403Webshell
Server IP : 104.21.14.103  /  Your IP : 18.216.66.30
Web Server : LiteSpeed
System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : giankuin ( 1871)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/proc/thread-self/root/proc/thread-self/root/home/giankuin/thietke365.net/wp-content/plugins/mailpoet/assets/dist/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/proc/thread-self/root/proc/thread-self/root/home/giankuin/thietke365.net/wp-content/plugins/mailpoet/assets/dist/js//newsletter_editor.js
/*! For license information please see newsletter_editor.js.LICENSE.txt */
(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[883],{92140:function(){(function(){var e,t;e=this.jQuery||window.jQuery,t=e(window),e.fn.stick_in_parent=function(o){var n,r,i,s,a,l,c,d,u,h,m,p,g;for(null==o&&(o={}),g=o.sticky_class,l=o.inner_scrolling,p=o.recalc_every,m=o.parent,u=o.offset_top,d=o.spacer,i=o.bottoming,null==u&&(u=0),null==m&&(m=void 0),null==l&&(l=!0),null==g&&(g="is_stuck"),n=e(document),null==i&&(i=!0),h=function(e){var t,o;return window.getComputedStyle?(e[0],t=window.getComputedStyle(e[0]),o=parseFloat(t.getPropertyValue("width"))+parseFloat(t.getPropertyValue("margin-left"))+parseFloat(t.getPropertyValue("margin-right")),"border-box"!==t.getPropertyValue("box-sizing")&&(o+=parseFloat(t.getPropertyValue("border-left-width"))+parseFloat(t.getPropertyValue("border-right-width"))+parseFloat(t.getPropertyValue("padding-left"))+parseFloat(t.getPropertyValue("padding-right"))),o):e.outerWidth(!0)},s=function(o,r,s,a,c,f,v,b){var y,w,_,x,C,k,S,T,E,O,A,M;if(!o.data("sticky_kit")){if(o.data("sticky_kit",!0),C=n.height(),S=o.parent(),null!=m&&(S=S.closest(m)),!S.length)throw"failed to find stick parent";return _=!1,y=!1,(A=null!=d?d&&o.closest(d):e("<div />"))&&A.css("position",o.css("position")),(T=function(){var e,t,i;if(!b)return C=n.height(),e=parseInt(S.css("border-top-width"),10),t=parseInt(S.css("padding-top"),10),r=parseInt(S.css("padding-bottom"),10),s=S.offset().top+e+t,a=S.height(),_&&(_=!1,y=!1,null==d&&(o.insertAfter(A),A.detach()),o.css({position:"",top:"",width:"",bottom:""}).removeClass(g),i=!0),c=o.offset().top-(parseInt(o.css("margin-top"),10)||0)-u,f=o.outerHeight(!0),v=o.css("float"),A&&A.css({width:h(o),height:f,display:o.css("display"),"vertical-align":o.css("vertical-align"),float:v}),i?M():void 0})(),x=void 0,k=u,O=p,M=function(){var e,h,m,w,E,M;if(!b)return m=!1,null!=O&&(O-=1)<=0&&(O=p,T(),m=!0),m||n.height()===C||(T(),m=!0),w=t.scrollTop(),null!=x&&(h=w-x),x=w,_?(i&&(E=w+f+k>a+s,y&&!E&&(y=!1,o.css({position:"fixed",bottom:"",top:k}).trigger("sticky_kit:unbottom"))),w<c&&(_=!1,k=u,null==d&&("left"!==v&&"right"!==v||o.insertAfter(A),A.detach()),e={position:"",width:"",top:""},o.css(e).removeClass(g).trigger("sticky_kit:unstick")),l&&(M=t.height(),f+u>M&&(y||(k-=h,k=Math.max(M-f,k),k=Math.min(u,k),_&&o.css({top:k+"px"}))))):w>c&&(_=!0,(e={position:"fixed",top:k}).width="border-box"===o.css("box-sizing")?o.outerWidth()+"px":o.width()+"px",o.css(e).addClass(g),null==d&&(o.after(A),"left"!==v&&"right"!==v||A.append(o)),o.trigger("sticky_kit:stick")),_&&i&&(null==E&&(E=w+f+k>a+s),!y&&E)?(y=!0,"static"===S.css("position")&&S.css({position:"relative"}),o.css({position:"absolute",bottom:r,top:"auto"}).trigger("sticky_kit:bottom")):void 0},E=function(){return T(),M()},w=function(){if(b=!0,t.off("touchmove",M),t.off("scroll",M),t.off("resize",E),e(document.body).off("sticky_kit:recalc",E),o.off("sticky_kit:detach",w),o.removeData("sticky_kit"),o.css({position:"",bottom:"",top:"",width:""}),S.position("position",""),_)return null==d&&("left"!==v&&"right"!==v||o.insertAfter(A),A.remove()),o.removeClass(g)},t.on("touchmove",M),t.on("scroll",M),t.on("resize",E),e(document.body).on("sticky_kit:recalc",E),o.on("sticky_kit:detach",w),setTimeout(M,0)}},a=0,c=this.length;a<c;a++)r=this[a],s(e(r));return this}}).call(this)},90858:(e,t,o)=>{"use strict";o(92140),o(40669);var n=o(97442),r=o(17816),i=o(7936),s=o(99581),a=o(4611),l=o(44137),c=o(35614),d=o(83201),u=o(96267),h=o(35250);n.Hooks.addAction("mailpoet_newsletters_editor_initialize","mailpoet",(e=>{const t=document.getElementById("mailpoet_editor"),o=e=>(document.location.search.split(`${e}=`)[1]||"").split("&")[0];t&&window.EditorApplication&&(r.x.Modal.loading(!0),r.x.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"get",data:{id:o("id")}}).always((()=>r.x.Modal.loading(!1))).always((()=>(0,u.Z)())).done((t=>{var n;const u=t.data;if("sending"===u.status&&u.queue&&null===u.queue.status){let e="yes"===o("pauseConfirmed");if(e||(e=window.confirm((0,i.__)("Sending is in progress. Do you want to pause sending and edit the newsletter?","mailpoet"))),!e)return void(window.location=`admin.php?page=mailpoet-newsletters#/${u.type}`);r.x.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"sending_queue",action:"pause",data:{newsletter_id:u.id}}).done((()=>r.x.Notice.system((0,i.__)("Email sending has been paused.","mailpoet")))).fail((e=>{e.errors.length>0&&r.x.Notice.error(e.errors.map((e=>e.message)),{scroll:!0,static:!0})}))}else if(l.qY.includes(u.type)&&"active"===u.status){let e="yes"===o("deactivationConfirmed");if(e||(e=window.confirm((0,i.__)("To edit this email, it needs to be deactivated. You can activate it again after you make the changes.","mailpoet"))),!e)return void(window.location=`admin.php?page=mailpoet-newsletters#/${u.type}`);r.x.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"setStatus",data:{id:u.id,status:"draft"}}).done((e=>{"draft"===e.data.status&&r.x.Notice.system((0,i.__)("This email was deactivated.","mailpoet"))})).fail((e=>{r.x.Notice.error(e.errors.map((e=>e.message)),{scroll:!0,static:!0})}))}Promise.resolve(((e,t)=>{if("automatic"!==t.type)return e;const o=e;return r.x.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"automatic_emails",action:"get_event_shortcodes",data:{email_slug:t.options.group,event_slug:t.options.event}}).then((e=>c.ZP.isObject(e)&&e.data?(o.shortcodes={...o.shortcodes,...e.data},o):o)).fail((e=>{e.errors.length>0&&r.x.Notice.error(e.errors.map((e=>e.message)),{scroll:!0,static:!0})}))})(e,u)).then((e=>{const t={...e.blockDefaults,container:{}};window.EditorApplication.start({newsletter:u,config:{...e,blockDefaults:t}})})).catch((()=>{window.EditorApplication.start({newsletter:u,config:e})})),((e,t)=>{if(!["wc_transactional","confirmation_email"].includes(e)){const o=document.getElementById("mailpoet_editor_steps_heading"),n=["automation","automation_transactional"].includes(e)?2:3;let i=null,l=()=>{window.location=`admin.php?page=${r.x.mainPageSlug}`};if(t.automationId){const e=`admin.php?page=mailpoet-automation-editor&id=${t.automationId}`;l=()=>{window.location=e};const o=()=>document.querySelector(".mailpoet_show_preview").click(),n=()=>document.querySelector(".mailpoet_save_go_to_automation").click();i=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("input",{type:"button",name:"preview",className:"button link-button",onClick:o,value:"Preview"})," ",(0,h.jsx)("input",{type:"button",className:"button button-primary",onClick:n,value:"Save and continue"})]})}const c=(0,h.jsx)(d.ErrorBoundary,{children:(0,h.jsx)(a.b,{emailType:e,step:n,buttons:i,onLogoClick:l})});s.render(c,o)}})("automatic"===u.type?null===(n=u.options)||void 0===n?void 0:n.group:u.type,u.options)})).fail((e=>{e.errors.length>0&&r.x.Notice.error(e.errors.map((e=>e.message)),{scroll:!0,static:!0})})))}));var m,p,g=o(99267),f=o.n(g),v=o(74506),b=o.n(v),y=o(65311),w=o.n(y);window._=c.ZP,m=b(),p=f().View.extend({el:"#mailpoet_editor",regions:{stylesRegion:"#mailpoet_editor_styles",contentRegion:"#mailpoet_editor_content",sidebarRegion:"#mailpoet_editor_sidebar",bottomRegion:"#mailpoet_editor_bottom",headingRegion:"#mailpoet_editor_heading",historyRegion:"#mailpoet_editor_history",topRegion:"#mailpoet_editor_top"},events:{click:"onClickOutsideContentHideSettings"},onClickOutsideContentHideSettings:function(e){w()(e.target).parents("#mailpoet_editor_content").length||window.EditorApplication.getChannel().trigger("hideSettings")}});const x=new(f().Application.extend({region:"#mailpoet_editor",onStart:function(){this._appView=new p,this.showView(this._appView),this.listenTo(this.getChannel(),"settingsDisplayed",this.setDisplayedSettingsId)},getChannel:function(e){return void 0===e?m.channel("global"):m.channel(e)},getDisplayedSettingsId:function(){return this.displayedSettingsId},setDisplayedSettingsId:function(e){this.displayedSettingsId=e}}));window.EditorApplication=x,Backbone.SuperModel=function(e,t){var o=function(t){for(var o=t.length-1;o>=0;o--){var n=t.slice(0,o),r=t.slice(o);if(1!=r.length){var i=this;(n=n.join(".")).length>0&&(i=this.get(n));for(var s=e.first(r),a=e.rest(r),l=[s],c=0;c<a.length;c++)s=[s,a[c]].join("."),l.push(s);for(var d=0;d<l.length;d++){var u=l[d],h=i.trigger;h&&e.isFunction(h)&&h.call(i,"change:"+u,i,i.get(u))}}}},n=function(t){return e.isString(t)&&(t=t.split(".")),t},r=function(e,t,o){for(var r=(t=n(t)).length-1,i=0;i<r;++i){var s=t[i];s in e||(e[s]={}),e=e[s]}o(e,t[r])},i=function(o,r,s){r=n(r);var a=e.first(r),l=o.get(a);l instanceof t.Model&&i(l,e.rest(r),s),s(o,r)},s=function(t,o,n){var r;return o&&(r=e.result(t,"relations")[o]),n&&!r&&(r=l),null==r&&(r=l),r},a=function(t,o,n){var r=e.result(t,"name");return r&&!o[r]&&(o[r]=t),o},l=t.Model.extend({relations:{},unsafeAttributes:[],name:null,_valueForCollection:function(t){return!!e.isArray(t)&&(!(t.length>=1)||e.isObject(t[0]))},_nestedSet:function(n,r,i){for(var d=(n=n.split(".")).length-1,u=this,h=0;h<d;++h){var m=n[h];if(!u.attributes[m]){var p=new(s(u,m,r));u.attributes[m]=a(u,p)}u=u.attributes[m]}var g=n[d];if(!e.isArray(r)&&e.isObject(r)&&function(e){return e.constructor===Object}(r))if(0===e.size(r))u.attributes[g]=new l;else for(var f in r){var v=g+"."+f;u._nestedSet(v,r[f],i)}else if(this._valueForCollection(r)){var b=s(u,g,r);b.prototype instanceof t.Model&&(b=c);var y=new b(r);y=a(u,y),u.attributes[g]=y}else 1==n.length?u.attributes[g]=r:u.set(g,r,e.extend({skipNested:!0,forceChange:!0},i));i.silent||o.call(this,n)},_setChanging:function(){this._previousAttributes=this.toJSON(),this.changed={}},_triggerChanges:function(e,t,o){e.length&&(this._pending=!0);for(var n=0,r=e.length;n<r;n++)o||(o=this.get(e[n])),1==e[n].split(".").length&&this.trigger("change:"+e[n],this,o,t)},_setChange:function(t,o,n){var i,s,a=this.get(t);return t=t.split("."),!e.isEqual(a,o)||n.forceChange?(i=this.changed,s=o,r(i,t,(function(e,t){e[t]=s})),!0):(function(e,t){r(e,t,(function(e,t){delete e[t]}))}(this.changed,t),!1)},set:function(e,t,o){var n,r,s,a,l,c,d;if(null==e)return this;if("object"==typeof e?(r=e,o=t):(r={})[e]=t,o=o||{},!this._validate(r,o))return!1;s=o.unset,l=o.silent,a=[],c=this._changing,d=o.skipNested,this._changing=!0,c||this._setChanging(),this.idAttribute in r&&(this.id=r[this.idAttribute]);var u=function(e,t){delete e.attributes[t]};for(n in r)t=r[n],this._setChange(n,t,o)&&a.push(n),s?i(this,n,u):d?this.attributes[n]=t:this._nestedSet(n,t,o);if(l||this._triggerChanges(a,o),c)return this;if(!l)for(;this._pending;)this._pending=!1,this.trigger("change",this,o);return this._pending=!1,this._changing=!1,this},get:function(t){var o=t?t.split("."):[];if(o.length>1){var n=this.attributes[e.first(o)];if(!n)return;var r=e.rest(o).join(".");return e.isFunction(n.get)?n.get(r):n[r]}return this.attributes[t]},toJSON:function(t){t=t||{};var o=e.result(this,"unsafeAttributes");t.except&&(o=e.union(o,t.except));var n=e.clone(this.attributes);return e.each(o,(function(e){delete n[e]})),e.each(n,(function(t,o){t&&e.isFunction(t.toJSON)&&(n[o]=t.toJSON())})),n},hasChanged:function(t){return null==t?!e.isEmpty(this.changed):(o=this.changed,n=!1,r(o,t,(function(t,o){n=e.has(t,o)})),n);var o,n},previous:function(e){return null!=e&&this._previousAttributes?function(e,t,o){for(var r=(t=n(t)).length,i=0;i<r;i++){if(!e||"object"!=typeof e)return o;e=e[t[i]]}return void 0===e?o:e}(this._previousAttributes,e):null},clear:function(e){for(var o in this.id=void 0,this.attributes){var n=this.attributes[o];n instanceof t.Model?n.clear():n instanceof t.Collection?n.reset():this.unset(o)}return this}}),c=t.Collection.extend({model:l});return l}(_,Backbone);const C=Backbone.SuperModel,k={};k.ConfigModel=C.extend({defaults:{availableStyles:{},socialIcons:{},blockDefaults:{},sidepanelWidth:"331px",validation:{},urls:{},availableDiscountTypes:{}}}),k.config={},k.getConfig=function(){return k.config},k.setConfig=function(e){return k.config=new k.ConfigModel(e,{parse:!0}),k.config},x.on("before:start",((e,t)=>{var o;const n=e,r=c.ZP.clone(t.config);n.getConfig=k.getConfig,n.setConfig=k.setConfig,r.blockDefaults=c.ZP.extend(r.blockDefaults,(null===(o=t.newsletter.body)||void 0===o?void 0:o.blockDefaults)||{}),n.setConfig(r)}));var S={};S.StylesModel=C.extend({defaults:{text:{fontColor:"#000000",fontFamily:"Arial",fontSize:"16px",lineHeight:"1.6"},h1:{fontColor:"#111111",fontFamily:"Arial",fontSize:"40px",lineHeight:"1.6"},h2:{fontColor:"#222222",fontFamily:"Tahoma",fontSize:"32px",lineHeight:"1.6"},h3:{fontColor:"#333333",fontFamily:"Verdana",fontSize:"24px",lineHeight:"1.6"},link:{fontColor:"#21759B",textDecoration:"underline"},wrapper:{backgroundColor:"#ffffff"},body:{backgroundColor:"#cccccc"}},initialize:function(e){this.set(w().extend(!0,{},this.defaults,e)),this.on("change",(function(){x.getChannel().trigger("autoSave")})),x.getChannel().on("historyUpdate",this.onHistoryUpdate,this)},onHistoryUpdate:function(e){this.set(e.globalStyles)}}),S.StylesView=f().View.extend({getTemplate:function(){return window.templates.styles},templateContext:function(){return{isWoocommerceTransactional:this.isWoocommerceTransactional}},modelEvents:{change:"render"},serializeData:function(){return this.model.toJSON()},initialize:function(e){this.isWoocommerceTransactional=e.isWoocommerceTransactional}}),S._globalStyles=new C,S.getGlobalStyles=function(){return S._globalStyles},S.setGlobalStyles=function(e){return S._globalStyles=new S.StylesModel(e),S._globalStyles},S.getAvailableStyles=function(){return x.getConfig().get("availableStyles")},x.on("before:start",(function(e,t){var o,n,r,i=e;i.getGlobalStyles=S.getGlobalStyles,i.setGlobalStyles=S.setGlobalStyles,i.getAvailableStyles=S.getAvailableStyles,o=t.newsletter.body,n=c.ZP.has(o,"globalStyles")?o.globalStyles:{},r=c.ZP.has(t.config,"overrideGlobalStyles")?t.config.overrideGlobalStyles:{},this.setGlobalStyles(w().extend(!0,{},n,r))})),x.on("start",(function(e){var t=new S.StylesView({model:e.getGlobalStyles(),isWoocommerceTransactional:x.getNewsletter().isWoocommerceTransactional()});e._appView.showChildView("stylesRegion",t)}));var T=o(45729),E=o.n(T),O=o(2226),A=o(70079);const M="brand",B="theme",P={selectedStyle:"brand",brand:{fontFamily:"SF Pro Text",fontWeight:"normal",background:"#ffffff",foreground:"#dfa8bb"},theme:{fontFamily:"SF Pro Text",fontWeight:"800",background:"#ffffff",foreground:"#ad86e9"}};function R(){const{brand:e,theme:t,selectedStyle:o}=P,[n,r]=(0,A.useState)(o),s=e=>()=>r(e);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)("h4",{children:[(0,i.__)("Choose a style","mailpoet")," ",(0,h.jsx)("i",{className:"mailpoet_info"})]}),(0,h.jsxs)("div",{id:"mailpoet_style_types",children:[(0,h.jsxs)("div",{className:"mailpoet_form_field mailpoet_form_style_type_brand",children:[(0,h.jsx)("input",{type:"radio",name:"style_type",id:"style_type_brand",value:M,checked:n===M,onChange:s(M)}),(0,h.jsxs)("label",{htmlFor:"style_type_brand",children:[(0,h.jsx)("h1",{className:"style_type_typography",style:{fontFamily:e.fontFamily,fontWeight:e.fontWeight},children:"Aa"}),(0,h.jsxs)("span",{className:"style_type_colors",children:[(0,h.jsx)("span",{style:{background:e.foreground}}),(0,h.jsx)("span",{style:{background:e.background}})]}),(0,h.jsx)("i",{className:"mailpoet_checkmark radio_checkmark"})]})]}),(0,h.jsxs)("div",{className:"mailpoet_form_field mailpoet_form_style_type_theme",children:[(0,h.jsx)("input",{type:"radio",name:"style_type",id:"style_type_theme",value:B,checked:n===B,onChange:s(B)}),(0,h.jsxs)("label",{htmlFor:"style_type_theme",children:[(0,h.jsx)("h1",{className:"style_type_typography",style:{fontFamily:t.fontFamily,fontWeight:t.fontWeight},children:"Aa"}),(0,h.jsxs)("span",{className:"style_type_colors",children:[(0,h.jsx)("span",{style:{background:t.foreground}}),(0,h.jsx)("span",{style:{background:t.background}})]}),(0,h.jsx)("i",{className:"mailpoet_checkmark radio_checkmark"})]})]})]})]})}const V=(e,t)=>{const o=t.offset(),n=t.height(),r=t.width();return!(e.pageX<o.left||e.pageX>o.left+r||e.pageY<o.top||e.pageY>o.top+n)},N={};N._contentWidgets=new(E().Collection.extend({model:C.extend({defaults:{name:"",priority:100,widgetView:void 0}}),comparator:"priority"})),N.registerWidget=e=>{const t=x.getConfig().get("hiddenWidgets");return(!t||!t.includes(e.name))&&N._contentWidgets.add(e)},N.getWidgets=function(){return N._contentWidgets},N._layoutWidgets=new(E().Collection.extend({model:C.extend({defaults:{name:"",priority:100,widgetView:void 0}}),comparator:"priority"})),N.registerLayoutWidget=function(e){return N._layoutWidgets.add(e)},N.getLayoutWidgets=function(){return N._layoutWidgets};const D=f().View.extend({getTemplate:()=>window.templates.sidebar,regions:{contentRegion:".mailpoet_content_region",layoutRegion:".mailpoet_layout_region",stylesRegion:".mailpoet_styles_region",previewRegion:".mailpoet_preview_region"},events:{"click .mailpoet_sidebar_region h3, .mailpoet_sidebar_region .handlediv":function(e){const t=this.$el.find(".mailpoet_sidebar_region:not(.closed)"),o=this.$el.find(e.target).closest(".mailpoet_sidebar_region");t.find(".mailpoet_region_content").velocity("slideUp",{duration:250,easing:"easeOut",complete:()=>{t.addClass("closed")}}),t.get(0)!==o.get(0)&&o.find(".mailpoet_region_content").velocity("slideDown",{duration:250,easing:"easeIn",complete:()=>{o.removeClass("closed")}})}},templateContext(){return{isWoocommerceTransactional:this.model.isWoocommerceTransactional()}},initialize(){w()(window).on("resize",this.updateHorizontalScroll.bind(this)).on("scroll",this.updateHorizontalScroll.bind(this))},onRender(){this.showChildView("contentRegion",new N.SidebarWidgetsView(x.getWidgets())),this.showChildView("layoutRegion",new N.SidebarLayoutWidgetsView(x.getLayoutWidgets())),this.showChildView("stylesRegion",new N.SidebarStylesView({model:x.getGlobalStyles(),availableStyles:x.getAvailableStyles(),isWoocommerceTransactional:this.model.isWoocommerceTransactional()}))},updateHorizontalScroll(){this.$el.parent().each((function(){const e=w()(this);if("fixed"===e.css("position")){const t=e.parent().offset().left-w()(window).scrollLeft();e.css("left",`${t}px`)}else e.css("left","")}))},onDomRefresh(){this.$el.parent().stick_in_parent({offset_top:32}),this.$el.parent().on("sticky_kit:stick",this.updateHorizontalScroll.bind(this)),this.$el.parent().on("sticky_kit:unstick",this.updateHorizontalScroll.bind(this)),this.$el.parent().on("sticky_kit:bottom",this.updateHorizontalScroll.bind(this)),this.$el.parent().on("sticky_kit:unbottom",this.updateHorizontalScroll.bind(this))}});N.SidebarWidgetsCollectionView=f().CollectionView.extend({childView:e=>e.get("widgetView")}),N.SidebarWidgetsView=f().View.extend({getTemplate:()=>window.templates.sidebarContent,regions:{widgets:".mailpoet_region_content"},initialize(e){this.widgets=e},onRender(){this.showChildView("widgets",new N.SidebarWidgetsCollectionView({collection:this.widgets}))}}),N.SidebarLayoutWidgetsView=N.SidebarWidgetsView.extend({getTemplate:()=>window.templates.sidebarLayout}),N.SidebarStylesView=f().View.extend({brandStylesRoot:null,getTemplate:()=>window.templates.sidebarStyles,behaviors:{ColorPickerBehavior:{},WooCommerceStylesBehavior:{}},events(){return{"change #mailpoet_text_font_color":c.ZP.partial(this.changeColorField,"text.fontColor"),"change #mailpoet_text_font_family":function(e){this.model.set("text.fontFamily",e.target.value)},"change #mailpoet_text_font_size":function(e){this.model.set("text.fontSize",e.target.value)},"change #mailpoet_h1_font_color":c.ZP.partial(this.changeColorField,"h1.fontColor"),"change #mailpoet_h1_font_family":function(e){this.model.set("h1.fontFamily",e.target.value)},"change #mailpoet_h1_font_size":function(e){this.model.set("h1.fontSize",e.target.value)},"change #mailpoet_h2_font_color":c.ZP.partial(this.changeColorField,"h2.fontColor"),"change #mailpoet_h2_font_family":function(e){this.model.set("h2.fontFamily",e.target.value)},"change #mailpoet_h2_font_size":function(e){this.model.set("h2.fontSize",e.target.value)},"change #mailpoet_h3_font_color":c.ZP.partial(this.changeColorField,"h3.fontColor"),"change #mailpoet_h3_font_family":function(e){this.model.set("h3.fontFamily",e.target.value)},"change #mailpoet_h3_font_size":function(e){this.model.set("h3.fontSize",e.target.value)},"change #mailpoet_a_font_color":c.ZP.partial(this.changeColorField,"link.fontColor"),"change #mailpoet_a_font_underline":function(e){this.model.set("link.textDecoration",e.target.checked?e.target.value:"none")},"change #mailpoet_text_line_height":function(e){this.model.set("text.lineHeight",e.target.value)},"change #mailpoet_heading_line_height":function(e){this.model.set("h1.lineHeight",e.target.value),this.model.set("h2.lineHeight",e.target.value),this.model.set("h3.lineHeight",e.target.value)},"change #mailpoet_newsletter_background_color":c.ZP.partial(this.changeColorField,"wrapper.backgroundColor"),"change #mailpoet_background_color":c.ZP.partial(this.changeColorField,"body.backgroundColor")}},templateContext(){return{model:this.model.toJSON(),availableStyles:this.availableStyles.toJSON(),isWoocommerceTransactional:this.isWoocommerceTransactional}},initialize(e){this.availableStyles=e.availableStyles,this.isWoocommerceTransactional=e.isWoocommerceTransactional,x.getChannel().on("historyUpdate",this.render)},changeField(e,t){this.model.set(e,w()(t.target).val())},changeColorField(e,t){const o=w()(t.target).val()||"transparent";this.model.set(e,o)},onRender(){const e=this.$el.find("#mailpoet_brand_styles")[0],t=r.x.FeaturesController.isSupported(r.x.FeaturesController.FEATURE_BRAND_TEMPLATES);e&&t&&(window.mailpoet_brand_styles||{}).available&&(this.brandStylesRoot=(0,O.s)(e),this.brandStylesRoot.render((0,h.jsx)(R,{})))},onDestroy(){this.brandStylesRoot&&this.brandStylesRoot.unmount()}}),x.on("before:start",(e=>{const t=e;t.registerWidget=N.registerWidget,t.getWidgets=N.getWidgets,t.registerLayoutWidget=N.registerLayoutWidget,t.getLayoutWidgets=N.getLayoutWidgets})),x.on("start",(e=>{const t=new D({model:e.getNewsletter()});e._appView.showChildView("sidebarRegion",t)}));var F=o(67912),I={};I.NewsletterModel=C.extend({whitelisted:["id","subject","preheader","type"],initialize:function(){this.on("change",(function(){x.getChannel().trigger("autoSave")}))},toJSON:function(){return c.ZP.pick(C.prototype.toJSON.call(this),this.whitelisted)},isWoocommerceTransactional:function(){return"wc_transactional"===this.get("type")},isAutomationEmail:function(){return["automation","automation_transactional"].includes(this.get("type"))},isConfirmationEmailTemplate:function(){return"confirmation_email"===this.get("type")},isStandardEmail:function(){return this.get("type")===F.j9.Standard}}),I._blockTypes={},I.registerBlockType=function(e,t){I._blockTypes[e]=t},I.getBlockTypeModel=function(e){return e in I._blockTypes?I._blockTypes[e].blockModel:I._blockTypes.unknownBlockFallback.blockModel},I.getBlockTypeView=function(e){return e in I._blockTypes?I._blockTypes[e].blockView:I._blockTypes.unknownBlockFallback.blockView},I.getBody=function(){return{content:x._contentContainer.toJSON(),globalStyles:x.getGlobalStyles().toJSON(),blockDefaults:c.ZP.omit(x.getConfig().toJSON().blockDefaults,"text","image")}},I.toJSON=function(){return c.ZP.extend({body:I.getBody()},x.getNewsletter().toJSON())},I.getNewsletter=function(){return I.newsletter},I.findModels=function(e){var t=x._contentContainer.getChildren();return c.ZP.filter(t,e)},I.renderContent=function(e){x._contentContainer&&x._contentContainer.destroy(),x._contentContainerView&&x._contentContainerView.destroy(),x._contentContainer=new(x.getBlockTypeModel("container"))(e,{parse:!0}),x._contentContainerView=new(x.getBlockTypeView("container"))({model:x._contentContainer,renderOptions:{depth:0}}),x._appView.showChildView("contentRegion",x._contentContainerView)},x.on("before:start",(function(e,t){var o=e;o.registerBlockType=I.registerBlockType,o.getBlockTypeModel=I.getBlockTypeModel,o.getBlockTypeView=I.getBlockTypeView,o.toJSON=I.toJSON,o.getBody=I.getBody,o.getNewsletter=I.getNewsletter,o.findModels=I.findModels,I.newsletter=new I.NewsletterModel(c.ZP.omit(c.ZP.clone(t.newsletter),["body"]))})),x.on("start",(function(e,t){var o=e,n=t.newsletter.body,s=c.ZP.has(n,"content")?n.content:{};c.ZP.has(t.newsletter,"body")&&c.ZP.isObject(t.newsletter.body)||r.x.Notice.error((0,i.__)("Contents of this newsletter are corrupted and may be lost, you may need to add new content to this newsletter, or create a new one. If possible, please contact us and report this issue.","mailpoet"),{static:!0}),I.renderContent(s),o.getChannel().on("historyUpdate",(function(e){I.renderContent(e.content)}),this)}));var L={};L.HeadingView=f().View.extend({getTemplate:function(){return window.templates.heading},templateContext:function(){return{model:this.model.toJSON(),isWoocommerceTransactional:this.model.isWoocommerceTransactional(),isAutomationEmail:this.model.isAutomationEmail(),isConfirmationEmailTemplate:this.model.isConfirmationEmailTemplate()}},events:function(){return{"change .mailpoet_input_title":c.ZP.partial(this.changeField,"subject"),"change .mailpoet_input_preheader":c.ZP.partial(this.changeField,"preheader"),"change #mailpoet_heading_email_type":e=>{x.getChannel().trigger("changeWCEmailType",e.target.value)}}},changeField:function(e,t){this.model.set(e,w()(t.target).val())}}),x.on("start",(function(e){var t=e.getNewsletter();e._appView.showChildView("headingRegion",new L.HeadingView({model:t}));const o=document.getElementById("tooltip-designer-subject-line"),n=document.getElementById("tooltip-designer-preheader");t.isWoocommerceTransactional()||t.isAutomationEmail()||(o&&r.x.helpTooltip.show(o,{tooltipId:"tooltip-designer-subject-line-ti",tooltip:(0,i.__)("You can add MailPoet shortcodes here. For example, you can add your subscribers' first names by using this shortcode: [subscriber:firstname | default:reader]. Simply copy and paste the shortcode into the field.","mailpoet"),place:"right"}),n&&r.x.helpTooltip.show(n,{tooltipId:"tooltip-designer-preheader-ti",tooltip:(0,i.__)("This optional text will appear in your subscribers' inboxes, beside the subject line. Write something enticing!","mailpoet")+" "+(0,i.__)("Max length is 250 characters, however, we recommend 80 characters.","mailpoet")}))}));var z=o(47317),H=o.n(z),Z={};Z.HistoryView=f().View.extend({MAX_HISTORY_STATES:25,elements:{redo:null,undo:null},events:{"click #mailpoet-history-arrow-undo":"undo","click #mailpoet-history-arrow-redo":"redo"},model:{statesStack:[],currentStateIndex:0},getTemplate:function(){return window.templates.history},initialize:function(){var e=this;x.getChannel().on("afterEditorSave",this.addState,this),H().bind(["ctrl+z","command+z"],(function(){e.undo()})),H().bind(["shift+ctrl+z","shift+command+z"],(function(){e.redo()}))},onAttach:function(){this.elements.redo=document.getElementById("mailpoet-history-arrow-redo"),this.elements.undo=document.getElementById("mailpoet-history-arrow-undo"),this.addState(x.toJSON())},addState:function(e){var t;e&&e.body&&(t=JSON.stringify(e.body),this.model.statesStack[this.model.currentStateIndex]!==t&&(this.model.currentStateIndex>0&&this.model.statesStack.splice(0,this.model.currentStateIndex),this.model.statesStack.unshift(t),this.model.currentStateIndex=0,this.model.statesStack.length=Math.min(this.model.statesStack.length,this.MAX_HISTORY_STATES),this.updateArrowsUI()))},canUndo:function(){return this.model.currentStateIndex<this.model.statesStack.length-1},canRedo:function(){return this.model.currentStateIndex>0},undo:function(){this.canUndo()&&(this.model.currentStateIndex=Math.min(this.model.statesStack.length-1,this.model.currentStateIndex+1),this.updateArrowsUI(),this.applyState(this.model.currentStateIndex))},redo:function(){this.canRedo()&&(this.model.currentStateIndex=Math.max(0,this.model.currentStateIndex-1),this.updateArrowsUI(),this.applyState(this.model.currentStateIndex))},updateArrowsUI:function(){this.elements.undo.classList.toggle("mailpoet_history_arrow_inactive",!this.canUndo()),this.elements.redo.classList.toggle("mailpoet_history_arrow_inactive",!this.canRedo()),this.elements.undo.setAttribute("title",this.canUndo()?(0,i._x)("Undo","A button title when user can undo the change in editor","mailpoet"):(0,i._x)("No actions available to undo.","A button title when user can't undo the change in editor","mailpoet")),this.elements.redo.setAttribute("title",this.canRedo()?(0,i._x)("Redo","A button title when user can redo the change in editor","mailpoet"):(0,i._x)("No actions available to redo.","A button title when user can't redo the change in editor","mailpoet"))},applyState:function(e){const t=JSON.parse(this.model.statesStack[e]);x.getChannel().trigger("historyUpdate",t)}}),x.on("start",(function(e){e._appView.showChildView("historyRegion",new Z.HistoryView)})),o(89483);var j={_query:function(e){return r.x.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"automatedLatestContent",action:e.action,data:e.options||{}})}};j._cachedQuery=c.ZP.memoize(j._query,JSON.stringify),j.getNewsletter=function(e){return j._query({action:"get",options:e})},j.getPostTypes=function(){return j._cachedQuery({action:"getPostTypes",options:{}}).then((function(e){return c.ZP.values(e.data)}))},j.getTaxonomies=function(e){return j._cachedQuery({action:"getTaxonomies",options:{postType:e}}).then((function(e){return e.data}))},j.getTerms=function(e){return j._cachedQuery({action:"getTerms",options:e}).then((function(e){return e.data}))},j.getPosts=function(e){return j._cachedQuery({action:"getPosts",options:e}).then((function(e){return e.data}))},j.getTransformedPosts=function(e){return j._cachedQuery({action:"getTransformedPosts",options:e}).then((function(e){return e.data}))},j.getBulkTransformedPosts=function(e){return j._query({action:"getBulkTransformedPosts",options:e}).then((function(e){return e.data}))},j.saveNewsletter=function(e){return r.x.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"save",data:e||{}})},j.previewNewsletter=function(e){return r.x.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"sendPreview",data:e||{}})},x.on("start",(function(){j.getPostTypes()})),function(e){if(e.URL=e.URL||e.webkitURL,e.Blob&&e.URL)try{return void new Blob}catch(e){}var t=e.BlobBuilder||e.WebKitBlobBuilder||e.MozBlobBuilder||function(e){var t=function(e){return Object.prototype.toString.call(e).match(/^\[object\s(.*)\]$/)[1]},o=function(){this.data=[]},n=function(e,t,o){this.data=e,this.size=e.length,this.type=t,this.encoding=o},r=o.prototype,i=n.prototype,s=e.FileReaderSync,a=function(e){this.code=this[this.name=e]},l="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),c=l.length,d=e.URL||e.webkitURL||e,u=d.createObjectURL,h=d.revokeObjectURL,m=d,p=e.btoa,g=e.atob,f=e.ArrayBuffer,v=e.Uint8Array,b=/^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;for(n.fake=i.fake=!0;c--;)a.prototype[l[c]]=c+1;return d.createObjectURL||(m=e.URL=function(e){var t,o=document.createElementNS("http://www.w3.org/1999/xhtml","a");return o.href=e,"origin"in o||("data:"===o.protocol.toLowerCase()?o.origin=null:(t=e.match(b),o.origin=t&&t[1])),o}),m.createObjectURL=function(e){var t,o=e.type;return null===o&&(o="application/octet-stream"),e instanceof n?(t="data:"+o,"base64"===e.encoding?t+";base64,"+e.data:"URI"===e.encoding?t+","+decodeURIComponent(e.data):p?t+";base64,"+p(e.data):t+","+encodeURIComponent(e.data)):u?u.call(d,e):void 0},m.revokeObjectURL=function(e){"data:"!==e.substring(0,5)&&h&&h.call(d,e)},r.append=function(e){var o=this.data;if(v&&(e instanceof f||e instanceof v)){for(var r="",i=new v(e),l=0,c=i.length;l<c;l++)r+=String.fromCharCode(i[l]);o.push(r)}else if("Blob"===t(e)||"File"===t(e)){if(!s)throw new a("NOT_READABLE_ERR");var d=new s;o.push(d.readAsBinaryString(e))}else e instanceof n?"base64"===e.encoding&&g?o.push(g(e.data)):"URI"===e.encoding?o.push(decodeURIComponent(e.data)):"raw"===e.encoding&&o.push(e.data):("string"!=typeof e&&(e+=""),o.push(unescape(encodeURIComponent(e))))},r.getBlob=function(e){return arguments.length||(e=null),new n(this.data.join(""),e,"raw")},r.toString=function(){return"[object BlobBuilder]"},i.slice=function(e,t,o){var r=arguments.length;return r<3&&(o=null),new n(this.data.slice(e,r>1?t:this.data.length),o,this.encoding)},i.toString=function(){return"[object Blob]"},i.close=function(){this.size=0,delete this.data},o}(e);e.Blob=function(e,o){var n=o&&o.type||"",r=new t;if(e)for(var i=0,s=e.length;i<s;i++)Uint8Array&&e[i]instanceof Uint8Array?r.append(e[i].buffer):r.append(e[i]);var a=r.getBlob(n);return!a.slice&&a.webkitSlice&&(a.slice=a.webkitSlice),a};var o=Object.getPrototypeOf||function(e){return e.__proto__};e.Blob.prototype=o(new e.Blob)}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||(void 0).content||void 0);const U=window.Blob;var $,W,q=o(55091),G=o.n(q),Y={isConfirmationEmailValid:function(){var e=x.toJSON(),t=e&&e.body&&e.body.content?JSON.stringify(e.body.content):"";return!(x.getConfig().get("validation.validateActivationLinkIsPresent")&&t.indexOf("[activation_link]")<0&&(w()(".mailpoet_save_error").html((0,i.__)("Don't forget to include the [activation_link] shortcode in the email","mailpoet")).removeClass("mailpoet_hidden"),w()(".mailpoet_save_button").attr("disabled","disabled").addClass("button-disabled"),w()(".mailpoet_editor_last_saved .mailpoet_autosaved_message").addClass("mailpoet_hidden"),1))},save:function(){var e,t,o=x.toJSON(),n=w()("#mailpoet_editor_top"),s=w().Deferred();c.ZP.isUndefined(o.body)||(o.body.blockDefaults&&(delete o.body.blockDefaults.woocommerceHeading,delete o.body.blockDefaults.woocommerceContent,o.body.blockDefaults&&o.body.blockDefaults.coupon&&(null===(e=o.body.blockDefaults.coupon)||void 0===e||delete e.couponId,null===(t=o.body.blockDefaults.coupon)||void 0===t||delete t.code)),o.body=JSON.stringify(o.body));return Y.isConfirmationEmailValid()?(x.getChannel().trigger("beforeEditorSave",o),j.saveNewsletter(o).done((function(e){void 0!==e.success&&!0===e.success||void 0!==e.error&&(0===e.error.length?r.x.Notice.error((0,i.__)("Template has not been saved, please try again","mailpoet"),{positionAfter:n,scroll:!0}):w()(e.error).each((function(e,t){r.x.Notice.error(t,{positionAfter:n,scroll:!0})}))),c.ZP.isUndefined(o.body)||(o.body=JSON.parse(o.body)),x.getChannel().trigger("afterEditorSave",o,e)})).fail((function(e){x.getChannel().trigger("editorSaveFailed",{},e)}))):s.resolve()},saveTemplate:function(e){return(0,d.fromNewsletter)(x.toJSON()).then((function(t){var o=c.ZP.extend(e||{},{thumbnail_data:t,body:JSON.stringify(x.getBody()),categories:JSON.stringify(["saved",x.getNewsletter().get("type")])});return r.x.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletterTemplates",action:"save",data:o})}))},exportTemplate:function(e){return(0,d.fromNewsletter)(x.toJSON()).then((function(t){var o=c.ZP.extend(e||{},{thumbnail_data:t,body:x.getBody(),categories:JSON.stringify(["saved",x.getNewsletter().get("type")])}),n=new U([JSON.stringify(o)],{type:"application/json;charset=utf-8"});G().saveAs(n,"template.json"),r.x.trackEvent("Editor > Template exported")}))}};Y.SaveView=f().View.extend({getTemplate:function(){return window.templates.save},templateContext:function(){return{wrapperClass:this.wrapperClass,isWoocommerceTransactional:this.model.isWoocommerceTransactional(),isAutomationEmail:this.model.isAutomationEmail(),woocommerceCustomizerEnabled:x.getConfig().get("woocommerceCustomizerEnabled"),isConfirmationEmailTemplate:this.model.isConfirmationEmailTemplate(),confirmationEmailCustomizerEnabled:x.getConfig().get("confirmationEmailCustomizerEnabled")}},events:{"click .mailpoet_save_button":"save","click .mailpoet_save_show_options":"toggleSaveOptions","click .mailpoet_save_next":"next","click .mailpoet_save_template":"showSaveAsTemplate","click .mailpoet_save_as_template":"saveAsTemplate","click .mailpoet_save_export":"showExportTemplate","click .mailpoet_export_template":"exportTemplate","click .mailpoet_save_activate_wc_customizer_button":"activateWooCommerceCustomizer","click .mailpoet_save_activate_confirmation_email_customizer_button":"activateConfirmationEmailCustomizer","click .mailpoet_save_go_to_automation":"saveAndGoToAutomation","click .mailpoet_show_preview":"showPreview"},initialize:function(){this.setDropdownDirectionDown(),x.getChannel().on("beforeEditorSave",this.beforeSave,this),x.getChannel().on("afterEditorSave",this.afterSave,this),x.getChannel().on("editorSaveFailed",this.handleSavingErrors,this)},setDropdownDirectionDown:function(){this.wrapperClass="mailpoet_save_dropdown_down"},setDropdownDirectionUp:function(){this.wrapperClass="mailpoet_save_dropdown_up"},onRender:function(){this.validateNewsletter(x.toJSON())},save:function(){this.model.isConfirmationEmailTemplate()&&this.$(".mailpoet_save_button").hasClass("button-disabled")||(this.hideSaveOptions(),x.getChannel().request("save"))},beforeSave:function(){this.$(".mailpoet_autosaved_at").text((0,i.__)("Saving...","mailpoet"))},afterSave:function(e){this.validateNewsletter(e),this.$(".mailpoet_editor_last_saved .mailpoet_autosaved_message").removeClass("mailpoet_hidden"),this.$(".mailpoet_autosaved_at").text("")},handleSavingErrors:function(){this.showError((0,i.__)("The email could not be saved. Please, clear browser cache and reload the page. If the problem persists, duplicate the email and try again.","mailpoet"))},showSaveOptions:function(){this.$(".mailpoet_save_show_options").addClass("mailpoet_save_show_options_active"),this.$(".mailpoet_save_options").removeClass("mailpoet_hidden"),this.hideSaveAsTemplate(),this.hideExportTemplate()},hideSaveOptions:function(){this.$(".mailpoet_save_show_options").removeClass("mailpoet_save_show_options_active"),this.$(".mailpoet_save_options").addClass("mailpoet_hidden"),this.hideSaveAsTemplate(),this.hideExportTemplate()},toggleSaveOptions:function(){this.$(".mailpoet_save_show_options").hasClass("mailpoet_save_show_options_active")?this.hideSaveOptions():this.showSaveOptions()},showSaveAsTemplate:function(){this.$(".mailpoet_save_as_template_container").removeClass("mailpoet_hidden")},hideSaveAsTemplate:function(){this.$(".mailpoet_save_as_template_container").addClass("mailpoet_hidden")},saveAsTemplate:function(){var e=this.$(".mailpoet_save_as_template_name").val(),t=w()("#mailpoet_editor_top");""===e?r.x.Notice.error((0,i.__)("Please add a template name","mailpoet"),{positionAfter:t,scroll:!0}):(Y.saveTemplate({name:e}).then((function(){r.x.Notice.success((0,i.__)("Template has been saved.","mailpoet"),{positionAfter:t,scroll:!0}),r.x.trackEvent("Editor > Template saved")})).catch((function(){r.x.Notice.error((0,i.__)("Template has not been saved, please try again","mailpoet"),{positionAfter:t,scroll:!0})})),this.hideSaveOptions())},showExportTemplate:function(){this.$(".mailpoet_export_template_container").removeClass("mailpoet_hidden")},hideExportTemplate:function(){this.$(".mailpoet_export_template_container").addClass("mailpoet_hidden")},exportTemplate:function(){var e=this.$(".mailpoet_export_template_name").val(),t=w()("#mailpoet_editor_top");""===e?r.x.Notice.error((0,i.__)("Please add a template name","mailpoet"),{positionAfter:t,scroll:!0}):(Y.exportTemplate({name:e}),this.hideExportTemplate())},showPreview:function(){var e=x.toJSON();c.ZP.isUndefined(e.body)||(e.body=JSON.stringify(e.body)),r.x.Modal.loading(!0),r.x.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"showPreview",data:e}).always((function(){r.x.Modal.loading(!1)})).done(function(e){this.previewView=new Y.NewsletterPreviewView({model:new Y.NewsletterPreviewModel,previewType:window.localStorage.getItem(x.getConfig().get("newsletterPreview.previewTypeLocalStorageKey")),previewUrl:e.meta.preview_url}),this.previewView.render(),r.x.Modal.popup({template:"",element:this.previewView.$el,minWidth:"95%",height:"100%",title:(0,i.__)("Newsletter Preview","mailpoet"),onCancel:function(){this.previewView.destroy(),this.previewView=null}.bind(this)}),r.x.trackEvent("Editor > Browser Preview")}.bind(this)).fail((function(e){e.errors.length>0&&r.x.Notice.error(e.errors.map((function(e){return e.message})),{scroll:!0})}))},next:function(){this.hideSaveOptions(),this.$(".mailpoet_save_next").hasClass("button-disabled")||(Y._cancelAutosave(),Y.save().done((function(){window.location.href=x.getConfig().get("urls.send")})))},saveAndGoToAutomation:function(){this.hideSaveOptions(),Y._cancelAutosave(),Y.save().done((function(){const e=`admin.php?page=mailpoet-automation-editor&id=${x.getNewsletter().get("options").get("automationId")}`;window.location.href=e}))},validateNewsletter:function(e){var t,o="",n=x.getNewsletter();x._contentContainer.isValid()?e&&e.body&&e.body.content?(t=e.body.content,o=JSON.stringify(e.body.content),t.blocks&&Array.isArray(t.blocks)&&0!==t.blocks.length?x.getConfig().get("validation.validateUnsubscribeLinkPresent")&&o.indexOf("[link:subscription_unsubscribe_url]")<0&&o.indexOf("[link:subscription_unsubscribe]")<0&&"sent"!==n.get("status")?this.showValidationError((0,i.__)('All emails must include an "Unsubscribe" link. Add a footer widget to your email to continue.',"mailpoet")):x.getConfig().get("validation.validateActivationLinkIsPresent")&&o.indexOf("[activation_link]")<0?this.showValidationError((0,i.__)("Don't forget to include the [activation_link] shortcode in the email","mailpoet")):"re_engagement"===n.get("type")&&o.indexOf("[link:subscription_re_engage_url]")<0?this.showValidationError((0,i.__)("A re-engagement email must include a link with [link:subscription_re_engage_url] shortcode.","mailpoet")):"notification"===n.get("type")&&o.indexOf('"type":"automatedLatestContent"')<0&&o.indexOf('"type":"automatedLatestContentLayout"')<0?this.showValidationError((0,i._x)("Please add an “Automatic Latest Content” widget to the email from the right sidebar.","(Please reuse the current translation used for the string “Automatic Latest Content”) This Error message is displayed when a user tries to send a “Post Notification” email without any “Automatic Latest Content” widget inside","mailpoet")):"standard"!==n.get("type")||"sent"!==n.get("status")?this.hideValidationError():this.showValidationError((0,i.__)("This email has already been sent. It can be edited, but not sent again. Duplicate this email if you want to send it again.","mailpoet")):this.showValidationError((0,i.__)("Poet, please add prose to your masterpiece before you send it to your followers.","mailpoet"))):this.handleSavingErrors():this.showValidationError(x._contentContainer.validationError)},showError:function(e){var t=this.$(".mailpoet_save_error");t.html(e.replace(/\. /g,".<br>")),t.removeClass("mailpoet_hidden")},hideError:function(){this.$(".mailpoet_save_error").addClass("mailpoet_hidden")},showValidationError:function(e){this.showError(e),this.$(".mailpoet_save_next").addClass("button-disabled"),this.model.isConfirmationEmailTemplate()&&this.$(".mailpoet_save_button").attr("disabled","disabled").addClass("button-disabled")},hideValidationError:function(){this.hideError(),this.$(".mailpoet_save_next").removeClass("button-disabled"),this.model.isConfirmationEmailTemplate()&&this.$(".mailpoet_save_button").removeAttr("disabled").removeClass("button-disabled")},activateWooCommerceCustomizer:function(){var e=w()(".mailpoet_save_woocommerce_customizer_disabled");return r.x.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"settings",action:"set",data:{"woocommerce.use_mailpoet_editor":1}}).done((function(){e.addClass("mailpoet_hidden"),r.x.trackEvent("Editor > WooCommerce email customizer enabled")})).fail((function(e){r.x.Notice.showApiErrorNotice(e,{scroll:!0})}))},activateConfirmationEmailCustomizer:function(){var e=w()(".mailpoet_save_confirmation_email_disabled");return r.x.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"settings",action:"set",data:{"signup_confirmation.use_mailpoet_editor":1}}).done((function(){e.addClass("mailpoet_hidden"),r.x.trackEvent("Editor > Confirmation email customizer enabled")})).fail((function(e){r.x.Notice.showApiErrorNotice(e,{scroll:!0})}))}}),Y.autoSave=function(){Y._cancelAutosave(),$=setTimeout((function(){if(W)return W=!1,void Y._cancelAutosave();Y.isConfirmationEmailValid()?x.getChannel().request("save").always((function(){Y._cancelAutosave()})):Y._cancelAutosave()}),1e3)},Y._cancelAutosave=function(){$&&(clearTimeout($),$=void 0)},Y.onHistoryUpdate=function(){W=!0},Y.beforeExitWithUnsavedChanges=function(e){var t,o;if($)return t=(0,i.__)("There are unsaved changes which will be lost if you leave this page.","mailpoet"),(o=e||window.event)&&(o.returnValue=t),t},Y.NewsletterPreviewModel=C.extend({defaults:{previewSendingError:!1,previewSendingSuccess:!1,sendingPreview:!1,mssPendingApproval:window.mailpoet_mss_key_pending_approval,mssKeyPendingApprovalRefreshMessage:!0,awaitingKeyCheck:!1}}),Y.NewsletterPreviewView=f().View.extend({className:"mailpoet_browser_preview_wrapper",getTemplate:function(){return window.templates.newsletterPreview},modelEvents:{change:"render"},events:function(){return{"change .mailpoet_browser_preview_type":"changeBrowserPreviewType","click #mailpoet_send_preview":"sendPreview","click #refresh-mss-key-status":"refreshMssKeyStatus"}},initialize:function(e){this.previewType=e.previewType||"mobile",this.previewUrl=e.previewUrl,this.width="100%",this.height="100%"},templateContext:function(){return{previewType:this.previewType,previewUrl:this.previewUrl,width:this.width,height:this.height,email:this.$("#mailpoet_preview_to_email").val()||window.currentUserEmail,previewSendingError:this.model.get("previewSendingError"),sendingPreview:this.model.get("sendingPreview"),mssKeyPendingApproval:this.model.get("mssPendingApproval"),mssKeyPendingApprovalRefreshMessage:this.model.get("mssKeyPendingApprovalRefreshMessage"),awaitingKeyCheck:this.model.get("awaitingKeyCheck")}},changeBrowserPreviewType:function(e){var t=w()(e.target).val();"mobile"===t?(this.$(".mailpoet_browser_preview_container").addClass("mailpoet_browser_preview_container_mobile"),this.$(".mailpoet_browser_preview_container").removeClass("mailpoet_browser_preview_container_desktop"),this.$(".mailpoet_browser_preview_container").removeClass("mailpoet_browser_preview_container_send_to_email")):"desktop"===t?(this.$(".mailpoet_browser_preview_container").addClass("mailpoet_browser_preview_container_desktop"),this.$(".mailpoet_browser_preview_container").removeClass("mailpoet_browser_preview_container_mobile"),this.$(".mailpoet_browser_preview_container").removeClass("mailpoet_browser_preview_container_send_to_email")):(this.$(".mailpoet_browser_preview_container").addClass("mailpoet_browser_preview_container_send_to_email"),this.$(".mailpoet_browser_preview_container").removeClass("mailpoet_browser_preview_container_desktop"),this.$(".mailpoet_browser_preview_container").removeClass("mailpoet_browser_preview_container_mobile")),window.localStorage.setItem(x.getConfig().get("newsletterPreview.previewTypeLocalStorageKey"),t),this.previewType=t},sendPreview:function(){var e=this,t=this.$("#mailpoet_preview_to_email"),o={subscriber:t.val(),id:x.getNewsletter().get("id")};if(o.subscriber.length<=0)return r.x.Notice.error((0,i.__)("Enter an email address to send the preview newsletter to.","mailpoet"),{positionAfter:t,scroll:!0}),!1;this.model.set("previewSendingError",!1),this.model.set("previewSendingSuccess",!1),this.model.set("sendingPreview",!0),x.getChannel().request("save").always((function(){j.previewNewsletter(o).done((function(){e.model.set("sendingPreview",!1),e.model.set("previewSendingSuccess",!0),r.x.trackEvent("Editor > Preview sent",{"Domain name":o.subscriber.substring(o.subscriber.indexOf("@")+1)})})).fail((function(t){e.model.set("sendingPreview",!1),e.model.set("previewSendingError",!0);let o=`<p>${(0,i.__)("Sorry, there was an error, please try again later.","mailpoet")}</p>`;t.errors.length>0&&(o=t.errors.map((function(e){let t=`\n              <p>\n                ${(0,i.__)("The email could not be sent due to a technical issue with %1$s","mailpoet").replace("%1$s",window.config.mtaMethod)}:\n                <i>${e.message}</i>\n              </p>\n            `;return"PHPMail"===window.config.mtaMethod?t+=`\n                <p>${(0,i.__)("Please check your sending method configuration, you may need to consult with your hosting company.","mailpoet")}</p>\n                <br />\n                <p>${(0,i.__)("The easy alternative is to <b>send emails with MailPoet Sending Service</b> instead, like thousands of other users do.","mailpoet")}</p>\n                <p>\n                  <a\n                    href='${r.x.MailPoetComUrlFactory.getFreePlanUrl({utm_campaign:"sending-error"})}'\n                    target='_blank'\n                    rel='noopener noreferrer'\n                  >\n                    ${(0,i.__)("Sign up for free in minutes","mailpoet")}\n                  </a>\n                </p>\n              `:t+=`<p>${(0,i.__)("Check your [link]sending method settings[/link].","mailpoet").replace(/\[link\](.*?)\[\/link\]/g,'<a href="?page=mailpoet-settings#mta" key="check-sending">$1</a>')}</p>`,t})).join("")),document.getElementById("mailpoet_preview_sending_error").innerHTML=o}))}))},refreshMssKeyStatus:function(){return this.model.set("awaitingKeyCheck",!0),r.x.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"services",action:"refreshMSSKeyStatus"}).done((e=>{this.model.set("awaitingKeyCheck",!1),e.data&&200===e.data.result.code&&(this.model.set("mssPendingApproval",!(0,d.isTruthy)(e.data.result.data.is_approved)),this.model.set("mssKeyPendingApprovalRefreshMessage",!1))})).fail((e=>{if(this.model.set("awaitingKeyCheck",!1),e.errors&&Array.isArray(e.errors)){const t=e.errors.map((e=>e.message));document.querySelector(".pendindig_approval_error").innerHTML=t.join("\n")}}))}}),x.on("before:start",(function(e){var t=e;t.save=Y.save,t.getChannel().on("autoSave",Y.autoSave),t.getChannel().on("historyUpdate",Y.onHistoryUpdate),window.onbeforeunload=Y.beforeExitWithUnsavedChanges,t.getChannel().reply("save",t.save)})),x.on("start",(function(e){var t=e.getNewsletter(),o=new Y.SaveView({model:t}),n=new Y.SaveView({model:t});n.setDropdownDirectionUp(),e._appView.showChildView("topRegion",o),e._appView.showChildView("bottomRegion",n)}));var X=f(),K={};X.Behaviors.behaviorsLookup=function(){return K},window.BehaviorsLookup=K,o(48883),K.ColorPickerBehavior=f().Behavior.extend({onRender:function(){var e=this,t="hex6";this.view.$(".mailpoet_color").each((function(){var o=e.view.$(this),n=function(e){e&&e.getAlpha()>0?o.val(e.toString(t)):o.val(""),o.trigger("change")};o.spectrum({clickoutFiresChange:!0,showInput:!0,showInitial:!0,showPalette:!0,showSelectionPalette:!0,palette:[],localStorageKey:"newsletter_editor.spectrum.palette",preferredFormat:t,allowEmpty:!0,chooseText:(0,i._x)("Select","select color","mailpoet"),cancelText:(0,i._x)("Cancel","cancel color selection","mailpoet"),change:n,move:n,hide:n})}))}});var J=o(36098),Q=o.n(J);K.ContainerDropZoneBehavior=f().Behavior.extend({defaults:{columnLimit:3},onRender:function(){c.ZP.isObject(this.view.options.renderOptions)&&!0===this.view.options.renderOptions.disableDragAndDrop||this.addDropZone()},addDropZone:function(){var e,t=this,o=this.view,n=t.$el.get(0);if(0===this.view.renderOptions.depth)e=".mailpoet_droppable_block.mailpoet_droppable_layout_block";else{if(2!==this.view.renderOptions.depth)return;e=".mailpoet_droppable_block:not(.mailpoet_droppable_layout_block)"}Q()(n).dropzone({accept:e,overlap:"pointer",ondragenter:function(){o.$el.addClass("mailpoet_drop_active")},ondragleave:function(){t.cleanup()},ondropmove:function(e){var n,r,i,s,a,l,c,d=t.getDropPosition(e.dragmove.pageX,e.dragmove.pageY,o.$el,o.model.get("orientation"),o.model.get("blocks").length),u=o.$el,h="",m="",p=u.offset(),g=t.getCollection();void 0!==d&&(u.find(".mailpoet_drop_marker").remove(),g.isEmpty()||(0===g.length?(s=(i=u.find(o.childViewContainer)).offset().top-u.offset().top,a=i.offset().left-u.offset().left,h=i.width(),m=i.height()):(r=t.getCollection().length===d.index?g.at(d.index-1):g.at(d.index),s=(i=t.getChildren().findByModel(r).$el).offset().top-p.top,a=i.offset().left-p.left,"normal"===d.insertionType?("after"===d.position&&("vertical"===o.model.get("orientation")?s+=i.outerHeight(!0):a+=i.outerWidth()),"vertical"===o.model.get("orientation")?h=i.outerWidth():m=i.outerHeight()):("after"===d.position&&("vertical"===o.model.get("orientation")?a+=i.outerWidth():s+=i.outerHeight()),"vertical"===o.model.get("orientation")?m=i.outerHeight(!0):h=i.outerWidth(!0))),n=w()('<div class="mailpoet_drop_marker"></div>'),0===d.index&&n.addClass("mailpoet_drop_marker_first"),g.length-1===d.index&&n.addClass("mailpoet_drop_marker_last"),d.index>0&&g.length-1>d.index&&n.addClass("mailpoet_drop_marker_middle"),n.addClass("mailpoet_drop_marker_"+d.position),c=(l="before"===d.position?t.getChildren().findByModel(g.at(d.index-1)).$el:t.getChildren().findByModel(g.at(d.index)).$el).outerHeight(!0)-l.outerHeight(),n.css("top",s-c/2),n.css("left",a),n.css("width",h),n.css("height",m),u.append(n)))},ondrop:function(e){var n,r,i,s,a,l=t.getDropPosition(e.dragEvent.pageX,e.dragEvent.pageY,o.$el,o.model.get("orientation"),o.model.get("blocks").length),c=e.draggable.getDropModel(),d=t.getCollection();void 0!==l&&("normal"===l.insertionType?(r="after"===l.position?l.index+1:l.index,"horizontal"===o.model.get("orientation")&&"container"!==c.get("type")?((i=new(window.EditorApplication.getBlockTypeModel("container"))({orientation:"vertical"})).get("blocks").add(c),d.add(i,{at:r})):d.add(c,{at:r}),n=t.getChildren().findByModel(c)):(a=d.at(l.index),i=new(window.EditorApplication.getBlockTypeModel("container"))({orientation:"vertical"===o.model.get("orientation")?"horizontal":"vertical"}),d.remove(a),"horizontal"===i.get("orientation")?("before"===l.position&&((s=new(window.EditorApplication.getBlockTypeModel("container"))({orientation:"vertical"})).get("blocks").add(c),i.get("blocks").add(s)),(s=new(window.EditorApplication.getBlockTypeModel("container"))({orientation:"vertical"})).get("blocks").add(a),i.get("blocks").add(s),"after"===l.position&&((s=new(window.EditorApplication.getBlockTypeModel("container"))({orientation:"vertical"})).get("blocks").add(c),i.get("blocks").add(s))):("before"===l.position&&i.get("blocks").add(c),i.get("blocks").add(a),"after"===l.position&&i.get("blocks").add(c)),d.add(i,{at:l.index}),n=t.getChildren().findByModel(i).children.findByModel(c)),e.draggable.onDrop({dropBehavior:t,droppedModel:c,droppedView:n}),t.cleanup())}})},cleanup:function(){this.view.$el.removeClass("mailpoet_drop_active"),this.view.$(".mailpoet_drop_marker").remove()},getDropPosition:function(e,t,o){var n,r,i,s,a,l,c=0,d=this.view.$el,u=this.view.model.get("orientation"),h=d.offset(),m=h.left,p=h.top,g=d.outerWidth(!0),f=d.outerHeight(!0),v=e-m,b=t-p,y=this._canAcceptNormalInsertion(),w=this._canAcceptSpecialInsertion(),_=!!o;return 0===this.getCollection().length?{insertionType:"normal",index:0,position:"inside"}:("vertical"===u?(n=v,r=g):(n=b,r=f),w&&!y&&(c=.5),n<=r*c&&(_||w)?(i="special",a="before",s=this._computeSpecialIndex(e,t)):n>r*(1-c)&&(_||w)?(i="special",a="after",s=this._computeSpecialIndex(e,t)):(i="normal",a=(l=this._computeNormalIndex(e,t)).position,s=l.index),_||"vertical"!==u||"special"!==i||"horizontal"!==this.getCollection().at(s).get("orientation")||(i="normal",a=(l=this._computeNormalIndex(e,t)).position,s=l.index),"horizontal"!==u||"special"!==i?{insertionType:i,index:s,position:a}:void 0)},_computeNormalIndex:function(e,t){var o,n,r,i=this._computeCellIndex(e,t),s=this.getChildren().findByModel(this.getCollection().at(i)),a=this.view.model.get("orientation"),l=s.$el;return"vertical"===a?(o=t,n=l.offset().top,r=l.outerHeight(!0)):(o=e,n=l.offset().left,r=l.outerWidth(!0)),o<=n+r/2?{index:i,position:"before"}:{index:i,position:"after"}},_computeSpecialIndex:function(e,t){return this._computeCellIndex(e,t)},_computeCellIndex:function(e,t){var o=this.view.model.get("orientation"),n="vertical"===o?t:e,r=this.getChildren().find((function(e){var t,r,i=e.$el;return"vertical"===o?(t=i.offset().top,r=i.outerHeight(!0)):(t=i.offset().left,r=i.outerWidth(!0)),r+=t,t<=n&&n<=r}));return"object"==typeof r?r._index:0},_canAcceptNormalInsertion:function(){var e=this.view.model.get("orientation"),t=this.view.renderOptions.depth,o=this.getChildren().length;return"vertical"===e||"horizontal"===e&&1===t&&o<this.options.columnLimit},_canAcceptSpecialInsertion:function(){var e=this.view.model.get("orientation"),t=this.view.renderOptions.depth,o=this.getChildren().length;return 0===t||1===t&&"horizontal"===e&&o<=this.options.columnLimit},getCollectionView:function(){return this.view.getChildView("blocks")},getChildren:function(){return this.getCollectionView().children},getCollection:function(){return this.getCollectionView().collection}}),K.DraggableBehavior=f().Behavior.extend({defaults:{cloneOriginal:!1,hideOriginal:!1,ignoreSelector:".mailpoet_ignore_drag, .mailpoet_ignore_drag *",onDragSubstituteBy:void 0,getDropModel:function(){throw new Error("Missing 'drop' function for DraggableBehavior")},onDrop:function(){},testAttachToInstance:function(){return!0}},onRender:function(){var e,t=this;this.options.testAttachToInstance(this.view.model,this.view)&&(e=Q()(this.$el.get(0),{ignoreFrom:this.options.ignoreSelector}).draggable({max:1/0,autoScroll:!0,onstart:function(e){var o,n,r,i,s,a=e;!0===t.options.cloneOriginal&&(c.ZP.isFunction(t.options.onDragSubstituteBy)&&(r=t.options.onDragSubstituteBy(t)),i=r||a.target.cloneNode(!0),w()(a.target),(s=w()(i)).addClass("mailpoet_droppable_active"),s.css("position","absolute"),s.css("top",0),s.css("left",0),document.body.appendChild(i),o=s.width()/2,n=s.height()/2,s.css("top",a.pageY-n),s.css("left",a.pageX-o),a.interaction.element=i,!0===t.options.hideOriginal&&t.view.$el.addClass("mailpoet_hidden"),x.getChannel().trigger("dragStart"),document.activeElement.blur())},onmove:function(e){var t=e.target,o=(parseFloat(t.getAttribute("data-x"))||0)+e.dx,n=(parseFloat(t.getAttribute("data-y"))||0)+e.dy;t.style.transform="translate("+o+"px, "+n+"px)",t.style.webkitTransform=t.style.transform,t.setAttribute("data-x",o),t.setAttribute("data-y",n)},onend:function(e){var o=e.target;o.style.transform="",o.style.webkitTransform=o.style.transform,o.removeAttribute("data-x"),o.removeAttribute("data-y"),w()(e.interaction.element).addClass("mailpoet_droppable_active"),!0===t.options.cloneOriginal&&(w()(o).remove(),!0===t.options.hideOriginal&&t.view.$el.removeClass("mailpoet_hidden"))}}).preventDefault("auto").styleCursor(!1).actionChecker((function(e,t,o){return 0!==t.button?null:o})),void 0!==this.options.drop?e.getDropModel=this.options.drop:e.getDropModel=this.view.getDropFunc(),e.onDrop=function(e){var o=e;c.ZP.isObject(o)&&(o.dragBehavior=t),t.options.onDrop.apply(t,[o])})}}),K.HighlightEditingBehavior=f().Behavior.extend({modelEvents:{startEditing:"onStartEditing",stopEditing:"onStopEditing",startResizing:"onStartResizing",stopResizing:"onStopResizing"},events:{mouseenter:"onMouseEnter",mouseleave:"onMouseLeave"},onMouseEnter:function(e){this.isFocusedByPointer=!0,e&&e.buttons>0||x.getDisplayedSettingsId()||this.view.addHighlight()},onMouseLeave:function(){this.isFocusedByPointer=!1,this.isBeingEdited||this.view.removeHighlight()},onStartEditing:function(){this.isBeingEdited=!0,this.view.addHighlight()},onStopEditing:function(){this.isBeingEdited=!1,this.isFocusedByPointer||this.view.removeHighlight()},onStartResizing:function(){this.onStartEditing(),this.view.triggerMethod("resizeStart")},onStopResizing:function(e){this.isFocusedByPointer=V(e,this.view.$el),x.getDisplayedSettingsId()||this.onStopEditing(),this.view.triggerMethod("resizeStop",e)},onDomRefresh:function(){this.isBeingEdited&&this.view.addHighlight()},onChildviewResizeStart:function(){this.onStartEditing(),this.view.triggerMethod("resizeStart")},onChildviewResizeStop:function(e){this.isFocusedByPointer=V(e,this.view.$el),this.onStopEditing(),this.view.triggerMethod("resizeStop",e)}}),K.MediaManagerBehavior=f().Behavior.extend({ui:{"select-image":".mailpoet_field_image_select_image","address-input":".mailpoet_field_image_address"},events:{"click @ui.select-image":"showMediaManager","input @ui.address-input":"changeAddress"},initialize:function(){this.view.options.showImageManager&&this.showMediaManager()},changeAddress:c.ZP.debounce((function(e){var t=w()(e.target).val(),o=new Image;t||!this.options.onSelect?(o.onload=function(){this.options.onSelect&&this.view[this.options.onSelect]({src:t,width:o.naturalWidth+"px",height:o.naturalHeight+"px"})}.bind(this),o.src=t):this.view[this.options.onSelect]({src:null,width:null,height:null})}),500),showMediaManager:function(){var e,t,o=this;if(this._mediaManager)return this._mediaManager.resetSelections(),void this._mediaManager.open();e=window.wp.media.view.MediaFrame.Select.extend({initialize:function(){window._=c.ZP,window.wp.media.view.MediaFrame.prototype.initialize.apply(this,arguments),c.ZP.defaults(this.options,{multiple:!0,editing:!1,state:"insert"}),this.createSelection(),this.createStates(),this.bindHandlers(),this.createIframeStates(),this.$el.addClass("hide-title")},resetSelections:function(){this.state().get("selection").reset()},createQuery:function(e){return window.wp.media.query(e)},createStates:function(){var e=this.options;this.states.add([new window.wp.media.controller.Library({id:"insert",title:"Add images",priority:20,toolbar:"main-insert",filterable:"image",library:this.createQuery(e.library),multiple:!!e.multiple&&"reset",editable:!1,allowLocalEdits:!1,displaySettings:!1,displayUserSettings:!1})]),window.wp.media.view.settings.post.featuredImageId&&this.states.add(new window.wp.media.controller.FeaturedImage)},bindHandlers:function(){var e;this.on("router:create:browse",this.createRouter,this),this.on("router:render:browse",this.browseRouter,this),this.on("content:create:browse",this.browseContent,this),this.on("content:render:upload",this.uploadContent,this),this.on("toolbar:create:select",this.createSelectToolbar,this),this.on("menu:create:gallery",this.createMenu,this),this.on("toolbar:create:main-insert",this.createToolbar,this),this.on("toolbar:create:main-gallery",this.createToolbar,this),this.on("toolbar:create:main-embed",this.mainEmbedToolbar,this),this.on("updateExcluded",this.browseContent,this),e={content:{embed:"embedContent","edit-selection":"editSelectionContent"},toolbar:{"main-insert":"mainInsertToolbar"}},c.ZP.each(e,(function(e,t){c.ZP.each(e,(function(e,o){this.on(t+":render:"+o,this[e],this)}),this)}),this)},uploadContent:function(){window.wp.media.view.MediaFrame.Select.prototype.uploadContent.apply(this,arguments),this.$el.addClass("hide-toolbar")},embedContent:function(){var e=new window.wp.media.view.Embed({controller:this,model:this.state()}).render();this.content.set(e),e.url.focus()},editSelectionContent:function(){var e,t=this.state(),o=t.get("selection");(e=new window.wp.media.view.AttachmentsBrowser({controller:this,collection:o,selection:o,model:t,sortable:!0,search:!1,dragInfo:!0,AttachmentView:window.wp.media.view.Attachment.EditSelection}).render()).toolbar.set("backToLibrary",{text:"Return to library",priority:-100,click:function(){this.controller.content.mode("browse")}}),this.content.set(e)},selectionStatusToolbar:function(e){var t=this.state().get("editable");e.set("selection",new window.wp.media.view.Selection({controller:this,collection:this.state().get("selection"),priority:-40,editable:t&&function(){this.controller.content.mode("edit-selection")}}).render())},mainInsertToolbar:function(e){var t=this;this.selectionStatusToolbar(e),e.set("insert",{style:"primary",priority:80,text:"Select Image",requires:{selection:!0},click:function(){var e=t.state(),o=e.get("selection");t.close(),e.trigger("insert",o).reset()}})},mainEmbedToolbar:function(e){e.view=new window.wp.media.view.Toolbar.Embed({controller:this,text:"Add images"})}}),t=new e({id:"mailpoet-media-manager",frame:"select",title:"Select image",editing:!1,multiple:!1,library:{type:"image"},displaySettings:!1,button:{text:"Select"}}),this._mediaManager=t,this._mediaManager.on("insert",(function(){t.state().get("selection").each((function(e){var t=e.get("sizes"),n=c.ZP.sortBy(c.ZP.keys(t),(function(e){return Math.abs(1320-t[e].width)})),r=t[c.ZP.first(n)].width,i=c.ZP.filter(c.ZP.values(t),(function(e){return e.width===r})),s=c.ZP.max(i,(function(e){return e.height}));o.options.onSelect&&o.view[o.options.onSelect]({height:s.height+"px",width:s.width+"px",src:s.url,alt:void 0!==e.get("alt")?e.get("alt"):""})}))})),this._mediaManager.open()},onBeforeDestroy:function(){"object"==typeof this._mediaManager&&this._mediaManager.remove()}}),K.ResizableBehavior=f().Behavior.extend({defaults:{elementSelector:null,resizeHandleSelector:!0,transformationFunction:function(e){return e},minLength:0,maxLength:1/0,modelField:"styles.block.height",onResize:function(e){var t=parseFloat(this.view.model.get(this.options.modelField))+this.options.transformationFunction(e.dy);t=Math.min(this.options.maxLength,Math.max(this.options.minLength,t)),this.view.model.set(this.options.modelField,t+"px")}},onRender:function(){this.attachResize(),this.view.$el.addClass("mailpoet_resizable_block")},attachResize:function(){var e,t=this;e=null===this.options.elementSelector?this.view.$el.get(0):this.view.$(this.options.elementSelector).get(0),Q()(e).resizable({edges:{top:!1,left:!1,right:!1,bottom:"string"==typeof this.options.resizeHandleSelector?this.view.$(this.options.resizeHandleSelector).get(0):this.options.resizeHandleSelector}}).on("resizestart",(function(){t.view.model.trigger("startResizing"),document.activeElement.blur()})).on("resizemove",(function(e){return t.options.onResize.bind(t)(e)})).on("resizeend",(function(e){t.view.model.trigger("stopResizing",e),t.$el.removeClass("mailpoet_resize_active")}))}}),K.SortableBehavior=f().Behavior.extend({onRender:function(){var e=this.view.collection;c.ZP.isFunction(this.$el.sortable)&&this.$el.sortable({cursor:"move",start:function(e,t){t.item.data("previousIndex",t.item.index())},end:function(e,t){t.item.removeData("previousIndex")},update:function(t,o){var n=o.item.data("previousIndex"),r=o.item.index(),i=e.at(n);e.remove(i),e.add(i,{at:r})},items:this.options.items})}}),K.ShowSettingsBehavior=f().Behavior.extend({defaults:{ignoreFrom:""},events:{"click .mailpoet_content":"showSettings"},showSettings:function(e){this.isIgnoredElement(e.target)||this.view.triggerMethod("showSettings")},isIgnoredElement:function(e){return this.options.ignoreFrom&&this.options.ignoreFrom.length>0&&w()(e).is(this.options.ignoreFrom)}});var ee=o(71619),te=o.n(ee);function oe(e){e.options.register("mailpoet_shortcodes",{processor:"object",default:{}}),e.options.register("mailpoet_shortcodes_window_title",{processor:"string",default:""}),e.ui.registry.addIcon("mailpoet",'<svg viewBox="0 0 152.02 156.4" width="20" height="20"><path d="M37.71,89.1c3.5,0,5.9-.8,7.2-2.3a8,8,0,0,0,2-5.4V35.7l17,45.1a12.68,12.68,0,0,0,3.7,5.4c1.6,1.3,4,2,7.2,2a12.54,12.54,0,0,0,5.9-1.4,8.41,8.41,0,0,0,3.9-5l18.1-50V81a8.53,8.53,0,0,0,2.1,6.1c1.4,1.4,3.7,2.2,6.9,2.2,3.5,0,5.9-.8,7.2-2.3a8,8,0,0,0,2-5.4V8.7a7.48,7.48,0,0,0-3.3-6.6c-2.1-1.4-5-2.1-8.6-2.1a19.3,19.3,0,0,0-9.4,2,11.63,11.63,0,0,0-5.1,6.8L74.91,67.1,54.41,8.4a12.4,12.4,0,0,0-4.5-6.2c-2.1-1.5-5-2.2-8.8-2.2a16.51,16.51,0,0,0-8.9,2.1c-2.3,1.5-3.5,3.9-3.5,7.2V80.8c0,2.8.7,4.8,2,6.2C32.21,88.4,34.41,89.1,37.71,89.1Z"/><path d="M149,116.6l-2.4-1.9a7.4,7.4,0,0,0-9.4.3,19.65,19.65,0,0,1-12.5,4.6h-21.4A37.08,37.08,0,0,0,77,130.5l-1.1,1.2-1.1-1.1a37.25,37.25,0,0,0-26.3-10.9H27a19.59,19.59,0,0,1-12.4-4.6,7.28,7.28,0,0,0-9.4-.3l-2.4,1.9A7.43,7.43,0,0,0,0,122.2a7.14,7.14,0,0,0,2.4,5.7A37.28,37.28,0,0,0,27,137.4h21.6a19.59,19.59,0,0,1,18.9,14.4v.2c.1.7,1.2,4.4,8.5,4.4s8.4-3.7,8.5-4.4v-.2a19.59,19.59,0,0,1,18.9-14.4H125a37.28,37.28,0,0,0,24.6-9.5,7.42,7.42,0,0,0,2.4-5.7A7.86,7.86,0,0,0,149,116.6Z"/></svg>'),e.ui.registry.addButton("mailpoet_shortcodes",{icon:"mailpoet",onAction:function(){var t,o=[],n=e.options.get("mailpoet_shortcodes");Object.keys(n).forEach((function(e){var r;if(Object.prototype.hasOwnProperty.call(n,e)){for(r={name:e,title:e,items:[]},t=0;t<n[e].length;t+=1)r.items.push({type:"button",text:n[e][t].text,name:n[e][t].shortcode});o.push(r)}})),e.windowManager.open({title:e.options.get("mailpoet_shortcodes_window_title"),body:{type:"tabpanel",tabs:o},buttons:[{type:"cancel",text:(0,i.__)("Close","mailpoet"),primary:!0}],onAction:function(t,o){e.insertContent(o.name),e.windowManager.close()}})}})}o(34630),o(85245),o(3356),o(47464),o(63323),te().IconManager.add("default",{icons:{"accessibility-check":'<svg width="24" height="24"><path d="M12 2a2 2 0 0 1 2 2 2 2 0 0 1-2 2 2 2 0 0 1-2-2c0-1.1.9-2 2-2Zm8 7h-5v12c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-5c0-.6-.4-1-1-1a1 1 0 0 0-1 1v5c0 .6-.4 1-1 1a1 1 0 0 1-1-1V9H4a1 1 0 1 1 0-2h16c.6 0 1 .4 1 1s-.4 1-1 1Z" fill-rule="nonzero"/></svg>',"action-next":'<svg width="24" height="24"><path fill-rule="nonzero" d="M5.7 7.3a1 1 0 0 0-1.4 1.4l7.7 7.7 7.7-7.7a1 1 0 1 0-1.4-1.4L12 13.6 5.7 7.3Z"/></svg>',"action-prev":'<svg width="24" height="24"><path fill-rule="nonzero" d="M18.3 15.7a1 1 0 0 0 1.4-1.4L12 6.6l-7.7 7.7a1 1 0 0 0 1.4 1.4L12 9.4l6.3 6.3Z"/></svg>',addtag:'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M15 5a2 2 0 0 1 1.6.8L21 12l-4.4 6.2a2 2 0 0 1-1.6.8h-3v-2h3l3.5-5L15 7H5v3H3V7c0-1.1.9-2 2-2h10Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M6 12a1 1 0 0 0-1 1v2H3a1 1 0 1 0 0 2h2v2a1 1 0 1 0 2 0v-2h2a1 1 0 1 0 0-2H7v-2c0-.6-.4-1-1-1Z"/></svg>',"align-center":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm3 4h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 1 1 0-2Zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2Zm-3-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',"align-justify":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',"align-left":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm0 4h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Zm0-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',"align-none":'<svg width="24" height="24"><path d="M14.2 5 13 7H5a1 1 0 1 1 0-2h9.2Zm4 0h.8a1 1 0 0 1 0 2h-2l1.2-2Zm-6.4 4-1.2 2H5a1 1 0 0 1 0-2h6.8Zm4 0H19a1 1 0 0 1 0 2h-4.4l1.2-2Zm-6.4 4-1.2 2H5a1 1 0 0 1 0-2h4.4Zm4 0H19a1 1 0 0 1 0 2h-6.8l1.2-2ZM7 17l-1.2 2H5a1 1 0 0 1 0-2h2Zm4 0h8a1 1 0 0 1 0 2H9.8l1.2-2Zm5.2-13.5 1.3.7-9.7 16.3-1.3-.7 9.7-16.3Z" fill-rule="evenodd"/></svg>',"align-right":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm6 4h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm-6-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',"arrow-left":'<svg width="24" height="24"><path d="m5.6 13 12 6a1 1 0 0 0 1.4-1V6a1 1 0 0 0-1.4-.9l-12 6a1 1 0 0 0 0 1.8Z" fill-rule="evenodd"/></svg>',"arrow-right":'<svg width="24" height="24"><path d="m18.5 13-12 6A1 1 0 0 1 5 18V6a1 1 0 0 1 1.4-.9l12 6a1 1 0 0 1 0 1.8Z" fill-rule="evenodd"/></svg>',bold:'<svg width="24" height="24"><path d="M7.8 19c-.3 0-.5 0-.6-.2l-.2-.5V5.7c0-.2 0-.4.2-.5l.6-.2h5c1.5 0 2.7.3 3.5 1 .7.6 1.1 1.4 1.1 2.5a3 3 0 0 1-.6 1.9c-.4.6-1 1-1.6 1.2.4.1.9.3 1.3.6s.8.7 1 1.2c.4.4.5 1 .5 1.6 0 1.3-.4 2.3-1.3 3-.8.7-2.1 1-3.8 1H7.8Zm5-8.3c.6 0 1.2-.1 1.6-.5.4-.3.6-.7.6-1.3 0-1.1-.8-1.7-2.3-1.7H9.3v3.5h3.4Zm.5 6c.7 0 1.3-.1 1.7-.4.4-.4.6-.9.6-1.5s-.2-1-.7-1.4c-.4-.3-1-.4-2-.4H9.4v3.8h4Z" fill-rule="evenodd"/></svg>',bookmark:'<svg width="24" height="24"><path d="M6 4v17l6-4 6 4V4c0-.6-.4-1-1-1H7a1 1 0 0 0-1 1Z" fill-rule="nonzero"/></svg>',"border-style":'<svg width="24" height="24"><g fill-rule="evenodd"><rect width="18" height="2" x="3" y="6" rx="1"/><rect width="2.8" height="2" x="3" y="16" rx="1"/><rect width="2.8" height="2" x="6.8" y="16" rx="1"/><rect width="2.8" height="2" x="10.6" y="16" rx="1"/><rect width="2.8" height="2" x="14.4" y="16" rx="1"/><rect width="2.8" height="2" x="18.2" y="16" rx="1"/><rect width="8" height="2" x="3" y="11" rx="1"/><rect width="8" height="2" x="13" y="11" rx="1"/></g></svg>',"border-width":'<svg width="24" height="24"><g fill-rule="evenodd"><rect width="18" height="5" x="3" y="5" rx="1"/><rect width="18" height="3.5" x="3" y="11.5" rx="1"/><rect width="18" height="2" x="3" y="17" rx="1"/></g></svg>',brightness:'<svg width="24" height="24"><path d="M12 17c.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7v-1c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3Zm0-10a1 1 0 0 1-.7-.3A1 1 0 0 1 11 6V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3Zm7 4c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-1a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1ZM7 12c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3H5a1 1 0 0 1-.7-.3A1 1 0 0 1 4 12c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1c.3 0 .5.1.7.3.2.2.3.4.3.7Zm10 3.5.7.8c.2.1.3.4.3.6 0 .3-.1.6-.3.8a1 1 0 0 1-.8.3 1 1 0 0 1-.6-.3l-.8-.7a1 1 0 0 1-.3-.8c0-.2.1-.5.3-.7a1 1 0 0 1 1.4 0Zm-10-7-.7-.8a1 1 0 0 1-.3-.6c0-.3.1-.6.3-.8.2-.2.5-.3.8-.3.2 0 .5.1.7.3l.7.7c.2.2.3.5.3.8 0 .2-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.8-.3Zm10 0a1 1 0 0 1-.8.3 1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.6.3-.8l.8-.7c.1-.2.4-.3.6-.3.3 0 .6.1.8.3.2.2.3.5.3.8 0 .2-.1.5-.3.7l-.7.7Zm-10 7c.2-.2.5-.3.8-.3.2 0 .5.1.7.3a1 1 0 0 1 0 1.4l-.8.8a1 1 0 0 1-.6.3 1 1 0 0 1-.8-.3 1 1 0 0 1-.3-.8c0-.2.1-.5.3-.6l.7-.8ZM12 8a4 4 0 0 1 3.7 2.4 4 4 0 0 1 0 3.2A4 4 0 0 1 12 16a4 4 0 0 1-3.7-2.4 4 4 0 0 1 0-3.2A4 4 0 0 1 12 8Zm0 6.5c.7 0 1.3-.2 1.8-.7.5-.5.7-1.1.7-1.8s-.2-1.3-.7-1.8c-.5-.5-1.1-.7-1.8-.7s-1.3.2-1.8.7c-.5.5-.7 1.1-.7 1.8s.2 1.3.7 1.8c.5.5 1.1.7 1.8.7Z" fill-rule="evenodd"/></svg>',browse:'<svg width="24" height="24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-4v-2h4V8H5v10h4v2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-8 9.4-2.3 2.3a1 1 0 1 1-1.4-1.4l4-4a1 1 0 0 1 1.4 0l4 4a1 1 0 0 1-1.4 1.4L13 13.4V20a1 1 0 0 1-2 0v-6.6Z" fill-rule="nonzero"/></svg>',cancel:'<svg width="24" height="24"><path d="M12 4.6a7.4 7.4 0 1 1 0 14.8 7.4 7.4 0 0 1 0-14.8ZM12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18Zm0 8L14.8 8l1 1.1-2.7 2.8 2.7 2.7-1.1 1.1-2.7-2.7-2.7 2.7-1-1.1 2.6-2.7-2.7-2.7 1-1.1 2.8 2.7Z" fill-rule="nonzero"/></svg>',"cell-background-color":'<svg width="24" height="24"><path d="m15.7 2 1.6 1.6-2.7 2.6 5.9 5.8c.7.7.7 1.7 0 2.4l-6.3 6.1a1.7 1.7 0 0 1-2.4 0l-6.3-6.1c-.7-.7-.7-1.7 0-2.4L15.7 2ZM18 12l-4.5-4L9 12h9ZM4 16s2 2.4 2 3.8C6 21 5.1 22 4 22s-2-1-2-2.2C2 18.4 4 16 4 16Z"/></svg>',"cell-border-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M5 13v5h2v2H5a2 2 0 0 1-2-2v-5h2zm8-7V4h6a2 2 0 0 1 2 2h-8z" opacity=".2"/><path fill-rule="nonzero" d="M13 4v2H5v7H3V6c0-1.1.9-2 2-2h8zm-2.6 14.1.1-.1.1.1.2.3.2.2.2.2c.4.6.8 1.2.8 1.7 0 .8-.7 1.5-1.5 1.5S9 21.3 9 20.5c0-.5.4-1.1.8-1.7l.2-.2.2-.2.2-.3z"/><path d="m13 11-2 2H5v-2h6V6h2z"/><path fill-rule="nonzero" d="m18.4 8 1 1-1.8 1.9 4 4c.5.4.5 1.1 0 1.6l-4.3 4.2a1.2 1.2 0 0 1-1.6 0l-4.4-4.2c-.4-.5-.4-1.2 0-1.7l7-6.8Zm1.6 7-3-3-3 3h6Z"/></g></svg>',"change-case":'<svg width="24" height="24"><path d="M18.4 18.2v-.6c-.5.8-1.3 1.2-2.4 1.2-2.2 0-3.3-1.6-3.3-4.8 0-3.1 1-4.7 3.3-4.7 1.1 0 1.8.3 2.4 1.1v-.6c0-.5.4-.8.8-.8s.8.3.8.8v8.4c0 .5-.4.8-.8.8a.8.8 0 0 1-.8-.8zm-2-7.4c-1.3 0-1.8.9-1.8 3.2 0 2.4.5 3.3 1.7 3.3 1.3 0 1.8-.9 1.8-3.2 0-2.4-.5-3.3-1.7-3.3zM10 15.7H5.5l-.8 2.6a1 1 0 0 1-1 .7h-.2a.7.7 0 0 1-.7-1l4-12a1 1 0 0 1 2 0l4 12a.7.7 0 0 1-.8 1h-.2a1 1 0 0 1-1-.7l-.8-2.6zm-.3-1.5-2-6.5-1.9 6.5h3.9z" fill-rule="evenodd"/></svg>',"character-count":'<svg width="24" height="24"><path d="M4 11.5h16v1H4v-1Zm4.8-6.8V10H7.7V5.8h-1v-1h2ZM11 8.3V9h2v1h-3V7.7l2-1v-.9h-2v-1h3v2.4l-2 1Zm6.3-3.4V10h-3.1V9h2.1V8h-2.1V6.8h2.1v-1h-2.1v-1h3.1ZM5.8 16.4c0-.5.2-.8.5-1 .2-.2.6-.3 1.2-.3l.8.1c.2 0 .4.2.5.3l.4.4v2.8l.2.3H8.2V18.7l-.6.3H7c-.4 0-.7 0-1-.2a1 1 0 0 1-.3-.9c0-.3 0-.6.3-.8.3-.2.7-.4 1.2-.4l.6-.2h.3v-.2l-.1-.2a.8.8 0 0 0-.5-.1 1 1 0 0 0-.4 0l-.3.4h-1Zm2.3.8h-.2l-.2.1-.4.1a1 1 0 0 0-.4.2l-.2.2.1.3.5.1h.4l.4-.4v-.6Zm2-3.4h1.2v1.7l.5-.3h.5c.5 0 .9.1 1.2.5.3.4.5.8.5 1.4 0 .6-.2 1.1-.5 1.5-.3.4-.7.6-1.3.6l-.6-.1-.4-.4v.4h-1.1v-5.4Zm1.1 3.3c0 .3 0 .6.2.8a.7.7 0 0 0 1.2 0l.2-.8c0-.4 0-.6-.2-.8a.7.7 0 0 0-.6-.3l-.6.3-.2.8Zm6.1-.5c0-.2 0-.3-.2-.4a.8.8 0 0 0-.5-.2c-.3 0-.5.1-.6.3l-.2.9c0 .3 0 .6.2.8.1.2.3.3.6.3.2 0 .4 0 .5-.2l.2-.4h1.1c0 .5-.3.8-.6 1.1a2 2 0 0 1-1.3.4c-.5 0-1-.2-1.3-.6a2 2 0 0 1-.5-1.4c0-.6.1-1.1.5-1.5.3-.4.8-.5 1.4-.5.5 0 1 0 1.2.3.4.3.5.7.5 1.2h-1v-.1Z" fill-rule="evenodd"/></svg>',"checklist-rtl":'<svg width="24" height="24"><path d="M5 17h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm14.2 11c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 8c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8z" fill-rule="evenodd"/></svg>',checklist:'<svg width="24" height="24"><path d="M11 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8a1 1 0 0 1 0 2h-8a1 1 0 0 1 0-2ZM7.2 16c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8Zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8Zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 8c-.2.3-.7.4-1 0L3.8 6.9a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8Z" fill-rule="evenodd"/></svg>',checkmark:'<svg width="24" height="24"><path d="M18.2 5.4a1 1 0 0 1 1.6 1.2l-8 12a1 1 0 0 1-1.5.1l-5-5a1 1 0 1 1 1.4-1.4l4.1 4.1 7.4-11Z" fill-rule="nonzero"/></svg>',"chevron-down":'<svg width="10" height="10"><path d="M8.7 2.2c.3-.3.8-.3 1 0 .4.4.4.9 0 1.2L5.7 7.8c-.3.3-.9.3-1.2 0L.2 3.4a.8.8 0 0 1 0-1.2c.3-.3.8-.3 1.1 0L5 6l3.7-3.8Z" fill-rule="nonzero"/></svg>',"chevron-left":'<svg width="10" height="10"><path d="M7.8 1.3 4 5l3.8 3.7c.3.3.3.8 0 1-.4.4-.9.4-1.2 0L2.2 5.7a.8.8 0 0 1 0-1.2L6.6.2C7 0 7.4 0 7.8.2c.3.3.3.8 0 1.1Z" fill-rule="nonzero"/></svg>',"chevron-right":'<svg width="10" height="10"><path d="M2.2 1.3a.8.8 0 0 1 0-1c.4-.4.9-.4 1.2 0l4.4 4.1c.3.4.3.9 0 1.2L3.4 9.8c-.3.3-.8.3-1.2 0a.8.8 0 0 1 0-1.1L6 5 2.2 1.3Z" fill-rule="nonzero"/></svg>',"chevron-up":'<svg width="10" height="10"><path d="M8.7 7.8 5 4 1.3 7.8c-.3.3-.8.3-1 0a.8.8 0 0 1 0-1.2l4.1-4.4c.3-.3.9-.3 1.2 0l4.2 4.4c.3.3.3.9 0 1.2-.3.3-.8.3-1.1 0Z" fill-rule="nonzero"/></svg>',close:'<svg width="24" height="24"><path d="M17.3 8.2 13.4 12l3.9 3.8a1 1 0 0 1-1.5 1.5L12 13.4l-3.8 3.9a1 1 0 0 1-1.5-1.5l3.9-3.8-3.9-3.8a1 1 0 0 1 1.5-1.5l3.8 3.9 3.8-3.9a1 1 0 0 1 1.5 1.5Z" fill-rule="evenodd"/></svg>',"code-sample":'<svg width="24" height="26"><path d="M7.1 11a2.8 2.8 0 0 1-.8 2 2.8 2.8 0 0 1 .8 2v1.7c0 .3.1.6.4.8.2.3.5.4.8.4.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.7 0-1.4-.3-2-.8-.5-.6-.8-1.3-.8-2V15c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 0 1-.4-.4v-.8c0-.2.2-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V9.3c0-.7.3-1.4.8-2 .6-.5 1.3-.8 2-.8.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8V11Zm9.8 0V9.3c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 0 1-.4-.4V7c0-.2.1-.4.4-.4.7 0 1.4.3 2 .8.5.6.8 1.3.8 2V11c0 .3.1.6.4.8.2.3.5.4.8.4.2 0 .4.2.4.4v.8c0 .2-.2.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8v1.7c0 .7-.3 1.4-.8 2-.6.5-1.3.8-2 .8a.4.4 0 0 1-.4-.4v-.8c0-.2.1-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V15a2.8 2.8 0 0 1 .8-2 2.8 2.8 0 0 1-.8-2Zm-3.3-.4c0 .4-.1.8-.5 1.1-.3.3-.7.5-1.1.5-.4 0-.8-.2-1.1-.5-.4-.3-.5-.7-.5-1.1 0-.5.1-.9.5-1.2.3-.3.7-.4 1.1-.4.4 0 .8.1 1.1.4.4.3.5.7.5 1.2ZM12 13c.4 0 .8.1 1.1.5.4.3.5.7.5 1.1 0 1-.1 1.6-.5 2a3 3 0 0 1-1.1 1c-.4.3-.8.4-1.1.4a.5.5 0 0 1-.5-.5V17a3 3 0 0 0 1-.2l.6-.6c-.6 0-1-.2-1.3-.5-.2-.3-.3-.7-.3-1 0-.5.1-1 .5-1.2.3-.4.7-.5 1.1-.5Z" fill-rule="evenodd"/></svg>',"color-levels":'<svg width="24" height="24"><path d="M17.5 11.4A9 9 0 0 1 18 14c0 .5 0 1-.2 1.4 0 .4-.3.9-.5 1.3a6.2 6.2 0 0 1-3.7 3 5.7 5.7 0 0 1-3.2 0A5.9 5.9 0 0 1 7.6 18a6.2 6.2 0 0 1-1.4-2.6 6.7 6.7 0 0 1 0-2.8c0-.4.1-.9.3-1.3a13.6 13.6 0 0 1 2.3-4A20 20 0 0 1 12 4a26.4 26.4 0 0 1 3.2 3.4 18.2 18.2 0 0 1 2.3 4Zm-2 4.5c.4-.7.5-1.4.5-2a7.3 7.3 0 0 0-1-3.2c.2.6.2 1.2.2 1.9a4.5 4.5 0 0 1-1.3 3 5.3 5.3 0 0 1-2.3 1.5 4.9 4.9 0 0 1-2 .1 4.3 4.3 0 0 0 2.4.8 4 4 0 0 0 2-.6 4 4 0 0 0 1.5-1.5Z" fill-rule="evenodd"/></svg>',"color-picker":'<svg width="24" height="24"><path d="M12 3a9 9 0 0 0 0 18 1.5 1.5 0 0 0 1.1-2.5c-.2-.3-.4-.6-.4-1 0-.8.7-1.5 1.5-1.5H16a5 5 0 0 0 5-5c0-4.4-4-8-9-8Zm-5.5 9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Zm3-4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Zm5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Zm3 4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Z" fill-rule="nonzero"/></svg>',"color-swatch-remove-color":'<svg width="24" height="24"><path stroke="#000" stroke-width="2" d="M21 3 3 21" fill-rule="evenodd"/></svg>',"color-swatch":'<svg width="24" height="24"><rect x="3" y="3" width="18" height="18" rx="1" fill-rule="evenodd"/></svg>',"comment-add":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="m9 19 3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 0 0-1 1v10c0 .6.4 1 1 1h4v2Zm-2 4v-4H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3h-6.4L7 23Z"/><path d="M13 10h2a1 1 0 0 1 0 2h-2v2a1 1 0 0 1-2 0v-2H9a1 1 0 0 1 0-2h2V8a1 1 0 0 1 2 0v2Z"/></g></svg>',comment:'<svg width="24" height="24"><path fill-rule="nonzero" d="m9 19 3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 0 0-1 1v10c0 .6.4 1 1 1h4v2Zm-2 4v-4H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3h-6.4L7 23Z"/></svg>',contrast:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4Zm-6 8a6 6 0 0 0 6 6V6a6 6 0 0 0-6 6Z" fill-rule="evenodd"/></svg>',copy:'<svg width="24" height="24"><path d="M16 3H6a2 2 0 0 0-2 2v11h2V5h10V3Zm1 4a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V9c0-1.2.9-2 2-2h7Zm0 12V9h-7v10h7Z" fill-rule="nonzero"/></svg>',crop:'<svg width="24" height="24"><path d="M17 8v7h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v2c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-2H7V9H5a1 1 0 1 1 0-2h2V5c0-.6.4-1 1-1s1 .4 1 1v2h7l3-3 1 1-3 3ZM9 9v5l5-5H9Zm1 6h5v-5l-5 5Z" fill-rule="evenodd"/></svg>',"cut-column":'<svg width="24" height="24"><path fill-rule="evenodd" d="M7.2 4.5c.9 0 1.6.4 2.2 1A3.7 3.7 0 0 1 10.5 8v.5l1 1 4-4 1-.5a3.3 3.3 0 0 1 2 0c.4 0 .7.3 1 .5L17 8h4v13h-6V10l-1.5 1.5.5.5v4l-2.5-2.5-1 1v.5c0 .4 0 .8-.3 1.2-.2.5-.4.9-.8 1.2-.6.7-1.3 1-2.2 1-.8.2-1.5 0-2-.6l-.5-.8-.2-1c0-.4 0-.8.3-1.2A3.9 3.9 0 0 1 7 12.7c.5-.2 1-.3 1.5-.2l1-1-1-1c-.5 0-1 0-1.5-.2-.5-.1-1-.4-1.4-.9-.4-.3-.6-.7-.8-1.2L4.5 7c0-.4 0-.7.2-1 0-.3.3-.6.5-.8.5-.5 1.2-.8 2-.7Zm12.3 5h-3v10h3v-10ZM8 13.8h-.3l-.4.2a2.8 2.8 0 0 0-.7.4v.1a2.8 2.8 0 0 0-.6.8l-.1.4v.7l.2.5.5.2h.7a2.6 2.6 0 0 0 .8-.3 2.4 2.4 0 0 0 .7-.7 2.5 2.5 0 0 0 .3-.8 1.5 1.5 0 0 0 0-.8 1 1 0 0 0-.2-.4 1 1 0 0 0-.5-.2H8Zm3.5-3.7c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4ZM7 5.8h-.4a1 1 0 0 0-.5.3 1 1 0 0 0-.2.5v.7a2.5 2.5 0 0 0 .3.8l.2.3h.1l.4.4.4.2.4.1h.7L9 9l.2-.4a1.6 1.6 0 0 0 0-.8 2.6 2.6 0 0 0-.3-.8A2.5 2.5 0 0 0 7.7 6l-.4-.1H7Z"/></svg>',"cut-row":'<svg width="24" height="24"><path fill-rule="evenodd" d="M22 3v5H9l3 3 2-2h4l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8.7.6 1 1.3 1 2.2.2.8 0 1.5-.6 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 0 1-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 0 1 8.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 0 1 0-2c0-.4.3-.7.5-1l2 2V3h14ZM8.5 15.3h-.3a2.6 2.6 0 0 0-.8.4 2.5 2.5 0 0 0-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 0 0 .8-.3L9 18V18l.4-.4.2-.4.1-.4v-.7a1 1 0 0 0-.2-.5 1 1 0 0 0-.4-.2h-.5Zm7 0H15a1 1 0 0 0-.4.3 1 1 0 0 0-.2.5 1.5 1.5 0 0 0 0 .7v.4a2.8 2.8 0 0 0 .5.7h.1a2.8 2.8 0 0 0 .8.6l.4.1h.7l.5-.2.2-.5v-.7a2.6 2.6 0 0 0-.3-.8 2.4 2.4 0 0 0-.7-.7 2.5 2.5 0 0 0-.8-.3h-.3ZM12 11.6c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4Zm8.5-7.1h-11v2h11v-2Z"/></svg>',cut:'<svg width="24" height="24"><path d="M18 15c.6.7 1 1.4 1 2.3 0 .8-.2 1.5-.7 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 0 1-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 0 1 8.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 0 1 0-2c0-.4.3-.7.5-1l6 6 6-6 .5 1a3.3 3.3 0 0 1 0 2c0 .4-.3.7-.5 1l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8Zm-8.5 2.2.1-.4v-.7a1 1 0 0 0-.2-.5 1 1 0 0 0-.4-.2 1.6 1.6 0 0 0-.8 0 2.6 2.6 0 0 0-.8.3 2.5 2.5 0 0 0-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 0 0 .8-.3 2.8 2.8 0 0 0 1-1Zm2.5-2.8c.4 0 .7-.1 1-.4.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4s-.7.1-1 .4c-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4Zm5.4 4 .2-.5v-.7a2.6 2.6 0 0 0-.3-.8 2.4 2.4 0 0 0-.7-.7 2.5 2.5 0 0 0-.8-.3 1.5 1.5 0 0 0-.8 0 1 1 0 0 0-.4.2 1 1 0 0 0-.2.5 1.5 1.5 0 0 0 0 .7v.4l.3.4.3.4a2.8 2.8 0 0 0 .8.5l.4.1h.7l.5-.2Z" fill-rule="evenodd"/></svg>',"document-properties":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h10a2 2 0 0 0 2-2V7.6L14.4 3ZM17 19H7V5h6v4h4v10Z" fill-rule="nonzero"/></svg>',drag:'<svg width="24" height="24"><path d="M13 5h2v2h-2V5Zm0 4h2v2h-2V9ZM9 9h2v2H9V9Zm4 4h2v2h-2v-2Zm-4 0h2v2H9v-2Zm0 4h2v2H9v-2Zm4 0h2v2h-2v-2ZM9 5h2v2H9V5Z" fill-rule="evenodd"/></svg>',"duplicate-column":'<svg width="24" height="24"><path d="M17 6v16h-7V6h7Zm-2 2h-3v12h3V8Zm-2-6v2H8v15H6V2h7Z"/></svg>',"duplicate-row":'<svg width="24" height="24"><path d="M22 11v7H6v-7h16Zm-2 2H8v3h12v-3Zm-1-6v2H4v5H2V7h17Z"/></svg>',duplicate:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M16 3v2H6v11H4V5c0-1.1.9-2 2-2h10Zm3 8h-2V9h-7v10h9a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V9c0-1.2.9-2 2-2h7a2 2 0 0 1 2 2v2Z"/><path d="M17 14h1a1 1 0 0 1 0 2h-1v1a1 1 0 0 1-2 0v-1h-1a1 1 0 0 1 0-2h1v-1a1 1 0 0 1 2 0v1Z"/></g></svg>',"edit-block":'<svg width="24" height="24"><path fill-rule="nonzero" d="m19.8 8.8-9.4 9.4c-.2.2-.5.4-.9.4l-5.4 1.2 1.2-5.4.5-.8 9.4-9.4c.7-.7 1.8-.7 2.5 0l2.1 2.1c.7.7.7 1.8 0 2.5Zm-2-.2 1-.9v-.3l-2.2-2.2a.3.3 0 0 0-.3 0l-1 1L18 8.5Zm-1 1-2.5-2.4-6 6 2.5 2.5 6-6Zm-7 7.1-2.6-2.4-.3.3-.1.2-.7 3 3.1-.6h.1l.4-.5Z"/></svg>',"edit-image":'<svg width="24" height="24"><path d="M18 16h2V7a2 2 0 0 0-2-2H7v2h11v9ZM6 17h15a1 1 0 0 1 0 2h-1v1a1 1 0 0 1-2 0v-1H6a2 2 0 0 1-2-2V7H3a1 1 0 1 1 0-2h1V4a1 1 0 1 1 2 0v13Zm3-5.3 1.3 2 3-4.7 3.7 6H7l2-3.3Z" fill-rule="nonzero"/></svg>',"embed-page":'<svg width="24" height="24"><path d="M19 6V5H5v14h2A13 13 0 0 1 19 6Zm0 1.4c-.8.8-1.6 2.4-2.2 4.6H19V7.4Zm0 5.6h-2.4c-.4 1.8-.6 3.8-.6 6h3v-6Zm-4 6c0-2.2.2-4.2.6-6H13c-.7 1.8-1.1 3.8-1.1 6h3Zm-4 0c0-2.2.4-4.2 1-6H9.6A12 12 0 0 0 8 19h3ZM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm11.8 9c.4-1.9 1-3.4 1.8-4.5a9.2 9.2 0 0 0-4 4.5h2.2Zm-3.4 0a12 12 0 0 1 2.8-4 12 12 0 0 0-5 4h2.2Z" fill-rule="nonzero"/></svg>',embed:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm1 2v14h14V5H5Zm4.8 2.6 5.6 4a.5.5 0 0 1 0 .8l-5.6 4A.5.5 0 0 1 9 16V8a.5.5 0 0 1 .8-.4Z" fill-rule="nonzero"/></svg>',emoji:'<svg width="24" height="24"><path d="M9 11c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1Zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1Zm-3 5.5c2.1 0 4-1.5 4.4-3.5H7.6c.5 2 2.3 3.5 4.4 3.5ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm0 14.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13Z" fill-rule="nonzero"/></svg>',export:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M14.4 3 18 7v1h-5V5H7v14h9a1 1 0 0 1 2 0c0 1-.8 2-1.9 2H7c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2h7.5Z"/><path d="M18.1 12c.5 0 .9.4.9 1 0 .5-.3 1-.8 1h-7.3c-.5 0-.9-.4-.9-1 0-.5.3-1 .8-1h7.3Z"/><path d="M16.4 9.2a1 1 0 0 1 1.4.2l2.4 3.6-2.4 3.6a1 1 0 0 1-1.7-1v-.2l1.7-2.4-1.6-2.4a1 1 0 0 1 .2-1.4Z"/></g></svg>',fill:'<svg width="24" height="26"><path d="m16.6 12-9-9-1.4 1.4 2.4 2.4-5.2 5.1c-.5.6-.5 1.6 0 2.2L9 19.6a1.5 1.5 0 0 0 2.2 0l5.5-5.5c.5-.6.5-1.6 0-2.2ZM5.2 13 10 8.2l4.8 4.8H5.2ZM19 14.5s-2 2.2-2 3.5c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.3-2-3.5-2-3.5Z" fill-rule="nonzero"/></svg>',"flip-horizontally":'<svg width="24" height="24"><path d="M14 19h2v-2h-2v2Zm4-8h2V9h-2v2ZM4 7v10c0 1.1.9 2 2 2h3v-2H6V7h3V5H6a2 2 0 0 0-2 2Zm14-2v2h2a2 2 0 0 0-2-2Zm-7 16h2V3h-2v18Zm7-6h2v-2h-2v2Zm-4-8h2V5h-2v2Zm4 12a2 2 0 0 0 2-2h-2v2Z" fill-rule="nonzero"/></svg>',"flip-vertically":'<svg width="24" height="24"><path d="M5 14v2h2v-2H5Zm8 4v2h2v-2h-2Zm4-14H7a2 2 0 0 0-2 2v3h2V6h10v3h2V6a2 2 0 0 0-2-2Zm2 14h-2v2a2 2 0 0 0 2-2ZM3 11v2h18v-2H3Zm6 7v2h2v-2H9Zm8-4v2h2v-2h-2ZM5 18c0 1.1.9 2 2 2v-2H5Z" fill-rule="nonzero"/></svg>',footnote:'<svg width="24" height="24"><path d="M19 13c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2h14Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M19 4v6h-1V5h-1.5V4h2.6Z"/><path d="M12 18c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2h7ZM14 8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2h9Z"/></svg>',"format-painter":'<svg width="24" height="24"><path d="M18 5V4c0-.5-.4-1-1-1H5a1 1 0 0 0-1 1v4c0 .6.5 1 1 1h12c.6 0 1-.4 1-1V7h1v4H9v9c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-7h8V5h-3Z" fill-rule="nonzero"/></svg>',format:'<svg width="24" height="24"><path fill-rule="evenodd" d="M17 5a1 1 0 0 1 0 2h-4v11a1 1 0 0 1-2 0V7H7a1 1 0 1 1 0-2h10Z"/></svg>',fullscreen:'<svg width="24" height="24"><path d="m15.3 10-1.2-1.3 2.9-3h-2.3a.9.9 0 1 1 0-1.7H19c.5 0 .9.4.9.9v4.4a.9.9 0 1 1-1.8 0V7l-2.9 3Zm0 4 3 3v-2.3a.9.9 0 1 1 1.7 0V19c0 .5-.4.9-.9.9h-4.4a.9.9 0 1 1 0-1.8H17l-3-2.9 1.3-1.2ZM10 15.4l-2.9 3h2.3a.9.9 0 1 1 0 1.7H5a.9.9 0 0 1-.9-.9v-4.4a.9.9 0 1 1 1.8 0V17l2.9-3 1.2 1.3ZM8.7 10 5.7 7v2.3a.9.9 0 0 1-1.7 0V5c0-.5.4-.9.9-.9h4.4a.9.9 0 0 1 0 1.8H7l3 2.9-1.3 1.2Z" fill-rule="nonzero"/></svg>',gallery:'<svg width="24" height="24"><path fill-rule="nonzero" d="m5 15.7 2.3-2.2c.3-.3.7-.3 1 0L11 16l5.1-5c.3-.4.8-.4 1 0l2 1.9V8H5v7.7ZM5 18V19h3l1.8-1.9-2-2L5 17.9Zm14-3-2.5-2.4-6.4 6.5H19v-4ZM4 6h16c.6 0 1 .4 1 1v13c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V7c0-.6.4-1 1-1Zm6 7a2 2 0 1 1 0-4 2 2 0 0 1 0 4ZM4.5 4h15a.5.5 0 1 1 0 1h-15a.5.5 0 0 1 0-1Zm2-2h11a.5.5 0 1 1 0 1h-11a.5.5 0 0 1 0-1Z"/></svg>',gamma:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm1 2v14h14V5H5Zm6.5 11.8V14L9.2 8.7a5.1 5.1 0 0 0-.4-.8l-.1-.2H8v-1l.3-.1.3-.1h.7a1 1 0 0 1 .6.5l.1.3a8.5 8.5 0 0 1 .3.6l1.9 4.6 2-5.2a1 1 0 0 1 1-.6.5.5 0 0 1 .5.6L13 14v2.8a.7.7 0 0 1-1.4 0Z" fill-rule="nonzero"/></svg>',help:'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M12 5.5a6.5 6.5 0 0 0-6 9 6.3 6.3 0 0 0 1.4 2l1 1a6.3 6.3 0 0 0 3.6 1 6.5 6.5 0 0 0 6-9 6.3 6.3 0 0 0-1.4-2l-1-1a6.3 6.3 0 0 0-3.6-1ZM12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4Z"/><path d="M9.6 9.7a.7.7 0 0 1-.7-.8c0-1.1 1.5-1.8 3.2-1.8 1.8 0 3.2.8 3.2 2.4 0 1.4-.4 2.1-1.5 2.8-.2 0-.3.1-.3.2a2 2 0 0 0-.8.8.8.8 0 0 1-1.4-.6c.3-.7.8-1 1.3-1.5l.4-.2c.7-.4.8-.6.8-1.5 0-.5-.6-.9-1.7-.9-.5 0-1 .1-1.4.3-.2 0-.3.1-.3.2v-.2c0 .4-.4.8-.8.8Z" fill-rule="nonzero"/><circle cx="12" cy="16" r="1"/></g></svg>',"highlight-bg-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path id="tox-icon-highlight-bg-color__color" d="M3 18h18v3H3z"/><path fill-rule="nonzero" d="M7.7 16.7H3l3.3-3.3-.7-.8L10.2 8l4 4.1-4 4.2c-.2.2-.6.2-.8 0l-.6-.7-1.1 1.1zm5-7.5L11 7.4l3-2.9a2 2 0 0 1 2.6 0L18 6c.7.7.7 2 0 2.7l-2.9 2.9-1.8-1.8-.5-.6"/></g></svg>',home:'<svg width="24" height="24"><path fill-rule="nonzero" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>',"horizontal-rule":'<svg width="24" height="24"><path d="M4 11h16v2H4z" fill-rule="evenodd"/></svg>',"image-options":'<svg width="24" height="24"><path d="M6 10a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Zm12 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Zm-6 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Z" fill-rule="nonzero"/></svg>',image:'<svg width="24" height="24"><path d="m5 15.7 3.3-3.2c.3-.3.7-.3 1 0L12 15l4.1-4c.3-.4.8-.4 1 0l2 1.9V5H5v10.7ZM5 18V19h3l2.8-2.9-2-2L5 17.9Zm14-3-2.5-2.4-6.4 6.5H19v-4ZM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm6 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill-rule="nonzero"/></svg>',indent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 1 1 0-2Zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2Zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2Zm-5 4h12a1 1 0 0 1 0 2H7a1 1 0 0 1 0-2Zm-2.6-3.8L6.2 12l-1.8-1.2a1 1 0 0 1 1.2-1.6l3 2a1 1 0 0 1 0 1.6l-3 2a1 1 0 1 1-1.2-1.6Z" fill-rule="evenodd"/></svg>',info:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4Zm-1 3v2h2V7h-2Zm3 10v-1h-1v-5h-3v1h1v4h-1v1h4Z" fill-rule="evenodd"/></svg>',"insert-character":'<svg width="24" height="24"><path d="M15 18h4l1-2v4h-6v-3.3l1.4-1a6 6 0 0 0 1.8-2.9 6.3 6.3 0 0 0-.1-4.1 5.8 5.8 0 0 0-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 0 0-3.9 1.8 6.3 6.3 0 0 0-1.3 6 6.2 6.2 0 0 0 1.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 0 1 4 11c0-1 .2-1.9.6-2.7A7 7 0 0 1 6.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 0 1 5.7 2 7 7 0 0 1 1.7 2.3 6 6 0 0 1 .2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 0 1-3.6 2.5v.5Z" fill-rule="evenodd"/></svg>',"insert-time":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M12 19a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm0 2a9 9 0 1 1 0-18 9 9 0 0 1 0 18Z"/><path d="M16 12h-3V7c0-.6-.4-1-1-1a1 1 0 0 0-1 1v7h5c.6 0 1-.4 1-1s-.4-1-1-1Z"/></g></svg>',invert:'<svg width="24" height="24"><path d="M18 19.3 16.5 18a5.8 5.8 0 0 1-3.1 1.9 6.1 6.1 0 0 1-5.5-1.6A5.8 5.8 0 0 1 6 14v-.3l.1-1.2A13.9 13.9 0 0 1 7.7 9l-3-3 .7-.8 2.8 2.9 9 8.9 1.5 1.6-.7.6Zm0-5.5v.3l-.1 1.1-.4 1-1.2-1.2a4.3 4.3 0 0 0 .2-1v-.2c0-.4 0-.8-.2-1.3l-.5-1.4a14.8 14.8 0 0 0-3-4.2L12 6a26.1 26.1 0 0 0-2.2 2.5l-1-1a20.9 20.9 0 0 1 2.9-3.3L12 4l1 .8a22.2 22.2 0 0 1 4 5.4c.6 1.2 1 2.4 1 3.6Z" fill-rule="evenodd"/></svg>',italic:'<svg width="24" height="24"><path d="m16.7 4.7-.1.9h-.3c-.6 0-1 0-1.4.3-.3.3-.4.6-.5 1.1l-2.1 9.8v.6c0 .5.4.8 1.4.8h.2l-.2.8H8l.2-.8h.2c1.1 0 1.8-.5 2-1.5l2-9.8.1-.5c0-.6-.4-.8-1.4-.8h-.3l.2-.9h5.8Z" fill-rule="evenodd"/></svg>',language:'<svg width="24" height="24"><path d="M12 3a9 9 0 1 1 0 18 9 9 0 0 1 0-18Zm4.3 13.3c-.5 1-1.2 2-2 2.9a7.5 7.5 0 0 0 3.2-2.1l-.2-.2a6 6 0 0 0-1-.6Zm-8.6 0c-.5.2-.9.5-1.2.8.9 1 2 1.7 3.2 2a10 10 0 0 1-2-2.8Zm3.6-.8c-.8 0-1.6.1-2.2.3.5 1 1.2 1.9 2.1 2.7Zm1.5 0v3c.9-.8 1.6-1.7 2.1-2.7-.6-.2-1.4-.3-2.1-.3Zm-6-2.7H4.5c.2 1 .5 2.1 1 3h.3l1.3-1a10 10 0 0 1-.3-2Zm12.7 0h-2.3c0 .7-.1 1.4-.3 2l1.6 1.1c.5-1 .9-2 1-3.1Zm-3.8 0h-3V14c1 0 2 .1 2.7.4.2-.5.3-1 .3-1.6Zm-4.4 0h-3l.3 1.6c.8-.3 1.7-.4 2.7-.4v-1.3Zm-5.5-5c-.7 1-1.1 2.2-1.3 3.5h2.3c0-1 .2-1.8.5-2.6l-1.5-1Zm2.9 1.4v.1c-.2.6-.4 1.3-.4 2h3V9.4c-1 0-1.8-.1-2.6-.3Zm6.6 0h-.1l-2.4.3v1.8h3l-.5-2.1Zm3-1.4-.3.1-1.3.8c.3.8.5 1.6.5 2.6h2.3a7.5 7.5 0 0 0-1.3-3.5Zm-9 0 2 .2V5.5a9 9 0 0 0-2 2.2Zm3.5-2.3V8c.6 0 1.3 0 1.9-.2a9 9 0 0 0-2-2.3Zm-3-.7h-.1c-1.1.4-2.1 1-3 1.8l1.2.7a10 10 0 0 1 1.9-2.5Zm4.4 0 .1.1a10 10 0 0 1 1.8 2.4l1.1-.7a7.5 7.5 0 0 0-3-1.8Z"/></svg>',"line-height":'<svg width="24" height="24"><path d="M21 5a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zm0 4a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zm0 4a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zm0 4a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zM7 3.6l3.7 3.7a1 1 0 0 1-1.3 1.5h-.1L8 7.3v9.2l1.3-1.3a1 1 0 0 1 1.3 0h.1c.4.4.4 1 0 1.3v.1L7 20.4l-3.7-3.7a1 1 0 0 1 1.3-1.5h.1L6 16.7V7.4L4.7 8.7a1 1 0 0 1-1.3 0h-.1a1 1 0 0 1 0-1.3v-.1L7 3.6z"/></svg>',line:'<svg width="24" height="24"><path d="m15 9-8 8H4v-3l8-8 3 3Zm1-1-3-3 1-1h1c-.2 0 0 0 0 0l2 2s0 .2 0 0v1l-1 1ZM4 18h16v2H4v-2Z" fill-rule="evenodd"/></svg>',link:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 0 1 1.4 1.4l-2 2a2 2 0 1 0 2.6 2.8l4.8-4.8a1 1 0 0 0 0-1.4 1 1 0 1 1 1.4-1.3 2.9 2.9 0 0 1 0 4L9.6 20a3.9 3.9 0 0 1-5.5-5.5l2-2Zm11.6-.6a1 1 0 0 1-1.4-1.4l2-2a2 2 0 1 0-2.6-2.8L11 10.3a1 1 0 0 0 0 1.4A1 1 0 1 1 9.6 13a2.9 2.9 0 0 1 0-4L14.4 4a3.9 3.9 0 0 1 5.5 5.5l-2 2Z" fill-rule="nonzero"/></svg>',"list-bull-circle":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M11 16a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6ZM11 26a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6ZM11 36a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6Z" fill-rule="nonzero"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-default":'<svg width="48" height="48"><g fill-rule="evenodd"><circle cx="11" cy="14" r="3"/><circle cx="11" cy="24" r="3"/><circle cx="11" cy="34" r="3"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-square":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M8 11h6v6H8zM8 21h6v6H8zM8 31h6v6H8z"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-num-default-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 17v-4.8h-.1l-1.5 1v-1.1l1.6-1.1h1.2v6zM33.3 17.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm1.7 5.7c0-1.2 1-2 2.2-2 1.3 0 2.1.8 2.1 1.8 0 .7-.3 1.2-1.3 2.2l-1.2 1v.2h2.6v1h-4.3v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H35zm-1.7 4.3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm3.2 7.3v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H35c0-1.1 1-1.8 2.2-1.8 1.2 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.7.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .6 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7zm-3.3 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7z"/></g></svg>',"list-num-default":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10 17v-4.8l-1.5 1v-1.1l1.6-1h1.2V17h-1.2Zm3.6.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7Zm-5 5.7c0-1.2.8-2 2.1-2s2.1.8 2.1 1.8c0 .7-.3 1.2-1.4 2.2l-1.1 1v.2h2.6v1H8.6v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H8.5Zm6.3 4.3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7ZM10 34.4v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H8.6c0-1.1 1-1.8 2.2-1.8 1.3 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.8.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .7 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7Zm4.7 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7Z"/></g></svg>',"list-num-lower-alpha-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M36.5 16c-.9 0-1.5-.5-1.5-1.3s.6-1.3 1.8-1.4h1v-.4c0-.4-.2-.6-.7-.6-.4 0-.7.1-.8.4h-1.1c0-.8.8-1.4 2-1.4S39 12 39 13V16h-1.2v-.6c-.3.4-.8.7-1.4.7Zm.4-.8c.6 0 1-.4 1-.9V14h-1c-.5.1-.7.3-.7.6 0 .4.3.6.7.6ZM33.1 16.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7ZM37.7 26c-.7 0-1.2-.2-1.5-.7v.7H35v-6.3h1.2v2.5c.3-.5.8-.9 1.5-.9 1.1 0 1.8 1 1.8 2.4 0 1.5-.7 2.4-1.8 2.4Zm-.5-3.6c-.6 0-1 .5-1 1.3s.4 1.4 1 1.4c.7 0 1-.6 1-1.4 0-.8-.3-1.3-1-1.3ZM33.2 26.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zm6 7h-1c-.1-.5-.4-.8-1-.8s-1 .5-1 1.4c0 1 .4 1.4 1 1.4.5 0 .9-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7zm-6.1 3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.3 15.2c.5 0 1-.4 1-.9V14h-1c-.5.1-.8.3-.8.6 0 .4.3.6.8.6Zm-.4.9c-1 0-1.5-.6-1.5-1.4 0-.8.6-1.3 1.7-1.4h1.1v-.4c0-.4-.2-.6-.7-.6-.5 0-.8.1-.9.4h-1c0-.8.8-1.4 2-1.4 1.1 0 1.8.6 1.8 1.6V16h-1.1v-.6h-.1c-.2.4-.7.7-1.3.7Zm4.6 0c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Zm-3.2 10c-.6 0-1.2-.3-1.4-.8v.7H8.5v-6.3H10v2.5c.3-.5.8-.9 1.4-.9 1.2 0 1.9 1 1.9 2.4 0 1.5-.7 2.4-1.9 2.4Zm-.4-3.7c-.7 0-1 .5-1 1.3s.3 1.4 1 1.4c.6 0 1-.6 1-1.4 0-.8-.4-1.3-1-1.3Zm4 3.7c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Zm-2.2 7h-1.2c0-.5-.4-.8-.9-.8-.6 0-1 .5-1 1.4 0 1 .4 1.4 1 1.4.5 0 .8-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7Zm1.8 3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Z"/></g></svg>',"list-num-lower-greek-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 16c-1.2 0-2-.8-2-2.3 0-1.5.8-2.4 2-2.4.6 0 1 .4 1.3 1v-.9H40v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1-.7h-.2c-.2.4-.7.8-1.3.8Zm.3-1c.6 0 1-.5 1-1.3s-.4-1.3-1-1.3-1 .5-1 1.3.4 1.4 1 1.4ZM33.3 16.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7ZM36 21.9c0-1.5.8-2.3 2.1-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.9 1.3.9.3 1.3.8 1.3 1.7 0 1.2-.7 1.9-1.8 1.9-.6 0-1.1-.3-1.4-.8v2.2H36V22Zm1.8 1.2v-1h.3c.5 0 .9-.2.9-.7 0-.5-.3-.8-.9-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1 1.3s1-.4 1-1-.4-1-1.2-1h-.3ZM33.3 26.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7ZM37.1 34.6 34.8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.2.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2Zm.7 1a2 2 0 0 0-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1ZM33.3 36.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Z"/></g></svg>',"list-num-lower-greek":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.5 15c.7 0 1-.5 1-1.3s-.3-1.3-1-1.3c-.5 0-.9.5-.9 1.3s.4 1.4 1 1.4Zm-.3 1c-1.1 0-1.8-.8-1.8-2.3 0-1.5.7-2.4 1.8-2.4.7 0 1.1.4 1.3 1h.1v-.9h1.2v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1.1-.7h-.1c-.2.4-.7.8-1.4.8Zm5 .1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7Zm-4.9 7v-1h.3c.6 0 1-.2 1-.7 0-.5-.4-.8-1-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1.1 1.3.6 0 1-.4 1-1s-.5-1-1.3-1h-.3ZM8.6 22c0-1.5.7-2.3 2-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.8 1.3.8.3 1.3.8 1.3 1.7 0 1.2-.8 1.9-1.9 1.9-.6 0-1.1-.3-1.3-.8v2.2H8.5V22Zm6.2 4.2c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7Zm-4.5 8.5L8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.1.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2Zm.7 1a2 2 0 0 0-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1Zm4.5.5c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Z"/></g></svg>',"list-num-lower-roman-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M32.9 16v-1.2h-1.3V16H33Zm0 10v-1.2h-1.3V26H33Zm0 10v-1.2h-1.3V36H33Z"/><path fill-rule="nonzero" d="M36 21h-1.5v5H36zM36 31h-1.5v5H36zM39 21h-1.5v5H39zM39 31h-1.5v5H39zM42 31h-1.5v5H42zM36 11h-1.5v5H36zM36 19h-1.5v1H36zM36 29h-1.5v1H36zM39 19h-1.5v1H39zM39 29h-1.5v1H39zM42 29h-1.5v1H42zM36 9h-1.5v1H36z"/></g></svg>',"list-num-lower-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 16v-1.2h1.3V16H15Zm0 10v-1.2h1.3V26H15Zm0 10v-1.2h1.3V36H15Z"/><path fill-rule="nonzero" d="M12 21h1.5v5H12zM12 31h1.5v5H12zM9 21h1.5v5H9zM9 31h1.5v5H9zM6 31h1.5v5H6zM12 11h1.5v5H12zM12 19h1.5v1H12zM12 29h1.5v1H12zM9 19h1.5v1H9zM9 29h1.5v1H9zM6 29h1.5v1H6zM12 9h1.5v1H12z"/></g></svg>',"list-num-upper-alpha-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="m39.3 17-.5-1.4h-2l-.5 1.4H35l2-6h1.6l2 6h-1.3Zm-1.6-4.7-.7 2.3h1.6l-.8-2.3ZM33.4 17c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7Zm4.7 9.9h-2.7v-6H38c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7Zm-1.4-5v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1Zm0 4h1.1c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9h-1.1V26ZM33 27.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Zm4.9 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2Zm-4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Z"/></g></svg>',"list-num-upper-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="m12.6 17-.5-1.4h-2L9.5 17H8.3l2-6H12l2 6h-1.3ZM11 12.3l-.7 2.3h1.6l-.8-2.3Zm4.7 4.8c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7ZM11.4 27H8.7v-6h2.6c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7ZM10 22v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1Zm0 4H11c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9H10V26Zm5.4 1.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Zm-4.1 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2Zm4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Z"/></g></svg>',"list-num-upper-roman-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M31.6 17v-1.2H33V17h-1.3Zm0 10v-1.2H33V27h-1.3Zm0 10v-1.2H33V37h-1.3Z"/><path fill-rule="nonzero" d="M34.5 20H36v7h-1.5zM34.5 30H36v7h-1.5zM37.5 20H39v7h-1.5zM37.5 30H39v7h-1.5zM40.5 30H42v7h-1.5zM34.5 10H36v7h-1.5z"/></g></svg>',"list-num-upper-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 17v-1.2h1.3V17H15Zm0 10v-1.2h1.3V27H15Zm0 10v-1.2h1.3V37H15Z"/><path fill-rule="nonzero" d="M12 20h1.5v7H12zM12 30h1.5v7H12zM9 20h1.5v7H9zM9 30h1.5v7H9zM6 30h1.5v7H6zM12 10h1.5v7H12z"/></g></svg>',lock:'<svg width="24" height="24"><path d="M16.3 11c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H8V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h.3ZM10 8v3h4V8a1 1 0 0 0-.3-.7A1 1 0 0 0 13 7h-2a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7Z" fill-rule="evenodd"/></svg>',ltr:'<svg width="24" height="24"><path d="M11 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 7.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L11 5ZM4.4 16.2 6.2 15l-1.8-1.2a1 1 0 0 1 1.2-1.6l3 2a1 1 0 0 1 0 1.6l-3 2a1 1 0 1 1-1.2-1.6Z" fill-rule="evenodd"/></svg>',"more-drawer":'<svg width="24" height="24"><path d="M6 10a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Zm12 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Zm-6 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Z" fill-rule="nonzero"/></svg>',"new-document":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h10a2 2 0 0 0 2-2V7.6L14.4 3ZM17 19H7V5h6v4h4v10Z" fill-rule="nonzero"/></svg>',"new-tab":'<svg width="24" height="24"><path d="m15 13 2-2v8H5V7h8l-2 2H7v8h8v-4Zm4-8v5.5l-2-2-5.6 5.5H10v-1.4L15.5 7l-2-2H19Z" fill-rule="evenodd"/></svg>',"non-breaking":'<svg width="24" height="24"><path d="M11 11H8a1 1 0 1 1 0-2h3V6c0-.6.4-1 1-1s1 .4 1 1v3h3c.6 0 1 .4 1 1s-.4 1-1 1h-3v3c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-3Zm10 4v5H3v-5c0-.6.4-1 1-1s1 .4 1 1v3h14v-3c0-.6.4-1 1-1s1 .4 1 1Z" fill-rule="evenodd"/></svg>',notice:'<svg width="24" height="24"><path d="M15.5 4 20 8.5v7L15.5 20h-7L4 15.5v-7L8.5 4h7ZM13 17v-2h-2v2h2Zm0-4V7h-2v6h2Z" fill-rule="evenodd" clip-rule="evenodd"/></svg>',"ordered-list-rtl":'<svg width="24" height="24"><path d="M6 17h8a1 1 0 0 1 0 2H6a1 1 0 0 1 0-2Zm0-6h8a1 1 0 0 1 0 2H6a1 1 0 0 1 0-2Zm0-6h8a1 1 0 0 1 0 2H6a1 1 0 1 1 0-2Zm13-1v3.5a.5.5 0 1 1-1 0V5h-.5a.5.5 0 1 1 0-1H19Zm-1 8.8.2.2h1.3a.5.5 0 1 1 0 1h-1.6a1 1 0 0 1-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 0 0-.2-.2h-1.3a.5.5 0 0 1-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3Zm2 4.2v2c0 .6-.4 1-1 1h-1.5a.5.5 0 0 1 0-1h1.2a.3.3 0 1 0 0-.6h-1.3a.4.4 0 1 1 0-.8h1.3a.3.3 0 0 0 0-.6h-1.2a.5.5 0 1 1 0-1H19c.6 0 1 .4 1 1Z" fill-rule="evenodd"/></svg>',"ordered-list":'<svg width="24" height="24"><path d="M10 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 1 1 0-2ZM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 0 1-.5-.5V5h-.5a.5.5 0 0 1 0-1H6Zm-1 8.8.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 0 1-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 0 0-.2-.2H4.5a.5.5 0 0 1-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3ZM7 17v2c0 .6-.4 1-1 1H4.5a.5.5 0 0 1 0-1h1.2c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.4a.4.4 0 1 1 0-.8h1.3c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.5a.5.5 0 1 1 0-1H6c.6 0 1 .4 1 1Z" fill-rule="evenodd"/></svg>',orientation:'<svg width="24" height="24"><path d="M7.3 6.4 1 13l6.4 6.5 6.5-6.5-6.5-6.5ZM3.7 13l3.6-3.7L11 13l-3.7 3.7-3.6-3.7ZM12 6l2.8 2.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0L9.2 5.7a.8.8 0 0 1 0-1.2L13.6.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L12 4h1a9 9 0 1 1-4.3 16.9l1.5-1.5A7 7 0 1 0 13 6h-1Z" fill-rule="nonzero"/></svg>',outdent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 1 1 0-2Zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2Zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2Zm-5 4h12a1 1 0 0 1 0 2H7a1 1 0 0 1 0-2Zm1.6-3.8a1 1 0 0 1-1.2 1.6l-3-2a1 1 0 0 1 0-1.6l3-2a1 1 0 0 1 1.2 1.6L6.8 12l1.8 1.2Z" fill-rule="evenodd"/></svg>',"page-break":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M5 11c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2Zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2Zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2Zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1h-1a1 1 0 0 1 0-2Zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2ZM7 3v5h10V3c0-.6.4-1 1-1s1 .4 1 1v7H5V3c0-.6.4-1 1-1s1 .4 1 1ZM6 22a1 1 0 0 1-1-1v-7h14v7c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-5H7v5c0 .6-.4 1-1 1Z"/></g></svg>',paragraph:'<svg width="24" height="24"><path fill-rule="evenodd" d="M10 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 6.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L10 5Z"/></svg>',"paste-column-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h7v2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0 1 12 1Zm8 7v12h-6V8h6Zm-1.5 1.5h-3v9h3v-9ZM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"/></svg>',"paste-column-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V18c0 1-.8 2-1.9 2H11v-2h7V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v2H4V5c0-1 .8-2 1.9-2H9.2A3 3 0 0 1 12 1Zm-2 7v12H4V8h6ZM8.5 9.5h-3v9h3v-9ZM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"/></svg>',"paste-row-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V11h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h14c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0 1 12 1Zm10 11v5H8v-5h14Zm-1.5 1.5h-11v2h11v-2ZM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"/></svg>',"paste-row-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h12v-4h2v4c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0 1 12 1Zm10 7v5H8V8h14Zm-1.5 1.5h-11v2h11v-2ZM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"/></svg>',"paste-text":'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h3V9h9ZM9 20H6a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0 1 12 1a3 3 0 0 1 2.8 2H18a2 2 0 0 1 2 2v4h1v12H9v-1Zm1.5-9.5v9h9v-9h-9ZM12 3a1 1 0 0 0-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1Zm0 9h6v2h-.5l-.5-1h-1v4h.8v1h-3.6v-1h.8v-4h-1l-.5 1H12v-2Z" fill-rule="nonzero"/></svg>',paste:'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h3V9h9ZM9 20H6a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0 1 12 1a3 3 0 0 1 2.8 2H18a2 2 0 0 1 2 2v4h1v12H9v-1Zm1.5-9.5v9h9v-9h-9ZM12 3a1 1 0 0 0-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1Z" fill-rule="nonzero"/></svg>',"permanent-pen":'<svg width="24" height="24"><path d="M10.5 17.5 8 20H3v-3l3.5-3.5a2 2 0 0 1 0-3L14 3l1 1-7.3 7.3a1 1 0 0 0 0 1.4l3.6 3.6c.4.4 1 .4 1.4 0L20 9l1 1-7.6 7.6a2 2 0 0 1-2.8 0l-.1-.1Z" fill-rule="nonzero"/></svg>',plus:'<svg width="24" height="24"><path d="M12 4c.5 0 1 .4 1 .9V11h6a1 1 0 0 1 .1 2H13v6a1 1 0 0 1-2 .1V13H5a1 1 0 0 1-.1-2H11V5c0-.6.4-1 1-1Z"/></svg>',preferences:'<svg width="24" height="24"><path d="m20.1 13.5-1.9.2a5.8 5.8 0 0 1-.6 1.5l1.2 1.5c.4.4.3 1 0 1.4l-.7.7a1 1 0 0 1-1.4 0l-1.5-1.2a6.2 6.2 0 0 1-1.5.6l-.2 1.9c0 .5-.5.9-1 .9h-1a1 1 0 0 1-1-.9l-.2-1.9a5.8 5.8 0 0 1-1.5-.6l-1.5 1.2a1 1 0 0 1-1.4 0l-.7-.7a1 1 0 0 1 0-1.4l1.2-1.5a6.2 6.2 0 0 1-.6-1.5l-1.9-.2a1 1 0 0 1-.9-1v-1c0-.5.4-1 .9-1l1.9-.2a5.8 5.8 0 0 1 .6-1.5L5.2 7.3a1 1 0 0 1 0-1.4l.7-.7a1 1 0 0 1 1.4 0l1.5 1.2a6.2 6.2 0 0 1 1.5-.6l.2-1.9c0-.5.5-.9 1-.9h1c.5 0 1 .4 1 .9l.2 1.9a5.8 5.8 0 0 1 1.5.6l1.5-1.2a1 1 0 0 1 1.4 0l.7.7c.3.4.4 1 0 1.4l-1.2 1.5a6.2 6.2 0 0 1 .6 1.5l1.9.2c.5 0 .9.5.9 1v1c0 .5-.4 1-.9 1ZM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z" fill-rule="evenodd"/></svg>',preview:'<svg width="24" height="24"><path d="M3.5 12.5c.5.8 1.1 1.6 1.8 2.3 2 2 4.2 3.2 6.7 3.2s4.7-1.2 6.7-3.2a16.2 16.2 0 0 0 2.1-2.8 15.7 15.7 0 0 0-2.1-2.8c-2-2-4.2-3.2-6.7-3.2a9.3 9.3 0 0 0-6.7 3.2A16.2 16.2 0 0 0 3.2 12c0 .2.2.3.3.5Zm-2.4-1 .7-1.2L4 7.8C6.2 5.4 8.9 4 12 4c3 0 5.8 1.4 8.1 3.8a18.2 18.2 0 0 1 2.8 3.7v1l-.7 1.2-2.1 2.5c-2.3 2.4-5 3.8-8.1 3.8-3 0-5.8-1.4-8.1-3.8a18.2 18.2 0 0 1-2.8-3.7 1 1 0 0 1 0-1Zm12-3.3a2 2 0 1 0 2.7 2.6 4 4 0 1 1-2.6-2.6Z" fill-rule="nonzero"/></svg>',print:'<svg width="24" height="24"><path d="M18 8H6a3 3 0 0 0-3 3v6h2v3h14v-3h2v-6a3 3 0 0 0-3-3Zm-1 10H7v-4h10v4Zm.5-5c-.8 0-1.5-.7-1.5-1.5s.7-1.5 1.5-1.5 1.5.7 1.5 1.5-.7 1.5-1.5 1.5Zm.5-8H6v2h12V5Z" fill-rule="nonzero"/></svg>',quote:'<svg width="24" height="24"><path d="M7.5 17h.9c.4 0 .7-.2.9-.6L11 13V8c0-.6-.4-1-1-1H6a1 1 0 0 0-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 0 0 .8 1.3Zm8 0h.9c.4 0 .7-.2.9-.6L19 13V8c0-.6-.4-1-1-1h-4a1 1 0 0 0-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 0 0 .8 1.3Z" fill-rule="nonzero"/></svg>',redo:'<svg width="24" height="24"><path d="M17.6 10H12c-2.8 0-4.4 1.4-4.9 3.5-.4 2 .3 4 1.4 4.6a1 1 0 1 1-1 1.8c-2-1.2-2.9-4.1-2.3-6.8.6-3 3-5.1 6.8-5.1h5.6l-3.3-3.3a1 1 0 1 1 1.4-1.4l5 5a1 1 0 0 1 0 1.4l-5 5a1 1 0 0 1-1.4-1.4l3.3-3.3Z" fill-rule="nonzero"/></svg>',reload:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="m5 22.1-1.2-4.7v-.2a1 1 0 0 1 1-1l5 .4a1 1 0 1 1-.2 2l-2.2-.2a7.8 7.8 0 0 0 8.4.2 7.5 7.5 0 0 0 3.5-6.4 1 1 0 1 1 2 0 9.5 9.5 0 0 1-4.5 8 9.9 9.9 0 0 1-10.2 0l.4 1.4a1 1 0 1 1-2 .5ZM13.6 7.4c0-.5.5-1 1-.9l2.8.2a8 8 0 0 0-9.5-1 7.5 7.5 0 0 0-3.6 7 1 1 0 0 1-2 0 9.5 9.5 0 0 1 4.5-8.6 10 10 0 0 1 10.9.3l-.3-1a1 1 0 0 1 2-.5l1.1 4.8a1 1 0 0 1-1 1.2l-5-.4a1 1 0 0 1-.9-1Z"/></g></svg>',"remove-formatting":'<svg width="24" height="24"><path d="M13.2 6a1 1 0 0 1 0 .2l-2.6 10a1 1 0 0 1-1 .8h-.2a.8.8 0 0 1-.8-1l2.6-10H8a1 1 0 1 1 0-2h9a1 1 0 0 1 0 2h-3.8ZM5 18h7a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Zm13 1.5L16.5 18 15 19.5a.7.7 0 0 1-1-1l1.5-1.5-1.5-1.5a.7.7 0 0 1 1-1l1.5 1.5 1.5-1.5a.7.7 0 0 1 1 1L17.5 17l1.5 1.5a.7.7 0 0 1-1 1Z" fill-rule="evenodd"/></svg>',remove:'<svg width="24" height="24"><path d="M16 7h3a1 1 0 0 1 0 2h-1v9a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3V9H5a1 1 0 1 1 0-2h3V6a3 3 0 0 1 3-3h2a3 3 0 0 1 3 3v1Zm-2 0V6c0-.6-.4-1-1-1h-2a1 1 0 0 0-1 1v1h4Zm2 2H8v9c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V9Zm-7 3a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0v-4Zm4 0a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0v-4Z" fill-rule="nonzero"/></svg>',"resize-handle":'<svg width="10" height="10"><g fill-rule="nonzero"><path d="M8.1 1.1A.5.5 0 1 1 9 2l-7 7A.5.5 0 1 1 1 8l7-7ZM8.1 5.1A.5.5 0 1 1 9 6l-3 3A.5.5 0 1 1 5 8l3-3Z"/></g></svg>',resize:'<svg width="24" height="24"><path d="M4 5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h6c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 0 1-.7.3H7.4L18 16.6V13c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v6c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-6a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3.6L6 7.4V11c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.7-.3A1 1 0 0 1 4 11V5Z" fill-rule="evenodd"/></svg>',"restore-draft":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M17 13c0 .6-.4 1-1 1h-4V8c0-.6.4-1 1-1s1 .4 1 1v4h2c.6 0 1 .4 1 1Z"/><path d="M4.7 10H9a1 1 0 0 1 0 2H3a1 1 0 0 1-1-1V5a1 1 0 1 1 2 0v3l2.5-2.4a9.2 9.2 0 0 1 10.8-1.5A9 9 0 0 1 13.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 1 1 1.3-1.5 7.2 7.2 0 0 0 11.6-3.7 7 7 0 0 0-3.5-7.7A7.2 7.2 0 0 0 8 7L4.7 10Z" fill-rule="nonzero"/></g></svg>',"rotate-left":'<svg width="24" height="24"><path d="M4.7 10H9a1 1 0 0 1 0 2H3a1 1 0 0 1-1-1V5a1 1 0 1 1 2 0v3l2.5-2.4a9.2 9.2 0 0 1 10.8-1.5A9 9 0 0 1 13.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 1 1 1.3-1.5 7.2 7.2 0 0 0 11.6-3.7 7 7 0 0 0-3.5-7.7A7.2 7.2 0 0 0 8 7L4.7 10Z" fill-rule="nonzero"/></svg>',"rotate-right":'<svg width="24" height="24"><path d="M20 8V5a1 1 0 0 1 2 0v6c0 .6-.4 1-1 1h-6a1 1 0 0 1 0-2h4.3L16 7A7.2 7.2 0 0 0 7.7 6a7 7 0 0 0 3 13.1c1.9.1 3.7-.5 5-1.7a1 1 0 0 1 1.4 1.5A9.2 9.2 0 0 1 2.2 14c-.9-3.9 1-8 4.5-9.9 3.5-1.9 8-1.3 10.8 1.5L20 8Z" fill-rule="nonzero"/></svg>',rtl:'<svg width="24" height="24"><path d="M8 5h8v2h-2v12h-2V7h-2v12H8v-7c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 4.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L8 5Zm12 11.2a1 1 0 1 1-1 1.6l-3-2a1 1 0 0 1 0-1.6l3-2a1 1 0 1 1 1 1.6L18.4 15l1.8 1.2Z" fill-rule="evenodd"/></svg>',save:'<svg width="24" height="24"><path d="M5 16h14a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2Zm0 2v2h14v-2H5Zm10 0h2v2h-2v-2Zm-4-6.4L8.7 9.3a1 1 0 1 0-1.4 1.4l4 4c.4.4 1 .4 1.4 0l4-4a1 1 0 1 0-1.4-1.4L13 11.6V4a1 1 0 0 0-2 0v7.6Z" fill-rule="nonzero"/></svg>',search:'<svg width="24" height="24"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3Zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12Z" fill-rule="nonzero"/></svg>',"select-all":'<svg width="24" height="24"><path d="M3 5h2V3a2 2 0 0 0-2 2Zm0 8h2v-2H3v2Zm4 8h2v-2H7v2ZM3 9h2V7H3v2Zm10-6h-2v2h2V3Zm6 0v2h2a2 2 0 0 0-2-2ZM5 21v-2H3c0 1.1.9 2 2 2Zm-2-4h2v-2H3v2ZM9 3H7v2h2V3Zm2 18h2v-2h-2v2Zm8-8h2v-2h-2v2Zm0 8a2 2 0 0 0 2-2h-2v2Zm0-12h2V7h-2v2Zm0 8h2v-2h-2v2Zm-4 4h2v-2h-2v2Zm0-16h2V3h-2v2ZM7 17h10V7H7v10Zm2-8h6v6H9V9Z" fill-rule="nonzero"/></svg>',selected:'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2Zm3.6 10.9L7 12.3a.7.7 0 0 0-1 1L9.6 17 18 8.6a.7.7 0 0 0 0-1 .7.7 0 0 0-1 0l-7.4 7.3Z"/></svg>',settings:'<svg width="24" height="24"><path d="M11 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V8H5a1 1 0 1 1 0-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.5V6ZM8 8h2V6H8v2Zm9 2.8v.2h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v.3c0 .2 0 .3-.2.5l-.6.2h-2.4c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V13H5a1 1 0 0 1 0-2h8v-.3c0-.2 0-.3.2-.5l.6-.2h2.4c.3 0 .4 0 .6.2l.2.6ZM14 13h2v-2h-2v2Zm-3 2.8v.2h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V18H5a1 1 0 0 1 0-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.6ZM8 18h2v-2H8v2Z" fill-rule="evenodd"/></svg>',sharpen:'<svg width="24" height="24"><path d="m16 6 4 4-8 9-8-9 4-4h8Zm-4 10.2 5.5-6.2-.1-.1H12v-.3h5.1l-.2-.2H12V9h4.6l-.2-.2H12v-.3h4.1l-.2-.2H12V8h3.6l-.2-.2H8.7L6.5 10l.1.1H12v.3H6.9l.2.2H12v.3H7.3l.2.2H12v.3H7.7l.3.2h4v.3H8.2l.2.2H12v.3H8.6l.3.2H12v.3H9l.3.2H12v.3H9.5l.2.2H12v.3h-2l.2.2H12v.3h-1.6l.2.2H12v.3h-1.1l.2.2h.9v.3h-.7l.2.2h.5v.3h-.3l.3.2Z" fill-rule="evenodd"/></svg>',sourcecode:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M9.8 15.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0l-4.4-4.1a.8.8 0 0 1 0-1.2l4.4-4.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L6 12l3.8 3.7ZM14.2 15.7c-.3.3-.3.8 0 1 .4.4.9.4 1.2 0l4.4-4.1c.3-.3.3-.9 0-1.2l-4.4-4.2a.8.8 0 0 0-1.2 0c-.3.3-.3.8 0 1.1L18 12l-3.8 3.7Z"/></g></svg>',"spell-check":'<svg width="24" height="24"><path d="M6 8v3H5V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h2c.3 0 .5.1.7.3.2.2.3.4.3.7v6H8V8H6Zm0-3v2h2V5H6Zm13 0h-3v5h3v1h-3a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3v1Zm-5 1.5-.1.7c-.1.2-.3.3-.6.3.3 0 .5.1.6.3l.1.7V10c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-3V4h3c.3 0 .5.1.7.3.2.2.3.4.3.7v1.5ZM13 10V8h-2v2h2Zm0-3V5h-2v2h2Zm3 5 1 1-6.5 7L7 15.5l1.3-1 2.2 2.2L16 12Z" fill-rule="evenodd"/></svg>',"strike-through":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M15.6 8.5c-.5-.7-1-1.1-1.3-1.3-.6-.4-1.3-.6-2-.6-2.7 0-2.8 1.7-2.8 2.1 0 1.6 1.8 2 3.2 2.3 4.4.9 4.6 2.8 4.6 3.9 0 1.4-.7 4.1-5 4.1A6.2 6.2 0 0 1 7 16.4l1.5-1.1c.4.6 1.6 2 3.7 2 1.6 0 2.5-.4 3-1.2.4-.8.3-2-.8-2.6-.7-.4-1.6-.7-2.9-1-1-.2-3.9-.8-3.9-3.6C7.6 6 10.3 5 12.4 5c2.9 0 4.2 1.6 4.7 2.4l-1.5 1.1Z"/><path d="M5 11h14a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Z" fill-rule="nonzero"/></g></svg>',subscript:'<svg width="24" height="24"><path d="m10.4 10 4.6 4.6-1.4 1.4L9 11.4 4.4 16 3 14.6 7.6 10 3 5.4 4.4 4 9 8.6 13.6 4 15 5.4 10.4 10ZM21 19h-5v-1l1-.8 1.7-1.6c.3-.4.5-.8.5-1.2 0-.3 0-.6-.2-.7-.2-.2-.5-.3-.9-.3a2 2 0 0 0-.8.2l-.7.3-.4-1.1 1-.6 1.2-.2c.8 0 1.4.3 1.8.7.4.4.6.9.6 1.5s-.2 1.1-.5 1.6a8 8 0 0 1-1.3 1.3l-.6.6h2.6V19Z" fill-rule="nonzero"/></svg>',superscript:'<svg width="24" height="24"><path d="M15 9.4 10.4 14l4.6 4.6-1.4 1.4L9 15.4 4.4 20 3 18.6 7.6 14 3 9.4 4.4 8 9 12.6 13.6 8 15 9.4Zm5.9 1.6h-5v-1l1-.8 1.7-1.6c.3-.5.5-.9.5-1.3 0-.3 0-.5-.2-.7-.2-.2-.5-.3-.9-.3l-.8.2-.7.4-.4-1.2c.2-.2.5-.4 1-.5.3-.2.8-.2 1.2-.2.8 0 1.4.2 1.8.6.4.4.6 1 .6 1.6 0 .5-.2 1-.5 1.5l-1.3 1.4-.6.5h2.6V11Z" fill-rule="nonzero"/></svg>',"table-caption":'<svg width="24" height="24"><g fill-rule="nonzero"><rect width="12" height="2" x="3" y="4" rx="1"/><path d="M19 8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-8c0-1.1.9-2 2-2h14ZM5 15v3h6v-3H5Zm14 0h-6v3h6v-3Zm0-5h-6v3h6v-3ZM5 13h6v-3H5v3Z"/></g></svg>',"table-cell-classes":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M13 4v9H3V6c0-1.1.9-2 2-2h8Zm-2 2H5v5h6V6Z"/><path fill-rule="nonzero" d="M13 4h6a2 2 0 0 1 2 2v7h-8v-2h6V6h-6V4Z" opacity=".2"/><path d="m18 20-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3.1.2-2.4 2 .7 3z"/><path fill-rule="nonzero" d="M3 13v5c0 1.1.9 2 2 2h8v-7h-2v5H5v-5H3Z" opacity=".2"/></g></svg>',"table-cell-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-8 9H5v5h6v-5Zm8 0h-6v5h6v-5Zm-8-7H5v5h6V6Z"/></svg>',"table-cell-select-all":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm0 2H5v12h14V6Z"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2Z" opacity=".2"/></g></svg>',"table-cell-select-inner":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm0 2H5v12h14V6Z" opacity=".2"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2Z"/></g></svg>',"table-classes":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v7h-8v7H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-8 9H5v5h6v-5Zm8-7h-6v5h6V6Zm-8 0H5v5h6V6Z"/><path d="m18 20-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3.1.2-2.4 2 .7 3z"/></g></svg>',"table-delete-column":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-4 4h-2V6h-2v2H9V6H5v12h4v-2h2v2h2v-2h2v2h4V6h-4v2Zm.3.5 1 1.2-3 2.3 3 2.3-1 1.2L12 13l-3.3 2.6-1-1.2 3-2.3-3-2.3 1-1.2L12 11l3.3-2.5Z"/></svg>',"table-delete-row":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm0 2H5v3h2.5v2H5v2h2.5v2H5v3h14v-3h-2.5v-2H19v-2h-2.5V9H19V6Zm-4.7 1.8 1.2 1L13 12l2.6 3.3-1.2 1-2.3-3-2.3 3-1.2-1L11 12 8.5 8.7l1.2-1 2.3 3 2.3-3Z"/></svg>',"table-delete-table":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM5 6v12h14V6H5Z"/><path d="m14.4 8.6 1.1 1-2.4 2.4 2.4 2.4-1.1 1.1-2.4-2.4-2.4 2.4-1-1.1 2.3-2.4-2.3-2.4 1-1 2.4 2.3z"/></g></svg>',"table-insert-column-after":'<svg width="24" height="24"><path fill-rule="nonzero" d="M20 4c.6 0 1 .4 1 1v2a1 1 0 0 1-2 0V6h-8v12h8v-1a1 1 0 0 1 2 0v2c0 .5-.4 1-.9 1H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h15ZM9 13H5v5h4v-5Zm7-5c.5 0 1 .4 1 .9V11h2a1 1 0 0 1 .1 2H17v2a1 1 0 0 1-2 .1V13h-2a1 1 0 0 1-.1-2H15V9c0-.6.4-1 1-1ZM9 6H5v5h4V6Z"/></svg>',"table-insert-column-before":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a1 1 0 0 1-1-1v-2a1 1 0 0 1 2 0v1h8V6H5v1a1 1 0 1 1-2 0V5c0-.6.4-1 1-1h15Zm0 9h-4v5h4v-5ZM8 8c.5 0 1 .4 1 .9V11h2a1 1 0 0 1 .1 2H9v2a1 1 0 0 1-2 .1V13H5a1 1 0 0 1-.1-2H7V9c0-.6.4-1 1-1Zm11-2h-4v5h4V6Z"/></svg>',"table-insert-row-above":'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4a1 1 0 1 1 0 2H5v6h14V6h-1a1 1 0 0 1 0-2h2c.6 0 1 .4 1 1v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5c0-.6.4-1 1-1h2Zm5 10H5v4h6v-4Zm8 0h-6v4h6v-4ZM12 3c.5 0 1 .4 1 .9V6h2a1 1 0 0 1 0 2h-2v2a1 1 0 0 1-2 .1V8H9a1 1 0 0 1 0-2h2V4c0-.6.4-1 1-1Z"/></svg>',"table-insert-row-after":'<svg width="24" height="24"><path fill-rule="nonzero" d="M12 13c.5 0 1 .4 1 .9V16h2a1 1 0 0 1 .1 2H13v2a1 1 0 0 1-2 .1V18H9a1 1 0 0 1-.1-2H11v-2c0-.6.4-1 1-1Zm6 7a1 1 0 0 1 0-2h1v-6H5v6h1a1 1 0 0 1 0 2H4a1 1 0 0 1-1-1V6c0-1.1.9-2 2-2h14a2 2 0 0 1 2 2v13c0 .5-.4 1-.9 1H18ZM11 6H5v4h6V6Zm8 0h-6v4h6V6Z"/></svg>',"table-left-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm0 9h-4v5h4v-5Zm-6 0H9v5h4v-5Zm0-7H9v5h4V6Zm6 0h-4v5h4V6Z"/></svg>',"table-merge-cells":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM5 15.5V18h3v-2.5H5Zm14-5h-9V18h9v-7.5ZM19 6h-4v2.5h4V6ZM8 6H5v2.5h3V6Zm5 0h-3v2.5h3V6Zm-8 7.5h3v-3H5v3Z"/></svg>',"table-row-numbering-rtl":'<svg width="24" height="24"><path d="M6 4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2H6Zm0 12h8v3H6v-3Zm11 0c.6 0 1 .4 1 1v1a1 1 0 0 1-2 0v-1c0-.6.4-1 1-1ZM6 11h8v3H6v-3Zm11 0c.6 0 1 .4 1 1v1a1 1 0 0 1-2 0v-1c0-.6.4-1 1-1ZM6 6h8v3H6V6Zm11 0c.6 0 1 .4 1 1v1a1 1 0 1 1-2 0V7c0-.6.4-1 1-1Z"/></svg>',"table-row-numbering":'<svg width="24" height="24"><path d="M18 4a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h12Zm0 12h-8v3h8v-3ZM7 16a1 1 0 0 0-1 1v1a1 1 0 0 0 2 0v-1c0-.6-.4-1-1-1Zm11-5h-8v3h8v-3ZM7 11a1 1 0 0 0-1 1v1a1 1 0 0 0 2 0v-1c0-.6-.4-1-1-1Zm11-5h-8v3h8V6ZM7 6a1 1 0 0 0-1 1v1a1 1 0 1 0 2 0V7c0-.6-.4-1-1-1Z"/></svg>',"table-row-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM5 15v3h6v-3H5Zm14 0h-6v3h6v-3Zm0-9h-6v3h6V6ZM5 9h6V6H5v3Z"/></svg>',"table-split-cells":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM8 15.5H5V18h3v-2.5Zm11-5h-9V18h9v-7.5Zm-2.5 1 1 1-2 2 2 2-1 1-2-2-2 2-1-1 2-2-2-2 1-1 2 2 2-2Zm-8.5-1H5v3h3v-3ZM19 6h-4v2.5h4V6ZM8 6H5v2.5h3V6Zm5 0h-3v2.5h3V6Z"/></svg>',"table-top-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-8 11H5v3h6v-3Zm8 0h-6v3h6v-3Zm0-5h-6v3h6v-3ZM5 13h6v-3H5v3Z"/></svg>',table:'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM5 14v4h6v-4H5Zm14 0h-6v4h6v-4Zm0-6h-6v4h6V8ZM5 12h6V8H5v4Z"/></svg>',template:'<svg width="24" height="24"><path d="M19 19v-1H5v1h14ZM9 16v-4a5 5 0 1 1 6 0v4h4a2 2 0 0 1 2 2v3H3v-3c0-1.1.9-2 2-2h4Zm4 0v-5l.8-.6a3 3 0 1 0-3.6 0l.8.6v5h2Z" fill-rule="nonzero"/></svg>',"temporary-placeholder":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M9 7.6V6h2.5V4.5a.5.5 0 1 1 1 0V6H15v1.6a8 8 0 1 1-6 0Zm-2.6 5.3a.5.5 0 0 0 .3.6c.3 0 .6 0 .6-.3l.1-.2a5 5 0 0 1 3.3-2.8c.3-.1.4-.4.4-.6-.1-.3-.4-.5-.6-.4a6 6 0 0 0-4.1 3.7Z"/><circle cx="14" cy="4" r="1"/><circle cx="12" cy="2" r="1"/><circle cx="10" cy="4" r="1"/></g></svg>',"text-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path id="tox-icon-text-color__color" d="M3 18h18v3H3z"/><path d="M8.7 16h-.8a.5.5 0 0 1-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 0 1-.5.6h-.8a.5.5 0 0 1-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4Zm2.6-7.6-.6 2a.5.5 0 0 0 .5.6h1.6a.5.5 0 0 0 .5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4Z"/></g></svg>',toc:'<svg width="24" height="24"><path d="M5 5c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 1 1 0-2Zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 1 1 0-2Zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2Zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2Zm0-4c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 1 1 0-2Zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2Zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',translate:'<svg width="24" height="24"><path d="m12.7 14.3-.3.7-.4.7-2.2-2.2-3.1 3c-.3.4-.8.4-1 0a.7.7 0 0 1 0-1l3.1-3A12.4 12.4 0 0 1 6.7 9H8a10.1 10.1 0 0 0 1.7 2.4c.5-.5 1-1.1 1.4-1.8l.9-2H4.7a.7.7 0 1 1 0-1.5h4.4v-.7c0-.4.3-.8.7-.8.4 0 .7.4.7.8v.7H15c.4 0 .8.3.8.7 0 .4-.4.8-.8.8h-1.4a12.3 12.3 0 0 1-1 2.4 13.5 13.5 0 0 1-1.7 2.3l1.9 1.8Zm4.3-3 2.7 7.3a.5.5 0 0 1-.4.7 1 1 0 0 1-1-.7l-.6-1.5h-3.4l-.6 1.5a1 1 0 0 1-1 .7.5.5 0 0 1-.4-.7l2.7-7.4a1 1 0 0 1 2 0Zm-2.2 4.4h2.4L16 12.5l-1.2 3.2Z" fill-rule="evenodd"/></svg>',typography:'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M17 5a1 1 0 1 1 0 2h-4v11a1 1 0 1 1-2 0V7H7a1 1 0 0 1 0-2h10Z"/><path d="m17.5 14 .8-1.7 1.7-.8-1.7-.8-.8-1.7-.8 1.7-1.7.8 1.7.8.8 1.7ZM7 14l1 2 2 1-2 1-1 2-1-2-2-1 2-1 1-2Z"/></svg>',underline:'<svg width="24" height="24"><path d="M16 5c.6 0 1 .4 1 1v5.5a4 4 0 0 1-.4 1.8l-1 1.4a5.3 5.3 0 0 1-5.5 1 5 5 0 0 1-1.6-1c-.5-.4-.8-.9-1.1-1.4a4 4 0 0 1-.4-1.8V6c0-.6.4-1 1-1s1 .4 1 1v5.5c0 .3 0 .6.2 1l.6.7a3.3 3.3 0 0 0 2.2.8 3.4 3.4 0 0 0 2.2-.8c.3-.2.4-.5.6-.8l.2-.9V6c0-.6.4-1 1-1ZM8 17h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',undo:'<svg width="24" height="24"><path d="M6.4 8H12c3.7 0 6.2 2 6.8 5.1.6 2.7-.4 5.6-2.3 6.8a1 1 0 0 1-1-1.8c1.1-.6 1.8-2.7 1.4-4.6-.5-2.1-2.1-3.5-4.9-3.5H6.4l3.3 3.3a1 1 0 1 1-1.4 1.4l-5-5a1 1 0 0 1 0-1.4l5-5a1 1 0 0 1 1.4 1.4L6.4 8Z" fill-rule="nonzero"/></svg>',unlink:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 0 1 1.4 1.4l-2 2a2 2 0 1 0 2.6 2.8l4.8-4.8a1 1 0 0 0 0-1.4 1 1 0 1 1 1.4-1.3 2.9 2.9 0 0 1 0 4L9.6 20a3.9 3.9 0 0 1-5.5-5.5l2-2Zm11.6-.6a1 1 0 0 1-1.4-1.4l2.1-2a2 2 0 1 0-2.7-2.8L11 10.3a1 1 0 0 0 0 1.4A1 1 0 1 1 9.6 13a2.9 2.9 0 0 1 0-4L14.4 4a3.9 3.9 0 0 1 5.5 5.5l-2 2ZM7.6 6.3a.8.8 0 0 1-1 1.1L3.3 4.2a.7.7 0 1 1 1-1l3.2 3.1ZM5.1 8.6a.8.8 0 0 1 0 1.5H3a.8.8 0 0 1 0-1.5H5Zm5-3.5a.8.8 0 0 1-1.5 0V3a.8.8 0 0 1 1.5 0V5Zm6 11.8a.8.8 0 0 1 1-1l3.2 3.2a.8.8 0 0 1-1 1L16 17Zm-2.2 2a.8.8 0 0 1 1.5 0V21a.8.8 0 0 1-1.5 0V19Zm5-3.5a.7.7 0 1 1 0-1.5H21a.8.8 0 0 1 0 1.5H19Z" fill-rule="nonzero"/></svg>',unlock:'<svg width="24" height="24"><path d="M16 5c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h-2V8a1 1 0 0 0-.3-.7A1 1 0 0 0 16 7h-2a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7v3h.3c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H4.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H11V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2Z" fill-rule="evenodd"/></svg>',"unordered-list":'<svg width="24" height="24"><path d="M11 5h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2ZM4.5 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1Zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1Zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1Z" fill-rule="evenodd"/></svg>',unselected:'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2Zm0 1a1 1 0 0 0-1 1v12c0 .6.4 1 1 1h12c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H6Z"/></svg>',upload:'<svg width="24" height="24"><path d="M18 19v-2a1 1 0 0 1 2 0v3c0 .6-.4 1-1 1H5a1 1 0 0 1-1-1v-3a1 1 0 0 1 2 0v2h12ZM11 6.4 8.7 8.7a1 1 0 0 1-1.4-1.4l4-4a1 1 0 0 1 1.4 0l4 4a1 1 0 1 1-1.4 1.4L13 6.4V16a1 1 0 0 1-2 0V6.4Z" fill-rule="nonzero"/></svg>',user:'<svg width="24" height="24"><path d="M12 24a12 12 0 1 1 0-24 12 12 0 0 1 0 24Zm-8.7-5.3a11 11 0 0 0 17.4 0C19.4 16.3 14.6 15 12 15c-2.6 0-7.4 1.3-8.7 3.7ZM12 13c2.2 0 4-2 4-4.5S14.2 4 12 4 8 6 8 8.5 9.8 13 12 13Z" fill-rule="nonzero"/></svg>',"vertical-align":'<svg width="24" height="24"><g fill-rule="nonzero"><rect width="18" height="2" x="3" y="11" rx="1"/><path d="M12 2c.6 0 1 .4 1 1v4l2-1.3a1 1 0 0 1 1.2 1.5l-.1.1-4.1 3-4-3a1 1 0 0 1 1-1.7l2 1.5V3c0-.6.4-1 1-1zm0 11.8 4 2.9a1 1 0 0 1-1 1.7l-2-1.5V21c0 .5-.4 1-.9 1H12a1 1 0 0 1-1-1v-4l-2 1.3a1 1 0 0 1-1.2-.1l-.1-.1a1 1 0 0 1 .1-1.3l.1-.1 4.1-3z"/></g></svg>',visualblocks:'<svg width="24" height="24"><path d="M9 19v2H7v-2h2Zm-4 0v2a2 2 0 0 1-2-2h2Zm8 0v2h-2v-2h2Zm8 0a2 2 0 0 1-2 2v-2h2Zm-4 0v2h-2v-2h2ZM15 7a1 1 0 0 1 0 2v7a1 1 0 0 1-2 0V9h-1v7a1 1 0 0 1-2 0v-4a2.5 2.5 0 0 1-.2-5H15ZM5 15v2H3v-2h2Zm16 0v2h-2v-2h2ZM5 11v2H3v-2h2Zm16 0v2h-2v-2h2ZM5 7v2H3V7h2Zm16 0v2h-2V7h2ZM5 3v2H3c0-1.1.9-2 2-2Zm8 0v2h-2V3h2Zm6 0a2 2 0 0 1 2 2h-2V3ZM9 3v2H7V3h2Zm8 0v2h-2V3h2Z" fill-rule="evenodd"/></svg>',visualchars:'<svg width="24" height="24"><path d="M10 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 6.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L10 5Z" fill-rule="evenodd"/></svg>',warning:'<svg width="24" height="24"><path d="M19.8 18.3c.2.5.3.9 0 1.2-.1.3-.5.5-1 .5H5.2c-.5 0-.9-.2-1-.5-.3-.3-.2-.7 0-1.2L11 4.7l.5-.5.5-.2c.2 0 .3 0 .5.2.2 0 .3.3.5.5l6.8 13.6ZM12 18c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7a1 1 0 0 0-.3-.7 1 1 0 0 0-.7-.3 1 1 0 0 0-.7.3 1 1 0 0 0-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3Zm.7-3 .3-4a1 1 0 0 0-.3-.7 1 1 0 0 0-.7-.3 1 1 0 0 0-.7.3 1 1 0 0 0-.3.7l.3 4h1.4Z" fill-rule="evenodd"/></svg>',"zoom-in":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3Zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12Zm-1-9a1 1 0 0 1 2 0v6a1 1 0 0 1-2 0V8Zm-2 4a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2H8Z" fill-rule="nonzero"/></svg>',"zoom-out":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3Zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12Zm-3-5a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2H8Z" fill-rule="nonzero"/></svg>'}}),K.TextEditorBehavior=f().Behavior.extend({defaults:{selector:".mailpoet_content",toolbar1:"bold italic link unlink forecolor mailpoet_shortcodes",toolbar2:"",validElements:"p[class|style],span[class|style],a[href|class|title|target|style],strong[class|style],em[class|style],strike,br,del",invalidElements:"script",blockFormats:"Paragraph=p",plugins:"link mailpoet_shortcodes",configurationFilter:e=>e},initialize:function(){this.listenTo(x.getChannel(),"dragStart",this.hideEditor)},hideEditor:function(){this.tinymceEditor&&this.tinymceEditor.fire("blur")},onDomRefresh:async function(){!0!==this.view.disableTextEditor&&(te().PluginManager.add("mailpoet_shortcodes",oe),await te().init(this.options.configurationFilter({target:this.el.querySelector(this.options.selector),inline:!0,contextmenu:!1,menubar:!1,toolbar1:this.options.toolbar1,toolbar2:this.options.toolbar2,browser_spellcheck:!0,valid_elements:this.options.validElements,invalid_elements:this.options.invalidElements,block_formats:this.options.blockFormats,relative_urls:!1,remove_script_host:!1,convert_urls:!0,urlconverter_callback:function(e){return e.match(/\[.+\]/g)?e:this.documentBaseURI.toAbsolute(e,this.options.get("remove_script_host"))},plugins:this.options.plugins,setup:e=>{this.tinymceEditor=e,e.on("change",(()=>{this.view.triggerMethod("text:editor:change",e.getContent())})),e.on("click",(t=>{x.getDisplayedSettingsId()&&x.getChannel().trigger("hideSettings"),document.activeElement!==e.targetElm&&e.selection.placeCaretAt(t.clientX,t.clientY)})),e.on("focus",(()=>{this.view.triggerMethod("text:editor:focus")})),e.on("blur",(()=>{this.view.triggerMethod("text:editor:blur")}))}})))}}),K.WooCommerceStylesBehavior=f().Behavior.extend({events:function(){return{"change #mailpoet_wc_branding_color":function(e){let t;const o=e.target.value,n=this.wcHexIsLight(o)?"#202020":"#ffffff";t=this.wcHexIsLight(this.view.model.get("wrapper.backgroundColor"))?this.wcHexIsLight(o)?n:o:this.wcHexIsLight(o)?o:n,this.view.model.set("woocommerce.brandingColor",o),this.view.model.set("woocommerce.headingFontColor",n),this.view.model.set("link.fontColor",t)}}},wcHexIsLight:function(e){const t=e.replace("#","");return(299*parseInt(t.substr(0,2),16)+587*parseInt(t.substr(2,2),16)+114*parseInt(t.substr(4,2),16))/1e3>155}}),o(96845);var ne={},re=f().View.extend({});ne.BlockModel=C.extend({stale:[],initialize:function(){this.on("change",(function(){this._updateDefaults(),x.getChannel().trigger("autoSave")}))},_getDefaults:function(e,t){var o;return o=c.ZP.isObject(t)&&c.ZP.isFunction(t.toJSON)?t.toJSON():t,JSON.parse(JSON.stringify(w().extend(e,o||{})))},_updateDefaults:function(){var e=this.get("context")||this.get("type");x.getConfig().set("blockDefaults."+e,this.toJSON())},toJSON:function(){return c.ZP.omit(C.prototype.toJSON.call(this),this.stale)},getChildren:function(){return[]}}),ne.BlockView=re.extend({regions:{toolsRegion:"> .mailpoet_tools"},modelEvents:{change:"render",delete:"deleteBlock",duplicate:"duplicateBlock"},behaviors:{DraggableBehavior:{cloneOriginal:!0,hideOriginal:!0,onDrop:function(e){x.getChannel().trigger("hideSettings"),e.dragBehavior.view.model.destroy()},onDragSubstituteBy:function(e){var t,o;if(c.ZP.isFunction(e.view.onDragSubstituteBy))return(t=new(e.view.onDragSubstituteBy())).render(),o=t.$el.get(0).cloneNode(!0),t.destroy(),o}},HighlightEditingBehavior:{}},templateContext:function(){return{model:this.model.toJSON(),viewCid:this.cid}},constructor:function(){re.apply(this,arguments),this.$el.addClass("mailpoet_editor_view_"+this.cid)},initialize:function(){this.on("showSettings",this.showSettings,this)},addHighlight:function(){this.$el.addClass("mailpoet_highlight"),this.showingToolsDisabled||(this.$("> .mailpoet_tools").addClass("mailpoet_display_tools"),this.toolsView.triggerMethod("showTools"))},removeHighlight:function(){this.$el.removeClass("mailpoet_highlight"),this.hideTools()},hideTools:function(){this.$("> .mailpoet_tools").removeClass("mailpoet_display_tools"),this.toolsView.triggerMethod("hideTools")},enableShowingTools:function(){this.showingToolsDisabled=!1},disableShowingTools:function(){this.showingToolsDisabled=!0,this.hideTools()},showSettings:function(e){this.toolsView.triggerMethod("showSettings",e)},getDropFunc:function(){return function(){return this.model.clone()}.bind(this)},disableDragging:function(){this.$el.addClass("mailpoet_ignore_drag")},enableDragging:function(){this.$el.removeClass("mailpoet_ignore_drag")},deleteBlock:function(){this.transitionOut().then(function(){this.model.destroy()}.bind(this))},duplicateBlock:function(){this.model.collection.add(this.model.toJSON(),{at:this.model.collection.findIndex(this.model)})},transitionOut:function(){return this._transition("slideUp","fadeOut","easeIn")},_transition:function(e,t,o){var n=w().Deferred();return this.$el.velocity(e,{duration:250,easing:o,complete:function(){n.resolve()}}).velocity(t,{duration:250,easing:o,queue:!1}),n}}),ne.BlockToolsView=re.extend({getTemplate:function(){return window.templates.genericBlockTools},events:{"click .mailpoet_edit_block":"toggleSettings","click .mailpoet_delete_block_activate":"showDeletionConfirmation","click .mailpoet_delete_block_cancel":"hideDeletionConfirmation","click .mailpoet_delete_block_confirm":"deleteBlock","click .mailpoet_duplicate_block":"duplicateBlock"},tools:{settings:!0,delete:!0,duplicate:!0,move:!0},getSettingsView:function(){return ne.BlockSettingsView},initialize:function(e){var t=e||{};c.ZP.isUndefined(t.tools)||(this.tools=w().extend({},this.tools,t.tools||{})),this.on("hideTools",this.hideDeletionConfirmation,this),this.on("showSettings",this.changeSettings)},templateContext:function(){return{model:this.model.toJSON(),viewCid:this.cid,tools:this.tools}},toggleSettings:function(){x.getDisplayedSettingsId()!==this.model.cid?this.changeSettings():x.getChannel().trigger("hideSettings")},changeSettings:function(e){var t=this.getSettingsView(),o=x.getDisplayedSettingsId();if(o){if(o===this.model.cid)return;x.getChannel().trigger("hideSettings")}else document.activeElement.blur(),x.getChannel().trigger("settingsDisplayed",this.model.cid),new t(c.ZP.extend({model:this.model},e||{})).render()},showDeletionConfirmation:function(){this.$(".mailpoet_delete_block").closest(".mailpoet_block").find("> .mailpoet_block_highlight").css({background:"#E64047",opacity:.5}),this.$(".mailpoet_delete_block").addClass("mailpoet_delete_block_activated")},hideDeletionConfirmation:function(){this.$(".mailpoet_delete_block").closest(".mailpoet_block").find("> .mailpoet_block_highlight").css({background:"transparent",opacity:1}),this.$(".mailpoet_delete_block").removeClass("mailpoet_delete_block_activated")},deleteBlock:function(e){return e.preventDefault(),this.model.trigger("delete"),x.getChannel().trigger("hideSettings"),!1},duplicateBlock:function(e){return e.preventDefault(),this.model.trigger("duplicate"),x.getChannel().trigger("hideSettings"),!1}}),ne.BlockSettingsView=f().View.extend({className:"mailpoet_editor_settings",behaviors:{ColorPickerBehavior:{}},initialize:function(e){var t;this.model.trigger("startEditing"),t={element:this.$el,template:"",position:"right",overlayRender:!1,width:x.getConfig().get("sidepanelWidth"),onCancel:function(){this.destroy()}.bind(this)},this.renderOptions=e.renderOptions||{},"subpanel"===this.renderOptions.displayFormat?r.x.Modal.subpanel(t):r.x.Modal.panel(t),this.listenTo(x.getChannel(),"hideSettings",this.close)},templateContext:function(){return{model:this.model.toJSON()}},close:function(){this.destroy()},changeField:function(e,t){this.model.set(e,w()(t.target).val())},changePixelField:function(e,t){this.changeFieldWithSuffix(e,t,"px")},changeFieldWithSuffix:function(e,t,o){this.model.set(e,w()(t.target).val()+o)},changeBoolField:function(e,t){this.model.set(e,"true"===w()(t.target).val())},changeBoolCheckboxField:function(e,t){this.model.set(e,!!w()(t.target).prop("checked"))},changeColorField:function(e,t){var o=w()(t.target).val();""===o&&(o="transparent"),this.model.set(e,o)},onBeforeDestroy:function(){r.x.Modal.close(),this.model.trigger("stopEditing"),x.getChannel().trigger("settingsDisplayed",null)}}),ne.WidgetView=f().View.extend({className:"mailpoet_widget mailpoet_droppable_block mailpoet_droppable_widget",behaviors:{DraggableBehavior:{drop:function(){throw new Error("Unsupported operation")}}}});var ie,se={},ae=ne;ie=E().Collection.extend({model:ae.BlockModel,initialize:function(){this.on("add change remove",(function(){x.getChannel().trigger("autoSave")}))},parse:function(e){return c.ZP.map(e,(function(e){return new(x.getBlockTypeModel(e.type))(e,{parse:!0})}))}}),se.ContainerBlockModel=ae.BlockModel.extend({relations:{blocks:ie},defaults:function(){return this._getDefaults({type:"container",columnLayout:!1,orientation:"vertical",image:{src:null,display:"scale"},styles:{block:{backgroundColor:"transparent"}},blocks:new ie},x.getConfig().get("blockDefaults.container"))},_updateDefaults:function(){},validate:function(){var e=this.get("blocks").find((function(e){return!e.isValid()}));if(e)return e.validationError},parse:function(e){return"container"===e.type&&c.ZP.has(e,"blocks")&&e.blocks.constructor===Array&&(e.blocks=new ie(e.blocks,{parse:!0})),e},getChildren:function(){var e=this.get("blocks").map((function(e){return[e,e.getChildren()]}));return c.ZP.flatten(e)}}),se.ContainerBlocksView=f().CollectionView.extend({className:"mailpoet_container",events:{click:"removeFocusFromAnyActiveElement"},childView:function(e){return x.getBlockTypeView(e.get("type"))},childViewOptions:function(){var e=c.ZP.clone(this.renderOptions);return void 0!==e.depth&&(e.depth+=1),{renderOptions:e}},emptyView:function(){return se.ContainerBlockEmptyView},emptyViewOptions:function(){return{renderOptions:this.renderOptions}},initialize:function(e){this.renderOptions=e.renderOptions},onChildviewResizeStart:function(){this.triggerMethod("resizeStart")},onChildviewResizeStop:function(e){this.triggerMethod("resizeStop",e)},removeFocusFromAnyActiveElement:function(e){var t;e&&e.target&&(t=e.target.getAttribute("class"))&&-1!==t.indexOf("mailpoet_container_horizontal")&&document.activeElement.blur()}}),se.ContainerBlockView=ae.BlockView.extend({regions:c.ZP.extend({},ae.BlockView.prototype.regions,{blocks:{el:"> .mailpoet_container",replaceElement:!0}}),className:"mailpoet_block mailpoet_container_block mailpoet_droppable_block mailpoet_droppable_layout_block",getTemplate:function(){return window.templates.containerBlock},events:c.ZP.extend({},ae.BlockView.prototype.events,{"click .mailpoet_newsletter_layer_selector":"toggleEditingLayer"}),ui:{tools:"> .mailpoet_tools"},behaviors:c.ZP.extend({},ae.BlockView.prototype.behaviors,{ContainerDropZoneBehavior:{},DraggableBehavior:{cloneOriginal:!0,hideOriginal:!0,onDrop:function(e){e.dragBehavior.view.model.destroy()},onDragSubstituteBy:function(e){var t,o;if(c.ZP.isFunction(e.view.onDragSubstituteBy))return(t=new(e.view.onDragSubstituteBy())).render(),o=t.$el.get(0).cloneNode(!0),t.destroy(),o},testAttachToInstance:function(e,t){return 1===t.renderOptions.depth}},HighlightEditingBehavior:{}}),onDragSubstituteBy:function(){if(1===this.renderOptions.depth){if(3===this.model.get("blocks").length)return se.ThreeColumnContainerWidgetView;if(2===this.model.get("blocks").length)return se.TwoColumnContainerWidgetView}return se.OneColumnContainerWidgetView},initialize:function(e){ae.BlockView.prototype.initialize.apply(this,arguments),this.renderOptions=c.ZP.defaults(e.renderOptions||{},{})},onRender:function(){var e,t="";this.toolsView=new se.ContainerBlockToolsView({model:this.model,tools:{settings:1===this.renderOptions.depth,delete:1===this.renderOptions.depth,duplicate:!0,move:1===this.renderOptions.depth,layerSelector:!1}}),this.showChildView("toolsRegion",this.toolsView),this.showChildView("blocks",new se.ContainerBlocksView({collection:this.model.get("blocks"),renderOptions:this.renderOptions})),"string"==typeof(e=this.model.get("columnLayout"))&&(t="mailpoet_irregular_width_contents_container column_layout_"+e),this.$("> .mailpoet_container").attr("class","mailpoet_container mailpoet_container_"+this.model.get("orientation")+" "+t)},addHighlight:function(){1!==this.renderOptions.depth||this.$el.hasClass("mailpoet_container_layer_active")||(this.$(this.ui.tools).addClass("mailpoet_display_tools"),this.$el.addClass("mailpoet_highlight"),this.toolsView.triggerMethod("showTools"))},removeHighlight:function(){1!==this.renderOptions.depth||this.$el.hasClass("mailpoet_container_layer_active")||(this.$(this.ui.tools).removeClass("mailpoet_display_tools"),this.$el.removeClass("mailpoet_highlight"),this.toolsView.triggerMethod("hideTools"))},toggleEditingLayer:function(e){var t=this,o=this.$("> .mailpoet_tools .mailpoet_newsletter_layer_selector"),n=w()(".mailpoet_layer_overlay"),r=this.$("> .mailpoet_container"),i=function(){t.$el.removeClass("mailpoet_container_layer_active"),o.removeClass("mailpoet_container_layer_active"),r.removeClass("mailpoet_layer_highlight"),n.hide(),n.off("click")};o.hasClass("mailpoet_container_layer_active")?i():(t.$el.addClass("mailpoet_container_layer_active"),o.addClass("mailpoet_container_layer_active"),r.addClass("mailpoet_layer_highlight"),n.on("click",i),n.show()),e.stopPropagation()}}),se.ContainerBlockEmptyView=f().View.extend({getTemplate:function(){return window.templates.containerEmpty},initialize:function(e){this.renderOptions=c.ZP.defaults(e.renderOptions||{},{})},templateContext:function(){return{isRoot:0===this.renderOptions.depth,emptyContainerMessage:this.renderOptions.emptyContainerMessage||""}}}),se.ContainerBlockToolsView=ae.BlockToolsView.extend({getSettingsView:function(){return se.ContainerBlockSettingsView}}),se.ContainerBlockSettingsView=ae.BlockSettingsView.extend({behaviors:c.ZP.extend({},ae.BlockSettingsView.prototype.behaviors,{MediaManagerBehavior:{onSelect:"onImageSelect"}}),getTemplate:function(){return window.templates.containerBlockSettings},events:function(){return{"change .mailpoet_field_container_background_color":c.ZP.partial(this.changeColorField,"styles.block.backgroundColor"),"click .mailpoet_done_editing":"close","change .mailpoet_field_display_type":"changeDisplayType"}},initialize:function(){ae.BlockSettingsView.prototype.initialize.apply(this,arguments),this.model.trigger("startEditing"),this._columnsSettingsView=new se.ContainerBlockColumnsSettingsView({collection:this.model.get("blocks")})},changeDisplayType:function(e){this.model.get("image").set("display",e.target.value),this.model.trigger("change")},onImageSelect:function(e){this.model.set("image.src",e.src),this.model.trigger("change"),this.render()}}),se.ContainerBlockColumnsSettingsView=f().CollectionView.extend({childView:function(){return se.ContainerBlockColumnSettingsView},childViewOptions:function(e,t){return{columnIndex:t}}}),se.ContainerBlockColumnSettingsView=f().View.extend({getTemplate:function(){return window.templates.containerBlockColumnSettings},initialize:function(e){this.columnNumber=(e.columnIndex||0)+1},templateContext:function(){return{model:this.model.toJSON(),columnNumber:this.columnNumber}}}),se.OneColumnContainerWidgetView=ae.WidgetView.extend({className:ae.WidgetView.prototype.className+" mailpoet_droppable_layout_block",getTemplate:function(){return window.templates.oneColumnLayoutInsertion},behaviors:{DraggableBehavior:{cloneOriginal:!0,drop:function(){return new se.ContainerBlockModel({orientation:"horizontal",blocks:[new se.ContainerBlockModel]})}}}}),se.TwoColumnContainerWidgetView=ae.WidgetView.extend({className:ae.WidgetView.prototype.className+" mailpoet_droppable_layout_block",getTemplate:function(){return window.templates.twoColumnLayoutInsertion},behaviors:{DraggableBehavior:{cloneOriginal:!0,drop:function(){return new se.ContainerBlockModel({orientation:"horizontal",blocks:[new se.ContainerBlockModel,new se.ContainerBlockModel]})}}}}),se.ThreeColumnContainerWidgetView=ae.WidgetView.extend({className:ae.WidgetView.prototype.className+" mailpoet_droppable_layout_block",getTemplate:function(){return window.templates.threeColumnLayoutInsertion},behaviors:{DraggableBehavior:{cloneOriginal:!0,drop:function(){return new se.ContainerBlockModel({orientation:"horizontal",blocks:[new se.ContainerBlockModel,new se.ContainerBlockModel,new se.ContainerBlockModel]})}}}}),se.TwoColumn12ContainerWidgetView=ae.WidgetView.extend({className:ae.WidgetView.prototype.className+" mailpoet_droppable_layout_block",getTemplate:function(){return window.templates.twoColumn12LayoutInsertion},behaviors:{DraggableBehavior:{cloneOriginal:!0,drop:function(){var e=new se.ContainerBlockModel({orientation:"horizontal",blocks:[new se.ContainerBlockModel,new se.ContainerBlockModel]});return e.set("columnLayout","1_2"),e}}}}),se.TwoColumn21ContainerWidgetView=ae.WidgetView.extend({className:ae.WidgetView.prototype.className+" mailpoet_droppable_layout_block",getTemplate:function(){return window.templates.twoColumn21LayoutInsertion},behaviors:{DraggableBehavior:{cloneOriginal:!0,drop:function(){var e=new se.ContainerBlockModel({orientation:"horizontal",blocks:[new se.ContainerBlockModel,new se.ContainerBlockModel]});return e.set("columnLayout","2_1"),e}}}}),x.on("before:start",(function(e){e.registerBlockType("container",{blockModel:se.ContainerBlockModel,blockView:se.ContainerBlockView}),e.registerLayoutWidget({name:"oneColumnLayout",priority:100,widgetView:se.OneColumnContainerWidgetView}),e.registerLayoutWidget({name:"twoColumnLayout",priority:100,widgetView:se.TwoColumnContainerWidgetView}),e.registerLayoutWidget({name:"threeColumnLayout",priority:100,widgetView:se.ThreeColumnContainerWidgetView}),e.registerLayoutWidget({name:"twoColumn12Layout",priority:100,widgetView:se.TwoColumn12ContainerWidgetView}),e.registerLayoutWidget({name:"twoColumn21Layout",priority:100,widgetView:se.TwoColumn21ContainerWidgetView})}));var le={},ce=ne;le.ButtonBlockModel=ce.BlockModel.extend({defaults:function(){return this._getDefaults({type:"button",text:"Button",url:"",styles:{block:{backgroundColor:"#ff0000",borderColor:"#cccccc",borderWidth:"1px",borderRadius:"4px",borderStyle:"solid",width:"200px",lineHeight:"40px",fontColor:"#000000",fontFamily:"Arial",fontSize:"16px",fontWeight:"normal",textAlign:"center"}}},x.getConfig().get("blockDefaults.button"))}}),le.ButtonBlockView=ce.BlockView.extend({className:"mailpoet_block mailpoet_button_block mailpoet_droppable_block",getTemplate:function(){return window.templates.buttonBlock},onDragSubstituteBy:function(){return le.ButtonWidgetView},behaviors:c.ZP.extend({},ce.BlockView.prototype.behaviors,{ShowSettingsBehavior:{}}),initialize:function(){ce.BlockView.prototype.initialize.apply(this,arguments),this._replaceButtonStylesHandler=function(e){this.model.set(e)}.bind(this),x.getChannel().on("replaceAllButtonStyles",this._replaceButtonStylesHandler)},onRender:function(){this.toolsView=new le.ButtonBlockToolsView({model:this.model}),this.showChildView("toolsRegion",this.toolsView)}}),le.ButtonBlockToolsView=ce.BlockToolsView.extend({getSettingsView:function(){return le.ButtonBlockSettingsView}}),le.ButtonBlockSettingsView=ce.BlockSettingsView.extend({getTemplate:function(){return window.templates.buttonBlockSettings},events:function(){return{"input .mailpoet_field_button_text":c.ZP.partial(this.changeField,"text"),"input .mailpoet_field_button_url":c.ZP.partial(this.changeField,"url"),"change .mailpoet_field_button_alignment":c.ZP.partial(this.changeField,"styles.block.textAlign"),"change .mailpoet_field_button_font_color":c.ZP.partial(this.changeColorField,"styles.block.fontColor"),"change .mailpoet_field_button_font_family":c.ZP.partial(this.changeField,"styles.block.fontFamily"),"change .mailpoet_field_button_font_size":c.ZP.partial(this.changeField,"styles.block.fontSize"),"change .mailpoet_field_button_background_color":c.ZP.partial(this.changeColorField,"styles.block.backgroundColor"),"change .mailpoet_field_button_border_color":c.ZP.partial(this.changeColorField,"styles.block.borderColor"),"change .mailpoet_field_button_font_weight":"changeFontWeight","input .mailpoet_field_button_border_width":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_button_border_width_input",c.ZP.partial(this.changePixelField,"styles.block.borderWidth").bind(this)),"change .mailpoet_field_button_border_width":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_button_border_width_input",c.ZP.partial(this.changePixelField,"styles.block.borderWidth").bind(this)),"input .mailpoet_field_button_border_width_input":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_button_border_width",c.ZP.partial(this.changePixelField,"styles.block.borderWidth").bind(this)),"input .mailpoet_field_button_border_radius":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_button_border_radius_input",c.ZP.partial(this.changePixelField,"styles.block.borderRadius").bind(this)),"change .mailpoet_field_button_border_radius":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_button_border_radius_input",c.ZP.partial(this.changePixelField,"styles.block.borderRadius").bind(this)),"input .mailpoet_field_button_border_radius_input":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_button_border_radius",c.ZP.partial(this.changePixelField,"styles.block.borderRadius").bind(this)),"input .mailpoet_field_button_width":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_button_width_input",c.ZP.partial(this.changePixelField,"styles.block.width").bind(this)),"change .mailpoet_field_button_width":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_button_width_input",c.ZP.partial(this.changePixelField,"styles.block.width").bind(this)),"input .mailpoet_field_button_width_input":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_button_width",c.ZP.partial(this.changePixelField,"styles.block.width").bind(this)),"input .mailpoet_field_button_line_height":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_button_line_height_input",c.ZP.partial(this.changePixelField,"styles.block.lineHeight").bind(this)),"change .mailpoet_field_button_line_height":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_button_line_height_input",c.ZP.partial(this.changePixelField,"styles.block.lineHeight").bind(this)),"input .mailpoet_field_button_line_height_input":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_button_line_height",c.ZP.partial(this.changePixelField,"styles.block.lineHeight").bind(this)),"click .mailpoet_field_button_replace_all_styles":"applyToAll","click .mailpoet_done_editing":"close"}},templateContext:function(){return c.ZP.extend({},ce.BlockView.prototype.templateContext.apply(this,arguments),{availableStyles:x.getAvailableStyles().toJSON(),renderOptions:this.renderOptions})},applyToAll:function(){x.getChannel().trigger("replaceAllButtonStyles",c.ZP.pick(this.model.toJSON(),"styles","type"))},updateValueAndCall:function(e,t,o){this.$(e).val(w()(o.target).val()),t(o)},changeFontWeight:function(e){var t=!!w()(e.target).prop("checked");this.model.set("styles.block.fontWeight",t?w()(e.target).val():"normal")}}),le.ButtonWidgetView=ce.WidgetView.extend({id:"automation_editor_block_button",getTemplate:function(){return window.templates.buttonInsertion},behaviors:{DraggableBehavior:{cloneOriginal:!0,drop:function(){return new le.ButtonBlockModel}}}}),x.on("before:start",(function(e){e.registerBlockType("button",{blockModel:le.ButtonBlockModel,blockView:le.ButtonBlockView}),e.registerWidget({name:"button",widgetView:le.ButtonWidgetView,priority:92})}));var de,ue={},he=ne;ue.ImageBlockModel=he.BlockModel.extend({defaults:function(){return this._getDefaults({type:"image",link:"",src:"",alt:"An image of...",fullWidth:!0,width:"64px",height:"64px",styles:{block:{textAlign:"center"}}},x.getConfig().get("blockDefaults.image"))},_updateDefaults:function(){}}),ue.ImageBlockView=he.BlockView.extend({className:"mailpoet_block mailpoet_image_block mailpoet_droppable_block",getTemplate:function(){return window.templates.imageBlock},onDragSubstituteBy:function(){return ue.ImageWidgetView},templateContext:function(){return c.ZP.extend({imageMissingSrc:x.getConfig().get("urls.imageMissing")},he.BlockView.prototype.templateContext.apply(this))},behaviors:c.ZP.extend({},he.BlockView.prototype.behaviors,{ResizableBehavior:{elementSelector:".mailpoet_image",resizeHandleSelector:".mailpoet_image_resize_handle",onResize:function(e){var t=this.view.model.get("styles.block.textAlign"),o=this.$(".mailpoet_image").offset(),n=this.$(".mailpoet_image").width(),r=e.pageX-o.left;"right"===t&&(r=n+o.left-e.pageX),this.view.model.set("width",r+"px")}},ShowSettingsBehavior:{ignoreFrom:".mailpoet_image_resize_handle"}}),onRender:function(){var e=this;this.toolsView=new ue.ImageBlockToolsView({model:this.model}),this.showChildView("toolsRegion",this.toolsView),this.model.get("fullWidth")?this.$el.addClass("mailpoet_full_image"):this.$el.removeClass("mailpoet_full_image"),this.model.get("width")&&"auto"!==this.model.get("width")||this.$el.find("img").on("load",(function(){e.model.set("width",this.width),e.model.set("height",this.height)})),this.$(".mailpoet_content").css("width",this.model.get("width"))}}),ue.ImageBlockToolsView=he.BlockToolsView.extend({getSettingsView:function(){return ue.ImageBlockSettingsView}}),ue.ImageBlockSettingsView=he.BlockSettingsView.extend({behaviors:c.ZP.extend({},he.BlockSettingsView.prototype.behaviors,{MediaManagerBehavior:{onSelect:"onImageSelect"}}),onRender:function(){r.x.helpTooltip.show(document.getElementById("tooltip-designer-full-width"),{tooltipId:"tooltip-editor-full-width",tooltip:(0,i.__)("This option eliminates padding around the image.","mailpoet"),place:"top"}),r.x.helpTooltip.show(document.getElementById("tooltip-designer-ideal-width"),{tooltipId:"tooltip-editor-ideal-width",tooltip:(0,i.__)("Use images with widths of at least 1,000 pixels to ensure sharp display on high density screens, like mobile devices.","mailpoet"),place:"bottom"})},getTemplate:function(){return window.templates.imageBlockSettings},events:function(){return{"input .mailpoet_field_image_link":c.ZP.partial(this.changeField,"link"),"input .mailpoet_field_image_alt_text":c.ZP.partial(this.changeField,"alt"),"change .mailpoet_field_image_full_width":c.ZP.partial(this.changeBoolCheckboxField,"fullWidth"),"change .mailpoet_field_image_alignment":c.ZP.partial(this.changeField,"styles.block.textAlign"),"click .mailpoet_done_editing":"close","input .mailpoet_field_image_width":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_image_width_input",c.ZP.partial(this.changePixelField,"width").bind(this)),"change .mailpoet_field_image_width":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_image_width_input",c.ZP.partial(this.changePixelField,"width").bind(this)),"input .mailpoet_field_image_width_input":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_image_width",c.ZP.partial(this.changePixelField,"width").bind(this))}},modelEvents:function(){return{"change:maxWidth":"updateMaxWidth","change:width":"updateWidth"}},updateValueAndCall:function(e,t,o){this.$(e).val(w()(o.target).val()),t(o)},updateMaxWidth:function(){var e=parseInt(this.model.get("maxWidth"),10);this.$(".mailpoet_field_image_width").attr("max",e),this.$(".mailpoet_field_image_width_input").attr("max",e)},updateWidth:function(){var e=parseInt(this.model.get("width"),10);this.$(".mailpoet_field_image_width").val(e),this.$(".mailpoet_field_image_width_input").val(e)},onImageSelect:function(e){null===e.src?this.model.set({src:""}):this.model.set(e),this.render()}}),de=he.WidgetView.extend({id:"automation_editor_block_image",getTemplate:function(){return window.templates.imageInsertion},behaviors:{DraggableBehavior:{cloneOriginal:!0,drop:function(){return new ue.ImageBlockModel},onDrop:function(e){e.droppedView.triggerMethod("showSettings",{showImageManager:!0})}}}}),ue.ImageWidgetView=de,x.on("before:start",(function(e){e.registerBlockType("image",{blockModel:ue.ImageBlockModel,blockView:ue.ImageBlockView}),e.registerWidget({name:"image",widgetView:ue.ImageWidgetView,priority:91})}));var me={},pe=ne;me.DividerBlockModel=pe.BlockModel.extend({defaults:function(){return this._getDefaults({type:"divider",styles:{block:{backgroundColor:"transparent",padding:"12px",borderStyle:"solid",borderWidth:"1px",borderColor:"#000000"}}},x.getConfig().get("blockDefaults.divider"))}}),me.DividerBlockView=pe.BlockView.extend({className:"mailpoet_block mailpoet_divider_block mailpoet_droppable_block",getTemplate:function(){return window.templates.dividerBlock},modelEvents:c.ZP.omit(pe.BlockView.prototype.modelEvents,"change"),behaviors:c.ZP.defaults({ResizableBehavior:{elementSelector:".mailpoet_content",resizeHandleSelector:".mailpoet_resize_handle",transformationFunction:function(e){return e/2},minLength:0,modelField:"styles.block.padding"},ShowSettingsBehavior:{ignoreFrom:".mailpoet_resize_handle"}},pe.BlockView.prototype.behaviors),onDragSubstituteBy:function(){return me.DividerWidgetView},initialize:function(){var e=this;pe.BlockView.prototype.initialize.apply(this,arguments),this._replaceDividerHandler=function(t){e.model.set(t),e.model.trigger("applyToAll")},x.getChannel().on("replaceAllDividers",this._replaceDividerHandler),this.listenTo(this.model,"change:src change:styles.block.backgroundColor change:styles.block.borderStyle change:styles.block.borderWidth change:styles.block.borderColor applyToAll",this.render),this.listenTo(this.model,"change:styles.block.padding",this.changePadding)},templateContext:function(){return c.ZP.extend({totalHeight:2*parseInt(this.model.get("styles.block.padding"),10)+parseInt(this.model.get("styles.block.borderWidth"),10)+"px"},pe.BlockView.prototype.templateContext.apply(this))},onRender:function(){this.toolsView=new me.DividerBlockToolsView({model:this.model}),this.showChildView("toolsRegion",this.toolsView)},onBeforeDestroy:function(){x.getChannel().off("replaceAllDividers",this._replaceDividerHandler),this.stopListening(this.model)},changePadding:function(){this.$(".mailpoet_content").css("padding-top",this.model.get("styles.block.padding")),this.$(".mailpoet_content").css("padding-bottom",this.model.get("styles.block.padding")),this.$(".mailpoet_resize_handle_text").text(2*parseInt(this.model.get("styles.block.padding"),10)+parseInt(this.model.get("styles.block.borderWidth"),10)+"px")}}),me.DividerBlockToolsView=pe.BlockToolsView.extend({getSettingsView:function(){return me.DividerBlockSettingsView}}),me.DividerBlockSettingsView=pe.BlockSettingsView.extend({getTemplate:function(){return window.templates.dividerBlockSettings},events:function(){return{"click .mailpoet_field_divider_style":"changeStyle","input .mailpoet_field_divider_border_width":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_divider_border_width_input",c.ZP.partial(this.changePixelField,"styles.block.borderWidth").bind(this)),"change .mailpoet_field_divider_border_width":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_divider_border_width_input",c.ZP.partial(this.changePixelField,"styles.block.borderWidth").bind(this)),"input .mailpoet_field_divider_border_width_input":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_divider_border_width",c.ZP.partial(this.changePixelField,"styles.block.borderWidth").bind(this)),"change .mailpoet_field_divider_border_color":c.ZP.partial(this.changeColorField,"styles.block.borderColor"),"change .mailpoet_field_divider_background_color":c.ZP.partial(this.changeColorField,"styles.block.backgroundColor"),"click .mailpoet_button_divider_apply_to_all":"applyToAll","click .mailpoet_done_editing":"close"}},modelEvents:function(){return{"change:styles.block.borderColor":"repaintDividerStyleOptions"}},templateContext:function(){return c.ZP.extend({},pe.BlockView.prototype.templateContext.apply(this,arguments),{availableStyles:x.getAvailableStyles().toJSON(),renderOptions:this.renderOptions})},changeStyle:function(e){var t=w()(e.currentTarget).data("style");this.model.set("styles.block.borderStyle",t),this.$(".mailpoet_field_divider_style").removeClass("mailpoet_active_divider_style"),this.$('.mailpoet_field_divider_style[data-style="'+t+'"]').addClass("mailpoet_active_divider_style")},repaintDividerStyleOptions:function(){this.$(".mailpoet_field_divider_style > div").css("border-top-color",this.model.get("styles.block.borderColor"))},applyToAll:function(){x.getChannel().trigger("replaceAllDividers",this.model.toJSON())},updateValueAndCall:function(e,t,o){this.$(e).val(w()(o.target).val()),t(o)}}),me.DividerWidgetView=pe.WidgetView.extend({id:"automation_editor_block_divider",getTemplate:function(){return window.templates.dividerInsertion},behaviors:{DraggableBehavior:{cloneOriginal:!0,drop:function(){return new me.DividerBlockModel}}}}),x.on("before:start",(function(e){e.registerBlockType("divider",{blockModel:me.DividerBlockModel,blockView:me.DividerBlockView}),e.registerWidget({name:"divider",widgetView:me.DividerWidgetView,priority:93})}));var ge={},fe=ne;ge.TextBlockModel=fe.BlockModel.extend({defaults:function(){return this._getDefaults({type:"text",text:"Edit this to insert text"},x.getConfig().get("blockDefaults.text"))},_updateDefaults:function(){}}),ge.TextBlockView=fe.BlockView.extend({className:"mailpoet_block mailpoet_text_block mailpoet_droppable_block",getTemplate:function(){return window.templates.textBlock},modelEvents:c.ZP.omit(fe.BlockView.prototype.modelEvents,"change"),behaviors:c.ZP.extend({},fe.BlockView.prototype.behaviors,{TextEditorBehavior:{toolbar1:"blocks bold italic forecolor | link unlink",toolbar2:"alignleft aligncenter alignright alignjustify | bullist numlist blockquote | code mailpoet_shortcodes",validElements:"p[class|style],span[class|style],a[href|class|title|target|style],h1[class|style],h2[class|style],h3[class|style],ol[class|style],ul[class|style],li[class|style],strong[class|style],em[class|style],strike,br,blockquote[class|style],table[class|style],tr[class|style],th[class|style],td[class|style],del",invalidElements:"script",blockFormats:"Heading 1=h1;Heading 2=h2;Heading 3=h3;Paragraph=p",plugins:"link lists code mailpoet_shortcodes",configurationFilter:function(e){return c.ZP.extend({},e,{mailpoet_shortcodes:x.getConfig().get("shortcodes").toJSON(),mailpoet_shortcodes_window_title:(0,i.__)("Select a shortcode","mailpoet")})}}}),initialize:function(e){fe.BlockView.prototype.initialize.apply(this,arguments),this.renderOptions=c.ZP.defaults(e.renderOptions||{},{disableTextEditor:!1}),this.disableTextEditor=this.renderOptions.disableTextEditor},onDragSubstituteBy:function(){return ge.TextWidgetView},onRender:function(){this.toolsView=new ge.TextBlockToolsView({model:this.model,tools:{settings:!1}}),this.showChildView("toolsRegion",this.toolsView)},onTextEditorChange:function(e){this.model.set("text",e)},onTextEditorFocus:function(){this.disableDragging(),this.disableShowingTools()},onTextEditorBlur:function(){this.enableDragging(),this.enableShowingTools()}}),ge.TextBlockToolsView=fe.BlockToolsView.extend({getSettingsView:function(){return ge.TextBlockSettingsView}}),ge.TextBlockSettingsView=fe.BlockSettingsView.extend({getTemplate:function(){return window.templates.textBlockSettings}}),ge.TextWidgetView=fe.WidgetView.extend({id:"automation_editor_block_text",getTemplate:function(){return window.templates.textInsertion},behaviors:{DraggableBehavior:{cloneOriginal:!0,drop:function(){return new ge.TextBlockModel}}}}),x.on("before:start",(function(e){e.registerBlockType("text",{blockModel:ge.TextBlockModel,blockView:ge.TextBlockView}),e.registerWidget({name:"text",widgetView:ge.TextWidgetView,priority:90})}));var ve={},be=ne;ve.SpacerBlockModel=be.BlockModel.extend({defaults:function(){return this._getDefaults({type:"spacer",styles:{block:{backgroundColor:"transparent",height:"40px"}}},x.getConfig().get("blockDefaults.spacer"))}}),ve.SpacerBlockView=be.BlockView.extend({className:"mailpoet_block mailpoet_spacer_block mailpoet_droppable_block",getTemplate:function(){return window.templates.spacerBlock},behaviors:c.ZP.defaults({ResizableBehavior:{elementSelector:".mailpoet_spacer",resizeHandleSelector:".mailpoet_resize_handle",minLength:20,modelField:"styles.block.height"},ShowSettingsBehavior:{ignoreFrom:".mailpoet_resize_handle"}},be.BlockView.prototype.behaviors),modelEvents:c.ZP.omit(be.BlockView.prototype.modelEvents,"change"),onDragSubstituteBy:function(){return ve.SpacerWidgetView},initialize:function(){be.BlockView.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change:styles.block.backgroundColor",this.render),this.listenTo(this.model,"change:styles.block.height",this.changeHeight)},onRender:function(){this.toolsView=new ve.SpacerBlockToolsView({model:this.model}),this.showChildView("toolsRegion",this.toolsView)},changeHeight:function(){this.$(".mailpoet_spacer").css("height",this.model.get("styles.block.height")),this.$(".mailpoet_resize_handle_text").text(this.model.get("styles.block.height"))},onBeforeDestroy:function(){this.stopListening(this.model)}}),ve.SpacerBlockToolsView=be.BlockToolsView.extend({getSettingsView:function(){return ve.SpacerBlockSettingsView}}),ve.SpacerBlockSettingsView=be.BlockSettingsView.extend({getTemplate:function(){return window.templates.spacerBlockSettings},events:function(){return{"change .mailpoet_field_spacer_background_color":c.ZP.partial(this.changeColorField,"styles.block.backgroundColor"),"click .mailpoet_done_editing":"close"}}}),ve.SpacerWidgetView=be.WidgetView.extend({id:"automation_editor_block_spacer",getTemplate:function(){return window.templates.spacerInsertion},behaviors:{DraggableBehavior:{cloneOriginal:!0,drop:function(){return new ve.SpacerBlockModel}}}}),x.on("before:start",(function(e){e.registerBlockType("spacer",{blockModel:ve.SpacerBlockModel,blockView:ve.SpacerBlockView}),e.registerWidget({name:"spacer",widgetView:ve.SpacerWidgetView,priority:94})}));var ye={},we=ne;ye.FooterBlockModel=we.BlockModel.extend({defaults:function(){return this._getDefaults({type:"footer",text:'<a href="[link:subscription_unsubscribe_url]">Unsubscribe</a> | <a href="[link:subscription_manage_url]">Manage subscription</a><br /><b>Add your postal address here!</b>',styles:{block:{backgroundColor:"transparent"},text:{fontColor:"#000000",fontFamily:"Arial",fontSize:"12px",textAlign:"center"},link:{fontColor:"#0000ff",textDecoration:"none"}}},x.getConfig().get("blockDefaults.footer"))},_updateDefaults:function(){x.getConfig().set("blockDefaults.footer",c.ZP.omit(this.toJSON(),"text"))}}),ye.FooterBlockView=we.BlockView.extend({className:"mailpoet_block mailpoet_footer_block mailpoet_droppable_block",getTemplate:function(){return window.templates.footerBlock},modelEvents:c.ZP.extend({"change:styles.block.backgroundColor change:styles.text.fontColor change:styles.text.fontFamily change:styles.text.fontSize change:styles.text.textAlign change:styles.link.fontColor change:styles.link.textDecoration":"render"},c.ZP.omit(we.BlockView.prototype.modelEvents,"change")),behaviors:c.ZP.extend({},we.BlockView.prototype.behaviors,{TextEditorBehavior:{configurationFilter:function(e){return c.ZP.extend({},e,{mailpoet_shortcodes:x.getConfig().get("shortcodes").toJSON(),mailpoet_shortcodes_window_title:(0,i.__)("Select a shortcode","mailpoet")})}}}),onDragSubstituteBy:function(){return ye.FooterWidgetView},onRender:function(){this.toolsView=new ye.FooterBlockToolsView({model:this.model}),this.showChildView("toolsRegion",this.toolsView)},onTextEditorChange:function(e){this.model.set("text",e)},onTextEditorFocus:function(){this.disableDragging(),this.disableShowingTools()},onTextEditorBlur:function(){this.enableDragging(),this.enableShowingTools()}}),ye.FooterBlockToolsView=we.BlockToolsView.extend({getSettingsView:function(){return ye.FooterBlockSettingsView}}),ye.FooterBlockSettingsView=we.BlockSettingsView.extend({getTemplate:function(){return window.templates.footerBlockSettings},events:function(){return{"change .mailpoet_field_footer_text_color":c.ZP.partial(this.changeColorField,"styles.text.fontColor"),"change .mailpoet_field_footer_text_font_family":c.ZP.partial(this.changeField,"styles.text.fontFamily"),"change .mailpoet_field_footer_text_size":c.ZP.partial(this.changeField,"styles.text.fontSize"),"change #mailpoet_field_footer_link_color":c.ZP.partial(this.changeColorField,"styles.link.fontColor"),"change #mailpoet_field_footer_link_underline":function(e){this.model.set("styles.link.textDecoration",e.target.checked?e.target.value:"none")},"change .mailpoet_field_footer_background_color":c.ZP.partial(this.changeColorField,"styles.block.backgroundColor"),"change .mailpoet_field_footer_alignment":c.ZP.partial(this.changeField,"styles.text.textAlign"),"click .mailpoet_done_editing":"close"}},templateContext:function(){return c.ZP.extend({},we.BlockView.prototype.templateContext.apply(this,arguments),{availableStyles:x.getAvailableStyles().toJSON()})}}),ye.FooterWidgetView=we.WidgetView.extend({id:"automation_editor_block_footer",getTemplate:function(){return window.templates.footerInsertion},behaviors:{DraggableBehavior:{cloneOriginal:!0,drop:function(){return new ye.FooterBlockModel}}}}),x.on("before:start",(function(e){e.registerBlockType("footer",{blockModel:ye.FooterBlockModel,blockView:ye.FooterBlockView}),e.registerWidget({name:"footer",widgetView:ye.FooterWidgetView,priority:101})}));var _e={},xe=ne;_e.HeaderBlockModel=xe.BlockModel.extend({defaults:function(){return this._getDefaults({type:"header",text:'<a href="[link:newsletter_view_in_browser_url]">View this in your browser</a>',styles:{block:{backgroundColor:"transparent"},text:{fontColor:"#000000",fontFamily:"Arial",fontSize:"12px",textAlign:"center"},link:{fontColor:"#0000ff",textDecoration:"underline"}}},x.getConfig().get("blockDefaults.header"))},_updateDefaults:function(){x.getConfig().set("blockDefaults.header",c.ZP.omit(this.toJSON(),"text"))}}),_e.HeaderBlockView=xe.BlockView.extend({className:"mailpoet_block mailpoet_header_block mailpoet_droppable_block",getTemplate:function(){return window.templates.headerBlock},modelEvents:c.ZP.extend({"change:styles.block.backgroundColor change:styles.text.fontColor change:styles.text.fontFamily change:styles.text.fontSize change:styles.text.textAlign change:styles.link.fontColor change:styles.link.textDecoration":"render"},c.ZP.omit(xe.BlockView.prototype.modelEvents,"change")),behaviors:c.ZP.extend({},xe.BlockView.prototype.behaviors,{TextEditorBehavior:{configurationFilter:function(e){return c.ZP.extend({},e,{mailpoet_shortcodes:x.getConfig().get("shortcodes").toJSON(),mailpoet_shortcodes_window_title:(0,i.__)("Select a shortcode","mailpoet")})}}}),onDragSubstituteBy:function(){return _e.HeaderWidgetView},onRender:function(){this.toolsView=new _e.HeaderBlockToolsView({model:this.model}),this.showChildView("toolsRegion",this.toolsView)},onTextEditorChange:function(e){this.model.set("text",e)},onTextEditorFocus:function(){this.disableDragging(),this.disableShowingTools()},onTextEditorBlur:function(){this.enableDragging(),this.enableShowingTools()}}),_e.HeaderBlockToolsView=xe.BlockToolsView.extend({getSettingsView:function(){return _e.HeaderBlockSettingsView}}),_e.HeaderBlockSettingsView=xe.BlockSettingsView.extend({getTemplate:function(){return window.templates.headerBlockSettings},events:function(){return{"change .mailpoet_field_header_text_color":c.ZP.partial(this.changeColorField,"styles.text.fontColor"),"change .mailpoet_field_header_text_font_family":c.ZP.partial(this.changeField,"styles.text.fontFamily"),"change .mailpoet_field_header_text_size":c.ZP.partial(this.changeField,"styles.text.fontSize"),"change #mailpoet_field_header_link_color":c.ZP.partial(this.changeColorField,"styles.link.fontColor"),"change #mailpoet_field_header_link_underline":function(e){this.model.set("styles.link.textDecoration",e.target.checked?e.target.value:"none")},"change .mailpoet_field_header_background_color":c.ZP.partial(this.changeColorField,"styles.block.backgroundColor"),"change .mailpoet_field_header_alignment":c.ZP.partial(this.changeField,"styles.text.textAlign"),"click .mailpoet_done_editing":"close"}},templateContext:function(){return c.ZP.extend({},xe.BlockView.prototype.templateContext.apply(this,arguments),{availableStyles:x.getAvailableStyles().toJSON()})}}),_e.HeaderWidgetView=xe.WidgetView.extend({id:"automation_editor_block_header",getTemplate:function(){return window.templates.headerInsertion},behaviors:{DraggableBehavior:{cloneOriginal:!0,drop:function(){return new _e.HeaderBlockModel}}}}),x.on("before:start",(function(e){e.registerBlockType("header",{blockModel:_e.HeaderBlockModel,blockView:_e.HeaderBlockView}),e.registerWidget({name:"header",widgetView:_e.HeaderWidgetView,priority:100})}));var Ce={},ke=ne;Ce.ALCSupervisor=C.extend({initialize:function(){this.listenTo(x.getChannel(),"automatedLatestContentRefresh",c.ZP.debounce(this.refresh,500))},refresh:function(){var e,t=x.findModels((function(e){return"automatedLatestContent"===e.get("type")}))||[];0!==t.length&&(e=c.ZP.map(t,(function(e){return e.toJSON()})),j.getBulkTransformedPosts({blocks:e}).then(c.ZP.partial(this.refreshBlocks,t)))},refreshBlocks:function(e,t){c.ZP.each(c.ZP.zip(e,t),(function(e){var t=e[0],o=e[1];t.trigger("refreshPosts",o)}))}}),Ce.AutomatedLatestContentBlockModel=ke.BlockModel.extend({stale:["_container"],defaults:function(){return this._getDefaults({type:"automatedLatestContent",withLayout:!1,amount:"5",contentType:"post",terms:[],inclusionType:"include",displayType:"excerpt",titleFormat:"h1",titleAlignment:"left",titleIsLink:!1,imageFullWidth:!1,featuredImagePosition:"belowTitle",showAuthor:"no",authorPrecededBy:"Author:",showCategories:"no",categoriesPrecededBy:"Categories:",readMoreType:"button",readMoreText:"Read more",readMoreButton:{text:"Read more",url:"[postLink]"},sortBy:"newest",showDivider:!0,divider:{},_container:new(x.getBlockTypeModel("container"))},x.getConfig().get("blockDefaults.automatedLatestContent"))},relations:function(){return{readMoreButton:x.getBlockTypeModel("button"),divider:x.getBlockTypeModel("divider"),_container:x.getBlockTypeModel("container")}},initialize:function(){ke.BlockView.prototype.initialize.apply(this,arguments),this.on("change:amount change:contentType change:terms change:inclusionType change:displayType change:titleFormat change:featuredImagePosition change:titleAlignment change:titleIsLink change:imageFullWidth change:showAuthor change:authorPrecededBy change:showCategories change:categoriesPrecededBy change:readMoreType change:readMoreText change:sortBy change:showDivider",this._handleChanges,this),this.listenTo(this.get("readMoreButton"),"change",this._handleChanges),this.listenTo(this.get("divider"),"change",this._handleChanges),this.on("add remove update reset",this._handleChanges),this.on("refreshPosts",this.updatePosts,this)},updatePosts:function(e){this.get("_container.blocks").reset(e,{parse:!0})},_handleChanges:function(){this._updateDefaults(),x.getChannel().trigger("automatedLatestContentRefresh")}}),Ce.AutomatedLatestContentBlockView=ke.BlockView.extend({className:"mailpoet_block mailpoet_automated_latest_content_block mailpoet_droppable_block",initialize:function(){x.getChannel().on("replaceAllButtonStyles",function(e){this.model.set({readMoreButton:e})}.bind(this))},getTemplate:function(){return window.templates.automatedLatestContentBlock},regions:{toolsRegion:".mailpoet_tools",postsRegion:".mailpoet_automated_latest_content_block_posts"},modelEvents:c.ZP.extend(c.ZP.omit(ke.BlockView.prototype.modelEvents,"change"),{postsChanged:"render"}),events:{"click .mailpoet_automated_latest_content_block_overlay":"showSettings"},onDragSubstituteBy:function(){return Ce.AutomatedLatestContentWidgetView},onRender:function(){var e=x.getBlockTypeView("container"),t={disableTextEditor:!0,disableDragAndDrop:!0,emptyContainerMessage:(0,i.__)("There is no content to display.","mailpoet")};this.toolsView=new Ce.AutomatedLatestContentBlockToolsView({model:this.model}),this.showChildView("toolsRegion",this.toolsView),this.showChildView("postsRegion",new e({model:this.model.get("_container"),renderOptions:t}))}}),Ce.AutomatedLatestContentBlockToolsView=ke.BlockToolsView.extend({getSettingsView:function(){return Ce.AutomatedLatestContentBlockSettingsView}}),Ce.AutomatedLatestContentBlockSettingsView=ke.BlockSettingsView.extend({getTemplate:function(){return window.templates.automatedLatestContentBlockSettings},events:function(){return{"click .mailpoet_automated_latest_content_hide_display_options":"toggleDisplayOptions","click .mailpoet_automated_latest_content_show_display_options":"toggleDisplayOptions","click .mailpoet_automated_latest_content_select_button":"showButtonSettings","click .mailpoet_automated_latest_content_select_divider":"showDividerSettings","change .mailpoet_automated_latest_content_read_more_type":"changeReadMoreType","change .mailpoet_automated_latest_content_display_type":"changeDisplayType","change .mailpoet_automated_latest_content_title_format":"changeTitleFormat","change .mailpoet_automated_latest_content_title_as_links":c.ZP.partial(this.changeBoolField,"titleIsLink"),"change .mailpoet_automated_latest_content_show_divider":c.ZP.partial(this.changeBoolField,"showDivider"),"input .mailpoet_automated_latest_content_show_amount":c.ZP.partial(this.changeField,"amount"),"change .mailpoet_automated_latest_content_content_type":c.ZP.partial(this.changeField,"contentType"),"change .mailpoet_automated_latest_content_include_or_exclude":c.ZP.partial(this.changeField,"inclusionType"),"change .mailpoet_automated_latest_content_title_alignment":c.ZP.partial(this.changeField,"titleAlignment"),"change .mailpoet_automated_latest_content_image_full_width":c.ZP.partial(this.changeBoolField,"imageFullWidth"),"change .mailpoet_automated_latest_content_featured_image_position":c.ZP.partial(this.changeField,"featuredImagePosition"),"change .mailpoet_automated_latest_content_show_author":c.ZP.partial(this.changeField,"showAuthor"),"input .mailpoet_automated_latest_content_author_preceded_by":c.ZP.partial(this.changeField,"authorPrecededBy"),"change .mailpoet_automated_latest_content_show_categories":c.ZP.partial(this.changeField,"showCategories"),"input .mailpoet_automated_latest_content_categories":c.ZP.partial(this.changeField,"categoriesPrecededBy"),"input .mailpoet_automated_latest_content_read_more_text":c.ZP.partial(this.changeField,"readMoreText"),"change .mailpoet_automated_latest_content_sort_by":c.ZP.partial(this.changeField,"sortBy"),"click .mailpoet_done_editing":"close"}},onRender:function(){var e=this;j.getPostTypes().done(c.ZP.bind(this._updateContentTypes,this)),this.$(".mailpoet_automated_latest_content_categories_and_tags").select2({multiple:!0,allowClear:!0,placeholder:(0,i.__)("Categories & tags","mailpoet"),ajax:{data:function(e){return{term:e.term,page:e.page||1}},transport:function(t,o,n){var r,i=j.getTaxonomies(e.model.get("contentType")).then((function(e){return r=e,j.getTerms({search:t.data.term,page:t.data.page,taxonomies:c.ZP.keys(r)}).then((function(e){return{taxonomies:r,terms:e}}))}));return i.then(o),i.fail(n),i},processResults:function(e){return{results:c.ZP.map(e.terms,(function(t){return c.ZP.defaults({text:e.taxonomies[t.taxonomy].labels.singular_name+": "+t.name,id:t.term_id},t)})),pagination:{more:100===e.terms.length}}}}}).on({"select2:select":function(t){var o=e.model.get("terms");o.add(t.params.data),e.model.set("terms",o.toJSON())},"select2:unselect":function(t){var o=e.model.get("terms");o.remove(t.params.data),e.model.set("terms",o.toJSON())}}).trigger("change")},toggleDisplayOptions:function(){var e=this.$(".mailpoet_automated_latest_content_display_options"),t=this.$(".mailpoet_automated_latest_content_show_display_options");e.hasClass("mailpoet_closed")?(e.removeClass("mailpoet_closed"),t.addClass("mailpoet_hidden")):(e.addClass("mailpoet_closed"),t.removeClass("mailpoet_hidden"))},showButtonSettings:function(){new le.ButtonBlockSettingsView({model:this.model.get("readMoreButton"),renderOptions:{displayFormat:"subpanel",hideLink:!0,hideApplyToAll:!0}}).render()},showDividerSettings:function(){new me.DividerBlockSettingsView({model:this.model.get("divider"),renderOptions:{displayFormat:"subpanel",hideApplyToAll:!0}}).render()},changeReadMoreType:function(e){var t=w()(e.target).val();"link"===t?(this.$(".mailpoet_automated_latest_content_read_more_text").removeClass("mailpoet_hidden"),this.$(".mailpoet_automated_latest_content_select_button").addClass("mailpoet_hidden")):"button"===t&&(this.$(".mailpoet_automated_latest_content_read_more_text").addClass("mailpoet_hidden"),this.$(".mailpoet_automated_latest_content_select_button").removeClass("mailpoet_hidden")),this.changeField("readMoreType",e)},changeDisplayType:function(e){var t=w()(e.target).val();"titleOnly"===t?(this.$(".mailpoet_automated_latest_content_title_as_list").removeClass("mailpoet_hidden"),this.$(".mailpoet_automated_latest_content_image_full_width_option").addClass("mailpoet_hidden"),this.$(".mailpoet_automated_latest_content_image_separator").addClass("mailpoet_hidden")):(this.$(".mailpoet_automated_latest_content_title_as_list").addClass("mailpoet_hidden"),this.$(".mailpoet_automated_latest_content_image_full_width_option").removeClass("mailpoet_hidden"),this.$(".mailpoet_automated_latest_content_image_separator").removeClass("mailpoet_hidden"),"ul"===this.model.get("titleFormat")&&(this.model.set("titleFormat","h1"),this.$(".mailpoet_automated_latest_content_title_format").val(["h1"]),this.$(".mailpoet_automated_latest_content_title_as_link").removeClass("mailpoet_hidden"))),"excerpt"===t?this.$(".mailpoet_automated_latest_content_featured_image_position_container").removeClass("mailpoet_hidden"):this.$(".mailpoet_automated_latest_content_featured_image_position_container").addClass("mailpoet_hidden"),this.changeField("displayType",e)},changeTitleFormat:function(e){"ul"===w()(e.target).val()?(this.$(".mailpoet_automated_latest_content_non_title_list_options").addClass("mailpoet_hidden"),this.model.set("titleIsLink",!0),this.$(".mailpoet_automated_latest_content_title_as_link").addClass("mailpoet_hidden"),this.$(".mailpoet_automated_latest_content_title_as_links").val(["true"])):(this.$(".mailpoet_automated_latest_content_non_title_list_options").removeClass("mailpoet_hidden"),this.$(".mailpoet_automated_latest_content_title_as_link").removeClass("mailpoet_hidden")),this.changeField("titleFormat",e)},_updateContentTypes:function(e){var t=this.$(".mailpoet_automated_latest_content_content_type"),o=this.model.get("contentType");t.find("option").remove(),c.ZP.each(e,(function(e){t.append(w()("<option>",{value:e.name,text:e.label}))})),t.val(o)}}),Ce.AutomatedLatestContentWidgetView=ke.WidgetView.extend({getTemplate:function(){return window.templates.automatedLatestContentInsertion},behaviors:{DraggableBehavior:{cloneOriginal:!0,drop:function(){return new Ce.AutomatedLatestContentBlockModel({},{parse:!0})},onDrop:function(e){e.droppedView.triggerMethod("showSettings")}}}}),x.on("before:start",(function(e){e.registerBlockType("automatedLatestContent",{blockModel:Ce.AutomatedLatestContentBlockModel,blockView:Ce.AutomatedLatestContentBlockView})})),x.on("start",(function(e){var t=e;t._ALCSupervisor=new Ce.ALCSupervisor,t._ALCSupervisor.refresh()}));var Se={},Te=ne;Se.ALCLayoutSupervisor=C.extend({initialize:function(){this.listenTo(x.getChannel(),"automatedLatestContentLayoutRefresh",c.ZP.debounce(this.refresh,500))},refresh:function(){var e,t=x.findModels((function(e){return"automatedLatestContentLayout"===e.get("type")}))||[];0!==t.length&&(e=c.ZP.map(t,(function(e){return e.toJSON()})),j.getBulkTransformedPosts({blocks:e}).then(c.ZP.partial(this.refreshBlocks,t)))},refreshBlocks:function(e,t){c.ZP.each(c.ZP.zip(e,t),(function(e){var t=e[0],o=e[1];t.trigger("refreshPosts",o)}))}}),Se.AutomatedLatestContentLayoutBlockModel=Te.BlockModel.extend({stale:["_container","_displayOptionsHidden","_featuredImagePosition"],defaults:function(){return this._getDefaults({type:"automatedLatestContentLayout",withLayout:!0,amount:"5",contentType:"post",terms:[],inclusionType:"include",displayType:"excerpt",titleFormat:"h1",titleAlignment:"left",titleIsLink:!1,imageFullWidth:!1,titlePosition:"abovePost",featuredImagePosition:"centered",fullPostFeaturedImagePosition:"none",showAuthor:"no",authorPrecededBy:"Author:",showCategories:"no",categoriesPrecededBy:"Categories:",readMoreType:"button",readMoreText:"Read more",readMoreButton:{text:"Read more",url:"[postLink]"},sortBy:"newest",showDivider:!0,divider:{},_container:new(x.getBlockTypeModel("container")),_displayOptionsHidden:!0,_featuredImagePosition:"none"},x.getConfig().get("blockDefaults.automatedLatestContentLayout"))},relations:function(){return{readMoreButton:x.getBlockTypeModel("button"),divider:x.getBlockTypeModel("divider"),_container:x.getBlockTypeModel("container")}},initialize:function(e){c.ZP.isEmpty(e)&&this.set("fullPostFeaturedImagePosition","left"),e&&"full"===e.displayType&&"product"===e.contentType&&!this.get("fullPostFeaturedImagePosition")&&this.set("fullPostFeaturedImagePosition",this.get("featuredImagePosition")),Te.BlockView.prototype.initialize.apply(this,arguments),this.on("change:amount change:contentType change:terms change:inclusionType change:displayType change:titleFormat change:featuredImagePosition change:fullPostFeaturedImagePosition change:titleAlignment change:titleIsLink change:imageFullWidth change:showAuthor change:authorPrecededBy change:showCategories change:categoriesPrecededBy change:readMoreType change:readMoreText change:sortBy change:showDivider change:titlePosition",this._handleChanges,this),this.listenTo(this.get("readMoreButton"),"change",this._handleChanges),this.listenTo(this.get("divider"),"change",this._handleChanges),this.on("add remove update reset",this._handleChanges),this.on("refreshPosts",this.updatePosts,this);const t="full"===this.get("displayType")?"fullPostFeaturedImagePosition":"featuredImagePosition";this.set("_featuredImagePosition",this.get(t))},updatePosts:function(e){this.get("_container.blocks").reset(e,{parse:!0})},_handleChanges:function(){this._updateDefaults(),x.getChannel().trigger("automatedLatestContentLayoutRefresh")}}),Se.AutomatedLatestContentLayoutBlockView=Te.BlockView.extend({className:"mailpoet_block mailpoet_automated_latest_content_block mailpoet_droppable_block",initialize:function(){x.getChannel().on("replaceAllButtonStyles",function(e){this.model.set({readMoreButton:e})}.bind(this))},getTemplate:function(){return window.templates.automatedLatestContentLayoutBlock},regions:{toolsRegion:".mailpoet_tools",postsRegion:".mailpoet_automated_latest_content_block_posts"},modelEvents:c.ZP.extend(c.ZP.omit(Te.BlockView.prototype.modelEvents,"change"),{postsChanged:"render"}),events:{"click .mailpoet_automated_latest_content_block_overlay":"showSettings"},onDragSubstituteBy:function(){return Se.AutomatedLatestContentLayoutWidgetView},onRender:function(){var e=x.getBlockTypeView("container"),t={disableTextEditor:!0,disableDragAndDrop:!0,emptyContainerMessage:(0,i.__)("There is no content to display.","mailpoet")};this.toolsView=new Se.AutomatedLatestContentLayoutBlockToolsView({model:this.model}),this.showChildView("toolsRegion",this.toolsView),this.showChildView("postsRegion",new e({model:this.model.get("_container"),renderOptions:t}))},duplicateBlock:function(){var e=this.model.toJSON(),t=new Se.AutomatedLatestContentLayoutBlockModel(e);this.model.collection.add(t,{at:this.model.collection.findIndex(this.model)})}}),Se.AutomatedLatestContentLayoutBlockToolsView=Te.BlockToolsView.extend({getSettingsView:function(){return Se.AutomatedLatestContentLayoutBlockSettingsView}}),Se.AutomatedLatestContentLayoutBlockSettingsView=Te.BlockSettingsView.extend({getTemplate:function(){return window.templates.automatedLatestContentLayoutBlockSettings},events:function(){return{"click .mailpoet_automated_latest_content_hide_display_options":"toggleDisplayOptions","click .mailpoet_automated_latest_content_show_display_options":"toggleDisplayOptions","click .mailpoet_automated_latest_content_select_button":"showButtonSettings","click .mailpoet_automated_latest_content_select_divider":"showDividerSettings","change .mailpoet_automated_latest_content_read_more_type":"changeReadMoreType","change .mailpoet_automated_latest_content_display_type":"changeDisplayType","change .mailpoet_automated_latest_content_title_format":"changeTitleFormat","change .mailpoet_automated_latest_content_title_as_links":c.ZP.partial(this.changeBoolField,"titleIsLink"),"change .mailpoet_automated_latest_content_show_divider":c.ZP.partial(this.changeBoolField,"showDivider"),"input .mailpoet_automated_latest_content_show_amount":c.ZP.partial(this.changeField,"amount"),"change .mailpoet_automated_latest_content_content_type":c.ZP.partial(this.changeField,"contentType"),"change .mailpoet_automated_latest_content_include_or_exclude":c.ZP.partial(this.changeField,"inclusionType"),"change .mailpoet_automated_latest_content_title_alignment":c.ZP.partial(this.changeField,"titleAlignment"),"change .mailpoet_automated_latest_content_image_full_width":c.ZP.partial(this.changeBoolField,"imageFullWidth"),"change .mailpoet_automated_latest_content_featured_image_position":"changeFeaturedImagePosition","change .mailpoet_automated_latest_content_show_author":c.ZP.partial(this.changeField,"showAuthor"),"input .mailpoet_automated_latest_content_author_preceded_by":c.ZP.partial(this.changeField,"authorPrecededBy"),"change .mailpoet_automated_latest_content_show_categories":c.ZP.partial(this.changeField,"showCategories"),"input .mailpoet_automated_latest_content_categories":c.ZP.partial(this.changeField,"categoriesPrecededBy"),"input .mailpoet_automated_latest_content_read_more_text":c.ZP.partial(this.changeField,"readMoreText"),"change .mailpoet_automated_latest_content_sort_by":c.ZP.partial(this.changeField,"sortBy"),"change .mailpoet_automated_latest_content_title_position":c.ZP.partial(this.changeField,"titlePosition"),"click .mailpoet_done_editing":"close"}},onRender:function(){var e=this;j.getPostTypes().done(c.ZP.bind(this._updateContentTypes,this)),this.$(".mailpoet_automated_latest_content_categories_and_tags").select2({multiple:!0,allowClear:!0,placeholder:(0,i.__)("Categories & tags","mailpoet"),ajax:{data:function(e){return{term:e.term,page:e.page||1}},transport:function(t,o,n){var r,i=j.getTaxonomies(e.model.get("contentType")).then((function(e){return r=e,j.getTerms({search:t.data.term,page:t.data.page,taxonomies:c.ZP.keys(r)}).then((function(e){return{taxonomies:r,terms:e}}))}));return i.then(o),i.fail(n),i},processResults:function(e){return{results:c.ZP.map(e.terms,(function(t){return c.ZP.defaults({text:e.taxonomies[t.taxonomy].labels.singular_name+": "+t.name,id:t.term_id},t)})),pagination:{more:100===e.terms.length}}}}}).on({"select2:select":function(t){var o=e.model.get("terms");o.add(t.params.data),e.model.set("terms",o.toJSON())},"select2:unselect":function(t){var o=e.model.get("terms");o.remove(t.params.data),e.model.set("terms",o.toJSON())}}).trigger("change")},toggleDisplayOptions:function(){this.model.set("_displayOptionsHidden",!this.model.get("_displayOptionsHidden")),this.render()},showButtonSettings:function(){new le.ButtonBlockSettingsView({model:this.model.get("readMoreButton"),renderOptions:{displayFormat:"subpanel",hideLink:!0,hideApplyToAll:!0}}).render()},showDividerSettings:function(){new me.DividerBlockSettingsView({model:this.model.get("divider"),renderOptions:{displayFormat:"subpanel",hideApplyToAll:!0}}).render()},changeReadMoreType:function(e){var t=w()(e.target).val();"link"===t?(this.$(".mailpoet_automated_latest_content_read_more_text").removeClass("mailpoet_hidden"),this.$(".mailpoet_automated_latest_content_select_button").addClass("mailpoet_hidden")):"button"===t&&(this.$(".mailpoet_automated_latest_content_read_more_text").addClass("mailpoet_hidden"),this.$(".mailpoet_automated_latest_content_select_button").removeClass("mailpoet_hidden")),this.changeField("readMoreType",e)},changeDisplayType:function(e){"titleOnly"!==w()(e.target).val()&&"ul"===this.model.get("titleFormat")&&(this.model.set("titleFormat","h1"),this.$(".mailpoet_automated_latest_content_title_format").val(["h1"]),this.$(".mailpoet_automated_latest_content_title_as_link").removeClass("mailpoet_hidden")),this.changeField("displayType",e);const t="full"===this.model.get("displayType")?"fullPostFeaturedImagePosition":"featuredImagePosition";this.model.set("_featuredImagePosition",this.model.get(t)),this.render()},changeTitleFormat:function(e){"ul"===w()(e.target).val()?(this.$(".mailpoet_automated_latest_content_non_title_list_options").addClass("mailpoet_hidden"),this.model.set("titleIsLink",!0),this.$(".mailpoet_automated_latest_content_title_as_link").addClass("mailpoet_hidden"),this.$(".mailpoet_automated_latest_content_title_as_links").val(["true"])):(this.$(".mailpoet_automated_latest_content_non_title_list_options").removeClass("mailpoet_hidden"),this.$(".mailpoet_automated_latest_content_title_as_link").removeClass("mailpoet_hidden")),this.changeField("titleFormat",e)},changeFeaturedImagePosition:function(e){const t="full"===this.model.get("displayType")?"fullPostFeaturedImagePosition":"featuredImagePosition";this.changeField(t,e),this.changeField("_featuredImagePosition",e)},_updateContentTypes:function(e){var t=this.$(".mailpoet_automated_latest_content_content_type"),o=this.model.get("contentType");t.find("option").remove(),c.ZP.each(e,(function(e){t.append(w()("<option>",{value:e.name,text:e.label}))})),t.val(o)}}),Se.AutomatedLatestContentLayoutWidgetView=Te.WidgetView.extend({className:Te.WidgetView.prototype.className+" mailpoet_droppable_layout_block",getTemplate:function(){return window.templates.automatedLatestContentLayoutInsertion},behaviors:{DraggableBehavior:{cloneOriginal:!0,drop:function(){return new Se.AutomatedLatestContentLayoutBlockModel({},{parse:!0})},onDrop:function(e){e.droppedView.triggerMethod("showSettings")}}}}),x.on("before:start",(function(e){e.registerBlockType("automatedLatestContentLayout",{blockModel:Se.AutomatedLatestContentLayoutBlockModel,blockView:Se.AutomatedLatestContentLayoutBlockView}),e.registerWidget({name:"automatedLatestContentLayout",widgetView:Se.AutomatedLatestContentLayoutWidgetView,priority:97})})),x.on("start",(function(e){var t=e;t._ALCLayoutSupervisor=new Se.ALCLayoutSupervisor,t._ALCLayoutSupervisor.refresh()})),o(1201);var Ee,Oe,Ae,Me,Be,Pe={},Re=ne;Pe.PostsBlockModel=Re.BlockModel.extend({stale:["_selectedPosts","_availablePosts","_transformedPosts","_featuredImagePosition"],defaults:function(){return this._getDefaults({type:"posts",withLayout:!0,amount:"10",offset:0,contentType:"post",postStatus:"publish",terms:[],search:"",inclusionType:"include",displayType:"excerpt",titleFormat:"h1",titleAlignment:"left",titleIsLink:!1,imageFullWidth:!1,titlePosition:"abovePost",featuredImagePosition:"centered",fullPostFeaturedImagePosition:"none",showAuthor:"no",authorPrecededBy:"Author:",showCategories:"no",categoriesPrecededBy:"Categories:",readMoreType:"link",readMoreText:"Read more",readMoreButton:{text:"Read more",url:"[postLink]"},sortBy:"newest",showDivider:!0,divider:{},_selectedPosts:[],_availablePosts:[],_transformedPosts:new(x.getBlockTypeModel("container")),_featuredImagePosition:"none"},x.getConfig().get("blockDefaults.posts"))},relations:function(){return{readMoreButton:x.getBlockTypeModel("button"),divider:x.getBlockTypeModel("divider"),_selectedPosts:E().Collection,_availablePosts:E().Collection,_transformedPosts:x.getBlockTypeModel("container")}},initialize:function(e){var t=c.ZP.debounce(this.fetchAvailablePosts.bind(this),500),o=c.ZP.debounce(this._refreshTransformedPosts.bind(this),500);c.ZP.isEmpty(e)&&this.set("fullPostFeaturedImagePosition","left"),e&&"full"===e.displayType&&"product"===e.contentType&&!this.get("fullPostFeaturedImagePosition")&&this.set("fullPostFeaturedImagePosition",this.get("featuredImagePosition")),c.ZP.extend(this,b().Requests),this.fetchAvailablePosts(),this.on("change",this._updateDefaults,this),this.on("change:contentType change:terms change:postStatus change:search",t),this.on("loadMorePosts",this._loadMorePosts,this),this.listenTo(this.get("_selectedPosts"),"add remove reset",o),this.on("change:displayType change:titleFormat change:featuredImagePosition change:fullPostFeaturedImagePosition change:titleAlignment change:titleIsLink change:imageFullWidth change:showAuthor change:authorPrecededBy change:showCategories change:categoriesPrecededBy change:readMoreType change:readMoreText change:showDivider change:titlePosition",o),this.listenTo(this.get("readMoreButton"),"change",o),this.listenTo(this.get("divider"),"change",o),this.listenTo(x.getChannel(),"hideSettings",this.destroy),this.on("insertSelectedPosts",this._insertSelectedPosts,this);const n="full"===this.get("displayType")?"fullPostFeaturedImagePosition":"featuredImagePosition";this.set("_featuredImagePosition",this.get(n))},fetchAvailablePosts:function(){var e=this;this.set("offset",0),j.getPosts(this.toJSON()).done((function(t){e.get("_availablePosts").reset(t),e.get("_selectedPosts").reset(),e.trigger("change:_availablePosts")})).fail((function(){r.x.Notice.error((0,i.__)("Failed to fetch available posts","mailpoet"))}))},_loadMorePosts:function(){var e=this,t=this.get("_availablePosts").length,o=this.get("offset")+Number(this.get("amount"));return!(0===t||t<o||(this.set("offset",o),this.trigger("loadingMorePosts"),j.getPosts(this.toJSON()).done((function(t){e.get("_availablePosts").add(t),e.trigger("change:_availablePosts")})).fail((function(){r.x.Notice.error((0,i.__)("Failed to fetch available posts","mailpoet"))})).always((function(){e.trigger("morePostsLoaded")})),0))},_refreshTransformedPosts:function(){var e=this,t=this.toJSON();t.posts=this.get("_selectedPosts").pluck("ID"),0!==t.posts.length?j.getTransformedPosts(t).done((function(t){e.get("_transformedPosts").get("blocks").reset(t,{parse:!0})})).fail((function(){r.x.Notice.error((0,i.__)("Failed to fetch rendered posts","mailpoet"))})):this.get("_transformedPosts").get("blocks").reset()},_insertSelectedPosts:function(){var e=this.toJSON(),t=this.collection.indexOf(this),o=this.collection;e.posts=this.get("_selectedPosts").pluck("ID"),0!==e.posts.length&&j.getTransformedPosts(e).done((function(e){o.add(JSON.parse(JSON.stringify(e)),{at:t})})).fail((function(){r.x.Notice.error((0,i.__)("Failed to fetch rendered posts","mailpoet"))}))}}),Pe.PostsBlockView=Re.BlockView.extend({className:"mailpoet_block mailpoet_posts_block mailpoet_droppable_block",getTemplate:function(){return window.templates.postsBlock},modelEvents:{},regions:c.ZP.extend({postsRegion:".mailpoet_posts_container"},Re.BlockView.prototype.regions),onDragSubstituteBy:function(){return Pe.PostsWidgetView},initialize:function(){Re.BlockView.prototype.initialize.apply(this,arguments),this.toolsView=new Pe.PostsBlockToolsView({model:this.model}),this.model.reply("blockView",this.notifyAboutSelf,this)},onRender:function(){var e,t;this.getRegion("toolsRegion").hasView()||this.showChildView("toolsRegion",this.toolsView),this.trigger("showSettings"),e=x.getBlockTypeView("container"),t={disableTextEditor:!0,disableDragAndDrop:!0,emptyContainerMessage:(0,i.__)("There is no content to display.","mailpoet")},this.showChildView("postsRegion",new e({model:this.model.get("_transformedPosts"),renderOptions:t}))},notifyAboutSelf:function(){return this},onBeforeDestroy:function(){this.model.stopReplying("blockView",this.notifyAboutSelf,this)}}),Pe.PostsBlockToolsView=Re.BlockToolsView.extend({getSettingsView:function(){return Pe.PostsBlockSettingsView}}),Pe.PostsBlockSettingsView=Re.BlockSettingsView.extend({getTemplate:function(){return window.templates.postsBlockSettings},regions:{selectionRegion:".mailpoet_settings_posts_selection",displayOptionsRegion:".mailpoet_settings_posts_display_options"},events:{"click .mailpoet_settings_posts_show_display_options":"switchToDisplayOptions","click .mailpoet_settings_posts_show_post_selection":"switchToPostSelection","click .mailpoet_settings_posts_insert_selected":"insertPosts"},templateContext:function(){return{model:this.model.toJSON()}},initialize:function(){this.model.trigger("startEditing"),this.selectionView=new Me({model:this.model}),this.displayOptionsView=new Ee({model:this.model})},onRender:function(){var e=this;this.model.request("blockView"),this.showChildView("selectionRegion",this.selectionView),this.showChildView("displayOptionsRegion",this.displayOptionsView),r.x.Modal.panel({element:this.$el,template:"",position:"right",overlayRender:!1,width:x.getConfig().get("sidepanelWidth"),onCancel:function(){e.model.destroy()}}),this.selectionView.triggerMethod("attach"),this.displayOptionsView.triggerMethod("attach")},switchToDisplayOptions:function(){this.$(".mailpoet_settings_posts_selection").addClass("mailpoet_closed"),this.$(".mailpoet_settings_posts_display_options").removeClass("mailpoet_closed"),this.$(".mailpoet_settings_posts_show_display_options").addClass("mailpoet_hidden"),this.$(".mailpoet_settings_posts_show_post_selection").removeClass("mailpoet_hidden")},switchToPostSelection:function(){this.$(".mailpoet_settings_posts_display_options").addClass("mailpoet_closed"),this.$(".mailpoet_settings_posts_selection").removeClass("mailpoet_closed"),this.$(".mailpoet_settings_posts_show_post_selection").addClass("mailpoet_hidden"),this.$(".mailpoet_settings_posts_show_display_options").removeClass("mailpoet_hidden")},insertPosts:function(){this.model.trigger("insertSelectedPosts"),this.model.destroy(),this.close()}}),Be=f().CollectionView.extend({className:"mailpoet_post_scroll_container",childView:function(){return Oe},emptyView:function(){return Ae},childViewOptions:function(){return{blockModel:this.blockModel}},initialize:function(e){this.blockModel=e.blockModel},events:{scroll:"onPostsScroll"},onPostsScroll:function(e){var t=w()(e.target);t.scrollTop()+t.innerHeight()>=t[0].scrollHeight&&this.blockModel.trigger("loadMorePosts")}}),Me=f().View.extend({getTemplate:function(){return window.templates.postSelectionPostsBlockSettings},regions:{posts:".mailpoet_post_selection_container"},events:function(){return{"change .mailpoet_settings_posts_content_type":c.ZP.partial(this.changeField,"contentType"),"change .mailpoet_posts_post_status":c.ZP.partial(this.changeField,"postStatus"),"input .mailpoet_posts_search_term":c.ZP.partial(this.changeField,"search")}},modelEvents:{"change:offset":function(e,t){0===t&&this.$(".mailpoet_post_scroll_container").scrollTop(0)},loadingMorePosts:function(){this.$(".mailpoet_post_selection_loading").css("visibility","visible")},morePostsLoaded:function(){this.$(".mailpoet_post_selection_loading").css("visibility","hidden")}},templateContext:function(){return{model:this.model.toJSON()}},onRender:function(){var e;j.getPostTypes().done(c.ZP.bind(this._updateContentTypes,this)),e=new Be({collection:this.model.get("_availablePosts"),blockModel:this.model}),this.showChildView("posts",e)},onAttach:function(){var e=this;this.$(".mailpoet_posts_categories_and_tags").select2({multiple:!0,allowClear:!0,placeholder:(0,i.__)("Categories & tags","mailpoet"),ajax:{data:function(e){return{term:e.term,page:e.page||1}},transport:function(t,o,n){var r,i=j.getTaxonomies(e.model.get("contentType")).then((function(e){return r=e,j.getTerms({search:t.data.term,page:t.data.page,taxonomies:c.ZP.keys(r)}).then((function(e){return{taxonomies:r,terms:e}}))}));return i.then(o),i.fail(n),i},processResults:function(e){return{results:c.ZP.map(e.terms,(function(t){return c.ZP.defaults({text:e.taxonomies[t.taxonomy].labels.singular_name+": "+t.name,id:t.term_id},t)})),pagination:{more:100===e.terms.length}}}}}).on({"select2:select":function(t){var o=e.model.get("terms");o.add(t.params.data),e.model.set("terms",o.toJSON())},"select2:unselect":function(t){var o=e.model.get("terms");o.remove(t.params.data),e.model.set("terms",o.toJSON())}}).trigger("change")},changeField:function(e,t){this.model.set(e,w()(t.target).val())},_updateContentTypes:function(e){var t=this.$(".mailpoet_settings_posts_content_type"),o=this.model.get("contentType");t.find("option").remove(),c.ZP.each(e,(function(e){t.append(w()("<option>",{value:e.name,text:e.label}))})),t.val(o)}}),Ae=f().View.extend({getTemplate:function(){return window.templates.emptyPostPostsBlockSettings}}),Oe=f().View.extend({getTemplate:function(){return window.templates.singlePostPostsBlockSettings},events:function(){return{"change .mailpoet_select_post_checkbox":"postSelectionChange"}},templateContext:function(){return{model:this.model.toJSON(),index:this._index}},initialize:function(e){this.blockModel=e.blockModel},postSelectionChange:function(e){var t=w()(e.target),o=this.blockModel.get("_selectedPosts");t.prop("checked")?o.add(this.model):o.remove(this.model)}}),Ee=Re.BlockSettingsView.extend({getTemplate:function(){return window.templates.displayOptionsPostsBlockSettings},events:function(){return{"click .mailpoet_posts_select_button":"showButtonSettings","click .mailpoet_posts_select_divider":"showDividerSettings","change .mailpoet_posts_read_more_type":"changeReadMoreType","change .mailpoet_posts_display_type":"changeDisplayType","change .mailpoet_posts_title_format":"changeTitleFormat","change .mailpoet_posts_title_as_links":c.ZP.partial(this.changeBoolField,"titleIsLink"),"change .mailpoet_posts_show_divider":c.ZP.partial(this.changeBoolField,"showDivider"),"change .mailpoet_posts_content_type":c.ZP.partial(this.changeField,"contentType"),"change .mailpoet_posts_title_alignment":c.ZP.partial(this.changeField,"titleAlignment"),"change .mailpoet_posts_image_full_width":c.ZP.partial(this.changeBoolField,"imageFullWidth"),"change .mailpoet_posts_featured_image_position":"changeFeaturedImagePosition","change .mailpoet_posts_show_author":c.ZP.partial(this.changeField,"showAuthor"),"input .mailpoet_posts_author_preceded_by":c.ZP.partial(this.changeField,"authorPrecededBy"),"change .mailpoet_posts_show_categories":c.ZP.partial(this.changeField,"showCategories"),"input .mailpoet_posts_categories":c.ZP.partial(this.changeField,"categoriesPrecededBy"),"input .mailpoet_posts_read_more_text":c.ZP.partial(this.changeField,"readMoreText"),"change .mailpoet_automated_latest_content_title_position":c.ZP.partial(this.changeField,"titlePosition")}},templateContext:function(){return{model:this.model.toJSON()}},showButtonSettings:function(){new le.ButtonBlockSettingsView({model:this.model.get("readMoreButton"),renderOptions:{displayFormat:"subpanel",hideLink:!0,hideApplyToAll:!0}}).render()},showDividerSettings:function(){new me.DividerBlockSettingsView({model:this.model.get("divider"),renderOptions:{displayFormat:"subpanel",hideApplyToAll:!0}}).render()},changeReadMoreType:function(e){var t=w()(e.target).val();"link"===t?(this.$(".mailpoet_posts_read_more_text").removeClass("mailpoet_hidden"),this.$(".mailpoet_posts_select_button").addClass("mailpoet_hidden")):"button"===t&&(this.$(".mailpoet_posts_read_more_text").addClass("mailpoet_hidden"),this.$(".mailpoet_posts_select_button").removeClass("mailpoet_hidden")),this.changeField("readMoreType",e)},changeDisplayType:function(e){"titleOnly"!==w()(e.target).val()&&"ul"===this.model.get("titleFormat")&&(this.model.set("titleFormat","h1"),this.$(".mailpoet_posts_title_format").val(["h1"]),this.$(".mailpoet_posts_title_as_link").removeClass("mailpoet_hidden")),this.changeField("displayType",e);const t="full"===this.model.get("displayType")?"fullPostFeaturedImagePosition":"featuredImagePosition";this.model.set("_featuredImagePosition",this.model.get(t)),this.render()},changeTitleFormat:function(e){"ul"===w()(e.target).val()?(this.$(".mailpoet_posts_non_title_list_options").addClass("mailpoet_hidden"),this.model.set("titleIsLink",!0),this.$(".mailpoet_posts_title_as_link").addClass("mailpoet_hidden"),this.$(".mailpoet_posts_title_as_links").val(["true"])):(this.$(".mailpoet_posts_non_title_list_options").removeClass("mailpoet_hidden"),this.$(".mailpoet_posts_title_as_link").removeClass("mailpoet_hidden")),this.changeField("titleFormat",e)},changeFeaturedImagePosition:function(e){const t="full"===this.model.get("displayType")?"fullPostFeaturedImagePosition":"featuredImagePosition";this.changeField(t,e),this.changeField("_featuredImagePosition",e)}}),Pe.PostsWidgetView=Re.WidgetView.extend({className:Re.WidgetView.prototype.className+" mailpoet_droppable_layout_block",getTemplate:function(){return window.templates.postsInsertion},behaviors:{DraggableBehavior:{cloneOriginal:!0,drop:function(){return new Pe.PostsBlockModel({},{parse:!0})}}}}),x.on("before:start",(function(e){e.registerBlockType("posts",{blockModel:Pe.PostsBlockModel,blockView:Pe.PostsBlockView}),e.registerWidget({name:"posts",widgetView:Pe.PostsWidgetView,priority:96})}));var Ve,Ne,De,Fe,Ie,Le={},ze=ne;Le.ProductsBlockModel=ze.BlockModel.extend({stale:["_selectedProducts","_availableProducts","_transformedProducts"],defaults:function(){return this._getDefaults({type:"products",withLayout:!0,amount:"10",offset:0,contentType:"product",postStatus:"publish",terms:[],search:"",inclusionType:"include",displayType:"excerpt",titleFormat:"h1",titleAlignment:"left",titleIsLink:!1,imageFullWidth:!1,titlePosition:"abovePost",featuredImagePosition:"alternate",pricePosition:"below",readMoreType:"link",readMoreText:"Buy now",readMoreButton:{text:"Buy now",url:"[postLink]"},sortBy:"newest",showDivider:!0,divider:{},_selectedProducts:[],_availableProducts:[],_transformedProducts:new(x.getBlockTypeModel("container"))},x.getConfig().get("blockDefaults.products"))},relations:function(){return{readMoreButton:x.getBlockTypeModel("button"),divider:x.getBlockTypeModel("divider"),_selectedProducts:E().Collection,_availableProducts:E().Collection,_transformedProducts:x.getBlockTypeModel("container")}},initialize:function(){var e=c.ZP.debounce(this.fetchAvailableProducts.bind(this),500),t=c.ZP.debounce(this._refreshTransformedProducts.bind(this),500);c.ZP.extend(this,b().Requests),this.fetchAvailableProducts(),this.on("change",this._updateDefaults,this),this.on("change:terms change:postStatus change:search",e),this.on("loadMoreProducts",this._loadMoreProducts,this),this.listenTo(this.get("_selectedProducts"),"add remove reset",t),this.on("change:displayType change:titleFormat change:featuredImagePosition change:titleAlignment change:titleIsLink change:imageFullWidth change:pricePosition change:readMoreType change:readMoreText change:showDivider change:titlePosition",t),this.listenTo(this.get("readMoreButton"),"change",t),this.listenTo(this.get("divider"),"change",t),this.listenTo(x.getChannel(),"hideSettings",this.destroy),this.on("insertSelectedProducts",this._insertSelectedProducts,this)},fetchAvailableProducts:function(){var e=this;this.set("offset",0),j.getPosts(this.toJSON()).done((function(t){e.get("_availableProducts").reset(t),e.get("_selectedProducts").reset(),e.trigger("change:_availableProducts")})).fail((function(){r.x.Notice.error((0,i.__)("Failed to fetch available posts","mailpoet"))}))},_loadMoreProducts:function(){var e=this,t=this.get("_availableProducts").length,o=this.get("offset")+Number(this.get("amount"));return!(0===t||t<o||(this.set("offset",o),this.trigger("loadingMoreProducts"),j.getPosts(this.toJSON()).done((function(t){e.get("_availableProducts").add(t),e.trigger("change:_availableProducts")})).fail((function(){r.x.Notice.error((0,i.__)("Failed to fetch available posts","mailpoet"))})).always((function(){e.trigger("moreProductsLoaded")})),0))},_refreshTransformedProducts:function(){var e=this,t=this.toJSON();t.posts=this.get("_selectedProducts").pluck("ID"),0!==t.posts.length?j.getTransformedPosts(t).done((function(t){e.get("_transformedProducts").get("blocks").reset(t,{parse:!0})})).fail((function(){r.x.Notice.error((0,i.__)("Failed to fetch rendered posts","mailpoet"))})):this.get("_transformedProducts").get("blocks").reset()},_insertSelectedProducts:function(){var e=this.toJSON(),t=this.collection.indexOf(this),o=this.collection;e.posts=this.get("_selectedProducts").pluck("ID"),0!==e.posts.length&&j.getTransformedPosts(e).done((function(e){o.add(JSON.parse(JSON.stringify(e)),{at:t})})).fail((function(){r.x.Notice.error((0,i.__)("Failed to fetch rendered posts","mailpoet"))}))}}),Le.ProductsBlockView=ze.BlockView.extend({className:"mailpoet_block mailpoet_products_block mailpoet_droppable_block",getTemplate:function(){return window.templates.productsBlock},modelEvents:{},regions:c.ZP.extend({productsRegion:".mailpoet_products_container"},ze.BlockView.prototype.regions),onDragSubstituteBy:function(){return Le.ProductsWidgetView},initialize:function(){ze.BlockView.prototype.initialize.apply(this,arguments),this.toolsView=new Le.ProductsBlockToolsView({model:this.model}),this.model.reply("blockView",this.notifyAboutSelf,this)},onRender:function(){var e,t;this.getRegion("toolsRegion").hasView()||this.showChildView("toolsRegion",this.toolsView),this.trigger("showSettings"),e=x.getBlockTypeView("container"),t={disableTextEditor:!0,disableDragAndDrop:!0,emptyContainerMessage:(0,i.__)("There is no content to display.","mailpoet")},this.showChildView("productsRegion",new e({model:this.model.get("_transformedProducts"),renderOptions:t}))},notifyAboutSelf:function(){return this},onBeforeDestroy:function(){this.model.stopReplying("blockView",this.notifyAboutSelf,this)}}),Le.ProductsBlockToolsView=ze.BlockToolsView.extend({getSettingsView:function(){return Le.ProductsBlockSettingsView}}),Le.ProductsBlockSettingsView=ze.BlockSettingsView.extend({getTemplate:function(){return window.templates.productsBlockSettings},regions:{selectionRegion:".mailpoet_settings_products_selection",displayOptionsRegion:".mailpoet_settings_products_display_options"},events:{"click .mailpoet_settings_products_show_display_options":"switchToDisplayOptions","click .mailpoet_settings_products_show_product_selection":"switchToProductSelection","click .mailpoet_settings_products_insert_selected":"insertProducts"},templateContext:function(){return{model:this.model.toJSON()}},initialize:function(){this.model.trigger("startEditing"),this.selectionView=new Fe({model:this.model}),this.displayOptionsView=new Ve({model:this.model})},onRender:function(){var e=this;this.model.request("blockView"),this.showChildView("selectionRegion",this.selectionView),this.showChildView("displayOptionsRegion",this.displayOptionsView),r.x.Modal.panel({element:this.$el,template:"",position:"right",overlayRender:!1,width:x.getConfig().get("sidepanelWidth"),onCancel:function(){e.model.destroy()}}),this.selectionView.triggerMethod("attach"),this.displayOptionsView.triggerMethod("attach")},switchToDisplayOptions:function(){this.$(".mailpoet_settings_products_selection").addClass("mailpoet_closed"),this.$(".mailpoet_settings_products_display_options").removeClass("mailpoet_closed"),this.$(".mailpoet_settings_products_show_display_options").addClass("mailpoet_hidden"),this.$(".mailpoet_settings_products_show_product_selection").removeClass("mailpoet_hidden")},switchToProductSelection:function(){this.$(".mailpoet_settings_products_display_options").addClass("mailpoet_closed"),this.$(".mailpoet_settings_products_selection").removeClass("mailpoet_closed"),this.$(".mailpoet_settings_products_show_product_selection").addClass("mailpoet_hidden"),this.$(".mailpoet_settings_products_show_display_options").removeClass("mailpoet_hidden")},insertProducts:function(){this.model.trigger("insertSelectedProducts"),this.model.destroy(),this.close()}}),Ie=f().CollectionView.extend({className:"mailpoet_products_scroll_container",childView:function(){return Ne},emptyView:function(){return De},childViewOptions:function(){return{blockModel:this.blockModel}},initialize:function(e){this.blockModel=e.blockModel},events:{scroll:"onProductsScroll"},onProductsScroll:function(e){var t=w()(e.target);t.scrollTop()+t.innerHeight()>=t[0].scrollHeight&&this.blockModel.trigger("loadMoreProducts")}}),Fe=f().View.extend({getTemplate:function(){return window.templates.postSelectionProductsBlockSettings},regions:{posts:".mailpoet_product_selection_container"},events:function(){return{"change .mailpoet_products_post_status":c.ZP.partial(this.changeField,"postStatus"),"input .mailpoet_products_search_term":c.ZP.partial(this.changeField,"search")}},modelEvents:{"change:offset":function(e,t){0===t&&this.$(".mailpoet_products_scroll_container").scrollTop(0)},loadingMoreProducts:function(){this.$(".mailpoet_product_selection_loading").css("visibility","visible")},moreProductsLoaded:function(){this.$(".mailpoet_product_selection_loading").css("visibility","hidden")}},templateContext:function(){return{model:this.model.toJSON()}},onRender:function(){var e;e=new Ie({collection:this.model.get("_availableProducts"),blockModel:this.model}),this.showChildView("posts",e)},onAttach:function(){var e=this;this.$(".mailpoet_products_categories_and_tags").select2({multiple:!0,allowClear:!0,placeholder:(0,i.__)("Categories & tags","mailpoet"),ajax:{data:function(e){return{term:e.term,page:e.page||1}},transport:function(t,o,n){var r,i=j.getTaxonomies(e.model.get("contentType")).then((function(e){return r=e,j.getTerms({search:t.data.term,page:t.data.page,taxonomies:c.ZP.keys(r)}).then((function(e){return{taxonomies:r,terms:e}}))}));return i.then(o),i.fail(n),i},processResults:function(e){return{results:c.ZP.map(e.terms,(function(t){return c.ZP.defaults({text:e.taxonomies[t.taxonomy].labels.singular_name+": "+t.name,id:t.term_id},t)})),pagination:{more:100===e.terms.length}}}}}).on({"select2:select":function(t){var o=e.model.get("terms");o.add(t.params.data),e.model.set("terms",o.toJSON())},"select2:unselect":function(t){var o=e.model.get("terms");o.remove(t.params.data),e.model.set("terms",o.toJSON())}}).trigger("change")},changeField:function(e,t){this.model.set(e,w()(t.target).val())}}),De=f().View.extend({getTemplate:function(){return window.templates.emptyPostProductsBlockSettings}}),Ne=f().View.extend({getTemplate:function(){return window.templates.singlePostProductsBlockSettings},events:function(){return{"change .mailpoet_select_product_checkbox":"productSelectionChange"}},templateContext:function(){return{model:this.model.toJSON(),index:this._index}},initialize:function(e){this.blockModel=e.blockModel},productSelectionChange:function(e){var t=w()(e.target),o=this.blockModel.get("_selectedProducts");t.prop("checked")?o.add(this.model):o.remove(this.model)}}),Ve=ze.BlockSettingsView.extend({getTemplate:function(){return window.templates.displayOptionsProductsBlockSettings},events:function(){return{"click .mailpoet_products_select_button":"showButtonSettings","click .mailpoet_products_select_divider":"showDividerSettings","change .mailpoet_products_read_more_type":"changeReadMoreType","change .mailpoet_products_display_type":"changeDisplayType","change .mailpoet_products_title_format":"changeTitleFormat","change .mailpoet_products_title_as_links":c.ZP.partial(this.changeBoolField,"titleIsLink"),"change .mailpoet_products_show_divider":c.ZP.partial(this.changeBoolField,"showDivider"),"change .mailpoet_products_title_alignment":c.ZP.partial(this.changeField,"titleAlignment"),"change .mailpoet_products_image_full_width":c.ZP.partial(this.changeBoolField,"imageFullWidth"),"change .mailpoet_products_featured_image_position":c.ZP.partial(this.changeField,"featuredImagePosition"),"change .mailpoet_products_price_position":c.ZP.partial(this.changeField,"pricePosition"),"input .mailpoet_products_read_more_text":c.ZP.partial(this.changeField,"readMoreText"),"change .mailpoet_products_title_position":c.ZP.partial(this.changeField,"titlePosition")}},templateContext:function(){return{model:this.model.toJSON()}},showButtonSettings:function(){new le.ButtonBlockSettingsView({model:this.model.get("readMoreButton"),renderOptions:{displayFormat:"subpanel",hideLink:!0,hideApplyToAll:!0}}).render()},showDividerSettings:function(){new me.DividerBlockSettingsView({model:this.model.get("divider"),renderOptions:{displayFormat:"subpanel",hideApplyToAll:!0}}).render()},changeReadMoreType:function(e){var t=w()(e.target).val();"link"===t?(this.$(".mailpoet_products_read_more_text").removeClass("mailpoet_hidden"),this.$(".mailpoet_products_select_button").addClass("mailpoet_hidden")):"button"===t&&(this.$(".mailpoet_products_read_more_text").addClass("mailpoet_hidden"),this.$(".mailpoet_products_select_button").removeClass("mailpoet_hidden")),this.changeField("readMoreType",e)},changeDisplayType:function(e){"titleOnly"!==w()(e.target).val()?(this.$(".mailpoet_products_title_position").removeClass("mailpoet_hidden"),this.$(".mailpoet_products_title_position_separator").removeClass("mailpoet_hidden")):(this.$(".mailpoet_products_title_position").addClass("mailpoet_hidden"),this.$(".mailpoet_products_title_position_separator").addClass("mailpoet_hidden")),this.changeField("displayType",e)},changeTitleFormat:function(e){this.changeField("titleFormat",e)}}),Le.ProductsWidgetView=ze.WidgetView.extend({className:ze.WidgetView.prototype.className+" mailpoet_droppable_layout_block",id:"automation_editor_block_products",getTemplate:function(){return window.templates.productsInsertion},behaviors:{DraggableBehavior:{cloneOriginal:!0,drop:function(){return new Le.ProductsBlockModel({},{parse:!0})}}}}),x.on("before:start",(function(e){window.mailpoet_woocommerce_active&&(e.registerBlockType("products",{blockModel:Le.ProductsBlockModel,blockView:Le.ProductsBlockView}),e.registerWidget({name:"products",widgetView:Le.ProductsWidgetView,priority:98}))}));var He,Ze={},je=ne,Ue=!0;Ze.AbandonedCartContentBlockModel=je.BlockModel.extend({stale:["_selectedProducts","_availableProducts","_transformedProducts"],defaults:function(){return this._getDefaults({type:"abandonedCartContent",withLayout:!0,amount:"2",contentType:"product",postStatus:"publish",inclusionType:"include",displayType:"excerpt",titleFormat:"h1",titleAlignment:"left",titleIsLink:!1,imageFullWidth:!1,titlePosition:"abovePost",featuredImagePosition:"alternate",pricePosition:"below",readMoreType:"none",readMoreText:"",readMoreButton:{},sortBy:"newest",showDivider:!0,divider:{},_selectedProducts:[],_availableProducts:[],_transformedProducts:new(x.getBlockTypeModel("container"))},x.getConfig().get("blockDefaults.abandonedCartContent"))},relations:function(){return{divider:x.getBlockTypeModel("divider"),_selectedProducts:E().Collection,_availableProducts:E().Collection,_transformedProducts:x.getBlockTypeModel("container")}},initialize:function(){var e=c.ZP.debounce(this._refreshTransformedProducts.bind(this),500);c.ZP.extend(this,b().Requests),this._refreshTransformedProducts(),this.on("change",this._updateDefaults,this),this.listenTo(this.get("_selectedProducts"),"add remove reset",e),this.on("change:displayType change:titleFormat change:featuredImagePosition change:titleAlignment change:titleIsLink change:imageFullWidth change:pricePosition change:showDivider change:titlePosition",e),this.listenTo(this.get("divider"),"change",e)},_refreshTransformedProducts:function(){var e=this,t=this.toJSON();j.getTransformedPosts(t).done((function(t){e.get("_transformedProducts").get("blocks").reset(t,{parse:!0})})).fail((function(){r.x.Notice.error((0,i.__)("Failed to fetch rendered posts","mailpoet"))}))}}),Ze.AbandonedCartContentBlockView=je.BlockView.extend({className:"mailpoet_block mailpoet_abandoned_cart_content_block mailpoet_droppable_block",getTemplate:function(){return window.templates.abandonedCartContentBlock},modelEvents:c.ZP.omit(je.BlockView.prototype.modelEvents,"change"),regions:c.ZP.extend({productsRegion:".mailpoet_abandoned_cart_content_container"},je.BlockView.prototype.regions),onDragSubstituteBy:function(){return Ze.AbandonedCartContentBlockWidgetView},initialize:function(){je.BlockView.prototype.initialize.apply(this,arguments),this.toolsView=new Ze.AbandonedCartContentBlockToolsView({model:this.model})},events:{"click .mailpoet_abandoned_cart_content_block_overlay":"showSettings"},onRender:function(){var e,t;Ue&&(this.getRegion("toolsRegion").hasView()||this.showChildView("toolsRegion",this.toolsView),e=x.getBlockTypeView("container"),t={disableTextEditor:!0,disableDragAndDrop:!0,emptyContainerMessage:(0,i.__)("There is no content to display.","mailpoet")},this.showChildView("productsRegion",new e({model:this.model.get("_transformedProducts"),renderOptions:t})))}}),Ze.AbandonedCartContentBlockToolsView=je.BlockToolsView.extend({getSettingsView:function(){return Ze.AbandonedCartContentBlockSettingsView}}),Ze.AbandonedCartContentBlockSettingsView=je.BlockSettingsView.extend({getTemplate:function(){return window.templates.abandonedCartContentBlockSettings},regions:{displayOptionsRegion:".mailpoet_settings_abandoned_cart_content_display_options"},events:{"click .mailpoet_done_editing":"close"},templateContext:function(){return{model:this.model.toJSON()}},initialize:function(){this.model.trigger("startEditing"),this.displayOptionsView=new He({model:this.model})},onRender:function(){this.model.request("blockView"),this.showChildView("displayOptionsRegion",this.displayOptionsView),r.x.Modal.panel({element:this.$el,template:"",position:"right",overlayRender:!1,width:x.getConfig().get("sidepanelWidth")}),this.displayOptionsView.triggerMethod("attach")}}),He=je.BlockSettingsView.extend({getTemplate:function(){return window.templates.displayOptionsAbandonedCartContentBlockSettings},events:function(){return{"click .mailpoet_products_select_divider":"showDividerSettings","change .mailpoet_products_display_type":"changeDisplayType","change .mailpoet_products_title_format":"changeTitleFormat","change .mailpoet_products_title_as_links":c.ZP.partial(this.changeBoolField,"titleIsLink"),"change .mailpoet_products_show_divider":c.ZP.partial(this.changeBoolField,"showDivider"),"change .mailpoet_products_title_alignment":c.ZP.partial(this.changeField,"titleAlignment"),"change .mailpoet_products_image_full_width":c.ZP.partial(this.changeBoolField,"imageFullWidth"),"change .mailpoet_products_featured_image_position":c.ZP.partial(this.changeField,"featuredImagePosition"),"change .mailpoet_products_price_position":c.ZP.partial(this.changeField,"pricePosition"),"change .mailpoet_products_title_position":c.ZP.partial(this.changeField,"titlePosition")}},templateContext:function(){return{model:this.model.toJSON()}},showDividerSettings:function(){new me.DividerBlockSettingsView({model:this.model.get("divider"),renderOptions:{displayFormat:"subpanel",hideApplyToAll:!0}}).render()},changeDisplayType:function(e){"titleOnly"!==w()(e.target).val()?(this.$(".mailpoet_products_title_position").removeClass("mailpoet_hidden"),this.$(".mailpoet_products_title_position_separator").removeClass("mailpoet_hidden")):(this.$(".mailpoet_products_title_position").addClass("mailpoet_hidden"),this.$(".mailpoet_products_title_position_separator").addClass("mailpoet_hidden")),this.changeField("displayType",e)},changeTitleFormat:function(e){this.changeField("titleFormat",e)}}),Ze.AbandonedCartContentBlockWidgetView=je.WidgetView.extend({className:je.WidgetView.prototype.className+" mailpoet_droppable_layout_block",id:"automation_editor_block_abandoned_cart_content",getTemplate:function(){return window.templates.abandonedCartContentInsertion},behaviors:{DraggableBehavior:{cloneOriginal:!0,drop:function(){return new Ze.AbandonedCartContentBlockModel({},{parse:!0})}}}}),x.on("before:start",(function(e,t){window.mailpoet_woocommerce_active&&(e.registerBlockType("abandonedCartContent",{blockModel:Ze.AbandonedCartContentBlockModel,blockView:Ze.AbandonedCartContentBlockView}),"woocommerce"===t.newsletter.options.group&&"woocommerce_abandoned_shopping_cart"===t.newsletter.options.event?e.registerWidget({name:"abandonedCartContent",widgetView:Ze.AbandonedCartContentBlockWidgetView,priority:99}):Ue=!1)}));var $e,We,qe,Ge,Ye,Xe={},Ke=ne;Xe.SocialIconModel=C.extend({defaults:function(){var e=x.getConfig().get("socialIcons.custom");return{type:"socialIcon",iconType:"custom",link:e.get("defaultLink"),image:x.getAvailableStyles().get("socialIconSets.default.custom"),height:"32px",width:"32px",text:e.get("title")}},initialize:function(){var e=this;this.on("change:iconType",(function(){var t=x.getConfig().get("socialIcons").get(e.get("iconType")),o=e.collection.iconBlockModel.getIconSet();this.set({link:t.get("defaultLink"),image:o.get(e.get("iconType")),text:t.get("title")})}),this),this.on("change",(function(){x.getChannel().trigger("autoSave")}))}}),Xe.SocialIconCollectionModel=E().Collection.extend({model:Xe.SocialIconModel}),Xe.SocialBlockModel=Ke.BlockModel.extend({name:"iconBlockModel",defaults:function(){return this._getDefaults({type:"social",iconSet:"default",styles:{block:{textAlign:"center"}},icons:new Xe.SocialIconCollectionModel},x.getConfig().get("blockDefaults.social"))},relations:{icons:Xe.SocialIconCollectionModel},initialize:function(){this.get("icons").on("add remove change",this._iconsChanged,this),this.on("change:iconSet",this.changeIconSet,this),this.on("change",this._updateDefaults,this)},getIconSet:function(){return x.getAvailableStyles().get("socialIconSets").get(this.get("iconSet"))},changeIconSet:function(){var e=this.getIconSet();c.ZP.each(this.get("icons").models,(function(t){t.set("image",e.get(t.get("iconType")))}))},_iconsChanged:function(){this._updateDefaults(),x.getChannel().trigger("autoSave")}}),Ye=f().View.extend({tagName:"span",getTemplate:function(){return window.templates.socialIconBlock},modelEvents:{change:"render"},templateContext:function(){var e=x.getAvailableStyles().get("socialIconSets");return{model:this.model.toJSON(),allIconSets:e.toJSON(),imageMissingSrc:x.getConfig().get("urls.imageMissing")}}}),Xe.SocialIconCollectionView=f().CollectionView.extend({childView:Ye}),Xe.SocialBlockView=Ke.BlockView.extend({className:"mailpoet_block mailpoet_social_block mailpoet_droppable_block",getTemplate:function(){return window.templates.socialBlock},regions:c.ZP.extend({},Ke.BlockView.prototype.regions,{icons:".mailpoet_social"}),ui:{tools:"> .mailpoet_tools"},behaviors:c.ZP.extend({},Ke.BlockView.prototype.behaviors,{ShowSettingsBehavior:{}}),onDragSubstituteBy:function(){return Xe.SocialWidgetView},onRender:function(){this.toolsView=new Xe.SocialBlockToolsView({model:this.model}),this.showChildView("toolsRegion",this.toolsView),this.showChildView("icons",new Xe.SocialIconCollectionView({collection:this.model.get("icons")}))}}),Xe.SocialBlockToolsView=Ke.BlockToolsView.extend({getSettingsView:function(){return Xe.SocialBlockSettingsView}}),Xe.SocialBlockSettingsView=Ke.BlockSettingsView.extend({getTemplate:function(){return window.templates.socialBlockSettings},regions:{iconRegion:"#mailpoet_social_icons_selection",stylesRegion:"#mailpoet_social_icons_styles"},events:function(){return{"click .mailpoet_done_editing":"close","change .mailpoet_social_block_alignment":c.ZP.partial(this.changeField,"styles.block.textAlign")}},initialize:function(){Ke.BlockSettingsView.prototype.initialize.apply(this,arguments),this._iconSelectorView=new $e({model:this.model}),this._stylesView=new Ge({model:this.model})},onRender:function(){this.showChildView("iconRegion",this._iconSelectorView),this.showChildView("stylesRegion",this._stylesView)}}),We=f().View.extend({getTemplate:function(){return window.templates.socialSettingsIcon},events:function(){return{"click .mailpoet_delete_block":"deleteIcon","change .mailpoet_social_icon_field_type":c.ZP.partial(this.changeField,"iconType"),"input .mailpoet_social_icon_field_image":c.ZP.partial(this.changeField,"image"),"input .mailpoet_social_icon_field_link":this.changeLink,"input .mailpoet_social_icon_field_text":c.ZP.partial(this.changeField,"text")}},modelEvents:{"change:iconType":"render","change:image":function(){this.$(".mailpoet_social_icon_image").attr("src",this.model.get("image"))},"change:text":function(){this.$(".mailpoet_social_icon_image").attr("alt",this.model.get("text"))}},templateContext:function(){var e=x.getConfig().get("socialIcons"),t=c.ZP.map(c.ZP.keys(e.attributes),(function(t){return{iconType:t,title:e.get(t).get("title")}})),o=x.getAvailableStyles().get("socialIconSets");return c.ZP.extend({},Ke.BlockView.prototype.templateContext.apply(this,arguments),{iconTypes:t,currentType:e.get(this.model.get("iconType")).toJSON(),allIconSets:o.toJSON()})},deleteIcon:function(){this.model.destroy()},changeLink:function(e){if("email"!==this.model.get("iconType"))return this.changeField("link",e);this.model.set("link","mailto:"+w()(e.target).val())},changeField:function(e,t){this.model.set(e,w()(t.target).val())}}),qe=f().CollectionView.extend({behaviors:{SortableBehavior:{items:"> div"}},childViewContainer:"#mailpoet_social_icon_selector_contents",childView:We}),$e=f().View.extend({getTemplate:function(){return window.templates.socialSettingsIconSelector},regions:{icons:"#mailpoet_social_icon_selector_contents"},events:{"click .mailpoet_add_social_icon":"addSocialIcon"},modelEvents:{"change:iconSet":"render"},addSocialIcon:function(){this.model.get("icons").add({})},onRender:function(){this.showChildView("icons",new qe({collection:this.model.get("icons")}))}}),Ge=f().View.extend({getTemplate:function(){return window.templates.socialSettingsStyles},modelEvents:{change:"render"},events:{"click .mailpoet_social_icon_set":"changeSocialIconSet"},initialize:function(){this.listenTo(this.model.get("icons"),"add remove change",this.render)},templateContext:function(){var e=x.getAvailableStyles().get("socialIconSets");return{activeSet:this.model.get("iconSet"),socialIconSets:e.toJSON(),availableSets:c.ZP.keys(e.toJSON()),availableSocialIcons:this.model.get("icons").pluck("iconType")}},changeSocialIconSet:function(e){this.model.set("iconSet",w()(e.currentTarget).data("setname"))},onBeforeDestroy:function(){this.model.get("icons").off("add remove",this.render,this)}}),Xe.SocialWidgetView=Ke.WidgetView.extend({id:"automation_editor_block_social",getTemplate:function(){return window.templates.socialInsertion},behaviors:{DraggableBehavior:{cloneOriginal:!0,drop:function(){return new Xe.SocialBlockModel}}}}),x.on("before:start",(function(e){e.registerBlockType("social",{blockModel:Xe.SocialBlockModel,blockView:Xe.SocialBlockView}),e.registerWidget({name:"social",widgetView:Xe.SocialWidgetView,priority:95})}));const Je=ne.BlockModel.extend({stale:["selected"],defaults(){return this._getDefaults({type:"woocommerceContent",selected:"completed_order"},x.getConfig().get("blockDefaults.woocommerceContent"))}}),Qe=ne.BlockToolsView.extend({tools:{move:!0}}),et=ne.WidgetView.extend({className:ne.WidgetView.prototype.className+" mailpoet_droppable_layout_block",getTemplate:()=>window.templates.woocommerceContentInsertion,behaviors:{DraggableBehavior:{cloneOriginal:!0,drop:()=>new Je({},{parse:!0})}}}),tt=ne.BlockView.extend({className:"mailpoet_block mailpoet_woocommerce_content_block mailpoet_droppable_block",initialize:function(){ne.BlockView.prototype.initialize.apply(this,arguments),this.listenTo(x.getChannel(),"changeWCEmailType",(e=>{this.model.set("selected",e),this.render()}))},getTemplate(){return"new_account"===this.model.get("selected")?window.templates.woocommerceNewAccount:"processing_order"===this.model.get("selected")?window.templates.woocommerceProcessingOrder:"completed_order"===this.model.get("selected")?window.templates.woocommerceCompletedOrder:window.templates.woocommerceCustomerNote},regions:{toolsRegion:".mailpoet_tools"},onDragSubstituteBy:()=>et,onRender(){this.toolsView=new Qe({model:this.model}),this.showChildView("toolsRegion",this.toolsView)},templateContext(){return{viewCid:this.cid,model:this.model.toJSON(),selected:this.model.get("selected"),siteName:window.mailpoet_site_name,siteAddress:window.mailpoet_site_address}}});x.on("before:start",(e=>{e.registerBlockType("woocommerceContent",{blockModel:Je,blockView:tt})}));const ot=ne.BlockModel.extend({stale:["contents","selected"],defaults(){return this._getDefaults({type:"woocommerceHeading",selected:"completed_order"},x.getConfig().get("blockDefaults.woocommerceHeading"))}}),nt=ne.BlockToolsView.extend({tools:{move:!0}}),rt=ne.WidgetView.extend({className:ne.WidgetView.prototype.className+" mailpoet_droppable_layout_block",getTemplate:()=>window.templates.woocommerceHeadingInsertion,behaviors:{DraggableBehavior:{cloneOriginal:!0,drop:()=>new ot({},{parse:!0})}}}),it=ne.BlockView.extend({className:"mailpoet_container mailpoet_woocommerce_heading_block mailpoet_droppable_block",initialize:function(){ne.BlockView.prototype.initialize.apply(this,arguments),this.listenTo(x.getChannel(),"changeWCEmailType",(e=>{this.model.set("selected",e),this.render()}))},modelEvents:c.ZP.omit(ne.BlockView.prototype.modelEvents,"change"),getTemplate:()=>window.templates.woocommerceHeadingBlock,regions:{toolsRegion:".mailpoet_tools"},onDragSubstituteBy:()=>rt,onRender(){this.toolsView=new nt({model:this.model}),this.showChildView("toolsRegion",this.toolsView)},templateContext(){const e=this.model.get("contents").toJSON(),t=this.model.get("selected");return{viewCid:this.cid,model:this.model.toJSON(),content:e[t]}}});x.on("before:start",(e=>{e.registerBlockType("woocommerceHeading",{blockModel:ot,blockView:it})}));var st=o(12447),at=o.n(st);const lt={},ct=ne;lt.BlockModel=ct.BlockModel.extend({}),lt.BlockView=ct.BlockView.extend({className:"mailpoet_block mailpoet_fallback_block mailpoet_droppable_block",getTemplate:function(){return window.templates.unknownBlockFallbackBlock},onRender:function(){this.toolsView=new lt.BlockToolsView({model:this.model,tools:{settings:!1,duplicate:!1}}),at()((()=>{this.showChildView("toolsRegion",this.toolsView)}))},templateContext(){return{blockType:this.model.get("type")}}}),lt.WidgetView=ct.WidgetView.extend({id:"automation_editor_block_fallback",getTemplate:function(){return window.templates.unknownBlockFallbackInsertion},behaviors:{DraggableBehavior:{cloneOriginal:!0,drop:function(){return new lt.BlockModel}}}}),lt.BlockToolsView=ct.BlockToolsView.extend({}),x.on("before:start",(function(e){e.registerBlockType("unknownBlockFallback",{blockModel:lt.BlockModel,blockView:lt.BlockView})}));var dt=o(45833),ut=o(53890),ht=o(43876),mt=o(17554),pt=o(77460),gt=o(6712);class ft extends A.Component{availableDiscountTypes;availableCoupons;getValueCallback;setValueCallback;constructor(e){super(e),this.availableCoupons=e.availableCoupons,this.getValueCallback=e.getValueCallback,this.setValueCallback=e.setValueCallback,this.availableDiscountTypes=[{label:(0,i.__)("All types","mailpoet"),value:""}].concat(e.availableDiscountTypes),this.state={couponSearch:"",couponFilterDiscountType:"",couponId:this.getValueCallback("couponId")}}filterCoupons=()=>{let e=[];e=this.state.couponFilterDiscountType?this.availableCoupons.filter((e=>e.discountType===this.state.couponFilterDiscountType)):this.availableCoupons,this.state.couponSearch&&(e=e.filter((e=>e.text.toLowerCase().includes(this.state.couponSearch.toLowerCase()))));const t=this.availableDiscountTypes.map((e=>e.value)).filter((e=>""!==e));return e=e.filter((e=>t.includes(e.discountType))),e};render(){return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ut.Z,{children:(0,h.jsxs)(ht.Z,{children:[(0,h.jsx)(mt.Z,{children:(0,h.jsx)(pt.Z,{value:this.state.couponSearch,onChange:e=>{this.setState({couponSearch:e})}})}),(0,h.jsx)(mt.Z,{children:(0,h.jsx)(gt.Z,{label:(0,i.__)("Discount type","mailpoet"),onChange:e=>this.setState({couponFilterDiscountType:e}),options:this.availableDiscountTypes,value:this.state.couponFilterDiscountType})})]})}),(0,h.jsx)(ut.Z,{children:(0,h.jsx)(ht.Z,{className:"mailpoet-coupon-block-existing-coupons",children:(0,h.jsx)(mt.Z,{children:this.filterCoupons().length>0?this.filterCoupons().slice(0,10).map((e=>{const t=this.availableDiscountTypes.find((t=>t.value===e.discountType));return(0,h.jsxs)("div",{className:"mailpoet_coupon_block_coupon",children:[(0,h.jsx)("input",{id:`coupon-${e.id}`,className:"components-radio-control__input",name:"coupon",type:"radio",value:e.id,checked:e.id===this.state.couponId,onChange:t=>{const o=Number(t.target.value);this.setState({couponId:o}),this.setValueCallback("couponId",o),this.setValueCallback("code",e.text)}}),(0,h.jsx)("label",{htmlFor:`coupon-${e.id}`,children:e.text}),(0,h.jsx)("div",{className:"discount_type",children:t.label}),e.excerpt?(0,h.jsx)("div",{children:e.excerpt}):null]},`coupon-${e.id}`)})):(0,h.jsx)("div",{className:"mailpoet_coupon_block_coupon",children:(0,i.__)("No coupons found","mailpoet")})})})})]})}}var vt=o(63983),bt=o(92519);class yt extends A.Component{availableDiscountTypes;getValueCallback;setValueCallback;constructor(e){super(e),this.availableDiscountTypes=e.availableDiscountTypes,this.getValueCallback=e.getValueCallback,this.setValueCallback=e.setValueCallback,this.state={amount:this.getValueCallback("amount"),amountMax:this.getValueCallback("amountMax"),discountType:this.getValueCallback("discountType"),expiryDay:this.getValueCallback("expiryDay"),freeShipping:this.getValueCallback("freeShipping")},this.discountTypeChange=this.discountTypeChange.bind(this)}discountTypeChange=e=>{const t=w()(".mailpoet_field_coupon_amount input");t.parsley().destroy();let o="";o=e.includes("percent")?"100":"1000000",t.prop("max",o),t.parsley().validate(),this.setState({amountMax:o,discountType:e}),this.setValueCallback("amountMax",o),this.setValueCallback("discountType",e)};render(){return(0,h.jsx)(ut.Z,{children:(0,h.jsxs)(ht.Z,{title:(0,i.__)("General settings","mailpoet"),children:[(0,h.jsx)(mt.Z,{children:(0,h.jsx)(gt.Z,{label:(0,i.__)("Discount type","mailpoet"),onChange:this.discountTypeChange,options:this.availableDiscountTypes,value:this.state.discountType})}),(0,h.jsx)(mt.Z,{children:(0,h.jsx)(vt.Z,{className:"mailpoet_field_coupon_amount",label:(0,i.__)("Coupon amount","mailpoet"),onChange:e=>{this.setState({amount:e}),w()(".mailpoet_field_coupon_amount input").parsley().isValid()&&this.setValueCallback("amount",e)},type:"number",min:"0",max:this.state.amountMax,value:this.state.amount,"data-parsley-validate":!0,"data-parsley-required":!0,"data-parsley-validation-threshold":"0","data-parsley-trigger":"input"})}),(0,h.jsx)(mt.Z,{children:(0,h.jsx)(vt.Z,{className:"mailpoet_field_coupon_expiry_day",label:(0,i.__)("Expires in","mailpoet"),onChange:e=>{this.setState({expiryDay:e}),w()(".mailpoet_field_coupon_expiry_day input").parsley().isValid()&&this.setValueCallback("expiryDay",e)},min:"0",type:"number",value:this.state.expiryDay,"data-parsley-required":!0,"data-parsley-validation-threshold":"0","data-parsley-trigger":"input"})}),(0,h.jsx)(mt.Z,{children:(0,h.jsx)(bt.Z,{checked:this.state.freeShipping,label:(0,i.__)("Free shipping","mailpoet"),onChange:e=>{this.setValueCallback("freeShipping",e),this.setState({freeShipping:e})}})})]})})}}var wt=o(3939),_t=o(65443),xt=o.n(_t);let Ct;function kt(e){let{activeTab:t,onClick:o}=e;return(0,h.jsx)("div",{className:"components-panel__header interface-complementary-area-header edit-post-sidebar__panel-tabs",children:(0,h.jsxs)("ul",{children:[(0,h.jsx)("li",{children:(0,h.jsx)(wt.ZP,{onClick:()=>o(Ct.allCoupons),className:xt()("edit-post-sidebar__panel-tab",{"is-active":t===Ct.allCoupons}),"data-label":(0,i.__)("All coupons","mailpoet"),children:(0,i.__)("All coupons","mailpoet")})}),(0,h.jsx)("li",{children:(0,h.jsx)(wt.ZP,{onClick:()=>o(Ct.createNew),className:xt()("edit-post-sidebar__panel-tab",{"is-active":t===Ct.createNew}),"data-label":(0,i.__)("Create new","mailpoet"),children:(0,i.__)("Create new","mailpoet")})})]})})}!function(e){e.allCoupons="allCoupons",e.createNew="createNew"}(Ct||(Ct={}));var St=o(79846);class Tt extends A.Component{getValueCallback;setValueCallback;priceDecimalSeparator;constructor(e){super(e),this.getValueCallback=e.getValueCallback,this.setValueCallback=e.setValueCallback,this.priceDecimalSeparator=e.priceDecimalSeparator,this.state={minimumAmount:this.getValueCallback("minimumAmount"),maximumAmount:this.getValueCallback("maximumAmount"),individualUse:this.getValueCallback("individualUse"),excludeSaleItems:this.getValueCallback("excludeSaleItems"),productIds:this.getValueCallback("productIds").toJSON(),excludedProductIds:this.getValueCallback("excludedProductIds").toJSON(),productCategoryIds:this.getValueCallback("productCategoryIds").toJSON(),excludedProductCategoryIds:this.getValueCallback("excludedProductCategoryIds").toJSON(),emailRestrictions:this.getValueCallback("emailRestrictions")}}handleSelection=e=>{const t=this.getValueCallback(e.target.name);t.reset(e.target.value.map((e=>({id:e})))),this.setValueCallback(e.target.name,t);const o={};o[e.target.name]=e.target.value,this.setState(o)};render(){const e={forceSelect2:!0,endpoint:"products",resetSelect2OnUpdate:!0,multiple:!0,placeholder:(0,i.__)("Search for a product…","mailpoet")},t={forceSelect2:!0,endpoint:"product_categories",resetSelect2OnUpdate:!0,multiple:!0};return(0,h.jsx)(ut.Z,{children:(0,h.jsxs)(ht.Z,{title:(0,i.__)("Usage restriction","mailpoet"),className:"mailpoet-coupon-block-usage-restriction",initialOpen:!1,children:[(0,h.jsx)(mt.Z,{children:(0,h.jsx)(vt.Z,{className:"mailpoet_field_coupon_minimum_amount",label:(0,i.__)("Minimum spend","mailpoet"),value:this.state.minimumAmount,placeholder:(0,i.__)("No minimum","mailpoet"),onChange:e=>{this.setState({minimumAmount:e}),w()(".mailpoet_field_coupon_minimum_amount input").parsley().isValid()&&this.setValueCallback("minimumAmount",e)},pattern:`[0-9]+([${this.priceDecimalSeparator}][0-9]+)?`,"data-parsley-validate":!0,"data-parsley-trigger":"input","data-parsley-validation-threshold":"1","data-parsley-error-message":(0,i.__)("Please enter a value with one monetary decimal point (%s) without thousand separators and currency symbols.","mailpoet").replace("%s",this.priceDecimalSeparator)})}),(0,h.jsx)(mt.Z,{children:(0,h.jsx)(vt.Z,{className:"mailpoet_field_coupon_maximum_amount",label:(0,i.__)("Maximum spend","mailpoet"),value:this.state.maximumAmount,placeholder:(0,i.__)("No maximum","mailpoet"),onChange:e=>{this.setState({maximumAmount:e}),w()(".mailpoet_field_coupon_maximum_amount input").parsley().isValid()&&this.setValueCallback("maximumAmount",e)},pattern:`[0-9]+([${this.priceDecimalSeparator}][0-9]+)?`,"data-parsley-validate":!0,"data-parsley-trigger":"input","data-parsley-validation-threshold":"1","data-parsley-error-message":(0,i.__)("Please enter a value with one monetary decimal point (%s) without thousand separators and currency symbols.","mailpoet").replace("%s",this.priceDecimalSeparator)})}),(0,h.jsx)(mt.Z,{children:(0,h.jsx)(bt.Z,{checked:this.state.individualUse,label:(0,i.__)("Individual use only","mailpoet"),onChange:e=>{this.setValueCallback("individualUse",e),this.setState({individualUse:e})},help:(0,i.__)("Coupon cannot be used in conjunction with other coupons.","mailpoet")})}),(0,h.jsx)(mt.Z,{children:(0,h.jsx)(bt.Z,{checked:this.state.excludeSaleItems,label:(0,i.__)("Exclude sale items","mailpoet"),onChange:e=>{this.setValueCallback("excludeSaleItems",e),this.setState({excludeSaleItems:e})},help:(0,i.__)("Coupon does not apply to items on sale.","mailpoet")})}),(0,h.jsxs)(mt.Z,{children:[(0,h.jsx)("label",{htmlFor:"productIds",children:(0,i.__)("Products","mailpoet")}),(0,h.jsx)(St.Y,{field:{...e,name:"productIds",selected:()=>this.state.productIds.map((e=>e.id))},onValueChange:this.handleSelection})]}),(0,h.jsxs)(mt.Z,{children:[(0,h.jsx)("label",{htmlFor:"excludedProductIds",children:(0,i.__)("Excluded products","mailpoet")}),(0,h.jsx)(St.Y,{field:{...e,name:"excludedProductIds",selected:()=>this.state.excludedProductIds.map((e=>e.id))},onValueChange:this.handleSelection})]}),(0,h.jsxs)(mt.Z,{children:[(0,h.jsx)("label",{htmlFor:"productCategoriesIds",children:(0,i.__)("Product categories","mailpoet")}),(0,h.jsx)(St.Y,{field:{...t,name:"productCategoryIds",placeholder:(0,i.__)("Any category","mailpoet"),selected:()=>this.state.productCategoryIds.map((e=>e.id))},onValueChange:this.handleSelection})]}),(0,h.jsxs)(mt.Z,{children:[(0,h.jsx)("label",{htmlFor:"excludedProductCategoryIds",children:(0,i.__)("Exclude product categories","mailpoet")}),(0,h.jsx)(St.Y,{field:{...t,name:"excludedProductCategoryIds",placeholder:(0,i.__)("No categories","mailpoet"),selected:()=>this.state.excludedProductCategoryIds.map((e=>e.id))},onValueChange:this.handleSelection})]}),(0,h.jsx)(mt.Z,{children:(0,h.jsx)(vt.Z,{className:"mailpoet_field_coupon_email_restrictions",label:(0,i.__)("Allowed emails","mailpoet"),value:this.state.emailRestrictions,placeholder:(0,i.__)("No restrictions","mailpoet"),onChange:e=>{this.setState({emailRestrictions:e}),w()(".mailpoet_field_coupon_email_restrictions input").parsley().isValid()&&this.setValueCallback("emailRestrictions",e)},type:"text",pattern:"/^([\\w\\d._\\-#\\*])+@([\\w\\d._\\-#\\*]+[.][\\w\\d._\\-#\\*]+)+(,([\\w\\d._\\-#\\*])+@([\\w\\d._\\-#\\*]+[.][\\w\\d._\\-#\\*]+))*$/","data-parsley-validate":!0,"data-parsley-validation-threshold":"1","data-parsley-trigger":"input","data-parsley-error-message":(0,i.__)('Separate email addresses with commas. You can also use an asterisk (*) to match parts of an email. For example "*@gmail.com" would match all gmail addresses.',"mailpoet")})})]})})}}class Et extends A.Component{getValueCallback;setValueCallback;constructor(e){super(e),this.getValueCallback=e.getValueCallback,this.setValueCallback=e.setValueCallback,this.state={usageLimit:this.getValueCallback("usageLimit"),usageLimitPerUser:this.getValueCallback("usageLimitPerUser")}}render(){return(0,h.jsx)(ut.Z,{children:(0,h.jsxs)(ht.Z,{title:(0,i.__)("Usage limits","mailpoet"),className:"mailpoet-coupon-block-usage-limits",initialOpen:!1,children:[(0,h.jsx)(mt.Z,{children:(0,h.jsx)(vt.Z,{label:(0,i.__)("Usage limit per coupon","mailpoet"),value:this.state.usageLimit,placeholder:(0,i.__)("Unlimited usage","mailpoet"),type:"number",onChange:e=>{this.setValueCallback("usageLimit",e),this.setState({usageLimit:e})}})}),(0,h.jsx)(mt.Z,{children:(0,h.jsx)(vt.Z,{label:(0,i.__)("Usage limit per user","mailpoet"),value:this.state.usageLimitPerUser,placeholder:(0,i.__)("Unlimited usage","mailpoet"),type:"number",onChange:e=>{this.setValueCallback("usageLimitPerUser",e),this.setState({usageLimitPerUser:e})}})})]})})}}function Ot(e){let{availableDiscountTypes:t,availableCoupons:o,getValueCallback:n,setValueCallback:r,priceDecimalSeparator:i,codePlaceholder:s}=e;const[a,l]=(0,A.useState)(n("source"));return(0,h.jsx)(d.ErrorBoundary,{children:(0,h.jsxs)(dt.k.Provider,{value:(0,dt.S)(window),children:[(0,h.jsx)(kt,{activeTab:a,onClick:e=>{if(r("source",e),l(e),e===Ct.createNew)r("code",s),r("couponId",null),jQuery(".mailpoet_editor_coupon_overlay").css("visibility","visible");else if(e===Ct.allCoupons){const e=o.find((e=>e.id===n("couponId")));e&&r("code",e.text),jQuery(".mailpoet_editor_coupon_overlay").css("visibility","hidden")}}}),a===Ct.createNew?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(yt,{availableDiscountTypes:t,getValueCallback:n,setValueCallback:r}),(0,h.jsx)(Tt,{getValueCallback:n,setValueCallback:r,priceDecimalSeparator:i}),(0,h.jsx)(Et,{getValueCallback:n,setValueCallback:r})]}):(0,h.jsx)(ft,{availableDiscountTypes:t,availableCoupons:o,getValueCallback:n,setValueCallback:r})]})})}const At={},Mt=ne;At.CouponBlockModel=Mt.BlockModel.extend({defaults(){return this._getDefaults({isStandardEmail:x.getNewsletter().isStandardEmail(),productIds:[],excludedProductIds:[],productCategoryIds:[],excludedProductCategoryIds:[],type:"coupon",amount:10,amountMax:100,discountType:"percent",expiryDay:10,usageLimit:"",usageLimitPerUser:"",minimumAmount:"",maximumAmount:"",emailRestrictions:"",styles:{block:{backgroundColor:"#ffffff",borderColor:"#000000",borderRadius:"5px",borderStyle:"solid",borderWidth:"1px",fontColor:"#000000",fontFamily:"Verdan",fontSize:"18px",fontWeight:"normal",lineHeight:"40px",textAlign:"center",width:"200px"}},source:"createNew",code:x.getConfig().get("coupon.code_placeholder")},x.getConfig().get("blockDefaults.coupon"))}}),At.CouponBlockView=Mt.BlockView.extend({className:"mailpoet_block mailpoet_coupon_block mailpoet_droppable_block",getTemplate:()=>window.templates.couponBlock,onDragSubstituteBy:()=>At.CouponWidgetView,behaviors:c.ZP.extend({},Mt.BlockView.prototype.behaviors,{ShowSettingsBehavior:{}}),initialize(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];Mt.BlockView.prototype.initialize.apply(this,t),this.replaceCouponStylesHandler=e=>{this.model.set(e)},x.getChannel().on("replaceAllCouponStyles",this.replaceCouponStylesHandler)},onRender(){this.toolsView=new At.CouponBlockToolsView({model:this.model}),this.showChildView("toolsRegion",this.toolsView)}}),At.CouponBlockToolsView=Mt.BlockToolsView.extend({getSettingsView:()=>At.CouponBlockSettingsView}),At.CouponBlockSettingsView=Mt.BlockSettingsView.extend({getTemplate:()=>window.templates.couponBlockSettings,events(){return{"change .mailpoet_field_coupon_alignment":c.ZP.partial(this.changeField,"styles.block.textAlign"),"change .mailpoet_field_coupon_font_color":c.ZP.partial(this.changeColorField,"styles.block.fontColor"),"change .mailpoet_field_coupon_font_family":c.ZP.partial(this.changeField,"styles.block.fontFamily"),"change .mailpoet_field_coupon_font_size":c.ZP.partial(this.changeField,"styles.block.fontSize"),"change .mailpoet_field_coupon_background_color":c.ZP.partial(this.changeColorField,"styles.block.backgroundColor"),"change .mailpoet_field_coupon_border_color":c.ZP.partial(this.changeColorField,"styles.block.borderColor"),"change .mailpoet_field_coupon_font_weight":"changeFontWeight","input .mailpoet_field_coupon_border_width":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_coupon_border_width_input",c.ZP.partial(this.changePixelField,"styles.block.borderWidth").bind(this)),"change .mailpoet_field_coupon_border_width":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_coupon_border_width_input",c.ZP.partial(this.changePixelField,"styles.block.borderWidth").bind(this)),"input .mailpoet_field_coupon_border_width_input":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_coupon_border_width",c.ZP.partial(this.changePixelField,"styles.block.borderWidth").bind(this)),"input .mailpoet_field_coupon_border_radius":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_coupon_border_radius_input",c.ZP.partial(this.changePixelField,"styles.block.borderRadius").bind(this)),"change .mailpoet_field_coupon_border_radius":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_coupon_border_radius_input",c.ZP.partial(this.changePixelField,"styles.block.borderRadius").bind(this)),"input .mailpoet_field_coupon_border_radius_input":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_coupon_border_radius",c.ZP.partial(this.changePixelField,"styles.block.borderRadius").bind(this)),"input .mailpoet_field_coupon_width":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_coupon_width_input",c.ZP.partial(this.changePixelField,"styles.block.width").bind(this)),"change .mailpoet_field_coupon_width":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_coupon_width_input",c.ZP.partial(this.changePixelField,"styles.block.width").bind(this)),"input .mailpoet_field_coupon_width_input":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_coupon_width",c.ZP.partial(this.changePixelField,"styles.block.width").bind(this)),"input .mailpoet_field_coupon_line_height":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_coupon_line_height_input",c.ZP.partial(this.changePixelField,"styles.block.lineHeight").bind(this)),"change .mailpoet_field_coupon_line_height":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_coupon_line_height_input",c.ZP.partial(this.changePixelField,"styles.block.lineHeight").bind(this)),"input .mailpoet_field_coupon_line_height_input":c.ZP.partial(this.updateValueAndCall,".mailpoet_field_coupon_line_height",c.ZP.partial(this.changePixelField,"styles.block.lineHeight").bind(this)),"click .mailpoet_field_coupon_replace_all_styles":"applyToAll","click .mailpoet_done_editing":"close","click .mailpoet_settings_coupon_show_coupon_configuration":"switchToCouponConfiguration","click .mailpoet_settings_coupon_show_display_options":"switchToDisplayOptions"}},templateContext(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return c.ZP.extend({},Mt.BlockView.prototype.templateContext.apply(this,t),{availableStyles:x.getAvailableStyles().toJSON(),renderOptions:this.renderOptions})},applyToAll(){x.getChannel().trigger("replaceAllCouponStyles",c.ZP.pick(this.model.toJSON(),"styles","type"))},updateValueAndCall(e,t,o){this.$(e).val(w()(o.target).val()),t(o)},changeFontWeight(e){const t=!!w()(e.target).prop("checked");this.model.set("styles.block.fontWeight",t?w()(e.target).val():"normal")},switchToDisplayOptions(){w()(".mailpoet_coupon_block_settings").addClass("mailpoet_closed"),w()(".mailpoet_coupon_block_display_options").removeClass("mailpoet_closed"),w()(".mailpoet_settings_coupon_show_display_options").addClass("mailpoet_hidden"),w()(".mailpoet_settings_coupon_show_coupon_configuration").removeClass("mailpoet_hidden")},switchToCouponConfiguration(){w()(".mailpoet_coupon_block_display_options").addClass("mailpoet_closed"),w()(".mailpoet_coupon_block_settings").removeClass("mailpoet_closed"),w()(".mailpoet_settings_coupon_show_coupon_configuration").addClass("mailpoet_hidden"),w()(".mailpoet_settings_coupon_show_display_options").removeClass("mailpoet_hidden")},onRender(){s.render((0,h.jsx)(Ot,{availableDiscountTypes:x.getConfig().get("coupon.discount_types").toJSON(),availableCoupons:x.getConfig().get("coupon.available_coupons").toJSON(),codePlaceholder:x.getConfig().get("coupon.code_placeholder"),priceDecimalSeparator:x.getConfig().get("coupon.price_decimal_separator"),setValueCallback:(e,t)=>this.model.set(e,t),getValueCallback:e=>this.model.get(e)}),document.getElementById("mailpoet_coupon_block_settings"))}}),At.CouponWidgetView=Mt.WidgetView.extend({id:"automation_editor_block_coupon",getTemplate:()=>window.templates.couponInsertion,behaviors:{DraggableBehavior:{cloneOriginal:!0,drop:()=>new At.CouponBlockModel}}}),x.on("before:start",(e=>{window.MailPoet.isWoocommerceActive&&(e.registerBlockType("coupon",{blockModel:At.CouponBlockModel,blockView:At.CouponBlockView}),e.registerWidget({name:"coupon",widgetView:At.CouponWidgetView,priority:92}))})),(0,d.registerTranslations)()},99267:function(e,t,o){e.exports=function(e,t,o){"use strict";e="default"in e?e.default:e,t="default"in t?t.default:t,o="default"in o?o.default:o;var n="3.2.0",r=function(e){return function(t){for(var o=arguments.length,n=Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return e.apply(t,n)}},i=e.Model.extend,s=function e(o,n){t.isObject(o)&&(o=o.prev+" is going to be removed in the future. Please use "+o.next+" instead."+(o.url?" See: "+o.url:"")),Ee.DEV_MODE&&(void 0!==n&&n||e._cache[o]||(e._warn("Deprecation warning: "+o),e._cache[o]=!0))};s._console="undefined"!=typeof console?console:{},s._warn=function(){return(s._console.warn||s._console.log||t.noop).apply(s._console,arguments)},s._cache={};var a=function(e){return document.documentElement.contains(e&&e.parentNode)},l=function(e,o){var n=this;e&&t.each(o,(function(t){var o=e[t];void 0!==o&&(n[t]=o)}))},c=function(e){if(e)return this.options&&void 0!==this.options[e]?this.options[e]:this[e]},d=function(e){var o=this;return t.reduce(e,(function(e,n,r){return t.isFunction(n)||(n=o[n]),n&&(e[r]=n),e}),{})},u=/(^|:)(\w)/gi;function h(e,t,o){return o.toUpperCase()}var m=t.memoize((function(e){return"on"+e.replace(u,h)}));function p(e){for(var o=arguments.length,n=Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];var i=m(e),s=c.call(this,i),a=void 0;return t.isFunction(s)&&(a=s.apply(this,n)),this.trigger.apply(this,arguments),a}function g(e){for(var o=arguments.length,n=Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return t.isFunction(e.triggerMethod)?e.triggerMethod.apply(e,n):p.apply(e,n)}function f(e,o,n){e._getImmediateChildren&&t.each(e._getImmediateChildren(),(function(e){n(e)&&g(e,o,e)}))}function v(e){return!e._isAttached}function b(e){return!!v(e)&&(e._isAttached=!0,!0)}function y(e){return e._isAttached}function w(e){return!!y(e)&&(e._isAttached=!1,!0)}function _(e){e._isAttached&&e._isRendered&&g(e,"dom:refresh",e)}function x(){f(this,"before:attach",v)}function C(){f(this,"attach",b),_(this)}function k(){f(this,"before:detach",y)}function S(){f(this,"detach",w)}function T(){_(this)}function E(e){e._areViewEventsMonitored||(e._areViewEventsMonitored=!0,e.on({"before:attach":x,attach:C,"before:detach":k,detach:S,render:T}))}var O=["description","fileName","lineNumber","name","message","number"],A=i.call(Error,{urlRoot:"http://marionettejs.com/docs/v3.2.0/",constructor:function(e,o){t.isObject(e)?e=(o=e).message:o||(o={});var n=Error.call(this,e);t.extend(this,t.pick(n,O),t.pick(o,O)),this.captureStackTrace(),o.url&&(this.url=this.urlRoot+o.url)},captureStackTrace:function(){Error.captureStackTrace&&Error.captureStackTrace(this,A)},toString:function(){return this.name+": "+this.message+(this.url?" See: "+this.url:"")}});function M(e,o,n,r){if(o&&n){if(!t.isObject(n))throw new A({message:"Bindings must be an object.",url:"marionette.functions.html#marionettebindevents"});t.each(n,(function(n,i){t.isString(n)?function(e,o,n,r,i){var s=r.split(/\s+/);t.each(s,(function(t){var r=e[t];if(!r)throw new A('Method "'+t+'" was configured as an event handler, but does not exist.');e[i](o,n,r)}))}(e,o,i,n,r):e[r](o,i,n)}))}}function B(e,t){return M(this,e,t,"listenTo"),this}function P(e,t){return M(this,e,t,"stopListening"),this}function R(e,o,n,r){if(o&&n){if(!t.isObject(n))throw new A({message:"Bindings must be an object.",url:"marionette.functions.html#marionettebindrequests"});var i=d.call(e,n);o[r](i,e)}}function V(e,t){return R(this,e,t,"reply"),this}function N(e,t){return R(this,e,t,"stopReplying"),this}A.extend=i;var D={normalizeMethods:d,_setOptions:function(){for(var e=arguments.length,o=Array(e),n=0;n<e;n++)o[n]=arguments[n];this.options=t.extend.apply(t,[{},t.result(this,"options")].concat(o))},mergeOptions:l,getOption:c,bindEvents:B,unbindEvents:P},F={_initRadio:function(){var e=t.result(this,"channelName");if(e){if(!o)throw new A({name:"BackboneRadioMissing",message:'The dependency "backbone.radio" is missing.'});var n=this._channel=o.channel(e),r=t.result(this,"radioEvents");this.bindEvents(n,r);var i=t.result(this,"radioRequests");this.bindRequests(n,i),this.on("destroy",this._destroyRadio)}},_destroyRadio:function(){this._channel.stopReplying(null,null,this)},getChannel:function(){return this._channel},bindEvents:B,unbindEvents:P,bindRequests:V,unbindRequests:N},I=["channelName","radioEvents","radioRequests"],L=function(e){this._setOptions(e),this.mergeOptions(e,I),this.cid=t.uniqueId(this.cidPrefix),this._initRadio(),this.initialize.apply(this,arguments)};L.extend=i,t.extend(L.prototype,e.Events,D,F,{cidPrefix:"mno",_isDestroyed:!1,isDestroyed:function(){return this._isDestroyed},initialize:function(){},destroy:function(){if(this._isDestroyed)return this;for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o];return this.triggerMethod.apply(this,["before:destroy",this].concat(t)),this._isDestroyed=!0,this.triggerMethod.apply(this,["destroy",this].concat(t)),this.stopListening(),this},triggerMethod:p});var z={createBuffer:function(){return document.createDocumentFragment()},appendChildren:function(t,o){e.$(t).append(o)},beforeEl:function(t,o){e.$(t).before(o)},replaceEl:function(e,t){if(e!==t){var o=t.parentNode;o&&o.replaceChild(e,t)}},detachContents:function(t){e.$(t).contents().detach()},setInnerContent:function(t,o){e.$(t).html(o)},removeEl:function(t){e.$(t).remove()},findEls:function(t,o){return e.$(t,o)}},H=function(e){this.templateId=e};t.extend(H,{templateCaches:{},get:function(e,t){var o=this.templateCaches[e];return o||(o=new H(e),this.templateCaches[e]=o),o.load(t)},clear:function(){for(var e=void 0,t=arguments.length,o=Array(t),n=0;n<t;n++)o[n]=arguments[n];var r=o.length;if(r>0)for(e=0;e<r;e++)delete this.templateCaches[o[e]];else this.templateCaches={}}}),t.extend(H.prototype,z,{load:function(e){if(this.compiledTemplate)return this.compiledTemplate;var t=this.loadTemplate(this.templateId,e);return this.compiledTemplate=this.compileTemplate(t,e),this.compiledTemplate},loadTemplate:function(e,t){var o=this.findEls(e);if(!o.length)throw new A({name:"NoTemplateError",message:'Could not find template: "'+e+'"'});return o.html()},compileTemplate:function(e,o){return t.template(e,o)}});var Z=t.invokeMap||t.invoke;function j(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);t<e.length;t++)o[t]=e[t];return o}return Array.from(e)}function U(e,o){return t.chain(o).map((function(o,n){var r=function(e,o){return e.behaviorClass?e.behaviorClass:t.isFunction(e)?e:t.isFunction(Ee.Behaviors.behaviorsLookup)?Ee.Behaviors.behaviorsLookup(e,o)[o]:Ee.Behaviors.behaviorsLookup[o]}(o,n),i=new r(o===r?{}:o,e),s=U(e,t.result(i,"behaviors"));return[i].concat(s)})).flatten().value()}var $={_initBehaviors:function(){this._behaviors=this._getBehaviors()},_getBehaviors:function(){var e=t.result(this,"behaviors");return t.isObject(e)?U(this,e):{}},_getBehaviorTriggers:function(){var e=Z(this._behaviors,"getTriggers");return t.extend.apply(t,[{}].concat(j(e)))},_getBehaviorEvents:function(){var e=Z(this._behaviors,"getEvents");return t.extend.apply(t,[{}].concat(j(e)))},_proxyBehaviorViewProperties:function(){Z(this._behaviors,"proxyViewProperties")},_delegateBehaviorEntityEvents:function(){Z(this._behaviors,"delegateEntityEvents")},_undelegateBehaviorEntityEvents:function(){Z(this._behaviors,"undelegateEntityEvents")},_destroyBehaviors:function(e){Z.apply(void 0,[this._behaviors,"destroy"].concat(j(e)))},_bindBehaviorUIElements:function(){Z(this._behaviors,"bindUIElements")},_unbindBehaviorUIElements:function(){Z(this._behaviors,"unbindUIElements")},_triggerEventOnBehaviors:function(){for(var e=this._behaviors,t=0,o=e&&e.length;t<o;t++)p.apply(e[t],arguments)}},W={_delegateEntityEvents:function(e,o){this._undelegateEntityEvents(e,o);var n=t.result(this,"modelEvents");B.call(this,e,n);var r=t.result(this,"collectionEvents");B.call(this,o,r)},_undelegateEntityEvents:function(e,o){var n=t.result(this,"modelEvents");P.call(this,e,n);var r=t.result(this,"collectionEvents");P.call(this,o,r)}},q=/^(\S+)\s*(.*)$/;var G=function(e){var o=e.match(q);return function(e,o){return[e+t.uniqueId(".evt"),o].join(" ")}(o[1],o[2])},Y={triggersStopPropagation:!0,triggersPreventDefault:!0};function X(e){return!!Y[e]}var K={_getViewTriggers:function(e,o){return t.reduce(o,(function(o,n,r){return o[r=G(r)]=function(e,o){t.isString(o)&&(o={event:o});var n=o.event,r=!!o.preventDefault;X("triggersPreventDefault")&&(r=!1!==o.preventDefault);var i=!!o.stopPropagation;return X("triggersStopPropagation")&&(i=!1!==o.stopPropagation),function(t){r&&t.preventDefault(),i&&t.stopPropagation(),e.triggerMethod(n,e,t)}}(e,n),o}),{})}},J=function(e,t){return e.replace(/@ui\.[a-zA-Z-_$0-9]*/g,(function(e){return t[e.slice(4)]}))},Q=function e(o,n,r){return t.each(o,(function(i,s){t.isString(i)?o[s]=J(i,n):t.isObject(i)&&t.isArray(r)&&(t.extend(i,e(t.pick(i,r),n)),t.each(r,(function(e){var o=i[e];t.isString(o)&&(i[e]=J(o,n))})))})),o},ee={normalizeUIKeys:function(e){return function(e,o){return t.reduce(e,(function(e,t,n){return e[J(n,o)]=t,e}),{})}(e,this._getUIBindings())},normalizeUIString:function(e){var t=this._getUIBindings();return J(e,t)},normalizeUIValues:function(e,t){var o=this._getUIBindings();return Q(e,o,t)},_getUIBindings:function(){var e=t.result(this,"_uiBindings"),o=t.result(this,"ui");return e||o},_bindUIElements:function(){var e=this;if(this.ui){this._uiBindings||(this._uiBindings=this.ui);var o=t.result(this,"_uiBindings");this._ui={},t.each(o,(function(t,o){e._ui[o]=e.$(t)})),this.ui=this._ui}},_unbindUIElements:function(){var e=this;this.ui&&this._uiBindings&&(t.each(this.ui,(function(t,o){delete e.ui[o]})),this.ui=this._uiBindings,delete this._uiBindings,delete this._ui)},_getUI:function(e){return this._ui[e]}},te={supportsRenderLifecycle:!0,supportsDestroyLifecycle:!0,_isDestroyed:!1,isDestroyed:function(){return!!this._isDestroyed},_isRendered:!1,isRendered:function(){return!!this._isRendered},_isAttached:!1,isAttached:function(){return!!this._isAttached},delegateEvents:function(o){this._proxyBehaviorViewProperties(),this._buildEventProxies();var n=this._getEvents(o);void 0===o&&(this.events=n);var r=t.extend({},this._getBehaviorEvents(),n,this._getBehaviorTriggers(),this.getTriggers());return e.View.prototype.delegateEvents.call(this,r),this},_getEvents:function(e){var o=e||this.events;return t.isFunction(o)?this.normalizeUIKeys(o.call(this)):this.normalizeUIKeys(o)},getTriggers:function(){if(this.triggers){var e=this.normalizeUIKeys(t.result(this,"triggers"));return this._getViewTriggers(this,e)}},delegateEntityEvents:function(){return this._delegateEntityEvents(this.model,this.collection),this._delegateBehaviorEntityEvents(),this},undelegateEntityEvents:function(){return this._undelegateEntityEvents(this.model,this.collection),this._undelegateBehaviorEntityEvents(),this},destroy:function(){if(this._isDestroyed)return this;for(var e=!!this._isAttached,t=arguments.length,o=Array(t),n=0;n<t;n++)o[n]=arguments[n];return this.triggerMethod.apply(this,["before:destroy",this].concat(o)),e&&this.triggerMethod("before:detach",this),this.unbindUIElements(),this.removeEl(this.el),e&&(this._isAttached=!1,this.triggerMethod("detach",this)),this._removeChildren(),this._destroyBehaviors(o),this._isDestroyed=!0,this._isRendered=!1,this.triggerMethod.apply(this,["destroy",this].concat(o)),this.stopListening(),this},bindUIElements:function(){return this._bindUIElements(),this._bindBehaviorUIElements(),this},unbindUIElements:function(){return this._unbindUIElements(),this._unbindBehaviorUIElements(),this},getUI:function(e){return this._getUI(e)},childViewEventPrefix:"childview",triggerMethod:function(){var e=p.apply(this,arguments);return this._triggerEventOnBehaviors.apply(this,arguments),e},_buildEventProxies:function(){this._childViewEvents=t.result(this,"childViewEvents"),this._childViewTriggers=t.result(this,"childViewTriggers")},_proxyChildViewEvents:function(e){this.listenTo(e,"all",this._childViewEventHandler)},_childViewEventHandler:function(e){for(var o=this.normalizeMethods(this._childViewEvents),n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];void 0!==o&&t.isFunction(o[e])&&o[e].apply(this,r);var s=this._childViewTriggers;s&&t.isString(s[e])&&this.triggerMethod.apply(this,[s[e]].concat(r));var a=t.result(this,"childViewEventPrefix");if(!1!==a){var l=a+":"+e;this.triggerMethod.apply(this,[l].concat(r))}}};function oe(e){e.supportsDestroyLifecycle||g(e,"before:destroy",e);var t=!!e._isAttached;t&&g(e,"before:detach",e),e.remove(),t&&(e._isAttached=!1,g(e,"detach",e)),e._isDestroyed=!0,e.supportsDestroyLifecycle||g(e,"destroy",e)}t.extend(te,z,$,D,W,K,ee);var ne=["allowMissingEl","parentEl","replaceElement"],re=L.extend({cidPrefix:"mnr",replaceElement:!1,_isReplaced:!1,constructor:function(t){if(this._setOptions(t),this.mergeOptions(t,ne),this._initEl=this.el=this.getOption("el"),this.el=this.el instanceof e.$?this.el[0]:this.el,!this.el)throw new A({name:"NoElError",message:'An "el" must be specified for a region.'});this.$el=this.getEl(this.el),L.call(this,t)},show:function(e,t){if(this._ensureElement(t))return(e=this._getView(e,t))===this.currentView||(this.triggerMethod("before:show",this,e,t),e._isAttached||this.empty(t),this._setupChildView(e),this._renderView(e),this._attachView(e,t),this.currentView=e,this.triggerMethod("show",this,e,t)),this},_setupChildView:function(e){E(e),this._proxyChildViewEvents(e),e.on("destroy",this._empty,this)},_proxyChildViewEvents:function(e){var t=this._parentView;t&&t._proxyChildViewEvents(e)},_renderView:function(e){e._isRendered||(e.supportsRenderLifecycle||g(e,"before:render",e),e.render(),e.supportsRenderLifecycle||(e._isRendered=!0,g(e,"render",e)))},_attachView:function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!e._isAttached&&a(this.el),r=void 0===o.replaceElement?!!t.result(this,"replaceElement"):!!o.replaceElement;n&&g(e,"before:attach",e),r?this._replaceEl(e):this.attachHtml(e),n&&(e._isAttached=!0,g(e,"attach",e))},_ensureElement:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.isObject(this.el)||(this.$el=this.getEl(this.el),this.el=this.$el[0]),!this.$el||0===this.$el.length){if(void 0===e.allowMissingEl?t.result(this,"allowMissingEl"):e.allowMissingEl)return!1;throw new A('An "el" must exist in DOM for this region '+this.cid)}return!0},_getView:function(t){if(!t)throw new A({name:"ViewNotValid",message:"The view passed is undefined and therefore invalid. You must pass a view instance to show."});if(t._isDestroyed)throw new A({name:"ViewDestroyedError",message:'View (cid: "'+t.cid+'") has already been destroyed and cannot be used.'});if(t instanceof e.View)return t;var o=this._getViewOptions(t);return new de(o)},_getViewOptions:function(e){return t.isFunction(e)?{template:e}:t.isObject(e)?e:{template:function(){return e}}},getEl:function(e){return this.findEls(e,t.result(this,"parentEl"))},_replaceEl:function(e){this._restoreEl(),e.on("before:destroy",this._restoreEl,this),this.replaceEl(e.el,this.el),this._isReplaced=!0},_restoreEl:function(){if(this._isReplaced){var e=this.currentView;e&&(this.replaceEl(this.el,e.el),this._isReplaced=!1)}},isReplaced:function(){return!!this._isReplaced},attachHtml:function(e){this.appendChildren(this.el,e.el)},empty:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{allowMissingEl:!0},t=this.currentView;if(!t)return this._ensureElement(e)&&this.detachHtml(),this;var o=!e.preventDestroy;return o||s("The preventDestroy option is deprecated. Use Region#detachView"),this._empty(t,o),this},_empty:function(e,t){e.off("destroy",this._empty,this),this.triggerMethod("before:empty",this,e),this._restoreEl(),delete this.currentView,e._isDestroyed||(this._removeView(e,t),this._stopChildViewEvents(e)),this.triggerMethod("empty",this,e)},_stopChildViewEvents:function(e){this._parentView&&this._parentView.stopListening(e)},_removeView:function(e,t){t?e.destroy?e.destroy():oe(e):this._detachView(e)},detachView:function(){var e=this.currentView;if(e)return this._empty(e),e},_detachView:function(e){var t=!!e._isAttached;t&&g(e,"before:detach",e),this.detachHtml(),t&&(e._isAttached=!1,g(e,"detach",e))},detachHtml:function(){this.detachContents(this.el)},hasView:function(){return!!this.currentView},reset:function(e){return this.empty(e),this.$el&&(this.el=this._initEl),delete this.$el,this},destroy:function(e){return this.reset(e),L.prototype.destroy.apply(this,arguments)}});t.extend(re.prototype,z);var ie=function(e,o){return e instanceof re?e:function(e,o){var n=t.extend({},o);if(t.isString(e))return t.extend(n,{el:e}),se(n);if(t.isFunction(e))return t.extend(n,{regionClass:e}),se(n);if(t.isObject(e))return e.selector&&s("The selector option on a Region definition object is deprecated. Use el to pass a selector string"),t.extend(n,{el:e.selector},e),se(n);throw new A({message:"Improper region configuration type.",url:"marionette.region.html#region-configuration-types"})}(e,o)};function se(e){return new(0,e.regionClass)(t.omit(e,"regionClass"))}var ae={regionClass:re,_initRegions:function(){this.regions=this.regions||{},this._regions={},this.addRegions(t.result(this,"regions"))},_reInitRegions:function(){Z(this._regions,"reset")},addRegion:function(e,t){var o={};return o[e]=t,this.addRegions(o)[e]},addRegions:function(e){if(!t.isEmpty(e))return e=this.normalizeUIValues(e,["selector","el"]),this.regions=t.extend({},this.regions,e),this._addRegions(e)},_addRegions:function(e){var o=this,n={regionClass:this.regionClass,parentEl:t.partial(t.result,this,"el")};return t.reduce(e,(function(e,t,r){return e[r]=ie(t,n),o._addRegion(e[r],r),e}),{})},_addRegion:function(e,t){this.triggerMethod("before:add:region",this,t,e),e._parentView=this,this._regions[t]=e,this.triggerMethod("add:region",this,t,e)},removeRegion:function(e){var t=this._regions[e];return this._removeRegion(t,e),t},removeRegions:function(){var e=this.getRegions();return t.each(this._regions,t.bind(this._removeRegion,this)),e},_removeRegion:function(e,t){this.triggerMethod("before:remove:region",this,t,e),e.destroy(),delete this.regions[t],delete this._regions[t],this.triggerMethod("remove:region",this,t,e)},emptyRegions:function(){var e=this.getRegions();return Z(e,"empty"),e},hasRegion:function(e){return!!this.getRegion(e)},getRegion:function(e){return this._regions[e]},getRegions:function(){return t.clone(this._regions)},showChildView:function(e,t){for(var o=this.getRegion(e),n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return o.show.apply(o,[t].concat(r))},detachChildView:function(e){return this.getRegion(e).detachView()},getChildView:function(e){return this.getRegion(e).currentView}},le={render:function(e,o){if(!e)throw new A({name:"TemplateNotFoundError",message:"Cannot render the template since its false, null or undefined."});return(t.isFunction(e)?e:H.get(e))(o)}},ce=["behaviors","childViewEventPrefix","childViewEvents","childViewTriggers","collectionEvents","events","modelEvents","regionClass","regions","template","templateContext","triggers","ui"],de=e.View.extend({constructor:function(o){this.render=t.bind(this.render,this),this._setOptions(o),this.mergeOptions(o,ce),E(this),this._initBehaviors(),this._initRegions();var n=Array.prototype.slice.call(arguments);n[0]=this.options,e.View.prototype.constructor.apply(this,n),this.delegateEntityEvents()},serializeData:function(){return this.model||this.collection?this.model?this.serializeModel():{items:this.serializeCollection()}:{}},serializeModel:function(){return this.model?t.clone(this.model.attributes):{}},serializeCollection:function(){return this.collection?this.collection.map((function(e){return t.clone(e.attributes)})):{}},setElement:function(){var t=!!this.el;return e.View.prototype.setElement.apply(this,arguments),t&&(this._isRendered=!!this.$el.length,this._isAttached=a(this.el)),this._isRendered&&this.bindUIElements(),this},render:function(){return this._isDestroyed||(this.triggerMethod("before:render",this),this._isRendered&&this._reInitRegions(),this._renderTemplate(),this.bindUIElements(),this._isRendered=!0,this.triggerMethod("render",this)),this},_renderTemplate:function(){var e=this.getTemplate();if(!1!==e){var t=this.mixinTemplateContext(this.serializeData()),o=le.render(e,t,this);this.attachElContent(o)}},getTemplate:function(){return this.template},mixinTemplateContext:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=t.result(this,"templateContext");return t.extend(e,o)},attachElContent:function(e){return this.setInnerContent(this.el,e),this},_removeChildren:function(){this.removeRegions()},_getImmediateChildren:function(){return t.chain(this.getRegions()).map("currentView").compact().value()}});t.extend(de.prototype,te,ae);var ue,he,me=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck","reduce"],pe=function(e){this._views={},this._indexByModel={},this._indexByCustom={},this._updateLength(),t.each(e,t.bind(this.add,this))};ue=pe.prototype,he="_views",t.each(me,(function(e){ue[e]=function(){var o=[t.values(t.result(this,he))].concat(t.toArray(arguments));return t[e].apply(t,o)}})),t.extend(pe.prototype,{add:function(e,t){return this._add(e,t)._updateLength()},_add:function(e,t){var o=e.cid;return this._views[o]=e,e.model&&(this._indexByModel[e.model.cid]=o),t&&(this._indexByCustom[t]=o),this},findByModel:function(e){return this.findByModelCid(e.cid)},findByModelCid:function(e){var t=this._indexByModel[e];return this.findByCid(t)},findByCustom:function(e){var t=this._indexByCustom[e];return this.findByCid(t)},findByIndex:function(e){return t.values(this._views)[e]},findByCid:function(e){return this._views[e]},remove:function(e){return this._remove(e)._updateLength()},_remove:function(e){var o=e.cid;return e.model&&delete this._indexByModel[e.model.cid],t.some(this._indexByCustom,t.bind((function(e,t){if(e===o)return delete this._indexByCustom[t],!0}),this)),delete this._views[o],this},_updateLength:function(){return this.length=t.size(this._views),this}});var ge=["behaviors","childView","childViewEventPrefix","childViewEvents","childViewOptions","childViewTriggers","collectionEvents","events","filter","emptyView","emptyViewOptions","modelEvents","reorderOnSort","sort","triggers","ui","viewComparator"],fe=e.View.extend({sort:!0,constructor:function(o){this.render=t.bind(this.render,this),this._setOptions(o),this.mergeOptions(o,ge),E(this),this._initBehaviors(),this.once("render",this._initialEvents),this._initChildViewStorage(),this._bufferedChildren=[];var n=Array.prototype.slice.call(arguments);n[0]=this.options,e.View.prototype.constructor.apply(this,n),this.delegateEntityEvents()},_startBuffering:function(){this._isBuffering=!0},_endBuffering:function(){var e=this._isAttached?this._getImmediateChildren():[];this._isBuffering=!1,t.each(e,(function(e){g(e,"before:attach",e)})),this.attachBuffer(this,this._createBuffer()),t.each(e,(function(e){e._isAttached=!0,g(e,"attach",e)})),this._bufferedChildren=[]},_getImmediateChildren:function(){return t.values(this.children._views)},_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this._onCollectionAdd),this.listenTo(this.collection,"update",this._onCollectionUpdate),this.listenTo(this.collection,"reset",this.render),this.sort&&this.listenTo(this.collection,"sort",this._sortViews))},_onCollectionAdd:function(e,o,n){var r=void 0!==n.at&&(n.index||o.indexOf(e));(this.filter||!1===r)&&(r=t.indexOf(this._filteredSortedModels(r),e)),this._shouldAddChild(e,r)&&(this._destroyEmptyView(),this._addChild(e,r))},_onCollectionUpdate:function(e,t){var o=t.changes;this._removeChildModels(o.removed)},_removeChildModels:function(e){var t=this._getRemovedViews(e);t.length&&(this.children._updateLength(),this._updateIndices(t,!1),this.isEmpty()&&this._showEmptyView())},_getRemovedViews:function(e){var o=this;return t.reduce(e,(function(e,t){var n=t&&o.children.findByModel(t);return!n||n._isDestroyed||(o._removeChildView(n),e.push(n)),e}),[])},_removeChildView:function(e){this.triggerMethod("before:remove:child",this,e),this.children._remove(e),e.destroy?e.destroy():oe(e),this.stopListening(e),this.triggerMethod("remove:child",this,e)},setElement:function(){var t=!!this.el;return e.View.prototype.setElement.apply(this,arguments),t&&(this._isAttached=a(this.el)),this},render:function(){return this._isDestroyed||(this.triggerMethod("before:render",this),this._renderChildren(),this._isRendered=!0,this.triggerMethod("render",this)),this},setFilter:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).preventRender,o=this._isRendered&&!this._isDestroyed,n=this.filter!==e;if(o&&n&&!t){var r=this._filteredSortedModels();this.filter=e;var i=this._filteredSortedModels();this._applyModelDeltas(i,r)}else this.filter=e;return this},removeFilter:function(e){return this.setFilter(null,e)},_applyModelDeltas:function(e,o){var n=this,r={};t.each(e,(function(e,t){!n.children.findByModel(e)&&n._onCollectionAdd(e,n.collection,{at:t}),r[e.cid]=!0}));var i=t.filter(o,(function(e){return!r[e.cid]&&n.children.findByModel(e)}));this._removeChildModels(i)},reorder:function(){var e,o,n=this,r=this.children,i=this._filteredSortedModels();return!i.length&&this._showingEmptyView||(t.some(i,(function(e){return!r.findByModel(e)}))?this.render():(e=[],o=r.reduce((function(o,n){var r=t.indexOf(i,n.model);return-1===r?(e.push(n.model),o):(n._index=r,o[r]=n.el,o)}),new Array(i.length)),n.triggerMethod("before:reorder",n),n._appendReorderedChildren(o),n._removeChildModels(e),n.triggerMethod("reorder",n))),this},resortView:function(){return this.reorderOnSort?this.reorder():this._renderChildren(),this},_sortViews:function(){var e=this,o=this._filteredSortedModels();t.find(o,(function(t,o){var n=e.children.findByModel(t);return!n||n._index!==o}))&&this.resortView()},_emptyViewIndex:-1,_appendReorderedChildren:function(e){this.appendChildren(this.el,e)},_renderChildren:function(){this._isRendered&&(this._destroyEmptyView(),this._destroyChildren());var e=this._filteredSortedModels();this.isEmpty({processedModels:e})?this._showEmptyView():(this.triggerMethod("before:render:children",this),this._startBuffering(),this._showCollection(e),this._endBuffering(),this.triggerMethod("render:children",this))},_createView:function(e,t){var o=this._getChildView(e),n=this._getChildViewOptions(e,t);return this.buildChildView(e,o,n)},_setupChildView:function(e,t){E(e),this._proxyChildViewEvents(e),this.sort&&(e._index=t)},_showCollection:function(e){t.each(e,t.bind(this._addChild,this)),this.children._updateLength()},_filteredSortedModels:function(e){if(!this.collection||!this.collection.length)return[];var t=this.getViewComparator(),o=this.collection.models;if(e=Math.min(Math.max(e,0),o.length-1),t){var n=void 0;e&&(n=o[e],o=o.slice(0,e).concat(o.slice(e+1))),o=this._sortModelsBy(o,t),n&&o.splice(e,0,n)}return this._filterModels(o)},getViewComparator:function(){return this.viewComparator},_filterModels:function(e){var o=this;return this.filter&&(e=t.filter(e,(function(e,t){return o._shouldAddChild(e,t)}))),e},_sortModelsBy:function(e,o){return"string"==typeof o?t.sortBy(e,(function(e){return e.get(o)})):1===o.length?t.sortBy(e,t.bind(o,this)):t.clone(e).sort(t.bind(o,this))},_showEmptyView:function(){var o=this._getEmptyView();if(o&&!this._showingEmptyView){this._showingEmptyView=!0;var n=new e.Model,r=this.emptyViewOptions||this.childViewOptions;t.isFunction(r)&&(r=r.call(this,n,this._emptyViewIndex));var i=this.buildChildView(n,o,r);this.triggerMethod("before:render:empty",this,i),this.addChildView(i,0),this.triggerMethod("render:empty",this,i)}},_destroyEmptyView:function(){this._showingEmptyView&&(this.triggerMethod("before:remove:empty",this),this._destroyChildren(),delete this._showingEmptyView,this.triggerMethod("remove:empty",this))},_getEmptyView:function(){var e=this.emptyView;if(e)return this._getView(e)},_getChildView:function(e){var t=this.childView;if(!t)throw new A({name:"NoChildViewError",message:'A "childView" must be specified'});if(!(t=this._getView(t,e)))throw new A({name:"InvalidChildViewError",message:'"childView" must be a view class or a function that returns a view class'});return t},_getView:function(o,n){return o.prototype instanceof e.View||o===e.View?o:t.isFunction(o)?o.call(this,n):void 0},_addChild:function(e,t){var o=this._createView(e,t);return this.addChildView(o,t),o},_getChildViewOptions:function(e,o){return t.isFunction(this.childViewOptions)?this.childViewOptions(e,o):this.childViewOptions},addChildView:function(e,t){return this.triggerMethod("before:add:child",this,e),this._setupChildView(e,t),this._isBuffering?this.children._add(e):(this._updateIndices(e,!0),this.children.add(e)),this._renderView(e),this._attachView(e,t),this.triggerMethod("add:child",this,e),e},_updateIndices:function(e,o){if(this.sort)if(o){var n=t.isArray(e)?t.max(e,"_index"):e;t.isObject(n)&&this.children.each((function(e){e._index>=n._index&&(e._index+=1)}))}else t.each(t.sortBy(this.children._views,"_index"),(function(e,t){e._index=t}))},_renderView:function(e){e._isRendered||(e.supportsRenderLifecycle||g(e,"before:render",e),e.render(),e.supportsRenderLifecycle||(e._isRendered=!0,g(e,"render",e)))},_attachView:function(e,t){var o=!e._isAttached&&!this._isBuffering&&this._isAttached;o&&g(e,"before:attach",e),this.attachHtml(this,e,t),o&&(e._isAttached=!0,g(e,"attach",e))},buildChildView:function(e,o,n){return new o(t.extend({model:e},n))},removeChildView:function(e){return!e||e._isDestroyed||(this._removeChildView(e),this.children._updateLength(),this._updateIndices(e,!1)),e},isEmpty:function(e){var o=void 0;return t.result(e,"processedModels")?o=e.processedModels:(o=this.collection?this.collection.models:[],o=this._filterModels(o)),0===o.length},attachBuffer:function(e,t){this.appendChildren(e.el,t)},_createBuffer:function(){var e=this,o=this.createBuffer();return t.each(this._bufferedChildren,(function(t){e.appendChildren(o,t.el)})),o},attachHtml:function(e,t,o){e._isBuffering?e._bufferedChildren.splice(o,0,t):e._insertBefore(t,o)||e._insertAfter(t)},_insertBefore:function(e,t){var o=void 0;return this.sort&&t<this.children.length-1&&(o=this.children.find((function(e){return e._index===t+1}))),!!o&&(this.beforeEl(o.el,e.el),!0)},_insertAfter:function(e){this.appendChildren(this.el,e.el)},_initChildViewStorage:function(){this.children=new pe},_removeChildren:function(){this._destroyChildren()},_destroyChildren:function(e){this.children.length&&(this.triggerMethod("before:destroy:children",this),this.children.each(t.bind(this._removeChildView,this)),this.children._updateLength(),this.triggerMethod("destroy:children",this))},_shouldAddChild:function(e,o){var n=this.filter;return!t.isFunction(n)||n.call(this,e,o,this.collection)}});t.extend(fe.prototype,te);var ve=["childViewContainer","template","templateContext"],be=fe.extend({constructor:function(e){s("CompositeView is deprecated. Convert to View at your earliest convenience"),this.mergeOptions(e,ve),fe.prototype.constructor.apply(this,arguments)},_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this._onCollectionAdd),this.listenTo(this.collection,"update",this._onCollectionUpdate),this.listenTo(this.collection,"reset",this.renderChildren),this.sort&&this.listenTo(this.collection,"sort",this._sortViews))},_getChildView:function(e){var t=this.childView;if(!t)return this.constructor;if(!(t=this._getView(t,e)))throw new A({name:"InvalidChildViewError",message:'"childView" must be a view class or a function that returns a view class'});return t},serializeData:function(){return this.serializeModel()},render:function(){return this._isDestroyed||(this._isRendering=!0,this.resetChildViewContainer(),this.triggerMethod("before:render",this),this._renderTemplate(),this.bindUIElements(),this.renderChildren(),this._isRendering=!1,this._isRendered=!0,this.triggerMethod("render",this)),this},renderChildren:function(){(this._isRendered||this._isRendering)&&fe.prototype._renderChildren.call(this)},attachBuffer:function(e,t){var o=this.getChildViewContainer(e);this.appendChildren(o,t)},_insertAfter:function(e){var t=this.getChildViewContainer(this,e);this.appendChildren(t,e.el)},_appendReorderedChildren:function(e){var t=this.getChildViewContainer(this);this.appendChildren(t,e)},getChildViewContainer:function(e,o){if(e.$childViewContainer)return e.$childViewContainer;var n=void 0;if(e.childViewContainer){var r=t.result(e,"childViewContainer");if((n="@"===r.charAt(0)&&e.ui?e.ui[r.substr(4)]:this.findEls(r,e.$el)).length<=0)throw new A({name:"ChildViewContainerMissingError",message:'The specified "childViewContainer" was not found: '+e.childViewContainer})}else n=e.$el;return e.$childViewContainer=n,n},resetChildViewContainer:function(){this.$childViewContainer&&(this.$childViewContainer=void 0)}}),ye=t.pick(de.prototype,"serializeModel","getTemplate","_renderTemplate","mixinTemplateContext","attachElContent");t.extend(be.prototype,ye);var we=["collectionEvents","events","modelEvents","triggers","ui"],_e=L.extend({cidPrefix:"mnb",constructor:function(e,o){this.view=o,this.defaults=t.clone(t.result(this,"defaults",{})),this._setOptions(this.defaults,e),this.mergeOptions(this.options,we),this.ui=t.extend({},t.result(this,"ui"),t.result(o,"ui")),L.apply(this,arguments)},$:function(){return this.view.$.apply(this.view,arguments)},destroy:function(){return this.stopListening(),this},proxyViewProperties:function(){return this.$el=this.view.$el,this.el=this.view.el,this},bindUIElements:function(){return this._bindUIElements(),this},unbindUIElements:function(){return this._unbindUIElements(),this},getUI:function(e){return this._getUI(e)},delegateEntityEvents:function(){return this._delegateEntityEvents(this.view.model,this.view.collection),this},undelegateEntityEvents:function(){return this._undelegateEntityEvents(this.view.model,this.view.collection),this},getEvents:function(){var e=this,o=this.normalizeUIKeys(t.result(this,"events"));return t.reduce(o,(function(o,n,r){if(t.isFunction(n)||(n=e[n]),n)return o[r=G(r)]=t.bind(n,e),o}),{})},getTriggers:function(){if(this.triggers){var e=this.normalizeUIKeys(t.result(this,"triggers"));return this._getViewTriggers(this.view,e)}}});t.extend(_e.prototype,W,K,ee);var xe=["region","regionClass"],Ce=L.extend({cidPrefix:"mna",constructor:function(e){this._setOptions(e),this.mergeOptions(e,xe),this._initRegion(),L.prototype.constructor.apply(this,arguments)},regionClass:re,_initRegion:function(){var e=this.region;if(e){var t={regionClass:this.regionClass};this._region=ie(e,t)}},getRegion:function(){return this._region},showView:function(e){for(var t=this.getRegion(),o=arguments.length,n=Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return t.show.apply(t,[e].concat(n))},getView:function(){return this.getRegion().currentView},start:function(e){return this.triggerMethod("before:start",this,e),this.triggerMethod("start",this,e),this}}),ke=["appRoutes","controller"],Se=e.Router.extend({constructor:function(t){this._setOptions(t),this.mergeOptions(t,ke),e.Router.apply(this,arguments);var o=this.appRoutes,n=this._getController();this.processAppRoutes(n,o),this.on("route",this._processOnRoute,this)},appRoute:function(e,t){var o=this._getController();return this._addAppRoute(o,e,t),this},_processOnRoute:function(e,o){if(t.isFunction(this.onRoute)){var n=t.invert(this.appRoutes)[e];this.onRoute(e,n,o)}},processAppRoutes:function(e,o){var n=this;if(!o)return this;var r=t.keys(o).reverse();return t.each(r,(function(t){n._addAppRoute(e,t,o[t])})),this},_getController:function(){return this.controller},_addAppRoute:function(e,o,n){var r=e[n];if(!r)throw new A('Method "'+n+'" was not found on the controller');this.route(o,n,t.bind(r,e))},triggerMethod:p});t.extend(Se.prototype,D);var Te=e.Marionette,Ee=e.Marionette={};return Ee.noConflict=function(){return e.Marionette=Te,this},Ee.bindEvents=r(B),Ee.unbindEvents=r(P),Ee.bindRequests=r(V),Ee.unbindRequests=r(N),Ee.mergeOptions=r(l),Ee.getOption=r(c),Ee.normalizeMethods=r(d),Ee.extend=i,Ee.isNodeAttached=a,Ee.deprecate=s,Ee.triggerMethod=r(p),Ee.triggerMethodOn=g,Ee.isEnabled=X,Ee.setEnabled=function(e,t){return Y[e]=t},Ee.monitorViewEvents=E,Ee.Behaviors={},Ee.Behaviors.behaviorsLookup=function(){throw new A({message:"You must define where your behaviors are stored.",url:"marionette.behaviors.md#behaviorslookup"})},Ee.Application=Ce,Ee.AppRouter=Se,Ee.Renderer=le,Ee.TemplateCache=H,Ee.View=de,Ee.CollectionView=fe,Ee.CompositeView=be,Ee.Behavior=_e,Ee.Region=re,Ee.Error=A,Ee.Object=L,Ee.DEV_MODE=!1,Ee.FEATURES=Y,Ee.VERSION=n,Ee}(o(45729),o(37062),o(74506))},74506:function(e,t,o){e.exports=function(e,t){"use strict";e="default"in e?e.default:e,t="default"in t?t.default:t;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},n=t.Radio,r=t.Radio={};r.VERSION="2.0.0",r.noConflict=function(){return t.Radio=n,this},r.DEBUG=!1,r._debugText=function(e,t,o){return e+(o?" on the "+o+" channel":"")+': "'+t+'"'},r.debugLog=function(e,t,o){r.DEBUG&&console&&console.warn&&console.warn(r._debugText(e,t,o))};var i=/\s+/;function s(e,t,o,n){var r=e[t];if(!(o&&o!==r.callback&&o!==r.callback._callback||n&&n!==r.context))return delete e[t],!0}r._eventsApi=function(t,n,r,s){if(!r)return!1;var a={};if("object"===(void 0===r?"undefined":o(r))){for(var l in r){var c=t[n].apply(t,[l,r[l]].concat(s));i.test(l)?e.extend(a,c):a[l]=c}return a}if(i.test(r)){for(var d=r.split(i),u=0,h=d.length;u<h;u++)a[d[u]]=t[n].apply(t,[d[u]].concat(s));return a}return!1},r._callHandler=function(e,t,o){var n=o[0],r=o[1],i=o[2];switch(o.length){case 0:return e.call(t);case 1:return e.call(t,n);case 2:return e.call(t,n,r);case 3:return e.call(t,n,r,i);default:return e.apply(t,o)}};var a,l,c={};function d(t){return c[t]||(c[t]=e.bind(r.log,r,t))}function u(t){return e.isFunction(t)?t:function(){return t}}e.extend(r,{log:function(t,o){if("undefined"!=typeof console){var n=e.toArray(arguments).slice(2);console.log("["+t+'] "'+o+'"',n)}},tuneIn:function(e){var t=r.channel(e);return t._tunedIn=!0,t.on("all",d(e)),this},tuneOut:function(e){var t=r.channel(e);return t._tunedIn=!1,t.off("all",d(e)),delete c[e],this}}),r.Requests={request:function(t){var o=e.toArray(arguments).slice(1),n=r._eventsApi(this,"request",t,o);if(n)return n;var i=this.channelName,s=this._requests;if(i&&this._tunedIn&&r.log.apply(this,[i,t].concat(o)),s&&(s[t]||s.default)){var a=s[t]||s.default;return o=s[t]?o:arguments,r._callHandler(a.callback,a.context,o)}r.debugLog("An unhandled request was fired",t,i)},reply:function(e,t,o){return r._eventsApi(this,"reply",e,[t,o])||(this._requests||(this._requests={}),this._requests[e]&&r.debugLog("A request was overwritten",e,this.channelName),this._requests[e]={callback:u(t),context:o||this}),this},replyOnce:function(t,o,n){if(r._eventsApi(this,"replyOnce",t,[o,n]))return this;var i=this,s=e.once((function(){return i.stopReplying(t),u(o).apply(this,arguments)}));return this.reply(t,s,n)},stopReplying:function(t,o,n){return r._eventsApi(this,"stopReplying",t)||(t||o||n?function(t,o,n,r){t||(t={});for(var i=o?[o]:e.keys(t),a=!1,l=0,c=i.length;l<c;l++)t[o=i[l]]&&s(t,o,n,r)&&(a=!0);return a}(this._requests,t,o,n)||r.debugLog("Attempted to remove the unregistered request",t,this.channelName):delete this._requests),this}},r._channels={},r.channel=function(e){if(!e)throw new Error("You must provide a name for the channel.");return r._channels[e]?r._channels[e]:r._channels[e]=new r.Channel(e)},r.Channel=function(e){this.channelName=e},e.extend(r.Channel.prototype,t.Events,r.Requests,{reset:function(){return this.off(),this.stopListening(),this.stopReplying(),this}});var h=[t.Events,r.Requests];return e.each(h,(function(t){e.each(t,(function(t,o){r[o]=function(t){return l=e.toArray(arguments).slice(1),(a=this.channel(t))[o].apply(a,l)}}))})),r.reset=function(t){var o=t?[this._channels[t]]:this._channels;e.each(o,(function(e){e.reset()}))},r}(o(37062),o(45729))},45729:(e,t,o)=>{var n,r,i;i="object"==typeof self&&self.self===self&&self||"object"==typeof o.g&&o.g.global===o.g&&o.g,n=[o(37062),o(65311),t],r=function(e,t,o){i.Backbone=function(e,t,o,n){var r=e.Backbone,i=Array.prototype.slice;t.VERSION="1.3.3",t.$=n,t.noConflict=function(){return e.Backbone=r,this},t.emulateHTTP=!1,t.emulateJSON=!1;var s=function(e,t,n){o.each(t,(function(t,r){o[r]&&(e.prototype[r]=function(e,t,n){switch(e){case 1:return function(){return o[t](this[n])};case 2:return function(e){return o[t](this[n],e)};case 3:return function(e,r){return o[t](this[n],a(e,this),r)};case 4:return function(e,r,i){return o[t](this[n],a(e,this),r,i)};default:return function(){var e=i.call(arguments);return e.unshift(this[n]),o[t].apply(o,e)}}}(t,r,n))}))},a=function(e,t){return o.isFunction(e)?e:o.isObject(e)&&!t._isModel(e)?l(e):o.isString(e)?function(t){return t.get(e)}:e},l=function(e){var t=o.matches(e);return function(e){return t(e.attributes)}},c=t.Events={},d=/\s+/,u=function(e,t,n,r,i){var s,a=0;if(n&&"object"==typeof n){void 0!==r&&"context"in i&&void 0===i.context&&(i.context=r);for(s=o.keys(n);a<s.length;a++)t=u(e,t,s[a],n[s[a]],i)}else if(n&&d.test(n))for(s=n.split(d);a<s.length;a++)t=e(t,s[a],r,i);else t=e(t,n,r,i);return t};c.on=function(e,t,o){return h(this,e,t,o)};var h=function(e,t,o,n,r){return e._events=u(m,e._events||{},t,o,{context:n,ctx:e,listening:r}),r&&((e._listeners||(e._listeners={}))[r.id]=r),e};c.listenTo=function(e,t,n){if(!e)return this;var r=e._listenId||(e._listenId=o.uniqueId("l")),i=this._listeningTo||(this._listeningTo={}),s=i[r];if(!s){var a=this._listenId||(this._listenId=o.uniqueId("l"));s=i[r]={obj:e,objId:r,id:a,listeningTo:i,count:0}}return h(e,t,n,this,s),this};var m=function(e,t,o,n){if(o){var r=e[t]||(e[t]=[]),i=n.context,s=n.ctx,a=n.listening;a&&a.count++,r.push({callback:o,context:i,ctx:i||s,listening:a})}return e};c.off=function(e,t,o){return this._events?(this._events=u(p,this._events,e,t,{context:o,listeners:this._listeners}),this):this},c.stopListening=function(e,t,n){var r=this._listeningTo;if(!r)return this;for(var i=e?[e._listenId]:o.keys(r),s=0;s<i.length;s++){var a=r[i[s]];if(!a)break;a.obj.off(t,n,this)}return this};var p=function(e,t,n,r){if(e){var i,s=0,a=r.context,l=r.listeners;if(t||n||a){for(var c=t?[t]:o.keys(e);s<c.length;s++){var d=e[t=c[s]];if(!d)break;for(var u=[],h=0;h<d.length;h++){var m=d[h];n&&n!==m.callback&&n!==m.callback._callback||a&&a!==m.context?u.push(m):(i=m.listening)&&0==--i.count&&(delete l[i.id],delete i.listeningTo[i.objId])}u.length?e[t]=u:delete e[t]}return e}for(var p=o.keys(l);s<p.length;s++)delete l[(i=l[p[s]]).id],delete i.listeningTo[i.objId]}};c.once=function(e,t,n){var r=u(g,{},e,t,o.bind(this.off,this));return"string"==typeof e&&null==n&&(t=void 0),this.on(r,t,n)},c.listenToOnce=function(e,t,n){var r=u(g,{},t,n,o.bind(this.stopListening,this,e));return this.listenTo(e,r)};var g=function(e,t,n,r){if(n){var i=e[t]=o.once((function(){r(t,i),n.apply(this,arguments)}));i._callback=n}return e};c.trigger=function(e){if(!this._events)return this;for(var t=Math.max(0,arguments.length-1),o=Array(t),n=0;n<t;n++)o[n]=arguments[n+1];return u(f,this._events,e,void 0,o),this};var f=function(e,t,o,n){if(e){var r=e[t],i=e.all;r&&i&&(i=i.slice()),r&&v(r,n),i&&v(i,[t].concat(n))}return e},v=function(e,t){var o,n=-1,r=e.length,i=t[0],s=t[1],a=t[2];switch(t.length){case 0:for(;++n<r;)(o=e[n]).callback.call(o.ctx);return;case 1:for(;++n<r;)(o=e[n]).callback.call(o.ctx,i);return;case 2:for(;++n<r;)(o=e[n]).callback.call(o.ctx,i,s);return;case 3:for(;++n<r;)(o=e[n]).callback.call(o.ctx,i,s,a);return;default:for(;++n<r;)(o=e[n]).callback.apply(o.ctx,t);return}};c.bind=c.on,c.unbind=c.off,o.extend(t,c);var b=t.Model=function(e,t){var n=e||{};t||(t={}),this.cid=o.uniqueId(this.cidPrefix),this.attributes={},t.collection&&(this.collection=t.collection),t.parse&&(n=this.parse(n,t)||{});var r=o.result(this,"defaults");n=o.defaults(o.extend({},r,n),r),this.set(n,t),this.changed={},this.initialize.apply(this,arguments)};o.extend(b.prototype,c,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",initialize:function(){},toJSON:function(e){return o.clone(this.attributes)},sync:function(){return t.sync.apply(this,arguments)},get:function(e){return this.attributes[e]},escape:function(e){return o.escape(this.get(e))},has:function(e){return null!=this.get(e)},matches:function(e){return!!o.iteratee(e,this)(this.attributes)},set:function(e,t,n){if(null==e)return this;var r;if("object"==typeof e?(r=e,n=t):(r={})[e]=t,n||(n={}),!this._validate(r,n))return!1;var i=n.unset,s=n.silent,a=[],l=this._changing;this._changing=!0,l||(this._previousAttributes=o.clone(this.attributes),this.changed={});var c=this.attributes,d=this.changed,u=this._previousAttributes;for(var h in r)t=r[h],o.isEqual(c[h],t)||a.push(h),o.isEqual(u[h],t)?delete d[h]:d[h]=t,i?delete c[h]:c[h]=t;if(this.idAttribute in r&&(this.id=this.get(this.idAttribute)),!s){a.length&&(this._pending=n);for(var m=0;m<a.length;m++)this.trigger("change:"+a[m],this,c[a[m]],n)}if(l)return this;if(!s)for(;this._pending;)n=this._pending,this._pending=!1,this.trigger("change",this,n);return this._pending=!1,this._changing=!1,this},unset:function(e,t){return this.set(e,void 0,o.extend({},t,{unset:!0}))},clear:function(e){var t={};for(var n in this.attributes)t[n]=void 0;return this.set(t,o.extend({},e,{unset:!0}))},hasChanged:function(e){return null==e?!o.isEmpty(this.changed):o.has(this.changed,e)},changedAttributes:function(e){if(!e)return!!this.hasChanged()&&o.clone(this.changed);var t=this._changing?this._previousAttributes:this.attributes,n={};for(var r in e){var i=e[r];o.isEqual(t[r],i)||(n[r]=i)}return!!o.size(n)&&n},previous:function(e){return null!=e&&this._previousAttributes?this._previousAttributes[e]:null},previousAttributes:function(){return o.clone(this._previousAttributes)},fetch:function(e){e=o.extend({parse:!0},e);var t=this,n=e.success;return e.success=function(o){var r=e.parse?t.parse(o,e):o;if(!t.set(r,e))return!1;n&&n.call(e.context,t,o,e),t.trigger("sync",t,o,e)},F(this,e),this.sync("read",this,e)},save:function(e,t,n){var r;null==e||"object"==typeof e?(r=e,n=t):(r={})[e]=t;var i=(n=o.extend({validate:!0,parse:!0},n)).wait;if(r&&!i){if(!this.set(r,n))return!1}else if(!this._validate(r,n))return!1;var s=this,a=n.success,l=this.attributes;n.success=function(e){s.attributes=l;var t=n.parse?s.parse(e,n):e;if(i&&(t=o.extend({},r,t)),t&&!s.set(t,n))return!1;a&&a.call(n.context,s,e,n),s.trigger("sync",s,e,n)},F(this,n),r&&i&&(this.attributes=o.extend({},l,r));var c=this.isNew()?"create":n.patch?"patch":"update";"patch"!==c||n.attrs||(n.attrs=r);var d=this.sync(c,this,n);return this.attributes=l,d},destroy:function(e){e=e?o.clone(e):{};var t=this,n=e.success,r=e.wait,i=function(){t.stopListening(),t.trigger("destroy",t,t.collection,e)};e.success=function(o){r&&i(),n&&n.call(e.context,t,o,e),t.isNew()||t.trigger("sync",t,o,e)};var s=!1;return this.isNew()?o.defer(e.success):(F(this,e),s=this.sync("delete",this,e)),r||i(),s},url:function(){var e=o.result(this,"urlRoot")||o.result(this.collection,"url")||D();if(this.isNew())return e;var t=this.get(this.idAttribute);return e.replace(/[^\/]$/,"$&/")+encodeURIComponent(t)},parse:function(e,t){return e},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(e){return this._validate({},o.extend({},e,{validate:!0}))},_validate:function(e,t){if(!t.validate||!this.validate)return!0;e=o.extend({},this.attributes,e);var n=this.validationError=this.validate(e,t)||null;return!n||(this.trigger("invalid",this,n,o.extend(t,{validationError:n})),!1)}}),s(b,{keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1},"attributes");var y=t.Collection=function(e,t){t||(t={}),t.model&&(this.model=t.model),void 0!==t.comparator&&(this.comparator=t.comparator),this._reset(),this.initialize.apply(this,arguments),e&&this.reset(e,o.extend({silent:!0},t))},w={add:!0,remove:!0,merge:!0},_={add:!0,remove:!1},x=function(e,t,o){o=Math.min(Math.max(o,0),e.length);var n,r=Array(e.length-o),i=t.length;for(n=0;n<r.length;n++)r[n]=e[n+o];for(n=0;n<i;n++)e[n+o]=t[n];for(n=0;n<r.length;n++)e[n+i+o]=r[n]};o.extend(y.prototype,c,{model:b,initialize:function(){},toJSON:function(e){return this.map((function(t){return t.toJSON(e)}))},sync:function(){return t.sync.apply(this,arguments)},add:function(e,t){return this.set(e,o.extend({merge:!1},t,_))},remove:function(e,t){t=o.extend({},t);var n=!o.isArray(e);e=n?[e]:e.slice();var r=this._removeModels(e,t);return!t.silent&&r.length&&(t.changes={added:[],merged:[],removed:r},this.trigger("update",this,t)),n?r[0]:r},set:function(e,t){if(null!=e){(t=o.extend({},w,t)).parse&&!this._isModel(e)&&(e=this.parse(e,t)||[]);var n=!o.isArray(e);e=n?[e]:e.slice();var r=t.at;null!=r&&(r=+r),r>this.length&&(r=this.length),r<0&&(r+=this.length+1);var i,s,a=[],l=[],c=[],d=[],u={},h=t.add,m=t.merge,p=t.remove,g=!1,f=this.comparator&&null==r&&!1!==t.sort,v=o.isString(this.comparator)?this.comparator:null;for(s=0;s<e.length;s++){i=e[s];var b=this.get(i);if(b){if(m&&i!==b){var y=this._isModel(i)?i.attributes:i;t.parse&&(y=b.parse(y,t)),b.set(y,t),c.push(b),f&&!g&&(g=b.hasChanged(v))}u[b.cid]||(u[b.cid]=!0,a.push(b)),e[s]=b}else h&&(i=e[s]=this._prepareModel(i,t))&&(l.push(i),this._addReference(i,t),u[i.cid]=!0,a.push(i))}if(p){for(s=0;s<this.length;s++)u[(i=this.models[s]).cid]||d.push(i);d.length&&this._removeModels(d,t)}var _=!1,C=!f&&h&&p;if(a.length&&C?(_=this.length!==a.length||o.some(this.models,(function(e,t){return e!==a[t]})),this.models.length=0,x(this.models,a,0),this.length=this.models.length):l.length&&(f&&(g=!0),x(this.models,l,null==r?this.length:r),this.length=this.models.length),g&&this.sort({silent:!0}),!t.silent){for(s=0;s<l.length;s++)null!=r&&(t.index=r+s),(i=l[s]).trigger("add",i,this,t);(g||_)&&this.trigger("sort",this,t),(l.length||d.length||c.length)&&(t.changes={added:l,removed:d,merged:c},this.trigger("update",this,t))}return n?e[0]:e}},reset:function(e,t){t=t?o.clone(t):{};for(var n=0;n<this.models.length;n++)this._removeReference(this.models[n],t);return t.previousModels=this.models,this._reset(),e=this.add(e,o.extend({silent:!0},t)),t.silent||this.trigger("reset",this,t),e},push:function(e,t){return this.add(e,o.extend({at:this.length},t))},pop:function(e){var t=this.at(this.length-1);return this.remove(t,e)},unshift:function(e,t){return this.add(e,o.extend({at:0},t))},shift:function(e){var t=this.at(0);return this.remove(t,e)},slice:function(){return i.apply(this.models,arguments)},get:function(e){if(null!=e)return this._byId[e]||this._byId[this.modelId(e.attributes||e)]||e.cid&&this._byId[e.cid]},has:function(e){return null!=this.get(e)},at:function(e){return e<0&&(e+=this.length),this.models[e]},where:function(e,t){return this[t?"find":"filter"](e)},findWhere:function(e){return this.where(e,!0)},sort:function(e){var t=this.comparator;if(!t)throw new Error("Cannot sort a set without a comparator");e||(e={});var n=t.length;return o.isFunction(t)&&(t=o.bind(t,this)),1===n||o.isString(t)?this.models=this.sortBy(t):this.models.sort(t),e.silent||this.trigger("sort",this,e),this},pluck:function(e){return this.map(e+"")},fetch:function(e){var t=(e=o.extend({parse:!0},e)).success,n=this;return e.success=function(o){var r=e.reset?"reset":"set";n[r](o,e),t&&t.call(e.context,n,o,e),n.trigger("sync",n,o,e)},F(this,e),this.sync("read",this,e)},create:function(e,t){var n=(t=t?o.clone(t):{}).wait;if(!(e=this._prepareModel(e,t)))return!1;n||this.add(e,t);var r=this,i=t.success;return t.success=function(e,t,o){n&&r.add(e,o),i&&i.call(o.context,e,t,o)},e.save(null,t),e},parse:function(e,t){return e},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(e){return e[this.model.prototype.idAttribute||"id"]},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(e,t){if(this._isModel(e))return e.collection||(e.collection=this),e;(t=t?o.clone(t):{}).collection=this;var n=new this.model(e,t);return n.validationError?(this.trigger("invalid",this,n.validationError,t),!1):n},_removeModels:function(e,t){for(var o=[],n=0;n<e.length;n++){var r=this.get(e[n]);if(r){var i=this.indexOf(r);this.models.splice(i,1),this.length--,delete this._byId[r.cid];var s=this.modelId(r.attributes);null!=s&&delete this._byId[s],t.silent||(t.index=i,r.trigger("remove",r,this,t)),o.push(r),this._removeReference(r,t)}}return o},_isModel:function(e){return e instanceof b},_addReference:function(e,t){this._byId[e.cid]=e;var o=this.modelId(e.attributes);null!=o&&(this._byId[o]=e),e.on("all",this._onModelEvent,this)},_removeReference:function(e,t){delete this._byId[e.cid];var o=this.modelId(e.attributes);null!=o&&delete this._byId[o],this===e.collection&&delete e.collection,e.off("all",this._onModelEvent,this)},_onModelEvent:function(e,t,o,n){if(t){if(("add"===e||"remove"===e)&&o!==this)return;if("destroy"===e&&this.remove(t,n),"change"===e){var r=this.modelId(t.previousAttributes()),i=this.modelId(t.attributes);r!==i&&(null!=r&&delete this._byId[r],null!=i&&(this._byId[i]=t))}}this.trigger.apply(this,arguments)}}),s(y,{forEach:3,each:3,map:3,collect:3,reduce:0,foldl:0,inject:0,reduceRight:0,foldr:0,find:3,detect:3,filter:3,select:3,reject:3,every:3,all:3,some:3,any:3,include:3,includes:3,contains:3,invoke:0,max:3,min:3,toArray:1,size:1,first:3,head:3,take:3,initial:3,rest:3,tail:3,drop:3,last:3,without:0,difference:0,indexOf:3,shuffle:1,lastIndexOf:3,isEmpty:1,chain:1,sample:3,partition:3,groupBy:3,countBy:3,sortBy:3,indexBy:3,findIndex:3,findLastIndex:3},"models");var C=t.View=function(e){this.cid=o.uniqueId("view"),o.extend(this,o.pick(e,S)),this._ensureElement(),this.initialize.apply(this,arguments)},k=/^(\S+)\s*(.*)$/,S=["model","collection","el","id","attributes","className","tagName","events"];o.extend(C.prototype,c,{tagName:"div",$:function(e){return this.$el.find(e)},initialize:function(){},render:function(){return this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.$el.remove()},setElement:function(e){return this.undelegateEvents(),this._setElement(e),this.delegateEvents(),this},_setElement:function(e){this.$el=e instanceof t.$?e:t.$(e),this.el=this.$el[0]},delegateEvents:function(e){if(e||(e=o.result(this,"events")),!e)return this;for(var t in this.undelegateEvents(),e){var n=e[t];if(o.isFunction(n)||(n=this[n]),n){var r=t.match(k);this.delegate(r[1],r[2],o.bind(n,this))}}return this},delegate:function(e,t,o){return this.$el.on(e+".delegateEvents"+this.cid,t,o),this},undelegateEvents:function(){return this.$el&&this.$el.off(".delegateEvents"+this.cid),this},undelegate:function(e,t,o){return this.$el.off(e+".delegateEvents"+this.cid,t,o),this},_createElement:function(e){return document.createElement(e)},_ensureElement:function(){if(this.el)this.setElement(o.result(this,"el"));else{var e=o.extend({},o.result(this,"attributes"));this.id&&(e.id=o.result(this,"id")),this.className&&(e.class=o.result(this,"className")),this.setElement(this._createElement(o.result(this,"tagName"))),this._setAttributes(e)}},_setAttributes:function(e){this.$el.attr(e)}}),t.sync=function(e,n,r){var i=T[e];o.defaults(r||(r={}),{emulateHTTP:t.emulateHTTP,emulateJSON:t.emulateJSON});var s={type:i,dataType:"json"};if(r.url||(s.url=o.result(n,"url")||D()),null!=r.data||!n||"create"!==e&&"update"!==e&&"patch"!==e||(s.contentType="application/json",s.data=JSON.stringify(r.attrs||n.toJSON(r))),r.emulateJSON&&(s.contentType="application/x-www-form-urlencoded",s.data=s.data?{model:s.data}:{}),r.emulateHTTP&&("PUT"===i||"DELETE"===i||"PATCH"===i)){s.type="POST",r.emulateJSON&&(s.data._method=i);var a=r.beforeSend;r.beforeSend=function(e){if(e.setRequestHeader("X-HTTP-Method-Override",i),a)return a.apply(this,arguments)}}"GET"===s.type||r.emulateJSON||(s.processData=!1);var l=r.error;r.error=function(e,t,o){r.textStatus=t,r.errorThrown=o,l&&l.call(r.context,e,t,o)};var c=r.xhr=t.ajax(o.extend(s,r));return n.trigger("request",n,c,r),c};var T={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};t.ajax=function(){return t.$.ajax.apply(t.$,arguments)};var E=t.Router=function(e){e||(e={}),e.routes&&(this.routes=e.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},O=/\((.*?)\)/g,A=/(\(\?)?:\w+/g,M=/\*\w+/g,B=/[\-{}\[\]+?.,\\\^$|#\s]/g;o.extend(E.prototype,c,{initialize:function(){},route:function(e,n,r){o.isRegExp(e)||(e=this._routeToRegExp(e)),o.isFunction(n)&&(r=n,n=""),r||(r=this[n]);var i=this;return t.history.route(e,(function(o){var s=i._extractParameters(e,o);!1!==i.execute(r,s,n)&&(i.trigger.apply(i,["route:"+n].concat(s)),i.trigger("route",n,s),t.history.trigger("route",i,n,s))})),this},execute:function(e,t,o){e&&e.apply(this,t)},navigate:function(e,o){return t.history.navigate(e,o),this},_bindRoutes:function(){if(this.routes){this.routes=o.result(this,"routes");for(var e,t=o.keys(this.routes);null!=(e=t.pop());)this.route(e,this.routes[e])}},_routeToRegExp:function(e){return e=e.replace(B,"\\$&").replace(O,"(?:$1)?").replace(A,(function(e,t){return t?e:"([^/?]+)"})).replace(M,"([^?]*?)"),new RegExp("^"+e+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(e,t){var n=e.exec(t).slice(1);return o.map(n,(function(e,t){return t===n.length-1?e||null:e?decodeURIComponent(e):null}))}});var P=t.History=function(){this.handlers=[],this.checkUrl=o.bind(this.checkUrl,this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},R=/^[#\/]|\s+$/g,V=/^\/+|\/+$/g,N=/#.*$/;P.started=!1,o.extend(P.prototype,c,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root&&!this.getSearch()},matchRoot:function(){return this.decodeFragment(this.location.pathname).slice(0,this.root.length-1)+"/"===this.root},decodeFragment:function(e){return decodeURI(e.replace(/%25/g,"%2525"))},getSearch:function(){var e=this.location.href.replace(/#.*/,"").match(/\?.+/);return e?e[0]:""},getHash:function(e){var t=(e||this).location.href.match(/#(.*)$/);return t?t[1]:""},getPath:function(){var e=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return"/"===e.charAt(0)?e.slice(1):e},getFragment:function(e){return null==e&&(e=this._usePushState||!this._wantsHashChange?this.getPath():this.getHash()),e.replace(R,"")},start:function(e){if(P.started)throw new Error("Backbone.history has already been started");if(P.started=!0,this.options=o.extend({root:"/"},this.options,e),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,this._hasHashChange="onhashchange"in window&&(void 0===document.documentMode||document.documentMode>7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(V,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var t=this.root.slice(0,-1)||"/";return this.location.replace(t+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var n=document.body,r=n.insertBefore(this.iframe,n.firstChild).contentWindow;r.document.open(),r.document.close(),r.location.hash="#"+this.fragment}var i=window.addEventListener||function(e,t){return attachEvent("on"+e,t)};if(this._usePushState?i("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?i("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var e=window.removeEventListener||function(e,t){return detachEvent("on"+e,t)};this._usePushState?e("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&e("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),P.started=!1},route:function(e,t){this.handlers.unshift({route:e,callback:t})},checkUrl:function(e){var t=this.getFragment();if(t===this.fragment&&this.iframe&&(t=this.getHash(this.iframe.contentWindow)),t===this.fragment)return!1;this.iframe&&this.navigate(t),this.loadUrl()},loadUrl:function(e){return!!this.matchRoot()&&(e=this.fragment=this.getFragment(e),o.some(this.handlers,(function(t){if(t.route.test(e))return t.callback(e),!0})))},navigate:function(e,t){if(!P.started)return!1;t&&!0!==t||(t={trigger:!!t}),e=this.getFragment(e||"");var o=this.root;""!==e&&"?"!==e.charAt(0)||(o=o.slice(0,-1)||"/");var n=o+e;if(e=this.decodeFragment(e.replace(N,"")),this.fragment!==e){if(this.fragment=e,this._usePushState)this.history[t.replace?"replaceState":"pushState"]({},document.title,n);else{if(!this._wantsHashChange)return this.location.assign(n);if(this._updateHash(this.location,e,t.replace),this.iframe&&e!==this.getHash(this.iframe.contentWindow)){var r=this.iframe.contentWindow;t.replace||(r.document.open(),r.document.close()),this._updateHash(r.location,e,t.replace)}}return t.trigger?this.loadUrl(e):void 0}},_updateHash:function(e,t,o){if(o){var n=e.href.replace(/(javascript:|#).*$/,"");e.replace(n+"#"+t)}else e.hash="#"+t}}),t.history=new P;b.extend=y.extend=E.extend=C.extend=P.extend=function(e,t){var n,r=this;return n=e&&o.has(e,"constructor")?e.constructor:function(){return r.apply(this,arguments)},o.extend(n,r,t),n.prototype=o.create(r.prototype,e),n.prototype.constructor=n,n.__super__=r.prototype,n};var D=function(){throw new Error('A "url" property or function must be specified')},F=function(e,t){var o=t.error;t.error=function(n){o&&o.call(t.context,e,n,t),e.trigger("error",e,n,t)}};return t}(i,o,e,t)}.apply(t,n),void 0===r||(e.exports=r)},55091:function(e,t,o){var n,r;void 0===(r="function"==typeof(n=function(){"use strict";function t(e,t,o){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){a(n.response,t,o)},n.onerror=function(){console.error("could not download file")},n.send()}function n(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function r(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(o){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof o.g&&o.g.global===o.g?o.g:void 0,s=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),a=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(e,o,s){var a=i.URL||i.webkitURL,l=document.createElement("a");o=o||e.name||"download",l.download=o,l.rel="noopener","string"==typeof e?(l.href=e,l.origin===location.origin?r(l):n(l.href)?t(e,o,s):r(l,l.target="_blank")):(l.href=a.createObjectURL(e),setTimeout((function(){a.revokeObjectURL(l.href)}),4e4),setTimeout((function(){r(l)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,o,i){if(o=o||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}(e,i),o);else if(n(e))t(e,o,i);else{var s=document.createElement("a");s.href=e,s.target="_blank",setTimeout((function(){r(s)}))}}:function(e,o,n,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),"string"==typeof e)return t(e,o,n);var a="application/octet-stream"===e.type,l=/constructor/i.test(i.HTMLElement)||i.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||a&&l||s)&&"undefined"!=typeof FileReader){var d=new FileReader;d.onloadend=function(){var e=d.result;e=c?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=e:location=e,r=null},d.readAsDataURL(e)}else{var u=i.URL||i.webkitURL,h=u.createObjectURL(e);r?r.location=h:location.href=h,r=null,setTimeout((function(){u.revokeObjectURL(h)}),4e4)}});i.saveAs=a.saveAs=a,e.exports=a})?n.apply(t,[]):n)||(e.exports=r)},40669:(e,t,o)=>{"use strict";var n,r=o(65311),i=o.n(r);e=o.hmd(e),function(e){if(!e.jQuery){var t=function(e,o){return new t.fn.init(e,o)};t.isWindow=function(e){return e&&e===e.window},t.type=function(e){return e?"object"==typeof e||"function"==typeof e?n[i.call(e)]||"object":typeof e:e+""},t.isArray=Array.isArray||function(e){return"array"===t.type(e)},t.isPlainObject=function(e){var o;if(!e||"object"!==t.type(e)||e.nodeType||t.isWindow(e))return!1;try{if(e.constructor&&!r.call(e,"constructor")&&!r.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}for(o in e);return void 0===o||r.call(e,o)},t.each=function(e,t,o){var n=0,r=e.length,i=l(e);if(o){if(i)for(;n<r&&!1!==t.apply(e[n],o);n++);else for(n in e)if(e.hasOwnProperty(n)&&!1===t.apply(e[n],o))break}else if(i)for(;n<r&&!1!==t.call(e[n],n,e[n]);n++);else for(n in e)if(e.hasOwnProperty(n)&&!1===t.call(e[n],n,e[n]))break;return e},t.data=function(e,n,r){if(void 0===r){var i=e[t.expando],s=i&&o[i];if(void 0===n)return s;if(s&&n in s)return s[n]}else if(void 0!==n){var a=e[t.expando]||(e[t.expando]=++t.uuid);return o[a]=o[a]||{},o[a][n]=r,r}},t.removeData=function(e,n){var r=e[t.expando],i=r&&o[r];i&&(n?t.each(n,(function(e,t){delete i[t]})):delete o[r])},t.extend=function(){var e,o,n,r,i,s,a=arguments[0]||{},l=1,c=arguments.length,d=!1;for("boolean"==typeof a&&(d=a,a=arguments[l]||{},l++),"object"!=typeof a&&"function"!==t.type(a)&&(a={}),l===c&&(a=this,l--);l<c;l++)if(i=arguments[l])for(r in i)i.hasOwnProperty(r)&&(e=a[r],a!==(n=i[r])&&(d&&n&&(t.isPlainObject(n)||(o=t.isArray(n)))?(o?(o=!1,s=e&&t.isArray(e)?e:[]):s=e&&t.isPlainObject(e)?e:{},a[r]=t.extend(d,s,n)):void 0!==n&&(a[r]=n)));return a},t.queue=function(e,o,n){if(e){o=(o||"fx")+"queue";var r,i,s=t.data(e,o);return n?(!s||t.isArray(n)?s=t.data(e,o,(i=[],(r=n)&&(l(Object(r))?function(e,t){for(var o=+t.length,n=0,r=e.length;n<o;)e[r++]=t[n++];if(o!=o)for(;void 0!==t[n];)e[r++]=t[n++];e.length=r}(i,"string"==typeof r?[r]:r):[].push.call(i,r)),i)):s.push(n),s):s||[]}},t.dequeue=function(e,o){t.each(e.nodeType?[e]:e,(function(e,n){o=o||"fx";var r=t.queue(n,o),i=r.shift();"inprogress"===i&&(i=r.shift()),i&&("fx"===o&&r.unshift("inprogress"),i.call(n,(function(){t.dequeue(n,o)})))}))},t.fn=t.prototype={init:function(e){if(e.nodeType)return this[0]=e,this;throw new Error("Not a DOM node.")},offset:function(){var t=this[0].getBoundingClientRect?this[0].getBoundingClientRect():{top:0,left:0};return{top:t.top+(e.pageYOffset||document.scrollTop||0)-(document.clientTop||0),left:t.left+(e.pageXOffset||document.scrollLeft||0)-(document.clientLeft||0)}},position:function(){var e=this[0],o=function(e){for(var t=e.offsetParent;t&&"html"!==t.nodeName.toLowerCase()&&t.style&&"static"===t.style.position.toLowerCase();)t=t.offsetParent;return t||document}(e),n=this.offset(),r=/^(?:body|html)$/i.test(o.nodeName)?{top:0,left:0}:t(o).offset();return n.top-=parseFloat(e.style.marginTop)||0,n.left-=parseFloat(e.style.marginLeft)||0,o.style&&(r.top+=parseFloat(o.style.borderTopWidth)||0,r.left+=parseFloat(o.style.borderLeftWidth)||0),{top:n.top-r.top,left:n.left-r.left}}};var o={};t.expando="velocity"+(new Date).getTime(),t.uuid=0;for(var n={},r=n.hasOwnProperty,i=n.toString,s="Boolean Number String Function Array Date RegExp Object Error".split(" "),a=0;a<s.length;a++)n["[object "+s[a]+"]"]=s[a].toLowerCase();t.fn.init.prototype=t.fn,e.Velocity={Utilities:t}}function l(e){var o=e.length,n=t.type(e);return"function"!==n&&!t.isWindow(e)&&(!(1!==e.nodeType||!o)||"array"===n||0===o||"number"==typeof o&&o>0&&o-1 in e)}}(window),n=function(){return function(e,t,o,n){var r,s=function(){if(o.documentMode)return o.documentMode;for(var e=7;e>4;e--){var t=o.createElement("div");if(t.innerHTML="\x3c!--[if IE "+e+"]><span></span><![endif]--\x3e",t.getElementsByTagName("span").length)return t=null,e}return n}(),a=(r=0,t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||function(e){var t,o=(new Date).getTime();return t=Math.max(0,16-(o-r)),r=o+t,setTimeout((function(){e(o+t)}),t)}),l=function(){var e=t.performance||{};if("function"!=typeof e.now){var o=e.timing&&e.timing.navigationStart?e.timing.navigationStart:(new Date).getTime();e.now=function(){return(new Date).getTime()-o}}return e}(),c=function(){var e=Array.prototype.slice;try{return e.call(o.documentElement),e}catch(t){return function(t,o){var n=this.length;if("number"!=typeof t&&(t=0),"number"!=typeof o&&(o=n),this.slice)return e.call(this,t,o);var r,i=[],s=t>=0?t:Math.max(0,n+t),a=(o<0?n+o:Math.min(o,n))-s;if(a>0)if(i=new Array(a),this.charAt)for(r=0;r<a;r++)i[r]=this.charAt(s+r);else for(r=0;r<a;r++)i[r]=this[s+r];return i}}}(),d=function(){return Array.prototype.includes?function(e,t){return e.includes(t)}:Array.prototype.indexOf?function(e,t){return e.indexOf(t)>=0}:function(e,t){for(var o=0;o<e.length;o++)if(e[o]===t)return!0;return!1}};function u(e){return m.isWrapped(e)?e=c.call(e):m.isNode(e)&&(e=[e]),e}var h,m={isNumber:function(e){return"number"==typeof e},isString:function(e){return"string"==typeof e},isArray:Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},isFunction:function(e){return"[object Function]"===Object.prototype.toString.call(e)},isNode:function(e){return e&&e.nodeType},isWrapped:function(e){return e&&e!==t&&m.isNumber(e.length)&&!m.isString(e)&&!m.isFunction(e)&&!m.isNode(e)&&(0===e.length||m.isNode(e[0]))},isSVG:function(e){return t.SVGElement&&e instanceof t.SVGElement},isEmptyObject:function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}},p=!1;if(e.fn&&e.fn.jquery?(h=e,p=!0):h=t.Velocity.Utilities,s<=8&&!p)throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity.");if(!(s<=7)){var g="swing",f={State:{isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t.navigator.userAgent),isAndroid:/Android/i.test(t.navigator.userAgent),isGingerbread:/Android 2\.3\.[3-7]/i.test(t.navigator.userAgent),isChrome:t.chrome,isFirefox:/Firefox/i.test(t.navigator.userAgent),prefixElement:o.createElement("div"),prefixMatches:{},scrollAnchor:null,scrollPropertyLeft:null,scrollPropertyTop:null,isTicking:!1,calls:[],delayedElements:{count:0}},CSS:{},Utilities:h,Redirects:{},Easings:{},Promise:t.Promise,defaults:{queue:"",duration:400,easing:g,begin:n,complete:n,progress:n,display:n,visibility:n,loop:!1,delay:!1,mobileHA:!0,_cacheValues:!0,promiseRejectEmpty:!0},init:function(e){h.data(e,"velocity",{isSVG:m.isSVG(e),isAnimating:!1,computedStyle:null,tweensContainer:null,rootPropertyValueCache:{},transformCache:{}})},hook:null,mock:!1,version:{major:1,minor:5,patch:2},debug:!1,timestamp:!0,pauseAll:function(e){var t=(new Date).getTime();h.each(f.State.calls,(function(t,o){if(o){if(e!==n&&(o[2].queue!==e||!1===o[2].queue))return!0;o[5]={resume:!1}}})),h.each(f.State.delayedElements,(function(e,o){o&&C(o,t)}))},resumeAll:function(e){(new Date).getTime(),h.each(f.State.calls,(function(t,o){if(o){if(e!==n&&(o[2].queue!==e||!1===o[2].queue))return!0;o[5]&&(o[5].resume=!0)}})),h.each(f.State.delayedElements,(function(e,t){t&&k(t)}))}};t.pageYOffset!==n?(f.State.scrollAnchor=t,f.State.scrollPropertyLeft="pageXOffset",f.State.scrollPropertyTop="pageYOffset"):(f.State.scrollAnchor=o.documentElement||o.body.parentNode||o.body,f.State.scrollPropertyLeft="scrollLeft",f.State.scrollPropertyTop="scrollTop");var v=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,o,n){var r={x:t.x+n.dx*o,v:t.v+n.dv*o,tension:t.tension,friction:t.friction};return{dx:r.v,dv:e(r)}}function o(o,n){var r={dx:o.v,dv:e(o)},i=t(o,.5*n,r),s=t(o,.5*n,i),a=t(o,n,s),l=1/6*(r.dx+2*(i.dx+s.dx)+a.dx),c=1/6*(r.dv+2*(i.dv+s.dv)+a.dv);return o.x=o.x+l*n,o.v=o.v+c*n,o}return function e(t,n,r){var i,s,a,l={x:-1,v:0,tension:null,friction:null},c=[0],d=0,u=1e-4;for(t=parseFloat(t)||500,n=parseFloat(n)||20,r=r||null,l.tension=t,l.friction=n,s=(i=null!==r)?(d=e(t,n))/r*.016:.016;a=o(a||l,s),c.push(1+a.x),d+=16,Math.abs(a.x)>u&&Math.abs(a.v)>u;);return i?function(e){return c[e*(c.length-1)|0]}:d}}();f.Easings={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},spring:function(e){return 1-Math.cos(4.5*e*Math.PI)*Math.exp(6*-e)}},h.each([["ease",[.25,.1,.25,1]],["ease-in",[.42,0,1,1]],["ease-out",[0,0,.58,1]],["ease-in-out",[.42,0,.58,1]],["easeInSine",[.47,0,.745,.715]],["easeOutSine",[.39,.575,.565,1]],["easeInOutSine",[.445,.05,.55,.95]],["easeInQuad",[.55,.085,.68,.53]],["easeOutQuad",[.25,.46,.45,.94]],["easeInOutQuad",[.455,.03,.515,.955]],["easeInCubic",[.55,.055,.675,.19]],["easeOutCubic",[.215,.61,.355,1]],["easeInOutCubic",[.645,.045,.355,1]],["easeInQuart",[.895,.03,.685,.22]],["easeOutQuart",[.165,.84,.44,1]],["easeInOutQuart",[.77,0,.175,1]],["easeInQuint",[.755,.05,.855,.06]],["easeOutQuint",[.23,1,.32,1]],["easeInOutQuint",[.86,0,.07,1]],["easeInExpo",[.95,.05,.795,.035]],["easeOutExpo",[.19,1,.22,1]],["easeInOutExpo",[1,0,0,1]],["easeInCirc",[.6,.04,.98,.335]],["easeOutCirc",[.075,.82,.165,1]],["easeInOutCirc",[.785,.135,.15,.86]]],(function(e,t){f.Easings[t[0]]=T.apply(null,t[1])}));var b=f.CSS={RegEx:{isHex:/^#([A-f\d]{3}){1,2}$/i,valueUnwrap:/^[A-z]+\((.*)\)$/i,wrappedValueAlreadyExtracted:/[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,valueSplit:/([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/gi},Lists:{colors:["fill","stroke","stopColor","color","backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","outlineColor"],transformsBase:["translateX","translateY","scale","scaleX","scaleY","skewX","skewY","rotateZ"],transforms3D:["transformPerspective","translateZ","scaleZ","rotateX","rotateY"],units:["%","em","ex","ch","rem","vw","vh","vmin","vmax","cm","mm","Q","in","pc","pt","px","deg","grad","rad","turn","s","ms"],colorNames:{aliceblue:"240,248,255",antiquewhite:"250,235,215",aquamarine:"127,255,212",aqua:"0,255,255",azure:"240,255,255",beige:"245,245,220",bisque:"255,228,196",black:"0,0,0",blanchedalmond:"255,235,205",blueviolet:"138,43,226",blue:"0,0,255",brown:"165,42,42",burlywood:"222,184,135",cadetblue:"95,158,160",chartreuse:"127,255,0",chocolate:"210,105,30",coral:"255,127,80",cornflowerblue:"100,149,237",cornsilk:"255,248,220",crimson:"220,20,60",cyan:"0,255,255",darkblue:"0,0,139",darkcyan:"0,139,139",darkgoldenrod:"184,134,11",darkgray:"169,169,169",darkgrey:"169,169,169",darkgreen:"0,100,0",darkkhaki:"189,183,107",darkmagenta:"139,0,139",darkolivegreen:"85,107,47",darkorange:"255,140,0",darkorchid:"153,50,204",darkred:"139,0,0",darksalmon:"233,150,122",darkseagreen:"143,188,143",darkslateblue:"72,61,139",darkslategray:"47,79,79",darkturquoise:"0,206,209",darkviolet:"148,0,211",deeppink:"255,20,147",deepskyblue:"0,191,255",dimgray:"105,105,105",dimgrey:"105,105,105",dodgerblue:"30,144,255",firebrick:"178,34,34",floralwhite:"255,250,240",forestgreen:"34,139,34",fuchsia:"255,0,255",gainsboro:"220,220,220",ghostwhite:"248,248,255",gold:"255,215,0",goldenrod:"218,165,32",gray:"128,128,128",grey:"128,128,128",greenyellow:"173,255,47",green:"0,128,0",honeydew:"240,255,240",hotpink:"255,105,180",indianred:"205,92,92",indigo:"75,0,130",ivory:"255,255,240",khaki:"240,230,140",lavenderblush:"255,240,245",lavender:"230,230,250",lawngreen:"124,252,0",lemonchiffon:"255,250,205",lightblue:"173,216,230",lightcoral:"240,128,128",lightcyan:"224,255,255",lightgoldenrodyellow:"250,250,210",lightgray:"211,211,211",lightgrey:"211,211,211",lightgreen:"144,238,144",lightpink:"255,182,193",lightsalmon:"255,160,122",lightseagreen:"32,178,170",lightskyblue:"135,206,250",lightslategray:"119,136,153",lightsteelblue:"176,196,222",lightyellow:"255,255,224",limegreen:"50,205,50",lime:"0,255,0",linen:"250,240,230",magenta:"255,0,255",maroon:"128,0,0",mediumaquamarine:"102,205,170",mediumblue:"0,0,205",mediumorchid:"186,85,211",mediumpurple:"147,112,219",mediumseagreen:"60,179,113",mediumslateblue:"123,104,238",mediumspringgreen:"0,250,154",mediumturquoise:"72,209,204",mediumvioletred:"199,21,133",midnightblue:"25,25,112",mintcream:"245,255,250",mistyrose:"255,228,225",moccasin:"255,228,181",navajowhite:"255,222,173",navy:"0,0,128",oldlace:"253,245,230",olivedrab:"107,142,35",olive:"128,128,0",orangered:"255,69,0",orange:"255,165,0",orchid:"218,112,214",palegoldenrod:"238,232,170",palegreen:"152,251,152",paleturquoise:"175,238,238",palevioletred:"219,112,147",papayawhip:"255,239,213",peachpuff:"255,218,185",peru:"205,133,63",pink:"255,192,203",plum:"221,160,221",powderblue:"176,224,230",purple:"128,0,128",red:"255,0,0",rosybrown:"188,143,143",royalblue:"65,105,225",saddlebrown:"139,69,19",salmon:"250,128,114",sandybrown:"244,164,96",seagreen:"46,139,87",seashell:"255,245,238",sienna:"160,82,45",silver:"192,192,192",skyblue:"135,206,235",slateblue:"106,90,205",slategray:"112,128,144",snow:"255,250,250",springgreen:"0,255,127",steelblue:"70,130,180",tan:"210,180,140",teal:"0,128,128",thistle:"216,191,216",tomato:"255,99,71",turquoise:"64,224,208",violet:"238,130,238",wheat:"245,222,179",whitesmoke:"245,245,245",white:"255,255,255",yellowgreen:"154,205,50",yellow:"255,255,0"}},Hooks:{templates:{textShadow:["Color X Y Blur","black 0px 0px 0px"],boxShadow:["Color X Y Blur Spread","black 0px 0px 0px 0px"],clip:["Top Right Bottom Left","0px 0px 0px 0px"],backgroundPosition:["X Y","0% 0%"],transformOrigin:["X Y Z","50% 50% 0px"],perspectiveOrigin:["X Y","50% 50%"]},registered:{},register:function(){for(var e=0;e<b.Lists.colors.length;e++){var t="color"===b.Lists.colors[e]?"0 0 0 1":"255 255 255 1";b.Hooks.templates[b.Lists.colors[e]]=["Red Green Blue Alpha",t]}var o,n,r;if(s)for(o in b.Hooks.templates)if(b.Hooks.templates.hasOwnProperty(o)){r=(n=b.Hooks.templates[o])[0].split(" ");var i=n[1].match(b.RegEx.valueSplit);"Color"===r[0]&&(r.push(r.shift()),i.push(i.shift()),b.Hooks.templates[o]=[r.join(" "),i.join(" ")])}for(o in b.Hooks.templates)if(b.Hooks.templates.hasOwnProperty(o))for(var a in r=(n=b.Hooks.templates[o])[0].split(" "))if(r.hasOwnProperty(a)){var l=o+r[a],c=a;b.Hooks.registered[l]=[o,c]}},getRoot:function(e){var t=b.Hooks.registered[e];return t?t[0]:e},getUnit:function(e,t){var o=(e.substr(t||0,5).match(/^[a-z%]+/)||[])[0]||"";return o&&d(b.Lists.units)?o:""},fixColors:function(e){return e.replace(/(rgba?\(\s*)?(\b[a-z]+\b)/g,(function(e,t,o){return b.Lists.colorNames.hasOwnProperty(o)?(t||"rgba(")+b.Lists.colorNames[o]+(t?"":",1)"):t+o}))},cleanRootPropertyValue:function(e,t){return b.RegEx.valueUnwrap.test(t)&&(t=t.match(b.RegEx.valueUnwrap)[1]),b.Values.isCSSNullValue(t)&&(t=b.Hooks.templates[e][1]),t},extractValue:function(e,t){var o=b.Hooks.registered[e];if(o){var n=o[0],r=o[1];return(t=b.Hooks.cleanRootPropertyValue(n,t)).toString().match(b.RegEx.valueSplit)[r]}return t},injectValue:function(e,t,o){var n=b.Hooks.registered[e];if(n){var r,i=n[0],s=n[1];return(r=(o=b.Hooks.cleanRootPropertyValue(i,o)).toString().match(b.RegEx.valueSplit))[s]=t,r.join(" ")}return o}},Normalizations:{registered:{clip:function(e,t,o){switch(e){case"name":return"clip";case"extract":var n;return b.RegEx.wrappedValueAlreadyExtracted.test(o)?o:(n=o.toString().match(b.RegEx.valueUnwrap))?n[1].replace(/,(\s+)?/g," "):o;case"inject":return"rect("+o+")"}},blur:function(e,t,o){switch(e){case"name":return f.State.isFirefox?"filter":"-webkit-filter";case"extract":var n=parseFloat(o);if(!n&&0!==n){var r=o.toString().match(/blur\(([0-9]+[A-z]+)\)/i);n=r?r[1]:0}return n;case"inject":return parseFloat(o)?"blur("+o+")":"none"}},opacity:function(e,t,o){if(s<=8)switch(e){case"name":return"filter";case"extract":var n=o.toString().match(/alpha\(opacity=(.*)\)/i);return n?n[1]/100:1;case"inject":return t.style.zoom=1,parseFloat(o)>=1?"":"alpha(opacity="+parseInt(100*parseFloat(o),10)+")"}else switch(e){case"name":return"opacity";case"extract":case"inject":return o}}},register:function(){s&&!(s>9)||f.State.isGingerbread||(b.Lists.transformsBase=b.Lists.transformsBase.concat(b.Lists.transforms3D));for(var e=0;e<b.Lists.transformsBase.length;e++)!function(){var t=b.Lists.transformsBase[e];b.Normalizations.registered[t]=function(e,o,r){switch(e){case"name":return"transform";case"extract":return x(o)===n||x(o).transformCache[t]===n?/^scale/i.test(t)?1:0:x(o).transformCache[t].replace(/[()]/g,"");case"inject":var i=!1;switch(t.substr(0,t.length-1)){case"translate":i=!/(%|px|em|rem|vw|vh|\d)$/i.test(r);break;case"scal":case"scale":f.State.isAndroid&&x(o).transformCache[t]===n&&r<1&&(r=1),i=!/(\d)$/i.test(r);break;case"skew":case"rotate":i=!/(deg|\d)$/i.test(r)}return i||(x(o).transformCache[t]="("+r+")"),x(o).transformCache[t]}}}();for(var t=0;t<b.Lists.colors.length;t++)!function(){var e=b.Lists.colors[t];b.Normalizations.registered[e]=function(t,o,r){switch(t){case"name":return e;case"extract":var i;if(b.RegEx.wrappedValueAlreadyExtracted.test(r))i=r;else{var a,l={black:"rgb(0, 0, 0)",blue:"rgb(0, 0, 255)",gray:"rgb(128, 128, 128)",green:"rgb(0, 128, 0)",red:"rgb(255, 0, 0)",white:"rgb(255, 255, 255)"};/^[A-z]+$/i.test(r)?a=l[r]!==n?l[r]:l.black:b.RegEx.isHex.test(r)?a="rgb("+b.Values.hexToRgb(r).join(" ")+")":/^rgba?\(/i.test(r)||(a=l.black),i=(a||r).toString().match(b.RegEx.valueUnwrap)[1].replace(/,(\s+)?/g," ")}return(!s||s>8)&&3===i.split(" ").length&&(i+=" 1"),i;case"inject":return/^rgb/.test(r)?r:(s<=8?4===r.split(" ").length&&(r=r.split(/\s+/).slice(0,3).join(" ")):3===r.split(" ").length&&(r+=" 1"),(s<=8?"rgb":"rgba")+"("+r.replace(/\s+/g,",").replace(/\.(\d)+(?=,)/g,"")+")")}}}();function o(e,t,o){if("border-box"===b.getPropertyValue(t,"boxSizing").toString().toLowerCase()===(o||!1)){var n,r,i=0,s="width"===e?["Left","Right"]:["Top","Bottom"],a=["padding"+s[0],"padding"+s[1],"border"+s[0]+"Width","border"+s[1]+"Width"];for(n=0;n<a.length;n++)r=parseFloat(b.getPropertyValue(t,a[n])),isNaN(r)||(i+=r);return o?-i:i}return 0}function r(e,t){return function(n,r,i){switch(n){case"name":return e;case"extract":return parseFloat(i)+o(e,r,t);case"inject":return parseFloat(i)-o(e,r,t)+"px"}}}b.Normalizations.registered.innerWidth=r("width",!0),b.Normalizations.registered.innerHeight=r("height",!0),b.Normalizations.registered.outerWidth=r("width"),b.Normalizations.registered.outerHeight=r("height")}},Names:{camelCase:function(e){return e.replace(/-(\w)/g,(function(e,t){return t.toUpperCase()}))},SVGAttribute:function(e){var t="width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";return(s||f.State.isAndroid&&!f.State.isChrome)&&(t+="|transform"),new RegExp("^("+t+")$","i").test(e)},prefixCheck:function(e){if(f.State.prefixMatches[e])return[f.State.prefixMatches[e],!0];for(var t=["","Webkit","Moz","ms","O"],o=0,n=t.length;o<n;o++){var r;if(r=0===o?e:t[o]+e.replace(/^\w/,(function(e){return e.toUpperCase()})),m.isString(f.State.prefixElement.style[r]))return f.State.prefixMatches[e]=r,[r,!0]}return[e,!1]}},Values:{hexToRgb:function(e){var t;return e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,o,n){return t+t+o+o+n+n})),(t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e))?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:[0,0,0]},isCSSNullValue:function(e){return!e||/^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(e)},getUnitType:function(e){return/^(rotate|skew)/i.test(e)?"deg":/(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(e)?"":"px"},getDisplayType:function(e){var t=e&&e.tagName.toString().toLowerCase();return/^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|var|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i.test(t)?"inline":/^(li)$/i.test(t)?"list-item":/^(tr)$/i.test(t)?"table-row":/^(table)$/i.test(t)?"table":/^(tbody)$/i.test(t)?"table-row-group":"block"},addClass:function(e,t){if(e)if(e.classList)e.classList.add(t);else if(m.isString(e.className))e.className+=(e.className.length?" ":"")+t;else{var o=e.getAttribute(s<=7?"className":"class")||"";e.setAttribute("class",o+(o?" ":"")+t)}},removeClass:function(e,t){if(e)if(e.classList)e.classList.remove(t);else if(m.isString(e.className))e.className=e.className.toString().replace(new RegExp("(^|\\s)"+t.split(" ").join("|")+"(\\s|$)","gi")," ");else{var o=e.getAttribute(s<=7?"className":"class")||"";e.setAttribute("class",o.replace(new RegExp("(^|s)"+t.split(" ").join("|")+"(s|$)","gi")," "))}}},getPropertyValue:function(e,o,r,i){function a(e,o){var r=0;if(s<=8)r=h.css(e,o);else{var l=!1;/^(width|height)$/.test(o)&&0===b.getPropertyValue(e,"display")&&(l=!0,b.setPropertyValue(e,"display",b.Values.getDisplayType(e)));var c,d=function(){l&&b.setPropertyValue(e,"display","none")};if(!i){if("height"===o&&"border-box"!==b.getPropertyValue(e,"boxSizing").toString().toLowerCase()){var u=e.offsetHeight-(parseFloat(b.getPropertyValue(e,"borderTopWidth"))||0)-(parseFloat(b.getPropertyValue(e,"borderBottomWidth"))||0)-(parseFloat(b.getPropertyValue(e,"paddingTop"))||0)-(parseFloat(b.getPropertyValue(e,"paddingBottom"))||0);return d(),u}if("width"===o&&"border-box"!==b.getPropertyValue(e,"boxSizing").toString().toLowerCase()){var m=e.offsetWidth-(parseFloat(b.getPropertyValue(e,"borderLeftWidth"))||0)-(parseFloat(b.getPropertyValue(e,"borderRightWidth"))||0)-(parseFloat(b.getPropertyValue(e,"paddingLeft"))||0)-(parseFloat(b.getPropertyValue(e,"paddingRight"))||0);return d(),m}}c=x(e)===n?t.getComputedStyle(e,null):x(e).computedStyle?x(e).computedStyle:x(e).computedStyle=t.getComputedStyle(e,null),"borderColor"===o&&(o="borderTopColor"),""!==(r=9===s&&"filter"===o?c.getPropertyValue(o):c[o])&&null!==r||(r=e.style[o]),d()}if("auto"===r&&/^(top|right|bottom|left)$/i.test(o)){var p=a(e,"position");("fixed"===p||"absolute"===p&&/top|left/i.test(o))&&(r=h(e).position()[o]+"px")}return r}var l;if(b.Hooks.registered[o]){var c=o,d=b.Hooks.getRoot(c);r===n&&(r=b.getPropertyValue(e,b.Names.prefixCheck(d)[0])),b.Normalizations.registered[d]&&(r=b.Normalizations.registered[d]("extract",e,r)),l=b.Hooks.extractValue(c,r)}else if(b.Normalizations.registered[o]){var u,m;"transform"!==(u=b.Normalizations.registered[o]("name",e))&&(m=a(e,b.Names.prefixCheck(u)[0]),b.Values.isCSSNullValue(m)&&b.Hooks.templates[o]&&(m=b.Hooks.templates[o][1])),l=b.Normalizations.registered[o]("extract",e,m)}if(!/^[\d-]/.test(l)){var p=x(e);if(p&&p.isSVG&&b.Names.SVGAttribute(o))if(/^(height|width)$/i.test(o))try{l=e.getBBox()[o]}catch(e){l=0}else l=e.getAttribute(o);else l=a(e,b.Names.prefixCheck(o)[0])}return b.Values.isCSSNullValue(l)&&(l=0),f.debug>=2&&console.log("Get "+o+": "+l),l},setPropertyValue:function(e,o,n,r,i){var a=o;if("scroll"===o)i.container?i.container["scroll"+i.direction]=n:"Left"===i.direction?t.scrollTo(n,i.alternateValue):t.scrollTo(i.alternateValue,n);else if(b.Normalizations.registered[o]&&"transform"===b.Normalizations.registered[o]("name",e))b.Normalizations.registered[o]("inject",e,n),a="transform",n=x(e).transformCache[o];else{if(b.Hooks.registered[o]){var l=o,c=b.Hooks.getRoot(o);r=r||b.getPropertyValue(e,c),n=b.Hooks.injectValue(l,n,r),o=c}if(b.Normalizations.registered[o]&&(n=b.Normalizations.registered[o]("inject",e,n),o=b.Normalizations.registered[o]("name",e)),a=b.Names.prefixCheck(o)[0],s<=8)try{e.style[a]=n}catch(e){f.debug&&console.log("Browser does not support ["+n+"] for ["+a+"]")}else{var d=x(e);d&&d.isSVG&&b.Names.SVGAttribute(o)?e.setAttribute(o,n):e.style[a]=n}f.debug>=2&&console.log("Set "+o+" ("+a+"): "+n)}return[a,n]},flushTransformCache:function(e){var t="",o=x(e);if((s||f.State.isAndroid&&!f.State.isChrome)&&o&&o.isSVG){var n=function(t){return parseFloat(b.getPropertyValue(e,t))},r={translate:[n("translateX"),n("translateY")],skewX:[n("skewX")],skewY:[n("skewY")],scale:1!==n("scale")?[n("scale"),n("scale")]:[n("scaleX"),n("scaleY")],rotate:[n("rotateZ"),0,0]};h.each(x(e).transformCache,(function(e){/^translate/i.test(e)?e="translate":/^scale/i.test(e)?e="scale":/^rotate/i.test(e)&&(e="rotate"),r[e]&&(t+=e+"("+r[e].join(" ")+") ",delete r[e])}))}else{var i,a;h.each(x(e).transformCache,(function(o){if(i=x(e).transformCache[o],"transformPerspective"===o)return a=i,!0;9===s&&"rotateZ"===o&&(o="rotate"),t+=o+i+" "})),a&&(t="perspective"+a+" "+t)}b.setPropertyValue(e,"transform",t)}};b.Hooks.register(),b.Normalizations.register(),f.hook=function(e,t,o){var r;return e=u(e),h.each(e,(function(e,i){if(x(i)===n&&f.init(i),o===n)r===n&&(r=b.getPropertyValue(i,t));else{var s=b.setPropertyValue(i,t,o);"transform"===s[0]&&f.CSS.flushTransformCache(i),r=s}})),r};var y=function(){var e;function r(){return i?v.promise||null:s}var i,s,a,l,c,p,g=arguments[0]&&(arguments[0].p||h.isPlainObject(arguments[0].properties)&&!arguments[0].properties.names||m.isString(arguments[0].properties));m.isWrapped(this)?(i=!1,a=0,l=this,s=this):(i=!0,a=1,l=g?arguments[0].elements||arguments[0].e:arguments[0]);var v={promise:null,resolver:null,rejecter:null};if(i&&f.Promise&&(v.promise=new f.Promise((function(e,t){v.resolver=e,v.rejecter=t}))),g?(c=arguments[0].properties||arguments[0].p,p=arguments[0].options||arguments[0].o):(c=arguments[a],p=arguments[a+1]),l=u(l)){var w,_=l.length,S=0;if(!/^(stop|finish|finishAll|pause|resume)$/i.test(c)&&!h.isPlainObject(p)){p={};for(var T=a+1;T<arguments.length;T++)m.isArray(arguments[T])||!/^(fast|normal|slow)$/i.test(arguments[T])&&!/^\d/.test(arguments[T])?m.isString(arguments[T])||m.isArray(arguments[T])?p.easing=arguments[T]:m.isFunction(arguments[T])&&(p.complete=arguments[T]):p.duration=arguments[T]}switch(c){case"scroll":w="scroll";break;case"reverse":w="reverse";break;case"pause":var M=(new Date).getTime();return h.each(l,(function(e,t){C(t,M)})),h.each(f.State.calls,(function(e,t){var o=!1;t&&h.each(t[1],(function(e,r){var i=p===n?"":p;return!0!==i&&t[2].queue!==i&&(p!==n||!1!==t[2].queue)||(h.each(l,(function(e,n){if(n===r)return t[5]={resume:!1},o=!0,!1})),!o&&void 0)}))})),r();case"resume":return h.each(l,(function(e,t){k(t)})),h.each(f.State.calls,(function(e,t){var o=!1;t&&h.each(t[1],(function(e,r){var i=p===n?"":p;return!0!==i&&t[2].queue!==i&&(p!==n||!1!==t[2].queue)||!t[5]||(h.each(l,(function(e,n){if(n===r)return t[5].resume=!0,o=!0,!1})),!o&&void 0)}))})),r();case"finish":case"finishAll":case"stop":h.each(l,(function(e,t){x(t)&&x(t).delayTimer&&(clearTimeout(x(t).delayTimer.setTimeout),x(t).delayTimer.next&&x(t).delayTimer.next(),delete x(t).delayTimer),"finishAll"!==c||!0!==p&&!m.isString(p)||(h.each(h.queue(t,m.isString(p)?p:""),(function(e,t){m.isFunction(t)&&t()})),h.queue(t,m.isString(p)?p:"",[]))}));var B=[];return h.each(f.State.calls,(function(e,t){t&&h.each(t[1],(function(o,r){var i=p===n?"":p;if(!0!==i&&t[2].queue!==i&&(p!==n||!1!==t[2].queue))return!0;h.each(l,(function(o,n){if(n===r)if((!0===p||m.isString(p))&&(h.each(h.queue(n,m.isString(p)?p:""),(function(e,t){m.isFunction(t)&&t(null,!0)})),h.queue(n,m.isString(p)?p:"",[])),"stop"===c){var s=x(n);s&&s.tweensContainer&&(!0===i||""===i)&&h.each(s.tweensContainer,(function(e,t){t.endValue=t.currentValue})),B.push(e)}else"finish"!==c&&"finishAll"!==c||(t[2].duration=1)}))}))})),"stop"===c&&(h.each(B,(function(e,t){A(t,!0)})),v.promise&&v.resolver(l)),r();default:if(!h.isPlainObject(c)||m.isEmptyObject(c)){if(m.isString(c)&&f.Redirects[c]){var P=(e=h.extend({},p)).duration,R=e.delay||0;return!0===e.backwards&&(l=h.extend(!0,[],l).reverse()),h.each(l,(function(t,o){parseFloat(e.stagger)?e.delay=R+parseFloat(e.stagger)*t:m.isFunction(e.stagger)&&(e.delay=R+e.stagger.call(o,t,_)),e.drag&&(e.duration=parseFloat(P)||(/^(callout|transition)/.test(c)?1e3:400),e.duration=Math.max(e.duration*(e.backwards?1-t/_:(t+1)/_),.75*e.duration,200)),f.Redirects[c].call(o,o,e||{},t,_,l,v.promise?v:n)})),r()}var V="Velocity: First argument ("+c+") was not a property map, a known action, or a registered redirect. Aborting.";return v.promise?v.rejecter(new Error(V)):t.console&&console.log(V),r()}w="start"}var N={lastParent:null,lastPosition:null,lastFontSize:null,lastPercentToPxWidth:null,lastPercentToPxHeight:null,lastEmToPx:null,remToPx:null,vwToPx:null,vhToPx:null},D=[];h.each(l,(function(e,r){m.isNode(r)&&function(e,r){var i,s,a=h.extend({},f.defaults,p),u={};switch(x(e)===n&&f.init(e),parseFloat(a.delay)&&!1!==a.queue&&h.queue(e,a.queue,(function(t,o){if(!0===o)return!0;f.velocityQueueEntryFlag=!0;var n=f.State.delayedElements.count++;f.State.delayedElements[n]=e;var r,i=(r=n,function(){f.State.delayedElements[r]=!1,t()});x(e).delayBegin=(new Date).getTime(),x(e).delay=parseFloat(a.delay),x(e).delayTimer={setTimeout:setTimeout(t,parseFloat(a.delay)),next:i}})),a.duration.toString().toLowerCase()){case"fast":a.duration=200;break;case"normal":a.duration=400;break;case"slow":a.duration=600;break;default:a.duration=parseFloat(a.duration)||1}function g(s){var g,y;if(a.begin&&0===S)try{a.begin.call(l,l)}catch(e){setTimeout((function(){throw e}),1)}if("scroll"===w){var C,k,T,A=/^x$/i.test(a.axis)?"Left":"Top",M=parseFloat(a.offset)||0;a.container?m.isWrapped(a.container)||m.isNode(a.container)?(a.container=a.container[0]||a.container,T=(C=a.container["scroll"+A])+h(e).position()[A.toLowerCase()]+M):a.container=null:(C=f.State.scrollAnchor[f.State["scrollProperty"+A]],k=f.State.scrollAnchor[f.State["scrollProperty"+("Left"===A?"Top":"Left")]],T=h(e).offset()[A.toLowerCase()]+M),u={scroll:{rootPropertyValue:!1,startValue:C,currentValue:C,endValue:T,unitType:"",easing:a.easing,scrollData:{container:a.container,direction:A,alternateValue:k}},element:e},f.debug&&console.log("tweensContainer (scroll): ",u.scroll,e)}else if("reverse"===w){if(!(g=x(e)))return;if(!g.tweensContainer)return void h.dequeue(e,a.queue);for(var B in"none"===g.opts.display&&(g.opts.display="auto"),"hidden"===g.opts.visibility&&(g.opts.visibility="visible"),g.opts.loop=!1,g.opts.begin=null,g.opts.complete=null,p.easing||delete a.easing,p.duration||delete a.duration,a=h.extend({},g.opts,a),y=h.extend(!0,{},g?g.tweensContainer:null))if(y.hasOwnProperty(B)&&"element"!==B){var P=y[B].startValue;y[B].startValue=y[B].currentValue=y[B].endValue,y[B].endValue=P,m.isEmptyObject(p)||(y[B].easing=a.easing),f.debug&&console.log("reverse tweensContainer ("+B+"): "+JSON.stringify(y[B]),e)}u=y}else if("start"===w){(g=x(e))&&g.tweensContainer&&!0===g.isAnimating&&(y=g.tweensContainer);var R=function(t,o){var n,i,s;return m.isFunction(t)&&(t=t.call(e,r,_)),m.isArray(t)?(n=t[0],!m.isArray(t[1])&&/^[\d-]/.test(t[1])||m.isFunction(t[1])||b.RegEx.isHex.test(t[1])?s=t[1]:m.isString(t[1])&&!b.RegEx.isHex.test(t[1])&&f.Easings[t[1]]||m.isArray(t[1])?(i=o?t[1]:E(t[1],a.duration),s=t[2]):s=t[1]||t[2]):n=t,o||(i=i||a.easing),m.isFunction(n)&&(n=n.call(e,r,_)),m.isFunction(s)&&(s=s.call(e,r,_)),[n||0,i,s]},V=function(r,s){var l,c=b.Hooks.getRoot(r),d=!1,p=s[0],v=s[1],w=s[2];if(g&&g.isSVG||"tween"===c||!1!==b.Names.prefixCheck(c)[1]||b.Normalizations.registered[c]!==n){(a.display!==n&&null!==a.display&&"none"!==a.display||a.visibility!==n&&"hidden"!==a.visibility)&&/opacity|filter/.test(r)&&!w&&0!==p&&(w=0),a._cacheValues&&y&&y[r]?(w===n&&(w=y[r].endValue+y[r].unitType),d=g.rootPropertyValueCache[c]):b.Hooks.registered[r]?w===n?(d=b.getPropertyValue(e,c),w=b.getPropertyValue(e,r,d)):d=b.Hooks.templates[c][1]:w===n&&(w=b.getPropertyValue(e,r));var _,x,C,k=!1,S=function(e,t){var o,n;return n=(t||"0").toString().toLowerCase().replace(/[%A-z]+$/,(function(e){return o=e,""})),o||(o=b.Values.getUnitType(e)),[n,o]};if(w!==p&&m.isString(w)&&m.isString(p)){l="";var T=0,E=0,O=[],A=[],M=0,B=0,P=0;for(w=b.Hooks.fixColors(w),p=b.Hooks.fixColors(p);T<w.length&&E<p.length;){var R=w[T],V=p[E];if(/[\d\.-]/.test(R)&&/[\d\.-]/.test(V)){for(var D=R,F=V,I=".",L=".";++T<w.length;){if((R=w[T])===I)I="..";else if(!/\d/.test(R))break;D+=R}for(;++E<p.length;){if((V=p[E])===L)L="..";else if(!/\d/.test(V))break;F+=V}var z=b.Hooks.getUnit(w,T),H=b.Hooks.getUnit(p,E);if(T+=z.length,E+=H.length,z===H)D===F?l+=D+z:(l+="{"+O.length+(B?"!":"")+"}"+z,O.push(parseFloat(D)),A.push(parseFloat(F)));else{var Z=parseFloat(D),j=parseFloat(F);l+=(M<5?"calc":"")+"("+(Z?"{"+O.length+(B?"!":"")+"}":"0")+z+" + "+(j?"{"+(O.length+(Z?1:0))+(B?"!":"")+"}":"0")+H+")",Z&&(O.push(Z),A.push(0)),j&&(O.push(0),A.push(j))}}else{if(R!==V){M=0;break}l+=R,T++,E++,0===M&&"c"===R||1===M&&"a"===R||2===M&&"l"===R||3===M&&"c"===R||M>=4&&"("===R?M++:(M&&M<5||M>=4&&")"===R&&--M<5)&&(M=0),0===B&&"r"===R||1===B&&"g"===R||2===B&&"b"===R||3===B&&"a"===R||B>=3&&"("===R?(3===B&&"a"===R&&(P=1),B++):P&&","===R?++P>3&&(B=P=0):(P&&B<(P?5:4)||B>=(P?4:3)&&")"===R&&--B<(P?5:4))&&(B=P=0)}}T===w.length&&E===p.length||(f.debug&&console.error('Trying to pattern match mis-matched strings ["'+p+'", "'+w+'"]'),l=n),l&&(O.length?(f.debug&&console.log('Pattern found "'+l+'" -> ',O,A,"["+w+","+p+"]"),w=O,p=A,x=C=""):l=n)}if(l||(w=(_=S(r,w))[0],C=_[1],p=(_=S(r,p))[0].replace(/^([+-\/*])=/,(function(e,t){return k=t,""})),x=_[1],w=parseFloat(w)||0,p=parseFloat(p)||0,"%"===x&&(/^(fontSize|lineHeight)$/.test(r)?(p/=100,x="em"):/^scale/.test(r)?(p/=100,x=""):/(Red|Green|Blue)$/i.test(r)&&(p=p/100*255,x=""))),/[\/*]/.test(k))x=C;else if(C!==x&&0!==w)if(0===p)x=C;else{i=i||function(){var n={myParent:e.parentNode||o.body,position:b.getPropertyValue(e,"position"),fontSize:b.getPropertyValue(e,"fontSize")},r=n.position===N.lastPosition&&n.myParent===N.lastParent,i=n.fontSize===N.lastFontSize;N.lastParent=n.myParent,N.lastPosition=n.position,N.lastFontSize=n.fontSize;var s=100,a={};if(i&&r)a.emToPx=N.lastEmToPx,a.percentToPxWidth=N.lastPercentToPxWidth,a.percentToPxHeight=N.lastPercentToPxHeight;else{var l=g&&g.isSVG?o.createElementNS("http://www.w3.org/2000/svg","rect"):o.createElement("div");f.init(l),n.myParent.appendChild(l),h.each(["overflow","overflowX","overflowY"],(function(e,t){f.CSS.setPropertyValue(l,t,"hidden")})),f.CSS.setPropertyValue(l,"position",n.position),f.CSS.setPropertyValue(l,"fontSize",n.fontSize),f.CSS.setPropertyValue(l,"boxSizing","content-box"),h.each(["minWidth","maxWidth","width","minHeight","maxHeight","height"],(function(e,t){f.CSS.setPropertyValue(l,t,s+"%")})),f.CSS.setPropertyValue(l,"paddingLeft",s+"em"),a.percentToPxWidth=N.lastPercentToPxWidth=(parseFloat(b.getPropertyValue(l,"width",null,!0))||1)/s,a.percentToPxHeight=N.lastPercentToPxHeight=(parseFloat(b.getPropertyValue(l,"height",null,!0))||1)/s,a.emToPx=N.lastEmToPx=(parseFloat(b.getPropertyValue(l,"paddingLeft"))||1)/s,n.myParent.removeChild(l)}return null===N.remToPx&&(N.remToPx=parseFloat(b.getPropertyValue(o.body,"fontSize"))||16),null===N.vwToPx&&(N.vwToPx=parseFloat(t.innerWidth)/100,N.vhToPx=parseFloat(t.innerHeight)/100),a.remToPx=N.remToPx,a.vwToPx=N.vwToPx,a.vhToPx=N.vhToPx,f.debug>=1&&console.log("Unit ratios: "+JSON.stringify(a),e),a}();var U=/margin|padding|left|right|width|text|word|letter/i.test(r)||/X$/.test(r)||"x"===r?"x":"y";switch(C){case"%":w*="x"===U?i.percentToPxWidth:i.percentToPxHeight;break;case"px":break;default:w*=i[C+"ToPx"]}switch(x){case"%":w*=1/("x"===U?i.percentToPxWidth:i.percentToPxHeight);break;case"px":break;default:w*=1/i[x+"ToPx"]}}switch(k){case"+":p=w+p;break;case"-":p=w-p;break;case"*":p*=w;break;case"/":p=w/p}u[r]={rootPropertyValue:d,startValue:w,currentValue:w,endValue:p,unitType:x,easing:v},l&&(u[r].pattern=l),f.debug&&console.log("tweensContainer ("+r+"): "+JSON.stringify(u[r]),e)}else f.debug&&console.log("Skipping ["+c+"] due to a lack of browser support.")};for(var F in c)if(c.hasOwnProperty(F)){var I=b.Names.camelCase(F),L=R(c[F]);if(d(b.Lists.colors)){var z=L[0],H=L[1],Z=L[2];if(b.RegEx.isHex.test(z)){for(var j=["Red","Green","Blue"],U=b.Values.hexToRgb(z),$=Z?b.Values.hexToRgb(Z):n,W=0;W<j.length;W++){var q=[U[W]];H&&q.push(H),$!==n&&q.push($[W]),V(I+j[W],q)}continue}}V(I,L)}u.element=e}u.element&&(b.Values.addClass(e,"velocity-animating"),D.push(u),(g=x(e))&&(""===a.queue&&(g.tweensContainer=u,g.opts=a),g.isAnimating=!0),S===_-1?(f.State.calls.push([D,l,a,null,v.resolver,null,0]),!1===f.State.isTicking&&(f.State.isTicking=!0,O())):S++)}if(!1!==f.mock&&(!0===f.mock?a.duration=a.delay=1:(a.duration*=parseFloat(f.mock)||1,a.delay*=parseFloat(f.mock)||1)),a.easing=E(a.easing,a.duration),a.begin&&!m.isFunction(a.begin)&&(a.begin=null),a.progress&&!m.isFunction(a.progress)&&(a.progress=null),a.complete&&!m.isFunction(a.complete)&&(a.complete=null),a.display!==n&&null!==a.display&&(a.display=a.display.toString().toLowerCase(),"auto"===a.display&&(a.display=f.CSS.Values.getDisplayType(e))),a.visibility!==n&&null!==a.visibility&&(a.visibility=a.visibility.toString().toLowerCase()),a.mobileHA=a.mobileHA&&f.State.isMobile&&!f.State.isGingerbread,!1===a.queue)if(a.delay){var y=f.State.delayedElements.count++;f.State.delayedElements[y]=e;var C=(s=y,function(){f.State.delayedElements[s]=!1,g()});x(e).delayBegin=(new Date).getTime(),x(e).delay=parseFloat(a.delay),x(e).delayTimer={setTimeout:setTimeout(g,parseFloat(a.delay)),next:C}}else g();else h.queue(e,a.queue,(function(e,t){if(!0===t)return v.promise&&v.resolver(l),!0;f.velocityQueueEntryFlag=!0,g()}));""!==a.queue&&"fx"!==a.queue||"inprogress"===h.queue(e)[0]||h.dequeue(e)}(r,e)})),(e=h.extend({},f.defaults,p)).loop=parseInt(e.loop,10);var F=2*e.loop-1;if(e.loop)for(var I=0;I<F;I++){var L={delay:e.delay,progress:e.progress};I===F-1&&(L.display=e.display,L.visibility=e.visibility,L.complete=e.complete),y(l,"reverse",L)}return r()}v.promise&&(c&&p&&!1===p.promiseRejectEmpty?v.resolver():v.rejecter())};(f=h.extend(y,f)).animate=y;var w=t.requestAnimationFrame||a;if(!f.State.isMobile&&o.hidden!==n){var _=function(){o.hidden?(w=function(e){return setTimeout((function(){e(!0)}),16)},O()):w=t.requestAnimationFrame||a};_(),o.addEventListener("visibilitychange",_)}return e.Velocity=f,e!==t&&(e.fn.velocity=y,e.fn.velocity.defaults=f.defaults),h.each(["Down","Up"],(function(e,t){f.Redirects["slide"+t]=function(e,o,r,i,s,a){var l=h.extend({},o),c=l.begin,d=l.complete,u={},m={height:"",marginTop:"",marginBottom:"",paddingTop:"",paddingBottom:""};l.display===n&&(l.display="Down"===t?"inline"===f.CSS.Values.getDisplayType(e)?"inline-block":"block":"none"),l.begin=function(){for(var o in 0===r&&c&&c.call(s,s),m)if(m.hasOwnProperty(o)){u[o]=e.style[o];var n=b.getPropertyValue(e,o);m[o]="Down"===t?[n,0]:[0,n]}u.overflow=e.style.overflow,e.style.overflow="hidden"},l.complete=function(){for(var t in u)u.hasOwnProperty(t)&&(e.style[t]=u[t]);r===i-1&&(d&&d.call(s,s),a&&a.resolver(s))},f(e,m,l)}})),h.each(["In","Out"],(function(e,t){f.Redirects["fade"+t]=function(e,o,r,i,s,a){var l=h.extend({},o),c=l.complete,d={opacity:"In"===t?1:0};0!==r&&(l.begin=null),l.complete=r!==i-1?null:function(){c&&c.call(s,s),a&&a.resolver(s)},l.display===n&&(l.display="In"===t?"auto":"none"),f(this,d,l)}})),f}function x(e){var t=h.data(e,"velocity");return null===t?n:t}function C(e,t){var o=x(e);o&&o.delayTimer&&!o.delayPaused&&(o.delayRemaining=o.delay-t+o.delayBegin,o.delayPaused=!0,clearTimeout(o.delayTimer.setTimeout))}function k(e,t){var o=x(e);o&&o.delayTimer&&o.delayPaused&&(o.delayPaused=!1,o.delayTimer.setTimeout=setTimeout(o.delayTimer.next,o.delayRemaining))}function S(e){return function(t){return Math.round(t*e)*(1/e)}}function T(e,o,n,r){var i=.1,s="Float32Array"in t;if(4!==arguments.length)return!1;for(var a=0;a<4;++a)if("number"!=typeof arguments[a]||isNaN(arguments[a])||!isFinite(arguments[a]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var l=s?new Float32Array(11):new Array(11);function c(e,t){return 1-3*t+3*e}function d(e,t){return 3*t-6*e}function u(e){return 3*e}function h(e,t,o){return((c(t,o)*e+d(t,o))*e+u(t))*e}function m(e,t,o){return 3*c(t,o)*e*e+2*d(t,o)*e+u(t)}var p=!1;var g=function(t){return p||(p=!0,e===o&&n===r||function(){for(var t=0;t<11;++t)l[t]=h(t*i,e,n)}()),e===o&&n===r?t:0===t?0:1===t?1:h(function(t){for(var o=0,r=1;10!==r&&l[r]<=t;++r)o+=i;--r;var s=o+(t-l[r])/(l[r+1]-l[r])*i,a=m(s,e,n);return a>=.001?function(t,o){for(var r=0;r<4;++r){var i=m(o,e,n);if(0===i)return o;o-=(h(o,e,n)-t)/i}return o}(t,s):0===a?s:function(t,o,r){var i,s,a=0;do{(i=h(s=o+(r-o)/2,e,n)-t)>0?r=s:o=s}while(Math.abs(i)>1e-7&&++a<10);return s}(t,o,o+i)}(t),o,r)};g.getControlPoints=function(){return[{x:e,y:o},{x:n,y:r}]};var f="generateBezier("+[e,o,n,r]+")";return g.toString=function(){return f},g}function E(e,t){var o=e;return m.isString(e)?f.Easings[e]||(o=!1):o=m.isArray(e)&&1===e.length?S.apply(null,e):m.isArray(e)&&2===e.length?v.apply(null,e.concat([t])):!(!m.isArray(e)||4!==e.length)&&T.apply(null,e),!1===o&&(o=f.Easings[f.defaults.easing]?f.defaults.easing:g),o}function O(e){if(e){var t=f.timestamp&&!0!==e?e:l.now(),o=f.State.calls.length;o>1e4&&(f.State.calls=function(e){for(var t=-1,o=e?e.length:0,n=[];++t<o;){var r=e[t];r&&n.push(r)}return n}(f.State.calls),o=f.State.calls.length);for(var r=0;r<o;r++)if(f.State.calls[r]){var i=f.State.calls[r],a=i[0],c=i[2],d=i[3],u=!d,p=null,g=i[5],v=i[6];if(d||(d=f.State.calls[r][3]=t-16),g){if(!0!==g.resume)continue;d=i[3]=Math.round(t-v-16),i[5]=null}v=i[6]=t-d;for(var y=Math.min(v/c.duration,1),_=0,C=a.length;_<C;_++){var k=a[_],S=k.element;if(x(S)){var T=!1;for(var E in c.display!==n&&null!==c.display&&"none"!==c.display&&("flex"===c.display&&h.each(["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex"],(function(e,t){b.setPropertyValue(S,"display",t)})),b.setPropertyValue(S,"display",c.display)),c.visibility!==n&&"hidden"!==c.visibility&&b.setPropertyValue(S,"visibility",c.visibility),k)if(k.hasOwnProperty(E)&&"element"!==E){var M,B=k[E],P=m.isString(B.easing)?f.Easings[B.easing]:B.easing;if(m.isString(B.pattern)){var R=1===y?function(e,t,o){var n=B.endValue[t];return o?Math.round(n):n}:function(e,t,o){var n=B.startValue[t],r=B.endValue[t]-n,i=n+r*P(y,c,r);return o?Math.round(i):i};M=B.pattern.replace(/{(\d+)(!)?}/g,R)}else if(1===y)M=B.endValue;else{var V=B.endValue-B.startValue;M=B.startValue+V*P(y,c,V)}if(!u&&M===B.currentValue)continue;if(B.currentValue=M,"tween"===E)p=M;else{var N;if(b.Hooks.registered[E]){N=b.Hooks.getRoot(E);var D=x(S).rootPropertyValueCache[N];D&&(B.rootPropertyValue=D)}var F=b.setPropertyValue(S,E,B.currentValue+(s<9&&0===parseFloat(M)?"":B.unitType),B.rootPropertyValue,B.scrollData);b.Hooks.registered[E]&&(b.Normalizations.registered[N]?x(S).rootPropertyValueCache[N]=b.Normalizations.registered[N]("extract",null,F[1]):x(S).rootPropertyValueCache[N]=F[1]),"transform"===F[0]&&(T=!0)}}c.mobileHA&&x(S).transformCache.translate3d===n&&(x(S).transformCache.translate3d="(0px, 0px, 0px)",T=!0),T&&b.flushTransformCache(S)}}c.display!==n&&"none"!==c.display&&(f.State.calls[r][2].display=!1),c.visibility!==n&&"hidden"!==c.visibility&&(f.State.calls[r][2].visibility=!1),c.progress&&c.progress.call(i[1],i[1],y,Math.max(0,d+c.duration-t),d,p),1===y&&A(r)}}f.State.isTicking&&w(O)}function A(e,t){if(!f.State.calls[e])return!1;for(var o=f.State.calls[e][0],r=f.State.calls[e][1],i=f.State.calls[e][2],s=f.State.calls[e][4],a=!1,l=0,c=o.length;l<c;l++){var d=o[l].element;t||i.loop||("none"===i.display&&b.setPropertyValue(d,"display",i.display),"hidden"===i.visibility&&b.setPropertyValue(d,"visibility",i.visibility));var u=x(d);if(!0!==i.loop&&(h.queue(d)[1]===n||!/\.velocityQueueEntryFlag/i.test(h.queue(d)[1]))&&u){u.isAnimating=!1,u.rootPropertyValueCache={};var m=!1;h.each(b.Lists.transforms3D,(function(e,t){var o=/^scale/.test(t)?1:0,r=u.transformCache[t];u.transformCache[t]!==n&&new RegExp("^\\("+o+"[^.]").test(r)&&(m=!0,delete u.transformCache[t])})),i.mobileHA&&(m=!0,delete u.transformCache.translate3d),m&&b.flushTransformCache(d),b.Values.removeClass(d,"velocity-animating")}if(!t&&i.complete&&!i.loop&&l===c-1)try{i.complete.call(r,r)}catch(e){setTimeout((function(){throw e}),1)}s&&!0!==i.loop&&s(r),u&&!0===i.loop&&!t&&(h.each(u.tweensContainer,(function(e,t){if(/^rotate/.test(e)&&(parseFloat(t.startValue)-parseFloat(t.endValue))%360==0){var o=t.startValue;t.startValue=t.endValue,t.endValue=o}/^backgroundPosition/.test(e)&&100===parseFloat(t.endValue)&&"%"===t.unitType&&(t.endValue=0,t.startValue=100)})),f(d,"reverse",{loop:!0,delay:i.delay})),!1!==i.queue&&h.dequeue(d,i.queue)}f.State.calls[e]=!1;for(var p=0,g=f.State.calls.length;p<g;p++)if(!1!==f.State.calls[p]){a=!0;break}!1===a&&(f.State.isTicking=!1,delete f.State.calls,f.State.calls=[])}i().fn.velocity=i().fn.animate}(window.jQuery||window.Zepto||window,window,window?window.document:void 0)},"object"==typeof e.exports?e.exports=n():"function"==typeof define&&o.amdO?define(n):n()},36098:(e,t)=>{!function(o){"use strict";if(o){var n,r,i,s=(i=o.document.createTextNode("")).ownerDocument!==o.document&&"function"==typeof o.wrap&&o.wrap(i)===i?o.wrap(o):o,a=s.document,l=s.DocumentFragment||W,c=s.SVGElement||W,d=s.SVGSVGElement||W,u=s.SVGElementInstance||W,h=s.HTMLElement||s.Element,m=s.PointerEvent||s.MSPointerEvent,p=Math.hypot||function(e,t){return Math.sqrt(e*e+t*t)},g={},f=[],v=[],b=[],y=!1,w={},_={base:{accept:null,actionChecker:null,styleCursor:!0,preventDefault:"auto",origin:{x:0,y:0},deltaSource:"page",allowFrom:null,ignoreFrom:null,_context:a,dropChecker:null},drag:{enabled:!1,manualStart:!0,max:1/0,maxPerElement:1,snap:null,restrict:null,inertia:null,autoScroll:null,axis:"xy"},drop:{enabled:!1,accept:null,overlap:"pointer"},resize:{enabled:!1,manualStart:!1,max:1/0,maxPerElement:1,snap:null,restrict:null,inertia:null,autoScroll:null,square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},gesture:{manualStart:!1,enabled:!1,max:1/0,maxPerElement:1,restrict:null},perAction:{manualStart:!1,max:1/0,maxPerElement:1,snap:{enabled:!1,endOnly:!1,range:1/0,targets:null,offsets:null,relativePoints:null},restrict:{enabled:!1,endOnly:!1},autoScroll:{enabled:!1,container:null,margin:60,speed:300},inertia:{enabled:!1,resistance:10,minSpeed:100,endSpeed:10,allowResume:!0,zeroResumeDelta:!0,smoothEndDuration:300}},_holdDuration:600},x={interaction:null,i:null,x:0,y:0,scroll:function(){var e,t,o,n,r=x.interaction.target.options[x.interaction.prepared.name].autoScroll,i=r.container||me(x.interaction.element),s=(new Date).getTime(),a=(s-x.prevTimeX)/1e3,l=(s-x.prevTimeY)/1e3;r.velocity?(e=r.velocity.x,t=r.velocity.y):e=t=r.speed,n=t*l,((o=e*a)>=1||n>=1)&&(G(i)?i.scrollBy(x.x*o,x.y*n):i&&(i.scrollLeft+=x.x*o,i.scrollTop+=x.y*n),o>=1&&(x.prevTimeX=s),n>=1&&(x.prevTimeY=s)),x.isScrolling&&(I(x.i),x.i=F(x.scroll))},isScrolling:!1,prevTimeX:0,prevTimeY:0,start:function(e){x.isScrolling=!0,I(x.i),x.interaction=e,x.prevTimeX=(new Date).getTime(),x.prevTimeY=(new Date).getTime(),x.i=F(x.scroll)},stop:function(){x.isScrolling=!1,I(x.i)}},C="ontouchstart"in s||s.DocumentTouch&&a instanceof s.DocumentTouch,k=m&&!/Chrome/.test(navigator.userAgent),S=C||k?20:10,T=1,E=0,O=1/0,A=a.all&&!s.atob?{drag:"move",resizex:"e-resize",resizey:"s-resize",resizexy:"se-resize",resizetop:"n-resize",resizeleft:"w-resize",resizebottom:"s-resize",resizeright:"e-resize",resizetopleft:"se-resize",resizebottomright:"se-resize",resizetopright:"ne-resize",resizebottomleft:"ne-resize",gesture:""}:{drag:"move",resizex:"ew-resize",resizey:"ns-resize",resizexy:"nwse-resize",resizetop:"ns-resize",resizeleft:"ew-resize",resizebottom:"ns-resize",resizeright:"ew-resize",resizetopleft:"nwse-resize",resizebottomright:"nwse-resize",resizetopright:"nesw-resize",resizebottomleft:"nesw-resize",gesture:""},M={drag:!0,resize:!0,gesture:!0},B="onmousewheel"in a?"mousewheel":"wheel",P=["dragstart","dragmove","draginertiastart","dragend","dragenter","dragleave","dropactivate","dropdeactivate","dropmove","drop","resizestart","resizemove","resizeinertiastart","resizeend","gesturestart","gesturemove","gestureinertiastart","gestureend","down","move","up","cancel","tap","doubletap","hold"],R={},V="Opera"==navigator.appName&&C&&navigator.userAgent.match("Presto"),N=/iP(hone|od|ad)/.test(navigator.platform)&&/OS 7[^\d]/.test(navigator.appVersion),D="matches"in Element.prototype?"matches":"webkitMatchesSelector"in Element.prototype?"webkitMatchesSelector":"mozMatchesSelector"in Element.prototype?"mozMatchesSelector":"oMatchesSelector"in Element.prototype?"oMatchesSelector":"msMatchesSelector",F=o.requestAnimationFrame,I=o.cancelAnimationFrame,L=function(){var e="attachEvent"in s&&!("addEventListener"in s),t=e?"attachEvent":"addEventListener",o=e?"detachEvent":"removeEventListener",n=e?"on":"",r=[],i=[],a=[];function l(){this.returnValue=!1}function c(){this.cancelBubble=!0}function d(){this.cancelBubble=!0,this.immediatePropagationStopped=!0}return{add:function(o,s,u,h){var m=Xe(r,o),p=i[m];if(p||(p={events:{},typeCount:0},m=r.push(o)-1,i.push(p),a.push(e?{supplied:[],wrapped:[],useCount:[]}:null)),p.events[s]||(p.events[s]=[],p.typeCount++),!Ke(p.events[s],u)){var g;if(e){var f=a[m],v=Xe(f.supplied,u),b=f.wrapped[v]||function(e){e.immediatePropagationStopped||(e.target=e.srcElement,e.currentTarget=o,e.preventDefault=e.preventDefault||l,e.stopPropagation=e.stopPropagation||c,e.stopImmediatePropagation=e.stopImmediatePropagation||d,/mouse|click/.test(e.type)&&(e.pageX=e.clientX+me(o).document.documentElement.scrollLeft,e.pageY=e.clientY+me(o).document.documentElement.scrollTop),u(e))};g=o[t](n+s,b,Boolean(h)),-1===v?(f.supplied.push(u),f.wrapped.push(b),f.useCount.push(1)):f.useCount[v]++}else g=o[t](s,u,h||!1);return p.events[s].push(u),g}},remove:function t(s,l,c,d){var u,h,m,p=Xe(r,s),g=i[p],f=c;if(g&&g.events)if(e&&(m=Xe((h=a[p]).supplied,c),f=h.wrapped[m]),"all"!==l){if(g.events[l]){var v=g.events[l].length;if("all"===c){for(u=0;u<v;u++)t(s,l,g.events[l][u],Boolean(d));return}for(u=0;u<v;u++)if(g.events[l][u]===c){s[o](n+l,f,d||!1),g.events[l].splice(u,1),e&&h&&(h.useCount[m]--,0===h.useCount[m]&&(h.supplied.splice(m,1),h.wrapped.splice(m,1),h.useCount.splice(m,1)));break}g.events[l]&&0===g.events[l].length&&(g.events[l]=null,g.typeCount--)}g.typeCount||(i.splice(p,1),r.splice(p,1),a.splice(p,1))}else for(l in g.events)g.events.hasOwnProperty(l)&&t(s,l,"all")},useAttachEvent:e,_elements:r,_targets:i,_attachedListeners:a}}(),z={webkit:/(Movement[XY]|Radius[XY]|RotationAngle|Force)$/};Ve.prototype={getPageXY:function(e,t){return ce(e,t)},getClientXY:function(e,t){return de(e,t)},setEventXY:function(e,t){return o=e,ce(r=(n=t).length>1?ve(n):n[0],g),o.page.x=g.x,o.page.y=g.y,de(r,g),o.client.x=g.x,o.client.y=g.y,void(o.timeStamp=(new Date).getTime());var o,n,r},pointerOver:function(e,t,o){if(!this.prepared.name&&this.mouse){var r=[],i=[],s=this.element;this.addPointer(e),!this.target||!Oe(this.target,this.element,o)&&Ae(this.target,this.element,o)||(this.target=null,this.element=null,this.matches=[],this.matchElements=[]);var a=v.get(o),l=a&&!Oe(a,o,o)&&Ae(a,o,o)&&Ze(a.getAction(e,t,this,o),a);l&&!Re(a,o,l)&&(l=null),l?(this.target=a,this.element=o,this.matches=[],this.matchElements=[]):(v.forEachSelector((function(e,t){e&&Ee(e,o)&&!Oe(e,o,o)&&Ae(e,o,o)&&Je(o,t)&&(r.push(e),i.push(o))})),this.validateSelector(e,t,r,i)?(this.matches=r,this.matchElements=i,this.pointerHover(e,t,this.matches,this.matchElements),L.add(o,k?n.move:"mousemove",H.pointerHover)):this.target&&(ke(s,o)?(this.pointerHover(e,t,this.matches,this.matchElements),L.add(this.element,k?n.move:"mousemove",H.pointerHover)):(this.target=null,this.element=null,this.matches=[],this.matchElements=[])))}},pointerHover:function(e,t,o,n,r,i){var s,a=this.target;!this.prepared.name&&this.mouse?(this.setEventXY(this.curCoords,[e]),r?s=this.validateSelector(e,t,r,i):a&&(s=Ze(a.getAction(this.pointers[0],t,this,this.element),this.target)),a&&a.options.styleCursor&&(a._doc.documentElement.style.cursor=s?Le(s):"")):this.prepared.name&&this.checkAndPreventDefault(t,a,this.element)},pointerOut:function(e,t,o){this.prepared.name||(v.get(o)||L.remove(o,k?n.move:"mousemove",H.pointerHover),this.target&&this.target.options.styleCursor&&!this.interacting()&&(this.target._doc.documentElement.style.cursor=""))},selectorDown:function(e,t,o,n){var i,s=this,a=L.useAttachEvent?ne({},t):t,l=o,c=this.addPointer(e);if(this.holdTimers[c]=setTimeout((function(){s.pointerHold(L.useAttachEvent?a:e,a,o,n)}),_._holdDuration),this.pointerIsDown=!0,this.inertiaStatus.active&&this.target.selector)for(;q(l);){if(l===this.element&&Ze(this.target.getAction(e,t,this,this.element),this.target).name===this.prepared.name)return I(this.inertiaStatus.i),this.inertiaStatus.active=!1,void this.collectEventTargets(e,t,o,"down");l=Te(l)}if(this.interacting())this.collectEventTargets(e,t,o,"down");else{for(this.setEventXY(this.curCoords,[e]),this.downEvent=t;q(l)&&!i;)this.matches=[],this.matchElements=[],v.forEachSelector(d),i=this.validateSelector(e,t,this.matches,this.matchElements),l=Te(l);if(i)return this.prepared.name=i.name,this.prepared.axis=i.axis,this.prepared.edges=i.edges,this.collectEventTargets(e,t,o,"down"),this.pointerDown(e,t,o,n,i);this.downTimes[c]=(new Date).getTime(),this.downTargets[c]=o,re(this.downPointer,e),ie(this.prevCoords,this.curCoords),this.pointerWasMoved=!1,this.collectEventTargets(e,t,o,"down")}function d(e,t,n){var i=r?n.querySelectorAll(t):void 0;Ee(e,l)&&!Oe(e,l,o)&&Ae(e,l,o)&&Je(l,t,i)&&(s.matches.push(e),s.matchElements.push(l))}},pointerDown:function(e,t,o,n,r){if(r||this.inertiaStatus.active||!this.pointerWasMoved||!this.prepared.name){this.pointerIsDown=!0,this.downEvent=t;var i,s=this.addPointer(e);if(this.pointerIds.length>1&&this.target._element===this.element){var a=Ze(r||this.target.getAction(e,t,this,this.element),this.target);Re(this.target,this.element,a)&&(i=a),this.prepared.name=null}else if(!this.prepared.name){var l=v.get(n);l&&!Oe(l,n,o)&&Ae(l,n,o)&&(i=Ze(r||l.getAction(e,t,this,n),l))&&Re(l,n,i)&&(this.target=l,this.element=n)}var c=this.target,d=c&&c.options;if(!c||!r&&this.prepared.name)this.inertiaStatus.active&&n===this.element&&Ze(c.getAction(e,t,this,this.element),c).name===this.prepared.name&&(I(this.inertiaStatus.i),this.inertiaStatus.active=!1,this.checkAndPreventDefault(t,c,this.element));else{if(i=i||Ze(r||c.getAction(e,t,this,n),c,this.element),this.setEventXY(this.startCoords,this.pointers),!i)return;d.styleCursor&&(c._doc.documentElement.style.cursor=Le(i)),this.resizeAxes="resize"===i.name?i.axis:null,"gesture"===i&&this.pointerIds.length<2&&(i=null),this.prepared.name=i.name,this.prepared.axis=i.axis,this.prepared.edges=i.edges,this.snapStatus.snappedX=this.snapStatus.snappedY=this.restrictStatus.restrictedX=this.restrictStatus.restrictedY=NaN,this.downTimes[s]=(new Date).getTime(),this.downTargets[s]=o,re(this.downPointer,e),ie(this.prevCoords,this.startCoords),this.pointerWasMoved=!1,this.checkAndPreventDefault(t,c,this.element)}}else this.checkAndPreventDefault(t,this.target,this.element)},setModifications:function(e,t){var o=this.target,n=!0,r=Be(o,this.prepared.name)&&(!o.options[this.prepared.name].snap.endOnly||t),i=Pe(o,this.prepared.name)&&(!o.options[this.prepared.name].restrict.endOnly||t);return r?this.setSnapping(e):this.snapStatus.locked=!1,i?this.setRestriction(e):this.restrictStatus.restricted=!1,r&&this.snapStatus.locked&&!this.snapStatus.changed?n=i&&this.restrictStatus.restricted&&this.restrictStatus.changed:i&&this.restrictStatus.restricted&&!this.restrictStatus.changed&&(n=!1),n},setStartOffsets:function(e,t,o){var n,r,i=t.getRect(o),s=_e(t,o),a=t.options[this.prepared.name].snap,l=t.options[this.prepared.name].restrict;i?(this.startOffset.left=this.startCoords.page.x-i.left,this.startOffset.top=this.startCoords.page.y-i.top,this.startOffset.right=i.right-this.startCoords.page.x,this.startOffset.bottom=i.bottom-this.startCoords.page.y,n="width"in i?i.width:i.right-i.left,r="height"in i?i.height:i.bottom-i.top):this.startOffset.left=this.startOffset.top=this.startOffset.right=this.startOffset.bottom=0,this.snapOffsets.splice(0);var c=a&&"startCoords"===a.offset?{x:this.startCoords.page.x-s.x,y:this.startCoords.page.y-s.y}:a&&a.offset||{x:0,y:0};if(i&&a&&a.relativePoints&&a.relativePoints.length)for(var d=0;d<a.relativePoints.length;d++)this.snapOffsets.push({x:this.startOffset.left-n*a.relativePoints[d].x+c.x,y:this.startOffset.top-r*a.relativePoints[d].y+c.y});else this.snapOffsets.push(c);i&&l.elementRect?(this.restrictOffset.left=this.startOffset.left-n*l.elementRect.left,this.restrictOffset.top=this.startOffset.top-r*l.elementRect.top,this.restrictOffset.right=this.startOffset.right-n*(1-l.elementRect.right),this.restrictOffset.bottom=this.startOffset.bottom-r*(1-l.elementRect.bottom)):this.restrictOffset.left=this.restrictOffset.top=this.restrictOffset.right=this.restrictOffset.bottom=0},start:function(e,t,o){this.interacting()||!this.pointerIsDown||this.pointerIds.length<("gesture"===e.name?2:1)||(-1===Xe(b,this)&&b.push(this),this.prepared.name||this.setEventXY(this.startCoords,this.pointers),this.prepared.name=e.name,this.prepared.axis=e.axis,this.prepared.edges=e.edges,this.target=t,this.element=o,this.setStartOffsets(e.name,t,o),this.setModifications(this.startCoords.page),this.prevEvent=this[this.prepared.name+"Start"](this.downEvent))},pointerMove:function(e,t,o,n,i){if(this.inertiaStatus.active){var s=this.inertiaStatus.upCoords.page,a=this.inertiaStatus.upCoords.client,l={pageX:s.x+this.inertiaStatus.sx,pageY:s.y+this.inertiaStatus.sy,clientX:a.x+this.inertiaStatus.sx,clientY:a.y+this.inertiaStatus.sy};this.setEventXY(this.curCoords,[l])}else this.recordPointer(e),this.setEventXY(this.curCoords,this.pointers);var c,d,u=this.curCoords.page.x===this.prevCoords.page.x&&this.curCoords.page.y===this.prevCoords.page.y&&this.curCoords.client.x===this.prevCoords.client.x&&this.curCoords.client.y===this.prevCoords.client.y,h=this.mouse?0:Xe(this.pointerIds,ue(e));if(this.pointerIsDown&&!this.pointerWasMoved&&(c=this.curCoords.client.x-this.startCoords.client.x,d=this.curCoords.client.y-this.startCoords.client.y,this.pointerWasMoved=p(c,d)>T),u||this.pointerIsDown&&!this.pointerWasMoved||(this.pointerIsDown&&clearTimeout(this.holdTimers[h]),this.collectEventTargets(e,t,o,"move")),this.pointerIsDown)if(u&&this.pointerWasMoved&&!i)this.checkAndPreventDefault(t,this.target,this.element);else if(se(this.pointerDelta,this.prevCoords,this.curCoords),this.prepared.name){if(this.pointerWasMoved&&(!this.inertiaStatus.active||e instanceof Fe&&/inertiastart/.test(e.type))){if(!this.interacting()&&(se(this.pointerDelta,this.prevCoords,this.curCoords),"drag"===this.prepared.name)){var m=Math.abs(c),g=Math.abs(d),f=this.target.options.drag.axis,b=m>g?"x":m<g?"y":"xy";if("xy"!==b&&"xy"!==f&&f!==b){this.prepared.name=null;for(var y=o;q(y);){var w=v.get(y);if(w&&w!==this.target&&!w.options.drag.manualStart&&"drag"===w.getAction(this.downPointer,this.downEvent,this,y).name&&Me(b,w)){this.prepared.name="drag",this.target=w,this.element=y;break}y=Te(y)}if(!this.prepared.name){var _=this,x=function(e,t,n){var i=r?n.querySelectorAll(t):void 0;if(e!==_.target)return Ee(e,o)&&!e.options.drag.manualStart&&!Oe(e,y,o)&&Ae(e,y,o)&&Je(y,t,i)&&"drag"===e.getAction(_.downPointer,_.downEvent,_,y).name&&Me(b,e)&&Re(e,y,"drag")?e:void 0};for(y=o;q(y);){var C=v.forEachSelector(x);if(C){this.prepared.name="drag",this.target=C,this.element=y;break}y=Te(y)}}}}var k=!!this.prepared.name&&!this.interacting();if(k&&(this.target.options[this.prepared.name].manualStart||!Re(this.target,this.element,this.prepared)))return void this.stop(t);this.prepared.name&&this.target&&(k&&this.start(this.prepared,this.target,this.element),(this.setModifications(this.curCoords.page,i)||k)&&(this.prevEvent=this[this.prepared.name+"Move"](t)),this.checkAndPreventDefault(t,this.target,this.element))}ie(this.prevCoords,this.curCoords),(this.dragging||this.resizing)&&this.autoScrollMove(e)}},dragStart:function(e){var t=new Fe(this,e,"drag","start",this.element);this.dragging=!0,this.target.fire(t),this.activeDrops.dropzones=[],this.activeDrops.elements=[],this.activeDrops.rects=[],this.dynamicDrop||this.setActiveDrops(this.element);var o=this.getDropEvents(e,t);return o.activate&&this.fireActiveDrops(o.activate),t},dragMove:function(e){var t=this.target,o=new Fe(this,e,"drag","move",this.element),n=this.element,r=this.getDrop(o,e,n);this.dropTarget=r.dropzone,this.dropElement=r.element;var i=this.getDropEvents(e,o);return t.fire(o),i.leave&&this.prevDropTarget.fire(i.leave),i.enter&&this.dropTarget.fire(i.enter),i.move&&this.dropTarget.fire(i.move),this.prevDropTarget=this.dropTarget,this.prevDropElement=this.dropElement,o},resizeStart:function(e){var t=new Fe(this,e,"resize","start",this.element);if(this.prepared.edges){var o=this.target.getRect(this.element);if(this.target.options.resize.square||this.target.options.resize.preserveAspectRatio){var n=ne({},this.prepared.edges);n.top=n.top||n.left&&!n.bottom,n.left=n.left||n.top&&!n.right,n.bottom=n.bottom||n.right&&!n.top,n.right=n.right||n.bottom&&!n.left,this.prepared._linkedEdges=n}else this.prepared._linkedEdges=null;this.target.options.resize.preserveAspectRatio&&(this.resizeStartAspectRatio=o.width/o.height),this.resizeRects={start:o,current:ne({},o),restricted:ne({},o),previous:ne({},o),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},t.rect=this.resizeRects.restricted,t.deltaRect=this.resizeRects.delta}return this.target.fire(t),this.resizing=!0,t},resizeMove:function(e){var t=new Fe(this,e,"resize","move",this.element),o=this.prepared.edges,n=this.target.options.resize.invert,r="reposition"===n||"negate"===n;if(o){var i,s=t.dx,a=t.dy,l=this.resizeRects.start,c=this.resizeRects.current,d=this.resizeRects.restricted,u=this.resizeRects.delta,h=ne(this.resizeRects.previous,d),m=o;if(this.target.options.resize.preserveAspectRatio){var p=this.resizeStartAspectRatio;o=this.prepared._linkedEdges,m.left&&m.bottom||m.right&&m.top?a=-s/p:m.left||m.right?a=s/p:(m.top||m.bottom)&&(s=a*p)}else this.target.options.resize.square&&(o=this.prepared._linkedEdges,m.left&&m.bottom||m.right&&m.top?a=-s:m.left||m.right?a=s:(m.top||m.bottom)&&(s=a));for(var g in o.top&&(c.top+=a),o.bottom&&(c.bottom+=a),o.left&&(c.left+=s),o.right&&(c.right+=s),r?(ne(d,c),"reposition"===n&&(d.top>d.bottom&&(i=d.top,d.top=d.bottom,d.bottom=i),d.left>d.right&&(i=d.left,d.left=d.right,d.right=i))):(d.top=Math.min(c.top,l.bottom),d.bottom=Math.max(c.bottom,l.top),d.left=Math.min(c.left,l.right),d.right=Math.max(c.right,l.left)),d.width=d.right-d.left,d.height=d.bottom-d.top,d)u[g]=d[g]-h[g];t.edges=this.prepared.edges,t.rect=d,t.deltaRect=u}return this.target.fire(t),t},gestureStart:function(e){var t=new Fe(this,e,"gesture","start",this.element);return t.ds=0,this.gesture.startDistance=this.gesture.prevDistance=t.distance,this.gesture.startAngle=this.gesture.prevAngle=t.angle,this.gesture.scale=1,this.gesturing=!0,this.target.fire(t),t},gestureMove:function(e){return this.pointerIds.length?((t=new Fe(this,e,"gesture","move",this.element)).ds=t.scale-this.gesture.scale,this.target.fire(t),this.gesture.prevAngle=t.angle,this.gesture.prevDistance=t.distance,t.scale===1/0||null===t.scale||void 0===t.scale||isNaN(t.scale)||(this.gesture.scale=t.scale),t):this.prevEvent;var t},pointerHold:function(e,t,o){this.collectEventTargets(e,t,o,"hold")},pointerUp:function(e,t,o,n){var r=this.mouse?0:Xe(this.pointerIds,ue(e));clearTimeout(this.holdTimers[r]),this.collectEventTargets(e,t,o,"up"),this.collectEventTargets(e,t,o,"tap"),this.pointerEnd(e,t,o,n),this.removePointer(e)},pointerCancel:function(e,t,o,n){var r=this.mouse?0:Xe(this.pointerIds,ue(e));clearTimeout(this.holdTimers[r]),this.collectEventTargets(e,t,o,"cancel"),this.pointerEnd(e,t,o,n),this.removePointer(e)},ie8Dblclick:function(e,t,o){this.prevTap&&t.clientX===this.prevTap.clientX&&t.clientY===this.prevTap.clientY&&o===this.prevTap.target&&(this.downTargets[0]=o,this.downTimes[0]=(new Date).getTime(),this.collectEventTargets(e,t,o,"tap"))},pointerEnd:function(e,t,o,n){var r,i=this.target,s=i&&i.options,a=s&&this.prepared.name&&s[this.prepared.name].inertia,l=this.inertiaStatus;if(this.interacting()){if(l.active&&!l.ending)return;var c,d,u,h=(new Date).getTime(),m=!1,p=Be(i,this.prepared.name)&&s[this.prepared.name].snap.endOnly,g=Pe(i,this.prepared.name)&&s[this.prepared.name].restrict.endOnly,f=0,v=0;if(c=this.dragging?"x"===s.drag.axis?Math.abs(this.pointerDelta.client.vx):"y"===s.drag.axis?Math.abs(this.pointerDelta.client.vy):this.pointerDelta.client.speed:this.pointerDelta.client.speed,u=(d=a&&a.enabled&&"gesture"!==this.prepared.name&&t!==l.startEvent)&&h-this.curCoords.timeStamp<50&&c>a.minSpeed&&c>a.endSpeed,d&&!u&&(p||g)){var b={};b.snap=b.restrict=b,p&&(this.setSnapping(this.curCoords.page,b),b.locked&&(f+=b.dx,v+=b.dy)),g&&(this.setRestriction(this.curCoords.page,b),b.restricted&&(f+=b.dx,v+=b.dy)),(f||v)&&(m=!0)}if(u||m){if(ie(l.upCoords,this.curCoords),this.pointers[0]=l.startEvent=new Fe(this,t,this.prepared.name,"inertiastart",this.element),l.t0=h,i.fire(l.startEvent),u){l.vx0=this.pointerDelta.client.vx,l.vy0=this.pointerDelta.client.vy,l.v0=c,this.calcInertia(l);var y,w=ne({},this.curCoords.page),_=_e(i,this.element);if(w.x=w.x+l.xe-_.x,w.y=w.y+l.ye-_.y,(y={useStatusXY:!0,x:w.x,y:w.y,dx:0,dy:0,snap:null}).snap=y,f=v=0,p){var x=this.setSnapping(this.curCoords.page,y);x.locked&&(f+=x.dx,v+=x.dy)}if(g){var C=this.setRestriction(this.curCoords.page,y);C.restricted&&(f+=C.dx,v+=C.dy)}l.modifiedXe+=f,l.modifiedYe+=v,l.i=F(this.boundInertiaFrame)}else l.smoothEnd=!0,l.xe=f,l.ye=v,l.sx=l.sy=0,l.i=F(this.boundSmoothEndFrame);return void(l.active=!0)}(p||g)&&this.pointerMove(e,t,o,n,!0)}if(this.dragging){r=new Fe(this,t,"drag","end",this.element);var k=this.element,S=this.getDrop(r,t,k);this.dropTarget=S.dropzone,this.dropElement=S.element;var T=this.getDropEvents(t,r);T.leave&&this.prevDropTarget.fire(T.leave),T.enter&&this.dropTarget.fire(T.enter),T.drop&&this.dropTarget.fire(T.drop),T.deactivate&&this.fireActiveDrops(T.deactivate),i.fire(r)}else this.resizing?(r=new Fe(this,t,"resize","end",this.element),i.fire(r)):this.gesturing&&(r=new Fe(this,t,"gesture","end",this.element),i.fire(r));this.stop(t)},collectDrops:function(e){var t,o=[],n=[];for(e=e||this.element,t=0;t<v.length;t++)if(v[t].options.drop.enabled){var r=v[t],i=r.options.drop.accept;if(!(q(i)&&i!==e||te(i)&&!Je(e,i)))for(var s=r.selector?r._context.querySelectorAll(r.selector):[r._element],a=0,l=s.length;a<l;a++){var c=s[a];c!==e&&(o.push(r),n.push(c))}}return{dropzones:o,elements:n}},fireActiveDrops:function(e){var t,o,n,r;for(t=0;t<this.activeDrops.dropzones.length;t++)o=this.activeDrops.dropzones[t],(n=this.activeDrops.elements[t])!==r&&(e.target=n,o.fire(e)),r=n},setActiveDrops:function(e){var t=this.collectDrops(e,!0);this.activeDrops.dropzones=t.dropzones,this.activeDrops.elements=t.elements,this.activeDrops.rects=[];for(var o=0;o<this.activeDrops.dropzones.length;o++)this.activeDrops.rects[o]=this.activeDrops.dropzones[o].getRect(this.activeDrops.elements[o])},getDrop:function(e,t,o){var n=[];y&&this.setActiveDrops(o);for(var r=0;r<this.activeDrops.dropzones.length;r++){var i=this.activeDrops.dropzones[r],s=this.activeDrops.elements[r],a=this.activeDrops.rects[r];n.push(i.dropCheck(e,t,this.target,o,s,a)?s:null)}var l=function(e){var t,o,n,r,i,s=e[0],a=s?0:-1,l=[],u=[];for(r=1;r<e.length;r++)if((t=e[r])&&t!==s)if(s){if(t.parentNode!==t.ownerDocument)if(s.parentNode!==t.ownerDocument){if(!l.length)for(o=s;o.parentNode&&o.parentNode!==o.ownerDocument;)l.unshift(o),o=o.parentNode;if(s instanceof h&&t instanceof c&&!(t instanceof d)){if(t===s.parentNode)continue;o=t.ownerSVGElement}else o=t;for(u=[];o.parentNode!==o.ownerDocument;)u.unshift(o),o=o.parentNode;for(i=0;u[i]&&u[i]===l[i];)i++;var m=[u[i-1],u[i],l[i]];for(n=m[0].lastChild;n;){if(n===m[1]){s=t,a=r,l=[];break}if(n===m[2])break;n=n.previousSibling}}else s=t,a=r}else s=t,a=r;return a}(n);return{dropzone:this.activeDrops.dropzones[l]||null,element:this.activeDrops.elements[l]||null}},getDropEvents:function(e,t){var o={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};return this.dropElement!==this.prevDropElement&&(this.prevDropTarget&&(o.leave={target:this.prevDropElement,dropzone:this.prevDropTarget,relatedTarget:t.target,draggable:t.interactable,dragEvent:t,interaction:this,timeStamp:t.timeStamp,type:"dragleave"},t.dragLeave=this.prevDropElement,t.prevDropzone=this.prevDropTarget),this.dropTarget&&(o.enter={target:this.dropElement,dropzone:this.dropTarget,relatedTarget:t.target,draggable:t.interactable,dragEvent:t,interaction:this,timeStamp:t.timeStamp,type:"dragenter"},t.dragEnter=this.dropElement,t.dropzone=this.dropTarget)),"dragend"===t.type&&this.dropTarget&&(o.drop={target:this.dropElement,dropzone:this.dropTarget,relatedTarget:t.target,draggable:t.interactable,dragEvent:t,interaction:this,timeStamp:t.timeStamp,type:"drop"},t.dropzone=this.dropTarget),"dragstart"===t.type&&(o.activate={target:null,dropzone:null,relatedTarget:t.target,draggable:t.interactable,dragEvent:t,interaction:this,timeStamp:t.timeStamp,type:"dropactivate"}),"dragend"===t.type&&(o.deactivate={target:null,dropzone:null,relatedTarget:t.target,draggable:t.interactable,dragEvent:t,interaction:this,timeStamp:t.timeStamp,type:"dropdeactivate"}),"dragmove"===t.type&&this.dropTarget&&(o.move={target:this.dropElement,dropzone:this.dropTarget,relatedTarget:t.target,draggable:t.interactable,dragEvent:t,interaction:this,dragmove:t,timeStamp:t.timeStamp,type:"dropmove"},t.dropzone=this.dropTarget),o},currentAction:function(){return(this.dragging?"drag":this.resizing&&"resize")||this.gesturing&&"gesture"||null},interacting:function(){return this.dragging||this.resizing||this.gesturing},clearTargets:function(){this.target=this.element=null,this.dropTarget=this.dropElement=this.prevDropTarget=this.prevDropElement=null},stop:function(e){if(this.interacting()){x.stop(),this.matches=[],this.matchElements=[];var t=this.target;t.options.styleCursor&&(t._doc.documentElement.style.cursor=""),e&&J(e.preventDefault)&&this.checkAndPreventDefault(e,t,this.element),this.dragging&&(this.activeDrops.dropzones=this.activeDrops.elements=this.activeDrops.rects=null)}this.clearTargets(),this.pointerIsDown=this.snapStatus.locked=this.dragging=this.resizing=this.gesturing=!1,this.prepared.name=this.prevEvent=null,this.inertiaStatus.resumeDx=this.inertiaStatus.resumeDy=0;for(var o=0;o<this.pointers.length;o++)-1===Xe(this.pointerIds,ue(this.pointers[o]))&&this.pointers.splice(o,1)},inertiaFrame:function(){var e,t,o,n,r,i=this.inertiaStatus,s=this.target.options[this.prepared.name].inertia.resistance,a=(new Date).getTime()/1e3-i.t0;if(a<i.te){var l=1-(Math.exp(-s*a)-i.lambda_v0)/i.one_ve_v0;if(i.modifiedXe===i.xe&&i.modifiedYe===i.ye)i.sx=i.xe*l,i.sy=i.ye*l;else{var c=(0,0,e=i.xe,t=i.ye,o=i.modifiedXe,n=i.modifiedYe,{x:xe(r=l,0,e,o),y:xe(r,0,t,n)});i.sx=c.x,i.sy=c.y}this.pointerMove(i.startEvent,i.startEvent),i.i=F(this.boundInertiaFrame)}else i.ending=!0,i.sx=i.modifiedXe,i.sy=i.modifiedYe,this.pointerMove(i.startEvent,i.startEvent),this.pointerEnd(i.startEvent,i.startEvent),i.active=i.ending=!1},smoothEndFrame:function(){var e=this.inertiaStatus,t=(new Date).getTime()-e.t0,o=this.target.options[this.prepared.name].inertia.smoothEndDuration;t<o?(e.sx=Ce(t,0,e.xe,o),e.sy=Ce(t,0,e.ye,o),this.pointerMove(e.startEvent,e.startEvent),e.i=F(this.boundSmoothEndFrame)):(e.ending=!0,e.sx=e.xe,e.sy=e.ye,this.pointerMove(e.startEvent,e.startEvent),this.pointerEnd(e.startEvent,e.startEvent),e.smoothEnd=e.active=e.ending=!1)},addPointer:function(e){var t=ue(e),o=this.mouse?0:Xe(this.pointerIds,t);return-1===o&&(o=this.pointerIds.length),this.pointerIds[o]=t,this.pointers[o]=e,o},removePointer:function(e){var t=ue(e),o=this.mouse?0:Xe(this.pointerIds,t);-1!==o&&(this.pointers.splice(o,1),this.pointerIds.splice(o,1),this.downTargets.splice(o,1),this.downTimes.splice(o,1),this.holdTimers.splice(o,1))},recordPointer:function(e){var t=this.mouse?0:Xe(this.pointerIds,ue(e));-1!==t&&(this.pointers[t]=e)},collectEventTargets:function(e,t,o,n){var i=this.mouse?0:Xe(this.pointerIds,ue(e));if("tap"!==n||!this.pointerWasMoved&&this.downTargets[i]&&this.downTargets[i]===o){for(var s=[],a=[],l=o;l;)$e.isSet(l)&&$e(l)._iEvents[n]&&(s.push($e(l)),a.push(l)),v.forEachSelector(c),l=Te(l);(s.length||"tap"===n)&&this.firePointers(e,t,o,s,a,n)}function c(e,t,i){var c=r?i.querySelectorAll(t):void 0;e._iEvents[n]&&q(l)&&Ee(e,l)&&!Oe(e,l,o)&&Ae(e,l,o)&&Je(l,t,c)&&(s.push(e),a.push(l))}},firePointers:function(e,t,o,n,r,i){var s,a,l,c=this.mouse?0:Xe(this.pointerIds,ue(e)),d={};for("doubletap"===i?d=e:(re(d,t),t!==e&&re(d,e),d.preventDefault=Ie,d.stopPropagation=Fe.prototype.stopPropagation,d.stopImmediatePropagation=Fe.prototype.stopImmediatePropagation,d.interaction=this,d.timeStamp=(new Date).getTime(),d.originalEvent=t,d.originalPointer=e,d.type=i,d.pointerId=ue(e),d.pointerType=this.mouse?"mouse":k?te(e.pointerType)?e.pointerType:[,,"touch","pen","mouse"][e.pointerType]:"touch"),"tap"===i&&(d.dt=d.timeStamp-this.downTimes[c],a=d.timeStamp-this.tapTime,l=!!(this.prevTap&&"doubletap"!==this.prevTap.type&&this.prevTap.target===d.target&&a<500),d.double=l,this.tapTime=d.timeStamp),s=0;s<n.length&&(d.currentTarget=r[s],d.interactable=n[s],n[s].fire(d),!(d.immediatePropagationStopped||d.propagationStopped&&r[s+1]!==d.currentTarget));s++);if(l){var u={};ne(u,d),u.dt=a,u.type="doubletap",this.collectEventTargets(u,t,o,"doubletap"),this.prevTap=u}else"tap"===i&&(this.prevTap=d)},validateSelector:function(e,t,o,n){for(var r=0,i=o.length;r<i;r++){var s=o[r],a=n[r],l=Ze(s.getAction(e,t,this,a),s);if(l&&Re(s,a,l))return this.target=s,this.element=a,l}},setSnapping:function(e,t){var o,n,r,i=this.target.options[this.prepared.name].snap,s=[];if((t=t||this.snapStatus).useStatusXY)n={x:t.x,y:t.y};else{var a=_e(this.target,this.element);(n=ne({},e)).x-=a.x,n.y-=a.y}t.realX=n.x,t.realY=n.y,n.x=n.x-this.inertiaStatus.resumeDx,n.y=n.y-this.inertiaStatus.resumeDy;for(var l=i.targets?i.targets.length:0,c=0;c<this.snapOffsets.length;c++){var d={x:n.x-this.snapOffsets[c].x,y:n.y-this.snapOffsets[c].y};for(r=0;r<l;r++)(o=J(i.targets[r])?i.targets[r](d.x,d.y,this):i.targets[r])&&s.push({x:Q(o.x)?o.x+this.snapOffsets[c].x:d.x,y:Q(o.y)?o.y+this.snapOffsets[c].y:d.y,range:Q(o.range)?o.range:i.range})}var u,h={target:null,inRange:!1,distance:0,range:0,dx:0,dy:0};for(r=0,l=s.length;r<l;r++){var m=(o=s[r]).range,g=o.x-n.x,f=o.y-n.y,v=p(g,f),b=v<=m;m===1/0&&h.inRange&&h.range!==1/0&&(b=!1),h.target&&!(b?h.inRange&&m!==1/0?v/m<h.distance/h.range:m===1/0&&h.range!==1/0||v<h.distance:!h.inRange&&v<h.distance)||(m===1/0&&(b=!0),h.target=o,h.distance=v,h.range=m,h.inRange=b,h.dx=g,h.dy=f,t.range=m)}return h.target?(u=t.snappedX!==h.target.x||t.snappedY!==h.target.y,t.snappedX=h.target.x,t.snappedY=h.target.y):(u=!0,t.snappedX=NaN,t.snappedY=NaN),t.dx=h.dx,t.dy=h.dy,t.changed=u||h.inRange&&!t.locked,t.locked=h.inRange,t},setRestriction:function(e,t){var o,n,r,i,s=this.target,a=s&&s.options[this.prepared.name].restrict,l=a&&a.restriction;return l?(o=o=(t=t||this.restrictStatus).useStatusXY?{x:t.x,y:t.y}:ne({},e),t.snap&&t.snap.locked&&(o.x+=t.snap.dx||0,o.y+=t.snap.dy||0),o.x-=this.inertiaStatus.resumeDx,o.y-=this.inertiaStatus.resumeDy,t.dx=0,t.dy=0,t.restricted=!1,te(l)&&!(l="parent"===l?Te(this.element):"self"===l?s.getRect(this.element):Se(this.element,l))||(J(l)&&(l=l(o.x,o.y,this.element)),q(l)&&(l=ge(l)),n=l,l?"x"in l&&"y"in l?(r=Math.max(Math.min(n.x+n.width-this.restrictOffset.right,o.x),n.x+this.restrictOffset.left),i=Math.max(Math.min(n.y+n.height-this.restrictOffset.bottom,o.y),n.y+this.restrictOffset.top)):(r=Math.max(Math.min(n.right-this.restrictOffset.right,o.x),n.left+this.restrictOffset.left),i=Math.max(Math.min(n.bottom-this.restrictOffset.bottom,o.y),n.top+this.restrictOffset.top)):(r=o.x,i=o.y),t.dx=r-o.x,t.dy=i-o.y,t.changed=t.restrictedX!==r||t.restrictedY!==i,t.restricted=!(!t.dx&&!t.dy),t.restrictedX=r,t.restrictedY=i),t):t},checkAndPreventDefault:function(e,t,o){if(t=t||this.target){var n=t.options,r=n.preventDefault;if("auto"!==r||!o||/^(input|select|textarea)$/i.test(e.target.nodeName))"always"!==r||e.preventDefault();else{if(/down|start/i.test(e.type)&&"drag"===this.prepared.name&&"xy"!==n.drag.axis)return;if(n[this.prepared.name]&&n[this.prepared.name].manualStart&&!this.interacting())return;e.preventDefault()}}},calcInertia:function(e){var t=this.target.options[this.prepared.name].inertia,o=t.resistance,n=-Math.log(t.endSpeed/e.v0)/o;e.x0=this.prevEvent.pageX,e.y0=this.prevEvent.pageY,e.t0=e.startEvent.timeStamp/1e3,e.sx=e.sy=0,e.modifiedXe=e.xe=(e.vx0-n)/o,e.modifiedYe=e.ye=(e.vy0-n)/o,e.te=n,e.lambda_v0=o/e.v0,e.one_ve_v0=1-t.endSpeed/e.v0},autoScrollMove:function(e){if(this.interacting()&&function(e,t){var o=e.options;return/^resize/.test(t)&&(t="resize"),o[t].autoScroll&&o[t].autoScroll.enabled}(this.target,this.prepared.name))if(this.inertiaStatus.active)x.x=x.y=0;else{var t,o,n,r,i=this.target.options[this.prepared.name].autoScroll,s=i.container||me(this.element);if(G(s))r=e.clientX<x.margin,t=e.clientY<x.margin,o=e.clientX>s.innerWidth-x.margin,n=e.clientY>s.innerHeight-x.margin;else{var a=pe(s);r=e.clientX<a.left+x.margin,t=e.clientY<a.top+x.margin,o=e.clientX>a.right-x.margin,n=e.clientY>a.bottom-x.margin}x.x=o?1:r?-1:0,x.y=n?1:t?-1:0,x.isScrolling||(x.margin=i.margin,x.speed=i.speed,x.start(this))}},_updateEventTargets:function(e,t){this._eventTarget=e,this._curEventTarget=t}},Fe.prototype={preventDefault:W,stopImmediatePropagation:function(){this.immediatePropagationStopped=this.propagationStopped=!0},stopPropagation:function(){this.propagationStopped=!0}};for(var H={},Z=["dragStart","dragMove","resizeStart","resizeMove","gestureStart","gestureMove","pointerOver","pointerOut","pointerHover","selectorDown","pointerDown","pointerMove","pointerUp","pointerCancel","pointerEnd","addPointer","removePointer","recordPointer","autoScrollMove"],j=0,U=Z.length;j<U;j++){var $=Z[j];H[$]=De($)}v.indexOfElement=function(e,t){t=t||a;for(var o=0;o<this.length;o++){var n=this[o];if(n.selector===e&&n._context===t||!n.selector&&n._element===e)return o}return-1},v.get=function(e,t){return this[this.indexOfElement(e,t&&t.context)]},v.forEachSelector=function(e){for(var t=0;t<this.length;t++){var o=this[t];if(o.selector){var n=e(o,o.selector,o._context,t,this);if(void 0!==n)return n}}},We.prototype={setOnEvents:function(e,t){return"drop"===e?(J(t.ondrop)&&(this.ondrop=t.ondrop),J(t.ondropactivate)&&(this.ondropactivate=t.ondropactivate),J(t.ondropdeactivate)&&(this.ondropdeactivate=t.ondropdeactivate),J(t.ondragenter)&&(this.ondragenter=t.ondragenter),J(t.ondragleave)&&(this.ondragleave=t.ondragleave),J(t.ondropmove)&&(this.ondropmove=t.ondropmove)):(e="on"+e,J(t.onstart)&&(this[e+"start"]=t.onstart),J(t.onmove)&&(this[e+"move"]=t.onmove),J(t.onend)&&(this[e+"end"]=t.onend),J(t.oninertiastart)&&(this[e+"inertiastart"]=t.oninertiastart)),this},draggable:function(e){return K(e)?(this.options.drag.enabled=!1!==e.enabled,this.setPerAction("drag",e),this.setOnEvents("drag",e),/^x$|^y$|^xy$/.test(e.axis)?this.options.drag.axis=e.axis:null===e.axis&&delete this.options.drag.axis,this):ee(e)?(this.options.drag.enabled=e,this):this.options.drag},setPerAction:function(e,t){for(var o in t)o in _[e]&&(K(t[o])?(this.options[e][o]=ne(this.options[e][o]||{},t[o]),K(_.perAction[o])&&"enabled"in _.perAction[o]&&(this.options[e][o].enabled=!1!==t[o].enabled)):ee(t[o])&&K(_.perAction[o])?this.options[e][o].enabled=t[o]:void 0!==t[o]&&(this.options[e][o]=t[o]))},dropzone:function(e){return K(e)?(this.options.drop.enabled=!1!==e.enabled,this.setOnEvents("drop",e),/^(pointer|center)$/.test(e.overlap)?this.options.drop.overlap=e.overlap:Q(e.overlap)&&(this.options.drop.overlap=Math.max(Math.min(1,e.overlap),0)),"accept"in e&&(this.options.drop.accept=e.accept),"checker"in e&&(this.options.drop.checker=e.checker),this):ee(e)?(this.options.drop.enabled=e,this):this.options.drop},dropCheck:function(e,t,o,n,r,i){var s=!1;if(!(i=i||this.getRect(r)))return!!this.options.drop.checker&&this.options.drop.checker(e,t,s,this,r,o,n);var a=this.options.drop.overlap;if("pointer"===a){var l,c,d=ce(e),u=_e(o,n);d.x+=u.x,d.y+=u.y,l=d.x>i.left&&d.x<i.right,c=d.y>i.top&&d.y<i.bottom,s=l&&c}var h=o.getRect(n);if("center"===a){var m=h.left+h.width/2,p=h.top+h.height/2;s=m>=i.left&&m<=i.right&&p>=i.top&&p<=i.bottom}return Q(a)&&(s=Math.max(0,Math.min(i.right,h.right)-Math.max(i.left,h.left))*Math.max(0,Math.min(i.bottom,h.bottom)-Math.max(i.top,h.top))/(h.width*h.height)>=a),this.options.drop.checker&&(s=this.options.drop.checker(e,t,s,this,r,o,n)),s},dropChecker:function(e){return J(e)?(this.options.drop.checker=e,this):null===e?(delete this.options.getRect,this):this.options.drop.checker},accept:function(e){return q(e)||oe(e)?(this.options.drop.accept=e,this):null===e?(delete this.options.drop.accept,this):this.options.drop.accept},resizable:function(e){return K(e)?(this.options.resize.enabled=!1!==e.enabled,this.setPerAction("resize",e),this.setOnEvents("resize",e),/^x$|^y$|^xy$/.test(e.axis)?this.options.resize.axis=e.axis:null===e.axis&&(this.options.resize.axis=_.resize.axis),ee(e.preserveAspectRatio)?this.options.resize.preserveAspectRatio=e.preserveAspectRatio:ee(e.square)&&(this.options.resize.square=e.square),this):ee(e)?(this.options.resize.enabled=e,this):this.options.resize},squareResize:function(e){return ee(e)?(this.options.resize.square=e,this):null===e?(delete this.options.resize.square,this):this.options.resize.square},gesturable:function(e){return K(e)?(this.options.gesture.enabled=!1!==e.enabled,this.setPerAction("gesture",e),this.setOnEvents("gesture",e),this):ee(e)?(this.options.gesture.enabled=e,this):this.options.gesture},autoScroll:function(e){return K(e)?e=ne({actions:["drag","resize"]},e):ee(e)&&(e={actions:["drag","resize"],enabled:e}),this.setOptions("autoScroll",e)},snap:function(e){var t=this.setOptions("snap",e);return t===this?this:t.drag},setOptions:function(e,t){var o,n=t&&X(t.actions)?t.actions:["drag"];if(K(t)||ee(t)){for(o=0;o<n.length;o++){var r=/resize/.test(n[o])?"resize":n[o];if(K(this.options[r])){var i=this.options[r][e];K(t)?(ne(i,t),i.enabled=!1!==t.enabled,"snap"===e&&("grid"===i.mode?i.targets=[$e.createSnapGrid(ne({offset:i.gridOffset||{x:0,y:0}},i.grid||{}))]:"anchor"===i.mode?i.targets=i.anchors:"path"===i.mode&&(i.targets=i.paths),"elementOrigin"in t&&(i.relativePoints=[t.elementOrigin]))):ee(t)&&(i.enabled=t)}}return this}var s={},a=["drag","resize","gesture"];for(o=0;o<a.length;o++)e in _[a[o]]&&(s[a[o]]=this.options[a[o]][e]);return s},inertia:function(e){var t=this.setOptions("inertia",e);return t===this?this:t.drag},getAction:function(e,t,o,n){var r=this.defaultActionChecker(e,o,n);return this.options.actionChecker?this.options.actionChecker(e,t,r,this,n,o):r},defaultActionChecker:He,actionChecker:function(e){return J(e)?(this.options.actionChecker=e,this):null===e?(delete this.options.actionChecker,this):this.options.actionChecker},getRect:function(e){return e=e||this._element,this.selector&&!q(e)&&(e=this._context.querySelector(this.selector)),ge(e)},rectChecker:function(e){return J(e)?(this.getRect=e,this):null===e?(delete this.options.getRect,this):this.getRect},styleCursor:function(e){return ee(e)?(this.options.styleCursor=e,this):null===e?(delete this.options.styleCursor,this):this.options.styleCursor},preventDefault:function(e){return/^(always|never|auto)$/.test(e)?(this.options.preventDefault=e,this):ee(e)?(this.options.preventDefault=e?"always":"never",this):this.options.preventDefault},origin:function(e){return oe(e)||K(e)?(this.options.origin=e,this):this.options.origin},deltaSource:function(e){return"page"===e||"client"===e?(this.options.deltaSource=e,this):this.options.deltaSource},restrict:function(e){if(!K(e))return this.setOptions("restrict",e);for(var t,o=["drag","resize","gesture"],n=0;n<o.length;n++){var r=o[n];if(r in e){var i=ne({actions:[r],restriction:e[r]},e);t=this.setOptions("restrict",i)}}return t},context:function(){return this._context},_context:a,ignoreFrom:function(e){return oe(e)||q(e)?(this.options.ignoreFrom=e,this):this.options.ignoreFrom},allowFrom:function(e){return oe(e)||q(e)?(this.options.allowFrom=e,this):this.options.allowFrom},element:function(){return this._element},fire:function(e){if(!e||!e.type||!Ke(P,e.type))return this;var t,o,n,r="on"+e.type;if(e.type in this._iEvents)for(o=0,n=(t=this._iEvents[e.type]).length;o<n&&!e.immediatePropagationStopped;o++)t[o].name,t[o](e);if(J(this[r])&&(this[r].name,this[r](e)),e.type in R&&(t=R[e.type]))for(o=0,n=t.length;o<n&&!e.immediatePropagationStopped;o++)t[o].name,t[o](e);return this},on:function(e,t,o){var n;if(te(e)&&-1!==e.search(" ")&&(e=e.trim().split(/ +/)),X(e)){for(n=0;n<e.length;n++)this.on(e[n],t,o);return this}if(K(e)){for(var r in e)this.on(r,e[r],t);return this}if("wheel"===e&&(e=B),o=!!o,Ke(P,e))e in this._iEvents?this._iEvents[e].push(t):this._iEvents[e]=[t];else if(this.selector){if(!w[e])for(w[e]={selectors:[],contexts:[],listeners:[]},n=0;n<f.length;n++)L.add(f[n],e,je),L.add(f[n],e,Ue,!0);var i,s=w[e];for(i=s.selectors.length-1;i>=0&&(s.selectors[i]!==this.selector||s.contexts[i]!==this._context);i--);-1===i&&(i=s.selectors.length,s.selectors.push(this.selector),s.contexts.push(this._context),s.listeners.push([])),s.listeners[i].push([t,o])}else L.add(this._element,e,t,o);return this},off:function(e,t,o){var n;if(te(e)&&-1!==e.search(" ")&&(e=e.trim().split(/ +/)),X(e)){for(n=0;n<e.length;n++)this.off(e[n],t,o);return this}if(K(e)){for(var r in e)this.off(r,e[r],t);return this}var i,s=-1;if(o=!!o,"wheel"===e&&(e=B),Ke(P,e))(i=this._iEvents[e])&&-1!==(s=Xe(i,t))&&this._iEvents[e].splice(s,1);else if(this.selector){var a=w[e],l=!1;if(!a)return this;for(s=a.selectors.length-1;s>=0;s--)if(a.selectors[s]===this.selector&&a.contexts[s]===this._context){var c=a.listeners[s];for(n=c.length-1;n>=0;n--){var d=c[n][0],u=c[n][1];if(d===t&&u===o){c.splice(n,1),c.length||(a.selectors.splice(s,1),a.contexts.splice(s,1),a.listeners.splice(s,1),L.remove(this._context,e,je),L.remove(this._context,e,Ue,!0),a.selectors.length||(w[e]=null)),l=!0;break}}if(l)break}}else L.remove(this._element,e,t,o);return this},set:function(e){K(e)||(e={}),this.options=ne({},_.base);var t,o=["drag","drop","resize","gesture"],n=["draggable","dropzone","resizable","gesturable"],r=ne(ne({},_.perAction),e[i]||{});for(t=0;t<o.length;t++){var i=o[t];this.options[i]=ne({},_[i]),this.setPerAction(i,r),this[n[t]](e[i])}var s=["accept","actionChecker","allowFrom","deltaSource","dropChecker","ignoreFrom","origin","preventDefault","rectChecker","styleCursor"];for(t=0,U=s.length;t<U;t++){var a=s[t];this.options[a]=_.base[a],a in e&&this[a](e[a])}return this},unset:function(){if(L.remove(this._element,"all"),te(this.selector))for(var e in w)for(var t=w[e],o=0;o<t.selectors.length;o++){t.selectors[o]===this.selector&&t.contexts[o]===this._context&&(t.selectors.splice(o,1),t.contexts.splice(o,1),t.listeners.splice(o,1),t.selectors.length||(w[e]=null)),L.remove(this._context,e,je),L.remove(this._context,e,Ue,!0);break}else L.remove(this,"all"),this.options.styleCursor&&(this._element.style.cursor="");return this.dropzone(!1),v.splice(Xe(v,this),1),$e}},We.prototype.snap=qe(We.prototype.snap,"Interactable#snap is deprecated. See the new documentation for snapping at http://interactjs.io/docs/snapping"),We.prototype.restrict=qe(We.prototype.restrict,"Interactable#restrict is deprecated. See the new documentation for resticting at http://interactjs.io/docs/restriction"),We.prototype.inertia=qe(We.prototype.inertia,"Interactable#inertia is deprecated. See the new documentation for inertia at http://interactjs.io/docs/inertia"),We.prototype.autoScroll=qe(We.prototype.autoScroll,"Interactable#autoScroll is deprecated. See the new documentation for autoScroll at http://interactjs.io/docs/#autoscroll"),We.prototype.squareResize=qe(We.prototype.squareResize,"Interactable#squareResize is deprecated. See http://interactjs.io/docs/#resize-square"),We.prototype.accept=qe(We.prototype.accept,"Interactable#accept is deprecated. use Interactable#dropzone({ accept: target }) instead"),We.prototype.dropChecker=qe(We.prototype.dropChecker,"Interactable#dropChecker is deprecated. use Interactable#dropzone({ dropChecker: checkerFunction }) instead"),We.prototype.context=qe(We.prototype.context,"Interactable#context as a method is deprecated. It will soon be a DOM Node instead"),$e.isSet=function(e,t){return-1!==v.indexOfElement(e,t&&t.context)},$e.on=function(e,t,o){if(te(e)&&-1!==e.search(" ")&&(e=e.trim().split(/ +/)),X(e)){for(var n=0;n<e.length;n++)$e.on(e[n],t,o);return $e}if(K(e)){for(var r in e)$e.on(r,e[r],t);return $e}return Ke(P,e)?R[e]?R[e].push(t):R[e]=[t]:L.add(a,e,t,o),$e},$e.off=function(e,t,o){if(te(e)&&-1!==e.search(" ")&&(e=e.trim().split(/ +/)),X(e)){for(var n=0;n<e.length;n++)$e.off(e[n],t,o);return $e}if(K(e)){for(var r in e)$e.off(r,e[r],t);return $e}var i;return Ke(P,e)?e in R&&-1!==(i=Xe(R[e],t))&&R[e].splice(i,1):L.remove(a,e,t,o),$e},$e.enableDragging=qe((function(e){return null!=e?(M.drag=e,$e):M.drag}),"interact.enableDragging is deprecated and will soon be removed."),$e.enableResizing=qe((function(e){return null!=e?(M.resize=e,$e):M.resize}),"interact.enableResizing is deprecated and will soon be removed."),$e.enableGesturing=qe((function(e){return null!=e?(M.gesture=e,$e):M.gesture}),"interact.enableGesturing is deprecated and will soon be removed."),$e.eventTypes=P,$e.debug=function(){var e=b[0]||new Ve;return{interactions:b,target:e.target,dragging:e.dragging,resizing:e.resizing,gesturing:e.gesturing,prepared:e.prepared,matches:e.matches,matchElements:e.matchElements,prevCoords:e.prevCoords,startCoords:e.startCoords,pointerIds:e.pointerIds,pointers:e.pointers,addPointer:H.addPointer,removePointer:H.removePointer,recordPointer:H.recordPointer,snap:e.snapStatus,restrict:e.restrictStatus,inertia:e.inertiaStatus,downTime:e.downTimes[0],downEvent:e.downEvent,downPointer:e.downPointer,prevEvent:e.prevEvent,Interactable:We,interactables:v,pointerIsDown:e.pointerIsDown,defaultOptions:_,defaultActionChecker:He,actionCursors:A,dragMove:H.dragMove,resizeMove:H.resizeMove,gestureMove:H.gestureMove,pointerUp:H.pointerUp,pointerDown:H.pointerDown,pointerMove:H.pointerMove,pointerHover:H.pointerHover,eventTypes:P,events:L,globalEvents:R,delegatedEvents:w,prefixedPropREs:z}},$e.getPointerAverage=ve,$e.getTouchBBox=be,$e.getTouchDistance=ye,$e.getTouchAngle=we,$e.getElementRect=ge,$e.getElementClientRect=pe,$e.matchesSelector=Je,$e.closest=Se,$e.margin=qe((function(e){return Q(e)?(S=e,$e):S}),"interact.margin is deprecated. Use interact(target).resizable({ margin: number }); instead."),$e.supportsTouch=function(){return C},$e.supportsPointerEvent=function(){return k},$e.stop=function(e){for(var t=b.length-1;t>=0;t--)b[t].stop(e);return $e},$e.dynamicDrop=function(e){return ee(e)?(y=e,$e):y},$e.pointerMoveTolerance=function(e){return Q(e)?(T=e,this):T},$e.maxInteractions=function(e){return Q(e)?(O=e,this):O},$e.createSnapGrid=function(e){return function(t,o){var n=0,r=0;K(e.offset)&&(n=e.offset.x,r=e.offset.y);var i=Math.round((t-n)/e.x),s=Math.round((o-r)/e.y);return{x:i*e.x+n,y:s*e.y+r,range:e.range}}},Ye(a),D in Element.prototype&&J(Element.prototype[D])||(r=function(e,t,o){for(var n=0,r=(o=o||e.parentNode.querySelectorAll(t)).length;n<r;n++)if(o[n]===e)return!0;return!1}),function(){for(var e=0,t=["ms","moz","webkit","o"],n=0;n<t.length&&!o.requestAnimationFrame;++n)F=o[t[n]+"RequestAnimationFrame"],I=o[t[n]+"CancelAnimationFrame"]||o[t[n]+"CancelRequestAnimationFrame"];F||(F=function(t){var o=(new Date).getTime(),n=Math.max(0,16-(o-e)),r=setTimeout((function(){t(o+n)}),n);return e=o+n,r}),I||(I=function(e){clearTimeout(e)})}(),e.exports&&(t=e.exports=$e),t.interact=$e}function W(){}function q(e){if(!e||"object"!=typeof e)return!1;var t=me(e)||s;return/object|function/.test(typeof t.Element)?e instanceof t.Element:1===e.nodeType&&"string"==typeof e.nodeName}function G(e){return e===s||!(!e||!e.Window)&&e instanceof e.Window}function Y(e){return!!e&&e instanceof l}function X(e){return K(e)&&void 0!==typeof e.length&&J(e.splice)}function K(e){return!!e&&"object"==typeof e}function J(e){return"function"==typeof e}function Q(e){return"number"==typeof e}function ee(e){return"boolean"==typeof e}function te(e){return"string"==typeof e}function oe(e){return!!te(e)&&(a.querySelector(e),!0)}function ne(e,t){for(var o in t)e[o]=t[o];return e}function re(e,t){for(var o in t){var n=!1;for(var r in z)if(0===o.indexOf(r)&&z[r].test(o)){n=!0;break}n||(e[o]=t[o])}return e}function ie(e,t){e.page=e.page||{},e.page.x=t.page.x,e.page.y=t.page.y,e.client=e.client||{},e.client.x=t.client.x,e.client.y=t.client.y,e.timeStamp=t.timeStamp}function se(e,t,o){e.page.x=o.page.x-t.page.x,e.page.y=o.page.y-t.page.y,e.client.x=o.client.x-t.client.x,e.client.y=o.client.y-t.client.y,e.timeStamp=(new Date).getTime()-t.timeStamp;var n=Math.max(e.timeStamp/1e3,.001);e.page.speed=p(e.page.x,e.page.y)/n,e.page.vx=e.page.x/n,e.page.vy=e.page.y/n,e.client.speed=p(e.client.x,e.page.y)/n,e.client.vx=e.client.x/n,e.client.vy=e.client.y/n}function ae(e){return e instanceof s.Event||C&&s.Touch&&e instanceof s.Touch}function le(e,t,o){return e=e||"page",(o=o||{}).x=t[e+"X"],o.y=t[e+"Y"],o}function ce(e,t){return t=t||{},V&&ae(e)?(le("screen",e,t),t.x+=s.scrollX,t.y+=s.scrollY):le("page",e,t),t}function de(e,t){return t=t||{},V&&ae(e)?le("screen",e,t):le("client",e,t),t}function ue(e){return Q(e.pointerId)?e.pointerId:e.identifier}function he(e){return e instanceof u?e.correspondingUseElement:e}function me(e){if(G(e))return e;var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||s}function pe(e){var t=e instanceof c?e.getBoundingClientRect():e.getClientRects()[0];return t&&{left:t.left,right:t.right,top:t.top,bottom:t.bottom,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function ge(e){var t,o=pe(e);if(!N&&o){var n={x:(t=(t=me(e))||s).scrollX||t.document.documentElement.scrollLeft,y:t.scrollY||t.document.documentElement.scrollTop};o.left+=n.x,o.right+=n.x,o.top+=n.y,o.bottom+=n.y}return o}function fe(e){var t=[];return X(e)?(t[0]=e[0],t[1]=e[1]):"touchend"===e.type?1===e.touches.length?(t[0]=e.touches[0],t[1]=e.changedTouches[0]):0===e.touches.length&&(t[0]=e.changedTouches[0],t[1]=e.changedTouches[1]):(t[0]=e.touches[0],t[1]=e.touches[1]),t}function ve(e){for(var t,o={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},n=0;n<e.length;n++)for(t in o)o[t]+=e[n][t];for(t in o)o[t]/=e.length;return o}function be(e){if(e.length||e.touches&&e.touches.length>1){var t=fe(e),o=Math.min(t[0].pageX,t[1].pageX),n=Math.min(t[0].pageY,t[1].pageY);return{x:o,y:n,left:o,top:n,width:Math.max(t[0].pageX,t[1].pageX)-o,height:Math.max(t[0].pageY,t[1].pageY)-n}}}function ye(e,t){var o=(t=t||_.deltaSource)+"X",n=t+"Y",r=fe(e),i=r[0][o]-r[1][o],s=r[0][n]-r[1][n];return p(i,s)}function we(e,t,o){var n=(o=o||_.deltaSource)+"X",r=o+"Y",i=fe(e),s=i[0][n]-i[1][n],a=i[0][r]-i[1][r],l=180*Math.atan(a/s)/Math.PI;if(Q(t)){var c=(l-t)%360;c>315?l-=360+l/360|0:c>135?l-=180+l/360|0:c<-315?l+=360+l/360|0:c<-135&&(l+=180+l/360|0)}return l}function _e(e,t){var o=e?e.options.origin:_.origin;return"parent"===o?o=Te(t):"self"===o?o=e.getRect(t):oe(o)&&(o=Se(t,o)||{x:0,y:0}),J(o)&&(o=o(e&&t)),q(o)&&(o=ge(o)),o.x="x"in o?o.x:o.left,o.y="y"in o?o.y:o.top,o}function xe(e,t,o,n){var r=1-e;return r*r*t+2*r*e*o+e*e*n}function Ce(e,t,o,n){return-o*(e/=n)*(e-2)+t}function ke(e,t){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function Se(e,t){for(var o=Te(e);q(o);){if(Je(o,t))return o;o=Te(o)}return null}function Te(e){var t=e.parentNode;if(Y(t)){for(;(t=t.host)&&Y(t););return t}return t}function Ee(e,t){return e._context===t.ownerDocument||ke(e._context,t)}function Oe(e,t,o){var n=e.options.ignoreFrom;return!(!n||!q(o))&&(te(n)?Qe(o,n,t):!!q(n)&&ke(n,o))}function Ae(e,t,o){var n=e.options.allowFrom;return!n||!!q(o)&&(te(n)?Qe(o,n,t):!!q(n)&&ke(n,o))}function Me(e,t){if(!t)return!1;var o=t.options.drag.axis;return"xy"===e||"xy"===o||o===e}function Be(e,t){var o=e.options;return/^resize/.test(t)&&(t="resize"),o[t].snap&&o[t].snap.enabled}function Pe(e,t){var o=e.options;return/^resize/.test(t)&&(t="resize"),o[t].restrict&&o[t].restrict.enabled}function Re(e,t,o){for(var n=e.options,r=n[o.name].max,i=n[o.name].maxPerElement,s=0,a=0,l=0,c=0,d=b.length;c<d;c++){var u=b[c],h=u.prepared.name;if(u.interacting()){if(++s>=O)return!1;if(u.target===e){if((a+=h===o.name|0)>=r)return!1;if(u.element===t&&(l++,h!==o.name||l>=i))return!1}}}return O>0}function Ve(){if(this.target=null,this.element=null,this.dropTarget=null,this.dropElement=null,this.prevDropTarget=null,this.prevDropElement=null,this.prepared={name:null,axis:null,edges:null},this.matches=[],this.matchElements=[],this.inertiaStatus={active:!1,smoothEnd:!1,ending:!1,startEvent:null,upCoords:{},xe:0,ye:0,sx:0,sy:0,t0:0,vx0:0,vys:0,duration:0,resumeDx:0,resumeDy:0,lambda_v0:0,one_ve_v0:0,i:null},J(Function.prototype.bind))this.boundInertiaFrame=this.inertiaFrame.bind(this),this.boundSmoothEndFrame=this.smoothEndFrame.bind(this);else{var e=this;this.boundInertiaFrame=function(){return e.inertiaFrame()},this.boundSmoothEndFrame=function(){return e.smoothEndFrame()}}this.activeDrops={dropzones:[],elements:[],rects:[]},this.pointers=[],this.pointerIds=[],this.downTargets=[],this.downTimes=[],this.holdTimers=[],this.prevCoords={page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},this.curCoords={page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},this.startCoords={page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},this.pointerDelta={page:{x:0,y:0,vx:0,vy:0,speed:0},client:{x:0,y:0,vx:0,vy:0,speed:0},timeStamp:0},this.downEvent=null,this.downPointer={},this._eventTarget=null,this._curEventTarget=null,this.prevEvent=null,this.tapTime=0,this.prevTap=null,this.startOffset={left:0,right:0,top:0,bottom:0},this.restrictOffset={left:0,right:0,top:0,bottom:0},this.snapOffsets=[],this.gesture={start:{x:0,y:0},startDistance:0,prevDistance:0,distance:0,scale:1,startAngle:0,prevAngle:0},this.snapStatus={x:0,y:0,dx:0,dy:0,realX:0,realY:0,snappedX:0,snappedY:0,targets:[],locked:!1,changed:!1},this.restrictStatus={dx:0,dy:0,restrictedX:0,restrictedY:0,snap:null,restricted:!1,changed:!1},this.restrictStatus.snap=this.snapStatus,this.pointerIsDown=!1,this.pointerWasMoved=!1,this.gesturing=!1,this.dragging=!1,this.resizing=!1,this.resizeAxes="xy",this.mouse=!1,b.push(this)}function Ne(e,t,o){var n,r=0,i=b.length,s=/mouse/i.test(e.pointerType||t)||4===e.pointerType,a=ue(e);if(/down|start/i.test(t))for(r=0;r<i;r++){var l=o;if((n=b[r]).inertiaStatus.active&&n.target.options[n.prepared.name].inertia.allowResume&&n.mouse===s)for(;l;){if(l===n.element)return n;l=Te(l)}}if(s||!C&&!k){for(r=0;r<i;r++)if(b[r].mouse&&!b[r].inertiaStatus.active)return b[r];for(r=0;r<i;r++)if(b[r].mouse&&(!/down/.test(t)||!b[r].inertiaStatus.active))return n;return(n=new Ve).mouse=!0,n}for(r=0;r<i;r++)if(Ke(b[r].pointerIds,a))return b[r];if(/up|end|out/i.test(t))return null;for(r=0;r<i;r++)if((!(n=b[r]).prepared.name||n.target.options.gesture.enabled)&&!n.interacting()&&(s||!n.mouse))return n;return new Ve}function De(e){return function(t){var o,n,r=he(t.path?t.path[0]:t.target),i=he(t.currentTarget);if(C&&/touch/.test(t.type))for(E=(new Date).getTime(),n=0;n<t.changedTouches.length;n++){var s=t.changedTouches[n];(o=Ne(s,t.type,r))&&(o._updateEventTargets(r,i),o[e](s,t,r,i))}else{if(!k&&/mouse/.test(t.type)){for(n=0;n<b.length;n++)if(!b[n].mouse&&b[n].pointerIsDown)return;if((new Date).getTime()-E<500)return}if(!(o=Ne(t,t.type,r)))return;o._updateEventTargets(r,i),o[e](t,t,r,i)}}}function Fe(e,t,o,n,r,i){var s,a,l=e.target,c=e.snapStatus,d=e.restrictStatus,u=e.pointers,h=(l&&l.options||_).deltaSource,m=h+"X",g=h+"Y",f=l?l.options:_,v=_e(l,r),b="start"===n,y="end"===n,w=b?e.startCoords:e.curCoords;r=r||e.element,a=ne({},w.page),s=ne({},w.client),a.x-=v.x,a.y-=v.y,s.x-=v.x,s.y-=v.y;var x=f[o].snap&&f[o].snap.relativePoints;!Be(l,o)||b&&x&&x.length||(this.snap={range:c.range,locked:c.locked,x:c.snappedX,y:c.snappedY,realX:c.realX,realY:c.realY,dx:c.dx,dy:c.dy},c.locked&&(a.x+=c.dx,a.y+=c.dy,s.x+=c.dx,s.y+=c.dy)),!Pe(l,o)||b&&f[o].restrict.elementRect||!d.restricted||(a.x+=d.dx,a.y+=d.dy,s.x+=d.dx,s.y+=d.dy,this.restrict={dx:d.dx,dy:d.dy}),this.pageX=a.x,this.pageY=a.y,this.clientX=s.x,this.clientY=s.y,this.x0=e.startCoords.page.x-v.x,this.y0=e.startCoords.page.y-v.y,this.clientX0=e.startCoords.client.x-v.x,this.clientY0=e.startCoords.client.y-v.y,this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.button=t.button,this.buttons=t.buttons,this.target=r,this.t0=e.downTimes[0],this.type=o+(n||""),this.interaction=e,this.interactable=l;var C=e.inertiaStatus;if(C.active&&(this.detail="inertia"),i&&(this.relatedTarget=i),y?"client"===h?(this.dx=s.x-e.startCoords.client.x,this.dy=s.y-e.startCoords.client.y):(this.dx=a.x-e.startCoords.page.x,this.dy=a.y-e.startCoords.page.y):b?(this.dx=0,this.dy=0):"inertiastart"===n?(this.dx=e.prevEvent.dx,this.dy=e.prevEvent.dy):"client"===h?(this.dx=s.x-e.prevEvent.clientX,this.dy=s.y-e.prevEvent.clientY):(this.dx=a.x-e.prevEvent.pageX,this.dy=a.y-e.prevEvent.pageY),e.prevEvent&&"inertia"===e.prevEvent.detail&&!C.active&&f[o].inertia&&f[o].inertia.zeroResumeDelta&&(C.resumeDx+=this.dx,C.resumeDy+=this.dy,this.dx=this.dy=0),"resize"===o&&e.resizeAxes?f.resize.square?("y"===e.resizeAxes?this.dx=this.dy:this.dy=this.dx,this.axes="xy"):(this.axes=e.resizeAxes,"x"===e.resizeAxes?this.dy=0:"y"===e.resizeAxes&&(this.dx=0)):"gesture"===o&&(this.touches=[u[0],u[1]],b?(this.distance=ye(u,h),this.box=be(u),this.scale=1,this.ds=0,this.angle=we(u,void 0,h),this.da=0):y||t instanceof Fe?(this.distance=e.prevEvent.distance,this.box=e.prevEvent.box,this.scale=e.prevEvent.scale,this.ds=this.scale-1,this.angle=e.prevEvent.angle,this.da=this.angle-e.gesture.startAngle):(this.distance=ye(u,h),this.box=be(u),this.scale=this.distance/e.gesture.startDistance,this.angle=we(u,e.gesture.prevAngle,h),this.ds=this.scale-e.gesture.prevScale,this.da=this.angle-e.gesture.prevAngle)),b)this.timeStamp=e.downTimes[0],this.dt=0,this.duration=0,this.speed=0,this.velocityX=0,this.velocityY=0;else if("inertiastart"===n)this.timeStamp=e.prevEvent.timeStamp,this.dt=e.prevEvent.dt,this.duration=e.prevEvent.duration,this.speed=e.prevEvent.speed,this.velocityX=e.prevEvent.velocityX,this.velocityY=e.prevEvent.velocityY;else if(this.timeStamp=(new Date).getTime(),this.dt=this.timeStamp-e.prevEvent.timeStamp,this.duration=this.timeStamp-e.downTimes[0],t instanceof Fe){var k=this[m]-e.prevEvent[m],S=this[g]-e.prevEvent[g],T=this.dt/1e3;this.speed=p(k,S)/T,this.velocityX=k/T,this.velocityY=S/T}else this.speed=e.pointerDelta[h].speed,this.velocityX=e.pointerDelta[h].vx,this.velocityY=e.pointerDelta[h].vy;if((y||"inertiastart"===n)&&e.prevEvent.speed>600&&this.timeStamp-e.prevEvent.timeStamp<150){var E=180*Math.atan2(e.prevEvent.velocityY,e.prevEvent.velocityX)/Math.PI;E<0&&(E+=360);var O=112.5<=E&&E<247.5,A=202.5<=E&&E<337.5,M=!O&&(292.5<=E||E<67.5),B=!A&&22.5<=E&&E<157.5;this.swipe={up:A,down:B,left:O,right:M,angle:E,speed:e.prevEvent.speed,velocity:{x:e.prevEvent.velocityX,y:e.prevEvent.velocityY}}}}function Ie(){this.originalEvent.preventDefault()}function Le(e){var t="";if("drag"===e.name&&(t=A.drag),"resize"===e.name)if(e.axis)t=A[e.name+e.axis];else if(e.edges){for(var o="resize",n=["top","bottom","left","right"],r=0;r<4;r++)e.edges[n[r]]&&(o+=n[r]);t=A[o]}return t}function ze(e,t,o,n,r,i,s){if(!t)return!1;if(!0===t){var a=Q(i.width)?i.width:i.right-i.left,l=Q(i.height)?i.height:i.bottom-i.top;if(a<0&&("left"===e?e="right":"right"===e&&(e="left")),l<0&&("top"===e?e="bottom":"bottom"===e&&(e="top")),"left"===e)return o.x<(a>=0?i.left:i.right)+s;if("top"===e)return o.y<(l>=0?i.top:i.bottom)+s;if("right"===e)return o.x>(a>=0?i.right:i.left)-s;if("bottom"===e)return o.y>(l>=0?i.bottom:i.top)-s}return!!q(n)&&(q(t)?t===n:Qe(n,t,r))}function He(e,t,o){var n,r=this.getRect(o),i=!1,s=null,a=null,l=ne({},t.curCoords.page),c=this.options;if(!r)return null;if(M.resize&&c.resize.enabled){var d=c.resize;if(n={left:!1,right:!1,top:!1,bottom:!1},K(d.edges)){for(var u in n)n[u]=ze(u,d.edges[u],l,t._eventTarget,o,r,d.margin||S);n.left=n.left&&!n.right,n.top=n.top&&!n.bottom,i=n.left||n.right||n.top||n.bottom}else{var h="y"!==c.resize.axis&&l.x>r.right-S,m="x"!==c.resize.axis&&l.y>r.bottom-S;i=h||m,a=(h?"x":"")+(m?"y":"")}}return s=i?"resize":M.drag&&c.drag.enabled?"drag":null,M.gesture&&t.pointerIds.length>=2&&!t.dragging&&!t.resizing&&(s="gesture"),s?{name:s,axis:a,edges:n}:null}function Ze(e,t){if(!K(e))return null;var o=e.name,n=t.options;return("resize"===o&&n.resize.enabled||"drag"===o&&n.drag.enabled||"gesture"===o&&n.gesture.enabled)&&M[o]?("resize"!==o&&"resizeyx"!==o||(o="resizexy"),e):null}function je(e,t){var o={},n=w[e.type],r=he(e.path?e.path[0]:e.target),i=r;for(var s in t=!!t,e)o[s]=e[s];for(o.originalEvent=e,o.preventDefault=Ie;q(i);){for(var a=0;a<n.selectors.length;a++){var l=n.selectors[a],c=n.contexts[a];if(Je(i,l)&&ke(c,r)&&ke(c,i)){var d=n.listeners[a];o.currentTarget=i;for(var u=0;u<d.length;u++)d[u][1]===t&&d[u][0](o)}}i=Te(i)}}function Ue(e){return je.call(this,e,!0)}function $e(e,t){return v.get(e,t)||new We(e,t)}function We(e,t){var o;if(this._element=e,this._iEvents=this._iEvents||{},oe(e)){this.selector=e;var r=t&&t.context;o=r?me(r):s,r&&(o.Node?r instanceof o.Node:q(r)||r===o.document)&&(this._context=r)}else o=me(e),q(e)&&(k?(L.add(this._element,n.down,H.pointerDown),L.add(this._element,n.move,H.pointerHover)):(L.add(this._element,"mousedown",H.pointerDown),L.add(this._element,"mousemove",H.pointerHover),L.add(this._element,"touchstart",H.pointerDown),L.add(this._element,"touchmove",H.pointerHover)));this._doc=o.document,Ke(f,this._doc)||Ye(this._doc),v.push(this),this.set(t)}function qe(e,t){var o=!1;return function(){return o||(s.console.warn(t),o=!0),e.apply(this,arguments)}}function Ge(e){for(var t=0;t<b.length;t++)b[t].pointerEnd(e,e)}function Ye(e){if(!Ke(f,e)){var t=e.defaultView||e.parentWindow;for(var o in w)L.add(e,o,je),L.add(e,o,Ue,!0);k?(n=m===t.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"},L.add(e,n.down,H.selectorDown),L.add(e,n.move,H.pointerMove),L.add(e,n.over,H.pointerOver),L.add(e,n.out,H.pointerOut),L.add(e,n.up,H.pointerUp),L.add(e,n.cancel,H.pointerCancel),L.add(e,n.move,H.autoScrollMove)):(L.add(e,"mousedown",H.selectorDown),L.add(e,"mousemove",H.pointerMove),L.add(e,"mouseup",H.pointerUp),L.add(e,"mouseover",H.pointerOver),L.add(e,"mouseout",H.pointerOut),L.add(e,"touchstart",H.selectorDown),L.add(e,"touchmove",H.pointerMove),L.add(e,"touchend",H.pointerUp),L.add(e,"touchcancel",H.pointerCancel),L.add(e,"mousemove",H.autoScrollMove),L.add(e,"touchmove",H.autoScrollMove)),L.add(t,"blur",Ge);try{if(t.frameElement){var r=t.frameElement.ownerDocument,i=r.defaultView;L.add(r,"mouseup",H.pointerEnd),L.add(r,"touchend",H.pointerEnd),L.add(r,"touchcancel",H.pointerEnd),L.add(r,"pointerup",H.pointerEnd),L.add(r,"MSPointerUp",H.pointerEnd),L.add(i,"blur",Ge)}}catch(e){$e.windowParentError=e}L.add(e,"dragstart",(function(e){for(var t=0;t<b.length;t++){var o=b[t];if(o.element&&(o.element===e.target||ke(o.element,e.target)))return void o.checkAndPreventDefault(e,o.target,o.element)}})),L.useAttachEvent&&(L.add(e,"selectstart",(function(e){var t=b[0];t.currentAction()&&t.checkAndPreventDefault(e)})),L.add(e,"dblclick",De("ie8Dblclick"))),f.push(e)}}function Xe(e,t){for(var o=0,n=e.length;o<n;o++)if(e[o]===t)return o;return-1}function Ke(e,t){return-1!==Xe(e,t)}function Je(e,t,n){return r?r(e,t,n):(s!==o&&(t=t.replace(/\/deep\//g," ")),e[D](t))}function Qe(e,t,o){for(;q(e);){if(Je(e,t))return!0;if((e=Te(e))===o)return Je(e,t)}return!1}}("undefined"==typeof window?void 0:window)},48883:(e,t,o)=>{var n,r,i;!function(s){"use strict";r=[o(65311)],n=function(e,t){var o={beforeShow:d,move:d,change:d,show:d,hide:d,color:!1,flat:!1,showInput:!1,allowEmpty:!1,showButtons:!0,clickoutFiresChange:!0,showInitial:!1,showPalette:!1,showPaletteOnly:!1,hideAfterPaletteSelect:!1,togglePaletteOnly:!1,showSelectionPalette:!0,localStorageKey:!1,appendTo:"body",maxSelectionSize:7,cancelText:"cancel",chooseText:"choose",togglePaletteMoreText:"more",togglePaletteLessText:"less",clearText:"Clear Color Selection",noColorSelectedText:"No Color Selected",preferredFormat:!1,className:"",containerClassName:"",replacerClassName:"",showAlpha:!1,theme:"sp-light",palette:[["#ffffff","#000000","#ff0000","#ff8000","#ffff00","#008000","#0000ff","#4b0082","#9400d3"]],selectionPalette:[],disabled:!1,offset:null},n=[],r=!!/msie/i.exec(window.navigator.userAgent),i=function(){function e(e,t){return!!~(""+e).indexOf(t)}var t=document.createElement("div").style;return t.cssText="background-color:rgba(0,0,0,.5)",e(t.backgroundColor,"rgba")||e(t.backgroundColor,"hsla")}(),s=["<div class='sp-replacer'>","<div class='sp-preview'><div class='sp-preview-inner'></div></div>","<div class='sp-dd'>&#9660;</div>","</div>"].join(""),a=function(){var e="";if(r)for(var t=1;t<=6;t++)e+="<div class='sp-"+t+"'></div>";return["<div class='sp-container sp-hidden'>","<div class='sp-palette-container'>","<div class='sp-palette sp-thumb sp-cf'></div>","<div class='sp-palette-button-container sp-cf'>","<button type='button' class='sp-palette-toggle'></button>","</div>","</div>","<div class='sp-picker-container'>","<div class='sp-top sp-cf'>","<div class='sp-fill'></div>","<div class='sp-top-inner'>","<div class='sp-color'>","<div class='sp-sat'>","<div class='sp-val'>","<div class='sp-dragger'></div>","</div>","</div>","</div>","<div class='sp-clear sp-clear-display'>","</div>","<div class='sp-hue'>","<div class='sp-slider'></div>",e,"</div>","</div>","<div class='sp-alpha'><div class='sp-alpha-inner'><div class='sp-alpha-handle'></div></div></div>","</div>","<div class='sp-input-container sp-cf'>","<input class='sp-input' type='text' spellcheck='false'  />","</div>","<div class='sp-initial sp-thumb sp-cf'></div>","<div class='sp-button-container sp-cf'>","<a class='sp-cancel' href='#'></a>","<button type='button' class='sp-choose'></button>","</div>","</div>","</div>"].join("")}();function l(t,o,n,r){for(var s=[],a=0;a<t.length;a++){var l=t[a];if(l){var c=tinycolor(l),d=c.toHsl().l<.5?"sp-thumb-el sp-thumb-dark":"sp-thumb-el sp-thumb-light";d+=tinycolor.equals(o,l)?" sp-thumb-active":"";var u=c.toString(r.preferredFormat||"rgb"),h=i?"background-color:"+c.toRgbString():"filter:"+c.toFilter();s.push('<span title="'+u+'" data-color="'+c.toRgbString()+'" class="'+d+'"><span class="sp-thumb-inner" style="'+h+';"></span></span>')}else{s.push(e("<div />").append(e('<span data-color="" style="background-color:transparent;" class="sp-clear-display"></span>').attr("title",r.noColorSelectedText)).html())}}return"<div class='sp-cf "+n+"'>"+s.join("")+"</div>"}function c(c,d){var g,f,v,b,y=function(t,n){var r=e.extend({},o,t);return r.callbacks={move:h(r.move,n),change:h(r.change,n),show:h(r.show,n),hide:h(r.hide,n),beforeShow:h(r.beforeShow,n)},r}(d,c),w=y.flat,_=y.showSelectionPalette,x=y.localStorageKey,C=y.theme,k=y.callbacks,S=(g=je,f=10,function(){var e=this,t=arguments,o=function(){b=null,g.apply(e,t)};v&&clearTimeout(b),!v&&b||(b=setTimeout(o,f))}),T=!1,E=!1,O=0,A=0,M=0,B=0,P=0,R=0,V=0,N=0,D=0,F=0,I=1,L=[],z=[],H={},Z=y.selectionPalette.slice(0),j=y.maxSelectionSize,U="sp-dragging",$=null,W=c.ownerDocument,q=(W.body,e(c)),G=!1,Y=e(a,W).addClass(C),X=Y.find(".sp-picker-container"),K=Y.find(".sp-color"),J=Y.find(".sp-dragger"),Q=Y.find(".sp-hue"),ee=Y.find(".sp-slider"),te=Y.find(".sp-alpha-inner"),oe=Y.find(".sp-alpha"),ne=Y.find(".sp-alpha-handle"),re=Y.find(".sp-input"),ie=Y.find(".sp-palette"),se=Y.find(".sp-initial"),ae=Y.find(".sp-cancel"),le=Y.find(".sp-clear"),ce=Y.find(".sp-choose"),de=Y.find(".sp-palette-toggle"),ue=q.is("input"),he=ue&&"color"===q.attr("type")&&p(),me=ue&&!w,pe=me?e(s).addClass(C).addClass(y.className).addClass(y.replacerClassName):e([]),ge=me?pe:q,fe=pe.find(".sp-preview-inner"),ve=y.color||ue&&q.val(),be=!1,ye=y.preferredFormat,we=!y.showButtons||y.clickoutFiresChange,_e=!ve,xe=y.allowEmpty&&!he;function Ce(){if(y.showPaletteOnly&&(y.showPalette=!0),de.text(y.showPaletteOnly?y.togglePaletteMoreText:y.togglePaletteLessText),y.palette){L=y.palette.slice(0),z=Array.isArray(L[0])?L:[L],H={};for(var e=0;e<z.length;e++)for(var t=0;t<z[e].length;t++){var o=tinycolor(z[e][t]).toRgbString();H[o]=!0}}Y.toggleClass("sp-flat",w),Y.toggleClass("sp-input-disabled",!y.showInput),Y.toggleClass("sp-alpha-enabled",y.showAlpha),Y.toggleClass("sp-clear-enabled",xe),Y.toggleClass("sp-buttons-disabled",!y.showButtons),Y.toggleClass("sp-palette-buttons-disabled",!y.togglePaletteOnly),Y.toggleClass("sp-palette-disabled",!y.showPalette),Y.toggleClass("sp-palette-only",y.showPaletteOnly),Y.toggleClass("sp-initial-disabled",!y.showInitial),Y.addClass(y.className).addClass(y.containerClassName),je()}function ke(){if(x&&window.localStorage){try{var t=window.localStorage[x].split(",#");t.length>1&&(delete window.localStorage[x],e.each(t,(function(e,t){Se(t)})))}catch(e){}try{Z=window.localStorage[x].split(";")}catch(e){}}}function Se(t){if(_){var o=tinycolor(t).toRgbString();if(!H[o]&&-1===e.inArray(o,Z))for(Z.push(o);Z.length>j;)Z.shift();if(x&&window.localStorage)try{window.localStorage[x]=Z.join(";")}catch(e){}}}function Te(){var t=Ie(),o=e.map(z,(function(e,o){return l(e,t,"sp-palette-row sp-palette-row-"+o,y)}));ke(),Z&&o.push(l(function(){var e=[];if(y.showPalette)for(var t=0;t<Z.length;t++){var o=tinycolor(Z[t]).toRgbString();H[o]||e.push(Z[t])}return e.reverse().slice(0,y.maxSelectionSize)}(),t,"sp-palette-row sp-palette-row-selection",y)),ie.html(o.join(""))}function Ee(){if(y.showInitial){var e=be,t=Ie();se.html(l([e,t],t,"sp-palette-row-initial",y))}}function Oe(){(A<=0||O<=0||B<=0)&&je(),E=!0,Y.addClass(U),$=null,q.trigger("dragstart.spectrum",[Ie()])}function Ae(){E=!1,Y.removeClass(U),q.trigger("dragstop.spectrum",[Ie()])}function Me(){var e=re.val();if(null!==e&&""!==e||!xe){var t=tinycolor(e);t.isValid()?(Fe(t),Le(),Ze()):re.addClass("sp-validation-error")}else Fe(null),Le(),Ze()}function Be(){T?Ne():Pe()}function Pe(){var t=e.Event("beforeShow.spectrum");T?je():(q.trigger(t,[Ie()]),!1===k.beforeShow(Ie())||t.isDefaultPrevented()||(function(){for(var e=0;e<n.length;e++)n[e]&&n[e].hide()}(),T=!0,e(W).on("keydown.spectrum",Re),e(W).on("click.spectrum",Ve),e(window).on("resize.spectrum",S),pe.addClass("sp-active"),Y.removeClass("sp-hidden"),je(),ze(),be=Ie(),Ee(),k.show(be),q.trigger("show.spectrum",[be])))}function Re(e){27===e.keyCode&&Ne()}function Ve(e){2!=e.button&&(E||(we?Ze(!0):De(),Ne()))}function Ne(){T&&!w&&(T=!1,e(W).off("keydown.spectrum",Re),e(W).off("click.spectrum",Ve),e(window).off("resize.spectrum",S),pe.removeClass("sp-active"),Y.addClass("sp-hidden"),k.hide(Ie()),q.trigger("hide.spectrum",[Ie()]))}function De(){Fe(be,!0),Ze(!0)}function Fe(e,t){var o,n;tinycolor.equals(e,Ie())?ze():(!e&&xe?_e=!0:(_e=!1,n=(o=tinycolor(e)).toHsv(),N=n.h%360/360,D=n.s,F=n.v,I=n.a),ze(),o&&o.isValid()&&!t&&(ye=y.preferredFormat||o.getFormat()))}function Ie(e){return e=e||{},xe&&_e?null:tinycolor.fromRatio({h:N,s:D,v:F,a:Math.round(1e3*I)/1e3},{format:e.format||ye})}function Le(){ze(),k.move(Ie()),q.trigger("move.spectrum",[Ie()])}function ze(){re.removeClass("sp-validation-error"),He();var e=tinycolor.fromRatio({h:N,s:1,v:1});K.css("background-color",e.toHexString());var t=ye;I<1&&(0!==I||"name"!==t)&&("hex"!==t&&"hex3"!==t&&"hex6"!==t&&"name"!==t||(t="rgb"));var o=Ie({format:t}),n="";if(fe.removeClass("sp-clear-display"),fe.css("background-color","transparent"),!o&&xe)fe.addClass("sp-clear-display");else{var s=o.toHexString(),a=o.toRgbString();if(i||1===o.alpha?fe.css("background-color",a):(fe.css("background-color","transparent"),fe.css("filter",o.toFilter())),y.showAlpha){var l=o.toRgb();l.a=0;var c=tinycolor(l).toRgbString(),d="linear-gradient(left, "+c+", "+s+")";r?te.css("filter",tinycolor(c).toFilter({gradientType:1},s)):(te.css("background","-webkit-"+d),te.css("background","-moz-"+d),te.css("background","-ms-"+d),te.css("background","linear-gradient(to right, "+c+", "+s+")"))}n=o.toString(t)}y.showInput&&re.val(n),y.showPalette&&Te(),Ee()}function He(){var e=D,t=F;if(xe&&_e)ne.hide(),ee.hide(),J.hide();else{ne.show(),ee.show(),J.show();var o=e*O,n=A-t*A;o=Math.max(-M,Math.min(O-M,o-M)),n=Math.max(-M,Math.min(A-M,n-M)),J.css({top:n+"px",left:o+"px"});var r=I*P;ne.css({left:r-R/2+"px"});var i=N*B;ee.css({top:i-V+"px"})}}function Ze(e){var t=Ie(),o="",n=!tinycolor.equals(t,be);t&&(o=t.toString(ye),Se(t)),ue&&q.val(o),e&&n&&(k.change(t),q.trigger("change",[t]))}function je(){T&&(O=K.width(),A=K.height(),M=J.height(),Q.width(),B=Q.height(),V=ee.height(),P=oe.width(),R=ne.width(),w||(Y.css("position","absolute"),y.offset?Y.offset(y.offset):Y.offset(function(t,o){var n=0,r=t.outerWidth(),i=t.outerHeight(),s=o.outerHeight(),a=t[0].ownerDocument,l=a.documentElement,c=l.clientWidth+e(a).scrollLeft(),d=l.clientHeight+e(a).scrollTop(),u=o.offset(),h=u.left,m=u.top;return m+=s,h-=Math.min(h,h+r>c&&c>r?Math.abs(h+r-c):0),{top:m-=Math.min(m,m+i>d&&d>i?Math.abs(i+s-n):n),bottom:u.bottom,left:h,right:u.right,width:u.width,height:u.height}}(Y,ge))),He(),y.showPalette&&Te(),q.trigger("reflow.spectrum"))}function Ue(){Ne(),G=!0,q.attr("disabled",!0),ge.addClass("sp-disabled")}!function(){if(r&&Y.find("*:not(input)").attr("unselectable","on"),Ce(),me&&q.after(pe).hide(),xe||le.hide(),w)q.after(Y).hide();else{var t="parent"===y.appendTo?q.parent():e(y.appendTo);1!==t.length&&(t=e("body")),t.append(Y)}function o(t){return t.data&&t.data.ignore?(Fe(e(t.target).closest(".sp-thumb-el").data("color")),Le()):(Fe(e(t.target).closest(".sp-thumb-el").data("color")),Le(),y.hideAfterPaletteSelect?(Ze(!0),Ne()):Ze()),!1}ke(),ge.on("click.spectrum touchstart.spectrum",(function(t){G||Be(),t.stopPropagation(),e(t.target).is("input")||t.preventDefault()})),(q.is(":disabled")||!0===y.disabled)&&Ue(),Y.on("click",u),re.on("change",Me),re.on("paste",(function(){setTimeout(Me,1)})),re.on("keydown",(function(e){13==e.keyCode&&Me()})),ae.text(y.cancelText),ae.on("click.spectrum",(function(e){e.stopPropagation(),e.preventDefault(),De(),Ne()})),le.attr("title",y.clearText),le.on("click.spectrum",(function(e){e.stopPropagation(),e.preventDefault(),_e=!0,Le(),w&&Ze(!0)})),ce.text(y.chooseText),ce.on("click.spectrum",(function(e){e.stopPropagation(),e.preventDefault(),r&&re.is(":focus")&&re.trigger("change"),!re.hasClass("sp-validation-error")&&(Ze(!0),Ne())})),de.text(y.showPaletteOnly?y.togglePaletteMoreText:y.togglePaletteLessText),de.on("click.spectrum",(function(e){e.stopPropagation(),e.preventDefault(),y.showPaletteOnly=!y.showPaletteOnly,y.showPaletteOnly||w||Y.css("left","-="+(X.outerWidth(!0)+5)),Ce()})),m(oe,(function(e,t,o){I=e/P,_e=!1,o.shiftKey&&(I=Math.round(10*I)/10),Le()}),Oe,Ae),m(Q,(function(e,t){N=parseFloat(t/B),_e=!1,y.showAlpha||(I=1),Le()}),Oe,Ae),m(K,(function(e,t,o){if(o.shiftKey){if(!$){var n=D*O,r=A-F*A,i=Math.abs(e-n)>Math.abs(t-r);$=i?"x":"y"}}else $=null;var s=!$||"y"===$;(!$||"x"===$)&&(D=parseFloat(e/O)),s&&(F=parseFloat((A-t)/A)),_e=!1,y.showAlpha||(I=1),Le()}),Oe,Ae),ve?(Fe(ve),ze(),ye=y.preferredFormat||tinycolor(ve).format,Se(ve)):ze(),w&&Pe();var n=r?"mousedown.spectrum":"click.spectrum touchstart.spectrum";ie.on(n,".sp-thumb-el",o),se.on(n,".sp-thumb-el:nth-child(1)",{ignore:!0},o)}();var $e={show:Pe,hide:Ne,toggle:Be,reflow:je,option:function(o,n){return o===t?e.extend({},y):n===t?y[o]:(y[o]=n,"preferredFormat"===o&&(ye=y.preferredFormat),void Ce())},enable:function(){G=!1,q.attr("disabled",!1),ge.removeClass("sp-disabled")},disable:Ue,offset:function(e){y.offset=e,je()},set:function(e){Fe(e),Ze()},get:Ie,destroy:function(){q.show(),ge.off("click.spectrum touchstart.spectrum"),Y.remove(),pe.remove(),n[$e.id]=null},container:Y};return $e.id=n.push($e)-1,$e}function d(){}function u(e){e.stopPropagation()}function h(e,t){var o=Array.prototype.slice,n=o.call(arguments,2);return function(){return e.apply(t,n.concat(o.call(arguments)))}}function m(t,o,n,i){o=o||function(){},n=n||function(){},i=i||function(){};var s=document,a=!1,l={},c=0,d=0,u="ontouchstart"in window,h={};function m(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),e.returnValue=!1}function p(e){if(a){if(r&&s.documentMode<9&&!e.button)return g();var n=e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches[0],i=n&&n.pageX||e.pageX,h=n&&n.pageY||e.pageY,p=Math.max(0,Math.min(i-l.left,d)),f=Math.max(0,Math.min(h-l.top,c));u&&m(e),o.apply(t,[p,f,e])}}function g(){a&&(e(s).off(h),e(s.body).removeClass("sp-dragging"),setTimeout((function(){i.apply(t,arguments)}),0)),a=!1}h.selectstart=m,h.dragstart=m,h["touchmove mousemove"]=p,h["touchend mouseup"]=g,e(t).on("touchstart mousedown",(function(o){(o.which?3==o.which:2==o.button)||a||!1!==n.apply(t,arguments)&&(a=!0,c=e(t).height(),d=e(t).width(),l=e(t).offset(),e(s).on(h),e(s.body).addClass("sp-dragging"),p(o),m(o))}))}function p(){return e.fn.spectrum.inputTypeColorSupport()}var g="spectrum.id";e.fn.spectrum=function(t,o){if("string"==typeof t){var r=this,i=Array.prototype.slice.call(arguments,1);return this.each((function(){var o=n[e(this).data(g)];if(o){var s=o[t];if(!s)throw new Error("Spectrum: no such method: '"+t+"'");"get"==t?r=o.get():"container"==t?r=o.container:"option"==t?r=o.option.apply(o,i):"destroy"==t?(o.destroy(),e(this).removeData(g)):s.apply(o,i)}})),r}return this.spectrum("destroy").each((function(){var o=c(this,e.extend({},e(this).data(),t));e(this).data(g,o.id)}))},e.fn.spectrum.load=!0,e.fn.spectrum.loadOpts={},e.fn.spectrum.draggable=m,e.fn.spectrum.defaults=o,e.fn.spectrum.inputTypeColorSupport=function t(){if(void 0===t._cachedResult){var o=e("<input type='color'/>")[0];t._cachedResult="color"===o.type&&""!==o.value}return t._cachedResult},e.spectrum={},e.spectrum.localization={},e.spectrum.palettes={},e.fn.spectrum.processNativeColorInputs=function(){var t=e("input[type=color]");t.length&&!p()&&t.spectrum({preferredFormat:"hex6"})},function(){var e=/^[\s,#]+/,t=/\s+$/,o=0,n=Math,r=n.round,i=n.min,s=n.max,a=n.random,l=function(a,c){if(c=c||{},(a=a||"")instanceof l)return a;if(!(this instanceof l))return new l(a,c);var d=function(o){var r={r:0,g:0,b:0},a=1,l=!1,c=!1;return"string"==typeof o&&(o=function(o){o=o.replace(e,"").replace(t,"").toLowerCase();var n,r=!1;if(T[o])o=T[o],r=!0;else if("transparent"==o)return{r:0,g:0,b:0,a:0,format:"name"};return(n=I.rgb.exec(o))?{r:n[1],g:n[2],b:n[3]}:(n=I.rgba.exec(o))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=I.hsl.exec(o))?{h:n[1],s:n[2],l:n[3]}:(n=I.hsla.exec(o))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=I.hsv.exec(o))?{h:n[1],s:n[2],v:n[3]}:(n=I.hsva.exec(o))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=I.hex8.exec(o))?{a:V(n[1]),r:B(n[2]),g:B(n[3]),b:B(n[4]),format:r?"name":"hex8"}:(n=I.hex6.exec(o))?{r:B(n[1]),g:B(n[2]),b:B(n[3]),format:r?"name":"hex"}:!!(n=I.hex3.exec(o))&&{r:B(n[1]+""+n[1]),g:B(n[2]+""+n[2]),b:B(n[3]+""+n[3]),format:r?"name":"hex"}}(o)),"object"==typeof o&&(o.hasOwnProperty("r")&&o.hasOwnProperty("g")&&o.hasOwnProperty("b")?(d=o.r,u=o.g,h=o.b,r={r:255*A(d,255),g:255*A(u,255),b:255*A(h,255)},l=!0,c="%"===String(o.r).substr(-1)?"prgb":"rgb"):o.hasOwnProperty("h")&&o.hasOwnProperty("s")&&o.hasOwnProperty("v")?(o.s=R(o.s),o.v=R(o.v),r=function(e,t,o){e=6*A(e,360),t=A(t,100),o=A(o,100);var r=n.floor(e),i=e-r,s=o*(1-t),a=o*(1-i*t),l=o*(1-(1-i)*t),c=r%6;return{r:255*[o,a,s,s,l,o][c],g:255*[l,o,o,a,s,s][c],b:255*[s,s,l,o,o,a][c]}}(o.h,o.s,o.v),l=!0,c="hsv"):o.hasOwnProperty("h")&&o.hasOwnProperty("s")&&o.hasOwnProperty("l")&&(o.s=R(o.s),o.l=R(o.l),r=function(e,t,o){var n,r,i;function s(e,t,o){return o<0&&(o+=1),o>1&&(o-=1),o<1/6?e+6*(t-e)*o:o<.5?t:o<2/3?e+(t-e)*(2/3-o)*6:e}if(e=A(e,360),t=A(t,100),o=A(o,100),0===t)n=r=i=o;else{var a=o<.5?o*(1+t):o+t-o*t,l=2*o-a;n=s(l,a,e+1/3),r=s(l,a,e),i=s(l,a,e-1/3)}return{r:255*n,g:255*r,b:255*i}}(o.h,o.s,o.l),l=!0,c="hsl"),o.hasOwnProperty("a")&&(a=o.a)),a=O(a),{ok:l,format:o.format||c,r:i(255,s(r.r,0)),g:i(255,s(r.g,0)),b:i(255,s(r.b,0)),a};var d,u,h}(a);this._originalInput=a,this._r=d.r,this._g=d.g,this._b=d.b,this._a=d.a,this._roundA=r(1e3*this._a)/1e3,this._format=c.format||d.format,this._gradientType=c.gradientType,this._r<1&&(this._r=r(this._r)),this._g<1&&(this._g=r(this._g)),this._b<1&&(this._b=r(this._b)),this._ok=d.ok,this._tc_id=o++};function c(e,t,o){e=A(e,255),t=A(t,255),o=A(o,255);var n,r,a=s(e,t,o),l=i(e,t,o),c=(a+l)/2;if(a==l)n=r=0;else{var d=a-l;switch(r=c>.5?d/(2-a-l):d/(a+l),a){case e:n=(t-o)/d+(t<o?6:0);break;case t:n=(o-e)/d+2;break;case o:n=(e-t)/d+4}n/=6}return{h:n,s:r,l:c}}function d(e,t,o){e=A(e,255),t=A(t,255),o=A(o,255);var n,r,a=s(e,t,o),l=i(e,t,o),c=a,d=a-l;if(r=0===a?0:d/a,a==l)n=0;else{switch(a){case e:n=(t-o)/d+(t<o?6:0);break;case t:n=(o-e)/d+2;break;case o:n=(e-t)/d+4}n/=6}return{h:n,s:r,v:c}}function u(e,t,o,n){var i=[P(r(e).toString(16)),P(r(t).toString(16)),P(r(o).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function h(e,t,o,n){return[P((i=n,Math.round(255*parseFloat(i)).toString(16))),P(r(e).toString(16)),P(r(t).toString(16)),P(r(o).toString(16))].join("");var i}function m(e,t){t=0===t?0:t||10;var o=l(e).toHsl();return o.s-=t/100,o.s=M(o.s),l(o)}function p(e,t){t=0===t?0:t||10;var o=l(e).toHsl();return o.s+=t/100,o.s=M(o.s),l(o)}function g(e){return l(e).desaturate(100)}function f(e,t){t=0===t?0:t||10;var o=l(e).toHsl();return o.l+=t/100,o.l=M(o.l),l(o)}function v(e,t){t=0===t?0:t||10;var o=l(e).toRgb();return o.r=s(0,i(255,o.r-r(-t/100*255))),o.g=s(0,i(255,o.g-r(-t/100*255))),o.b=s(0,i(255,o.b-r(-t/100*255))),l(o)}function b(e,t){t=0===t?0:t||10;var o=l(e).toHsl();return o.l-=t/100,o.l=M(o.l),l(o)}function y(e,t){var o=l(e).toHsl(),n=(r(o.h)+t)%360;return o.h=n<0?360+n:n,l(o)}function w(e){var t=l(e).toHsl();return t.h=(t.h+180)%360,l(t)}function _(e){var t=l(e).toHsl(),o=t.h;return[l(e),l({h:(o+120)%360,s:t.s,l:t.l}),l({h:(o+240)%360,s:t.s,l:t.l})]}function x(e){var t=l(e).toHsl(),o=t.h;return[l(e),l({h:(o+90)%360,s:t.s,l:t.l}),l({h:(o+180)%360,s:t.s,l:t.l}),l({h:(o+270)%360,s:t.s,l:t.l})]}function C(e){var t=l(e).toHsl(),o=t.h;return[l(e),l({h:(o+72)%360,s:t.s,l:t.l}),l({h:(o+216)%360,s:t.s,l:t.l})]}function k(e,t,o){t=t||6,o=o||30;var n=l(e).toHsl(),r=360/o,i=[l(e)];for(n.h=(n.h-(r*t>>1)+720)%360;--t;)n.h=(n.h+r)%360,i.push(l(n));return i}function S(e,t){t=t||6;for(var o=l(e).toHsv(),n=o.h,r=o.s,i=o.v,s=[],a=1/t;t--;)s.push(l({h:n,s:r,v:i})),i=(i+a)%1;return s}l.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},setAlpha:function(e){return this._a=O(e),this._roundA=r(1e3*this._a)/1e3,this},toHsv:function(){var e=d(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=d(this._r,this._g,this._b),t=r(360*e.h),o=r(100*e.s),n=r(100*e.v);return 1==this._a?"hsv("+t+", "+o+"%, "+n+"%)":"hsva("+t+", "+o+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=c(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=c(this._r,this._g,this._b),t=r(360*e.h),o=r(100*e.s),n=r(100*e.l);return 1==this._a?"hsl("+t+", "+o+"%, "+n+"%)":"hsla("+t+", "+o+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return u(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(){return h(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:r(this._r),g:r(this._g),b:r(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+r(this._r)+", "+r(this._g)+", "+r(this._b)+")":"rgba("+r(this._r)+", "+r(this._g)+", "+r(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:r(100*A(this._r,255))+"%",g:r(100*A(this._g,255))+"%",b:r(100*A(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+r(100*A(this._r,255))+"%, "+r(100*A(this._g,255))+"%, "+r(100*A(this._b,255))+"%)":"rgba("+r(100*A(this._r,255))+"%, "+r(100*A(this._g,255))+"%, "+r(100*A(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(E[u(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+h(this._r,this._g,this._b,this._a),o=t,n=this._gradientType?"GradientType = 1, ":"";return e&&(o=l(e).toHex8String()),"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+o+")"},toString:function(e){var t=!!e;e=e||this._format;var o=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"name"!==e?("rgb"===e&&(o=this.toRgbString()),"prgb"===e&&(o=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(o=this.toHexString()),"hex3"===e&&(o=this.toHexString(!0)),"hex8"===e&&(o=this.toHex8String()),"name"===e&&(o=this.toName()),"hsl"===e&&(o=this.toHslString()),"hsv"===e&&(o=this.toHsvString()),o||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},_applyModification:function(e,t){var o=e.apply(null,[this].concat([].slice.call(t)));return this._r=o._r,this._g=o._g,this._b=o._b,this.setAlpha(o._a),this},lighten:function(){return this._applyModification(f,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(m,arguments)},saturate:function(){return this._applyModification(p,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(y,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(k,arguments)},complement:function(){return this._applyCombination(w,arguments)},monochromatic:function(){return this._applyCombination(S,arguments)},splitcomplement:function(){return this._applyCombination(C,arguments)},triad:function(){return this._applyCombination(_,arguments)},tetrad:function(){return this._applyCombination(x,arguments)}},l.fromRatio=function(e,t){if("object"==typeof e){var o={};for(var n in e)e.hasOwnProperty(n)&&(o[n]="a"===n?e[n]:R(e[n]));e=o}return l(e,t)},l.equals=function(e,t){return!(!e||!t)&&l(e).toRgbString()==l(t).toRgbString()},l.random=function(){return l.fromRatio({r:a(),g:a(),b:a()})},l.mix=function(e,t,o){o=0===o?0:o||50;var n,r=l(e).toRgb(),i=l(t).toRgb(),s=o/100,a=2*s-1,c=i.a-r.a,d=1-(n=((n=a*c==-1?a:(a+c)/(1+a*c))+1)/2),u={r:i.r*n+r.r*d,g:i.g*n+r.g*d,b:i.b*n+r.b*d,a:i.a*s+r.a*(1-s)};return l(u)},l.readability=function(e,t){var o=l(e),n=l(t),r=o.toRgb(),i=n.toRgb(),s=o.getBrightness(),a=n.getBrightness(),c=Math.max(r.r,i.r)-Math.min(r.r,i.r)+Math.max(r.g,i.g)-Math.min(r.g,i.g)+Math.max(r.b,i.b)-Math.min(r.b,i.b);return{brightness:Math.abs(s-a),color:c}},l.isReadable=function(e,t){var o=l.readability(e,t);return o.brightness>125&&o.color>500},l.mostReadable=function(e,t){for(var o=null,n=0,r=!1,i=0;i<t.length;i++){var s=l.readability(e,t[i]),a=s.brightness>125&&s.color>500,c=s.brightness/125*3+s.color/500;(a&&!r||a&&r&&c>n||!a&&!r&&c>n)&&(r=a,n=c,o=l(t[i]))}return o};var T=l.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},E=l.hexNames=function(e){var t={};for(var o in e)e.hasOwnProperty(o)&&(t[e[o]]=o);return t}(T);function O(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function A(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var o=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=i(t,s(0,parseFloat(e))),o&&(e=parseInt(e*t,10)/100),n.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function M(e){return i(1,s(0,e))}function B(e){return parseInt(e,16)}function P(e){return 1==e.length?"0"+e:""+e}function R(e){return e<=1&&(e=100*e+"%"),e}function V(e){return B(e)/255}var N,D,F,I=(D="[\\s|\\(]+("+(N="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",F="[\\s|\\(]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")[,|\\s]+("+N+")\\s*\\)?",{rgb:new RegExp("rgb"+D),rgba:new RegExp("rgba"+F),hsl:new RegExp("hsl"+D),hsla:new RegExp("hsla"+F),hsv:new RegExp("hsv"+D),hsva:new RegExp("hsva"+F),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});window.tinycolor=l}(),e((function(){e.fn.spectrum.load&&e.fn.spectrum.processNativeColorInputs()}))},void 0===(i=n.apply(t,r))||(e.exports=i)}()},63323:(e,t,o)=>{o(8255)},8255:()=>{!function(){"use strict";var e=window.mailpoetTinymce.util.Tools.resolve("mailpoetTinymce.ModelManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=n=e,(r=String).prototype.isPrototypeOf(o)||(null===(i=n.constructor)||void 0===i?void 0:i.name)===r.name)?"string":t;var o,n,r,i})(t)===e,o=e=>t=>typeof t===e,n=e=>t=>e===t,r=t("string"),i=t("object"),s=t("array"),a=n(null),l=o("boolean"),c=n(void 0),d=e=>!(e=>null==e)(e),u=o("function"),h=o("number"),m=()=>{},p=e=>()=>e,g=e=>e,f=(e,t)=>e===t;function v(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const b=e=>t=>!e(t),y=e=>e(),w=p(!1),_=p(!0);class x{constructor(e,t){this.tag=e,this.value=t}static some(e){return new x(!0,e)}static none(){return x.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?x.some(e(this.value)):x.none()}bind(e){return this.tag?e(this.value):x.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:x.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return d(e)?x.some(e):x.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}x.singletonNone=new x(!1);const C=Array.prototype.slice,k=Array.prototype.indexOf,S=Array.prototype.push,T=(e,t)=>{return o=e,n=t,k.call(o,n)>-1;var o,n},E=(e,t)=>{for(let o=0,n=e.length;o<n;o++)if(t(e[o],o))return!0;return!1},O=(e,t)=>{const o=[];for(let n=0;n<e;n++)o.push(t(n));return o},A=(e,t)=>{const o=e.length,n=new Array(o);for(let r=0;r<o;r++){const o=e[r];n[r]=t(o,r)}return n},M=(e,t)=>{for(let o=0,n=e.length;o<n;o++)t(e[o],o)},B=(e,t)=>{const o=[],n=[];for(let r=0,i=e.length;r<i;r++){const i=e[r];(t(i,r)?o:n).push(i)}return{pass:o,fail:n}},P=(e,t)=>{const o=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];t(r,n)&&o.push(r)}return o},R=(e,t,o)=>(((e,t)=>{for(let o=e.length-1;o>=0;o--)t(e[o],o)})(e,((e,n)=>{o=t(o,e,n)})),o),V=(e,t,o)=>(M(e,((e,n)=>{o=t(o,e,n)})),o),N=(e,t)=>((e,t,o)=>{for(let n=0,r=e.length;n<r;n++){const r=e[n];if(t(r,n))return x.some(r);if(o(r,n))break}return x.none()})(e,t,w),D=(e,t)=>{for(let o=0,n=e.length;o<n;o++)if(t(e[o],o))return x.some(o);return x.none()},F=e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!s(e[o]))throw new Error("Arr.flatten item "+o+" was not an array, input: "+e);S.apply(t,e[o])}return t},I=(e,t)=>F(A(e,t)),L=(e,t)=>{for(let o=0,n=e.length;o<n;++o)if(!0!==t(e[o],o))return!1;return!0},z=(e,t)=>{const o={};for(let n=0,r=e.length;n<r;n++){const r=e[n];o[String(r)]=t(r,n)}return o},H=(e,t)=>t>=0&&t<e.length?x.some(e[t]):x.none(),Z=e=>H(e,0),j=e=>H(e,e.length-1),U=(e,t)=>{for(let o=0;o<e.length;o++){const n=t(e[o],o);if(n.isSome())return n}return x.none()},$=Object.keys,W=Object.hasOwnProperty,q=(e,t)=>{const o=$(e);for(let n=0,r=o.length;n<r;n++){const r=o[n];t(e[r],r)}},G=(e,t)=>Y(e,((e,o)=>({k:o,v:t(e,o)}))),Y=(e,t)=>{const o={};return q(e,((e,n)=>{const r=t(e,n);o[r.k]=r.v})),o},X=(e,t)=>{const o=[];return q(e,((e,n)=>{o.push(t(e,n))})),o},K=e=>X(e,g),J=(e,t)=>W.call(e,t);"undefined"!=typeof window?window:Function("return this;")();const Q=e=>e.dom.nodeName.toLowerCase(),ee=e=>e.dom.nodeType,te=e=>t=>ee(t)===e,oe=e=>8===ee(e)||"#comment"===Q(e),ne=te(1),re=te(3),ie=te(9),se=te(11),ae=e=>t=>ne(t)&&Q(t)===e,le=(e,t,o)=>{if(!(r(o)||l(o)||h(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")},ce=(e,t,o)=>{le(e.dom,t,o)},de=(e,t)=>{const o=e.dom;q(t,((e,t)=>{le(o,t,e)}))},ue=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},he=(e,t)=>x.from(ue(e,t)),me=(e,t)=>{e.dom.removeAttribute(t)},pe=e=>V(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}),ge=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},fe={fromHtml:(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return ge(o.childNodes[0])},fromTag:(e,t)=>{const o=(t||document).createElement(e);return ge(o)},fromText:(e,t)=>{const o=(t||document).createTextNode(e);return ge(o)},fromDom:ge,fromPoint:(e,t,o)=>x.from(e.dom.elementFromPoint(t,o)).map(ge)},ve=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},be=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,ye=(e,t)=>{const o=void 0===t?document:t.dom;return be(o)?x.none():x.from(o.querySelector(e)).map(fe.fromDom)},we=(e,t)=>e.dom===t.dom,_e=(e,t)=>{const o=e.dom,n=t.dom;return o!==n&&o.contains(n)},xe=ve,Ce=e=>fe.fromDom(e.dom.ownerDocument),ke=e=>ie(e)?e:Ce(e),Se=e=>x.from(e.dom.parentNode).map(fe.fromDom),Te=(e,t)=>{const o=u(t)?t:w;let n=e.dom;const r=[];for(;null!==n.parentNode&&void 0!==n.parentNode;){const e=n.parentNode,t=fe.fromDom(e);if(r.push(t),!0===o(t))break;n=e}return r},Ee=e=>x.from(e.dom.previousSibling).map(fe.fromDom),Oe=e=>x.from(e.dom.nextSibling).map(fe.fromDom),Ae=e=>A(e.dom.childNodes,fe.fromDom),Me=(e,t)=>{const o=e.dom.childNodes;return x.from(o[t]).map(fe.fromDom)},Be=(e,t)=>{Se(e).each((o=>{o.dom.insertBefore(t.dom,e.dom)}))},Pe=(e,t)=>{Oe(e).fold((()=>{Se(e).each((e=>{Ve(e,t)}))}),(e=>{Be(e,t)}))},Re=(e,t)=>{const o=(e=>Me(e,0))(e);o.fold((()=>{Ve(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))},Ve=(e,t)=>{e.dom.appendChild(t.dom)},Ne=(e,t)=>{Be(e,t),Ve(t,e)},De=(e,t)=>{M(t,((o,n)=>{const r=0===n?e:t[n-1];Pe(r,o)}))},Fe=(e,t)=>{M(t,(t=>{Ve(e,t)}))},Ie=e=>{e.dom.textContent="",M(Ae(e),(e=>{Le(e)}))},Le=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},ze=e=>{const t=Ae(e);t.length>0&&De(e,t),Le(e)},He=(e,t)=>fe.fromDom(e.dom.cloneNode(t)),Ze=e=>He(e,!1),je=e=>He(e,!0),Ue=(e,t)=>{const o=fe.fromTag(t),n=pe(e);return de(o,n),o},$e=["tfoot","thead","tbody","colgroup"],We=(e,t,o)=>({element:e,rowspan:t,colspan:o}),qe=(e,t,o)=>({element:e,cells:t,section:o}),Ge=(e,t,o)=>({element:e,isNew:t,isLocked:o}),Ye=(e,t,o,n)=>({element:e,cells:t,section:o,isNew:n}),Xe=u(Element.prototype.attachShadow)&&u(Node.prototype.getRootNode),Ke=p(Xe),Je=Xe?e=>fe.fromDom(e.dom.getRootNode()):ke,Qe=e=>fe.fromDom(e.dom.host),et=e=>{const t=re(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return(e=>{const t=Je(e);return se(o=t)&&d(o.dom.host)?x.some(t):x.none();var o})(fe.fromDom(t)).fold((()=>o.body.contains(t)),(n=et,r=Qe,e=>n(r(e))));var n,r},tt=e=>{const t=e.dom.body;if(null==t)throw new Error("Body is not available yet");return fe.fromDom(t)},ot=(e,t)=>{let o=[];return M(Ae(e),(e=>{t(e)&&(o=o.concat([e])),o=o.concat(ot(e,t))})),o},nt=(e,t,o)=>((e,o,n)=>P(Te(e,n),(e=>ve(e,t))))(e,0,o),rt=(e,t)=>((e,o)=>P(Ae(e),(e=>ve(e,t))))(e),it=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return be(o)?[]:A(o.querySelectorAll(e),fe.fromDom)})(t,e);var st=(e,t,o,n,r)=>e(o,n)?x.some(o):u(r)&&r(o)?x.none():t(o,n,r);const at=(e,t,o)=>{let n=e.dom;const r=u(o)?o:w;for(;n.parentNode;){n=n.parentNode;const e=fe.fromDom(n);if(t(e))return x.some(e);if(r(e))break}return x.none()},lt=(e,t,o)=>at(e,(e=>ve(e,t)),o),ct=(e,t)=>((e,o)=>N(e.dom.childNodes,(e=>{return o=fe.fromDom(e),ve(o,t);var o})).map(fe.fromDom))(e),dt=(e,t)=>ye(t,e),ut=(e,t,o)=>st(((e,t)=>ve(e,t)),lt,e,t,o),ht=(e,t,o=f)=>e.exists((e=>o(e,t))),mt=e=>{const t=[],o=e=>{t.push(e)};for(let t=0;t<e.length;t++)e[t].each(o);return t},pt=(e,t)=>e?x.some(t):x.none(),gt=(e,t,o)=>""===t||e.length>=t.length&&e.substr(o,o+t.length)===t,ft=(e,t,o=0,n)=>{const r=e.indexOf(t,o);return-1!==r&&(!!c(n)||r+t.length<=n)},vt=(e,t)=>gt(e,t,0),bt=(e,t)=>gt(e,t,e.length-t.length),yt=(e=>t=>t.replace(e,""))(/^\s+|\s+$/g),wt=e=>e.length>0,_t=e=>void 0!==e.style&&u(e.style.getPropertyValue),xt=(e,t,o)=>{if(!r(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);_t(e)&&e.style.setProperty(t,o)},Ct=(e,t,o)=>{const n=e.dom;xt(n,t,o)},kt=(e,t)=>{const o=e.dom;q(t,((e,t)=>{xt(o,t,e)}))},St=(e,t)=>{const o=e.dom,n=window.getComputedStyle(o).getPropertyValue(t);return""!==n||et(e)?n:Tt(o,t)},Tt=(e,t)=>_t(e)?e.style.getPropertyValue(t):"",Et=(e,t)=>{const o=e.dom,n=Tt(o,t);return x.from(n).filter((e=>e.length>0))},Ot=(e,t)=>{((e,t)=>{_t(e)&&e.style.removeProperty(t)})(e.dom,t),ht(he(e,"style").map(yt),"")&&me(e,"style")},At=(e,t,o=0)=>he(e,t).map((e=>parseInt(e,10))).getOr(o),Mt=(e,t)=>At(e,t,1),Bt=e=>ae("col")(e)?At(e,"span",1)>1:Mt(e,"colspan")>1,Pt=e=>Mt(e,"rowspan")>1,Rt=(e,t)=>parseInt(St(e,t),10),Vt=p(10),Nt=p(10),Dt=(e,t)=>Ft(e,t,_),Ft=(e,t,o)=>I(Ae(e),(e=>ve(e,t)?o(e)?[e]:[]:Ft(e,t,o))),It=(e,t)=>((e,t,o=w)=>o(t)?x.none():T(e,Q(t))?x.some(t):lt(t,e.join(","),(e=>ve(e,"table")||o(e))))(["td","th"],e,t),Lt=e=>Dt(e,"th,td"),zt=e=>ve(e,"colgroup")?rt(e,"col"):I(jt(e),(e=>rt(e,"col"))),Ht=(e,t)=>ut(e,"table",t),Zt=e=>Dt(e,"tr"),jt=e=>Ht(e).fold(p([]),(e=>rt(e,"colgroup"))),Ut=(e,t)=>A(e,(e=>{if("colgroup"===Q(e)){const t=A(zt(e),(e=>{const t=At(e,"span",1);return We(e,1,t)}));return qe(e,t,"colgroup")}{const o=A(Lt(e),(e=>{const t=At(e,"rowspan",1),o=At(e,"colspan",1);return We(e,t,o)}));return qe(e,o,t(e))}})),$t=e=>Se(e).map((e=>{const t=Q(e);return(e=>T($e,e))(t)?t:"tbody"})).getOr("tbody"),Wt=e=>{const t=Zt(e),o=[...jt(e),...t];return Ut(o,$t)},qt=e=>{let t,o=!1;return(...n)=>(o||(o=!0,t=e.apply(null,n)),t)},Gt=()=>Yt(0,0),Yt=(e,t)=>({major:e,minor:t}),Xt={nu:Yt,detect:(e,t)=>{const o=String(t).toLowerCase();return 0===e.length?Gt():((e,t)=>{const o=((e,t)=>{for(let o=0;o<e.length;o++){const n=e[o];if(n.test(t))return n}})(e,t);if(!o)return{major:0,minor:0};const n=e=>Number(t.replace(o,"$"+e));return Yt(n(1),n(2))})(e,o)},unknown:Gt},Kt=(e,t)=>{const o=String(t).toLowerCase();return N(e,(e=>e.search(o)))},Jt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Qt=e=>t=>ft(t,e),eo=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>ft(e,"edge/")&&ft(e,"chrome")&&ft(e,"safari")&&ft(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Jt],search:e=>ft(e,"chrome")&&!ft(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>ft(e,"msie")||ft(e,"trident")},{name:"Opera",versionRegexes:[Jt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Qt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Qt("firefox")},{name:"Safari",versionRegexes:[Jt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(ft(e,"safari")||ft(e,"mobile/"))&&ft(e,"applewebkit")}],to=[{name:"Windows",search:Qt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>ft(e,"iphone")||ft(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Qt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:Qt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Qt("linux"),versionRegexes:[]},{name:"Solaris",search:Qt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Qt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Qt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],oo={browsers:p(eo),oses:p(to)},no="Edge",ro="Chromium",io="Opera",so="Firefox",ao="Safari",lo=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isEdge:n(no),isChromium:n(ro),isIE:n("IE"),isOpera:n(io),isFirefox:n(so),isSafari:n(ao)}},co=()=>lo({current:void 0,version:Xt.unknown()}),uo=lo,ho=(p(no),p(ro),p("IE"),p(io),p(so),p(ao),"Windows"),mo="Android",po="Linux",go="macOS",fo="Solaris",vo="FreeBSD",bo="ChromeOS",yo=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isWindows:n(ho),isiOS:n("iOS"),isAndroid:n(mo),isMacOS:n(go),isLinux:n(po),isSolaris:n(fo),isFreeBSD:n(vo),isChromeOS:n(bo)}},wo=()=>yo({current:void 0,version:Xt.unknown()}),_o=yo,xo=(p(ho),p("iOS"),p(mo),p(po),p(go),p(fo),p(vo),p(bo),e=>window.matchMedia(e).matches);let Co=qt((()=>((e,t,o)=>{const n=oo.browsers(),r=oo.oses(),i=t.bind((e=>((e,t)=>U(t.brands,(t=>{const o=t.brand.toLowerCase();return N(e,(e=>{var t;return o===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((e=>({current:e.name,version:Xt.nu(parseInt(t.version,10),0)})))})))(n,e))).orThunk((()=>((e,t)=>Kt(e,t).map((e=>{const o=Xt.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(n,e))).fold(co,uo),s=((e,t)=>Kt(e,t).map((e=>{const o=Xt.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(r,e).fold(wo,_o),a=((e,t,o,n)=>{const r=e.isiOS()&&!0===/ipad/i.test(o),i=e.isiOS()&&!r,s=e.isiOS()||e.isAndroid(),a=s||n("(pointer:coarse)"),l=r||!i&&s&&n("(min-device-width:768px)"),c=i||s&&!l,d=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(o),u=!c&&!l&&!d;return{isiPad:p(r),isiPhone:p(i),isTablet:p(l),isPhone:p(c),isTouch:p(a),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:p(d),isDesktop:p(u)}})(s,i,e,o);return{browser:i,os:s,deviceType:a}})(navigator.userAgent,x.from(navigator.userAgentData),xo)));const ko=()=>Co(),So=(e,t)=>{const o=o=>{const n=t(o);if(n<=0||null===n){const t=St(o,e);return parseFloat(t)||0}return n},n=(e,t)=>V(t,((t,o)=>{const n=St(e,o),r=void 0===n?0:parseInt(n,10);return isNaN(r)?t:t+r}),0);return{set:(t,o)=>{if(!h(o)&&!o.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+o);const n=t.dom;_t(n)&&(n.style[e]=o+"px")},get:o,getOuter:o,aggregate:n,max:(e,t,o)=>{const r=n(e,o);return t>r?t-r:0}}},To=(e,t,o)=>((e,t)=>(e=>{const t=parseFloat(e);return isNaN(t)?x.none():x.some(t)})(e).getOr(t))(St(e,t),o),Eo=So("width",(e=>e.dom.offsetWidth)),Oo=e=>Eo.get(e),Ao=e=>Eo.getOuter(e),Mo=e=>((e,t)=>{const o=e.dom,n=o.getBoundingClientRect().width||o.offsetWidth;return"border-box"===t?n:((e,t,o,n)=>t-To(e,`padding-${o}`,0)-To(e,`padding-${n}`,0)-To(e,`border-${o}-width`,0)-To(e,`border-${n}-width`,0))(e,n,"left","right")})(e,"content-box"),Bo=(e,t,o)=>{const n=e.cells,r=n.slice(0,t),i=n.slice(t),s=r.concat(o).concat(i);return Vo(e,s)},Po=(e,t,o)=>Bo(e,t,[o]),Ro=(e,t,o)=>{e.cells[t]=o},Vo=(e,t)=>Ye(e.element,t,e.section,e.isNew),No=(e,t)=>e.cells[t],Do=(e,t)=>No(e,t).element,Fo=e=>e.cells.length,Io=e=>{const t=B(e,(e=>"colgroup"===e.section));return{rows:t.fail,cols:t.pass}},Lo=(e,t,o)=>{const n=A(e.cells,o);return Ye(t(e.element),n,e.section,!0)},zo="data-snooker-locked-cols",Ho=e=>he(e,zo).bind((e=>x.from(e.match(/\d+/g)))).map((e=>z(e,_))),Zo=e=>{const t=V(Io(e).rows,((e,t)=>(M(t.cells,((t,o)=>{t.isLocked&&(e[o]=!0)})),e)),{}),o=X(t,((e,t)=>parseInt(t,10)));return((e,t)=>{const o=C.call(e,0);return o.sort(void 0),o})(o)},jo=(e,t)=>e+","+t,Uo=(e,t)=>{const o=I(e.all,(e=>e.cells));return P(o,t)},$o=e=>{const t={},o=[],n=Z(e).map((e=>e.element)).bind(Ht).bind(Ho).getOr({});let r=0,i=0,s=0;const{pass:a,fail:l}=B(e,(e=>"colgroup"===e.section));M(l,(e=>{const a=[];M(e.cells,(e=>{let o=0;for(;void 0!==t[jo(s,o)];)o++;const r=((e,t)=>J(e,t)&&void 0!==e[t]&&null!==e[t])(n,o.toString()),l=((e,t,o,n,r,i)=>({element:e,rowspan:t,colspan:o,row:n,column:r,isLocked:i}))(e.element,e.rowspan,e.colspan,s,o,r);for(let n=0;n<e.colspan;n++)for(let r=0;r<e.rowspan;r++){const e=o+n,a=jo(s+r,e);t[a]=l,i=Math.max(i,e+1)}a.push(l)})),r++,o.push(qe(e.element,a,e.section)),s++}));const{columns:c,colgroups:d}=j(a).map((e=>{const t=(e=>{const t={};let o=0;return M(e.cells,(e=>{const n=e.colspan;O(n,(r=>{const i=o+r;t[i]=((e,t,o)=>({element:e,colspan:t,column:o}))(e.element,n,i)})),o+=n})),t})(e),o=((e,t)=>({element:e,columns:t}))(e.element,K(t));return{colgroups:[o],columns:t}})).getOrThunk((()=>({colgroups:[],columns:{}}))),u=((e,t)=>({rows:e,columns:t}))(r,i);return{grid:u,access:t,all:o,columns:c,colgroups:d}},Wo=e=>{const t=Wt(e);return $o(t)},qo=$o,Go=(e,t,o)=>x.from(e.access[jo(t,o)]),Yo=(e,t,o)=>{const n=Uo(e,(e=>o(t,e.element)));return n.length>0?x.some(n[0]):x.none()},Xo=Uo,Ko=e=>I(e.all,(e=>e.cells)),Jo=e=>K(e.columns),Qo=e=>$(e.columns).length>0,en=(e,t)=>x.from(e.columns[t]),tn=(e,t=_)=>{const o=e.grid,n=O(o.columns,g),r=O(o.rows,g);return A(n,(o=>on((()=>I(r,(t=>Go(e,t,o).filter((e=>e.column===o)).toArray()))),(e=>1===e.colspan&&t(e.element)),(()=>Go(e,0,o)))))},on=(e,t,o)=>{const n=e();return N(n,t).orThunk((()=>x.from(n[0]).orThunk(o))).map((e=>e.element))},nn=e=>{const t=e.grid,o=O(t.rows,g),n=O(t.columns,g);return A(o,(t=>on((()=>I(n,(o=>Go(e,t,o).filter((e=>e.row===t)).fold(p([]),(e=>[e]))))),(e=>1===e.rowspan),(()=>Go(e,t,0)))))},rn=(e,t)=>o=>"rtl"===sn(o)?t:e,sn=e=>"rtl"===St(e,"direction")?"rtl":"ltr",an=So("height",(e=>{const t=e.dom;return et(e)?t.getBoundingClientRect().height:t.offsetHeight})),ln=e=>an.get(e),cn=e=>an.getOuter(e),dn=(e,t)=>({left:e,top:t,translate:(o,n)=>dn(e+o,t+n)}),un=dn,hn=(e,t)=>void 0!==e?e:void 0!==t?t:0,mn=e=>{const t=e.dom.ownerDocument,o=t.body,n=t.defaultView,r=t.documentElement;if(o===e.dom)return un(o.offsetLeft,o.offsetTop);const i=hn(null==n?void 0:n.pageYOffset,r.scrollTop),s=hn(null==n?void 0:n.pageXOffset,r.scrollLeft),a=hn(r.clientTop,o.clientTop),l=hn(r.clientLeft,o.clientLeft);return pn(e).translate(s-l,i-a)},pn=e=>{const t=e.dom,o=t.ownerDocument.body;return o===t?un(o.offsetLeft,o.offsetTop):et(e)?(e=>{const t=e.getBoundingClientRect();return un(t.left,t.top)})(t):un(0,0)},gn=(e,t)=>({row:e,y:t}),fn=(e,t)=>({col:e,x:t}),vn=e=>mn(e).left+Ao(e),bn=e=>mn(e).left,yn=(e,t)=>fn(e,bn(t)),wn=(e,t)=>fn(e,vn(t)),_n=e=>mn(e).top,xn=(e,t)=>gn(e,_n(t)),Cn=(e,t)=>gn(e,_n(t)+cn(t)),kn=(e,t,o)=>{if(0===o.length)return[];const n=A(o.slice(1),((t,o)=>t.map((t=>e(o,t))))),r=o[o.length-1].map((e=>t(o.length-1,e)));return n.concat([r])},Sn={delta:g,positions:e=>kn(xn,Cn,e),edge:_n},Tn=rn({delta:g,edge:bn,positions:e=>kn(yn,wn,e)},{delta:e=>-e,edge:vn,positions:e=>kn(wn,yn,e)}),En={delta:(e,t)=>Tn(t).delta(e,t),positions:(e,t)=>Tn(t).positions(e,t),edge:e=>Tn(e).edge(e)},On={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},An=(()=>{const e="[0-9]+",t="[eE][+-]?"+e,o=e=>`(?:${e})?`,n=["Infinity",e+"\\."+o(e)+o(t),"\\."+e+o(t),e+o(t)].join("|");return new RegExp(`^([+-]?(?:${n}))(.*)$`)})(),Mn=/(\d+(\.\d+)?)%/,Bn=/(\d+(\.\d+)?)px|em/,Pn=ae("col"),Rn=(e,t,o)=>{const n=(r=e,x.from(r.dom.parentElement).map(fe.fromDom)).getOrThunk((()=>tt(Ce(e))));var r;return t(e)/o(n)*100},Vn=(e,t)=>{Ct(e,"width",t+"px")},Nn=(e,t)=>{Ct(e,"width",t+"%")},Dn=(e,t)=>{Ct(e,"height",t+"px")},Fn=e=>{const t=(e=>{return To(t=e,"height",t.dom.offsetHeight)+"px";var t})(e);return t?((e,t,o,n)=>{const r=parseFloat(e);return bt(e,"%")&&"table"!==Q(t)?((e,t,o,n)=>{const r=Ht(e).map((e=>{const n=o(e);return Math.floor(t/100*n)})).getOr(t);return n(e,r),r})(t,r,o,n):r})(t,e,ln,Dn):ln(e)},In=(e,t)=>Et(e,t).orThunk((()=>he(e,t).map((e=>e+"px")))),Ln=e=>In(e,"width"),zn=e=>Rn(e,Oo,Mo),Hn=e=>{return Pn(e)?Oo(e):To(t=e,"width",t.dom.offsetWidth);var t},Zn=e=>((e,t,o)=>o(e)/Mt(e,"rowspan"))(e,0,Fn),jn=(e,t,o)=>{Ct(e,"width",t+o)},Un=e=>Rn(e,Oo,Mo)+"%",$n=p(Mn),Wn=ae("col"),qn=e=>Ln(e).getOrThunk((()=>Hn(e)+"px")),Gn=e=>{return(t=e,In(t,"height")).getOrThunk((()=>Zn(e)+"px"));var t},Yn=(e,t,o,n,r,i)=>e.filter(n).fold((()=>i(((e,t)=>{if(t<0||t>=e.length-1)return x.none();const o=e[t].fold((()=>{const o=(e=>{const t=C.call(e,0);return t.reverse(),t})(e.slice(0,t));return U(o,((e,t)=>e.map((e=>({value:e,delta:t+1})))))}),(e=>x.some({value:e,delta:0}))),n=e[t+1].fold((()=>{const o=e.slice(t+1);return U(o,((e,t)=>e.map((e=>({value:e,delta:t+1})))))}),(e=>x.some({value:e,delta:1})));return o.bind((e=>n.map((t=>{const o=t.delta+e.delta;return Math.abs(t.value-e.value)/o}))))})(o,t))),(e=>r(e))),Xn=(e,t,o,n)=>{const r=tn(e),i=Qo(e)?(e=>A(Jo(e),(e=>x.from(e.element))))(e):r,s=[x.some(En.edge(t))].concat(A(En.positions(r,t),(e=>e.map((e=>e.x))))),a=b(Bt);return A(i,((e,t)=>Yn(e,t,s,a,(e=>{if((e=>{const t=ko().browser,o=t.isChromium()||t.isFirefox();return!Wn(e)||o})(e))return o(e);{const e=null!=(i=r[t])?g(i):x.none();return Yn(e,t,s,a,(e=>n(x.some(Oo(e)))),n)}var i}),n)))},Kn=e=>e.map((e=>e+"px")).getOr(""),Jn=(e,t,o)=>Xn(e,t,Hn,(e=>e.getOrThunk(o.minCellWidth))),Qn=(e,t,o,n,r)=>{const i=nn(e),s=[x.some(o.edge(t))].concat(A(o.positions(i,t),(e=>e.map((e=>e.y)))));return A(i,((e,t)=>Yn(e,t,s,b(Pt),n,r)))},er=(e,t)=>()=>et(e)?t(e):parseFloat(Et(e,"width").getOr("0")),tr=e=>{const t=er(e,(e=>parseFloat(Un(e)))),o=er(e,Oo);return{width:t,pixelWidth:o,getWidths:(t,o)=>((e,t,o)=>Xn(e,t,zn,(e=>e.fold((()=>o.minCellWidth()),(e=>e/o.pixelWidth()*100)))))(t,e,o),getCellDelta:e=>e/o()*100,singleColumnWidth:(e,t)=>[100-e],minCellWidth:()=>Vt()/o()*100,setElementWidth:Nn,adjustTableWidth:o=>{const n=t();Nn(e,n+o/100*n)},isRelative:!0,label:"percent"}},or=e=>{const t=er(e,Oo);return{width:t,pixelWidth:t,getWidths:(t,o)=>Jn(t,e,o),getCellDelta:g,singleColumnWidth:(e,t)=>[Math.max(Vt(),e+t)-e],minCellWidth:Vt,setElementWidth:Vn,adjustTableWidth:o=>{const n=t()+o;Vn(e,n)},isRelative:!1,label:"pixel"}},nr=e=>Ln(e).fold((()=>(e=>{const t=er(e,Oo),o=p(0);return{width:t,pixelWidth:t,getWidths:(t,o)=>Jn(t,e,o),getCellDelta:o,singleColumnWidth:p([0]),minCellWidth:o,setElementWidth:m,adjustTableWidth:m,isRelative:!0,label:"none"}})(e)),(t=>((e,t)=>null!==$n().exec(t)?tr(e):or(e))(e,t))),rr=or,ir=tr,sr=(e,t,o)=>{const n=e[o].element,r=fe.fromTag("td");Ve(r,fe.fromTag("br")),(t?Ve:Re)(n,r)},ar=((e,t)=>{const o=t=>e(t)?x.from(t.dom.nodeValue):x.none();return{get:t=>{if(!e(t))throw new Error("Can only get text value of a text node");return o(t).getOr("")},getOption:o,set:(t,o)=>{if(!e(t))throw new Error("Can only set raw text value of a text node");t.dom.nodeValue=o}}})(re),lr=e=>ar.get(e),cr=e=>ar.getOption(e),dr=(e,t)=>ar.set(e,t),ur=e=>"img"===Q(e)?1:cr(e).fold((()=>Ae(e).length),(e=>e.length)),hr=["img","br"],mr=e=>cr(e).filter((e=>0!==e.trim().length||e.indexOf(" ")>-1)).isSome()||T(hr,Q(e)),pr=e=>((e,t)=>{const o=e=>{for(let n=0;n<e.childNodes.length;n++){const r=fe.fromDom(e.childNodes[n]);if(t(r))return x.some(r);const i=o(e.childNodes[n]);if(i.isSome())return i}return x.none()};return o(e.dom)})(e,mr),gr=e=>fr(e,mr),fr=(e,t)=>{const o=e=>{const n=Ae(e);for(let e=n.length-1;e>=0;e--){const r=n[e];if(t(r))return x.some(r);const i=o(r);if(i.isSome())return i}return x.none()};return o(e)},vr={scope:["row","col"]},br=e=>()=>{const t=fe.fromTag("td",e.dom);return Ve(t,fe.fromTag("br",e.dom)),t},yr=e=>()=>fe.fromTag("col",e.dom),wr=e=>()=>fe.fromTag("colgroup",e.dom),_r=e=>()=>fe.fromTag("tr",e.dom),xr=(e,t,o)=>{const n=((e,t)=>{const o=Ue(e,t),n=Ae(je(e));return Fe(o,n),o})(e,t);return q(o,((e,t)=>{null===e?me(n,t):ce(n,t,e)})),n},Cr=e=>e,kr=(e,t,o)=>{const n=(e,t)=>{((e,t)=>{const o=e.dom,n=t.dom;_t(o)&&_t(n)&&(n.style.cssText=o.style.cssText)})(e.element,t),Ot(t,"height"),1!==e.colspan&&Ot(t,"width")};return{col:o=>{const r=fe.fromTag(Q(o.element),t.dom);return n(o,r),e(o.element,r),r},colgroup:wr(t),row:_r(t),cell:r=>{const i=fe.fromTag(Q(r.element),t.dom),s=o.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),a=s.length>0?((e,t,o)=>pr(e).map((n=>{const r=o.join(","),i=nt(n,r,(t=>we(t,e)));return R(i,((e,t)=>{const o=Ze(t);return me(o,"contenteditable"),Ve(e,o),o}),t)})).getOr(t))(r.element,i,s):i;return Ve(a,fe.fromTag("br")),n(r,i),((e,t)=>{q(vr,((o,n)=>he(e,n).filter((e=>T(o,e))).each((e=>ce(t,n,e)))))})(r.element,i),e(r.element,i),i},replace:xr,colGap:yr(t),gap:br(t)}},Sr=e=>({col:yr(e),colgroup:wr(e),row:_r(e),cell:br(e),replace:Cr,colGap:yr(e),gap:br(e)}),Tr=e=>fe.fromDom(e.getBody()),Er=e=>t=>we(t,Tr(e)),Or=e=>{me(e,"data-mce-style");const t=e=>me(e,"data-mce-style");M(Lt(e),t),M(zt(e),t),M(Zt(e),t)},Ar=e=>fe.fromDom(e.selection.getStart()),Mr=e=>e.getBoundingClientRect().width,Br=e=>e.getBoundingClientRect().height,Pr=(e,t)=>{const o=t.column,n=t.column+t.colspan-1,r=t.row,i=t.row+t.rowspan-1;return o<=e.finishCol&&n>=e.startCol&&r<=e.finishRow&&i>=e.startRow},Rr=(e,t)=>t.column>=e.startCol&&t.column+t.colspan-1<=e.finishCol&&t.row>=e.startRow&&t.row+t.rowspan-1<=e.finishRow,Vr=(e,t,o)=>{const n=Yo(e,t,we),r=Yo(e,o,we);return n.bind((e=>r.map((t=>{return o=e,n=t,{startRow:Math.min(o.row,n.row),startCol:Math.min(o.column,n.column),finishRow:Math.max(o.row+o.rowspan-1,n.row+n.rowspan-1),finishCol:Math.max(o.column+o.colspan-1,n.column+n.colspan-1)};var o,n}))))},Nr=(e,t,o)=>Vr(e,t,o).map((t=>{const o=Xo(e,v(Pr,t));return A(o,(e=>e.element))})),Dr=(e,t)=>Yo(e,t,((e,t)=>_e(t,e))).map((e=>e.element)),Fr=(e,t,o)=>{const n=Lr(e);return Nr(n,t,o)},Ir=(e,t,o,n,r)=>{const i=Lr(e),s=we(e,o)?x.some(t):Dr(i,t),a=we(e,r)?x.some(n):Dr(i,n);return s.bind((e=>a.bind((t=>Nr(i,e,t)))))},Lr=Wo;var zr=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],Hr=()=>({up:p({selector:lt,closest:ut,predicate:at,all:Te}),down:p({selector:it,predicate:ot}),styles:p({get:St,getRaw:Et,set:Ct,remove:Ot}),attrs:p({get:ue,set:ce,remove:me,copyTo:(e,t)=>{const o=pe(e);de(t,o)}}),insert:p({before:Be,after:Pe,afterAll:De,append:Ve,appendAll:Fe,prepend:Re,wrap:Ne}),remove:p({unwrap:ze,remove:Le}),create:p({nu:fe.fromTag,clone:e=>fe.fromDom(e.dom.cloneNode(!1)),text:fe.fromText}),query:p({comparePosition:(e,t)=>e.dom.compareDocumentPosition(t.dom),prevSibling:Ee,nextSibling:Oe}),property:p({children:Ae,name:Q,parent:Se,document:e=>ke(e).dom,isText:re,isComment:oe,isElement:ne,isSpecial:e=>{const t=Q(e);return T(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],t)},getLanguage:e=>ne(e)?he(e,"lang"):x.none(),getText:lr,setText:dr,isBoundary:e=>!!ne(e)&&("body"===Q(e)||T(zr,Q(e))),isEmptyTag:e=>!!ne(e)&&T(["br","img","hr","input"],Q(e)),isNonEditable:e=>ne(e)&&"false"===ue(e,"contenteditable")}),eq:we,is:xe});const Zr=(e,t,o,n)=>{const r=t(e,o);return R(n,((o,n)=>{const r=t(e,n);return jr(e,o,r)}),r)},jr=(e,t,o)=>t.bind((t=>o.filter(v(e.eq,t)))),Ur=Hr(),$r=(e,t)=>((e,t,o)=>o.length>0?((e,t,o,n)=>n(e,t,o[0],o.slice(1)))(e,t,o,Zr):x.none())(Ur,((t,o)=>e(o)),t),Wr=e=>lt(e,"table"),qr=(e,t,o)=>{const n=e=>t=>void 0!==o&&o(t)||we(t,e);return we(e,t)?x.some({boxes:x.some([e]),start:e,finish:t}):Wr(e).bind((r=>Wr(t).bind((i=>{if(we(r,i))return x.some({boxes:Fr(r,e,t),start:e,finish:t});if(_e(r,i)){const o=nt(t,"td,th",n(r)),s=o.length>0?o[o.length-1]:t;return x.some({boxes:Ir(r,e,r,t,i),start:e,finish:s})}if(_e(i,r)){const o=nt(e,"td,th",n(i)),s=o.length>0?o[o.length-1]:e;return x.some({boxes:Ir(i,e,r,t,i),start:e,finish:s})}return((e,t,o)=>((e,t,o,n=w)=>{const r=[t].concat(e.up().all(t)),i=[o].concat(e.up().all(o)),s=e=>D(e,n).fold((()=>e),(t=>e.slice(0,t+1))),a=s(r),l=s(i),c=N(a,(t=>E(l,((e,t)=>v(e.eq,t))(e,t))));return{firstpath:a,secondpath:l,shared:c}})(Ur,e,t,void 0))(e,t).shared.bind((s=>ut(s,"table",o).bind((o=>{const s=nt(t,"td,th",n(o)),a=s.length>0?s[s.length-1]:t,l=nt(e,"td,th",n(o)),c=l.length>0?l[l.length-1]:e;return x.some({boxes:Ir(o,e,r,t,i),start:c,finish:a})}))))}))))},Gr=(e,t)=>{const o=it(e,t);return o.length>0?x.some(o):x.none()},Yr=(e,t,o)=>dt(e,t).bind((t=>dt(e,o).bind((e=>$r(Wr,[t,e]).map((o=>({first:t,last:e,table:o}))))))),Xr=(e,t,o,n,r)=>((e,t)=>N(e,(e=>ve(e,t))))(e,r).bind((e=>((e,t,o)=>Ht(e).bind((n=>((e,t,o,n)=>Yo(e,t,we).bind((t=>{const r=o>0?t.row+t.rowspan-1:t.row,i=n>0?t.column+t.colspan-1:t.column;return Go(e,r+o,i+n).map((e=>e.element))})))(Lr(n),e,t,o))))(e,t,o).bind((e=>((e,t)=>lt(e,"table").bind((o=>dt(o,t).bind((t=>qr(t,e).bind((e=>e.boxes.map((t=>({boxes:t,start:e.start,finish:e.finish}))))))))))(e,n))))),Kr=(e,t)=>Gr(e,t),Jr=(e,t,o)=>Yr(e,t,o).bind((t=>{const o=t=>we(e,t),n="thead,tfoot,tbody,table",r=lt(t.first,n,o),i=lt(t.last,n,o);return r.bind((e=>i.bind((o=>we(e,o)?((e,t,o)=>((e,t,o)=>Vr(e,t,o).bind((t=>((e,t)=>{let o=!0;const n=v(Rr,t);for(let r=t.startRow;r<=t.finishRow;r++)for(let i=t.startCol;i<=t.finishCol;i++)o=o&&Go(e,r,i).exists(n);return o?x.some(t):x.none()})(e,t))))(Lr(e),t,o))(t.table,t.first,t.last):x.none()))))})),Qr=g,ei=e=>{const t=(e,t)=>he(e,t).exists((e=>parseInt(e,10)>1));return e.length>0&&L(e,(e=>t(e,"rowspan")||t(e,"colspan")))?x.some(e):x.none()},ti=(e,t,o)=>t.length<=1?x.none():Jr(e,o.firstSelectedSelector,o.lastSelectedSelector).map((e=>({bounds:e,cells:t}))),oi="data-mce-selected",ni="td["+oi+"],th["+oi+"]",ri="["+oi+"]",ii="data-mce-first-selected",si="td["+ii+"],th["+ii+"]",ai="data-mce-last-selected",li="td["+ai+"],th["+ai+"]",ci=ri,di={selected:oi,selectedSelector:ni,firstSelected:ii,firstSelectedSelector:si,lastSelected:ai,lastSelectedSelector:li},ui=(e,t,o)=>({element:o,mergable:ti(t,e,di),unmergable:ei(e),selection:Qr(e)}),hi=e=>(t,o)=>{const n=Q(t),r="col"===n||"colgroup"===n?Ht(i=t).bind((e=>Kr(e,di.firstSelectedSelector))).fold(p(i),(e=>e[0])):t;var i;return ut(r,e,o)},mi=hi("th,td,caption"),pi=hi("th,td"),gi=e=>{return t=e.model.table.getSelectedCells(),A(t,fe.fromDom);var t},fi=(e,t)=>{e.on("BeforeGetContent",(t=>{const o=o=>{t.preventDefault(),(e=>Ht(e[0]).map((e=>{const t=((e,t)=>{const o=e=>ve(e.element,t),n=je(e),r=Wt(n),i=nr(e),s=qo(r),a=((e,t)=>{const o=e.grid.columns;let n=e.grid.rows,r=o,i=0,s=0;const a=[],l=[];return q(e.access,(e=>{if(a.push(e),t(e)){l.push(e);const t=e.row,o=t+e.rowspan-1,a=e.column,c=a+e.colspan-1;t<n?n=t:o>i&&(i=o),a<r?r=a:c>s&&(s=c)}})),((e,t,o,n,r,i)=>({minRow:e,minCol:t,maxRow:o,maxCol:n,allCells:r,selectedCells:i}))(n,r,i,s,a,l)})(s,o),l="th:not("+t+"),td:not("+t+")",c=Ft(n,"th,td",(e=>ve(e,l)));M(c,Le),((e,t,o,n)=>{const r=P(e,(e=>"colgroup"!==e.section)),i=t.grid.columns,s=t.grid.rows;for(let e=0;e<s;e++){let s=!1;for(let a=0;a<i;a++)e<o.minRow||e>o.maxRow||a<o.minCol||a>o.maxCol||(Go(t,e,a).filter(n).isNone()?sr(r,s,e):s=!0)}})(r,s,a,o);const d=((e,t,o,n)=>{if(0===n.minCol&&t.grid.columns===n.maxCol+1)return 0;const r=Jn(t,e,o),i=V(r,((e,t)=>e+t),0),s=V(r.slice(n.minCol,n.maxCol+1),((e,t)=>e+t),0),a=s/i*o.pixelWidth()-o.pixelWidth();return o.getCellDelta(a)})(e,Wo(e),i,a);return((e,t,o,n)=>{q(o.columns,(e=>{(e.column<t.minCol||e.column>t.maxCol)&&Le(e.element)}));const r=P(Dt(e,"tr"),(e=>0===e.dom.childElementCount));M(r,Le),t.minCol!==t.maxCol&&t.minRow!==t.maxRow||M(Dt(e,"th,td"),(e=>{me(e,"rowspan"),me(e,"colspan")})),me(e,zo),me(e,"data-snooker-col-series"),nr(e).adjustTableWidth(n)})(n,a,s,d),n})(e,ci);return Or(t),[t]})))(o).each((o=>{t.content="text"===t.format?(e=>A(e,(e=>e.dom.innerText)).join(""))(o):((e,t)=>A(t,(t=>e.selection.serializer.serialize(t.dom,{}))).join(""))(e,o)}))};if(!0===t.selection){const t=(e=>P(gi(e),(e=>ve(e,di.selectedSelector))))(e);t.length>=1&&o(t)}})),e.on("BeforeSetContent",(o=>{if(!0===o.selection&&!0===o.paste){const n=gi(e);Z(n).each((n=>{Ht(n).each((r=>{const i=P(((e,t)=>{const o=document.createElement("div");return o.innerHTML=e,Ae(fe.fromDom(o))})(o.content),(e=>"meta"!==Q(e))),s=ae("table");if(1===i.length&&s(i[0])){o.preventDefault();const s=fe.fromDom(e.getDoc()),a=Sr(s),l=((e,t,o)=>({element:e,clipboard:t,generators:o}))(n,i[0],a);t.pasteCells(r,l).each((()=>{e.focus()}))}}))}))}}))},vi=(e,t)=>({element:e,offset:t}),bi=(e,t,o)=>e.property().isText(t)&&0===e.property().getText(t).trim().length||e.property().isComment(t)?o(t).bind((t=>bi(e,t,o).orThunk((()=>x.some(t))))):x.none(),yi=(e,t)=>e.property().isText(t)?e.property().getText(t).length:e.property().children(t).length,wi=(e,t)=>{const o=bi(e,t,e.query().prevSibling).getOr(t);if(e.property().isText(o))return vi(o,yi(e,o));const n=e.property().children(o);return n.length>0?wi(e,n[n.length-1]):vi(o,yi(e,o))},_i=wi,xi=Hr(),Ci=(e,t)=>{if(!Bt(e)){const o=(e=>Ln(e).bind((e=>{return t=e,o=["fixed","relative","empty"],x.from(An.exec(t)).bind((e=>{const t=Number(e[1]),n=e[2];return((e,t)=>E(t,(t=>E(On[t],(t=>e===t)))))(n,o)?x.some({value:t,unit:n}):x.none()}));var t,o})))(e);o.each((o=>{const n=o.value/2;jn(e,n,o.unit),jn(t,n,o.unit)}))}},ki=e=>A(e,p(0)),Si=(e,t,o,n,r)=>r(e.slice(0,t)).concat(n).concat(r(e.slice(o))),Ti=e=>(t,o,n,r)=>{if(e(n)){const e=Math.max(r,t[o]-Math.abs(n)),i=Math.abs(e-t[o]);return n>=0?i:-i}return n},Ei=Ti((e=>e<0)),Oi=Ti(_),Ai=()=>{const e=(e,t,o,n)=>{const r=(100+o)/100,i=Math.max(n,(e[t]+o)/r);return A(e,((e,o)=>(o===t?i:e/r)-e))},t=(t,o,n,r,i,s)=>s?e(t,o,r,i):((e,t,o,n,r)=>{const i=Ei(e,t,n,r);return Si(e,t,o+1,[i,0],ki)})(t,o,n,r,i);return{resizeTable:(e,t)=>e(t),clampTableDelta:Ei,calcLeftEdgeDeltas:t,calcMiddleDeltas:(e,o,n,r,i,s,a)=>t(e,n,r,i,s,a),calcRightEdgeDeltas:(t,o,n,r,i,s)=>{if(s)return e(t,n,r,i);{const e=Ei(t,n,r,i);return ki(t.slice(0,n)).concat([e])}},calcRedestributedWidths:(e,t,o,n)=>{if(n){const n=(t+o)/t,r=A(e,(e=>e/n));return{delta:100*n-100,newSizes:r}}return{delta:o,newSizes:e}}}},Mi=()=>{const e=(e,t,o,n,r)=>{const i=Oi(e,n>=0?o:t,n,r);return Si(e,t,o+1,[i,-i],ki)};return{resizeTable:(e,t,o)=>{o&&e(t)},clampTableDelta:(e,t,o,n,r)=>{if(r){if(o>=0)return o;{const t=V(e,((e,t)=>e+t-n),0);return Math.max(-t,o)}}return Ei(e,t,o,n)},calcLeftEdgeDeltas:e,calcMiddleDeltas:(t,o,n,r,i,s)=>e(t,n,r,i,s),calcRightEdgeDeltas:(e,t,o,n,r,i)=>{if(i)return ki(e);{const t=n/e.length;return A(e,p(t))}},calcRedestributedWidths:(e,t,o,n)=>({delta:0,newSizes:e})}},Bi=e=>Wo(e).grid,Pi=ae("th"),Ri=e=>L(e,(e=>Pi(e.element))),Vi=(e,t)=>e&&t?"sectionCells":e?"section":"cells",Ni=e=>{const t="thead"===e.section,o=ht(Di(e.cells),"th");return"tfoot"===e.section?{type:"footer"}:t||o?{type:"header",subType:Vi(t,o)}:{type:"body"}},Di=e=>{const t=P(e,(e=>Pi(e.element)));return 0===t.length?x.some("td"):t.length===e.length?x.some("th"):x.none()},Fi=(e,t,o)=>Ge(o(e.element,t),!0,e.isLocked),Ii=(e,t)=>e.section!==t?Ye(e.element,e.cells,t,e.isNew):e,Li=()=>({transformRow:Ii,transformCell:(e,t,o)=>{const n=o(e.element,t),r="td"!==Q(n)?((e,t)=>{const o=Ue(e,"td");Pe(e,o);const n=Ae(e);return Fe(o,n),Le(e),o})(n):n;return Ge(r,e.isNew,e.isLocked)}}),zi=()=>({transformRow:Ii,transformCell:Fi}),Hi=()=>({transformRow:(e,t)=>Ii(e,"thead"===t?"tbody":t),transformCell:Fi}),Zi=Li,ji=zi,Ui=Hi,$i=()=>({transformRow:g,transformCell:Fi}),Wi=e=>ut(e,"[contenteditable]"),qi=(e,t=!1)=>et(e)?e.dom.isContentEditable:Wi(e).fold(p(t),(e=>"true"===Gi(e))),Gi=e=>e.dom.contentEditable,Yi=(e,t,o,n)=>{o===n?me(e,t):ce(e,t,o)},Xi=(e,t,o)=>{j(rt(e,t)).fold((()=>Re(e,o)),(e=>Pe(e,o)))},Ki=(e,t)=>{const o=[],n=[],r=e=>A(e,(e=>{e.isNew&&o.push(e.element);const t=e.element;return Ie(t),M(e.cells,(e=>{e.isNew&&n.push(e.element),Yi(e.element,"colspan",e.colspan,1),Yi(e.element,"rowspan",e.rowspan,1),Ve(t,e.element)})),t})),i=e=>I(e,(e=>A(e.cells,(e=>(Yi(e.element,"span",e.colspan,1),e.element))))),s=(t,o)=>{const n=((e,t)=>{const o=ct(e,t).getOrThunk((()=>{const o=fe.fromTag(t,Ce(e).dom);return"thead"===t?Xi(e,"caption,colgroup",o):"colgroup"===t?Xi(e,"caption",o):Ve(e,o),o}));return Ie(o),o})(e,o),s=("colgroup"===o?i:r)(t);Fe(n,s)},a=(t,o)=>{t.length>0?s(t,o):(t=>{ct(e,t).each(Le)})(o)},l=[],c=[],d=[],u=[];return M(t,(e=>{switch(e.section){case"thead":l.push(e);break;case"tbody":c.push(e);break;case"tfoot":d.push(e);break;case"colgroup":u.push(e)}})),a(u,"colgroup"),a(l,"thead"),a(c,"tbody"),a(d,"tfoot"),{newRows:o,newCells:n}},Ji=(e,t)=>{if(0===e.length)return 0;const o=e[0];return D(e,(e=>!t(o.element,e.element))).getOr(e.length)},Qi=(e,t)=>{const o=A(e,(e=>A(e.cells,w)));return A(e,((n,r)=>{const i=I(n.cells,((n,i)=>{if(!1===o[r][i]){const d=((e,t,o,n)=>{const r=((e,t)=>e[t])(e,t),i="colgroup"===r.section,s=Ji(r.cells.slice(o),n),a=i?1:Ji(((e,t)=>A(e,(e=>No(e,t))))(e.slice(t),o),n);return{colspan:s,rowspan:a}})(e,r,i,t);return((e,t,n,r)=>{for(let i=e;i<e+n;i++)for(let e=t;e<t+r;e++)o[i][e]=!0})(r,i,d.rowspan,d.colspan),[(s=n.element,a=d.rowspan,l=d.colspan,c=n.isNew,{element:s,rowspan:a,colspan:l,isNew:c})]}return[];var s,a,l,c}));return((e,t,o,n)=>({element:e,cells:t,section:o,isNew:n}))(n.element,i,n.section,n.isNew)}))},es=(e,t,o)=>{const n=[];M(e.colgroups,(r=>{const i=[];for(let n=0;n<e.grid.columns;n++){const r=en(e,n).map((e=>Ge(e.element,o,!1))).getOrThunk((()=>Ge(t.colGap(),!0,!1)));i.push(r)}n.push(Ye(r.element,i,"colgroup",o))}));for(let r=0;r<e.grid.rows;r++){const i=[];for(let n=0;n<e.grid.columns;n++){const s=Go(e,r,n).map((e=>Ge(e.element,o,e.isLocked))).getOrThunk((()=>Ge(t.gap(),!0,!1)));i.push(s)}const s=e.all[r],a=Ye(s.element,i,s.section,o);n.push(a)}return n},ts=e=>Qi(e,we),os=(e,t)=>U(e.all,(e=>N(e.cells,(e=>we(t,e.element))))),ns=(e,t,o)=>{const n=A(t.selection,(t=>It(t).bind((t=>os(e,t))).filter(o))),r=mt(n);return pt(r.length>0,r)},rs=(e,t,o,n,r)=>(i,s,a,l)=>{const c=Wo(i),d=x.from(null==l?void 0:l.section).getOrThunk($i);return t(c,s).map((t=>{const o=((e,t)=>es(e,t,!1))(c,a),n=e(o,t,we,r(a),d),i=Zo(n.grid);return{info:t,grid:ts(n.grid),cursor:n.cursor,lockedColumns:i}})).bind((e=>{const t=Ki(i,e.grid),r=x.from(null==l?void 0:l.sizing).getOrThunk((()=>nr(i))),s=x.from(null==l?void 0:l.resize).getOrThunk(Mi);return o(i,e.grid,e.info,{sizing:r,resize:s,section:d}),n(i),me(i,zo),e.lockedColumns.length>0&&ce(i,zo,e.lockedColumns.join(",")),x.some({cursor:e.cursor,newRows:t.newRows,newCells:t.newCells})}))},is=(e,t)=>ns(e,t,_).map((e=>({cells:e,generators:t.generators,clipboard:t.clipboard}))),ss=(e,t)=>ns(e,t,_),as=(e,t)=>ns(e,t,(e=>!e.isLocked)),ls=(e,t)=>L(t,(t=>((e,t)=>os(e,t).exists((e=>!e.isLocked)))(e,t))),cs=(e,t,o,n)=>{const r=Io(e).rows;let i=!0;for(let e=0;e<r.length;e++)for(let s=0;s<Fo(r[0]);s++){const a=r[e],l=No(a,s),c=o(l.element,t);c&&!i?Ro(a,s,Ge(n(),!0,l.isLocked)):c&&(i=!1)}return e},ds=e=>{const t=t=>t(e),o=p(e),n=()=>r,r={tag:!0,inner:e,fold:(t,o)=>o(e),isValue:_,isError:w,map:t=>hs.value(t(e)),mapError:n,bind:t,exists:t,forall:t,getOr:o,or:n,getOrThunk:o,orThunk:n,getOrDie:o,each:t=>{t(e)},toOptional:()=>x.some(e)};return r},us=e=>{const t=()=>o,o={tag:!1,inner:e,fold:(t,o)=>t(e),isValue:w,isError:_,map:t,mapError:t=>hs.error(t(e)),bind:t,exists:w,forall:_,getOr:g,or:g,getOrThunk:y,orThunk:y,getOrDie:(n=String(e),()=>{throw new Error(n)}),each:m,toOptional:x.none};var n;return o},hs={value:ds,error:us,fromOption:(e,t)=>e.fold((()=>us(t)),ds)},ms=(e,t)=>({rowDelta:0,colDelta:Fo(e[0])-Fo(t[0])}),ps=(e,t)=>({rowDelta:e.length-t.length,colDelta:0}),gs=(e,t,o,n)=>{const r="colgroup"===t.section?o.col:o.cell;return O(e,(e=>Ge(r(),!0,n(e))))},fs=(e,t,o,n)=>{const r=e[e.length-1];return e.concat(O(t,(()=>{const e="colgroup"===r.section?o.colgroup:o.row,t=Lo(r,e,g),i=gs(t.cells.length,t,o,(e=>J(n,e.toString())));return Vo(t,i)})))},vs=(e,t,o,n)=>A(e,(e=>{const r=gs(t,e,o,w);return Bo(e,n,r)})),bs=(e,t,o)=>{const n=t.colDelta<0?vs:g,r=t.rowDelta<0?fs:g,i=Zo(e),s=Fo(e[0]),a=E(i,(e=>e===s-1)),l=n(e,Math.abs(t.colDelta),o,a?s-1:s),c=Zo(l);return r(l,Math.abs(t.rowDelta),o,z(c,_))},ys=(e,t,o,n)=>{const r=v(n,No(e[t],o).element),i=e[t];return e.length>1&&Fo(i)>1&&(o>0&&r(Do(i,o-1))||o<i.cells.length-1&&r(Do(i,o+1))||t>0&&r(Do(e[t-1],o))||t<e.length-1&&r(Do(e[t+1],o)))},ws=(e,t,o)=>P(o,(o=>o>=e.column&&o<=Fo(t[0])+e.column)),_s=(e,t,o,n,r)=>{((e,t,o,n)=>{t>0&&t<e[0].cells.length&&M(e,(e=>{const r=e.cells[t-1];let i=0;const s=n();for(;e.cells.length>t+i&&o(r.element,e.cells[t+i].element);)Ro(e,t+i,Ge(s,!0,e.cells[t+i].isLocked)),i++}))})(t,e,r,n.cell);const i=ps(o,t),s=bs(o,i,n),a=ps(t,s),l=bs(t,a,n);return A(l,((t,o)=>Bo(t,e,s[o].cells)))},xs=(e,t,o,n,r)=>{((e,t,o,n)=>{const r=Io(e).rows;if(t>0&&t<r.length){const e=((e,t)=>V(e,((e,o)=>E(e,(e=>t(e.element,o.element)))?e:e.concat([o])),[]))(r[t-1].cells,o);M(e,(e=>{let i=x.none();for(let s=t;s<r.length;s++)for(let t=0;t<Fo(r[0]);t++){const a=r[s],l=No(a,t);o(l.element,e.element)&&(i.isNone()&&(i=x.some(n())),i.each((e=>{Ro(a,t,Ge(e,!0,l.isLocked))})))}}))}})(t,e,r,n.cell);const i=Zo(t),s=ms(t,o),a={...s,colDelta:s.colDelta-i.length},l=bs(t,a,n),{cols:c,rows:d}=Io(l),u=Zo(l),h=ms(o,t),m={...h,colDelta:h.colDelta+u.length},p=(f=n,v=u,A(o,(e=>V(v,((t,o)=>{const n=gs(1,e,f,_)[0];return Po(t,o,n)}),e)))),g=bs(p,m,n);var f,v;return[...c,...d.slice(0,e),...g,...d.slice(e,d.length)]},Cs=(e,t,o,n,r)=>{const{rows:i,cols:s}=Io(e),a=i.slice(0,t),l=i.slice(t);return[...s,...a,((e,t,o,n)=>Lo(e,(e=>n(e,o)),t))(i[o],((e,o)=>t>0&&t<i.length&&n(Do(i[t-1],o),Do(i[t],o))?No(i[t],o):Ge(r(e.element,n),!0,e.isLocked)),n,r),...l]},ks=(e,t,o,n,r)=>A(e,(e=>{const i=t>0&&t<Fo(e)&&n(Do(e,t-1),Do(e,t)),s=((e,t,o,n,r,i,s)=>{if("colgroup"!==o&&n)return No(e,t);{const t=No(e,r);return Ge(s(t.element,i),!0,!1)}})(e,t,e.section,i,o,n,r);return Po(e,t,s)})),Ss=(e,t,o,n)=>((e,t,o,n)=>void 0!==Do(e[t],o)&&t>0&&n(Do(e[t-1],o),Do(e[t],o)))(e,t,o,n)||((e,t,o)=>t>0&&o(Do(e,t-1),Do(e,t)))(e[t],o,n),Ts=(e,t,o,n)=>{const r=e=>(e=>"row"===e?Pt(t):Bt(t))(e)?`${e}group`:e;return e?Pi(t)?r(o):null:n&&Pi(t)?r("row"===o?"col":"row"):null},Es=(e,t,o)=>Ge(o(e.element,t),!0,e.isLocked),Os=(e,t,o,n,r,i,s)=>A(e,((e,a)=>((e,l)=>{const c=e.cells,d=A(c,((e,l)=>{if((e=>E(t,(t=>o(e.element,t.element))))(e)){const t=s(e,a,l)?r(e,o,n):e;return i(t,a,l).each((e=>{var o,n;o=t.element,n={scope:x.from(e)},q(n,((e,t)=>{e.fold((()=>{me(o,t)}),(e=>{le(o.dom,t,e)}))}))})),t}return e}));return Ye(e.element,d,e.section,e.isNew)})(e))),As=(e,t,o)=>I(e,((n,r)=>Ss(e,r,t,o)?[]:[No(n,t)])),Ms=(e,t,o,n,r)=>{const i=Io(e).rows,s=I(t,(e=>As(i,e,n))),a=A(i,(e=>Ri(e.cells))),l=((e,t)=>L(t,g)&&Ri(e)?_:(e,o,n)=>!("th"===Q(e.element)&&t[o]))(s,a),c=((e,t)=>(o,n)=>x.some(Ts(e,o.element,"row",t[n])))(o,a);return Os(e,s,n,r,Es,c,l)},Bs=(e,t,o,n)=>{const r=Io(e).rows,i=A(t,(e=>No(r[e.row],e.column)));return Os(e,i,o,n,Es,x.none,_)},Ps=e=>{if(!s(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");const t=[],o={};return M(e,((n,r)=>{const i=$(n);if(1!==i.length)throw new Error("one and only one name per case");const a=i[0],l=n[a];if(void 0!==o[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!s(l))throw new Error("case arguments must be an array");t.push(a),o[a]=(...o)=>{const n=o.length;if(n!==l.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+l.length+" ("+l+"), got "+n);return{fold:(...t)=>{if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);return t[r].apply(null,o)},match:e=>{const n=$(e);if(t.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","));if(!L(t,(e=>T(n,e))))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "));return e[a].apply(null,o)},log:e=>{console.log(e,{constructors:t,constructor:a,params:o})}}}})),o},Rs={...Ps([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}])},Vs=(e,t,o)=>{let n=0;for(let r=e;r<t;r++)n+=void 0!==o[r]?o[r]:0;return n},Ns=(e,t)=>{const o=Ko(e);return A(o,(e=>{const o=Vs(e.row,e.row+e.rowspan,t);return{element:e.element,height:o,rowspan:e.rowspan}}))},Ds=(e,t,o)=>{const n=((e,t)=>Qo(e)?((e,t)=>{const o=Jo(e);return A(o,((e,o)=>({element:e.element,width:t[o],colspan:e.colspan})))})(e,t):((e,t)=>{const o=Ko(e);return A(o,(e=>{const o=Vs(e.column,e.column+e.colspan,t);return{element:e.element,width:o,colspan:e.colspan}}))})(e,t))(e,t);M(n,(e=>{o.setElementWidth(e.element,e.width)}))},Fs=(e,t,o,n,r)=>{const i=Wo(e),s=r.getCellDelta(t),a=r.getWidths(i,r),l=o===i.grid.columns-1,c=n.clampTableDelta(a,o,s,r.minCellWidth(),l),d=((e,t,o,n,r)=>{const i=e.slice(0),s=((e,t)=>0===e.length?Rs.none():1===e.length?Rs.only(0):0===t?Rs.left(0,1):t===e.length-1?Rs.right(t-1,t):t>0&&t<e.length-1?Rs.middle(t-1,t,t+1):Rs.none())(e,t),a=p(A(i,p(0)));return s.fold(a,(e=>n.singleColumnWidth(i[e],o)),((e,t)=>r.calcLeftEdgeDeltas(i,e,t,o,n.minCellWidth(),n.isRelative)),((e,t,s)=>r.calcMiddleDeltas(i,e,t,s,o,n.minCellWidth(),n.isRelative)),((e,t)=>r.calcRightEdgeDeltas(i,e,t,o,n.minCellWidth(),n.isRelative)))})(a,o,c,r,n),u=A(d,((e,t)=>e+a[t]));Ds(i,u,r),n.resizeTable(r.adjustTableWidth,c,l)},Is=e=>V(e,((e,t)=>E(e,(e=>e.column===t.column))?e:e.concat([t])),[]).sort(((e,t)=>e.column-t.column)),Ls=ae("col"),zs=ae("colgroup"),Hs=e=>"tr"===Q(e)||zs(e),Zs=e=>({element:e,colspan:At(e,"colspan",1),rowspan:At(e,"rowspan",1)}),js=e=>he(e,"scope").map((e=>e.substr(0,3))),Us=(e,t=Zs)=>{const o=o=>{if(Hs(o))return zs((r={element:o}).element)?e.colgroup(r):e.row(r);{const r=o,i=(t=>Ls(t.element)?e.col(t):e.cell(t))(t(r));return n=x.some({item:r,replacement:i}),i}var r};let n=x.none();return{getOrInit:(e,t)=>n.fold((()=>o(e)),(n=>t(e,n.item)?n.replacement:o(e)))}},$s=e=>t=>{const o=[],n=n=>{const r="td"===e?{scope:null}:{},i=t.replace(n,e,r);return o.push({item:n,sub:i}),i};return{replaceOrInit:(e,t)=>{if(Hs(e)||Ls(e))return e;{const r=e;return((e,t)=>N(o,(o=>t(o.item,e))))(r,t).fold((()=>n(r)),(o=>t(e,o.item)?o.sub:n(r)))}}}},Ws=e=>({unmerge:t=>{const o=js(t);return o.each((e=>ce(t,"scope",e))),()=>{const n=e.cell({element:t,colspan:1,rowspan:1});return Ot(n,"width"),Ot(t,"width"),o.each((e=>ce(n,"scope",e))),n}},merge:e=>(Ot(e[0],"width"),(()=>{const t=mt(A(e,js));if(0===t.length)return x.none();{const e=t[0],o=["row","col"];return E(t,(t=>t!==e&&T(o,t)))?x.none():x.from(e)}})().fold((()=>me(e[0],"scope")),(t=>ce(e[0],"scope",t+"group"))),p(e[0]))}),qs=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],Gs=Hr(),Ys=e=>((e,t)=>{const o=e.property().name(t);return T(qs,o)})(Gs,e),Xs=e=>((e,t)=>{const o=e.property().name(t);return T(["ol","ul"],o)})(Gs,e),Ks=e=>{const t=ae("br"),o=e=>gr(e).bind((o=>{const n=Oe(o).map((e=>!!Ys(e)||!!((e,t)=>T(["br","img","hr","input"],e.property().name(t)))(Gs,e)&&"img"!==Q(e))).getOr(!1);return Se(o).map((r=>{return!0===n||("li"===Q(i=r)||at(i,Xs).isSome())||t(o)||Ys(r)&&!we(e,r)?[]:[fe.fromTag("br")];var i}))})).getOr([]),n=(()=>{const n=I(e,(e=>{const n=Ae(e);return(e=>L(e,(e=>t(e)||re(e)&&0===lr(e).trim().length)))(n)?[]:n.concat(o(e))}));return 0===n.length?[fe.fromTag("br")]:n})();Ie(e[0]),Fe(e[0],n)},Js=e=>qi(e,!0),Qs=e=>{0===Lt(e).length&&Le(e)},ea=(e,t)=>({grid:e,cursor:t}),ta=(e,t,o)=>{const n=((e,t,o)=>{var n,r;const i=Io(e).rows;return x.from(null===(r=null===(n=i[t])||void 0===n?void 0:n.cells[o])||void 0===r?void 0:r.element).filter(Js).orThunk((()=>(e=>U(e,(e=>U(e.cells,(e=>{const t=e.element;return pt(Js(t),t)})))))(i)))})(e,t,o);return ea(e,n)},oa=e=>V(e,((e,t)=>E(e,(e=>e.row===t.row))?e:e.concat([t])),[]).sort(((e,t)=>e.row-t.row)),na=(e,t)=>(o,n,r,i,s)=>{const a=oa(n),l=A(a,(e=>e.row)),c=((e,t,o,n,r,i,s)=>{const{cols:a,rows:l}=Io(e),c=l[t[0]],d=I(t,(e=>((e,t,o)=>{const n=e[t];return I(n.cells,((n,r)=>Ss(e,t,r,o)?[]:[n]))})(l,e,r))),u=A(c.cells,((e,t)=>Ri(As(l,t,r)))),h=[...l];M(t,(e=>{h[e]=s.transformRow(l[e],o)}));const m=[...a,...h],p=((e,t)=>L(t,g)&&Ri(e.cells)?_:(e,o,n)=>!("th"===Q(e.element)&&t[n]))(c,u),f=((e,t)=>(o,n,r)=>x.some(Ts(e,o.element,"col",t[r])))(n,u);return Os(m,d,r,i,s.transformCell,f,p)})(o,l,e,t,r,i.replaceOrInit,s);return ta(c,n[0].row,n[0].column)},ra=na("thead",!0),ia=na("tbody",!1),sa=na("tfoot",!1),aa=(e,t,o)=>{const n=((e,t)=>Ut(e,(()=>t)))(e,o.section),r=qo(n);return es(r,t,!0)},la=(e,t,o,n)=>((e,t,o,n)=>{const r=qo(t),i=n.getWidths(r,n);Ds(r,i,n)})(0,t,0,n.sizing),ca=(e,t,o,n)=>((e,t,o,n,r)=>{const i=qo(t),s=n.getWidths(i,n),a=n.pixelWidth(),{newSizes:l,delta:c}=r.calcRedestributedWidths(s,a,o.pixelDelta,n.isRelative);Ds(i,l,n),n.adjustTableWidth(c)})(0,t,o,n.sizing,n.resize),da=(e,t)=>E(t,(e=>0===e.column&&e.isLocked)),ua=(e,t)=>E(t,(t=>t.column+t.colspan>=e.grid.columns&&t.isLocked)),ha=(e,t)=>{const o=tn(e),n=Is(t);return V(n,((e,t)=>e+o[t.column].map(Ao).getOr(0)),0)},ma=e=>(t,o)=>ss(t,o).filter((o=>!(e?da:ua)(t,o))).map((e=>({details:e,pixelDelta:ha(t,e)}))),pa=e=>(t,o)=>is(t,o).filter((o=>!(e?da:ua)(t,o.cells))),ga=$s("th"),fa=$s("td"),va=rs(((e,t,o,n)=>{const r=t[0].row,i=oa(t),s=R(i,((e,t)=>({grid:Cs(e.grid,r,t.row+e.delta,o,n.getOrInit),delta:e.delta+1})),{grid:e,delta:0}).grid;return ta(s,r,t[0].column)}),ss,m,m,Us),ba=rs(((e,t,o,n)=>{const r=oa(t),i=r[r.length-1],s=i.row+i.rowspan,a=R(r,((e,t)=>Cs(e,s,t.row,o,n.getOrInit)),e);return ta(a,s,t[0].column)}),ss,m,m,Us),ya=rs(((e,t,o,n)=>{const r=t.details,i=Is(r),s=i[0].column,a=R(i,((e,t)=>({grid:ks(e.grid,s,t.column+e.delta,o,n.getOrInit),delta:e.delta+1})),{grid:e,delta:0}).grid;return ta(a,r[0].row,s)}),ma(!0),ca,m,Us),wa=rs(((e,t,o,n)=>{const r=t.details,i=r[r.length-1],s=i.column+i.colspan,a=Is(r),l=R(a,((e,t)=>ks(e,s,t.column,o,n.getOrInit)),e);return ta(l,r[0].row,s)}),ma(!1),ca,m,Us),_a=rs(((e,t,o,n)=>{const r=Is(t.details),i=((e,t)=>I(e,(e=>{const o=e.cells,n=R(t,((e,t)=>t>=0&&t<e.length?e.slice(0,t).concat(e.slice(t+1)):e),o);return n.length>0?[Ye(e.element,n,e.section,e.isNew)]:[]})))(e,A(r,(e=>e.column))),s=i.length>0?i[0].cells.length-1:0;return ta(i,r[0].row,Math.min(r[0].column,s))}),((e,t)=>as(e,t).map((t=>({details:t,pixelDelta:-ha(e,t)})))),ca,Qs,Us),xa=rs(((e,t,o,n)=>{const r=oa(t),i=((e,t,o)=>{const{rows:n,cols:r}=Io(e);return[...r,...n.slice(0,t),...n.slice(o+1)]})(e,r[0].row,r[r.length-1].row),s=i.length>0?i.length-1:0;return ta(i,Math.min(t[0].row,s),t[0].column)}),ss,m,Qs,Us),Ca=rs(((e,t,o,n)=>{const r=Is(t),i=A(r,(e=>e.column)),s=Ms(e,i,!0,o,n.replaceOrInit);return ta(s,t[0].row,t[0].column)}),as,m,m,ga),ka=rs(((e,t,o,n)=>{const r=Is(t),i=A(r,(e=>e.column)),s=Ms(e,i,!1,o,n.replaceOrInit);return ta(s,t[0].row,t[0].column)}),as,m,m,fa),Sa=rs(ra,as,m,m,ga),Ta=rs(ia,as,m,m,fa),Ea=rs(sa,as,m,m,fa),Oa=rs(((e,t,o,n)=>{const r=Bs(e,t,o,n.replaceOrInit);return ta(r,t[0].row,t[0].column)}),as,m,m,ga),Aa=rs(((e,t,o,n)=>{const r=Bs(e,t,o,n.replaceOrInit);return ta(r,t[0].row,t[0].column)}),as,m,m,fa),Ma=rs(((e,t,o,n)=>{const r=t.cells;Ks(r);const i=((e,t,o,n)=>{const r=Io(e).rows;if(0===r.length)return e;for(let e=t.startRow;e<=t.finishRow;e++)for(let o=t.startCol;o<=t.finishCol;o++){const t=r[e],i=No(t,o).isLocked;Ro(t,o,Ge(n(),!1,i))}return e})(e,t.bounds,0,n.merge(r));return ea(i,x.from(r[0]))}),((e,t)=>((e,t)=>t.mergable)(0,t).filter((t=>ls(e,t.cells)))),la,m,Ws),Ba=rs(((e,t,o,n)=>{const r=R(t,((e,t)=>cs(e,t,o,n.unmerge(t))),e);return ea(r,x.from(t[0]))}),((e,t)=>((e,t)=>t.unmergable)(0,t).filter((t=>ls(e,t)))),la,m,Ws),Pa=rs(((e,t,o,n)=>{const r=((e,t)=>{const o=Wo(e);return es(o,t,!0)})(t.clipboard,t.generators);var i,s;return((e,t,o,n,r)=>{const i=Zo(t),s=((e,t,o)=>{const n=Fo(t[0]),r=Io(t).cols.length+e.row,i=O(n-e.column,(t=>t+e.column));return{row:r,column:N(i,(e=>L(o,(t=>t!==e)))).getOr(n-1)}})(e,t,i),a=Io(o).rows,l=ws(s,a,i),c=((e,t,o)=>{if(e.row>=t.length||e.column>Fo(t[0]))return hs.error("invalid start address out of table bounds, row: "+e.row+", column: "+e.column);const n=t.slice(e.row),r=n[0].cells.slice(e.column),i=Fo(o[0]),s=o.length;return hs.value({rowDelta:n.length-s,colDelta:r.length-i})})(s,t,a);return c.map((e=>{const o={...e,colDelta:e.colDelta-l.length},i=bs(t,o,n),c=Zo(i),d=ws(s,a,c);return((e,t,o,n,r,i)=>{const s=e.row,a=e.column,l=s+o.length,c=a+Fo(o[0])+i.length,d=z(i,_);for(let e=s;e<l;e++){let i=0;for(let l=a;l<c;l++){if(d[l]){i++;continue}ys(t,e,l,r)&&cs(t,Do(t[e],l),r,n.cell);const c=l-a-i,u=No(o[e-s],c),h=u.element,m=n.replace(h);Ro(t[e],l,Ge(m,!0,u.isLocked))}}return t})(s,i,a,n,r,d)}))})((i=t.row,s=t.column,{row:i,column:s}),e,r,t.generators,o).fold((()=>ea(e,x.some(t.element))),(e=>ta(e,t.row,t.column)))}),((e,t)=>It(t.element).bind((o=>os(e,o).map((e=>({...e,generators:t.generators,clipboard:t.clipboard})))))),la,m,Us),Ra=rs(((e,t,o,n)=>{const r=Io(e).rows,i=t.cells[0].column,s=r[t.cells[0].row],a=aa(t.clipboard,t.generators,s),l=_s(i,e,a,t.generators,o);return ta(l,t.cells[0].row,t.cells[0].column)}),pa(!0),m,m,Us),Va=rs(((e,t,o,n)=>{const r=Io(e).rows,i=t.cells[t.cells.length-1].column+t.cells[t.cells.length-1].colspan,s=r[t.cells[0].row],a=aa(t.clipboard,t.generators,s),l=_s(i,e,a,t.generators,o);return ta(l,t.cells[0].row,t.cells[0].column)}),pa(!1),m,m,Us),Na=rs(((e,t,o,n)=>{const r=Io(e).rows,i=t.cells[0].row,s=r[i],a=aa(t.clipboard,t.generators,s),l=xs(i,e,a,t.generators,o);return ta(l,t.cells[0].row,t.cells[0].column)}),is,m,m,Us),Da=rs(((e,t,o,n)=>{const r=Io(e).rows,i=t.cells[t.cells.length-1].row+t.cells[t.cells.length-1].rowspan,s=r[t.cells[0].row],a=aa(t.clipboard,t.generators,s),l=xs(i,e,a,t.generators,o);return ta(l,t.cells[0].row,t.cells[0].column)}),is,m,m,Us),Fa=(e,t)=>{const o=Wo(e);return ss(o,t).bind((e=>{const t=e[e.length-1],n=e[0].column,r=t.column+t.colspan,i=F(A(o.all,(e=>P(e.cells,(e=>e.column>=n&&e.column<r)))));return Di(i)})).getOr("")},Ia=(e,t)=>{const o=Wo(e);return ss(o,t).bind(Di).getOr("")},La=(e,t)=>{const o=Wo(e);return ss(o,t).bind((e=>{const t=e[e.length-1],n=e[0].row,r=t.row+t.rowspan;return(e=>{const t=A(e,(e=>Ni(e).type)),o=T(t,"header"),n=T(t,"footer");if(o||n){const e=T(t,"body");return!o||e||n?o||e||!n?x.none():x.some("footer"):x.some("header")}return x.some("body")})(o.all.slice(n,r))})).getOr("")},za=(e,t)=>e.dispatch("NewRow",{node:t}),Ha=(e,t)=>e.dispatch("NewCell",{node:t}),Za=(e,t,o)=>{e.dispatch("TableModified",{...o,table:t})},ja={structure:!1,style:!0},Ua={structure:!0,style:!1},$a={structure:!0,style:!0},Wa=e=>t=>t.options.get(e),qa="100%",Ga=e=>{var t;const o=e.dom,n=null!==(t=o.getParent(e.selection.getStart(),o.isBlock))&&void 0!==t?t:e.getBody();return Mo(fe.fromDom(n))+"px"},Ya=e=>x.from(e.options.get("table_clone_elements")),Xa=Wa("table_header_type"),Ka=Wa("table_column_resizing"),Ja=e=>"preservetable"===Ka(e),Qa=e=>"resizetable"===Ka(e),el=Wa("table_sizing_mode"),tl=e=>"relative"===el(e),ol=e=>"fixed"===el(e),nl=e=>"responsive"===el(e),rl=Wa("table_resize_bars"),il=Wa("table_style_by_css"),sl=e=>{const t=e.options,o=t.get("table_default_attributes");return t.isSet("table_default_attributes")?o:((e,t)=>nl(e)||il(e)?t:ol(e)?{...t,width:Ga(e)}:{...t,width:qa})(e,o)},al=Wa("table_use_colgroups"),ll=(e,t)=>tl(e)?ir(t):ol(e)?rr(t):nr(t),cl=(e,t,o)=>{const n=e=>"table"===Q(Tr(e)),r=Ya(e),i=Qa(e)?m:Ci,s=t=>{switch(Xa(e)){case"section":return Zi();case"sectionCells":return ji();case"cells":return Ui();default:return((e,t)=>{var o;switch((o=Wo(e),U(o.all,(e=>{const t=Ni(e);return"header"===t.type?x.from(t.subType):x.none()}))).getOr(t)){case"section":return Li();case"sectionCells":return zi();case"cells":return Hi()}})(t,"section")}},a=(n,i,a,l)=>(c,d,u=!1)=>{Or(c);const h=fe.fromDom(e.getDoc()),m=kr(a,h,r),p={sizing:ll(e,c),resize:Qa(e)?Ai():Mi(),section:s(c)};return i(c)?n(c,d,m,p).bind((n=>{t.refresh(c.dom),M(n.newRows,(t=>{za(e,t.dom)})),M(n.newCells,(t=>{Ha(e,t.dom)}));const r=((t,n)=>n.cursor.fold((()=>{const n=Lt(t);return Z(n).filter(et).map((n=>{o.clearSelectedCells(t.dom);const r=e.dom.createRng();return r.selectNode(n.dom),e.selection.setRng(r),ce(n,"data-mce-selected","1"),r}))}),(n=>{const r=_i(xi,n),i=e.dom.createRng();return i.setStart(r.element.dom,r.offset),i.setEnd(r.element.dom,r.offset),e.selection.setRng(i),o.clearSelectedCells(t.dom),x.some(i)})))(c,n);return et(c)&&(Or(c),u||Za(e,c.dom,l)),r.map((e=>({rng:e,effect:l})))})):x.none()},l=a(xa,(t=>!n(e)||Bi(t).rows>1),m,Ua),c=a(_a,(t=>!n(e)||Bi(t).columns>1),m,Ua);return{deleteRow:l,deleteColumn:c,insertRowsBefore:a(va,_,m,Ua),insertRowsAfter:a(ba,_,m,Ua),insertColumnsBefore:a(ya,_,i,Ua),insertColumnsAfter:a(wa,_,i,Ua),mergeCells:a(Ma,_,m,Ua),unmergeCells:a(Ba,_,m,Ua),pasteColsBefore:a(Ra,_,m,Ua),pasteColsAfter:a(Va,_,m,Ua),pasteRowsBefore:a(Na,_,m,Ua),pasteRowsAfter:a(Da,_,m,Ua),pasteCells:a(Pa,_,m,$a),makeCellsHeader:a(Oa,_,m,Ua),unmakeCellsHeader:a(Aa,_,m,Ua),makeColumnsHeader:a(Ca,_,m,Ua),unmakeColumnsHeader:a(ka,_,m,Ua),makeRowsHeader:a(Sa,_,m,Ua),makeRowsBody:a(Ta,_,m,Ua),makeRowsFooter:a(Ea,_,m,Ua),getTableRowType:La,getTableCellType:Ia,getTableColType:Fa}},dl=(e,t,o)=>{const n=At(e,t,1);1===o||n<=1?me(e,t):ce(e,t,Math.min(o,n))},ul=(e,t)=>o=>{const n=o.column+o.colspan-1,r=o.column;return n>=e&&r<t},hl=Ps([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),ml=(e,t,o)=>{const n=o.substring(0,o.length-e.length),r=parseFloat(n);return n===r.toString()?t(r):hl.invalid(o)},pl={...hl,from:e=>bt(e,"%")?ml("%",hl.percent,e):bt(e,"px")?ml("px",hl.pixels,e):hl.invalid(e)},gl=(e,t,o)=>{const n=pl.from(o),r=L(e,(e=>"0px"===e))?((e,t)=>{const o=e.fold((()=>p("")),(e=>p(e/t+"px")),(()=>p(100/t+"%")));return O(t,o)})(n,e.length):((e,t,o)=>e.fold((()=>t),(e=>((e,t,o)=>{const n=o/t;return A(e,(e=>pl.from(e).fold((()=>e),(e=>e*n+"px"),(e=>e/100*o+"px"))))})(t,o,e)),(e=>((e,t)=>A(e,(e=>pl.from(e).fold((()=>e),(e=>e/t*100+"%"),(e=>e+"%")))))(t,o))))(n,e,t);return bl(r)},fl=(e,t)=>0===e.length?t:R(e,((e,t)=>pl.from(t).fold(p(0),g,g)+e),0),vl=(e,t)=>pl.from(e).fold(p(e),(e=>e+t+"px"),(e=>e+t+"%")),bl=e=>{if(0===e.length)return e;const t=R(e,((e,t)=>{const o=pl.from(t).fold((()=>({value:t,remainder:0})),(e=>((e,t)=>{const o=Math.floor(e);return{value:o+"px",remainder:e-o}})(e)),(e=>({value:e+"%",remainder:0})));return{output:[o.value].concat(e.output),remainder:e.remainder+o.remainder}}),{output:[],remainder:0}),o=t.output;return o.slice(0,o.length-1).concat([vl(o[o.length-1],Math.round(t.remainder))])},yl=pl.from,wl=e=>yl(e).fold(p("px"),p("px"),p("%")),_l=(e,t,o)=>{const n=Wo(e),r=n.all,i=Ko(n),s=Jo(n);t.each((t=>{const o=wl(t),r=Oo(e),a=((e,t)=>Xn(e,t,qn,Kn))(n,e),l=gl(a,r,t);Qo(n)?((e,t,o)=>{M(t,((t,n)=>{const r=fl([e[n]],Vt());Ct(t.element,"width",r+o)}))})(l,s,o):((e,t,o)=>{M(t,(t=>{const n=e.slice(t.column,t.colspan+t.column),r=fl(n,Vt());Ct(t.element,"width",r+o)}))})(l,i,o),Ct(e,"width",t)})),o.each((t=>{const o=wl(t),s=ln(e),a=((e,t,o)=>Qn(e,t,o,Gn,Kn))(n,e,Sn);((e,t,o,n)=>{M(o,(t=>{const o=e.slice(t.row,t.rowspan+t.row),r=fl(o,Nt());Ct(t.element,"height",r+n)})),M(t,((t,o)=>{Ct(t.element,"height",e[o])}))})(gl(a,s,t),r,i,o),Ct(e,"height",t)}))},xl=e=>Ln(e).exists((e=>Mn.test(e))),Cl=e=>Ln(e).exists((e=>Bn.test(e))),kl=e=>Ln(e).isNone(),Sl=e=>{me(e,"width")},Tl=e=>{const t=Un(e);_l(e,x.some(t),x.none()),Sl(e)},El=e=>{const t=(e=>Oo(e)+"px")(e);_l(e,x.some(t),x.none()),Sl(e)},Ol=e=>{Ot(e,"width");const t=zt(e),o=t.length>0?t:Lt(e);M(o,(e=>{Ot(e,"width"),Sl(e)})),Sl(e)},Al={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},Ml=(e,t,o,n)=>O(e,(e=>((e,t,o,n)=>{const r=fe.fromTag("tr");for(let i=0;i<e;i++){const e=fe.fromTag(n<t||i<o?"th":"td");i<o&&ce(e,"scope","row"),n<t&&ce(e,"scope","col"),Ve(e,fe.fromTag("br")),Ve(r,e)}return r})(t,o,n,e))),Bl=(e,t)=>{e.selection.select(t.dom,!0),e.selection.collapse(!0)},Pl=(e,t,o,n,i)=>{const s=(e=>{const t=e.options,o=t.get("table_default_styles");return t.isSet("table_default_styles")?o:((e,t)=>nl(e)||!il(e)?t:ol(e)?{...t,width:Ga(e)}:{...t,width:qa})(e,o)})(e),a={styles:s,attributes:sl(e),colGroups:al(e)};return e.undoManager.ignore((()=>{const r=((e,t,o,n,r,i=Al)=>{const s=fe.fromTag("table"),a="cells"!==r;kt(s,i.styles),de(s,i.attributes),i.colGroups&&Ve(s,(e=>{const t=fe.fromTag("colgroup");return O(e,(()=>Ve(t,fe.fromTag("col")))),t})(t));const l=Math.min(e,o);if(a&&o>0){const e=fe.fromTag("thead");Ve(s,e);const i=Ml(o,t,"sectionCells"===r?l:0,n);Fe(e,i)}const c=fe.fromTag("tbody");Ve(s,c);const d=Ml(a?e-l:e,t,a?0:o,n);return Fe(c,d),s})(o,t,i,n,Xa(e),a);ce(r,"data-mce-id","__mce");const s=(e=>{const t=fe.fromTag("div"),o=fe.fromDom(e.dom.cloneNode(!0));return Ve(t,o),(e=>e.dom.innerHTML)(t)})(r);e.insertContent(s),e.addVisual()})),dt(Tr(e),'table[data-mce-id="__mce"]').map((t=>(ol(e)?El(t):nl(e)?Ol(t):(tl(e)||(e=>r(e)&&-1!==e.indexOf("%"))(s.width))&&Tl(t),Or(t),me(t,"data-mce-id"),((e,t)=>{M(it(t,"tr"),(t=>{za(e,t.dom),M(it(t,"th,td"),(t=>{Ha(e,t.dom)}))}))})(e,t),((e,t)=>{dt(t,"td,th").each(v(Bl,e))})(e,t),t.dom))).getOrNull()};var Rl=window.mailpoetTinymce.util.Tools.resolve("mailpoetTinymce.FakeClipboard");const Vl="x-tinymce/dom-table-",Nl=Vl+"rows",Dl=Vl+"columns",Fl=e=>{const t=Rl.FakeClipboardItem(e);Rl.write([t])},Il=e=>{var t;const o=null!==(t=Rl.read())&&void 0!==t?t:[];return U(o,(t=>x.from(t.getType(e))))},Ll=e=>{Il(e).isSome()&&Rl.clear()},zl=e=>{e.fold(Zl,(e=>Fl({[Nl]:e})))},Hl=()=>Il(Nl),Zl=()=>Ll(Nl),jl=e=>{e.fold($l,(e=>Fl({[Dl]:e})))},Ul=()=>Il(Dl),$l=()=>Ll(Dl),Wl=e=>mi(Ar(e),Er(e)),ql=(e,t)=>{const o=Er(e),n=e=>Ht(e,o),s=t=>(e=>pi(Ar(e),Er(e)))(e).bind((e=>n(e).map((o=>t(o,e))))),a=t=>{e.focus()},l=(t,o=!1)=>s(((n,r)=>{const i=ui(gi(e),n,r);t(n,i,o).each(a)})),c=()=>s(((t,o)=>((e,t,o)=>{const n=Wo(e);return ss(n,t).bind((e=>{const t=es(n,o,!1),r=Io(t).rows.slice(e[0].row,e[e.length-1].row+e[e.length-1].rowspan),i=I(r,(e=>{const t=P(e.cells,(e=>!e.isLocked));return t.length>0?[{...e,cells:t}]:[]})),s=ts(i);return pt(s.length>0,s)})).map((e=>A(e,(e=>{const t=Ze(e.element);return M(e.cells,(e=>{const o=je(e.element);Yi(o,"colspan",e.colspan,1),Yi(o,"rowspan",e.rowspan,1),Ve(t,o)})),t}))))})(t,ui(gi(e),t,o),kr(m,fe.fromDom(e.getDoc()),x.none())))),d=()=>s(((t,o)=>((e,t)=>{const o=Wo(e);return as(o,t).map((e=>{const t=e[e.length-1],n=e[0].column,r=t.column+t.colspan,i=((e,t,o)=>{if(Qo(e)){const n=P(Jo(e),ul(t,o)),r=A(n,(e=>{const n=je(e.element);return dl(n,"span",o-t),n})),i=fe.fromTag("colgroup");return Fe(i,r),[i]}return[]})(o,n,r),s=((e,t,o)=>A(e.all,(e=>{const n=P(e.cells,ul(t,o)),r=A(n,(e=>{const n=je(e.element);return dl(n,"colspan",o-t),n})),i=fe.fromTag("tr");return Fe(i,r),i})))(o,n,r);return[...i,...s]}))})(t,ui(gi(e),t,o)))),u=(t,o)=>o().each((o=>{const n=A(o,(e=>je(e)));s(((o,r)=>{const i=Sr(fe.fromDom(e.getDoc())),s=((e,t,o,n)=>({selection:Qr(e),clipboard:o,generators:n}))(gi(e),0,n,i);t(o,s).each(a)}))})),p=e=>(t,o)=>((e,t)=>J(e,t)?x.from(e[t]):x.none())(o,"type").each((t=>{l(e(t),o.no_events)}));q({mceTableSplitCells:()=>l(t.unmergeCells),mceTableMergeCells:()=>l(t.mergeCells),mceTableInsertRowBefore:()=>l(t.insertRowsBefore),mceTableInsertRowAfter:()=>l(t.insertRowsAfter),mceTableInsertColBefore:()=>l(t.insertColumnsBefore),mceTableInsertColAfter:()=>l(t.insertColumnsAfter),mceTableDeleteCol:()=>l(t.deleteColumn),mceTableDeleteRow:()=>l(t.deleteRow),mceTableCutCol:()=>d().each((e=>{jl(e),l(t.deleteColumn)})),mceTableCutRow:()=>c().each((e=>{zl(e),l(t.deleteRow)})),mceTableCopyCol:()=>d().each((e=>jl(e))),mceTableCopyRow:()=>c().each((e=>zl(e))),mceTablePasteColBefore:()=>u(t.pasteColsBefore,Ul),mceTablePasteColAfter:()=>u(t.pasteColsAfter,Ul),mceTablePasteRowBefore:()=>u(t.pasteRowsBefore,Hl),mceTablePasteRowAfter:()=>u(t.pasteRowsAfter,Hl),mceTableDelete:()=>Wl(e).each((t=>{Ht(t,o).filter(b(o)).each((t=>{const o=fe.fromText("");if(Pe(t,o),Le(t),e.dom.isEmpty(e.getBody()))e.setContent(""),e.selection.setCursorLocation();else{const t=e.dom.createRng();t.setStart(o.dom,0),t.setEnd(o.dom,0),e.selection.setRng(t),e.nodeChanged()}}))})),mceTableCellToggleClass:(t,o)=>{s((t=>{const n=gi(e),r=L(n,(t=>e.formatter.match("tablecellclass",{value:o},t.dom))),i=r?e.formatter.remove:e.formatter.apply;M(n,(e=>i("tablecellclass",{value:o},e.dom))),Za(e,t.dom,ja)}))},mceTableToggleClass:(t,o)=>{s((t=>{e.formatter.toggle("tableclass",{value:o},t.dom),Za(e,t.dom,ja)}))},mceTableToggleCaption:()=>{Wl(e).each((t=>{Ht(t,o).each((o=>{ct(o,"caption").fold((()=>{const t=fe.fromTag("caption");Ve(t,fe.fromText("Caption")),((e,t,o)=>{Me(e,0).fold((()=>{Ve(e,t)}),(e=>{Be(e,t)}))})(o,t),e.selection.setCursorLocation(t.dom,0)}),(n=>{ae("caption")(t)&&ye("td",o).each((t=>e.selection.setCursorLocation(t.dom,0))),Le(n)})),Za(e,o.dom,Ua)}))}))},mceTableSizingMode:(t,n)=>(t=>Wl(e).each((n=>{nl(e)||ol(e)||tl(e)||Ht(n,o).each((o=>{"relative"!==t||xl(o)?"fixed"!==t||Cl(o)?"responsive"!==t||kl(o)||Ol(o):El(o):Tl(o),Or(o),Za(e,o.dom,Ua)}))})))(n),mceTableCellType:p((e=>"th"===e?t.makeCellsHeader:t.unmakeCellsHeader)),mceTableColType:p((e=>"th"===e?t.makeColumnsHeader:t.unmakeColumnsHeader)),mceTableRowType:p((e=>{switch(e){case"header":return t.makeRowsHeader;case"footer":return t.makeRowsFooter;default:return t.makeRowsBody}}))},((t,o)=>e.addCommand(o,t))),e.addCommand("mceInsertTable",((t,o)=>{((e,t,o,n={})=>{const r=e=>h(e)&&e>0;if(r(t)&&r(o)){const r=n.headerRows||0,i=n.headerColumns||0;return Pl(e,o,t,i,r)}console.error("Invalid values for mceInsertTable - rows and columns values are required to insert a table.")})(e,o.rows,o.columns,o.options)})),e.addCommand("mceTableApplyCellStyle",((t,o)=>{const s=e=>"tablecell"+e.toLowerCase().replace("-","");if(!i(o))return;const a=gi(e);if(0===a.length)return;const l=((e,t)=>{const o={};return((e,t,o,n)=>{q(e,((e,r)=>{(t(e,r)?o:n)(e,r)}))})(e,t,(e=>(t,o)=>{e[o]=t})(o),m),o})(o,((t,o)=>e.formatter.has(s(o))&&r(t)));(e=>{for(const t in e)if(W.call(e,t))return!1;return!0})(l)||(q(l,((t,o)=>{const n=s(o);M(a,(o=>{""===t?e.formatter.remove(n,{value:null},o.dom,!0):e.formatter.apply(n,{value:t},o.dom)}))})),n(a[0]).each((t=>Za(e,t.dom,ja))))}))},Gl=Ps([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Yl={before:Gl.before,on:Gl.on,after:Gl.after,cata:(e,t,o,n)=>e.fold(t,o,n),getStart:e=>e.fold(g,g,g)},Xl=(e,t)=>({selection:e,kill:t}),Kl=(e,t)=>{const o=e.document.createRange();return o.selectNode(t.dom),o},Jl=(e,t)=>{const o=e.document.createRange();return Ql(o,t),o},Ql=(e,t)=>e.selectNodeContents(t.dom),ec=(e,t,o)=>{const n=e.document.createRange();var r;return r=n,t.fold((e=>{r.setStartBefore(e.dom)}),((e,t)=>{r.setStart(e.dom,t)}),(e=>{r.setStartAfter(e.dom)})),((e,t)=>{t.fold((t=>{e.setEndBefore(t.dom)}),((t,o)=>{e.setEnd(t.dom,o)}),(t=>{e.setEndAfter(t.dom)}))})(n,o),n},tc=(e,t,o,n,r)=>{const i=e.document.createRange();return i.setStart(t.dom,o),i.setEnd(n.dom,r),i},oc=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}),nc=Ps([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),rc=(e,t,o)=>t(fe.fromDom(o.startContainer),o.startOffset,fe.fromDom(o.endContainer),o.endOffset),ic=(e,t)=>{const o=((e,t)=>t.match({domRange:e=>({ltr:p(e),rtl:x.none}),relative:(t,o)=>({ltr:qt((()=>ec(e,t,o))),rtl:qt((()=>x.some(ec(e,o,t))))}),exact:(t,o,n,r)=>({ltr:qt((()=>tc(e,t,o,n,r))),rtl:qt((()=>x.some(tc(e,n,r,t,o))))})}))(e,t);return((e,t)=>{const o=t.ltr();return o.collapsed?t.rtl().filter((e=>!1===e.collapsed)).map((e=>nc.rtl(fe.fromDom(e.endContainer),e.endOffset,fe.fromDom(e.startContainer),e.startOffset))).getOrThunk((()=>rc(0,nc.ltr,o))):rc(0,nc.ltr,o)})(0,o)},sc=(e,t)=>ic(e,t).match({ltr:(t,o,n,r)=>{const i=e.document.createRange();return i.setStart(t.dom,o),i.setEnd(n.dom,r),i},rtl:(t,o,n,r)=>{const i=e.document.createRange();return i.setStart(n.dom,r),i.setEnd(t.dom,o),i}});nc.ltr,nc.rtl;const ac=(e,t,o,n)=>({start:e,soffset:t,finish:o,foffset:n}),lc=(e,t,o,n)=>({start:Yl.on(e,t),finish:Yl.on(o,n)}),cc=(e,t)=>{const o=sc(e,t);return ac(fe.fromDom(o.startContainer),o.startOffset,fe.fromDom(o.endContainer),o.endOffset)},dc=lc,uc=(e,t,o,n,r)=>we(o,n)?x.none():qr(o,n,t).bind((t=>{const n=t.boxes.getOr([]);return n.length>1?(r(e,n,t.start,t.finish),x.some(Xl(x.some(dc(o,0,o,ur(o))),!0))):x.none()})),hc=(e,t)=>({item:e,mode:t}),mc=(e,t,o,n=pc)=>e.property().parent(t).map((e=>hc(e,n))),pc=(e,t,o,n=gc)=>o.sibling(e,t).map((e=>hc(e,n))),gc=(e,t,o,n=gc)=>{const r=e.property().children(t);return o.first(r).map((e=>hc(e,n)))},fc=[{current:mc,next:pc,fallback:x.none()},{current:pc,next:gc,fallback:x.some(mc)},{current:gc,next:gc,fallback:x.some(pc)}],vc=(e,t,o,n,r=fc)=>N(r,(e=>e.current===o)).bind((o=>o.current(e,t,n,o.next).orThunk((()=>o.fallback.bind((o=>vc(e,t,o,n))))))),bc=(e,t,o,n,r,i)=>vc(e,t,n,r).bind((t=>i(t.item)?x.none():o(t.item)?x.some(t.item):bc(e,t.item,o,t.mode,r,i))),yc=e=>t=>0===e.property().children(t).length,wc=(e,t,o,n)=>bc(e,t,o,pc,{sibling:(e,t)=>e.query().prevSibling(t),first:e=>e.length>0?x.some(e[e.length-1]):x.none()},n),_c=(e,t,o,n)=>bc(e,t,o,pc,{sibling:(e,t)=>e.query().nextSibling(t),first:e=>e.length>0?x.some(e[0]):x.none()},n),xc=Hr(),Cc=(e,t)=>((e,t,o)=>wc(e,t,yc(e),o))(xc,e,t),kc=(e,t)=>((e,t,o)=>_c(e,t,yc(e),o))(xc,e,t),Sc=Ps([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),Tc=e=>ut(e,"tr"),Ec={...Sc,verify:(e,t,o,n,r,i,s)=>ut(n,"td,th",s).bind((o=>ut(t,"td,th",s).map((t=>we(o,t)?we(n,o)&&ur(o)===r?i(t):Sc.none("in same cell"):$r(Tc,[o,t]).fold((()=>((e,t,o)=>{const n=e.getRect(t),r=e.getRect(o);return r.right>n.left&&r.left<n.right})(e,t,o)?Sc.success():i(t)),(e=>i(t))))))).getOr(Sc.none("default")),cata:(e,t,o,n,r)=>e.fold(t,o,n,r)},Oc=ae("br"),Ac=(e,t,o)=>t(e,o).bind((e=>re(e)&&0===lr(e).trim().length?Ac(e,t,o):x.some(e))),Mc=(e,t,o,n)=>((e,t)=>Me(e,t).filter(Oc).orThunk((()=>Me(e,t-1).filter(Oc))))(t,o).bind((t=>n.traverse(t).fold((()=>Ac(t,n.gather,e).map(n.relative)),(e=>(e=>Se(e).bind((t=>{const o=Ae(t);return((e,t)=>D(e,v(we,t)))(o,e).map((n=>((e,t,o,n)=>({parent:e,children:t,element:o,index:n}))(t,o,e,n)))})))(e).map((e=>Yl.on(e.parent,e.index))))))),Bc=(e,t)=>({left:e.left,top:e.top+t,right:e.right,bottom:e.bottom+t}),Pc=(e,t)=>({left:e.left,top:e.top-t,right:e.right,bottom:e.bottom-t}),Rc=(e,t,o)=>({left:e.left+t,top:e.top+o,right:e.right+t,bottom:e.bottom+o}),Vc=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom}),Nc=(e,t)=>x.some(e.getRect(t)),Dc=(e,t,o)=>ne(t)?Nc(e,t).map(Vc):re(t)?((e,t,o)=>o>=0&&o<ur(t)?e.getRangedRect(t,o,t,o+1):o>0?e.getRangedRect(t,o-1,t,o):x.none())(e,t,o).map(Vc):x.none(),Fc=(e,t)=>ne(t)?Nc(e,t).map(Vc):re(t)?e.getRangedRect(t,0,t,ur(t)).map(Vc):x.none(),Ic=Ps([{none:[]},{retry:["caret"]}]),Lc=(e,t,o)=>{return(n=t,r=Ys,st(((e,t)=>t(e)),at,n,r,undefined)).fold(w,(t=>Fc(e,t).exists((e=>((e,t)=>e.left<t.left||Math.abs(t.right-e.left)<1||e.left>t.right)(o,e)))));var n,r},zc={point:e=>e.bottom,adjuster:(e,t,o,n,r)=>{const i=Bc(r,5);return Math.abs(o.bottom-n.bottom)<1||o.top>r.bottom?Ic.retry(i):o.top===r.bottom?Ic.retry(Bc(r,1)):Lc(e,t,r)?Ic.retry(Rc(i,5,0)):Ic.none()},move:Bc,gather:kc},Hc=(e,t,o,n,r)=>0===r?x.some(n):((e,t,o)=>e.elementFromPoint(t,o).filter((e=>"table"===Q(e))).isSome())(e,n.left,t.point(n))?((e,t,o,n,r)=>Hc(e,t,o,t.move(n,5),r))(e,t,o,n,r-1):e.situsFromPoint(n.left,t.point(n)).bind((i=>i.start.fold(x.none,(i=>Fc(e,i).bind((s=>t.adjuster(e,i,s,o,n).fold(x.none,(n=>Hc(e,t,o,n,r-1))))).orThunk((()=>x.some(n)))),x.none))),Zc=(e,t,o)=>{const n=e.move(o,5),r=Hc(t,e,o,n,100).getOr(n);return((e,t,o)=>e.point(t)>o.getInnerHeight()?x.some(e.point(t)-o.getInnerHeight()):e.point(t)<0?x.some(-e.point(t)):x.none())(e,r,t).fold((()=>t.situsFromPoint(r.left,e.point(r))),(o=>(t.scrollBy(0,o),t.situsFromPoint(r.left,e.point(r)-o))))},jc={tryUp:v(Zc,{point:e=>e.top,adjuster:(e,t,o,n,r)=>{const i=Pc(r,5);return Math.abs(o.top-n.top)<1||o.bottom<r.top?Ic.retry(i):o.bottom===r.top?Ic.retry(Pc(r,1)):Lc(e,t,r)?Ic.retry(Rc(i,5,0)):Ic.none()},move:Pc,gather:Cc}),tryDown:v(Zc,zc),getJumpSize:p(5)},Uc=(e,t,o)=>e.getSelection().bind((n=>((e,t,o,n)=>{const r=Oc(t)?((e,t,o)=>o.traverse(t).orThunk((()=>Ac(t,o.gather,e))).map(o.relative))(e,t,n):Mc(e,t,o,n);return r.map((e=>({start:e,finish:e})))})(t,n.finish,n.foffset,o).fold((()=>x.some(vi(n.finish,n.foffset))),(r=>{const i=e.fromSitus(r);return s=Ec.verify(e,n.finish,n.foffset,i.finish,i.foffset,o.failure,t),Ec.cata(s,(e=>x.none()),(()=>x.none()),(e=>x.some(vi(e,0))),(e=>x.some(vi(e,ur(e)))));var s})))),$c=(e,t,o,n,r,i)=>0===i?x.none():Gc(e,t,o,n,r).bind((s=>{const a=e.fromSitus(s),l=Ec.verify(e,o,n,a.finish,a.foffset,r.failure,t);return Ec.cata(l,(()=>x.none()),(()=>x.some(s)),(s=>we(o,s)&&0===n?Wc(e,o,n,Pc,r):$c(e,t,s,0,r,i-1)),(s=>we(o,s)&&n===ur(s)?Wc(e,o,n,Bc,r):$c(e,t,s,ur(s),r,i-1)))})),Wc=(e,t,o,n,r)=>Dc(e,t,o).bind((t=>qc(e,r,n(t,jc.getJumpSize())))),qc=(e,t,o)=>{const n=ko().browser;return n.isChromium()||n.isSafari()||n.isFirefox()?t.retry(e,o):x.none()},Gc=(e,t,o,n,r)=>Dc(e,o,n).bind((t=>qc(e,r,t))),Yc=(e,t,o,n,r)=>ut(n,"td,th",t).bind((n=>ut(n,"table",t).bind((i=>((e,t)=>at(e,(e=>Se(e).exists((e=>we(e,t)))),void 0).isSome())(r,i)?((e,t,o)=>Uc(e,t,o).bind((n=>$c(e,t,n.element,n.offset,o,20).map(e.fromSitus))))(e,t,o).bind((e=>ut(e.finish,"td,th",t).map((t=>({start:n,finish:t,range:e}))))):x.none())))),Xc=(e,t,o,n,r,i)=>i(n,t).orThunk((()=>Yc(e,t,o,n,r).map((e=>{const t=e.range;return Xl(x.some(dc(t.start,t.soffset,t.finish,t.foffset)),!0)})))),Kc=(e,t)=>ut(e,"tr",t).bind((e=>ut(e,"table",t).bind((o=>{const n=it(o,"tr");return we(e,n[0])?((e,t,o)=>wc(xc,e,(e=>gr(e).isSome()),o))(o,0,t).map((e=>{const t=ur(e);return Xl(x.some(dc(e,t,e,t)),!0)})):x.none()})))),Jc=(e,t)=>ut(e,"tr",t).bind((e=>ut(e,"table",t).bind((o=>{const n=it(o,"tr");return we(e,n[n.length-1])?((e,t,o)=>_c(xc,e,(e=>pr(e).isSome()),o))(o,0,t).map((e=>Xl(x.some(dc(e,0,e,0)),!0))):x.none()})))),Qc=(e,t,o,n,r,i,s)=>Yc(e,o,n,r,i).bind((e=>uc(t,o,e.start,e.finish,s))),ed=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}},td=()=>{const e=(e=>{const t=ed(x.none()),o=()=>t.get().each(e);return{clear:()=>{o(),t.set(x.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{o(),t.set(x.some(e))}}})(m);return{...e,on:t=>e.get().each(t)}},od=(e,t)=>ut(e,"td,th",t),nd={traverse:Oe,gather:kc,relative:Yl.before,retry:jc.tryDown,failure:Ec.failedDown},rd={traverse:Ee,gather:Cc,relative:Yl.before,retry:jc.tryUp,failure:Ec.failedUp},id=e=>t=>t===e,sd=id(38),ad=id(40),ld=e=>e>=37&&e<=40,cd={isBackward:id(37),isForward:id(39)},dd={isBackward:id(39),isForward:id(37)},ud=Ps([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),hd={domRange:ud.domRange,relative:ud.relative,exact:ud.exact,exactFromRange:e=>ud.exact(e.start,e.soffset,e.finish,e.foffset),getWin:e=>{const t=(e=>e.match({domRange:e=>fe.fromDom(e.startContainer),relative:(e,t)=>Yl.getStart(e),exact:(e,t,o,n)=>e}))(e);return fe.fromDom(ke(t).dom.defaultView)},range:ac},md=document.caretPositionFromPoint?(e,t,o)=>{var n,r;return x.from(null===(r=(n=e.dom).caretPositionFromPoint)||void 0===r?void 0:r.call(n,t,o)).bind((t=>{if(null===t.offsetNode)return x.none();const o=e.dom.createRange();return o.setStart(t.offsetNode,t.offset),o.collapse(),x.some(o)}))}:document.caretRangeFromPoint?(e,t,o)=>{var n,r;return x.from(null===(r=(n=e.dom).caretRangeFromPoint)||void 0===r?void 0:r.call(n,t,o))}:x.none,pd=(e,t)=>{const o=Q(e);return"input"===o?Yl.after(e):T(["br","img"],o)?0===t?Yl.before(e):Yl.after(e):Yl.on(e,t)},gd=e=>x.from(e.getSelection()),fd=(e,t)=>{gd(e).each((e=>{e.removeAllRanges(),e.addRange(t)}))},vd=(e,t,o,n,r)=>{const i=tc(e,t,o,n,r);fd(e,i)},bd=(e,t)=>ic(e,t).match({ltr:(t,o,n,r)=>{vd(e,t,o,n,r)},rtl:(t,o,n,r)=>{gd(e).each((i=>{if(i.setBaseAndExtent)i.setBaseAndExtent(t.dom,o,n.dom,r);else if(i.extend)try{((e,t,o,n,r,i)=>{t.collapse(o.dom,n),t.extend(r.dom,i)})(0,i,t,o,n,r)}catch(i){vd(e,n,r,t,o)}else vd(e,n,r,t,o)}))}}),yd=(e,t,o,n,r)=>{const i=((e,t,o,n)=>{const r=pd(e,t),i=pd(o,n);return hd.relative(r,i)})(t,o,n,r);bd(e,i)},wd=(e,t,o)=>{const n=((e,t)=>{const o=e.fold(Yl.before,pd,Yl.after),n=t.fold(Yl.before,pd,Yl.after);return hd.relative(o,n)})(t,o);bd(e,n)},_d=e=>{if(e.rangeCount>0){const t=e.getRangeAt(0),o=e.getRangeAt(e.rangeCount-1);return x.some(ac(fe.fromDom(t.startContainer),t.startOffset,fe.fromDom(o.endContainer),o.endOffset))}return x.none()},xd=e=>{if(null===e.anchorNode||null===e.focusNode)return _d(e);{const t=fe.fromDom(e.anchorNode),o=fe.fromDom(e.focusNode);return((e,t,o,n)=>{const r=((e,t,o,n)=>{const r=Ce(e).dom.createRange();return r.setStart(e.dom,t),r.setEnd(o.dom,n),r})(e,t,o,n),i=we(e,o)&&t===n;return r.collapsed&&!i})(t,e.anchorOffset,o,e.focusOffset)?x.some(ac(t,e.anchorOffset,o,e.focusOffset)):_d(e)}},Cd=(e,t,o=!0)=>{const n=(o?Jl:Kl)(e,t);fd(e,n)},kd=e=>(e=>gd(e).filter((e=>e.rangeCount>0)).bind(xd))(e).map((e=>hd.exact(e.start,e.soffset,e.finish,e.foffset))),Sd=e=>({elementFromPoint:(t,o)=>fe.fromPoint(fe.fromDom(e.document),t,o),getRect:e=>e.dom.getBoundingClientRect(),getRangedRect:(t,o,n,r)=>{const i=hd.exact(t,o,n,r);return((e,t)=>(e=>{const t=e.getClientRects(),o=t.length>0?t[0]:e.getBoundingClientRect();return o.width>0||o.height>0?x.some(o).map(oc):x.none()})(sc(e,t)))(e,i)},getSelection:()=>kd(e).map((t=>cc(e,t))),fromSitus:t=>{const o=hd.relative(t.start,t.finish);return cc(e,o)},situsFromPoint:(t,o)=>((e,t,o)=>((e,t,o)=>{const n=fe.fromDom(e.document);return md(n,t,o).map((e=>ac(fe.fromDom(e.startContainer),e.startOffset,fe.fromDom(e.endContainer),e.endOffset)))})(e,t,o))(e,t,o).map((e=>lc(e.start,e.soffset,e.finish,e.foffset))),clearSelection:()=>{(e=>{gd(e).each((e=>e.removeAllRanges()))})(e)},collapseSelection:(t=!1)=>{kd(e).each((o=>o.fold((e=>e.collapse(t)),((o,n)=>{const r=t?o:n;wd(e,r,r)}),((o,n,r,i)=>{const s=t?o:r,a=t?n:i;yd(e,s,a,s,a)}))))},setSelection:t=>{yd(e,t.start,t.soffset,t.finish,t.foffset)},setRelativeSelection:(t,o)=>{wd(e,t,o)},selectNode:t=>{Cd(e,t,!1)},selectContents:t=>{Cd(e,t)},getInnerHeight:()=>e.innerHeight,getScrollY:()=>(e=>{const t=void 0!==e?e.dom:document,o=t.body.scrollLeft||t.documentElement.scrollLeft,n=t.body.scrollTop||t.documentElement.scrollTop;return un(o,n)})(fe.fromDom(e.document)).top,scrollBy:(t,o)=>{((e,t,o)=>{const n=(void 0!==o?o.dom:document).defaultView;n&&n.scrollBy(e,t)})(t,o,fe.fromDom(e.document))}}),Td=(e,t)=>({rows:e,cols:t}),Ed=e=>void 0!==e.dom.classList,Od=(e,t)=>((e,t,o)=>{const n=((e,t)=>{const o=ue(e,t);return void 0===o||""===o?[]:o.split(" ")})(e,t).concat([o]);return ce(e,t,n.join(" ")),!0})(e,"class",t),Ad=(e,t)=>{Ed(e)?e.dom.classList.add(t):Od(e,t)},Md=(e,t)=>Ed(e)&&e.dom.classList.contains(t),Bd=()=>({tag:"none"}),Pd=e=>({tag:"multiple",elements:e}),Rd=e=>({tag:"single",element:e}),Vd=e=>{const t=fe.fromDom((e=>{if(Ke()&&d(e.target)){const t=fe.fromDom(e.target);if(ne(t)&&d(t.dom.shadowRoot)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return Z(t)}}return x.from(e.target)})(e).getOr(e.target)),o=()=>e.stopPropagation(),n=()=>e.preventDefault(),r=(i=n,s=o,(...e)=>i(s.apply(null,e)));var i,s;return((e,t,o,n,r,i,s)=>({target:e,x:t,y:o,stop:n,prevent:r,kill:i,raw:s}))(t,e.clientX,e.clientY,o,n,r,e)},Nd=(e,t,o,n)=>{e.dom.removeEventListener(t,o,n)},Dd=_,Fd=(e,t,o)=>((e,t,o,n)=>((e,t,o,n,r)=>{const i=((e,t)=>o=>{e(o)&&t(Vd(o))})(o,n);return e.dom.addEventListener(t,i,r),{unbind:v(Nd,e,t,i,r)}})(e,t,o,n,!1))(e,t,Dd,o),Id=Vd,Ld=e=>!Md(fe.fromDom(e.target),"ephox-snooker-resizer-bar"),zd=(e,t)=>{const o=(r=di.selectedSelector,{get:()=>Kr(fe.fromDom(e.getBody()),r).fold((()=>pi(Ar(e),Er(e)).fold(Bd,Rd)),Pd)}),n=((e,t,o)=>{const n=t=>{me(t,e.selected),me(t,e.firstSelected),me(t,e.lastSelected)},r=t=>{ce(t,e.selected,"1")},i=e=>{s(e),o()},s=t=>{const o=it(t,`${e.selectedSelector},${e.firstSelectedSelector},${e.lastSelectedSelector}`);M(o,n)};return{clearBeforeUpdate:s,clear:i,selectRange:(o,n,s,a)=>{i(o),M(n,r),ce(s,e.firstSelected,"1"),ce(a,e.lastSelected,"1"),t(n,s,a)},selectedSelector:e.selectedSelector,firstSelectedSelector:e.firstSelectedSelector,lastSelectedSelector:e.lastSelectedSelector}})(di,((t,o,n)=>{Ht(o).each((r=>{const i=Ya(e),s=kr(m,fe.fromDom(e.getDoc()),i),a=((e,t,o)=>{const n=Wo(e);return ss(n,t).map((e=>{const t=es(n,o,!1),{rows:r}=Io(t),i=((e,t)=>{const o=e.slice(0,t[t.length-1].row+1),n=ts(o);return I(n,(e=>{const o=e.cells.slice(0,t[t.length-1].column+1);return A(o,(e=>e.element))}))})(r,e),s=((e,t)=>{const o=e.slice(t[0].row+t[0].rowspan-1,e.length),n=ts(o);return I(n,(e=>{const o=e.cells.slice(t[0].column+t[0].colspan-1,e.cells.length);return A(o,(e=>e.element))}))})(r,e);return{upOrLeftCells:i,downOrRightCells:s}}))})(r,{selection:gi(e)},s);((e,t,o,n,r)=>{e.dispatch("TableSelectionChange",{cells:t,start:o,finish:n,otherCells:r})})(e,t,o,n,a)}))}),(()=>(e=>{e.dispatch("TableSelectionClear")})(e)));var r;return e.on("init",(o=>{const r=e.getWin(),i=Tr(e),s=Er(e),a=((e,t,o,n)=>{const r=((e,t,o,n)=>{const r=td(),i=r.clear,s=i=>{r.on((r=>{n.clearBeforeUpdate(t),od(i.target,o).each((s=>{qr(r,s,o).each((o=>{const r=o.boxes.getOr([]);if(1===r.length){const o=r[0],s="false"===Gi(o),a=ht(Wi(i.target),o,we);s&&a&&(n.selectRange(t,r,o,o),e.selectContents(o))}else r.length>1&&(n.selectRange(t,r,o.start,o.finish),e.selectContents(s))}))}))}))};return{clearstate:i,mousedown:e=>{n.clear(t),od(e.target,o).each(r.set)},mouseover:e=>{s(e)},mouseup:e=>{s(e),i()}}})(Sd(e),t,o,n);return{clearstate:r.clearstate,mousedown:r.mousedown,mouseover:r.mouseover,mouseup:r.mouseup}})(r,i,s,n),l=((e,t,o,n)=>{const r=Sd(e),i=()=>(n.clear(t),x.none());return{keydown:(e,s,a,l,c,d)=>{const u=e.raw,h=u.which,m=!0===u.shiftKey,p=Gr(t,n.selectedSelector).fold((()=>(ld(h)&&!m&&n.clearBeforeUpdate(t),ad(h)&&m?v(Qc,r,t,o,nd,l,s,n.selectRange):sd(h)&&m?v(Qc,r,t,o,rd,l,s,n.selectRange):ad(h)?v(Xc,r,o,nd,l,s,Jc):sd(h)?v(Xc,r,o,rd,l,s,Kc):x.none)),(e=>{const o=o=>()=>{const i=U(o,(o=>((e,t,o,n,r)=>Xr(n,e,t,r.firstSelectedSelector,r.lastSelectedSelector).map((e=>(r.clearBeforeUpdate(o),r.selectRange(o,e.boxes,e.start,e.finish),e.boxes))))(o.rows,o.cols,t,e,n)));return i.fold((()=>Yr(t,n.firstSelectedSelector,n.lastSelectedSelector).map((e=>{const o=ad(h)||d.isForward(h)?Yl.after:Yl.before;return r.setRelativeSelection(Yl.on(e.first,0),o(e.table)),n.clear(t),Xl(x.none(),!0)}))),(e=>x.some(Xl(x.none(),!0))))};return ad(h)&&m?o([Td(1,0)]):sd(h)&&m?o([Td(-1,0)]):d.isBackward(h)&&m?o([Td(0,-1),Td(-1,0)]):d.isForward(h)&&m?o([Td(0,1),Td(1,0)]):ld(h)&&!m?i:x.none}));return p()},keyup:(e,r,i,s,a)=>Gr(t,n.selectedSelector).fold((()=>{const l=e.raw,c=l.which;return!0===l.shiftKey&&ld(c)?((e,t,o,n,r,i,s)=>we(o,r)&&n===i?x.none():ut(o,"td,th",t).bind((o=>ut(r,"td,th",t).bind((n=>uc(e,t,o,n,s))))))(t,o,r,i,s,a,n.selectRange):x.none()}),x.none)}})(r,i,s,n),c=((e,t,o,n)=>{const r=Sd(e);return(e,i)=>{n.clearBeforeUpdate(t),qr(e,i,o).each((e=>{const o=e.boxes.getOr([]);n.selectRange(t,o,e.start,e.finish),r.selectContents(i),r.collapseSelection()}))}})(r,i,s,n);e.on("TableSelectorChange",(e=>c(e.start,e.finish)));const d=(t,o)=>{(e=>!0===e.raw.shiftKey)(t)&&(o.kill&&t.kill(),o.selection.each((t=>{const o=hd.relative(t.start,t.finish),n=sc(r,o);e.selection.setRng(n)})))},u=e=>0===e.button,h=(()=>{const e=ed(fe.fromDom(i)),t=ed(0);return{touchEnd:o=>{const n=fe.fromDom(o.target);if(ae("td")(n)||ae("th")(n)){const r=e.get(),i=t.get();we(r,n)&&o.timeStamp-i<300&&(o.preventDefault(),c(n,n))}e.set(n),t.set(o.timeStamp)}}})();e.on("dragstart",(e=>{a.clearstate()})),e.on("mousedown",(e=>{u(e)&&Ld(e)&&a.mousedown(Id(e))})),e.on("mouseover",(e=>{var t;void 0!==(t=e).buttons&&0==(1&t.buttons)||!Ld(e)||a.mouseover(Id(e))})),e.on("mouseup",(e=>{u(e)&&Ld(e)&&a.mouseup(Id(e))})),e.on("touchend",h.touchEnd),e.on("keyup",(t=>{const o=Id(t);if(o.raw.shiftKey&&ld(o.raw.which)){const t=e.selection.getRng(),n=fe.fromDom(t.startContainer),r=fe.fromDom(t.endContainer);l.keyup(o,n,t.startOffset,r,t.endOffset).each((e=>{d(o,e)}))}})),e.on("keydown",(o=>{const n=Id(o);t.hide();const r=e.selection.getRng(),i=fe.fromDom(r.startContainer),s=fe.fromDom(r.endContainer),a=rn(cd,dd)(fe.fromDom(e.selection.getStart()));l.keydown(n,i,r.startOffset,s,r.endOffset,a).each((e=>{d(n,e)})),t.show()})),e.on("NodeChange",(()=>{const t=e.selection,o=fe.fromDom(t.getStart()),r=fe.fromDom(t.getEnd());$r(Ht,[o,r]).fold((()=>n.clear(i)),m)}))})),e.on("PreInit",(()=>{e.serializer.addTempAttr(di.firstSelected),e.serializer.addTempAttr(di.lastSelected)})),{getSelectedCells:()=>((e,t,o,n)=>{switch(e.tag){case"none":return t();case"single":return(e=>[e.dom])(e.element);case"multiple":return(e=>A(e,(e=>e.dom)))(e.elements)}})(o.get(),p([])),clearSelectedCells:e=>n.clear(fe.fromDom(e))}},Hd=e=>{let t=[];return{bind:e=>{if(void 0===e)throw new Error("Event bind error: undefined handler");t.push(e)},unbind:e=>{t=P(t,(t=>t!==e))},trigger:(...o)=>{const n={};M(e,((e,t)=>{n[e]=o[t]})),M(t,(e=>{e(n)}))}}},Zd=e=>({registry:G(e,(e=>({bind:e.bind,unbind:e.unbind}))),trigger:G(e,(e=>e.trigger))}),jd=e=>e.slice(0).sort(),Ud=(e,t)=>{const o=P(t,(t=>!T(e,t)));o.length>0&&(e=>{throw new Error("Unsupported keys for object: "+jd(e).join(", "))})(o)},$d=e=>((e,t)=>((e,t,o)=>{if(0===t.length)throw new Error("You must specify at least one required field.");return((e,t)=>{if(!s(t))throw new Error("The "+e+" fields must be an array. Was: "+t+".");M(t,(t=>{if(!r(t))throw new Error("The value "+t+" in the "+e+" fields was not a string.")}))})("required",t),(e=>{const t=jd(e);N(t,((e,o)=>o<t.length-1&&e===t[o+1])).each((e=>{throw new Error("The field: "+e+" occurs more than once in the combined fields: ["+t.join(", ")+"].")}))})(t),n=>{const r=$(n);L(t,(e=>T(r,e)))||((e,t)=>{throw new Error("All required keys ("+jd(e).join(", ")+") were not specified. Specified keys were: "+jd(t).join(", ")+".")})(t,r),e(t,r);const i=P(t,(e=>!o.validate(n[e],e)));return i.length>0&&((e,t)=>{throw new Error("All values need to be of type: "+t+". Keys ("+jd(e).join(", ")+") were not.")})(i,o.label),n}})(e,t,{validate:u,label:"function"}))(Ud,e),Wd=$d(["compare","extract","mutate","sink"]),qd=$d(["element","start","stop","destroy"]),Gd=$d(["forceDrop","drop","move","delayDrop"]),Yd=()=>{const e=(()=>{const e=Zd({move:Hd(["info"])});return{onEvent:m,reset:m,events:e.registry}})(),t=(()=>{let e=x.none();const t=Zd({move:Hd(["info"])});return{onEvent:(o,n)=>{n.extract(o).each((o=>{const r=((t,o)=>{const n=e.map((e=>t.compare(e,o)));return e=x.some(o),n})(n,o);r.each((e=>{t.trigger.move(e)}))}))},reset:()=>{e=x.none()},events:t.registry}})();let o=e;return{on:()=>{o.reset(),o=t},off:()=>{o.reset(),o=e},isOn:()=>o===t,onEvent:(e,t)=>{o.onEvent(e,t)},events:t.events}},Xd=e=>{const t=e.replace(/\./g,"-");return{resolve:e=>t+"-"+e}},Kd=Xd("ephox-dragster").resolve;var Jd=Wd({compare:(e,t)=>un(t.left-e.left,t.top-e.top),extract:e=>x.some(un(e.x,e.y)),sink:(e,t)=>{const o=(e=>{const t={layerClass:Kd("blocker"),...e},o=fe.fromTag("div");return ce(o,"role","presentation"),kt(o,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),Ad(o,Kd("blocker")),Ad(o,t.layerClass),{element:p(o),destroy:()=>{Le(o)}}})(t),n=Fd(o.element(),"mousedown",e.forceDrop),r=Fd(o.element(),"mouseup",e.drop),i=Fd(o.element(),"mousemove",e.move),s=Fd(o.element(),"mouseout",e.delayDrop);return qd({element:o.element,start:e=>{Ve(e,o.element())},stop:()=>{Le(o.element())},destroy:()=>{o.destroy(),r.unbind(),i.unbind(),s.unbind(),n.unbind()}})},mutate:(e,t)=>{e.mutate(t.left,t.top)}});const Qd=Xd("ephox-snooker").resolve,eu=Qd("resizer-bar"),tu=Qd("resizer-rows"),ou=Qd("resizer-cols"),nu=e=>{const t=it(e.parent(),"."+eu);M(t,Le)},ru=(e,t,o)=>{const n=e.origin();M(t,(t=>{t.each((t=>{const r=o(n,t);Ad(r,eu),Ve(e.parent(),r)}))}))},iu=(e,t,o,n,r)=>{const i=mn(o),s=t.isResizable,a=n.length>0?Sn.positions(n,o):[],l=a.length>0?((e,t)=>I(e.all,((e,o)=>t(e.element)?[o]:[])))(e,s):[];((e,t,o,n)=>{ru(e,t,((e,t)=>{const r=((e,t,o,n,r)=>{const i=fe.fromTag("div");return kt(i,{position:"absolute",left:t+"px",top:o-3.5+"px",height:"7px",width:n+"px"}),de(i,{"data-row":e,role:"presentation"}),i})(t.row,o.left-e.left,t.y-e.top,n);return Ad(r,tu),r}))})(t,P(a,((e,t)=>E(l,(e=>t===e)))),i,Ao(o));const c=r.length>0?En.positions(r,o):[],d=c.length>0?((e,t)=>{const o=[];return O(e.grid.columns,(n=>{en(e,n).map((e=>e.element)).forall(t)&&o.push(n)})),P(o,(o=>{const n=Xo(e,(e=>e.column===o));return L(n,(e=>t(e.element)))}))})(e,s):[];((e,t,o,n)=>{ru(e,t,((e,t)=>{const r=((e,t,o,n,r)=>{const i=fe.fromTag("div");return kt(i,{position:"absolute",left:t-3.5+"px",top:o+"px",height:r+"px",width:"7px"}),de(i,{"data-column":e,role:"presentation"}),i})(t.col,t.x-e.left,o.top-e.top,0,n);return Ad(r,ou),r}))})(t,P(c,((e,t)=>E(d,(e=>t===e)))),i,cn(o))},su=(e,t)=>{if(nu(e),e.isResizable(t)){const o=Wo(t),n=nn(o),r=tn(o);iu(o,e,t,n,r)}},au=(e,t)=>{const o=it(e.parent(),"."+eu);M(o,t)},lu=e=>{au(e,(e=>{Ct(e,"display","none")}))},cu=e=>{au(e,(e=>{Ct(e,"display","block")}))},du=Qd("resizer-bar-dragging"),uu=e=>{const t=(()=>{const e=Zd({drag:Hd(["xDelta","yDelta","target"])});let t=x.none();const o=(()=>{const e=Zd({drag:Hd(["xDelta","yDelta"])});return{mutate:(t,o)=>{e.trigger.drag(t,o)},events:e.registry}})();return o.events.drag.bind((o=>{t.each((t=>{e.trigger.drag(o.xDelta,o.yDelta,t)}))})),{assign:e=>{t=x.some(e)},get:()=>t,mutate:o.mutate,events:e.registry}})(),o=((e,t={})=>{var o;return((e,t,o)=>{let n=!1;const r=Zd({start:Hd([]),stop:Hd([])}),i=Yd(),s=()=>{d.stop(),i.isOn()&&(i.off(),r.trigger.stop())},l=((e,t)=>{let o=null;const n=()=>{a(o)||(clearTimeout(o),o=null)};return{cancel:n,throttle:(...t)=>{n(),o=setTimeout((()=>{o=null,e.apply(null,t)}),200)}}})(s);i.events.move.bind((o=>{t.mutate(e,o.info)}));const c=e=>(...t)=>{n&&e.apply(null,t)},d=t.sink(Gd({forceDrop:s,drop:c(s),move:c((e=>{l.cancel(),i.onEvent(e,t)})),delayDrop:c(l.throttle)}),o);return{element:d.element,go:e=>{d.start(e),i.on(),r.trigger.start()},on:()=>{n=!0},off:()=>{n=!1},destroy:()=>{d.destroy()},events:r.registry}})(e,null!==(o=t.mode)&&void 0!==o?o:Jd,t)})(t,{});let n=x.none();const r=(e,t)=>x.from(ue(e,t));t.events.drag.bind((e=>{r(e.target,"data-row").each((t=>{const o=Rt(e.target,"top");Ct(e.target,"top",o+e.yDelta+"px")})),r(e.target,"data-column").each((t=>{const o=Rt(e.target,"left");Ct(e.target,"left",o+e.xDelta+"px")}))}));const i=(e,t)=>Rt(e,t)-At(e,"data-initial-"+t,0);o.events.stop.bind((()=>{t.get().each((t=>{n.each((o=>{r(t,"data-row").each((e=>{const n=i(t,"top");me(t,"data-initial-top"),u.trigger.adjustHeight(o,n,parseInt(e,10))})),r(t,"data-column").each((e=>{const n=i(t,"left");me(t,"data-initial-left"),u.trigger.adjustWidth(o,n,parseInt(e,10))})),su(e,o)}))}))}));const s=(n,r)=>{u.trigger.startAdjust(),t.assign(n),ce(n,"data-initial-"+r,Rt(n,r)),Ad(n,du),Ct(n,"opacity","0.2"),o.go(e.parent())},l=Fd(e.parent(),"mousedown",(e=>{var t;t=e.target,Md(t,tu)&&s(e.target,"top"),(e=>Md(e,ou))(e.target)&&s(e.target,"left")})),c=t=>we(t,e.view()),d=Fd(e.view(),"mouseover",(t=>{var o;(o=t.target,ut(o,"table",c).filter(qi)).fold((()=>{et(t.target)&&nu(e)}),(t=>{n=x.some(t),su(e,t)}))})),u=Zd({adjustHeight:Hd(["table","delta","row"]),adjustWidth:Hd(["table","delta","column"]),startAdjust:Hd([])});return{destroy:()=>{l.unbind(),d.unbind(),o.destroy(),nu(e)},refresh:t=>{su(e,t)},on:o.on,off:o.off,hideBars:v(lu,e),showBars:v(cu,e),events:u.registry}},hu=(e,t,o)=>{const n=Sn,r=En,i=uu(e),s=Zd({beforeResize:Hd(["table","type"]),afterResize:Hd(["table","type"]),startDrag:Hd([])});return i.events.adjustHeight.bind((e=>{const t=e.table;s.trigger.beforeResize(t,"row");((e,t,o,n)=>{const r=Wo(e),i=((e,t,o)=>Qn(e,t,o,Zn,(e=>e.getOrThunk(Nt))))(r,e,n),s=A(i,((e,n)=>o===n?Math.max(t+e,Nt()):e)),a=Ns(r,s),l=((e,t)=>A(e.all,((e,o)=>({element:e.element,height:t[o]}))))(r,s);M(l,(e=>{Dn(e.element,e.height)})),M(a,(e=>{Dn(e.element,e.height)}));const c=R(s,((e,t)=>e+t),0);Dn(e,c)})(t,n.delta(e.delta,t),e.row,n),s.trigger.afterResize(t,"row")})),i.events.startAdjust.bind((e=>{s.trigger.startDrag()})),i.events.adjustWidth.bind((e=>{const n=e.table;s.trigger.beforeResize(n,"col");const i=r.delta(e.delta,n),a=o(n);Fs(n,i,e.column,t,a),s.trigger.afterResize(n,"col")})),{on:i.on,off:i.off,refreshBars:i.refresh,hideBars:i.hideBars,showBars:i.showBars,destroy:i.destroy,events:s.registry}},mu=e=>d(e)&&"TABLE"===e.nodeName,pu="bar-",gu=e=>"false"!==ue(e,"data-mce-resize"),fu=e=>{const t=td(),o=td(),n=td();let r,i;const s=t=>ll(e,t),a=()=>Ja(e)?Mi():Ai();return e.on("init",(()=>{const r=((e,t)=>e.inline?((e,t,o)=>({parent:p(t),view:p(e),origin:p(un(0,0)),isResizable:o}))(fe.fromDom(e.getBody()),(()=>{const e=fe.fromTag("div");return kt(e,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Ve(tt(fe.fromDom(document)),e),e})(),t):((e,t)=>{const o=ie(e)?(e=>fe.fromDom(ke(e).dom.documentElement))(e):e;return{parent:p(o),view:p(e),origin:p(un(0,0)),isResizable:t}})(fe.fromDom(e.getDoc()),t))(e,gu);if(n.set(r),(e=>{const t=e.options.get("object_resizing");return T(t.split(","),"table")})(e)&&rl(e)){const n=a(),i=hu(r,n,s);i.on(),i.events.startDrag.bind((o=>{t.set(e.selection.getRng())})),i.events.beforeResize.bind((t=>{const o=t.table.dom;((e,t,o,n,r)=>{e.dispatch("ObjectResizeStart",{target:t,width:o,height:n,origin:r})})(e,o,Mr(o),Br(o),pu+t.type)})),i.events.afterResize.bind((o=>{const n=o.table,r=n.dom;Or(n),t.on((t=>{e.selection.setRng(t),e.focus()})),((e,t,o,n,r)=>{e.dispatch("ObjectResized",{target:t,width:o,height:n,origin:r})})(e,r,Mr(r),Br(r),pu+o.type),e.undoManager.add()})),o.set(i)}})),e.on("ObjectResizeStart",(t=>{const o=t.target;if(mu(o)){const n=fe.fromDom(o);M(e.dom.select(".mce-clonedresizable"),(t=>{e.dom.addClass(t,"mce-"+Ka(e)+"-columns")})),!Cl(n)&&ol(e)?El(n):!xl(n)&&tl(e)&&Tl(n),kl(n)&&vt(t.origin,pu)&&Tl(n),r=t.width,i=nl(e)?"":((e,t)=>{const o=e.dom.getStyle(t,"width")||e.dom.getAttrib(t,"width");return x.from(o).filter(wt)})(e,o).getOr("")}})),e.on("ObjectResized",(t=>{const o=t.target;if(mu(o)){const n=fe.fromDom(o),l=t.origin;vt(l,"corner-")&&((t,o,n)=>{const l=bt(o,"e");if(""===i&&Tl(t),n!==r&&""!==i){Ct(t,"width",i);const o=a(),c=s(t),d=Ja(e)||l?(e=>Bi(e).columns)(t)-1:0;Fs(t,n-r,d,o,c)}else if((e=>/^(\d+(\.\d+)?)%$/.test(e))(i)){const e=parseFloat(i.replace("%",""));Ct(t,"width",n*e/r+"%")}(e=>/^(\d+(\.\d+)?)px$/.test(e))(i)&&(e=>{const t=Wo(e);Qo(t)||M(Lt(e),(e=>{const t=St(e,"width");Ct(e,"width",t),me(e,"width")}))})(t)})(n,l,t.width),Or(n),Za(e,n.dom,ja)}})),e.on("SwitchMode",(()=>{o.on((t=>{e.mode.isReadOnly()?t.hideBars():t.showBars()}))})),e.on("remove",(()=>{o.on((e=>{e.destroy()})),n.on((t=>{((e,t)=>{e.inline&&Le(t.parent())})(e,t)}))})),{refresh:e=>{o.on((t=>t.refreshBars(fe.fromDom(e))))},hide:()=>{o.on((e=>e.hideBars()))},show:()=>{o.on((e=>e.showBars()))}}},vu=e=>{(e=>{const t=e.options.register;t("table_clone_elements",{processor:"string[]"}),t("table_use_colgroups",{processor:"boolean",default:!0}),t("table_header_type",{processor:e=>{const t=T(["section","cells","sectionCells","auto"],e);return t?{value:e,valid:t}:{valid:!1,message:"Must be one of: section, cells, sectionCells or auto."}},default:"section"}),t("table_sizing_mode",{processor:"string",default:"auto"}),t("table_default_attributes",{processor:"object",default:{border:"1"}}),t("table_default_styles",{processor:"object",default:{"border-collapse":"collapse"}}),t("table_column_resizing",{processor:e=>{const t=T(["preservetable","resizetable"],e);return t?{value:e,valid:t}:{valid:!1,message:"Must be preservetable, or resizetable."}},default:"preservetable"}),t("table_resize_bars",{processor:"boolean",default:!0}),t("table_style_by_css",{processor:"boolean",default:!0})})(e);const t=fu(e),o=zd(e,t),n=cl(e,t,o);return ql(e,n),((e,t)=>{const o=Er(e),n=t=>pi(Ar(e)).bind((n=>Ht(n,o).map((o=>{const r=ui(gi(e),o,n);return t(o,r)})))).getOr("");q({mceTableRowType:()=>n(t.getTableRowType),mceTableCellType:()=>n(t.getTableCellType),mceTableColType:()=>n(t.getTableColType)},((t,o)=>e.addQueryValueHandler(o,t)))})(e,n),fi(e,n),{getSelectedCells:o.getSelectedCells,clearSelectedCells:o.clearSelectedCells}};e.add("dom",(e=>({table:vu(e)})))}()},85245:(e,t,o)=>{o(39223)},39223:()=>{!function(){"use strict";window.mailpoetTinymce.util.Tools.resolve("mailpoetTinymce.PluginManager").add("code",(e=>((e=>{e.addCommand("mceCodeEditor",(()=>{(e=>{const t=(e=>e.getContent({source_view:!0}))(e);e.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:t},onSubmit:t=>{((e,t)=>{e.focus(),e.undoManager.transact((()=>{e.setContent(t)})),e.selection.setCursorLocation(),e.nodeChanged()})(e,t.getData().code),t.close()}})})(e)}))})(e),(e=>{const t=()=>e.execCommand("mceCodeEditor");e.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:t}),e.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:t})})(e),{})))}()},3356:(e,t,o)=>{o(80974)},80974:()=>{!function(){"use strict";var e=window.mailpoetTinymce.util.Tools.resolve("mailpoetTinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=n=e,(r=String).prototype.isPrototypeOf(o)||(null===(i=n.constructor)||void 0===i?void 0:i.name)===r.name)?"string":t;var o,n,r,i})(t)===e,o=e=>t=>typeof t===e,n=t("string"),r=t("object"),i=t("array"),s=(null,e=>null===e);const a=o("boolean"),l=e=>!(e=>null==e)(e),c=o("function"),d=(e,t)=>{if(i(e)){for(let o=0,n=e.length;o<n;++o)if(!t(e[o]))return!1;return!0}return!1},u=()=>{},h=(e,t)=>e===t;class m{constructor(e,t){this.tag=e,this.value=t}static some(e){return new m(!0,e)}static none(){return m.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?m.some(e(this.value)):m.none()}bind(e){return this.tag?e(this.value):m.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:m.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return l(e)?m.some(e):m.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}m.singletonNone=new m(!1);const p=Array.prototype.indexOf,g=Array.prototype.push,f=e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!i(e[o]))throw new Error("Arr.flatten item "+o+" was not an array, input: "+e);g.apply(t,e[o])}return t},v=(e,t)=>{for(let o=0;o<e.length;o++){const n=t(e[o],o);if(n.isSome())return n}return m.none()},b=(e,t,o=h)=>e.exists((e=>o(e,t))),y=e=>{const t=[],o=e=>{t.push(e)};for(let t=0;t<e.length;t++)e[t].each(o);return t},w=(e,t)=>e?m.some(t):m.none(),_=e=>t=>t.options.get(e),x=_("link_assume_external_targets"),C=_("link_context_toolbar"),k=_("link_list"),S=_("link_default_target"),T=_("link_default_protocol"),E=_("link_target_list"),O=_("link_rel_list"),A=_("link_class_list"),M=_("link_title"),B=_("allow_unsafe_link_target"),P=_("link_quicklink");var R=window.mailpoetTinymce.util.Tools.resolve("window.mailpoetTinymce.util.Tools");const V=e=>n(e.value)?e.value:"",N=(e,t)=>{const o=[];return R.each(e,(e=>{const r=(e=>n(e.text)?e.text:n(e.title)?e.title:"")(e);if(void 0!==e.menu){const n=N(e.menu,t);o.push({text:r,items:n})}else{const n=t(e);o.push({text:r,value:n})}})),o},D=(e=V)=>t=>m.from(t).map((t=>N(t,e))),F=e=>D(V)(e),I=D,L=(e,t)=>o=>({name:e,type:"listbox",label:t,items:o}),z=V,H=Object.keys,Z=Object.hasOwnProperty,j=(e,t)=>Z.call(e,t);var U=window.mailpoetTinymce.util.Tools.resolve("mailpoetTinymce.dom.TreeWalker"),$=window.mailpoetTinymce.util.Tools.resolve("window.mailpoetTinymce.util.URI");const W=e=>l(e)&&"a"===e.nodeName.toLowerCase(),q=e=>W(e)&&!!X(e),G=(e,t)=>{if(e.collapsed)return[];{const o=e.cloneContents(),n=o.firstChild,r=new U(n,o),i=[];let s=n;do{t(s)&&i.push(s)}while(s=r.next());return i}},Y=e=>/^\w+:/i.test(e),X=e=>{var t,o;return null!==(o=null!==(t=e.getAttribute("data-mce-href"))&&void 0!==t?t:e.getAttribute("href"))&&void 0!==o?o:""},K=(e,t)=>{const o=["noopener"],n=e?e.split(/\s+/):[],r=e=>e.filter((e=>-1===R.inArray(o,e))),i=t?(e=>(e=r(e)).length>0?e.concat(o):o)(n):r(n);return i.length>0?(e=>R.trim(e.sort().join(" ")))(i):""},J=(e,t)=>(t=t||e.selection.getNode(),ne(t)?m.from(e.dom.select("a[href]",t)[0]):m.from(e.dom.getParent(t,"a[href]"))),Q=(e,t)=>J(e,t).isSome(),ee=(e,t)=>t.fold((()=>e.getContent({format:"text"})),(e=>e.innerText||e.textContent||"")).replace(/\uFEFF/g,""),te=e=>R.grep(e,q).length>0,oe=e=>{const t=e.schema.getTextInlineElements();if(J(e).exists((e=>e.hasAttribute("data-mce-block"))))return!1;const o=e.selection.getRng();return!!o.collapsed||0===G(o,(e=>1===e.nodeType&&!W(e)&&!j(t,e.nodeName.toLowerCase()))).length},ne=e=>l(e)&&"FIGURE"===e.nodeName&&/\bimage\b/i.test(e.className),re=(e,t,o)=>{const n=e.selection.getNode(),r=J(e,n),i=((e,t)=>{const o={...t};if(0===O(e).length&&!B(e)){const e=K(o.rel,"_blank"===o.target);o.rel=e||null}return m.from(o.target).isNone()&&!1===E(e)&&(o.target=S(e)),o.href=((e,t)=>"http"!==t&&"https"!==t||Y(e)?e:t+"://"+e)(o.href,x(e)),o})(e,(e=>{return t=["title","rel","class","target"],o=(t,o)=>(e[o].each((e=>{t[o]=e.length>0?e:null})),t),n={href:e.href},((e,t)=>{for(let o=0,n=e.length;o<n;o++)t(e[o],o)})(t,((e,t)=>{n=o(n,e)})),n;var t,o,n})(o));e.undoManager.transact((()=>{o.href===t.href&&t.attach(),r.fold((()=>{((e,t,o,n)=>{const r=e.dom;ne(t)?ce(r,t,n):o.fold((()=>{e.execCommand("mceInsertLink",!1,n)}),(t=>{e.insertContent(r.createHTML("a",n,r.encode(t)))}))})(e,n,o.text,i)}),(t=>{e.focus(),((e,t,o,n)=>{o.each((e=>{j(t,"innerText")?t.innerText=e:t.textContent=e})),e.dom.setAttribs(t,n),e.selection.select(t)})(e,t,o.text,i)}))}))},ie=e=>{const{class:t,href:o,rel:n,target:r,text:i,title:a}=e;return((e,t)=>{const o={};var n;return((e,t,o,n)=>{((e,t)=>{const o=H(e);for(let n=0,r=o.length;n<r;n++){const r=o[n];t(e[r],r)}})(e,((e,r)=>{(t(e,r)?o:n)(e,r)}))})(e,((e,t)=>!1===s(e)),(n=o,(e,t)=>{n[t]=e}),u),o})({class:t.getOrNull(),href:o,rel:n.getOrNull(),target:r.getOrNull(),text:i.getOrNull(),title:a.getOrNull()})},se=(e,t,o)=>{const n=((e,t)=>{const o=e.options.get,n={allow_html_data_urls:o("allow_html_data_urls"),allow_script_urls:o("allow_script_urls"),allow_svg_data_urls:o("allow_svg_data_urls")},r=t.href;return{...t,href:$.isDomSafe(r,"a",n)?r:""}})(e,o);e.hasPlugin("rtc",!0)?e.execCommand("createlink",!1,ie(n)):re(e,t,n)},ae=e=>{e.hasPlugin("rtc",!0)?e.execCommand("unlink"):(e=>{e.undoManager.transact((()=>{const t=e.selection.getNode();ne(t)?le(e,t):(e=>{const t=e.dom,o=e.selection,n=o.getBookmark(),r=o.getRng().cloneRange(),i=t.getParent(r.startContainer,"a[href]",e.getBody()),s=t.getParent(r.endContainer,"a[href]",e.getBody());i&&r.setStartBefore(i),s&&r.setEndAfter(s),o.setRng(r),e.execCommand("unlink"),o.moveToBookmark(n)})(e),e.focus()}))})(e)},le=(e,t)=>{var o;const n=e.dom.select("img",t)[0];if(n){const r=e.dom.getParents(n,"a[href]",t)[0];r&&(null===(o=r.parentNode)||void 0===o||o.insertBefore(n,r),e.dom.remove(r))}},ce=(e,t,o)=>{var n;const r=e.select("img",t)[0];if(r){const t=e.create("a",o);null===(n=r.parentNode)||void 0===n||n.insertBefore(t,r),t.appendChild(r)}},de=(e,t)=>v(t,(t=>(e=>{return j(t=e,o="items")&&void 0!==t[o]&&null!==t[o];var t,o})(t)?de(e,t.items):w(t.value===e,t))),ue=(e,t)=>{const o={text:e.text,title:e.title},n=(e,n)=>{const r=(i=t,s=n,"link"===s?i.link:"anchor"===s?i.anchor:m.none()).getOr([]);var i,s;return((e,t,o,n)=>{const r=n[t],i=e.length>0;return void 0!==r?de(r,o).map((t=>({url:{value:t.value,meta:{text:i?e:t.text,attach:u}},text:i?e:t.text}))):m.none()})(o.text,n,r,e)};return{onChange:(e,t)=>{const r=t.name;return"url"===r?(e=>{const t=(n=e.url,w(o.text.length<=0,m.from(null===(r=n.meta)||void 0===r?void 0:r.text).getOr(n.value)));var n,r;const i=(e=>{var t;return w(o.title.length<=0,m.from(null===(t=e.meta)||void 0===t?void 0:t.title).getOr(""))})(e.url);return t.isSome()||i.isSome()?m.some({...t.map((e=>({text:e}))).getOr({}),...i.map((e=>({title:e}))).getOr({})}):m.none()})(e()):((e,t)=>p.call(e,t))(["anchor","link"],r)>-1?n(e(),r):"text"===r||"title"===r?(o[r]=e()[r],m.none()):m.none()}}};var he=window.mailpoetTinymce.util.Tools.resolve("window.mailpoetTinymce.util.Delay");const me=e=>{const t=e.href;return t.indexOf("@")>0&&-1===t.indexOf("/")&&-1===t.indexOf("mailto:")?m.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:e=>({...e,href:"mailto:"+t})}):m.none()},pe=(e,t)=>o=>{const n=o.href;return 1===e&&!Y(n)||0===e&&/^\s*www(\.|\d\.)/i.test(n)?m.some({message:`The URL you entered seems to be an external link. Do you want to add the required ${t}:// prefix?`,preprocess:e=>({...e,href:t+"://"+n})}):m.none()},ge=e=>{const t=e.dom.select("a:not([href])"),o=f(((e,t)=>{const o=e.length,n=new Array(o);for(let r=0;r<o;r++){const o=e[r];n[r]=t(o,r)}return n})(t,(e=>{const t=e.name||e.id;return t?[{text:t,value:"#"+t}]:[]})));return o.length>0?m.some([{text:"None",value:""}].concat(o)):m.none()},fe=e=>{const t=A(e);return t.length>0?F(t):m.none()},ve=e=>{try{return m.some(JSON.parse(e))}catch(e){return m.none()}},be=(e,t)=>{const o=O(e);if(o.length>0){const n=b(t,"_blank"),r=e=>K(z(e),n);return(!1===B(e)?I(r):F)(o)}return m.none()},ye=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],we=e=>{const t=E(e);return i(t)?F(t).orThunk((()=>m.some(ye))):!1===t?m.none():m.some(ye)},_e=(e,t,o)=>{const n=e.getAttrib(t,o);return null!==n&&n.length>0?m.some(n):m.none()},xe=(e,t)=>(e=>{const t=t=>e.convertURL(t.value||t.url||"","href"),o=k(e);return new Promise((e=>{n(o)?fetch(o).then((e=>e.ok?e.text().then(ve):Promise.reject())).then(e,(()=>e(m.none()))):c(o)?o((t=>e(m.some(t)))):e(m.from(o))})).then((e=>e.bind(I(t)).map((e=>e.length>0?[{text:"None",value:""}].concat(e):e))))})(e).then((o=>{const n=((e,t)=>{const o=e.dom,n=oe(e)?m.some(ee(e.selection,t)):m.none(),r=t.bind((e=>m.from(o.getAttrib(e,"href")))),i=t.bind((e=>m.from(o.getAttrib(e,"target")))),s=t.bind((e=>_e(o,e,"rel"))),a=t.bind((e=>_e(o,e,"class")));return{url:r,text:n,title:t.bind((e=>_e(o,e,"title"))),target:i,rel:s,linkClass:a}})(e,t);return{anchor:n,catalogs:{targets:we(e),rels:be(e,n.target),classes:fe(e),anchor:ge(e),link:o},optNode:t,flags:{titleEnabled:M(e)}}})),Ce=e=>{const t=(e=>{const t=J(e);return xe(e,t)})(e);t.then((t=>{const o=((e,t)=>o=>{const n=o.getData();if(!n.url.value)return ae(e),void o.close();const r=e=>m.from(n[e]).filter((o=>!b(t.anchor[e],o))),i={href:n.url.value,text:r("text"),target:r("target"),rel:r("rel"),class:r("linkClass"),title:r("title")},s={href:n.url.value,attach:void 0!==n.url.meta&&n.url.meta.attach?n.url.meta.attach:u};((e,t)=>v([me,pe(x(e),T(e))],(e=>e(t))).fold((()=>Promise.resolve(t)),(o=>new Promise((n=>{((e,t,o)=>{const n=e.selection.getRng();he.setEditorTimeout(e,(()=>{e.windowManager.confirm(t,(t=>{e.selection.setRng(n),o(t)}))}))})(e,o.message,(e=>{n(e?o.preprocess(t):t)}))})))))(e,i).then((t=>{se(e,s,t)})),o.close()})(e,t);return((e,t,o)=>{const n=e.anchor.text.map((()=>({name:"text",type:"input",label:"Text to display"}))).toArray(),r=e.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],i=((e,t)=>{const o=e.anchor,n=o.url.getOr("");return{url:{value:n,meta:{original:{value:n}}},text:o.text.getOr(""),title:o.title.getOr(""),anchor:n,link:n,rel:o.rel.getOr(""),target:o.target.or(t).getOr(""),linkClass:o.linkClass.getOr("")}})(e,m.from(S(o))),s=e.catalogs,a=ue(i,s);return{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:f([[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],n,r,y([s.anchor.map(L("anchor","Anchors")),s.rels.map(L("rel","Rel")),s.targets.map(L("target","Open link in...")),s.link.map(L("link","Link list")),s.classes.map(L("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:i,onChange:(e,{name:t})=>{a.onChange(e.getData,{name:t}).each((t=>{e.setData(t)}))},onSubmit:t}})(t,o,e)})).then((t=>{e.windowManager.open(t)}))};var ke=window.mailpoetTinymce.util.Tools.resolve("window.mailpoetTinymce.util.VK");const Se=(e,t)=>e.dom.getParent(t,"a[href]"),Te=e=>Se(e,e.selection.getStart()),Ee=(e,t)=>{if(t){const o=X(t);if(/^#/.test(o)){const t=e.dom.select(o);t.length&&e.selection.scrollIntoView(t[0],!0)}else(e=>{const t=document.createElement("a");t.target="_blank",t.href=e,t.rel="noreferrer noopener";const o=document.createEvent("MouseEvents");o.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),((e,t)=>{document.body.appendChild(e),e.dispatchEvent(t),document.body.removeChild(e)})(t,o)})(t.href)}},Oe=e=>()=>{e.execCommand("mceLink",!1,{dialog:!0})},Ae=e=>()=>{Ee(e,Te(e))},Me=(e,t)=>(e.on("NodeChange",t),()=>e.off("NodeChange",t)),Be=e=>t=>{const o=()=>t.setActive(!e.mode.isReadOnly()&&Q(e,e.selection.getNode()));return o(),Me(e,o)},Pe=e=>t=>{const o=()=>t.setEnabled(Q(e,e.selection.getNode()));return o(),Me(e,o)},Re=e=>t=>{const o=t=>{return te(t)||(o=e.selection.getRng(),G(o,q).length>0);var o},n=e.dom.getParents(e.selection.getStart());return t.setEnabled(o(n)),Me(e,(e=>t.setEnabled(o(e.parents))))};e.add("link",(e=>{(e=>{const t=e.options.register;t("link_assume_external_targets",{processor:e=>{const t=n(e)||a(e);return t?!0===e?{value:1,valid:t}:"http"===e||"https"===e?{value:e,valid:t}:{value:0,valid:t}:{valid:!1,message:"Must be a string or a boolean."}},default:!1}),t("link_context_toolbar",{processor:"boolean",default:!1}),t("link_list",{processor:e=>n(e)||c(e)||d(e,r)}),t("link_default_target",{processor:"string"}),t("link_default_protocol",{processor:"string",default:"https"}),t("link_target_list",{processor:e=>a(e)||d(e,r),default:!0}),t("link_rel_list",{processor:"object[]",default:[]}),t("link_class_list",{processor:"object[]",default:[]}),t("link_title",{processor:"boolean",default:!0}),t("allow_unsafe_link_target",{processor:"boolean",default:!1}),t("link_quicklink",{processor:"boolean",default:!1})})(e),(e=>{e.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:Oe(e),onSetup:Be(e)}),e.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:Ae(e),onSetup:Pe(e)}),e.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:()=>ae(e),onSetup:Re(e)})})(e),(e=>{e.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Ae(e),onSetup:Pe(e)}),e.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:Oe(e)}),e.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:()=>ae(e),onSetup:Re(e)})})(e),(e=>{e.ui.registry.addContextMenu("link",{update:t=>te(e.dom.getParents(t,"a"))?"link unlink openlink":"link"})})(e),(e=>{const t=t=>{const o=e.selection.getNode();return t.setEnabled(Q(e,o)),u};e.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Be(e)},label:"Link",predicate:t=>C(e)&&Q(e,t),initValue:()=>J(e).fold((()=>""),X),commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:t=>{const o=e.selection.getNode();return t.setActive(Q(e,o)),Be(e)(t)},onAction:t=>{const o=t.getValue(),n=(t=>{const o=J(e),n=oe(e);if(o.isNone()&&n){const n=ee(e.selection,o);return m.some(n.length>0?n:t)}return m.none()})(o);se(e,{href:o,attach:u},{href:o,text:n,title:m.none(),rel:m.none(),target:m.none(),class:m.none()}),(e=>{e.selection.collapse(!1)})(e),t.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:t,onAction:t=>{ae(e),t.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:t,onAction:t=>{Ae(e)(),t.hide()}}]})})(e),(e=>{e.on("click",(t=>{const o=Se(e,t.target);o&&ke.metaKeyPressed(t)&&(t.preventDefault(),Ee(e,o))})),e.on("keydown",(t=>{if(!t.isDefaultPrevented()&&13===t.keyCode&&(e=>!0===e.altKey&&!1===e.shiftKey&&!1===e.ctrlKey&&!1===e.metaKey)(t)){const o=Te(e);o&&(t.preventDefault(),Ee(e,o))}}))})(e),(e=>{e.addCommand("mceLink",((t,o)=>{!0!==(null==o?void 0:o.dialog)&&P(e)?e.dispatch("contexttoolbar-show",{toolbarKey:"quicklink"}):Ce(e)}))})(e),(e=>{e.addShortcut("Meta+K","",(()=>{e.execCommand("mceLink")}))})(e)}))}()},47464:(e,t,o)=>{o(20579)},20579:()=>{!function(){"use strict";var e=window.mailpoetTinymce.util.Tools.resolve("mailpoetTinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(o=n=e,(r=String).prototype.isPrototypeOf(o)||(null===(i=n.constructor)||void 0===i?void 0:i.name)===r.name)?"string":t;var o,n,r,i})(t)===e,o=e=>t=>typeof t===e,n=t("string"),r=t("object"),i=t("array"),s=o("boolean"),a=e=>!(e=>null==e)(e),l=o("function"),c=o("number"),d=()=>{},u=(e,t)=>e===t,h=e=>t=>!e(t),m=(!1,()=>false);class p{constructor(e,t){this.tag=e,this.value=t}static some(e){return new p(!0,e)}static none(){return p.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?p.some(e(this.value)):p.none()}bind(e){return this.tag?e(this.value):p.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:p.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return a(e)?p.some(e):p.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}p.singletonNone=new p(!1);const g=Array.prototype.slice,f=Array.prototype.indexOf,v=Array.prototype.push,b=(e,t)=>{return o=e,n=t,f.call(o,n)>-1;var o,n},y=(e,t)=>{for(let o=0,n=e.length;o<n;o++)if(t(e[o],o))return!0;return!1},w=(e,t)=>{const o=e.length,n=new Array(o);for(let r=0;r<o;r++){const o=e[r];n[r]=t(o,r)}return n},_=(e,t)=>{for(let o=0,n=e.length;o<n;o++)t(e[o],o)},x=(e,t)=>{const o=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];t(r,n)&&o.push(r)}return o},C=(e,t,o)=>(_(e,((e,n)=>{o=t(o,e,n)})),o),k=(e,t,o)=>{for(let n=0,r=e.length;n<r;n++){const r=e[n];if(t(r,n))return p.some(r);if(o(r,n))break}return p.none()},S=(e,t)=>k(e,t,m),T=(e,t)=>(e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!i(e[o]))throw new Error("Arr.flatten item "+o+" was not an array, input: "+e);v.apply(t,e[o])}return t})(w(e,t)),E=e=>{const t=g.call(e,0);return t.reverse(),t},O=(e,t)=>t>=0&&t<e.length?p.some(e[t]):p.none(),A=e=>O(e,0),M=e=>O(e,e.length-1),B=(e,t)=>{const o=[],n=l(t)?e=>y(o,(o=>t(o,e))):e=>b(o,e);for(let t=0,r=e.length;t<r;t++){const r=e[t];n(r)||o.push(r)}return o},P=(e,t,o=u)=>e.exists((e=>o(e,t))),R=(e,t,o)=>e.isSome()&&t.isSome()?p.some(o(e.getOrDie(),t.getOrDie())):p.none(),V=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},N=(e,t)=>{const o=(t||document).createElement(e);return V(o)},D=V,F=(e,t)=>e.dom===t.dom;"undefined"!=typeof window?window:Function("return this;")();const I=e=>e.dom.nodeName.toLowerCase(),L=(1,e=>1===(e=>e.dom.nodeType)(e));const z=e=>t=>L(t)&&I(t)===e,H=e=>p.from(e.dom.parentNode).map(D),Z=e=>w(e.dom.childNodes,D),j=(e,t)=>{const o=e.dom.childNodes;return p.from(o[t]).map(D)},U=e=>j(e,0),$=e=>j(e,e.dom.childNodes.length-1),W=(e,t,o)=>{let n=e.dom;const r=l(o)?o:m;for(;n.parentNode;){n=n.parentNode;const e=D(n);if(t(e))return p.some(e);if(r(e))break}return p.none()},q=(e,t,o)=>((e,t,o,n,r)=>n(o)?p.some(o):l(r)&&r(o)?p.none():t(o,n,r))(0,W,e,t,o),G=(e,t)=>{H(e).each((o=>{o.dom.insertBefore(t.dom,e.dom)}))},Y=(e,t)=>{e.dom.appendChild(t.dom)},X=(e,t)=>{_(t,(t=>{Y(e,t)}))},K=e=>{e.dom.textContent="",_(Z(e),(e=>{J(e)}))},J=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)};var Q=window.mailpoetTinymce.util.Tools.resolve("mailpoetTinymce.dom.RangeUtils"),ee=window.mailpoetTinymce.util.Tools.resolve("mailpoetTinymce.dom.TreeWalker"),te=window.mailpoetTinymce.util.Tools.resolve("window.mailpoetTinymce.util.VK");const oe=e=>w(e,D),ne=Object.keys,re=(e,t)=>{const o=ne(e);for(let n=0,r=o.length;n<r;n++){const r=o[n];t(e[r],r)}},ie=(e,t)=>{const o=e.dom;re(t,((e,t)=>{((e,t,o)=>{if(!(n(o)||s(o)||c(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")})(o,t,e)}))},se=e=>C(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}),ae=e=>((e,t)=>D(e.dom.cloneNode(!0)))(e),le=(e,t)=>{const o=((e,t)=>{const o=N(t),n=se(e);return ie(o,n),o})(e,t);var n,r;r=o,(e=>p.from(e.dom.nextSibling).map(D))(n=e).fold((()=>{H(n).each((e=>{Y(e,r)}))}),(e=>{G(e,r)}));const i=Z(e);return X(o,i),J(e),o};var ce=window.mailpoetTinymce.util.Tools.resolve("mailpoetTinymce.dom.DOMUtils"),de=window.mailpoetTinymce.util.Tools.resolve("window.mailpoetTinymce.util.Tools");const ue=e=>t=>a(t)&&t.nodeName.toLowerCase()===e,he=e=>t=>a(t)&&e.test(t.nodeName),me=e=>a(e)&&3===e.nodeType,pe=e=>a(e)&&1===e.nodeType,ge=he(/^(OL|UL|DL)$/),fe=he(/^(OL|UL)$/),ve=ue("ol"),be=he(/^(LI|DT|DD)$/),ye=he(/^(DT|DD)$/),we=he(/^(TH|TD)$/),_e=ue("br"),xe=(e,t)=>a(t)&&t.nodeName in e.schema.getTextBlockElements(),Ce=(e,t)=>a(e)&&e.nodeName in t,ke=(e,t,o)=>{const n=e.isEmpty(t);return!(o&&e.select("span[data-mce-type=bookmark]",t).length>0)&&n},Se=(e,t)=>e.isChildOf(t,e.getRoot()),Te=e=>t=>t.options.get(e),Ee=Te("lists_indent_on_tab"),Oe=Te("forced_root_block"),Ae=Te("forced_root_block_attrs"),Me=(e,t)=>{const o=e.dom,n=e.schema.getBlockElements(),r=o.createFragment(),i=Oe(e),s=Ae(e);let a,l,c=!1;for(l=o.create(i,s),Ce(t.firstChild,n)||r.appendChild(l);a=t.firstChild;){const e=a.nodeName;c||"SPAN"===e&&"bookmark"===a.getAttribute("data-mce-type")||(c=!0),Ce(a,n)?(r.appendChild(a),l=null):(l||(l=o.create(i,s),r.appendChild(l)),l.appendChild(a))}return!c&&l&&l.appendChild(o.create("br",{"data-mce-bogus":"1"})),r},Be=ce.DOM,Pe=z("dd"),Re=z("dt"),Ve=(e,t)=>{var o;Pe(t)?le(t,"dt"):Re(t)&&(o=t,p.from(o.dom.parentElement).map(D)).each((o=>((e,t,o)=>{const n=Be.select('span[data-mce-type="bookmark"]',t),r=Me(e,o),i=Be.createRng();i.setStartAfter(o),i.setEndAfter(t);const s=i.extractContents();for(let t=s.firstChild;t;t=t.firstChild)if("LI"===t.nodeName&&e.dom.isEmpty(t)){Be.remove(t);break}e.dom.isEmpty(s)||Be.insertAfter(s,t),Be.insertAfter(r,t);const a=o.parentElement;a&&ke(e.dom,a)&&(e=>{const t=e.parentNode;t&&de.each(n,(e=>{t.insertBefore(e,o.parentNode)})),Be.remove(e)})(a),Be.remove(o),ke(e.dom,t)&&Be.remove(t)})(e,o.dom,t.dom)))},Ne=e=>{Re(e)&&le(e,"dd")},De=(e,t)=>{if(me(e))return{container:e,offset:t};const o=Q.getNode(e,t);return me(o)?{container:o,offset:t>=e.childNodes.length?o.data.length:0}:o.previousSibling&&me(o.previousSibling)?{container:o.previousSibling,offset:o.previousSibling.data.length}:o.nextSibling&&me(o.nextSibling)?{container:o.nextSibling,offset:0}:{container:e,offset:t}},Fe=e=>{const t=e.cloneRange(),o=De(e.startContainer,e.startOffset);t.setStart(o.container,o.offset);const n=De(e.endContainer,e.endOffset);return t.setEnd(n.container,n.offset),t},Ie=["OL","UL","DL"],Le=Ie.join(","),ze=(e,t)=>{const o=t||e.selection.getStart(!0);return e.dom.getParent(o,Le,je(e,o))},He=e=>{const t=e.selection.getSelectedBlocks();return x(((e,t)=>{const o=de.map(t,(t=>e.dom.getParent(t,"li,dd,dt",je(e,t))||t));return B(o)})(e,t),be)},Ze=(e,t)=>{const o=e.dom.getParents(t,"TD,TH");return o.length>0?o[0]:e.getBody()},je=(e,t)=>{const o=e.dom.getParents(t,e.dom.isBlock),n=S(o,(t=>{return o=e.schema,!ge(n=t)&&!be(n)&&y(Ie,(e=>o.isValidChild(n.nodeName,e)));var o,n}));return n.getOr(e.getBody())},Ue=(e,t)=>{const o=e.dom.getParents(t,"ol,ul",je(e,t));return M(o)},$e=(e,t)=>{const o=w(t,(t=>Ue(e,t).getOr(t)));return B(o)},We=e=>/\btox\-/.test(e.className),qe=(e,t)=>k(e,ge,we).exists((e=>e.nodeName===t&&!We(e))),Ge=(e,t)=>null!==t&&"false"===e.dom.getContentEditableParent(t),Ye=(e,t)=>{const o=e.dom.getParent(t,"ol,ul,dl");return Ge(e,o)},Xe=(e,t)=>{const o=e.selection.getNode();return t({parents:e.dom.getParents(o),element:o}),e.on("NodeChange",t),()=>e.off("NodeChange",t)},Ke=(e,t,o)=>e.dispatch("ListMutation",{action:t,element:o}),Je=(Qe=/^\s+|\s+$/g,e=>e.replace(Qe,""));var Qe;const et=(e,t,o)=>{((e,t,o)=>{if(!n(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);(e=>void 0!==e.style&&l(e.style.getPropertyValue))(e)&&e.style.setProperty(t,o)})(e.dom,t,o)},tt=(e,t)=>{Y(e.item,t.list)},ot=(e,t)=>{const o={list:N(t,e),item:N("li",e)};return Y(o.list,o.item),o},nt=e=>((e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}})(e,"OL,UL"),rt=e=>U(e).exists(nt),it=e=>e.depth>0,st=e=>e.isSelected,at=e=>{const t=Z(e),o=$(e).exists(nt)?t.slice(0,-1):t;return w(o,ae)},lt=e=>(_(e,((t,o)=>{((e,t)=>{const o=e[t].depth,n=e=>e.depth===o&&!e.dirty,r=e=>e.depth<o;return k(E(e.slice(0,t)),n,r).orThunk((()=>k(e.slice(t+1),n,r)))})(e,o).fold((()=>{t.dirty&&(e=>{e.listAttributes=((e,t)=>{const o={};var n;return((e,t,o,n)=>{re(e,((e,r)=>{(t(e,r)?o:n)(e,r)}))})(e,t,(n=o,(e,t)=>{n[t]=e}),d),o})(e.listAttributes,((e,t)=>"start"!==t))})(t)}),(e=>{return n=e,(o=t).listType=n.listType,void(o.listAttributes={...n.listAttributes});var o,n}))})),e),ct=(e,t,o,n)=>U(n).filter(nt).fold((()=>{t.each((e=>{F(e.start,n)&&o.set(!0)}));const r=((e,t,o)=>H(e).filter(L).map((n=>({depth:t,dirty:!1,isSelected:o,content:at(e),itemAttributes:se(e),listAttributes:se(n),listType:I(n)}))))(n,e,o.get());t.each((e=>{F(e.end,n)&&o.set(!1)}));const i=$(n).filter(nt).map((n=>dt(e,t,o,n))).getOr([]);return r.toArray().concat(i)}),(n=>dt(e,t,o,n))),dt=(e,t,o,n)=>T(Z(n),(n=>(nt(n)?dt:ct)(e+1,t,o,n))),ut=(e,t)=>{const o=lt(t);return((e,t)=>{const o=C(t,((t,o)=>o.depth>t.length?((e,t,o)=>{const n=((e,t,o)=>{const n=[];for(let r=0;r<o;r++)n.push(ot(e,t.listType));return n})(e,o,o.depth-t.length);var r;return(e=>{for(let t=1;t<e.length;t++)tt(e[t-1],e[t])})(n),((e,t)=>{for(let t=0;t<e.length-1;t++)et(e[t].item,"list-style-type","none");M(e).each((e=>{ie(e.list,t.listAttributes),ie(e.item,t.itemAttributes),X(e.item,t.content)}))})(n,o),r=n,R(M(t),A(r),tt),t.concat(n)})(e,t,o):((e,t,o)=>{const n=t.slice(0,o.depth);return M(n).each((t=>{const n=((e,t,o)=>{const n=N("li",e);return ie(n,t),X(n,o),n})(e,o.itemAttributes,o.content);((e,t)=>{Y(e.list,t),e.item=t})(t,n),((e,t)=>{I(e.list)!==t.listType&&(e.list=le(e.list,t.listType)),ie(e.list,t.listAttributes)})(t,o)})),n})(e,t,o)),[]);return A(o).map((e=>e.list))})(e.contentDocument,o).toArray()},ht=(e,t,o)=>{const n=((e,t)=>{const o=(e=>{let t=!1;return{get:()=>t,set:e=>{t=e}}})();return w(e,(e=>({sourceList:e,entries:dt(0,t,o,e)})))})(t,(e=>{const t=w(He(e),D);return R(S(t,h(rt)),S(E(t),h(rt)),((e,t)=>({start:e,end:t})))})(e));_(n,(t=>{((e,t)=>{_(x(e,st),(e=>((e,t)=>{switch(e){case"Indent":t.depth++;break;case"Outdent":t.depth--;break;case"Flatten":t.depth=0}t.dirty=!0})(t,e)))})(t.entries,o);const n=((e,t)=>T(((e,t)=>{if(0===e.length)return[];{let o=t(e[0]);const n=[];let r=[];for(let i=0,s=e.length;i<s;i++){const s=e[i],a=t(s);a!==o&&(n.push(r),r=[]),o=a,r.push(s)}return 0!==r.length&&n.push(r),n}})(t,it),(t=>A(t).exists(it)?ut(e,t):((e,t)=>{const o=lt(t);return w(o,(t=>{const o=((e,t)=>{const o=document.createDocumentFragment();return _(e,(e=>{o.appendChild(e.dom)})),D(o)})(t.content);return D(Me(e,o.dom))}))})(e,t))))(e,t.entries);var r;_(n,(t=>{Ke(e,"Indent"===o?"IndentList":"OutdentList",t.dom)})),r=t.sourceList,_(n,(e=>{G(r,e)})),J(t.sourceList)}))},mt=(e,t)=>{const o=oe((e=>{const t=(e=>{const t=Ue(e,e.selection.getStart()),o=x(e.selection.getSelectedBlocks(),fe);return t.toArray().concat(o)})(e);return $e(e,t)})(e)),n=oe((e=>x(He(e),ye))(e));let r=!1;if(o.length||n.length){const i=e.selection.getBookmark();ht(e,o,t),((e,t,o)=>{_(o,"Indent"===t?Ne:t=>Ve(e,t))})(e,t,n),e.selection.moveToBookmark(i),e.selection.setRng(Fe(e.selection.getRng())),e.nodeChanged(),r=!0}return r},pt=(e,t)=>!(e=>{const t=ze(e);return Ge(e,t)})(e)&&mt(e,t),gt=e=>pt(e,"Indent"),ft=e=>pt(e,"Outdent"),vt=e=>pt(e,"Flatten");var bt=window.mailpoetTinymce.util.Tools.resolve("mailpoetTinymce.dom.BookmarkManager");const yt=ce.DOM,wt=e=>{const t={},o=o=>{let n=e[o?"startContainer":"endContainer"],r=e[o?"startOffset":"endOffset"];if(pe(n)){const e=yt.create("span",{"data-mce-type":"bookmark"});n.hasChildNodes()?(r=Math.min(r,n.childNodes.length-1),o?n.insertBefore(e,n.childNodes[r]):yt.insertAfter(e,n.childNodes[r])):n.appendChild(e),n=e,r=0}t[o?"startContainer":"endContainer"]=n,t[o?"startOffset":"endOffset"]=r};return o(!0),e.collapsed||o(),t},_t=e=>{const t=t=>{let o=e[t?"startContainer":"endContainer"],n=e[t?"startOffset":"endOffset"];if(o){if(pe(o)&&o.parentNode){const e=o;n=(e=>{var t;let o=null===(t=e.parentNode)||void 0===t?void 0:t.firstChild,n=0;for(;o;){if(o===e)return n;pe(o)&&"bookmark"===o.getAttribute("data-mce-type")||n++,o=o.nextSibling}return-1})(o),o=o.parentNode,yt.remove(e),!o.hasChildNodes()&&yt.isBlock(o)&&o.appendChild(yt.create("br"))}e[t?"startContainer":"endContainer"]=o,e[t?"startOffset":"endOffset"]=n}};t(!0),t();const o=yt.createRng();return o.setStart(e.startContainer,e.startOffset),e.endContainer&&o.setEnd(e.endContainer,e.endOffset),Fe(o)},xt=e=>{switch(e){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},Ct=(e,t)=>{de.each(t,((t,o)=>{e.setAttribute(o,t)}))},kt=(e,t,o)=>{((e,t,o)=>{const n=o["list-style-type"]?o["list-style-type"]:null;e.setStyle(t,"list-style-type",n)})(e,t,o),((e,t,o)=>{Ct(t,o["list-attributes"]),de.each(e.select("li",t),(e=>{Ct(e,o["list-item-attributes"])}))})(e,t,o)},St=(e,t,o,n)=>{let r=t[o?"startContainer":"endContainer"];const i=t[o?"startOffset":"endOffset"];for(pe(r)&&(r=r.childNodes[Math.min(i,r.childNodes.length-1)]||r),!o&&_e(r.nextSibling)&&(r=r.nextSibling);r.parentNode!==n;){const t=r.parentNode;if(xe(e,r))return r;if(/^(TD|TH)$/.test(t.nodeName))return r;r=t}return r},Tt=(e,t,o)=>{const n=e.selection.getRng();let r="LI";const i=je(e,e.selection.getStart(!0)),s=e.dom;if("false"===s.getContentEditable(e.selection.getNode()))return;"DL"===(t=t.toUpperCase())&&(r="DT");const a=wt(n),l=((e,t,o)=>{const n=[],r=e.dom,i=St(e,t,!0,o),s=St(e,t,!1,o);let a;const l=[];for(let e=i;e&&(l.push(e),e!==s);e=e.nextSibling);return de.each(l,(t=>{var i;if(xe(e,t))return n.push(t),void(a=null);if(r.isBlock(t)||_e(t))return _e(t)&&r.remove(t),void(a=null);const s=t.nextSibling;bt.isBookmarkNode(t)&&(ge(s)||xe(e,s)||!s&&t.parentNode===o)?a=null:(a||(a=r.create("p"),null===(i=t.parentNode)||void 0===i||i.insertBefore(a,t),n.push(a)),a.appendChild(t))})),n})(e,n,i);de.each(l,(n=>{let i;const a=n.previousSibling,l=n.parentNode;be(l)||(a&&ge(a)&&a.nodeName===t&&((e,t,o)=>{const n=e.getStyle(t,"list-style-type");let r=o?o["list-style-type"]:"";return r=null===r?"":r,n===r})(s,a,o)?(i=a,n=s.rename(n,r),a.appendChild(n)):(i=s.create(t),l.insertBefore(i,n),i.appendChild(n),n=s.rename(n,r)),((e,t,o)=>{de.each(["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"],(o=>e.setStyle(t,o,"")))})(s,n),kt(s,i,o),Ot(e.dom,i))})),e.selection.setRng(_t(a))},Et=(e,t,o)=>{return((e,t)=>ge(e)&&e.nodeName===(null==t?void 0:t.nodeName))(t,o)&&((e,t,o)=>e.getStyle(t,"list-style-type",!0)===e.getStyle(o,"list-style-type",!0))(e,t,o)&&(n=o,t.className===n.className);var n},Ot=(e,t)=>{let o,n=t.nextSibling;if(Et(e,t,n)){const r=n;for(;o=r.firstChild;)t.appendChild(o);e.remove(r)}if(n=t.previousSibling,Et(e,t,n)){const r=n;for(;o=r.lastChild;)t.insertBefore(o,t.firstChild);e.remove(r)}},At=e=>"list-style-type"in e,Mt=(e,t,o)=>{const n=ze(e);if(Ye(e,n))return;const i=(e=>{const t=ze(e),o=e.selection.getSelectedBlocks();return((e,t)=>a(e)&&1===t.length&&t[0]===e)(t,o)?(e=>x(e.querySelectorAll(Le),ge))(t):x(o,(e=>ge(e)&&t!==e))})(e),s=r(o)?o:{};i.length>0?((e,t,o,n,r)=>{const i=ge(t);if(i&&t.nodeName===n&&!At(r))vt(e);else{Tt(e,n,r);const s=wt(e.selection.getRng()),a=i?[t,...o]:o;de.each(a,(t=>{((e,t,o,n)=>{if(t.nodeName!==o){const r=e.dom.rename(t,o);kt(e.dom,r,n),Ke(e,xt(o),r)}else kt(e.dom,t,n),Ke(e,xt(o),t)})(e,t,n,r)})),e.selection.setRng(_t(s))}})(e,n,i,t,s):((e,t,o,n)=>{if(t!==e.getBody())if(t)if(t.nodeName!==o||At(n)||We(t)){const r=wt(e.selection.getRng());kt(e.dom,t,n);const i=e.dom.rename(t,o);Ot(e.dom,i),e.selection.setRng(_t(r)),Tt(e,o,n),Ke(e,xt(o),i)}else vt(e);else Tt(e,o,n),Ke(e,xt(o),t)})(e,n,t,s)},Bt=ce.DOM,Pt=(e,t)=>{const o=de.grep(e.select("ol,ul",t));de.each(o,(t=>{((e,t)=>{const o=t.parentElement;if(o&&"LI"===o.nodeName&&o.firstChild===t){const n=o.previousSibling;n&&"LI"===n.nodeName?(n.appendChild(t),ke(e,o)&&Bt.remove(o)):Bt.setStyle(o,"listStyleType","none")}if(ge(o)){const e=o.previousSibling;e&&"LI"===e.nodeName&&e.appendChild(t)}})(e,t)}))},Rt=(e,t,o,n)=>{let r=t.startContainer;const i=t.startOffset;if(me(r)&&(o?i<r.data.length:i>0))return r;const s=e.schema.getNonEmptyElements();pe(r)&&(r=Q.getNode(r,i));const a=new ee(r,n);o&&((e,t)=>!!_e(t)&&e.isBlock(t.nextSibling)&&!_e(t.previousSibling))(e.dom,r)&&a.next();const l=o?a.next.bind(a):a.prev2.bind(a);for(;r=l();){if("LI"===r.nodeName&&!r.hasChildNodes())return r;if(s[r.nodeName])return r;if(me(r)&&r.data.length>0)return r}return null},Vt=(e,t)=>{const o=t.childNodes;return 1===o.length&&!ge(o[0])&&e.isBlock(o[0])},Nt=(e,t,o)=>{let n;const r=t.parentNode;if(!Se(e,t)||!Se(e,o))return;ge(o.lastChild)&&(n=o.lastChild),r===o.lastChild&&_e(r.previousSibling)&&e.remove(r.previousSibling);const i=o.lastChild;i&&_e(i)&&t.hasChildNodes()&&e.remove(i),ke(e,o,!0)&&K(D(o)),((e,t,o)=>{let n;const r=Vt(e,o)?o.firstChild:o;if(((e,t)=>{Vt(e,t)&&e.remove(t.firstChild,!0)})(e,t),!ke(e,t,!0))for(;n=t.firstChild;)r.appendChild(n)})(e,t,o),n&&o.appendChild(n);const s=((e,t)=>{const o=e.dom,n=t.dom;return o!==n&&o.contains(n)})(D(o),D(t))?e.getParents(t,ge,o):[];e.remove(t),_(s,(t=>{ke(e,t)&&t!==e.getRoot()&&e.remove(t)}))},Dt=(e,t)=>{const o=e.dom,n=e.selection,r=n.getStart(),i=Ze(e,r),s=o.getParent(n.getStart(),"LI",i);if(s){const r=s.parentElement;if(r===e.getBody()&&ke(o,r))return!0;const a=Fe(n.getRng()),l=o.getParent(Rt(e,a,t,i),"LI",i);if(l&&l!==s)return e.undoManager.transact((()=>{var o,n;t?((e,t,o,n)=>{const r=e.dom;if(r.isEmpty(n))((e,t,o)=>{K(D(o)),Nt(e.dom,t,o),e.selection.setCursorLocation(o,0)})(e,o,n);else{const i=wt(t);Nt(r,o,n),e.selection.setRng(_t(i))}})(e,a,l,s):(null===(n=(o=s).parentNode)||void 0===n?void 0:n.firstChild)===o?ft(e):((e,t,o,n)=>{const r=wt(t);Nt(e.dom,o,n);const i=_t(r);e.selection.setRng(i)})(e,a,s,l)})),!0;if(!l&&!t&&0===a.startOffset&&0===a.endOffset)return e.undoManager.transact((()=>{vt(e)})),!0}return!1},Ft=e=>{const t=e.selection.getStart(),o=Ze(e,t);return e.dom.getParent(t,"LI,DT,DD",o)||He(e).length>0},It=(e,t)=>{const o=e.selection;return!Ye(e,o.getNode())&&(o.isCollapsed()?((e,t)=>Dt(e,t)||((e,t)=>{const o=e.dom,n=e.selection.getStart(),r=Ze(e,n),i=o.getParent(n,o.isBlock,r);if(i&&o.isEmpty(i)){const n=Fe(e.selection.getRng()),s=o.getParent(Rt(e,n,t,r),"LI",r);if(s){const a=e=>b(["td","th","caption"],I(e)),l=e=>e.dom===r;return!!((e,t,o=u)=>R(e,t,o).getOr(e.isNone()&&t.isNone()))(q(D(s),a,l),q(D(n.startContainer),a,l),F)&&(e.undoManager.transact((()=>{((e,t,o)=>{const n=e.getParent(t.parentNode,e.isBlock,o);e.remove(t),n&&e.isEmpty(n)&&e.remove(n)})(o,i,r),Ot(o,s.parentNode),e.selection.select(s,!0),e.selection.collapse(t)})),!0)}}return!1})(e,t))(e,t):(e=>!!Ft(e)&&(e.undoManager.transact((()=>{e.execCommand("Delete"),Pt(e.dom,e.getBody())})),!0))(e))},Lt=e=>{const t=E(Je(e).split("")),o=w(t,((e,t)=>{const o=e.toUpperCase().charCodeAt(0)-"A".charCodeAt(0)+1;return Math.pow(26,t)*o}));return C(o,((e,t)=>e+t),0)},zt=e=>{if(--e<0)return"";{const t=e%26,o=Math.floor(e/26);return zt(o)+String.fromCharCode("A".charCodeAt(0)+t)}},Ht=e=>{const t=parseInt(e.start,10);return P(e.listStyleType,"upper-alpha")?zt(t):P(e.listStyleType,"lower-alpha")?zt(t).toLowerCase():e.start},Zt=(e,t)=>()=>{const o=ze(e);return a(o)&&o.nodeName===t},jt=e=>{e.addCommand("mceListProps",(()=>{(e=>{const t=ze(e);ve(t)&&!Ye(e,t)&&e.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:Ht({start:e.dom.getAttrib(t,"start","1"),listStyleType:p.from(e.dom.getStyle(t,"list-style-type"))})},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:t=>{(e=>{switch((e=>/^[0-9]+$/.test(e)?2:/^[A-Z]+$/.test(e)?0:/^[a-z]+$/.test(e)?1:e.length>0?4:3)(e)){case 2:return p.some({listStyleType:p.none(),start:e});case 0:return p.some({listStyleType:p.some("upper-alpha"),start:Lt(e).toString()});case 1:return p.some({listStyleType:p.some("lower-alpha"),start:Lt(e).toString()});case 3:return p.some({listStyleType:p.none(),start:""});case 4:return p.none()}})(t.getData().start).each((t=>{e.execCommand("mceListUpdate",!1,{attrs:{start:"1"===t.start?"":t.start},styles:{"list-style-type":t.listStyleType.getOr("")}})})),t.close()}})})(e)}))},Ut=(e,t)=>o=>Xe(e,(n=>{o.setActive(qe(n.parents,t)),o.setEnabled(!Ye(e,n.element))})),$t=(e,t)=>o=>Xe(e,(n=>o.setEnabled(qe(n.parents,t)&&!Ye(e,n.element))));e.add("lists",(e=>((e=>{(0,e.options.register)("lists_indent_on_tab",{processor:"boolean",default:!0})})(e),e.hasPlugin("rtc",!0)?jt(e):((e=>{Ee(e)&&(e=>{e.on("keydown",(t=>{t.keyCode!==te.TAB||te.metaKeyPressed(t)||e.undoManager.transact((()=>{(t.shiftKey?ft(e):gt(e))&&t.preventDefault()}))}))})(e),(e=>{e.on("ExecCommand",(t=>{const o=t.command.toLowerCase();"delete"!==o&&"forwarddelete"!==o||!Ft(e)||Pt(e.dom,e.getBody())})),e.on("keydown",(t=>{t.keyCode===te.BACKSPACE?It(e,!1)&&t.preventDefault():t.keyCode===te.DELETE&&It(e,!0)&&t.preventDefault()}))})(e)})(e),(e=>{e.on("BeforeExecCommand",(t=>{const o=t.command.toLowerCase();"indent"===o?gt(e):"outdent"===o&&ft(e)})),e.addCommand("InsertUnorderedList",((t,o)=>{Mt(e,"UL",o)})),e.addCommand("InsertOrderedList",((t,o)=>{Mt(e,"OL",o)})),e.addCommand("InsertDefinitionList",((t,o)=>{Mt(e,"DL",o)})),e.addCommand("RemoveList",(()=>{vt(e)})),jt(e),e.addCommand("mceListUpdate",((t,o)=>{r(o)&&((e,t)=>{const o=ze(e);null===o||Ye(e,o)||e.undoManager.transact((()=>{r(t.styles)&&e.dom.setStyles(o,t.styles),r(t.attrs)&&re(t.attrs,((t,n)=>e.dom.setAttrib(o,n,t)))}))})(e,o)})),e.addQueryStateHandler("InsertUnorderedList",Zt(e,"UL")),e.addQueryStateHandler("InsertOrderedList",Zt(e,"OL")),e.addQueryStateHandler("InsertDefinitionList",Zt(e,"DL"))})(e)),(e=>{const t=t=>()=>e.execCommand(t);e.hasPlugin("advlist")||(e.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:t("InsertOrderedList"),onSetup:Ut(e,"OL")}),e.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:t("InsertUnorderedList"),onSetup:Ut(e,"UL")}))})(e),(e=>{const t={text:"List properties...",icon:"ordered-list",onAction:()=>e.execCommand("mceListProps"),onSetup:$t(e,"OL")};e.ui.registry.addMenuItem("listprops",t),e.ui.registry.addContextMenu("lists",{update:t=>{const o=ze(e,t);return ve(o)?["listprops"]:[]}})})(e),(e=>({backspaceDelete:t=>{It(e,t)}}))(e))))}()},34630:(e,t,o)=>{o(52766)},52766:()=>{!function(){"use strict";const e=Object.getPrototypeOf,t=(e,t,o)=>{var n;return!!o(e,t.prototype)||(null===(n=e.constructor)||void 0===n?void 0:n.name)===t.name},o=e=>o=>(e=>{const o=typeof e;return null===e?"null":"object"===o&&Array.isArray(e)?"array":"object"===o&&t(e,String,((e,t)=>t.isPrototypeOf(e)))?"string":o})(o)===e,n=e=>t=>typeof t===e,r=e=>t=>e===t,i=o("string"),s=o("object"),a=o=>((o,n)=>s(o)&&t(o,n,((t,o)=>e(t)===o)))(o,Object),l=o("array"),c=r(null),d=n("boolean"),u=r(void 0),h=e=>null==e,m=e=>!h(e),p=n("function"),g=n("number"),f=(e,t)=>{if(l(e)){for(let o=0,n=e.length;o<n;++o)if(!t(e[o]))return!1;return!0}return!1},v=()=>{},b=(e,t)=>(...o)=>e(t.apply(null,o)),y=e=>()=>e,w=e=>e,_=(e,t)=>e===t;function x(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const C=e=>t=>!e(t),k=e=>()=>{throw new Error(e)},S=e=>e(),T=y(!1),E=y(!0);var O=window.mailpoetTinymce.util.Tools.resolve("mailpoetTinymce.ThemeManager");class A{constructor(e,t){this.tag=e,this.value=t}static some(e){return new A(!0,e)}static none(){return A.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?A.some(e(this.value)):A.none()}bind(e){return this.tag?e(this.value):A.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:A.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return m(e)?A.some(e):A.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}A.singletonNone=new A(!1);const M=Array.prototype.slice,B=Array.prototype.indexOf,P=Array.prototype.push,R=(e,t)=>B.call(e,t),V=(e,t)=>{const o=R(e,t);return-1===o?A.none():A.some(o)},N=(e,t)=>R(e,t)>-1,D=(e,t)=>{for(let o=0,n=e.length;o<n;o++)if(t(e[o],o))return!0;return!1},F=(e,t)=>{const o=[];for(let n=0;n<e;n++)o.push(t(n));return o},I=(e,t)=>{const o=[];for(let n=0;n<e.length;n+=t){const r=M.call(e,n,n+t);o.push(r)}return o},L=(e,t)=>{const o=e.length,n=new Array(o);for(let r=0;r<o;r++){const o=e[r];n[r]=t(o,r)}return n},z=(e,t)=>{for(let o=0,n=e.length;o<n;o++)t(e[o],o)},H=(e,t)=>{const o=[],n=[];for(let r=0,i=e.length;r<i;r++){const i=e[r];(t(i,r)?o:n).push(i)}return{pass:o,fail:n}},Z=(e,t)=>{const o=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];t(r,n)&&o.push(r)}return o},j=(e,t,o)=>(((e,t)=>{for(let o=e.length-1;o>=0;o--)t(e[o],o)})(e,((e,n)=>{o=t(o,e,n)})),o),U=(e,t,o)=>(z(e,((e,n)=>{o=t(o,e,n)})),o),$=(e,t)=>((e,t,o)=>{for(let n=0,r=e.length;n<r;n++){const r=e[n];if(t(r,n))return A.some(r);if(o(r,n))break}return A.none()})(e,t,T),W=(e,t)=>{for(let o=0,n=e.length;o<n;o++)if(t(e[o],o))return A.some(o);return A.none()},q=e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!l(e[o]))throw new Error("Arr.flatten item "+o+" was not an array, input: "+e);P.apply(t,e[o])}return t},G=(e,t)=>q(L(e,t)),Y=(e,t)=>{for(let o=0,n=e.length;o<n;++o)if(!0!==t(e[o],o))return!1;return!0},X=e=>{const t=M.call(e,0);return t.reverse(),t},K=(e,t)=>Z(e,(e=>!N(t,e))),J=(e,t)=>{const o={};for(let n=0,r=e.length;n<r;n++){const r=e[n];o[String(r)]=t(r,n)}return o},Q=e=>[e],ee=(e,t)=>{const o=M.call(e,0);return o.sort(t),o},te=(e,t)=>t>=0&&t<e.length?A.some(e[t]):A.none(),oe=e=>te(e,0),ne=e=>te(e,e.length-1),re=p(Array.from)?Array.from:e=>M.call(e),ie=(e,t)=>{for(let o=0;o<e.length;o++){const n=t(e[o],o);if(n.isSome())return n}return A.none()},se=Object.keys,ae=Object.hasOwnProperty,le=(e,t)=>{const o=se(e);for(let n=0,r=o.length;n<r;n++){const r=o[n];t(e[r],r)}},ce=(e,t)=>de(e,((e,o)=>({k:o,v:t(e,o)}))),de=(e,t)=>{const o={};return le(e,((e,n)=>{const r=t(e,n);o[r.k]=r.v})),o},ue=e=>(t,o)=>{e[o]=t},he=(e,t,o,n)=>{le(e,((e,r)=>{(t(e,r)?o:n)(e,r)}))},me=(e,t)=>{const o={};return he(e,t,ue(o),v),o},pe=(e,t)=>{const o=[];return le(e,((e,n)=>{o.push(t(e,n))})),o},ge=(e,t)=>{const o=se(e);for(let n=0,r=o.length;n<r;n++){const r=o[n],i=e[r];if(t(i,r,e))return A.some(i)}return A.none()},fe=e=>pe(e,w),ve=(e,t)=>be(e,t)?A.from(e[t]):A.none(),be=(e,t)=>ae.call(e,t),ye=(e,t)=>be(e,t)&&void 0!==e[t]&&null!==e[t],we=(e,t,o=_)=>e.exists((e=>o(e,t))),_e=e=>{const t=[],o=e=>{t.push(e)};for(let t=0;t<e.length;t++)e[t].each(o);return t},xe=(e,t,o)=>e.isSome()&&t.isSome()?A.some(o(e.getOrDie(),t.getOrDie())):A.none(),Ce=(e,t)=>e?A.some(t):A.none(),ke=(e,t,o)=>""===t||e.length>=t.length&&e.substr(o,o+t.length)===t,Se=(e,t,o=0,n)=>{const r=e.indexOf(t,o);return-1!==r&&(!!u(n)||r+t.length<=n)},Te=(e,t)=>ke(e,t,e.length-t.length),Ee=(ko=/^\s+|\s+$/g,e=>e.replace(ko,"")),Oe=e=>e.length>0,Ae=e=>void 0!==e.style&&p(e.style.getPropertyValue),Me=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},Be=(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return Me(o.childNodes[0])},Pe=(e,t)=>{const o=(t||document).createElement(e);return Me(o)},Re=(e,t)=>{const o=(t||document).createTextNode(e);return Me(o)},Ve=Me,Ne="undefined"!=typeof window?window:Function("return this;")(),De=(e,t)=>((e,t)=>{let o=null!=t?t:Ne;for(let t=0;t<e.length&&null!=o;++t)o=o[e[t]];return o})(e.split("."),t),Fe=Object.getPrototypeOf,Ie=e=>{const t=De("ownerDocument.defaultView",e);return s(e)&&((e=>((e,t)=>{const o=((e,t)=>De(e,t))(e,t);if(null==o)throw new Error(e+" not available on this browser");return o})("HTMLElement",e))(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(Fe(e).constructor.name))},Le=e=>e.dom.nodeName.toLowerCase(),ze=e=>t=>(e=>e.dom.nodeType)(t)===e,He=ze(1),Ze=ze(3),je=ze(9),Ue=ze(11),$e=e=>t=>He(t)&&Le(t)===e,We=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},qe=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,Ge=(e,t)=>e.dom===t.dom,Ye=(e,t)=>{const o=e.dom,n=t.dom;return o!==n&&o.contains(n)},Xe=e=>Ve(e.dom.ownerDocument),Ke=e=>je(e)?e:Xe(e),Je=e=>Ve(Ke(e).dom.documentElement),Qe=e=>Ve(Ke(e).dom.defaultView),et=e=>A.from(e.dom.parentNode).map(Ve),tt=e=>A.from(e.dom.parentElement).map(Ve),ot=e=>A.from(e.dom.offsetParent).map(Ve),nt=e=>L(e.dom.childNodes,Ve),rt=(e,t)=>{const o=e.dom.childNodes;return A.from(o[t]).map(Ve)},it=(e,t)=>({element:e,offset:t}),st=(e,t)=>{const o=nt(e);return o.length>0&&t<o.length?it(o[t],0):it(e,t)},at=e=>Ue(e)&&m(e.dom.host),lt=p(Element.prototype.attachShadow)&&p(Node.prototype.getRootNode),ct=y(lt),dt=lt?e=>Ve(e.dom.getRootNode()):Ke,ut=e=>at(e)?e:Ve(Ke(e).dom.body),ht=e=>{const t=dt(e);return at(t)?A.some(t):A.none()},mt=e=>Ve(e.dom.host),pt=e=>{const t=Ze(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return ht(Ve(t)).fold((()=>o.body.contains(t)),(n=pt,r=mt,e=>n(r(e))));var n,r},gt=()=>ft(Ve(document)),ft=e=>{const t=e.dom.body;if(null==t)throw new Error("Body is not available yet");return Ve(t)},vt=(e,t,o)=>{if(!(i(o)||d(o)||g(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")},bt=(e,t,o)=>{vt(e.dom,t,o)},yt=(e,t)=>{const o=e.dom;le(t,((e,t)=>{vt(o,t,e)}))},wt=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},_t=(e,t)=>A.from(wt(e,t)),xt=(e,t)=>{const o=e.dom;return!(!o||!o.hasAttribute)&&o.hasAttribute(t)},Ct=(e,t)=>{e.dom.removeAttribute(t)},kt=(e,t,o)=>{if(!i(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);Ae(e)&&e.style.setProperty(t,o)},St=(e,t)=>{Ae(e)&&e.style.removeProperty(t)},Tt=(e,t,o)=>{const n=e.dom;kt(n,t,o)},Et=(e,t)=>{const o=e.dom;le(t,((e,t)=>{kt(o,t,e)}))},Ot=(e,t)=>{const o=e.dom;le(t,((e,t)=>{e.fold((()=>{St(o,t)}),(e=>{kt(o,t,e)}))}))},At=(e,t)=>{const o=e.dom,n=window.getComputedStyle(o).getPropertyValue(t);return""!==n||pt(e)?n:Mt(o,t)},Mt=(e,t)=>Ae(e)?e.style.getPropertyValue(t):"",Bt=(e,t)=>{const o=e.dom,n=Mt(o,t);return A.from(n).filter((e=>e.length>0))},Pt=e=>{const t={},o=e.dom;if(Ae(o))for(let e=0;e<o.style.length;e++){const n=o.style.item(e);t[n]=o.style[n]}return t},Rt=(e,t,o)=>{const n=Pe(e);return Tt(n,t,o),Bt(n,t).isSome()},Vt=(e,t)=>{const o=e.dom;St(o,t),we(_t(e,"style").map(Ee),"")&&Ct(e,"style")},Nt=e=>e.dom.offsetWidth,Dt=(e,t)=>{const o=o=>{const n=t(o);if(n<=0||null===n){const t=At(o,e);return parseFloat(t)||0}return n},n=(e,t)=>U(t,((t,o)=>{const n=At(e,o),r=void 0===n?0:parseInt(n,10);return isNaN(r)?t:t+r}),0);return{set:(t,o)=>{if(!g(o)&&!o.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+o);const n=t.dom;Ae(n)&&(n.style[e]=o+"px")},get:o,getOuter:o,aggregate:n,max:(e,t,o)=>{const r=n(e,o);return t>r?t-r:0}}},Ft=Dt("height",(e=>{const t=e.dom;return pt(e)?t.getBoundingClientRect().height:t.offsetHeight})),It=e=>Ft.get(e),Lt=e=>Ft.getOuter(e),zt=(e,t)=>({left:e,top:t,translate:(o,n)=>zt(e+o,t+n)}),Ht=zt,Zt=(e,t)=>void 0!==e?e:void 0!==t?t:0,jt=e=>{const t=e.dom.ownerDocument,o=t.body,n=t.defaultView,r=t.documentElement;if(o===e.dom)return Ht(o.offsetLeft,o.offsetTop);const i=Zt(null==n?void 0:n.pageYOffset,r.scrollTop),s=Zt(null==n?void 0:n.pageXOffset,r.scrollLeft),a=Zt(r.clientTop,o.clientTop),l=Zt(r.clientLeft,o.clientLeft);return Ut(e).translate(s-l,i-a)},Ut=e=>{const t=e.dom,o=t.ownerDocument.body;return o===t?Ht(o.offsetLeft,o.offsetTop):pt(e)?(e=>{const t=e.getBoundingClientRect();return Ht(t.left,t.top)})(t):Ht(0,0)},$t=Dt("width",(e=>e.dom.offsetWidth)),Wt=e=>$t.get(e),qt=e=>$t.getOuter(e),Gt=e=>{let t,o=!1;return(...n)=>(o||(o=!0,t=e.apply(null,n)),t)},Yt=()=>Xt(0,0),Xt=(e,t)=>({major:e,minor:t}),Kt={nu:Xt,detect:(e,t)=>{const o=String(t).toLowerCase();return 0===e.length?Yt():((e,t)=>{const o=((e,t)=>{for(let o=0;o<e.length;o++){const n=e[o];if(n.test(t))return n}})(e,t);if(!o)return{major:0,minor:0};const n=e=>Number(t.replace(o,"$"+e));return Xt(n(1),n(2))})(e,o)},unknown:Yt},Jt=(e,t)=>{const o=String(t).toLowerCase();return $(e,(e=>e.search(o)))},Qt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,eo=e=>t=>Se(t,e),to=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>Se(e,"edge/")&&Se(e,"chrome")&&Se(e,"safari")&&Se(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Qt],search:e=>Se(e,"chrome")&&!Se(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>Se(e,"msie")||Se(e,"trident")},{name:"Opera",versionRegexes:[Qt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:eo("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:eo("firefox")},{name:"Safari",versionRegexes:[Qt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(Se(e,"safari")||Se(e,"mobile/"))&&Se(e,"applewebkit")}],oo=[{name:"Windows",search:eo("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>Se(e,"iphone")||Se(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:eo("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:eo("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:eo("linux"),versionRegexes:[]},{name:"Solaris",search:eo("sunos"),versionRegexes:[]},{name:"FreeBSD",search:eo("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:eo("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],no={browsers:y(to),oses:y(oo)},ro="Edge",io="Chromium",so="Opera",ao="Firefox",lo="Safari",co=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isEdge:n(ro),isChromium:n(io),isIE:n("IE"),isOpera:n(so),isFirefox:n(ao),isSafari:n(lo)}},uo=()=>co({current:void 0,version:Kt.unknown()}),ho=co,mo=(y(ro),y(io),y("IE"),y(so),y(ao),y(lo),"Windows"),po="Android",go="Linux",fo="macOS",vo="Solaris",bo="FreeBSD",yo="ChromeOS",wo=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isWindows:n(mo),isiOS:n("iOS"),isAndroid:n(po),isMacOS:n(fo),isLinux:n(go),isSolaris:n(vo),isFreeBSD:n(bo),isChromeOS:n(yo)}},_o=()=>wo({current:void 0,version:Kt.unknown()}),xo=wo,Co=(y(mo),y("iOS"),y(po),y(go),y(fo),y(vo),y(bo),y(yo),e=>window.matchMedia(e).matches);var ko;let So=Gt((()=>((e,t,o)=>{const n=no.browsers(),r=no.oses(),i=t.bind((e=>((e,t)=>ie(t.brands,(t=>{const o=t.brand.toLowerCase();return $(e,(e=>{var t;return o===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((e=>({current:e.name,version:Kt.nu(parseInt(t.version,10),0)})))})))(n,e))).orThunk((()=>((e,t)=>Jt(e,t).map((e=>{const o=Kt.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(n,e))).fold(uo,ho),s=((e,t)=>Jt(e,t).map((e=>{const o=Kt.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(r,e).fold(_o,xo),a=((e,t,o,n)=>{const r=e.isiOS()&&!0===/ipad/i.test(o),i=e.isiOS()&&!r,s=e.isiOS()||e.isAndroid(),a=s||n("(pointer:coarse)"),l=r||!i&&s&&n("(min-device-width:768px)"),c=i||s&&!l,d=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(o),u=!c&&!l&&!d;return{isiPad:y(r),isiPhone:y(i),isTablet:y(l),isPhone:y(c),isTouch:y(a),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:y(d),isDesktop:y(u)}})(s,i,e,o);return{browser:i,os:s,deviceType:a}})(navigator.userAgent,A.from(navigator.userAgentData),Co)));const To=()=>So(),Eo=e=>{const t=Ve((e=>{if(ct()&&m(e.target)){const t=Ve(e.target);if(He(t)&&(e=>m(e.dom.shadowRoot))(t)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return oe(t)}}return A.from(e.target)})(e).getOr(e.target)),o=()=>e.stopPropagation(),n=()=>e.preventDefault(),r=b(n,o);return((e,t,o,n,r,i,s)=>({target:e,x:t,y:o,stop:n,prevent:r,kill:i,raw:s}))(t,e.clientX,e.clientY,o,n,r,e)},Oo=(e,t,o,n,r)=>{const i=((e,t)=>o=>{e(o)&&t(Eo(o))})(o,n);return e.dom.addEventListener(t,i,r),{unbind:x(Ao,e,t,i,r)}},Ao=(e,t,o,n)=>{e.dom.removeEventListener(t,o,n)},Mo=(e,t)=>{et(e).each((o=>{o.dom.insertBefore(t.dom,e.dom)}))},Bo=(e,t)=>{const o=(e=>A.from(e.dom.nextSibling).map(Ve))(e);o.fold((()=>{et(e).each((e=>{Ro(e,t)}))}),(e=>{Mo(e,t)}))},Po=(e,t)=>{const o=(e=>rt(e,0))(e);o.fold((()=>{Ro(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))},Ro=(e,t)=>{e.dom.appendChild(t.dom)},Vo=(e,t)=>{z(t,(t=>{Ro(e,t)}))},No=e=>{e.dom.textContent="",z(nt(e),(e=>{Do(e)}))},Do=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},Fo=e=>{const t=void 0!==e?e.dom:document,o=t.body.scrollLeft||t.documentElement.scrollLeft,n=t.body.scrollTop||t.documentElement.scrollTop;return Ht(o,n)},Io=(e,t,o)=>{const n=(void 0!==o?o.dom:document).defaultView;n&&n.scrollTo(e,t)},Lo=(e,t,o,n)=>({x:e,y:t,width:o,height:n,right:e+o,bottom:t+n}),zo=e=>{const t=void 0===e?window:e,o=t.document,n=Fo(Ve(o));return(e=>{const t=void 0===e?window:e;return To().browser.isFirefox()?A.none():A.from(t.visualViewport)})(t).fold((()=>{const e=t.document.documentElement,o=e.clientWidth,r=e.clientHeight;return Lo(n.left,n.top,o,r)}),(e=>Lo(Math.max(e.pageLeft,n.left),Math.max(e.pageTop,n.top),e.width,e.height)))},Ho=()=>Ve(document),Zo=(e,t)=>e.view(t).fold(y([]),(t=>{const o=e.owner(t),n=Zo(e,o);return[t].concat(n)}));var jo=Object.freeze({__proto__:null,view:e=>{var t;return(e.dom===document?A.none():A.from(null===(t=e.dom.defaultView)||void 0===t?void 0:t.frameElement)).map(Ve)},owner:e=>Xe(e)});const Uo=e=>{const t=Ho(),o=Fo(t),n=((e,t)=>{const o=t.owner(e),n=Zo(t,o);return A.some(n)})(e,jo);return n.fold(x(jt,e),(t=>{const n=Ut(e),r=j(t,((e,t)=>{const o=Ut(t);return{left:e.left+o.left,top:e.top+o.top}}),{left:0,top:0});return Ht(r.left+n.left+o.left,r.top+n.top+o.top)}))},$o=(e,t,o,n)=>({x:e,y:t,width:o,height:n,right:e+o,bottom:t+n}),Wo=e=>{const t=jt(e),o=qt(e),n=Lt(e);return $o(t.left,t.top,o,n)},qo=e=>{const t=Uo(e),o=qt(e),n=Lt(e);return $o(t.left,t.top,o,n)},Go=()=>zo(window),Yo=e=>{const t=t=>t(e),o=y(e),n=()=>r,r={tag:!0,inner:e,fold:(t,o)=>o(e),isValue:E,isError:T,map:t=>Ko.value(t(e)),mapError:n,bind:t,exists:t,forall:t,getOr:o,or:n,getOrThunk:o,orThunk:n,getOrDie:o,each:t=>{t(e)},toOptional:()=>A.some(e)};return r},Xo=e=>{const t=()=>o,o={tag:!1,inner:e,fold:(t,o)=>t(e),isValue:T,isError:E,map:t,mapError:t=>Ko.error(t(e)),bind:t,exists:T,forall:E,getOr:w,or:w,getOrThunk:S,orThunk:S,getOrDie:k(String(e)),each:v,toOptional:A.none};return o},Ko={value:Yo,error:Xo,fromOption:(e,t)=>e.fold((()=>Xo(t)),Yo)};var Jo;!function(e){e[e.Error=0]="Error",e[e.Value=1]="Value"}(Jo||(Jo={}));const Qo=(e,t,o)=>e.stype===Jo.Error?t(e.serror):o(e.svalue),en=e=>({stype:Jo.Value,svalue:e}),tn=e=>({stype:Jo.Error,serror:e}),on=en,nn=tn,rn=Qo,sn=(e,t,o,n)=>({tag:"field",key:e,newKey:t,presence:o,prop:n}),an=(e,t,o)=>{switch(e.tag){case"field":return t(e.key,e.newKey,e.presence,e.prop);case"custom":return o(e.newKey,e.instantiator)}},ln=e=>(...t)=>{if(0===t.length)throw new Error("Can't merge zero objects");const o={};for(let n=0;n<t.length;n++){const r=t[n];for(const t in r)be(r,t)&&(o[t]=e(o[t],r[t]))}return o},cn=ln(((e,t)=>a(e)&&a(t)?cn(e,t):t)),dn=ln(((e,t)=>t)),un=e=>({tag:"defaultedThunk",process:e}),hn=e=>un(y(e)),mn=e=>({tag:"mergeWithThunk",process:e}),pn=e=>{const t=(e=>{const t=[],o=[];return z(e,(e=>{Qo(e,(e=>o.push(e)),(e=>t.push(e)))})),{values:t,errors:o}})(e);return t.errors.length>0?(o=t.errors,b(nn,q)(o)):on(t.values);var o},gn=e=>s(e)&&se(e).length>100?" removed due to size":JSON.stringify(e,null,2),fn=(e,t)=>nn([{path:e,getErrorInfo:t}]),vn=e=>({extract:(t,o)=>{return n=e(o),r=e=>((e,t)=>fn(e,y(t)))(t,e),n.stype===Jo.Error?r(n.serror):n;var n,r},toString:y("val")}),bn=vn(on),yn=(e,t,o,n)=>n(ve(e,t).getOrThunk((()=>o(e)))),wn=(e,t,o,n,r)=>{const i=e=>r.extract(t.concat([n]),e),s=e=>e.fold((()=>on(A.none())),(e=>{const o=r.extract(t.concat([n]),e);return i=o,s=A.some,i.stype===Jo.Value?{stype:Jo.Value,svalue:s(i.svalue)}:i;var i,s}));switch(e.tag){case"required":return((e,t,o,n)=>ve(t,o).fold((()=>((e,t,o)=>fn(e,(()=>'Could not find valid *required* value for "'+t+'" in '+gn(o))))(e,o,t)),n))(t,o,n,i);case"defaultedThunk":return yn(o,n,e.process,i);case"option":return((e,t,o)=>o(ve(e,t)))(o,n,s);case"defaultedOptionThunk":return((e,t,o,n)=>n(ve(e,t).map((t=>!0===t?o(e):t))))(o,n,e.process,s);case"mergeWithThunk":return yn(o,n,y({}),(t=>{const n=cn(e.process(o),t);return i(n)}))}},_n=e=>({extract:(t,o)=>e().extract(t,o),toString:()=>e().toString()}),xn=e=>se(me(e,m)),Cn=e=>{const t=kn(e),o=j(e,((e,t)=>an(t,(t=>cn(e,{[t]:!0})),y(e))),{});return{extract:(e,n)=>{const r=d(n)?[]:xn(n),i=Z(r,(e=>!ye(o,e)));return 0===i.length?t.extract(e,n):((e,t)=>fn(e,(()=>"There are unsupported fields: ["+t.join(", ")+"] specified")))(e,i)},toString:t.toString}},kn=e=>({extract:(t,o)=>((e,t,o)=>{const n={},r=[];for(const i of o)an(i,((o,i,s,a)=>{const l=wn(s,e,t,o,a);rn(l,(e=>{r.push(...e)}),(e=>{n[i]=e}))}),((e,o)=>{n[e]=o(t)}));return r.length>0?nn(r):on(n)})(t,o,e),toString:()=>{const t=L(e,(e=>an(e,((e,t,o,n)=>e+" -> "+n.toString()),((e,t)=>"state("+e+")"))));return"obj{\n"+t.join("\n")+"}"}}),Sn=e=>({extract:(t,o)=>{const n=L(o,((o,n)=>e.extract(t.concat(["["+n+"]"]),o)));return pn(n)},toString:()=>"array("+e.toString()+")"}),Tn=(e,t)=>{const o=void 0!==t?t:w;return{extract:(t,n)=>{const r=[];for(const i of e){const e=i.extract(t,n);if(e.stype===Jo.Value)return{stype:Jo.Value,svalue:o(e.svalue)};r.push(e)}return pn(r)},toString:()=>"oneOf("+L(e,(e=>e.toString())).join(", ")+")"}},En=(e,t)=>({extract:(o,n)=>{const r=se(n),i=((t,o)=>Sn(vn(e)).extract(t,o))(o,r);return a=e=>{const r=L(e,(e=>sn(e,e,{tag:"required",process:{}},t)));return kn(r).extract(o,n)},(s=i).stype===Jo.Value?a(s.svalue):s;var s,a},toString:()=>"setOf("+t.toString()+")"}),On=b(Sn,kn),An=y(bn),Mn=(e,t)=>vn((o=>{const n=typeof o;return e(o)?on(o):nn(`Expected type: ${t} but got: ${n}`)})),Bn=Mn(g,"number"),Pn=Mn(i,"string"),Rn=Mn(d,"boolean"),Vn=Mn(p,"function"),Nn=e=>{if(Object(e)!==e)return!0;switch({}.toString.call(e).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(e).every((t=>Nn(e[t])));default:return!1}},Dn=vn((e=>Nn(e)?on(e):nn("Expected value to be acceptable for sending via postMessage"))),Fn=(e,t)=>({extract:(o,n)=>ve(n,e).fold((()=>((e,t)=>fn(e,(()=>'Choice schema did not contain choice key: "'+t+'"')))(o,e)),(e=>((e,t,o,n)=>ve(o,n).fold((()=>((e,t,o)=>fn(e,(()=>'The chosen schema: "'+o+'" did not exist in branches: '+gn(t))))(e,o,n)),(o=>o.extract(e.concat(["branch: "+n]),t))))(o,n,t,e))),toString:()=>"chooseOn("+e+"). Possible values: "+se(t)}),In=e=>vn((t=>e(t).fold(nn,on))),Ln=(e,t)=>En((t=>e(t).fold(tn,en)),t),zn=(e,t,o)=>{return n=((e,t,o)=>((e,t)=>e.stype===Jo.Error?{stype:Jo.Error,serror:t(e.serror)}:e)(t.extract([e],o),(e=>({input:o,errors:e}))))(e,t,o),Qo(n,Ko.error,Ko.value);var n},Hn=e=>e.fold((e=>{throw new Error(jn(e))}),w),Zn=(e,t,o)=>Hn(zn(e,t,o)),jn=e=>"Errors: \n"+(e=>{const t=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:y("... (only showing first ten failures)")}]):e;return L(t,(e=>"Failed path: ("+e.path.join(" > ")+")\n"+e.getErrorInfo()))})(e.errors).join("\n")+"\n\nInput object: "+gn(e.input),Un=(e,t)=>Fn(e,ce(t,kn)),$n=sn,Wn=(e,t)=>({tag:"custom",newKey:e,instantiator:t}),qn=e=>In((t=>N(e,t)?Ko.value(t):Ko.error(`Unsupported value: "${t}", choose one of "${e.join(", ")}".`))),Gn=e=>$n(e,e,{tag:"required",process:{}},An()),Yn=(e,t)=>$n(e,e,{tag:"required",process:{}},t),Xn=e=>Yn(e,Bn),Kn=e=>Yn(e,Pn),Jn=(e,t)=>$n(e,e,{tag:"required",process:{}},qn(t)),Qn=e=>Yn(e,Vn),er=(e,t)=>$n(e,e,{tag:"required",process:{}},kn(t)),tr=(e,t)=>$n(e,e,{tag:"required",process:{}},On(t)),or=(e,t)=>$n(e,e,{tag:"required",process:{}},Sn(t)),nr=e=>$n(e,e,{tag:"option",process:{}},An()),rr=(e,t)=>$n(e,e,{tag:"option",process:{}},t),ir=e=>rr(e,Bn),sr=e=>rr(e,Pn),ar=(e,t)=>rr(e,qn(t)),lr=e=>rr(e,Vn),cr=(e,t)=>rr(e,Sn(t)),dr=(e,t)=>rr(e,kn(t)),ur=(e,t)=>$n(e,e,hn(t),An()),hr=(e,t,o)=>$n(e,e,hn(t),o),mr=(e,t)=>hr(e,t,Bn),pr=(e,t)=>hr(e,t,Pn),gr=(e,t,o)=>hr(e,t,qn(o)),fr=(e,t)=>hr(e,t,Rn),vr=(e,t)=>hr(e,t,Vn),br=(e,t,o)=>hr(e,t,Sn(o)),yr=(e,t,o)=>hr(e,t,kn(o)),wr=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}},_r=e=>{if(!l(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");const t=[],o={};return z(e,((n,r)=>{const i=se(n);if(1!==i.length)throw new Error("one and only one name per case");const s=i[0],a=n[s];if(void 0!==o[s])throw new Error("duplicate key detected:"+s);if("cata"===s)throw new Error("cannot have a case named cata (sorry)");if(!l(a))throw new Error("case arguments must be an array");t.push(s),o[s]=(...o)=>{const n=o.length;if(n!==a.length)throw new Error("Wrong number of arguments to case "+s+". Expected "+a.length+" ("+a+"), got "+n);return{fold:(...t)=>{if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);return t[r].apply(null,o)},match:e=>{const n=se(e);if(t.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","));if(!Y(t,(e=>N(n,e))))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "));return e[s].apply(null,o)},log:e=>{console.log(e,{constructors:t,constructor:s,params:o})}}}})),o};_r([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const xr=(e,t)=>((e,t)=>({[e]:t}))(e,t),Cr=e=>(e=>{const t={};return z(e,(e=>{t[e.key]=e.value})),t})(e),kr=e=>p(e)?e:T,Sr=(e,t,o)=>{let n=e.dom;const r=kr(o);for(;n.parentNode;){n=n.parentNode;const e=Ve(n),o=t(e);if(o.isSome())return o;if(r(e))break}return A.none()},Tr=(e,t,o)=>{const n=t(e),r=kr(o);return n.orThunk((()=>r(e)?A.none():Sr(e,t,r)))},Er=(e,t)=>Ge(e.element,t.event.target),Or={can:E,abort:T,run:v},Ar=e=>{if(!ye(e,"can")&&!ye(e,"abort")&&!ye(e,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(e,null,2)+" does not have can, abort, or run!");return{...Or,...e}},Mr=y,Br=Mr("touchstart"),Pr=Mr("touchmove"),Rr=Mr("touchend"),Vr=Mr("touchcancel"),Nr=Mr("mousedown"),Dr=Mr("mousemove"),Fr=Mr("mouseout"),Ir=Mr("mouseup"),Lr=Mr("mouseover"),zr=Mr("focusin"),Hr=Mr("focusout"),Zr=Mr("keydown"),jr=Mr("keyup"),Ur=Mr("input"),$r=Mr("change"),Wr=Mr("click"),qr=Mr("transitioncancel"),Gr=Mr("transitionend"),Yr=Mr("transitionstart"),Xr=Mr("selectstart"),Kr=e=>y("alloy."+e),Jr={tap:Kr("tap")},Qr=Kr("focus"),ei=Kr("blur.post"),ti=Kr("paste.post"),oi=Kr("receive"),ni=Kr("execute"),ri=Kr("focus.item"),ii=Jr.tap,si=Kr("longpress"),ai=Kr("sandbox.close"),li=Kr("typeahead.cancel"),ci=Kr("system.init"),di=Kr("system.touchmove"),ui=Kr("system.touchend"),hi=Kr("system.scroll"),mi=Kr("system.resize"),pi=Kr("system.attached"),gi=Kr("system.detached"),fi=Kr("system.dismissRequested"),vi=Kr("system.repositionRequested"),bi=Kr("focusmanager.shifted"),yi=Kr("slotcontainer.visibility"),wi=Kr("change.tab"),_i=Kr("dismiss.tab"),xi=Kr("highlight"),Ci=Kr("dehighlight"),ki=(e,t)=>{Oi(e,e.element,t,{})},Si=(e,t,o)=>{Oi(e,e.element,t,o)},Ti=e=>{ki(e,ni())},Ei=(e,t,o)=>{Oi(e,t,o,{})},Oi=(e,t,o,n)=>{const r={target:t,...n};e.getSystem().triggerEvent(o,t,r)},Ai=(e,t,o,n)=>{e.getSystem().triggerEvent(o,t,n.event)},Mi=e=>Cr(e),Bi=(e,t)=>({key:e,value:Ar({abort:t})}),Pi=e=>({key:e,value:Ar({run:(e,t)=>{t.event.prevent()}})}),Ri=(e,t)=>({key:e,value:Ar({run:t})}),Vi=(e,t,o)=>({key:e,value:Ar({run:(e,n)=>{t.apply(void 0,[e,n].concat(o))}})}),Ni=e=>t=>({key:e,value:Ar({run:(e,o)=>{Er(e,o)&&t(e,o)}})}),Di=(e,t,o)=>((e,t)=>Ri(e,((o,n)=>{o.getSystem().getByUid(t).each((t=>{Ai(t,t.element,e,n)}))})))(e,t.partUids[o]),Fi=(e,t)=>Ri(e,((e,o)=>{const n=o.event,r=e.getSystem().getByDom(n.target).getOrThunk((()=>Tr(n.target,(t=>e.getSystem().getByDom(t).toOptional()),T).getOr(e)));t(e,r,o)})),Ii=e=>Ri(e,((e,t)=>{t.cut()})),Li=e=>Ri(e,((e,t)=>{t.stop()})),zi=(e,t)=>Ni(e)(t),Hi=Ni(pi()),Zi=Ni(gi()),ji=Ni(ci()),Ui=(Xi=ni(),e=>Ri(Xi,e)),$i=e=>e.dom.innerHTML,Wi=(e,t)=>{const o=Xe(e).dom,n=Ve(o.createDocumentFragment()),r=((e,t)=>{const o=(t||document).createElement("div");return o.innerHTML=e,nt(Ve(o))})(t,o);Vo(n,r),No(e),Ro(e,n)},qi=e=>at(e)?"#shadow-root":(e=>{const t=Pe("div"),o=Ve(e.dom.cloneNode(!0));return Ro(t,o),$i(t)})((e=>((e,t)=>Ve(e.dom.cloneNode(!1)))(e))(e)),Gi=e=>qi(e),Yi=Mi([((e,t)=>({key:e,value:Ar({can:(e,t)=>{const o=t.event,n=o.originator,r=o.target;return!((e,t,o)=>Ge(t,e.element)&&!Ge(t,o))(e,n,r)||(console.warn(Qr()+" did not get interpreted by the desired target. \nOriginator: "+Gi(n)+"\nTarget: "+Gi(r)+"\nCheck the "+Qr()+" event handlers"),!1)}})}))(Qr())]);var Xi,Ki=Object.freeze({__proto__:null,events:Yi});let Ji=0;const Qi=e=>{const t=(new Date).getTime(),o=Math.floor(1e9*Math.random());return Ji++,e+"_"+o+Ji+String(t)},es=y("alloy-id-"),ts=y("data-alloy-id"),os=es(),ns=ts(),rs=(e,t)=>{Object.defineProperty(e.dom,ns,{value:t,writable:!0})},is=e=>{const t=He(e)?e.dom[ns]:null;return A.from(t)},ss=e=>Qi(e),as=w,ls=e=>{const t=t=>`The component must be in a context to execute: ${t}`+(e?"\n"+Gi(e().element)+" is not in context.":""),o=e=>()=>{throw new Error(t(e))},n=e=>()=>{console.warn(t(e))};return{debugInfo:y("fake"),triggerEvent:n("triggerEvent"),triggerFocus:n("triggerFocus"),triggerEscape:n("triggerEscape"),broadcast:n("broadcast"),broadcastOn:n("broadcastOn"),broadcastEvent:n("broadcastEvent"),build:o("build"),buildOrPatch:o("buildOrPatch"),addToWorld:o("addToWorld"),removeFromWorld:o("removeFromWorld"),addToGui:o("addToGui"),removeFromGui:o("removeFromGui"),getByUid:o("getByUid"),getByDom:o("getByDom"),isConnected:T}},cs=ls(),ds=e=>L(e,(e=>Te(e,"/*")?e.substring(0,e.length-"/*".length):e)),us=(e,t)=>{const o=e.toString(),n=o.indexOf(")")+1,r=o.indexOf("("),i=o.substring(r+1,n-1).split(/,\s*/);return e.toFunctionAnnotation=()=>({name:t,parameters:ds(i)}),e},hs=Qi("alloy-premade"),ms=e=>(Object.defineProperty(e.element.dom,hs,{value:e.uid,writable:!0}),xr(hs,e)),ps=e=>ve(e,hs),gs=e=>((e,t)=>{const o=t.toString(),n=o.indexOf(")")+1,r=o.indexOf("("),i=o.substring(r+1,n-1).split(/,\s*/);return e.toFunctionAnnotation=()=>({name:"OVERRIDE",parameters:ds(i.slice(1))}),e})(((t,...o)=>e(t.getApis(),t,...o)),e),fs={init:()=>vs({readState:y("No State required")})},vs=e=>e,bs=(e,t)=>{const o={};return le(e,((e,n)=>{le(e,((e,r)=>{const i=ve(o,r).getOr([]);o[r]=i.concat([t(n,e)])}))})),o},ys=e=>({classes:u(e.classes)?[]:e.classes,attributes:u(e.attributes)?{}:e.attributes,styles:u(e.styles)?{}:e.styles}),ws=e=>e.cHandler,_s=(e,t)=>({name:e,handler:t}),xs=(e,t)=>{const o={};return z(e,(e=>{o[e.name()]=e.handlers(t)})),o},Cs=(e,t,o)=>{const n=t[o];return n?((e,t,o,n)=>{try{const r=ee(o,((o,r)=>{const i=o[t],s=r[t],a=n.indexOf(i),l=n.indexOf(s);if(-1===a)throw new Error("The ordering for "+e+" does not have an entry for "+i+".\nOrder specified: "+JSON.stringify(n,null,2));if(-1===l)throw new Error("The ordering for "+e+" does not have an entry for "+s+".\nOrder specified: "+JSON.stringify(n,null,2));return a<l?-1:l<a?1:0}));return Ko.value(r)}catch(e){return Ko.error([e])}})("Event: "+o,"name",e,n).map((e=>(e=>{const t=((e,t)=>(...t)=>U(e,((e,o)=>e&&(e=>e.can)(o).apply(void 0,t)),!0))(e),o=((e,t)=>(...t)=>U(e,((e,o)=>e||(e=>e.abort)(o).apply(void 0,t)),!1))(e);return{can:t,abort:o,run:(...t)=>{z(e,(e=>{e.run.apply(void 0,t)}))}}})(L(e,(e=>e.handler))))):((e,t)=>Ko.error(["The event ("+e+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify(L(t,(e=>e.name)),null,2)]))(o,e)},ks=(e,t)=>((e,t)=>{const o=(e=>{const t=[],o=[];return z(e,(e=>{e.fold((e=>{t.push(e)}),(e=>{o.push(e)}))})),{errors:t,values:o}})(e);return o.errors.length>0?(n=o.errors,Ko.error(q(n))):((e,t)=>0===e.length?Ko.value(t):Ko.value(cn(t,dn.apply(void 0,e))))(o.values,t);var n})(pe(e,((e,o)=>(1===e.length?Ko.value(e[0].handler):Cs(e,t,o)).map((n=>{const r=(e=>{const t=(e=>p(e)?{can:E,abort:T,run:e}:e)(e);return(e,o,...n)=>{const r=[e,o].concat(n);t.abort.apply(void 0,r)?o.stop():t.can.apply(void 0,r)&&t.run.apply(void 0,r)}})(n),i=e.length>1?Z(t[o],(t=>D(e,(e=>e.name===t)))).join(" > "):e[0].name;return xr(o,((e,t)=>({handler:e,purpose:t}))(r,i))})))),{}),Ss="alloy.base.behaviour",Ts=kn([$n("dom","dom",{tag:"required",process:{}},kn([Gn("tag"),ur("styles",{}),ur("classes",[]),ur("attributes",{}),nr("value"),nr("innerHtml")])),Gn("components"),Gn("uid"),ur("events",{}),ur("apis",{}),$n("eventOrder","eventOrder",(Ks={[ni()]:["disabling",Ss,"toggling","typeaheadevents"],[Qr()]:[Ss,"focusing","keying"],[ci()]:[Ss,"disabling","toggling","representing"],[Ur()]:[Ss,"representing","streaming","invalidating"],[gi()]:[Ss,"representing","item-events","tooltipping"],[Nr()]:["focusing",Ss,"item-type-events"],[Br()]:["focusing",Ss,"item-type-events"],[Lr()]:["item-type-events","tooltipping"],[oi()]:["receiving","reflecting","tooltipping"]},mn(y(Ks))),An()),nr("domModification")]),Es=e=>e.events,Os=(e,t)=>{const o=wt(e,t);return void 0===o||""===o?[]:o.split(" ")},As=e=>void 0!==e.dom.classList,Ms=e=>Os(e,"class"),Bs=(e,t)=>{As(e)?e.dom.classList.add(t):((e,t)=>{((e,t,o)=>{const n=Os(e,t).concat([o]);bt(e,t,n.join(" "))})(e,"class",t)})(e,t)},Ps=(e,t)=>{As(e)?e.dom.classList.remove(t):((e,t)=>{((e,t,o)=>{const n=Z(Os(e,t),(e=>e!==o));n.length>0?bt(e,t,n.join(" ")):Ct(e,t)})(e,"class",t)})(e,t),(e=>{0===(As(e)?e.dom.classList:Ms(e)).length&&Ct(e,"class")})(e)},Rs=(e,t)=>As(e)&&e.dom.classList.contains(t),Vs=(e,t)=>{z(t,(t=>{Bs(e,t)}))},Ns=(e,t)=>{z(t,(t=>{Ps(e,t)}))},Ds=e=>e.dom.value,Fs=(e,t)=>{if(void 0===t)throw new Error("Value.set was undefined");e.dom.value=t},Is=(e,t,o)=>{o.fold((()=>Ro(e,t)),(e=>{Ge(e,t)||(Mo(e,t),Do(e))}))},Ls=(e,t,o)=>{const n=L(t,o),r=nt(e);return z(r.slice(n.length),Do),n},zs=(e,t,o,n)=>{const r=rt(e,t),i=n(o,r),s=((e,t,o)=>rt(e,t).map((e=>{if(o.exists((t=>!Ge(t,e)))){const t=o.map(Le).getOr("span"),n=Pe(t);return Mo(e,n),n}return e})))(e,t,r);return Is(e,i.element,s),i},Hs=(e,t)=>{const o=se(e),n=se(t);return{toRemove:K(n,o),toSet:((e,o)=>{const n={},r={};return he(e,((e,o)=>!be(t,o)||e!==t[o]),ue(n),ue(r)),{t:n,f:r}})(e).t}},Zs=(e,t)=>{const{class:o,style:n,...r}=(e=>U(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}))(t),{toSet:i,toRemove:s}=Hs(e.attributes,r),a=Pt(t),{toSet:l,toRemove:c}=Hs(e.styles,a),d=(e=>As(e)?(e=>{const t=e.dom.classList,o=new Array(t.length);for(let e=0;e<t.length;e++){const n=t.item(e);null!==n&&(o[e]=n)}return o})(e):Ms(e))(t),u=K(d,e.classes),h=K(e.classes,d);return z(s,(e=>Ct(t,e))),yt(t,i),Vs(t,h),Ns(t,u),z(c,(e=>Vt(t,e))),Et(t,l),e.innerHtml.fold((()=>{const o=e.domChildren;((e,t)=>{Ls(e,t,((t,o)=>{const n=rt(e,o);return Is(e,t,n),t}))})(t,o)}),(e=>{Wi(t,e)})),(()=>{const o=t,n=e.value.getOrUndefined();n!==Ds(o)&&Fs(o,null!=n?n:"")})(),t},js=e=>{const t=(e=>{const t=ve(e,"behaviours").getOr({});return G(se(t),(e=>{const o=t[e];return m(o)?[o.me]:[]}))})(e);return((e,t)=>((e,t)=>{const o=L(t,(e=>dr(e.name(),[Gn("config"),ur("state",fs)]))),n=zn("component.behaviours",kn(o),e.behaviours).fold((t=>{throw new Error(jn(t)+"\nComplete spec:\n"+JSON.stringify(e,null,2))}),w);return{list:t,data:ce(n,(e=>{const t=e.map((e=>({config:e.config,state:e.state.init(e.config)})));return y(t)}))}})(e,t))(e,t)},Us=(e,t)=>{const o=()=>h,n=wr(cs),r=Hn((e=>zn("custom.definition",Ts,e))(e)),i=js(e),s=(e=>e.list)(i),a=(e=>e.data)(i),l=((e,t,o)=>{const n={...(r=e).dom,uid:r.uid,domChildren:L(r.components,(e=>e.element))};var r;const i=(e=>e.domModification.fold((()=>ys({})),ys))(e),s={"alloy.base.modification":i},a=t.length>0?((e,t,o,n)=>{const r={...t};z(o,(t=>{r[t.name()]=t.exhibit(e,n)}));const i=bs(r,((e,t)=>({name:e,modification:t}))),s=e=>j(e,((e,t)=>({...t.modification,...e})),{}),a=j(i.classes,((e,t)=>t.modification.concat(e)),[]),l=s(i.attributes),c=s(i.styles);return ys({classes:a,attributes:l,styles:c})})(o,s,t,n):i;return l=n,c=a,{...l,attributes:{...l.attributes,...c.attributes},styles:{...l.styles,...c.styles},classes:l.classes.concat(c.classes)};var l,c})(r,s,a),c=((e,t)=>{const o=t.filter((t=>Le(t)===e.tag&&!(e=>e.innerHtml.isSome()&&e.domChildren.length>0)(e)&&!(e=>be(e.dom,hs))(t))).bind((t=>((e,t)=>{try{const o=Zs(e,t);return A.some(o)}catch(e){return A.none()}})(e,t))).getOrThunk((()=>(e=>{const t=Pe(e.tag);yt(t,e.attributes),Vs(t,e.classes),Et(t,e.styles),e.innerHtml.each((e=>Wi(t,e)));const o=e.domChildren;return Vo(t,o),e.value.each((e=>{Fs(t,e)})),t})(e)));return rs(o,e.uid),o})(l,t),d=((e,t,o)=>{const n={"alloy.base.behaviour":Es(e)};return((e,t,o,n)=>{const r=((e,t,o)=>{const n={...o,...xs(t,e)};return bs(n,_s)})(e,o,n);return ks(r,t)})(o,e.eventOrder,t,n).getOrDie()})(r,s,a),u=wr(r.components),h={uid:e.uid,getSystem:n.get,config:t=>{const o=a;return(p(o[t.name()])?o[t.name()]:()=>{throw new Error("Could not find "+t.name()+" in "+JSON.stringify(e,null,2))})()},hasConfigured:e=>p(a[e.name()]),spec:e,readState:e=>a[e]().map((e=>e.state.readState())).getOr("not enabled"),getApis:()=>r.apis,connect:e=>{n.set(e)},disconnect:()=>{n.set(ls(o))},element:c,syncComponents:()=>{const e=nt(c),t=G(e,(e=>n.get().getByDom(e).fold((()=>[]),Q)));u.set(t)},components:u.get,events:d};return h},$s=e=>{const t=Re(e);return Ws({element:t})},Ws=e=>{const t=Zn("external.component",Cn([Gn("element"),nr("uid")]),e),o=wr(ls()),n=t.uid.getOrThunk((()=>ss("external")));rs(t.element,n);const r={uid:n,getSystem:o.get,config:A.none,hasConfigured:T,connect:e=>{o.set(e)},disconnect:()=>{o.set(ls((()=>r)))},getApis:()=>({}),element:t.element,spec:e,readState:y("No state"),syncComponents:v,components:y([]),events:{}};return ms(r)},qs=ss,Gs=(e,t)=>ps(e).getOrThunk((()=>((e,t)=>{const{events:o,...n}=as(e),r=((e,t)=>{const o=ve(e,"components").getOr([]);return t.fold((()=>L(o,Ys)),(e=>L(o,((t,o)=>Gs(t,rt(e,o))))))})(n,t),i={...n,events:{...Ki,...o},components:r};return Ko.value(Us(i,t))})((e=>be(e,"uid"))(e)?e:{uid:qs(""),...e},t).getOrDie())),Ys=e=>Gs(e,A.none()),Xs=ms;var Ks,Js=(e,t,o,n,r)=>e(o,n)?A.some(o):p(r)&&r(o)?A.none():t(o,n,r);const Qs=(e,t,o)=>{let n=e.dom;const r=p(o)?o:T;for(;n.parentNode;){n=n.parentNode;const e=Ve(n);if(t(e))return A.some(e);if(r(e))break}return A.none()},ea=(e,t,o)=>Js(((e,t)=>t(e)),Qs,e,t,o),ta=(e,t,o)=>ea(e,t,o).isSome(),oa=(e,t,o)=>Qs(e,(e=>We(e,t)),o),na=(e,t)=>((e,o)=>$(e.dom.childNodes,(e=>{return o=Ve(e),We(o,t);var o})).map(Ve))(e),ra=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return qe(o)?A.none():A.from(o.querySelector(e)).map(Ve)})(t,e),ia=(e,t,o)=>Js(((e,t)=>We(e,t)),oa,e,t,o),sa="aria-controls",aa=()=>{const e=Qi(sa);return{id:e,link:t=>{bt(t,sa,e)},unlink:e=>{Ct(e,sa)}}},la=(e,t)=>ta(t,(t=>Ge(t,e.element)),T)||((e,t)=>(e=>ea(e,(e=>{if(!He(e))return!1;const t=wt(e,"id");return void 0!==t&&t.indexOf(sa)>-1})).bind((e=>{const t=wt(e,"id"),o=dt(e);return ra(o,`[${sa}="${t}"]`)})))(t).exists((t=>la(e,t))))(e,t);var ca;!function(e){e[e.STOP=0]="STOP",e[e.NORMAL=1]="NORMAL",e[e.LOGGING=2]="LOGGING"}(ca||(ca={}));const da=wr({}),ua=["alloy/data/Fields","alloy/debugging/Debugging"],ha=(e,t,o)=>((e,t,o)=>{switch(ve(da.get(),e).orThunk((()=>{const t=se(da.get());return ie(t,(t=>e.indexOf(t)>-1?A.some(da.get()[t]):A.none()))})).getOr(ca.NORMAL)){case ca.NORMAL:return o(ma());case ca.LOGGING:{const n=((e,t)=>{const o=[],n=(new Date).getTime();return{logEventCut:(e,t,n)=>{o.push({outcome:"cut",target:t,purpose:n})},logEventStopped:(e,t,n)=>{o.push({outcome:"stopped",target:t,purpose:n})},logNoParent:(e,t,n)=>{o.push({outcome:"no-parent",target:t,purpose:n})},logEventNoHandlers:(e,t)=>{o.push({outcome:"no-handlers-left",target:t})},logEventResponse:(e,t,n)=>{o.push({outcome:"response",purpose:n,target:t})},write:()=>{const r=(new Date).getTime();N(["mousemove","mouseover","mouseout",ci()],e)||console.log(e,{event:e,time:r-n,target:t.dom,sequence:L(o,(e=>N(["cut","stopped","response"],e.outcome)?"{"+e.purpose+"} "+e.outcome+" at ("+Gi(e.target)+")":e.outcome))})}}})(e,t),r=o(n);return n.write(),r}case ca.STOP:return!0}})(e,t,o),ma=y({logEventCut:v,logEventStopped:v,logNoParent:v,logEventNoHandlers:v,logEventResponse:v,write:v}),pa=y([Gn("menu"),Gn("selectedMenu")]),ga=y([Gn("item"),Gn("selectedItem")]);y(kn(ga().concat(pa())));const fa=y(kn(ga())),va=er("initSize",[Gn("numColumns"),Gn("numRows")]),ba=()=>er("markers",[Gn("backgroundMenu")].concat(pa()).concat(ga())),ya=e=>er("markers",L(e,Gn)),wa=(e,t,o)=>((()=>{const e=new Error;if(void 0!==e.stack){const t=e.stack.split("\n");$(t,(e=>e.indexOf("alloy")>0&&!D(ua,(t=>e.indexOf(t)>-1)))).getOr("unknown")}})(),$n(t,t,o,In((e=>Ko.value(((...t)=>e.apply(void 0,t))))))),_a=e=>wa(0,e,hn(v)),xa=e=>wa(0,e,hn(A.none)),Ca=e=>wa(0,e,{tag:"required",process:{}}),ka=e=>wa(0,e,{tag:"required",process:{}}),Sa=(e,t)=>Wn(e,y(t)),Ta=e=>Wn(e,w),Ea=y(va),Oa=(e,t,o,n,r,i,s,a=!1)=>({x:e,y:t,bubble:o,direction:n,placement:r,restriction:i,label:`${s}-${r}`,alwaysFit:a}),Aa=_r([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Ma=Aa.southeast,Ba=Aa.southwest,Pa=Aa.northeast,Ra=Aa.northwest,Va=Aa.south,Na=Aa.north,Da=Aa.east,Fa=Aa.west,Ia=(e,t,o,n)=>{const r=e+t;return r>n?o:r<o?n:r},La=(e,t,o)=>Math.min(Math.max(e,t),o),za=(e,t)=>J(["left","right","top","bottom"],(o=>ve(t,o).map((t=>((e,t)=>{switch(t){case 1:return e.x;case 0:return e.x+e.width;case 2:return e.y;case 3:return e.y+e.height}})(e,t))))),Ha="layout",Za=e=>e.x,ja=(e,t)=>e.x+e.width/2-t.width/2,Ua=(e,t)=>e.x+e.width-t.width,$a=(e,t)=>e.y-t.height,Wa=e=>e.y+e.height,qa=(e,t)=>e.y+e.height/2-t.height/2,Ga=(e,t,o)=>Oa(Za(e),Wa(e),o.southeast(),Ma(),"southeast",za(e,{left:1,top:3}),Ha),Ya=(e,t,o)=>Oa(Ua(e,t),Wa(e),o.southwest(),Ba(),"southwest",za(e,{right:0,top:3}),Ha),Xa=(e,t,o)=>Oa(Za(e),$a(e,t),o.northeast(),Pa(),"northeast",za(e,{left:1,bottom:2}),Ha),Ka=(e,t,o)=>Oa(Ua(e,t),$a(e,t),o.northwest(),Ra(),"northwest",za(e,{right:0,bottom:2}),Ha),Ja=(e,t,o)=>Oa(ja(e,t),$a(e,t),o.north(),Na(),"north",za(e,{bottom:2}),Ha),Qa=(e,t,o)=>Oa(ja(e,t),Wa(e),o.south(),Va(),"south",za(e,{top:3}),Ha),el=(e,t,o)=>Oa((e=>e.x+e.width)(e),qa(e,t),o.east(),Da(),"east",za(e,{left:0}),Ha),tl=(e,t,o)=>Oa(((e,t)=>e.x-t.width)(e,t),qa(e,t),o.west(),Fa(),"west",za(e,{right:1}),Ha),ol=()=>[Ga,Ya,Xa,Ka,Qa,Ja,el,tl],nl=()=>[Ya,Ga,Ka,Xa,Qa,Ja,el,tl],rl=()=>[Xa,Ka,Ga,Ya,Ja,Qa],il=()=>[Ka,Xa,Ya,Ga,Ja,Qa],sl=()=>[Ga,Ya,Xa,Ka,Qa,Ja],al=()=>[Ya,Ga,Ka,Xa,Qa,Ja];var ll=Object.freeze({__proto__:null,events:e=>Mi([Ri(oi(),((t,o)=>{const n=e.channels,r=se(n),i=o,s=((e,t)=>t.universal?e:Z(e,(e=>N(t.channels,e))))(r,i);z(s,(e=>{const o=n[e],r=o.schema,s=Zn("channel["+e+"] data\nReceiver: "+Gi(t.element),r,i.data);o.onReceive(t,s)}))}))])}),cl=[Yn("channels",Ln(Ko.value,Cn([Ca("onReceive"),ur("schema",An())])))];const dl=(e,t,o)=>ji(((n,r)=>{o(n,e,t)})),ul=e=>({key:e,value:void 0}),hl=(e,t,o,n,r,i,s)=>{const a=e=>ye(e,o)?e[o]():A.none(),l=ce(r,((e,t)=>((e,t,o)=>((e,t,o)=>{const n=o.toString(),r=n.indexOf(")")+1,i=n.indexOf("("),s=n.substring(i+1,r-1).split(/,\s*/);return e.toFunctionAnnotation=()=>({name:t,parameters:ds(s.slice(0,1).concat(s.slice(3)))}),e})(((n,...r)=>{const i=[n].concat(r);return n.config({name:y(e)}).fold((()=>{throw new Error("We could not find any behaviour configuration for: "+e+". Using API: "+o)}),(e=>{const o=Array.prototype.slice.call(i,1);return t.apply(void 0,[n,e.config,e.state].concat(o))}))}),o,t))(o,e,t))),c={...ce(i,((e,t)=>us(e,t))),...l,revoke:x(ul,o),config:t=>{const n=Zn(o+"-config",e,t);return{key:o,value:{config:n,me:c,configAsRaw:Gt((()=>Zn(o+"-config",e,t))),initialConfig:t,state:s}}},schema:y(t),exhibit:(e,t)=>xe(a(e),ve(n,"exhibit"),((e,o)=>o(t,e.config,e.state))).getOrThunk((()=>ys({}))),name:y(o),handlers:e=>a(e).map((e=>ve(n,"events").getOr((()=>({})))(e.config,e.state))).getOr({})};return c},ml=e=>Cr(e),pl=Cn([Gn("fields"),Gn("name"),ur("active",{}),ur("apis",{}),ur("state",fs),ur("extra",{})]),gl=e=>{const t=Zn("Creating behaviour: "+e.name,pl,e);return((e,t,o,n,r,i)=>{const s=Cn(e),a=dr(t,[("config",l=e,rr("config",Cn(l)))]);var l;return hl(s,a,t,o,n,r,i)})(t.fields,t.name,t.active,t.apis,t.extra,t.state)},fl=Cn([Gn("branchKey"),Gn("branches"),Gn("name"),ur("active",{}),ur("apis",{}),ur("state",fs),ur("extra",{})]),vl=e=>{const t=Zn("Creating behaviour: "+e.name,fl,e);return((e,t,o,n,r,i)=>{const s=e,a=dr(t,[rr("config",e)]);return hl(s,a,t,o,n,r,i)})(Un(t.branchKey,t.branches),t.name,t.active,t.apis,t.extra,t.state)},bl=y(void 0),yl=gl({fields:cl,name:"receiving",active:ll});var wl=Object.freeze({__proto__:null,exhibit:(e,t)=>ys({classes:[],styles:t.useFixed()?{}:{position:"relative"}})});const _l=e=>e.dom.focus(),xl=e=>{const t=dt(e).dom;return e.dom===t.activeElement},Cl=(e=Ho())=>A.from(e.dom.activeElement).map(Ve),kl=e=>Cl(dt(e)).filter((t=>e.dom.contains(t.dom))),Sl=(e,t)=>{const o=dt(t),n=Cl(o).bind((e=>{const o=t=>Ge(e,t);return o(t)?A.some(t):((e,t)=>{const o=e=>{for(let n=0;n<e.childNodes.length;n++){const r=Ve(e.childNodes[n]);if(t(r))return A.some(r);const i=o(e.childNodes[n]);if(i.isSome())return i}return A.none()};return o(e.dom)})(t,o)})),r=e(t);return n.each((e=>{Cl(o).filter((t=>Ge(t,e))).fold((()=>{_l(e)}),v)})),r},Tl=(e,t,o,n,r)=>{const i=e=>e+"px";return{position:e,left:t.map(i),top:o.map(i),right:n.map(i),bottom:r.map(i)}},El=(e,t)=>{Ot(e,(e=>({...e,position:A.some(e.position)}))(t))},Ol=_r([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),Al=(e,t,o,n,r,i)=>{const s=t.rect,a=s.x-o,l=s.y-n,c=r-(a+s.width),d=i-(l+s.height),u=A.some(a),h=A.some(l),m=A.some(c),p=A.some(d),g=A.none();return t.direction.fold((()=>Tl(e,u,h,g,g)),(()=>Tl(e,g,h,m,g)),(()=>Tl(e,u,g,g,p)),(()=>Tl(e,g,g,m,p)),(()=>Tl(e,u,h,g,g)),(()=>Tl(e,u,g,g,p)),(()=>Tl(e,u,h,g,g)),(()=>Tl(e,g,h,m,g)))},Ml=(e,t)=>e.fold((()=>{const e=t.rect;return Tl("absolute",A.some(e.x),A.some(e.y),A.none(),A.none())}),((e,o,n,r)=>Al("absolute",t,e,o,n,r)),((e,o,n,r)=>Al("fixed",t,e,o,n,r))),Bl=(e,t)=>{const o=x(Uo,t),n=e.fold(o,o,(()=>{const e=Fo();return Uo(t).translate(-e.left,-e.top)})),r=qt(t),i=Lt(t);return $o(n.left,n.top,r,i)},Pl=(e,t)=>t.fold((()=>e.fold(Go,Go,$o)),(t=>e.fold(t,t,(()=>{const o=t(),n=Rl(e,o.x,o.y);return $o(n.left,n.top,o.width,o.height)})))),Rl=(e,t,o)=>{const n=Ht(t,o);return e.fold(y(n),y(n),(()=>{const e=Fo();return n.translate(-e.left,-e.top)}))};Ol.none;const Vl=Ol.relative,Nl=Ol.fixed,Dl="data-alloy-placement",Fl=e=>_t(e,Dl),Il=_r([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),Ll=(e,t,o,n)=>{const r=e.bubble,i=r.offset,s=((e,t,o)=>{const n=(n,r)=>t[n].map((t=>{const i="top"===n||"bottom"===n,s=i?o.top:o.left,a=("left"===n||"top"===n?Math.max:Math.min)(t,r)+s;return i?La(a,e.y,e.bottom):La(a,e.x,e.right)})).getOr(r),r=n("left",e.x),i=n("top",e.y),s=n("right",e.right),a=n("bottom",e.bottom);return $o(r,i,s-r,a-i)})(n,e.restriction,i),a=e.x+i.left,l=e.y+i.top,c=$o(a,l,t,o),{originInBounds:d,sizeInBounds:u,visibleW:h,visibleH:m}=((e,t)=>{const{x:o,y:n,right:r,bottom:i}=t,{x:s,y:a,right:l,bottom:c,width:d,height:u}=e;return{originInBounds:s>=o&&s<=r&&a>=n&&a<=i,sizeInBounds:l<=r&&l>=o&&c<=i&&c>=n,visibleW:Math.min(d,s>=o?r-s:l-o),visibleH:Math.min(u,a>=n?i-a:c-n)}})(c,s),p=d&&u,g=p?c:((e,t)=>{const{x:o,y:n,right:r,bottom:i}=t,{x:s,y:a,width:l,height:c}=e,d=Math.max(o,r-l),u=Math.max(n,i-c),h=La(s,o,d),m=La(a,n,u),p=Math.min(h+l,r)-h,g=Math.min(m+c,i)-m;return $o(h,m,p,g)})(c,s),f=g.width>0&&g.height>0,{maxWidth:v,maxHeight:b}=((e,t,o)=>{const n=y(t.bottom-o.y),r=y(o.bottom-t.y),i=((e,t,o,n)=>e.fold(t,t,n,n,t,n,o,o))(e,r,r,n),s=y(t.right-o.x),a=y(o.right-t.x),l=((e,t,o,n)=>e.fold(t,n,t,n,o,o,t,n))(e,a,a,s);return{maxWidth:l,maxHeight:i}})(e.direction,g,n),w={rect:g,maxHeight:b,maxWidth:v,direction:e.direction,placement:e.placement,classes:{on:r.classesOn,off:r.classesOff},layout:e.label,testY:l};return p||e.alwaysFit?Il.fit(w):Il.nofit(w,h,m,f)},zl=e=>{const t=wr(A.none()),o=()=>t.get().each(e);return{clear:()=>{o(),t.set(A.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{o(),t.set(A.some(e))}}},Hl=()=>zl((e=>e.unbind())),Zl=()=>{const e=zl(v);return{...e,on:t=>e.get().each(t)}},jl=E,Ul=(e,t,o)=>((e,t,o,n)=>Oo(e,t,o,n,!1))(e,t,jl,o),$l=(e,t,o)=>((e,t,o,n)=>Oo(e,t,o,n,!0))(e,t,jl,o),Wl=Eo,ql=["top","bottom","right","left"],Gl="data-alloy-transition-timer",Yl=(e,t,o,n,r,s)=>{const a=((e,t,o)=>o.exists((o=>{const n=e.mode;return"all"===n||o[n]!==t[n]})))(n,r,s);if(a||((e,t)=>((e,t)=>Y(t,(t=>Rs(e,t))))(e,t.classes))(e,n)){Tt(e,"position",o.position);const s=Bl(t,e),l=Ml(t,{...r,rect:s}),c=J(ql,(e=>l[e]));((e,t)=>{const o=e=>parseFloat(e).toFixed(3);return ge(t,((t,n)=>!((e,t,o=_)=>xe(e,t,o).getOr(e.isNone()&&t.isNone()))(e[n].map(o),t.map(o)))).isSome()})(o,c)&&(Ot(e,c),a&&((e,t)=>{Vs(e,t.classes),_t(e,Gl).each((t=>{clearTimeout(parseInt(t,10)),Ct(e,Gl)})),((e,t)=>{const o=Hl(),n=Hl();let r;const s=t=>{var o;const n=null!==(o=t.raw.pseudoElement)&&void 0!==o?o:"";return Ge(t.target,e)&&!Oe(n)&&N(ql,t.raw.propertyName)},a=i=>{if(h(i)||s(i)){o.clear(),n.clear();const s=null==i?void 0:i.raw.type;(h(s)||s===Gr())&&(clearTimeout(r),Ct(e,Gl),Ns(e,t.classes))}},l=Ul(e,Yr(),(t=>{s(t)&&(l.unbind(),o.set(Ul(e,Gr(),a)),n.set(Ul(e,qr(),a)))})),c=(e=>{const t=t=>{const o=At(e,t).split(/\s*,\s*/);return Z(o,Oe)},o=e=>{if(i(e)&&/^[\d.]+/.test(e)){const t=parseFloat(e);return Te(e,"ms")?t:1e3*t}return 0},n=t("transition-delay"),r=t("transition-duration");return U(r,((e,t,r)=>{const i=o(n[r])+o(t);return Math.max(e,i)}),0)})(e);requestAnimationFrame((()=>{r=setTimeout(a,c+17),bt(e,Gl,r)}))})(e,t)})(e,n),Nt(e))}else Ns(e,n.classes)},Xl=(e,t)=>{((e,t)=>{const o=Ft.max(e,t,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);Tt(e,"max-height",o+"px")})(e,Math.floor(t))},Kl=y(((e,t)=>{Xl(e,t),Et(e,{"overflow-x":"hidden","overflow-y":"auto"})})),Jl=y(((e,t)=>{Xl(e,t)})),Ql=(e,t,o)=>void 0===e[t]?o:e[t],ec=(e,t,o,n)=>{const r=((e,t,o,n)=>{Vt(t,"max-height"),Vt(t,"max-width");const r={width:qt(i=t),height:Lt(i)};var i;return((e,t,o,n,r,i)=>{const s=n.width,a=n.height,l=(t,l,c,d,u)=>{const h=t(o,n,r,e,i),m=Ll(h,s,a,i);return m.fold(y(m),((e,t,o,n)=>(u===n?o>d||t>c:!u&&n)?m:Il.nofit(l,c,d,u)))};return U(t,((e,t)=>{const o=x(l,t);return e.fold(y(e),o)}),Il.nofit({rect:o,maxHeight:n.height,maxWidth:n.width,direction:Ma(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:o.y},-1,-1,!1)).fold(w,w)})(t,n.preference,e,r,o,n.bounds)})(e,t,o,n);return((e,t,o)=>{const n=Ml(o.origin,t);o.transition.each((r=>{Yl(e,o.origin,n,r,t,o.lastPlacement)})),El(e,n)})(t,r,n),((e,t)=>{((e,t)=>{bt(e,Dl,t)})(e,t.placement)})(t,r),((e,t)=>{const o=t.classes;Ns(e,o.off),Vs(e,o.on)})(t,r),((e,t,o)=>{(0,o.maxHeightFunction)(e,t.maxHeight)})(t,r,n),((e,t,o)=>{(0,o.maxWidthFunction)(e,t.maxWidth)})(t,r,n),{layout:r.layout,placement:r.placement}},tc=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],oc=(e,t,o,n=1)=>{const r=e*n,i=t*n,s=e=>ve(o,e).getOr([]),a=(e,t,o)=>{const n=K(tc,o);return{offset:Ht(e,t),classesOn:G(o,s),classesOff:G(n,s)}};return{southeast:()=>a(-e,t,["top","alignLeft"]),southwest:()=>a(e,t,["top","alignRight"]),south:()=>a(-e/2,t,["top","alignCentre"]),northeast:()=>a(-e,-t,["bottom","alignLeft"]),northwest:()=>a(e,-t,["bottom","alignRight"]),north:()=>a(-e/2,-t,["bottom","alignCentre"]),east:()=>a(e,-t/2,["valignCentre","left"]),west:()=>a(-e,-t/2,["valignCentre","right"]),insetNortheast:()=>a(r,i,["top","alignLeft","inset"]),insetNorthwest:()=>a(-r,i,["top","alignRight","inset"]),insetNorth:()=>a(-r/2,i,["top","alignCentre","inset"]),insetSoutheast:()=>a(r,-i,["bottom","alignLeft","inset"]),insetSouthwest:()=>a(-r,-i,["bottom","alignRight","inset"]),insetSouth:()=>a(-r/2,-i,["bottom","alignCentre","inset"]),insetEast:()=>a(-r,-i/2,["valignCentre","right","inset"]),insetWest:()=>a(r,-i/2,["valignCentre","left","inset"])}},nc=()=>oc(0,0,{}),rc=w,ic=(e,t)=>o=>"rtl"===sc(o)?t:e,sc=e=>"rtl"===At(e,"direction")?"rtl":"ltr";var ac;!function(e){e.TopToBottom="toptobottom",e.BottomToTop="bottomtotop"}(ac||(ac={}));const lc="data-alloy-vertical-dir",cc=e=>ta(e,(e=>He(e)&&wt(e,"data-alloy-vertical-dir")===ac.BottomToTop)),dc=()=>dr("layouts",[Gn("onLtr"),Gn("onRtl"),nr("onBottomLtr"),nr("onBottomRtl")]),uc=(e,t,o,n,r,i,s)=>{const a=s.map(cc).getOr(!1),l=t.layouts.map((t=>t.onLtr(e))),c=t.layouts.map((t=>t.onRtl(e))),d=a?t.layouts.bind((t=>t.onBottomLtr.map((t=>t(e))))).or(l).getOr(r):l.getOr(o),u=a?t.layouts.bind((t=>t.onBottomRtl.map((t=>t(e))))).or(c).getOr(i):c.getOr(n);return ic(d,u)(e)};var hc=[Gn("hotspot"),nr("bubble"),ur("overrides",{}),dc(),Sa("placement",((e,t,o)=>{const n=t.hotspot,r=Bl(o,n.element),i=uc(e.element,t,sl(),al(),rl(),il(),A.some(t.hotspot.element));return A.some(rc({anchorBox:r,bubble:t.bubble.getOr(nc()),overrides:t.overrides,layouts:i,placer:A.none()}))}))],mc=[Gn("x"),Gn("y"),ur("height",0),ur("width",0),ur("bubble",nc()),ur("overrides",{}),dc(),Sa("placement",((e,t,o)=>{const n=Rl(o,t.x,t.y),r=$o(n.left,n.top,t.width,t.height),i=uc(e.element,t,ol(),nl(),ol(),nl(),A.none());return A.some(rc({anchorBox:r,bubble:t.bubble,overrides:t.overrides,layouts:i,placer:A.none()}))}))];const pc=_r([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),gc=e=>e.fold(w,((e,t,o)=>e.translate(-t,-o))),fc=e=>e.fold(w,w),vc=e=>U(e,((e,t)=>e.translate(t.left,t.top)),Ht(0,0)),bc=e=>{const t=L(e,fc);return vc(t)},yc=pc.screen,wc=pc.absolute,_c=(e,t,o)=>{const n=Xe(e.element),r=Fo(n),i=((e,t,o)=>{const n=Qe(o.root).dom;return A.from(n.frameElement).map(Ve).filter((t=>{const o=Xe(t),n=Xe(e.element);return Ge(o,n)})).map(jt)})(e,0,o).getOr(r);return wc(i,r.left,r.top)},xc=(e,t,o,n)=>{const r=yc(Ht(e,t));return A.some(((e,t,o)=>({point:e,width:t,height:o}))(r,o,n))},Cc=(e,t,o,n,r)=>e.map((e=>{const i=[t,e.point],s=(a=()=>bc(i),l=()=>bc(i),c=()=>(e=>{const t=L(e,gc);return vc(t)})(i),n.fold(a,l,c));var a,l,c;const d=(p=s.left,g=s.top,f=e.width,v=e.height,{x:p,y:g,width:f,height:v}),u=o.showAbove?rl():sl(),h=o.showAbove?il():al(),m=uc(r,o,u,h,u,h,A.none());var p,g,f,v;return rc({anchorBox:d,bubble:o.bubble.getOr(nc()),overrides:o.overrides,layouts:m,placer:A.none()})}));var kc=[Gn("node"),Gn("root"),nr("bubble"),dc(),ur("overrides",{}),ur("showAbove",!1),Sa("placement",((e,t,o)=>{const n=_c(e,0,t);return t.node.filter(pt).bind((r=>{const i=r.dom.getBoundingClientRect(),s=xc(i.left,i.top,i.width,i.height),a=t.node.getOr(e.element);return Cc(s,n,t,o,a)}))}))];const Sc=(e,t,o,n)=>({start:e,soffset:t,finish:o,foffset:n}),Tc=_r([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Ec=(Tc.before,Tc.on,Tc.after,e=>e.fold(w,w,w)),Oc=_r([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Ac={domRange:Oc.domRange,relative:Oc.relative,exact:Oc.exact,exactFromRange:e=>Oc.exact(e.start,e.soffset,e.finish,e.foffset),getWin:e=>{const t=(e=>e.match({domRange:e=>Ve(e.startContainer),relative:(e,t)=>Ec(e),exact:(e,t,o,n)=>e}))(e);return Qe(t)},range:Sc},Mc=(e,t,o)=>{const n=e.document.createRange();var r;return r=n,t.fold((e=>{r.setStartBefore(e.dom)}),((e,t)=>{r.setStart(e.dom,t)}),(e=>{r.setStartAfter(e.dom)})),((e,t)=>{t.fold((t=>{e.setEndBefore(t.dom)}),((t,o)=>{e.setEnd(t.dom,o)}),(t=>{e.setEndAfter(t.dom)}))})(n,o),n},Bc=(e,t,o,n,r)=>{const i=e.document.createRange();return i.setStart(t.dom,o),i.setEnd(n.dom,r),i},Pc=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}),Rc=_r([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Vc=(e,t,o)=>t(Ve(o.startContainer),o.startOffset,Ve(o.endContainer),o.endOffset),Nc=(e,t)=>((e,t)=>{const o=((e,t)=>t.match({domRange:e=>({ltr:y(e),rtl:A.none}),relative:(t,o)=>({ltr:Gt((()=>Mc(e,t,o))),rtl:Gt((()=>A.some(Mc(e,o,t))))}),exact:(t,o,n,r)=>({ltr:Gt((()=>Bc(e,t,o,n,r))),rtl:Gt((()=>A.some(Bc(e,n,r,t,o))))})}))(e,t);return((e,t)=>{const o=t.ltr();return o.collapsed?t.rtl().filter((e=>!1===e.collapsed)).map((e=>Rc.rtl(Ve(e.endContainer),e.endOffset,Ve(e.startContainer),e.startOffset))).getOrThunk((()=>Vc(0,Rc.ltr,o))):Vc(0,Rc.ltr,o)})(0,o)})(e,t).match({ltr:(t,o,n,r)=>{const i=e.document.createRange();return i.setStart(t.dom,o),i.setEnd(n.dom,r),i},rtl:(t,o,n,r)=>{const i=e.document.createRange();return i.setStart(n.dom,r),i.setEnd(t.dom,o),i}});Rc.ltr,Rc.rtl;const Dc=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return qe(o)?[]:L(o.querySelectorAll(e),Ve)})(t,e),Fc=e=>{if(e.rangeCount>0){const t=e.getRangeAt(0),o=e.getRangeAt(e.rangeCount-1);return A.some(Sc(Ve(t.startContainer),t.startOffset,Ve(o.endContainer),o.endOffset))}return A.none()},Ic=e=>{if(null===e.anchorNode||null===e.focusNode)return Fc(e);{const t=Ve(e.anchorNode),o=Ve(e.focusNode);return((e,t,o,n)=>{const r=((e,t,o,n)=>{const r=Xe(e).dom.createRange();return r.setStart(e.dom,t),r.setEnd(o.dom,n),r})(e,t,o,n),i=Ge(e,o)&&t===n;return r.collapsed&&!i})(t,e.anchorOffset,o,e.focusOffset)?A.some(Sc(t,e.anchorOffset,o,e.focusOffset)):Fc(e)}},Lc=(e,t)=>(e=>{const t=e.getClientRects(),o=t.length>0?t[0]:e.getBoundingClientRect();return o.width>0||o.height>0?A.some(o).map(Pc):A.none()})(Nc(e,t)),zc=((e,t)=>{const o=t=>e(t)?A.from(t.dom.nodeValue):A.none();return{get:t=>{if(!e(t))throw new Error("Can only get text value of a text node");return o(t).getOr("")},getOption:o,set:(t,o)=>{if(!e(t))throw new Error("Can only set raw text value of a text node");t.dom.nodeValue=o}}})(Ze),Hc=(e,t)=>({element:e,offset:t}),Zc=(e,t)=>Ze(e)?Hc(e,t):((e,t)=>{const o=nt(e);if(0===o.length)return Hc(e,t);if(t<o.length)return Hc(o[t],0);{const e=o[o.length-1],t=Ze(e)?(e=>zc.get(e))(e).length:nt(e).length;return Hc(e,t)}})(e,t),jc=(e,t)=>t.getSelection.getOrThunk((()=>()=>(e=>(e=>A.from(e.getSelection()))(e).filter((e=>e.rangeCount>0)).bind(Ic))(e)))().map((e=>{const t=Zc(e.start,e.soffset),o=Zc(e.finish,e.foffset);return Ac.range(t.element,t.offset,o.element,o.offset)}));var Uc=[nr("getSelection"),Gn("root"),nr("bubble"),dc(),ur("overrides",{}),ur("showAbove",!1),Sa("placement",((e,t,o)=>{const n=Qe(t.root).dom,r=_c(e,0,t),i=jc(n,t).bind((e=>{const t=((e,t)=>(e=>{const t=e.getBoundingClientRect();return t.width>0||t.height>0?A.some(t).map(Pc):A.none()})(Nc(e,t)))(n,Ac.exactFromRange(e)).orThunk((()=>{const t=Re("\ufeff");Mo(e.start,t);const o=Lc(n,Ac.exact(t,0,t,1));return Do(t),o}));return t.bind((e=>xc(e.left,e.top,e.width,e.height)))})),s=jc(n,t).bind((e=>He(e.start)?A.some(e.start):tt(e.start))).getOr(e.element);return Cc(i,r,t,o,s)}))];const $c="link-layout",Wc=e=>e.x+e.width,qc=(e,t)=>e.x-t.width,Gc=(e,t)=>e.y-t.height+e.height,Yc=e=>e.y,Xc=(e,t,o)=>Oa(Wc(e),Yc(e),o.southeast(),Ma(),"southeast",za(e,{left:0,top:2}),$c),Kc=(e,t,o)=>Oa(qc(e,t),Yc(e),o.southwest(),Ba(),"southwest",za(e,{right:1,top:2}),$c),Jc=(e,t,o)=>Oa(Wc(e),Gc(e,t),o.northeast(),Pa(),"northeast",za(e,{left:0,bottom:3}),$c),Qc=(e,t,o)=>Oa(qc(e,t),Gc(e,t),o.northwest(),Ra(),"northwest",za(e,{right:1,bottom:3}),$c),ed=()=>[Xc,Kc,Jc,Qc],td=()=>[Kc,Xc,Qc,Jc];var od=[Gn("item"),dc(),ur("overrides",{}),Sa("placement",((e,t,o)=>{const n=Bl(o,t.item.element),r=uc(e.element,t,ed(),td(),ed(),td(),A.none());return A.some(rc({anchorBox:n,bubble:nc(),overrides:t.overrides,layouts:r,placer:A.none()}))}))],nd=Un("type",{selection:Uc,node:kc,hotspot:hc,submenu:od,makeshift:mc});const rd=[or("classes",Pn),gr("mode","all",["all","layout","placement"])],id=[ur("useFixed",T),nr("getBounds")],sd=[Yn("anchor",nd),dr("transition",rd)],ad=(e,t,o,n,r,i,s)=>((e,t,o,n,r,i,s,a)=>{const l=Ql(s,"maxHeightFunction",Kl()),c=Ql(s,"maxWidthFunction",v),d=e.anchorBox,u=e.origin,h={bounds:Pl(u,i),origin:u,preference:n,maxHeightFunction:l,maxWidthFunction:c,lastPlacement:r,transition:a};return ec(d,t,o,h)})(((e,t)=>((e,t)=>({anchorBox:e,origin:t}))(e,t))(o.anchorBox,t),r.element,o.bubble,o.layouts,i,n,o.overrides,s),ld=(e,t,o,n,r,i)=>{const s=i.map(Wo);return cd(e,t,o,n,r,s)},cd=(e,t,o,n,r,i)=>{const s=Zn("placement.info",kn(sd),r),a=s.anchor,l=n.element,c=o.get(n.uid);Sl((()=>{Tt(l,"position","fixed");const r=Bt(l,"visibility");Tt(l,"visibility","hidden");const d=t.useFixed()?(()=>{const e=document.documentElement;return Nl(0,0,e.clientWidth,e.clientHeight)})():(e=>{const t=jt(e.element),o=e.element.dom.getBoundingClientRect();return Vl(t.left,t.top,o.width,o.height)})(e),u=a.placement,h=i.map(y).or(t.getBounds);u(e,a,d).each((t=>{const r=t.placer.getOr(ad)(e,d,t,h,n,c,s.transition);o.set(n.uid,r)})),r.fold((()=>{Vt(l,"visibility")}),(e=>{Tt(l,"visibility",e)})),Bt(l,"left").isNone()&&Bt(l,"top").isNone()&&Bt(l,"right").isNone()&&Bt(l,"bottom").isNone()&&we(Bt(l,"position"),"fixed")&&Vt(l,"position")}),l)};var dd=Object.freeze({__proto__:null,position:(e,t,o,n,r)=>{ld(e,t,o,n,r,A.none())},positionWithin:ld,positionWithinBounds:cd,getMode:(e,t,o)=>t.useFixed()?"fixed":"absolute",reset:(e,t,o,n)=>{const r=n.element;z(["position","left","right","top","bottom"],(e=>Vt(r,e))),(e=>{Ct(e,Dl)})(r),o.clear(n.uid)}});const ud=gl({fields:id,name:"positioning",active:wl,apis:dd,state:Object.freeze({__proto__:null,init:()=>{let e={};return vs({readState:()=>e,clear:t=>{m(t)?delete e[t]:e={}},set:(t,o)=>{e[t]=o},get:t=>ve(e,t)})}})}),hd=e=>e.getSystem().isConnected(),md=e=>{ki(e,gi());const t=e.components();z(t,md)},pd=e=>{const t=e.components();z(t,pd),ki(e,pi())},gd=(e,t)=>{e.getSystem().addToWorld(t),pt(e.element)&&pd(t)},fd=e=>{md(e),e.getSystem().removeFromWorld(e)},vd=(e,t)=>{Ro(e.element,t.element)},bd=(e,t)=>{yd(e,t,Ro)},yd=(e,t,o)=>{e.getSystem().addToWorld(t),o(e.element,t.element),pt(e.element)&&pd(t),e.syncComponents()},wd=e=>{md(e),Do(e.element),e.getSystem().removeFromWorld(e)},_d=e=>{const t=et(e.element).bind((t=>e.getSystem().getByDom(t).toOptional()));wd(e),t.each((e=>{e.syncComponents()}))},xd=e=>{const t=e.components();z(t,wd),No(e.element),e.syncComponents()},Cd=(e,t)=>{kd(e,t,Ro)},kd=(e,t,o)=>{o(e,t.element);const n=nt(t.element);z(n,(e=>{t.getByDom(e).each(pd)}))},Sd=e=>{const t=nt(e.element);z(t,(t=>{e.getByDom(t).each(md)})),Do(e.element)},Td=(e,t,o,n)=>{o.get().each((t=>{xd(e)}));const r=t.getAttachPoint(e);bd(r,e);const i=e.getSystem().build(n);return bd(e,i),o.set(i),i},Ed=(e,t,o,n)=>{const r=Td(e,t,o,n);return t.onOpen(e,r),r},Od=(e,t,o)=>{o.get().each((n=>{xd(e),_d(e),t.onClose(e,n),o.clear()}))},Ad=(e,t,o)=>o.isOpen(),Md=(e,t,o)=>{const n=t.getAttachPoint(e);Tt(e.element,"position",ud.getMode(n)),((e,t,o,n)=>{Bt(e.element,t).fold((()=>{Ct(e.element,o)}),(t=>{bt(e.element,o,t)})),Tt(e.element,t,"hidden")})(e,"visibility",t.cloakVisibilityAttr)},Bd=(e,t,o)=>{(e=>D(["top","left","right","bottom"],(t=>Bt(e,t).isSome())))(e.element)||Vt(e.element,"position"),((e,t,o)=>{_t(e.element,o).fold((()=>Vt(e.element,t)),(o=>Tt(e.element,t,o)))})(e,"visibility",t.cloakVisibilityAttr)};var Pd=Object.freeze({__proto__:null,cloak:Md,decloak:Bd,open:Ed,openWhileCloaked:(e,t,o,n,r)=>{Md(e,t),Ed(e,t,o,n),r(),Bd(e,t)},close:Od,isOpen:Ad,isPartOf:(e,t,o,n)=>Ad(0,0,o)&&o.get().exists((o=>t.isPartOf(e,o,n))),getState:(e,t,o)=>o.get(),setContent:(e,t,o,n)=>o.get().map((()=>Td(e,t,o,n)))}),Rd=Object.freeze({__proto__:null,events:(e,t)=>Mi([Ri(ai(),((o,n)=>{Od(o,e,t)}))])}),Vd=[_a("onOpen"),_a("onClose"),Gn("isPartOf"),Gn("getAttachPoint"),ur("cloakVisibilityAttr","data-precloak-visibility")],Nd=Object.freeze({__proto__:null,init:()=>{const e=Zl(),t=y("not-implemented");return vs({readState:t,isOpen:e.isSet,clear:e.clear,set:e.set,get:e.get})}});const Dd=gl({fields:Vd,name:"sandboxing",active:Rd,apis:Pd,state:Nd}),Fd=y("dismiss.popups"),Id=y("reposition.popups"),Ld=y("mouse.released"),zd=Cn([ur("isExtraPart",T),dr("fireEventInstead",[ur("event",fi())])]),Hd=e=>{const t=Zn("Dismissal",zd,e);return{[Fd()]:{schema:Cn([Gn("target")]),onReceive:(e,o)=>{Dd.isOpen(e)&&(Dd.isPartOf(e,o.target)||t.isExtraPart(e,o.target)||t.fireEventInstead.fold((()=>Dd.close(e)),(t=>ki(e,t.event))))}}}},Zd=Cn([dr("fireEventInstead",[ur("event",vi())]),Qn("doReposition")]),jd=e=>{const t=Zn("Reposition",Zd,e);return{[Id()]:{onReceive:e=>{Dd.isOpen(e)&&t.fireEventInstead.fold((()=>t.doReposition(e)),(t=>ki(e,t.event)))}}}},Ud=(e,t,o)=>{t.store.manager.onLoad(e,t,o)},$d=(e,t,o)=>{t.store.manager.onUnload(e,t,o)};var Wd=Object.freeze({__proto__:null,onLoad:Ud,onUnload:$d,setValue:(e,t,o,n)=>{t.store.manager.setValue(e,t,o,n)},getValue:(e,t,o)=>t.store.manager.getValue(e,t,o),getState:(e,t,o)=>o}),qd=Object.freeze({__proto__:null,events:(e,t)=>{const o=e.resetOnDom?[Hi(((o,n)=>{Ud(o,e,t)})),Zi(((o,n)=>{$d(o,e,t)}))]:[dl(e,t,Ud)];return Mi(o)}});const Gd=()=>{const e=wr(null);return vs({set:e.set,get:e.get,isNotSet:()=>null===e.get(),clear:()=>{e.set(null)},readState:()=>({mode:"memory",value:e.get()})})},Yd=()=>{const e=wr({}),t=wr({});return vs({readState:()=>({mode:"dataset",dataByValue:e.get(),dataByText:t.get()}),lookup:o=>ve(e.get(),o).orThunk((()=>ve(t.get(),o))),update:o=>{const n=e.get(),r=t.get(),i={},s={};z(o,(e=>{i[e.value]=e,ve(e,"meta").each((t=>{ve(t,"text").each((t=>{s[t]=e}))}))})),e.set({...n,...i}),t.set({...r,...s})},clear:()=>{e.set({}),t.set({})}})};var Xd=Object.freeze({__proto__:null,memory:Gd,dataset:Yd,manual:()=>vs({readState:v}),init:e=>e.store.manager.state(e)});const Kd=(e,t,o,n)=>{const r=t.store;o.update([n]),r.setValue(e,n),t.onSetValue(e,n)};var Jd=[nr("initialValue"),Gn("getFallbackEntry"),Gn("getDataKey"),Gn("setValue"),Sa("manager",{setValue:Kd,getValue:(e,t,o)=>{const n=t.store,r=n.getDataKey(e);return o.lookup(r).getOrThunk((()=>n.getFallbackEntry(r)))},onLoad:(e,t,o)=>{t.store.initialValue.each((n=>{Kd(e,t,o,n)}))},onUnload:(e,t,o)=>{o.clear()},state:Yd})],Qd=[Gn("getValue"),ur("setValue",v),nr("initialValue"),Sa("manager",{setValue:(e,t,o,n)=>{t.store.setValue(e,n),t.onSetValue(e,n)},getValue:(e,t,o)=>t.store.getValue(e),onLoad:(e,t,o)=>{t.store.initialValue.each((o=>{t.store.setValue(e,o)}))},onUnload:v,state:fs.init})],eu=[nr("initialValue"),Sa("manager",{setValue:(e,t,o,n)=>{o.set(n),t.onSetValue(e,n)},getValue:(e,t,o)=>o.get(),onLoad:(e,t,o)=>{t.store.initialValue.each((e=>{o.isNotSet()&&o.set(e)}))},onUnload:(e,t,o)=>{o.clear()},state:Gd})],tu=[hr("store",{mode:"memory"},Un("mode",{memory:eu,manual:Qd,dataset:Jd})),_a("onSetValue"),ur("resetOnDom",!1)];const ou=gl({fields:tu,name:"representing",active:qd,apis:Wd,extra:{setValueFrom:(e,t)=>{const o=ou.getValue(t);ou.setValue(e,o)}},state:Xd}),nu=(e,t)=>yr(e,{},L(t,(t=>{return o=t.name(),n="Cannot configure "+t.name()+" for "+e,$n(o,o,{tag:"option",process:{}},vn((e=>nn("The field: "+o+" is forbidden. "+n))));var o,n})).concat([Wn("dump",w)])),ru=e=>e.dump,iu=(e,t)=>({...ml(t),...e.dump}),su=nu,au=iu,lu="placeholder",cu=_r([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),du=e=>be(e,"uiType"),uu=(e,t,o,n)=>((e,t,o,n)=>du(o)&&o.uiType===lu?((e,t,o,n)=>e.exists((e=>e!==o.owner))?cu.single(!0,y(o)):ve(n,o.name).fold((()=>{throw new Error("Unknown placeholder component: "+o.name+"\nKnown: ["+se(n)+"]\nNamespace: "+e.getOr("none")+"\nSpec: "+JSON.stringify(o,null,2))}),(e=>e.replace())))(e,0,o,n):cu.single(!1,y(o)))(e,0,o,n).fold(((r,i)=>{const s=du(o)?i(t,o.config,o.validated):i(t),a=ve(s,"components").getOr([]),l=G(a,(o=>uu(e,t,o,n)));return[{...s,components:l}]}),((e,n)=>{if(du(o)){const e=n(t,o.config,o.validated);return o.validated.preprocess.getOr(w)(e)}return n(t)})),hu=cu.single,mu=cu.multiple,pu=y(lu),gu=_r([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),fu=ur("factory",{sketch:w}),vu=ur("schema",[]),bu=Gn("name"),yu=$n("pname","pname",un((e=>"<alloy."+Qi(e.name)+">")),An()),wu=Wn("schema",(()=>[nr("preprocess")])),_u=ur("defaults",y({})),xu=ur("overrides",y({})),Cu=kn([fu,vu,bu,yu,_u,xu]),ku=kn([fu,vu,bu,_u,xu]),Su=kn([fu,vu,bu,yu,_u,xu]),Tu=kn([fu,wu,bu,Gn("unit"),yu,_u,xu]),Eu=e=>e.fold(A.some,A.none,A.some,A.some),Ou=e=>{const t=e=>e.name;return e.fold(t,t,t,t)},Au=(e,t)=>o=>{const n=Zn("Converting part type",t,o);return e(n)},Mu=Au(gu.required,Cu),Bu=Au(gu.external,ku),Pu=Au(gu.optional,Su),Ru=Au(gu.group,Tu),Vu=y("entirety");var Nu=Object.freeze({__proto__:null,required:Mu,external:Bu,optional:Pu,group:Ru,asNamedPart:Eu,name:Ou,asCommon:e=>e.fold(w,w,w,w),original:Vu});const Du=(e,t,o,n)=>cn(t.defaults(e,o,n),o,{uid:e.partUids[t.name]},t.overrides(e,o,n)),Fu=(e,t)=>{const o={};return z(t,(t=>{Eu(t).each((t=>{const n=Iu(e,t.pname);o[t.name]=o=>{const r=Zn("Part: "+t.name+" in "+e,kn(t.schema),o);return{...n,config:o,validated:r}}}))})),o},Iu=(e,t)=>({uiType:pu(),owner:e,name:t}),Lu=(e,t,o)=>({uiType:pu(),owner:e,name:t,config:o,validated:{}}),zu=e=>G(e,(e=>e.fold(A.none,A.some,A.none,A.none).map((e=>er(e.name,e.schema.concat([Ta(Vu())])))).toArray())),Hu=e=>L(e,Ou),Zu=(e,t,o)=>((e,t,o)=>{const n={},r={};return z(o,(e=>{e.fold((e=>{n[e.pname]=hu(!0,((t,o,n)=>e.factory.sketch(Du(t,e,o,n))))}),(e=>{const o=t.parts[e.name];r[e.name]=y(e.factory.sketch(Du(t,e,o[Vu()]),o))}),(e=>{n[e.pname]=hu(!1,((t,o,n)=>e.factory.sketch(Du(t,e,o,n))))}),(e=>{n[e.pname]=mu(!0,((t,o,n)=>{const r=t[e.name];return L(r,(o=>e.factory.sketch(cn(e.defaults(t,o,n),o,e.overrides(t,o)))))}))}))})),{internals:y(n),externals:y(r)}})(0,t,o),ju=(e,t,o)=>((e,t,o,n)=>{const r=ce(n,((e,t)=>((e,t)=>{let o=!1;return{name:y(e),required:()=>t.fold(((e,t)=>e),((e,t)=>e)),used:()=>o,replace:()=>{if(o)throw new Error("Trying to use the same placeholder more than once: "+e);return o=!0,t}}})(t,e))),i=((e,t,o,n)=>G(o,(o=>uu(e,t,o,n))))(e,t,o,r);return le(r,(o=>{if(!1===o.used()&&o.required())throw new Error("Placeholder: "+o.name()+" was not found in components list\nNamespace: "+e.getOr("none")+"\nComponents: "+JSON.stringify(t.components,null,2))})),i})(A.some(e),t,t.components,o),Uu=(e,t,o)=>{const n=t.partUids[o];return e.getSystem().getByUid(n).toOptional()},$u=(e,t,o)=>Uu(e,t,o).getOrDie("Could not find part: "+o),Wu=(e,t,o)=>{const n={},r=t.partUids,i=e.getSystem();return z(o,(e=>{n[e]=y(i.getByUid(r[e]))})),n},qu=(e,t)=>{const o=e.getSystem();return ce(t.partUids,((e,t)=>y(o.getByUid(e))))},Gu=e=>se(e.partUids),Yu=(e,t,o)=>{const n={},r=t.partUids,i=e.getSystem();return z(o,(e=>{n[e]=y(i.getByUid(r[e]).getOrDie())})),n},Xu=(e,t)=>{const o=Hu(t);return Cr(L(o,(t=>({key:t,value:e+"-"+t}))))},Ku=e=>$n("partUids","partUids",mn((t=>Xu(t.uid,e))),An());var Ju=Object.freeze({__proto__:null,generate:Fu,generateOne:Lu,schemas:zu,names:Hu,substitutes:Zu,components:ju,defaultUids:Xu,defaultUidsSchema:Ku,getAllParts:qu,getAllPartNames:Gu,getPart:Uu,getPartOrDie:$u,getParts:Wu,getPartsOrDie:Yu});const Qu=(e,t,o,n,r)=>{const i=((e,t)=>(e.length>0?[er("parts",e)]:[]).concat([Gn("uid"),ur("dom",{}),ur("components",[]),Ta("originalSpec"),ur("debug.sketcher",{})]).concat(t))(n,r);return Zn(e+" [SpecSchema]",Cn(i.concat(t)),o)},eh=(e,t,o,n,r)=>{const i=th(r),s=zu(o),a=Ku(o),l=Qu(e,t,i,s,[a]),c=Zu(0,l,o);return n(l,ju(e,l,c.internals()),i,c.externals())},th=e=>(e=>be(e,"uid"))(e)?e:{...e,uid:ss("uid")},oh=Cn([Gn("name"),Gn("factory"),Gn("configFields"),ur("apis",{}),ur("extraApis",{})]),nh=Cn([Gn("name"),Gn("factory"),Gn("configFields"),Gn("partFields"),ur("apis",{}),ur("extraApis",{})]),rh=e=>{const t=Zn("Sketcher for "+e.name,oh,e),o=ce(t.apis,gs),n=ce(t.extraApis,((e,t)=>us(e,t)));return{name:t.name,configFields:t.configFields,sketch:e=>((e,t,o,n)=>{const r=th(n);return o(Qu(e,t,r,[],[]),r)})(t.name,t.configFields,t.factory,e),...o,...n}},ih=e=>{const t=Zn("Sketcher for "+e.name,nh,e),o=Fu(t.name,t.partFields),n=ce(t.apis,gs),r=ce(t.extraApis,((e,t)=>us(e,t)));return{name:t.name,partFields:t.partFields,configFields:t.configFields,sketch:e=>eh(t.name,t.configFields,t.partFields,t.factory,e),parts:o,...n,...r}},sh=e=>$e("input")(e)&&"radio"!==wt(e,"type")||$e("textarea")(e);var ah=Object.freeze({__proto__:null,getCurrent:(e,t,o)=>t.find(e)});const lh=[Gn("find")],ch=gl({fields:lh,name:"composing",apis:ah}),dh=["input","button","textarea","select"],uh=(e,t,o)=>{(t.disabled()?vh:bh)(e,t)},hh=(e,t)=>!0===t.useNative&&N(dh,Le(e.element)),mh=e=>{bt(e.element,"disabled","disabled")},ph=e=>{Ct(e.element,"disabled")},gh=e=>{bt(e.element,"aria-disabled","true")},fh=e=>{bt(e.element,"aria-disabled","false")},vh=(e,t,o)=>{t.disableClass.each((t=>{Bs(e.element,t)})),(hh(e,t)?mh:gh)(e),t.onDisabled(e)},bh=(e,t,o)=>{t.disableClass.each((t=>{Ps(e.element,t)})),(hh(e,t)?ph:fh)(e),t.onEnabled(e)},yh=(e,t)=>hh(e,t)?(e=>xt(e.element,"disabled"))(e):(e=>"true"===wt(e.element,"aria-disabled"))(e);var wh=Object.freeze({__proto__:null,enable:bh,disable:vh,isDisabled:yh,onLoad:uh,set:(e,t,o,n)=>{(n?vh:bh)(e,t)}}),_h=Object.freeze({__proto__:null,exhibit:(e,t)=>ys({classes:t.disabled()?t.disableClass.toArray():[]}),events:(e,t)=>Mi([Bi(ni(),((t,o)=>yh(t,e))),dl(e,t,uh)])}),xh=[vr("disabled",T),ur("useNative",!0),nr("disableClass"),_a("onDisabled"),_a("onEnabled")];const Ch=gl({fields:xh,name:"disabling",active:_h,apis:wh}),kh=(e,t,o,n)=>{const r=Dc(e.element,"."+t.highlightClass);z(r,(o=>{D(n,(e=>Ge(e.element,o)))||(Ps(o,t.highlightClass),e.getSystem().getByDom(o).each((o=>{t.onDehighlight(e,o),ki(o,Ci())})))}))},Sh=(e,t,o,n)=>{kh(e,t,0,[n]),Th(e,t,o,n)||(Bs(n.element,t.highlightClass),t.onHighlight(e,n),ki(n,xi()))},Th=(e,t,o,n)=>Rs(n.element,t.highlightClass),Eh=(e,t,o)=>ra(e.element,"."+t.itemClass).bind((t=>e.getSystem().getByDom(t).toOptional())),Oh=(e,t,o)=>{const n=Dc(e.element,"."+t.itemClass);return(n.length>0?A.some(n[n.length-1]):A.none()).bind((t=>e.getSystem().getByDom(t).toOptional()))},Ah=(e,t,o,n)=>{const r=Dc(e.element,"."+t.itemClass);return W(r,(e=>Rs(e,t.highlightClass))).bind((t=>{const o=Ia(t,n,0,r.length-1);return e.getSystem().getByDom(r[o]).toOptional()}))},Mh=(e,t,o)=>{const n=Dc(e.element,"."+t.itemClass);return _e(L(n,(t=>e.getSystem().getByDom(t).toOptional())))};var Bh=Object.freeze({__proto__:null,dehighlightAll:(e,t,o)=>kh(e,t,0,[]),dehighlight:(e,t,o,n)=>{Th(e,t,o,n)&&(Ps(n.element,t.highlightClass),t.onDehighlight(e,n),ki(n,Ci()))},highlight:Sh,highlightFirst:(e,t,o)=>{Eh(e,t).each((n=>{Sh(e,t,o,n)}))},highlightLast:(e,t,o)=>{Oh(e,t).each((n=>{Sh(e,t,o,n)}))},highlightAt:(e,t,o,n)=>{((e,t,o,n)=>{const r=Dc(e.element,"."+t.itemClass);return A.from(r[n]).fold((()=>Ko.error(new Error("No element found with index "+n))),e.getSystem().getByDom)})(e,t,0,n).fold((e=>{throw e}),(n=>{Sh(e,t,o,n)}))},highlightBy:(e,t,o,n)=>{const r=Mh(e,t);$(r,n).each((n=>{Sh(e,t,o,n)}))},isHighlighted:Th,getHighlighted:(e,t,o)=>ra(e.element,"."+t.highlightClass).bind((t=>e.getSystem().getByDom(t).toOptional())),getFirst:Eh,getLast:Oh,getPrevious:(e,t,o)=>Ah(e,t,0,-1),getNext:(e,t,o)=>Ah(e,t,0,1),getCandidates:Mh}),Ph=[Gn("highlightClass"),Gn("itemClass"),_a("onHighlight"),_a("onDehighlight")];const Rh=gl({fields:Ph,name:"highlighting",apis:Bh}),Vh=[8],Nh=[9],Dh=[13],Fh=[27],Ih=[32],Lh=[37],zh=[38],Hh=[39],Zh=[40],jh=(e,t,o)=>{const n=X(e.slice(0,t)),r=X(e.slice(t+1));return $(n.concat(r),o)},Uh=(e,t,o)=>{const n=X(e.slice(0,t));return $(n,o)},$h=(e,t,o)=>{const n=e.slice(0,t),r=e.slice(t+1);return $(r.concat(n),o)},Wh=(e,t,o)=>{const n=e.slice(t+1);return $(n,o)},qh=e=>t=>{const o=t.raw;return N(e,o.which)},Gh=e=>t=>Y(e,(e=>e(t))),Yh=e=>!0===e.raw.shiftKey,Xh=e=>!0===e.raw.ctrlKey,Kh=C(Yh),Jh=(e,t)=>({matches:e,classification:t}),Qh=(e,t,o)=>{t.exists((e=>o.exists((t=>Ge(t,e)))))||Si(e,bi(),{prevFocus:t,newFocus:o})},em=()=>{const e=e=>kl(e.element);return{get:e,set:(t,o)=>{const n=e(t);t.getSystem().triggerFocus(o,t.element);const r=e(t);Qh(t,n,r)}}},tm=()=>{const e=e=>Rh.getHighlighted(e).map((e=>e.element));return{get:e,set:(t,o)=>{const n=e(t);t.getSystem().getByDom(o).fold(v,(e=>{Rh.highlight(t,e)}));const r=e(t);Qh(t,n,r)}}};var om;!function(e){e.OnFocusMode="onFocus",e.OnEnterOrSpaceMode="onEnterOrSpace",e.OnApiMode="onApi"}(om||(om={}));const nm=(e,t,o,n,r)=>{const i=(e,t,o,n,r)=>{return(i=o(e,t,n,r),s=t.event,$(i,(e=>e.matches(s))).map((e=>e.classification))).bind((o=>o(e,t,n,r)));var i,s},s={schema:()=>e.concat([ur("focusManager",em()),hr("focusInside","onFocus",In((e=>N(["onFocus","onEnterOrSpace","onApi"],e)?Ko.value(e):Ko.error("Invalid value for focusInside")))),Sa("handler",s),Sa("state",t),Sa("sendFocusIn",r)]),processKey:i,toEvents:(e,t)=>{const s=e.focusInside!==om.OnFocusMode?A.none():r(e).map((o=>Ri(Qr(),((n,r)=>{o(n,e,t),r.stop()})))),a=[Ri(Zr(),((n,s)=>{i(n,s,o,e,t).fold((()=>{((o,n)=>{const i=qh(Ih.concat(Dh))(n.event);e.focusInside===om.OnEnterOrSpaceMode&&i&&Er(o,n)&&r(e).each((r=>{r(o,e,t),n.stop()}))})(n,s)}),(e=>{s.stop()}))})),Ri(jr(),((o,r)=>{i(o,r,n,e,t).each((e=>{r.stop()}))}))];return Mi(s.toArray().concat(a))}};return s},rm=e=>{const t=[nr("onEscape"),nr("onEnter"),ur("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),ur("firstTabstop",0),ur("useTabstopAt",E),nr("visibilitySelector")].concat([e]),o=(e,t)=>{const o=e.visibilitySelector.bind((e=>ia(t,e))).getOr(t);return It(o)>0},n=(e,t,n)=>{((e,t)=>{const n=Dc(e.element,t.selector),r=Z(n,(e=>o(t,e)));return A.from(r[t.firstTabstop])})(e,t).each((o=>{t.focusManager.set(e,o)}))},r=(e,t,n,r)=>{const i=Dc(e.element,n.selector);return((e,t)=>t.focusManager.get(e).bind((e=>ia(e,t.selector))))(e,n).bind((t=>W(i,x(Ge,t)).bind((t=>((e,t,n,r,i)=>i(t,n,(e=>((e,t)=>o(e,t)&&e.useTabstopAt(t))(r,e))).fold((()=>r.cyclic?A.some(!0):A.none()),(t=>(r.focusManager.set(e,t),A.some(!0)))))(e,i,t,n,r)))))},i=y([Jh(Gh([Yh,qh(Nh)]),((e,t,o)=>{const n=o.cyclic?jh:Uh;return r(e,0,o,n)})),Jh(qh(Nh),((e,t,o)=>{const n=o.cyclic?$h:Wh;return r(e,0,o,n)})),Jh(Gh([Kh,qh(Dh)]),((e,t,o)=>o.onEnter.bind((o=>o(e,t)))))]),s=y([Jh(qh(Fh),((e,t,o)=>o.onEscape.bind((o=>o(e,t)))))]);return nm(t,fs.init,i,s,(()=>A.some(n)))};var im=rm(Wn("cyclic",T)),sm=rm(Wn("cyclic",E));const am=(e,t,o)=>sh(o)&&qh(Ih)(t.event)?A.none():((e,t,o)=>(Ei(e,o,ni()),A.some(!0)))(e,0,o),lm=(e,t)=>A.some(!0),cm=[ur("execute",am),ur("useSpace",!1),ur("useEnter",!0),ur("useControlEnter",!1),ur("useDown",!1)],dm=(e,t,o)=>o.execute(e,t,e.element);var um=nm(cm,fs.init,((e,t,o,n)=>{const r=o.useSpace&&!sh(e.element)?Ih:[],i=o.useEnter?Dh:[],s=o.useDown?Zh:[],a=r.concat(i).concat(s);return[Jh(qh(a),dm)].concat(o.useControlEnter?[Jh(Gh([Xh,qh(Dh)]),dm)]:[])}),((e,t,o,n)=>o.useSpace&&!sh(e.element)?[Jh(qh(Ih),lm)]:[]),(()=>A.none()));const hm=()=>{const e=Zl();return vs({readState:()=>e.get().map((e=>({numRows:String(e.numRows),numColumns:String(e.numColumns)}))).getOr({numRows:"?",numColumns:"?"}),setGridSize:(t,o)=>{e.set({numRows:t,numColumns:o})},getNumRows:()=>e.get().map((e=>e.numRows)),getNumColumns:()=>e.get().map((e=>e.numColumns))})};var mm=Object.freeze({__proto__:null,flatgrid:hm,init:e=>e.state(e)});const pm=e=>(t,o,n,r)=>{const i=e(t.element);return bm(i,t,o,n,r)},gm=(e,t)=>{const o=ic(e,t);return pm(o)},fm=(e,t)=>{const o=ic(t,e);return pm(o)},vm=e=>(t,o,n,r)=>bm(e,t,o,n,r),bm=(e,t,o,n,r)=>n.focusManager.get(t).bind((o=>e(t.element,o,n,r))).map((e=>(n.focusManager.set(t,e),!0))),ym=vm,wm=vm,_m=vm,xm=e=>!(e=>e.offsetWidth<=0&&e.offsetHeight<=0)(e.dom),Cm=(e,t,o)=>{const n=Dc(e,o);return((e,o)=>W(e,(e=>Ge(e,t))).map((t=>({index:t,candidates:e}))))(Z(n,xm))},km=(e,t)=>W(e,(e=>Ge(t,e))),Sm=(e,t,o,n)=>n(Math.floor(t/o),t%o).bind((t=>{const n=t.row*o+t.column;return n>=0&&n<e.length?A.some(e[n]):A.none()})),Tm=(e,t,o,n,r)=>Sm(e,t,n,((t,i)=>{const s=t===o-1?e.length-t*n:n,a=Ia(i,r,0,s-1);return A.some({row:t,column:a})})),Em=(e,t,o,n,r)=>Sm(e,t,n,((t,i)=>{const s=Ia(t,r,0,o-1),a=s===o-1?e.length-s*n:n,l=La(i,0,a-1);return A.some({row:s,column:l})})),Om=[Gn("selector"),ur("execute",am),xa("onEscape"),ur("captureTab",!1),Ea()],Am=(e,t,o)=>{ra(e.element,t.selector).each((o=>{t.focusManager.set(e,o)}))},Mm=e=>(t,o,n,r)=>Cm(t,o,n.selector).bind((t=>e(t.candidates,t.index,r.getNumRows().getOr(n.initSize.numRows),r.getNumColumns().getOr(n.initSize.numColumns)))),Bm=(e,t,o)=>o.captureTab?A.some(!0):A.none(),Pm=Mm(((e,t,o,n)=>Tm(e,t,o,n,-1))),Rm=Mm(((e,t,o,n)=>Tm(e,t,o,n,1))),Vm=Mm(((e,t,o,n)=>Em(e,t,o,n,-1))),Nm=Mm(((e,t,o,n)=>Em(e,t,o,n,1))),Dm=y([Jh(qh(Lh),gm(Pm,Rm)),Jh(qh(Hh),fm(Pm,Rm)),Jh(qh(zh),ym(Vm)),Jh(qh(Zh),wm(Nm)),Jh(Gh([Yh,qh(Nh)]),Bm),Jh(Gh([Kh,qh(Nh)]),Bm),Jh(qh(Ih.concat(Dh)),((e,t,o,n)=>((e,t)=>t.focusManager.get(e).bind((e=>ia(e,t.selector))))(e,o).bind((n=>o.execute(e,t,n)))))]),Fm=y([Jh(qh(Fh),((e,t,o)=>o.onEscape(e,t))),Jh(qh(Ih),lm)]);var Im=nm(Om,hm,Dm,Fm,(()=>A.some(Am)));const Lm=(e,t,o,n)=>{const r=(e,t,o)=>{const i=Ia(t,n,0,o.length-1);return i===e?A.none():(s=o[i],"button"===Le(s)&&"disabled"===wt(s,"disabled")?r(e,i,o):A.from(o[i]));var s};return Cm(e,o,t).bind((e=>{const t=e.index,o=e.candidates;return r(t,t,o)}))},zm=[Gn("selector"),ur("getInitial",A.none),ur("execute",am),xa("onEscape"),ur("executeOnMove",!1),ur("allowVertical",!0)],Hm=(e,t,o)=>((e,t)=>t.focusManager.get(e).bind((e=>ia(e,t.selector))))(e,o).bind((n=>o.execute(e,t,n))),Zm=(e,t,o)=>{t.getInitial(e).orThunk((()=>ra(e.element,t.selector))).each((o=>{t.focusManager.set(e,o)}))},jm=(e,t,o)=>Lm(e,o.selector,t,-1),Um=(e,t,o)=>Lm(e,o.selector,t,1),$m=e=>(t,o,n,r)=>e(t,o,n,r).bind((()=>n.executeOnMove?Hm(t,o,n):A.some(!0))),Wm=y([Jh(qh(Ih),lm),Jh(qh(Fh),((e,t,o)=>o.onEscape(e,t)))]);var qm=nm(zm,fs.init,((e,t,o,n)=>{const r=Lh.concat(o.allowVertical?zh:[]),i=Hh.concat(o.allowVertical?Zh:[]);return[Jh(qh(r),$m(gm(jm,Um))),Jh(qh(i),$m(fm(jm,Um))),Jh(qh(Dh),Hm),Jh(qh(Ih),Hm)]}),Wm,(()=>A.some(Zm)));const Gm=(e,t,o)=>A.from(e[t]).bind((e=>A.from(e[o]).map((e=>({rowIndex:t,columnIndex:o,cell:e}))))),Ym=(e,t,o,n)=>{const r=e[t].length,i=Ia(o,n,0,r-1);return Gm(e,t,i)},Xm=(e,t,o,n)=>{const r=Ia(o,n,0,e.length-1),i=e[r].length,s=La(t,0,i-1);return Gm(e,r,s)},Km=(e,t,o,n)=>{const r=e[t].length,i=La(o+n,0,r-1);return Gm(e,t,i)},Jm=(e,t,o,n)=>{const r=La(o+n,0,e.length-1),i=e[r].length,s=La(t,0,i-1);return Gm(e,r,s)},Qm=[er("selectors",[Gn("row"),Gn("cell")]),ur("cycles",!0),ur("previousSelector",A.none),ur("execute",am)],ep=(e,t,o)=>{t.previousSelector(e).orThunk((()=>{const o=t.selectors;return ra(e.element,o.cell)})).each((o=>{t.focusManager.set(e,o)}))},tp=(e,t)=>(o,n,r)=>{const i=r.cycles?e:t;return ia(n,r.selectors.row).bind((e=>{const t=Dc(e,r.selectors.cell);return km(t,n).bind((t=>{const n=Dc(o,r.selectors.row);return km(n,e).bind((e=>{const o=((e,t)=>L(e,(e=>Dc(e,t.selectors.cell))))(n,r);return i(o,e,t).map((e=>e.cell))}))}))}))},op=tp(((e,t,o)=>Ym(e,t,o,-1)),((e,t,o)=>Km(e,t,o,-1))),np=tp(((e,t,o)=>Ym(e,t,o,1)),((e,t,o)=>Km(e,t,o,1))),rp=tp(((e,t,o)=>Xm(e,o,t,-1)),((e,t,o)=>Jm(e,o,t,-1))),ip=tp(((e,t,o)=>Xm(e,o,t,1)),((e,t,o)=>Jm(e,o,t,1))),sp=y([Jh(qh(Lh),gm(op,np)),Jh(qh(Hh),fm(op,np)),Jh(qh(zh),ym(rp)),Jh(qh(Zh),wm(ip)),Jh(qh(Ih.concat(Dh)),((e,t,o)=>kl(e.element).bind((n=>o.execute(e,t,n)))))]),ap=y([Jh(qh(Ih),lm)]);var lp=nm(Qm,fs.init,sp,ap,(()=>A.some(ep)));const cp=[Gn("selector"),ur("execute",am),ur("moveOnTab",!1)],dp=(e,t,o)=>o.focusManager.get(e).bind((n=>o.execute(e,t,n))),up=(e,t,o)=>{ra(e.element,t.selector).each((o=>{t.focusManager.set(e,o)}))},hp=(e,t,o)=>Lm(e,o.selector,t,-1),mp=(e,t,o)=>Lm(e,o.selector,t,1),pp=y([Jh(qh(zh),_m(hp)),Jh(qh(Zh),_m(mp)),Jh(Gh([Yh,qh(Nh)]),((e,t,o,n)=>o.moveOnTab?_m(hp)(e,t,o,n):A.none())),Jh(Gh([Kh,qh(Nh)]),((e,t,o,n)=>o.moveOnTab?_m(mp)(e,t,o,n):A.none())),Jh(qh(Dh),dp),Jh(qh(Ih),dp)]),gp=y([Jh(qh(Ih),lm)]);var fp=nm(cp,fs.init,pp,gp,(()=>A.some(up)));const vp=[xa("onSpace"),xa("onEnter"),xa("onShiftEnter"),xa("onLeft"),xa("onRight"),xa("onTab"),xa("onShiftTab"),xa("onUp"),xa("onDown"),xa("onEscape"),ur("stopSpaceKeyup",!1),nr("focusIn")];var bp=nm(vp,fs.init,((e,t,o)=>[Jh(qh(Ih),o.onSpace),Jh(Gh([Kh,qh(Dh)]),o.onEnter),Jh(Gh([Yh,qh(Dh)]),o.onShiftEnter),Jh(Gh([Yh,qh(Nh)]),o.onShiftTab),Jh(Gh([Kh,qh(Nh)]),o.onTab),Jh(qh(zh),o.onUp),Jh(qh(Zh),o.onDown),Jh(qh(Lh),o.onLeft),Jh(qh(Hh),o.onRight),Jh(qh(Ih),o.onSpace)]),((e,t,o)=>[...o.stopSpaceKeyup?[Jh(qh(Ih),lm)]:[],Jh(qh(Fh),o.onEscape)]),(e=>e.focusIn));const yp=im.schema(),wp=sm.schema(),_p=qm.schema(),xp=Im.schema(),Cp=lp.schema(),kp=um.schema(),Sp=fp.schema(),Tp=bp.schema(),Ep=vl({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:yp,cyclic:wp,flow:_p,flatgrid:xp,matrix:Cp,execution:kp,menu:Sp,special:Tp}),name:"keying",active:{events:(e,t)=>e.handler.toEvents(e,t)},apis:{focusIn:(e,t,o)=>{t.sendFocusIn(t).fold((()=>{e.getSystem().triggerFocus(e.element,e.element)}),(n=>{n(e,t,o)}))},setGridSize:(e,t,o,n,r)=>{(e=>ye(e,"setGridSize"))(o)?o.setGridSize(n,r):console.error("Layout does not support setGridSize")}},state:mm}),Op=(e,t)=>{Sl((()=>{((e,t,o)=>{const n=e.components();(e=>{z(e.components(),(e=>Do(e.element))),No(e.element),e.syncComponents()})(e);const r=o(t),i=K(n,r);z(i,(t=>{md(t),e.getSystem().removeFromWorld(t)})),z(r,(t=>{hd(t)?vd(e,t):(e.getSystem().addToWorld(t),vd(e,t),pt(e.element)&&pd(t))})),e.syncComponents()})(e,t,(()=>L(t,e.getSystem().build)))}),e.element)},Ap=(e,t)=>{Sl((()=>{((o,n,r)=>{const i=o.components(),s=G(n,(e=>ps(e).toArray()));z(i,(e=>{N(s,e)||fd(e)}));const a=((e,t,o)=>Ls(e,t,((t,n)=>zs(e,n,t,o))))(e.element,t,e.getSystem().buildOrPatch),l=K(i,a);z(l,(e=>{hd(e)&&fd(e)})),z(a,(e=>{hd(e)||gd(o,e)})),o.syncComponents()})(e,t)}),e.element)},Mp=(e,t,o,n)=>{fd(t);const r=zs(e.element,o,n,e.getSystem().buildOrPatch);gd(e,r),e.syncComponents()},Bp=(e,t,o)=>{const n=e.getSystem().build(o);yd(e,n,t)},Pp=(e,t,o,n)=>{_d(t),Bp(e,((e,t)=>((e,t,o)=>{rt(e,o).fold((()=>{Ro(e,t)}),(e=>{Mo(e,t)}))})(e,t,o)),n)},Rp=(e,t)=>e.components(),Vp=(e,t,o,n,r)=>{const i=Rp(e);return A.from(i[n]).map((o=>(r.fold((()=>_d(o)),(r=>{(t.reuseDom?Mp:Pp)(e,o,n,r)})),o)))};var Np=Object.freeze({__proto__:null,append:(e,t,o,n)=>{Bp(e,Ro,n)},prepend:(e,t,o,n)=>{Bp(e,Po,n)},remove:(e,t,o,n)=>{const r=Rp(e),i=$(r,(e=>Ge(n.element,e.element)));i.each(_d)},replaceAt:Vp,replaceBy:(e,t,o,n,r)=>{const i=Rp(e);return W(i,n).bind((o=>Vp(e,t,0,o,r)))},set:(e,t,o,n)=>(t.reuseDom?Ap:Op)(e,n),contents:Rp});const Dp=gl({fields:[fr("reuseDom",!0)],name:"replacing",apis:Np}),Fp=(e,t)=>{const o=((e,t)=>{const o=Mi(t);return gl({fields:[Gn("enabled")],name:e,active:{events:y(o)}})})(e,t);return{key:e,value:{config:{},me:o,configAsRaw:y({}),initialConfig:{},state:fs}}},Ip=(e,t)=>{t.ignore||(_l(e.element),t.onFocus(e))};var Lp=Object.freeze({__proto__:null,focus:Ip,blur:(e,t)=>{t.ignore||(e=>{e.dom.blur()})(e.element)},isFocused:e=>xl(e.element)}),zp=Object.freeze({__proto__:null,exhibit:(e,t)=>{const o=t.ignore?{}:{attributes:{tabindex:"-1"}};return ys(o)},events:e=>Mi([Ri(Qr(),((t,o)=>{Ip(t,e),o.stop()}))].concat(e.stopMousedown?[Ri(Nr(),((e,t)=>{t.event.prevent()}))]:[]))}),Hp=[_a("onFocus"),ur("stopMousedown",!1),ur("ignore",!1)];const Zp=gl({fields:Hp,name:"focusing",active:zp,apis:Lp}),jp=(e,t,o,n)=>{const r=o.get();o.set(n),((e,t,o)=>{t.toggleClass.each((t=>{o.get()?Bs(e.element,t):Ps(e.element,t)}))})(e,t,o),((e,t,o)=>{const n=t.aria;n.update(e,n,o.get())})(e,t,o),r!==n&&t.onToggled(e,n)},Up=(e,t,o)=>{jp(e,t,o,!o.get())},$p=(e,t,o)=>{jp(e,t,o,t.selected)};var Wp=Object.freeze({__proto__:null,onLoad:$p,toggle:Up,isOn:(e,t,o)=>o.get(),on:(e,t,o)=>{jp(e,t,o,!0)},off:(e,t,o)=>{jp(e,t,o,!1)},set:jp}),qp=Object.freeze({__proto__:null,exhibit:()=>ys({}),events:(e,t)=>{const o=(n=e,r=t,i=Up,Ui((e=>{i(e,n,r)})));var n,r,i;const s=dl(e,t,$p);return Mi(q([e.toggleOnExecute?[o]:[],[s]]))}});const Gp=(e,t,o)=>{bt(e.element,"aria-expanded",o)};var Yp=[ur("selected",!1),nr("toggleClass"),ur("toggleOnExecute",!0),_a("onToggled"),hr("aria",{mode:"none"},Un("mode",{pressed:[ur("syncWithExpanded",!1),Sa("update",((e,t,o)=>{bt(e.element,"aria-pressed",o),t.syncWithExpanded&&Gp(e,0,o)}))],checked:[Sa("update",((e,t,o)=>{bt(e.element,"aria-checked",o)}))],expanded:[Sa("update",Gp)],selected:[Sa("update",((e,t,o)=>{bt(e.element,"aria-selected",o)}))],none:[Sa("update",v)]}))];const Xp=gl({fields:Yp,name:"toggling",active:qp,apis:Wp,state:(!1,{init:()=>{const e=wr(false);return{get:()=>e.get(),set:t=>e.set(t),clear:()=>e.set(false),readState:()=>e.get()}}})});const Kp=()=>{const e=(e,t)=>{t.stop(),Ti(e)};return[Ri(Wr(),e),Ri(ii(),e),Ii(Br()),Ii(Nr())]},Jp=e=>Mi(q([e.map((e=>Ui(((t,o)=>{e(t),o.stop()})))).toArray(),Kp()])),Qp="alloy.item-hover",eg="alloy.item-focus",tg="alloy.item-toggled",og=e=>{(kl(e.element).isNone()||Zp.isFocused(e))&&(Zp.isFocused(e)||Zp.focus(e),Si(e,Qp,{item:e}))},ng=e=>{Si(e,eg,{item:e})},rg=y(Qp),ig=y(eg),sg=y(tg),ag=e=>e.toggling.map((e=>e.exclusive?"menuitemradio":"menuitemcheckbox")).getOr("menuitem"),lg=[Gn("data"),Gn("components"),Gn("dom"),ur("hasSubmenu",!1),nr("toggling"),su("itemBehaviours",[Xp,Zp,Ep,ou]),ur("ignoreFocus",!1),ur("domModification",{}),Sa("builder",(e=>({dom:e.dom,domModification:{...e.domModification,attributes:{role:ag(e),...e.domModification.attributes,"aria-haspopup":e.hasSubmenu,...e.hasSubmenu?{"aria-expanded":!1}:{}}},behaviours:au(e.itemBehaviours,[e.toggling.fold(Xp.revoke,(e=>Xp.config((e=>({aria:{mode:"checked"},...me(e,((e,t)=>"exclusive"!==t)),onToggled:(t,o)=>{p(e.onToggled)&&e.onToggled(t,o),((e,t)=>{Si(e,tg,{item:e,state:t})})(t,o)}}))(e)))),Zp.config({ignore:e.ignoreFocus,stopMousedown:e.ignoreFocus,onFocus:e=>{ng(e)}}),Ep.config({mode:"execution"}),ou.config({store:{mode:"memory",initialValue:e.data}}),Fp("item-type-events",[...Kp(),Ri(Lr(),og),Ri(ri(),Zp.focus)])]),components:e.components,eventOrder:e.eventOrder}))),ur("eventOrder",{})],cg=[Gn("dom"),Gn("components"),Sa("builder",(e=>({dom:e.dom,components:e.components,events:Mi([Li(ri())])})))],dg=y("item-widget"),ug=y([Mu({name:"widget",overrides:e=>({behaviours:ml([ou.config({store:{mode:"manual",getValue:t=>e.data,setValue:v}})])})})]),hg=[Gn("uid"),Gn("data"),Gn("components"),Gn("dom"),ur("autofocus",!1),ur("ignoreFocus",!1),su("widgetBehaviours",[ou,Zp,Ep]),ur("domModification",{}),Ku(ug()),Sa("builder",(e=>{const t=Zu(dg(),e,ug()),o=ju(dg(),e,t.internals()),n=t=>Uu(t,e,"widget").map((e=>(Ep.focusIn(e),e))),r=(t,o)=>sh(o.event.target)?A.none():e.autofocus?(o.setSource(t.element),A.none()):A.none();return{dom:e.dom,components:o,domModification:e.domModification,events:Mi([Ui(((e,t)=>{n(e).each((e=>{t.stop()}))})),Ri(Lr(),og),Ri(ri(),((t,o)=>{e.autofocus?n(t):Zp.focus(t)}))]),behaviours:au(e.widgetBehaviours,[ou.config({store:{mode:"memory",initialValue:e.data}}),Zp.config({ignore:e.ignoreFocus,onFocus:e=>{ng(e)}}),Ep.config({mode:"special",focusIn:e.autofocus?e=>{n(e)}:bl(),onLeft:r,onRight:r,onEscape:(t,o)=>Zp.isFocused(t)||e.autofocus?e.autofocus?(o.setSource(t.element),A.none()):A.none():(Zp.focus(t),A.some(!0))})])}}))],mg=Un("type",{widget:hg,item:lg,separator:cg}),pg=y([Ru({factory:{sketch:e=>{const t=Zn("menu.spec item",mg,e);return t.builder(t)}},name:"items",unit:"item",defaults:(e,t)=>be(t,"uid")?t:{...t,uid:ss("item")},overrides:(e,t)=>({type:t.type,ignoreFocus:e.fakeFocus,domModification:{classes:[e.markers.item]}})})]),gg=y([Gn("value"),Gn("items"),Gn("dom"),Gn("components"),ur("eventOrder",{}),nu("menuBehaviours",[Rh,ou,ch,Ep]),hr("movement",{mode:"menu",moveOnTab:!0},Un("mode",{grid:[Ea(),Sa("config",((e,t)=>({mode:"flatgrid",selector:"."+e.markers.item,initSize:{numColumns:t.initSize.numColumns,numRows:t.initSize.numRows},focusManager:e.focusManager})))],matrix:[Sa("config",((e,t)=>({mode:"matrix",selectors:{row:t.rowSelector,cell:"."+e.markers.item},previousSelector:t.previousSelector,focusManager:e.focusManager}))),Gn("rowSelector"),ur("previousSelector",A.none)],menu:[ur("moveOnTab",!0),Sa("config",((e,t)=>({mode:"menu",selector:"."+e.markers.item,moveOnTab:t.moveOnTab,focusManager:e.focusManager})))]})),Yn("markers",fa()),ur("fakeFocus",!1),ur("focusManager",em()),_a("onHighlight"),_a("onDehighlight")]),fg=y("alloy.menu-focus"),vg=ih({name:"Menu",configFields:gg(),partFields:pg(),factory:(e,t,o,n)=>({uid:e.uid,dom:e.dom,markers:e.markers,behaviours:iu(e.menuBehaviours,[Rh.config({highlightClass:e.markers.selectedItem,itemClass:e.markers.item,onHighlight:e.onHighlight,onDehighlight:e.onDehighlight}),ou.config({store:{mode:"memory",initialValue:e.value}}),ch.config({find:A.some}),Ep.config(e.movement.config(e,e.movement))]),events:Mi([Ri(ig(),((e,t)=>{const o=t.event;e.getSystem().getByDom(o.target).each((o=>{Rh.highlight(e,o),t.stop(),Si(e,fg(),{menu:e,item:o})}))})),Ri(rg(),((e,t)=>{const o=t.event.item;Rh.highlight(e,o)})),Ri(sg(),((e,t)=>{const{item:o,state:n}=t.event;n&&"menuitemradio"===wt(o.element,"role")&&((e,t)=>{const o=Dc(e.element,'[role="menuitemradio"][aria-checked="true"]');z(o,(o=>{Ge(o,t.element)||e.getSystem().getByDom(o).each((e=>{Xp.off(e)}))}))})(e,o)}))]),components:t,eventOrder:e.eventOrder,domModification:{attributes:{role:"menu"}}})}),bg=(e,t,o,n)=>ve(o,n).bind((n=>ve(e,n).bind((n=>{const r=bg(e,t,o,n);return A.some([n].concat(r))})))).getOr([]),yg=e=>"prepared"===e.type?A.some(e.menu):A.none(),wg=()=>{const e=wr({}),t=wr({}),o=wr({}),n=Zl(),r=wr({}),i=e=>s(e).bind(yg),s=e=>ve(t.get(),e),a=t=>ve(e.get(),t);return{setMenuBuilt:(e,o)=>{t.set({...t.get(),[e]:{type:"prepared",menu:o}})},setContents:(i,s,a,l)=>{n.set(i),e.set(a),t.set(s),r.set(l);const c=((e,t)=>{const o={};le(e,((e,t)=>{z(e,(e=>{o[e]=t}))}));const n=t,r=de(t,((e,t)=>({k:e,v:t}))),i=ce(r,((e,t)=>[t].concat(bg(o,n,r,t))));return ce(o,(e=>ve(i,e).getOr([e])))})(l,a);o.set(c)},expand:t=>ve(e.get(),t).map((e=>{const n=ve(o.get(),t).getOr([]);return[e].concat(n)})),refresh:e=>ve(o.get(),e),collapse:e=>ve(o.get(),e).bind((e=>e.length>1?A.some(e.slice(1)):A.none())),lookupMenu:s,lookupItem:a,otherMenus:e=>{const t=r.get();return K(se(t),e)},getPrimary:()=>n.get().bind(i),getMenus:()=>t.get(),clear:()=>{e.set({}),t.set({}),o.set({}),n.clear()},isClear:()=>n.get().isNone(),getTriggeringPath:(t,r)=>{const s=Z(a(t).toArray(),(e=>i(e).isSome()));return ve(o.get(),t).bind((t=>{const o=X(s.concat(t));return(e=>{const t=[];for(let o=0;o<e.length;o++){const n=e[o];if(!n.isSome())return A.none();t.push(n.getOrDie())}return A.some(t)})(G(o,((t,s)=>((t,o,n)=>i(t).bind((r=>(t=>ge(e.get(),((e,o)=>e===t)))(t).bind((e=>o(e).map((e=>({triggeredMenu:r,triggeringItem:e,triggeringPath:n}))))))))(t,r,o.slice(0,s+1)).fold((()=>we(n.get(),t)?[]:[A.none()]),(e=>[A.some(e)])))))}))}}},_g=yg,xg=Qi("tiered-menu-item-highlight"),Cg=Qi("tiered-menu-item-dehighlight");var kg;!function(e){e[e.HighlightMenuAndItem=0]="HighlightMenuAndItem",e[e.HighlightJustMenu=1]="HighlightJustMenu",e[e.HighlightNone=2]="HighlightNone"}(kg||(kg={}));const Sg=y("collapse-item"),Tg=rh({name:"TieredMenu",configFields:[ka("onExecute"),ka("onEscape"),Ca("onOpenMenu"),Ca("onOpenSubmenu"),_a("onRepositionMenu"),_a("onCollapseMenu"),ur("highlightOnOpen",kg.HighlightMenuAndItem),er("data",[Gn("primary"),Gn("menus"),Gn("expansions")]),ur("fakeFocus",!1),_a("onHighlightItem"),_a("onDehighlightItem"),_a("onHover"),ba(),Gn("dom"),ur("navigateOnHover",!0),ur("stayInDom",!1),nu("tmenuBehaviours",[Ep,Rh,ch,Dp]),ur("eventOrder",{})],apis:{collapseMenu:(e,t)=>{e.collapseMenu(t)},highlightPrimary:(e,t)=>{e.highlightPrimary(t)},repositionMenus:(e,t)=>{e.repositionMenus(t)}},factory:(e,t)=>{const o=Zl(),n=wg(),r=e=>ou.getValue(e).value,i=t=>ce(e.data.menus,((e,t)=>G(e.items,(e=>"separator"===e.type?[]:[e.data.value])))),s=Rh.highlight,a=(t,o)=>{s(t,o),Rh.getHighlighted(o).orThunk((()=>Rh.getFirst(o))).each((n=>{e.fakeFocus?Rh.highlight(o,n):Ei(t,n.element,ri())}))},l=(e,t)=>_e(L(t,(t=>e.lookupMenu(t).bind((e=>"prepared"===e.type?A.some(e.menu):A.none()))))),c=(t,o,n)=>{const r=l(o,o.otherMenus(n));z(r,(o=>{Ns(o.element,[e.markers.backgroundMenu]),e.stayInDom||Dp.remove(t,o)}))},d=(t,n)=>{const i=(t=>o.get().getOrThunk((()=>{const n={},i=Dc(t.element,`.${e.markers.item}`),s=Z(i,(e=>"true"===wt(e,"aria-haspopup")));return z(s,(e=>{t.getSystem().getByDom(e).each((e=>{const t=r(e);n[t]=e}))})),o.set(n),n})))(t);le(i,((e,t)=>{const o=N(n,t);bt(e.element,"aria-expanded",o)}))},u=(t,o,n)=>A.from(n[0]).bind((r=>o.lookupMenu(r).bind((r=>{if("notbuilt"===r.type)return A.none();{const i=r.menu,s=l(o,n.slice(1));return z(s,(t=>{Bs(t.element,e.markers.backgroundMenu)})),pt(i.element)||Dp.append(t,Xs(i)),Ns(i.element,[e.markers.backgroundMenu]),a(t,i),c(t,o,n),A.some(i)}}))));let h;!function(e){e[e.HighlightSubmenu=0]="HighlightSubmenu",e[e.HighlightParent=1]="HighlightParent"}(h||(h={}));const m=(t,o,i=h.HighlightSubmenu)=>{if(o.hasConfigured(Ch)&&Ch.isDisabled(o))return A.some(o);{const s=r(o);return n.expand(s).bind((r=>(d(t,r),A.from(r[0]).bind((s=>n.lookupMenu(s).bind((a=>{const l=((e,t,o)=>{if("notbuilt"===o.type){const r=e.getSystem().build(o.nbMenu());return n.setMenuBuilt(t,r),r}return o.menu})(t,s,a);return pt(l.element)||Dp.append(t,Xs(l)),e.onOpenSubmenu(t,o,l,X(r)),i===h.HighlightSubmenu?(Rh.highlightFirst(l),u(t,n,r)):(Rh.dehighlightAll(l),A.some(o))})))))))}},p=(t,o)=>{const i=r(o);return n.collapse(i).bind((r=>(d(t,r),u(t,n,r).map((n=>(e.onCollapseMenu(t,o,n),n))))))},g=t=>(o,n)=>ia(n.getSource(),`.${e.markers.item}`).bind((e=>o.getSystem().getByDom(e).toOptional().bind((e=>t(o,e).map(E))))),f=Mi([Ri(fg(),((e,t)=>{const o=t.event.item;n.lookupItem(r(o)).each((()=>{const o=t.event.menu;Rh.highlight(e,o);const i=r(t.event.item);n.refresh(i).each((t=>c(e,n,t)))}))})),Ui(((t,o)=>{const n=o.event.target;t.getSystem().getByDom(n).each((o=>{0===r(o).indexOf("collapse-item")&&p(t,o),m(t,o,h.HighlightSubmenu).fold((()=>{e.onExecute(t,o)}),v)}))})),Hi(((t,o)=>{(t=>{const o=((t,o,n)=>ce(n,((n,r)=>{const i=()=>vg.sketch({...n,value:r,markers:e.markers,fakeFocus:e.fakeFocus,onHighlight:(e,t)=>{Si(e,xg,{menuComp:e,itemComp:t})},onDehighlight:(e,t)=>{Si(e,Cg,{menuComp:e,itemComp:t})},focusManager:e.fakeFocus?tm():em()});return r===o?{type:"prepared",menu:t.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}})))(t,e.data.primary,e.data.menus),r=i();return n.setContents(e.data.primary,o,e.data.expansions,r),n.getPrimary()})(t).each((o=>{Dp.append(t,Xs(o)),e.onOpenMenu(t,o),e.highlightOnOpen===kg.HighlightMenuAndItem?a(t,o):e.highlightOnOpen===kg.HighlightJustMenu&&s(t,o)}))})),Ri(xg,((t,o)=>{e.onHighlightItem(t,o.event.menuComp,o.event.itemComp)})),Ri(Cg,((t,o)=>{e.onDehighlightItem(t,o.event.menuComp,o.event.itemComp)})),...e.navigateOnHover?[Ri(rg(),((t,o)=>{const i=o.event.item;((e,t)=>{const o=r(t);n.refresh(o).bind((t=>(d(e,t),u(e,n,t))))})(t,i),m(t,i,h.HighlightParent),e.onHover(t,i)}))]:[]]),b=e=>Rh.getHighlighted(e).bind(Rh.getHighlighted),y={collapseMenu:e=>{b(e).each((t=>{p(e,t)}))},highlightPrimary:e=>{n.getPrimary().each((t=>{a(e,t)}))},repositionMenus:t=>{const o=n.getPrimary().bind((e=>b(t).bind((e=>{const t=r(e),o=fe(n.getMenus()),i=_e(L(o,_g));return n.getTriggeringPath(t,(e=>((e,t,o)=>ie(t,(e=>{if(!e.getSystem().isConnected())return A.none();const t=Rh.getCandidates(e);return $(t,(e=>r(e)===o))})))(0,i,e)))})).map((t=>({primary:e,triggeringPath:t})))));o.fold((()=>{(e=>A.from(e.components()[0]).filter((e=>"menu"===wt(e.element,"role"))))(t).each((o=>{e.onRepositionMenu(t,o,[])}))}),(({primary:o,triggeringPath:n})=>{e.onRepositionMenu(t,o,n)}))}};return{uid:e.uid,dom:e.dom,markers:e.markers,behaviours:iu(e.tmenuBehaviours,[Ep.config({mode:"special",onRight:g(((e,t)=>sh(t.element)?A.none():m(e,t,h.HighlightSubmenu))),onLeft:g(((e,t)=>sh(t.element)?A.none():p(e,t))),onEscape:g(((t,o)=>p(t,o).orThunk((()=>e.onEscape(t,o).map((()=>t)))))),focusIn:(e,t)=>{n.getPrimary().each((t=>{Ei(e,t.element,ri())}))}}),Rh.config({highlightClass:e.markers.selectedMenu,itemClass:e.markers.menu}),ch.config({find:e=>Rh.getHighlighted(e)}),Dp.config({})]),eventOrder:e.eventOrder,apis:y,events:f}},extraApis:{tieredData:(e,t,o)=>({primary:e,menus:t,expansions:o}),singleData:(e,t)=>({primary:e,menus:xr(e,t),expansions:{}}),collapseItem:e=>({value:Qi(Sg()),meta:{text:e}})}}),Eg=rh({name:"InlineView",configFields:[Gn("lazySink"),_a("onShow"),_a("onHide"),lr("onEscape"),nu("inlineBehaviours",[Dd,ou,yl]),dr("fireDismissalEventInstead",[ur("event",fi())]),dr("fireRepositionEventInstead",[ur("event",vi())]),ur("getRelated",A.none),ur("isExtraPart",T),ur("eventOrder",A.none)],factory:(e,t)=>{const o=(e,t,o,r)=>{n(e,t,o,(()=>r.map((e=>Wo(e)))))},n=(t,o,n,r)=>{const i=e.lazySink(t).getOrDie();Dd.openWhileCloaked(t,o,(()=>ud.positionWithinBounds(i,t,n,r()))),ou.setValue(t,A.some({mode:"position",config:n,getBounds:r}))},r=(t,o,n,r)=>{const i=((e,t,o,n,r)=>{const i=()=>e.lazySink(t),s="horizontal"===n.type?{layouts:{onLtr:()=>sl(),onRtl:()=>al()}}:{},a=e=>(e=>2===e.length)(e)?s:{};return Tg.sketch({dom:{tag:"div"},data:n.data,markers:n.menu.markers,highlightOnOpen:n.menu.highlightOnOpen,fakeFocus:n.menu.fakeFocus,onEscape:()=>(Dd.close(t),e.onEscape.map((e=>e(t))),A.some(!0)),onExecute:()=>A.some(!0),onOpenMenu:(e,t)=>{ud.positionWithinBounds(i().getOrDie(),t,o,r())},onOpenSubmenu:(e,t,o,n)=>{const r=i().getOrDie();ud.position(r,o,{anchor:{type:"submenu",item:t,...a(n)}})},onRepositionMenu:(e,t,n)=>{const s=i().getOrDie();ud.positionWithinBounds(s,t,o,r()),z(n,(e=>{const t=a(e.triggeringPath);ud.position(s,e.triggeredMenu,{anchor:{type:"submenu",item:e.triggeringItem,...t}})}))}})})(e,t,o,n,r);Dd.open(t,i),ou.setValue(t,A.some({mode:"menu",menu:i}))},i=t=>{Dd.isOpen(t)&&ou.getValue(t).each((o=>{switch(o.mode){case"menu":Dd.getState(t).each(Tg.repositionMenus);break;case"position":const n=e.lazySink(t).getOrDie();ud.positionWithinBounds(n,t,o.config,o.getBounds())}}))},s={setContent:(e,t)=>{Dd.setContent(e,t)},showAt:(e,t,n)=>{o(e,t,n,A.none())},showWithin:o,showWithinBounds:n,showMenuAt:(e,t,o)=>{r(e,t,o,A.none)},showMenuWithinBounds:r,hide:e=>{Dd.isOpen(e)&&(ou.setValue(e,A.none()),Dd.close(e))},getContent:e=>Dd.getState(e),reposition:i,isOpen:Dd.isOpen};return{uid:e.uid,dom:e.dom,behaviours:iu(e.inlineBehaviours,[Dd.config({isPartOf:(t,o,n)=>la(o,n)||((t,o)=>e.getRelated(t).exists((e=>la(e,o))))(t,n),getAttachPoint:t=>e.lazySink(t).getOrDie(),onOpen:t=>{e.onShow(t)},onClose:t=>{e.onHide(t)}}),ou.config({store:{mode:"memory",initialValue:A.none()}}),yl.config({channels:{...Hd({isExtraPart:t.isExtraPart,...e.fireDismissalEventInstead.map((e=>({fireEventInstead:{event:e.event}}))).getOr({})}),...jd({...e.fireRepositionEventInstead.map((e=>({fireEventInstead:{event:e.event}}))).getOr({}),doReposition:i})}})]),eventOrder:e.eventOrder,apis:s}},apis:{showAt:(e,t,o,n)=>{e.showAt(t,o,n)},showWithin:(e,t,o,n,r)=>{e.showWithin(t,o,n,r)},showWithinBounds:(e,t,o,n,r)=>{e.showWithinBounds(t,o,n,r)},showMenuAt:(e,t,o,n)=>{e.showMenuAt(t,o,n)},showMenuWithinBounds:(e,t,o,n,r)=>{e.showMenuWithinBounds(t,o,n,r)},hide:(e,t)=>{e.hide(t)},isOpen:(e,t)=>e.isOpen(t),getContent:(e,t)=>e.getContent(t),setContent:(e,t,o)=>{e.setContent(t,o)},reposition:(e,t)=>{e.reposition(t)}}});var Og=window.mailpoetTinymce.util.Tools.resolve("window.mailpoetTinymce.util.Delay");const Ag=rh({name:"Button",factory:e=>{const t=Jp(e.action),o=e.dom.tag,n=t=>ve(e.dom,"attributes").bind((e=>ve(e,t)));return{uid:e.uid,dom:e.dom,components:e.components,events:t,behaviours:au(e.buttonBehaviours,[Zp.config({}),Ep.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:"button"===o?{type:n("type").getOr("button"),...n("role").map((e=>({role:e}))).getOr({})}:{role:n("role").getOr("button")}},eventOrder:e.eventOrder}},configFields:[ur("uid",void 0),Gn("dom"),ur("components",[]),su("buttonBehaviours",[Zp,Ep]),nr("action"),nr("role"),ur("eventOrder",{})]}),Mg=e=>{const t=(e=>void 0!==e.uid)(e)&&ye(e,"uid")?e.uid:ss("memento");return{get:e=>e.getSystem().getByUid(t).getOrDie(),getOpt:e=>e.getSystem().getByUid(t).toOptional(),asSpec:()=>({...e,uid:t})}};var Bg=window.mailpoetTinymce.util.Tools.resolve("window.mailpoetTinymce.util.I18n");const Pg={indent:!0,outdent:!0,"table-insert-column-after":!0,"table-insert-column-before":!0,"paste-column-after":!0,"paste-column-before":!0,"unordered-list":!0,"list-bull-circle":!0,"list-bull-default":!0,"list-bull-square":!0},Rg="temporary-placeholder",Vg=e=>()=>ve(e,Rg).getOr("!not found!"),Ng=(e,t)=>{const o=e.toLowerCase();if(Bg.isRtl()){const e=((e,t)=>Te(e,t)?e:((e,t)=>e+t)(e,t))(o,"-rtl");return be(t,e)?e:o}return o},Dg=(e,t)=>ve(t,Ng(e,t)),Fg=(e,t)=>{const o=t();return Dg(e,o).getOrThunk(Vg(o))},Ig=()=>Fp("add-focusable",[Hi((e=>{na(e.element,"svg").each((e=>bt(e,"focusable","false")))}))]),Lg=(e,t,o,n)=>{var r,i;const s=(e=>!!Bg.isRtl()&&be(Pg,e))(t)?["tox-icon--flip"]:[],a=ve(o,Ng(t,o)).or(n).getOrThunk(Vg(o));return{dom:{tag:e.tag,attributes:null!==(r=e.attributes)&&void 0!==r?r:{},classes:e.classes.concat(s),innerHtml:a},behaviours:ml([...null!==(i=e.behaviours)&&void 0!==i?i:[],Ig()])}},zg=(e,t,o,n=A.none())=>Lg(t,e,o(),n),Hg={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},Zg=rh({name:"Notification",factory:e=>{const t=Mg({dom:{tag:"p",innerHtml:e.translationProvider(e.text)},behaviours:ml([Dp.config({})])}),o=e=>({dom:{tag:"div",classes:["tox-bar"],styles:{width:`${e}%`}}}),n=e=>({dom:{tag:"div",classes:["tox-text"],innerHtml:`${e}%`}}),r=Mg({dom:{tag:"div",classes:e.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[o(0)]},n(0)],behaviours:ml([Dp.config({})])}),i={updateProgress:(e,t)=>{e.getSystem().isConnected()&&r.getOpt(e).each((e=>{Dp.set(e,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[o(t)]},n(t)])}))},updateText:(e,o)=>{if(e.getSystem().isConnected()){const n=t.get(e);Dp.set(n,[$s(o)])}}},s=q([e.icon.toArray(),e.level.toArray(),e.level.bind((e=>A.from(Hg[e]))).toArray()]),a=Mg(Ag.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[zg("close",{tag:"div",classes:["tox-icon"],attributes:{"aria-label":e.translationProvider("Close")}},e.iconProvider)],action:t=>{e.onAction(t)}})),l=((e,t,o)=>{const n=o(),r=$(e,(e=>be(n,Ng(e,n))));return Lg({tag:"div",classes:["tox-notification__icon"]},r.getOr(Rg),n,A.none())})(s,0,e.iconProvider),c=[l,{dom:{tag:"div",classes:["tox-notification__body"]},components:[t.asSpec()],behaviours:ml([Dp.config({})])}];return{uid:e.uid,dom:{tag:"div",attributes:{role:"alert"},classes:e.level.map((e=>["tox-notification","tox-notification--in",`tox-notification--${e}`])).getOr(["tox-notification","tox-notification--in"])},behaviours:ml([Zp.config({}),Fp("notification-events",[Ri(zr(),(e=>{a.getOpt(e).each(Zp.focus)}))])]),components:c.concat(e.progress?[r.asSpec()]:[]).concat(e.closeButton?[a.asSpec()]:[]),apis:i}},configFields:[nr("level"),Gn("progress"),nr("icon"),Gn("onAction"),Gn("text"),Gn("iconProvider"),Gn("translationProvider"),fr("closeButton",!0)],apis:{updateProgress:(e,t,o)=>{e.updateProgress(t,o)},updateText:(e,t,o)=>{e.updateText(t,o)}}});var jg,Ug,$g=window.mailpoetTinymce.util.Tools.resolve("mailpoetTinymce.dom.DOMUtils"),Wg=window.mailpoetTinymce.util.Tools.resolve("mailpoetTinymce.EditorManager"),qg=window.mailpoetTinymce.util.Tools.resolve("mailpoetTinymce.Env");!function(e){e.default="wrap",e.floating="floating",e.sliding="sliding",e.scrolling="scrolling"}(jg||(jg={})),function(e){e.auto="auto",e.top="top",e.bottom="bottom"}(Ug||(Ug={}));const Gg=e=>t=>t.options.get(e),Yg=e=>t=>A.from(e(t)),Xg=e=>{const t=qg.deviceType.isPhone(),o=qg.deviceType.isTablet()||t,n=e.options.register,r=e=>i(e)||!1===e,s=e=>i(e)||g(e);n("skin",{processor:e=>i(e)||!1===e,default:"oxide"}),n("skin_url",{processor:"string"}),n("height",{processor:s,default:Math.max(e.getElement().offsetHeight,400)}),n("width",{processor:s,default:$g.DOM.getStyle(e.getElement(),"width")}),n("min_height",{processor:"number",default:100}),n("min_width",{processor:"number"}),n("max_height",{processor:"number"}),n("max_width",{processor:"number"}),n("style_formats",{processor:"object[]"}),n("style_formats_merge",{processor:"boolean",default:!1}),n("style_formats_autohide",{processor:"boolean",default:!1}),n("line_height_formats",{processor:"string",default:"1 1.1 1.2 1.3 1.4 1.5 2"}),n("font_family_formats",{processor:"string",default:"Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats"}),n("font_size_formats",{processor:"string",default:"8pt 10pt 12pt 14pt 18pt 24pt 36pt"}),n("block_formats",{processor:"string",default:"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre"}),n("content_langs",{processor:"object[]"}),n("removed_menuitems",{processor:"string",default:""}),n("menubar",{processor:e=>i(e)||d(e),default:!t}),n("menu",{processor:"object",default:{}}),n("toolbar",{processor:e=>d(e)||i(e)||l(e)?{value:e,valid:!0}:{valid:!1,message:"Must be a boolean, string or array."},default:!0}),F(9,(e=>{n("toolbar"+(e+1),{processor:"string"})})),n("toolbar_mode",{processor:"string",default:o?"scrolling":"floating"}),n("toolbar_groups",{processor:"object",default:{}}),n("toolbar_location",{processor:"string",default:Ug.auto}),n("toolbar_persist",{processor:"boolean",default:!1}),n("toolbar_sticky",{processor:"boolean",default:e.inline}),n("toolbar_sticky_offset",{processor:"number",default:0}),n("fixed_toolbar_container",{processor:"string",default:""}),n("fixed_toolbar_container_target",{processor:"object"}),n("file_picker_callback",{processor:"function"}),n("file_picker_validator_handler",{processor:"function"}),n("file_picker_types",{processor:"string"}),n("typeahead_urls",{processor:"boolean",default:!0}),n("anchor_top",{processor:r,default:"#top"}),n("anchor_bottom",{processor:r,default:"#bottom"}),n("draggable_modal",{processor:"boolean",default:!1}),n("statusbar",{processor:"boolean",default:!0}),n("elementpath",{processor:"boolean",default:!0}),n("branding",{processor:"boolean",default:!0}),n("promotion",{processor:"boolean",default:!0}),n("resize",{processor:e=>"both"===e||d(e),default:!qg.deviceType.isTouch()}),n("sidebar_show",{processor:"string"})},Kg=Gg("readonly"),Jg=Gg("height"),Qg=Gg("width"),ef=Yg(Gg("min_width")),tf=Yg(Gg("min_height")),of=Yg(Gg("max_width")),nf=Yg(Gg("max_height")),rf=Yg(Gg("style_formats")),sf=Gg("style_formats_merge"),af=Gg("style_formats_autohide"),lf=Gg("content_langs"),cf=Gg("removed_menuitems"),df=Gg("toolbar_mode"),uf=Gg("toolbar_groups"),hf=Gg("toolbar_location"),mf=Gg("fixed_toolbar_container"),pf=Gg("fixed_toolbar_container_target"),gf=Gg("toolbar_persist"),ff=Gg("toolbar_sticky_offset"),vf=Gg("menubar"),bf=Gg("toolbar"),yf=Gg("file_picker_callback"),wf=Gg("file_picker_validator_handler"),_f=Gg("file_picker_types"),xf=Gg("typeahead_urls"),Cf=Gg("anchor_top"),kf=Gg("anchor_bottom"),Sf=Gg("draggable_modal"),Tf=Gg("statusbar"),Ef=Gg("elementpath"),Of=Gg("branding"),Af=Gg("resize"),Mf=Gg("paste_as_text"),Bf=Gg("sidebar_show"),Pf=Gg("promotion"),Rf=e=>!1===e.options.get("skin"),Vf=e=>!1!==e.options.get("menubar"),Nf=e=>{const t=e.options.get("skin_url");if(Rf(e))return t;if(t)return e.documentBaseURI.toAbsolute(t);{const t=e.options.get("skin");return Wg.baseURL+"/skins/ui/"+t}},Df=e=>e.options.get("line_height_formats").split(" "),Ff=e=>{const t=bf(e),o=i(t),n=l(t)&&t.length>0;return!Lf(e)&&(n||o||!0===t)},If=e=>{const t=F(9,(t=>e.options.get("toolbar"+(t+1)))),o=Z(t,i);return Ce(o.length>0,o)},Lf=e=>If(e).fold((()=>{const t=bf(e);return f(t,i)&&t.length>0}),E),zf=e=>hf(e)===Ug.bottom,Hf=e=>{var t;if(!e.inline)return A.none();const o=null!==(t=mf(e))&&void 0!==t?t:"";if(o.length>0)return ra(gt(),o);const n=pf(e);return m(n)?A.some(Ve(n)):A.none()},Zf=e=>e.inline&&Hf(e).isSome(),jf=e=>Hf(e).getOrThunk((()=>ut(dt(Ve(e.getElement()))))),Uf=e=>e.inline&&!Vf(e)&&!Ff(e)&&!Lf(e),$f=e=>(e.options.get("toolbar_sticky")||e.inline)&&!Zf(e)&&!Uf(e),Wf=e=>{const t=e.options.get("menu");return ce(t,(e=>({...e,items:e.items})))};var qf=Object.freeze({__proto__:null,get ToolbarMode(){return jg},get ToolbarLocation(){return Ug},register:Xg,getSkinUrl:Nf,isReadOnly:Kg,isSkinDisabled:Rf,getHeightOption:Jg,getWidthOption:Qg,getMinWidthOption:ef,getMinHeightOption:tf,getMaxWidthOption:of,getMaxHeightOption:nf,getUserStyleFormats:rf,shouldMergeStyleFormats:sf,shouldAutoHideStyleFormats:af,getLineHeightFormats:Df,getContentLanguages:lf,getRemovedMenuItems:cf,isMenubarEnabled:Vf,isMultipleToolbars:Lf,isToolbarEnabled:Ff,isToolbarPersist:gf,getMultipleToolbarsOption:If,getUiContainer:jf,useFixedContainer:Zf,getToolbarMode:df,isDraggableModal:Sf,isDistractionFree:Uf,isStickyToolbar:$f,getStickyToolbarOffset:ff,getToolbarLocation:hf,isToolbarLocationBottom:zf,getToolbarGroups:uf,getMenus:Wf,getMenubar:vf,getToolbar:bf,getFilePickerCallback:yf,getFilePickerTypes:_f,useTypeaheadUrls:xf,getAnchorTop:Cf,getAnchorBottom:kf,getFilePickerValidatorHandler:wf,useStatusBar:Tf,useElementPath:Ef,promotionEnabled:Pf,useBranding:Of,getResize:Af,getPasteAsText:Mf,getSidebarShow:Bf});const Gf="[data-mce-autocompleter]",Yf=e=>ia(e,Gf);var Xf;!function(e){e[e.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",e[e.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"}(Xf||(Xf={}));var Kf=Xf;const Jf="tox-menu-nav__js",Qf="tox-collection__item",ev="tox-swatch",tv={normal:Jf,color:ev},ov="tox-collection__item--enabled",nv="tox-collection__item-icon",rv="tox-collection__item-label",iv="tox-collection__item-caret",sv="tox-collection__item--active",av="tox-collection__item-container",lv="tox-collection__item-container--row",cv=e=>ve(tv,e).getOr(Jf),dv=e=>"color"===e?"tox-swatches":"tox-menu",uv=e=>({backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:dv(e),tieredMenu:"tox-tiered-menu"}),hv=e=>{const t=uv(e);return{backgroundMenu:t.backgroundMenu,selectedMenu:t.selectedMenu,menu:t.menu,selectedItem:t.selectedItem,item:cv(e)}},mv=(e,t,o)=>{const n=uv(o);return{tag:"div",classes:q([[n.menu,`tox-menu-${t}-column`],e?[n.hasIcons]:[]])}},pv=[vg.parts.items({})],gv=(e,t,o)=>{const n=uv(o);return{dom:{tag:"div",classes:q([[n.tieredMenu]])},markers:hv(o)}},fv=y([nr("data"),ur("inputAttributes",{}),ur("inputStyles",{}),ur("tag","input"),ur("inputClasses",[]),_a("onSetValue"),ur("styles",{}),ur("eventOrder",{}),nu("inputBehaviours",[ou,Zp]),ur("selectOnFocus",!0)]),vv=e=>ml([Zp.config({onFocus:e.selectOnFocus?e=>{const t=e.element,o=Ds(t);t.dom.setSelectionRange(0,o.length)}:v})]),bv=e=>({...vv(e),...iu(e.inputBehaviours,[ou.config({store:{mode:"manual",...e.data.map((e=>({initialValue:e}))).getOr({}),getValue:e=>Ds(e.element),setValue:(e,t)=>{Ds(e.element)!==t&&Fs(e.element,t)}},onSetValue:e.onSetValue})])}),yv=e=>({tag:e.tag,attributes:{type:"text",...e.inputAttributes},styles:e.inputStyles,classes:e.inputClasses}),wv=rh({name:"Input",configFields:fv(),factory:(e,t)=>({uid:e.uid,dom:yv(e),components:[],behaviours:bv(e),eventOrder:e.eventOrder})}),_v=Qi("refetch-trigger-event"),xv=Qi("redirect-menu-item-interaction"),Cv="tox-menu__searcher",kv=e=>ra(e.element,`.${Cv}`).bind((t=>e.getSystem().getByDom(t).toOptional())),Sv=kv,Tv=e=>({fetchPattern:ou.getValue(e),selectionStart:e.element.dom.selectionStart,selectionEnd:e.element.dom.selectionEnd}),Ev=e=>{const t=(e,t)=>(t.cut(),A.none()),o=(e,t)=>{const o={interactionEvent:t.event,eventType:t.event.raw.type};return Si(e,xv,o),A.some(!0)},n="searcher-events";return{dom:{tag:"div",classes:[Qf]},components:[wv.sketch({inputClasses:[Cv,"tox-textfield"],inputAttributes:{...e.placeholder.map((t=>({placeholder:e.i18n(t)}))).getOr({}),type:"search","aria-autocomplete":"list"},inputBehaviours:ml([Fp(n,[Ri(Ur(),(e=>{ki(e,_v)})),Ri(Zr(),((e,t)=>{"Escape"===t.event.raw.key&&t.stop()}))]),Ep.config({mode:"special",onLeft:t,onRight:t,onSpace:t,onEnter:o,onEscape:o,onUp:o,onDown:o})]),eventOrder:{keydown:[n,Ep.name()]}})]}},Ov="tox-collection--results__js",Av=e=>{var t;return e.dom?{...e,dom:{...e.dom,attributes:{...null!==(t=e.dom.attributes)&&void 0!==t?t:{},id:Qi("aria-item-search-result-id"),"aria-selected":"false"}}}:e},Mv=(e,t)=>o=>{const n=I(o,t);return L(n,(t=>({dom:e,components:t})))},Bv=(e,t)=>{const o=[];let n=[];return z(e,((e,r)=>{t(e,r)?(n.length>0&&o.push(n),n=[],(be(e.dom,"innerHtml")||e.components&&e.components.length>0)&&n.push(e)):n.push(e)})),n.length>0&&o.push(n),L(o,(e=>({dom:{tag:"div",classes:["tox-collection__group"]},components:e})))},Pv=(e,t,o)=>vg.parts.items({preprocess:n=>{const r=L(n,o);return"auto"!==e&&e>1?Mv({tag:"div",classes:["tox-collection__group"]},e)(r):Bv(r,((e,o)=>"separator"===t[o].type))}}),Rv=(e,t,o=!0)=>({dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===e?["tox-collection--list"]:["tox-collection--grid"])},components:[Pv(e,t,w)]}),Vv=e=>D(e,(e=>"icon"in e&&void 0!==e.icon)),Nv=e=>(console.error(jn(e)),console.log(e),A.none()),Dv=(e,t,o,n,r)=>{const i=(s=o,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[vg.parts.items({preprocess:e=>Bv(e,((e,t)=>"separator"===s[t].type))})]});var s;return{value:e,dom:i.dom,components:i.components,items:o}},Fv=(e,t,o,n,r)=>{if("color"===r.menuType){const t=(e=>({dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[vg.parts.items({preprocess:"auto"!==e?Mv({tag:"div",classes:["tox-swatches__row"]},e):w})]}]}))(n);return{value:e,dom:t.dom,components:t.components,items:o}}if("normal"===r.menuType&&"auto"===n){const t=Rv(n,o);return{value:e,dom:t.dom,components:t.components,items:o}}if("normal"===r.menuType||"searchable"===r.menuType){const t="searchable"!==r.menuType?Rv(n,o):"search-with-field"===r.searchMode.searchMode?((e,t,o)=>{const n=Qi("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===e?["tox-collection--list"]:["tox-collection--grid"])},components:[Ev({i18n:Bg.translate,placeholder:o.placeholder}),{dom:{tag:"div",classes:[...1===e?["tox-collection--list"]:["tox-collection--grid"],Ov],attributes:{id:n}},components:[Pv(e,t,Av)]}]}})(n,o,r.searchMode):((e,t,o=!0)=>{const n=Qi("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection",Ov].concat(1===e?["tox-collection--list"]:["tox-collection--grid"]),attributes:{id:n}},components:[Pv(e,t,Av)]}})(n,o);return{value:e,dom:t.dom,components:t.components,items:o}}if("listpreview"===r.menuType&&"auto"!==n){const t=(e=>({dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[vg.parts.items({preprocess:Mv({tag:"div",classes:["tox-collection__group"]},e)})]}))(n);return{value:e,dom:t.dom,components:t.components,items:o}}return{value:e,dom:mv(t,n,r.menuType),components:pv,items:o}},Iv=Kn("type"),Lv=Kn("name"),zv=Kn("label"),Hv=Kn("text"),Zv=Kn("title"),jv=Kn("icon"),Uv=Kn("value"),$v=Qn("fetch"),Wv=Qn("getSubmenuItems"),qv=Qn("onAction"),Gv=Qn("onItemAction"),Yv=vr("onSetup",(()=>v)),Xv=sr("name"),Kv=sr("text"),Jv=sr("icon"),Qv=sr("tooltip"),eb=sr("label"),tb=sr("shortcut"),ob=lr("select"),nb=fr("active",!1),rb=fr("borderless",!1),ib=fr("enabled",!0),sb=fr("primary",!1),ab=e=>ur("columns",e),lb=ur("meta",{}),cb=vr("onAction",v),db=e=>pr("type",e),ub=e=>$n("name","name",un((()=>Qi(`${e}-name`))),Pn),hb=kn([Iv,Kv]),mb=kn([db("autocompleteitem"),nb,ib,lb,Uv,Kv,Jv]),pb=[ib,Qv,Jv,Kv,Yv],gb=kn([Iv,qv].concat(pb)),fb=e=>zn("toolbarbutton",gb,e),vb=[nb].concat(pb),bb=kn(vb.concat([Iv,qv])),yb=e=>zn("ToggleButton",bb,e),wb=[vr("predicate",T),gr("scope","node",["node","editor"]),gr("position","selection",["node","selection","line"])],_b=pb.concat([db("contextformbutton"),sb,qv,Wn("original",w)]),xb=vb.concat([db("contextformbutton"),sb,qv,Wn("original",w)]),Cb=pb.concat([db("contextformbutton")]),kb=vb.concat([db("contextformtogglebutton")]),Sb=Un("type",{contextformbutton:_b,contextformtogglebutton:xb}),Tb=kn([db("contextform"),vr("initValue",y("")),eb,or("commands",Sb),rr("launch",Un("type",{contextformbutton:Cb,contextformtogglebutton:kb}))].concat(wb)),Eb=kn([db("contexttoolbar"),Kn("items")].concat(wb)),Ob=[Iv,Kn("src"),sr("alt"),br("classes",[],Pn)],Ab=kn(Ob),Mb=[Iv,Hv,Xv,br("classes",["tox-collection__item-label"],Pn)],Bb=kn(Mb),Pb=_n((()=>Fn("type",{cardimage:Ab,cardtext:Bb,cardcontainer:Rb}))),Rb=kn([Iv,pr("direction","horizontal"),pr("align","left"),pr("valign","middle"),or("items",Pb)]),Vb=[ib,Kv,tb,("menuitem",$n("value","value",un((()=>Qi("menuitem-value"))),An())),lb];const Nb=kn([Iv,eb,or("items",Pb),Yv,cb].concat(Vb)),Db=kn([Iv,nb,Jv].concat(Vb)),Fb=[Iv,Kn("fancytype"),cb],Ib=[ur("initData",{})].concat(Fb),Lb=[yr("initData",{},[fr("allowCustomColors",!0),pr("storageKey","default"),cr("colors",An())])].concat(Fb),zb=Un("fancytype",{inserttable:Ib,colorswatch:Lb}),Hb=kn([Iv,Yv,cb,Jv].concat(Vb)),Zb=kn([Iv,Wv,Yv,Jv].concat(Vb)),jb=kn([Iv,Jv,nb,Yv,qv].concat(Vb)),Ub=(e,t,o)=>{const n=Dc(e.element,"."+o);if(n.length>0){const e=W(n,(e=>{const o=e.dom.getBoundingClientRect().top,r=n[0].dom.getBoundingClientRect().top;return Math.abs(o-r)>t})).getOr(n.length);return A.some({numColumns:e,numRows:Math.ceil(n.length/e)})}return A.none()},$b=e=>((e,t)=>ml([Fp(e,t)]))(Qi("unnamed-events"),e),Wb=Qi("tooltip.exclusive"),qb=Qi("tooltip.show"),Gb=Qi("tooltip.hide"),Yb=(e,t,o)=>{e.getSystem().broadcastOn([Wb],{})};var Xb=Object.freeze({__proto__:null,hideAllExclusive:Yb,setComponents:(e,t,o,n)=>{o.getTooltip().each((e=>{e.getSystem().isConnected()&&Dp.set(e,n)}))}}),Kb=Object.freeze({__proto__:null,events:(e,t)=>{const o=o=>{t.getTooltip().each((n=>{_d(n),e.onHide(o,n),t.clearTooltip()})),t.clearTimer()};return Mi(q([[Ri(qb,(o=>{t.resetTimer((()=>{(o=>{if(!t.isShowing()){Yb(o);const n=e.lazySink(o).getOrDie(),r=o.getSystem().build({dom:e.tooltipDom,components:e.tooltipComponents,events:Mi("normal"===e.mode?[Ri(Lr(),(e=>{ki(o,qb)})),Ri(Fr(),(e=>{ki(o,Gb)}))]:[]),behaviours:ml([Dp.config({})])});t.setTooltip(r),bd(n,r),e.onShow(o,r),ud.position(n,r,{anchor:e.anchor(o)})}})(o)}),e.delay)})),Ri(Gb,(n=>{t.resetTimer((()=>{o(n)}),e.delay)})),Ri(oi(),((e,t)=>{const n=t;n.universal||N(n.channels,Wb)&&o(e)})),Zi((e=>{o(e)}))],"normal"===e.mode?[Ri(zr(),(e=>{ki(e,qb)})),Ri(ei(),(e=>{ki(e,Gb)})),Ri(Lr(),(e=>{ki(e,qb)})),Ri(Fr(),(e=>{ki(e,Gb)}))]:[Ri(xi(),((e,t)=>{ki(e,qb)})),Ri(Ci(),(e=>{ki(e,Gb)}))]]))}}),Jb=[Gn("lazySink"),Gn("tooltipDom"),ur("exclusive",!0),ur("tooltipComponents",[]),ur("delay",300),gr("mode","normal",["normal","follow-highlight"]),ur("anchor",(e=>({type:"hotspot",hotspot:e,layouts:{onLtr:y([Qa,Ja,Ga,Xa,Ya,Ka]),onRtl:y([Qa,Ja,Ga,Xa,Ya,Ka])}}))),_a("onHide"),_a("onShow")];const Qb=gl({fields:Jb,name:"tooltipping",active:Kb,state:Object.freeze({__proto__:null,init:()=>{const e=Zl(),t=Zl(),o=()=>{e.on(clearTimeout)},n=y("not-implemented");return vs({getTooltip:t.get,isShowing:t.isSet,setTooltip:t.set,clearTooltip:t.clear,clearTimer:o,resetTimer:(t,n)=>{o(),e.set(setTimeout(t,n))},readState:n})}}),apis:Xb}),ey="silver.readonly",ty=kn([("readonly",Yn("readonly",Rn))]);const oy=(e,t)=>{const o=e.mainUi.outerContainer.element,n=[e.mainUi.mothership,...e.uiMotherships];t&&z(n,(e=>{e.broadcastOn([Fd()],{target:o})})),z(n,(e=>{e.broadcastOn([ey],{readonly:t})}))},ny=(e,t)=>{e.on("init",(()=>{e.mode.isReadOnly()&&oy(t,!0)})),e.on("SwitchMode",(()=>oy(t,e.mode.isReadOnly()))),Kg(e)&&e.mode.set("readonly")},ry=()=>yl.config({channels:{[ey]:{schema:ty,onReceive:(e,t)=>{Ch.set(e,t.readonly)}}}}),iy=e=>Ch.config({disabled:e}),sy=e=>Ch.config({disabled:e,disableClass:"tox-tbtn--disabled"}),ay=e=>Ch.config({disabled:e,disableClass:"tox-tbtn--disabled",useNative:!1}),ly=(e,t)=>{const o=e.getApi(t);return e=>{e(o)}},cy=(e,t)=>Hi((o=>{ly(e,o)((o=>{const n=e.onSetup(o);p(n)&&t.set(n)}))})),dy=(e,t)=>Zi((o=>ly(e,o)(t.get()))),uy=(e,t)=>Ui(((o,n)=>{ly(e,o)(e.onAction),e.triggersSubmenu||t!==Kf.CLOSE_ON_EXECUTE||(o.getSystem().isConnected()&&ki(o,ai()),n.stop())})),hy={[ni()]:["disabling","alloy.base.behaviour","toggling","item-events"]},my=_e,py=(e,t,o,n)=>{const r=wr(v);return{type:"item",dom:t.dom,components:my(t.optComponents),data:e.data,eventOrder:hy,hasSubmenu:e.triggersSubmenu,itemBehaviours:ml([Fp("item-events",[uy(e,o),cy(e,r),dy(e,r)]),(i=()=>!e.enabled||n.isDisabled(),Ch.config({disabled:i,disableClass:"tox-collection__item--state-disabled"})),ry(),Dp.config({})].concat(e.itemBehaviours))};var i},gy=e=>({value:e.value,meta:{text:e.text.getOr(""),...e.meta}}),fy=e=>{const t=qg.os.isMacOS()||qg.os.isiOS(),o=t?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},n=e.split("+"),r=L(n,(e=>{const t=e.toLowerCase().trim();return be(o,t)?o[t]:e}));return t?r.join(""):r.join("+")},vy=(e,t,o=[nv])=>zg(e,{tag:"div",classes:o},t),by=e=>({dom:{tag:"div",classes:[rv]},components:[$s(Bg.translate(e))]}),yy=(e,t)=>({dom:{tag:"div",classes:t,innerHtml:e}}),wy=(e,t)=>({dom:{tag:"div",classes:[rv]},components:[{dom:{tag:e.tag,styles:e.styles},components:[$s(Bg.translate(t))]}]}),_y=e=>({dom:{tag:"div",classes:["tox-collection__item-accessory"]},components:[$s(fy(e))]}),xy=e=>vy("checkmark",e,["tox-collection__item-checkmark"]),Cy=e=>{const t=e.map((e=>({attributes:{title:Bg.translate(e)}}))).getOr({});return{tag:"div",classes:[Jf,Qf],...t}},ky=(e,t,o,n=A.none())=>"color"===e.presets?((e,t,o)=>{const n=e.ariaLabel,r=e.value,i=e.iconContent.map((e=>((e,t,o)=>{const n=t();return Dg(e,n).or(o).getOrThunk(Vg(n))})(e,t.icons,o)));return{dom:(()=>{const e=ev,o=i.getOr(""),s=n.map((e=>({title:t.translate(e)}))).getOr({}),a={tag:"div",attributes:s,classes:[e]};return"custom"===r?{...a,tag:"button",classes:[...a.classes,"tox-swatches__picker-btn"],innerHtml:o}:"remove"===r?{...a,classes:[...a.classes,"tox-swatch--remove"],innerHtml:o}:m(r)?{...a,attributes:{...a.attributes,"data-mce-color":r},styles:{"background-color":r},innerHtml:o}:a})(),optComponents:[]}})(e,t,n):((e,t,o,n)=>{const r={tag:"div",classes:[nv]},i=o?e.iconContent.map((e=>zg(e,r,t.icons,n))).orThunk((()=>A.some({dom:r}))):A.none(),s=e.checkMark,a=A.from(e.meta).fold((()=>by),(e=>be(e,"style")?x(wy,e.style):by)),l=e.htmlContent.fold((()=>e.textContent.map(a)),(e=>A.some(yy(e,[rv]))));return{dom:Cy(e.ariaLabel),optComponents:[i,l,e.shortcutContent.map(_y),s,e.caret]}})(e,t,o,n),Sy=(e,t)=>ve(e,"tooltipWorker").map((e=>[Qb.config({lazySink:t.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:e=>({type:"submenu",item:e,overrides:{maxHeightFunction:Jl}}),mode:"follow-highlight",onShow:(t,o)=>{e((e=>{Qb.setComponents(t,[Ws({element:Ve(e)})])}))}})])).getOr([]),Ty=(e,t)=>{const o=(e=>$g.DOM.encode(e))(Bg.translate(e));if(t.length>0){const e=new RegExp((e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(t),"gi");return o.replace(e,(e=>`<span class="tox-autocompleter-highlight">${e}</span>`))}return o},Ey=(e,t)=>L(e,(e=>{switch(e.type){case"cardcontainer":return((e,t)=>{const o="vertical"===e.direction?"tox-collection__item-container--column":lv,n="left"===e.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right";return{dom:{tag:"div",classes:[av,o,n,(()=>{switch(e.valign){case"top":return"tox-collection__item-container--valign-top";case"middle":return"tox-collection__item-container--valign-middle";case"bottom":return"tox-collection__item-container--valign-bottom"}})()]},components:t}})(e,Ey(e.items,t));case"cardimage":return((e,t,o)=>({dom:{tag:"img",classes:t,attributes:{src:e,alt:o.getOr("")}}}))(e.src,e.classes,e.alt);case"cardtext":const o=e.name.exists((e=>N(t.cardText.highlightOn,e))),n=o?A.from(t.cardText.matchText).getOr(""):"";return yy(Ty(e.text,n),e.classes)}})),Oy=Fu(dg(),ug()),Ay=e=>({value:e}),My=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,By=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Py=e=>My.test(e)||By.test(e),Ry=e=>{return(t=e,((e,t)=>ke(e,t,0))(t,"#")?((e,t)=>e.substring(t))(t,"#".length):t).toUpperCase();var t},Vy=e=>{const t=e.toString(16);return(1===t.length?"0"+t:t).toUpperCase()},Ny=e=>{const t=Vy(e.red)+Vy(e.green)+Vy(e.blue);return Ay(t)},Dy=Math.min,Fy=Math.max,Iy=Math.round,Ly=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,zy=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,Hy=(e,t,o,n)=>({red:e,green:t,blue:o,alpha:n}),Zy=e=>{const t=parseInt(e,10);return t.toString()===e&&t>=0&&t<=255},jy=e=>{let t,o,n;const r=(e.hue||0)%360;let i=e.saturation/100,s=e.value/100;if(i=Fy(0,Dy(i,1)),s=Fy(0,Dy(s,1)),0===i)return t=o=n=Iy(255*s),Hy(t,o,n,1);const a=r/60,l=s*i,c=l*(1-Math.abs(a%2-1)),d=s-l;switch(Math.floor(a)){case 0:t=l,o=c,n=0;break;case 1:t=c,o=l,n=0;break;case 2:t=0,o=l,n=c;break;case 3:t=0,o=c,n=l;break;case 4:t=c,o=0,n=l;break;case 5:t=l,o=0,n=c;break;default:t=o=n=0}return t=Iy(255*(t+d)),o=Iy(255*(o+d)),n=Iy(255*(n+d)),Hy(t,o,n,1)},Uy=e=>{const t=(e=>{const t=(e=>{const t=e.value.replace(My,((e,t,o,n)=>t+t+o+o+n+n));return{value:t}})(e),o=By.exec(t.value);return null===o?["FFFFFF","FF","FF","FF"]:o})(e),o=parseInt(t[1],16),n=parseInt(t[2],16),r=parseInt(t[3],16);return Hy(o,n,r,1)},$y=(e,t,o,n)=>{const r=parseInt(e,10),i=parseInt(t,10),s=parseInt(o,10),a=parseFloat(n);return Hy(r,i,s,a)},Wy=e=>{if("transparent"===e)return A.some(Hy(0,0,0,0));const t=Ly.exec(e);if(null!==t)return A.some($y(t[1],t[2],t[3],"1"));const o=zy.exec(e);return null!==o?A.some($y(o[1],o[2],o[3],o[4])):A.none()},qy=e=>`rgba(${e.red},${e.green},${e.blue},${e.alpha})`,Gy=Hy(255,0,0,1),Yy=(e,t)=>{e.dispatch("ResizeContent",t)},Xy=(e,t)=>e.dispatch("ResolveName",{name:t.nodeName.toLowerCase(),target:t});var Ky=window.mailpoetTinymce.util.Tools.resolve("window.mailpoetTinymce.util.LocalStorage");const Jy={},Qy=e=>ve(Jy,e).getOrThunk((()=>{const t=`tinymce-custom-colors-${e}`,o=Ky.getItem(t);if(h(o)){const e=Ky.getItem("tinymce-custom-colors");Ky.setItem(t,m(e)?e:"[]")}const n=((e,t=10)=>{const o=Ky.getItem(e),n=i(o)?JSON.parse(o):[],r=t-(s=n).length<0?s.slice(0,t):s;var s;const a=e=>{r.splice(e,1)};return{add:o=>{V(r,o).each(a),r.unshift(o),r.length>t&&r.pop(),Ky.setItem(e,JSON.stringify(r))},state:()=>r.slice(0)}})(t,10);return Jy[e]=n,n})),ew=(e,t)=>{Qy(e).add(t)},tw=(e,t,o)=>({hue:e,saturation:t,value:o}),ow=e=>{let t=0,o=0,n=0;const r=e.red/255,i=e.green/255,s=e.blue/255,a=Math.min(r,Math.min(i,s)),l=Math.max(r,Math.max(i,s));return a===l?(n=a,tw(0,0,100*n)):(t=r===a?3:s===a?1:5,t=60*(t-(r===a?i-s:s===a?r-i:s-r)/(l-a)),o=(l-a)/l,n=l,tw(Math.round(t),Math.round(100*o),Math.round(100*n)))},nw=e=>Ny(jy(e)),rw=e=>{return(t=e,Py(t)?A.some({value:Ry(t)}):A.none()).orThunk((()=>Wy(e).map(Ny))).getOrThunk((()=>{const t=document.createElement("canvas");t.height=1,t.width=1;const o=t.getContext("2d");o.clearRect(0,0,t.width,t.height),o.fillStyle="#FFFFFF",o.fillStyle=e,o.fillRect(0,0,1,1);const n=o.getImageData(0,0,1,1).data,r=n[0],i=n[1],s=n[2],a=n[3];return Ny(Hy(r,i,s,a))}));var t},iw="forecolor",sw="hilitecolor",aw=e=>Math.max(5,Math.ceil(Math.sqrt(e))),lw=e=>{const t=[];for(let o=0;o<e.length;o+=2)t.push({text:e[o+1],value:"#"+rw(e[o]).value,icon:"checkmark",type:"choiceitem"});return t},cw=e=>t=>t.options.get(e),dw="#000000",uw=(e,t)=>t===iw?cw("color_cols_foreground")(e):t===sw?cw("color_cols_background")(e):cw("color_cols")(e),hw=cw("custom_colors"),mw=(e,t)=>t===iw&&e.options.isSet("color_map_foreground")?cw("color_map_foreground")(e):t===sw&&e.options.isSet("color_map_background")?cw("color_map_background")(e):cw("color_map")(e),pw=cw("color_default_foreground"),gw=cw("color_default_background"),fw=(e,t)=>{const o=At(Ve(e.selection.getStart()),"hilitecolor"===t?"background-color":"color");return Wy(o).map((e=>"#"+Ny(e).value))},vw=e=>{const t="choiceitem",o={type:t,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return e?[o,{type:t,text:"Custom color",icon:"color-picker",value:"custom"}]:[o]},bw=(e,t,o,n)=>{"custom"===o?kw(e)((o=>{o.each((o=>{ew(t,o),e.execCommand("mceApplyTextcolor",t,o),n(o)}))}),fw(e,t).getOr(dw)):"remove"===o?(n(""),e.execCommand("mceRemoveTextcolor",t)):(n(o),e.execCommand("mceApplyTextcolor",t,o))},yw=(e,t,o)=>e.concat((e=>L(Qy(e).state(),(e=>({type:"choiceitem",text:e,icon:"checkmark",value:e}))))(t).concat(vw(o))),ww=(e,t,o)=>n=>{n(yw(e,t,o))},_w=(e,t,o)=>{const n="forecolor"===t?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color";e.setIconFill(n,o)},xw=(e,t,o,n,r)=>{e.ui.registry.addSplitButton(t,{tooltip:n,presets:"color",icon:"forecolor"===t?"text-color":"highlight-bg-color",select:t=>{const n=fw(e,o);return we(n,t.toUpperCase())},columns:uw(e,o),fetch:ww(mw(e,o),o,hw(e)),onAction:t=>{bw(e,o,r.get(),v)},onItemAction:(n,i)=>{bw(e,o,i,(o=>{r.set(o),((e,t)=>{e.dispatch("TextColorChange",t)})(e,{name:t,color:o})}))},onSetup:o=>{_w(o,t,r.get());const n=e=>{e.name===t&&_w(o,e.name,e.color)};return e.on("TextColorChange",n),()=>{e.off("TextColorChange",n)}}})},Cw=(e,t,o,n)=>{e.ui.registry.addNestedMenuItem(t,{text:n,icon:"forecolor"===t?"text-color":"highlight-bg-color",getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"colorswatch",initData:{storageKey:o},onAction:t=>{bw(e,o,t.value,v)}}]})},kw=e=>(t,o)=>{let n=!1;const r={colorpicker:o};e.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:r,onAction:(e,t)=>{"hex-valid"===t.name&&(n=t.value)},onSubmit:o=>{const r=o.getData().colorpicker;n?(t(A.from(r)),o.close()):e.windowManager.alert(e.translate(["Invalid hex color code: {0}",r]))},onClose:v,onCancel:()=>{t(A.none())}})},Sw=(e,t,o,n,r,i,s,a)=>{const l=Vv(t),c=Tw(t,o,n,"color"!==r?"normal":"color",i,s,a);return Fv(e,l,c,n,{menuType:r})},Tw=(e,t,o,n,r,i,s)=>_e(L(e,(a=>{return"choiceitem"===a.type?(l=a,zn("choicemenuitem",Db,l)).fold(Nv,(a=>A.some(((e,t,o,n,r,i,s,a=!0)=>{const l=ky({presets:o,textContent:t?e.text:A.none(),htmlContent:A.none(),ariaLabel:e.text,iconContent:e.icon,shortcutContent:t?e.shortcut:A.none(),checkMark:t?A.some(xy(s.icons)):A.none(),caret:A.none(),value:e.value},s,a);return cn(py({data:gy(e),enabled:e.enabled,getApi:e=>({setActive:t=>{Xp.set(e,t)},isActive:()=>Xp.isOn(e),isEnabled:()=>!Ch.isDisabled(e),setEnabled:t=>Ch.set(e,!t)}),onAction:t=>n(e.value),onSetup:e=>(e.setActive(r),v),triggersSubmenu:!1,itemBehaviours:[]},l,i,s),{toggling:{toggleClass:ov,toggleOnExecute:!1,selected:e.active,exclusive:!0}})})(a,1===o,n,t,i(a.value),r,s,Vv(e))))):A.none();var l}))),Ew=(e,t)=>{const o=hv(t);return 1===e?{mode:"menu",moveOnTab:!0}:"auto"===e?{mode:"grid",selector:"."+o.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===t?"tox-swatches__row":"tox-collection__group"),previousSelector:e=>"color"===t?ra(e.element,"[aria-checked=true]"):A.none()}},Ow=Qi("cell-over"),Aw=Qi("cell-execute"),Mw=(e,t,o)=>{const n=o=>Si(o,Aw,{row:e,col:t}),r=(e,t)=>{t.stop(),n(e)};return Ys({dom:{tag:"div",attributes:{role:"button","aria-labelledby":o}},behaviours:ml([Fp("insert-table-picker-cell",[Ri(Lr(),Zp.focus),Ri(ni(),n),Ri(Wr(),r),Ri(ii(),r)]),Xp.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Zp.config({onFocus:o=>Si(o,Ow,{row:e,col:t})})])})},Bw=e=>G(e,(e=>L(e,Xs))),Pw=(e,t)=>$s(`${t}x${e}`),Rw={inserttable:e=>{const t=Qi("size-label"),o=((e,t,o)=>{const n=[];for(let t=0;t<10;t++){const o=[];for(let n=0;n<10;n++)o.push(Mw(t,n,e));n.push(o)}return n})(t),n=Pw(0,0),r=Mg({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:t}},components:[n],behaviours:ml([Dp.config({})])});return{type:"widget",data:{value:Qi("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[Oy.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:Bw(o).concat(r.asSpec()),behaviours:ml([Fp("insert-table-picker",[Hi((e=>{Dp.set(r.get(e),[n])})),Fi(Ow,((e,t,n)=>{const{row:i,col:s}=n.event;((e,t,o,n,r)=>{for(let n=0;n<10;n++)for(let r=0;r<10;r++)Xp.set(e[n][r],n<=t&&r<=o)})(o,i,s),Dp.set(r.get(e),[Pw(i+1,s+1)])})),Fi(Aw,((t,o,n)=>{const{row:r,col:i}=n.event;e.onAction({numRows:r+1,numColumns:i+1}),ki(t,ai())}))]),Ep.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:(e,t)=>{const o=((e,t)=>{const o=e.initData.allowCustomColors&&t.colorinput.hasCustomColors();return e.initData.colors.fold((()=>yw(t.colorinput.getColors(e.initData.storageKey),e.initData.storageKey,o)),(e=>e.concat(vw(o))))})(e,t),n=t.colorinput.getColorCols(e.initData.storageKey),r="color",i={...Sw(Qi("menu-value"),o,(t=>{e.onAction({value:t})}),n,r,Kf.CLOSE_ON_EXECUTE,T,t.shared.providers),markers:hv(r),movement:Ew(n,r)};return{type:"widget",data:{value:Qi("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[Oy.widget(vg.sketch(i))]}}},Vw=e=>({type:"separator",dom:{tag:"div",classes:[Qf,"tox-collection__group-heading"]},components:e.text.map($s).toArray()});var Nw=Object.freeze({__proto__:null,getCoupled:(e,t,o,n)=>o.getOrCreate(e,t,n),getExistingCoupled:(e,t,o,n)=>o.getExisting(e,t,n)}),Dw=[Yn("others",Ln(Ko.value,An()))],Fw=Object.freeze({__proto__:null,init:()=>{const e={},t=(t,o)=>{if(0===se(t.others).length)throw new Error("Cannot find any known coupled components");return ve(e,o)},o=y({});return vs({readState:o,getExisting:(e,o,n)=>t(o,n).orThunk((()=>(ve(o.others,n).getOrDie("No information found for coupled component: "+n),A.none()))),getOrCreate:(o,n,r)=>t(n,r).getOrThunk((()=>{const t=ve(n.others,r).getOrDie("No information found for coupled component: "+r)(o),i=o.getSystem().build(t);return e[r]=i,i}))})}});const Iw=gl({fields:Dw,name:"coupling",apis:Nw,state:Fw}),Lw=e=>{let t=A.none(),o=[];const n=e=>{r()?i(e):o.push(e)},r=()=>t.isSome(),i=e=>{t.each((t=>{setTimeout((()=>{e(t)}),0)}))};return e((e=>{r()||(t=A.some(e),z(o,i),o=[])})),{get:n,map:e=>Lw((t=>{n((o=>{t(e(o))}))})),isReady:r}},zw={nu:Lw,pure:e=>Lw((t=>{t(e)}))},Hw=e=>{setTimeout((()=>{throw e}),0)},Zw=e=>{const t=t=>{e().then(t,Hw)};return{map:t=>Zw((()=>e().then(t))),bind:t=>Zw((()=>e().then((e=>t(e).toPromise())))),anonBind:t=>Zw((()=>e().then((()=>t.toPromise())))),toLazy:()=>zw.nu(t),toCached:()=>{let t=null;return Zw((()=>(null===t&&(t=e()),t)))},toPromise:e,get:t}},jw=e=>Zw((()=>new Promise(e))),Uw=e=>Zw((()=>Promise.resolve(e))),$w=y("sink"),Ww=y(Pu({name:$w(),overrides:y({dom:{tag:"div"},behaviours:ml([ud.config({useFixed:E})]),events:Mi([Ii(Zr()),Ii(Nr()),Ii(Wr())])})})),qw=(e,t)=>{const o=e.getHotspot(t).getOr(t),n="hotspot",r=e.getAnchorOverrides();return e.layouts.fold((()=>({type:n,hotspot:o,overrides:r})),(e=>({type:n,hotspot:o,overrides:r,layouts:e})))},Gw=(e,t,o,n,r,i,s)=>{const a=((e,t,o,n,r,i,s)=>{const a=((e,t,o)=>(0,e.fetch)(o).map(t))(e,t,n),l=Kw(n,e);return a.map((e=>e.bind((e=>A.from(Tg.sketch({...i.menu(),uid:ss(""),data:e,highlightOnOpen:s,onOpenMenu:(e,t)=>{const n=l().getOrDie();ud.position(n,t,{anchor:o}),Dd.decloak(r)},onOpenSubmenu:(e,t,o)=>{const n=l().getOrDie();ud.position(n,o,{anchor:{type:"submenu",item:t}}),Dd.decloak(r)},onRepositionMenu:(e,t,n)=>{const r=l().getOrDie();ud.position(r,t,{anchor:o}),z(n,(e=>{ud.position(r,e.triggeredMenu,{anchor:{type:"submenu",item:e.triggeringItem}})}))},onEscape:()=>(Zp.focus(n),Dd.close(r),A.some(!0))}))))))})(e,t,qw(e,o),o,n,r,s);return a.map((e=>(e.fold((()=>{Dd.isOpen(n)&&Dd.close(n)}),(e=>{Dd.cloak(n),Dd.open(n,e),i(n)})),n)))},Yw=(e,t,o,n,r,i,s)=>(Dd.close(n),Uw(n)),Xw=(e,t,o,n,r,i)=>{const s=Iw.getCoupled(o,"sandbox");return(Dd.isOpen(s)?Yw:Gw)(e,t,o,s,n,r,i)},Kw=(e,t)=>e.getSystem().getByUid(t.uid+"-"+$w()).map((e=>()=>Ko.value(e))).getOrThunk((()=>t.lazySink.fold((()=>()=>Ko.error(new Error("No internal sink is specified, nor could an external sink be found"))),(t=>()=>t(e))))),Jw=e=>{Dd.getState(e).each((e=>{Tg.repositionMenus(e)}))},Qw=(e,t,o)=>{const n=aa(),r=Kw(t,e);return{dom:{tag:"div",classes:e.sandboxClasses,attributes:{id:n.id,role:"listbox"}},behaviours:au(e.sandboxBehaviours,[ou.config({store:{mode:"memory",initialValue:t}}),Dd.config({onOpen:(r,i)=>{const s=qw(e,t);n.link(t.element),e.matchWidth&&((e,t,o)=>{const n=ch.getCurrent(t).getOr(t),r=Wt(e.element);o?Tt(n.element,"min-width",r+"px"):((e,t)=>{$t.set(e,t)})(n.element,r)})(s.hotspot,i,e.useMinWidth),e.onOpen(s,r,i),void 0!==o&&void 0!==o.onOpen&&o.onOpen(r,i)},onClose:(e,r)=>{n.unlink(t.element),void 0!==o&&void 0!==o.onClose&&o.onClose(e,r)},isPartOf:(e,o,n)=>la(o,n)||la(t,n),getAttachPoint:()=>r().getOrDie()}),ch.config({find:e=>Dd.getState(e).bind((e=>ch.getCurrent(e)))}),yl.config({channels:{...Hd({isExtraPart:T}),...jd({doReposition:Jw})}})])}},e_=e=>{const t=Iw.getCoupled(e,"sandbox");Jw(t)},t_=()=>[ur("sandboxClasses",[]),su("sandboxBehaviours",[ch,yl,Dd,ou])],o_=y([Gn("dom"),Gn("fetch"),_a("onOpen"),xa("onExecute"),ur("getHotspot",A.some),ur("getAnchorOverrides",y({})),dc(),nu("dropdownBehaviours",[Xp,Iw,Ep,Zp]),Gn("toggleClass"),ur("eventOrder",{}),nr("lazySink"),ur("matchWidth",!1),ur("useMinWidth",!1),nr("role")].concat(t_())),n_=y([Bu({schema:[ba(),ur("fakeFocus",!1)],name:"menu",defaults:e=>({onExecute:e.onExecute})}),Ww()]),r_=ih({name:"Dropdown",configFields:o_(),partFields:n_(),factory:(e,t,o,n)=>{const r=e=>{Dd.getState(e).each((e=>{Tg.highlightPrimary(e)}))},i=(t,o,r)=>Xw(e,w,t,n,o,r),s={expand:e=>{Xp.isOn(e)||i(e,v,kg.HighlightNone).get(v)},open:e=>{Xp.isOn(e)||i(e,v,kg.HighlightMenuAndItem).get(v)},refetch:t=>Iw.getExistingCoupled(t,"sandbox").fold((()=>i(t,v,kg.HighlightMenuAndItem).map(v)),(o=>Gw(e,w,t,o,n,v,kg.HighlightMenuAndItem).map(v))),isOpen:Xp.isOn,close:e=>{Xp.isOn(e)&&i(e,v,kg.HighlightMenuAndItem).get(v)},repositionMenus:e=>{Xp.isOn(e)&&e_(e)}},a=(e,t)=>(Ti(e),A.some(!0));return{uid:e.uid,dom:e.dom,components:t,behaviours:iu(e.dropdownBehaviours,[Xp.config({toggleClass:e.toggleClass,aria:{mode:"expanded"}}),Iw.config({others:{sandbox:t=>Qw(e,t,{onOpen:()=>Xp.on(t),onClose:()=>Xp.off(t)})}}),Ep.config({mode:"special",onSpace:a,onEnter:a,onDown:(e,t)=>{if(r_.isOpen(e)){const t=Iw.getCoupled(e,"sandbox");r(t)}else r_.open(e);return A.some(!0)},onEscape:(e,t)=>r_.isOpen(e)?(r_.close(e),A.some(!0)):A.none()}),Zp.config({})]),events:Jp(A.some((e=>{i(e,r,kg.HighlightMenuAndItem).get(v)}))),eventOrder:{...e.eventOrder,[ni()]:["disabling","toggling","alloy.base.behaviour"]},apis:s,domModification:{attributes:{"aria-haspopup":"true",...e.role.fold((()=>({})),(e=>({role:e}))),..."button"===e.dom.tag?{type:("type",ve(e.dom,"attributes").bind((e=>ve(e,"type")))).getOr("button")}:{}}}}},apis:{open:(e,t)=>e.open(t),refetch:(e,t)=>e.refetch(t),expand:(e,t)=>e.expand(t),close:(e,t)=>e.close(t),isOpen:(e,t)=>e.isOpen(t),repositionMenus:(e,t)=>e.repositionMenus(t)}}),i_=(e,t,o)=>{Sv(e).each((e=>{var n;((e,t)=>{_t(t.element,"id").each((t=>bt(e.element,"aria-activedescendant",t)))})(e,o),(Rs((n=t).element,Ov)?A.some(n.element):ra(n.element,"."+Ov)).each((t=>{_t(t,"id").each((t=>bt(e.element,"aria-controls",t)))}))})),bt(o.element,"aria-selected","true")},s_=(e,t,o)=>{bt(o.element,"aria-selected","false")},a_=e=>Iw.getExistingCoupled(e,"sandbox").bind(kv).map(Tv).map((e=>e.fetchPattern)).getOr("");var l_;!function(e){e[e.ContentFocus=0]="ContentFocus",e[e.UiFocus=1]="UiFocus"}(l_||(l_={}));const c_=(e,t,o,n,r)=>{const i=o.shared.providers,s=e=>r?{...e,shortcut:A.none(),icon:e.text.isSome()?A.none():e.icon}:e;switch(e.type){case"menuitem":return(a=e,zn("menuitem",Hb,a)).fold(Nv,(e=>A.some(((e,t,o,n=!0)=>{const r=ky({presets:"normal",iconContent:e.icon,textContent:e.text,htmlContent:A.none(),ariaLabel:e.text,caret:A.none(),checkMark:A.none(),shortcutContent:e.shortcut},o,n);return py({data:gy(e),getApi:e=>({isEnabled:()=>!Ch.isDisabled(e),setEnabled:t=>Ch.set(e,!t)}),enabled:e.enabled,onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,t,o)})(s(e),t,i,n))));case"nestedmenuitem":return(e=>zn("nestedmenuitem",Zb,e))(e).fold(Nv,(e=>A.some(((e,t,o,n=!0,r=!1)=>{const i=r?(s=o.icons,vy("chevron-down",s,[iv])):(e=>vy("chevron-right",e,[iv]))(o.icons);var s;const a=ky({presets:"normal",iconContent:e.icon,textContent:e.text,htmlContent:A.none(),ariaLabel:e.text,caret:A.some(i),checkMark:A.none(),shortcutContent:e.shortcut},o,n);return py({data:gy(e),getApi:e=>({isEnabled:()=>!Ch.isDisabled(e),setEnabled:t=>Ch.set(e,!t)}),enabled:e.enabled,onAction:v,onSetup:e.onSetup,triggersSubmenu:!0,itemBehaviours:[]},a,t,o)})(s(e),t,i,n,r))));case"togglemenuitem":return(e=>zn("togglemenuitem",jb,e))(e).fold(Nv,(e=>A.some(((e,t,o,n=!0)=>{const r=ky({iconContent:e.icon,textContent:e.text,htmlContent:A.none(),ariaLabel:e.text,checkMark:A.some(xy(o.icons)),caret:A.none(),shortcutContent:e.shortcut,presets:"normal",meta:e.meta},o,n);return cn(py({data:gy(e),enabled:e.enabled,getApi:e=>({setActive:t=>{Xp.set(e,t)},isActive:()=>Xp.isOn(e),isEnabled:()=>!Ch.isDisabled(e),setEnabled:t=>Ch.set(e,!t)}),onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,t,o),{toggling:{toggleClass:ov,toggleOnExecute:!1,selected:e.active}})})(s(e),t,i,n))));case"separator":return(e=>zn("separatormenuitem",hb,e))(e).fold(Nv,(e=>A.some(Vw(e))));case"fancymenuitem":return(e=>zn("fancymenuitem",zb,e))(e).fold(Nv,(e=>((e,t)=>ve(Rw,e.fancytype).map((o=>o(e,t))))(e,o)));default:return console.error("Unknown item in general menu",e),A.none()}var a},d_=(e,t,o,n,r,i,s)=>{const a=1===n,l=!a||Vv(e);return _e(L(e,(e=>{switch(e.type){case"separator":return(n=e,zn("Autocompleter.Separator",hb,n)).fold(Nv,(e=>A.some(Vw(e))));case"cardmenuitem":return(e=>zn("cardmenuitem",Nb,e))(e).fold(Nv,(e=>A.some(((e,t,o,n)=>{const r={dom:Cy(e.label),optComponents:[A.some({dom:{tag:"div",classes:[av,lv]},components:Ey(e.items,n)})]};return py({data:gy({text:A.none(),...e}),enabled:e.enabled,getApi:e=>({isEnabled:()=>!Ch.isDisabled(e),setEnabled:t=>{Ch.set(e,!t),z(Dc(e.element,"*"),(o=>{e.getSystem().getByDom(o).each((e=>{e.hasConfigured(Ch)&&Ch.set(e,!t)}))}))}}),onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:!1,itemBehaviours:A.from(n.itemBehaviours).getOr([])},r,t,o.providers)})({...e,onAction:t=>{e.onAction(t),o(e.value,e.meta)}},r,i,{itemBehaviours:Sy(e.meta,i),cardText:{matchText:t,highlightOn:s}}))));default:return(e=>zn("Autocompleter.Item",mb,e))(e).fold(Nv,(e=>A.some(((e,t,o,n,r,i,s,a=!0)=>{const l=ky({presets:n,textContent:A.none(),htmlContent:o?e.text.map((e=>Ty(e,t))):A.none(),ariaLabel:e.text,iconContent:e.icon,shortcutContent:A.none(),checkMark:A.none(),caret:A.none(),value:e.value},s.providers,a,e.icon);return py({data:gy(e),enabled:e.enabled,getApi:y({}),onAction:t=>r(e.value,e.meta),onSetup:y(v),triggersSubmenu:!1,itemBehaviours:Sy(e.meta,s)},l,i,s.providers)})(e,t,a,"normal",o,r,i,l))))}var n})))},u_=(e,t,o,n,r,i)=>{const s=Vv(t),a=_e(L(t,(e=>{const t=e=>c_(e,o,n,(e=>r?!be(e,"text"):s)(e),r);return"nestedmenuitem"===e.type&&e.getSubmenuItems().length<=0?t({...e,enabled:!1}):t(e)}))),l=(e=>"no-search"===e.searchMode?{menuType:"normal"}:{menuType:"searchable",searchMode:e})(i);return(r?Dv:Fv)(e,s,a,1,l)},h_=e=>Tg.singleData(e.value,e),m_=(e,t)=>{const o=wr(!1),n=wr(!1),r=Ys(Eg.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:ml([Fp("dismissAutocompleter",[Ri(fi(),(()=>c()))])]),lazySink:t.getSink})),i=()=>Eg.isOpen(r),s=n.get,a=()=>{i()&&Eg.hide(r)},l=()=>Eg.getContent(r).bind((e=>te(e.components(),0))),c=()=>e.execCommand("mceAutocompleterClose"),d=n=>{const i=(n=>{const r=ie(n,(e=>A.from(e.columns))).getOr(1);return G(n,(n=>{const i=n.items;return d_(i,n.matchText,((t,r)=>{const i=e.selection.getRng();((e,t)=>Yf(Ve(t.startContainer)).map((t=>{const o=e.createRng();return o.selectNode(t.dom),o})))(e.dom,i).each((i=>{const s={hide:()=>c(),reload:t=>{a(),e.execCommand("mceAutocompleterReload",!1,{fetchOptions:t})}};o.set(!0),n.onAction(s,i,t,r),o.set(!1)}))}),r,Kf.BUBBLE_TO_SANDBOX,t,n.highlightOn)}))})(n);i.length>0?((t,o)=>{var n;(n=Ve(e.getBody()),ra(n,Gf)).each((n=>{const i=ie(t,(e=>A.from(e.columns))).getOr(1);Eg.showMenuAt(r,{anchor:{type:"node",root:Ve(e.getBody()),node:A.from(n)}},((e,t,o,n)=>{const r=Ew(t,n),i=hv(n);return{data:h_({...e,movement:r,menuBehaviours:$b("auto"!==t?[]:[Hi(((e,t)=>{Ub(e,4,i.item).each((({numColumns:t,numRows:o})=>{Ep.setGridSize(e,o,t)}))}))])}),menu:{markers:hv(n),fakeFocus:o===l_.ContentFocus}}})(Fv("autocompleter-value",!0,o,i,{menuType:"normal"}),i,l_.ContentFocus,"normal"))})),l().each(Rh.highlightFirst)})(n,i):a()};e.on("AutocompleterStart",(({lookupData:e})=>{n.set(!0),o.set(!1),d(e)})),e.on("AutocompleterUpdate",(({lookupData:e})=>d(e))),e.on("AutocompleterEnd",(()=>{a(),n.set(!1),o.set(!1)}));((e,t)=>{const o=(e,t)=>{Si(e,Zr(),{raw:t})},n=()=>e.getMenu().bind(Rh.getHighlighted);t.on("keydown",(t=>{const r=t.which;e.isActive()&&(e.isMenuOpen()?13===r?(n().each(Ti),t.preventDefault()):40===r?(n().fold((()=>{e.getMenu().each(Rh.highlightFirst)}),(e=>{o(e,t)})),t.preventDefault(),t.stopImmediatePropagation()):37!==r&&38!==r&&39!==r||n().each((e=>{o(e,t),t.preventDefault(),t.stopImmediatePropagation()})):13!==r&&38!==r&&40!==r||e.cancelIfNecessary())})),t.on("NodeChange",(t=>{e.isActive()&&!e.isProcessingAction()&&Yf(Ve(t.element)).isNone()&&e.cancelIfNecessary()}))})({cancelIfNecessary:c,isMenuOpen:i,isActive:s,isProcessingAction:o.get,getMenu:l},e)},p_=(e,t,o)=>ia(e,t,o).isSome(),g_=(e,t)=>{let o=null;return{cancel:()=>{null!==o&&(clearTimeout(o),o=null)},schedule:(...n)=>{o=setTimeout((()=>{e.apply(null,n),o=null}),t)}}},f_=e=>{const t=e.raw;return void 0===t.touches||1!==t.touches.length?A.none():A.some(t.touches[0])},v_=(e,t)=>{const o={stopBackspace:!0,...t},n=(e=>{const t=Zl(),o=wr(!1),n=g_((t=>{e.triggerEvent(si(),t),o.set(!0)}),400),r=Cr([{key:Br(),value:e=>(f_(e).each((r=>{n.cancel();const i={x:r.clientX,y:r.clientY,target:e.target};n.schedule(e),o.set(!1),t.set(i)})),A.none())},{key:Pr(),value:e=>(n.cancel(),f_(e).each((e=>{t.on((o=>{((e,t)=>{const o=Math.abs(e.clientX-t.x),n=Math.abs(e.clientY-t.y);return o>5||n>5})(e,o)&&t.clear()}))})),A.none())},{key:Rr(),value:r=>(n.cancel(),t.get().filter((e=>Ge(e.target,r.target))).map((t=>o.get()?(r.prevent(),!1):e.triggerEvent(ii(),r))))}]);return{fireIfReady:(e,t)=>ve(r,t).bind((t=>t(e)))}})(o),r=L(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(t=>Ul(e,t,(e=>{n.fireIfReady(e,t).each((t=>{t&&e.kill()})),o.triggerEvent(t,e)&&e.kill()})))),i=Zl(),s=Ul(e,"paste",(e=>{n.fireIfReady(e,"paste").each((t=>{t&&e.kill()})),o.triggerEvent("paste",e)&&e.kill(),i.set(setTimeout((()=>{o.triggerEvent(ti(),e)}),0))})),a=Ul(e,"keydown",(e=>{o.triggerEvent("keydown",e)?e.kill():o.stopBackspace&&(e=>e.raw.which===Vh[0]&&!N(["input","textarea"],Le(e.target))&&!p_(e.target,'[contenteditable="true"]'))(e)&&e.prevent()})),l=Ul(e,"focusin",(e=>{o.triggerEvent("focusin",e)&&e.kill()})),c=Zl(),d=Ul(e,"focusout",(e=>{o.triggerEvent("focusout",e)&&e.kill(),c.set(setTimeout((()=>{o.triggerEvent(ei(),e)}),0))}));return{unbind:()=>{z(r,(e=>{e.unbind()})),a.unbind(),l.unbind(),d.unbind(),s.unbind(),i.on(clearTimeout),c.on(clearTimeout)}}},b_=(e,t)=>{const o=ve(e,"target").getOr(t);return wr(o)},y_=_r([{stopped:[]},{resume:["element"]},{complete:[]}]),w_=(e,t,o,n,r,i)=>{const s=e(t,n),a=((e,t)=>{const o=wr(!1),n=wr(!1);return{stop:()=>{o.set(!0)},cut:()=>{n.set(!0)},isStopped:o.get,isCut:n.get,event:e,setSource:t.set,getSource:t.get}})(o,r);return s.fold((()=>(i.logEventNoHandlers(t,n),y_.complete())),(e=>{const o=e.descHandler;return ws(o)(a),a.isStopped()?(i.logEventStopped(t,e.element,o.purpose),y_.stopped()):a.isCut()?(i.logEventCut(t,e.element,o.purpose),y_.complete()):et(e.element).fold((()=>(i.logNoParent(t,e.element,o.purpose),y_.complete())),(n=>(i.logEventResponse(t,e.element,o.purpose),y_.resume(n))))}))},__=(e,t,o,n,r,i)=>w_(e,t,o,n,r,i).fold(E,(n=>__(e,t,o,n,r,i)),T),x_=(e,t,o,n,r)=>{const i=b_(o,n);return __(e,t,o,n,i,r)},C_=()=>{const e=(()=>{const e={};return{registerId:(t,o,n)=>{le(n,((n,r)=>{const i=void 0!==e[r]?e[r]:{};i[o]=((e,t)=>({cHandler:x.apply(void 0,[e.handler].concat(t)),purpose:e.purpose}))(n,t),e[r]=i}))},unregisterId:t=>{le(e,((e,o)=>{be(e,t)&&delete e[t]}))},filterByType:t=>ve(e,t).map((e=>pe(e,((e,t)=>((e,t)=>({id:e,descHandler:t}))(t,e))))).getOr([]),find:(t,o,n)=>ve(e,o).bind((e=>Tr(n,(t=>((e,t)=>is(t).bind((t=>ve(e,t))).map((e=>((e,t)=>({element:e,descHandler:t}))(t,e))))(e,t)),t)))}})(),t={},o=o=>{is(o.element).each((o=>{delete t[o],e.unregisterId(o)}))};return{find:(t,o,n)=>e.find(t,o,n),filter:t=>e.filterByType(t),register:n=>{const r=(e=>{const t=e.element;return is(t).getOrThunk((()=>((e,t)=>{const o=Qi(os+"uid-");return rs(t,o),o})(0,e.element)))})(n);ye(t,r)&&((e,n)=>{const r=t[n];if(r!==e)throw new Error('The tagId "'+n+'" is already used by: '+Gi(r.element)+"\nCannot use it for: "+Gi(e.element)+"\nThe conflicting element is"+(pt(r.element)?" ":" not ")+"already in the DOM");o(e)})(n,r);const i=[n];e.registerId(i,r,n.events),t[r]=n},unregister:o,getById:e=>ve(t,e)}},k_=rh({name:"Container",factory:e=>{const{attributes:t,...o}=e.dom;return{uid:e.uid,dom:{tag:"div",attributes:{role:"presentation",...t},...o},components:e.components,behaviours:ru(e.containerBehaviours),events:e.events,domModification:e.domModification,eventOrder:e.eventOrder}},configFields:[ur("components",[]),nu("containerBehaviours",[]),ur("events",{}),ur("domModification",{}),ur("eventOrder",{})]}),S_=e=>{const t=t=>et(e.element).fold(E,(e=>Ge(t,e))),o=C_(),n=(e,n)=>o.find(t,e,n),r=v_(e.element,{triggerEvent:(e,t)=>ha(e,t.target,(o=>((e,t,o,n)=>x_(e,t,o,o.target,n))(n,e,t,o)))}),i={debugInfo:y("real"),triggerEvent:(e,t,o)=>{ha(e,t,(r=>x_(n,e,o,t,r)))},triggerFocus:(e,t)=>{is(e).fold((()=>{_l(e)}),(o=>{ha(Qr(),e,(o=>(((e,t,o,n,r)=>{const i=b_(o,n);w_(e,t,o,n,i,r)})(n,Qr(),{originator:t,kill:v,prevent:v,target:e},e,o),!1)))}))},triggerEscape:(e,t)=>{i.triggerEvent("keydown",e.element,t.event)},getByUid:e=>p(e),getByDom:e=>g(e),build:Ys,buildOrPatch:Gs,addToGui:e=>{l(e)},removeFromGui:e=>{c(e)},addToWorld:e=>{s(e)},removeFromWorld:e=>{a(e)},broadcast:e=>{u(e)},broadcastOn:(e,t)=>{h(e,t)},broadcastEvent:(e,t)=>{m(e,t)},isConnected:E},s=e=>{e.connect(i),Ze(e.element)||(o.register(e),z(e.components(),s),i.triggerEvent(ci(),e.element,{target:e.element}))},a=e=>{Ze(e.element)||(z(e.components(),a),o.unregister(e)),e.disconnect()},l=t=>{bd(e,t)},c=e=>{_d(e)},d=e=>{const t=o.filter(oi());z(t,(t=>{const o=t.descHandler;ws(o)(e)}))},u=e=>{d({universal:!0,data:e})},h=(e,t)=>{d({universal:!1,channels:e,data:t})},m=(e,t)=>((e,t,o)=>{const n=(e=>{const t=wr(!1);return{stop:()=>{t.set(!0)},cut:v,isStopped:t.get,isCut:T,event:e,setSource:k("Cannot set source of a broadcasted event"),getSource:k("Cannot get source of a broadcasted event")}})(t);return z(e,(e=>{const t=e.descHandler;ws(t)(n)})),n.isStopped()})(o.filter(e),t),p=e=>o.getById(e).fold((()=>Ko.error(new Error('Could not find component with uid: "'+e+'" in system.'))),Ko.value),g=e=>{const t=is(e).getOr("not found");return p(t)};return s(e),{root:e,element:e.element,destroy:()=>{r.unbind(),Do(e.element)},add:l,remove:c,getByUid:p,getByDom:g,addToWorld:s,removeFromWorld:a,broadcast:u,broadcastOn:h,broadcastEvent:m}},T_=y([ur("prefix","form-field"),nu("fieldBehaviours",[ch,ou])]),E_=y([Pu({schema:[Gn("dom")],name:"label"}),Pu({factory:{sketch:e=>({uid:e.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:e.text}})},schema:[Gn("text")],name:"aria-descriptor"}),Mu({factory:{sketch:e=>{const t=((e,t)=>{const o={};return le(e,((e,n)=>{N(t,n)||(o[n]=e)})),o})(e,["factory"]);return e.factory.sketch(t)}},schema:[Gn("factory")],name:"field"})]),O_=ih({name:"FormField",configFields:T_(),partFields:E_(),factory:(e,t,o,n)=>{const r=iu(e.fieldBehaviours,[ch.config({find:t=>Uu(t,e,"field")}),ou.config({store:{mode:"manual",getValue:e=>ch.getCurrent(e).bind(ou.getValue),setValue:(e,t)=>{ch.getCurrent(e).each((e=>{ou.setValue(e,t)}))}}})]),i=Mi([Hi(((t,o)=>{const n=Wu(t,e,["label","field","aria-descriptor"]);n.field().each((t=>{const o=Qi(e.prefix);n.label().each((e=>{bt(e.element,"for",o),bt(t.element,"id",o)})),n["aria-descriptor"]().each((o=>{const n=Qi(e.prefix);bt(o.element,"id",n),bt(t.element,"aria-describedby",n)}))}))}))]),s={getField:t=>Uu(t,e,"field"),getLabel:t=>Uu(t,e,"label")};return{uid:e.uid,dom:e.dom,components:t,behaviours:r,events:i,apis:s}},apis:{getField:(e,t)=>e.getField(t),getLabel:(e,t)=>e.getLabel(t)}});var A_=Object.freeze({__proto__:null,exhibit:(e,t)=>ys({attributes:Cr([{key:t.tabAttr,value:"true"}])})}),M_=[ur("tabAttr","data-alloy-tabstop")];const B_=gl({fields:M_,name:"tabstopping",active:A_});var P_=window.mailpoetTinymce.util.Tools.resolve("mailpoetTinymce.html.Entities");const R_=(e,t,o,n)=>{const r=V_(e,t,o,n);return O_.sketch(r)},V_=(e,t,o,n)=>({dom:N_(o),components:e.toArray().concat([t]),fieldBehaviours:ml(n)}),N_=e=>({tag:"div",classes:["tox-form__group"].concat(e)}),D_=(e,t)=>O_.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[$s(t.translate(e))]}),F_=Qi("form-component-change"),I_=Qi("form-close"),L_=Qi("form-cancel"),z_=Qi("form-action"),H_=Qi("form-submit"),Z_=Qi("form-block"),j_=Qi("form-unblock"),U_=Qi("form-tabchange"),$_=Qi("form-resize"),W_=["input","textarea"],q_=e=>{const t=Le(e);return N(W_,t)},G_=(e,t)=>{const o=t.getRoot(e).getOr(e.element);Ps(o,t.invalidClass),t.notify.each((t=>{q_(e.element)&&bt(e.element,"aria-invalid",!1),t.getContainer(e).each((e=>{Wi(e,t.validHtml)})),t.onValid(e)}))},Y_=(e,t,o,n)=>{const r=t.getRoot(e).getOr(e.element);Bs(r,t.invalidClass),t.notify.each((t=>{q_(e.element)&&bt(e.element,"aria-invalid",!0),t.getContainer(e).each((e=>{Wi(e,n)})),t.onInvalid(e,n)}))},X_=(e,t,o)=>t.validator.fold((()=>Uw(Ko.value(!0))),(t=>t.validate(e))),K_=(e,t,o)=>(t.notify.each((t=>{t.onValidate(e)})),X_(e,t).map((o=>e.getSystem().isConnected()?o.fold((o=>(Y_(e,t,0,o),Ko.error(o))),(o=>(G_(e,t),Ko.value(o)))):Ko.error("No longer in system"))));var J_=Object.freeze({__proto__:null,markValid:G_,markInvalid:Y_,query:X_,run:K_,isInvalid:(e,t)=>{const o=t.getRoot(e).getOr(e.element);return Rs(o,t.invalidClass)}}),Q_=Object.freeze({__proto__:null,events:(e,t)=>e.validator.map((t=>Mi([Ri(t.onEvent,(t=>{K_(t,e).get(w)}))].concat(t.validateOnLoad?[Hi((t=>{K_(t,e).get(v)}))]:[])))).getOr({})}),ex=[Gn("invalidClass"),ur("getRoot",A.none),dr("notify",[ur("aria","alert"),ur("getContainer",A.none),ur("validHtml",""),_a("onValid"),_a("onInvalid"),_a("onValidate")]),dr("validator",[Gn("validate"),ur("onEvent","input"),ur("validateOnLoad",!0)])];const tx=gl({fields:ex,name:"invalidating",active:Q_,apis:J_,extra:{validation:e=>t=>{const o=ou.getValue(t);return Uw(e(o))}}}),ox=gl({fields:[],name:"unselecting",active:Object.freeze({__proto__:null,events:()=>Mi([Bi(Xr(),E)]),exhibit:()=>ys({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})})}),nx=Qi("color-input-change"),rx=Qi("color-swatch-change"),ix=Qi("color-picker-cancel"),sx=Pu({schema:[Gn("dom")],name:"label"}),ax=e=>Pu({name:e+"-edge",overrides:t=>t.model.manager.edgeActions[e].fold((()=>({})),(e=>({events:Mi([Vi(Br(),((t,o,n)=>e(t,n)),[t]),Vi(Nr(),((t,o,n)=>e(t,n)),[t]),Vi(Dr(),((t,o,n)=>{n.mouseIsDown.get()&&e(t,n)}),[t])])})))}),lx=ax("top-left"),cx=ax("top"),dx=ax("top-right"),ux=ax("right"),hx=ax("bottom-right"),mx=ax("bottom"),px=ax("bottom-left");var gx=[sx,ax("left"),ux,cx,mx,lx,dx,px,hx,Mu({name:"thumb",defaults:y({dom:{styles:{position:"absolute"}}}),overrides:e=>({events:Mi([Di(Br(),e,"spectrum"),Di(Pr(),e,"spectrum"),Di(Rr(),e,"spectrum"),Di(Nr(),e,"spectrum"),Di(Dr(),e,"spectrum"),Di(Ir(),e,"spectrum")])})}),Mu({schema:[Wn("mouseIsDown",(()=>wr(!1)))],name:"spectrum",overrides:e=>{const t=e.model.manager,o=(o,n)=>t.getValueFromEvent(n).map((n=>t.setValueFrom(o,e,n)));return{behaviours:ml([Ep.config({mode:"special",onLeft:o=>t.onLeft(o,e),onRight:o=>t.onRight(o,e),onUp:o=>t.onUp(o,e),onDown:o=>t.onDown(o,e)}),Zp.config({})]),events:Mi([Ri(Br(),o),Ri(Pr(),o),Ri(Nr(),o),Ri(Dr(),((t,n)=>{e.mouseIsDown.get()&&o(t,n)}))])}}})];const fx=y("slider.change.value"),vx=e=>{const t=e.event.raw;if((e=>-1!==e.type.indexOf("touch"))(t)){const e=t;return void 0!==e.touches&&1===e.touches.length?A.some(e.touches[0]).map((e=>Ht(e.clientX,e.clientY))):A.none()}{const e=t;return void 0!==e.clientX?A.some(e).map((e=>Ht(e.clientX,e.clientY))):A.none()}},bx=e=>e.model.minX,yx=e=>e.model.minY,wx=e=>e.model.minX-1,_x=e=>e.model.minY-1,xx=e=>e.model.maxX,Cx=e=>e.model.maxY,kx=e=>e.model.maxX+1,Sx=e=>e.model.maxY+1,Tx=(e,t,o)=>t(e)-o(e),Ex=e=>Tx(e,xx,bx),Ox=e=>Tx(e,Cx,yx),Ax=e=>Ex(e)/2,Mx=e=>Ox(e)/2,Bx=e=>e.stepSize,Px=e=>e.snapToGrid,Rx=e=>e.snapStart,Vx=e=>e.rounded,Nx=(e,t)=>void 0!==e[t+"-edge"],Dx=e=>Nx(e,"left"),Fx=e=>Nx(e,"right"),Ix=e=>Nx(e,"top"),Lx=e=>Nx(e,"bottom"),zx=e=>e.model.value.get(),Hx=(e,t)=>({x:e,y:t}),Zx=(e,t)=>{Si(e,fx(),{value:t})},jx=(e,t,o,n)=>e<t?e:e>o?o:e===t?t-1:Math.max(t,e-n),Ux=(e,t,o,n)=>e>o?e:e<t?t:e===o?o+1:Math.min(o,e+n),$x=(e,t,o)=>Math.max(t,Math.min(o,e)),Wx=e=>{const{min:t,max:o,range:n,value:r,step:i,snap:s,snapStart:a,rounded:l,hasMinEdge:c,hasMaxEdge:d,minBound:u,maxBound:h,screenRange:m}=e,p=c?t-1:t,g=d?o+1:o;if(r<u)return p;if(r>h)return g;{const e=((e,t,o)=>Math.min(o,Math.max(e,t))-t)(r,u,h),c=$x(e/m*n+t,p,g);return s&&c>=t&&c<=o?((e,t,o,n,r)=>r.fold((()=>{const r=e-t,i=Math.round(r/n)*n;return $x(t+i,t-1,o+1)}),(t=>{const r=(e-t)%n,i=Math.round(r/n),s=Math.floor((e-t)/n),a=Math.floor((o-t)/n),l=t+Math.min(a,s+i)*n;return Math.max(t,l)})))(c,t,o,i,a):l?Math.round(c):c}},qx=e=>{const{min:t,max:o,range:n,value:r,hasMinEdge:i,hasMaxEdge:s,maxBound:a,maxOffset:l,centerMinEdge:c,centerMaxEdge:d}=e;return r<t?i?0:c:r>o?s?a:d:(r-t)/n*l},Gx="top",Yx="right",Xx="bottom",Kx="left",Jx=e=>e.element.dom.getBoundingClientRect(),Qx=(e,t)=>e[t],eC=e=>{const t=Jx(e);return Qx(t,Kx)},tC=e=>{const t=Jx(e);return Qx(t,Yx)},oC=e=>{const t=Jx(e);return Qx(t,Gx)},nC=e=>{const t=Jx(e);return Qx(t,Xx)},rC=e=>{const t=Jx(e);return Qx(t,"width")},iC=e=>{const t=Jx(e);return Qx(t,"height")},sC=(e,t,o)=>(e+t)/2-o,aC=(e,t)=>{const o=Jx(e),n=Jx(t),r=Qx(o,Kx),i=Qx(o,Yx),s=Qx(n,Kx);return sC(r,i,s)},lC=(e,t)=>{const o=Jx(e),n=Jx(t),r=Qx(o,Gx),i=Qx(o,Xx),s=Qx(n,Gx);return sC(r,i,s)},cC=(e,t)=>{Si(e,fx(),{value:t})},dC=(e,t,o)=>{const n={min:bx(t),max:xx(t),range:Ex(t),value:o,step:Bx(t),snap:Px(t),snapStart:Rx(t),rounded:Vx(t),hasMinEdge:Dx(t),hasMaxEdge:Fx(t),minBound:eC(e),maxBound:tC(e),screenRange:rC(e)};return Wx(n)},uC=e=>(t,o)=>((e,t,o)=>{const n=(e>0?Ux:jx)(zx(o),bx(o),xx(o),Bx(o));return cC(t,n),A.some(n)})(e,t,o).map(E),hC=(e,t,o,n,r,i)=>{const s=((e,t,o,n,r)=>{const i=rC(e),s=n.bind((t=>A.some(aC(t,e)))).getOr(0),a=r.bind((t=>A.some(aC(t,e)))).getOr(i),l={min:bx(t),max:xx(t),range:Ex(t),value:o,hasMinEdge:Dx(t),hasMaxEdge:Fx(t),minBound:eC(e),minOffset:0,maxBound:tC(e),maxOffset:i,centerMinEdge:s,centerMaxEdge:a};return qx(l)})(t,i,o,n,r);return eC(t)-eC(e)+s},mC=uC(-1),pC=uC(1),gC=A.none,fC=A.none,vC={"top-left":A.none(),top:A.none(),"top-right":A.none(),right:A.some(((e,t)=>{Zx(e,kx(t))})),"bottom-right":A.none(),bottom:A.none(),"bottom-left":A.none(),left:A.some(((e,t)=>{Zx(e,wx(t))}))};var bC=Object.freeze({__proto__:null,setValueFrom:(e,t,o)=>{const n=dC(e,t,o);return cC(e,n),n},setToMin:(e,t)=>{const o=bx(t);cC(e,o)},setToMax:(e,t)=>{const o=xx(t);cC(e,o)},findValueOfOffset:dC,getValueFromEvent:e=>vx(e).map((e=>e.left)),findPositionOfValue:hC,setPositionFromValue:(e,t,o,n)=>{const r=zx(o),i=hC(e,n.getSpectrum(e),r,n.getLeftEdge(e),n.getRightEdge(e),o),s=Wt(t.element)/2;Tt(t.element,"left",i-s+"px")},onLeft:mC,onRight:pC,onUp:gC,onDown:fC,edgeActions:vC});const yC=(e,t)=>{Si(e,fx(),{value:t})},wC=(e,t,o)=>{const n={min:yx(t),max:Cx(t),range:Ox(t),value:o,step:Bx(t),snap:Px(t),snapStart:Rx(t),rounded:Vx(t),hasMinEdge:Ix(t),hasMaxEdge:Lx(t),minBound:oC(e),maxBound:nC(e),screenRange:iC(e)};return Wx(n)},_C=e=>(t,o)=>((e,t,o)=>{const n=(e>0?Ux:jx)(zx(o),yx(o),Cx(o),Bx(o));return yC(t,n),A.some(n)})(e,t,o).map(E),xC=(e,t,o,n,r,i)=>{const s=((e,t,o,n,r)=>{const i=iC(e),s=n.bind((t=>A.some(lC(t,e)))).getOr(0),a=r.bind((t=>A.some(lC(t,e)))).getOr(i),l={min:yx(t),max:Cx(t),range:Ox(t),value:o,hasMinEdge:Ix(t),hasMaxEdge:Lx(t),minBound:oC(e),minOffset:0,maxBound:nC(e),maxOffset:i,centerMinEdge:s,centerMaxEdge:a};return qx(l)})(t,i,o,n,r);return oC(t)-oC(e)+s},CC=A.none,kC=A.none,SC=_C(-1),TC=_C(1),EC={"top-left":A.none(),top:A.some(((e,t)=>{Zx(e,_x(t))})),"top-right":A.none(),right:A.none(),"bottom-right":A.none(),bottom:A.some(((e,t)=>{Zx(e,Sx(t))})),"bottom-left":A.none(),left:A.none()};var OC=Object.freeze({__proto__:null,setValueFrom:(e,t,o)=>{const n=wC(e,t,o);return yC(e,n),n},setToMin:(e,t)=>{const o=yx(t);yC(e,o)},setToMax:(e,t)=>{const o=Cx(t);yC(e,o)},findValueOfOffset:wC,getValueFromEvent:e=>vx(e).map((e=>e.top)),findPositionOfValue:xC,setPositionFromValue:(e,t,o,n)=>{const r=zx(o),i=xC(e,n.getSpectrum(e),r,n.getTopEdge(e),n.getBottomEdge(e),o),s=It(t.element)/2;Tt(t.element,"top",i-s+"px")},onLeft:CC,onRight:kC,onUp:SC,onDown:TC,edgeActions:EC});const AC=(e,t)=>{Si(e,fx(),{value:t})},MC=(e,t)=>({x:e,y:t}),BC=(e,t)=>(o,n)=>((e,t,o,n)=>{const r=e>0?Ux:jx,i=t?zx(n).x:r(zx(n).x,bx(n),xx(n),Bx(n)),s=t?r(zx(n).y,yx(n),Cx(n),Bx(n)):zx(n).y;return AC(o,MC(i,s)),A.some(i)})(e,t,o,n).map(E),PC=BC(-1,!1),RC=BC(1,!1),VC=BC(-1,!0),NC=BC(1,!0),DC={"top-left":A.some(((e,t)=>{Zx(e,Hx(wx(t),_x(t)))})),top:A.some(((e,t)=>{Zx(e,Hx(Ax(t),_x(t)))})),"top-right":A.some(((e,t)=>{Zx(e,Hx(kx(t),_x(t)))})),right:A.some(((e,t)=>{Zx(e,Hx(kx(t),Mx(t)))})),"bottom-right":A.some(((e,t)=>{Zx(e,Hx(kx(t),Sx(t)))})),bottom:A.some(((e,t)=>{Zx(e,Hx(Ax(t),Sx(t)))})),"bottom-left":A.some(((e,t)=>{Zx(e,Hx(wx(t),Sx(t)))})),left:A.some(((e,t)=>{Zx(e,Hx(wx(t),Mx(t)))}))};var FC=Object.freeze({__proto__:null,setValueFrom:(e,t,o)=>{const n=dC(e,t,o.left),r=wC(e,t,o.top),i=MC(n,r);return AC(e,i),i},setToMin:(e,t)=>{const o=bx(t),n=yx(t);AC(e,MC(o,n))},setToMax:(e,t)=>{const o=xx(t),n=Cx(t);AC(e,MC(o,n))},getValueFromEvent:e=>vx(e),setPositionFromValue:(e,t,o,n)=>{const r=zx(o),i=hC(e,n.getSpectrum(e),r.x,n.getLeftEdge(e),n.getRightEdge(e),o),s=xC(e,n.getSpectrum(e),r.y,n.getTopEdge(e),n.getBottomEdge(e),o),a=Wt(t.element)/2,l=It(t.element)/2;Tt(t.element,"left",i-a+"px"),Tt(t.element,"top",s-l+"px")},onLeft:PC,onRight:RC,onUp:VC,onDown:NC,edgeActions:DC});const IC=ih({name:"Slider",configFields:[ur("stepSize",1),ur("onChange",v),ur("onChoose",v),ur("onInit",v),ur("onDragStart",v),ur("onDragEnd",v),ur("snapToGrid",!1),ur("rounded",!0),nr("snapStart"),Yn("model",Un("mode",{x:[ur("minX",0),ur("maxX",100),Wn("value",(e=>wr(e.mode.minX))),Gn("getInitialValue"),Sa("manager",bC)],y:[ur("minY",0),ur("maxY",100),Wn("value",(e=>wr(e.mode.minY))),Gn("getInitialValue"),Sa("manager",OC)],xy:[ur("minX",0),ur("maxX",100),ur("minY",0),ur("maxY",100),Wn("value",(e=>wr({x:e.mode.minX,y:e.mode.minY}))),Gn("getInitialValue"),Sa("manager",FC)]})),nu("sliderBehaviours",[Ep,ou]),Wn("mouseIsDown",(()=>wr(!1)))],partFields:gx,factory:(e,t,o,n)=>{const r=t=>$u(t,e,"thumb"),i=t=>$u(t,e,"spectrum"),s=t=>Uu(t,e,"left-edge"),a=t=>Uu(t,e,"right-edge"),l=t=>Uu(t,e,"top-edge"),c=t=>Uu(t,e,"bottom-edge"),d=e.model,u=d.manager,h=(t,o)=>{u.setPositionFromValue(t,o,e,{getLeftEdge:s,getRightEdge:a,getTopEdge:l,getBottomEdge:c,getSpectrum:i})},m=(e,t)=>{d.value.set(t);const o=r(e);h(e,o)},p=t=>{const o=e.mouseIsDown.get();e.mouseIsDown.set(!1),o&&Uu(t,e,"thumb").each((o=>{const n=d.value.get();e.onChoose(t,o,n)}))},g=(t,o)=>{o.stop(),e.mouseIsDown.set(!0),e.onDragStart(t,r(t))},f=(t,o)=>{o.stop(),e.onDragEnd(t,r(t)),p(t)};return{uid:e.uid,dom:e.dom,components:t,behaviours:iu(e.sliderBehaviours,[Ep.config({mode:"special",focusIn:t=>Uu(t,e,"spectrum").map(Ep.focusIn).map(E)}),ou.config({store:{mode:"manual",getValue:e=>d.value.get(),setValue:m}}),yl.config({channels:{[Ld()]:{onReceive:p}}})]),events:Mi([Ri(fx(),((t,o)=>{((t,o)=>{m(t,o);const n=r(t);e.onChange(t,n,o),A.some(!0)})(t,o.event.value)})),Hi(((t,o)=>{const n=d.getInitialValue();d.value.set(n);const s=r(t);h(t,s);const a=i(t);e.onInit(t,s,a,d.value.get())})),Ri(Br(),g),Ri(Rr(),f),Ri(Nr(),g),Ri(Ir(),f)]),apis:{resetToMin:t=>{u.setToMin(t,e)},resetToMax:t=>{u.setToMax(t,e)},setValue:m,refresh:h},domModification:{styles:{position:"relative"}}}},apis:{setValue:(e,t,o)=>{e.setValue(t,o)},resetToMin:(e,t)=>{e.resetToMin(t)},resetToMax:(e,t)=>{e.resetToMax(t)},refresh:(e,t)=>{e.refresh(t)}}}),LC=Qi("rgb-hex-update"),zC=Qi("slider-update"),HC=Qi("palette-update"),ZC="form",jC=[nu("formBehaviours",[ou])],UC=e=>"<alloy.field."+e+">",$C=(e,t)=>({uid:e.uid,dom:e.dom,components:t,behaviours:iu(e.formBehaviours,[ou.config({store:{mode:"manual",getValue:t=>{const o=qu(t,e);return ce(o,((e,t)=>e().bind((e=>{return o=ch.getCurrent(e),n=new Error(`Cannot find a current component to extract the value from for form part '${t}': `+Gi(e.element)),o.fold((()=>Ko.error(n)),Ko.value);var o,n})).map(ou.getValue)))},setValue:(t,o)=>{le(o,((o,n)=>{Uu(t,e,n).each((e=>{ch.getCurrent(e).each((e=>{ou.setValue(e,o)}))}))}))}}})]),apis:{getField:(t,o)=>Uu(t,e,o).bind(ch.getCurrent)}}),WC={getField:gs(((e,t,o)=>e.getField(t,o))),sketch:e=>{const t=(()=>{const e=[];return{field:(t,o)=>(e.push(t),Lu(ZC,UC(t),o)),record:y(e)}})(),o=e(t),n=t.record(),r=L(n,(e=>Mu({name:e,pname:UC(e)})));return eh(ZC,jC,r,$C,o)}},qC=Qi("valid-input"),GC=Qi("invalid-input"),YC=Qi("validating-input"),XC="colorcustom.rgb.",KC=(e,t,o,n)=>{const r=(o,n)=>tx.config({invalidClass:t("invalid"),notify:{onValidate:e=>{Si(e,YC,{type:o})},onValid:e=>{Si(e,qC,{type:o,value:ou.getValue(e)})},onInvalid:e=>{Si(e,GC,{type:o,value:ou.getValue(e)})}},validator:{validate:t=>{const o=ou.getValue(t),r=n(o)?Ko.value(!0):Ko.error(e("aria.input.invalid"));return Uw(r)},validateOnLoad:!1}}),i=(o,n,i,s,a)=>{const l=e(XC+"range"),c=O_.parts.label({dom:{tag:"label",attributes:{"aria-label":s}},components:[$s(i)]}),d=O_.parts.field({data:a,factory:wv,inputAttributes:{type:"text",..."hex"===n?{"aria-live":"polite"}:{}},inputClasses:[t("textfield")],inputBehaviours:ml([r(n,o),B_.config({})]),onSetValue:e=>{tx.isInvalid(e)&&tx.run(e).get(v)}}),u=[c,d],h="hex"!==n?[O_.parts["aria-descriptor"]({text:l})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:u.concat(h)}},s=(e,t)=>{const o=t.red,n=t.green,r=t.blue;ou.setValue(e,{red:o,green:n,blue:r})},a=Mg({dom:{tag:"div",classes:[t("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),l=(e,t)=>{a.getOpt(e).each((e=>{Tt(e.element,"background-color","#"+t.value)}))},c=rh({factory:()=>{const r={red:wr(A.some(255)),green:wr(A.some(255)),blue:wr(A.some(255)),hex:wr(A.some("ffffff"))},c=e=>r[e].get(),d=(e,t)=>{r[e].set(t)},u=e=>{const t=e.red,o=e.green,n=e.blue;d("red",A.some(t)),d("green",A.some(o)),d("blue",A.some(n))},h=(e,t)=>{const o=t.event;"hex"!==o.type?d(o.type,A.none()):n(e)},m=(e,t)=>{const n=t.event;(e=>"hex"===e.type)(n)?((e,t)=>{o(e);const n=Ay(t);d("hex",A.some(t));const r=Uy(n);s(e,r),u(r),Si(e,LC,{hex:n}),l(e,n)})(e,n.value):((e,t,o)=>{const n=parseInt(o,10);d(t,A.some(n)),c("red").bind((e=>c("green").bind((t=>c("blue").map((o=>Hy(e,t,o,1))))))).each((t=>{const o=((e,t)=>{const o=Ny(t);return WC.getField(e,"hex").each((t=>{Zp.isFocused(t)||ou.setValue(e,{hex:o.value})})),o})(e,t);Si(e,LC,{hex:o}),l(e,o)}))})(e,n.type,n.value)},p=t=>({label:e(XC+t+".label"),description:e(XC+t+".description")}),g=p("red"),f=p("green"),v=p("blue"),b=p("hex");return cn(WC.sketch((o=>({dom:{tag:"form",classes:[t("rgb-form")],attributes:{"aria-label":e("aria.color.picker")}},components:[o.field("red",O_.sketch(i(Zy,"red",g.label,g.description,255))),o.field("green",O_.sketch(i(Zy,"green",f.label,f.description,255))),o.field("blue",O_.sketch(i(Zy,"blue",v.label,v.description,255))),o.field("hex",O_.sketch(i(Py,"hex",b.label,b.description,"ffffff"))),a.asSpec()],formBehaviours:ml([tx.config({invalidClass:t("form-invalid")}),Fp("rgb-form-events",[Ri(qC,m),Ri(GC,h),Ri(YC,h)])])}))),{apis:{updateHex:(e,t)=>{ou.setValue(e,{hex:t.value}),((e,t)=>{const o=Uy(t);s(e,o),u(o)})(e,t),l(e,t)}}})},name:"RgbForm",configFields:[],apis:{updateHex:(e,t,o)=>{e.updateHex(t,o)}},extraApis:{}});return c},JC=(e,t)=>{const o=rh({name:"ColourPicker",configFields:[Gn("dom"),ur("onValidHex",v),ur("onInvalidHex",v)],factory:o=>{const n=KC(e,t,o.onValidHex,o.onInvalidHex),r=((e,t)=>{const o=IC.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[t("sv-palette-spectrum")]}}),n=IC.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[t("sv-palette-thumb")],innerHtml:`<div class=${t("sv-palette-inner-thumb")} role="presentation"></div>`}}),r=(e,t)=>{const{width:o,height:n}=e,r=e.getContext("2d");if(null===r)return;r.fillStyle=t,r.fillRect(0,0,o,n);const i=r.createLinearGradient(0,0,o,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),r.fillStyle=i,r.fillRect(0,0,o,n);const s=r.createLinearGradient(0,0,0,n);s.addColorStop(0,"rgba(0,0,0,0)"),s.addColorStop(1,"rgba(0,0,0,1)"),r.fillStyle=s,r.fillRect(0,0,o,n)};return rh({factory:e=>{const i=y({x:0,y:0}),s=ml([ch.config({find:A.some}),Zp.config({})]);return IC.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[t("sv-palette")]},model:{mode:"xy",getInitialValue:i},rounded:!1,components:[o,n],onChange:(e,t,o)=>{Si(e,HC,{value:o})},onInit:(e,t,o,n)=>{r(o.element.dom,qy(Gy))},sliderBehaviours:s})},name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:(e,t,o)=>{((e,t)=>{const o=e.components()[0].element.dom,n=tw(t,100,100),i=jy(n);r(o,qy(i))})(t,o)},setThumb:(e,t,o)=>{((e,t)=>{const o=ow(Uy(t));IC.setValue(e,{x:o.saturation,y:100-o.value})})(t,o)}},extraApis:{}})})(0,t),i={paletteRgba:wr(Gy),paletteHue:wr(0)},s=Mg(((e,t)=>{const o=IC.parts.spectrum({dom:{tag:"div",classes:[t("hue-slider-spectrum")],attributes:{role:"presentation"}}}),n=IC.parts.thumb({dom:{tag:"div",classes:[t("hue-slider-thumb")],attributes:{role:"presentation"}}});return IC.sketch({dom:{tag:"div",classes:[t("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:y(0)},components:[o,n],sliderBehaviours:ml([Zp.config({})]),onChange:(e,t,o)=>{Si(e,zC,{value:o})}})})(0,t)),a=Mg(r.sketch({})),l=Mg(n.sketch({})),c=(e,t,o)=>{a.getOpt(e).each((e=>{r.setHue(e,o)}))},d=(e,t)=>{l.getOpt(e).each((e=>{n.updateHex(e,t)}))},u=(e,t,o)=>{s.getOpt(e).each((e=>{IC.setValue(e,(e=>100-e/360*100)(o))}))},h=(e,t)=>{a.getOpt(e).each((e=>{r.setThumb(e,t)}))},m=(e,t,o,n)=>{((e,t)=>{const o=Uy(e);i.paletteRgba.set(o),i.paletteHue.set(t)})(t,o),z(n,(n=>{n(e,t,o)}))};return{uid:o.uid,dom:o.dom,components:[a.asSpec(),s.asSpec(),l.asSpec()],behaviours:ml([Fp("colour-picker-events",[Ri(LC,(()=>{const e=[c,u,h];return(t,o)=>{const n=o.event.hex,r=(e=>ow(Uy(e)))(n);m(t,n,r.hue,e)}})()),Ri(HC,(()=>{const e=[d];return(t,o)=>{const n=o.event.value,r=i.paletteHue.get(),s=tw(r,n.x,100-n.y),a=nw(s);m(t,a,r,e)}})()),Ri(zC,(()=>{const e=[c,d];return(t,o)=>{const n=(e=>(100-e)/100*360)(o.event.value),r=i.paletteRgba.get(),s=ow(r),a=tw(n,s.saturation,s.value),l=nw(a);m(t,l,n,e)}})())]),ch.config({find:e=>l.getOpt(e)}),Ep.config({mode:"acyclic"})])}}});return o},QC=()=>ch.config({find:A.some}),ek=e=>ch.config({find:t=>rt(t.element,e).bind((e=>t.getSystem().getByDom(e).toOptional()))}),tk=kn([ur("preprocess",w),ur("postprocess",w)]),ok=(e,t,o)=>ou.config({store:{mode:"manual",...e.map((e=>({initialValue:e}))).getOr({}),getValue:t,setValue:o}}),nk=(e,t,o)=>ok(e,(e=>t(e.element)),((e,t)=>o(e.element,t))),rk=(e,t)=>{const o=Zn("RepresentingConfigs.memento processors",tk,t);return ou.config({store:{mode:"manual",getValue:t=>{const n=e.get(t),r=ou.getValue(n);return o.postprocess(r)},setValue:(t,n)=>{const r=o.preprocess(n),i=e.get(t);ou.setValue(i,r)}}})},ik=nk,sk=ok,ak=e=>ou.config({store:{mode:"memory",initialValue:e}}),lk={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red component","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green component","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue component","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"};var ck=window.mailpoetTinymce.util.Tools.resolve("mailpoetTinymce.Resource"),dk=window.mailpoetTinymce.util.Tools.resolve("window.mailpoetTinymce.util.Tools");const uk=Qi("alloy-fake-before-tabstop"),hk=Qi("alloy-fake-after-tabstop"),mk=e=>({dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:e},behaviours:ml([Zp.config({ignore:!0}),B_.config({})])}),pk=e=>({dom:{tag:"div",classes:["tox-navobj"]},components:[mk([uk]),e,mk([hk])],behaviours:ml([ek(1)])}),gk=(e,t)=>{Si(e,Zr(),{raw:{which:9,shiftKey:t}})},fk=(e,t)=>{const o=t.element;Rs(o,uk)?gk(e,!0):Rs(o,hk)&&gk(e,!1)},vk=e=>p_(e,["."+uk,"."+hk].join(","),T),bk=Qi("toolbar.button.execute"),yk={[ni()]:["disabling","alloy.base.behaviour","toggling","toolbar-button-events"]},wk=(e,t,o)=>zg(e,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:o},t),_k=(e,t)=>wk(e,t,[]),xk=(e,t)=>wk(e,t,[Dp.config({})]),Ck=(e,t,o)=>({dom:{tag:"span",classes:[`${t}__select-label`]},components:[$s(o.translate(e))],behaviours:ml([Dp.config({})])}),kk=Qi("update-menu-text"),Sk=Qi("update-menu-icon"),Tk=(e,t,o)=>{const n=wr(v),r=e.text.map((e=>Mg(Ck(e,t,o.providers)))),i=e.icon.map((e=>Mg(xk(e,o.providers.icons)))),s=(e,t)=>{const o=ou.getValue(e);return Zp.focus(o),Si(o,"keydown",{raw:t.event.raw}),r_.close(o),A.some(!0)},a=e.role.fold((()=>({})),(e=>({role:e}))),l=e.tooltip.fold((()=>({})),(e=>{const t=o.providers.translate(e);return{title:t,"aria-label":t}})),c=zg("chevron-down",{tag:"div",classes:[`${t}__select-chevron`]},o.providers.icons),d=Mg(r_.sketch({...e.uid?{uid:e.uid}:{},...a,dom:{tag:"button",classes:[t,`${t}--select`].concat(L(e.classes,(e=>`${t}--${e}`))),attributes:{...l}},components:my([i.map((e=>e.asSpec())),r.map((e=>e.asSpec())),A.some(c)]),matchWidth:!0,useMinWidth:!0,onOpen:(t,o,n)=>{e.searchable&&(e=>{Sv(e).each((e=>Zp.focus(e)))})(n)},dropdownBehaviours:ml([...e.dropdownBehaviours,iy((()=>e.disabled||o.providers.isDisabled())),ry(),ox.config({}),Dp.config({}),Fp("dropdown-events",[cy(e,n),dy(e,n)]),Fp("menubutton-update-display-text",[Ri(kk,((e,t)=>{r.bind((t=>t.getOpt(e))).each((e=>{Dp.set(e,[$s(o.providers.translate(t.event.text))])}))})),Ri(Sk,((e,t)=>{i.bind((t=>t.getOpt(e))).each((e=>{Dp.set(e,[xk(t.event.icon,o.providers.icons)])}))}))])]),eventOrder:cn(yk,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:ml([Ep.config({mode:"special",onLeft:s,onRight:s}),Fp("dropdown-sandbox-events",[Ri(_v,((e,t)=>{(e=>{const t=ou.getValue(e),o=kv(e).map(Tv);r_.refetch(t).get((()=>{const e=Iw.getCoupled(t,"sandbox");o.each((t=>kv(e).each((e=>((e,t)=>{ou.setValue(e,t.fetchPattern),e.element.dom.selectionStart=t.selectionStart,e.element.dom.selectionEnd=t.selectionEnd})(e,t)))))}))})(e),t.stop()})),Ri(xv,((e,t)=>{((e,t)=>{(e=>Dd.getState(e).bind(Rh.getHighlighted).bind(Rh.getHighlighted))(e).each((o=>{((e,t,o,n)=>{const r={...n,target:t};e.getSystem().triggerEvent(o,t,r)})(e,o.element,t.event.eventType,t.event.interactionEvent)}))})(e,t),t.stop()}))])]),lazySink:o.getSink,toggleClass:`${t}--active`,parts:{menu:{...gv(0,e.columns,e.presets),fakeFocus:e.searchable,onHighlightItem:i_,onCollapseMenu:(e,t,o)=>{Rh.getHighlighted(o).each((t=>{i_(e,o,t)}))},onDehighlightItem:s_}},fetch:t=>jw(x(e.fetch,t))}));return d.asSpec()},Ek=e=>"separator"===e.type,Ok={type:"separator"},Ak=(e,t)=>{const o=((e,t)=>{const o=U(e,((e,o)=>(e=>i(e))(o)?""===o?e:"|"===o?e.length>0&&!Ek(e[e.length-1])?e.concat([Ok]):e:be(t,o.toLowerCase())?e.concat([t[o.toLowerCase()]]):e:e.concat([o])),[]);return o.length>0&&Ek(o[o.length-1])&&o.pop(),o})(i(e)?e.split(" "):e,t);return j(o,((e,o)=>{if((e=>be(e,"getSubmenuItems"))(o)){const n=(e=>{const t=ve(e,"value").getOrThunk((()=>Qi("generated-menu-item")));return cn({value:t},e)})(o),r=((e,t)=>{const o=e.getSubmenuItems(),n=Ak(o,t);return{item:e,menus:cn(n.menus,{[e.value]:n.items}),expansions:cn(n.expansions,{[e.value]:e.value})}})(n,t);return{menus:cn(e.menus,r.menus),items:[r.item,...e.items],expansions:cn(e.expansions,r.expansions)}}return{...e,items:[o,...e.items]}}),{menus:{},expansions:{},items:[]})},Mk=(e,t,o,n)=>{const r=Qi("primary-menu"),i=Ak(e,o.shared.providers.menuItems());if(0===i.items.length)return A.none();const s=(e=>e.search.fold((()=>({searchMode:"no-search"})),(e=>({searchMode:"search-with-field",placeholder:e.placeholder}))))(n),a=u_(r,i.items,t,o,n.isHorizontalMenu,s),l=(e=>e.search.fold((()=>({searchMode:"no-search"})),(e=>({searchMode:"search-with-results"}))))(n),c=ce(i.menus,((e,n)=>u_(n,e,t,o,!1,l))),d=cn(c,xr(r,a));return A.from(Tg.tieredData(r,d,i.expansions))},Bk=e=>!be(e,"items"),Pk="data-value",Rk=(e,t,o,n)=>L(o,(o=>Bk(o)?{type:"togglemenuitem",text:o.text,value:o.value,active:o.value===n,onAction:()=>{ou.setValue(e,o.value),Si(e,F_,{name:t}),Zp.focus(e)}}:{type:"nestedmenuitem",text:o.text,getSubmenuItems:()=>Rk(e,t,o.items,n)})),Vk=(e,t)=>ie(e,(e=>Bk(e)?Ce(e.value===t,e):Vk(e.items,t))),Nk=rh({name:"HtmlSelect",configFields:[Gn("options"),nu("selectBehaviours",[Zp,ou]),ur("selectClasses",[]),ur("selectAttributes",{}),nr("data")],factory:(e,t)=>{const o=L(e.options,(e=>({dom:{tag:"option",value:e.value,innerHtml:e.text}}))),n=e.data.map((e=>xr("initialValue",e))).getOr({});return{uid:e.uid,dom:{tag:"select",classes:e.selectClasses,attributes:e.selectAttributes},components:o,behaviours:iu(e.selectBehaviours,[Zp.config({}),ou.config({store:{mode:"manual",getValue:e=>Ds(e.element),setValue:(t,o)=>{$(e.options,(e=>e.value===o)).isSome()&&Fs(t.element,o)},...n}})])}}}),Dk=y([ur("field1Name","field1"),ur("field2Name","field2"),Ca("onLockedChange"),ya(["lockClass"]),ur("locked",!1),su("coupledFieldBehaviours",[ch,ou])]),Fk=(e,t)=>Mu({factory:O_,name:e,overrides:e=>({fieldBehaviours:ml([Fp("coupled-input-behaviour",[Ri(Ur(),(o=>{((e,t,o)=>Uu(e,t,o).bind(ch.getCurrent))(o,e,t).each((t=>{Uu(o,e,"lock").each((n=>{Xp.isOn(n)&&e.onLockedChange(o,t,n)}))}))}))])])})}),Ik=y([Fk("field1","field2"),Fk("field2","field1"),Mu({factory:Ag,schema:[Gn("dom")],name:"lock",overrides:e=>({buttonBehaviours:ml([Xp.config({selected:e.locked,toggleClass:e.markers.lockClass,aria:{mode:"pressed"}})])})})]),Lk=ih({name:"FormCoupledInputs",configFields:Dk(),partFields:Ik(),factory:(e,t,o,n)=>({uid:e.uid,dom:e.dom,components:t,behaviours:au(e.coupledFieldBehaviours,[ch.config({find:A.some}),ou.config({store:{mode:"manual",getValue:t=>{const o=Yu(t,e,["field1","field2"]);return{[e.field1Name]:ou.getValue(o.field1()),[e.field2Name]:ou.getValue(o.field2())}},setValue:(t,o)=>{const n=Yu(t,e,["field1","field2"]);ye(o,e.field1Name)&&ou.setValue(n.field1(),o[e.field1Name]),ye(o,e.field2Name)&&ou.setValue(n.field2(),o[e.field2Name])}}})]),apis:{getField1:t=>Uu(t,e,"field1"),getField2:t=>Uu(t,e,"field2"),getLock:t=>Uu(t,e,"lock")}}),apis:{getField1:(e,t)=>e.getField1(t),getField2:(e,t)=>e.getField2(t),getLock:(e,t)=>e.getLock(t)}}),zk=e=>{const t=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(e);if(null!==t){const e=parseFloat(t[1]),o=t[2];return Ko.value({value:e,unit:o})}return Ko.error(e)},Hk=(e,t)=>{const o={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},n=e=>be(o,e);return e.unit===t?A.some(e.value):n(e.unit)&&n(t)?o[e.unit]===o[t]?A.some(e.value):A.some(e.value/o[e.unit]*o[t]):A.none()},Zk=e=>A.none(),jk=(e,t)=>{const o=e.label.map((e=>D_(e,t))),n=[Ch.config({disabled:()=>e.disabled||t.isDisabled()}),ry(),Ep.config({mode:"execution",useEnter:!0!==e.multiline,useControlEnter:!0===e.multiline,execute:e=>(ki(e,H_),A.some(!0))}),Fp("textfield-change",[Ri(Ur(),((t,o)=>{Si(t,F_,{name:e.name})})),Ri(ti(),((t,o)=>{Si(t,F_,{name:e.name})}))]),B_.config({})],r=e.validation.map((e=>tx.config({getRoot:e=>tt(e.element),invalidClass:"tox-invalid",validator:{validate:t=>{const o=ou.getValue(t),n=e.validator(o);return Uw(!0===n?Ko.value(o):Ko.error(n))},validateOnLoad:e.validateOnLoad}}))).toArray(),i={...e.placeholder.fold(y({}),(e=>({placeholder:t.translate(e)}))),...e.inputMode.fold(y({}),(e=>({inputmode:e})))},s=O_.parts.field({tag:!0===e.multiline?"textarea":"input",...e.data.map((e=>({data:e}))).getOr({}),inputAttributes:i,inputClasses:[e.classname],inputBehaviours:ml(q([n,r])),selectOnFocus:!1,factory:wv}),a=(e.flex?["tox-form__group--stretched"]:[]).concat(e.maximized?["tox-form-group--maximize"]:[]),l=[Ch.config({disabled:()=>e.disabled||t.isDisabled(),onDisabled:e=>{O_.getField(e).each(Ch.disable)},onEnabled:e=>{O_.getField(e).each(Ch.enable)}}),ry()];return R_(o,s,a,l)};var Uk=Object.freeze({__proto__:null,events:(e,t)=>{const o=e.stream.streams.setup(e,t);return Mi([Ri(e.event,o),Zi((()=>t.cancel()))].concat(e.cancelEvent.map((e=>[Ri(e,(()=>t.cancel()))])).getOr([])))}});const $k=(e,t)=>{let o=null;const n=()=>{c(o)||(clearTimeout(o),o=null)};return{cancel:n,throttle:(...r)=>{n(),o=setTimeout((()=>{o=null,e.apply(null,r)}),t)}}},Wk=e=>{const t=wr(null);return vs({readState:()=>({timer:null!==t.get()?"set":"unset"}),setTimer:e=>{t.set(e)},cancel:()=>{const e=t.get();null!==e&&e.cancel()}})};var qk=Object.freeze({__proto__:null,throttle:Wk,init:e=>e.stream.streams.state(e)}),Gk=[Yn("stream",Un("mode",{throttle:[Gn("delay"),ur("stopEvent",!0),Sa("streams",{setup:(e,t)=>{const o=e.stream,n=$k(e.onStream,o.delay);return t.setTimer(n),(e,t)=>{n.throttle(e,t),o.stopEvent&&t.stop()}},state:Wk})]})),ur("event","input"),nr("cancelEvent"),Ca("onStream")];const Yk=gl({fields:Gk,name:"streaming",active:Uk,state:qk}),Xk=(e,t,o)=>{const n=ou.getValue(o);ou.setValue(t,n),Jk(t)},Kk=(e,t)=>{const o=e.element,n=Ds(o),r=o.dom;"number"!==wt(o,"type")&&t(r,n)},Jk=e=>{Kk(e,((e,t)=>e.setSelectionRange(t.length,t.length)))},Qk=y("alloy.typeahead.itemexecute"),eS=y([nr("lazySink"),Gn("fetch"),ur("minChars",5),ur("responseTime",1e3),_a("onOpen"),ur("getHotspot",A.some),ur("getAnchorOverrides",y({})),ur("layouts",A.none()),ur("eventOrder",{}),yr("model",{},[ur("getDisplayText",(e=>void 0!==e.meta&&void 0!==e.meta.text?e.meta.text:e.value)),ur("selectsOver",!0),ur("populateFromBrowse",!0)]),_a("onSetValue"),xa("onExecute"),_a("onItemExecute"),ur("inputClasses",[]),ur("inputAttributes",{}),ur("inputStyles",{}),ur("matchWidth",!0),ur("useMinWidth",!1),ur("dismissOnBlur",!0),ya(["openClass"]),nr("initialData"),nu("typeaheadBehaviours",[Zp,ou,Yk,Ep,Xp,Iw]),Wn("lazyTypeaheadComp",(()=>wr(A.none))),Wn("previewing",(()=>wr(!0)))].concat(fv()).concat(t_())),tS=y([Bu({schema:[ba()],name:"menu",overrides:e=>({fakeFocus:!0,onHighlightItem:(t,o,n)=>{e.previewing.get()?e.lazyTypeaheadComp.get().each((t=>{((e,t,o)=>{if(e.selectsOver){const n=ou.getValue(t),r=e.getDisplayText(n),i=ou.getValue(o);return 0===e.getDisplayText(i).indexOf(r)?A.some((()=>{Xk(0,t,o),((e,t)=>{Kk(e,((e,o)=>e.setSelectionRange(t,o.length)))})(t,r.length)})):A.none()}return A.none()})(e.model,t,n).fold((()=>{e.model.selectsOver?(Rh.dehighlight(o,n),e.previewing.set(!0)):e.previewing.set(!1)}),(t=>{t(),e.previewing.set(!1)}))})):e.lazyTypeaheadComp.get().each((t=>{e.model.populateFromBrowse&&Xk(e.model,t,n)}))},onExecute:(t,o)=>e.lazyTypeaheadComp.get().map((e=>(Si(e,Qk(),{item:o}),!0))),onHover:(t,o)=>{e.previewing.set(!1),e.lazyTypeaheadComp.get().each((t=>{e.model.populateFromBrowse&&Xk(e.model,t,o)}))}})})]),oS=ih({name:"Typeahead",configFields:eS(),partFields:tS(),factory:(e,t,o,n)=>{const r=(t,o,r)=>{e.previewing.set(!1);const i=Iw.getCoupled(t,"sandbox");if(Dd.isOpen(i))ch.getCurrent(i).each((e=>{Rh.getHighlighted(e).fold((()=>{r(e)}),(()=>{Ai(i,e.element,"keydown",o)}))}));else{const o=e=>{ch.getCurrent(e).each(r)};Gw(e,s(t),t,i,n,o,kg.HighlightMenuAndItem).get(v)}},i=vv(e),s=e=>t=>t.map((t=>{const o=fe(t.menus),n=G(o,(e=>Z(e.items,(e=>"item"===e.type))));return ou.getState(e).update(L(n,(e=>e.data))),t})),a=e=>ch.getCurrent(e),l="typeaheadevents",c=[Zp.config({}),ou.config({onSetValue:e.onSetValue,store:{mode:"dataset",getDataKey:e=>Ds(e.element),getFallbackEntry:e=>({value:e,meta:{}}),setValue:(t,o)=>{Fs(t.element,e.model.getDisplayText(o))},...e.initialData.map((e=>xr("initialValue",e))).getOr({})}}),Yk.config({stream:{mode:"throttle",delay:e.responseTime,stopEvent:!1},onStream:(t,o)=>{const r=Iw.getCoupled(t,"sandbox");if(Zp.isFocused(t)&&Ds(t.element).length>=e.minChars){const o=a(r).bind((e=>Rh.getHighlighted(e).map(ou.getValue)));e.previewing.set(!0);const i=t=>{a(r).each((t=>{o.fold((()=>{e.model.selectsOver&&Rh.highlightFirst(t)}),(e=>{Rh.highlightBy(t,(t=>ou.getValue(t).value===e.value)),Rh.getHighlighted(t).orThunk((()=>(Rh.highlightFirst(t),A.none())))}))}))};Gw(e,s(t),t,r,n,i,kg.HighlightJustMenu).get(v)}},cancelEvent:li()}),Ep.config({mode:"special",onDown:(e,t)=>(r(e,t,Rh.highlightFirst),A.some(!0)),onEscape:e=>{const t=Iw.getCoupled(e,"sandbox");return Dd.isOpen(t)?(Dd.close(t),A.some(!0)):A.none()},onUp:(e,t)=>(r(e,t,Rh.highlightLast),A.some(!0)),onEnter:t=>{const o=Iw.getCoupled(t,"sandbox"),n=Dd.isOpen(o);if(n&&!e.previewing.get())return a(o).bind((e=>Rh.getHighlighted(e))).map((e=>(Si(t,Qk(),{item:e}),!0)));{const r=ou.getValue(t);return ki(t,li()),e.onExecute(o,t,r),n&&Dd.close(o),A.some(!0)}}}),Xp.config({toggleClass:e.markers.openClass,aria:{mode:"expanded"}}),Iw.config({others:{sandbox:t=>Qw(e,t,{onOpen:()=>Xp.on(t),onClose:()=>Xp.off(t)})}}),Fp(l,[Hi((t=>{e.lazyTypeaheadComp.set(A.some(t))})),Zi((t=>{e.lazyTypeaheadComp.set(A.none())})),Ui((t=>{const o=v;Xw(e,s(t),t,n,o,kg.HighlightMenuAndItem).get(v)})),Ri(Qk(),((t,o)=>{const n=Iw.getCoupled(t,"sandbox");Xk(e.model,t,o.event.item),ki(t,li()),e.onItemExecute(t,n,o.event.item,ou.getValue(t)),Dd.close(n),Jk(t)}))].concat(e.dismissOnBlur?[Ri(ei(),(e=>{const t=Iw.getCoupled(e,"sandbox");kl(t.element).isNone()&&Dd.close(t)}))]:[]))],d={[gi()]:[ou.name(),Yk.name(),l],...e.eventOrder};return{uid:e.uid,dom:yv(cn(e,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:{...i,...iu(e.typeaheadBehaviours,c)},eventOrder:d}}}),nS=e=>({...e,toCached:()=>nS(e.toCached()),bindFuture:t=>nS(e.bind((e=>e.fold((e=>Uw(Ko.error(e))),(e=>t(e)))))),bindResult:t=>nS(e.map((e=>e.bind(t)))),mapResult:t=>nS(e.map((e=>e.map(t)))),mapError:t=>nS(e.map((e=>e.mapError(t)))),foldResult:(t,o)=>e.map((e=>e.fold(t,o))),withTimeout:(t,o)=>nS(jw((n=>{let r=!1;const i=setTimeout((()=>{r=!0,n(Ko.error(o()))}),t);e.get((e=>{r||(clearTimeout(i),n(e))}))})))}),rS=e=>nS(jw(e)),iS=e=>({isEnabled:()=>!Ch.isDisabled(e),setEnabled:t=>Ch.set(e,!t),setActive:t=>{const o=e.element;t?(Bs(o,"tox-tbtn--enabled"),bt(o,"aria-pressed",!0)):(Ps(o,"tox-tbtn--enabled"),Ct(o,"aria-pressed"))},isActive:()=>Rs(e.element,"tox-tbtn--enabled")}),sS=(e,t,o,n)=>Tk({text:e.text,icon:e.icon,tooltip:e.tooltip,searchable:e.search.isSome(),role:n,fetch:(t,n)=>{const r={pattern:e.search.isSome()?a_(t):""};e.fetch((t=>{n(Mk(t,Kf.CLOSE_ON_EXECUTE,o,{isHorizontalMenu:!1,search:e.search}))}),r)},onSetup:e.onSetup,getApi:iS,columns:1,presets:"normal",classes:[],dropdownBehaviours:[B_.config({})]},t,o.shared),aS=(e,t,o)=>{const n=e=>n=>{const r=!n.isActive();n.setActive(r),e.storage.set(r),o.shared.getSink().each((o=>{t().getOpt(o).each((t=>{_l(t.element),Si(t,z_,{name:e.name,value:e.storage.get()})}))}))},r=e=>t=>{t.setActive(e.storage.get())};return t=>{t(L(e,(e=>{const t=e.text.fold((()=>({})),(e=>({text:e})));return{type:e.type,active:!1,...t,onAction:n(e),onSetup:r(e)}})))}},lS=(e,t,o=[],n,r,i)=>{const s=t.fold((()=>({})),(e=>({action:e}))),a={buttonBehaviours:ml([iy((()=>!e.enabled||i.isDisabled())),ry(),B_.config({}),Fp("button press",[Pi("click"),Pi("mousedown")])].concat(o)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]},...s},l=cn(a,{dom:n});return cn(l,{components:r})},cS=(e,t,o,n=[])=>{const r={tag:"button",classes:["tox-tbtn"],attributes:e.tooltip.map((e=>({"aria-label":o.translate(e),title:o.translate(e)}))).getOr({})},i=e.icon.map((e=>_k(e,o.icons))),s=my([i]);return lS(e,t,n,r,s,o)},dS=(e,t,o,n=[],r=[])=>{const i=o.translate(e.text),s=e.icon.map((e=>_k(e,o.icons))),a=[s.getOrThunk((()=>$s(i)))],l=[...(e=>{switch(e){case"primary":return["tox-button"];case"toolbar":return["tox-tbtn"];default:return["tox-button","tox-button--secondary"]}})(e.buttonType.getOr(e.primary||e.borderless?"primary":"secondary")),...s.isSome()?["tox-button--icon"]:[],...e.borderless?["tox-button--naked"]:[],...r];return lS(e,t,n,{tag:"button",classes:l,attributes:{title:i}},a,o)},uS=(e,t,o,n=[],r=[])=>{const i=dS(e,A.some(t),o,n,r);return Ag.sketch(i)},hS=(e,t)=>o=>{"custom"===t?Si(o,z_,{name:e,value:{}}):"submit"===t?ki(o,H_):"cancel"===t?ki(o,L_):console.error("Unknown button type: ",t)},mS=(e,t,o)=>{if(((e,t)=>"menu"===t)(0,t)){const t=()=>i,n=e,r={...e,type:"menubutton",search:A.none(),onSetup:t=>(t.setEnabled(e.enabled),v),fetch:aS(n.items,t,o)},i=Mg(sS(r,"tox-tbtn",o,A.none()));return i.asSpec()}if(((e,t)=>"custom"===t||"cancel"===t||"submit"===t)(0,t)){const n=hS(e.name,t),r={...e,borderless:!1};return uS(r,n,o.shared.providers,[])}throw console.error("Unknown footer button type: ",t),new Error("Unknown footer button type")},pS={type:"separator"},gS=e=>({type:"menuitem",value:e.url,text:e.title,meta:{attach:e.attach},onAction:v}),fS=(e,t)=>({type:"menuitem",value:t,text:e,meta:{attach:void 0},onAction:v}),vS=(e,t)=>(e=>L(e,gS))(((e,t)=>Z(t,(t=>t.type===e)))(e,t)),bS=e=>vS("header",e.targets),yS=e=>vS("anchor",e.targets),wS=e=>A.from(e.anchorTop).map((e=>fS("<top>",e))).toArray(),_S=e=>A.from(e.anchorBottom).map((e=>fS("<bottom>",e))).toArray(),xS=(e,t)=>{const o=e.toLowerCase();return Z(t,(e=>{var t;const n=void 0!==e.meta&&void 0!==e.meta.text?e.meta.text:e.text,r=null!==(t=e.value)&&void 0!==t?t:"";return Se(n.toLowerCase(),o)||Se(r.toLowerCase(),o)}))},CS=Qi("aria-invalid"),kS=(e,t)=>{e.dom.checked=t},SS=e=>e.dom.checked,TS=e=>(t,o,n,r)=>ve(o,"name").fold((()=>e(o,r,A.none())),(i=>t.field(i,e(o,r,ve(n,i))))),ES={bar:TS(((e,t)=>((e,t)=>({dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:L(e.items,t.interpreter)}))(e,t.shared))),collection:TS(((e,t,o)=>((e,t,o)=>{const n=e.label.map((e=>D_(e,t))),r=e=>(t,o)=>{ia(o.event.target,"[data-collection-item-value]").each((n=>{e(t,o,n,wt(n,"data-collection-item-value"))}))},i=r(((o,n,r,i)=>{n.stop(),t.isDisabled()||Si(o,z_,{name:e.name,value:i})})),s=[Ri(Lr(),r(((e,t,o)=>{_l(o)}))),Ri(Wr(),i),Ri(ii(),i),Ri(zr(),r(((e,t,o)=>{ra(e.element,"."+sv).each((e=>{Ps(e,sv)})),Bs(o,sv)}))),Ri(Hr(),r((e=>{ra(e.element,"."+sv).each((e=>{Ps(e,sv)}))}))),Ui(r(((t,o,n,r)=>{Si(t,z_,{name:e.name,value:r})})))],a=(e,t)=>L(Dc(e.element,".tox-collection__item"),t),l=O_.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==e.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:w},behaviours:ml([Ch.config({disabled:t.isDisabled,onDisabled:e=>{a(e,(e=>{Bs(e,"tox-collection__item--state-disabled"),bt(e,"aria-disabled",!0)}))},onEnabled:e=>{a(e,(e=>{Ps(e,"tox-collection__item--state-disabled"),Ct(e,"aria-disabled")}))}}),ry(),Dp.config({}),ou.config({store:{mode:"memory",initialValue:o.getOr([])},onSetValue:(o,n)=>{((o,n)=>{const r=L(n,(o=>{const n=Bg.translate(o.text),r=1===e.columns?`<div class="tox-collection__item-label">${n}</div>`:"",i=`<div class="tox-collection__item-icon">${o.icon}</div>`,s={_:" "," - ":" ","-":" "},a=n.replace(/\_| \- |\-/g,(e=>s[e]));return`<div class="tox-collection__item${t.isDisabled()?" tox-collection__item--state-disabled":""}" tabindex="-1" data-collection-item-value="${P_.encodeAllRaw(o.value)}" title="${a}" aria-label="${a}">${i}${r}</div>`})),i="auto"!==e.columns&&e.columns>1?I(r,e.columns):[r],s=L(i,(e=>`<div class="tox-collection__group">${e.join("")}</div>`));Wi(o.element,s.join(""))})(o,n),"auto"===e.columns&&Ub(o,5,"tox-collection__item").each((({numRows:e,numColumns:t})=>{Ep.setGridSize(o,e,t)})),ki(o,$_)}}),B_.config({}),Ep.config((c=e.columns,1===c?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===c?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:".tox-collection__group",cell:`.${Qf}`}})),Fp("collection-events",s)]),eventOrder:{[ni()]:["disabling","alloy.base.behaviour","collection-events"]}});var c;return R_(n,l,["tox-form__group--collection"],[])})(e,t.shared.providers,o))),alertbanner:TS(((e,t)=>((e,t)=>k_.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in",`tox-notification--${e.level}`]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[Ag.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:Fg(e.icon,t.icons),attributes:{title:t.translate(e.iconTooltip)}},action:t=>{Si(t,z_,{name:"alert-banner",value:e.url})},buttonBehaviours:ml([Ig()])})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:t.translate(e.text)}}]}))(e,t.shared.providers))),input:TS(((e,t,o)=>((e,t,o)=>jk({name:e.name,multiline:!1,label:e.label,inputMode:e.inputMode,placeholder:e.placeholder,flex:!1,disabled:!e.enabled,classname:"tox-textfield",validation:A.none(),maximized:e.maximized,data:o},t))(e,t.shared.providers,o))),textarea:TS(((e,t,o)=>((e,t,o)=>jk({name:e.name,multiline:!0,label:e.label,inputMode:A.none(),placeholder:e.placeholder,flex:!0,disabled:!e.enabled,classname:"tox-textarea",validation:A.none(),maximized:e.maximized,data:o},t))(e,t.shared.providers,o))),label:TS(((e,t)=>((e,t)=>{return{dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"label",classes:["tox-label"]},components:[$s(t.providers.translate(e.label))]},...L(e.items,t.interpreter)],behaviours:ml([QC(),Dp.config({}),(o=A.none(),nk(o,$i,Wi)),Ep.config({mode:"acyclic"})])};var o})(e,t.shared))),iframe:(JT=(e,t,o)=>((e,t,o)=>{const n=e.sandboxed,r=e.transparent,i="tox-dialog__iframe",s={...e.label.map((e=>({title:e}))).getOr({}),...o.map((e=>({srcdoc:e}))).getOr({}),...n?{sandbox:"allow-scripts allow-same-origin"}:{}},a=(e=>{const t=wr(e.getOr(""));return{getValue:e=>t.get(),setValue:(e,o)=>{t.get()!==o&&bt(e.element,"srcdoc",o),t.set(o)}}})(o),l=e.label.map((e=>D_(e,t))),c=O_.parts.field({factory:{sketch:e=>pk({uid:e.uid,dom:{tag:"iframe",attributes:s,classes:r?[i]:[i,`${i}--opaque`]},behaviours:ml([B_.config({}),Zp.config({}),sk(o,a.getValue,a.setValue)])})}});return R_(l,c,["tox-form__group--stretched"],[])})(e,t.shared.providers,o),(e,t,o,n)=>{const r=cn(t,{source:"dynamic"});return TS(JT)(e,r,o,n)}),button:TS(((e,t)=>((e,t)=>{const o=hS(e.name,"custom");return n=A.none(),r=O_.parts.field({factory:Ag,...dS(e,A.some(o),t,[ak(""),QC()])}),R_(n,r,[],[]);var n,r})(e,t.shared.providers))),checkbox:TS(((e,t,o)=>((e,t,o)=>{const n=e=>(e.element.dom.click(),A.some(!0)),r=O_.parts.field({factory:{sketch:w},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:ml([QC(),Ch.config({disabled:()=>!e.enabled||t.isDisabled()}),B_.config({}),Zp.config({}),ik(o,SS,kS),Ep.config({mode:"special",onEnter:n,onSpace:n,stopSpaceKeyup:!0}),Fp("checkbox-events",[Ri($r(),((t,o)=>{Si(t,F_,{name:e.name})}))])])}),i=O_.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"]},components:[$s(t.translate(e.label))],behaviours:ml([ox.config({})])}),s=e=>zg("checked"===e?"selected":"unselected",{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+e]},t.icons),a=Mg({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[s("checked"),s("unchecked")]});return O_.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[r,a.asSpec(),i],fieldBehaviours:ml([Ch.config({disabled:()=>!e.enabled||t.isDisabled(),disableClass:"tox-checkbox--disabled",onDisabled:e=>{O_.getField(e).each(Ch.disable)},onEnabled:e=>{O_.getField(e).each(Ch.enable)}}),ry()])})})(e,t.shared.providers,o))),colorinput:TS(((e,t,o)=>((e,t,o,n)=>{const r=O_.parts.field({factory:wv,inputClasses:["tox-textfield"],data:n,onSetValue:e=>tx.run(e).get(v),inputBehaviours:ml([Ch.config({disabled:t.providers.isDisabled}),ry(),B_.config({}),tx.config({invalidClass:"tox-textbox-field-invalid",getRoot:e=>tt(e.element),notify:{onValid:e=>{const t=ou.getValue(e);Si(e,nx,{color:t})}},validator:{validateOnLoad:!1,validate:e=>{const t=ou.getValue(e);if(0===t.length)return Uw(Ko.value(!0));{const e=Pe("span");Tt(e,"background-color",t);const o=Bt(e,"background-color").fold((()=>Ko.error("blah")),(e=>Ko.value(t)));return Uw(o)}}}})]),selectOnFocus:!1}),i=e.label.map((e=>D_(e,t.providers))),s=(e,t)=>{Si(e,rx,{value:t})},a=Mg(((e,t)=>r_.sketch({dom:e.dom,components:e.components,toggleClass:"mce-active",dropdownBehaviours:ml([iy(t.providers.isDisabled),ry(),ox.config({}),B_.config({})]),layouts:e.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:t.getSink,fetch:o=>jw((t=>e.fetch(t))).map((n=>A.from(h_(cn(Sw(Qi("menu-value"),n,(t=>{e.onItemAction(o,t)}),e.columns,e.presets,Kf.CLOSE_ON_EXECUTE,T,t.providers),{movement:Ew(e.columns,e.presets)}))))),parts:{menu:gv(0,0,e.presets)}}))({dom:{tag:"span",attributes:{"aria-label":t.providers.translate("Color swatch")}},layouts:{onRtl:()=>[Ya,Ga,Qa],onLtr:()=>[Ga,Ya,Qa]},components:[],fetch:ww(o.getColors(e.storageKey),e.storageKey,o.hasCustomColors()),columns:o.getColorCols(e.storageKey),presets:"color",onItemAction:(t,n)=>{a.getOpt(t).each((t=>{"custom"===n?o.colorPicker((o=>{o.fold((()=>ki(t,ix)),(o=>{s(t,o),ew(e.storageKey,o)}))}),"#ffffff"):s(t,"remove"===n?"":n)}))}},t));return O_.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:i.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[r,a.asSpec()]}]),fieldBehaviours:ml([Fp("form-field-events",[Ri(nx,((t,o)=>{a.getOpt(t).each((e=>{Tt(e.element,"background-color",o.event.color)})),Si(t,F_,{name:e.name})})),Ri(rx,((e,t)=>{O_.getField(e).each((o=>{ou.setValue(o,t.event.value),ch.getCurrent(e).each(Zp.focus)}))})),Ri(ix,((e,t)=>{O_.getField(e).each((t=>{ch.getCurrent(e).each(Zp.focus)}))}))])])})})(e,t.shared,t.colorinput,o))),colorpicker:TS(((e,t,o)=>((e,t,o)=>{const n=e=>"tox-"+e,r=JC((e=>t=>e.translate(lk[t]))(t),n),i=Mg(r.sketch({dom:{tag:"div",classes:[n("color-picker-container")],attributes:{role:"presentation"}},onValidHex:e=>{Si(e,z_,{name:"hex-valid",value:!0})},onInvalidHex:e=>{Si(e,z_,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[i.asSpec()],behaviours:ml([sk(o,(e=>{const t=i.get(e);return ch.getCurrent(t).bind((e=>ou.getValue(e).hex)).map((e=>"#"+e)).getOr("")}),((e,t)=>{const o=A.from(/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(t)).bind((e=>te(e,1))),n=i.get(e);ch.getCurrent(n).fold((()=>{console.log("Can not find form")}),(e=>{ou.setValue(e,{hex:o.getOr("")}),WC.getField(e,"hex").each((e=>{ki(e,Ur())}))}))})),QC()])}})(0,t.shared.providers,o))),dropzone:TS(((e,t,o)=>((e,t,o)=>{const n=(e,t)=>{t.stop()},r=e=>(t,o)=>{z(e,(e=>{e(t,o)}))},i=(e,t)=>{var o;if(!Ch.isDisabled(e)){const n=t.event.raw;a(e,null===(o=n.dataTransfer)||void 0===o?void 0:o.files)}},s=(e,t)=>{const o=t.event.raw.target;a(e,o.files)},a=(o,n)=>{n&&(ou.setValue(o,((e,t)=>{const o=dk.explode(t.getOption("images_file_types"));return Z(re(e),(e=>D(o,(t=>Te(e.name.toLowerCase(),`.${t.toLowerCase()}`)))))})(n,t)),Si(o,F_,{name:e.name}))},l=Mg({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:ml([Fp("input-file-events",[Ii(Wr()),Ii(ii())])])}),c=e.label.map((e=>D_(e,t))),d=O_.parts.field({factory:{sketch:e=>({uid:e.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:ml([ak(o.getOr([])),QC(),Ch.config({}),Xp.config({toggleClass:"dragenter",toggleOnExecute:!1}),Fp("dropzone-events",[Ri("dragenter",r([n,Xp.toggle])),Ri("dragleave",r([n,Xp.toggle])),Ri("dragover",n),Ri("drop",r([n,i])),Ri($r(),s)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p"},components:[$s(t.translate("Drop an image here"))]},Ag.sketch({dom:{tag:"button",styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[$s(t.translate("Browse for an image")),l.asSpec()],action:e=>{l.get(e).element.dom.click()},buttonBehaviours:ml([B_.config({}),iy(t.isDisabled),ry()])})]}]})}});return R_(c,d,["tox-form__group--stretched"],[])})(e,t.shared.providers,o))),grid:TS(((e,t)=>((e,t)=>({dom:{tag:"div",classes:["tox-form__grid",`tox-form__grid--${e.columns}col`]},components:L(e.items,t.interpreter)}))(e,t.shared))),listbox:TS(((e,t,o)=>((e,t,o)=>{const n=t.shared.providers,r=o.bind((t=>Vk(e.items,t))).orThunk((()=>oe(e.items).filter(Bk))),i=e.label.map((e=>D_(e,n))),s=O_.parts.field({dom:{},factory:{sketch:o=>Tk({uid:o.uid,text:r.map((e=>e.text)),icon:A.none(),tooltip:e.label,role:A.none(),fetch:(o,n)=>{const r=Rk(o,e.name,e.items,ou.getValue(o));n(Mk(r,Kf.CLOSE_ON_EXECUTE,t,{isHorizontalMenu:!1,search:A.none()}))},onSetup:y(v),getApi:y({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[B_.config({}),sk(r.map((e=>e.value)),(e=>wt(e.element,Pk)),((t,o)=>{Vk(e.items,o).each((e=>{bt(t.element,Pk,e.value),Si(t,kk,{text:e.text})}))}))]},"tox-listbox",t.shared)}}),a={dom:{tag:"div",classes:["tox-listboxfield"]},components:[s]};return O_.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:q([i.toArray(),[a]]),fieldBehaviours:ml([Ch.config({disabled:y(!e.enabled),onDisabled:e=>{O_.getField(e).each(Ch.disable)},onEnabled:e=>{O_.getField(e).each(Ch.enable)}})])})})(e,t,o))),selectbox:TS(((e,t,o)=>((e,t,o)=>{const n=L(e.items,(e=>({text:t.translate(e.text),value:e.value}))),r=e.label.map((e=>D_(e,t))),i=O_.parts.field({dom:{},...o.map((e=>({data:e}))).getOr({}),selectAttributes:{size:e.size},options:n,factory:Nk,selectBehaviours:ml([Ch.config({disabled:()=>!e.enabled||t.isDisabled()}),B_.config({}),Fp("selectbox-change",[Ri($r(),((t,o)=>{Si(t,F_,{name:e.name})}))])])}),s=e.size>1?A.none():A.some(zg("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},t.icons)),a={dom:{tag:"div",classes:["tox-selectfield"]},components:q([[i],s.toArray()])};return O_.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:q([r.toArray(),[a]]),fieldBehaviours:ml([Ch.config({disabled:()=>!e.enabled||t.isDisabled(),onDisabled:e=>{O_.getField(e).each(Ch.disable)},onEnabled:e=>{O_.getField(e).each(Ch.enable)}}),ry()])})})(e,t.shared.providers,o))),sizeinput:TS(((e,t)=>((e,t)=>{let o=Zk;const n=Qi("ratio-event"),r=e=>zg(e,{tag:"span",classes:["tox-icon","tox-lock-icon__"+e]},t.icons),i=Lk.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:t.translate(e.label.getOr("Constrain proportions"))}},components:[r("lock"),r("unlock")],buttonBehaviours:ml([Ch.config({disabled:()=>!e.enabled||t.isDisabled()}),ry(),B_.config({})])}),s=e=>({dom:{tag:"div",classes:["tox-form__group"]},components:e}),a=o=>O_.parts.field({factory:wv,inputClasses:["tox-textfield"],inputBehaviours:ml([Ch.config({disabled:()=>!e.enabled||t.isDisabled()}),ry(),B_.config({}),Fp("size-input-events",[Ri(zr(),((e,t)=>{Si(e,n,{isField1:o})})),Ri($r(),((t,o)=>{Si(t,F_,{name:e.name})}))])]),selectOnFocus:!1}),l=e=>({dom:{tag:"label",classes:["tox-label"]},components:[$s(t.translate(e))]}),c=Lk.parts.field1(s([O_.parts.label(l("Width")),a(!0)])),d=Lk.parts.field2(s([O_.parts.label(l("Height")),a(!1)]));return Lk.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[c,d,s([l(" "),i])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:(e,t,n)=>{zk(ou.getValue(e)).each((e=>{o(e).each((e=>{ou.setValue(t,(e=>{const t={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4};let o=e.value.toFixed((n=e.unit)in t?t[n]:1);var n;return-1!==o.indexOf(".")&&(o=o.replace(/\.?0*$/,"")),o+e.unit})(e))}))}))},coupledFieldBehaviours:ml([Ch.config({disabled:()=>!e.enabled||t.isDisabled(),onDisabled:e=>{Lk.getField1(e).bind(O_.getField).each(Ch.disable),Lk.getField2(e).bind(O_.getField).each(Ch.disable),Lk.getLock(e).each(Ch.disable)},onEnabled:e=>{Lk.getField1(e).bind(O_.getField).each(Ch.enable),Lk.getField2(e).bind(O_.getField).each(Ch.enable),Lk.getLock(e).each(Ch.enable)}}),ry(),Fp("size-input-events2",[Ri(n,((e,t)=>{const n=t.event.isField1,r=n?Lk.getField1(e):Lk.getField2(e),i=n?Lk.getField2(e):Lk.getField1(e),s=r.map(ou.getValue).getOr(""),a=i.map(ou.getValue).getOr("");o=((e,t)=>{const o=zk(e).toOptional(),n=zk(t).toOptional();return xe(o,n,((e,t)=>Hk(e,t.unit).map((e=>t.value/e)).map((e=>{return o=e,n=t.unit,e=>Hk(e,n).map((e=>({value:e*o,unit:n})));var o,n})).getOr(Zk))).getOr(Zk)})(s,a)}))])])})})(e,t.shared.providers))),slider:TS(((e,t,o)=>((e,t,o)=>{const n=IC.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[$s(t.translate(e.label))]}),r=IC.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),i=IC.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return IC.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:e.min,maxX:e.max,getInitialValue:y(o.getOrThunk((()=>(Math.abs(e.max)-Math.abs(e.min))/2)))},components:[n,r,i],sliderBehaviours:ml([QC(),Zp.config({})]),onChoose:(t,o,n)=>{Si(t,F_,{name:e.name,value:n})}})})(e,t.shared.providers,o))),urlinput:TS(((e,t,o)=>((e,t,o,n)=>{const r=t.shared.providers,i=t=>{const n=ou.getValue(t);o.addToHistory(n.value,e.filetype)},s={...n.map((e=>({initialData:e}))).getOr({}),dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":CS,type:"url"},minChars:0,responseTime:0,fetch:n=>{const r=((e,t,o)=>{const n=ou.getValue(t),r=void 0!==n.meta.text?n.meta.text:n.value;return o.getLinkInformation().fold((()=>[]),(t=>{const n=xS(r,(e=>L(e,(e=>fS(e,e))))(o.getHistory(e)));return"file"===e?(i=[n,xS(r,bS(t)),xS(r,q([wS(t),yS(t),_S(t)]))],U(i,((e,t)=>0===e.length||0===t.length?e.concat(t):e.concat(pS,t)),[])):n;var i}))})(e.filetype,n,o),i=Mk(r,Kf.BUBBLE_TO_SANDBOX,t,{isHorizontalMenu:!1,search:A.none()});return Uw(i)},getHotspot:e=>m.getOpt(e),onSetValue:(e,t)=>{e.hasConfigured(tx)&&tx.run(e).get(v)},typeaheadBehaviours:ml([...o.getValidationHandler().map((t=>tx.config({getRoot:e=>tt(e.element),invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:(e,t)=>{c.getOpt(e).each((e=>{bt(e.element,"title",r.translate(t))}))}},validator:{validate:o=>{const n=ou.getValue(o);return rS((o=>{t({type:e.filetype,url:n.value},(e=>{if("invalid"===e.status){const t=Ko.error(e.message);o(t)}else{const t=Ko.value(e.message);o(t)}}))}))},validateOnLoad:!1}}))).toArray(),Ch.config({disabled:()=>!e.enabled||r.isDisabled()}),B_.config({}),Fp("urlinput-events",[Ri(Ur(),(t=>{const o=Ds(t.element),n=o.trim();n!==o&&Fs(t.element,n),"file"===e.filetype&&Si(t,F_,{name:e.name})})),Ri($r(),(t=>{Si(t,F_,{name:e.name}),i(t)})),Ri(ti(),(t=>{Si(t,F_,{name:e.name}),i(t)}))])]),eventOrder:{[Ur()]:["streaming","urlinput-events","invalidating"]},model:{getDisplayText:e=>e.value,selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:t.shared.getSink,parts:{menu:gv(0,0,"normal")},onExecute:(e,t,o)=>{Si(t,H_,{})},onItemExecute:(t,o,n,r)=>{i(t),Si(t,F_,{name:e.name})}},a=O_.parts.field({...s,factory:oS}),l=e.label.map((e=>D_(e,r))),c=Mg(((e,t,o=e,n=e)=>zg(o,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+e],attributes:{title:r.translate(n),"aria-live":"polite",...t.fold((()=>({})),(e=>({id:e})))}},r.icons))("invalid",A.some(CS),"warning")),d=Mg({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[c.asSpec()]}),u=o.getUrlPicker(e.filetype),h=Qi("browser.url.event"),m=Mg({dom:{tag:"div",classes:["tox-control-wrap"]},components:[a,d.asSpec()],behaviours:ml([Ch.config({disabled:()=>!e.enabled||r.isDisabled()})])}),p=Mg(uS({name:e.name,icon:A.some("browse"),text:e.label.getOr(""),enabled:e.enabled,primary:!1,buttonType:A.none(),borderless:!0},(e=>ki(e,h)),r,[],["tox-browse-url"]));return O_.sketch({dom:N_([]),components:l.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:q([[m.asSpec()],u.map((()=>p.asSpec())).toArray()])}]),fieldBehaviours:ml([Ch.config({disabled:()=>!e.enabled||r.isDisabled(),onDisabled:e=>{O_.getField(e).each(Ch.disable),p.getOpt(e).each(Ch.disable)},onEnabled:e=>{O_.getField(e).each(Ch.enable),p.getOpt(e).each(Ch.enable)}}),ry(),Fp("url-input-events",[Ri(h,(t=>{ch.getCurrent(t).each((o=>{const n=ou.getValue(o),r={fieldname:e.name,...n};u.each((n=>{n(r).get((n=>{ou.setValue(o,n),Si(t,F_,{name:e.name})}))}))}))}))])])})})(e,t,t.urlinput,o))),customeditor:TS((e=>{const t=Zl(),o=Mg({dom:{tag:e.tag}}),n=Zl();return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:ml([Fp("custom-editor-events",[Hi((r=>{o.getOpt(r).each((o=>{((e=>be(e,"init"))(e)?e.init(o.element.dom):ck.load(e.scriptId,e.scriptUrl).then((t=>t(o.element.dom,e.settings)))).then((e=>{n.on((t=>{e.setValue(t)})),n.clear(),t.set(e)}))}))}))]),sk(A.none(),(()=>t.get().fold((()=>n.get().getOr("")),(e=>e.getValue()))),((e,o)=>{t.get().fold((()=>n.set(o)),(e=>e.setValue(o)))})),QC()]),components:[o.asSpec()]}})),htmlpanel:TS((e=>"presentation"===e.presets?k_.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:e.html}}):k_.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:e.html,attributes:{role:"document"}},containerBehaviours:ml([B_.config({}),Zp.config({})])}))),imagepreview:TS(((e,t,o)=>((e,t)=>{const o=wr(t.getOr({url:""})),n=Mg({dom:{tag:"img",classes:["tox-imagepreview__image"],attributes:t.map((e=>({src:e.url}))).getOr({})}}),r=Mg({dom:{tag:"div",classes:["tox-imagepreview__container"],attributes:{role:"presentation"}},components:[n.asSpec()]}),i={};e.height.each((e=>i.height=e));const s=t.map((e=>({url:e.url,zoom:A.from(e.zoom),cachedWidth:A.from(e.cachedWidth),cachedHeight:A.from(e.cachedHeight)})));return{dom:{tag:"div",classes:["tox-imagepreview"],styles:i,attributes:{role:"presentation"}},components:[r.asSpec()],behaviours:ml([QC(),sk(s,(()=>o.get()),((e,t)=>{const i={url:t.url};t.zoom.each((e=>i.zoom=e)),t.cachedWidth.each((e=>i.cachedWidth=e)),t.cachedHeight.each((e=>i.cachedHeight=e)),o.set(i);const s=()=>{const{cachedWidth:t,cachedHeight:o,zoom:n}=i;if(!u(t)&&!u(o)){if(u(n)){const n=((e,t,o)=>{const n=Wt(e),r=It(e);return Math.min(n/t,r/o,1)})(e.element,t,o);i.zoom=n}const s=((e,t,o,n,r)=>{const i=o*r,s=n*r,a=Math.max(0,e/2-i/2),l=Math.max(0,t/2-s/2);return{left:a.toString()+"px",top:l.toString()+"px",width:i.toString()+"px",height:s.toString()+"px"}})(Wt(e.element),It(e.element),t,o,i.zoom);r.getOpt(e).each((e=>{Et(e.element,s)}))}};n.getOpt(e).each((o=>{const n=o.element;var r;t.url!==wt(n,"src")&&(bt(n,"src",t.url),Ps(e.element,"tox-imagepreview__loaded")),s(),(r=n,new Promise(((e,t)=>{const o=()=>{i(),e(r)},n=[Ul(r,"load",o),Ul(r,"error",(()=>{i(),t("Unable to load data from image: "+r.dom.src)}))],i=()=>z(n,(e=>e.unbind()));r.dom.complete&&o()}))).then((t=>{e.getSystem().isConnected()&&(Bs(e.element,"tox-imagepreview__loaded"),i.cachedWidth=t.dom.naturalWidth,i.cachedHeight=t.dom.naturalHeight,s())}))}))}))])}})(e,o))),table:TS(((e,t)=>((e,t)=>{const o=e=>({dom:{tag:"td",innerHtml:t.translate(e)}});return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(r=e.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:L(r,(e=>({dom:{tag:"th",innerHtml:t.translate(e)}})))}]}),(n=e.cells,{dom:{tag:"tbody"},components:L(n,(e=>({dom:{tag:"tr"},components:L(e,o)})))})],behaviours:ml([B_.config({}),Zp.config({})])};var n,r})(e,t.shared.providers))),panel:TS(((e,t)=>((e,t)=>({dom:{tag:"div",classes:e.classes},components:L(e.items,t.shared.interpreter)}))(e,t)))},OS={field:(e,t)=>t,record:y([])},AS=(e,t,o,n)=>{const r=cn(n,{shared:{interpreter:t=>MS(e,t,o,r)}});return MS(e,t,o,r)},MS=(e,t,o,n)=>ve(ES,t.type).fold((()=>(console.error(`Unknown factory type "${t.type}", defaulting to container: `,t),t)),(r=>r(e,t,o,n))),BS=(e,t,o)=>MS(OS,e,t,o),PS="layout-inset",RS=e=>e.x,VS=(e,t)=>e.x+e.width/2-t.width/2,NS=(e,t)=>e.x+e.width-t.width,DS=e=>e.y,FS=(e,t)=>e.y+e.height-t.height,IS=(e,t)=>e.y+e.height/2-t.height/2,LS=(e,t,o)=>Oa(NS(e,t),FS(e,t),o.insetSouthwest(),Ra(),"southwest",za(e,{right:0,bottom:3}),PS),zS=(e,t,o)=>Oa(RS(e),FS(e,t),o.insetSoutheast(),Pa(),"southeast",za(e,{left:1,bottom:3}),PS),HS=(e,t,o)=>Oa(NS(e,t),DS(e),o.insetNorthwest(),Ba(),"northwest",za(e,{right:0,top:2}),PS),ZS=(e,t,o)=>Oa(RS(e),DS(e),o.insetNortheast(),Ma(),"northeast",za(e,{left:1,top:2}),PS),jS=(e,t,o)=>Oa(VS(e,t),DS(e),o.insetNorth(),Va(),"north",za(e,{top:2}),PS),US=(e,t,o)=>Oa(VS(e,t),FS(e,t),o.insetSouth(),Na(),"south",za(e,{bottom:3}),PS),$S=(e,t,o)=>Oa(NS(e,t),IS(e,t),o.insetEast(),Fa(),"east",za(e,{right:0}),PS),WS=(e,t,o)=>Oa(RS(e),IS(e,t),o.insetWest(),Da(),"west",za(e,{left:1}),PS),qS=e=>{switch(e){case"north":return jS;case"northeast":return ZS;case"northwest":return HS;case"south":return US;case"southeast":return zS;case"southwest":return LS;case"east":return $S;case"west":return WS}},GS=(e,t,o,n,r)=>Fl(n).map(qS).getOr(jS)(e,t,o,n,r),YS=e=>{switch(e){case"north":return US;case"northeast":return zS;case"northwest":return LS;case"south":return jS;case"southeast":return ZS;case"southwest":return HS;case"east":return WS;case"west":return $S}},XS=(e,t,o,n,r)=>Fl(n).map(YS).getOr(jS)(e,t,o,n,r),KS={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},JS=(e,t,o)=>{const n={maxHeightFunction:Jl()};return()=>o()?{type:"node",root:ut(dt(e())),node:A.from(e()),bubble:oc(12,12,KS),layouts:{onRtl:()=>[ZS],onLtr:()=>[HS]},overrides:n}:{type:"hotspot",hotspot:t(),bubble:oc(-12,12,KS),layouts:{onRtl:()=>[Ga],onLtr:()=>[Ya]},overrides:n}},QS=(e,t,o)=>()=>o()?{type:"node",root:ut(dt(e())),node:A.from(e()),layouts:{onRtl:()=>[jS],onLtr:()=>[jS]}}:{type:"hotspot",hotspot:t(),layouts:{onRtl:()=>[Qa],onLtr:()=>[Qa]}},eT=(e,t)=>()=>({type:"selection",root:t(),getSelection:()=>{const t=e.selection.getRng();return A.some(Ac.range(Ve(t.startContainer),t.startOffset,Ve(t.endContainer),t.endOffset))}}),tT=e=>t=>({type:"node",root:e(),node:t}),oT=(e,t,o)=>{const n=Zf(e),r=()=>Ve(e.getBody()),i=()=>Ve(e.getContentAreaContainer()),s=()=>n||!o();return{inlineDialog:JS(i,t,s),banner:QS(i,t,s),cursor:eT(e,r),node:tT(r)}},nT=e=>(t,o)=>{kw(e)(t,o)},rT=e=>()=>hw(e),iT=e=>t=>mw(e,t),sT=e=>t=>uw(e,t),aT=e=>()=>Sf(e),lT=e=>ye(e,"items"),cT=e=>ye(e,"format"),dT=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],uT=e=>U(e,((e,t)=>{if(be(t,"items")){const o=uT(t.items);return{customFormats:e.customFormats.concat(o.customFormats),formats:e.formats.concat([{title:t.title,items:o.formats}])}}if(be(t,"inline")||(e=>be(e,"block"))(t)||(e=>be(e,"selector"))(t)){const o=`custom-${i(t.name)?t.name:t.title.toLowerCase()}`;return{customFormats:e.customFormats.concat([{name:o,format:t}]),formats:e.formats.concat([{title:t.title,format:o,icon:t.icon}])}}return{...e,formats:e.formats.concat(t)}}),{customFormats:[],formats:[]}),hT=e=>rf(e).map((t=>{const o=((e,t)=>{const o=uT(t),n=t=>{z(t,(t=>{e.formatter.has(t.name)||e.formatter.register(t.name,t.format)}))};return e.formatter?n(o.customFormats):e.on("init",(()=>{n(o.customFormats)})),o.formats})(e,t);return sf(e)?dT.concat(o):o})).getOr(dT),mT=(e,t,o)=>({...e,type:"formatter",isSelected:t(e.format),getStylePreview:o(e.format)}),pT=(e,t,o,n)=>{const r=t=>L(t,(t=>lT(t)?(e=>{const t=r(e.items);return{...e,type:"submenu",getStyleItems:y(t)}})(t):cT(t)?(e=>mT(e,o,n))(t):(e=>{const t=se(e);return 1===t.length&&N(t,"title")})(t)?{...t,type:"separator"}:(t=>{const r=i(t.name)?t.name:Qi(t.title),s=`custom-${r}`,a={...t,type:"formatter",format:s,isSelected:o(s),getStylePreview:n(s)};return e.formatter.register(r,a),a})(t)));return r(t)},gT=dk.trim,fT=e=>t=>{if((e=>m(e)&&1===e.nodeType)(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1},vT=fT("true"),bT=fT("false"),yT=(e,t,o,n,r)=>({type:e,title:t,url:o,level:n,attach:r}),wT=e=>e.innerText||e.textContent,_T=e=>(e=>e&&"A"===e.nodeName&&void 0!==(e.id||e.name))(e)&&CT(e),xT=e=>e&&/^(H[1-6])$/.test(e.nodeName),CT=e=>(e=>{let t=e;for(;t=t.parentNode;){const e=t.contentEditable;if(e&&"inherit"!==e)return vT(t)}return!1})(e)&&!bT(e),kT=e=>xT(e)&&CT(e),ST=e=>{var t;const o=(e=>e.id?e.id:Qi("h"))(e);return yT("header",null!==(t=wT(e))&&void 0!==t?t:"","#"+o,(e=>xT(e)?parseInt(e.nodeName.substr(1),10):0)(e),(()=>{e.id=o}))},TT=e=>{const t=e.id||e.name,o=wT(e);return yT("anchor",o||"#"+t,"#"+t,0,v)},ET=e=>gT(e.title).length>0,OT=e=>{const t=(e=>{const t=L(Dc(Ve(e),"h1,h2,h3,h4,h5,h6,a:not([href])"),(e=>e.dom));return t})(e);return Z((e=>L(Z(e,kT),ST))(t).concat((e=>L(Z(e,_T),TT))(t)),ET)},AT="tinymce-url-history",MT=e=>i(e)&&/^https?/.test(e),BT=e=>s(e)&&ge(e,(e=>{return!(l(t=e)&&t.length<=5&&Y(t,MT));var t})).isNone(),PT=()=>{const e=Ky.getItem(AT);if(null===e)return{};let t;try{t=JSON.parse(e)}catch(e){if(e instanceof SyntaxError)return console.log("Local storage "+AT+" was not valid JSON",e),{};throw e}return BT(t)?t:(console.log("Local storage "+AT+" was not valid format",t),{})},RT=e=>{const t=PT();return ve(t,e).getOr([])},VT=(e,t)=>{if(!MT(e))return;const o=PT(),n=ve(o,t).getOr([]),r=Z(n,(t=>t!==e));o[t]=[e].concat(r).slice(0,5),(e=>{if(!BT(e))throw new Error("Bad format for history:\n"+JSON.stringify(e));Ky.setItem(AT,JSON.stringify(e))})(o)},NT=e=>!!e,DT=e=>ce(dk.makeMap(e,/[, ]/),NT),FT=e=>A.from(yf(e)),IT=e=>A.from(e).filter(i).getOrUndefined(),LT=e=>({getHistory:RT,addToHistory:VT,getLinkInformation:()=>(e=>xf(e)?A.some({targets:OT(e.getBody()),anchorTop:IT(Cf(e)),anchorBottom:IT(kf(e))}):A.none())(e),getValidationHandler:()=>(e=>A.from(wf(e)))(e),getUrlPicker:t=>((e,t)=>((e,t)=>{const o=(e=>{const t=A.from(_f(e)).filter(NT).map(DT);return FT(e).fold(T,(e=>t.fold(E,(e=>se(e).length>0&&e))))})(e);return d(o)?o?FT(e):A.none():o[t]?FT(e):A.none()})(e,t).map((o=>n=>jw((r=>{const a={filetype:t,fieldname:n.fieldname,...A.from(n.meta).getOr({})};o.call(e,((e,t)=>{if(!i(e))throw new Error("Expected value to be string");if(void 0!==t&&!s(t))throw new Error("Expected meta to be a object");r({value:e,meta:t})}),n.value,a)})))))(e,t)}),zT=Ju,HT=Nu,ZT=y([ur("shell",!1),Gn("makeItem"),ur("setupItem",v),su("listBehaviours",[Dp])]),jT=Pu({name:"items",overrides:()=>({behaviours:ml([Dp.config({})])})}),UT=y([jT]),$T=ih({name:y("CustomList")(),configFields:ZT(),partFields:UT(),factory:(e,t,o,n)=>{const r=e.shell?{behaviours:[Dp.config({})],components:[]}:{behaviours:[],components:t};return{uid:e.uid,dom:e.dom,components:r.components,behaviours:iu(e.listBehaviours,r.behaviours),apis:{setItems:(t,o)=>{var n;(n=t,e.shell?A.some(n):Uu(n,e,"items")).fold((()=>{throw console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")}),(n=>{const r=Dp.contents(n),i=o.length,s=i-r.length,a=s>0?F(s,(()=>e.makeItem())):[],l=r.slice(i);z(l,(e=>Dp.remove(n,e))),z(a,(e=>Dp.append(n,e)));const c=Dp.contents(n);z(c,((n,r)=>{e.setupItem(t,n,o[r],r)}))}))}}}},apis:{setItems:(e,t,o)=>{e.setItems(t,o)}}}),WT=y([Gn("dom"),ur("shell",!0),nu("toolbarBehaviours",[Dp])]),qT=y([Pu({name:"groups",overrides:()=>({behaviours:ml([Dp.config({})])})})]),GT=ih({name:"Toolbar",configFields:WT(),partFields:qT(),factory:(e,t,o,n)=>{const r=e.shell?{behaviours:[Dp.config({})],components:[]}:{behaviours:[],components:t};return{uid:e.uid,dom:e.dom,components:r.components,behaviours:iu(e.toolbarBehaviours,r.behaviours),apis:{setGroups:(t,o)=>{var n;(n=t,e.shell?A.some(n):Uu(n,e,"groups")).fold((()=>{throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")}),(e=>{Dp.set(e,o)}))}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:(e,t,o)=>{e.setGroups(t,o)}}}),YT=v,XT=T,KT=y([]);var JT,QT=Object.freeze({__proto__:null,setup:YT,isDocked:XT,getBehaviours:KT});const eE=e=>(we(Bt(e,"position"),"fixed")?A.none():ot(e)).orThunk((()=>{const t=Pe("span");return et(e).bind((e=>{Ro(e,t);const o=ot(t);return Do(t),o}))})),tE=e=>eE(e).map(jt).getOrThunk((()=>Ht(0,0))),oE=_r([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),nE=(e,t)=>{const o=e.element;Bs(o,t.transitionClass),Ps(o,t.fadeOutClass),Bs(o,t.fadeInClass),t.onShow(e)},rE=(e,t)=>{const o=e.element;Bs(o,t.transitionClass),Ps(o,t.fadeInClass),Bs(o,t.fadeOutClass),t.onHide(e)},iE=(e,t,o)=>Y(e,(e=>{switch(e){case"bottom":return((e,t)=>e.bottom<=t.bottom)(t,o);case"top":return((e,t)=>e.y>=t.y)(t,o)}})),sE=(e,t)=>t.getInitialPos().map((t=>$o(t.bounds.x,t.bounds.y,Wt(e),It(e)))),aE=(e,t,o)=>o.getInitialPos().bind((n=>{switch(o.clearInitialPos(),n.position){case"static":return A.some(oE.static());case"absolute":const o=eE(e).map(Wo).getOrThunk((()=>Wo(gt())));return A.some(oE.absolute(Tl("absolute",ve(n.style,"left").map((e=>t.x-o.x)),ve(n.style,"top").map((e=>t.y-o.y)),ve(n.style,"right").map((e=>o.right-t.right)),ve(n.style,"bottom").map((e=>o.bottom-t.bottom)))));default:return A.none()}})),lE=(e,t,o)=>{const n=e.element;return we(Bt(n,"position"),"fixed")?((e,t,o)=>sE(e,o).filter((e=>iE(o.getModes(),e,t))).bind((t=>aE(e,t,o))))(n,t,o):((e,t,o)=>{const n=Wo(e);if(iE(o.getModes(),n,t))return A.none();{((e,t,o)=>{o.setInitialPos({style:Pt(e),position:At(e,"position")||"static",bounds:t})})(e,n,o);const r=Go(),i=n.x-r.x,s=t.y-r.y,a=r.bottom-t.bottom,l=n.y<=t.y;return A.some(oE.fixed(Tl("fixed",A.some(i),l?A.some(s):A.none(),A.none(),l?A.none():A.some(a))))}})(n,t,o)},cE=(e,t,o)=>{o.setDocked(!1),z(["left","right","top","bottom","position"],(t=>Vt(e.element,t))),t.onUndocked(e)},dE=(e,t,o,n)=>{const r="fixed"===n.position;o.setDocked(r),El(e.element,n),(r?t.onDocked:t.onUndocked)(e)},uE=(e,t,o,n,r=!1)=>{t.contextual.each((t=>{t.lazyContext(e).each((i=>{const s=((e,t)=>e.y<t.bottom&&e.bottom>t.y)(i,n);s!==o.isVisible()&&(o.setVisible(s),r&&!s?(Vs(e.element,[t.fadeOutClass]),t.onHide(e)):(s?nE:rE)(e,t))}))}))},hE=(e,t,o)=>{e.getSystem().isConnected()&&((e,t,o)=>{const n=t.lazyViewport(e);o.isDocked()&&uE(e,t,o,n),lE(e,n,o).each((r=>{r.fold((()=>cE(e,t,o)),(n=>dE(e,t,o,n)),(r=>{uE(e,t,o,n,!0),dE(e,t,o,r)}))}))})(e,t,o)},mE=(e,t,o)=>{o.isDocked()&&((e,t,o)=>{const n=e.element;o.setDocked(!1),((e,t)=>{const o=e.element;return sE(o,t).bind((e=>aE(o,e,t)))})(e,o).each((n=>{n.fold((()=>cE(e,t,o)),(n=>dE(e,t,o,n)),v)})),o.setVisible(!0),t.contextual.each((t=>{Ns(n,[t.fadeInClass,t.fadeOutClass,t.transitionClass]),t.onShow(e)})),hE(e,t,o)})(e,t,o)};var pE=Object.freeze({__proto__:null,refresh:hE,reset:mE,isDocked:(e,t,o)=>o.isDocked(),getModes:(e,t,o)=>o.getModes(),setModes:(e,t,o,n)=>o.setModes(n)}),gE=Object.freeze({__proto__:null,events:(e,t)=>Mi([zi(Gr(),((o,n)=>{e.contextual.each((e=>{Rs(o.element,e.transitionClass)&&(Ns(o.element,[e.transitionClass,e.fadeInClass]),(t.isVisible()?e.onShown:e.onHidden)(o)),n.stop()}))})),Ri(hi(),((o,n)=>{hE(o,e,t)})),Ri(mi(),((o,n)=>{mE(o,e,t)}))])}),fE=[dr("contextual",[Kn("fadeInClass"),Kn("fadeOutClass"),Kn("transitionClass"),Qn("lazyContext"),_a("onShow"),_a("onShown"),_a("onHide"),_a("onHidden")]),vr("lazyViewport",Go),br("modes",["top","bottom"],Pn),_a("onDocked"),_a("onUndocked")];const vE=gl({fields:fE,name:"docking",active:gE,apis:pE,state:Object.freeze({__proto__:null,init:e=>{const t=wr(!1),o=wr(!0),n=Zl(),r=wr(e.modes);return vs({isDocked:t.get,setDocked:t.set,getInitialPos:n.get,setInitialPos:n.set,clearInitialPos:n.clear,isVisible:o.get,setVisible:o.set,getModes:r.get,setModes:r.set,readState:()=>`docked:  ${t.get()}, visible: ${o.get()}, modes: ${r.get().join(",")}`})}})}),bE=y(Qi("toolbar-height-change")),yE={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},wE="tox-tinymce--toolbar-sticky-on",_E="tox-tinymce--toolbar-sticky-off",xE=(e,t)=>N(vE.getModes(e),t),CE=e=>{const t=e.element;tt(t).each((o=>{const n="padding-"+vE.getModes(e)[0];if(vE.isDocked(e)){const e=Wt(o);Tt(t,"width",e+"px"),Tt(o,n,(e=>Lt(e)+(parseInt(At(e,"margin-top"),10)||0)+(parseInt(At(e,"margin-bottom"),10)||0))(t)+"px")}else Vt(t,"width"),Vt(o,n)}))},kE=(e,t)=>{t?(Ps(e,yE.fadeOutClass),Vs(e,[yE.transitionClass,yE.fadeInClass])):(Ps(e,yE.fadeInClass),Vs(e,[yE.fadeOutClass,yE.transitionClass]))},SE=(e,t)=>{const o=Ve(e.getContainer());t?(Bs(o,wE),Ps(o,_E)):(Bs(o,_E),Ps(o,wE))},TE=(e,t)=>{const o=Zl(),n=t.getSink,r=e=>{n().each((t=>e(t.element)))},i=t=>{e.inline||CE(t),SE(e,vE.isDocked(t)),t.getSystem().broadcastOn([Id()],{}),n().each((e=>e.getSystem().broadcastOn([Id()],{})))},s=e.inline?[]:[yl.config({channels:{[bE()]:{onReceive:CE}}})];return[Zp.config({}),vE.config({contextual:{lazyContext:t=>{const o=Lt(t.element),n=e.inline?e.getContentAreaContainer():e.getContainer(),r=Wo(Ve(n)),i=r.height-o,s=r.y+(xE(t,"top")?0:o);return A.some($o(r.x,s,r.width,i))},onShow:()=>{r((e=>kE(e,!0)))},onShown:e=>{r((e=>Ns(e,[yE.transitionClass,yE.fadeInClass]))),o.get().each((t=>{((e,t)=>{const o=Xe(t);Cl(o).filter((e=>!Ge(t,e))).filter((t=>Ge(t,Ve(o.dom.body))||Ye(e,t))).each((()=>_l(t)))})(e.element,t),o.clear()}))},onHide:e=>{((e,t)=>kl(e).orThunk((()=>t().toOptional().bind((e=>kl(e.element))))))(e.element,n).fold(o.clear,o.set),r((e=>kE(e,!1)))},onHidden:()=>{r((e=>Ns(e,[yE.transitionClass])))},...yE},lazyViewport:t=>{const o=Go(),n=ff(e),r=o.y+(xE(t,"top")?n:0),i=o.height-(xE(t,"bottom")?n:0);return $o(o.x,r,o.width,i)},modes:[t.header.getDockingMode()],onDocked:i,onUndocked:i}),...s]};var EE=Object.freeze({__proto__:null,setup:(e,t,o)=>{e.inline||(t.header.isPositionedAtTop()||e.on("ResizeEditor",(()=>{o().each(vE.reset)})),e.on("ResizeWindow ResizeEditor",(()=>{o().each(CE)})),e.on("SkinLoaded",(()=>{o().each((e=>{vE.isDocked(e)?vE.reset(e):vE.refresh(e)}))})),e.on("FullscreenStateChanged",(()=>{o().each(vE.reset)}))),e.on("AfterScrollIntoView",(e=>{o().each((t=>{vE.refresh(t);const o=t.element;xm(o)&&((e,t)=>{const o=Xe(t),n=Qe(t).dom.innerHeight,r=Fo(o),i=Ve(e.elm),s=qo(i),a=It(i),l=s.y,c=l+a,d=jt(t),u=It(t),h=d.top,m=h+u,p=Math.abs(h-r.top)<2,g=Math.abs(m-(r.top+n))<2;if(p&&l<m)Io(r.left,l-u,o);else if(g&&c>h){const e=l-n+a+u;Io(r.left,e,o)}})(e,o)}))})),e.on("PostRender",(()=>{SE(e,!1)}))},isDocked:e=>e().map(vE.isDocked).getOr(!1),getBehaviours:TE});const OE=kn([Iv,Yn("items",Tn([On([Lv,or("items",Pn)]),Pn]))].concat(pb)),AE=[sr("text"),sr("tooltip"),sr("icon"),hr("search",!1,Tn([Rn,kn([sr("placeholder")])],(e=>d(e)?e?A.some({placeholder:A.none()}):A.none():A.some(e)))),Qn("fetch"),vr("onSetup",(()=>v))],ME=kn([Iv,...AE]),BE=e=>zn("menubutton",ME,e),PE=kn([Iv,Qv,Jv,Kv,ob,$v,Yv,gr("presets","normal",["normal","color","listpreview"]),ab(1),qv,Gv]);var RE=rh({factory:(e,t)=>{const o={focus:Ep.focusIn,setMenus:(e,o)=>{const n=L(o,(e=>{const o={type:"menubutton",text:e.text,fetch:t=>{t(e.getItems())}},n=BE(o).mapError((e=>jn(e))).getOrDie();return sS(n,"tox-mbtn",t.backstage,A.some("menuitem"))}));Dp.set(e,n)}};return{uid:e.uid,dom:e.dom,components:[],behaviours:ml([Dp.config({}),Fp("menubar-events",[Hi((t=>{e.onSetup(t)})),Ri(Lr(),((e,t)=>{ra(e.element,".tox-mbtn--active").each((o=>{ia(t.event.target,".tox-mbtn").each((t=>{Ge(o,t)||e.getSystem().getByDom(o).each((o=>{e.getSystem().getByDom(t).each((e=>{r_.expand(e),r_.close(o),Zp.focus(e)}))}))}))}))})),Ri(bi(),((e,t)=>{t.event.prevFocus.bind((t=>e.getSystem().getByDom(t).toOptional())).each((o=>{t.event.newFocus.bind((t=>e.getSystem().getByDom(t).toOptional())).each((e=>{r_.isOpen(o)&&(r_.expand(e),r_.close(o))}))}))}))]),Ep.config({mode:"flow",selector:".tox-mbtn",onEscape:t=>(e.onEscape(t),A.some(!0))}),B_.config({})]),apis:o,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[Gn("dom"),Gn("uid"),Gn("onEscape"),Gn("backstage"),ur("onSetup",v)],apis:{focus:(e,t)=>{e.focus(t)},setMenus:(e,t,o)=>{e.setMenus(t,o)}}});const VE=(e,t)=>t.getAnimationRoot.fold((()=>e.element),(t=>t(e))),NE=e=>e.dimension.property,DE=(e,t)=>e.dimension.getDimension(t),FE=(e,t)=>{const o=VE(e,t);Ns(o,[t.shrinkingClass,t.growingClass])},IE=(e,t)=>{Ps(e.element,t.openClass),Bs(e.element,t.closedClass),Tt(e.element,NE(t),"0px"),Nt(e.element)},LE=(e,t)=>{Ps(e.element,t.closedClass),Bs(e.element,t.openClass),Vt(e.element,NE(t))},zE=(e,t,o,n)=>{o.setCollapsed(),Tt(e.element,NE(t),DE(t,e.element)),FE(e,t),IE(e,t),t.onStartShrink(e),t.onShrunk(e)},HE=(e,t,o,n)=>{const r=n.getOrThunk((()=>DE(t,e.element)));o.setCollapsed(),Tt(e.element,NE(t),r),Nt(e.element);const i=VE(e,t);Ps(i,t.growingClass),Bs(i,t.shrinkingClass),IE(e,t),t.onStartShrink(e)},ZE=(e,t,o)=>{const n=DE(t,e.element);("0px"===n?zE:HE)(e,t,o,A.some(n))},jE=(e,t,o)=>{const n=VE(e,t),r=Rs(n,t.shrinkingClass),i=DE(t,e.element);LE(e,t);const s=DE(t,e.element);(r?()=>{Tt(e.element,NE(t),i),Nt(e.element)}:()=>{IE(e,t)})(),Ps(n,t.shrinkingClass),Bs(n,t.growingClass),LE(e,t),Tt(e.element,NE(t),s),o.setExpanded(),t.onStartGrow(e)},UE=(e,t,o)=>{const n=VE(e,t);return!0===Rs(n,t.growingClass)},$E=(e,t,o)=>{const n=VE(e,t);return!0===Rs(n,t.shrinkingClass)};var WE=Object.freeze({__proto__:null,refresh:(e,t,o)=>{if(o.isExpanded()){Vt(e.element,NE(t));const o=DE(t,e.element);Tt(e.element,NE(t),o)}},grow:(e,t,o)=>{o.isExpanded()||jE(e,t,o)},shrink:(e,t,o)=>{o.isExpanded()&&ZE(e,t,o)},immediateShrink:(e,t,o)=>{o.isExpanded()&&zE(e,t,o)},hasGrown:(e,t,o)=>o.isExpanded(),hasShrunk:(e,t,o)=>o.isCollapsed(),isGrowing:UE,isShrinking:$E,isTransitioning:(e,t,o)=>UE(e,t)||$E(e,t),toggleGrow:(e,t,o)=>{(o.isExpanded()?ZE:jE)(e,t,o)},disableTransitions:FE,immediateGrow:(e,t,o)=>{o.isExpanded()||(LE(e,t),Tt(e.element,NE(t),DE(t,e.element)),FE(e,t),o.setExpanded(),t.onStartGrow(e),t.onGrown(e))}}),qE=Object.freeze({__proto__:null,exhibit:(e,t,o)=>{const n=t.expanded;return ys(n?{classes:[t.openClass],styles:{}}:{classes:[t.closedClass],styles:xr(t.dimension.property,"0px")})},events:(e,t)=>Mi([zi(Gr(),((o,n)=>{n.event.raw.propertyName===e.dimension.property&&(FE(o,e),t.isExpanded()&&Vt(o.element,e.dimension.property),(t.isExpanded()?e.onGrown:e.onShrunk)(o))}))])}),GE=[Gn("closedClass"),Gn("openClass"),Gn("shrinkingClass"),Gn("growingClass"),nr("getAnimationRoot"),_a("onShrunk"),_a("onStartShrink"),_a("onGrown"),_a("onStartGrow"),ur("expanded",!1),Yn("dimension",Un("property",{width:[Sa("property","width"),Sa("getDimension",(e=>Wt(e)+"px"))],height:[Sa("property","height"),Sa("getDimension",(e=>It(e)+"px"))]}))];const YE=gl({fields:GE,name:"sliding",active:qE,apis:WE,state:Object.freeze({__proto__:null,init:e=>{const t=wr(e.expanded);return vs({isExpanded:()=>!0===t.get(),isCollapsed:()=>!1===t.get(),setCollapsed:x(t.set,!1),setExpanded:x(t.set,!0),readState:()=>"expanded: "+t.get()})}})}),XE="container",KE=[nu("slotBehaviours",[])],JE=e=>"<alloy.field."+e+">",QE=(e,t)=>{const o=t=>Gu(e),n=(t,o)=>(n,r)=>Uu(n,e,r).map((e=>t(e,r))).getOr(o),r=(e,t)=>"true"!==wt(e.element,"aria-hidden"),i=n(r,!1),s=n(((e,t)=>{if(r(e)){const o=e.element;Tt(o,"display","none"),bt(o,"aria-hidden","true"),Si(e,yi(),{name:t,visible:!1})}})),a=(l=s,(e,t)=>{z(t,(t=>l(e,t)))});var l;const c=n(((e,t)=>{if(!r(e)){const o=e.element;Vt(o,"display"),Ct(o,"aria-hidden"),Si(e,yi(),{name:t,visible:!0})}})),d={getSlotNames:o,getSlot:(t,o)=>Uu(t,e,o),isShowing:i,hideSlot:s,hideAllSlots:e=>a(e,o()),showSlot:c};return{uid:e.uid,dom:e.dom,components:t,behaviours:ru(e.slotBehaviours),apis:d}},eO=ce({getSlotNames:(e,t)=>e.getSlotNames(t),getSlot:(e,t,o)=>e.getSlot(t,o),isShowing:(e,t,o)=>e.isShowing(t,o),hideSlot:(e,t,o)=>e.hideSlot(t,o),hideAllSlots:(e,t)=>e.hideAllSlots(t),showSlot:(e,t,o)=>e.showSlot(t,o)},(e=>gs(e))),tO={...eO,sketch:e=>{const t=(()=>{const e=[];return{slot:(t,o)=>(e.push(t),Lu(XE,JE(t),o)),record:y(e)}})(),o=e(t),n=t.record(),r=L(n,(e=>Mu({name:e,pname:JE(e)})));return eh(XE,KE,r,QE,o)}},oO=kn([Jv,Qv,vr("onShow",v),vr("onHide",v),Yv]),nO=e=>({element:()=>e.element.dom}),rO=(e,t)=>{const o=L(se(t),(e=>{const o=t[e],n=Hn((e=>zn("sidebar",oO,e))(o));return{name:e,getApi:nO,onSetup:n.onSetup,onShow:n.onShow,onHide:n.onHide}}));return L(o,(t=>{const n=wr(v);return e.slot(t.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:$b([cy(t,n),dy(t,n),Ri(yi(),((e,t)=>{const n=t.event,r=$(o,(e=>e.name===n.name));r.each((t=>{(n.visible?t.onShow:t.onHide)(t.getApi(e))}))}))])})}))},iO=e=>tO.sketch((t=>({dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:rO(t,e),slotBehaviours:$b([Hi((e=>tO.hideAllSlots(e)))])}))),sO=e=>ch.getCurrent(e).bind((e=>YE.isGrowing(e)||YE.hasGrown(e)?ch.getCurrent(e).bind((e=>$(tO.getSlotNames(e),(t=>tO.isShowing(e,t))))):A.none())),aO=Qi("FixSizeEvent"),lO=Qi("AutoSizeEvent");var cO=Object.freeze({__proto__:null,block:(e,t,o,n)=>{bt(e.element,"aria-busy",!0);const r=t.getRoot(e).getOr(e),i=ml([Ep.config({mode:"special",onTab:()=>A.some(!0),onShiftTab:()=>A.some(!0)}),Zp.config({})]),s=n(r,i),a=r.getSystem().build(s);Dp.append(r,Xs(a)),a.hasConfigured(Ep)&&t.focus&&Ep.focusIn(a),o.isBlocked()||t.onBlock(e),o.blockWith((()=>Dp.remove(r,a)))},unblock:(e,t,o)=>{Ct(e.element,"aria-busy"),o.isBlocked()&&t.onUnblock(e),o.clear()}}),dO=[vr("getRoot",A.none),fr("focus",!0),_a("onBlock"),_a("onUnblock")];const uO=gl({fields:dO,name:"blocking",apis:cO,state:Object.freeze({__proto__:null,init:()=>{const e=zl((e=>e.destroy()));return vs({readState:e.isSet,blockWith:t=>{e.set({destroy:t})},clear:e.clear,isBlocked:e.isSet})}})}),hO=e=>{const t=Be(e),o=nt(t),n=(e=>{const t=void 0!==e.dom.attributes?e.dom.attributes:[];return U(t,((e,t)=>"class"===t.name?e:{...e,[t.name]:t.value}),{})})(t),r=(e=>Array.prototype.slice.call(e.dom.classList,0))(t),i=0===o.length?{}:{innerHtml:$i(t)};return{tag:Le(t),classes:r,attributes:n,...i}},mO=e=>ch.getCurrent(e).each((e=>_l(e.element))),pO=(e,t,o)=>{const n=wr(!1),r=Zl(),i=o=>{var r;n.get()&&(!(e=>"focusin"===e.type)(r=o)||!(r.composed?oe(r.composedPath()):A.from(r.target)).map(Ve).filter(He).exists((e=>Rs(e,"mce-pastebin"))))&&(o.preventDefault(),mO(t()),e.editorManager.setActive(e))};e.inline||e.on("PreInit",(()=>{e.dom.bind(e.getWin(),"focusin",i),e.on("BeforeExecCommand",(e=>{"mcefocus"===e.command.toLowerCase()&&!0!==e.value&&i(e)}))}));const s=r=>{r!==n.get()&&(n.set(r),((e,t,o,n)=>{const r=t.element;if(((e,t)=>{const o="tabindex",n=`data-mce-${o}`;A.from(e.iframeElement).map(Ve).each((e=>{t?(_t(e,o).each((t=>bt(e,n,t))),bt(e,o,-1)):(Ct(e,o),_t(e,n).each((t=>{bt(e,o,t),Ct(e,n)})))}))})(e,o),o)uO.block(t,(e=>(t,o)=>({dom:{tag:"div",attributes:{"aria-label":e.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:hO('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}))(n)),Vt(r,"display"),Ct(r,"aria-hidden"),e.hasFocus()&&mO(t);else{const o=ch.getCurrent(t).exists((e=>xl(e.element)));uO.unblock(t),Tt(r,"display","none"),bt(r,"aria-hidden","true"),o&&e.focus()}})(e,t(),r,o.providers),((e,t)=>{e.dispatch("AfterProgressState",{state:t})})(e,r))};e.on("ProgressState",(t=>{if(r.on(clearTimeout),g(t.time)){const o=Og.setEditorTimeout(e,(()=>s(t.state)),t.time);r.set(o)}else s(t.state),r.clear()}))},gO=(e,t,o)=>({within:e,extra:t,withinWidth:o}),fO=(e,t,o)=>{const n=U(e,((e,t)=>((e,t)=>{const n=o(e);return A.some({element:e,start:t,finish:t+n,width:n})})(t,e.len).fold(y(e),(t=>({len:t.finish,list:e.list.concat([t])})))),{len:0,list:[]}).list,r=Z(n,(e=>e.finish<=t)),i=j(r,((e,t)=>e+t.width),0);return{within:r,extra:n.slice(r.length),withinWidth:i}},vO=e=>L(e,(e=>e.element)),bO=(e,t)=>{const o=L(t,(e=>Xs(e)));GT.setGroups(e,o)},yO=(e,t,o)=>{const n=t.builtGroups.get();if(0===n.length)return;const r=$u(e,t,"primary"),i=Iw.getCoupled(e,"overflowGroup");Tt(r.element,"visibility","hidden");const s=n.concat([i]),a=ie(s,(e=>kl(e.element).bind((t=>e.getSystem().getByDom(t).toOptional()))));o([]),bO(r,s);const l=((e,t,o,n)=>{const r=((e,t,o)=>{const n=fO(t,e,o);return 0===n.extra.length?A.some(n):A.none()})(e,t,o).getOrThunk((()=>fO(t,e-o(n),o))),i=r.within,s=r.extra,a=r.withinWidth;return 1===s.length&&s[0].width<=o(n)?((e,t,o)=>{const n=vO(e.concat(t));return gO(n,[],o)})(i,s,a):s.length>=1?((e,t,o,n)=>{const r=vO(e).concat([o]);return gO(r,vO(t),n)})(i,s,n,a):((e,t,o)=>gO(vO(e),[],o))(i,0,a)})(Wt(r.element),t.builtGroups.get(),(e=>Wt(e.element)),i);0===l.extra.length?(Dp.remove(r,i),o([])):(bO(r,l.within),o(l.extra)),Vt(r.element,"visibility"),Nt(r.element),a.each(Zp.focus)},wO=y([nu("splitToolbarBehaviours",[Iw]),Wn("builtGroups",(()=>wr([])))]),_O=y([ya(["overflowToggledClass"]),lr("getOverflowBounds"),Gn("lazySink"),Wn("overflowGroups",(()=>wr([]))),_a("onOpened"),_a("onClosed")].concat(wO())),xO=y([Mu({factory:GT,schema:WT(),name:"primary"}),Bu({schema:WT(),name:"overflow"}),Bu({name:"overflow-button"}),Bu({name:"overflow-group"})]),CO=y(((e,t)=>{((e,t)=>{const o=$t.max(e,t,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);Tt(e,"max-width",o+"px")})(e,Math.floor(t))})),kO=y([ya(["toggledClass"]),Gn("lazySink"),Qn("fetch"),lr("getBounds"),dr("fireDismissalEventInstead",[ur("event",fi())]),dc(),_a("onToggled")]),SO=y([Bu({name:"button",overrides:e=>({dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:ml([Xp.config({toggleClass:e.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1,onToggled:e.onToggled})])})}),Bu({factory:GT,schema:WT(),name:"toolbar",overrides:e=>({toolbarBehaviours:ml([Ep.config({mode:"cyclic",onEscape:t=>(Uu(t,e,"button").each(Zp.focus),A.none())})])})})]),TO=(e,t)=>{const o=Iw.getCoupled(e,"toolbarSandbox");Dd.isOpen(o)?Dd.close(o):Dd.open(o,t.toolbar())},EO=(e,t,o,n)=>{const r=o.getBounds.map((e=>e())),i=o.lazySink(e).getOrDie();ud.positionWithinBounds(i,t,{anchor:{type:"hotspot",hotspot:e,layouts:n,overrides:{maxWidthFunction:CO()}}},r)},OO=(e,t,o,n,r)=>{GT.setGroups(t,r),EO(e,t,o,n),Xp.on(e)},AO=ih({name:"FloatingToolbarButton",factory:(e,t,o,n)=>({...Ag.sketch({...n.button(),action:e=>{TO(e,n)},buttonBehaviours:au({dump:n.button().buttonBehaviours},[Iw.config({others:{toolbarSandbox:t=>((e,t,o)=>{const n=aa();return{dom:{tag:"div",attributes:{id:n.id}},behaviours:ml([Ep.config({mode:"special",onEscape:e=>(Dd.close(e),A.some(!0))}),Dd.config({onOpen:(r,i)=>{o.fetch().get((r=>{OO(e,i,o,t.layouts,r),n.link(e.element),Ep.focusIn(i)}))},onClose:()=>{Xp.off(e),Zp.focus(e),n.unlink(e.element)},isPartOf:(t,o,n)=>la(o,n)||la(e,n),getAttachPoint:()=>o.lazySink(e).getOrDie()}),yl.config({channels:{...Hd({isExtraPart:T,...o.fireDismissalEventInstead.map((e=>({fireEventInstead:{event:e.event}}))).getOr({})}),...jd({doReposition:()=>{Dd.getState(Iw.getCoupled(e,"toolbarSandbox")).each((n=>{EO(e,n,o,t.layouts)}))}})}})])}})(t,o,e)}})])}),apis:{setGroups:(t,n)=>{Dd.getState(Iw.getCoupled(t,"toolbarSandbox")).each((r=>{OO(t,r,e,o.layouts,n)}))},reposition:t=>{Dd.getState(Iw.getCoupled(t,"toolbarSandbox")).each((n=>{EO(t,n,e,o.layouts)}))},toggle:e=>{TO(e,n)},getToolbar:e=>Dd.getState(Iw.getCoupled(e,"toolbarSandbox")),isOpen:e=>Dd.isOpen(Iw.getCoupled(e,"toolbarSandbox"))}}),configFields:kO(),partFields:SO(),apis:{setGroups:(e,t,o)=>{e.setGroups(t,o)},reposition:(e,t)=>{e.reposition(t)},toggle:(e,t)=>{e.toggle(t)},getToolbar:(e,t)=>e.getToolbar(t),isOpen:(e,t)=>e.isOpen(t)}}),MO=y([Gn("items"),ya(["itemSelector"]),nu("tgroupBehaviours",[Ep])]),BO=y([Ru({name:"items",unit:"item"})]),PO=ih({name:"ToolbarGroup",configFields:MO(),partFields:BO(),factory:(e,t,o,n)=>({uid:e.uid,dom:e.dom,components:t,behaviours:iu(e.tgroupBehaviours,[Ep.config({mode:"flow",selector:e.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}})}),RO=e=>L(e,(e=>Xs(e))),VO=(e,t,o)=>{yO(e,o,(n=>{o.overflowGroups.set(n),t.getOpt(e).each((e=>{AO.setGroups(e,RO(n))}))}))},NO=ih({name:"SplitFloatingToolbar",configFields:_O(),partFields:xO(),factory:(e,t,o,n)=>{const r=Mg(AO.sketch({fetch:()=>jw((t=>{t(RO(e.overflowGroups.get()))})),layouts:{onLtr:()=>[Ya,Ga],onRtl:()=>[Ga,Ya],onBottomLtr:()=>[Ka,Xa],onBottomRtl:()=>[Xa,Ka]},getBounds:o.getOverflowBounds,lazySink:e.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:e.markers.overflowToggledClass},parts:{button:n["overflow-button"](),toolbar:n.overflow()},onToggled:(t,o)=>e[o?"onOpened":"onClosed"](t)}));return{uid:e.uid,dom:e.dom,components:t,behaviours:iu(e.splitToolbarBehaviours,[Iw.config({others:{overflowGroup:()=>PO.sketch({...n["overflow-group"](),items:[r.asSpec()]})}})]),apis:{setGroups:(t,o)=>{e.builtGroups.set(L(o,t.getSystem().build)),VO(t,r,e)},refresh:t=>VO(t,r,e),toggle:e=>{r.getOpt(e).each((e=>{AO.toggle(e)}))},isOpen:e=>r.getOpt(e).map(AO.isOpen).getOr(!1),reposition:e=>{r.getOpt(e).each((e=>{AO.reposition(e)}))},getOverflow:e=>r.getOpt(e).bind(AO.getToolbar)},domModification:{attributes:{role:"group"}}}},apis:{setGroups:(e,t,o)=>{e.setGroups(t,o)},refresh:(e,t)=>{e.refresh(t)},reposition:(e,t)=>{e.reposition(t)},toggle:(e,t)=>{e.toggle(t)},isOpen:(e,t)=>e.isOpen(t),getOverflow:(e,t)=>e.getOverflow(t)}}),DO=y([ya(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),_a("onOpened"),_a("onClosed")].concat(wO())),FO=y([Mu({factory:GT,schema:WT(),name:"primary"}),Mu({factory:GT,schema:WT(),name:"overflow",overrides:e=>({toolbarBehaviours:ml([YE.config({dimension:{property:"height"},closedClass:e.markers.closedClass,openClass:e.markers.openClass,shrinkingClass:e.markers.shrinkingClass,growingClass:e.markers.growingClass,onShrunk:t=>{Uu(t,e,"overflow-button").each((e=>{Xp.off(e),Zp.focus(e)})),e.onClosed(t)},onGrown:t=>{Ep.focusIn(t),e.onOpened(t)},onStartGrow:t=>{Uu(t,e,"overflow-button").each(Xp.on)}}),Ep.config({mode:"acyclic",onEscape:t=>(Uu(t,e,"overflow-button").each(Zp.focus),A.some(!0))})])})}),Bu({name:"overflow-button",overrides:e=>({buttonBehaviours:ml([Xp.config({toggleClass:e.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])})}),Bu({name:"overflow-group"})]),IO=(e,t)=>{Uu(e,t,"overflow-button").bind((()=>Uu(e,t,"overflow"))).each((o=>{LO(e,t),YE.toggleGrow(o)}))},LO=(e,t)=>{Uu(e,t,"overflow").each((o=>{yO(e,t,(e=>{const t=L(e,(e=>Xs(e)));GT.setGroups(o,t)})),Uu(e,t,"overflow-button").each((e=>{YE.hasGrown(o)&&Xp.on(e)})),YE.refresh(o)}))},zO=ih({name:"SplitSlidingToolbar",configFields:DO(),partFields:FO(),factory:(e,t,o,n)=>{const r="alloy.toolbar.toggle";return{uid:e.uid,dom:e.dom,components:t,behaviours:iu(e.splitToolbarBehaviours,[Iw.config({others:{overflowGroup:e=>PO.sketch({...n["overflow-group"](),items:[Ag.sketch({...n["overflow-button"](),action:t=>{ki(e,r)}})]})}}),Fp("toolbar-toggle-events",[Ri(r,(t=>{IO(t,e)}))])]),apis:{setGroups:(t,o)=>{((t,o)=>{const n=L(o,t.getSystem().build);e.builtGroups.set(n)})(t,o),LO(t,e)},refresh:t=>LO(t,e),toggle:t=>IO(t,e),isOpen:t=>((e,t)=>Uu(e,t,"overflow").map(YE.hasGrown).getOr(!1))(t,e)},domModification:{attributes:{role:"group"}}}},apis:{setGroups:(e,t,o)=>{e.setGroups(t,o)},refresh:(e,t)=>{e.refresh(t)},toggle:(e,t)=>{e.toggle(t)},isOpen:(e,t)=>e.isOpen(t)}}),HO=e=>{const t=e.title.fold((()=>({})),(e=>({attributes:{title:e}})));return{dom:{tag:"div",classes:["tox-toolbar__group"],...t},components:[PO.parts.items({})],items:e.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:ml([B_.config({}),Zp.config({})])}},ZO=e=>PO.sketch(HO(e)),jO=(e,t)=>{const o=Hi((t=>{const o=L(e.initGroups,ZO);GT.setGroups(t,o)}));return ml([ay(e.providers.isDisabled),ry(),Ep.config({mode:t,onEscape:e.onEscape,selector:".tox-toolbar__group"}),Fp("toolbar-events",[o])])},UO=e=>{const t=e.cyclicKeying?"cyclic":"acyclic";return{uid:e.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":HO({title:A.none(),items:[]}),"overflow-button":cS({name:"more",icon:A.some("more-drawer"),enabled:!0,tooltip:A.some("More..."),primary:!1,buttonType:A.none(),borderless:!1},A.none(),e.providers)},splitToolbarBehaviours:jO(e,t)}},$O=e=>{const t=UO(e),o=NO.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return NO.sketch({...t,lazySink:e.getSink,getOverflowBounds:()=>{const t=e.moreDrawerData.lazyHeader().element,o=qo(t),n=Je(t),r=qo(n),i=Math.max(n.dom.scrollHeight,r.height);return $o(o.x+4,r.y,o.width-8,i)},parts:{...t.parts,overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:e.attributes}}},components:[o],markers:{overflowToggledClass:"tox-tbtn--enabled"},onOpened:t=>e.onToggled(t,!0),onClosed:t=>e.onToggled(t,!1)})},WO=e=>{const t=zO.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),o=zO.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),n=UO(e);return zO.sketch({...n,components:[t,o],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:t=>{t.getSystem().broadcastOn([bE()],{type:"opened"}),e.onToggled(t,!0)},onClosed:t=>{t.getSystem().broadcastOn([bE()],{type:"closed"}),e.onToggled(t,!1)}})},qO=e=>{const t=e.cyclicKeying?"cyclic":"acyclic";return GT.sketch({uid:e.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(e.type===jg.scrolling?["tox-toolbar--scrolling"]:[])},components:[GT.parts.groups({})],toolbarBehaviours:jO(e,t)})},GO=[Jn("type",["button"]),Hv,gr("buttonType","secondary",["primary","secondary"]),Qn("onAction")],YO=Un("type",{button:GO}),XO=kn([br("buttons",[],YO),Qn("onShow"),Qn("onHide")]);var KO=ih({name:"silver.View",configFields:[Gn("viewConfig")],partFields:[Pu({factory:{sketch:e=>{const t=L(e.buttons,(t=>((e,t)=>uS({text:e.text,enabled:!0,primary:!1,name:"name",icon:A.none(),borderless:!1,buttonType:A.some(e.buttonType)},(t=>{e.onAction()}),t))(t,e.providers)));return{uid:e.uid,dom:{tag:"div",classes:["tox-view__header"]},components:[k_.sketch({dom:{tag:"div",classes:["tox-view__header-start"]},components:[]}),k_.sketch({dom:{tag:"div",classes:["tox-view__header-end"]},components:t})]}}},schema:[Gn("buttons"),Gn("providers")],name:"header"}),Pu({factory:{sketch:e=>({uid:e.uid,dom:{tag:"div",classes:["tox-view__pane"]}})},schema:[],name:"pane"})],factory:(e,t,o,n)=>{const r={getPane:t=>zT.getPart(t,e,"pane"),getOnShow:t=>e.viewConfig.onShow,getOnHide:t=>e.viewConfig.onHide};return{uid:e.uid,dom:e.dom,components:t,apis:r}},apis:{getPane:(e,t)=>e.getPane(t),getOnShow:(e,t)=>e.getOnShow(t),getOnHide:(e,t)=>e.getOnHide(t)}});const JO=(e,t,o)=>pe(t,((t,n)=>{const r=Hn(zn("view",XO,t));return e.slot(n,KO.sketch({dom:{tag:"div",classes:["tox-view"]},viewConfig:r,components:[...r.buttons.length>0?[KO.parts.header({buttons:r.buttons,providers:o})]:[],KO.parts.pane({})]}))})),QO=(e,t)=>tO.sketch((o=>({dom:{tag:"div",classes:["tox-view-wrap__slot-container"]},components:JO(o,e,t),slotBehaviours:$b([Hi((e=>tO.hideAllSlots(e)))])}))),eA=e=>$(tO.getSlotNames(e),(t=>tO.isShowing(e,t))),tA=(e,t,o)=>{tO.getSlot(e,t).each((e=>{KO.getPane(e).each((t=>{var n;o(e)((n=t.element.dom,{getContainer:y(n)}))}))}))};var oA=rh({factory:(e,t)=>{const o={setViews:(e,o)=>{Dp.set(e,[QO(o,t.backstage.shared.providers)])},whichView:e=>ch.getCurrent(e).bind(eA),toggleView:(e,t,o,n)=>ch.getCurrent(e).exists((r=>{const i=eA(r),s=i.exists((e=>n===e)),a=tO.getSlot(r,n).isSome();return a&&(tO.hideAllSlots(r),s?((e=>{const t=e.element;Tt(t,"display","none"),bt(t,"aria-hidden","true")})(e),t()):(o(),(e=>{const t=e.element;Vt(t,"display"),Ct(t,"aria-hidden")})(e),tO.showSlot(r,n),((e,t)=>{tA(e,t,KO.getOnShow)})(r,n)),i.each((e=>((e,t)=>tA(e,t,KO.getOnHide))(r,e)))),a}))};return{uid:e.uid,dom:{tag:"div",classes:["tox-view-wrap"],attributes:{"aria-hidden":"true"},styles:{display:"none"}},components:[],behaviours:ml([Dp.config({}),ch.config({find:e=>{const t=Dp.contents(e);return oe(t)}})]),apis:o}},name:"silver.ViewWrapper",configFields:[Gn("backstage")],apis:{setViews:(e,t,o)=>e.setViews(t,o),toggleView:(e,t,o,n,r)=>e.toggleView(t,o,n,r),whichView:(e,t)=>e.whichView(t)}});const nA=HT.optional({factory:RE,name:"menubar",schema:[Gn("backstage")]}),rA=HT.optional({factory:{sketch:e=>$T.sketch({uid:e.uid,dom:e.dom,listBehaviours:ml([Ep.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:()=>qO({type:e.type,uid:Qi("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:e.providers,onEscape:()=>(e.onEscape(),A.some(!0))}),setupItem:(e,t,o,n)=>{GT.setGroups(t,o)},shell:!0})},name:"multiple-toolbar",schema:[Gn("dom"),Gn("onEscape")]}),iA=HT.optional({factory:{sketch:e=>{const t=(e=>e.type===jg.sliding?WO:e.type===jg.floating?$O:qO)(e);return t({type:e.type,uid:e.uid,onEscape:()=>(e.onEscape(),A.some(!0)),onToggled:(t,o)=>e.onToolbarToggled(o),cyclicKeying:!1,initGroups:[],getSink:e.getSink,providers:e.providers,moreDrawerData:{lazyToolbar:e.lazyToolbar,lazyMoreButton:e.lazyMoreButton,lazyHeader:e.lazyHeader},attributes:e.attributes})}},name:"toolbar",schema:[Gn("dom"),Gn("onEscape"),Gn("getSink")]}),sA=HT.optional({factory:{sketch:e=>{const t=e.editor,o=e.sticky?TE:KT;return{uid:e.uid,dom:e.dom,components:e.components,behaviours:ml(o(t,e.sharedBackstage))}}},name:"header",schema:[Gn("dom")]}),aA=HT.optional({factory:{sketch:e=>({uid:e.uid,dom:e.dom,components:[{dom:{tag:"a",attributes:{href:"https://www.tiny.cloud/tinymce-self-hosted-premium-features/?utm_source=TinyMCE&utm_medium=SPAP&utm_campaign=SPAP&utm_id=editorreferral",rel:"noopener",target:"_blank","aria-hidden":"true"},classes:["tox-promotion-link"],innerHtml:"⚡️Upgrade"}}]})},name:"promotion",schema:[Gn("dom")]}),lA=HT.optional({name:"socket",schema:[Gn("dom")]}),cA=HT.optional({factory:{sketch:e=>({uid:e.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:ml([B_.config({}),Zp.config({}),YE.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:e=>{ch.getCurrent(e).each(tO.hideAllSlots),ki(e,lO)},onGrown:e=>{ki(e,lO)},onStartGrow:e=>{Si(e,aO,{width:Bt(e.element,"width").getOr("")})},onStartShrink:e=>{Si(e,aO,{width:Wt(e.element)+"px"})}}),Dp.config({}),ch.config({find:e=>{const t=Dp.contents(e);return oe(t)}})])}],behaviours:ml([ek(0),Fp("sidebar-sliding-events",[Ri(aO,((e,t)=>{Tt(e.element,"width",t.event.width)})),Ri(lO,((e,t)=>{Vt(e.element,"width")}))])])})},name:"sidebar",schema:[Gn("dom")]}),dA=HT.optional({factory:{sketch:e=>({uid:e.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:ml([Dp.config({}),uO.config({focus:!1}),ch.config({find:e=>oe(e.components())})]),components:[]})},name:"throbber",schema:[Gn("dom")]}),uA=HT.optional({factory:oA,name:"viewWrapper",schema:[Gn("backstage")]}),hA=HT.optional({factory:{sketch:e=>({uid:e.uid,dom:{tag:"div",classes:["tox-editor-container"]},components:e.components})},name:"editorContainer",schema:[]});var mA=ih({name:"OuterContainer",factory:(e,t,o)=>{let n=!1;const r={getSocket:t=>zT.getPart(t,e,"socket"),setSidebar:(t,o,n)=>{zT.getPart(t,e,"sidebar").each((e=>((e,t,o)=>{ch.getCurrent(e).each((e=>{Dp.set(e,[iO(t)]);const n=null==o?void 0:o.toLowerCase();i(n)&&be(t,n)&&ch.getCurrent(e).each((t=>{tO.showSlot(t,n),YE.immediateGrow(e),Vt(e.element,"width")}))}))})(e,o,n)))},toggleSidebar:(t,o)=>{zT.getPart(t,e,"sidebar").each((e=>((e,t)=>{ch.getCurrent(e).each((e=>{ch.getCurrent(e).each((o=>{YE.hasGrown(e)?tO.isShowing(o,t)?YE.shrink(e):(tO.hideAllSlots(o),tO.showSlot(o,t)):(tO.hideAllSlots(o),tO.showSlot(o,t),YE.grow(e))}))}))})(e,o)))},whichSidebar:t=>zT.getPart(t,e,"sidebar").bind(sO).getOrNull(),getHeader:t=>zT.getPart(t,e,"header"),getToolbar:t=>zT.getPart(t,e,"toolbar"),setToolbar:(t,o)=>{zT.getPart(t,e,"toolbar").each((e=>{const t=L(o,ZO);e.getApis().setGroups(e,t)}))},setToolbars:(t,o)=>{zT.getPart(t,e,"multiple-toolbar").each((e=>{const t=L(o,(e=>L(e,ZO)));$T.setItems(e,t)}))},refreshToolbar:t=>{zT.getPart(t,e,"toolbar").each((e=>e.getApis().refresh(e)))},toggleToolbarDrawer:t=>{zT.getPart(t,e,"toolbar").each((e=>{var t,o;o=t=>t(e),null!=(t=e.getApis().toggle)?A.some(o(t)):A.none()}))},isToolbarDrawerToggled:t=>zT.getPart(t,e,"toolbar").bind((e=>A.from(e.getApis().isOpen).map((t=>t(e))))).getOr(!1),getThrobber:t=>zT.getPart(t,e,"throbber"),focusToolbar:t=>{zT.getPart(t,e,"toolbar").orThunk((()=>zT.getPart(t,e,"multiple-toolbar"))).each((e=>{Ep.focusIn(e)}))},setMenubar:(t,o)=>{zT.getPart(t,e,"menubar").each((e=>{RE.setMenus(e,o)}))},focusMenubar:t=>{zT.getPart(t,e,"menubar").each((e=>{RE.focus(e)}))},setViews:(t,o)=>{zT.getPart(t,e,"viewWrapper").each((e=>{oA.setViews(e,o)}))},toggleView:(t,o)=>zT.getPart(t,e,"viewWrapper").exists((e=>oA.toggleView(e,(()=>r.showMainView(t)),(()=>r.hideMainView(t)),o))),whichView:t=>zT.getPart(t,e,"viewWrapper").bind(oA.whichView).getOrNull(),hideMainView:t=>{n=r.isToolbarDrawerToggled(t),n&&r.toggleToolbarDrawer(t),zT.getPart(t,e,"editorContainer").each((e=>{const t=e.element;Tt(t,"display","none"),bt(t,"aria-hidden","true")}))},showMainView:t=>{n&&r.toggleToolbarDrawer(t),zT.getPart(t,e,"editorContainer").each((e=>{const t=e.element;Vt(t,"display"),Ct(t,"aria-hidden")}))}};return{uid:e.uid,dom:e.dom,components:t,apis:r,behaviours:e.behaviours}},configFields:[Gn("dom"),Gn("behaviours")],partFields:[sA,nA,iA,rA,lA,cA,aA,dA,uA,hA],apis:{getSocket:(e,t)=>e.getSocket(t),setSidebar:(e,t,o,n)=>{e.setSidebar(t,o,n)},toggleSidebar:(e,t,o)=>{e.toggleSidebar(t,o)},whichSidebar:(e,t)=>e.whichSidebar(t),getHeader:(e,t)=>e.getHeader(t),getToolbar:(e,t)=>e.getToolbar(t),setToolbar:(e,t,o)=>{e.setToolbar(t,o)},setToolbars:(e,t,o)=>{e.setToolbars(t,o)},refreshToolbar:(e,t)=>e.refreshToolbar(t),toggleToolbarDrawer:(e,t)=>{e.toggleToolbarDrawer(t)},isToolbarDrawerToggled:(e,t)=>e.isToolbarDrawerToggled(t),getThrobber:(e,t)=>e.getThrobber(t),setMenubar:(e,t,o)=>{e.setMenubar(t,o)},focusMenubar:(e,t)=>{e.focusMenubar(t)},focusToolbar:(e,t)=>{e.focusToolbar(t)},setViews:(e,t,o)=>{e.setViews(t,o)},toggleView:(e,t,o)=>e.toggleView(t,o),whichView:(e,t)=>e.whichView(t)}});const pA={file:{title:"File",items:"newdocument restoredraft | preview | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor tableofcontents footnotes | mergetags | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | styles blocks fontfamily fontsize align lineheight | forecolor backcolor | language | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | autocorrect capitalization | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},gA=e=>e.split(" "),fA=(e,t)=>{const o={...pA,...t.menus},n=se(t.menus).length>0,r=void 0===t.menubar||!0===t.menubar?gA("file edit view insert format tools table help"):gA(!1===t.menubar?"":t.menubar),s=Z(r,(e=>{const o=be(pA,e);return n?o||ve(t.menus,e).exists((e=>be(e,"items"))):o})),a=L(s,(n=>{const r=o[n];return((e,t,o)=>{const n=cf(o).split(/[ ,]/);return{text:e.title,getItems:()=>G(e.items,(e=>{const o=e.toLowerCase();return 0===o.trim().length||D(n,(e=>e===o))?[]:"separator"===o||"|"===o?[{type:"separator"}]:t.menuItems[o]?[t.menuItems[o]]:[]}))}})({title:r.title,items:gA(r.items)},t,e)}));return Z(a,(e=>e.getItems().length>0&&D(e.getItems(),(e=>i(e)||"separator"!==e.type))))},vA=e=>{const t=()=>{e._skinLoaded=!0,(e=>{e.dispatch("SkinLoaded")})(e)};return()=>{e.initialized?t():e.on("init",t)}},bA=(e,t,o)=>(e.on("remove",(()=>o.unload(t))),o.load(t)),yA=(e,t)=>bA(e,t+"/skin.min.css",e.ui.styleSheetLoader),wA=(e,t)=>{var o;return o=Ve(e.getElement()),ht(o).isSome()?bA(e,t+"/skin.shadowdom.min.css",$g.DOM.styleSheetLoader):Promise.resolve()},_A=(e,t)=>{const o=Nf(t);o&&t.contentCSS.push(o+(e?"/content.inline":"/content")+".min.css"),!Rf(t)&&i(o)?Promise.all([yA(t,o),wA(t,o)]).then(vA(t),((e,t)=>()=>((e,t)=>{e.dispatch("SkinLoadError",t)})(e,{message:"Skin could not be loaded"}))(t)):vA(t)()},xA=x(_A,!1),CA=x(_A,!0),kA=(e,t)=>o=>{const n=Hl(),r=()=>{o.setActive(e.formatter.match(t));const r=e.formatter.formatChanged(t,o.setActive);n.set(r)};return e.initialized?r():e.once("init",r),()=>{e.off("init",r),n.clear()}},SA=(e,t,o)=>n=>{const r=()=>o(n),i=()=>{o(n),e.on(t,r)};return e.initialized?i():e.once("init",i),()=>{e.off("init",i),e.off(t,r)}},TA=e=>t=>()=>{e.undoManager.transact((()=>{e.focus(),e.execCommand("mceToggleFormat",!1,t.format)}))},EA=(e,t)=>()=>e.execCommand(t),OA=(e,t,o)=>{const n=(e,n,i,s)=>{const a=t.shared.providers.translate(e.title);if("separator"===e.type)return A.some({type:"separator",text:a});if("submenu"===e.type){const t=G(e.getStyleItems(),(e=>r(e,n,s)));return 0===n&&t.length<=0?A.none():A.some({type:"nestedmenuitem",text:a,enabled:t.length>0,getSubmenuItems:()=>G(e.getStyleItems(),(e=>r(e,n,s)))})}return A.some({type:"togglemenuitem",text:a,icon:e.icon,active:e.isSelected(s),enabled:!i,onAction:o.onAction(e),...e.getStylePreview().fold((()=>({})),(e=>({meta:{style:e}})))})},r=(e,t,r)=>{const i="formatter"===e.type&&o.isInvalid(e);return 0===t?i?[]:n(e,t,!1,r).toArray():n(e,t,i,r).toArray()},i=e=>{const t=o.getCurrentValue(),n=o.shouldHide?0:1;return G(e,(e=>r(e,n,t)))};return{validateItems:i,getFetch:(e,t)=>(o,n)=>{const r=t(),s=i(r);n(Mk(s,Kf.CLOSE_ON_EXECUTE,e,{isHorizontalMenu:!1,search:A.none()}))}}},AA=(e,t,o)=>{const n=o.dataset,r="basic"===n.type?()=>L(n.data,(e=>mT(e,o.isSelectedFor,o.getPreviewFor))):n.getData;return{items:OA(0,t,o),getStyleItems:r}},MA=(e,t,o)=>{const{items:n,getStyleItems:r}=AA(0,t,o),i=SA(e,"NodeChange",(e=>{const t=e.getComponent();o.updateText(t)}));return Tk({text:o.icon.isSome()?A.none():o.text,icon:o.icon,tooltip:A.from(o.tooltip),role:A.none(),fetch:n.getFetch(t,r),onSetup:i,getApi:e=>({getComponent:y(e)}),columns:1,presets:"normal",classes:o.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",t.shared)};var BA;!function(e){e[e.SemiColon=0]="SemiColon",e[e.Space=1]="Space"}(BA||(BA={}));const PA=(e,t,o)=>{const n=(r=((e,t)=>t===BA.SemiColon?e.replace(/;$/,"").split(";"):e.split(" "))(e.options.get(t),o),L(r,(e=>{let t=e,o=e;const n=e.split("=");return n.length>1&&(t=n[0],o=n[1]),{title:t,format:o}})));var r;return{type:"basic",data:n}},RA=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}],VA=e=>{const t={type:"basic",data:RA};return{tooltip:"Align",text:A.none(),icon:A.some("align-left"),isSelectedFor:t=>()=>e.formatter.match(t),getCurrentValue:A.none,getPreviewFor:e=>A.none,onAction:t=>()=>$(RA,(e=>e.format===t.format)).each((t=>e.execCommand(t.command))),updateText:t=>{const o=$(RA,(t=>e.formatter.match(t.format))).fold(y("left"),(e=>e.title.toLowerCase()));Si(t,Sk,{icon:`align-${o}`})},dataset:t,shouldHide:!1,isInvalid:t=>!e.formatter.canApply(t.format)}},NA=(e,t)=>{const o=t(),n=L(o,(e=>e.format));return A.from(e.formatter.closest(n)).bind((e=>$(o,(t=>t.format===e)))).orThunk((()=>Ce(e.formatter.match("p"),{title:"Paragraph",format:"p"})))},DA=e=>{const t="Paragraph",o=PA(e,"block_formats",BA.SemiColon);return{tooltip:"Blocks",text:A.some(t),icon:A.none(),isSelectedFor:t=>()=>e.formatter.match(t),getCurrentValue:A.none,getPreviewFor:t=>()=>{const o=e.formatter.get(t);return o?A.some({tag:o.length>0&&(o[0].inline||o[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))}):A.none()},onAction:TA(e),updateText:n=>{const r=NA(e,(()=>o.data)).fold(y(t),(e=>e.title));Si(n,kk,{text:r})},dataset:o,shouldHide:!1,isInvalid:t=>!e.formatter.canApply(t.format)}},FA=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],IA=e=>{const t=e.split(/\s*,\s*/);return L(t,(e=>e.replace(/^['"]+|['"]+$/g,"")))},LA=e=>{const t="System Font",o=()=>{const o=e=>e?IA(e)[0]:"",r=e.queryCommandValue("FontName"),i=n.data,s=r?r.toLowerCase():"",a=$(i,(e=>{const t=e.format;return t.toLowerCase()===s||o(t).toLowerCase()===o(s).toLowerCase()})).orThunk((()=>Ce((e=>0===e.indexOf("-apple-system")&&(()=>{const t=IA(e.toLowerCase());return Y(FA,(e=>t.indexOf(e.toLowerCase())>-1))})())(s),{title:t,format:s})));return{matchOpt:a,font:r}},n=PA(e,"font_family_formats",BA.SemiColon);return{tooltip:"Fonts",text:A.some(t),icon:A.none(),isSelectedFor:e=>t=>t.exists((t=>t.format===e)),getCurrentValue:()=>{const{matchOpt:e}=o();return e},getPreviewFor:e=>()=>A.some({tag:"div",styles:-1===e.indexOf("dings")?{"font-family":e}:{}}),onAction:t=>()=>{e.undoManager.transact((()=>{e.focus(),e.execCommand("FontName",!1,t.format)}))},updateText:e=>{const{matchOpt:t,font:n}=o(),r=t.fold(y(n),(e=>e.title));Si(e,kk,{text:r})},dataset:n,shouldHide:!1,isInvalid:T}},zA={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},HA={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},ZA=(e,t)=>/[0-9.]+px$/.test(e)?((e,t)=>{const o=Math.pow(10,t);return Math.round(e*o)/o})(72*parseInt(e,10)/96,t||0)+"pt":ve(HA,e).getOr(e),jA=e=>ve(zA,e).getOr(""),UA=e=>{const t=()=>{let t=A.none();const o=n.data,r=e.queryCommandValue("FontSize");if(r)for(let e=3;t.isNone()&&e>=0;e--){const n=ZA(r,e),i=jA(n);t=$(o,(e=>e.format===r||e.format===n||e.format===i))}return{matchOpt:t,size:r}},o=y(A.none),n=PA(e,"font_size_formats",BA.Space);return{tooltip:"Font sizes",text:A.some("12pt"),icon:A.none(),isSelectedFor:e=>t=>t.exists((t=>t.format===e)),getPreviewFor:o,getCurrentValue:()=>{const{matchOpt:e}=t();return e},onAction:t=>()=>{e.undoManager.transact((()=>{e.focus(),e.execCommand("FontSize",!1,t.format)}))},updateText:e=>{const{matchOpt:o,size:n}=t(),r=o.fold(y(n),(e=>e.title));Si(e,kk,{text:r})},dataset:n,shouldHide:!1,isInvalid:T}},$A=(e,t)=>{const o="Paragraph";return{tooltip:"Formats",text:A.some(o),icon:A.none(),isSelectedFor:t=>()=>e.formatter.match(t),getCurrentValue:A.none,getPreviewFor:t=>()=>{const o=e.formatter.get(t);return void 0!==o?A.some({tag:o.length>0&&(o[0].inline||o[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))}):A.none()},onAction:TA(e),updateText:t=>{const n=e=>lT(e)?G(e.items,n):cT(e)?[{title:e.title,format:e.format}]:[],r=G(hT(e),n),i=NA(e,y(r)).fold(y(o),(e=>e.title));Si(t,kk,{text:i})},shouldHide:af(e),isInvalid:t=>!e.formatter.canApply(t.format),dataset:t}};var WA=Object.freeze({__proto__:null,events:(e,t)=>{const o=(o,n)=>{e.updateState.each((e=>{const r=e(o,n);t.set(r)})),e.renderComponents.each((r=>{const i=r(n,t.get());(e.reuseDom?Ap:Op)(o,i)}))};return Mi([Ri(oi(),((t,n)=>{const r=n;if(!r.universal){const n=e.channel;N(r.channels,n)&&o(t,r.data)}})),Hi(((t,n)=>{e.initialData.each((e=>{o(t,e)}))}))])}}),qA=Object.freeze({__proto__:null,getState:(e,t,o)=>o}),GA=[Gn("channel"),nr("renderComponents"),nr("updateState"),nr("initialData"),fr("reuseDom",!0)];const YA=gl({fields:GA,name:"reflecting",active:WA,apis:qA,state:Object.freeze({__proto__:null,init:()=>{const e=wr(A.none());return{readState:()=>e.get().getOr("none"),get:e.get,set:e.set,clear:()=>e.set(A.none())}}})}),XA=y([Gn("toggleClass"),Gn("fetch"),Ca("onExecute"),ur("getHotspot",A.some),ur("getAnchorOverrides",y({})),dc(),Ca("onItemExecute"),nr("lazySink"),Gn("dom"),_a("onOpen"),nu("splitDropdownBehaviours",[Iw,Ep,Zp]),ur("matchWidth",!1),ur("useMinWidth",!1),ur("eventOrder",{}),nr("role")].concat(t_())),KA=Mu({factory:Ag,schema:[Gn("dom")],name:"arrow",defaults:()=>({buttonBehaviours:ml([Zp.revoke()])}),overrides:e=>({dom:{tag:"span",attributes:{role:"presentation"}},action:t=>{t.getSystem().getByUid(e.uid).each(Ti)},buttonBehaviours:ml([Xp.config({toggleOnExecute:!1,toggleClass:e.toggleClass})])})}),JA=Mu({factory:Ag,schema:[Gn("dom")],name:"button",defaults:()=>({buttonBehaviours:ml([Zp.revoke()])}),overrides:e=>({dom:{tag:"span",attributes:{role:"presentation"}},action:t=>{t.getSystem().getByUid(e.uid).each((o=>{e.onExecute(o,t)}))}})}),QA=y([KA,JA,Pu({factory:{sketch:e=>({uid:e.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:e.text}})},schema:[Gn("text")],name:"aria-descriptor"}),Bu({schema:[ba()],name:"menu",defaults:e=>({onExecute:(t,o)=>{t.getSystem().getByUid(e.uid).each((n=>{e.onItemExecute(n,t,o)}))}})}),Ww()]),eM=ih({name:"SplitDropdown",configFields:XA(),partFields:QA(),factory:(e,t,o,n)=>{const r=e=>{ch.getCurrent(e).each((e=>{Rh.highlightFirst(e),Ep.focusIn(e)}))},i=t=>{Xw(e,w,t,n,r,kg.HighlightMenuAndItem).get(v)},s=t=>{const o=$u(t,e,"button");return Ti(o),A.some(!0)},a={...Mi([Hi(((t,o)=>{Uu(t,e,"aria-descriptor").each((e=>{const o=Qi("aria");bt(e.element,"id",o),bt(t.element,"aria-describedby",o)}))}))]),...Jp(A.some(i))},l={repositionMenus:e=>{Xp.isOn(e)&&e_(e)}};return{uid:e.uid,dom:e.dom,components:t,apis:l,eventOrder:{...e.eventOrder,[ni()]:["disabling","toggling","alloy.base.behaviour"]},events:a,behaviours:iu(e.splitDropdownBehaviours,[Iw.config({others:{sandbox:t=>{const o=$u(t,e,"arrow");return Qw(e,t,{onOpen:()=>{Xp.on(o),Xp.on(t)},onClose:()=>{Xp.off(o),Xp.off(t)}})}}}),Ep.config({mode:"special",onSpace:s,onEnter:s,onDown:e=>(i(e),A.some(!0))}),Zp.config({}),Xp.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:e.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:(e,t)=>e.repositionMenus(t)}}),tM=e=>({isEnabled:()=>!Ch.isDisabled(e),setEnabled:t=>Ch.set(e,!t)}),oM=e=>({setActive:t=>{Xp.set(e,t)},isActive:()=>Xp.isOn(e),isEnabled:()=>!Ch.isDisabled(e),setEnabled:t=>Ch.set(e,!t)}),nM=(e,t)=>e.map((e=>({"aria-label":t.translate(e),title:t.translate(e)}))).getOr({}),rM=Qi("focus-button"),iM=(e,t,o,n,r,i)=>({dom:{tag:"button",classes:["tox-tbtn"].concat(t.isSome()?["tox-tbtn--select"]:[]),attributes:nM(o,i)},components:my([e.map((e=>_k(e,i.icons))),t.map((e=>Ck(e,"tox-tbtn",i)))]),eventOrder:{[Nr()]:["focusing","alloy.base.behaviour","common-button-display-events"]},buttonBehaviours:ml([ay(i.isDisabled),ry(),Fp("common-button-display-events",[Ri(Nr(),((e,t)=>{t.event.prevent(),ki(e,rM)}))])].concat(n.map((o=>YA.config({channel:o,initialData:{icon:e,text:t},renderComponents:(e,t)=>my([e.icon.map((e=>_k(e,i.icons))),e.text.map((e=>Ck(e,"tox-tbtn",i)))])}))).toArray()).concat(r.getOr([])))}),sM=(e,t,o)=>{const n=wr(v),r=iM(e.icon,e.text,e.tooltip,A.none(),A.none(),o);return Ag.sketch({dom:r.dom,components:r.components,eventOrder:yk,buttonBehaviours:ml([Fp("toolbar-button-events",[(i={onAction:e.onAction,getApi:t.getApi},Ui(((e,t)=>{ly(i,e)((t=>{Si(e,bk,{buttonApi:t}),i.onAction(t)}))}))),cy(t,n),dy(t,n)]),ay((()=>!e.enabled||o.isDisabled())),ry()].concat(t.toolbarButtonBehaviours))});var i},aM=(e,t,o)=>sM(e,{toolbarButtonBehaviours:o.length>0?[Fp("toolbarButtonWith",o)]:[],getApi:tM,onSetup:e.onSetup},t),lM=(e,t,o)=>sM(e,{toolbarButtonBehaviours:[Dp.config({}),Xp.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(o.length>0?[Fp("toolbarToggleButtonWith",o)]:[]),getApi:oM,onSetup:e.onSetup},t),cM=(e,t,o)=>n=>jw((e=>t.fetch(e))).map((r=>A.from(h_(cn(Sw(Qi("menu-value"),r,(o=>{t.onItemAction(e(n),o)}),t.columns,t.presets,Kf.CLOSE_ON_EXECUTE,t.select.getOr(T),o),{movement:Ew(t.columns,t.presets),menuBehaviours:$b("auto"!==t.columns?[]:[Hi(((e,o)=>{Ub(e,4,cv(t.presets)).each((({numRows:t,numColumns:o})=>{Ep.setGridSize(e,t,o)}))}))])}))))),dM=[{name:"history",items:["undo","redo"]},{name:"styles",items:["styles"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],uM=(e,t)=>(o,n,r)=>{const i=e(o).mapError((e=>jn(e))).getOrDie();return t(i,n,r)},hM={button:uM(fb,((e,t)=>{return o=e,n=t.shared.providers,aM(o,n,[]);var o,n})),togglebutton:uM(yb,((e,t)=>{return o=e,n=t.shared.providers,lM(o,n,[]);var o,n})),menubutton:uM(BE,((e,t)=>sS(e,"tox-tbtn",t,A.none()))),splitbutton:uM((e=>zn("SplitButton",PE,e)),((e,t)=>((e,t)=>{const o=Qi("channel-update-split-dropdown-display"),n=e=>({isEnabled:()=>!Ch.isDisabled(e),setEnabled:t=>Ch.set(e,!t),setIconFill:(t,o)=>{ra(e.element,'svg path[id="'+t+'"], rect[id="'+t+'"]').each((e=>{bt(e,"fill",o)}))},setActive:t=>{bt(e.element,"aria-pressed",t),ra(e.element,"span").each((o=>{e.getSystem().getByDom(o).each((e=>Xp.set(e,t)))}))},isActive:()=>ra(e.element,"span").exists((t=>e.getSystem().getByDom(t).exists(Xp.isOn)))}),r=wr(v),i={getApi:n,onSetup:e.onSetup};return eM.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:{"aria-pressed":!1,...nM(e.tooltip,t.providers)}},onExecute:t=>{e.onAction(n(t))},onItemExecute:(e,t,o)=>{},splitDropdownBehaviours:ml([sy(t.providers.isDisabled),ry(),Fp("split-dropdown-events",[Ri(rM,Zp.focus),cy(i,r),dy(i,r)]),ox.config({})]),eventOrder:{[pi()]:["alloy.base.behaviour","split-dropdown-events"]},toggleClass:"tox-tbtn--enabled",lazySink:t.getSink,fetch:cM(n,e,t.providers),parts:{menu:gv(0,e.columns,e.presets)},components:[eM.parts.button(iM(e.icon,e.text,A.none(),A.some(o),A.some([Xp.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),t.providers)),eM.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:Fg("chevron-down",t.providers.icons)},buttonBehaviours:ml([sy(t.providers.isDisabled),ry(),Ig()])}),eM.parts["aria-descriptor"]({text:t.providers.translate("To open the popup, press Shift+Enter")})]})})(e,t.shared))),grouptoolbarbutton:uM((e=>zn("GroupToolbarButton",OE,e)),((e,t,o)=>{const n=o.ui.registry.getAll().buttons,r={[lc]:t.shared.header.isPositionedAtTop()?ac.TopToBottom:ac.BottomToTop};if(df(o)===jg.floating)return((e,t,o,n)=>{const r=t.shared;return AO.sketch({lazySink:r.getSink,fetch:()=>jw((t=>{t(L(o(e.items),ZO))})),markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:iM(e.icon,e.text,e.tooltip,A.none(),A.none(),r.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:n}}}})})(e,t,(e=>pM(o,{buttons:n,toolbar:e,allowToolbarGroups:!1},t,A.none())),r);throw new Error("Toolbar groups are only supported when using floating toolbar mode")}))},mM={styles:(e,t)=>{const o={type:"advanced",...t.styles};return MA(e,t,$A(e,o))},fontsize:(e,t)=>MA(e,t,UA(e)),fontfamily:(e,t)=>MA(e,t,LA(e)),blocks:(e,t)=>MA(e,t,DA(e)),align:(e,t)=>MA(e,t,VA(e))},pM=(e,t,o,n)=>{const r=(e=>{const t=e.toolbar,o=e.buttons;return!1===t?[]:void 0===t||!0===t?(e=>{const t=L(dM,(t=>{const o=Z(t.items,(t=>be(e,t)||be(mM,t)));return{name:t.name,items:o}}));return Z(t,(e=>e.items.length>0))})(o):i(t)?(e=>{const t=e.split("|");return L(t,(e=>({items:e.trim().split(" ")})))})(t):(e=>f(e,(e=>be(e,"name")&&be(e,"items"))))(t)?t:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])})(t),s=L(r,(r=>{const i=G(r.items,(r=>0===r.trim().length?[]:((e,t,o,n,r,i)=>ve(t,o.toLowerCase()).orThunk((()=>i.bind((e=>ie(e,(e=>ve(t,e+o.toLowerCase()))))))).fold((()=>ve(mM,o.toLowerCase()).map((t=>t(e,r)))),(t=>"grouptoolbarbutton"!==t.type||n?((e,t,o)=>ve(hM,e.type).fold((()=>(console.error("skipping button defined by",e),A.none())),(n=>A.some(n(e,t,o)))))(t,r,e):(console.warn(`Ignoring the '${o}' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested.`),A.none()))))(e,t.buttons,r,t.allowToolbarGroups,o,n).toArray()));return{title:A.from(e.translate(r.name)),items:i}}));return Z(s,(e=>e.items.length>0))},gM=(e,t,o,n)=>{const r=t.mainUi.outerContainer,s=o.toolbar,a=o.buttons;if(f(s,i)){const t=s.map((t=>{const r={toolbar:t,buttons:a,allowToolbarGroups:o.allowToolbarGroups};return pM(e,r,n,A.none())}));mA.setToolbars(r,t)}else mA.setToolbar(r,pM(e,o,n,A.none()))},fM=To(),vM=fM.os.isiOS()&&fM.os.version.major<=12;var bM=Object.freeze({__proto__:null,render:(e,t,o,n,r)=>{const{mainUi:i,uiMotherships:s}=t,a=wr(0),l=i.outerContainer;xA(e);const d=Ve(r.targetNode),u=ut(dt(d));((e,t)=>{kd(e,t,Bo)})(d,i.mothership),((e,t)=>{Cd(e,t.dialogUi.mothership)})(u,t),e.on("PostRender",(()=>{mA.setSidebar(l,o.sidebar,Bf(e)),gM(e,t,o,n),a.set(e.getWin().innerWidth),mA.setMenubar(l,fA(e,o)),mA.setViews(l,o.views),((e,t)=>{const{uiMotherships:o}=t,n=e.dom;let r=e.getWin();const i=e.getDoc().documentElement,s=wr(Ht(r.innerWidth,r.innerHeight)),a=wr(Ht(i.offsetWidth,i.offsetHeight)),l=()=>{const t=s.get();t.left===r.innerWidth&&t.top===r.innerHeight||(s.set(Ht(r.innerWidth,r.innerHeight)),Yy(e))},c=()=>{const t=e.getDoc().documentElement,o=a.get();o.left===t.offsetWidth&&o.top===t.offsetHeight||(a.set(Ht(t.offsetWidth,t.offsetHeight)),Yy(e))},d=t=>{((e,t)=>{e.dispatch("ScrollContent",t)})(e,t)};n.bind(r,"resize",l),n.bind(r,"scroll",d);const u=$l(Ve(e.getBody()),"load",c);e.on("hide",(()=>{z(o,(e=>{Tt(e.element,"display","none")}))})),e.on("show",(()=>{z(o,(e=>{Vt(e.element,"display")}))})),e.on("NodeChange",c),e.on("remove",(()=>{u.unbind(),n.unbind(r,"resize",l),n.unbind(r,"scroll",d),r=null}))})(e,t)}));const h=mA.getSocket(l).getOrDie("Could not find expected socket element");if(vM){Et(h.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});const t=((e,t)=>{let o=null;return{cancel:()=>{c(o)||(clearTimeout(o),o=null)},throttle:(...t)=>{c(o)&&(o=setTimeout((()=>{o=null,e.apply(null,t)}),20))}}})((()=>{e.dispatch("ScrollContent")})),o=Ul(h.element,"scroll",t.throttle);e.on("remove",o.unbind)}ny(e,t),e.addCommand("ToggleSidebar",((t,o)=>{mA.toggleSidebar(l,o),e.dispatch("ToggleSidebar")})),e.addQueryValueHandler("ToggleSidebar",(()=>{var e;return null!==(e=mA.whichSidebar(l))&&void 0!==e?e:""})),e.addCommand("ToggleView",((t,o)=>{if(mA.toggleView(l,o)){const t=l.element;i.mothership.broadcastOn([Fd()],{target:t}),z(s,(e=>{e.broadcastOn([Fd()],{target:t})})),c(mA.whichView(l))&&(e.focus(),e.nodeChanged())}})),e.addQueryValueHandler("ToggleView",(()=>{var e;return null!==(e=mA.whichView(l))&&void 0!==e?e:""}));const m=df(e);m!==jg.sliding&&m!==jg.floating||e.on("ResizeWindow ResizeEditor ResizeContent",(()=>{const o=e.getWin().innerWidth;o!==a.get()&&(mA.refreshToolbar(t.mainUi.outerContainer),a.set(o))}));const p={setEnabled:e=>{oy(t,!e)},isEnabled:()=>!Ch.isDisabled(l)};return{iframeContainer:h.element.dom,editorContainer:l.element.dom,api:p}}});const yM=e=>/^[0-9\.]+(|px)$/i.test(""+e)?A.some(parseInt(""+e,10)):A.none(),wM=e=>g(e)?e+"px":e,_M=(e,t,o)=>{const n=t.filter((t=>e<t)),r=o.filter((t=>e>t));return n.or(r).getOr(e)},xM=e=>{const t=Qg(e),o=ef(e),n=of(e);return yM(t).map((e=>_M(e,o,n)))},{ToolbarLocation:CM,ToolbarMode:kM}=qf,SM=(e,t)=>{const o=Wo(e);return{pos:t?o.y:o.bottom,bounds:o}};var TM=Object.freeze({__proto__:null,render:(e,t,o,n,r)=>{const{mainUi:i}=t,s=Zl(),a=Ve(r.targetNode),l=((e,t,o,n,r)=>{const{mainUi:i,uiMotherships:s}=o,a=$g.DOM,l=Zf(e),c=$f(e),d=of(e).or(xM(e)),u=n.shared.header,h=u.isPositionedAtTop,m=df(e),p=m===kM.sliding||m===kM.floating,g=wr(!1),f=()=>g.get()&&!e.removed,v=e=>p?e.fold(y(0),(e=>e.components().length>1?It(e.components()[1].element):0)):0,b=()=>{z(s,(e=>{e.broadcastOn([Id()],{})}))},w=(e=!1)=>{if(f()){if(l||r.on((e=>{const o=d.getOrThunk((()=>{const e=yM(At(gt(),"margin-left")).getOr(0);return Wt(gt())-jt(t).left+e}));Tt(e.element,"max-width",o+"px")})),p&&mA.refreshToolbar(i.outerContainer),l||r.on((e=>{const o=mA.getToolbar(i.outerContainer),n=v(o),r=Wo(t),s=h()?Math.max(r.y-It(e.element)+n,0):r.bottom;Et(i.outerContainer.element,{position:"absolute",top:Math.round(s)+"px",left:Math.round(r.x)+"px"})})),c){const t=e?vE.reset:vE.refresh;r.on(t)}b()}},_=(o=!0)=>{!l&&c&&f()&&r.on((n=>{const s=u.getDockingMode(),a=(o=>{switch(hf(e)){case CM.auto:const e=mA.getToolbar(i.outerContainer),n=v(e),r=It(o.element)-n,s=Wo(t);if(s.y>r)return"top";{const e=Je(t),o=Math.max(e.dom.scrollHeight,It(e));return s.bottom<o-r||Go().bottom<s.bottom-r?"bottom":"top"}case CM.bottom:return"bottom";case CM.top:default:return"top"}})(n);var l;a!==s&&(l=a,r.on((e=>{vE.setModes(e,[l]),u.setDockingMode(l);const t=h()?ac.TopToBottom:ac.BottomToTop;bt(e.element,lc,t)})),o&&w(!0))}))};return{isVisible:f,isPositionedAtTop:h,show:()=>{g.set(!0),Tt(i.outerContainer.element,"display","flex"),a.addClass(e.getBody(),"mce-edit-focus"),z(s,(e=>{Vt(e.element,"display")})),_(!1),w()},hide:()=>{g.set(!1),Tt(i.outerContainer.element,"display","none"),a.removeClass(e.getBody(),"mce-edit-focus"),z(s,(e=>{Tt(e.element,"display","none")}))},update:w,updateMode:_,repositionPopups:b}})(e,a,t,n,s),c=gf(e);CA(e);const d=()=>{if(s.isSet())return void l.show();s.set(mA.getHeader(i.outerContainer).getOrDie());const r=jf(e);Cd(r,i.mothership),((e,t)=>{Cd(e,t.dialogUi.mothership)})(r,t),gM(e,t,o,n),mA.setMenubar(i.outerContainer,fA(e,o)),l.show(),((e,t,o,n)=>{const r=wr(SM(t,o.isPositionedAtTop())),i=n=>{const{pos:i,bounds:s}=SM(t,o.isPositionedAtTop()),{pos:a,bounds:l}=r.get(),c=s.height!==l.height||s.width!==l.width;r.set({pos:i,bounds:s}),c&&Yy(e,n),o.isVisible()&&(a!==i?o.update(!0):c&&(o.updateMode(),o.repositionPopups()))};n||(e.on("activate",o.show),e.on("deactivate",o.hide)),e.on("SkinLoaded ResizeWindow",(()=>o.update(!0))),e.on("NodeChange keydown",(e=>{requestAnimationFrame((()=>i(e)))})),e.on("ScrollWindow",(()=>o.updateMode()));const s=Hl();s.set($l(Ve(e.getBody()),"load",(e=>i(e.raw)))),e.on("remove",(()=>{s.clear()}))})(e,a,l,c),e.nodeChanged()};e.on("show",d),e.on("hide",l.hide),c||(e.on("focus",d),e.on("blur",l.hide)),e.on("init",(()=>{(e.hasFocus()||c)&&d()})),ny(e,t);const u={show:d,hide:l.hide,setEnabled:e=>{oy(t,!e)},isEnabled:()=>!Ch.isDisabled(i.outerContainer)};return{editorContainer:i.outerContainer.element.dom,api:u}}});const EM="contexttoolbar-hide",OM=(e,t)=>Ri(bk,((o,n)=>{const r=(e=>({hide:()=>ki(e,ai()),getValue:()=>ou.getValue(e)}))(e.get(o));t.onAction(r,n.event.buttonApi)})),AM=(e,t)=>{const o=e.label.fold((()=>({})),(e=>({"aria-label":e}))),n=Mg(wv.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:e.initValue(),inputAttributes:o,selectOnFocus:!0,inputBehaviours:ml([Ep.config({mode:"special",onEnter:e=>r.findPrimary(e).map((e=>(Ti(e),!0))),onLeft:(e,t)=>(t.cut(),A.none()),onRight:(e,t)=>(t.cut(),A.none())})])})),r=((e,t,o)=>{const n=L(t,(t=>Mg(((e,t,o)=>(e=>"contextformtogglebutton"===e.type)(t)?((e,t,o)=>{const{primary:n,...r}=t.original,i=Hn(yb({...r,type:"togglebutton",onAction:v}));return lM(i,o,[OM(e,t)])})(e,t,o):((e,t,o)=>{const{primary:n,...r}=t.original,i=Hn(fb({...r,type:"button",onAction:v}));return aM(i,o,[OM(e,t)])})(e,t,o))(e,t,o))));return{asSpecs:()=>L(n,(e=>e.asSpec())),findPrimary:e=>ie(t,((t,o)=>t.primary?A.from(n[o]).bind((t=>t.getOpt(e))).filter(C(Ch.isDisabled)):A.none()))}})(n,e.commands,t);return[{title:A.none(),items:[n.asSpec()]},{title:A.none(),items:r.asSpecs()}]},MM=(e,t,o)=>t.bottom-e.y>=o&&e.bottom-t.y>=o,BM=e=>{const t=(e=>{const t=e.getBoundingClientRect();if(t.height<=0&&t.width<=0){const o=st(Ve(e.startContainer),e.startOffset).element;return(Ze(o)?et(o):A.some(o)).filter(He).map((e=>e.dom.getBoundingClientRect())).getOr(t)}return t})(e.selection.getRng());if(e.inline){const e=Fo();return $o(e.left+t.left,e.top+t.top,t.width,t.height)}{const o=qo(Ve(e.getBody()));return $o(o.x+t.left,o.y+t.top,t.width,t.height)}},PM=(e,t,o,n=0)=>{const r=zo(window),i=Wo(Ve(e.getContentAreaContainer())),s=Vf(e)||Ff(e)||Lf(e),{x:a,width:l}=((e,t,o)=>{const n=Math.max(e.x+o,t.x);return{x:n,width:Math.min(e.right-o,t.right)-n}})(i,r,n);if(e.inline&&!s)return $o(a,r.y,l,r.height);{const s=t.header.isPositionedAtTop(),{y:c,bottom:d}=((e,t,o,n,r,i)=>{const s=Ve(e.getContainer()),a=ra(s,".tox-editor-header").getOr(s),l=Wo(a),c=l.y>=t.bottom,d=n&&!c;if(e.inline&&d)return{y:Math.max(l.bottom+i,o.y),bottom:o.bottom};if(e.inline&&!d)return{y:o.y,bottom:Math.min(l.y-i,o.bottom)};const u="line"===r?Wo(s):t;return d?{y:Math.max(l.bottom+i,o.y),bottom:Math.min(u.bottom-i,o.bottom)}:{y:Math.max(u.y+i,o.y),bottom:Math.min(l.y-i,o.bottom)}})(e,i,r,s,o,n);return $o(a,c,l,d-c)}},RM={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"],inset:["tox-pop--inset"]},VM={maxHeightFunction:Jl(),maxWidthFunction:CO()},NM=e=>"node"===e,DM=(e,t,o,n,r)=>{const i=BM(e),s=n.lastElement().exists((e=>Ge(o,e)));return((e,t)=>{const o=e.selection.getRng(),n=st(Ve(o.startContainer),o.startOffset);return o.startContainer===o.endContainer&&o.startOffset===o.endOffset-1&&Ge(n.element,t)})(e,o)?s?GS:jS:s?((e,o,r)=>{const s=Bt(e,"position");Tt(e,"position",o);const a=MM(i,Wo(t),-20)&&!n.isReposition()?XS:GS;return s.each((t=>Tt(e,"position",t))),a})(t,n.getMode()):("fixed"===n.getMode()?r.y+Fo().top:r.y)+(It(t)+12)<=i.y?jS:US},FM=(e,t,o,n)=>{const r=t=>(n,r,i,s,a)=>({...DM(e,s,t,o,a)({...n,y:a.y,height:a.height},r,i,s,a),alwaysFit:!0}),i=e=>NM(n)?[r(e)]:[];return t?{onLtr:e=>[Qa,Ga,Ya,Xa,Ka,Ja].concat(i(e)),onRtl:e=>[Qa,Ya,Ga,Ka,Xa,Ja].concat(i(e))}:{onLtr:e=>[Ja,Qa,Xa,Ga,Ka,Ya].concat(i(e)),onRtl:e=>[Ja,Qa,Ka,Ya,Xa,Ga].concat(i(e))}},IM=(e,t)=>{const o=Z(t,(t=>t.predicate(e.dom))),{pass:n,fail:r}=H(o,(e=>"contexttoolbar"===e.type));return{contextToolbars:n,contextForms:r}},LM=(e,t)=>{const o={},n=[],r=[],i={},s={},a=se(e);return z(a,(a=>{const l=e[a];"contextform"===l.type?((e,a)=>{const l=Hn(zn("ContextForm",Tb,a));o[e]=l,l.launch.map((o=>{i["form:"+e]={...a.launch,type:"contextformtogglebutton"===o.type?"togglebutton":"button",onAction:()=>{t(l)}}})),"editor"===l.scope?r.push(l):n.push(l),s[e]=l})(a,l):"contexttoolbar"===l.type&&((e,t)=>{var o;(o=t,zn("ContextToolbar",Eb,o)).each((o=>{"editor"===t.scope?r.push(o):n.push(o),s[e]=o}))})(a,l)})),{forms:o,inNodeScope:n,inEditorScope:r,lookupTable:s,formNavigators:i}},zM=Qi("forward-slide"),HM=Qi("backward-slide"),ZM=Qi("change-slide-event"),jM="tox-pop--resizing",UM="tox-pop--transition",$M=(e,t,o,n)=>{const r=n.backstage,i=r.shared,s=To().deviceType.isTouch,a=Zl(),l=Zl(),c=Zl(),d=Ys((e=>{const t=wr([]);return Eg.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:e=>{t.set([]),Eg.getContent(e).each((e=>{Vt(e.element,"visibility")})),Ps(e.element,jM),Vt(e.element,"width")},inlineBehaviours:ml([Fp("context-toolbar-events",[zi(Gr(),((e,t)=>{"width"===t.event.raw.propertyName&&(Ps(e.element,jM),Vt(e.element,"width"))})),Ri(ZM,((e,t)=>{const o=e.element;Vt(o,"width");const n=Wt(o);Eg.setContent(e,t.event.contents),Bs(o,jM);const r=Wt(o);Tt(o,"width",n+"px"),Eg.getContent(e).each((e=>{t.event.focus.bind((e=>(_l(e),kl(o)))).orThunk((()=>(Ep.focusIn(e),Cl(dt(o)))))})),setTimeout((()=>{Tt(e.element,"width",r+"px")}),0)})),Ri(zM,((e,o)=>{Eg.getContent(e).each((o=>{t.set(t.get().concat([{bar:o,focus:Cl(dt(e.element))}]))})),Si(e,ZM,{contents:o.event.forwardContents,focus:A.none()})})),Ri(HM,((e,o)=>{ne(t.get()).each((o=>{t.set(t.get().slice(0,t.get().length-1)),Si(e,ZM,{contents:Xs(o.bar),focus:o.focus})}))}))]),Ep.config({mode:"special",onEscape:o=>ne(t.get()).fold((()=>e.onEscape()),(e=>(ki(o,HM),A.some(!0))))})]),lazySink:()=>Ko.value(e.sink)})})({sink:o,onEscape:()=>(e.focus(),A.some(!0))})),u=()=>{const t=c.get().getOr("node"),o=NM(t)?1:0;return PM(e,i,t,o)},h=()=>!(e.removed||s()&&r.isContextMenuOpen()),m=()=>{if(h()){const t=u(),o=we(c.get(),"node")?((e,t)=>t.filter((e=>pt(e)&&(e=>He(e)&&Ie(e.dom))(e))).map(qo).getOrThunk((()=>BM(e))))(e,a.get()):BM(e);return t.height<=0||!MM(o,t,.01)}return!0},p=()=>{a.clear(),l.clear(),c.clear(),Eg.hide(d)},g=()=>{if(Eg.isOpen(d)){const e=d.element;Vt(e,"display"),m()?Tt(e,"display","none"):(l.set(0),Eg.reposition(d))}},f=t=>({dom:{tag:"div",classes:["tox-pop__dialog"]},components:[t],behaviours:ml([Ep.config({mode:"acyclic"}),Fp("pop-dialog-wrap-events",[Hi((t=>{e.shortcuts.add("ctrl+F9","focus statusbar",(()=>Ep.focusIn(t)))})),Zi((t=>{e.shortcuts.remove("ctrl+F9")}))])])}),b=Gt((()=>LM(t,(e=>{const t=y([e]);Si(d,zM,{forwardContents:f(t)})})))),y=t=>{const{buttons:o}=e.ui.registry.getAll(),r={...o,...b().formNavigators},s=df(e)===jg.scrolling?jg.scrolling:jg.default,a=q(L(t,(t=>"contexttoolbar"===t.type?((t,o)=>pM(e,{buttons:t,toolbar:o.items,allowToolbarGroups:!1},n.backstage,A.some(["form:"])))(r,t):((e,t)=>AM(e,t))(t,i.providers))));return qO({type:s,uid:Qi("context-toolbar"),initGroups:a,onEscape:A.none,cyclicKeying:!0,providers:i.providers})},w=(t,n)=>{if(_.cancel(),!h())return;const r=y(t),p=t[0].position,g=((t,n)=>{const r="node"===t?i.anchors.node(n):i.anchors.cursor(),c=((e,t,o,n)=>"line"===t?{bubble:oc(12,0,RM),layouts:{onLtr:()=>[el],onRtl:()=>[tl]},overrides:VM}:{bubble:oc(0,12,RM,1/12),layouts:FM(e,o,n,t),overrides:VM})(e,t,s(),{lastElement:a.get,isReposition:()=>we(l.get(),0),getMode:()=>ud.getMode(o)});return cn(r,c)})(p,n);c.set(p),l.set(1);const v=d.element;Vt(v,"display"),(e=>we(xe(e,a.get(),Ge),!0))(n)||(Ps(v,UM),ud.reset(o,d)),Eg.showWithinBounds(d,f(r),{anchor:g,transition:{classes:[UM],mode:"placement"}},(()=>A.some(u()))),n.fold(a.clear,a.set),m()&&Tt(v,"display","none")},_=$k((()=>{e.hasFocus()&&!e.removed&&(Rs(d.element,UM)?_.throttle():((e,t)=>{const o=Ve(t.getBody()),n=e=>Ge(e,o),r=Ve(t.selection.getNode());return(e=>!n(e)&&!Ye(o,e))(r)?A.none():((e,t,o)=>{const n=IM(e,t);if(n.contextForms.length>0)return A.some({elem:e,toolbars:[n.contextForms[0]]});{const t=IM(e,o);if(t.contextForms.length>0)return A.some({elem:e,toolbars:[t.contextForms[0]]});if(n.contextToolbars.length>0||t.contextToolbars.length>0){const o=(e=>{if(e.length<=1)return e;{const t=t=>D(e,(e=>e.position===t)),o=t=>Z(e,(e=>e.position===t)),n=t("selection"),r=t("node");if(n||r){if(r&&n){const e=o("node"),t=L(o("selection"),(e=>({...e,position:"node"})));return e.concat(t)}return o(n?"selection":"node")}return o("line")}})(n.contextToolbars.concat(t.contextToolbars));return A.some({elem:e,toolbars:o})}return A.none()}})(r,e.inNodeScope,e.inEditorScope).orThunk((()=>((e,t,o)=>e(t)?A.none():Sr(t,(e=>{if(He(e)){const{contextToolbars:t,contextForms:n}=IM(e,o.inNodeScope),r=n.length>0?n:(e=>{if(e.length<=1)return e;{const t=t=>$(e,(e=>e.position===t));return t("selection").orThunk((()=>t("node"))).orThunk((()=>t("line"))).map((e=>e.position)).fold((()=>[]),(t=>Z(e,(e=>e.position===t))))}})(t);return r.length>0?A.some({elem:e,toolbars:r}):A.none()}return A.none()}),e))(n,r,e)))})(b(),e).fold(p,(e=>{w(e.toolbars,A.some(e.elem))})))}),17);e.on("init",(()=>{e.on("remove",p),e.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",g),e.on("click keyup focus SetContent",_.throttle),e.on(EM,p),e.on("contexttoolbar-show",(t=>{const o=b();ve(o.lookupTable,t.toolbarKey).each((o=>{w([o],Ce(t.target!==e,t.target)),Eg.getContent(d).each(Ep.focusIn)}))})),e.on("focusout",(t=>{Og.setEditorTimeout(e,(()=>{kl(o.element).isNone()&&kl(d.element).isNone()&&p()}),0)})),e.on("SwitchMode",(()=>{e.mode.isReadOnly()&&p()})),e.on("AfterProgressState",(t=>{t.state?p():e.hasFocus()&&_.throttle()})),e.on("NodeChange",(e=>{kl(d.element).fold(_.throttle,v)}))}))},WM={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},qM=(()=>{const e="[0-9]+",t="[eE][+-]?"+e,o=e=>`(?:${e})?`,n=["Infinity",e+"\\."+o(e)+o(t),"\\."+e+o(t),e+o(t)].join("|");return new RegExp(`^([+-]?(?:${n}))(.*)$`)})(),GM=(e,t)=>{const o=()=>{const o=t.getOptions(e),n=t.getCurrent(e).map(t.hash),r=Zl();return L(o,(o=>({type:"togglemenuitem",text:t.display(o),onSetup:i=>{const s=e=>{e&&(r.on((e=>e.setActive(!1))),r.set(i)),i.setActive(e)};s(we(n,t.hash(o)));const a=t.watcher(e,o,s);return()=>{r.clear(),a()}},onAction:()=>t.setCurrent(e,o)})))};e.ui.registry.addMenuButton(t.name,{tooltip:t.text,icon:t.icon,fetch:e=>e(o()),onSetup:t.onToolbarSetup}),e.ui.registry.addNestedMenuItem(t.name,{type:"nestedmenuitem",text:t.text,getSubmenuItems:o,onSetup:t.onMenuSetup})},YM={name:"lineheight",text:"Line height",icon:"line-height",getOptions:Df,hash:e=>((e,t)=>((e,t)=>A.from(qM.exec(e)).bind((e=>{const o=Number(e[1]),n=e[2];return((e,t)=>D(t,(t=>D(WM[t],(t=>e===t)))))(n,t)?A.some({value:o,unit:n}):A.none()})))(e,["fixed","relative","empty"]).map((({value:e,unit:t})=>e+t)))(e).getOr(e),display:w,watcher:(e,t,o)=>e.formatter.formatChanged("lineheight",o,!1,{value:t}).unbind,getCurrent:e=>A.from(e.queryCommandValue("LineHeight")),setCurrent:(e,t)=>e.execCommand("LineHeight",!1,t)},XM=e=>SA(e,"NodeChange",(t=>{t.setEnabled(e.queryCommandState("outdent"))})),KM=(e,t)=>o=>{o.setActive(t.get());const n=e=>{t.set(e.state),o.setActive(e.state)};return e.on("PastePlainTextToggle",n),()=>e.off("PastePlainTextToggle",n)},JM=(e,t)=>()=>{e.execCommand("mceToggleFormat",!1,t)},QM=e=>{(e=>{(e=>{dk.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],((t,o)=>{e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onSetup:kA(e,t.name),onAction:JM(e,t.name)})}));for(let t=1;t<=6;t++){const o="h"+t;e.ui.registry.addToggleButton(o,{text:o.toUpperCase(),tooltip:"Heading "+t,onSetup:kA(e,o),onAction:JM(e,o)})}})(e),(e=>{dk.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"},{name:"print",text:"Print",action:"mcePrint",icon:"print"},{name:"hr",text:"Horizontal line",action:"InsertHorizontalRule",icon:"horizontal-rule"}],(t=>{e.ui.registry.addButton(t.name,{tooltip:t.text,icon:t.icon,onAction:EA(e,t.action)})}))})(e),(e=>{dk.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(t=>{e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:EA(e,t.action),onSetup:kA(e,t.name)})}))})(e)})(e),(e=>{dk.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"},{name:"print",text:"Print...",action:"mcePrint",icon:"print",shortcut:"Meta+P"},{name:"hr",text:"Horizontal line",action:"InsertHorizontalRule",icon:"horizontal-rule"}],(t=>{e.ui.registry.addMenuItem(t.name,{text:t.text,icon:t.icon,shortcut:t.shortcut,onAction:EA(e,t.action)})})),e.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:JM(e,"code")})})(e)},eB=(e,t)=>SA(e,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",(o=>{o.setEnabled(!e.mode.isReadOnly()&&e.undoManager[t]())})),tB=e=>SA(e,"VisualAid",(t=>{t.setActive(e.hasVisual)})),oB=(e,t)=>{(e=>{z([{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}],(t=>{e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:EA(e,t.cmd),onSetup:kA(e,t.name)})})),e.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onAction:EA(e,"JustifyNone")})})(e),QM(e),((e,t)=>{((e,t)=>{const o=AA(0,t,VA(e));e.ui.registry.addNestedMenuItem("align",{text:t.shared.providers.translate("Align"),getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})})(e,t),((e,t)=>{const o=AA(0,t,LA(e));e.ui.registry.addNestedMenuItem("fontfamily",{text:t.shared.providers.translate("Fonts"),getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})})(e,t),((e,t)=>{const o={type:"advanced",...t.styles},n=AA(0,t,$A(e,o));e.ui.registry.addNestedMenuItem("styles",{text:"Formats",getSubmenuItems:()=>n.items.validateItems(n.getStyleItems())})})(e,t),((e,t)=>{const o=AA(0,t,DA(e));e.ui.registry.addNestedMenuItem("blocks",{text:"Blocks",getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})})(e,t),((e,t)=>{const o=AA(0,t,UA(e));e.ui.registry.addNestedMenuItem("fontsize",{text:"Font sizes",getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})})(e,t)})(e,t),(e=>{(e=>{e.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:eB(e,"hasUndo"),onAction:EA(e,"undo")}),e.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:eB(e,"hasRedo"),onAction:EA(e,"redo")})})(e),(e=>{e.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",enabled:!1,onSetup:eB(e,"hasUndo"),onAction:EA(e,"undo")}),e.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",enabled:!1,onSetup:eB(e,"hasRedo"),onAction:EA(e,"redo")})})(e)})(e),(e=>{(e=>{e.addCommand("mceApplyTextcolor",((t,o)=>{((e,t,o)=>{e.undoManager.transact((()=>{e.focus(),e.formatter.apply(t,{value:o}),e.nodeChanged()}))})(e,t,o)})),e.addCommand("mceRemoveTextcolor",(t=>{((e,t)=>{e.undoManager.transact((()=>{e.focus(),e.formatter.remove(t,{value:null},void 0,!0),e.nodeChanged()}))})(e,t)}))})(e);const t=pw(e),o=gw(e),n=wr(t),r=wr(o);xw(e,"forecolor","forecolor","Text color",n),xw(e,"backcolor","hilitecolor","Background color",r),Cw(e,"forecolor","forecolor","Text color"),Cw(e,"backcolor","hilitecolor","Background color")})(e),(e=>{(e=>{e.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:EA(e,"mceToggleVisualAid")})})(e),(e=>{e.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:tB(e),onAction:EA(e,"mceToggleVisualAid")})})(e)})(e),(e=>{(e=>{e.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:XM(e),onAction:EA(e,"outdent")}),e.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:EA(e,"indent")})})(e)})(e),(e=>{GM(e,YM),(e=>A.from(lf(e)).map((t=>({name:"language",text:"Language",icon:"language",getOptions:y(t),hash:e=>u(e.customCode)?e.code:`${e.code}/${e.customCode}`,display:e=>e.title,watcher:(e,t,o)=>{var n;return e.formatter.formatChanged("lang",o,!1,{value:t.code,customValue:null!==(n=t.customCode)&&void 0!==n?n:null}).unbind},getCurrent:e=>{const t=Ve(e.selection.getNode());return Tr(t,(e=>A.some(e).filter(He).bind((e=>_t(e,"lang").map((t=>({code:t,customCode:_t(e,"data-mce-lang").getOrUndefined(),title:""})))))))},setCurrent:(e,t)=>e.execCommand("Lang",!1,t),onToolbarSetup:t=>{const o=Hl();return t.setActive(e.formatter.match("lang",{},void 0,!0)),o.set(e.formatter.formatChanged("lang",t.setActive,!0)),o.clear}}))))(e).each((t=>GM(e,t)))})(e),(e=>{const t=wr(Mf(e)),o=()=>e.execCommand("mceTogglePlainTextPaste");e.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:o,onSetup:KM(e,t)}),e.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:o,onSetup:KM(e,t)})})(e)},nB=e=>i(e)?e.split(/[ ,]/):e,rB=e=>t=>t.options.get(e),iB=rB("contextmenu_never_use_native"),sB=rB("contextmenu_avoid_overlap"),aB=e=>{const t=e.ui.registry.getAll().contextMenus,o=e.options.get("contextmenu");return e.options.isSet("contextmenu")?o:Z(o,(e=>be(t,e)))},lB=(e,t)=>({type:"makeshift",x:e,y:t}),cB=e=>"longpress"===e.type||0===e.type.indexOf("touch"),dB=(e,t)=>"contextmenu"===t.type||"longpress"===t.type?e.inline?(e=>{if(cB(e)){const t=e.touches[0];return lB(t.pageX,t.pageY)}return lB(e.pageX,e.pageY)})(t):((e,t)=>{const o=$g.DOM.getPos(e);return((e,t,o)=>lB(e.x+t,e.y+o))(t,o.x,o.y)})(e.getContentAreaContainer(),(e=>{if(cB(e)){const t=e.touches[0];return lB(t.clientX,t.clientY)}return lB(e.clientX,e.clientY)})(t)):uB(e),uB=e=>({type:"selection",root:Ve(e.selection.getNode())}),hB=(e,t,o)=>{switch(o){case"node":return(e=>({type:"node",node:A.some(Ve(e.selection.getNode())),root:Ve(e.getBody())}))(e);case"point":return dB(e,t);case"selection":return uB(e)}},mB=(e,t,o,n,r,i)=>{const s=o(),a=hB(e,t,i);Mk(s,Kf.CLOSE_ON_EXECUTE,n,{isHorizontalMenu:!1,search:A.none()}).map((e=>{t.preventDefault(),Eg.showMenuAt(r,{anchor:a},{menu:{markers:hv("normal")},data:e})}))},pB={onLtr:()=>[Qa,Ga,Ya,Xa,Ka,Ja,jS,US,ZS,zS,HS,LS],onRtl:()=>[Qa,Ya,Ga,Ka,Xa,Ja,jS,US,HS,LS,ZS,zS]},gB={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},fB=(e,t,o,n,r,i)=>{const s=To(),a=s.os.isiOS(),l=s.os.isMacOS(),c=s.os.isAndroid(),d=s.deviceType.isTouch(),u=()=>{const s=o();((e,t,o,n,r,i,s)=>{const a=((e,t,o)=>{const n=hB(e,t,o);return{bubble:oc(0,"point"===o?12:0,gB),layouts:pB,overrides:{maxWidthFunction:CO(),maxHeightFunction:Jl()},...n}})(e,t,i);Mk(o,Kf.CLOSE_ON_EXECUTE,n,{isHorizontalMenu:!0,search:A.none()}).map((o=>{t.preventDefault();const l=s?kg.HighlightMenuAndItem:kg.HighlightNone;Eg.showMenuWithinBounds(r,{anchor:a},{menu:{markers:hv("normal"),highlightOnOpen:l},data:o,type:"horizontal"},(()=>A.some(PM(e,n.shared,"node"===i?"node":"selection")))),e.dispatch(EM)}))})(e,t,s,n,r,i,!(c||a||l&&d))};if((l||a)&&"node"!==i){const o=()=>{(e=>{const t=e.selection.getRng(),o=()=>{Og.setEditorTimeout(e,(()=>{e.selection.setRng(t)}),10),i()};e.once("touchend",o);const n=e=>{e.preventDefault(),e.stopImmediatePropagation()};e.on("mousedown",n,!0);const r=()=>i();e.once("longpresscancel",r);const i=()=>{e.off("touchend",o),e.off("longpresscancel",r),e.off("mousedown",n)}})(e),u()};((e,t)=>{const o=e.selection;if(o.isCollapsed()||t.touches.length<1)return!1;{const n=t.touches[0],r=o.getRng();return Lc(e.getWin(),Ac.domRange(r)).exists((e=>e.left<=n.clientX&&e.right>=n.clientX&&e.top<=n.clientY&&e.bottom>=n.clientY))}})(e,t)?o():(e.once("selectionchange",o),e.once("touchend",(()=>e.off("selectionchange",o))))}else u()},vB=e=>i(e)?"|"===e:"separator"===e.type,bB={type:"separator"},yB=e=>{const t=e=>({text:e.text,icon:e.icon,enabled:e.enabled,shortcut:e.shortcut});if(i(e))return e;switch(e.type){case"separator":return bB;case"submenu":return{type:"nestedmenuitem",...t(e),getSubmenuItems:()=>{const t=e.getSubmenuItems();return i(t)?t:L(t,yB)}};default:const n=e;return{type:"menuitem",...t(n),onAction:(o=n.onAction,()=>o())}}var o},wB=(e,t)=>{if(0===t.length)return e;const o=ne(e).filter((e=>!vB(e))).fold((()=>[]),(e=>[bB]));return e.concat(o).concat(t).concat([bB])},_B=(e,t)=>!(e=>"longpress"===e.type||be(e,"touches"))(t)&&(2!==t.button||t.target===e.getBody()&&""===t.pointerType),xB=(e,t)=>_B(e,t)?e.selection.getStart(!0):t.target,CB=(e,t,o)=>{const n=To().deviceType.isTouch,r=Ys(Eg.sketch({dom:{tag:"div"},lazySink:t,onEscape:()=>e.focus(),onShow:()=>o.setContextMenuState(!0),onHide:()=>o.setContextMenuState(!1),fireDismissalEventInstead:{},inlineBehaviours:ml([Fp("dismissContextMenu",[Ri(fi(),((t,o)=>{Dd.close(t),e.focus()}))])])})),s=()=>Eg.hide(r),a=t=>{if(iB(e)&&t.preventDefault(),((e,t)=>t.ctrlKey&&!iB(e))(e,t)||(e=>0===aB(e).length)(e))return;const s=((e,t)=>{const o=sB(e),n=_B(e,t)?"selection":"point";if(Oe(o)){const r=xB(e,t);return p_(Ve(r),o)?"node":n}return n})(e,t);(n()?fB:mB)(e,t,(()=>{const o=xB(e,t),n=e.ui.registry.getAll(),r=aB(e);return((e,t,o)=>{const n=U(t,((t,n)=>ve(e,n.toLowerCase()).map((e=>{const n=e.update(o);if(i(n))return wB(t,n.split(" "));if(n.length>0){const e=L(n,yB);return wB(t,e)}return t})).getOrThunk((()=>t.concat([n])))),[]);return n.length>0&&vB(n[n.length-1])&&n.pop(),n})(n.contextMenus,r,o)}),o,r,s)};e.on("init",(()=>{const t="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(n()?"":" ResizeWindow");e.on(t,s),e.on("longpress contextmenu",a)}))},kB=_r([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),SB=e=>t=>t.translate(-e.left,-e.top),TB=e=>t=>t.translate(e.left,e.top),EB=e=>(t,o)=>U(e,((e,t)=>t(e)),Ht(t,o)),OB=(e,t,o)=>e.fold(EB([TB(o),SB(t)]),EB([SB(t)]),EB([])),AB=(e,t,o)=>e.fold(EB([TB(o)]),EB([]),EB([TB(t)])),MB=(e,t,o)=>e.fold(EB([]),EB([SB(o)]),EB([TB(t),SB(o)])),BB=(e,t,o)=>{const n=e.fold(((e,t)=>({position:A.some("absolute"),left:A.some(e+"px"),top:A.some(t+"px")})),((e,t)=>({position:A.some("absolute"),left:A.some(e-o.left+"px"),top:A.some(t-o.top+"px")})),((e,t)=>({position:A.some("fixed"),left:A.some(e+"px"),top:A.some(t+"px")})));return{right:A.none(),bottom:A.none(),...n}},PB=(e,t,o,n)=>{const r=(e,r)=>(i,s)=>{const a=e(t,o,n);return r(i.getOr(a.left),s.getOr(a.top))};return e.fold(r(MB,RB),r(AB,VB),r(OB,NB))},RB=kB.offset,VB=kB.absolute,NB=kB.fixed,DB=(e,t)=>{const o=wt(e,t);return u(o)?NaN:parseInt(o,10)},FB=(e,t,o,n,r,i)=>{const s=((e,t,o,n)=>((e,t)=>{const o=e.element,n=DB(o,t.leftAttr),r=DB(o,t.topAttr);return isNaN(n)||isNaN(r)?A.none():A.some(Ht(n,r))})(e,t).fold((()=>o),(e=>NB(e.left+n.left,e.top+n.top))))(e,t,o,n),a=t.mustSnap?LB(e,t,s,r,i):zB(e,t,s,r,i),l=OB(s,r,i);return((e,t,o)=>{const n=e.element;bt(n,t.leftAttr,o.left+"px"),bt(n,t.topAttr,o.top+"px")})(e,t,l),a.fold((()=>({coord:NB(l.left,l.top),extra:A.none()})),(e=>({coord:e.output,extra:e.extra})))},IB=(e,t,o,n)=>ie(e,(e=>{const r=e.sensor,i=((e,t,o,n,r,i)=>{const s=AB(e,r,i),a=AB(t,r,i);return Math.abs(s.left-a.left)<=o&&Math.abs(s.top-a.top)<=n})(t,r,e.range.left,e.range.top,o,n);return i?A.some({output:PB(e.output,t,o,n),extra:e.extra}):A.none()})),LB=(e,t,o,n,r)=>{const i=t.getSnapPoints(e);return IB(i,o,n,r).orThunk((()=>{const e=U(i,((e,t)=>{const i=t.sensor,s=((e,t,o,n,r,i)=>{const s=AB(e,r,i),a=AB(t,r,i),l=Math.abs(s.left-a.left),c=Math.abs(s.top-a.top);return Ht(l,c)})(o,i,t.range.left,t.range.top,n,r);return e.deltas.fold((()=>({deltas:A.some(s),snap:A.some(t)})),(o=>(s.left+s.top)/2<=(o.left+o.top)/2?{deltas:A.some(s),snap:A.some(t)}:e))}),{deltas:A.none(),snap:A.none()});return e.snap.map((e=>({output:PB(e.output,o,n,r),extra:e.extra})))}))},zB=(e,t,o,n,r)=>{const i=t.getSnapPoints(e);return IB(i,o,n,r)};var HB=Object.freeze({__proto__:null,snapTo:(e,t,o,n)=>{const r=t.getTarget(e.element);if(t.repositionTarget){const t=Xe(e.element),o=Fo(t),i=tE(r),s=((e,t,o)=>({coord:PB(e.output,e.output,t,o),extra:e.extra}))(n,o,i),a=BB(s.coord,0,i);Ot(r,a)}}});const ZB="data-initial-z-index",jB=(e,t)=>{e.getSystem().addToGui(t),(e=>{et(e.element).filter(He).each((t=>{Bt(t,"z-index").each((e=>{bt(t,ZB,e)})),Tt(t,"z-index",At(e.element,"z-index"))}))})(t)},UB=e=>{(e=>{et(e.element).filter(He).each((e=>{_t(e,ZB).fold((()=>Vt(e,"z-index")),(t=>Tt(e,"z-index",t))),Ct(e,ZB)}))})(e),e.getSystem().removeFromGui(e)},$B=(e,t,o)=>e.getSystem().build(k_.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[t]},events:o}));var WB=dr("snaps",[Gn("getSnapPoints"),_a("onSensor"),Gn("leftAttr"),Gn("topAttr"),ur("lazyViewport",Go),ur("mustSnap",!1)]);const qB=[ur("useFixed",T),Gn("blockerClass"),ur("getTarget",w),ur("onDrag",v),ur("repositionTarget",!0),ur("onDrop",v),vr("getBounds",Go),WB],GB=(e,t)=>({bounds:e.getBounds(),height:Lt(t.element),width:qt(t.element)}),YB=(e,t,o,n,r)=>{const i=o.update(n,r),s=o.getStartData().getOrThunk((()=>GB(t,e)));i.each((o=>{((e,t,o,n)=>{const r=t.getTarget(e.element);if(t.repositionTarget){const i=Xe(e.element),s=Fo(i),a=tE(r),l=(e=>{return(t=Bt(e,"left"),o=Bt(e,"top"),n=Bt(e,"position"),r=(e,t,o)=>("fixed"===o?NB:RB)(parseInt(e,10),parseInt(t,10)),t.isSome()&&o.isSome()&&n.isSome()?A.some(r(t.getOrDie(),o.getOrDie(),n.getOrDie())):A.none()).getOrThunk((()=>{const t=jt(e);return VB(t.left,t.top)}));var t,o,n,r})(r),c=((e,t,o,n,r,i,s)=>((e,t,o,n,r)=>{const i=r.bounds,s=AB(t,o,n),a=La(s.left,i.x,i.x+i.width-r.width),l=La(s.top,i.y,i.y+i.height-r.height),c=VB(a,l);return t.fold((()=>{const e=MB(c,o,n);return RB(e.left,e.top)}),y(c),(()=>{const e=OB(c,o,n);return NB(e.left,e.top)}))})(0,t.fold((()=>{const e=(t=o,s=i.left,a=i.top,t.fold(((e,t)=>RB(e+s,t+a)),((e,t)=>VB(e+s,t+a)),((e,t)=>NB(e+s,t+a))));var t,s,a;const l=OB(e,n,r);return NB(l.left,l.top)}),(t=>{const s=FB(e,t,o,i,n,r);return s.extra.each((o=>{t.onSensor(e,o)})),s.coord})),n,r,s))(e,t.snaps,l,s,a,n,o),d=BB(c,0,a);Ot(r,d)}t.onDrag(e,r,n)})(e,t,s,o)}))},XB=(e,t,o,n)=>{t.each(UB),o.snaps.each((t=>{((e,t)=>{((e,t)=>{const o=e.element;Ct(o,t.leftAttr),Ct(o,t.topAttr)})(e,t)})(e,t)}));const r=o.getTarget(e.element);n.reset(),o.onDrop(e,r)},KB=e=>(t,o)=>{const n=e=>{o.setStartData(GB(t,e))};return Mi([Ri(hi(),(e=>{o.getStartData().each((()=>n(e)))})),...e(t,o,n)])};var JB=Object.freeze({__proto__:null,getData:e=>A.from(Ht(e.x,e.y)),getDelta:(e,t)=>Ht(t.left-e.left,t.top-e.top)});const QB=(e,t,o)=>[Ri(Nr(),((n,r)=>{if(0!==r.event.raw.button)return;r.stop();const i=()=>XB(n,A.some(l),e,t),s=g_(i,200),a={drop:i,delayDrop:s.schedule,forceDrop:i,move:o=>{s.cancel(),YB(n,e,t,JB,o)}},l=$B(n,e.blockerClass,(e=>Mi([Ri(Nr(),e.forceDrop),Ri(Ir(),e.drop),Ri(Dr(),((t,o)=>{e.move(o.event)})),Ri(Fr(),e.delayDrop)]))(a));o(n),jB(n,l)}))],eP=[...qB,Sa("dragger",{handlers:KB(QB)})];var tP=Object.freeze({__proto__:null,getData:e=>{const t=e.raw.touches;return 1===t.length?(e=>{const t=e[0];return A.some(Ht(t.clientX,t.clientY))})(t):A.none()},getDelta:(e,t)=>Ht(t.left-e.left,t.top-e.top)});const oP=(e,t,o)=>{const n=Zl(),r=o=>{XB(o,n.get(),e,t),n.clear()};return[Ri(Br(),((i,s)=>{s.stop();const a=()=>r(i),l={drop:a,delayDrop:v,forceDrop:a,move:o=>{YB(i,e,t,tP,o)}},c=$B(i,e.blockerClass,(e=>Mi([Ri(Br(),e.forceDrop),Ri(Rr(),e.drop),Ri(Vr(),e.drop),Ri(Pr(),((t,o)=>{e.move(o.event)}))]))(l));n.set(c),o(i),jB(i,c)})),Ri(Pr(),((o,n)=>{n.stop(),YB(o,e,t,tP,n.event)})),Ri(Rr(),((e,t)=>{t.stop(),r(e)})),Ri(Vr(),r)]},nP=eP,rP=[...qB,Sa("dragger",{handlers:KB(oP)})],iP=[...qB,Sa("dragger",{handlers:KB(((e,t,o)=>[...QB(e,t,o),...oP(e,t,o)]))})];var sP=Object.freeze({__proto__:null,mouse:nP,touch:rP,mouseOrTouch:iP}),aP=Object.freeze({__proto__:null,init:()=>{let e=A.none(),t=A.none();const o=y({});return vs({readState:o,reset:()=>{e=A.none(),t=A.none()},update:(t,o)=>t.getData(o).bind((o=>((t,o)=>{const n=e.map((e=>t.getDelta(e,o)));return e=A.some(o),n})(t,o))),getStartData:()=>t,setStartData:e=>{t=A.some(e)}})}});const lP=vl({branchKey:"mode",branches:sP,name:"dragging",active:{events:(e,t)=>e.dragger.handlers(e,t)},extra:{snap:e=>({sensor:e.sensor,range:e.range,output:e.output,extra:A.from(e.extra)})},state:aP,apis:HB}),cP=(e,t,o,n,r,i)=>e.fold((()=>lP.snap({sensor:VB(o-20,n-20),range:Ht(r,i),output:VB(A.some(o),A.some(n)),extra:{td:t}})),(e=>{const r=o-20,i=n-20,s=e.element.dom.getBoundingClientRect();return lP.snap({sensor:VB(r,i),range:Ht(40,40),output:VB(A.some(o-s.width/2),A.some(n-s.height/2)),extra:{td:t}})})),dP=(e,t,o)=>({getSnapPoints:e,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:(e,n)=>{const r=n.td;((e,t)=>e.exists((e=>Ge(e,t))))(t.get(),r)||(t.set(r),o(r))},mustSnap:!0}),uP=e=>Mg(Ag.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:ml([lP.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:e}),ox.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}})),hP=(e,t)=>{const o=wr([]),n=wr([]),r=wr(!1),i=Zl(),s=Zl(),a=e=>{const o=qo(e);return cP(u.getOpt(t),e,o.x,o.y,o.width,o.height)},l=e=>{const o=qo(e);return cP(h.getOpt(t),e,o.right,o.bottom,o.width,o.height)},c=dP((()=>L(o.get(),(e=>a(e)))),i,(t=>{s.get().each((o=>{e.dispatch("TableSelectorChange",{start:t,finish:o})}))})),d=dP((()=>L(n.get(),(e=>l(e)))),s,(t=>{i.get().each((o=>{e.dispatch("TableSelectorChange",{start:o,finish:t})}))})),u=uP(c),h=uP(d),m=Ys(u.asSpec()),p=Ys(h.asSpec()),g=(t,o,n,r)=>{const i=n(o);lP.snapTo(t,i),((t,o,n,i)=>{const s=o.dom.getBoundingClientRect();Vt(t.element,"display");const a=Qe(Ve(e.getBody())).dom.innerHeight,l=s[r]<0,c=((e,t)=>e[r]>t)(s,a);(l||c)&&Tt(t.element,"display","none")})(t,o)},f=e=>g(m,e,a,"top"),v=e=>g(p,e,l,"bottom");To().deviceType.isTouch()&&(e.on("TableSelectionChange",(e=>{r.get()||(bd(t,m),bd(t,p),r.set(!0)),i.set(e.start),s.set(e.finish),e.otherCells.each((t=>{o.set(t.upOrLeftCells),n.set(t.downOrRightCells),f(e.start),v(e.finish)}))})),e.on("ResizeEditor ResizeWindow ScrollContent",(()=>{i.get().each(f),s.get().each(v)})),e.on("TableSelectionClear",(()=>{r.get()&&(_d(m),_d(p),r.set(!1)),i.clear(),s.clear()})))},mP=(e,t,o)=>{var n;const r=null!==(n=t.delimiter)&&void 0!==n?n:"›";return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:ml([Ep.config({mode:"flow",selector:"div[role=button]"}),Ch.config({disabled:o.isDisabled}),ry(),B_.config({}),Dp.config({}),Fp("elementPathEvents",[Hi(((t,n)=>{e.shortcuts.add("alt+F11","focus statusbar elementpath",(()=>Ep.focusIn(t))),e.on("NodeChange",(n=>{const i=(t=>{const o=[];let n=t.length;for(;n-- >0;){const i=t[n];if(1===i.nodeType&&"BR"!==(r=i).nodeName&&!r.getAttribute("data-mce-bogus")&&"bookmark"!==r.getAttribute("data-mce-type")){const t=Xy(e,i);if(t.isDefaultPrevented()||o.push({name:t.name,element:i}),t.isPropagationStopped())break}}var r;return o})(n.parents),s=i.length>0?U(i,((t,n,i)=>{const s=((t,n,r)=>Ag.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{"data-index":r,"aria-level":r+1}},components:[$s(t)],action:t=>{e.focus(),e.selection.select(n),e.nodeChanged()},buttonBehaviours:ml([iy(o.isDisabled),ry()])}))(n.name,n.element,i);return 0===i?t.concat([s]):t.concat([{dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0}},components:[$s(` ${r} `)]},s])}),[]):[];Dp.set(t,s)}))}))])]),components:[]}};var pP;!function(e){e[e.None=0]="None",e[e.Both=1]="Both",e[e.Vertical=2]="Vertical"}(pP||(pP={}));const gP=(e,t,o)=>{const n=Ve(e.getContainer()),r=((e,t,o,n,r)=>{const i={height:_M(n+t.top,tf(e),nf(e))};return o===pP.Both&&(i.width=_M(r+t.left,ef(e),of(e))),i})(e,t,o,It(n),Wt(n));le(r,((e,t)=>{g(e)&&Tt(n,t,wM(e))})),(e=>{e.dispatch("ResizeEditor")})(e)},fP=(e,t,o,n)=>{const r=Ht(20*o,20*n);return gP(e,r,t),A.some(!0)},vP=(e,t)=>({dom:{tag:"div",classes:["tox-statusbar"]},components:(()=>{const o=(()=>{const o=[];return Ef(e)&&o.push(mP(e,{},t)),e.hasPlugin("wordcount")&&o.push(((e,t)=>{const o=(e,o,n)=>Dp.set(e,[$s(t.translate(["{0} "+n,o[n]]))]);return Ag.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:ml([iy(t.isDisabled),ry(),B_.config({}),Dp.config({}),ou.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),Fp("wordcount-events",[Ui((e=>{const t=ou.getValue(e),n="words"===t.mode?"characters":"words";ou.setValue(e,{mode:n,count:t.count}),o(e,t.count,n)})),Hi((t=>{e.on("wordCountUpdate",(e=>{const{mode:n}=ou.getValue(t);ou.setValue(t,{mode:n,count:e.wordCount}),o(t,e.wordCount,n)}))}))])]),eventOrder:{[ni()]:["disabling","alloy.base.behaviour","wordcount-events"]}})})(e,t)),Of(e)&&o.push({dom:{tag:"span",classes:["tox-statusbar__branding"]},components:[{dom:{tag:"a",attributes:{href:"https://www.tiny.cloud/powered-by-tiny?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce&utm_content=v6",rel:"noopener",target:"_blank","aria-label":Bg.translate(["Powered by {0}","Tiny"])},innerHtml:'<svg width="50px" height="16px" viewBox="0 0 50 16" xmlns="http://www.w3.org/2000/svg">\n  <path fill-rule="evenodd" clip-rule="evenodd" d="M10.143 0c2.608.015 5.186 2.178 5.186 5.331 0 0 .077 3.812-.084 4.87-.361 2.41-2.164 4.074-4.65 4.496-1.453.284-2.523.49-3.212.623-.373.071-.634.122-.785.152-.184.038-.997.145-1.35.145-2.732 0-5.21-2.04-5.248-5.33 0 0 0-3.514.03-4.442.093-2.4 1.758-4.342 4.926-4.963 0 0 3.875-.752 4.036-.782.368-.07.775-.1 1.15-.1Zm1.826 2.8L5.83 3.989v2.393l-2.455.475v5.968l6.137-1.189V9.243l2.456-.476V2.8ZM5.83 6.382l3.682-.713v3.574l-3.682.713V6.382Zm27.173-1.64-.084-1.066h-2.226v9.132h2.456V7.743c-.008-1.151.998-2.064 2.149-2.072 1.15-.008 1.987.92 1.995 2.072v5.065h2.455V7.359c-.015-2.18-1.657-3.929-3.837-3.913a3.993 3.993 0 0 0-2.908 1.296Zm-6.3-4.266L29.16 0v2.387l-2.456.475V.476Zm0 3.2v9.132h2.456V3.676h-2.456Zm18.179 11.787L49.11 3.676H46.58l-1.612 4.527-.46 1.382-.384-1.382-1.611-4.527H39.98l3.3 9.132L42.15 16l2.732-.537ZM22.867 9.738c0 .752.568 1.075.921 1.075.353 0 .668-.047.998-.154l.537 1.765c-.23.154-.92.537-2.225.537-1.305 0-2.655-.997-2.686-2.686a136.877 136.877 0 0 1 0-4.374H18.8V3.676h1.612v-1.98l2.455-.476v2.456h2.302V5.9h-2.302v3.837Z"/>\n</svg>\n'.trim()},behaviours:ml([Zp.config({})])}]}),o.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:o}]:[]})(),n=((e,t)=>{const o=(e=>{const t=Af(e);return!1===t?pP.None:"both"===t?pP.Both:pP.Vertical})(e);return o===pP.None?A.none():A.some(zg("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:t.translate("Resize")},behaviours:[lP.config({mode:"mouse",repositionTarget:!1,onDrag:(t,n,r)=>gP(e,r,o),blockerClass:"tox-blocker"}),Ep.config({mode:"special",onLeft:()=>fP(e,o,-1,0),onRight:()=>fP(e,o,1,0),onUp:()=>fP(e,o,0,-1),onDown:()=>fP(e,o,0,1)}),B_.config({}),Zp.config({})]},t.icons))})(e,t);return o.concat(n.toArray())})()}),bP=(e,t)=>t.get().getOrDie(`UI for ${e} has not been rendered`),yP=e=>{const t=e.inline,o=t?TM:bM,n=$f(e)?EE:QT,r=(()=>{const e=Zl(),t=Zl(),o=Zl();return{dialogUi:e,popupUi:t,mainUi:o,getUiMotherships:()=>[...e.get().map((e=>e.mothership)).toArray()],setupDialogUi:t=>{e.set(t)},lazyGetInOuterOrDie:(e,t)=>()=>o.get().bind((e=>t(e.outerContainer))).getOrDie(`Could not find ${e} element in OuterContainer`)}})(),i=Zl(),s=Zl(),a=To().deviceType.isTouch()?["tox-platform-touch"]:[],l=zf(e),c=df(e),d=Mg({dom:{tag:"div",classes:["tox-anchorbar"]}}),u=()=>r.mainUi.get().map((e=>e.outerContainer)).bind(mA.getHeader),h=r.lazyGetInOuterOrDie("anchor bar",d.getOpt),m=r.lazyGetInOuterOrDie("toolbar",mA.getToolbar),p=r.lazyGetInOuterOrDie("throbber",mA.getThrobber),g=((e,t,o)=>{const n=wr(!1),r=(e=>{const t=wr(zf(e)?"bottom":"top");return{isPositionedAtTop:()=>"top"===t.get(),getDockingMode:t.get,setDockingMode:t.set}})(t),i={icons:()=>t.ui.registry.getAll().icons,menuItems:()=>t.ui.registry.getAll().menuItems,translate:Bg.translate,isDisabled:()=>t.mode.isReadOnly()||!t.ui.isEnabled(),getOption:t.options.get},s=LT(t),a=(e=>{const t=t=>()=>e.formatter.match(t),o=t=>()=>{const o=e.formatter.get(t);return void 0!==o?A.some({tag:o.length>0&&(o[0].inline||o[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))}):A.none()},n=wr([]),r=wr([]),i=wr(!1);return e.on("PreInit",(r=>{const i=hT(e),s=pT(e,i,t,o);n.set(s)})),e.on("addStyleModifications",(n=>{const s=pT(e,n.items,t,o);r.set(s),i.set(n.replace)})),{getData:()=>{const e=i.get()?[]:n.get(),t=r.get();return e.concat(t)}}})(t),l=(e=>({colorPicker:nT(e),hasCustomColors:rT(e),getColors:iT(e),getColorCols:sT(e)}))(t),c=(e=>({isDraggableModal:aT(e)}))(t),d={shared:{providers:i,anchors:oT(t,o,r.isPositionedAtTop),header:r},urlinput:s,styles:a,colorinput:l,dialog:c,isContextMenuOpen:()=>n.get(),setContextMenuState:e=>n.set(e)},u={...d,shared:{...d.shared,interpreter:e=>BS(e,{},u),getSink:e.popup}},h={...d,shared:{...d.shared,interpreter:e=>BS(e,{},h),getSink:e.dialog}};return{popup:u,dialog:h}})({popup:()=>Ko.fromOption(r.popupUi.get().map((e=>e.sink)),"(popup) UI has not been rendered"),dialog:()=>Ko.fromOption(r.dialogUi.get().map((e=>e.sink)),"UI has not been rendered")},e,h),f=w,v=()=>{const o=(()=>{const t={attributes:{[lc]:l?ac.BottomToTop:ac.TopToBottom}},o=mA.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:g.popup,onEscape:()=>{e.focus()}}),n=mA.parts.toolbar({dom:{tag:"div",classes:["tox-toolbar"]},getSink:g.popup.shared.getSink,providers:g.popup.shared.providers,onEscape:()=>{e.focus()},onToolbarToggled:t=>{((e,t)=>{e.dispatch("ToggleToolbarDrawer",{state:t})})(e,t)},type:c,lazyToolbar:m,lazyHeader:()=>u().getOrDie("Could not find header element"),...t}),r=mA.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:g.popup.shared.providers,onEscape:()=>{e.focus()},type:c}),i=Lf(e),s=Ff(e),a=Vf(e),h=Pf(e),p=mA.parts.promotion({dom:{tag:"div",classes:["tox-promotion"]}}),f=i||s||a,v=h?[p,o]:[o];return mA.parts.header({dom:{tag:"div",classes:["tox-editor-header"].concat(f?[]:["tox-editor-header--empty"]),...t},components:q([a?v:[],i?[r]:s?[n]:[],Zf(e)?[]:[d.asSpec()]]),sticky:$f(e),editor:e,sharedBackstage:g.popup.shared})})(),n={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[mA.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),mA.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}})]},r=mA.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:g.popup}),s=mA.parts.viewWrapper({backstage:g.popup}),h=Tf(e)&&!t?A.some(vP(e,g.popup.shared.providers)):A.none(),p=q([l?[]:[o],t?[]:[n],l?[o]:[]]),f=mA.parts.editorContainer({components:q([p,t?[]:h.toArray()])}),v=Uf(e),b={role:"application",...Bg.isRtl()?{dir:"rtl"}:{},...v?{"aria-hidden":"true"}:{}},y=Ys(mA.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(t?["tox-tinymce-inline"]:[]).concat(l?["tox-tinymce--toolbar-bottom"]:[]).concat(a),styles:{visibility:"hidden",...v?{opacity:"0",border:"0"}:{}},attributes:b},components:[f,...t?[]:[s],r],behaviours:ml([ry(),Ch.config({disableClass:"tox-tinymce--disabled"}),Ep.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a, .tox-statusbar__resize-handle"})])})),w=S_(y);return i.set(w),{mothership:w,outerContainer:y}},b=t=>{const o=wM((e=>{const t=(e=>{const t=Jg(e),o=tf(e),n=nf(e);return yM(t).map((e=>_M(e,o,n)))})(e);return t.getOr(Jg(e))})(e)),n=wM((e=>xM(e).getOr(Qg(e)))(e));return e.inline||(Rt("div","width",n)&&Tt(t.element,"width",n),Rt("div","height",o)?Tt(t.element,"height",o):Tt(t.element,"height","400px")),o};return{popups:{backstage:g.popup,getMothership:()=>bP("popups",s)},dialogs:{backstage:g.dialog,getMothership:()=>bP("dialogs",s)},renderUI:()=>{const t=v(),i=(()=>{const t=jf(e),o=Ge(gt(),t)&&"grid"===At(t,"display"),r={dom:{tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(a),attributes:{...Bg.isRtl()?{dir:"rtl"}:{}}},behaviours:ml([ud.config({useFixed:()=>n.isDocked(u)})])},i={dom:{styles:{width:document.body.clientWidth+"px"}},events:Mi([Ri(mi(),(e=>{Tt(e.element,"width",document.body.clientWidth+"px")}))])},l=Ys(cn(r,o?i:{})),c=S_(l);return s.set(c),{sink:l,mothership:c}})(),l=f(i);r.dialogUi.set(i),r.popupUi.set(l),r.mainUi.set(t);return(t=>{const{mainUi:r,popupUi:i,uiMotherships:s}=t;ce(uf(e),((t,o)=>{e.ui.registry.addGroupToolbarButton(o,t)}));const{buttons:a,menuItems:l,contextToolbars:d,sidebars:h,views:m}=e.ui.registry.getAll(),f=If(e),v={menuItems:l,menus:Wf(e),menubar:vf(e),toolbar:f.getOrThunk((()=>bf(e))),allowToolbarGroups:c===jg.floating,buttons:a,sidebar:h,views:m};var y;y=r.outerContainer,e.addShortcut("alt+F9","focus menubar",(()=>{mA.focusMenubar(y)})),e.addShortcut("alt+F10","focus toolbar",(()=>{mA.focusToolbar(y)})),e.addCommand("ToggleToolbarDrawer",(()=>{mA.toggleToolbarDrawer(y)})),e.addQueryStateHandler("ToggleToolbarDrawer",(()=>mA.isToolbarDrawerToggled(y))),((e,t,o)=>{const n=(e,n)=>{z([t,...o],(t=>{t.broadcastEvent(e,n)}))},r=(e,n)=>{z([t,...o],(t=>{t.broadcastOn([e],n)}))},i=e=>r(Fd(),{target:e.target}),s=Ho(),a=Ul(s,"touchstart",i),l=Ul(s,"touchmove",(e=>n(di(),e))),c=Ul(s,"touchend",(e=>n(ui(),e))),d=Ul(s,"mousedown",i),u=Ul(s,"mouseup",(e=>{0===e.raw.button&&r(Ld(),{target:e.target})})),h=e=>r(Fd(),{target:Ve(e.target)}),m=e=>{0===e.button&&r(Ld(),{target:Ve(e.target)})},p=()=>{z(e.editorManager.get(),(t=>{e!==t&&t.dispatch("DismissPopups",{relatedTarget:e})}))},g=e=>n(hi(),Wl(e)),f=e=>{r(Id(),{}),n(mi(),Wl(e))},v=()=>r(Id(),{}),b=t=>{t.state&&r(Fd(),{target:Ve(e.getContainer())})},y=e=>{r(Fd(),{target:Ve(e.relatedTarget.getContainer())})};e.on("PostRender",(()=>{e.on("click",h),e.on("tap",h),e.on("mouseup",m),e.on("mousedown",p),e.on("ScrollWindow",g),e.on("ResizeWindow",f),e.on("ResizeEditor",v),e.on("AfterProgressState",b),e.on("DismissPopups",y)})),e.on("remove",(()=>{e.off("click",h),e.off("tap",h),e.off("mouseup",m),e.off("mousedown",p),e.off("ScrollWindow",g),e.off("ResizeWindow",f),e.off("ResizeEditor",v),e.off("AfterProgressState",b),e.off("DismissPopups",y),d.unbind(),a.unbind(),l.unbind(),c.unbind(),u.unbind()})),e.on("detach",(()=>{z([t,...o],Sd),z([t,...o],(e=>e.destroy()))}))})(e,r.mothership,s),n.setup(e,g.popup.shared,u),oB(e,g.popup),CB(e,g.popup.shared.getSink,g.popup),(e=>{const{sidebars:t}=e.ui.registry.getAll();z(se(t),(o=>{const n=t[o],r=()=>we(A.from(e.queryCommandValue("ToggleSidebar")),o);e.ui.registry.addToggleButton(o,{icon:n.icon,tooltip:n.tooltip,onAction:t=>{e.execCommand("ToggleSidebar",!1,o),t.setActive(r())},onSetup:t=>{t.setActive(r());const o=()=>t.setActive(r());return e.on("ToggleSidebar",o),()=>{e.off("ToggleSidebar",o)}}})}))})(e),pO(e,p,g.popup.shared),$M(e,d,i.sink,{backstage:g.popup}),hP(e,i.sink);const w={targetNode:e.getElement(),height:b(r.outerContainer)};return o.render(e,t,v,g.popup,w)})({popupUi:l,dialogUi:i,mainUi:t,uiMotherships:r.getUiMotherships()})}}},wP=y([Gn("lazySink"),nr("dragBlockClass"),vr("getBounds",Go),ur("useTabstopAt",E),ur("eventOrder",{}),nu("modalBehaviours",[Ep]),xa("onExecute"),ka("onEscape")]),_P={sketch:w},xP=y([Pu({name:"draghandle",overrides:(e,t)=>({behaviours:ml([lP.config({mode:"mouse",getTarget:e=>oa(e,'[role="dialog"]').getOr(e),blockerClass:e.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(t,null,2)).message),getBounds:e.getDragBounds})])})}),Mu({schema:[Gn("dom")],name:"title"}),Mu({factory:_P,schema:[Gn("dom")],name:"close"}),Mu({factory:_P,schema:[Gn("dom")],name:"body"}),Pu({factory:_P,schema:[Gn("dom")],name:"footer"}),Bu({factory:{sketch:(e,t)=>({...e,dom:t.dom,components:t.components})},schema:[ur("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),ur("components",[])],name:"blocker"})]),CP=ih({name:"ModalDialog",configFields:wP(),partFields:xP(),factory:(e,t,o,n)=>{const r=Zl(),i=Qi("modal-events"),s={...e.eventOrder,[pi()]:[i].concat(e.eventOrder["alloy.system.attached"]||[])};return{uid:e.uid,dom:e.dom,components:t,apis:{show:t=>{r.set(t);const o=e.lazySink(t).getOrDie(),i=n.blocker(),s=o.getSystem().build({...i,components:i.components.concat([Xs(t)]),behaviours:ml([Zp.config({}),Fp("dialog-blocker-events",[zi(zr(),(()=>{Ep.focusIn(t)}))])])});bd(o,s),Ep.focusIn(t)},hide:e=>{r.clear(),et(e.element).each((t=>{e.getSystem().getByDom(t).each((e=>{_d(e)}))}))},getBody:t=>$u(t,e,"body"),getFooter:t=>$u(t,e,"footer"),setIdle:e=>{uO.unblock(e)},setBusy:(e,t)=>{uO.block(e,t)}},eventOrder:s,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:iu(e.modalBehaviours,[Dp.config({}),Ep.config({mode:"cyclic",onEnter:e.onExecute,onEscape:e.onEscape,useTabstopAt:e.useTabstopAt}),uO.config({getRoot:r.get}),Fp(i,[Hi((t=>{((e,t)=>{const o=_t(e,"id").fold((()=>{const e=Qi("dialog-label");return bt(t,"id",e),e}),w);bt(e,"aria-labelledby",o)})(t.element,$u(t,e,"title").element),((e,t)=>{const o=A.from(wt(e,"id")).fold((()=>{const e=Qi("dialog-describe");return bt(t,"id",e),e}),w);bt(e,"aria-describedby",o)})(t.element,$u(t,e,"body").element)}))])])}},apis:{show:(e,t)=>{e.show(t)},hide:(e,t)=>{e.hide(t)},getBody:(e,t)=>e.getBody(t),getFooter:(e,t)=>e.getFooter(t),setBusy:(e,t,o)=>{e.setBusy(t,o)},setIdle:(e,t)=>{e.setIdle(t)}}}),kP=kn([Iv,Lv].concat(Vb)),SP=Rn,TP=[ub("button"),Jv,gr("align","end",["start","end"]),sb,ib,ar("buttonType",["primary","secondary"])],EP=[...TP,Hv],OP=[Jn("type",["submit","cancel","custom"]),...EP],AP=[Jn("type",["menu"]),Kv,Qv,Jv,or("items",kP),...TP],MP=Un("type",{submit:OP,cancel:OP,custom:OP,menu:AP}),BP=[Iv,Hv,Jn("level",["info","warn","error","success"]),jv,ur("url","")],PP=kn(BP),RP=[Iv,Hv,ib,ub("button"),Jv,rb,ar("buttonType",["primary","secondary","toolbar"]),sb],VP=kn(RP),NP=[Iv,Lv],DP=NP.concat([eb]),FP=NP.concat([zv,ib]),IP=kn(FP),LP=Rn,zP=DP.concat([ab("auto")]),HP=kn(zP),ZP=On([Uv,Hv,jv]),jP=DP.concat([pr("storageKey","default")]),UP=kn(jP),$P=Pn,WP=kn(DP),qP=Pn,GP=NP.concat([pr("tag","textarea"),Kn("scriptId"),Kn("scriptUrl"),hr("settings",void 0,Dn)]),YP=NP.concat([pr("tag","textarea"),Qn("init")]),XP=In((e=>zn("customeditor.old",Cn(YP),e).orThunk((()=>zn("customeditor.new",Cn(GP),e))))),KP=Pn,JP=kn(DP),QP=Sn(bn),eR=e=>[Iv,Xn("columns"),e],tR=[Iv,Kn("html"),gr("presets","presentation",["presentation","document"])],oR=kn(tR),nR=DP.concat([fr("sandboxed",!0),fr("transparent",!0)]),rR=kn(nR),iR=Pn,sR=kn(NP.concat([sr("height")])),aR=kn([Kn("url"),ir("zoom"),ir("cachedWidth"),ir("cachedHeight")]),lR=DP.concat([sr("inputMode"),sr("placeholder"),fr("maximized",!1),ib]),cR=kn(lR),dR=Pn,uR=e=>[Iv,zv,e],hR=[Hv,Uv],mR=[Hv,or("items",((e,t)=>{const o=Gt(t);return{extract:(e,t)=>o().extract(e,t),toString:()=>o().toString()}})(0,(()=>pR)))],pR=Tn([kn(hR),kn(mR)]),gR=DP.concat([or("items",pR),ib]),fR=kn(gR),vR=Pn,bR=DP.concat([tr("items",[Hv,Uv]),mr("size",1),ib]),yR=kn(bR),wR=Pn,_R=DP.concat([fr("constrain",!0),ib]),xR=kn(_R),CR=kn([Kn("width"),Kn("height")]),kR=NP.concat([zv,mr("min",0),mr("max",0)]),SR=kn(kR),TR=Bn,ER=[Iv,or("header",Pn),or("cells",Sn(Pn))],OR=kn(ER),AR=DP.concat([sr("placeholder"),fr("maximized",!1),ib]),MR=kn(AR),BR=Pn,PR=DP.concat([gr("filetype","file",["image","media","file"]),ib]),RR=kn(PR),VR=kn([Uv,lb]),NR=e=>$n("items","items",{tag:"required",process:{}},Sn(In((t=>zn(`Checking item of ${e}`,DR,t).fold((e=>Ko.error(jn(e))),(e=>Ko.value(e))))))),DR=_n((()=>{return Fn("type",{alertbanner:PP,bar:kn((e=NR("bar"),[Iv,e])),button:VP,checkbox:IP,colorinput:UP,colorpicker:WP,dropzone:JP,grid:kn(eR(NR("grid"))),iframe:rR,input:cR,listbox:fR,selectbox:yR,sizeinput:xR,slider:SR,textarea:MR,urlinput:RR,customeditor:XP,htmlpanel:oR,imagepreview:sR,collection:HP,label:kn(uR(NR("label"))),table:OR,panel:IR});var e})),FR=[Iv,ur("classes",[]),or("items",DR)],IR=kn(FR),LR=[ub("tab"),Zv,or("items",DR)],zR=[Iv,tr("tabs",LR)],HR=kn(zR),ZR=EP,jR=MP,UR=kn([Kn("title"),Yn("body",Fn("type",{panel:IR,tabpanel:HR})),pr("size","normal"),or("buttons",jR),ur("initialData",{}),vr("onAction",v),vr("onChange",v),vr("onSubmit",v),vr("onClose",v),vr("onCancel",v),vr("onTabChange",v)]),$R=kn([Jn("type",["cancel","custom"]),...ZR]),WR=kn([Kn("title"),Kn("url"),ir("height"),ir("width"),cr("buttons",$R),vr("onAction",v),vr("onCancel",v),vr("onClose",v),vr("onMessage",v)]),qR=e=>s(e)?[e].concat(G(fe(e),qR)):l(e)?G(e,qR):[],GR=e=>i(e.type)&&i(e.name),YR={checkbox:LP,colorinput:$P,colorpicker:qP,dropzone:QP,input:dR,iframe:iR,imagepreview:aR,selectbox:wR,sizeinput:CR,slider:TR,listbox:vR,size:CR,textarea:BR,urlinput:VR,customeditor:KP,collection:ZP,togglemenuitem:SP},XR=e=>{const t=(e=>Z(qR(e),GR))(e),o=G(t,(e=>(e=>A.from(YR[e.type]))(e).fold((()=>[]),(t=>[Yn(e.name,t)]))));return kn(o)},KR=e=>{var t;return{internalDialog:Hn(zn("dialog",UR,e)),dataValidator:XR(e),initialData:null!==(t=e.initialData)&&void 0!==t?t:{}}},JR={open:(e,t)=>{const o=KR(t);return e(o.internalDialog,o.initialData,o.dataValidator)},openUrl:(e,t)=>e(Hn(zn("dialog",WR,t))),redial:e=>KR(e)},QR=e=>{const t=[],o={};return le(e,((e,n)=>{e.fold((()=>{t.push(n)}),(e=>{o[n]=e}))})),t.length>0?Ko.error(t):Ko.value(o)},eV=(e,t,o)=>{const n=Mg(WC.sketch((n=>({dom:{tag:"div",classes:["tox-form"].concat(e.classes)},components:L(e.items,(e=>AS(n,e,t,o)))}))));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[n.asSpec()]}],behaviours:ml([Ep.config({mode:"acyclic",useTabstopAt:C(vk)}),(r=n,ch.config({find:r.getOpt})),rk(n,{postprocess:e=>QR(e).fold((e=>(console.error(e),{})),w)})])};var r},tV=rh({name:"TabButton",configFields:[ur("uid",void 0),Gn("value"),$n("dom","dom",mn((()=>({attributes:{role:"tab",id:Qi("aria"),"aria-selected":"false"}}))),An()),nr("action"),ur("domModification",{}),nu("tabButtonBehaviours",[Zp,Ep,ou]),Gn("view")],factory:(e,t)=>({uid:e.uid,dom:e.dom,components:e.components,events:Jp(e.action),behaviours:iu(e.tabButtonBehaviours,[Zp.config({}),Ep.config({mode:"execution",useSpace:!0,useEnter:!0}),ou.config({store:{mode:"memory",initialValue:e.value}})]),domModification:e.domModification})}),oV=y([Gn("tabs"),Gn("dom"),ur("clickToDismiss",!1),nu("tabbarBehaviours",[Rh,Ep]),ya(["tabClass","selectedClass"])]),nV=Ru({factory:tV,name:"tabs",unit:"tab",overrides:e=>{const t=(e,t)=>{Rh.dehighlight(e,t),Si(e,_i(),{tabbar:e,button:t})},o=(e,t)=>{Rh.highlight(e,t),Si(e,wi(),{tabbar:e,button:t})};return{action:n=>{const r=n.getSystem().getByUid(e.uid).getOrDie(),i=Rh.isHighlighted(r,n);(i&&e.clickToDismiss?t:i?v:o)(r,n)},domModification:{classes:[e.markers.tabClass]}}}}),rV=y([nV]),iV=ih({name:"Tabbar",configFields:oV(),partFields:rV(),factory:(e,t,o,n)=>({uid:e.uid,dom:e.dom,components:t,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:iu(e.tabbarBehaviours,[Rh.config({highlightClass:e.markers.selectedClass,itemClass:e.markers.tabClass,onHighlight:(e,t)=>{bt(t.element,"aria-selected","true")},onDehighlight:(e,t)=>{bt(t.element,"aria-selected","false")}}),Ep.config({mode:"flow",getInitial:e=>Rh.getHighlighted(e).map((e=>e.element)),selector:"."+e.markers.tabClass,executeOnMove:!0})])})}),sV=rh({name:"Tabview",configFields:[nu("tabviewBehaviours",[Dp])],factory:(e,t)=>({uid:e.uid,dom:e.dom,behaviours:iu(e.tabviewBehaviours,[Dp.config({})]),domModification:{attributes:{role:"tabpanel"}}})}),aV=y([ur("selectFirst",!0),_a("onChangeTab"),_a("onDismissTab"),ur("tabs",[]),nu("tabSectionBehaviours",[])]),lV=Mu({factory:iV,schema:[Gn("dom"),er("markers",[Gn("tabClass"),Gn("selectedClass")])],name:"tabbar",defaults:e=>({tabs:e.tabs})}),cV=Mu({factory:sV,name:"tabview"}),dV=y([lV,cV]),uV=ih({name:"TabSection",configFields:aV(),partFields:dV(),factory:(e,t,o,n)=>{const r=(t,o)=>{Uu(t,e,"tabbar").each((e=>{o(e).each(Ti)}))};return{uid:e.uid,dom:e.dom,components:t,behaviours:ru(e.tabSectionBehaviours),events:Mi(q([e.selectFirst?[Hi(((e,t)=>{r(e,Rh.getFirst)}))]:[],[Ri(wi(),((t,o)=>{(t=>{const o=ou.getValue(t);Uu(t,e,"tabview").each((n=>{$(e.tabs,(e=>e.value===o)).each((o=>{const r=o.view();_t(t.element,"id").each((e=>{bt(n.element,"aria-labelledby",e)})),Dp.set(n,r),e.onChangeTab(n,t,r)}))}))})(o.event.button)})),Ri(_i(),((t,o)=>{const n=o.event.button;e.onDismissTab(t,n)}))]])),apis:{getViewItems:t=>Uu(t,e,"tabview").map((e=>Dp.contents(e))).getOr([]),showTab:(e,t)=>{r(e,(e=>{const o=Rh.getCandidates(e);return $(o,(e=>ou.getValue(e)===t)).filter((t=>!Rh.isHighlighted(e,t)))}))}}}},apis:{getViewItems:(e,t)=>e.getViewItems(t),showTab:(e,t,o)=>{e.showTab(t,o)}}}),hV=(e,t)=>{Tt(e,"height",t+"px"),Tt(e,"flex-basis",t+"px")},mV=(e,t,o)=>{oa(e,'[role="dialog"]').each((e=>{ra(e,'[role="tablist"]').each((n=>{o.get().map((o=>(Tt(t,"height","0"),Tt(t,"flex-basis","0"),Math.min(o,((e,t,o)=>{const n=Je(e).dom,r=oa(e,".tox-dialog-wrap").getOr(e);let i;i="fixed"===At(r,"position")?Math.max(n.clientHeight,window.innerHeight):Math.max(n.offsetHeight,n.scrollHeight);const s=It(t),a=t.dom.offsetLeft>=o.dom.offsetLeft+Wt(o)?Math.max(It(o),s):s,l=parseInt(At(e,"margin-top"),10)||0,c=parseInt(At(e,"margin-bottom"),10)||0;return i-(It(e)+l+c-a)})(e,t,n))))).each((e=>{hV(t,e)}))}))}))},pV=e=>ra(e,'[role="tabpanel"]'),gV="send-data-to-section",fV="send-data-to-view",vV=(e,t,o)=>{const n=wr({}),r=e=>{const t=ou.getValue(e),o=QR(t).getOr({}),r=n.get(),i=cn(r,o);n.set(i)},i=e=>{const t=n.get();ou.setValue(e,t)},s=wr(null),a=L(e.tabs,(e=>({value:e.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"]},components:[$s(o.shared.providers.translate(e.title))],view:()=>[WC.sketch((n=>({dom:{tag:"div",classes:["tox-form"]},components:L(e.items,(e=>AS(n,e,t,o))),formBehaviours:ml([Ep.config({mode:"acyclic",useTabstopAt:C(vk)}),Fp("TabView.form.events",[Hi(i),Zi(r)]),yl.config({channels:Cr([{key:gV,value:{onReceive:r}},{key:fV,value:{onReceive:i}}])})])})))]}))),l=(e=>{const t=Zl(),o=[Hi((o=>{const n=o.element;pV(n).each((r=>{Tt(r,"visibility","hidden"),o.getSystem().getByDom(r).toOptional().each((o=>{const n=((e,t,o)=>L(e,((n,r)=>{Dp.set(o,e[r].view());const i=t.dom.getBoundingClientRect();return Dp.set(o,[]),i.height})))(e,r,o),i=(e=>oe(ee(e,((e,t)=>e>t?-1:e<t?1:0))))(n);i.fold(t.clear,t.set)})),mV(n,r,t),Vt(r,"visibility"),((e,t)=>{oe(e).each((e=>uV.showTab(t,e.value)))})(e,o),requestAnimationFrame((()=>{mV(n,r,t)}))}))})),Ri(mi(),(e=>{const o=e.element;pV(o).each((e=>{mV(o,e,t)}))})),Ri($_,((e,o)=>{const n=e.element;pV(n).each((e=>{const o=Cl(dt(e));Tt(e,"visibility","hidden");const r=Bt(e,"height").map((e=>parseInt(e,10)));Vt(e,"height"),Vt(e,"flex-basis");const i=e.dom.getBoundingClientRect().height;r.forall((e=>i>e))?(t.set(i),mV(n,e,t)):r.each((t=>{hV(e,t)})),Vt(e,"visibility"),o.each(_l)}))}))];return{extraEvents:o,selectFirst:!1}})(a);return uV.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:(e,t,o)=>{const n=ou.getValue(t);Si(e,U_,{name:n,oldName:s.get()}),s.set(n)},tabs:a,components:[uV.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[iV.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:ml([B_.config({})])}),uV.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:l.selectFirst,tabSectionBehaviours:ml([Fp("tabpanel",l.extraEvents),Ep.config({mode:"acyclic"}),ch.config({find:e=>oe(uV.getViewItems(e))}),sk(A.none(),(e=>(e.getSystem().broadcastOn([gV],{}),n.get())),((e,t)=>{n.set(t),e.getSystem().broadcastOn([fV],{})}))])})},bV=Qi("update-dialog"),yV=Qi("update-title"),wV=Qi("update-body"),_V=Qi("update-footer"),xV=Qi("body-send-message"),CV=(e,t,o,n,r)=>({dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:{...o.map((e=>({id:e}))).getOr({}),...r?{"aria-live":"polite"}:{}}},components:[],behaviours:ml([ek(0),YA.config({channel:`${wV}-${t}`,updateState:(e,t)=>A.some({isTabPanel:()=>"tabpanel"===t.body.type}),renderComponents:e=>{const t=e.body;return"tabpanel"===t.type?[vV(t,e.initialData,n)]:[eV(t,e.initialData,n)]},initialData:e})])});function kV(e){return kV="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kV(e)}function SV(e,t){return SV=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},SV(e,t)}function TV(e,t,o){return TV=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,o){var n=[null];n.push.apply(n,t);var r=new(Function.bind.apply(e,n));return o&&SV(r,o.prototype),r},TV.apply(null,arguments)}function EV(e){return function(e){if(Array.isArray(e))return OV(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return OV(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?OV(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function OV(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}var AV=Object.hasOwnProperty,MV=Object.setPrototypeOf,BV=Object.isFrozen,PV=Object.getPrototypeOf,RV=Object.getOwnPropertyDescriptor,VV=Object.freeze,NV=Object.seal,DV=Object.create,FV="undefined"!=typeof Reflect&&Reflect,IV=FV.apply,LV=FV.construct;IV||(IV=function(e,t,o){return e.apply(t,o)}),VV||(VV=function(e){return e}),NV||(NV=function(e){return e}),LV||(LV=function(e,t){return TV(e,EV(t))});var zV,HV=KV(Array.prototype.forEach),ZV=KV(Array.prototype.pop),jV=KV(Array.prototype.push),UV=KV(String.prototype.toLowerCase),$V=KV(String.prototype.match),WV=KV(String.prototype.replace),qV=KV(String.prototype.indexOf),GV=KV(String.prototype.trim),YV=KV(RegExp.prototype.test),XV=(zV=TypeError,function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return LV(zV,t)});function KV(e){return function(t){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return IV(e,t,n)}}function JV(e,t){MV&&MV(e,null);for(var o=t.length;o--;){var n=t[o];if("string"==typeof n){var r=UV(n);r!==n&&(BV(t)||(t[o]=r),n=r)}e[n]=!0}return e}function QV(e){var t,o=DV(null);for(t in e)IV(AV,e,[t])&&(o[t]=e[t]);return o}function eN(e,t){for(;null!==e;){var o=RV(e,t);if(o){if(o.get)return KV(o.get);if("function"==typeof o.value)return KV(o.value)}e=PV(e)}return function(e){return console.warn("fallback value for",e),null}}var tN=VV(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),oN=VV(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),nN=VV(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),rN=VV(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),iN=VV(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),sN=VV(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),aN=VV(["#text"]),lN=VV(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),cN=VV(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),dN=VV(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),uN=VV(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),hN=NV(/\{\{[\w\W]*|[\w\W]*\}\}/gm),mN=NV(/<%[\w\W]*|[\w\W]*%>/gm),pN=NV(/^data-[\-\w.\u00B7-\uFFFF]/),gN=NV(/^aria-[\-\w]+$/),fN=NV(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vN=NV(/^(?:\w+script|data):/i),bN=NV(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),yN=NV(/^html$/i),wN=function(){return"undefined"==typeof window?null:window},_N=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:wN(),o=function(t){return e(t)};if(o.version="2.3.8",o.removed=[],!t||!t.document||9!==t.document.nodeType)return o.isSupported=!1,o;var n=t.document,r=t.document,i=t.DocumentFragment,s=t.HTMLTemplateElement,a=t.Node,l=t.Element,c=t.NodeFilter,d=t.NamedNodeMap,u=void 0===d?t.NamedNodeMap||t.MozNamedAttrMap:d,h=t.HTMLFormElement,m=t.DOMParser,p=t.trustedTypes,g=l.prototype,f=eN(g,"cloneNode"),v=eN(g,"nextSibling"),b=eN(g,"childNodes"),y=eN(g,"parentNode");if("function"==typeof s){var w=r.createElement("template");w.content&&w.content.ownerDocument&&(r=w.content.ownerDocument)}var _=function(e,t){if("object"!==kV(e)||"function"!=typeof e.createPolicy)return null;var o=null,n="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(n)&&(o=t.currentScript.getAttribute(n));var r="dompurify"+(o?"#"+o:"");try{return e.createPolicy(r,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(p,n),x=_?_.createHTML(""):"",C=r,k=C.implementation,S=C.createNodeIterator,T=C.createDocumentFragment,E=C.getElementsByTagName,O=n.importNode,A={};try{A=QV(r).documentMode?r.documentMode:{}}catch(e){}var M={};o.isSupported="function"==typeof y&&k&&void 0!==k.createHTMLDocument&&9!==A;var B,P,R=hN,V=mN,N=pN,D=gN,F=vN,I=bN,L=fN,z=null,H=JV({},[].concat(EV(tN),EV(oN),EV(nN),EV(iN),EV(aN))),Z=null,j=JV({},[].concat(EV(lN),EV(cN),EV(dN),EV(uN))),U=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$=null,W=null,q=!0,G=!0,Y=!1,X=!1,K=!1,J=!1,Q=!1,ee=!1,te=!1,oe=!1,ne=!0,re=!0,ie=!1,se={},ae=null,le=JV({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ce=null,de=JV({},["audio","video","img","source","image","track"]),ue=null,he=JV({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),me="http://www.w3.org/1998/Math/MathML",pe="http://www.w3.org/2000/svg",ge="http://www.w3.org/1999/xhtml",fe=ge,ve=!1,be=["application/xhtml+xml","text/html"],ye=null,we=r.createElement("form"),_e=function(e){return e instanceof RegExp||e instanceof Function},xe=function(e){ye&&ye===e||(e&&"object"===kV(e)||(e={}),e=QV(e),z="ALLOWED_TAGS"in e?JV({},e.ALLOWED_TAGS):H,Z="ALLOWED_ATTR"in e?JV({},e.ALLOWED_ATTR):j,ue="ADD_URI_SAFE_ATTR"in e?JV(QV(he),e.ADD_URI_SAFE_ATTR):he,ce="ADD_DATA_URI_TAGS"in e?JV(QV(de),e.ADD_DATA_URI_TAGS):de,ae="FORBID_CONTENTS"in e?JV({},e.FORBID_CONTENTS):le,$="FORBID_TAGS"in e?JV({},e.FORBID_TAGS):{},W="FORBID_ATTR"in e?JV({},e.FORBID_ATTR):{},se="USE_PROFILES"in e&&e.USE_PROFILES,q=!1!==e.ALLOW_ARIA_ATTR,G=!1!==e.ALLOW_DATA_ATTR,Y=e.ALLOW_UNKNOWN_PROTOCOLS||!1,X=e.SAFE_FOR_TEMPLATES||!1,K=e.WHOLE_DOCUMENT||!1,ee=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,oe=e.RETURN_TRUSTED_TYPE||!1,Q=e.FORCE_BODY||!1,ne=!1!==e.SANITIZE_DOM,re=!1!==e.KEEP_CONTENT,ie=e.IN_PLACE||!1,L=e.ALLOWED_URI_REGEXP||L,fe=e.NAMESPACE||ge,e.CUSTOM_ELEMENT_HANDLING&&_e(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(U.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&_e(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(U.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(U.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),B=B=-1===be.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,P="application/xhtml+xml"===B?function(e){return e}:UV,X&&(G=!1),te&&(ee=!0),se&&(z=JV({},EV(aN)),Z=[],!0===se.html&&(JV(z,tN),JV(Z,lN)),!0===se.svg&&(JV(z,oN),JV(Z,cN),JV(Z,uN)),!0===se.svgFilters&&(JV(z,nN),JV(Z,cN),JV(Z,uN)),!0===se.mathMl&&(JV(z,iN),JV(Z,dN),JV(Z,uN))),e.ADD_TAGS&&(z===H&&(z=QV(z)),JV(z,e.ADD_TAGS)),e.ADD_ATTR&&(Z===j&&(Z=QV(Z)),JV(Z,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&JV(ue,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(ae===le&&(ae=QV(ae)),JV(ae,e.FORBID_CONTENTS)),re&&(z["#text"]=!0),K&&JV(z,["html","head","body"]),z.table&&(JV(z,["tbody"]),delete $.tbody),VV&&VV(e),ye=e)},Ce=JV({},["mi","mo","mn","ms","mtext"]),ke=JV({},["foreignobject","desc","title","annotation-xml"]),Se=JV({},["title","style","font","a","script"]),Te=JV({},oN);JV(Te,nN),JV(Te,rN);var Ee=JV({},iN);JV(Ee,sN);var Oe=function(e){jV(o.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=x}catch(t){e.remove()}}},Ae=function(e,t){try{jV(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){jV(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Z[e])if(ee||te)try{Oe(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Me=function(e){var t,o;if(Q)e="<remove></remove>"+e;else{var n=$V(e,/^[\r\n\t ]+/);o=n&&n[0]}"application/xhtml+xml"===B&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var i=_?_.createHTML(e):e;if(fe===ge)try{t=(new m).parseFromString(i,B)}catch(e){}if(!t||!t.documentElement){t=k.createDocument(fe,"template",null);try{t.documentElement.innerHTML=ve?"":i}catch(e){}}var s=t.body||t.documentElement;return e&&o&&s.insertBefore(r.createTextNode(o),s.childNodes[0]||null),fe===ge?E.call(t,K?"html":"body")[0]:K?t.documentElement:s},Be=function(e){return S.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},Pe=function(e){return"object"===kV(a)?e instanceof a:e&&"object"===kV(e)&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Re=function(e,t,n){M[e]&&HV(M[e],(function(e){e.call(o,t,n,ye)}))},Ve=function(e){var t,n;if(Re("beforeSanitizeElements",e,null),(n=e)instanceof h&&("string"!=typeof n.nodeName||"string"!=typeof n.textContent||"function"!=typeof n.removeChild||!(n.attributes instanceof u)||"function"!=typeof n.removeAttribute||"function"!=typeof n.setAttribute||"string"!=typeof n.namespaceURI||"function"!=typeof n.insertBefore))return Oe(e),!0;if(YV(/[\u0080-\uFFFF]/,e.nodeName))return Oe(e),!0;var r=P(e.nodeName);if(Re("uponSanitizeElement",e,{tagName:r,allowedTags:z}),e.hasChildNodes()&&!Pe(e.firstElementChild)&&(!Pe(e.content)||!Pe(e.content.firstElementChild))&&YV(/<[/\w]/g,e.innerHTML)&&YV(/<[/\w]/g,e.textContent))return Oe(e),!0;if("select"===r&&YV(/<template/i,e.innerHTML))return Oe(e),!0;if(!z[r]||$[r]){if(!$[r]&&De(r)){if(U.tagNameCheck instanceof RegExp&&YV(U.tagNameCheck,r))return!1;if(U.tagNameCheck instanceof Function&&U.tagNameCheck(r))return!1}if(re&&!ae[r]){var i=y(e)||e.parentNode,s=b(e)||e.childNodes;if(s&&i)for(var a=s.length-1;a>=0;--a)i.insertBefore(f(s[a],!0),v(e))}return Oe(e),!0}return e instanceof l&&!function(e){var t=y(e);t&&t.tagName||(t={namespaceURI:ge,tagName:"template"});var o=UV(e.tagName),n=UV(t.tagName);return e.namespaceURI===pe?t.namespaceURI===ge?"svg"===o:t.namespaceURI===me?"svg"===o&&("annotation-xml"===n||Ce[n]):Boolean(Te[o]):e.namespaceURI===me?t.namespaceURI===ge?"math"===o:t.namespaceURI===pe?"math"===o&&ke[n]:Boolean(Ee[o]):e.namespaceURI===ge&&!(t.namespaceURI===pe&&!ke[n])&&!(t.namespaceURI===me&&!Ce[n])&&!Ee[o]&&(Se[o]||!Te[o])}(e)?(Oe(e),!0):"noscript"!==r&&"noembed"!==r||!YV(/<\/no(script|embed)/i,e.innerHTML)?(X&&3===e.nodeType&&(t=e.textContent,t=WV(t,R," "),t=WV(t,V," "),e.textContent!==t&&(jV(o.removed,{element:e.cloneNode()}),e.textContent=t)),Re("afterSanitizeElements",e,null),!1):(Oe(e),!0)},Ne=function(e,t,o){if(ne&&("id"===t||"name"===t)&&(o in r||o in we))return!1;if(G&&!W[t]&&YV(N,t));else if(q&&YV(D,t));else if(!Z[t]||W[t]){if(!(De(e)&&(U.tagNameCheck instanceof RegExp&&YV(U.tagNameCheck,e)||U.tagNameCheck instanceof Function&&U.tagNameCheck(e))&&(U.attributeNameCheck instanceof RegExp&&YV(U.attributeNameCheck,t)||U.attributeNameCheck instanceof Function&&U.attributeNameCheck(t))||"is"===t&&U.allowCustomizedBuiltInElements&&(U.tagNameCheck instanceof RegExp&&YV(U.tagNameCheck,o)||U.tagNameCheck instanceof Function&&U.tagNameCheck(o))))return!1}else if(ue[t]);else if(YV(L,WV(o,I,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==qV(o,"data:")||!ce[e])if(Y&&!YV(F,WV(o,I,"")));else if(o)return!1;return!0},De=function(e){return e.indexOf("-")>0},Fe=function(e){var t,o,n,r;Re("beforeSanitizeAttributes",e,null);var i=e.attributes;if(i){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z};for(r=i.length;r--;){var a=t=i[r],l=a.name,c=a.namespaceURI;o="value"===l?t.value:GV(t.value),n=P(l);var d=o;if(s.attrName=n,s.attrValue=o,s.keepAttr=!0,s.forceKeepAttr=void 0,Re("uponSanitizeAttribute",e,s),o=s.attrValue,!s.forceKeepAttr)if(s.keepAttr)if(YV(/\/>/i,o))Ae(l,e);else{X&&(o=WV(o,R," "),o=WV(o,V," "));var u=P(e.nodeName);if(Ne(u,n,o)){if(o!==d)try{c?e.setAttributeNS(c,l,o):e.setAttribute(l,o)}catch(t){Ae(l,e)}}else Ae(l,e)}else Ae(l,e)}Re("afterSanitizeAttributes",e,null)}},Ie=function e(t){var o,n=Be(t);for(Re("beforeSanitizeShadowDOM",t,null);o=n.nextNode();)Re("uponSanitizeShadowNode",o,null),Ve(o)||(o.content instanceof i&&e(o.content),Fe(o));Re("afterSanitizeShadowDOM",t,null)};return o.sanitize=function(e,r){var s,l,c,d,u;if((ve=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Pe(e)){if("function"!=typeof e.toString)throw XV("toString is not a function");if("string"!=typeof(e=e.toString()))throw XV("dirty is not a string, aborting")}if(!o.isSupported){if("object"===kV(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(Pe(e))return t.toStaticHTML(e.outerHTML)}return e}if(J||xe(r),o.removed=[],"string"==typeof e&&(ie=!1),ie){if(e.nodeName){var h=P(e.nodeName);if(!z[h]||$[h])throw XV("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof a)1===(l=(s=Me("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?s=l:s.appendChild(l);else{if(!ee&&!X&&!K&&-1===e.indexOf("<"))return _&&oe?_.createHTML(e):e;if(!(s=Me(e)))return ee?null:oe?x:""}s&&Q&&Oe(s.firstChild);for(var m=Be(ie?e:s);c=m.nextNode();)3===c.nodeType&&c===d||Ve(c)||(c.content instanceof i&&Ie(c.content),Fe(c),d=c);if(d=null,ie)return e;if(ee){if(te)for(u=T.call(s.ownerDocument);s.firstChild;)u.appendChild(s.firstChild);else u=s;return Z.shadowroot&&(u=O.call(n,u,!0)),u}var p=K?s.outerHTML:s.innerHTML;return K&&z["!doctype"]&&s.ownerDocument&&s.ownerDocument.doctype&&s.ownerDocument.doctype.name&&YV(yN,s.ownerDocument.doctype.name)&&(p="<!DOCTYPE "+s.ownerDocument.doctype.name+">\n"+p),X&&(p=WV(p,R," "),p=WV(p,V," ")),_&&oe?_.createHTML(p):p},o.setConfig=function(e){xe(e),J=!0},o.clearConfig=function(){ye=null,J=!1},o.isValidAttribute=function(e,t,o){ye||xe({});var n=P(e),r=P(t);return Ne(n,r,o)},o.addHook=function(e,t){"function"==typeof t&&(M[e]=M[e]||[],jV(M[e],t))},o.removeHook=function(e){if(M[e])return ZV(M[e])},o.removeHooks=function(e){M[e]&&(M[e]=[])},o.removeAllHooks=function(){M={}},o}();const xN=e=>_N().sanitize(e),CN=qg.deviceType.isTouch(),kN=(e,t)=>({dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[e,t]}),SN=(e,t)=>CP.parts.close(Ag.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close")}},action:e,buttonBehaviours:ml([B_.config({})])})),TN=()=>CP.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}}),EN=(e,t)=>CP.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:hO(`<p>${xN(t.translate(e))}</p>`)}]}]}),ON=e=>CP.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:e}),AN=(e,t)=>[k_.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:e}),k_.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:t})],MN=e=>{const t="tox-dialog",o=t+"-wrap",n=o+"__backdrop",r=t+"__disable-scroll";return CP.sketch({lazySink:e.lazySink,onEscape:t=>(e.onEscape(t),A.some(!0)),useTabstopAt:e=>!vk(e),dom:{tag:"div",classes:[t].concat(e.extraClasses),styles:{position:"relative",...e.extraStyles}},components:[e.header,e.body,...e.footer.toArray()],parts:{blocker:{dom:hO(`<div class="${o}"></div>`),components:[{dom:{tag:"div",classes:CN?[n,n+"--opaque"]:[n]}}]}},dragBlockClass:o,modalBehaviours:ml([Zp.config({}),Fp("dialog-events",e.dialogEvents.concat([zi(zr(),((e,t)=>{Ep.focusIn(e)}))])),Fp("scroll-lock",[Hi((()=>{Bs(gt(),r)})),Zi((()=>{Ps(gt(),r)}))]),...e.extraBehaviours]),eventOrder:{[ni()]:["dialog-events"],[pi()]:["scroll-lock","dialog-events","alloy.base.behaviour"],[gi()]:["alloy.base.behaviour","dialog-events","scroll-lock"],...e.eventOrder}})},BN=e=>Ag.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close"),title:e.translate("Close")}},components:[zg("close",{tag:"div",classes:["tox-icon"]},e.icons)],action:e=>{ki(e,L_)}}),PN=(e,t,o,n)=>({dom:{tag:"div",classes:["tox-dialog__title"],attributes:{...o.map((e=>({id:e}))).getOr({})}},components:[],behaviours:ml([YA.config({channel:`${yV}-${t}`,initialData:e,renderComponents:e=>[$s(n.translate(e.title))]})])}),RN=()=>({dom:hO('<div class="tox-dialog__draghandle"></div>')}),VN=(e,t,o)=>((e,t,o)=>{const n=CP.parts.title(PN(e,t,A.none(),o)),r=CP.parts.draghandle(RN()),i=CP.parts.close(BN(o)),s=[n].concat(e.draggable?[r]:[]).concat([i]);return k_.sketch({dom:hO('<div class="tox-dialog__header"></div>'),components:s})})({title:o.shared.providers.translate(e),draggable:o.dialog.isDraggableModal()},t,o.shared.providers),NN=(e,t,o)=>({dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":o.translate(e)},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:t,components:[{dom:hO('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}),DN=(e,t,o)=>({onClose:()=>o.closeWindow(),onBlock:o=>{CP.setBusy(e(),((e,n)=>NN(o.message,n,t)))},onUnblock:()=>{CP.setIdle(e())}}),FN=(e,t,o,n)=>Ys(MN({...e,lazySink:n.shared.getSink,extraBehaviours:[YA.config({channel:`${bV}-${e.id}`,updateState:(e,t)=>A.some(t),initialData:t}),ak({}),...e.extraBehaviours],onEscape:e=>{ki(e,L_)},dialogEvents:o,eventOrder:{[oi()]:[YA.name(),yl.name()],[pi()]:["scroll-lock",YA.name(),"messages","dialog-events","alloy.base.behaviour"],[gi()]:["alloy.base.behaviour","dialog-events","messages",YA.name(),"scroll-lock"]}})),IN=e=>L(e,(e=>"menu"===e.type?(e=>{const t=L(e.items,(e=>({...e,storage:wr(!1)})));return{...e,items:t}})(e):e)),LN=e=>U(e,((e,t)=>"menu"===t.type?U(t.items,((e,t)=>(e[t.name]=t.storage,e)),e):e),{}),zN=(e,t)=>[Fi(zr(),fk),e(I_,((e,o)=>{t.onClose(),o.onClose()})),e(L_,((e,t,o,n)=>{t.onCancel(e),ki(n,I_)})),Ri(j_,((e,o)=>t.onUnblock())),Ri(Z_,((e,o)=>t.onBlock(o.event)))],HN=(e,t,o)=>{const n=(t,o)=>Ri(t,((t,n)=>{r(t,((r,i)=>{o(e(),r,n.event,t)}))})),r=(e,t)=>{YA.getState(e).get().each((o=>{t(o.internalDialog,e)}))};return[...zN(n,t),n(H_,((e,t)=>t.onSubmit(e))),n(F_,((e,t,o)=>{t.onChange(e,{name:o.name})})),n(z_,((e,t,n,r)=>{const i=()=>Ep.focusIn(r),s=e=>xt(e,"disabled")||_t(e,"aria-disabled").exists((e=>"true"===e)),a=dt(r.element),l=Cl(a);t.onAction(e,{name:n.name,value:n.value}),Cl(a).fold(i,(e=>{s(e)||l.exists((t=>Ye(e,t)&&s(t)))?i():o().toOptional().filter((t=>!Ye(t.element,e))).each(i)}))})),n(U_,((e,t,o)=>{t.onTabChange(e,{newTabName:o.name,oldTabName:o.oldName})})),Zi((t=>{const o=e();ou.setValue(t,o.getData())}))]},ZN=(e,t)=>{const o=t.map((e=>e.footerButtons)).getOr([]),n=H(o,(e=>"start"===e.align)),r=(e,t)=>k_.sketch({dom:{tag:"div",classes:[`tox-dialog__footer-${e}`]},components:L(t,(e=>e.memento.asSpec()))});return[r("start",n.pass),r("end",n.fail)]},jN=(e,t,o)=>({dom:hO('<div class="tox-dialog__footer"></div>'),components:[],behaviours:ml([YA.config({channel:`${_V}-${t}`,initialData:e,updateState:(e,t)=>{const n=L(t.buttons,(e=>{const t=Mg(((e,t)=>mS(e,e.type,t))(e,o));return{name:e.name,align:e.align,memento:t}}));return A.some({lookupByName:t=>((e,t,o)=>$(t,(e=>e.name===o)).bind((t=>t.memento.getOpt(e))))(e,n,t),footerButtons:n})},renderComponents:ZN})])}),UN=(e,t,o)=>CP.parts.footer(jN(e,t,o)),$N=(e,t)=>{if(e.getRoot().getSystem().isConnected()){const o=ch.getCurrent(e.getFormWrapper()).getOr(e.getFormWrapper());return WC.getField(o,t).orThunk((()=>{const o=e.getFooter();return YA.getState(o).get().bind((e=>e.lookupByName(t)))}))}return A.none()},WN=(e,t,o)=>{const n=t=>{const o=e.getRoot();o.getSystem().isConnected()&&t(o)},r={getData:()=>{const t=e.getRoot(),n=t.getSystem().isConnected()?e.getFormWrapper():t;return{...ou.getValue(n),...ce(o,(e=>e.get()))}},setData:t=>{n((n=>{const i=r.getData(),s=cn(i,t),a=((e,t)=>{const o=e.getRoot();return YA.getState(o).get().map((e=>Hn(zn("data",e.dataValidator,t)))).getOr(t)})(e,s),l=e.getFormWrapper();ou.setValue(l,a),le(o,((e,t)=>{be(s,t)&&e.set(s[t])}))}))},setEnabled:(t,o)=>{$N(e,t).each(o?Ch.enable:Ch.disable)},focus:t=>{$N(e,t).each(Zp.focus)},block:e=>{if(!i(e))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");n((t=>{Si(t,Z_,{message:e})}))},unblock:()=>{n((e=>{ki(e,j_)}))},showTab:t=>{n((o=>{const n=e.getBody();YA.getState(n).get().exists((e=>e.isTabPanel()))&&ch.getCurrent(n).each((e=>{uV.showTab(e,t)}))}))},redial:o=>{n((n=>{const i=e.getId(),s=t(o);n.getSystem().broadcastOn([`${bV}-${i}`],s),n.getSystem().broadcastOn([`${yV}-${i}`],s.internalDialog),n.getSystem().broadcastOn([`${wV}-${i}`],s.internalDialog),n.getSystem().broadcastOn([`${_V}-${i}`],s.internalDialog),r.setData(s.initialData)}))},close:()=>{n((e=>{ki(e,I_)}))}};return r};var qN=window.mailpoetTinymce.util.Tools.resolve("window.mailpoetTinymce.util.URI");const GN=["insertContent","setContent","execCommand","close","block","unblock"],YN=e=>s(e)&&-1!==GN.indexOf(e.mceAction),XN=(e,t,o,n)=>{const r=Qi("dialog"),a=VN(e.title,r,n),l=(e=>{const t={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[pk({dom:{tag:"iframe",attributes:{src:e.url}},behaviours:ml([B_.config({}),Zp.config({})])})]}],behaviours:ml([Ep.config({mode:"acyclic",useTabstopAt:C(vk)})])};return CP.parts.body(t)})(e),c=e.buttons.bind((e=>0===e.length?A.none():A.some(UN({buttons:e},r,n)))),u=((e,t)=>{const o=(t,o)=>Ri(t,((t,r)=>{n(t,((n,i)=>{o(e(),n,r.event,t)}))})),n=(e,t)=>{YA.getState(e).get().each((o=>{t(o,e)}))};return[...zN(o,t),o(z_,((e,t,o)=>{t.onAction(e,{name:o.name})}))]})((()=>w),DN((()=>y),n.shared.providers,t)),h={...e.height.fold((()=>({})),(e=>({height:e+"px","max-height":e+"px"}))),...e.width.fold((()=>({})),(e=>({width:e+"px","max-width":e+"px"})))},p=e.width.isNone()&&e.height.isNone()?["tox-dialog--width-lg"]:[],g=new qN(e.url,{base_uri:new qN(window.location.href)}),f=`${g.protocol}://${g.host}${g.port?":"+g.port:""}`,v=Hl(),b=[Fp("messages",[Hi((()=>{const t=Ul(Ve(window),"message",(t=>{if(g.isSameOrigin(new qN(t.raw.origin))){const n=t.raw.data;YN(n)?((e,t,o)=>{switch(o.mceAction){case"insertContent":e.insertContent(o.content);break;case"setContent":e.setContent(o.content);break;case"execCommand":const n=!!d(o.ui)&&o.ui;e.execCommand(o.cmd,n,o.value);break;case"close":t.close();break;case"block":t.block(o.message);break;case"unblock":t.unblock()}})(o,w,n):(e=>!YN(e)&&s(e)&&be(e,"mceAction"))(n)&&e.onMessage(w,n)}}));v.set(t)})),Zi(v.clear)]),yl.config({channels:{[xV]:{onReceive:(e,t)=>{ra(e.element,"iframe").each((e=>{const o=e.dom.contentWindow;m(o)&&o.postMessage(t,f)}))}}}})],y=FN({id:r,header:a,body:l,footer:c,extraClasses:p,extraBehaviours:b,extraStyles:h},e,u,n),w=(e=>{const t=t=>{e.getSystem().isConnected()&&t(e)};return{block:e=>{if(!i(e))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");t((t=>{Si(t,Z_,{message:e})}))},unblock:()=>{t((e=>{ki(e,j_)}))},close:()=>{t((e=>{ki(e,I_)}))},sendMessage:e=>{t((t=>{t.getSystem().broadcastOn([xV],e)}))}}})(y);return{dialog:y,instanceApi:w}},KN=(e,t,o)=>t&&o?[]:[vE.config({contextual:{lazyContext:()=>A.some(Wo(Ve(e.getContentAreaContainer()))),fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})],JN=e=>{const t=e.editor,o=$f(t),n=(e=>{const t=e.shared;return{open:(o,n)=>{const r=()=>{CP.hide(l),n()},i=Mg(mS({name:"close-alert",text:"OK",primary:!0,buttonType:A.some("primary"),align:"end",enabled:!0,icon:A.none()},"cancel",e)),s=TN(),a=SN(r,t.providers),l=Ys(MN({lazySink:()=>t.getSink(),header:kN(s,a),body:EN(o,t.providers),footer:A.some(ON(AN([],[i.asSpec()]))),onEscape:r,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Ri(L_,r)],eventOrder:{}}));CP.show(l);const c=i.get(l);Zp.focus(c)}}})(e.backstages.dialog),r=(e=>{const t=e.shared;return{open:(o,n)=>{const r=e=>{CP.hide(c),n(e)},i=Mg(mS({name:"yes",text:"Yes",primary:!0,buttonType:A.some("primary"),align:"end",enabled:!0,icon:A.none()},"submit",e)),s=mS({name:"no",text:"No",primary:!1,buttonType:A.some("secondary"),align:"end",enabled:!0,icon:A.none()},"cancel",e),a=TN(),l=SN((()=>r(!1)),t.providers),c=Ys(MN({lazySink:()=>t.getSink(),header:kN(a,l),body:EN(o,t.providers),footer:A.some(ON(AN([],[s,i.asSpec()]))),onEscape:()=>r(!1),extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Ri(L_,(()=>r(!1))),Ri(H_,(()=>r(!0)))],eventOrder:{}}));CP.show(c);const d=i.get(c);Zp.focus(d)}}})(e.backstages.dialog),i=(t,o)=>JR.open(((t,n,r)=>{const i=n,s=((e,t,o)=>{const n=Qi("dialog"),r=e.internalDialog,i=VN(r.title,n,o),s=((e,t,o)=>{const n=CV(e,t,A.none(),o,!1);return CP.parts.body(n)})({body:r.body,initialData:r.initialData},n,o),a=IN(r.buttons),l=LN(a),c=UN({buttons:a},n,o),d=HN((()=>g),DN((()=>m),o.shared.providers,t),o.shared.getSink),u=(e=>{switch(e){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}})(r.size),h={id:n,header:i,body:s,footer:A.some(c),extraClasses:u,extraBehaviours:[],extraStyles:{}},m=FN(h,e,d,o),p={getId:y(n),getRoot:y(m),getBody:()=>CP.getBody(m),getFooter:()=>CP.getFooter(m),getFormWrapper:()=>{const e=CP.getBody(m);return ch.getCurrent(e).getOr(e)}},g=WN(p,t.redial,l);return{dialog:m,instanceApi:g}})({dataValidator:r,initialData:i,internalDialog:t},{redial:JR.redial,closeWindow:()=>{CP.hide(s.dialog),o(s.instanceApi)}},e.backstages.dialog);return CP.show(s.dialog),s.instanceApi.setData(i),s.instanceApi}),t),s=(n,r,i,s=!1)=>JR.open(((n,a,l)=>{const c=Hn(zn("data",l,a)),d=Zl(),u=e.backstages.popup.shared.header.isPositionedAtTop(),h=()=>d.on((e=>{Eg.reposition(e),vE.refresh(e)})),m=((e,t,o,n)=>{const r=Qi("dialog"),i=Qi("dialog-label"),s=Qi("dialog-content"),a=e.internalDialog,l=Mg(((e,t,o,n)=>k_.sketch({dom:hO('<div class="tox-dialog__header"></div>'),components:[PN(e,t,A.some(o),n),RN(),BN(n)],containerBehaviours:ml([lP.config({mode:"mouse",blockerClass:"blocker",getTarget:e=>ia(e,'[role="dialog"]').getOrDie(),snaps:{getSnapPoints:()=>[],leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))({title:a.title,draggable:!0},r,i,o.shared.providers)),c=Mg(((e,t,o,n,r)=>CV(e,t,A.some(o),n,r))({body:a.body,initialData:a.initialData},r,s,o,n)),d=IN(a.buttons),u=LN(d),h=Mg(((e,t,o)=>jN(e,t,o))({buttons:d},r,o)),m=HN((()=>g),{onBlock:e=>{uO.block(p,((t,n)=>NN(e.message,n,o.shared.providers)))},onUnblock:()=>{uO.unblock(p)},onClose:()=>t.closeWindow()},o.shared.getSink),p=Ys({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:{role:"dialog","aria-labelledby":i,"aria-describedby":s}},eventOrder:{[oi()]:[YA.name(),yl.name()],[ni()]:["execute-on-form"],[pi()]:["reflecting","execute-on-form"]},behaviours:ml([Ep.config({mode:"cyclic",onEscape:e=>(ki(e,I_),A.some(!0)),useTabstopAt:e=>!vk(e)&&("button"!==Le(e)||"disabled"!==wt(e,"disabled"))}),YA.config({channel:`${bV}-${r}`,updateState:(e,t)=>A.some(t),initialData:e}),Zp.config({}),Fp("execute-on-form",m.concat([zi(zr(),((e,t)=>{Ep.focusIn(e)}))])),uO.config({getRoot:()=>A.some(p)}),Dp.config({}),ak({})]),components:[l.asSpec(),c.asSpec(),h.asSpec()]}),g=WN({getId:y(r),getRoot:y(p),getFooter:()=>h.get(p),getBody:()=>c.get(p),getFormWrapper:()=>{const e=c.get(p);return ch.getCurrent(e).getOr(e)}},t.redial,u);return{dialog:p,instanceApi:g}})({dataValidator:l,initialData:c,internalDialog:n},{redial:JR.redial,closeWindow:()=>{d.on(Eg.hide),t.off("ResizeEditor",h),d.clear(),i(m.instanceApi)}},e.backstages.popup,s),p=Ys(Eg.sketch({lazySink:e.backstages.popup.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{},...u?{}:{fireRepositionEventInstead:{}},inlineBehaviours:ml([Fp("window-manager-inline-events",[Ri(fi(),((e,t)=>{ki(m.dialog,L_)}))]),...KN(t,o,u)]),isExtraPart:(e,t)=>(e=>p_(e,".tox-alert-dialog")||p_(e,".tox-confirm-dialog"))(t)}));return d.set(p),Eg.showWithin(p,Xs(m.dialog),{anchor:r},A.some(gt())),o&&u||(vE.refresh(p),t.on("ResizeEditor",h)),m.instanceApi.setData(c),Ep.focusIn(m.dialog),m.instanceApi}),n);return{open:(t,o,n)=>void 0!==o&&"toolbar"===o.inline?s(t,e.backstages.popup.shared.anchors.inlineDialog(),n,o.ariaAttrs):void 0!==o&&"cursor"===o.inline?s(t,e.backstages.popup.shared.anchors.cursor(),n,o.ariaAttrs):i(t,n),openUrl:(o,n)=>((o,n)=>JR.openUrl((o=>{const r=XN(o,{closeWindow:()=>{CP.hide(r.dialog),n(r.instanceApi)}},t,e.backstages.dialog);return CP.show(r.dialog),r.instanceApi}),o))(o,n),alert:(e,t)=>{n.open(e,t)},close:e=>{e.close()},confirm:(e,t)=>{r.open(e,t)}}};O.add("silver",(e=>{(e=>{Xg(e),(e=>{const t=e.options.register,o=e=>f(e,i)?{value:lw(e),valid:!0}:{valid:!1,message:"Must be an array of strings."};t("color_map",{processor:o,default:["#BFEDD2","Light Green","#FBEEB8","Light Yellow","#F8CAC6","Light Red","#ECCAFA","Light Purple","#C2E0F4","Light Blue","#2DC26B","Green","#F1C40F","Yellow","#E03E2D","Red","#B96AD9","Purple","#3598DB","Blue","#169179","Dark Turquoise","#E67E23","Orange","#BA372A","Dark Red","#843FA1","Dark Purple","#236FA1","Dark Blue","#ECF0F1","Light Gray","#CED4D9","Medium Gray","#95A5A6","Gray","#7E8C8D","Dark Gray","#34495E","Navy Blue","#000000","Black","#ffffff","White"]}),t("color_map_background",{processor:o}),t("color_map_foreground",{processor:o}),t("color_cols",{processor:"number",default:aw(mw(e,"default").length)}),t("color_cols_foreground",{processor:"number",default:aw(mw(e,iw).length)}),t("color_cols_background",{processor:"number",default:aw(mw(e,sw).length)}),t("custom_colors",{processor:"boolean",default:!0}),t("color_default_foreground",{processor:"string",default:dw}),t("color_default_background",{processor:"string",default:dw})})(e),(e=>{const t=e.options.register;t("contextmenu_avoid_overlap",{processor:"string",default:""}),t("contextmenu_never_use_native",{processor:"boolean",default:!1}),t("contextmenu",{processor:e=>!1===e?{value:[],valid:!0}:i(e)||f(e,i)?{value:nB(e),valid:!0}:{valid:!1,message:"Must be false or a string."},default:"link linkchecker image editimage table spellchecker configurepermanentpen"})})(e)})(e);const{dialogs:t,popups:o,renderUI:n}=yP(e);m_(e,o.backstage.shared);const r=JN({editor:e,backstages:{popup:o.backstage,dialog:t.backstage}});return{renderUI:n,getWindowManagerImpl:y(r),getNotificationManagerImpl:()=>((e,t,o)=>{const n=t.backstage.shared,r=()=>{const t=Wo(Ve(e.getContentAreaContainer())),o=Go(),n=La(o.x,t.x,t.right),r=La(o.y,t.y,t.bottom),i=Math.max(t.right,o.right),s=Math.max(t.bottom,o.bottom);return A.some($o(n,r,i-n,s-r))};return{open:(t,i)=>{const s=()=>{i(),Eg.hide(l)},a=Ys(Zg.sketch({text:t.text,level:N(["success","error","warning","warn","info"],t.type)?t.type:void 0,progress:!0===t.progressBar,icon:t.icon,closeButton:t.closeButton,onAction:s,iconProvider:n.providers.icons,translationProvider:n.providers.translate})),l=Ys(Eg.sketch({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:n.getSink,fireDismissalEventInstead:{},...n.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}}}));o.add(l),g(t.timeout)&&t.timeout>0&&Og.setEditorTimeout(e,(()=>{s()}),t.timeout);const c={close:s,reposition:()=>{const t=Xs(a),o={maxHeightFunction:Jl()},i=e.notificationManager.getNotifications();if(i[0]===c){const e={...n.anchors.banner(),overrides:o};Eg.showWithinBounds(l,t,{anchor:e},r)}else V(i,c).each((e=>{const n=i[e-1].getEl(),s={type:"node",root:gt(),node:A.some(Ve(n)),overrides:o,layouts:{onRtl:()=>[Qa],onLtr:()=>[Qa]}};Eg.showWithinBounds(l,t,{anchor:s},r)}))},text:e=>{Zg.updateText(a,e)},settings:t,getEl:()=>a.element.dom,progressBar:{value:e=>{Zg.updateProgress(a,e)}}};return c},close:e=>{e.close()},getArgs:e=>e.settings}})(e,{backstage:o.backstage},o.getMothership())}}))}()},71619:e=>{!function(){"use strict";var t=function(e){if(null===e)return"null";if(void 0===e)return"undefined";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t},o=function(e){return{eq:e}},n=o((function(e,t){return e===t})),r=function(e){return o((function(t,o){if(t.length!==o.length)return!1;for(var n=t.length,r=0;r<n;r++)if(!e.eq(t[r],o[r]))return!1;return!0}))},i=function(e){return o((function(t,i){var s=Object.keys(t),a=Object.keys(i);if(!function(e,t){return function(e,t){return o((function(o,n){return e.eq(t(o),t(n))}))}(r(e),(function(e){return function(e,t){return Array.prototype.slice.call(e).sort(t)}(e,t)}))}(n).eq(s,a))return!1;for(var l=s.length,c=0;c<l;c++){var d=s[c];if(!e.eq(t[d],i[d]))return!1}return!0}))},s=o((function(e,o){if(e===o)return!0;var n=t(e);return n===t(o)&&(function(e){return-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(e)}(n)?e===o:"array"===n?r(s).eq(e,o):"object"===n&&i(s).eq(e,o))}));const a=Object.getPrototypeOf,l=(e,t,o)=>{var n;return!!o(e,t.prototype)||(null===(n=e.constructor)||void 0===n?void 0:n.name)===t.name},c=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&l(e,String,((e,t)=>t.isPrototypeOf(e)))?"string":t})(t)===e,d=e=>t=>typeof t===e,u=e=>t=>e===t,h=(e,t)=>p(e)&&l(e,t,((e,t)=>a(e)===t)),m=c("string"),p=c("object"),g=e=>h(e,Object),f=c("array"),v=u(null),b=d("boolean"),y=u(void 0),w=e=>null==e,_=e=>!w(e),x=d("function"),C=d("number"),k=(e,t)=>{if(f(e)){for(let o=0,n=e.length;o<n;++o)if(!t(e[o]))return!1;return!0}return!1},S=()=>{},T=(e,t)=>(...o)=>e(t.apply(null,o)),E=(e,t)=>o=>e(t(o)),O=e=>()=>e,A=e=>e,M=(e,t)=>e===t;function B(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const P=e=>t=>!e(t),R=e=>e(),V=e=>{e()},N=O(!1),D=O(!0);class F{constructor(e,t){this.tag=e,this.value=t}static some(e){return new F(!0,e)}static none(){return F.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?F.some(e(this.value)):F.none()}bind(e){return this.tag?e(this.value):F.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:F.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return _(e)?F.some(e):F.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}F.singletonNone=new F(!1);const I=Array.prototype.slice,L=Array.prototype.indexOf,z=Array.prototype.push,H=(e,t)=>L.call(e,t),Z=(e,t)=>H(e,t)>-1,j=(e,t)=>{for(let o=0,n=e.length;o<n;o++)if(t(e[o],o))return!0;return!1},U=(e,t)=>{const o=e.length,n=new Array(o);for(let r=0;r<o;r++){const o=e[r];n[r]=t(o,r)}return n},$=(e,t)=>{for(let o=0,n=e.length;o<n;o++)t(e[o],o)},W=(e,t)=>{for(let o=e.length-1;o>=0;o--)t(e[o],o)},q=(e,t)=>{const o=[],n=[];for(let r=0,i=e.length;r<i;r++){const i=e[r];(t(i,r)?o:n).push(i)}return{pass:o,fail:n}},G=(e,t)=>{const o=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];t(r,n)&&o.push(r)}return o},Y=(e,t,o)=>(W(e,((e,n)=>{o=t(o,e,n)})),o),X=(e,t,o)=>($(e,((e,n)=>{o=t(o,e,n)})),o),K=(e,t,o)=>{for(let n=0,r=e.length;n<r;n++){const r=e[n];if(t(r,n))return F.some(r);if(o(r,n))break}return F.none()},J=(e,t)=>K(e,t,N),Q=(e,t)=>{for(let o=0,n=e.length;o<n;o++)if(t(e[o],o))return F.some(o);return F.none()},ee=e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!f(e[o]))throw new Error("Arr.flatten item "+o+" was not an array, input: "+e);z.apply(t,e[o])}return t},te=(e,t)=>ee(U(e,t)),oe=(e,t)=>{for(let o=0,n=e.length;o<n;++o)if(!0!==t(e[o],o))return!1;return!0},ne=e=>{const t=I.call(e,0);return t.reverse(),t},re=(e,t)=>G(e,(e=>!Z(t,e))),ie=(e,t)=>{const o={};for(let n=0,r=e.length;n<r;n++){const r=e[n];o[String(r)]=t(r,n)}return o},se=(e,t)=>{const o=I.call(e,0);return o.sort(t),o},ae=(e,t)=>t>=0&&t<e.length?F.some(e[t]):F.none(),le=e=>ae(e,0),ce=e=>ae(e,e.length-1),de=x(Array.from)?Array.from:e=>I.call(e),ue=(e,t)=>{for(let o=0;o<e.length;o++){const n=t(e[o],o);if(n.isSome())return n}return F.none()},he=Object.keys,me=Object.hasOwnProperty,pe=(e,t)=>{const o=he(e);for(let n=0,r=o.length;n<r;n++){const r=o[n];t(e[r],r)}},ge=(e,t)=>fe(e,((e,o)=>({k:o,v:t(e,o)}))),fe=(e,t)=>{const o={};return pe(e,((e,n)=>{const r=t(e,n);o[r.k]=r.v})),o},ve=e=>(t,o)=>{e[o]=t},be=(e,t,o,n)=>{pe(e,((e,r)=>{(t(e,r)?o:n)(e,r)}))},ye=(e,t)=>{const o={};return be(e,t,ve(o),S),o},we=(e,t)=>{const o=[];return pe(e,((e,n)=>{o.push(t(e,n))})),o},_e=e=>we(e,A),xe=(e,t)=>Ce(e,t)?F.from(e[t]):F.none(),Ce=(e,t)=>me.call(e,t),ke=(e,t)=>Ce(e,t)&&void 0!==e[t]&&null!==e[t],Se=e=>{const t={};return $(e,(e=>{t[e]={}})),he(t)},Te=e=>void 0!==e.length,Ee=Array.isArray,Oe=(e,t,o)=>{if(!e)return!1;if(o=o||e,Te(e)){for(let n=0,r=e.length;n<r;n++)if(!1===t.call(o,e[n],n,e))return!1}else for(const n in e)if(Ce(e,n)&&!1===t.call(o,e[n],n,e))return!1;return!0},Ae=(e,t)=>{const o=[];return Oe(e,((n,r)=>{o.push(t(n,r,e))})),o},Me=(e,t)=>{const o=[];return Oe(e,((n,r)=>{t&&!t(n,r,e)||o.push(n)})),o},Be=(e,t,o,n)=>{let r=y(o)?e[0]:o;for(let o=0;o<e.length;o++)r=t.call(n,r,e[o],o);return r},Pe=(e,t,o)=>{for(let n=0,r=e.length;n<r;n++)if(t.call(o,e[n],n,e))return n;return-1},Re=e=>e[e.length-1],Ve=e=>{let t,o=!1;return(...n)=>(o||(o=!0,t=e.apply(null,n)),t)},Ne=()=>De(0,0),De=(e,t)=>({major:e,minor:t}),Fe={nu:De,detect:(e,t)=>{const o=String(t).toLowerCase();return 0===e.length?Ne():((e,t)=>{const o=((e,t)=>{for(let o=0;o<e.length;o++){const n=e[o];if(n.test(t))return n}})(e,t);if(!o)return{major:0,minor:0};const n=e=>Number(t.replace(o,"$"+e));return De(n(1),n(2))})(e,o)},unknown:Ne},Ie=(e,t)=>{const o=String(t).toLowerCase();return J(e,(e=>e.search(o)))},Le=(e,t,o)=>""===t||e.length>=t.length&&e.substr(o,o+t.length)===t,ze=(e,t,o=0,n)=>{const r=e.indexOf(t,o);return-1!==r&&(!!y(n)||r+t.length<=n)},He=(e,t)=>Le(e,t,0),Ze=(e,t)=>Le(e,t,e.length-t.length),je=e=>t=>t.replace(e,""),Ue=je(/^\s+|\s+$/g),$e=je(/^\s+/g),We=je(/\s+$/g),qe=e=>e.length>0,Ge=e=>!qe(e),Ye=(e,t=10)=>{const o=parseInt(e,t);return isNaN(o)?F.none():F.some(o)},Xe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Ke=e=>t=>ze(t,e),Je=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>ze(e,"edge/")&&ze(e,"chrome")&&ze(e,"safari")&&ze(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Xe],search:e=>ze(e,"chrome")&&!ze(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>ze(e,"msie")||ze(e,"trident")},{name:"Opera",versionRegexes:[Xe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Ke("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Ke("firefox")},{name:"Safari",versionRegexes:[Xe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(ze(e,"safari")||ze(e,"mobile/"))&&ze(e,"applewebkit")}],Qe=[{name:"Windows",search:Ke("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>ze(e,"iphone")||ze(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Ke("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:Ke("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Ke("linux"),versionRegexes:[]},{name:"Solaris",search:Ke("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Ke("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Ke("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],et={browsers:O(Je),oses:O(Qe)},tt="Edge",ot="Chromium",nt="Opera",rt="Firefox",it="Safari",st=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isEdge:n(tt),isChromium:n(ot),isIE:n("IE"),isOpera:n(nt),isFirefox:n(rt),isSafari:n(it)}},at=()=>st({current:void 0,version:Fe.unknown()}),lt=st,ct=(O(tt),O(ot),O("IE"),O(nt),O(rt),O(it),"Windows"),dt="Android",ut="Linux",ht="macOS",mt="Solaris",pt="FreeBSD",gt="ChromeOS",ft=e=>{const t=e.current,o=e.version,n=e=>()=>t===e;return{current:t,version:o,isWindows:n(ct),isiOS:n("iOS"),isAndroid:n(dt),isMacOS:n(ht),isLinux:n(ut),isSolaris:n(mt),isFreeBSD:n(pt),isChromeOS:n(gt)}},vt=()=>ft({current:void 0,version:Fe.unknown()}),bt=ft,yt=(O(ct),O("iOS"),O(dt),O(ut),O(ht),O(mt),O(pt),O(gt),e=>window.matchMedia(e).matches);let wt=Ve((()=>((e,t,o)=>{const n=et.browsers(),r=et.oses(),i=t.bind((e=>((e,t)=>ue(t.brands,(t=>{const o=t.brand.toLowerCase();return J(e,(e=>{var t;return o===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((e=>({current:e.name,version:Fe.nu(parseInt(t.version,10),0)})))})))(n,e))).orThunk((()=>((e,t)=>Ie(e,t).map((e=>{const o=Fe.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(n,e))).fold(at,lt),s=((e,t)=>Ie(e,t).map((e=>{const o=Fe.detect(e.versionRegexes,t);return{current:e.name,version:o}})))(r,e).fold(vt,bt),a=((e,t,o,n)=>{const r=e.isiOS()&&!0===/ipad/i.test(o),i=e.isiOS()&&!r,s=e.isiOS()||e.isAndroid(),a=s||n("(pointer:coarse)"),l=r||!i&&s&&n("(min-device-width:768px)"),c=i||s&&!l,d=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(o),u=!c&&!l&&!d;return{isiPad:O(r),isiPhone:O(i),isTablet:O(l),isPhone:O(c),isTouch:O(a),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:O(d),isDesktop:O(u)}})(s,i,e,o);return{browser:i,os:s,deviceType:a}})(navigator.userAgent,F.from(navigator.userAgentData),yt)));const _t=()=>wt(),xt=navigator.userAgent,Ct=_t(),kt=Ct.browser,St=Ct.os,Tt=Ct.deviceType,Et=-1!==xt.indexOf("Windows Phone"),Ot={transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",documentMode:kt.isIE()?document.documentMode||7:10,cacheSuffix:null,container:null,canHaveCSP:!kt.isIE(),windowsPhone:Et,browser:{current:kt.current,version:kt.version,isChromium:kt.isChromium,isEdge:kt.isEdge,isFirefox:kt.isFirefox,isIE:kt.isIE,isOpera:kt.isOpera,isSafari:kt.isSafari},os:{current:St.current,version:St.version,isAndroid:St.isAndroid,isChromeOS:St.isChromeOS,isFreeBSD:St.isFreeBSD,isiOS:St.isiOS,isLinux:St.isLinux,isMacOS:St.isMacOS,isSolaris:St.isSolaris,isWindows:St.isWindows},deviceType:{isDesktop:Tt.isDesktop,isiPad:Tt.isiPad,isiPhone:Tt.isiPhone,isPhone:Tt.isPhone,isTablet:Tt.isTablet,isTouch:Tt.isTouch,isWebView:Tt.isWebView}},At=/^\s*|\s*$/g,Mt=e=>w(e)?"":(""+e).replace(At,""),Bt=function(e,t,o,n){n=n||this,e&&(o&&(e=e[o]),Oe(e,((e,r)=>!1!==t.call(n,e,r,o)&&(Bt(e,t,o,n),!0))))},Pt={trim:Mt,isArray:Ee,is:(e,t)=>t?!("array"!==t||!Ee(e))||typeof e===t:void 0!==e,toArray:e=>{if(Ee(e))return e;{const t=[];for(let o=0,n=e.length;o<n;o++)t[o]=e[o];return t}},makeMap:(e,t,o={})=>{const n=m(e)?e.split(t||","):e||[];let r=n.length;for(;r--;)o[n[r]]={};return o},each:Oe,map:Ae,grep:Me,inArray:(e,t)=>{if(e)for(let o=0,n=e.length;o<n;o++)if(e[o]===t)return o;return-1},hasOwn:Ce,extend:(e,...t)=>{for(let o=0;o<t.length;o++){const n=t[o];for(const t in n)if(Ce(n,t)){const o=n[t];void 0!==o&&(e[t]=o)}}return e},walk:Bt,resolve:(e,t=window)=>{const o=e.split(".");for(let e=0,n=o.length;e<n&&(t=t[o[e]]);e++);return t},explode:(e,t)=>f(e)?e:""===e?[]:Ae(e.split(t||","),Mt),_addCacheSuffix:e=>{const t=Ot.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},Rt=(e,t,o=M)=>e.exists((e=>o(e,t))),Vt=(e,t,o)=>e.isSome()&&t.isSome()?F.some(o(e.getOrDie(),t.getOrDie())):F.none(),Nt=(e,t)=>e?F.some(t):F.none();"undefined"!=typeof window?window:Function("return this;")();const Dt=e=>e.dom.nodeName.toLowerCase(),Ft=e=>e.dom.nodeType,It=e=>t=>Ft(t)===e,Lt=It(1),zt=It(3),Ht=It(9),Zt=It(11),jt=e=>t=>Lt(t)&&Dt(t)===e,Ut=(e,t,o)=>{if(!(m(o)||b(o)||C(o)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,o+"")},$t=(e,t,o)=>{Ut(e.dom,t,o)},Wt=(e,t)=>{const o=e.dom;pe(t,((e,t)=>{Ut(o,t,e)}))},qt=(e,t)=>{const o=e.dom.getAttribute(t);return null===o?void 0:o},Gt=(e,t)=>F.from(qt(e,t)),Yt=(e,t)=>{const o=e.dom;return!(!o||!o.hasAttribute)&&o.hasAttribute(t)},Xt=(e,t)=>{e.dom.removeAttribute(t)},Kt=e=>X(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}),Jt=(e,t)=>{const o=qt(e,t);return void 0===o||""===o?[]:o.split(" ")},Qt=e=>void 0!==e.dom.classList,eo=e=>Jt(e,"class"),to=(e,t)=>((e,t,o)=>{const n=Jt(e,t).concat([o]);return $t(e,t,n.join(" ")),!0})(e,"class",t),oo=(e,t)=>((e,t,o)=>{const n=G(Jt(e,t),(e=>e!==o));return n.length>0?$t(e,t,n.join(" ")):Xt(e,t),!1})(e,"class",t),no=(e,t)=>{Qt(e)?e.dom.classList.add(t):to(e,t)},ro=e=>{0===(Qt(e)?e.dom.classList:eo(e)).length&&Xt(e,"class")},io=(e,t)=>{Qt(e)?e.dom.classList.remove(t):oo(e,t),ro(e)},so=(e,t)=>Qt(e)&&e.dom.classList.contains(t),ao=e=>void 0!==e.style&&x(e.style.getPropertyValue),lo=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},co=(e,t)=>{const o=(t||document).createElement("div");if(o.innerHTML=e,!o.hasChildNodes()||o.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return lo(o.childNodes[0])},uo=(e,t)=>{const o=(t||document).createElement(e);return lo(o)},ho=(e,t)=>{const o=(t||document).createTextNode(e);return lo(o)},mo=lo,po=(e,t,o)=>F.from(e.dom.elementFromPoint(t,o)).map(lo),go=(e,t)=>{const o=[],n=e=>(o.push(e),t(e));let r=t(e);do{r=r.bind(n)}while(r.isSome());return o},fo=(e,t)=>{const o=e.dom;if(1!==o.nodeType)return!1;{const e=o;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},vo=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,bo=(e,t)=>e.dom===t.dom,yo=(e,t)=>{const o=e.dom,n=t.dom;return o!==n&&o.contains(n)},wo=e=>mo(e.dom.ownerDocument),_o=e=>Ht(e)?e:wo(e),xo=e=>mo(_o(e).dom.defaultView),Co=e=>F.from(e.dom.parentNode).map(mo),ko=e=>F.from(e.dom.parentElement).map(mo),So=(e,t)=>{const o=x(t)?t:N;let n=e.dom;const r=[];for(;null!==n.parentNode&&void 0!==n.parentNode;){const e=n.parentNode,t=mo(e);if(r.push(t),!0===o(t))break;n=e}return r},To=e=>F.from(e.dom.previousSibling).map(mo),Eo=e=>F.from(e.dom.nextSibling).map(mo),Oo=e=>ne(go(e,To)),Ao=e=>go(e,Eo),Mo=e=>U(e.dom.childNodes,mo),Bo=(e,t)=>{const o=e.dom.childNodes;return F.from(o[t]).map(mo)},Po=e=>Bo(e,0),Ro=e=>Bo(e,e.dom.childNodes.length-1),Vo=e=>e.dom.childNodes.length,No=e=>Zt(e)&&_(e.dom.host),Do=x(Element.prototype.attachShadow)&&x(Node.prototype.getRootNode),Fo=O(Do),Io=Do?e=>mo(e.dom.getRootNode()):_o,Lo=e=>No(e)?e:(e=>{const t=e.dom.head;if(null==t)throw new Error("Head is not available yet");return mo(t)})(_o(e)),zo=e=>mo(e.dom.host),Ho=e=>{if(Fo()&&_(e.target)){const t=mo(e.target);if(Lt(t)&&Zo(t)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return le(t)}}return F.from(e.target)},Zo=e=>_(e.dom.shadowRoot),jo=e=>{const t=zt(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const o=t.ownerDocument;return(e=>{const t=Io(e);return No(t)?F.some(t):F.none()})(mo(t)).fold((()=>o.body.contains(t)),E(jo,zo))},Uo=(e,t,o)=>{if(!m(o))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e),new Error("CSS value must be a string: "+o);ao(e)&&e.style.setProperty(t,o)},$o=(e,t,o)=>{const n=e.dom;Uo(n,t,o)},Wo=(e,t)=>{const o=e.dom;pe(t,((e,t)=>{Uo(o,t,e)}))},qo=(e,t)=>{const o=e.dom,n=window.getComputedStyle(o).getPropertyValue(t);return""!==n||jo(e)?n:Go(o,t)},Go=(e,t)=>ao(e)?e.style.getPropertyValue(t):"",Yo=(e,t)=>{const o=e.dom,n=Go(o,t);return F.from(n).filter((e=>e.length>0))},Xo=e=>{const t={},o=e.dom;if(ao(o))for(let e=0;e<o.style.length;e++){const n=o.style.item(e);t[n]=o.style[n]}return t},Ko=(e,t)=>{((e,t)=>{ao(e)&&e.style.removeProperty(t)})(e.dom,t),Rt(Gt(e,"style").map(Ue),"")&&Xt(e,"style")},Jo=(e,t)=>{Co(e).each((o=>{o.dom.insertBefore(t.dom,e.dom)}))},Qo=(e,t)=>{Eo(e).fold((()=>{Co(e).each((e=>{tn(e,t)}))}),(e=>{Jo(e,t)}))},en=(e,t)=>{Po(e).fold((()=>{tn(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))},tn=(e,t)=>{e.dom.appendChild(t.dom)},on=(e,t)=>{$(t,(t=>{tn(e,t)}))},nn=e=>{e.dom.textContent="",$(Mo(e),(e=>{rn(e)}))},rn=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},sn=e=>{const t=Mo(e);var o,n;t.length>0&&(o=e,$(n=t,((e,t)=>{const r=0===t?o:n[t-1];Qo(r,e)}))),rn(e)},an=e=>U(e,mo),ln=e=>e.dom.innerHTML,cn=(e,t)=>{const o=wo(e).dom,n=mo(o.createDocumentFragment()),r=((e,t)=>{const o=(t||document).createElement("div");return o.innerHTML=e,Mo(mo(o))})(t,o);on(n,r),nn(e),tn(e,n)},dn=(e,t,o,n)=>((e,t,o,n,r)=>{const i=((e,t)=>o=>{e(o)&&t((e=>{const t=mo(Ho(e).getOr(e.target)),o=()=>e.stopPropagation(),n=()=>e.preventDefault(),r=T(n,o);return((e,t,o,n,r,i,s)=>({target:e,x:t,y:o,stop:n,prevent:r,kill:i,raw:s}))(t,e.clientX,e.clientY,o,n,r,e)})(o))})(o,n);return e.dom.addEventListener(t,i,false),{unbind:B(un,e,t,i,false)}})(e,t,o,n),un=(e,t,o,n)=>{e.dom.removeEventListener(t,o,n)},hn=(e,t)=>({left:e,top:t,translate:(o,n)=>hn(e+o,t+n)}),mn=hn,pn=(e,t)=>void 0!==e?e:void 0!==t?t:0,gn=e=>{const t=e.dom,o=t.ownerDocument.body;return o===t?mn(o.offsetLeft,o.offsetTop):jo(e)?(e=>{const t=e.getBoundingClientRect();return mn(t.left,t.top)})(t):mn(0,0)},fn=e=>{const t=void 0!==e?e.dom:document,o=t.body.scrollLeft||t.documentElement.scrollLeft,n=t.body.scrollTop||t.documentElement.scrollTop;return mn(o,n)},vn=(e,t,o)=>{const n=(void 0!==o?o.dom:document).defaultView;n&&n.scrollTo(e,t)},bn=(e,t)=>{_t().browser.isSafari()&&x(e.dom.scrollIntoViewIfNeeded)?e.dom.scrollIntoViewIfNeeded(!1):e.dom.scrollIntoView(t)},yn=(e,t,o,n)=>({x:e,y:t,width:o,height:n,right:e+o,bottom:t+n}),wn=e=>{const t=void 0===e?window:e,o=t.document,n=fn(mo(o));return(e=>{const t=void 0===e?window:e;return _t().browser.isFirefox()?F.none():F.from(t.visualViewport)})(t).fold((()=>{const e=t.document.documentElement,o=e.clientWidth,r=e.clientHeight;return yn(n.left,n.top,o,r)}),(e=>yn(Math.max(e.pageLeft,n.left),Math.max(e.pageTop,n.top),e.width,e.height)))},_n=(e,t)=>{let o=[];return $(Mo(e),(e=>{t(e)&&(o=o.concat([e])),o=o.concat(_n(e,t))})),o};var xn=(e,t,o,n,r)=>e(o,n)?F.some(o):x(r)&&r(o)?F.none():t(o,n,r);const Cn=(e,t,o)=>{let n=e.dom;const r=x(o)?o:N;for(;n.parentNode;){n=n.parentNode;const e=mo(n);if(t(e))return F.some(e);if(r(e))break}return F.none()},kn=(e,t,o)=>xn(((e,t)=>t(e)),Cn,e,t,o),Sn=(e,t,o)=>Cn(e,(e=>fo(e,t)),o),Tn=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return vo(o)?F.none():F.from(o.querySelector(e)).map(mo)})(t,e),En=(e,t,o)=>xn(((e,t)=>fo(e,t)),Sn,e,t,o),On=(e,t,o)=>Sn(e,t,o).isSome();class An{constructor(e,t){this.node=e,this.rootNode=t,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}current(){return this.node}next(e){return this.node=this.findSibling(this.node,"firstChild","nextSibling",e),this.node}prev(e){return this.node=this.findSibling(this.node,"lastChild","previousSibling",e),this.node}prev2(e){return this.node=this.findPreviousNode(this.node,e),this.node}findSibling(e,t,o,n){if(e){if(!n&&e[t])return e[t];if(e!==this.rootNode){let t=e[o];if(t)return t;for(let n=e.parentNode;n&&n!==this.rootNode;n=n.parentNode)if(t=n[o],t)return t}}}findPreviousNode(e,t){if(e){const o=e.previousSibling;if(this.rootNode&&o===this.rootNode)return;if(o){if(!t)for(let e=o.lastChild;e;e=e.lastChild)if(!e.lastChild)return e;return o}const n=e.parentNode;if(n&&n!==this.rootNode)return n}}}const Mn=e=>t=>!!t&&t.nodeType===e,Bn=e=>!!e&&!Object.getPrototypeOf(e),Pn=Mn(1),Rn=e=>{const t=e.toLowerCase();return e=>_(e)&&e.nodeName.toLowerCase()===t},Vn=e=>{const t=e.map((e=>e.toLowerCase()));return e=>{if(e&&e.nodeName){const o=e.nodeName.toLowerCase();return Z(t,o)}return!1}},Nn=(e,t)=>{const o=t.toLowerCase().split(" ");return t=>{if(Pn(t)){const n=t.ownerDocument.defaultView;if(n)for(let r=0;r<o.length;r++){const i=n.getComputedStyle(t,null);if((i?i.getPropertyValue(e):null)===o[r])return!0}}return!1}},Dn=e=>t=>Pn(t)&&t.hasAttribute(e),Fn=e=>Pn(e)&&e.hasAttribute("data-mce-bogus"),In=e=>Pn(e)&&"TABLE"===e.tagName,Ln=e=>t=>{if(Pn(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1},zn=Vn(["textarea","input"]),Hn=Mn(3),Zn=Mn(4),jn=Mn(7),Un=Mn(8),$n=Mn(9),Wn=Mn(11),qn=Rn("br"),Gn=Rn("img"),Yn=Ln("true"),Xn=Ln("false"),Kn=Vn(["td","th"]),Jn=Vn(["td","th","caption"]),Qn=Vn(["video","audio","object","embed"]),er=Rn("li"),tr="\ufeff",or=" ",nr=e=>e===tr,rr=(e,t)=>((e,t)=>{const o=void 0===t?document:t.dom;return vo(o)?[]:U(o.querySelectorAll(e),mo)})(t,e),ir=((e,t)=>{const o=t=>e(t)?F.from(t.dom.nodeValue):F.none();return{get:t=>{if(!e(t))throw new Error("Can only get text value of a text node");return o(t).getOr("")},getOption:o,set:(t,o)=>{if(!e(t))throw new Error("Can only set raw text value of a text node");t.dom.nodeValue=o}}})(zt),sr=e=>ir.get(e),ar=e=>ir.getOption(e),lr=["pre"].concat(["h1","h2","h3","h4","h5","h6"]),cr=e=>{let t;return o=>(t=t||ie(e,D),Ce(t,Dt(o)))},dr=cr(["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"]),ur=e=>Lt(e)&&!dr(e),hr=e=>Lt(e)&&"br"===Dt(e),mr=cr(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),pr=cr(["ul","ol","dl"]),gr=cr(["li","dd","dt"]),fr=cr(["thead","tbody","tfoot"]),vr=cr(["td","th"]),br=cr(["pre","script","textarea","style"]),yr=cr(lr),wr=e=>yr(e)||ur(e),_r=()=>{const e=uo("br");return $t(e,"data-mce-bogus","1"),e},xr=e=>{nn(e),tn(e,_r())},Cr=e=>{Ro(e).each((t=>{To(t).each((o=>{dr(e)&&hr(t)&&dr(o)&&rn(t)}))}))},kr=tr,Sr=nr,Tr=e=>e.replace(/\uFEFF/g,""),Er=Pn,Or=Hn,Ar=e=>(Or(e)&&(e=e.parentNode),Er(e)&&e.hasAttribute("data-mce-caret")),Mr=e=>Or(e)&&Sr(e.data),Br=e=>Ar(e)||Mr(e),Pr=e=>e.firstChild!==e.lastChild||!qn(e.firstChild),Rr=e=>{const t=e.container();return!!Hn(t)&&(t.data.charAt(e.offset())===kr||e.isAtStart()&&Mr(t.previousSibling))},Vr=e=>{const t=e.container();return!!Hn(t)&&(t.data.charAt(e.offset()-1)===kr||e.isAtEnd()&&Mr(t.nextSibling))},Nr=e=>Or(e)&&e.data[0]===kr,Dr=e=>Or(e)&&e.data[e.data.length-1]===kr,Fr=e=>e&&e.hasAttribute("data-mce-caret")?((e=>{var t;const o=e.getElementsByTagName("br"),n=o[o.length-1];Fn(n)&&(null===(t=n.parentNode)||void 0===t||t.removeChild(n))})(e),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("data-mce-style"),e.removeAttribute("_moz_abspos"),e):null,Ir=e=>Ar(e.startContainer),Lr=Yn,zr=Xn,Hr=qn,Zr=Hn,jr=Vn(["script","style","textarea"]),Ur=Vn(["img","input","textarea","hr","iframe","video","audio","object","embed"]),$r=Vn(["table"]),Wr=Br,qr=e=>!Wr(e)&&(Zr(e)?!jr(e.parentNode):Ur(e)||Hr(e)||$r(e)||Gr(e)),Gr=e=>!(e=>Pn(e)&&"true"===e.getAttribute("unselectable"))(e)&&zr(e),Yr=(e,t)=>qr(e)&&((e,t)=>{for(let o=e.parentNode;o&&o!==t;o=o.parentNode){if(Gr(o))return!1;if(Lr(o))return!0}return!0})(e,t),Xr=/^[ \t\r\n]*$/,Kr=e=>Xr.test(e),Jr=e=>"\n"===e||"\r"===e,Qr=(e,t=4,o=!0,n=!0)=>{const r=((e,t)=>t<=0?"":new Array(t+1).join(" "))(0,t),i=e.replace(/\t/g,r),s=X(i,((e,t)=>(e=>-1!==" \f\t\v".indexOf(e))(t)||t===or?e.pcIsSpace||""===e.str&&o||e.str.length===i.length-1&&n||((e,t)=>t<e.length&&t>=0&&Jr(e[t]))(i,e.str.length+1)?{pcIsSpace:!1,str:e.str+or}:{pcIsSpace:!0,str:e.str+" "}:{pcIsSpace:Jr(t),str:e.str+t}),{pcIsSpace:!1,str:""});return s.str},ei=(e,t)=>qr(e)&&!((e,t)=>Hn(e)&&Kr(e.data)&&!((e,t)=>{const o=mo(t),n=mo(e);return On(n,"pre,code",B(bo,o))})(e,t))(e,t)||(e=>Pn(e)&&"A"===e.nodeName&&!e.hasAttribute("href")&&(e.hasAttribute("name")||e.hasAttribute("id")))(e)||ti(e),ti=Dn("data-mce-bookmark"),oi=Dn("data-mce-bogus"),ni=("data-mce-bogus","all",e=>Pn(e)&&"all"===e.getAttribute("data-mce-bogus"));const ri=(e,t=!0)=>((e,t)=>{let o=0;if(ei(e,e))return!1;{let n=e.firstChild;if(!n)return!0;const r=new An(n,e);do{if(t){if(ni(n)){n=r.next(!0);continue}if(oi(n)){n=r.next();continue}}if(qn(n))o++,n=r.next();else{if(ei(n,e))return!1;n=r.next()}}while(n);return o<=1}})(e.dom,t),ii="data-mce-block",si=e=>(e=>G(he(e),(e=>!/[A-Z]/.test(e))))(e).join(","),ai=(e,t)=>_(t.querySelector(e))?(t.setAttribute(ii,"true"),"inline-boundary"===t.getAttribute("data-mce-selected")&&t.removeAttribute("data-mce-selected"),!0):(t.removeAttribute(ii),!1),li=(e,t)=>{const o=si(e.getTransparentElements()),n=si(e.getBlockElements());return G(t.querySelectorAll(o),(e=>ai(n,e)))},ci=(e,t)=>{var o;const n=t?"lastChild":"firstChild";for(let t=e[n];t;t=t[n])if(ri(mo(t)))return void(null===(o=t.parentNode)||void 0===o||o.removeChild(t))},di=(e,t,o)=>{const n=e.getBlockElements(),r=mo(t),i=e=>Dt(e)in n,s=e=>bo(e,r);$(an(o),(t=>{Cn(t,i,s).each((o=>{const n=((t,n)=>G(Mo(t),(t=>i(t)&&!e.isValidChild(Dt(o),Dt(t)))))(t);if(n.length>0){const t=ko(o);$(n,(e=>{Cn(e,i,s).each((t=>{((e,t)=>{const o=document.createRange(),n=e.parentNode;if(n){o.setStartBefore(e),o.setEndBefore(t);const r=o.extractContents();ci(r,!0),o.setStartAfter(t),o.setEndAfter(e);const i=o.extractContents();ci(i,!1),ri(mo(r))||n.insertBefore(r,e),ri(mo(t))||n.insertBefore(t,e),ri(mo(i))||n.insertBefore(i,e),n.removeChild(e)}})(t.dom,e.dom)}))})),t.each((t=>li(e,t.dom)))}}))}))},ui=(e,t)=>{const o=li(e,t);di(e,t,o)},hi=(e,t)=>{if(gi(e,t)){const o=si(e.getBlockElements());ai(o,t)}},mi=e=>e.hasAttribute(ii),pi=(e,t)=>Ce(e.getTransparentElements(),t),gi=(e,t)=>Pn(t)&&pi(e,t.nodeName),fi=(e,t)=>gi(e,t)&&mi(t),vi=(e,t)=>1===t.type&&pi(e,t.name)&&y(t.attr(ii)),bi=_t().browser,yi=e=>J(e,Lt),wi=(e,t)=>e.children&&Z(e.children,t),_i=(e,t={})=>{let o=0;const n={},r=mo(e),i=_o(r),s=t.maxLoadTime||5e3,a=a=>new Promise(((l,c)=>{let d;const u=Pt._addCacheSuffix(a),h=(e=>xe(n,e).getOrThunk((()=>({id:"mce-u"+o++,passed:[],failed:[],count:0}))))(u);n[u]=h,h.count++;const m=(e,t)=>{$(e,V),h.status=t,h.passed=[],h.failed=[],d&&(d.onload=null,d.onerror=null,d=null)},p=()=>m(h.passed,2),g=()=>m(h.failed,3),f=()=>{var t;t=f,(()=>{const t=e.styleSheets;let o=t.length;for(;o--;){const e=t[o].ownerNode;if(e&&d&&e.id===d.id)return p(),!0}return!1})()||(Date.now()-b<s?setTimeout(t):g())};if(l&&h.passed.push(l),c&&h.failed.push(c),1===h.status)return;if(2===h.status)return void p();if(3===h.status)return void g();h.status=1;const v=uo("link",i.dom);Wt(v,{rel:"stylesheet",type:"text/css",id:h.id});const b=Date.now();var y;t.contentCssCors&&$t(v,"crossOrigin","anonymous"),t.referrerPolicy&&$t(v,"referrerpolicy",t.referrerPolicy),d=v.dom,d.onload=f,d.onerror=g,y=v,tn(Lo(r),y),$t(v,"href",u)})),l=e=>{const t=Pt._addCacheSuffix(e);xe(n,t).each((e=>{0==--e.count&&(delete n[t],(e=>{const t=Lo(r);Tn(t,"#"+e).each(rn)})(e.id))}))};return{load:a,loadAll:e=>Promise.allSettled(U(e,(e=>a(e).then(O(e))))).then((e=>{const t=q(e,(e=>"fulfilled"===e.status));return t.fail.length>0?Promise.reject(U(t.fail,(e=>e.reason))):U(t.pass,(e=>e.value))})),unload:l,unloadAll:e=>{$(e,(e=>{l(e)}))},_setReferrerPolicy:e=>{t.referrerPolicy=e},_setContentCssCors:e=>{t.contentCssCors=e}}},xi=(()=>{const e=new WeakMap;return{forElement:(t,o)=>{const n=Io(t).dom;return F.from(e.get(n)).getOrThunk((()=>{const t=_i(n,o);return e.set(n,t),t}))}}})(),Ci=(e,t)=>_(e)&&(ei(e,t)||ur(mo(e))),ki=e=>(e=>"span"===e.nodeName.toLowerCase())(e)&&"bookmark"===e.getAttribute("data-mce-type"),Si=(e,t,o)=>{var n;const r=o||t;if(Pn(t)&&ki(t))return t;const i=t.childNodes;for(let t=i.length-1;t>=0;t--)Si(e,i[t],r);if(Pn(t)){const e=t.childNodes;1===e.length&&ki(e[0])&&(null===(n=t.parentNode)||void 0===n||n.insertBefore(e[0],t))}return(e=>Wn(e)||$n(e))(t)||ei(t,r)||(e=>!!Pn(e)&&e.childNodes.length>0)(t)||((e,t)=>Hn(e)&&e.data.length>0&&((e,t)=>{const o=new An(e,t).prev(!1),n=new An(e,t).next(!1),r=y(o)||Ci(o,t),i=y(n)||Ci(n,t);return r&&i})(e,t))(t,r)||e.remove(t),t},Ti=Pt.makeMap,Ei=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Oi=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ai=/[<>&\"\']/g,Mi=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Bi={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"},Pi={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;","`":"&#96;"},Ri={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"},Vi=(e,t)=>{const o={};if(e){const n=e.split(",");t=t||10;for(let e=0;e<n.length;e+=2){const r=String.fromCharCode(parseInt(n[e],t));if(!Pi[r]){const t="&"+n[e+1]+";";o[r]=t,o[t]=r}}return o}},Ni=Vi("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),Di=(e,t)=>e.replace(t?Ei:Oi,(e=>Pi[e]||e)),Fi=(e,t)=>e.replace(t?Ei:Oi,(e=>e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":Pi[e]||"&#"+e.charCodeAt(0)+";")),Ii=(e,t,o)=>{const n=o||Ni;return e.replace(t?Ei:Oi,(e=>Pi[e]||n[e]||e))},Li={encodeRaw:Di,encodeAllRaw:e=>(""+e).replace(Ai,(e=>Pi[e]||e)),encodeNumeric:Fi,encodeNamed:Ii,getEncodeFunc:(e,t)=>{const o=Vi(t)||Ni,n=Ti(e.replace(/\+/g,","));return n.named&&n.numeric?(e,t)=>e.replace(t?Ei:Oi,(e=>void 0!==Pi[e]?Pi[e]:void 0!==o[e]?o[e]:e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";")):n.named?t?(e,t)=>Ii(e,t,o):Ii:n.numeric?Fi:Di},decode:e=>e.replace(Mi,((e,t)=>t?(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))>65535?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):Bi[t]||String.fromCharCode(t):Ri[e]||Ni[e]||(e=>{const t=uo("div").dom;return t.innerHTML=e,t.textContent||t.innerText||e})(e)))},zi={},Hi={},Zi={},ji=Pt.makeMap,Ui=Pt.each,$i=Pt.extend,Wi=Pt.explode,qi=Pt.inArray,Gi=(e,t)=>(e=Pt.trim(e))?e.split(t||" "):[],Yi=(e,t={})=>{const o=ji(e," ",ji(e.toUpperCase()," "));return $i(o,t)},Xi=e=>Yi("td th li dt dd figcaption caption details summary",e.getTextBlockElements()),Ki=(e,t)=>{if(e){const o={};return m(e)&&(e={"*":e}),Ui(e,((e,n)=>{o[n]=o[n.toUpperCase()]="map"===t?ji(e,/[, ]/):Wi(e,/[, ]/)})),o}},Ji=(e={})=>{var t;const o={},n={};let r=[];const i={},s={},a=(t,o,n)=>{const r=e[t];if(r)return ji(r,/[, ]/,ji(r.toUpperCase(),/[, ]/));{let e=Hi[t];return e||(e=Yi(o,n),Hi[t]=e),e}},l=null!==(t=e.schema)&&void 0!==t?t:"html5",c=(e=>{const t={};let o,n,r,i;const s=(e,n="",r="")=>{const i=Gi(r),s=Gi(e);let a=s.length;for(;a--;){const e=Gi([o,n].join(" "));t[s[a]]={attributes:ie(e,(()=>({}))),attributesOrder:e,children:ie(i,O(Zi))}}},a=(e,o)=>{const n=Gi(e),r=Gi(o);let i=n.length;for(;i--;){const e=t[n[i]];for(let t=0,o=r.length;t<o;t++)e.attributes[r[t]]={},e.attributesOrder.push(r[t])}};if(zi[e])return zi[e];if(o="id accesskey class dir lang style tabindex title role",n="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",r="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==e&&(o+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",n+=" article aside details dialog figure main header footer hgroup section nav a ins del canvas map",r+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==e){o+=" xml:lang";const e="acronym applet basefont big font strike tt";r=[r,e].join(" "),Ui(Gi(e),(e=>{s(e,"",r)}));const t="center dir isindex noframes";n=[n,t].join(" "),i=[n,r].join(" "),Ui(Gi(t),(e=>{s(e,"",i)}))}return i=i||[n,r].join(" "),s("html","manifest","head body"),s("head","","base command link meta noscript script style title"),s("title hr noscript br"),s("base","href target"),s("link","href rel media hreflang type sizes hreflang"),s("meta","name http-equiv content charset"),s("style","media type scoped"),s("script","src async defer type charset"),s("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",i),s("address dt dd div caption","",i),s("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",r),s("blockquote","cite",i),s("ol","reversed start type","li"),s("ul","","li"),s("li","value",i),s("dl","","dt dd"),s("a","href target rel media hreflang type",i),s("q","cite",r),s("ins del","cite datetime",i),s("img","src sizes srcset alt usemap ismap width height"),s("iframe","src name width height",i),s("embed","src type width height"),s("object","data type typemustmatch name usemap form width height",[i,"param"].join(" ")),s("param","name value"),s("map","name",[i,"area"].join(" ")),s("area","alt coords shape href target rel media hreflang type"),s("table","border","caption colgroup thead tfoot tbody tr"+("html4"===e?" col":"")),s("colgroup","span","col"),s("col","span"),s("tbody thead tfoot","","tr"),s("tr","","td th"),s("td","colspan rowspan headers",i),s("th","colspan rowspan headers scope abbr",i),s("form","accept-charset action autocomplete enctype method name novalidate target",i),s("fieldset","disabled form name",[i,"legend"].join(" ")),s("label","form for",r),s("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),s("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===e?i:r),s("select","disabled form multiple name required size","option optgroup"),s("optgroup","disabled label","option"),s("option","disabled label selected value"),s("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),s("menu","type label",[i,"li"].join(" ")),s("noscript","",i),"html4"!==e&&(s("wbr"),s("ruby","",[r,"rt rp"].join(" ")),s("figcaption","",i),s("mark rt rp summary bdi","",r),s("canvas","width height",i),s("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[i,"track source"].join(" ")),s("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[i,"track source"].join(" ")),s("picture","","img source"),s("source","src srcset type media sizes"),s("track","kind src srclang label default"),s("datalist","",[r,"option"].join(" ")),s("article section nav aside main header footer","",i),s("hgroup","","h1 h2 h3 h4 h5 h6"),s("figure","",[i,"figcaption"].join(" ")),s("time","datetime",r),s("dialog","open",i),s("command","type label icon disabled checked radiogroup command"),s("output","for form name",r),s("progress","value max",r),s("meter","value min max low high optimum",r),s("details","open",[i,"summary"].join(" ")),s("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==e&&(a("script","language xml:space"),a("style","xml:space"),a("object","declare classid code codebase codetype archive standby align border hspace vspace"),a("embed","align name hspace vspace"),a("param","valuetype type"),a("a","charset name rev shape coords"),a("br","clear"),a("applet","codebase archive code object alt name width height align hspace vspace"),a("img","name longdesc align border hspace vspace"),a("iframe","longdesc frameborder marginwidth marginheight scrolling align"),a("font basefont","size color face"),a("input","usemap align"),a("select"),a("textarea"),a("h1 h2 h3 h4 h5 h6 div p legend caption","align"),a("ul","type compact"),a("li","type"),a("ol dl menu dir","compact"),a("pre","width xml:space"),a("hr","align noshade size width"),a("isindex","prompt"),a("table","summary width frame rules cellspacing cellpadding align bgcolor"),a("col","width align char charoff valign"),a("colgroup","width align char charoff valign"),a("thead","align char charoff valign"),a("tr","align char charoff valign bgcolor"),a("th","axis align char charoff valign nowrap bgcolor width height"),a("form","accept"),a("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),a("tfoot","align char charoff valign"),a("tbody","align char charoff valign"),a("area","nohref"),a("body","background bgcolor text link vlink alink")),"html4"!==e&&(a("input button select textarea","autofocus"),a("input textarea","placeholder"),a("a","download"),a("link script img","crossorigin"),a("img","loading"),a("iframe","sandbox seamless allow allowfullscreen loading")),"html4"!==e&&$([t.video,t.audio],(e=>{delete e.children.audio,delete e.children.video})),Ui(Gi("a form meter progress dfn"),(e=>{t[e]&&delete t[e].children[e]})),delete t.caption.children.table,delete t.script,zi[e]=t,t})(l);!1===e.verify_html&&(e.valid_elements="*[*]");const d=Ki(e.valid_styles),u=Ki(e.invalid_styles,"map"),h=Ki(e.valid_classes,"map"),m=a("whitespace_elements","pre script noscript style textarea video audio iframe object code"),p=a("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),g=a("void_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),f=a("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls allowfullscreen"),v="td th iframe video audio object script code",b=a("non_empty_elements",v+" pre",g),y=a("move_caret_before_on_enter_elements",v+" table",g),w=a("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),_=a("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",w),x=a("text_inline_elements","span strong b em i font s strike u var cite dfn code mark q sup sub samp"),C=a("transparent_elements","a ins del canvas map");Ui("script noscript iframe noframes noembed title style textarea xmp plaintext".split(" "),(e=>{s[e]=new RegExp("</"+e+"[^>]*>","gi")}));const k=e=>new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$"),S=e=>{const t=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/,n=/^([!\-])?(\w+[\\:]:\w+|[^=~<]+)?(?:([=~<])(.*))?$/,i=/[*?+]/;if(e){const s=Gi(e,",");let a,l;o["@"]&&(a=o["@"].attributes,l=o["@"].attributesOrder);for(let e=0,c=s.length;e<c;e++){let c=t.exec(s[e]);if(c){const e=c[1],t=c[2],s=c[3],d=c[5],u={},h=[],m={attributes:u,attributesOrder:h};if("#"===e&&(m.paddEmpty=!0),"-"===e&&(m.removeEmpty=!0),"!"===c[4]&&(m.removeEmptyAttrs=!0),a&&(pe(a,((e,t)=>{u[t]=e})),l&&h.push(...l)),d){const e=Gi(d,"|");for(let t=0,o=e.length;t<o;t++)if(c=n.exec(e[t]),c){const e={},t=c[1],o=c[2].replace(/[\\:]:/g,":"),n=c[3],r=c[4];if("!"===t&&(m.attributesRequired=m.attributesRequired||[],m.attributesRequired.push(o),e.required=!0),"-"===t){delete u[o],h.splice(qi(h,o),1);continue}if(n&&("="===n&&(m.attributesDefault=m.attributesDefault||[],m.attributesDefault.push({name:o,value:r}),e.defaultValue=r),"~"===n&&(m.attributesForced=m.attributesForced||[],m.attributesForced.push({name:o,value:r}),e.forcedValue=r),"<"===n&&(e.validValues=ji(r,"?"))),i.test(o)){const t=e;m.attributePatterns=m.attributePatterns||[],t.pattern=k(o),m.attributePatterns.push(t)}else u[o]||h.push(o),u[o]=e}}if(a||"@"!==t||(a=u,l=h),s&&(m.outputName=t,o[s]=m),i.test(t)){const e=m;e.pattern=k(t),r.push(e)}else o[t]=m}}}},T=e=>{r=[],$(he(o),(e=>{delete o[e]})),S(e),Ui(c,((e,t)=>{n[t]=e.children}))},E=e=>{const t=/^(~)?(.+)$/;e&&(delete Hi.text_block_elements,delete Hi.block_elements,Ui(Gi(e,","),(e=>{const r=t.exec(e);if(r){const e="~"===r[1],t=e?"span":"div",s=r[2];if(n[s]=n[t],i[s]=t,b[s.toUpperCase()]={},b[s]={},e||(_[s.toUpperCase()]={},_[s]={}),!o[s]){let e=o[t];e=$i({},e),delete e.removeEmptyAttrs,delete e.removeEmpty,o[s]=e}Ui(n,((e,o)=>{e[t]&&(n[o]=e=$i({},n[o]),e[s]=e[t])}))}})))},A=e=>{const t=/^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;delete zi[l],e&&Ui(Gi(e,","),(e=>{const o=t.exec(e);if(o){const e=o[1];let t;t=e?n[o[2]]:n[o[2]]={"#comment":{}},t=n[o[2]],Ui(Gi(o[3],"|"),(o=>{"-"===e?delete t[o]:t[o]={}}))}}))},M=e=>{const t=o[e];if(t)return t;let n=r.length;for(;n--;){const t=r[n];if(t.pattern.test(e))return t}};e.valid_elements?T(e.valid_elements):(Ui(c,((e,t)=>{o[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},n[t]=e.children})),Ui(Gi("strong/b em/i"),(e=>{const t=Gi(e,"/");o[t[1]].outputName=t[0]})),Ui(x,((t,n)=>{o[n]&&(e.padd_empty_block_inline_children&&(o[n].paddInEmptyBlock=!0),o[n].removeEmpty=!0)})),Ui(Gi("ol ul blockquote a table tbody"),(e=>{o[e]&&(o[e].removeEmpty=!0)})),Ui(Gi("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),(e=>{o[e].paddEmpty=!0})),Ui(Gi("span"),(e=>{o[e].removeEmptyAttrs=!0}))),E(e.custom_elements),A(e.valid_children),S(e.extended_valid_elements),A("+ol[ul|ol],+ul[ul|ol]"),Ui({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},((e,t)=>{o[t]&&(o[t].parentsRequired=Gi(e))})),e.invalid_elements&&Ui(Wi(e.invalid_elements),(e=>{o[e]&&delete o[e]})),M("span")||S("span[!data-mce-type|*]");const B=O(d),P=O(u),R=O(h),V=O(f),N=O(_),D=O(w),F=O(x),I=O(Object.seal(g)),L=O(p),z=O(b),H=O(y),Z=O(m),j=O(C),U=O(Object.seal(s)),W=O(i);return{type:l,children:n,elements:o,getValidStyles:B,getValidClasses:R,getBlockElements:N,getInvalidStyles:P,getVoidElements:I,getTextBlockElements:D,getTextInlineElements:F,getBoolAttrs:V,getElementRule:M,getSelfClosingElements:L,getNonEmptyElements:z,getMoveCaretBeforeOnEnterElements:H,getWhitespaceElements:Z,getTransparentElements:j,getSpecialElements:U,isValidChild:(e,t)=>{const o=n[e.toLowerCase()];return!(!o||!o[t.toLowerCase()])},isValid:(e,t)=>{const o=M(e);if(o){if(!t)return!0;{if(o.attributes[t])return!0;const e=o.attributePatterns;if(e){let o=e.length;for(;o--;)if(e[o].pattern.test(t))return!0}}}return!1},getCustomElements:W,addValidElements:S,setValidElements:T,addCustomElements:E,addValidChildren:A}},Qi=(e={},t)=>{const o=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,n=/\s*([^:]+):\s*([^;]+);?/g,r=/\s+$/,i={};let s,a;const l=tr;t&&(s=t.getValidStyles(),a=t.getInvalidStyles());const c="\\\" \\' \\; \\: ; : \ufeff".split(" ");for(let e=0;e<c.length;e++)i[c[e]]=l+e,i[l+e]=c[e];const d={parse:t=>{const s={};let a=!1;const c=e.url_converter,u=e.url_converter_scope||d,h=(e,t,o)=>{const n=s[e+"-top"+t];if(!n)return;const r=s[e+"-right"+t];if(!r)return;const i=s[e+"-bottom"+t];if(!i)return;const a=s[e+"-left"+t];if(!a)return;const l=[n,r,i,a];let c=l.length-1;for(;c--&&l[c]===l[c+1];);c>-1&&o||(s[e+t]=-1===c?l[0]:l.join(" "),delete s[e+"-top"+t],delete s[e+"-right"+t],delete s[e+"-bottom"+t],delete s[e+"-left"+t])},m=e=>{const t=s[e];if(!t)return;const o=t.split(" ");let n=o.length;for(;n--;)if(o[n]!==o[0])return!1;return s[e]=o[0],!0},p=e=>(a=!0,i[e]),g=(e,t)=>(a&&(e=e.replace(/\uFEFF[0-9]/g,(e=>i[e]))),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e),f=e=>String.fromCharCode(parseInt(e.slice(1),16)),v=e=>e.replace(/\\[0-9a-f]+/gi,f),b=(t,o,n,r,i,s)=>{if(i=i||s)return"'"+(i=g(i)).replace(/\'/g,"\\'")+"'";if(o=g(o||n||r||""),!e.allow_script_urls){const t=o.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(t))return"";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(t))return""}return c&&(o=c.call(u,o,"style")),"url('"+o.replace(/\'/g,"\\'")+"')"};if(t){let i;for(t=(t=t.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,p).replace(/\"[^\"]+\"|\'[^\']+\'/g,(e=>e.replace(/[;:]/g,p)));i=n.exec(t);){n.lastIndex=i.index+i[0].length;let t=i[1].replace(r,"").toLowerCase(),c=i[2].replace(r,"");if(t&&c){if(t=v(t),c=v(c),-1!==t.indexOf(l)||-1!==t.indexOf('"'))continue;if(!e.allow_script_urls&&("behavior"===t||/expression\s*\(|\/\*|\*\//.test(c)))continue;"font-weight"===t&&"700"===c?c="bold":"color"!==t&&"background-color"!==t||(c=c.toLowerCase()),c=c.replace(o,b),s[t]=a?g(c,!0):c}}h("border","",!0),h("border","-width"),h("border","-color"),h("border","-style"),h("padding",""),h("margin",""),"border",w="border-style",_="border-color",m(y="border-width")&&m(w)&&m(_)&&(s.border=s[y]+" "+s[w]+" "+s[_],delete s[y],delete s[w],delete s[_]),"medium none"===s.border&&delete s.border,"none"===s["border-image"]&&delete s["border-image"]}var y,w,_;return s},serialize:(e,t)=>{let o="";const n=(t,n)=>{const r=n[t];if(r)for(let t=0,n=r.length;t<n;t++){const n=r[t],i=e[n];i&&(o+=(o.length>0?" ":"")+n+": "+i+";")}};return t&&s?(n("*",s),n(t,s)):pe(e,((e,n)=>{e&&((e,t)=>{if(!a||!t)return!0;let o=a["*"];return!(o&&o[e]||(o=a[t],o&&o[e]))})(n,t)&&(o+=(o.length>0?" ":"")+n+": "+e+";")})),o}};return d},es={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},ts=(e,t)=>{const o=null!=t?t:{};for(const t in e)Ce(es,t)||(o[t]=e[t]);return _(e.composedPath)&&(o.composedPath=()=>e.composedPath()),o},os=(e,t,o,n)=>{var r;const i=ts(t,n);return i.type=e,w(i.target)&&(i.target=null!==(r=i.srcElement)&&void 0!==r?r:o),(e=>w(e.preventDefault)||(e=>e instanceof Event||x(e.initEvent))(e))(t)&&(i.preventDefault=()=>{i.defaultPrevented=!0,i.isDefaultPrevented=D,x(t.preventDefault)&&t.preventDefault()},i.stopPropagation=()=>{i.cancelBubble=!0,i.isPropagationStopped=D,x(t.stopPropagation)&&t.stopPropagation()},i.stopImmediatePropagation=()=>{i.isImmediatePropagationStopped=D,i.stopPropagation()},(e=>e.isDefaultPrevented===D||e.isDefaultPrevented===N)(i)||(i.isDefaultPrevented=!0===i.defaultPrevented?D:N,i.isPropagationStopped=!0===i.cancelBubble?D:N,i.isImmediatePropagationStopped=N)),i},ns=/^(?:mouse|contextmenu)|click/,rs=(e,t,o,n)=>{e.addEventListener(t,o,n||!1)},is=(e,t,o,n)=>{e.removeEventListener(t,o,n||!1)},ss=(e,t)=>{const o=os(e.type,e,document,t);if((e=>_(e)&&ns.test(e.type))(e)&&y(e.pageX)&&!y(e.clientX)){const t=o.target.ownerDocument||document,n=t.documentElement,r=t.body,i=o;i.pageX=e.clientX+(n&&n.scrollLeft||r&&r.scrollLeft||0)-(n&&n.clientLeft||r&&r.clientLeft||0),i.pageY=e.clientY+(n&&n.scrollTop||r&&r.scrollTop||0)-(n&&n.clientTop||r&&r.clientTop||0)}return o},as=(e,t,o)=>{const n=e.document,r={type:"ready"};if(o.domLoaded)return void t(r);const i=()=>{is(e,"DOMContentLoaded",i),is(e,"load",i),o.domLoaded||(o.domLoaded=!0,t(r)),e=null};"complete"===n.readyState||"interactive"===n.readyState&&n.body?i():rs(e,"DOMContentLoaded",i),o.domLoaded||rs(e,"load",i)};class ls{constructor(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}bind(e,t,o,n){const r=this;let i;const s=window,a=e=>{r.executeHandlers(ss(e||s.event),l)};if(!e||Hn(e)||Un(e))return o;let l;e[r.expando]?l=e[r.expando]:(l=r.count++,e[r.expando]=l,r.events[l]={}),n=n||e;const c=t.split(" ");let d=c.length;for(;d--;){let t=c[d],u=a,h=!1,m=!1;"DOMContentLoaded"===t&&(t="ready"),r.domLoaded&&"ready"===t&&"complete"===e.readyState?o.call(n,ss({type:t})):(r.hasFocusIn||"focusin"!==t&&"focusout"!==t||(h=!0,m="focusin"===t?"focus":"blur",u=e=>{const t=ss(e||s.event);t.type="focus"===t.type?"focusin":"focusout",r.executeHandlers(t,l)}),i=r.events[l][t],i?"ready"===t&&r.domLoaded?o(ss({type:t})):i.push({func:o,scope:n}):(r.events[l][t]=i=[{func:o,scope:n}],i.fakeName=m,i.capture=h,i.nativeHandler=u,"ready"===t?as(e,u,r):rs(e,m||t,u,h)))}return e=i=null,o}unbind(e,t,o){if(!e||Hn(e)||Un(e))return this;const n=e[this.expando];if(n){let r=this.events[n];if(t){const n=t.split(" ");let i=n.length;for(;i--;){const t=n[i],s=r[t];if(s){if(o){let e=s.length;for(;e--;)if(s[e].func===o){const o=s.nativeHandler,n=s.fakeName,i=s.capture,a=s.slice(0,e).concat(s.slice(e+1));a.nativeHandler=o,a.fakeName=n,a.capture=i,r[t]=a}}o&&0!==s.length||(delete r[t],is(e,s.fakeName||t,s.nativeHandler,s.capture))}}}else pe(r,((t,o)=>{is(e,t.fakeName||o,t.nativeHandler,t.capture)})),r={};for(const e in r)if(Ce(r,e))return this;delete this.events[n];try{delete e[this.expando]}catch(t){e[this.expando]=null}}return this}fire(e,t,o){return this.dispatch(e,t,o)}dispatch(e,t,o){if(!e||Hn(e)||Un(e))return this;const n=ss({type:t,target:e},o);do{const t=e[this.expando];t&&this.executeHandlers(n,t),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow}while(e&&!n.isPropagationStopped());return this}clean(e){if(!e||Hn(e)||Un(e))return this;if(e[this.expando]&&this.unbind(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName){this.unbind(e);const t=e.getElementsByTagName("*");let o=t.length;for(;o--;)(e=t[o])[this.expando]&&this.unbind(e)}return this}destroy(){this.events={}}cancel(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}executeHandlers(e,t){const o=this.events[t],n=o&&o[e.type];if(n)for(let t=0,o=n.length;t<o;t++){const o=n[t];if(o&&!1===o.func.call(o.scope,e)&&e.preventDefault(),e.isImmediatePropagationStopped())return}}}ls.Event=new ls;const cs=Pt.each,ds=Pt.grep,us="data-mce-style",hs=Pt.makeMap("fill-opacity font-weight line-height opacity orphans widows z-index zoom"," "),ms=(e,t,o)=>{w(o)||""===o?Xt(e,t):$t(e,t,o)},ps=e=>e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase())),gs=(e,t)=>{let o=0;if(e)for(let n=e.nodeType,r=e.previousSibling;r;r=r.previousSibling){const e=r.nodeType;(!t||!Hn(r)||e!==n&&r.data.length)&&(o++,n=e)}return o},fs=(e,t)=>{const o=qt(t,"style"),n=e.serialize(e.parse(o),Dt(t));ms(t,us,n)},vs=(e,t,o)=>{const n=ps(t);w(o)||""===o?Ko(e,n):$o(e,n,((e,t)=>C(e)?Ce(hs,t)?e+"":e+"px":e)(o,n))},bs=(e,t={})=>{const o={},n=window,r={};let i=0;const s=xi.forElement(mo(e),{contentCssCors:t.contentCssCors,referrerPolicy:t.referrerPolicy}),a=[],l=t.schema?t.schema:Ji({}),c=Qi({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),d=t.ownEvents?new ls:ls.Event,u=l.getBlockElements(),h=t=>t&&e&&m(t)?e.getElementById(t):t,p=e=>{const t=h(e);return _(t)?mo(t):null},g=(e,t,o="")=>{let n;const r=p(e);if(_(r)&&Lt(r)){const e=Y[t];n=e&&e.get?e.get(r.dom,t):qt(r,t)}return _(n)?n:o},v=e=>{const t=h(e);return w(t)?[]:t.attributes},b=(e,o,n)=>{B(e,(e=>{if(Pn(e)){const r=mo(e),i=""===n?null:n,s=qt(r,o),a=Y[o];a&&a.set?a.set(r.dom,i,o):ms(r,o,i),s!==i&&t.onSetAttrib&&t.onSetAttrib({attrElm:r.dom,attrName:o,attrValue:i})}}))},y=()=>t.root_element||e.body,C=(t,o)=>((e,t,o)=>{let n=0,r=0;const i=e.ownerDocument;if(o=o||e,t){if(o===e&&t.getBoundingClientRect&&"static"===qo(mo(e),"position")){const o=t.getBoundingClientRect();return n=o.left+(i.documentElement.scrollLeft||e.scrollLeft)-i.documentElement.clientLeft,r=o.top+(i.documentElement.scrollTop||e.scrollTop)-i.documentElement.clientTop,{x:n,y:r}}let s=t;for(;s&&s!==o&&s.nodeType&&!wi(s,o);){const e=s;n+=e.offsetLeft||0,r+=e.offsetTop||0,s=e.offsetParent}for(s=t.parentNode;s&&s!==o&&s.nodeType&&!wi(s,o);)n-=s.scrollLeft||0,r-=s.scrollTop||0,s=s.parentNode;r+=(e=>bi.isFirefox()&&"table"===Dt(e)?yi(Mo(e)).filter((e=>"caption"===Dt(e))).bind((e=>yi(Ao(e)).map((t=>{const o=t.dom.offsetTop,n=e.dom.offsetTop,r=e.dom.offsetHeight;return o<=n?-r:0})))).getOr(0):0)(mo(t))}return{x:n,y:r}})(e.body,h(t),o),k=(e,t,o)=>{const n=h(e);if(!w(n)&&Pn(n))return o?qo(mo(n),ps(t)):("float"===(t=t.replace(/-(\D)/g,((e,t)=>t.toUpperCase())))&&(t="cssFloat"),n.style?n.style[t]:void 0)},T=e=>{const t=h(e);if(!t)return{w:0,h:0};let o=k(t,"width"),n=k(t,"height");return o&&-1!==o.indexOf("px")||(o="0"),n&&-1!==n.indexOf("px")||(n="0"),{w:parseInt(o,10)||t.offsetWidth||t.clientWidth,h:parseInt(n,10)||t.offsetHeight||t.clientHeight}},E=(e,t)=>{if(!e)return!1;const o=f(e)?e:[e];return j(o,(e=>fo(mo(e),t)))},A=(e,t,o,n)=>{const r=[];let i=h(e);n=void 0===n;const s=o||("BODY"!==y().nodeName?y().parentNode:null);if(m(t))if("*"===t)t=Pn;else{const e=t;t=t=>E(t,e)}for(;i&&!(i===s||w(i.nodeType)||$n(i)||Wn(i));){if(!t||t(i)){if(!n)return[i];r.push(i)}i=i.parentNode}return n?r:null},M=(e,t,o)=>{let n=t;if(e){m(t)&&(n=e=>E(e,t));for(let t=e[o];t;t=t[o])if(x(n)&&n(t))return t}return null},B=function(e,t,o){const n=null!=o?o:this;if(f(e)){const o=[];return cs(e,((e,r)=>{const i=h(e);i&&o.push(t.call(n,i,r))})),o}{const o=h(e);return!!o&&t.call(n,o)}},P=(e,t)=>{B(e,(e=>{pe(t,((t,o)=>{b(e,o,t)}))}))},R=(e,t)=>{B(e,(e=>{const o=mo(e);cn(o,t)}))},V=(t,o,n,r,i)=>B(t,(t=>{const s=m(o)?e.createElement(o):o;return _(n)&&P(s,n),r&&(!m(r)&&r.nodeType?s.appendChild(r):m(r)&&R(s,r)),i?s:t.appendChild(s)})),N=(t,o,n)=>V(e.createElement(t),t,o,n,!0),D=Li.encodeAllRaw,F=(e,t)=>B(e,(e=>{const o=mo(e);return t&&$(Mo(o),(e=>{zt(e)&&0===e.dom.length?rn(e):Jo(o,e)})),rn(o),o.dom})),I=(e,t,o)=>{B(e,(e=>{if(Pn(e)){const n=mo(e),r=t.split(" ");$(r,(e=>{_(o)?(o?no:io)(n,e):((e,t)=>{const o=Qt(e)?e.dom.classList.toggle(t):((e,t)=>Z(eo(e),t)?oo(e,t):to(e,t))(e,t);ro(e)})(n,e)}))}}))},L=(e,t,o)=>B(t,(n=>{var r;const i=f(t)?e.cloneNode(!0):e;return o&&cs(ds(n.childNodes),(e=>{i.appendChild(e)})),null===(r=n.parentNode)||void 0===r||r.replaceChild(i,n),n})),z=e=>{if(Pn(e)){const t="a"===e.nodeName.toLowerCase()&&!g(e,"href")&&g(e,"id");if(g(e,"name")||g(e,"data-mce-bookmark")||t)return!0}return!1},H=()=>e.createRange(),U=(o,r,i,s)=>{if(f(o)){let e=o.length;const t=[];for(;e--;)t[e]=U(o[e],r,i,s);return t}return!t.collect||o!==e&&o!==n||a.push([o,r,i,s]),d.bind(o,r,i,s||G)},W=(t,o,r)=>{if(f(t)){let e=t.length;const n=[];for(;e--;)n[e]=W(t[e],o,r);return n}if(a.length>0&&(t===e||t===n)){let e=a.length;for(;e--;){const[n,i,s]=a[e];t!==n||o&&o!==i||r&&r!==s||d.unbind(n,i,s)}}return d.unbind(t,o,r)},q=e=>{if(e&&Pn(e)){const t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null},G={doc:e,settings:t,win:n,files:r,stdMode:!0,boxModel:!0,styleSheetLoader:s,boundEvents:a,styles:c,schema:l,events:d,isBlock:e=>m(e)?Ce(u,e):Pn(e)&&(Ce(u,e.nodeName)||fi(l,e)),root:null,clone:(e,t)=>e.cloneNode(t),getRoot:y,getViewPort:e=>{const t=wn(e);return{x:t.x,y:t.y,w:t.width,h:t.height}},getRect:e=>{const t=h(e),o=C(t),n=T(t);return{x:o.x,y:o.y,w:n.w,h:n.h}},getSize:T,getParent:(e,t,o)=>{const n=A(e,t,o,!1);return n&&n.length>0?n[0]:null},getParents:A,get:h,getNext:(e,t)=>M(e,t,"nextSibling"),getPrev:(e,t)=>M(e,t,"previousSibling"),select:(o,n)=>{var r,i;const s=null!==(i=null!==(r=h(n))&&void 0!==r?r:t.root_element)&&void 0!==i?i:e;return x(s.querySelectorAll)?de(s.querySelectorAll(o)):[]},is:E,add:V,create:N,createHTML:(e,t,o="")=>{let n="<"+e;for(const e in t)ke(t,e)&&(n+=" "+e+'="'+D(t[e])+'"');return Ge(o)&&Ce(l.getVoidElements(),e)?n+" />":n+">"+o+"</"+e+">"},createFragment:t=>{const o=e.createElement("div"),n=e.createDocumentFragment();let r;for(n.appendChild(o),t&&(o.innerHTML=t);r=o.firstChild;)n.appendChild(r);return n.removeChild(o),n},remove:F,setStyle:(e,o,n)=>{B(e,(e=>{const r=mo(e);vs(r,o,n),t.update_styles&&fs(c,r)}))},getStyle:k,setStyles:(e,o)=>{B(e,(e=>{const n=mo(e);pe(o,((e,t)=>{vs(n,t,e)})),t.update_styles&&fs(c,n)}))},removeAllAttribs:e=>B(e,(e=>{const t=e.attributes;for(let o=t.length-1;o>=0;o--)e.removeAttributeNode(t.item(o))})),setAttrib:b,setAttribs:P,getAttrib:g,getPos:C,parseStyle:e=>c.parse(e),serializeStyle:(e,t)=>c.serialize(e,t),addStyle:t=>{if(G!==bs.DOM&&e===document){if(o[t])return;o[t]=!0}let n=e.getElementById("mceDefaultStyles");if(!n){n=e.createElement("style"),n.id="mceDefaultStyles",n.type="text/css";const t=e.head;t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)}n.styleSheet?n.styleSheet.cssText+=t:n.appendChild(e.createTextNode(t))},loadCSS:e=>{e||(e=""),$(e.split(","),(e=>{r[e]=!0,s.load(e).catch(S)}))},addClass:(e,t)=>{I(e,t,!0)},removeClass:(e,t)=>{I(e,t,!1)},hasClass:(e,t)=>{const o=p(e),n=t.split(" ");return _(o)&&oe(n,(e=>so(o,e)))},toggleClass:I,show:e=>{B(e,(e=>Ko(mo(e),"display")))},hide:e=>{B(e,(e=>$o(mo(e),"display","none")))},isHidden:e=>{const t=p(e);return _(t)&&Rt(Yo(t,"display"),"none")},uniqueId:e=>(e||"mce_")+i++,setHTML:R,getOuterHTML:e=>{const t=p(e);return _(t)?Pn(t.dom)?t.dom.outerHTML:(e=>{const t=uo("div"),o=mo(e.dom.cloneNode(!0));return tn(t,o),ln(t)})(t):""},setOuterHTML:(e,t)=>{B(e,(e=>{Pn(e)&&(e.outerHTML=t)}))},decode:Li.decode,encode:D,insertAfter:(e,t)=>{const o=h(t);return B(e,(e=>{const t=null==o?void 0:o.parentNode,n=null==o?void 0:o.nextSibling;return t&&(n?t.insertBefore(e,n):t.appendChild(e)),e}))},replace:L,rename:(e,t)=>{if(e.nodeName!==t.toUpperCase()){const o=N(t);return cs(v(e),(t=>{b(o,t.nodeName,g(e,t.nodeName))})),L(o,e,!0),o}return e},findCommonAncestor:(e,t)=>{let o=e;for(;o;){let e=t;for(;e&&o!==e;)e=e.parentNode;if(o===e)break;o=o.parentNode}return!o&&e.ownerDocument?e.ownerDocument.documentElement:o},run:B,getAttribs:v,isEmpty:(e,t)=>{let o=0;if(z(e))return!1;const n=e.firstChild;if(n){const r=new An(n,e),i=l?l.getWhitespaceElements():{},s=t||(l?l.getNonEmptyElements():null);let a=n;do{if(Pn(a)){const e=a.getAttribute("data-mce-bogus");if(e){a=r.next("all"===e);continue}const t=a.nodeName.toLowerCase();if(s&&s[t]){if("br"===t){o++,a=r.next();continue}return!1}if(z(a))return!1}if(Un(a))return!1;if(Hn(a)&&!Kr(a.data))return!1;if(Hn(a)&&a.parentNode&&i[a.parentNode.nodeName]&&Kr(a.data))return!1;a=r.next()}while(a)}return o<=1},createRng:H,nodeIndex:gs,split:(e,t,o)=>{let n,r,i=H();if(e&&t&&e.parentNode&&t.parentNode){const s=e.parentNode;return i.setStart(s,gs(e)),i.setEnd(t.parentNode,gs(t)),n=i.extractContents(),i=H(),i.setStart(t.parentNode,gs(t)+1),i.setEnd(s,gs(e)+1),r=i.extractContents(),s.insertBefore(Si(G,n),e),o?s.insertBefore(o,e):s.insertBefore(t,e),s.insertBefore(Si(G,r),e),F(e),o||t}},bind:U,unbind:W,fire:(e,t,o)=>d.dispatch(e,t,o),dispatch:(e,t,o)=>d.dispatch(e,t,o),getContentEditable:q,getContentEditableParent:e=>{const t=y();let o=null;for(let n=e;n&&n!==t&&(o=q(n),null===o);n=n.parentNode);return o},destroy:()=>{if(a.length>0){let e=a.length;for(;e--;){const[t,o,n]=a[e];d.unbind(t,o,n)}}pe(r,((e,t)=>{s.unload(t),delete r[t]}))},isChildOf:(e,t)=>e===t||t.contains(e),dumpRng:e=>"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},Y=((e,t,o)=>{const n=t.keep_values,r={set:(e,n,r)=>{const i=mo(e);x(t.url_converter)&&_(n)&&(n=t.url_converter.call(t.url_converter_scope||o(),String(n),r,e)),ms(i,"data-mce-"+r,n),ms(i,r,n)},get:(e,t)=>{const o=mo(e);return qt(o,"data-mce-"+t)||qt(o,t)}},i={style:{set:(t,o)=>{const r=mo(t);n&&ms(r,us,o),Xt(r,"style"),m(o)&&Wo(r,e.parse(o))},get:t=>{const o=mo(t),n=qt(o,us)||qt(o,"style");return e.serialize(e.parse(n),Dt(o))}}};return n&&(i.href=i.src=r),i})(c,t,O(G));return G};bs.DOM=bs(document),bs.nodeIndex=gs;const ys=bs.DOM;class ws{constructor(e={}){this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=!1,this.settings=e}_setReferrerPolicy(e){this.settings.referrerPolicy=e}loadScript(e){return new Promise(((t,o)=>{const n=ys;let r;const i=()=>{n.remove(s),r&&(r.onerror=r.onload=r=null)},s=n.uniqueId();r=document.createElement("script"),r.id=s,r.type="text/javascript",r.src=Pt._addCacheSuffix(e),this.settings.referrerPolicy&&n.setAttrib(r,"referrerpolicy",this.settings.referrerPolicy),r.onload=()=>{i(),t()},r.onerror=()=>{i(),o("Failed to load script: "+e)},(document.getElementsByTagName("head")[0]||document.body).appendChild(r)}))}isDone(e){return 2===this.states[e]}markDone(e){this.states[e]=2}add(e){const t=this;return t.queue.push(e),void 0===t.states[e]&&(t.states[e]=0),new Promise(((o,n)=>{t.scriptLoadedCallbacks[e]||(t.scriptLoadedCallbacks[e]=[]),t.scriptLoadedCallbacks[e].push({resolve:o,reject:n})}))}load(e){return this.add(e)}remove(e){delete this.states[e],delete this.scriptLoadedCallbacks[e]}loadQueue(){const e=this.queue;return this.queue=[],this.loadScripts(e)}loadScripts(e){const t=this,o=(e,o)=>{xe(t.scriptLoadedCallbacks,o).each((t=>{$(t,(t=>t[e](o)))})),delete t.scriptLoadedCallbacks[o]},n=e=>{const t=G(e,(e=>"rejected"===e.status));return t.length>0?Promise.reject(te(t,(({reason:e})=>f(e)?e:[e]))):Promise.resolve()},r=e=>Promise.allSettled(U(e,(e=>2===t.states[e]?(o("resolve",e),Promise.resolve()):3===t.states[e]?(o("reject",e),Promise.reject(e)):(t.states[e]=1,t.loadScript(e).then((()=>{t.states[e]=2,o("resolve",e);const i=t.queue;return i.length>0?(t.queue=[],r(i).then(n)):Promise.resolve()}),(()=>(t.states[e]=3,o("reject",e),Promise.reject(e)))))))),i=e=>(t.loading=!0,r(e).then((e=>{t.loading=!1;const o=t.queueLoadedCallbacks.shift();return F.from(o).each(V),n(e)}))),s=Se(e);return t.loading?new Promise(((e,o)=>{t.queueLoadedCallbacks.push((()=>i(s).then(e,o)))})):i(s)}}ws.ScriptLoader=new ws;const _s=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}},xs={},Cs=_s("en"),ks=()=>xe(xs,Cs.get()),Ss={getData:()=>ge(xs,(e=>({...e}))),setCode:e=>{e&&Cs.set(e)},getCode:()=>Cs.get(),add:(e,t)=>{let o=xs[e];o||(xs[e]=o={}),pe(t,((e,t)=>{o[t.toLowerCase()]=e}))},translate:e=>{const t=ks().getOr({}),o=e=>x(e)?Object.prototype.toString.call(e):n(e)?"":""+e,n=e=>""===e||null==e,r=e=>{const n=o(e);return xe(t,n.toLowerCase()).map(o).getOr(n)},i=e=>e.replace(/{context:\w+}$/,"");if(n(e))return"";if(p(s=e)&&Ce(s,"raw"))return o(e.raw);var s;if((e=>f(e)&&e.length>1)(e)){const t=e.slice(1);return i(r(e[0]).replace(/\{([0-9]+)\}/g,((e,n)=>Ce(t,n)?o(t[n]):e)))}return i(r(e))},isRtl:()=>ks().bind((e=>xe(e,"_dir"))).exists((e=>"rtl"===e)),hasCode:e=>Ce(xs,e)},Ts=()=>{const e=[],t={},o={},n=[],r=(e,t)=>{const o=G(n,(o=>o.name===e&&o.state===t));$(o,(e=>e.resolve()))},i=e=>Ce(t,e),s=(e,o)=>{const n=Ss.getCode();!n||o&&-1===(","+(o||"")+",").indexOf(","+n+",")||ws.ScriptLoader.add(t[e]+"/langs/"+n+".js")},a=(e,t="added")=>"added"===t&&(e=>Ce(o,e))(e)||"loaded"===t&&i(e)?Promise.resolve():new Promise((o=>{n.push({name:e,state:t,resolve:o})}));return{items:e,urls:t,lookup:o,get:e=>{if(o[e])return o[e].instance},requireLangPack:(e,t)=>{!1!==Ts.languageLoad&&(i(e)?s(e,t):a(e,"loaded").then((()=>s(e,t))))},add:(t,n)=>(e.push(n),o[t]={instance:n},r(t,"added"),n),remove:e=>{delete t[e],delete o[e]},createUrl:(e,t)=>m(t)?m(e)?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}:t,load:(e,n)=>{if(t[e])return Promise.resolve();let i=m(n)?n:n.prefix+n.resource+n.suffix;0!==i.indexOf("/")&&-1===i.indexOf("://")&&(i=Ts.baseURL+"/"+i),t[e]=i.substring(0,i.lastIndexOf("/"));const s=()=>(r(e,"loaded"),Promise.resolve());return o[e]?s():ws.ScriptLoader.add(i).then(s)},waitFor:a}};Ts.languageLoad=!0,Ts.baseURL="",Ts.PluginManager=Ts(),Ts.ThemeManager=Ts(),Ts.ModelManager=Ts();const Es=e=>{const t=_s(F.none()),o=()=>t.get().each((e=>clearInterval(e)));return{clear:()=>{o(),t.set(F.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:n=>{o(),t.set(F.some(setInterval(n,e)))}}},Os=()=>{const e=(e=>{const t=_s(F.none()),o=()=>t.get().each(e);return{clear:()=>{o(),t.set(F.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{o(),t.set(F.some(e))}}})(S);return{...e,on:t=>e.get().each(t)}},As=(e,t)=>{let o=null;return{cancel:()=>{v(o)||(clearTimeout(o),o=null)},throttle:(...n)=>{v(o)&&(o=setTimeout((()=>{o=null,e.apply(null,n)}),t))}}},Ms=(e,t)=>{let o=null;const n=()=>{v(o)||(clearTimeout(o),o=null)};return{cancel:n,throttle:(...r)=>{n(),o=setTimeout((()=>{o=null,e.apply(null,r)}),t)}}},Bs=O("mce-annotation"),Ps=O("data-mce-annotation"),Rs=O("data-mce-annotation-uid"),Vs=O("data-mce-annotation-active"),Ns=O("data-mce-annotation-classes"),Ds=O("data-mce-annotation-attrs"),Fs=e=>t=>bo(t,e),Is=(e,t)=>{const o=e.selection.getRng(),n=mo(o.startContainer),r=mo(e.getBody()),i=t.fold((()=>"."+Bs()),(e=>`[${Ps()}="${e}"]`)),s=Bo(n,o.startOffset).getOr(n);return En(s,i,Fs(r)).bind((t=>Gt(t,`${Rs()}`).bind((o=>Gt(t,`${Ps()}`).map((t=>{const n=zs(e,o);return{uid:o,name:t,elements:n}}))))))},Ls=(e,t)=>Yt(e,"data-mce-bogus")||On(e,'[data-mce-bogus="all"]',Fs(t)),zs=(e,t)=>{const o=mo(e.getBody()),n=rr(o,`[${Rs()}="${t}"]`);return G(n,(e=>!Ls(e,o)))},Hs=(e,t)=>{const o=mo(e.getBody()),n=rr(o,`[${Ps()}="${t}"]`),r={};return $(n,(e=>{if(!Ls(e,o)){const t=qt(e,Rs()),o=xe(r,t).getOr([]);r[t]=o.concat([e])}})),r};let Zs=0;const js=e=>{const t=(new Date).getTime(),o=Math.floor(1e9*Math.random());return Zs++,e+"_"+o+Zs+String(t)},Us=(e,t)=>mo(e.dom.cloneNode(t)),$s=e=>Us(e,!1),Ws=e=>Us(e,!0),qs=(e,t,o=N)=>{const n=new An(e,t),r=e=>{let t;do{t=n[e]()}while(t&&!Hn(t)&&!o(t));return F.from(t).filter(Hn)};return{current:()=>F.from(n.current()).filter(Hn),next:()=>r("next"),prev:()=>r("prev"),prev2:()=>r("prev2")}},Gs=(e,t)=>{const o=t||(t=>e.isBlock(t)||qn(t)||Xn(t)),n=(e,t,o,r)=>{if(Hn(e)){const o=r(e,t,e.data);if(-1!==o)return F.some({container:e,offset:o})}return o().bind((e=>n(e.container,e.offset,o,r)))};return{backwards:(t,r,i,s)=>{const a=qs(t,null!=s?s:e.getRoot(),o);return n(t,r,(()=>a.prev().map((e=>({container:e,offset:e.length})))),i).getOrNull()},forwards:(t,r,i,s)=>{const a=qs(t,null!=s?s:e.getRoot(),o);return n(t,r,(()=>a.next().map((e=>({container:e,offset:0})))),i).getOrNull()}}},Ys=Math.round,Xs=e=>e?{left:Ys(e.left),top:Ys(e.top),bottom:Ys(e.bottom),right:Ys(e.right),width:Ys(e.width),height:Ys(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0},Ks=(e,t)=>(e=Xs(e),t||(e.left=e.left+e.width),e.right=e.left,e.width=0,e),Js=(e,t,o)=>e>=0&&e<=Math.min(t.height,o.height)/2,Qs=(e,t)=>{const o=Math.min(t.height/2,e.height/2);return e.bottom-o<t.top||!(e.top>t.bottom)&&Js(t.top-e.bottom,e,t)},ea=(e,t)=>e.top>t.bottom||!(e.bottom<t.top)&&Js(t.bottom-e.top,e,t),ta=(e,t,o)=>{const n=Math.max(Math.min(t,e.left+e.width),e.left),r=Math.max(Math.min(o,e.top+e.height),e.top);return Math.sqrt((t-n)*(t-n)+(o-r)*(o-r))},oa=e=>{const t=e.startContainer,o=e.startOffset;return t===e.endContainer&&t.hasChildNodes()&&e.endOffset===o+1?t.childNodes[o]:null},na=(e,t)=>{if(Pn(e)&&e.hasChildNodes()){const o=e.childNodes,n=((e,t,o)=>Math.min(Math.max(e,0),o))(t,0,o.length-1);return o[n]}return e},ra=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿‌-‍⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),ia=e=>m(e)&&e.charCodeAt(0)>=768&&ra.test(e),sa=Pn,aa=qr,la=Nn("display","block table"),ca=Nn("float","left right"),da=((...e)=>t=>{for(let o=0;o<e.length;o++)if(!e[o](t))return!1;return!0})(sa,aa,P(ca)),ua=P(Nn("white-space","pre pre-line pre-wrap")),ha=Hn,ma=qn,pa=bs.nodeIndex,ga=(e,t)=>t<0&&Pn(e)&&e.hasChildNodes()?void 0:na(e,t),fa=e=>e?e.createRange():bs.DOM.createRng(),va=e=>m(e)&&/[\r\n\t ]/.test(e),ba=e=>!!e.setStart&&!!e.setEnd,ya=e=>{const t=e.startContainer,o=e.startOffset;if(va(e.toString())&&ua(t.parentNode)&&Hn(t)){const e=t.data;if(va(e[o-1])||va(e[o+1]))return!0}return!1},wa=e=>0===e.left&&0===e.right&&0===e.top&&0===e.bottom,_a=e=>{var t;let o;const n=e.getClientRects();return o=n.length>0?Xs(n[0]):Xs(e.getBoundingClientRect()),!ba(e)&&ma(e)&&wa(o)?(e=>{const t=e.ownerDocument,o=fa(t),n=t.createTextNode(or),r=e.parentNode;r.insertBefore(n,e),o.setStart(n,0),o.setEnd(n,1);const i=Xs(o.getBoundingClientRect());return r.removeChild(n),i})(e):wa(o)&&ba(e)&&null!==(t=(e=>{const t=e.startContainer,o=e.endContainer,n=e.startOffset,r=e.endOffset;if(t===o&&Hn(o)&&0===n&&1===r){const t=e.cloneRange();return t.setEndAfter(o),_a(t)}return null})(e))&&void 0!==t?t:o},xa=(e,t)=>{const o=Ks(e,t);return o.width=1,o.right=o.left+1,o},Ca=(e,t,o)=>{const n=()=>(o||(o=(e=>{const t=[],o=e=>{var o,n;0!==e.height&&(t.length>0&&(o=e,n=t[t.length-1],o.left===n.left&&o.top===n.top&&o.bottom===n.bottom&&o.right===n.right)||t.push(e))},n=(e,t)=>{const n=fa(e.ownerDocument);if(t<e.data.length){if(ia(e.data[t]))return;if(ia(e.data[t-1])&&(n.setStart(e,t),n.setEnd(e,t+1),!ya(n)))return void o(xa(_a(n),!1))}t>0&&(n.setStart(e,t-1),n.setEnd(e,t),ya(n)||o(xa(_a(n),!1))),t<e.data.length&&(n.setStart(e,t),n.setEnd(e,t+1),ya(n)||o(xa(_a(n),!0)))},r=e.container(),i=e.offset();if(ha(r))return n(r,i),t;if(sa(r))if(e.isAtEnd()){const e=ga(r,i);ha(e)&&n(e,e.data.length),da(e)&&!ma(e)&&o(xa(_a(e),!1))}else{const s=ga(r,i);if(ha(s)&&n(s,0),da(s)&&e.isAtEnd())return o(xa(_a(s),!1)),t;const a=ga(e.container(),e.offset()-1);da(a)&&!ma(a)&&(la(a)||la(s)||!da(s))&&o(xa(_a(a),!1)),da(s)&&o(xa(_a(s),!0))}return t})(Ca(e,t))),o);return{container:O(e),offset:O(t),toRange:()=>{const o=fa(e.ownerDocument);return o.setStart(e,t),o.setEnd(e,t),o},getClientRects:n,isVisible:()=>n().length>0,isAtStart:()=>(ha(e),0===t),isAtEnd:()=>ha(e)?t>=e.data.length:t>=e.childNodes.length,isEqual:o=>o&&e===o.container()&&t===o.offset(),getNode:o=>ga(e,o?t-1:t)}};Ca.fromRangeStart=e=>Ca(e.startContainer,e.startOffset),Ca.fromRangeEnd=e=>Ca(e.endContainer,e.endOffset),Ca.after=e=>Ca(e.parentNode,pa(e)+1),Ca.before=e=>Ca(e.parentNode,pa(e)),Ca.isAbove=(e,t)=>Vt(le(t.getClientRects()),ce(e.getClientRects()),Qs).getOr(!1),Ca.isBelow=(e,t)=>Vt(ce(t.getClientRects()),le(e.getClientRects()),ea).getOr(!1),Ca.isAtStart=e=>!!e&&e.isAtStart(),Ca.isAtEnd=e=>!!e&&e.isAtEnd(),Ca.isTextPosition=e=>!!e&&Hn(e.container()),Ca.isElementPosition=e=>!Ca.isTextPosition(e);const ka=(e,t)=>{Hn(t)&&0===t.data.length&&e.remove(t)},Sa=(e,t,o)=>{Wn(o)?((e,t,o)=>{const n=F.from(o.firstChild),r=F.from(o.lastChild);t.insertNode(o),n.each((t=>ka(e,t.previousSibling))),r.each((t=>ka(e,t.nextSibling)))})(e,t,o):((e,t,o)=>{t.insertNode(o),ka(e,o.previousSibling),ka(e,o.nextSibling)})(e,t,o)},Ta=Hn,Ea=Fn,Oa=bs.nodeIndex,Aa=e=>{const t=e.parentNode;return Ea(t)?Aa(t):t},Ma=e=>e?Be(e.childNodes,((e,t)=>(Ea(t)&&"BR"!==t.nodeName?e=e.concat(Ma(t)):e.push(t),e)),[]):[],Ba=e=>t=>e===t,Pa=e=>(Ta(e)?"text()":e.nodeName.toLowerCase())+"["+(e=>{let t,o;t=Ma(Aa(e)),o=Pe(t,Ba(e),e),t=t.slice(0,o+1);const n=Be(t,((e,o,n)=>(Ta(o)&&Ta(t[n-1])&&e++,e)),0);return t=Me(t,Vn([e.nodeName])),o=Pe(t,Ba(e),e),o-n})(e)+"]",Ra=(e,t)=>{let o,n=[],r=t.container(),i=t.offset();if(Ta(r))o=((e,t)=>{let o=e;for(;(o=o.previousSibling)&&Ta(o);)t+=o.data.length;return t})(r,i);else{const e=r.childNodes;i>=e.length?(o="after",i=e.length-1):o="before",r=e[i]}n.push(Pa(r));let s=((e,t,o)=>{const n=[];for(let o=t.parentNode;o&&o!==e;o=o.parentNode)n.push(o);return n})(e,r);return s=Me(s,P(Fn)),n=n.concat(Ae(s,(e=>Pa(e)))),n.reverse().join("/")+","+o},Va=(e,t)=>{if(!t)return null;const o=t.split(","),n=o[0].split("/"),r=o.length>1?o[1]:"before",i=Be(n,((e,t)=>{const o=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t);return o?("text()"===o[1]&&(o[1]="#text"),((e,t,o)=>{let n=Ma(e);return n=Me(n,((e,t)=>!Ta(e)||!Ta(n[t-1]))),n=Me(n,Vn([t])),n[o]})(e,o[1],parseInt(o[2],10))):null}),e);if(!i)return null;if(!Ta(i)&&i.parentNode){let e;return e="after"===r?Oa(i)+1:Oa(i),Ca(i.parentNode,e)}return((e,t)=>{let o=e,n=0;for(;Ta(o);){const r=o.data.length;if(t>=n&&t<=n+r){e=o,t-=n;break}if(!Ta(o.nextSibling)){e=o,t=r;break}n+=r,o=o.nextSibling}return Ta(e)&&t>e.data.length&&(t=e.data.length),Ca(e,t)})(i,parseInt(r,10))},Na=Xn,Da=(e,t,o,n,r)=>{const i=r?n.startContainer:n.endContainer;let s=r?n.startOffset:n.endOffset;const a=[],l=e.getRoot();if(Hn(i))a.push(o?((e,t,o)=>{let n=e(t.data.slice(0,o)).length;for(let o=t.previousSibling;o&&Hn(o);o=o.previousSibling)n+=e(o.data).length;return n})(t,i,s):s);else{let t=0;const n=i.childNodes;s>=n.length&&n.length&&(t=1,s=Math.max(0,n.length-1)),a.push(e.nodeIndex(n[s],o)+t)}for(let t=i;t&&t!==l;t=t.parentNode)a.push(e.nodeIndex(t,o));return a},Fa=(e,t,o)=>{let n=0;return Pt.each(e.select(t),(e=>"all"===e.getAttribute("data-mce-bogus")?void 0:e!==o&&void n++)),n},Ia=(e,t)=>{let o=t?e.startContainer:e.endContainer,n=t?e.startOffset:e.endOffset;if(Pn(o)&&"TR"===o.nodeName){const r=o.childNodes;o=r[Math.min(t?n:n-1,r.length-1)],o&&(n=t?0:o.childNodes.length,t?e.setStart(o,n):e.setEnd(o,n))}},La=e=>(Ia(e,!0),Ia(e,!1),e),za=(e,t)=>{if(Pn(e)&&(e=na(e,t),Na(e)))return e;if(Br(e)){Hn(e)&&Ar(e)&&(e=e.parentNode);let t=e.previousSibling;if(Na(t))return t;if(t=e.nextSibling,Na(t))return t}},Ha=(e,t,o)=>{const n=o.getNode(),r=o.getRng();if("IMG"===n.nodeName||Na(n)){const e=n.nodeName;return{name:e,index:Fa(o.dom,e,n)}}const i=(e=>za(e.startContainer,e.startOffset)||za(e.endContainer,e.endOffset))(r);if(i){const e=i.tagName;return{name:e,index:Fa(o.dom,e,i)}}return((e,t,o,n)=>{const r=t.dom,i=Da(r,e,o,n,!0),s=t.isForward(),a=Ir(n)?{isFakeCaret:!0}:{};return t.isCollapsed()?{start:i,forward:s,...a}:{start:i,end:Da(r,e,o,n,!1),forward:s,...a}})(e,o,t,r)},Za=(e,t,o)=>{const n={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return o?e.create("span",n,"&#xFEFF;"):e.create("span",n)},ja=(e,t)=>{const o=e.dom;let n=e.getRng();const r=o.uniqueId(),i=e.isCollapsed(),s=e.getNode(),a=s.nodeName,l=e.isForward();if("IMG"===a)return{name:a,index:Fa(o,a,s)};const c=La(n.cloneRange());if(!i){c.collapse(!1);const e=Za(o,r+"_end",t);Sa(o,c,e)}n=La(n),n.collapse(!0);const d=Za(o,r+"_start",t);return Sa(o,n,d),e.moveToBookmark({id:r,keep:!0,forward:l}),{id:r,forward:l}},Ua=B(Ha,A,!0),$a=e=>{const t=t=>t(e),o=O(e),n=()=>r,r={tag:!0,inner:e,fold:(t,o)=>o(e),isValue:D,isError:N,map:t=>qa.value(t(e)),mapError:n,bind:t,exists:t,forall:t,getOr:o,or:n,getOrThunk:o,orThunk:n,getOrDie:o,each:t=>{t(e)},toOptional:()=>F.some(e)};return r},Wa=e=>{const t=()=>o,o={tag:!1,inner:e,fold:(t,o)=>t(e),isValue:N,isError:D,map:t,mapError:t=>qa.error(t(e)),bind:t,exists:N,forall:D,getOr:A,or:A,getOrThunk:R,orThunk:R,getOrDie:(n=String(e),()=>{throw new Error(n)}),each:S,toOptional:F.none};var n;return o},qa={value:$a,error:Wa,fromOption:(e,t)=>e.fold((()=>Wa(t)),$a)},Ga=e=>{if(!f(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");const t=[],o={};return $(e,((n,r)=>{const i=he(n);if(1!==i.length)throw new Error("one and only one name per case");const s=i[0],a=n[s];if(void 0!==o[s])throw new Error("duplicate key detected:"+s);if("cata"===s)throw new Error("cannot have a case named cata (sorry)");if(!f(a))throw new Error("case arguments must be an array");t.push(s),o[s]=(...o)=>{const n=o.length;if(n!==a.length)throw new Error("Wrong number of arguments to case "+s+". Expected "+a.length+" ("+a+"), got "+n);return{fold:(...t)=>{if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);return t[r].apply(null,o)},match:e=>{const n=he(e);if(t.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","));if(!oe(t,(e=>Z(n,e))))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "));return e[s].apply(null,o)},log:e=>{console.log(e,{constructors:t,constructor:s,params:o})}}}})),o};Ga([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const Ya=e=>"inline-command"===e.type||"inline-format"===e.type,Xa=e=>"block-command"===e.type||"block-format"===e.type,Ka=e=>{const t=t=>qa.error({message:t,pattern:e}),o=(o,n,r)=>{if(void 0!==e.format){let r;if(f(e.format)){if(!oe(e.format,m))return t(o+" pattern has non-string items in the `format` array");r=e.format}else{if(!m(e.format))return t(o+" pattern has non-string `format` parameter");r=[e.format]}return qa.value(n(r))}return void 0!==e.cmd?m(e.cmd)?qa.value(r(e.cmd,e.value)):t(o+" pattern has non-string `cmd` parameter"):t(o+" pattern is missing both `format` and `cmd` parameters")};if(!p(e))return t("Raw pattern is not an object");if(!m(e.start))return t("Raw pattern is missing `start` parameter");if(void 0!==e.end){if(!m(e.end))return t("Inline pattern has non-string `end` parameter");if(0===e.start.length&&0===e.end.length)return t("Inline pattern has empty `start` and `end` parameters");let n=e.start,r=e.end;return 0===r.length&&(r=n,n=""),o("Inline",(e=>({type:"inline-format",start:n,end:r,format:e})),((e,t)=>({type:"inline-command",start:n,end:r,cmd:e,value:t})))}return void 0!==e.replacement?m(e.replacement)?0===e.start.length?t("Replacement pattern has empty `start` parameter"):qa.value({type:"inline-command",start:"",end:e.start,cmd:"mceInsertContent",value:e.replacement}):t("Replacement pattern has non-string `replacement` parameter"):0===e.start.length?t("Block pattern has empty `start` parameter"):o("Block",(t=>({type:"block-format",start:e.start,format:t[0]})),((t,o)=>({type:"block-command",start:e.start,cmd:t,value:o})))},Ja=e=>G(e,Xa),Qa=e=>G(e,Ya),el=e=>{const t=(e=>{const t=[],o=[];return $(e,(e=>{e.fold((e=>{t.push(e)}),(e=>{o.push(e)}))})),{errors:t,values:o}})(U(e,Ka));return $(t.errors,(e=>console.error(e.message,e.pattern))),t.values},tl=_t().deviceType,ol=tl.isTouch(),nl=bs.DOM,rl=e=>h(e,RegExp),il=e=>t=>t.options.get(e),sl=e=>m(e)||p(e),al=(e,t="")=>o=>{const n=m(o);if(n){if(-1!==o.indexOf("=")){const r=(e=>{const t=e.indexOf("=")>0?e.split(/[;,](?![^=;,]*(?:[;,]|$))/):e.split(",");return X(t,((e,t)=>{const o=t.split("="),n=o[0],r=o.length>1?o[1]:n;return e[Ue(n)]=Ue(r),e}),{})})(o);return{value:xe(r,e.id).getOr(t),valid:n}}return{value:o,valid:n}}return{valid:!1,message:"Must be a string."}},ll=il("iframe_attrs"),cl=il("doctype"),dl=il("document_base_url"),ul=il("body_id"),hl=il("body_class"),ml=il("content_security_policy"),pl=il("br_in_pre"),gl=il("forced_root_block"),fl=il("forced_root_block_attrs"),vl=il("newline_behavior"),bl=il("br_newline_selector"),yl=il("no_newline_selector"),wl=il("keep_styles"),_l=il("end_container_on_empty_block"),xl=il("automatic_uploads"),Cl=il("images_reuse_filename"),kl=il("images_replace_blob_uris"),Sl=il("icons"),Tl=il("icons_url"),El=il("images_upload_url"),Ol=il("images_upload_base_path"),Al=il("images_upload_credentials"),Ml=il("images_upload_handler"),Bl=il("content_css_cors"),Pl=il("referrer_policy"),Rl=il("language"),Vl=il("language_url"),Nl=il("indent_use_margin"),Dl=il("indentation"),Fl=il("content_css"),Il=il("content_style"),Ll=il("font_css"),zl=il("directionality"),Hl=il("inline_boundaries_selector"),Zl=il("object_resizing"),jl=il("resize_img_proportional"),Ul=il("placeholder"),$l=il("event_root"),Wl=il("service_message"),ql=il("theme"),Gl=il("theme_url"),Yl=il("model"),Xl=il("model_url"),Kl=il("inline_boundaries"),Jl=il("formats"),Ql=il("preview_styles"),ec=il("format_empty_lines"),tc=il("format_noneditable_selector"),oc=il("custom_ui_selector"),nc=il("inline"),rc=il("hidden_input"),ic=il("submit_patch"),sc=il("add_form_submit_trigger"),ac=il("add_unload_trigger"),lc=il("custom_undo_redo_levels"),cc=il("disable_nodechange"),dc=il("readonly"),uc=il("content_css_cors"),hc=il("plugins"),mc=il("external_plugins"),pc=il("block_unsupported_drop"),gc=il("visual"),fc=il("visual_table_class"),vc=il("visual_anchor_class"),bc=il("iframe_aria_text"),yc=il("setup"),wc=il("init_instance_callback"),_c=il("urlconverter_callback"),xc=il("auto_focus"),Cc=il("browser_spellcheck"),kc=il("protect"),Sc=il("paste_block_drop"),Tc=il("paste_data_images"),Ec=il("paste_preprocess"),Oc=il("paste_postprocess"),Ac=il("paste_webkit_styles"),Mc=il("paste_remove_styles_if_webkit"),Bc=il("paste_merge_formats"),Pc=il("smart_paste"),Rc=il("paste_as_text"),Vc=il("paste_tab_spaces"),Nc=il("allow_html_data_urls"),Dc=il("text_patterns"),Fc=il("text_patterns_lookup"),Ic=il("noneditable_class"),Lc=il("editable_class"),zc=il("noneditable_regexp"),Hc=il("preserve_cdata"),Zc=e=>Pt.explode(e.options.get("images_file_types")),jc=il("table_tab_navigation"),Uc=Pn,$c=Hn,Wc=e=>{const t=e.parentNode;t&&t.removeChild(e)},qc=e=>{const t=Tr(e);return{count:e.length-t.length,text:t}},Gc=e=>{let t;for(;-1!==(t=e.data.lastIndexOf(kr));)e.deleteData(t,1)},Yc=(e,t)=>(Kc(e),t),Xc=(e,t)=>Ca.isTextPosition(t)?((e,t)=>$c(e)&&t.container()===e?((e,t)=>{const o=qc(e.data.substr(0,t.offset())),n=qc(e.data.substr(t.offset()));return(o.text+n.text).length>0?(Gc(e),Ca(e,t.offset()-o.count)):t})(e,t):Yc(e,t))(e,t):((e,t)=>t.container()===e.parentNode?((e,t)=>{const o=t.container(),n=((e,t)=>{const o=H(e,t);return-1===o?F.none():F.some(o)})(de(o.childNodes),e).map((e=>e<t.offset()?Ca(o,t.offset()-1):t)).getOr(t);return Kc(e),n})(e,t):Yc(e,t))(e,t),Kc=e=>{Uc(e)&&Br(e)&&(Pr(e)?e.removeAttribute("data-mce-caret"):Wc(e)),$c(e)&&(Gc(e),0===e.data.length&&Wc(e))},Jc=Xn,Qc=Qn,ed=Kn,td=(e,t,o)=>{const n=Ks(t.getBoundingClientRect(),o);let r,i;if("BODY"===e.tagName){const t=e.ownerDocument.documentElement;r=e.scrollLeft||t.scrollLeft,i=e.scrollTop||t.scrollTop}else{const t=e.getBoundingClientRect();r=e.scrollLeft-t.left,i=e.scrollTop-t.top}n.left+=r,n.right+=r,n.top+=i,n.bottom+=i,n.width=1;let s=t.offsetWidth-t.clientWidth;return s>0&&(o&&(s*=-1),n.left+=s,n.right+=s),n},od=(e,t,o,n)=>{const r=Os();let i,s;const a=gl(e),l=e.dom,c=()=>{(e=>{var t,o;const n=rr(mo(e),"*[contentEditable=false],video,audio,embed,object");for(let e=0;e<n.length;e++){const r=n[e].dom;let i=r.previousSibling;if(Dr(i)){const e=i.data;1===e.length?null===(t=i.parentNode)||void 0===t||t.removeChild(i):i.deleteData(e.length-1,1)}i=r.nextSibling,Nr(i)&&(1===i.data.length?null===(o=i.parentNode)||void 0===o||o.removeChild(i):i.deleteData(0,1))}})(t),s&&(Kc(s),s=null),r.on((e=>{l.remove(e.caret),r.clear()})),i&&(clearInterval(i),i=void 0)};return{show:(e,d)=>{let u;if(c(),ed(d))return null;if(!o(d))return s=((e,t)=>{var o;const n=(null!==(o=e.ownerDocument)&&void 0!==o?o:document).createTextNode(kr),r=e.parentNode;if(t){const t=e.previousSibling;if(Or(t)){if(Br(t))return t;if(Dr(t))return t.splitText(t.data.length-1)}null==r||r.insertBefore(n,e)}else{const t=e.nextSibling;if(Or(t)){if(Br(t))return t;if(Nr(t))return t.splitText(1),t}e.nextSibling?null==r||r.insertBefore(n,e.nextSibling):null==r||r.appendChild(n)}return n})(d,e),u=d.ownerDocument.createRange(),rd(s.nextSibling)?(u.setStart(s,0),u.setEnd(s,0)):(u.setStart(s,1),u.setEnd(s,1)),u;{const o=((e,t,o)=>{var n;const r=(null!==(n=t.ownerDocument)&&void 0!==n?n:document).createElement(e);r.setAttribute("data-mce-caret",o?"before":"after"),r.setAttribute("data-mce-bogus","all"),r.appendChild(_r().dom);const i=t.parentNode;return o?null==i||i.insertBefore(r,t):t.nextSibling?null==i||i.insertBefore(r,t.nextSibling):null==i||i.appendChild(r),r})(a,d,e),c=td(t,d,e);l.setStyle(o,"top",c.top),s=o;const h=l.create("div",{class:"mce-visual-caret","data-mce-bogus":"all"});l.setStyles(h,{...c}),l.add(t,h),r.set({caret:h,element:d,before:e}),e&&l.addClass(h,"mce-visual-caret-before"),i=setInterval((()=>{r.on((e=>{n()?l.toggleClass(e.caret,"mce-visual-caret-hidden"):l.addClass(e.caret,"mce-visual-caret-hidden")}))}),500),u=d.ownerDocument.createRange(),u.setStart(o,0),u.setEnd(o,0)}return u},hide:c,getCss:()=>".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}",reposition:()=>{r.on((e=>{const o=td(t,e.element,e.before);l.setStyles(e.caret,{...o})}))},destroy:()=>clearInterval(i)}},nd=()=>Ot.browser.isFirefox(),rd=e=>Jc(e)||Qc(e),id=e=>rd(e)||In(e)&&nd(),sd=Yn,ad=Xn,ld=Qn,cd=Nn("display","block table table-cell table-caption list-item"),dd=Br,ud=Ar,hd=Pn,md=Hn,pd=qr,gd=e=>e>0,fd=e=>e<0,vd=(e,t)=>{let o;for(;o=e(t);)if(!ud(o))return o;return null},bd=(e,t,o,n,r)=>{const i=new An(e,n),s=ad(e)||ud(e);let a;if(fd(t)){if(s&&(a=vd(i.prev.bind(i),!0),o(a)))return a;for(;a=vd(i.prev.bind(i),r);)if(o(a))return a}if(gd(t)){if(s&&(a=vd(i.next.bind(i),!0),o(a)))return a;for(;a=vd(i.next.bind(i),r);)if(o(a))return a}return null},yd=(e,t)=>{for(;e&&e!==t;){if(cd(e))return e;e=e.parentNode}return null},wd=(e,t,o)=>yd(e.container(),o)===yd(t.container(),o),_d=(e,t)=>{if(!t)return F.none();const o=t.container(),n=t.offset();return hd(o)?F.from(o.childNodes[n+e]):F.none()},xd=(e,t)=>{var o;const n=(null!==(o=t.ownerDocument)&&void 0!==o?o:document).createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n},Cd=(e,t,o)=>yd(t,e)===yd(o,e),kd=(e,t,o)=>{const n=e?"previousSibling":"nextSibling";let r=o;for(;r&&r!==t;){let e=r[n];if(e&&dd(e)&&(e=e[n]),ad(e)||ld(e)){if(Cd(t,e,r))return e;break}if(pd(e))break;r=r.parentNode}return null},Sd=B(xd,!0),Td=B(xd,!1),Ed=(e,t,o)=>{let n;const r=B(kd,!0,t),i=B(kd,!1,t),s=o.startContainer,a=o.startOffset;if(Ar(s)){const e=md(s)?s.parentNode:s,t=e.getAttribute("data-mce-caret");if("before"===t&&(n=e.nextSibling,id(n)))return Sd(n);if("after"===t&&(n=e.previousSibling,id(n)))return Td(n)}if(!o.collapsed)return o;if(Hn(s)){if(dd(s)){if(1===e){if(n=i(s),n)return Sd(n);if(n=r(s),n)return Td(n)}if(-1===e){if(n=r(s),n)return Td(n);if(n=i(s),n)return Sd(n)}return o}if(Dr(s)&&a>=s.data.length-1)return 1===e&&(n=i(s),n)?Sd(n):o;if(Nr(s)&&a<=1)return-1===e&&(n=r(s),n)?Td(n):o;if(a===s.data.length)return n=i(s),n?Sd(n):o;if(0===a)return n=r(s),n?Td(n):o}return o},Od=(e,t)=>_d(e?0:-1,t).filter(ad),Ad=(e,t,o)=>{const n=Ed(e,t,o);return-1===e?Ca.fromRangeStart(n):Ca.fromRangeEnd(n)},Md=e=>F.from(e.getNode()).map(mo),Bd=(e,t)=>{let o=t;for(;o=e(o);)if(o.isVisible())return o;return o},Pd=(e,t)=>{const o=wd(e,t);return!(o||!qn(e.getNode()))||o};var Rd;!function(e){e[e.Backwards=-1]="Backwards",e[e.Forwards=1]="Forwards"}(Rd||(Rd={}));const Vd=Xn,Nd=Hn,Dd=Pn,Fd=qn,Id=qr,Ld=e=>Ur(e)||(e=>!!Gr(e)&&!X(de(e.getElementsByTagName("*")),((e,t)=>e||Lr(t)),!1))(e),zd=Yr,Hd=(e,t)=>e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null,Zd=(e,t)=>{if(gd(e)){if(Id(t.previousSibling)&&!Nd(t.previousSibling))return Ca.before(t);if(Nd(t))return Ca(t,0)}if(fd(e)){if(Id(t.nextSibling)&&!Nd(t.nextSibling))return Ca.after(t);if(Nd(t))return Ca(t,t.data.length)}return fd(e)?Fd(t)?Ca.before(t):Ca.after(t):Ca.before(t)},jd=(e,t,o)=>{let n,r,i,s;if(!Dd(o)||!t)return null;if(t.isEqual(Ca.after(o))&&o.lastChild){if(s=Ca.after(o.lastChild),fd(e)&&Id(o.lastChild)&&Dd(o.lastChild))return Fd(o.lastChild)?Ca.before(o.lastChild):s}else s=t;const a=s.container();let l=s.offset();if(Nd(a)){if(fd(e)&&l>0)return Ca(a,--l);if(gd(e)&&l<a.length)return Ca(a,++l);n=a}else{if(fd(e)&&l>0&&(r=Hd(a,l-1),Id(r)))return!Ld(r)&&(i=bd(r,e,zd,r),i)?Nd(i)?Ca(i,i.data.length):Ca.after(i):Nd(r)?Ca(r,r.data.length):Ca.before(r);if(gd(e)&&l<a.childNodes.length&&(r=Hd(a,l),Id(r)))return Fd(r)?((e,t)=>{const o=t.nextSibling;return o&&Id(o)?Nd(o)?Ca(o,0):Ca.before(o):jd(Rd.Forwards,Ca.after(t),e)})(o,r):!Ld(r)&&(i=bd(r,e,zd,r),i)?Nd(i)?Ca(i,0):Ca.before(i):Nd(r)?Ca(r,0):Ca.after(r);n=r||s.getNode()}if(n&&(gd(e)&&s.isAtEnd()||fd(e)&&s.isAtStart())&&(n=bd(n,e,D,o,!0),zd(n,o)))return Zd(e,n);r=n?bd(n,e,zd,o):n;const c=Re(G(((e,t)=>{const o=[];let n=e;for(;n&&n!==t;)o.push(n),n=n.parentNode;return o})(a,o),Vd));return!c||r&&c.contains(r)?r?Zd(e,r):null:(s=gd(e)?Ca.after(c):Ca.before(c),s)},Ud=e=>({next:t=>jd(Rd.Forwards,t,e),prev:t=>jd(Rd.Backwards,t,e)}),$d=e=>Ca.isTextPosition(e)?0===e.offset():qr(e.getNode()),Wd=e=>{if(Ca.isTextPosition(e)){const t=e.container();return e.offset()===t.data.length}return qr(e.getNode(!0))},qd=(e,t)=>!Ca.isTextPosition(e)&&!Ca.isTextPosition(t)&&e.getNode()===t.getNode(!0),Gd=(e,t,o)=>{const n=Ud(t);return F.from(e?n.next(o):n.prev(o))},Yd=(e,t,o)=>Gd(e,t,o).bind((n=>wd(o,n,t)&&((e,t,o)=>{return e?!qd(t,o)&&(n=t,!(!Ca.isTextPosition(n)&&qn(n.getNode())))&&Wd(t)&&$d(o):!qd(o,t)&&$d(t)&&Wd(o);var n})(e,o,n)?Gd(e,t,n):F.some(n))),Xd=(e,t,o,n)=>Yd(e,t,o).bind((o=>n(o)?Xd(e,t,o,n):F.some(o))),Kd=(e,t)=>{const o=e?t.firstChild:t.lastChild;return Hn(o)?F.some(Ca(o,e?0:o.data.length)):o?qr(o)?F.some(e?Ca.before(o):qn(n=o)?Ca.before(n):Ca.after(n)):((e,t,o)=>{const n=e?Ca.before(o):Ca.after(o);return Gd(e,t,n)})(e,t,o):F.none();var n},Jd=B(Gd,!0),Qd=B(Gd,!1),eu=B(Kd,!0),tu=B(Kd,!1),ou="_mce_caret",nu=e=>Pn(e)&&e.id===ou,ru=(e,t)=>{let o=t;for(;o&&o!==e;){if(nu(o))return o;o=o.parentNode}return null},iu=e=>Ce(e,"name"),su=e=>Pt.isArray(e.start),au=e=>!(!iu(e)&&b(e.forward))||e.forward,lu=(e,t)=>(Pn(t)&&e.isBlock(t)&&!t.innerHTML&&(t.innerHTML='<br data-mce-bogus="1" />'),t),cu=(e,t)=>tu(e).fold(N,(e=>(t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0))),du=(e,t,o)=>!(!(e=>!e.hasChildNodes())(t)||!ru(e,t)||(((e,t)=>{var o;const n=(null!==(o=e.ownerDocument)&&void 0!==o?o:document).createTextNode(kr);e.appendChild(n),t.setStart(n,0),t.setEnd(n,0)})(t,o),0)),uu=(e,t,o,n)=>{const r=o[t?"start":"end"],i=e.getRoot();if(r){let e=i,o=r[0];for(let t=r.length-1;e&&t>=1;t--){const o=e.childNodes;if(du(i,e,n))return!0;if(r[t]>o.length-1)return!!du(i,e,n)||cu(e,n);e=o[r[t]]}Hn(e)&&(o=Math.min(r[0],e.data.length)),Pn(e)&&(o=Math.min(r[0],e.childNodes.length)),t?n.setStart(e,o):n.setEnd(e,o)}return!0},hu=e=>Hn(e)&&e.data.length>0,mu=(e,t,o)=>{const n=e.get(o.id+"_"+t),r=null==n?void 0:n.parentNode,i=o.keep;if(n&&r){let s,a;if("start"===t?i?n.hasChildNodes()?(s=n.firstChild,a=1):hu(n.nextSibling)?(s=n.nextSibling,a=0):hu(n.previousSibling)?(s=n.previousSibling,a=n.previousSibling.data.length):(s=r,a=e.nodeIndex(n)+1):(s=r,a=e.nodeIndex(n)):i?n.hasChildNodes()?(s=n.firstChild,a=1):hu(n.previousSibling)?(s=n.previousSibling,a=n.previousSibling.data.length):(s=r,a=e.nodeIndex(n)):(s=r,a=e.nodeIndex(n)),!i){const r=n.previousSibling,i=n.nextSibling;let l;for(Pt.each(Pt.grep(n.childNodes),(e=>{Hn(e)&&(e.data=e.data.replace(/\uFEFF/g,""))}));l=e.get(o.id+"_"+t);)e.remove(l,!0);if(Hn(i)&&Hn(r)&&!Ot.browser.isOpera()){const t=r.data.length;r.appendData(i.data),e.remove(i),s=r,a=t}}return F.some(Ca(s,a))}return F.none()},pu=(e,t,o)=>((e,t,o=!1)=>2===t?Ha(Tr,o,e):3===t?(e=>{const t=e.getRng();return{start:Ra(e.dom.getRoot(),Ca.fromRangeStart(t)),end:Ra(e.dom.getRoot(),Ca.fromRangeEnd(t)),forward:e.isForward()}})(e):t?(e=>({rng:e.getRng(),forward:e.isForward()}))(e):ja(e,!1))(e,t,o),gu=(e,t)=>{((e,t)=>{const o=e.dom;if(t){if(su(t))return((e,t)=>{const o=e.createRng();return uu(e,!0,t,o)&&uu(e,!1,t,o)?F.some({range:o,forward:au(t)}):F.none()})(o,t);if((e=>m(e.start))(t))return((e,t)=>{const o=F.from(Va(e.getRoot(),t.start)),n=F.from(Va(e.getRoot(),t.end));return Vt(o,n,((o,n)=>{const r=e.createRng();return r.setStart(o.container(),o.offset()),r.setEnd(n.container(),n.offset()),{range:r,forward:au(t)}}))})(o,t);if((e=>Ce(e,"id"))(t))return((e,t)=>{const o=mu(e,"start",t),n=mu(e,"end",t);return Vt(o,n.or(o),((o,n)=>{const r=e.createRng();return r.setStart(lu(e,o.container()),o.offset()),r.setEnd(lu(e,n.container()),n.offset()),{range:r,forward:au(t)}}))})(o,t);if(iu(t))return((e,t)=>F.from(e.select(t.name)[t.index]).map((t=>{const o=e.createRng();return o.selectNode(t),{range:o,forward:!0}})))(o,t);if((e=>Ce(e,"rng"))(t))return F.some({range:t.rng,forward:au(t)})}return F.none()})(e,t).each((({range:t,forward:o})=>{e.setRng(t,o)}))},fu=e=>Pn(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type"),vu=(bu=or,e=>bu===e);var bu;const yu=e=>""!==e&&-1!==" \f\n\r\t\v".indexOf(e),wu=e=>!yu(e)&&!vu(e)&&!nr(e),_u=e=>{const t=e.toString(16);return(1===t.length?"0"+t:t).toUpperCase()},xu=e=>(e=>({value:e}))(_u(e.red)+_u(e.green)+_u(e.blue)),Cu=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,ku=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,Su=(e,t,o,n)=>({red:e,green:t,blue:o,alpha:n}),Tu=(e,t,o,n)=>{const r=parseInt(e,10),i=parseInt(t,10),s=parseInt(o,10),a=parseFloat(n);return Su(r,i,s,a)},Eu=e=>(e=>{if("transparent"===e)return F.some(Su(0,0,0,0));const t=Cu.exec(e);if(null!==t)return F.some(Tu(t[1],t[2],t[3],"1"));const o=ku.exec(e);return null!==o?F.some(Tu(o[1],o[2],o[3],o[4])):F.none()})(e).map(xu).map((e=>"#"+e.value)).getOr(e),Ou=e=>{const t=[];if(e)for(let o=0;o<e.rangeCount;o++)t.push(e.getRangeAt(o));return t},Au=(e,t)=>{const o=rr(t,"td[data-mce-selected],th[data-mce-selected]");return o.length>0?o:(e=>G((e=>te(e,(e=>{const t=oa(e);return t?[mo(t)]:[]})))(e),vr))(e)},Mu=e=>Au(Ou(e.selection.getSel()),mo(e.getBody())),Bu=(e,t)=>Sn(e,"table",t),Pu=e=>Po(e).fold(O([e]),(t=>[e].concat(Pu(t)))),Ru=e=>Ro(e).fold(O([e]),(t=>"br"===Dt(t)?To(t).map((t=>[e].concat(Ru(t)))).getOr([]):[e].concat(Ru(t)))),Vu=(e,t)=>Vt((e=>{const t=e.startContainer,o=e.startOffset;return Hn(t)?0===o?F.some(mo(t)):F.none():F.from(t.childNodes[o]).map(mo)})(t),(e=>{const t=e.endContainer,o=e.endOffset;return Hn(t)?o===t.data.length?F.some(mo(t)):F.none():F.from(t.childNodes[o-1]).map(mo)})(t),((t,o)=>{const n=J(Pu(e),B(bo,t)),r=J(Ru(e),B(bo,o));return n.isSome()&&r.isSome()})).getOr(!1),Nu=(e,t,o,n)=>{const r=o,i=new An(o,r),s=ye(e.schema.getMoveCaretBeforeOnEnterElements(),((e,t)=>!Z(["td","th","table"],t.toLowerCase())));let a=o;do{if(Hn(a)&&0!==Pt.trim(a.data).length)return void(n?t.setStart(a,0):t.setEnd(a,a.data.length));if(s[a.nodeName])return void(n?t.setStartBefore(a):"BR"===a.nodeName?t.setEndBefore(a):t.setEndAfter(a))}while(a=n?i.next():i.prev());"BODY"===r.nodeName&&(n?t.setStart(r,0):t.setEnd(r,r.childNodes.length))},Du=e=>{const t=e.selection.getSel();return _(t)&&t.rangeCount>0},Fu=(e,t)=>{const o=Mu(e);o.length>0?$(o,(o=>{const n=o.dom,r=e.dom.createRng();r.setStartBefore(n),r.setEndAfter(n),t(r,!0)})):t(e.selection.getRng(),!1)},Iu=(e,t,o)=>{const n=ja(e,t);o(n),e.moveToBookmark(n)},Lu=e=>C(null==e?void 0:e.nodeType),zu=e=>Pn(e)&&!fu(e)&&!nu(e)&&!Fn(e),Hu=e=>!0===e.isContentEditable,Zu=(e,t,o)=>{const{selection:n,dom:r}=e,i=n.getNode(),s=Xn(i);Iu(n,!0,(()=>{t()})),s&&Xn(i)&&r.isChildOf(i,e.getBody())?e.selection.select(i):o(n.getStart())&&ju(r,n)},ju=(e,t)=>{var o,n;const r=t.getRng(),{startContainer:i,startOffset:s}=r;if(!((e,t)=>{if(zu(t)&&!/^(TD|TH)$/.test(t.nodeName)){const o=e.getAttrib(t,"data-mce-selected"),n=parseInt(o,10);return!isNaN(n)&&n>0}return!1})(e,t.getNode())&&Pn(i)){const a=i.childNodes,l=e.getRoot();let c;if(s<a.length){const t=a[s];c=new An(t,null!==(o=e.getParent(t,e.isBlock))&&void 0!==o?o:l)}else{const t=a[a.length-1];c=new An(t,null!==(n=e.getParent(t,e.isBlock))&&void 0!==n?n:l),c.next(!0)}for(let o=c.current();o;o=c.next()){if("false"===e.getContentEditable(o))return;if(Hn(o)&&!qu(o))return r.setStart(o,0),void t.setRng(r)}}},Uu=(e,t,o)=>{if(e){const n=t?"nextSibling":"previousSibling";for(e=o?e:e[n];e;e=e[n])if(Pn(e)||!qu(e))return e}},$u=(e,t)=>!!e.getTextBlockElements()[t.nodeName.toLowerCase()]||fi(e,t),Wu=(e,t,o)=>e.schema.isValidChild(t,o),qu=(e,t=!1)=>{if(_(e)&&Hn(e)){const o=t?e.data.replace(/ /g," "):e.data;return Kr(o)}return!1},Gu=(e,t)=>{const o=e.dom;return zu(t)&&"false"===o.getContentEditable(t)&&((e,t)=>{const o="[data-mce-cef-wrappable]",n=tc(e),r=Ge(n)?o:`${o},${n}`;return fo(mo(t),r)})(e,t)&&0===o.select('[contenteditable="true"]',t).length},Yu=(e,t)=>x(e)?e(t):(_(t)&&(e=e.replace(/%(\w+)/g,((e,o)=>t[o]||e))),e),Xu=(e,t)=>(t=t||"",e=""+((e=e||"").nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()===t.toLowerCase()),Ku=(e,t)=>{if(w(e))return null;{let o=String(e);return"color"!==t&&"backgroundColor"!==t||(o=Eu(o)),"fontWeight"===t&&700===e&&(o="bold"),"fontFamily"===t&&(o=o.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),o}},Ju=(e,t,o)=>{const n=e.getStyle(t,o);return Ku(n,o)},Qu=(e,t)=>{let o;return e.getParent(t,(t=>!!Pn(t)&&(o=e.getStyle(t,"text-decoration"),!!o&&"none"!==o))),o},eh=(e,t,o)=>e.getParents(t,o,e.getRoot()),th=(e,t,o)=>{const n=e.formatter.get(t);return _(n)&&j(n,o)},oh=e=>ke(e,"block"),nh=e=>ke(e,"selector"),rh=e=>ke(e,"inline"),ih=e=>nh(e)&&!1!==e.expand&&!rh(e),sh=fu,ah=eh,lh=qu,ch=$u,dh=(e,t)=>{let o=t;for(;o;){if(Pn(o)&&e.getContentEditable(o))return"false"===e.getContentEditable(o)?o:t;o=o.parentNode}return t},uh=(e,t,o,n)=>{const r=t.data;if(e){for(let e=o;e>0;e--)if(n(r.charAt(e-1)))return e}else for(let e=o;e<r.length;e++)if(n(r.charAt(e)))return e;return-1},hh=(e,t,o)=>uh(e,t,o,(e=>vu(e)||yu(e))),mh=(e,t,o)=>uh(e,t,o,wu),ph=(e,t,o,n,r,i)=>{let s;const a=e.getParent(o,e.isBlock)||t,l=(t,o,n)=>{const i=Gs(e),l=r?i.backwards:i.forwards;return F.from(l(t,o,((e,t)=>sh(e.parentNode)?-1:(s=e,n(r,e,t))),a))};return l(o,n,hh).bind((e=>i?l(e.container,e.offset+(r?-1:0),mh):F.some(e))).orThunk((()=>s?F.some({container:s,offset:r?0:s.length}):F.none()))},gh=(e,t,o,n,r)=>{const i=n[r];Hn(n)&&Ge(n.data)&&i&&(n=i);const s=ah(e,n);for(let n=0;n<s.length;n++)for(let r=0;r<t.length;r++){const i=t[r];if((!_(i.collapsed)||i.collapsed===o.collapsed)&&nh(i)&&e.is(s[n],i.selector))return s[n]}return n},fh=(e,t,o,n)=>{var r;let i=o;const s=e.getRoot(),a=t[0];if(oh(a)&&(i=a.wrapper?null:e.getParent(o,a.block,s)),!i){const t=null!==(r=e.getParent(o,"LI,TD,TH"))&&void 0!==r?r:s;i=e.getParent(Hn(o)?o.parentNode:o,(t=>t!==s&&ch(e.schema,t)),t)}if(i&&oh(a)&&a.wrapper&&(i=ah(e,i,"ul,ol").reverse()[0]||i),!i)for(i=o;i&&i[n]&&!e.isBlock(i[n])&&(i=i[n],!Xu(i,"br")););return i||o},vh=(e,t,o,n)=>{const r=o.parentNode;return!_(o[n])&&(!(r!==t&&!w(r)&&!e.isBlock(r))||vh(e,t,r,n))},bh=(e,t,o,n,r)=>{let i=o;const s=r?"previousSibling":"nextSibling",a=e.getRoot();if(Hn(o)&&!lh(o)&&(r?n>0:n<o.data.length))return o;for(;i;){if(!t[0].block_expand&&e.isBlock(i))return i;for(let t=i[s];t;t=t[s]){const o=Hn(t)&&!vh(e,a,t,s);if(!sh(t)&&(!qn(l=t)||!l.getAttribute("data-mce-bogus")||l.nextSibling)&&!lh(t,o))return i}if(i===a||i.parentNode===a){o=i;break}i=i.parentNode}var l;return o},yh=e=>sh(e.parentNode)||sh(e),wh=(e,t,o,n=!1)=>{let{startContainer:r,startOffset:i,endContainer:s,endOffset:a}=t;const l=o[0];return Pn(r)&&r.hasChildNodes()&&(r=na(r,i),Hn(r)&&(i=0)),Pn(s)&&s.hasChildNodes()&&(s=na(s,t.collapsed?a:a-1),Hn(s)&&(a=s.data.length)),r=dh(e,r),s=dh(e,s),yh(r)&&(r=sh(r)?r:r.parentNode,r=t.collapsed?r.previousSibling||r:r.nextSibling||r,Hn(r)&&(i=t.collapsed?r.length:0)),yh(s)&&(s=sh(s)?s:s.parentNode,s=t.collapsed?s.nextSibling||s:s.previousSibling||s,Hn(s)&&(a=t.collapsed?0:s.length)),t.collapsed&&(ph(e,e.getRoot(),r,i,!0,n).each((({container:e,offset:t})=>{r=e,i=t})),ph(e,e.getRoot(),s,a,!1,n).each((({container:e,offset:t})=>{s=e,a=t}))),(rh(l)||l.block_expand)&&(rh(l)&&Hn(r)&&0!==i||(r=bh(e,o,r,i,!0)),rh(l)&&Hn(s)&&a!==s.data.length||(s=bh(e,o,s,a,!1))),ih(l)&&(r=gh(e,o,t,r,"previousSibling"),s=gh(e,o,t,s,"nextSibling")),(oh(l)||nh(l))&&(r=fh(e,o,r,"previousSibling"),s=fh(e,o,s,"nextSibling"),oh(l)&&(e.isBlock(r)||(r=bh(e,o,r,i,!0)),e.isBlock(s)||(s=bh(e,o,s,a,!1)))),Pn(r)&&r.parentNode&&(i=e.nodeIndex(r),r=r.parentNode),Pn(s)&&s.parentNode&&(a=e.nodeIndex(s)+1,s=s.parentNode),{startContainer:r,startOffset:i,endContainer:s,endOffset:a}},_h=(e,t,o)=>{var n;const r=t.startOffset,i=na(t.startContainer,r),s=t.endOffset,a=na(t.endContainer,s-1),l=e=>{const t=e[0];Hn(t)&&t===i&&r>=t.data.length&&e.splice(0,1);const o=e[e.length-1];return 0===s&&e.length>0&&o===a&&Hn(o)&&e.splice(e.length-1,1),e},c=(e,t,o)=>{const n=[];for(;e&&e!==o;e=e[t])n.push(e);return n},d=(t,o)=>e.getParent(t,(e=>e.parentNode===o),o),u=(e,t,n)=>{const r=n?"nextSibling":"previousSibling";for(let i=e,s=i.parentNode;i&&i!==t;i=s){s=i.parentNode;const t=c(i===e?i:i[r],r);t.length&&(n||t.reverse(),o(l(t)))}};if(i===a)return o(l([i]));const h=null!==(n=e.findCommonAncestor(i,a))&&void 0!==n?n:e.getRoot();if(e.isChildOf(i,a))return u(i,h,!0);if(e.isChildOf(a,i))return u(a,h);const m=d(i,h)||i,p=d(a,h)||a;u(i,m,!0);const g=c(m===i?m:m.nextSibling,"nextSibling",p===a?p.nextSibling:p);g.length&&o(l(g)),u(a,p)},xh=['pre[class*=language-][contenteditable="false"]',"figure.image","div[data-ephox-embed-iri]","div.tiny-pageembed","div.mce-toc","div[data-mce-toc]"],Ch=(e,t,o,n,r,i)=>{const{uid:s=t,...a}=o;no(e,Bs()),$t(e,`${Rs()}`,s),$t(e,`${Ps()}`,n);const{attributes:l={},classes:c=[]}=r(s,a);if(Wt(e,l),((e,t)=>{$(t,(t=>{no(e,t)}))})(e,c),i){c.length>0&&$t(e,`${Ns()}`,c.join(","));const t=he(l);t.length>0&&$t(e,`${Ds()}`,t.join(","))}},kh=(e,t,o,n,r)=>{const i=uo("span",e);return Ch(i,t,o,n,r,!1),i},Sh=(e,t,o,n,r,i)=>{const s=[],a=kh(e.getDoc(),o,i,n,r),l=Os(),c=()=>{l.clear()},d=e=>{$(e,u)},u=t=>{switch(((e,t,o,n)=>Co(t).fold((()=>"skipping"),(r=>"br"===n||(e=>zt(e)&&sr(e)===kr)(t)?"valid":(e=>Lt(e)&&so(e,Bs()))(t)?"existing":nu(t.dom)?"caret":j(xh,(e=>fo(t,e)))?"valid-block":Wu(e,o,n)&&Wu(e,Dt(r),o)?"valid":"invalid-child")))(e,t,"span",Dt(t))){case"invalid-child":{c();const e=Mo(t);d(e),c();break}case"valid-block":c(),Ch(t,o,i,n,r,!0);break;case"valid":{const e=l.get().getOrThunk((()=>{const e=$s(a);return s.push(e),l.set(e),e}));((e,t)=>{Jo(e,t),tn(t,e)})(t,e);break}}};return _h(e.dom,t,(e=>{c(),(e=>{const t=U(e,mo);d(t)})(e)})),s},Th=e=>{const t=(()=>{const e={};return{register:(t,o)=>{e[t]={name:t,settings:o}},lookup:t=>xe(e,t).map((e=>e.settings)),getNames:()=>he(e)}})();((e,t)=>{const o=Ps(),n=e=>F.from(e.attr(o)).bind(t.lookup),r=e=>{var t,o;e.attr(Rs(),null),e.attr(Ps(),null),e.attr(Vs(),null);const n=F.from(e.attr(Ds())).map((e=>e.split(","))).getOr([]),r=F.from(e.attr(Ns())).map((e=>e.split(","))).getOr([]);$(n,(t=>e.attr(t,null)));const i=null!==(o=null===(t=e.attr("class"))||void 0===t?void 0:t.split(" "))&&void 0!==o?o:[],s=re(i,[Bs()].concat(r));e.attr("class",s.length>0?s.join(" "):null),e.attr(Ns(),null),e.attr(Ds(),null)};e.serializer.addTempAttr(Vs()),e.serializer.addAttributeFilter(o,(e=>{for(const t of e)n(t).each((e=>{!1===e.persistent&&("span"===t.name?t.unwrap():r(t))}))}))})(e,t);const o=((e,t)=>{const o=_s({}),n=()=>({listeners:[],previous:Os()}),r=(e,t)=>{i(e,(e=>(t(e),e)))},i=(e,t)=>{const r=o.get(),i=t(xe(r,e).getOrThunk(n));r[e]=i,o.set(r)},s=(t,o)=>{$(zs(e,t),(e=>{o?$t(e,Vs(),"true"):Xt(e,Vs())}))},a=Ms((()=>{const o=se(t.getNames());$(o,(t=>{i(t,(o=>{const n=o.previous.get();return Is(e,F.some(t)).fold((()=>{n.each((e=>{(e=>{r(e,(t=>{$(t.listeners,(t=>t(!1,e)))}))})(t),o.previous.clear(),s(e,!1)}))}),(({uid:e,name:t,elements:i})=>{Rt(n,e)||(n.each((e=>s(e,!1))),((e,t,o)=>{r(e,(n=>{$(n.listeners,(n=>n(!0,e,{uid:t,nodes:U(o,(e=>e.dom))})))}))})(t,e,i),o.previous.set(e),s(e,!0))})),{previous:o.previous,listeners:o.listeners}}))}))}),30);return e.on("remove",(()=>{a.cancel()})),e.on("NodeChange",(()=>{a.throttle()})),{addListener:(e,t)=>{i(e,(e=>({previous:e.previous,listeners:e.listeners.concat([t])})))}}})(e,t),n=jt("span"),r=e=>{$(e,(e=>{n(e)?sn(e):(e=>{io(e,Bs()),Xt(e,`${Rs()}`),Xt(e,`${Ps()}`),Xt(e,`${Vs()}`);const t=Gt(e,`${Ds()}`).map((e=>e.split(","))).getOr([]),o=Gt(e,`${Ns()}`).map((e=>e.split(","))).getOr([]);var n;$(t,(t=>Xt(e,t))),n=e,$(o,(e=>{io(n,e)})),Xt(e,`${Ns()}`),Xt(e,`${Ds()}`)})(e)}))};return{register:(e,o)=>{t.register(e,o)},annotate:(o,n)=>{t.lookup(o).each((t=>{((e,t,o,n)=>{e.undoManager.transact((()=>{const r=e.selection,i=r.getRng(),s=Mu(e).length>0,a=js("mce-annotation");if(i.collapsed&&!s&&((e,t)=>{const o=wh(e.dom,t,[{inline:"span"}]);t.setStart(o.startContainer,o.startOffset),t.setEnd(o.endContainer,o.endOffset),e.selection.setRng(t)})(e,i),r.getRng().collapsed&&!s){const i=kh(e.getDoc(),a,n,t,o.decorate);cn(i,or),r.getRng().insertNode(i.dom),r.select(i.dom)}else Iu(r,!1,(()=>{Fu(e,(r=>{Sh(e,r,a,t,o.decorate,n)}))}))}))})(e,o,t,n)}))},annotationChanged:(e,t)=>{o.addListener(e,t)},remove:t=>{const o=e.selection.getBookmark();Is(e,F.some(t)).each((({elements:e})=>{r(e)})),e.selection.moveToBookmark(o)},removeAll:t=>{const o=e.selection.getBookmark();pe(Hs(e,t),((e,t)=>{r(e)})),e.selection.moveToBookmark(o)},getAll:t=>{const o=Hs(e,t);return ge(o,(e=>U(e,(e=>e.dom))))}}},Eh=e=>({getBookmark:B(pu,e),moveToBookmark:B(gu,e)});Eh.isBookmarkNode=fu;const Oh=(e,t,o)=>!o.collapsed&&j(o.getClientRects(),(o=>((e,t,o)=>t>=e.left&&t<=e.right&&o>=e.top&&o<=e.bottom)(o,e,t))),Ah=(e,t,o)=>{e.dispatch(t,o)},Mh=(e,t,o,n)=>{e.dispatch("FormatApply",{format:t,node:o,vars:n})},Bh=(e,t,o,n)=>{e.dispatch("FormatRemove",{format:t,node:o,vars:n})},Ph=(e,t)=>e.dispatch("SetContent",t),Rh=(e,t)=>e.dispatch("GetContent",t),Vh=(e,t)=>e.dispatch("PastePlainTextToggle",{state:t}),Nh={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,ESC:27,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,modifierPressed:e=>e.shiftKey||e.ctrlKey||e.altKey||Nh.metaKeyPressed(e),metaKeyPressed:e=>Ot.os.isMacOS()||Ot.os.isiOS()?e.metaKey:e.ctrlKey&&!e.altKey},Dh="data-mce-selected",Fh=Math.abs,Ih=Math.round,Lh={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},zh=(e,t)=>{const o=t.dom,n=t.getDoc(),r=document,i=t.getBody();let s,a,l,c,d,u,h,m,p,g,f,v,b,y,w;const x=e=>_(e)&&(Gn(e)||o.is(e,"figure.image")),C=e=>Qn(e)||o.hasClass(e,"mce-preview-object"),k=e=>{const o=e.target;((e,t)=>{if((e=>"longpress"===e.type||0===e.type.indexOf("touch"))(e)){const o=e.touches[0];return x(e.target)&&!Oh(o.clientX,o.clientY,t)}return x(e.target)&&!Oh(e.clientX,e.clientY,t)})(e,t.selection.getRng())&&!e.isDefaultPrevented()&&t.selection.select(o)},S=e=>o.hasClass(e,"mce-preview-object")&&_(e.firstElementChild)?[e,e.firstElementChild]:o.is(e,"figure.image")?[e.querySelector("img")]:[e],T=e=>{const n=Zl(t);return!!n&&"false"!==e.getAttribute("data-mce-resize")&&e!==t.getBody()&&(o.hasClass(e,"mce-preview-object")&&_(e.firstElementChild)?fo(mo(e.firstElementChild),n):fo(mo(e),n))},E=(e,n,r)=>{if(_(r)){const i=S(e);$(i,(e=>{e.style[n]||!t.schema.isValid(e.nodeName.toLowerCase(),n)?o.setStyle(e,n,r):o.setAttrib(e,n,""+r)}))}},O=(e,t,o)=>{E(e,"width",t),E(e,"height",o)},A=e=>{let n,r,d,_,k;n=e.screenX-u,r=e.screenY-h,v=n*c[2]+m,b=r*c[3]+p,v=v<5?5:v,b=b<5?5:b,d=(x(s)||C(s))&&!1!==jl(t)?!Nh.modifierPressed(e):Nh.modifierPressed(e),d&&(Fh(n)>Fh(r)?(b=Ih(v*g),v=Ih(b/g)):(v=Ih(b/g),b=Ih(v*g))),O(a,v,b),_=c.startPos.x+n,k=c.startPos.y+r,_=_>0?_:0,k=k>0?k:0,o.setStyles(l,{left:_,top:k,display:"block"}),l.innerHTML=v+" &times; "+b,c[2]<0&&a.clientWidth<=v&&o.setStyle(a,"left",void 0+(m-v)),c[3]<0&&a.clientHeight<=b&&o.setStyle(a,"top",void 0+(p-b)),n=i.scrollWidth-y,r=i.scrollHeight-w,n+r!==0&&o.setStyles(l,{left:_-n,top:k-r}),f||(((e,t,o,n,r)=>{e.dispatch("ObjectResizeStart",{target:t,width:o,height:n,origin:r})})(t,s,m,p,"corner-"+c.name),f=!0)},M=()=>{const e=f;f=!1,e&&(E(s,"width",v),E(s,"height",b)),o.unbind(n,"mousemove",A),o.unbind(n,"mouseup",M),r!==n&&(o.unbind(r,"mousemove",A),o.unbind(r,"mouseup",M)),o.remove(a),o.remove(l),o.remove(d),B(s),e&&(((e,t,o,n,r)=>{e.dispatch("ObjectResized",{target:t,width:o,height:n,origin:r})})(t,s,v,b,"corner-"+c.name),o.setAttrib(s,"style",o.getAttrib(s,"style"))),t.nodeChanged()},B=e=>{D();const f=o.getPos(e,i),_=f.x,x=f.y,k=e.getBoundingClientRect(),E=k.width||k.right-k.left,B=k.height||k.bottom-k.top;s!==e&&(R(),s=e,v=b=0);const P=t.dispatch("ObjectSelected",{target:e});T(e)&&!P.isDefaultPrevented()?pe(Lh,((e,t)=>{let f=o.get("mceResizeHandle"+t);f&&o.remove(f),f=o.add(i,"div",{id:"mceResizeHandle"+t,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+t+"-resize; margin:0; padding:0"}),o.bind(f,"mousedown",(f=>{f.stopImmediatePropagation(),f.preventDefault(),(f=>{const v=S(s)[0];var b;u=f.screenX,h=f.screenY,m=v.clientWidth,p=v.clientHeight,g=p/m,c=e,c.name=t,c.startPos={x:E*e[0]+_,y:B*e[1]+x},y=i.scrollWidth,w=i.scrollHeight,d=o.add(i,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),o.setStyles(d,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),a=C(b=s)?o.create("img",{src:Ot.transparentSrc}):b.cloneNode(!0),o.addClass(a,"mce-clonedresizable"),o.setAttrib(a,"data-mce-bogus","all"),a.contentEditable="false",o.setStyles(a,{left:_,top:x,margin:0}),O(a,E,B),a.removeAttribute(Dh),i.appendChild(a),o.bind(n,"mousemove",A),o.bind(n,"mouseup",M),r!==n&&(o.bind(r,"mousemove",A),o.bind(r,"mouseup",M)),l=o.add(i,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},m+" &times; "+p)})(f)})),e.elm=f,o.setStyles(f,{left:E*e[0]+_-f.offsetWidth/2,top:B*e[1]+x-f.offsetHeight/2})})):R(!1)},P=As(B,0),R=(e=!0)=>{P.cancel(),D(),s&&e&&s.removeAttribute(Dh),pe(Lh,((e,t)=>{const n=o.get("mceResizeHandle"+t);n&&(o.unbind(n),o.remove(n))}))},V=(e,t)=>o.isChildOf(e,t),N=n=>{if(f||t.removed||t.composing)return;const r="mousedown"===n.type?n.target:e.getNode(),s=En(mo(r),"table,img,figure.image,hr,video,span.mce-preview-object").map((e=>e.dom)).getOrUndefined(),a=_(s)?o.getAttrib(s,Dh,"1"):"1";if($(o.select(`img[${Dh}],hr[${Dh}]`),(e=>{e.removeAttribute(Dh)})),_(s)&&V(s,i)){F();const t=e.getStart(!0);if(V(t,s)&&V(e.getEnd(!0),s))return o.setAttrib(s,Dh,a),void P.throttle(s)}R()},D=()=>{pe(Lh,(e=>{e.elm&&(o.unbind(e.elm),delete e.elm)}))},F=()=>{try{t.getDoc().execCommand("enableObjectResizing",!1,"false")}catch(e){}};return t.on("init",(()=>{F(),t.on("NodeChange ResizeEditor ResizeWindow ResizeContent drop",N),t.on("keyup compositionend",(e=>{s&&"TABLE"===s.nodeName&&N(e)})),t.on("hide blur",R),t.on("contextmenu longpress",k,!0)})),t.on("remove",D),{isResizable:T,showResizeRect:B,hideResizeRect:R,updateResizeRect:N,destroy:()=>{P.cancel(),s=a=d=null}}},Hh=(e,t,o)=>{const n=e.document.createRange();var r;return r=n,t.fold((e=>{r.setStartBefore(e.dom)}),((e,t)=>{r.setStart(e.dom,t)}),(e=>{r.setStartAfter(e.dom)})),((e,t)=>{t.fold((t=>{e.setEndBefore(t.dom)}),((t,o)=>{e.setEnd(t.dom,o)}),(t=>{e.setEndAfter(t.dom)}))})(n,o),n},Zh=(e,t,o,n,r)=>{const i=e.document.createRange();return i.setStart(t.dom,o),i.setEnd(n.dom,r),i},jh=Ga([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Uh=(e,t,o)=>t(mo(o.startContainer),o.startOffset,mo(o.endContainer),o.endOffset);jh.ltr,jh.rtl;const $h=(e,t,o,n)=>({start:e,soffset:t,finish:o,foffset:n}),Wh=document.caretPositionFromPoint?(e,t,o)=>{var n,r;return F.from(null===(r=(n=e.dom).caretPositionFromPoint)||void 0===r?void 0:r.call(n,t,o)).bind((t=>{if(null===t.offsetNode)return F.none();const o=e.dom.createRange();return o.setStart(t.offsetNode,t.offset),o.collapse(),F.some(o)}))}:document.caretRangeFromPoint?(e,t,o)=>{var n,r;return F.from(null===(r=(n=e.dom).caretRangeFromPoint)||void 0===r?void 0:r.call(n,t,o))}:F.none,qh=Ga([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Gh={before:qh.before,on:qh.on,after:qh.after,cata:(e,t,o,n)=>e.fold(t,o,n),getStart:e=>e.fold(A,A,A)},Yh=Ga([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Xh={domRange:Yh.domRange,relative:Yh.relative,exact:Yh.exact,exactFromRange:e=>Yh.exact(e.start,e.soffset,e.finish,e.foffset),getWin:e=>{const t=(e=>e.match({domRange:e=>mo(e.startContainer),relative:(e,t)=>Gh.getStart(e),exact:(e,t,o,n)=>e}))(e);return xo(t)},range:$h},Kh=(e,t)=>{const o=Dt(e);return"input"===o?Gh.after(e):Z(["br","img"],o)?0===t?Gh.before(e):Gh.after(e):Gh.on(e,t)},Jh=(e,t)=>{const o=e.fold(Gh.before,Kh,Gh.after),n=t.fold(Gh.before,Kh,Gh.after);return Xh.relative(o,n)},Qh=(e,t,o,n)=>{const r=Kh(e,t),i=Kh(o,n);return Xh.relative(r,i)},em=(e,t)=>{const o=(t||document).createDocumentFragment();return $(e,(e=>{o.appendChild(e.dom)})),mo(o)},tm=e=>{const t=Xh.getWin(e).dom,o=(e,o,n,r)=>Zh(t,e,o,n,r),n=(e=>e.match({domRange:e=>{const t=mo(e.startContainer),o=mo(e.endContainer);return Qh(t,e.startOffset,o,e.endOffset)},relative:Jh,exact:Qh}))(e);return((e,t)=>{const o=((e,t)=>t.match({domRange:e=>({ltr:O(e),rtl:F.none}),relative:(t,o)=>({ltr:Ve((()=>Hh(e,t,o))),rtl:Ve((()=>F.some(Hh(e,o,t))))}),exact:(t,o,n,r)=>({ltr:Ve((()=>Zh(e,t,o,n,r))),rtl:Ve((()=>F.some(Zh(e,n,r,t,o))))})}))(e,t);return((e,t)=>{const o=t.ltr();return o.collapsed?t.rtl().filter((e=>!1===e.collapsed)).map((e=>jh.rtl(mo(e.endContainer),e.endOffset,mo(e.startContainer),e.startOffset))).getOrThunk((()=>Uh(0,jh.ltr,o))):Uh(0,jh.ltr,o)})(0,o)})(t,n).match({ltr:o,rtl:o})},om=(e,t,o)=>((e,t,o)=>((e,t,o)=>{const n=mo(e.document);return Wh(n,t,o).map((e=>$h(mo(e.startContainer),e.startOffset,mo(e.endContainer),e.endOffset)))})(e,t,o))(xo(mo(o)).dom,e,t).map((e=>{const t=o.createRange();return t.setStart(e.start.dom,e.soffset),t.setEnd(e.finish.dom,e.foffset),t})).getOrUndefined(),nm=(e,t)=>_(e)&&_(t)&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset,rm=(e,t,o)=>null!==((e,t,o)=>{let n=e;for(;n&&n!==t;){if(o(n))return n;n=n.parentNode}return null})(e,t,o),im=(e,t,o)=>rm(e,t,(e=>e.nodeName===o)),sm=(e,t)=>Br(e)&&!rm(e,t,nu),am=(e,t,o)=>{const n=t.parentNode;if(n){const r=new An(t,e.getParent(n,e.isBlock)||e.getRoot());let i;for(;i=r[o?"prev":"next"]();)if(qn(i))return!0}return!1},lm=(e,t,o,n,r)=>{const i=e.getRoot(),s=e.schema.getNonEmptyElements(),a=r.parentNode;let l,c;if(!a)return F.none();const d=e.getParent(a,e.isBlock)||i;if(n&&qn(r)&&t&&e.isEmpty(d))return F.some(Ca(a,e.nodeIndex(r)));const u=new An(r,d);for(;c=u[n?"prev":"next"]();){if("false"===e.getContentEditableParent(c)||sm(c,i))return F.none();if(Hn(c)&&c.data.length>0)return im(c,i,"A")?F.none():F.some(Ca(c,n?c.data.length:0));if(e.isBlock(c)||s[c.nodeName.toLowerCase()])return F.none();l=c}return Un(l)?F.none():o&&l?F.some(Ca(l,0)):F.none()},cm=(e,t,o,n)=>{const r=e.getRoot();let i,s=!1,a=o?n.startContainer:n.endContainer,l=o?n.startOffset:n.endOffset;const c=Pn(a)&&l===a.childNodes.length,d=e.schema.getNonEmptyElements();let u=o;if(Br(a))return F.none();if(Pn(a)&&l>a.childNodes.length-1&&(u=!1),$n(a)&&(a=r,l=0),a===r){if(u&&(i=a.childNodes[l>0?l-1:0],i)){if(Br(i))return F.none();if(d[i.nodeName]||In(i))return F.none()}if(a.hasChildNodes()){if(l=Math.min(!u&&l>0?l-1:l,a.childNodes.length-1),a=a.childNodes[l],l=Hn(a)&&c?a.data.length:0,!t&&a===r.lastChild&&In(a))return F.none();if(((e,t)=>{let o=t;for(;o&&o!==e;){if(Xn(o))return!0;o=o.parentNode}return!1})(r,a)||Br(a))return F.none();if(a.hasChildNodes()&&!In(a)){i=a;const t=new An(a,r);do{if(Xn(i)||Br(i)){s=!1;break}if(Hn(i)&&i.data.length>0){l=u?0:i.data.length,a=i,s=!0;break}if(d[i.nodeName.toLowerCase()]&&!Jn(i)){l=e.nodeIndex(i),a=i.parentNode,u||l++,s=!0;break}}while(i=u?t.next():t.prev())}}}return t&&(Hn(a)&&0===l&&lm(e,c,t,!0,a).each((e=>{a=e.container(),l=e.offset(),s=!0})),Pn(a)&&(i=a.childNodes[l],i||(i=a.childNodes[l-1]),!i||!qn(i)||((e,t)=>{var o;return"A"===(null===(o=e.previousSibling)||void 0===o?void 0:o.nodeName)})(i)||am(e,i,!1)||am(e,i,!0)||lm(e,c,t,!0,i).each((e=>{a=e.container(),l=e.offset(),s=!0})))),u&&!t&&Hn(a)&&l===a.data.length&&lm(e,c,t,!1,a).each((e=>{a=e.container(),l=e.offset(),s=!0})),s&&a?F.some(Ca(a,l)):F.none()},dm=(e,t)=>{const o=t.collapsed,n=t.cloneRange(),r=Ca.fromRangeStart(t);return cm(e,o,!0,n).each((e=>{o&&Ca.isAbove(r,e)||n.setStart(e.container(),e.offset())})),o||cm(e,o,!1,n).each((e=>{n.setEnd(e.container(),e.offset())})),o&&n.collapse(!0),nm(t,n)?F.none():F.some(n)},um=(e,t)=>e.splitText(t),hm=e=>{let t=e.startContainer,o=e.startOffset,n=e.endContainer,r=e.endOffset;if(t===n&&Hn(t)){if(o>0&&o<t.data.length)if(n=um(t,o),t=n.previousSibling,r>o){r-=o;const e=um(n,r).previousSibling;t=n=e,r=e.data.length,o=0}else r=0}else if(Hn(t)&&o>0&&o<t.data.length&&(t=um(t,o),o=0),Hn(n)&&r>0&&r<n.data.length){const e=um(n,r).previousSibling;n=e,r=e.data.length}return{startContainer:t,startOffset:o,endContainer:n,endOffset:r}},mm=e=>({walk:(t,o)=>_h(e,t,o),split:hm,expand:(t,o={type:"word"})=>{if("word"===o.type){const o=wh(e,t,[{inline:"span"}]),n=e.createRng();return n.setStart(o.startContainer,o.startOffset),n.setEnd(o.endContainer,o.endOffset),n}return t},normalize:t=>dm(e,t).fold(N,(e=>(t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0)))});mm.compareRanges=nm,mm.getCaretRangeFromPoint=om,mm.getSelectedNode=oa,mm.getNode=na;const pm=((e,t)=>{const o=t=>{const o=(e=>{const t=e.dom;return jo(e)?t.getBoundingClientRect().height:t.offsetHeight})(t);if(o<=0||null===o){const o=qo(t,e);return parseFloat(o)||0}return o},n=(e,t)=>X(t,((t,o)=>{const n=qo(e,o),r=void 0===n?0:parseInt(n,10);return isNaN(r)?t:t+r}),0);return{set:(t,o)=>{if(!C(o)&&!o.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+o);const n=t.dom;ao(n)&&(n.style[e]=o+"px")},get:o,getOuter:o,aggregate:n,max:(e,t,o)=>{const r=n(e,o);return t>r?t-r:0}}})("height"),gm=()=>mo(document),fm=(e,t)=>e.view(t).fold(O([]),(t=>{const o=e.owner(t),n=fm(e,o);return[t].concat(n)}));var vm=Object.freeze({__proto__:null,view:e=>{var t;return(e.dom===document?F.none():F.from(null===(t=e.dom.defaultView)||void 0===t?void 0:t.frameElement)).map(mo)},owner:e=>_o(e)});const bm=e=>"textarea"===Dt(e),ym=(e,t)=>{const o=(e=>{const t=e.dom.ownerDocument,o=t.body,n=t.defaultView,r=t.documentElement;if(o===e.dom)return mn(o.offsetLeft,o.offsetTop);const i=pn(null==n?void 0:n.pageYOffset,r.scrollTop),s=pn(null==n?void 0:n.pageXOffset,r.scrollLeft),a=pn(r.clientTop,o.clientTop),l=pn(r.clientLeft,o.clientLeft);return gn(e).translate(s-l,i-a)})(e),n=(e=>pm.get(e))(e);return{element:e,bottom:o.top+n,height:n,pos:o,cleanup:t}},wm=(e,t,o,n)=>{km(e,((r,i)=>xm(e,t,o,n)),o)},_m=(e,t,o,n,r)=>{const i={elm:n.element.dom,alignToTop:r};((e,t)=>e.dispatch("ScrollIntoView",t).isDefaultPrevented())(e,i)||(o(t,fn(t).top,n,r),((e,t)=>{e.dispatch("AfterScrollIntoView",t)})(e,i))},xm=(e,t,o,n)=>{const r=mo(e.getBody()),i=mo(e.getDoc());r.dom.offsetWidth;const s=((e,t)=>{const o=((e,t)=>{const o=Mo(e);if(0===o.length||bm(e))return{element:e,offset:t};if(t<o.length&&!bm(o[t]))return{element:o[t],offset:0};{const n=o[o.length-1];return bm(n)?{element:e,offset:t}:"img"===Dt(n)?{element:n,offset:1}:zt(n)?{element:n,offset:sr(n).length}:{element:n,offset:Mo(n).length}}})(e,t),n=co('<span data-mce-bogus="all" style="display: inline-block;">\ufeff</span>');return Jo(o.element,n),ym(n,(()=>rn(n)))})(mo(o.startContainer),o.startOffset);_m(e,i,t,s,n),s.cleanup()},Cm=(e,t,o,n)=>{const r=mo(e.getDoc());_m(e,r,o,(e=>ym(mo(e),S))(t),n)},km=(e,t,o)=>{const n=o.startContainer,r=o.startOffset,i=o.endContainer,s=o.endOffset;t(mo(n),mo(i));const a=e.dom.createRng();a.setStart(n,r),a.setEnd(i,s),e.selection.setRng(o)},Sm=(e,t,o,n)=>{const r=e.pos;if(o)vn(r.left,r.top,n);else{const o=r.top-t+e.height;vn(r.left,o,n)}},Tm=(e,t,o,n,r)=>{const i=o+t,s=n.pos.top,a=n.bottom,l=a-s>=o;s<t?Sm(n,o,!1!==r,e):s>i?Sm(n,o,l?!1!==r:!0===r,e):a>i&&!l&&Sm(n,o,!0===r,e)},Em=(e,t,o,n)=>{const r=xo(e).dom.innerHeight;Tm(e,t,r,o,n)},Om=(e,t,o,n)=>{const r=xo(e).dom.innerHeight;Tm(e,t,r,o,n);const i=(e=>{const t=gm(),o=fn(t),n=((e,t)=>{const o=t.owner(e);return fm(t,o)})(e,vm),r=gn(e),i=Y(n,((e,t)=>{const o=gn(t);return{left:e.left+o.left,top:e.top+o.top}}),{left:0,top:0});return mn(i.left+r.left+o.left,i.top+r.top+o.top)})(o.element),s=wn(window);i.top<s.y?bn(o.element,!1!==n):i.top>s.bottom&&bn(o.element,!0===n)},Am=(e,t,o)=>wm(e,Em,t,o),Mm=(e,t,o)=>Cm(e,t,Em,o),Bm=(e,t,o)=>wm(e,Om,t,o),Pm=(e,t,o)=>Cm(e,t,Om,o),Rm=(e,t,o)=>{(e.inline?Am:Bm)(e,t,o)},Vm=e=>e.dom.focus(),Nm=e=>{const t=Io(e).dom;return e.dom===t.activeElement},Dm=(e=gm())=>F.from(e.dom.activeElement).map(mo),Fm=(e,t)=>{const o=zt(t)?sr(t).length:Mo(t).length+1;return e>o?o:e<0?0:e},Im=e=>Xh.range(e.start,Fm(e.soffset,e.start),e.finish,Fm(e.foffset,e.finish)),Lm=(e,t)=>!Bn(t.dom)&&(yo(e,t)||bo(e,t)),zm=e=>t=>Lm(e,t.start)&&Lm(e,t.finish),Hm=e=>Xh.range(mo(e.startContainer),e.startOffset,mo(e.endContainer),e.endOffset),Zm=e=>{const t=document.createRange();try{return t.setStart(e.start.dom,e.soffset),t.setEnd(e.finish.dom,e.foffset),F.some(t)}catch(e){return F.none()}},jm=e=>{const t=(e=>e.inline||Ot.browser.isFirefox())(e)?(o=mo(e.getBody()),(e=>{const t=e.getSelection();return(t&&0!==t.rangeCount?F.from(t.getRangeAt(0)):F.none()).map(Hm)})(xo(o).dom).filter(zm(o))):F.none();var o;e.bookmark=t.isSome()?t:e.bookmark},Um=e=>(e.bookmark?e.bookmark:F.none()).bind((t=>{return o=mo(e.getBody()),n=t,F.from(n).filter(zm(o)).map(Im);var o,n})).bind(Zm),$m={isEditorUIElement:e=>{const t=e.className.toString();return-1!==t.indexOf("tox-")||-1!==t.indexOf("mce-")}},Wm={setEditorTimeout:(e,t,o)=>((e,t)=>(C(t)||(t=0),setTimeout(e,t)))((()=>{e.removed||t()}),o),setEditorInterval:(e,t,o)=>{const n=((e,t)=>(C(t)||(t=0),setInterval(e,t)))((()=>{e.removed?clearInterval(n):t()}),o);return n}};let qm;const Gm=bs.DOM,Ym=(e,t)=>{const o=oc(e),n=Gm.getParent(t,(t=>(e=>Pn(e)&&$m.isEditorUIElement(e))(t)||!!o&&e.dom.is(t,o)));return null!==n},Xm=(e,t)=>{const o=t.editor;(e=>{const t=As((()=>{jm(e)}),0);e.on("init",(()=>{e.inline&&((e,t)=>{const o=()=>{t.throttle()};bs.DOM.bind(document,"mouseup",o),e.on("remove",(()=>{bs.DOM.unbind(document,"mouseup",o)}))})(e,t),((e,t)=>{((e,t)=>{e.on("mouseup touchend",(e=>{t.throttle()}))})(e,t),e.on("keyup NodeChange AfterSetSelectionRange",(t=>{(e=>"nodechange"===e.type&&e.selectionChange)(t)||jm(e)}))})(e,t)})),e.on("remove",(()=>{t.cancel()}))})(o),o.on("focusin",(()=>{const t=e.focusedEditor;t!==o&&(t&&t.dispatch("blur",{focusedEditor:o}),e.setActive(o),e.focusedEditor=o,o.dispatch("focus",{blurredEditor:t}),o.focus(!0))})),o.on("focusout",(()=>{Wm.setEditorTimeout(o,(()=>{const t=e.focusedEditor;Ym(o,(e=>{try{const t=Io(mo(e.getElement()));return Dm(t).fold((()=>document.body),(e=>e.dom))}catch(e){return document.body}})(o))||t!==o||(o.dispatch("blur",{focusedEditor:null}),e.focusedEditor=null)}))})),qm||(qm=t=>{const o=e.activeEditor;o&&Ho(t).each((t=>{const n=t;n.ownerDocument===document&&(n===document.body||Ym(o,n)||e.focusedEditor!==o||(o.dispatch("blur",{focusedEditor:null}),e.focusedEditor=null))}))},Gm.bind(document,"focusin",qm))},Km=(e,t)=>{e.focusedEditor===t.editor&&(e.focusedEditor=null),!e.activeEditor&&qm&&(Gm.unbind(document,"focusin",qm),qm=null)},Jm=(e,t)=>{((e,t)=>(e=>e.collapsed?F.from(na(e.startContainer,e.startOffset)).map(mo):F.none())(t).bind((t=>fr(t)?F.some(t):yo(e,t)?F.none():F.some(e))))(mo(e.getBody()),t).bind((e=>eu(e.dom))).fold((()=>{e.selection.normalize()}),(t=>e.selection.setRng(t.toRange())))},Qm=e=>{if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},ep=e=>e.inline?(e=>{const t=e.getBody();return t&&(o=mo(t),Nm(o)||(n=o,Dm(Io(n)).filter((e=>n.dom.contains(e.dom)))).isSome());var o,n})(e):(e=>_(e.iframeElement)&&Nm(mo(e.iframeElement)))(e),tp=e=>e.editorManager.setActive(e),op=(e,t,o,n,r)=>{const i=o?t.startContainer:t.endContainer,s=o?t.startOffset:t.endOffset;return F.from(i).map(mo).map((e=>n&&t.collapsed?e:Bo(e,r(e,s)).getOr(e))).bind((e=>Lt(e)?F.some(e):Co(e).filter(Lt))).map((e=>e.dom)).getOr(e)},np=(e,t,o=!1)=>op(e,t,!0,o,((e,t)=>Math.min(Vo(e),t))),rp=(e,t,o=!1)=>op(e,t,!1,o,((e,t)=>t>0?t-1:t)),ip=(e,t)=>{const o=e;for(;e&&Hn(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||o},sp=(e,t)=>U(t,(t=>{const o=e.dispatch("GetSelectionRange",{range:t});return o.range!==t?o.range:t})),ap=["img","br"],lp=e=>{const t=ar(e).filter((e=>0!==e.trim().length||e.indexOf(or)>-1)).isSome();return t||Z(ap,Dt(e))},cp="[data-mce-autocompleter]",dp=(e,t)=>{if(up(mo(e.getBody())).isNone()){const n=co('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',e.getDoc());tn(n,mo(t.extractContents())),t.insertNode(n.dom),Co(n).each((e=>e.dom.normalize())),(o=n,((e,t)=>{const o=e=>{const n=Mo(e);for(let e=n.length-1;e>=0;e--){const r=n[e];if(t(r))return F.some(r);const i=o(r);if(i.isSome())return i}return F.none()};return o(e)})(o,lp)).map((t=>{e.selection.setCursorLocation(t.dom,(e=>"img"===Dt(e)?1:ar(e).fold((()=>Mo(e).length),(e=>e.length)))(t))}))}var o},up=e=>Tn(e,cp),hp={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},mp=(e,t,o)=>{const n=o?"lastChild":"firstChild",r=o?"prev":"next";if(e[n])return e[n];if(e!==t){let o=e[r];if(o)return o;for(let n=e.parent;n&&n!==t;n=n.parent)if(o=n[r],o)return o}},pp=e=>{var t;const o=null!==(t=e.value)&&void 0!==t?t:"";if(!Kr(o))return!1;const n=e.parent;return!n||"span"===n.name&&!n.attr("style")||!/^[ ]+$/.test(o)},gp=e=>{const t="a"===e.name&&!e.attr("href")&&e.attr("id");return e.attr("name")||e.attr("id")&&!e.firstChild||e.attr("data-mce-bookmark")||t};class fp{constructor(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}static create(e,t){const o=new fp(e,hp[e]||1);return t&&pe(t,((e,t)=>{o.attr(t,e)})),o}replace(e){const t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t}attr(e,t){const o=this;if(!m(e))return _(e)&&pe(e,((e,t)=>{o.attr(t,e)})),o;const n=o.attributes;if(n){if(void 0!==t){if(null===t){if(e in n.map){delete n.map[e];let t=n.length;for(;t--;)if(n[t].name===e)return n.splice(t,1),o}return o}if(e in n.map){let o=n.length;for(;o--;)if(n[o].name===e){n[o].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,o}return n.map[e]}}clone(){const e=this,t=new fp(e.name,e.type),o=e.attributes;if(o){const e=[];e.map={};for(let t=0,n=o.length;t<n;t++){const n=o[t];"id"!==n.name&&(e[e.length]={name:n.name,value:n.value},e.map[n.name]=n.value)}t.attributes=e}return t.value=e.value,t}wrap(e){const t=this;return t.parent&&(t.parent.insert(e,t),e.append(t)),t}unwrap(){const e=this;for(let t=e.firstChild;t;){const o=t.next;e.insert(t,e,!0),t=o}e.remove()}remove(){const e=this,t=e.parent,o=e.next,n=e.prev;return t&&(t.firstChild===e?(t.firstChild=o,o&&(o.prev=null)):n&&(n.next=o),t.lastChild===e?(t.lastChild=n,n&&(n.next=null)):o&&(o.prev=n),e.parent=e.next=e.prev=null),e}append(e){const t=this;e.parent&&e.remove();const o=t.lastChild;return o?(o.next=e,e.prev=o,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e}insert(e,t,o){e.parent&&e.remove();const n=t.parent||this;return o?(t===n.firstChild?n.firstChild=e:t.prev&&(t.prev.next=e),e.prev=t.prev,e.next=t,t.prev=e):(t===n.lastChild?n.lastChild=e:t.next&&(t.next.prev=e),e.next=t.next,e.prev=t,t.next=e),e.parent=n,e}getAll(e){const t=this,o=[];for(let n=t.firstChild;n;n=mp(n,t))n.name===e&&o.push(n);return o}children(){const e=[];for(let t=this.firstChild;t;t=t.next)e.push(t);return e}empty(){const e=this;if(e.firstChild){const t=[];for(let o=e.firstChild;o;o=mp(o,e))t.push(o);let o=t.length;for(;o--;){const e=t[o];e.parent=e.firstChild=e.lastChild=e.next=e.prev=null}}return e.firstChild=e.lastChild=null,e}isEmpty(e,t={},o){var n;const r=this;let i=r.firstChild;if(gp(r))return!1;if(i)do{if(1===i.type){if(i.attr("data-mce-bogus"))continue;if(e[i.name])return!1;if(gp(i))return!1}if(8===i.type)return!1;if(3===i.type&&!pp(i))return!1;if(3===i.type&&i.parent&&t[i.parent.name]&&Kr(null!==(n=i.value)&&void 0!==n?n:""))return!1;if(o&&o(i))return!1}while(i=mp(i,r));return!0}walk(e){return mp(this,null,e)}}const vp=(e,t,o=0)=>{const n=e.toLowerCase();if(-1!==n.indexOf("[if ",o)&&((e,t)=>/^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(e.substr(t)))(n,o)){const e=n.indexOf("[endif]",o);return n.indexOf(">",e)}if(t){const e=n.indexOf(">",o);return-1!==e?e:n.length}{const t=/--!?>/g;t.lastIndex=o;const r=t.exec(e);return r?r.index+r[0].length:n.length}},bp=(e,t,o)=>{const n=/<([!?\/])?([A-Za-z0-9\-_:.]+)/g,r=/(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g,i=e.getVoidElements();let s=1,a=o;for(;0!==s;)for(n.lastIndex=a;;){const e=n.exec(t);if(null===e)return a;if("!"===e[1]){a=He(e[2],"--")?vp(t,!1,e.index+"!--".length):vp(t,!0,e.index+1);break}{r.lastIndex=n.lastIndex;const o=r.exec(t);if(v(o)||o.index!==n.lastIndex)continue;"/"===e[1]?s-=1:Ce(i,e[2])||(s+=1),a=n.lastIndex+o[0].length;break}}return a},yp=(e,t)=>{const o=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,n=e.schema;let r=((e,t)=>{const o=new RegExp(["\\s?("+e.join("|")+')="[^"]+"'].join("|"),"gi");return t.replace(o,"")})(e.getTempAttrs(),t);const i=n.getVoidElements();let s;for(;s=o.exec(r);){const e=o.lastIndex,t=s[0].length;let a;a=i[s[1]]?e:bp(n,r,e),r=r.substring(0,e-t)+r.substring(a),o.lastIndex=e-t}return Tr(r)},wp=yp,_p=e=>{const t=rr(e,"[data-mce-bogus]");$(t,(e=>{"all"===qt(e,"data-mce-bogus")?rn(e):hr(e)?(Jo(e,ho(tr)),rn(e)):sn(e)}))},xp=e=>{const t=rr(e,"input");$(t,(e=>{Xt(e,"name")}))},Cp=(e,t,o)=>{let n;return n="raw"===t.format?Pt.trim(wp(e.serializer,o.innerHTML)):"text"===t.format?((e,t)=>{const o=e.getDoc(),n=Io(mo(e.getBody())),r=uo("div",o);$t(r,"data-mce-bogus","all"),Wo(r,{position:"fixed",left:"-9999999px",top:"0"}),cn(r,t.innerHTML),_p(r),xp(r);const i=(e=>No(e)?e:mo(_o(e).dom.body))(n);tn(i,r);const s=Tr(r.dom.innerText);return rn(r),s})(e,o):"tree"===t.format?e.serializer.serialize(o,t):((e,t)=>{const o=gl(e),n=new RegExp(`^(<${o}[^>]*>(&nbsp;|&#160;|\\s| |<br \\/>|)<\\/${o}>[\r\n]*|<br \\/>[\r\n]*)$`);return t.replace(n,"")})(e,e.serializer.serialize(o,t)),"text"!==t.format&&!br(mo(o))&&m(n)?Pt.trim(n):n},kp=Pt.makeMap,Sp=e=>{const t=[],o=(e=e||{}).indent,n=kp(e.indent_before||""),r=kp(e.indent_after||""),i=Li.getEncodeFunc(e.entity_encoding||"raw",e.entities),s="xhtml"!==e.element_format;return{start:(e,a,l)=>{if(o&&n[e]&&t.length>0){const e=t[t.length-1];e.length>0&&"\n"!==e&&t.push("\n")}if(t.push("<",e),a)for(let e=0,o=a.length;e<o;e++){const o=a[e];t.push(" ",o.name,'="',i(o.value,!0),'"')}if(t[t.length]=!l||s?">":" />",l&&o&&r[e]&&t.length>0){const e=t[t.length-1];e.length>0&&"\n"!==e&&t.push("\n")}},end:e=>{let n;t.push("</",e,">"),o&&r[e]&&t.length>0&&(n=t[t.length-1],n.length>0&&"\n"!==n&&t.push("\n"))},text:(e,o)=>{e.length>0&&(t[t.length]=o?e:i(e))},cdata:e=>{t.push("<![CDATA[",e,"]]>")},comment:e=>{t.push("\x3c!--",e,"--\x3e")},pi:(e,n)=>{n?t.push("<?",e," ",i(n),"?>"):t.push("<?",e,"?>"),o&&t.push("\n")},doctype:e=>{t.push("<!DOCTYPE",e,">",o?"\n":"")},reset:()=>{t.length=0},getContent:()=>t.join("").replace(/\n$/,"")}},Tp=(e={},t=Ji())=>{const o=Sp(e);return e.validate=!("validate"in e)||e.validate,{serialize:n=>{const r=e.validate,i={3:e=>{var t;o.text(null!==(t=e.value)&&void 0!==t?t:"",e.raw)},8:e=>{var t;o.comment(null!==(t=e.value)&&void 0!==t?t:"")},7:e=>{o.pi(e.name,e.value)},10:e=>{var t;o.doctype(null!==(t=e.value)&&void 0!==t?t:"")},4:e=>{var t;o.cdata(null!==(t=e.value)&&void 0!==t?t:"")},11:e=>{let t=e;if(t=t.firstChild)do{s(t)}while(t=t.next)}};o.reset();const s=e=>{var n;const a=i[e.type];if(a)a(e);else{const i=e.name,a=i in t.getVoidElements();let l=e.attributes;if(r&&l&&l.length>1){const o=[];o.map={};const n=t.getElementRule(e.name);if(n){for(let e=0,t=n.attributesOrder.length;e<t;e++){const t=n.attributesOrder[e];if(t in l.map){const e=l.map[t];o.map[t]=e,o.push({name:t,value:e})}}for(let e=0,t=l.length;e<t;e++){const t=l[e].name;if(!(t in o.map)){const e=l.map[t];o.map[t]=e,o.push({name:t,value:e})}}l=o}}if(o.start(i,l,a),!a){let t=e.firstChild;if(t){"pre"!==i&&"textarea"!==i||3!==t.type||"\n"!==(null===(n=t.value)||void 0===n?void 0:n[0])||o.text("\n",!0);do{s(t)}while(t=t.next)}o.end(i)}}};return 1!==n.type||e.inner?3===n.type?i[3](n):i[11](n):s(n),o.getContent()}}},Ep=new Set;$(["margin","margin-left","margin-right","margin-top","margin-bottom","padding","padding-left","padding-right","padding-top","padding-bottom","border","border-width","border-style","border-color","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","float","position","left","right","top","bottom","z-index","display","transform","width","max-width","min-width","height","max-height","min-height","overflow","overflow-x","overflow-y","text-overflow","vertical-align","transition","transition-delay","transition-duration","transition-property","transition-timing-function"],(e=>{Ep.add(e)}));const Op=["font","text-decoration","text-emphasis"],Ap=(e,t)=>he(e.parseStyle(e.getAttrib(t,"style"))),Mp=(e,t,o)=>{const n=Ap(e,t),r=Ap(e,o),i=n=>{var r,i;const s=null!==(r=e.getStyle(t,n))&&void 0!==r?r:"",a=null!==(i=e.getStyle(o,n))&&void 0!==i?i:"";return qe(s)&&qe(a)&&s!==a};return j(n,(e=>{const t=t=>j(t,(t=>t===e));if(!t(r)&&t(Op)){const e=G(r,(e=>j(Op,(t=>He(e,t)))));return j(e,i)}return i(e)}))},Bp=(e,t,o)=>F.from(o.container()).filter(Hn).exists((n=>{const r=e?0:-1;return t(n.data.charAt(o.offset()+r))})),Pp=B(Bp,!0,yu),Rp=B(Bp,!1,yu),Vp=e=>{const t=e.container();return Hn(t)&&(0===t.data.length||Sr(t.data)&&Eh.isBookmarkNode(t.parentNode))},Np=(e,t)=>o=>_d(e?0:-1,o).filter(t).isSome(),Dp=e=>Gn(e)&&"block"===qo(mo(e),"display"),Fp=e=>Xn(e)&&!(e=>Pn(e)&&"all"===e.getAttribute("data-mce-bogus"))(e),Ip=Np(!0,Dp),Lp=Np(!1,Dp),zp=Np(!0,Qn),Hp=Np(!1,Qn),Zp=Np(!0,In),jp=Np(!1,In),Up=Np(!0,Fp),$p=Np(!1,Fp),Wp=(e,t)=>((e,t,o)=>yo(t,e)?So(e,(e=>o(e)||bo(e,t))).slice(0,-1):[])(e,t,N),qp=(e,t)=>[e].concat(Wp(e,t)),Gp=(e,t,o)=>Xd(e,t,o,Vp),Yp=(e,t)=>J(qp(mo(t.container()),e),dr),Xp=(e,t,o)=>Gp(e,t.dom,o).forall((e=>Yp(t,o).fold((()=>!wd(e,o,t.dom)),(n=>!wd(e,o,t.dom)&&yo(n,mo(e.container())))))),Kp=(e,t,o)=>Yp(t,o).fold((()=>Gp(e,t.dom,o).forall((e=>!wd(e,o,t.dom)))),(t=>Gp(e,t.dom,o).isNone())),Jp=B(Kp,!1),Qp=B(Kp,!0),eg=B(Xp,!1),tg=B(Xp,!0),og=e=>Md(e).exists(hr),ng=(e,t,o)=>{const n=G(qp(mo(o.container()),t),dr),r=le(n).getOr(t);return Gd(e,r.dom,o).filter(og)},rg=(e,t)=>Md(t).exists(hr)||ng(!0,e,t).isSome(),ig=(e,t)=>(e=>F.from(e.getNode(!0)).map(mo))(t).exists(hr)||ng(!1,e,t).isSome(),sg=B(ng,!1),ag=B(ng,!0),lg=e=>Ca.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd(),cg=(e,t)=>{const o=G(qp(mo(t.container()),e),dr);return le(o).getOr(e)},dg=(e,t)=>lg(t)?Rp(t):Rp(t)||Qd(cg(e,t).dom,t).exists(Rp),ug=(e,t)=>lg(t)?Pp(t):Pp(t)||Jd(cg(e,t).dom,t).exists(Pp),hg=e=>Md(e).bind((e=>kn(e,Lt))).exists((e=>(e=>Z(["pre","pre-wrap"],e))(qo(e,"white-space")))),mg=(e,t)=>o=>{return n=new An(o,e)[t](),_(n)&&Xn(n)&&cd(n);var n},pg=(e,t)=>!hg(t)&&(Jp(e,t)||eg(e,t)||ig(e,t)||dg(e,t)||((e,t)=>{const o=Qd(e.dom,t).getOr(t),n=mg(e.dom,"prev");return t.isAtStart()&&(n(t.container())||n(o.container()))})(e,t)),gg=(e,t)=>!hg(t)&&(Qp(e,t)||tg(e,t)||rg(e,t)||ug(e,t)||((e,t)=>{const o=Jd(e.dom,t).getOr(t),n=mg(e.dom,"next");return t.isAtEnd()&&(n(t.container())||n(o.container()))})(e,t)),fg=(e,t)=>pg(e,t)||gg(e,(e=>{const t=e.container(),o=e.offset();return Hn(t)&&o<t.data.length?Ca(t,o+1):e})(t)),vg=(e,t)=>vu(e.charAt(t)),bg=(e,t)=>yu(e.charAt(t)),yg=(e,t,o)=>{const n=t.data,r=Ca(t,0);return o||!vg(n,0)||fg(e,r)?!!(o&&bg(n,0)&&pg(e,r))&&(t.data=or+n.slice(1),!0):(t.data=" "+n.slice(1),!0)},wg=(e,t,o)=>{const n=t.data,r=Ca(t,n.length-1);return o||!vg(n,n.length-1)||fg(e,r)?!!(o&&bg(n,n.length-1)&&gg(e,r))&&(t.data=n.slice(0,-1)+or,!0):(t.data=n.slice(0,-1)+" ",!0)},_g=(e,t)=>{const o=t.container();if(!Hn(o))return F.none();if((e=>{const t=e.container();return Hn(t)&&ze(t.data,or)})(t)){const n=yg(e,o,!1)||(e=>{const t=e.data,o=(e=>{const t=e.split("");return U(t,((e,o)=>vu(e)&&o>0&&o<t.length-1&&wu(t[o-1])&&wu(t[o+1])?" ":e)).join("")})(t);return o!==t&&(e.data=o,!0)})(o)||wg(e,o,!1);return Nt(n,t)}if(fg(e,t)){const n=yg(e,o,!0)||wg(e,o,!0);return Nt(n,t)}return F.none()},xg=(e,t,o)=>{if(0===o)return;const n=mo(e),r=Cn(n,dr).getOr(n),i=e.data.slice(t,t+o),s=t+o>=e.data.length&&gg(r,Ca(e,e.data.length)),a=0===t&&pg(r,Ca(e,0));e.replaceData(t,o,Qr(i,4,a,s))},Cg=(e,t)=>{const o=e.data.slice(t),n=o.length-$e(o).length;xg(e,t,n)},kg=(e,t)=>{const o=e.data.slice(0,t),n=o.length-We(o).length;xg(e,t-n,n)},Sg=(e,t,o,n=!0)=>{const r=We(e.data).length,i=n?e:t,s=n?t:e;return n?i.appendData(s.data):i.insertData(0,s.data),rn(mo(s)),o&&Cg(i,r),i},Tg=(e,t)=>((e,t)=>{const o=e.container(),n=e.offset();return!Ca.isTextPosition(e)&&o===t.parentNode&&n>Ca.before(t).offset()})(t,e)?Ca(t.container(),t.offset()-1):t,Eg=e=>{return qr(e.previousSibling)?F.some((t=e.previousSibling,Hn(t)?Ca(t,t.data.length):Ca.after(t))):e.previousSibling?tu(e.previousSibling):F.none();var t},Og=e=>{return qr(e.nextSibling)?F.some((t=e.nextSibling,Hn(t)?Ca(t,0):Ca.before(t))):e.nextSibling?eu(e.nextSibling):F.none();var t},Ag=(e,t,o)=>((e,t,o)=>e?((e,t)=>Og(t).orThunk((()=>Eg(t))).orThunk((()=>((e,t)=>Jd(e,Ca.after(t)).orThunk((()=>Qd(e,Ca.before(t)))))(e,t))))(t,o):((e,t)=>Eg(t).orThunk((()=>Og(t))).orThunk((()=>((e,t)=>F.from(t.previousSibling?t.previousSibling:t.parentNode).bind((t=>Qd(e,Ca.before(t)))).orThunk((()=>Jd(e,Ca.after(t)))))(e,t))))(t,o))(e,t,o).map(B(Tg,o)),Mg=(e,t,o)=>{o.fold((()=>{e.focus()}),(o=>{e.selection.setRng(o.toRange(),t)}))},Bg=(e,t)=>t&&Ce(e.schema.getBlockElements(),Dt(t)),Pg=e=>{if(ri(e)){const t=co('<br data-mce-bogus="1">');return nn(e),tn(e,t),F.some(Ca.before(t.dom))}return F.none()},Rg=(e,t,o,n=!0)=>{const r=Ag(t,e.getBody(),o.dom),i=Cn(o,B(Bg,e),(s=e.getBody(),e=>e.dom===s));var s;const a=((e,t,o)=>{const n=To(e).filter(zt),r=Eo(e).filter(zt);return rn(e),(i=n,s=r,a=t,l=(e,t,n)=>{const r=e.dom,i=t.dom,s=r.data.length;return Sg(r,i,o),n.container()===i?Ca(r,s):n},i.isSome()&&s.isSome()&&a.isSome()?F.some(l(i.getOrDie(),s.getOrDie(),a.getOrDie())):F.none()).orThunk((()=>(o&&(n.each((e=>kg(e.dom,e.dom.length))),r.each((e=>Cg(e.dom,0)))),t)));var i,s,a,l})(o,r,((e,t)=>Ce(e.schema.getTextInlineElements(),Dt(t)))(e,o));e.dom.isEmpty(e.getBody())?(e.setContent(""),e.selection.setCursorLocation()):i.bind(Pg).fold((()=>{n&&Mg(e,t,a)}),(o=>{n&&Mg(e,t,F.some(o))}))},Vg=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,Ng=(e,t)=>fo(mo(t),Hl(e))&&!fi(e.schema,t),Dg=(e,t,o)=>{const n=((e,t,o)=>G(bs.DOM.getParents(o.container(),"*",t),e))(e,t,o);return F.from(n[n.length-1])},Fg=(e,t)=>{const o=t.container(),n=t.offset();return e?Mr(o)?Hn(o.nextSibling)?Ca(o.nextSibling,0):Ca.after(o):Rr(t)?Ca(o,n+1):t:Mr(o)?Hn(o.previousSibling)?Ca(o.previousSibling,o.previousSibling.data.length):Ca.before(o):Vr(t)?Ca(o,n-1):t},Ig=B(Fg,!0),Lg=B(Fg,!1),zg=(e,t)=>{const o=e=>e.stopImmediatePropagation();e.on("beforeinput input",o,!0),e.getDoc().execCommand(t),e.off("beforeinput input",o)},Hg=e=>zg(e,"Delete"),Zg=e=>mr(e)||gr(e),jg=(e,t)=>yo(e,t)?kn(t,Zg,(e=>t=>Rt(Co(t),e,bo))(e)):F.none(),Ug=(e,t=!0)=>{e.dom.isEmpty(e.getBody())&&e.setContent("",{no_selection:!t})},$g=e=>{var t;return(8===Ft(t=e)||"#comment"===Dt(t)?To(e):Ro(e)).bind($g).orThunk((()=>F.some(e)))},Wg=(e,t,o,n=!0)=>{var r;t.deleteContents();const i=$g(o).getOr(o),s=mo(null!==(r=e.dom.getParent(i.dom,e.dom.isBlock))&&void 0!==r?r:o.dom);if(s.dom===e.getBody()?Ug(e,n):ri(s)&&(xr(s),n&&e.selection.setCursorLocation(s.dom,0)),!bo(o,s)){const e=Rt(Co(s),o)?[]:Co(a=s).map(Mo).map((e=>G(e,(e=>!bo(a,e))))).getOr([]);$(e.concat(Mo(o)),(e=>{bo(e,s)||yo(e,s)||!ri(e)||rn(e)}))}var a},qg=e=>rr(e,"td,th"),Gg=(e,t)=>({start:e,end:t}),Yg=Ga([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),Xg=(e,t)=>En(mo(e),"td,th",t),Kg=e=>!bo(e.start,e.end),Jg=(e,t)=>Bu(e.start,t).bind((o=>Bu(e.end,t).bind((e=>Nt(bo(o,e),o))))),Qg=e=>t=>Jg(t,e).map((e=>((e,t,o)=>({rng:e,table:t,cells:o}))(t,e,qg(e)))),ef=(e,t,o,n)=>{if(o.collapsed||!e.forall(Kg))return F.none();if(t.isSameTable){const t=e.bind(Qg(n));return F.some({start:t,end:t})}{const e=Xg(o.startContainer,n),t=Xg(o.endContainer,n),r=e.bind((e=>t=>Bu(t,e).bind((e=>ce(qg(e)).map((e=>Gg(t,e))))))(n)).bind(Qg(n)),i=t.bind((e=>t=>Bu(t,e).bind((e=>le(qg(e)).map((e=>Gg(e,t))))))(n)).bind(Qg(n));return F.some({start:r,end:i})}},tf=(e,t)=>Q(e,(e=>bo(e,t))),of=e=>Vt(tf(e.cells,e.rng.start),tf(e.cells,e.rng.end),((t,o)=>e.cells.slice(t,o+1))),nf=(e,t)=>{const{startTable:o,endTable:n}=t,r=e.cloneRange();return o.each((e=>r.setStartAfter(e.dom))),n.each((e=>r.setEndBefore(e.dom))),r},rf=(e,t)=>{const o=(e=>t=>bo(e,t))(e),n=((e,t)=>{const o=Xg(e.startContainer,t),n=Xg(e.endContainer,t);return Vt(o,n,Gg)})(t,o),r=((e,t)=>{const o=e=>Bu(mo(e),t),n=o(e.startContainer),r=o(e.endContainer),i=n.isSome(),s=r.isSome(),a=Vt(n,r,bo).getOr(!1);return{startTable:n,endTable:r,isStartInTable:i,isEndInTable:s,isSameTable:a,isMultiTable:!a&&i&&s}})(t,o);return((e,t,o)=>e.exists((e=>((e,t)=>!Kg(e)&&Jg(e,t).exists((e=>{const t=e.dom.rows;return 1===t.length&&1===t[0].cells.length})))(e,o)&&Vu(e.start,t))))(n,t,o)?n.map((e=>Yg.singleCellTable(t,e.start))):r.isMultiTable?((e,t,o,n)=>ef(e,t,o,n).bind((({start:e,end:n})=>{const r=e.bind(of).getOr([]),i=n.bind(of).getOr([]);if(r.length>0&&i.length>0){const e=nf(o,t);return F.some(Yg.multiTable(r,i,e))}return F.none()})))(n,r,t,o):((e,t,o,n)=>ef(e,t,o,n).bind((({start:e,end:t})=>e.or(t))).bind((e=>{const{isSameTable:n}=t,r=of(e).getOr([]);if(n&&e.cells.length===r.length)return F.some(Yg.fullTable(e.table));if(r.length>0){if(n)return F.some(Yg.partialTable(r,F.none()));{const e=nf(o,t);return F.some(Yg.partialTable(r,F.some({...t,rng:e})))}}return F.none()})))(n,r,t,o)},sf=e=>$(e,(e=>{Xt(e,"contenteditable"),xr(e)})),af=(e,t,o,n)=>{const r=o.cloneRange();n?(r.setStart(o.startContainer,o.startOffset),r.setEndAfter(t.dom.lastChild)):(r.setStartBefore(t.dom.firstChild),r.setEnd(o.endContainer,o.endOffset)),uf(e,r,t,!1).each((e=>e()))},lf=e=>{const t=Mu(e),o=mo(e.selection.getNode());Kn(o.dom)&&ri(o)?e.selection.setCursorLocation(o.dom,0):e.selection.collapse(!0),t.length>1&&j(t,(e=>bo(e,o)))&&$t(o,"data-mce-selected","1")},cf=(e,t,o)=>F.some((()=>{const n=e.selection.getRng(),r=o.bind((({rng:o,isStartInTable:r})=>{const i=((e,t)=>F.from(e.dom.getParent(t,e.dom.isBlock)).map(mo))(e,r?o.endContainer:o.startContainer);o.deleteContents(),((e,t,o)=>{o.each((o=>{t?rn(o):(xr(o),e.selection.setCursorLocation(o.dom,0))}))})(e,r,i.filter(ri));const s=r?t[0]:t[t.length-1];return af(e,s,n,r),ri(s)?F.none():F.some(r?t.slice(1):t.slice(0,-1))})).getOr(t);sf(r),lf(e)})),df=(e,t,o,n)=>F.some((()=>{const r=e.selection.getRng(),i=t[0],s=o[o.length-1];af(e,i,r,!0),af(e,s,r,!1);const a=ri(i)?t:t.slice(1),l=ri(s)?o:o.slice(0,-1);sf(a.concat(l)),n.deleteContents(),lf(e)})),uf=(e,t,o,n=!0)=>F.some((()=>{Wg(e,t,o,n)})),hf=(e,t)=>F.some((()=>Rg(e,!1,t))),mf=(e,t)=>J(qp(t,e),vr),pf=(e,t)=>J(qp(t,e),jt("caption")),gf=(e,t)=>F.some((()=>{xr(t),e.selection.setCursorLocation(t.dom,0)})),ff=(e,t)=>e?Zp(t):jp(t),vf=(e,t,o)=>{const n=mo(e.getBody());return pf(n,o).fold((()=>((e,t,o,n)=>{const r=Ca.fromRangeStart(e.selection.getRng());return mf(o,n).bind((n=>ri(n)?gf(e,n):((e,t,o,n,r)=>Yd(o,e.getBody(),r).bind((e=>mf(t,mo(e.getNode())).bind((e=>bo(e,n)?F.none():F.some(S))))))(e,o,t,n,r)))})(e,t,n,o).orThunk((()=>Nt(((e,t)=>{const o=Ca.fromRangeStart(e.selection.getRng());return ff(t,o)||Gd(t,e.getBody(),o).exists((e=>ff(t,e)))})(e,t),S)))),(o=>((e,t,o,n)=>{const r=Ca.fromRangeStart(e.selection.getRng());return ri(n)?gf(e,n):((e,t,o,n,r)=>Yd(o,e.getBody(),r).fold((()=>F.some(S)),(i=>((e,t,o,n)=>eu(e.dom).bind((r=>tu(e.dom).map((e=>t?o.isEqual(r)&&n.isEqual(e):o.isEqual(e)&&n.isEqual(r))))).getOr(!0))(n,o,r,i)?((e,t)=>gf(e,t))(e,n):((e,t,o)=>pf(e,mo(o.getNode())).fold((()=>F.some(S)),(e=>Nt(!bo(e,t),S))))(t,n,i))))(e,o,t,n,r)})(e,t,n,o)))},bf=(e,t)=>{const o=mo(e.selection.getStart(!0)),n=Mu(e);return e.selection.isCollapsed()&&0===n.length?vf(e,t,o):((e,t,o)=>{const n=mo(e.getBody()),r=e.selection.getRng();return 0!==o.length?cf(e,o,F.none()):((e,t,o,n)=>pf(t,n).fold((()=>((e,t,o)=>rf(t,o).bind((t=>t.fold(B(uf,e),B(hf,e),B(cf,e),B(df,e)))))(e,t,o)),(t=>((e,t)=>gf(e,t))(e,t))))(e,n,r,t)})(e,o,n)},yf=(e,t)=>{let o=t;for(;o&&o!==e;){if(Yn(o)||Xn(o))return o;o=o.parentNode}return null},wf=["data-ephox-","data-mce-","data-alloy-","data-snooker-","_"],_f=Pt.each,xf=e=>{const t=e.dom,o=new Set(e.serializer.getTempAttrs()),n=e=>j(wf,(t=>He(e,t)))||o.has(e);return{compare:(e,o)=>{if(e.nodeName!==o.nodeName||e.nodeType!==o.nodeType)return!1;const r=e=>{const o={};return _f(t.getAttribs(e),(r=>{const i=r.nodeName.toLowerCase();"style"===i||n(i)||(o[i]=t.getAttrib(e,i))})),o},i=(e,t)=>{for(const o in e)if(Ce(e,o)){const n=t[o];if(y(n))return!1;if(e[o]!==n)return!1;delete t[o]}for(const e in t)if(Ce(t,e))return!1;return!0};if(Pn(e)&&Pn(o)){if(!i(r(e),r(o)))return!1;if(!i(t.parseStyle(t.getAttrib(e,"style")),t.parseStyle(t.getAttrib(o,"style"))))return!1}return!fu(e)&&!fu(o)},isAttributeInternal:n}},Cf=(e,t,o,n)=>{const r=o.name;for(let t=0,i=e.length;t<i;t++){const i=e[t];if(i.name===r){const e=n.nodes[r];e?e.nodes.push(o):n.nodes[r]={filter:i,nodes:[o]}}}if(o.attributes)for(let e=0,r=t.length;e<r;e++){const r=t[e],i=r.name;if(i in o.attributes.map){const e=n.attributes[i];e?e.nodes.push(o):n.attributes[i]={filter:r,nodes:[o]}}}},kf=(e,t)=>{const o=(e,o)=>{pe(e,(e=>{const n=de(e.nodes);$(e.filter.callbacks,(r=>{for(let t=n.length-1;t>=0;t--){const r=n[t];(o?void 0!==r.attr(e.filter.name):r.name===e.filter.name)&&!w(r.parent)||n.splice(t,1)}n.length>0&&r(n,e.filter.name,t)}))}))};o(e.nodes,!1),o(e.attributes,!0)},Sf=(e,t,o,n={})=>{const r=((e,t,o)=>{const n={nodes:{},attributes:{}};return o.firstChild&&((o,r)=>{let i=o;for(;i=i.walk();)Cf(e,t,i,n)})(o),n})(e,t,o);kf(r,n)},Tf=(e,t,o)=>{if(e.insert&&t(o)){const e=new fp("br",1);e.attr("data-mce-bogus","1"),o.empty().append(e)}else o.empty().append(new fp("#text",3)).value=or},Ef=(e,t)=>{const o=null==e?void 0:e.firstChild;return _(o)&&o===e.lastChild&&o.name===t},Of=(e,t,o,n)=>n.isEmpty(t,o,(t=>((e,t)=>{const o=e.getElementRule(t.name);return!0===(null==o?void 0:o.paddEmpty)})(e,t))),Af=(e,t,o=e.parent)=>{if(t.getSpecialElements()[e.name])e.empty().remove();else{const n=e.children();for(const e of n)o&&!t.isValidChild(o.name,e.name)&&Af(e,t,o);e.unwrap()}},Mf=(e,t,o=S)=>{const n=t.getTextBlockElements(),r=t.getNonEmptyElements(),i=t.getWhitespaceElements(),s=Pt.makeMap("tr,td,th,tbody,thead,tfoot,table"),a=new Set;for(let l=0;l<e.length;l++){const c=e[l];let d,u,h;if(!c.parent||a.has(c))continue;if(n[c.name]&&"li"===c.parent.name){let e=c.next;for(;e&&n[e.name];)e.name="li",a.add(e),c.parent.insert(e,c.parent),e=e.next;c.unwrap();continue}const m=[c];for(d=c.parent;d&&!t.isValidChild(d.name,c.name)&&!s[d.name];d=d.parent)m.push(d);if(d&&m.length>1)if(t.isValidChild(d.name,c.name)){m.reverse(),u=m[0].clone(),o(u);let e=u;for(let n=0;n<m.length-1;n++){t.isValidChild(e.name,m[n].name)?(h=m[n].clone(),o(h),e.append(h)):h=e;for(let e=m[n].firstChild;e&&e!==m[n+1];){const t=e.next;h.append(e),e=t}e=h}Of(t,r,i,u)?d.insert(c,m[0],!0):(d.insert(u,m[0],!0),d.insert(c,u)),d=m[0],(Of(t,r,i,d)||Ef(d,"br"))&&d.empty().remove()}else Af(c,t);else if(c.parent){if("li"===c.name){let e=c.prev;if(e&&("ul"===e.name||"ol"===e.name)){e.append(c);continue}if(e=c.next,e&&("ul"===e.name||"ol"===e.name)&&e.firstChild){e.insert(c,e.firstChild,!0);continue}const t=new fp("ul",1);o(t),c.wrap(t);continue}if(t.isValidChild(c.parent.name,"div")&&t.isValidChild("div",c.name)){const e=new fp("div",1);o(e),c.wrap(e)}else Af(c,t)}}},Bf=(e,t,o=t.parent)=>!(!o||!e.children[t.name]||e.isValidChild(o.name,t.name))||!(!o||"a"!==t.name||!((e,t)=>{let o=e;for(;o;){if("a"===o.name)return!0;o=o.parent}return!1})(o)),Pf=e=>e.collapsed?e:(e=>{const t=Ca.fromRangeStart(e),o=Ca.fromRangeEnd(e),n=e.commonAncestorContainer;return Gd(!1,n,o).map((r=>!wd(t,o,n)&&wd(t,r,n)?((e,t,o,n)=>{const r=document.createRange();return r.setStart(e,t),r.setEnd(o,n),r})(t.container(),t.offset(),r.container(),r.offset()):e)).getOr(e)})(e),Rf=(e,t)=>{let o=t.firstChild,n=t.lastChild;return o&&"meta"===o.name&&(o=o.next),n&&"mce_marker"===n.attr("id")&&(n=n.prev),((e,t)=>{const o=e.getNonEmptyElements();return _(t)&&(t.isEmpty(o)||((e,t)=>e.getBlockElements()[t.name]&&(e=>_(e.firstChild)&&e.firstChild===e.lastChild)(t)&&(e=>"br"===e.name||e.value===or)(t.firstChild))(e,t))})(e,n)&&(n=null==n?void 0:n.prev),!(!o||o!==n||"ul"!==o.name&&"ol"!==o.name)},Vf=e=>{return e.length>0&&(!(o=e[e.length-1]).firstChild||_(null==(t=o)?void 0:t.firstChild)&&t.firstChild===t.lastChild&&(e=>e.data===or||qn(e))(t.firstChild))?e.slice(0,-1):e;var t,o},Nf=(e,t)=>{const o=e.getParent(t,e.isBlock);return o&&"LI"===o.nodeName?o:null},Df=(e,t)=>{const o=Ca.after(e),n=Ud(t).prev(o);return n?n.toRange():null},Ff=(e,t,o,n)=>{const r=((e,t,o)=>{const n=t.serialize(o);return(e=>{var t,o;const n=e.firstChild,r=e.lastChild;return n&&"META"===n.nodeName&&(null===(t=n.parentNode)||void 0===t||t.removeChild(n)),r&&"mce_marker"===r.id&&(null===(o=r.parentNode)||void 0===o||o.removeChild(r)),e})(e.createFragment(n))})(t,e,n),i=Nf(t,o.startContainer),s=Vf((a=r.firstChild,G(null!==(l=null==a?void 0:a.childNodes)&&void 0!==l?l:[],(e=>"LI"===e.nodeName))));var a,l;const c=t.getRoot(),d=e=>{const n=Ca.fromRangeStart(o),r=Ud(t.getRoot()),s=1===e?r.prev(n):r.next(n),a=null==s?void 0:s.getNode();return!a||Nf(t,a)!==i};return i?d(1)?((e,t,o)=>{const n=e.parentNode;return n&&Pt.each(t,(t=>{n.insertBefore(t,e)})),((e,t)=>{const o=Ca.before(e),n=Ud(t).next(o);return n?n.toRange():null})(e,o)})(i,s,c):d(2)?((e,t,o,n)=>(n.insertAfter(t.reverse(),e),Df(t[0],o)))(i,s,c,t):((e,t,o,n)=>{const r=((e,t)=>{const o=t.cloneRange(),n=t.cloneRange();return o.setStartBefore(e),n.setEndAfter(e),[o.cloneContents(),n.cloneContents()]})(e,n),i=e.parentNode;return i&&(i.insertBefore(r[0],e),Pt.each(t,(t=>{i.insertBefore(t,e)})),i.insertBefore(r[1],e),i.removeChild(e)),Df(t[t.length-1],o)})(i,s,c,o):null},If=["pre"],Lf=Kn,zf=(e,t,o)=>{var n,r;const i=e.selection,s=e.dom,a=e.parser,l=o.merge,c=Tp({validate:!0},e.schema),d='<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;</span>';-1===t.indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,d);let u=i.getRng();const h=u.startContainer,m=e.getBody();h===m&&i.isCollapsed()&&s.isBlock(m.firstChild)&&((e,t)=>_(t)&&!e.schema.getVoidElements()[t.nodeName])(e,m.firstChild)&&s.isEmpty(m.firstChild)&&(u=s.createRng(),u.setStart(m.firstChild,0),u.setEnd(m.firstChild,0),i.setRng(u)),i.isCollapsed()||(e=>{const t=e.dom,o=Pf(e.selection.getRng());e.selection.setRng(o);const n=t.getParent(o.startContainer,Lf);((e,t,o)=>!!_(o)&&o===e.getParent(t.endContainer,Lf)&&Vu(mo(o),t))(t,o,n)?uf(e,o,mo(n)):o.startContainer===o.endContainer&&o.endOffset-o.startOffset==1&&Hn(o.startContainer.childNodes[o.startOffset])?o.deleteContents():e.getDoc().execCommand("Delete",!1)})(e);const p=i.getNode(),g={context:p.nodeName.toLowerCase(),data:o.data,insert:!0},f=a.parse(t,g);if(!0===o.paste&&Rf(e.schema,f)&&((e,t)=>!!Nf(e,t))(s,p))return u=Ff(c,s,i.getRng(),f),u&&i.setRng(u),t;!0===o.paste&&((e,t,o,n)=>{var r;const i=t.firstChild,s=t.lastChild,a=i===("bookmark"===s.attr("data-mce-type")?s.prev:s),l=Z(If,i.name);if(a&&l){const t="false"!==i.attr("contenteditable"),s=(null===(r=e.getParent(o,e.isBlock))||void 0===r?void 0:r.nodeName.toLowerCase())===i.name,a=F.from(yf(n,o)).forall(Yn);return t&&s&&a}return!1})(s,f,p,e.getBody())&&(null===(n=f.firstChild)||void 0===n||n.unwrap()),(e=>{let t=e;for(;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")})(f);let v=f.lastChild;if(v&&"mce_marker"===v.attr("id")){const t=v;for(v=v.prev;v;v=v.walk(!0))if(3===v.type||!s.isBlock(v.name)){v.parent&&e.schema.isValidChild(v.parent.name,"span")&&v.parent.insert(t,v,"br"===v.name);break}}if(e._selectionOverrides.showBlockCaretContainer(p),g.invalid){e.selection.setContent(d);let o,n=i.getNode();const l=e.getBody();for($n(n)?n=o=l:o=n;o&&o!==l;)n=o,o=o.parentNode;t=n===l?l.innerHTML:s.getOuterHTML(n);const u=a.parse(t);for(let e=u;e;e=e.walk())if("mce_marker"===e.attr("id")){e.replace(f);break}const h=f.children(),m=null!==(r=f.parent)&&void 0!==r?r:u;f.unwrap();const p=G(h,(t=>Bf(e.schema,t,m)));Mf(p,e.schema),Sf(a.getNodeFilters(),a.getAttributeFilters(),u),t=c.serialize(u),n===l?s.setHTML(l,t):s.setOuterHTML(n,t)}else t=c.serialize(f),((e,t,o)=>{var n;if("all"===o.getAttribute("data-mce-bogus"))null===(n=o.parentNode)||void 0===n||n.insertBefore(e.dom.createFragment(t),o);else{const n=o.firstChild,r=o.lastChild;!n||n===r&&"BR"===n.nodeName?e.dom.setHTML(o,t):e.selection.setContent(t,{no_events:!0})}})(e,t,p);var b;return((e,t)=>{const o=e.schema.getTextInlineElements(),n=e.dom;if(t){const t=e.getBody(),r=xf(e);Pt.each(n.select("*[data-mce-fragment]"),(e=>{if(_(o[e.nodeName.toLowerCase()])&&((e,t)=>oe(Ap(e,t),(e=>!(e=>Ep.has(e))(e))))(n,e))for(let o=e.parentElement;_(o)&&o!==t&&!Mp(n,e,o);o=o.parentElement)if(r.compare(o,e)){n.remove(e,!0);break}}))}})(e,l),((e,t)=>{var o,n,r;let i;const s=e.dom,a=e.selection;if(!t)return;a.scrollIntoView(t);const l=yf(e.getBody(),t);if(l&&"false"===s.getContentEditable(l))return s.remove(t),void a.select(l);let c=s.createRng();const d=t.previousSibling;if(Hn(d)){c.setStart(d,null!==(n=null===(o=d.nodeValue)||void 0===o?void 0:o.length)&&void 0!==n?n:0);const e=t.nextSibling;Hn(e)&&(d.appendData(e.data),null===(r=e.parentNode)||void 0===r||r.removeChild(e))}else c.setStartBefore(t),c.setEndBefore(t);const u=s.getParent(t,s.isBlock);s.remove(t),u&&s.isEmpty(u)&&(nn(mo(u)),c.setStart(u,0),c.setEnd(u,0),Lf(u)||(e=>!!e.getAttribute("data-mce-fragment"))(u)||!(i=(t=>{let o=Ca.fromRangeStart(t);return o=Ud(e.getBody()).next(o),null==o?void 0:o.toRange()})(c))?s.add(u,s.create("br",{"data-mce-bogus":"1"})):(c=i,s.remove(u))),a.setRng(c)})(e,s.get("mce_marker")),b=e.getBody(),Pt.each(b.getElementsByTagName("*"),(e=>{e.removeAttribute("data-mce-fragment")})),((e,t)=>{F.from(e.getParent(t,"td,th")).map(mo).each(Cr)})(s,i.getStart()),((e,t,o)=>{const n=So(mo(o),(e=>bo(e,mo(t))));ae(n,n.length-2).filter(Lt).fold((()=>ui(e,t)),(t=>ui(e,t.dom)))})(e.schema,e.getBody(),i.getStart()),t},Hf=e=>e instanceof fp,Zf=(e,t,o)=>{e.dom.setHTML(e.getBody(),t),!0!==o&&(e=>{ep(e)&&eu(e.getBody()).each((t=>{const o=t.getNode(),n=In(o)?eu(o).getOr(t):t;e.selection.setRng(n.toRange())}))})(e)},jf=(e,t)=>((e,t)=>{const o=e.dom;return o.parentNode?((e,t)=>J(e.dom.childNodes,(e=>t(mo(e)))).map(mo))(mo(o.parentNode),(o=>!bo(e,o)&&t(o))):F.none()})(e,t).isSome(),Uf=e=>x(e)?e:N,$f=(e,t,o)=>{const n=t(e),r=Uf(o);return n.orThunk((()=>r(e)?F.none():((e,t,o)=>{let n=e.dom;const r=Uf(o);for(;n.parentNode;){n=n.parentNode;const e=mo(n),o=t(e);if(o.isSome())return o;if(r(e))break}return F.none()})(e,t,r)))},Wf=Xu,qf=(e,t,o)=>{const n=e.formatter.get(o);if(n)for(let o=0;o<n.length;o++){const r=n[o];if(nh(r)&&!1===r.inherit&&e.dom.is(t,r.selector))return!0}return!1},Gf=(e,t,o,n,r)=>{const i=e.dom.getRoot();if(t===i)return!1;const s=e.dom.getParent(t,(t=>!!qf(e,t,o)||t.parentNode===i||!!Kf(e,t,o,n,!0)));return!!Kf(e,s,o,n,r)},Yf=(e,t,o)=>!(!rh(o)||!Wf(t,o.inline))||!(!oh(o)||!Wf(t,o.block))||!!nh(o)&&Pn(t)&&e.is(t,o.selector),Xf=(e,t,o,n,r,i)=>{const s=o[n],a="attributes"===n;if(x(o.onmatch))return o.onmatch(t,o,n);if(s)if(Te(s)){for(let o=0;o<s.length;o++)if(a?e.getAttrib(t,s[o]):Ju(e,t,s[o]))return!0}else for(const n in s)if(Ce(s,n)){const l=a?e.getAttrib(t,n):Ju(e,t,n),c=Yu(s[n],i),d=w(l)||Ge(l);if(d&&w(c))continue;if(r&&d&&!o.exact)return!1;if((!r||o.exact)&&!Wf(l,Ku(c,n)))return!1}return!0},Kf=(e,t,o,n,r)=>{const i=e.formatter.get(o),s=e.dom;if(i&&Pn(t))for(let o=0;o<i.length;o++){const a=i[o];if(Yf(e.dom,t,a)&&Xf(s,t,a,"attributes",r,n)&&Xf(s,t,a,"styles",r,n)){const o=a.classes;if(o)for(let r=0;r<o.length;r++)if(!e.dom.hasClass(t,Yu(o[r],n)))return;return a}}},Jf=(e,t,o,n,r)=>{if(n)return Gf(e,n,t,o,r);if(n=e.selection.getNode(),Gf(e,n,t,o,r))return!0;const i=e.selection.getStart();return!(i===n||!Gf(e,i,t,o,r))},Qf=kr,ev=e=>(e=>{const t=[];let o=e;for(;o;){if(Hn(o)&&o.data!==Qf||o.childNodes.length>1)return[];Pn(o)&&t.push(o),o=o.firstChild}return t})(e).length>0,tv=e=>{if(e){const t=new An(e,e);for(let e=t.current();e;e=t.next())if(Hn(e))return e}return null},ov=e=>{const t=uo("span");return Wt(t,{id:ou,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&tn(t,ho(Qf)),t},nv=(e,t,o=!0)=>{const n=e.dom,r=e.selection;if(ev(t))Rg(e,!1,mo(t),o);else{const e=r.getRng(),o=n.getParent(t,n.isBlock),i=e.startContainer,s=e.startOffset,a=e.endContainer,l=e.endOffset,c=(e=>{const t=tv(e);return t&&t.data.charAt(0)===Qf&&t.deleteData(0,1),t})(t);n.remove(t,!0),i===c&&s>0&&e.setStart(c,s-1),a===c&&l>0&&e.setEnd(c,l-1),o&&n.isEmpty(o)&&xr(mo(o)),r.setRng(e)}},rv=(e,t,o=!0)=>{const n=e.dom,r=e.selection;if(t)nv(e,t,o);else if(!(t=ru(e.getBody(),r.getStart())))for(;t=n.get(ou);)nv(e,t,!1)},iv=(e,t)=>(e.appendChild(t),t),sv=(e,t)=>{var o;const n=Y(e,((e,t)=>iv(e,t.cloneNode(!1))),t),r=null!==(o=n.ownerDocument)&&void 0!==o?o:document;return iv(n,r.createTextNode(Qf))},av=(e,t,o,n)=>{const r=e.dom,a=e.selection;let l=!1;const c=e.formatter.get(t);if(!c)return;const d=a.getRng(),u=d.startContainer,h=d.startOffset;let m=u;Hn(u)&&(h!==u.data.length&&(l=!0),m=m.parentNode);const p=[];let g;for(;m;){if(Kf(e,m,t,o,n)){g=m;break}m.nextSibling&&(l=!0),p.push(m),m=m.parentNode}if(g)if(l){const i=a.getBookmark();d.collapse(!0);let s=wh(r,d,c,!0);s=hm(s),e.formatter.remove(t,o,s,n),a.moveToBookmark(i)}else{const l=ru(e.getBody(),g),c=ov(!1).dom;((e,t,o)=>{var n,r;const i=e.dom,s=i.getParent(o,B($u,e.schema));s&&i.isEmpty(s)?null===(n=o.parentNode)||void 0===n||n.replaceChild(t,o):((e=>{const t=rr(e,"br"),o=G((e=>{const t=[];let o=e.dom;for(;o;)t.push(mo(o)),o=o.lastChild;return t})(e).slice(-1),hr);t.length===o.length&&$(o,rn)})(mo(o)),i.isEmpty(o)?null===(r=o.parentNode)||void 0===r||r.replaceChild(t,o):i.insertAfter(t,o))})(e,c,null!=l?l:g);const d=((e,t,o,n,r,a)=>{const l=e.formatter,c=e.dom,d=G(he(l.get()),(e=>e!==n&&!ze(e,"removeformat"))),u=((e,t,o)=>X(o,((o,n)=>{const r=((e,t)=>th(e,t,(e=>{const t=e=>x(e)||e.length>1&&"%"===e.charAt(0);return j(["styles","attributes"],(o=>xe(e,o).exists((e=>{const o=f(e)?e:_e(e);return j(o,t)}))))})))(e,n);return e.formatter.matchNode(t,n,{},r)?o.concat([n]):o}),[]))(e,o,d);if(G(u,(t=>!((e,t,o)=>{const n=["inline","block","selector","attributes","styles","classes"],r=e=>ye(e,((e,t)=>j(n,(e=>e===t))));return th(e,t,(t=>{const n=r(t);return th(e,o,(e=>{const t=r(e);return((e,t,o=s)=>i(o).eq(e,t))(n,t)}))}))})(e,t,n))).length>0){const e=o.cloneNode(!1);return c.add(t,e),l.remove(n,r,e,a),c.remove(e),F.some(e)}return F.none()})(e,c,g,t,o,n),u=sv(p.concat(d.toArray()),c);l&&nv(e,l,!1),a.setCursorLocation(u,1),r.isEmpty(g)&&r.remove(g)}},lv=(e,t)=>{const o=e.schema.getTextInlineElements();return Ce(o,Dt(t))&&!nu(t.dom)&&!Fn(t.dom)},cv={},dv=Vn(["pre"]);((e,t)=>{cv[e]||(cv[e]=[]),cv[e].push((e=>{if(!e.selection.getRng().collapsed){const t=e.selection.getSelectedBlocks(),o=G(G(t,dv),(e=>t=>{const o=t.previousSibling;return dv(o)&&Z(e,o)})(t));$(o,(e=>{((e,t)=>{const o=mo(t),n=_o(o).dom;rn(o),on(mo(e),[uo("br",n),uo("br",n),...Mo(o)])})(e.previousSibling,e)}))}}))})("pre");const uv=["fontWeight","fontStyle","color","fontSize","fontFamily"],hv=(e,t)=>{const o=e.get(t);return f(o)?J(o,(e=>rh(e)&&"span"===e.inline&&(e=>p(e.styles)&&j(he(e.styles),(e=>Z(uv,e))))(e))):F.none()},mv=(e,t)=>Qd(t,Ca.fromRangeStart(e)).isNone(),pv=(e,t)=>!1===Jd(t,Ca.fromRangeEnd(e)).exists((e=>!qn(e.getNode())||Jd(t,e).isSome())),gv=e=>t=>er(t)&&"false"!==e.getContentEditableParent(t),fv=e=>G(e.getSelectedBlocks(),gv(e.dom)),vv=Pt.each,bv=e=>Pn(e)&&!fu(e)&&!nu(e)&&!Fn(e),yv=(e,t)=>{for(let o=e;o;o=o[t]){if(Hn(o)&&qe(o.data))return e;if(Pn(o)&&!fu(o))return o}return e},wv=(e,t,o)=>{const n=xf(e),r=Pn(t)&&Hu(t),i=Pn(o)&&Hu(o);if(r&&i){const r=yv(t,"previousSibling"),i=yv(o,"nextSibling");if(n.compare(r,i)){for(let e=r.nextSibling;e&&e!==i;){const t=e;e=e.nextSibling,r.appendChild(t)}return e.dom.remove(i),Pt.each(Pt.grep(i.childNodes),(e=>{r.appendChild(e)})),r}}return o},_v=(e,t,o,n)=>{var r;if(n&&!1!==t.merge_siblings){const t=null!==(r=wv(e,Uu(n),n))&&void 0!==r?r:n;wv(e,t,Uu(t,!0))}},xv=(e,t,o)=>{vv(e.childNodes,(e=>{bv(e)&&(t(e)&&o(e),e.hasChildNodes()&&xv(e,t,o))}))},Cv=(e,t)=>o=>!(!o||!Ju(e,o,t)),kv=(e,t,o)=>n=>{e.setStyle(n,t,o),""===n.getAttribute("style")&&n.removeAttribute("style"),((e,t)=>{"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0)})(e,n)},Sv=Ga([{keep:[]},{rename:["name"]},{removed:[]}]),Tv=/^(src|href|style)$/,Ev=Pt.each,Ov=Xu,Av=(e,t,o)=>e.isChildOf(t,o)&&t!==o&&!e.isBlock(o),Mv=(e,t,o)=>{let n=t[o?"startContainer":"endContainer"],r=t[o?"startOffset":"endOffset"];if(Pn(n)){const e=n.childNodes.length-1;!o&&r&&r--,n=n.childNodes[r>e?e:r]}return Hn(n)&&o&&r>=n.data.length&&(n=new An(n,e.getBody()).next()||n),Hn(n)&&!o&&0===r&&(n=new An(n,e.getBody()).prev()||n),n},Bv=(e,t)=>{const o=t?"firstChild":"lastChild",n=e[o];return(e=>/^(TR|TH|TD)$/.test(e.nodeName))(e)&&n?"TR"===e.nodeName&&n[o]||n:e},Pv=(e,t,o,n)=>{var r;const i=e.create(o,n);return null===(r=t.parentNode)||void 0===r||r.insertBefore(i,t),i.appendChild(t),i},Rv=(e,t,o,n,r)=>{const i=mo(t),s=mo(e.create(n,r)),a=o?Ao(i):Oo(i);return on(s,a),o?(Jo(i,s),en(s,i)):(Qo(i,s),tn(s,i)),s.dom},Vv=(e,t,o)=>{const n=t.parentNode;let r;const i=e.dom,s=gl(e);oh(o)&&n===i.getRoot()&&(o.list_block&&Ov(t,o.list_block)||$(de(t.childNodes),(t=>{Wu(e,s,t.nodeName.toLowerCase())?r?r.appendChild(t):(r=Pv(i,t,s),i.setAttribs(r,fl(e))):r=null}))),(e=>nh(e)&&rh(e)&&Rt(xe(e,"mixed"),!0))(o)&&!Ov(o.inline,t)||i.remove(t,!0)},Nv=(e,t,o)=>C(e)?{name:t,value:null}:{name:e,value:Yu(t,o)},Dv=(e,t)=>{""===e.getAttrib(t,"style")&&(t.removeAttribute("style"),t.removeAttribute("data-mce-style"))},Fv=(e,t,o,n,r)=>{let i=!1;Ev(o.styles,((s,a)=>{const{name:l,value:c}=Nv(a,s,n),d=Ku(c,l);(o.remove_similar||v(c)||!Pn(r)||Ov(Ju(e,r,l),d))&&e.setStyle(t,l,""),i=!0})),i&&Dv(e,t)},Iv=(e,t,o,n,r)=>{const i=e.dom,s=xf(e),a=e.schema;if(rh(t)&&pi(a,t.inline)&&fi(a,n)&&n.parentElement===e.getBody())return Vv(e,n,t),Sv.removed();if(!t.ceFalseOverride&&n&&"false"===i.getContentEditableParent(n))return Sv.keep();if(n&&!Yf(i,n,t)&&!((e,t)=>t.links&&"A"===e.nodeName)(n,t))return Sv.keep();const l=n,c=t.preserve_attributes;if(rh(t)&&"all"===t.remove&&f(c)){const e=G(i.getAttribs(l),(e=>Z(c,e.name.toLowerCase())));if(i.removeAllAttribs(l),$(e,(e=>i.setAttrib(l,e.name,e.value))),e.length>0)return Sv.rename("span")}if("all"!==t.remove){Fv(i,l,t,o,r),Ev(t.attributes,((e,n)=>{const{name:s,value:a}=Nv(n,e,o);if(t.remove_similar||v(a)||!Pn(r)||Ov(i.getAttrib(r,s),a)){if("class"===s){const e=i.getAttrib(l,s);if(e){let t="";if($(e.split(/\s+/),(e=>{/mce\-\w+/.test(e)&&(t+=(t?" ":"")+e)})),t)return void i.setAttrib(l,s,t)}}if(Tv.test(s)&&l.removeAttribute("data-mce-"+s),"style"===s&&Vn(["li"])(l)&&"none"===i.getStyle(l,"list-style-type"))return l.removeAttribute(s),void i.setStyle(l,"list-style-type","none");"class"===s&&l.removeAttribute("className"),l.removeAttribute(s)}})),Ev(t.classes,(e=>{e=Yu(e,o),Pn(r)&&!i.hasClass(r,e)||i.removeClass(l,e)}));const e=i.getAttribs(l);for(let t=0;t<e.length;t++){const o=e[t].nodeName;if(!s.isAttributeInternal(o))return Sv.keep()}}return"none"!==t.remove?(Vv(e,l,t),Sv.removed()):Sv.keep()},Lv=(e,t,o,n,r)=>Iv(e,t,o,n,r).fold(N,(t=>(e.dom.rename(n,t),!0)),D),zv=(e,t,o,n)=>Iv(e,t,o,n,n).fold(O(n),(t=>(e.dom.createFragment().appendChild(n),e.dom.rename(n,t))),O(null)),Hv=(e,t,o,n,r)=>{const i=e.formatter.get(t),s=i[0],a=e.dom,l=e.selection,c=n=>{const a=((e,t,o,n,r)=>{let i;return t.parentNode&&$(eh(e.dom,t.parentNode).reverse(),(t=>{if(!i&&Pn(t)&&"_start"!==t.id&&"_end"!==t.id){const s=Kf(e,t,o,n,r);s&&!1!==s.split&&(i=t)}})),i})(e,n,t,o,r);return((e,t,o,n,r,i,s,a)=>{var l,c;let d,u;const h=e.dom;if(o){const i=o.parentNode;for(let o=n.parentNode;o&&o!==i;o=o.parentNode){let n=h.clone(o,!1);for(let o=0;o<t.length&&(n=zv(e,t[o],a,n),null!==n);o++);n&&(d&&n.appendChild(d),u||(u=n),d=n)}s.mixed&&h.isBlock(o)||(n=null!==(l=h.split(o,n))&&void 0!==l?l:n),d&&u&&(null===(c=r.parentNode)||void 0===c||c.insertBefore(d,r),u.appendChild(r),rh(s)&&_v(e,s,0,d))}return n})(e,i,a,n,n,0,s,o)},d=t=>j(i,(n=>Lv(e,n,o,t,t))),u=t=>{const o=de(t.childNodes),n=d(t)||j(i,(e=>Yf(a,t,e))),r=t.parentNode;if(!n&&_(r)&&ih(s)&&d(r),s.deep&&o.length)for(let e=0;e<o.length;e++)u(o[e]);$(["underline","line-through","overline"],(o=>{Pn(t)&&e.dom.getStyle(t,"text-decoration")===o&&t.parentNode&&Qu(a,t.parentNode)===o&&Lv(e,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:o}},void 0,t)}))},h=e=>{const t=a.get(e?"_start":"_end");if(t){let o=t[e?"firstChild":"lastChild"];return(e=>fu(e)&&Pn(e)&&("_start"===e.id||"_end"===e.id))(o)&&(o=o[e?"firstChild":"lastChild"]),Hn(o)&&0===o.data.length&&(o=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),a.remove(t,!0),o}return null},m=t=>{let o,n,r=wh(a,t,i,t.collapsed);if(s.split){if(r=hm(r),o=Mv(e,r,!0),n=Mv(e,r),o!==n){if(o=Bv(o,!0),n=Bv(n,!1),Av(a,o,n)){const e=F.from(o.firstChild).getOr(o);return c(Rv(a,e,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void h(!0)}if(Av(a,n,o)){const e=F.from(n.lastChild).getOr(n);return c(Rv(a,e,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void h(!1)}o=Pv(a,o,"span",{id:"_start","data-mce-type":"bookmark"}),n=Pv(a,n,"span",{id:"_end","data-mce-type":"bookmark"});const e=a.createRng();e.setStartAfter(o),e.setEndBefore(n),_h(a,e,(e=>{$(e,(e=>{fu(e)||fu(e.parentNode)||c(e)}))})),c(o),c(n),o=h(!0),n=h()}else o=n=c(o);r.startContainer=o.parentNode?o.parentNode:o,r.startOffset=a.nodeIndex(o),r.endContainer=n.parentNode?n.parentNode:n,r.endOffset=a.nodeIndex(n)+1}_h(a,r,(e=>{$(e,u)}))};if(n){if(Lu(n)){const e=a.createRng();e.setStartBefore(n),e.setEndAfter(n),m(e)}else m(n);Bh(e,t,n,o)}else l.isCollapsed()&&rh(s)&&!Mu(e).length?av(e,t,o,r):(Zu(e,(()=>Fu(e,m)),(n=>rh(s)&&Jf(e,t,o,n))),e.nodeChanged()),((e,t,o)=>{"removeformat"===t?$(fv(e.selection),(t=>{$(uv,(o=>e.dom.setStyle(t,o,""))),Dv(e.dom,t)})):hv(e.formatter,t).each((t=>{$(fv(e.selection),(n=>Fv(e.dom,n,t,o,null)))}))})(e,t,o),Bh(e,t,n,o)},Zv=Pt.each,jv=Pt.each,Uv=(e,t,o,n)=>{if(jv(o.styles,((o,r)=>{e.setStyle(t,r,Yu(o,n))})),o.styles){const o=e.getAttrib(t,"style");o&&e.setAttrib(t,"data-mce-style",o)}},$v=(e,t,o,n)=>{const r=e.formatter.get(t),i=r[0],s=!n&&e.selection.isCollapsed(),a=e.dom,l=e.selection,c=(e,t=i)=>{x(t.onformat)&&t.onformat(e,t,o,n),Uv(a,e,t,o),jv(t.attributes,((t,n)=>{a.setAttrib(e,n,Yu(t,o))})),jv(t.classes,(t=>{const n=Yu(t,o);a.hasClass(e,n)||a.addClass(e,n)}))},d=(e,t)=>{let o=!1;return jv(e,(e=>!(!nh(e)||("false"!==a.getContentEditable(t)||e.ceFalseOverride)&&(!_(e.collapsed)||e.collapsed===s)&&a.is(t,e.selector)&&!nu(t)&&(c(t,e),o=!0,1)))),o},u=e=>{if(m(e)){const t=a.create(e);return c(t),t}return null},h=(n,s,a)=>{const l=[];let h=!0;const m=i.inline||i.block,p=u(m);_h(n,s,(s=>{let u;const g=s=>{let f=!1,v=h,b=!1;const y=s.parentNode,w=y.nodeName.toLowerCase(),x=n.getContentEditable(s);_(x)&&(v=h,h="true"===x,f=!0,b=Gu(e,s));const C=h&&!f;if(qn(s)&&!((e,t,o,n)=>{if(ec(e)&&rh(t)&&o.parentNode){const t=Xi(e.schema),r=jf(mo(o),(e=>nu(e.dom)));return ke(t,n)&&ri(mo(o.parentNode),!1)&&!r}return!1})(e,i,s,w))return u=null,void(oh(i)&&n.remove(s));if((n=>(e=>oh(e)&&!0===e.wrapper)(i)&&Kf(e,n,t,o))(s))u=null;else{if(((t,o,n)=>{const r=(e=>oh(e)&&!0!==e.wrapper)(i)&&$u(e.schema,t)&&Wu(e,o,m);return n&&r})(s,w,C)){const e=n.rename(s,m);return c(e),l.push(e),void(u=null)}if(nh(i)){let e=d(r,s);if(!e&&_(y)&&ih(i)&&(e=d(r,y)),!rh(i)||e)return void(u=null)}_(p)&&((t,o,r,s)=>{const l=t.nodeName.toLowerCase(),c=Wu(e,m,l)&&Wu(e,o,m),d=!a&&Hn(t)&&Sr(t.data),u=nu(t),h=!rh(i)||!n.isBlock(t);return(r||s)&&c&&!d&&!u&&h})(s,w,C,b)?(u||(u=n.clone(p,!1),y.insertBefore(u,s),l.push(u)),b&&f&&(h=v),u.appendChild(s)):(u=null,$(de(s.childNodes),g),f&&(h=v),u=null)}};$(s,g)})),!0===i.links&&$(l,(e=>{const t=e=>{"A"===e.nodeName&&c(e,i),$(de(e.childNodes),t)};t(e)})),$(l,(s=>{const a=(e=>{let t=0;return $(e.childNodes,(e=>{(e=>_(e)&&Hn(e)&&0===e.length)(e)||fu(e)||t++})),t})(s);!(l.length>1)&&n.isBlock(s)||0!==a?(rh(i)||oh(i)&&i.wrapper)&&(i.exact||1!==a||(s=(e=>{const t=J(e.childNodes,zu).filter((e=>"false"!==n.getContentEditable(e)&&Yf(n,e,i)));return t.map((t=>{const o=n.clone(t,!1);return c(o),n.replace(o,e,!0),n.remove(t,!0),o})).getOr(e)})(s)),((e,t,o,n)=>{Zv(t,(t=>{rh(t)&&Zv(e.dom.select(t.inline,n),(n=>{bv(n)&&Lv(e,t,o,n,t.exact?n:null)})),((e,t,o)=>{if(t.clear_child_styles){const n=t.links?"*:not(a)":"*";vv(e.select(n,o),(o=>{bv(o)&&Hu(o)&&vv(t.styles,((t,n)=>{e.setStyle(o,n,"")}))}))}})(e.dom,t,n)}))})(e,r,o,s),((e,t,o,n,r)=>{const i=r.parentNode;Kf(e,i,o,n)&&Lv(e,t,n,r)||t.merge_with_parents&&i&&e.dom.getParent(i,(i=>!!Kf(e,i,o,n)&&(Lv(e,t,n,r),!0)))})(e,i,t,o,s),((e,t,o,n)=>{if(t.styles&&t.styles.backgroundColor){const r=Cv(e,"fontSize");xv(n,(e=>r(e)&&Hu(e)),kv(e,"backgroundColor",Yu(t.styles.backgroundColor,o)))}})(n,i,o,s),((e,t,o,n)=>{const r=t=>{if(Pn(t)&&Pn(t.parentNode)&&Hu(t)){const o=Qu(e,t.parentNode);e.getStyle(t,"color")&&o?e.setStyle(t,"text-decoration",o):e.getStyle(t,"text-decoration")===o&&e.setStyle(t,"text-decoration",null)}};t.styles&&(t.styles.color||t.styles.textDecoration)&&(Pt.walk(n,r,"childNodes"),r(n))})(n,i,0,s),((e,t,o,n)=>{if(rh(t)&&("sub"===t.inline||"sup"===t.inline)){const o=Cv(e,"fontSize");xv(n,(e=>o(e)&&Hu(e)),kv(e,"fontSize",""));const r=G(e.select("sup"===t.inline?"sub":"sup",n),Hu);e.remove(r,!0)}})(n,i,0,s),_v(e,i,0,s)):n.remove(s,!0)}))},p=Lu(n)?n:l.getNode();if("false"===a.getContentEditable(p)&&!Gu(e,p))return d(r,n=p),void Mh(e,t,n,o);if(i){if(n)if(Lu(n)){if(!d(r,n)){const e=a.createRng();e.setStartBefore(n),e.setEndAfter(n),h(a,wh(a,e,r),!0)}}else h(a,n,!0);else s&&rh(i)&&!Mu(e).length?((e,t,o)=>{let n;const r=e.selection,i=e.formatter.get(t);if(!i)return;const s=r.getRng();let a=s.startOffset;const l=s.startContainer.nodeValue;n=ru(e.getBody(),r.getStart());const c=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(l&&a>0&&a<l.length&&c.test(l.charAt(a))&&c.test(l.charAt(a-1))){const n=r.getBookmark();s.collapse(!0);let a=wh(e.dom,s,i);a=hm(a),e.formatter.apply(t,o,a),r.moveToBookmark(n)}else{let i=n?tv(n):null;n&&(null==i?void 0:i.data)===Qf||(d=e.getDoc(),u=ov(!0).dom,n=d.importNode(u,!0),i=n.firstChild,s.insertNode(n),a=1),e.formatter.apply(t,o,n),r.setCursorLocation(i,a)}var d,u})(e,t,o):(l.setRng(Pf(l.getRng())),Zu(e,(()=>{Fu(e,((e,t)=>{const o=t?e:wh(a,e,r);h(a,o,!1)}))}),D),e.nodeChanged()),hv(e.formatter,t).each((t=>{$((e=>G((e=>{const t=e.getSelectedBlocks(),o=e.getRng();if(e.isCollapsed())return[];if(1===t.length)return mv(o,t[0])&&pv(o,t[0])?t:[];{const e=le(t).filter((e=>mv(o,e))).toArray(),n=ce(t).filter((e=>pv(o,e))).toArray(),r=t.slice(1,-1);return e.concat(r).concat(n)}})(e),gv(e.dom)))(e.selection),(e=>Uv(a,e,t,o)))}));((e,t)=>{Ce(cv,e)&&$(cv[e],(e=>{e(t)}))})(t,e)}Mh(e,t,n,o)},Wv=e=>Ce(e,"vars"),qv=e=>e.selection.getStart(),Gv=(e,t,o,n,r)=>K(t,(t=>{const i=e.formatter.matchNode(t,o,null!=r?r:{},n);return!y(i)}),(t=>!!qf(e,t,o)||!n&&_(e.formatter.matchNode(t,o,r,!0)))),Yv=(e,t)=>{const o=null!=t?t:qv(e);return G(eh(e.dom,o),(e=>Pn(e)&&!Fn(e)))},Xv=(e,t,o)=>{const n=Yv(e,t);pe(o,((o,r)=>{const i=o=>{const i=Gv(e,n,r,o.similar,Wv(o)?o.vars:void 0),s=i.isSome();if(o.state.get()!==s){o.state.set(s);const e=i.getOr(t);Wv(o)?o.callback(s,{node:e,format:r,parents:n}):$(o.callbacks,(t=>t(s,{node:e,format:r,parents:n})))}};$([o.withSimilar,o.withoutSimilar],i),$(o.withVars,i)}))};function Kv(e){return Kv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kv(e)}function Jv(e,t){return Jv=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Jv(e,t)}function Qv(e,t,o){return Qv=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,o){var n=[null];n.push.apply(n,t);var r=new(Function.bind.apply(e,n));return o&&Jv(r,o.prototype),r},Qv.apply(null,arguments)}function eb(e){return function(e){if(Array.isArray(e))return tb(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return tb(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?tb(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tb(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}var ob=Object.hasOwnProperty,nb=Object.setPrototypeOf,rb=Object.isFrozen,ib=Object.getPrototypeOf,sb=Object.getOwnPropertyDescriptor,ab=Object.freeze,lb=Object.seal,cb=Object.create,db="undefined"!=typeof Reflect&&Reflect,ub=db.apply,hb=db.construct;ub||(ub=function(e,t,o){return e.apply(t,o)}),ab||(ab=function(e){return e}),lb||(lb=function(e){return e}),hb||(hb=function(e,t){return Qv(e,eb(t))});var mb,pb=kb(Array.prototype.forEach),gb=kb(Array.prototype.pop),fb=kb(Array.prototype.push),vb=kb(String.prototype.toLowerCase),bb=kb(String.prototype.match),yb=kb(String.prototype.replace),wb=kb(String.prototype.indexOf),_b=kb(String.prototype.trim),xb=kb(RegExp.prototype.test),Cb=(mb=TypeError,function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return hb(mb,t)});function kb(e){return function(t){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return ub(e,t,n)}}function Sb(e,t){nb&&nb(e,null);for(var o=t.length;o--;){var n=t[o];if("string"==typeof n){var r=vb(n);r!==n&&(rb(t)||(t[o]=r),n=r)}e[n]=!0}return e}function Tb(e){var t,o=cb(null);for(t in e)ub(ob,e,[t])&&(o[t]=e[t]);return o}function Eb(e,t){for(;null!==e;){var o=sb(e,t);if(o){if(o.get)return kb(o.get);if("function"==typeof o.value)return kb(o.value)}e=ib(e)}return function(e){return console.warn("fallback value for",e),null}}var Ob=ab(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ab=ab(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Mb=ab(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Bb=ab(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Pb=ab(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),Rb=ab(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Vb=ab(["#text"]),Nb=ab(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Db=ab(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Fb=ab(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ib=ab(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Lb=lb(/\{\{[\w\W]*|[\w\W]*\}\}/gm),zb=lb(/<%[\w\W]*|[\w\W]*%>/gm),Hb=lb(/^data-[\-\w.\u00B7-\uFFFF]/),Zb=lb(/^aria-[\-\w]+$/),jb=lb(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ub=lb(/^(?:\w+script|data):/i),$b=lb(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Wb=lb(/^html$/i),qb=function(){return"undefined"==typeof window?null:window},Gb=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:qb(),o=function(t){return e(t)};if(o.version="2.3.8",o.removed=[],!t||!t.document||9!==t.document.nodeType)return o.isSupported=!1,o;var n=t.document,r=t.document,i=t.DocumentFragment,s=t.HTMLTemplateElement,a=t.Node,l=t.Element,c=t.NodeFilter,d=t.NamedNodeMap,u=void 0===d?t.NamedNodeMap||t.MozNamedAttrMap:d,h=t.HTMLFormElement,m=t.DOMParser,p=t.trustedTypes,g=l.prototype,f=Eb(g,"cloneNode"),v=Eb(g,"nextSibling"),b=Eb(g,"childNodes"),y=Eb(g,"parentNode");if("function"==typeof s){var w=r.createElement("template");w.content&&w.content.ownerDocument&&(r=w.content.ownerDocument)}var _=function(e,t){if("object"!==Kv(e)||"function"!=typeof e.createPolicy)return null;var o=null,n="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(n)&&(o=t.currentScript.getAttribute(n));var r="dompurify"+(o?"#"+o:"");try{return e.createPolicy(r,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(p,n),x=_?_.createHTML(""):"",C=r,k=C.implementation,S=C.createNodeIterator,T=C.createDocumentFragment,E=C.getElementsByTagName,O=n.importNode,A={};try{A=Tb(r).documentMode?r.documentMode:{}}catch(e){}var M={};o.isSupported="function"==typeof y&&k&&void 0!==k.createHTMLDocument&&9!==A;var B,P,R=Lb,V=zb,N=Hb,D=Zb,F=Ub,I=$b,L=jb,z=null,H=Sb({},[].concat(eb(Ob),eb(Ab),eb(Mb),eb(Pb),eb(Vb))),Z=null,j=Sb({},[].concat(eb(Nb),eb(Db),eb(Fb),eb(Ib))),U=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$=null,W=null,q=!0,G=!0,Y=!1,X=!1,K=!1,J=!1,Q=!1,ee=!1,te=!1,oe=!1,ne=!0,re=!0,ie=!1,se={},ae=null,le=Sb({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ce=null,de=Sb({},["audio","video","img","source","image","track"]),ue=null,he=Sb({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),me="http://www.w3.org/1998/Math/MathML",pe="http://www.w3.org/2000/svg",ge="http://www.w3.org/1999/xhtml",fe=ge,ve=!1,be=["application/xhtml+xml","text/html"],ye=null,we=r.createElement("form"),_e=function(e){return e instanceof RegExp||e instanceof Function},xe=function(e){ye&&ye===e||(e&&"object"===Kv(e)||(e={}),e=Tb(e),z="ALLOWED_TAGS"in e?Sb({},e.ALLOWED_TAGS):H,Z="ALLOWED_ATTR"in e?Sb({},e.ALLOWED_ATTR):j,ue="ADD_URI_SAFE_ATTR"in e?Sb(Tb(he),e.ADD_URI_SAFE_ATTR):he,ce="ADD_DATA_URI_TAGS"in e?Sb(Tb(de),e.ADD_DATA_URI_TAGS):de,ae="FORBID_CONTENTS"in e?Sb({},e.FORBID_CONTENTS):le,$="FORBID_TAGS"in e?Sb({},e.FORBID_TAGS):{},W="FORBID_ATTR"in e?Sb({},e.FORBID_ATTR):{},se="USE_PROFILES"in e&&e.USE_PROFILES,q=!1!==e.ALLOW_ARIA_ATTR,G=!1!==e.ALLOW_DATA_ATTR,Y=e.ALLOW_UNKNOWN_PROTOCOLS||!1,X=e.SAFE_FOR_TEMPLATES||!1,K=e.WHOLE_DOCUMENT||!1,ee=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,oe=e.RETURN_TRUSTED_TYPE||!1,Q=e.FORCE_BODY||!1,ne=!1!==e.SANITIZE_DOM,re=!1!==e.KEEP_CONTENT,ie=e.IN_PLACE||!1,L=e.ALLOWED_URI_REGEXP||L,fe=e.NAMESPACE||ge,e.CUSTOM_ELEMENT_HANDLING&&_e(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(U.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&_e(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(U.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(U.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),B=B=-1===be.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,P="application/xhtml+xml"===B?function(e){return e}:vb,X&&(G=!1),te&&(ee=!0),se&&(z=Sb({},eb(Vb)),Z=[],!0===se.html&&(Sb(z,Ob),Sb(Z,Nb)),!0===se.svg&&(Sb(z,Ab),Sb(Z,Db),Sb(Z,Ib)),!0===se.svgFilters&&(Sb(z,Mb),Sb(Z,Db),Sb(Z,Ib)),!0===se.mathMl&&(Sb(z,Pb),Sb(Z,Fb),Sb(Z,Ib))),e.ADD_TAGS&&(z===H&&(z=Tb(z)),Sb(z,e.ADD_TAGS)),e.ADD_ATTR&&(Z===j&&(Z=Tb(Z)),Sb(Z,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&Sb(ue,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(ae===le&&(ae=Tb(ae)),Sb(ae,e.FORBID_CONTENTS)),re&&(z["#text"]=!0),K&&Sb(z,["html","head","body"]),z.table&&(Sb(z,["tbody"]),delete $.tbody),ab&&ab(e),ye=e)},Ce=Sb({},["mi","mo","mn","ms","mtext"]),ke=Sb({},["foreignobject","desc","title","annotation-xml"]),Se=Sb({},["title","style","font","a","script"]),Te=Sb({},Ab);Sb(Te,Mb),Sb(Te,Bb);var Ee=Sb({},Pb);Sb(Ee,Rb);var Oe=function(e){fb(o.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=x}catch(t){e.remove()}}},Ae=function(e,t){try{fb(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){fb(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Z[e])if(ee||te)try{Oe(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Me=function(e){var t,o;if(Q)e="<remove></remove>"+e;else{var n=bb(e,/^[\r\n\t ]+/);o=n&&n[0]}"application/xhtml+xml"===B&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var i=_?_.createHTML(e):e;if(fe===ge)try{t=(new m).parseFromString(i,B)}catch(e){}if(!t||!t.documentElement){t=k.createDocument(fe,"template",null);try{t.documentElement.innerHTML=ve?"":i}catch(e){}}var s=t.body||t.documentElement;return e&&o&&s.insertBefore(r.createTextNode(o),s.childNodes[0]||null),fe===ge?E.call(t,K?"html":"body")[0]:K?t.documentElement:s},Be=function(e){return S.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},Pe=function(e){return"object"===Kv(a)?e instanceof a:e&&"object"===Kv(e)&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Re=function(e,t,n){M[e]&&pb(M[e],(function(e){e.call(o,t,n,ye)}))},Ve=function(e){var t,n;if(Re("beforeSanitizeElements",e,null),(n=e)instanceof h&&("string"!=typeof n.nodeName||"string"!=typeof n.textContent||"function"!=typeof n.removeChild||!(n.attributes instanceof u)||"function"!=typeof n.removeAttribute||"function"!=typeof n.setAttribute||"string"!=typeof n.namespaceURI||"function"!=typeof n.insertBefore))return Oe(e),!0;if(xb(/[\u0080-\uFFFF]/,e.nodeName))return Oe(e),!0;var r=P(e.nodeName);if(Re("uponSanitizeElement",e,{tagName:r,allowedTags:z}),e.hasChildNodes()&&!Pe(e.firstElementChild)&&(!Pe(e.content)||!Pe(e.content.firstElementChild))&&xb(/<[/\w]/g,e.innerHTML)&&xb(/<[/\w]/g,e.textContent))return Oe(e),!0;if("select"===r&&xb(/<template/i,e.innerHTML))return Oe(e),!0;if(!z[r]||$[r]){if(!$[r]&&De(r)){if(U.tagNameCheck instanceof RegExp&&xb(U.tagNameCheck,r))return!1;if(U.tagNameCheck instanceof Function&&U.tagNameCheck(r))return!1}if(re&&!ae[r]){var i=y(e)||e.parentNode,s=b(e)||e.childNodes;if(s&&i)for(var a=s.length-1;a>=0;--a)i.insertBefore(f(s[a],!0),v(e))}return Oe(e),!0}return e instanceof l&&!function(e){var t=y(e);t&&t.tagName||(t={namespaceURI:ge,tagName:"template"});var o=vb(e.tagName),n=vb(t.tagName);return e.namespaceURI===pe?t.namespaceURI===ge?"svg"===o:t.namespaceURI===me?"svg"===o&&("annotation-xml"===n||Ce[n]):Boolean(Te[o]):e.namespaceURI===me?t.namespaceURI===ge?"math"===o:t.namespaceURI===pe?"math"===o&&ke[n]:Boolean(Ee[o]):e.namespaceURI===ge&&!(t.namespaceURI===pe&&!ke[n])&&!(t.namespaceURI===me&&!Ce[n])&&!Ee[o]&&(Se[o]||!Te[o])}(e)?(Oe(e),!0):"noscript"!==r&&"noembed"!==r||!xb(/<\/no(script|embed)/i,e.innerHTML)?(X&&3===e.nodeType&&(t=e.textContent,t=yb(t,R," "),t=yb(t,V," "),e.textContent!==t&&(fb(o.removed,{element:e.cloneNode()}),e.textContent=t)),Re("afterSanitizeElements",e,null),!1):(Oe(e),!0)},Ne=function(e,t,o){if(ne&&("id"===t||"name"===t)&&(o in r||o in we))return!1;if(G&&!W[t]&&xb(N,t));else if(q&&xb(D,t));else if(!Z[t]||W[t]){if(!(De(e)&&(U.tagNameCheck instanceof RegExp&&xb(U.tagNameCheck,e)||U.tagNameCheck instanceof Function&&U.tagNameCheck(e))&&(U.attributeNameCheck instanceof RegExp&&xb(U.attributeNameCheck,t)||U.attributeNameCheck instanceof Function&&U.attributeNameCheck(t))||"is"===t&&U.allowCustomizedBuiltInElements&&(U.tagNameCheck instanceof RegExp&&xb(U.tagNameCheck,o)||U.tagNameCheck instanceof Function&&U.tagNameCheck(o))))return!1}else if(ue[t]);else if(xb(L,yb(o,I,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==wb(o,"data:")||!ce[e])if(Y&&!xb(F,yb(o,I,"")));else if(o)return!1;return!0},De=function(e){return e.indexOf("-")>0},Fe=function(e){var t,o,n,r;Re("beforeSanitizeAttributes",e,null);var i=e.attributes;if(i){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z};for(r=i.length;r--;){var a=t=i[r],l=a.name,c=a.namespaceURI;o="value"===l?t.value:_b(t.value),n=P(l);var d=o;if(s.attrName=n,s.attrValue=o,s.keepAttr=!0,s.forceKeepAttr=void 0,Re("uponSanitizeAttribute",e,s),o=s.attrValue,!s.forceKeepAttr)if(s.keepAttr)if(xb(/\/>/i,o))Ae(l,e);else{X&&(o=yb(o,R," "),o=yb(o,V," "));var u=P(e.nodeName);if(Ne(u,n,o)){if(o!==d)try{c?e.setAttributeNS(c,l,o):e.setAttribute(l,o)}catch(t){Ae(l,e)}}else Ae(l,e)}else Ae(l,e)}Re("afterSanitizeAttributes",e,null)}},Ie=function e(t){var o,n=Be(t);for(Re("beforeSanitizeShadowDOM",t,null);o=n.nextNode();)Re("uponSanitizeShadowNode",o,null),Ve(o)||(o.content instanceof i&&e(o.content),Fe(o));Re("afterSanitizeShadowDOM",t,null)};return o.sanitize=function(e,r){var s,l,c,d,u;if((ve=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Pe(e)){if("function"!=typeof e.toString)throw Cb("toString is not a function");if("string"!=typeof(e=e.toString()))throw Cb("dirty is not a string, aborting")}if(!o.isSupported){if("object"===Kv(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(Pe(e))return t.toStaticHTML(e.outerHTML)}return e}if(J||xe(r),o.removed=[],"string"==typeof e&&(ie=!1),ie){if(e.nodeName){var h=P(e.nodeName);if(!z[h]||$[h])throw Cb("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof a)1===(l=(s=Me("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?s=l:s.appendChild(l);else{if(!ee&&!X&&!K&&-1===e.indexOf("<"))return _&&oe?_.createHTML(e):e;if(!(s=Me(e)))return ee?null:oe?x:""}s&&Q&&Oe(s.firstChild);for(var m=Be(ie?e:s);c=m.nextNode();)3===c.nodeType&&c===d||Ve(c)||(c.content instanceof i&&Ie(c.content),Fe(c),d=c);if(d=null,ie)return e;if(ee){if(te)for(u=T.call(s.ownerDocument);s.firstChild;)u.appendChild(s.firstChild);else u=s;return Z.shadowroot&&(u=O.call(n,u,!0)),u}var p=K?s.outerHTML:s.innerHTML;return K&&z["!doctype"]&&s.ownerDocument&&s.ownerDocument.doctype&&s.ownerDocument.doctype.name&&xb(Wb,s.ownerDocument.doctype.name)&&(p="<!DOCTYPE "+s.ownerDocument.doctype.name+">\n"+p),X&&(p=yb(p,R," "),p=yb(p,V," ")),_&&oe?_.createHTML(p):p},o.setConfig=function(e){xe(e),J=!0},o.clearConfig=function(){ye=null,J=!1},o.isValidAttribute=function(e,t,o){ye||xe({});var n=P(e),r=P(t);return Ne(n,r,o)},o.addHook=function(e,t){"function"==typeof t&&(M[e]=M[e]||[],fb(M[e],t))},o.removeHook=function(e){if(M[e])return gb(M[e])},o.removeHooks=function(e){M[e]&&(M[e]=[])},o.removeAllHooks=function(){M={}},o}();const Yb=Pt.explode,Xb=()=>{const e={};return{addFilter:(t,o)=>{$(Yb(t),(t=>{Ce(e,t)||(e[t]={name:t,callbacks:[]}),e[t].callbacks.push(o)}))},getFilters:()=>_e(e),removeFilter:(t,o)=>{$(Yb(t),(t=>{if(Ce(e,t))if(_(o)){const n=e[t],r=G(n.callbacks,(e=>e!==o));r.length>0?n.callbacks=r:delete e[t]}else delete e[t]}))}}},Kb=(e,t,o)=>{var n;const r=Qi();t.convert_fonts_to_spans&&((e,t,o)=>{e.addNodeFilter("font",(e=>{$(e,(e=>{const n=t.parse(e.attr("style")),r=e.attr("color"),i=e.attr("face"),s=e.attr("size");r&&(n.color=r),i&&(n["font-family"]=i),s&&Ye(s).each((e=>{n["font-size"]=o[e-1]})),e.name="span",e.attr("style",t.serialize(n)),((e,t)=>{$(["color","face","size"],(t=>{e.attr(t,null)}))})(e)}))}))})(e,r,Pt.explode(null!==(n=t.font_size_legacy_values)&&void 0!==n?n:"")),((e,t,o)=>{e.addNodeFilter("strike",(e=>{const n="html4"!==t.type;$(e,(e=>{if(n)e.name="s";else{const t=o.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",o.serialize(t))}}))}))})(e,o,r)},Jb=e=>{const[t,...o]=e.split(","),n=o.join(","),r=/data:([^/]+\/[^;]+)(;.+)?/.exec(t);if(r){const e=";base64"===r[2],t=e?(e=>{const t=/([a-z0-9+\/=\s]+)/i.exec(e);return t?t[1]:""})(n):decodeURIComponent(n);return F.some({type:r[1],data:t,base64Encoded:e})}return F.none()},Qb=(e,t,o=!0)=>{let n=t;if(o)try{n=atob(t)}catch(e){return F.none()}const r=new Uint8Array(n.length);for(let e=0;e<r.length;e++)r[e]=n.charCodeAt(e);return F.some(new Blob([r],{type:e}))},ey=e=>new Promise(((t,o)=>{const n=new FileReader;n.onloadend=()=>{t(n.result)},n.onerror=()=>{var e;o(null===(e=n.error)||void 0===e?void 0:e.message)},n.readAsDataURL(e)}));let ty=0;const oy=(e,t,o)=>Jb(e).bind((({data:e,type:n,base64Encoded:r})=>{if(t&&!r)return F.none();{const t=r?e:btoa(e);return o(t,n)}})),ny=(e,t,o)=>{const n=e.create("blobid"+ty++,t,o);return e.add(n),n},ry=(e,t,o=!1)=>oy(t,o,((t,o)=>F.from(e.getByData(t,o)).orThunk((()=>Qb(o,t).map((o=>ny(e,o,t))))))),iy=Pt.each,sy=Pt.trim,ay=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],ly={ftp:21,http:80,https:443,mailto:25},cy=["img","video"],dy=(e,t,o)=>{const n=(e=>{try{return decodeURIComponent(e)}catch(t){return unescape(e)}})(t);return!e.allow_script_urls&&(!!/((java|vb)script|mhtml):/i.test(n)||!e.allow_html_data_urls&&(/^data:image\//i.test(n)?((e,t)=>_(e)?!e:!_(t)||!Z(cy,t))(e.allow_svg_data_urls,o)&&/^data:image\/svg\+xml/i.test(n):/^data:/i.test(n)))};class uy{constructor(e,t={}){this.path="",this.directory="",e=sy(e),this.settings=t;const o=t.base_uri,n=this;if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))return void(n.source=e);const r=0===e.indexOf("//");if(0!==e.indexOf("/")||r||(e=(o&&o.protocol||"http")+"://mce_host"+e),!/^[\w\-]*:?\/\//.test(e)){const t=o?o.path:new uy(document.location.href).directory;if(""===(null==o?void 0:o.protocol))e="//mce_host"+n.toAbsPath(t,e);else{const r=/([^#?]*)([#?]?.*)/.exec(e);r&&(e=(o&&o.protocol||"http")+"://mce_host"+n.toAbsPath(t,r[1])+r[2])}}e=e.replace(/@@/g,"(mce_at)");const i=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);i&&iy(ay,((e,t)=>{let o=i[t];o&&(o=o.replace(/\(mce_at\)/g,"@@")),n[e]=o})),o&&(n.protocol||(n.protocol=o.protocol),n.userInfo||(n.userInfo=o.userInfo),n.port||"mce_host"!==n.host||(n.port=o.port),n.host&&"mce_host"!==n.host||(n.host=o.host),n.source=""),r&&(n.protocol="")}static parseDataUri(e){let t;const o=decodeURIComponent(e).split(","),n=/data:([^;]+)/.exec(o[0]);return n&&(t=n[1]),{type:t,data:o[1]}}static isDomSafe(e,t,o={}){if(o.allow_script_urls)return!0;{const n=Li.decode(e).replace(/[\s\u0000-\u001F]+/g,"");return!dy(o,n,t)}}static getDocumentBaseUrl(e){var t;let o;return o=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?null!==(t=e.href)&&void 0!==t?t:"":e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(o)&&(o=o.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(o)||(o+="/")),o}setPath(e){const t=/^(.*?)\/?(\w+)?$/.exec(e);t&&(this.path=t[0],this.directory=t[1],this.file=t[2]),this.source="",this.getURI()}toRelative(e){if("./"===e)return e;const t=new uy(e,{base_uri:this});if("mce_host"!==t.host&&this.host!==t.host&&t.host||this.port!==t.port||this.protocol!==t.protocol&&""!==t.protocol)return t.getURI();const o=this.getURI(),n=t.getURI();if(o===n||"/"===o.charAt(o.length-1)&&o.substr(0,o.length-1)===n)return o;let r=this.toRelPath(this.path,t.path);return t.query&&(r+="?"+t.query),t.anchor&&(r+="#"+t.anchor),r}toAbsolute(e,t){const o=new uy(e,{base_uri:this});return o.getURI(t&&this.isSameOrigin(o))}isSameOrigin(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;const t=this.protocol?ly[this.protocol]:null;if(t&&(this.port||t)==(e.port||t))return!0}return!1}toRelPath(e,t){let o,n,r=0,i="";const s=e.substring(0,e.lastIndexOf("/")).split("/"),a=t.split("/");if(s.length>=a.length)for(o=0,n=s.length;o<n;o++)if(o>=a.length||s[o]!==a[o]){r=o+1;break}if(s.length<a.length)for(o=0,n=a.length;o<n;o++)if(o>=s.length||s[o]!==a[o]){r=o+1;break}if(1===r)return t;for(o=0,n=s.length-(r-1);o<n;o++)i+="../";for(o=r-1,n=a.length;o<n;o++)i+=o!==r-1?"/"+a[o]:a[o];return i}toAbsPath(e,t){let o=0;const n=/\/$/.test(t)?"/":"",r=e.split("/"),i=t.split("/"),s=[];iy(r,(e=>{e&&s.push(e)}));const a=[];for(let e=i.length-1;e>=0;e--)0!==i[e].length&&"."!==i[e]&&(".."!==i[e]?o>0?o--:a.push(i[e]):o++);const l=s.length-o;let c;return c=l<=0?ne(a).join("/"):s.slice(0,l).join("/")+"/"+ne(a).join("/"),0!==c.indexOf("/")&&(c="/"+c),n&&c.lastIndexOf("/")!==c.length-1&&(c+=n),c}getURI(e=!1){let t;return this.source&&!e||(t="",e||(this.protocol?t+=this.protocol+"://":t+="//",this.userInfo&&(t+=this.userInfo+"@"),this.host&&(t+=this.host),this.port&&(t+=":"+this.port)),this.path&&(t+=this.path),this.query&&(t+="?"+this.query),this.anchor&&(t+="#"+this.anchor),this.source=t),this.source}}const hy=Pt.makeMap,my=Pt.extend,py={IN_PLACE:!0,ALLOW_UNKNOWN_PROTOCOLS:!0,ALLOWED_TAGS:["#comment","#cdata-section","body"],ALLOWED_ATTR:[]},gy=Pt.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),fy="data-mce-type",vy=(e,t)=>{const o=Gb(),n=t.getSpecialElements(),r=e.validate;let i=0;return o.addHook("uponSanitizeElement",((o,s)=>{var a,l,c;8===o.nodeType&&!e.allow_conditional_comments&&/^\[if/i.test(null!==(a=o.nodeValue)&&void 0!==a?a:"")&&(o.nodeValue=" "+o.nodeValue);const d=s.tagName;if(1!==o.nodeType||"body"===d)return;const u=mo(o),h=d.toLowerCase(),p=Yt(u,fy),g=qt(u,"data-mce-bogus");if(!p&&m(g))return void("all"===g?rn(u):sn(u));const f=t.getElementRule(h);if(!r||f){if(s.allowedTags[d]=!0,r&&f&&!p){if($(null!==(l=f.attributesForced)&&void 0!==l?l:[],(e=>{$t(u,e.name,"{$uid}"===e.value?"mce_"+i++:e.value)})),$(null!==(c=f.attributesDefault)&&void 0!==c?c:[],(e=>{Yt(u,e.name)||$t(u,e.name,"{$uid}"===e.value?"mce_"+i++:e.value)})),f.attributesRequired&&!j(f.attributesRequired,(e=>Yt(u,e))))return void sn(u);if(f.removeEmptyAttrs&&(e=>{const t=e.dom.attributes;return null==t||0===t.length})(u))return void sn(u);f.outputName&&f.outputName!==h&&((e,t)=>{const o=((e,t)=>{const o=uo(t),n=Kt(e);return Wt(o,n),o})(e,t);Qo(e,o);const n=Mo(e);on(o,n),rn(e)})(u,f.outputName)}}else Ce(n,h)?rn(u):sn(u)})),o.addHook("uponSanitizeAttribute",((o,n)=>{const i=o.tagName.toLowerCase(),{attrName:s,attrValue:a}=n;n.keepAttr=!r||t.isValid(i,s)||He(s,"data-")||He(s,"aria-"),s in gy&&dy(e,a,i)&&(n.keepAttr=!1),n.keepAttr?(n.allowedAttributes[s]=!0,s in t.getBoolAttrs()&&(n.attrValue=s),e.allow_svg_data_urls&&He(a,"data:image/svg+xml")&&(n.forceKeepAttr=!0)):!o.hasAttribute(fy)||"id"!==s&&"class"!==s&&"style"!==s||(n.forceKeepAttr=!0)})),o},by=(e,t,o)=>{const n=e.name,r=n in o&&"title"!==n&&"textarea"!==n,i=t.childNodes;for(let t=0,n=i.length;t<n;t++){const n=i[t],s=new fp(n.nodeName.toLowerCase(),n.nodeType);if(Pn(n)){const e=n.attributes;for(let t=0,o=e.length;t<o;t++){const o=e[t];s.attr(o.name,o.value)}}else Hn(n)?(s.value=n.data,r&&(s.raw=!0)):(Un(n)||Zn(n)||jn(n))&&(s.value=n.data);by(s,n,o),e.append(s)}},yy=(e={},t=Ji())=>{const o=Xb(),n=Xb(),r={validate:!0,root_name:"body",...e},i=new DOMParser,s=vy(r,t),a=o.addFilter,l=o.getFilters,c=o.removeFilter,d=n.addFilter,u=n.getFilters,h=n.removeFilter,p=(e,o)=>{const n=m(o.attr(fy)),r=1===o.type&&!Ce(e,o.name)&&!((e,t)=>1===t.type&&pi(e,t.name)&&m(t.attr(ii)))(t,o);return 3===o.type||r&&!n},g={schema:t,addAttributeFilter:d,getAttributeFilters:u,removeAttributeFilter:h,addNodeFilter:a,getNodeFilters:l,removeNodeFilter:c,parse:(e,o={})=>{var n;const a=r.validate,c=null!==(n=o.context)&&void 0!==n?n:r.root_name,d=((e,o,n="html")=>{const a="xhtml"===n?"application/xhtml+xml":"text/html",l=Ce(t.getSpecialElements(),o.toLowerCase()),c=l?`<${o}>${e}</${o}>`:e,d="xhtml"===n?`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>${c}</body></html>`:`<body>${c}</body>`,u=i.parseFromString(d,a).body;return s.sanitize(u,((e,t)=>{const o={...py};return o.PARSER_MEDIA_TYPE=t,e.allow_script_urls?o.ALLOWED_URI_REGEXP=/.*/:e.allow_html_data_urls&&(o.ALLOWED_URI_REGEXP=/^(?!(\w+script|mhtml):)/i),o})(r,a)),s.removed=[],l?u.firstChild:u})(e,c,o.format);ui(t,d);const h=new fp(c,11);by(h,d,t.getSpecialElements()),d.innerHTML="";const[m,g]=((e,t,o,n)=>{const r=o.validate,i=t.getNonEmptyElements(),s=t.getWhitespaceElements(),a=my(hy("script,style,head,html,body,title,meta,param"),t.getBlockElements()),l=Xi(t),c=/[ \t\r\n]+/g,d=/^[ \t\r\n]+/,u=/[ \t\r\n]+$/,h=e=>{let t=e.parent;for(;_(t);){if(t.name in s)return!0;t=t.parent}return!1},m=e=>e.name in a&&!vi(t,e),p=(t,o)=>{const r=o?t.prev:t.next;return!_(r)&&!w(t.parent)&&m(t.parent)&&(t.parent!==e||!0===n.isRootContent)};return[e=>{var t;if(3===e.type&&!h(e)){let o=null!==(t=e.value)&&void 0!==t?t:"";o=o.replace(c," "),(((e,t)=>_(e)&&(t(e)||"br"===e.name))(e.prev,m)||p(e,!0))&&(o=o.replace(d,"")),0===o.length?e.remove():e.value=o}},e=>{var o;if(1===e.type){const o=t.getElementRule(e.name);if(r&&o){const r=Of(t,i,s,e);o.paddInEmptyBlock&&r&&(e=>{let o=e;for(;_(o);){if(o.name in l)return Of(t,i,s,o);o=o.parent}return!1})(e)?Tf(n,m,e):o.removeEmpty&&r?m(e)?e.remove():e.unwrap():o.paddEmpty&&(r||(e=>{var t;return Ef(e,"#text")&&(null===(t=null==e?void 0:e.firstChild)||void 0===t?void 0:t.value)===or})(e))&&Tf(n,m,e)}}else if(3===e.type&&!h(e)){let t=null!==(o=e.value)&&void 0!==o?o:"";(e.next&&m(e.next)||p(e,!1))&&(t=t.replace(u,"")),0===t.length?e.remove():e.value=t}}]})(h,t,r,o),f=[],v=a?e=>((e,o)=>{Bf(t,e)&&o.push(e)})(e,f):S,b={nodes:{},attributes:{}},y=e=>Cf(l(),u(),e,b);if(((e,t,o)=>{const n=[];for(let o=e,r=o;o;r=o,o=o.walk()){const i=o;$(t,(e=>e(i))),w(i.parent)&&i!==e?o=r:n.push(i)}for(let e=n.length-1;e>=0;e--){const t=n[e];$(o,(e=>e(t)))}})(h,[m,y],[g,v]),f.reverse(),a&&f.length>0)if(o.context){const{pass:e,fail:n}=q(f,(e=>e.parent===h));Mf(n,t,y),o.invalid=e.length>0}else Mf(f,t,y);const x=((e,t)=>{var o;const n=null!==(o=t.forced_root_block)&&void 0!==o?o:e.forced_root_block;return!1===n?"":!0===n?"p":n})(r,o);return x&&("body"===h.name||o.isRootContent)&&((e,o)=>{const n=my(hy("script,style,head,html,body,title,meta,param"),t.getBlockElements()),i=/^[ \t\r\n]+/,s=/[ \t\r\n]+$/;let a=e.firstChild,l=null;const c=e=>{var t,o;e&&(a=e.firstChild,a&&3===a.type&&(a.value=null===(t=a.value)||void 0===t?void 0:t.replace(i,"")),a=e.lastChild,a&&3===a.type&&(a.value=null===(o=a.value)||void 0===o?void 0:o.replace(s,"")))};if(t.isValidChild(e.name,o.toLowerCase())){for(;a;){const t=a.next;p(n,a)?(l||(l=new fp(o,1),l.attr(r.forced_root_block_attrs),e.insert(l,a)),l.append(a)):(c(l),l=null),a=t}c(l)}})(h,x),o.invalid||kf(b,o),h}};return((e,t)=>{const o=e.schema;t.remove_trailing_brs&&e.addNodeFilter("br",((e,t,n)=>{const r=Pt.extend({},o.getBlockElements()),i=o.getNonEmptyElements(),s=o.getWhitespaceElements();r.body=1;const a=e=>e.name in r&&vi(o,e);for(let t=0,l=e.length;t<l;t++){let l=e[t],c=l.parent;if(c&&r[c.name]&&l===c.lastChild){let e=l.prev;for(;e;){const t=e.name;if("span"!==t||"bookmark"!==e.attr("data-mce-type")){"br"===t&&(l=null);break}e=e.prev}if(l&&(l.remove(),Of(o,i,s,c))){const e=o.getElementRule(c.name);e&&(e.removeEmpty?c.remove():e.paddEmpty&&Tf(n,a,c))}}else{let e=l;for(;c&&c.firstChild===e&&c.lastChild===e&&(e=c,!r[c.name]);)c=c.parent;if(e===c){const e=new fp("#text",3);e.value=or,l.replace(e)}}}})),e.addAttributeFilter("href",(e=>{let o=e.length;const n=e=>{const t=e?Pt.trim(e):"";return/\b(noopener)\b/g.test(t)?t:(e=>e.split(" ").filter((e=>e.length>0)).concat(["noopener"]).sort().join(" "))(t)};if(!t.allow_unsafe_link_target)for(;o--;){const t=e[o];"a"===t.name&&"_blank"===t.attr("target")&&t.attr("rel",n(t.attr("rel")))}})),t.allow_html_in_named_anchor||e.addAttributeFilter("id,name",(e=>{let t,o,n,r,i=e.length;for(;i--;)if(r=e[i],"a"===r.name&&r.firstChild&&!r.attr("href"))for(n=r.parent,t=r.lastChild;t&&n;)o=t.prev,n.insert(t,r),t=o})),t.fix_list_elements&&e.addNodeFilter("ul,ol",(e=>{let t,o,n=e.length;for(;n--;)if(t=e[n],o=t.parent,o&&("ul"===o.name||"ol"===o.name))if(t.prev&&"li"===t.prev.name)t.prev.append(t);else{const e=new fp("li",1);e.attr("style","list-style-type: none"),t.wrap(e)}}));const n=o.getValidClasses();t.validate&&n&&e.addAttributeFilter("class",(e=>{var t;let o=e.length;for(;o--;){const r=e[o],i=null!==(t=r.attr("class"))&&void 0!==t?t:"",s=Pt.explode(i," ");let a="";for(let e=0;e<s.length;e++){const t=s[e];let o=!1,i=n["*"];i&&i[t]&&(o=!0),i=n[r.name],!o&&i&&i[t]&&(o=!0),o&&(a&&(a+=" "),a+=t)}a.length||(a=null),r.attr("class",a)}})),((e,t)=>{const{blob_cache:o}=t;if(o){const t=e=>{const t=e.attr("src");(e=>e.attr("src")===Ot.transparentSrc||_(e.attr("data-mce-placeholder")))(e)||(e=>_(e.attr("data-mce-bogus")))(e)||w(t)||ry(o,t,!0).each((t=>{e.attr("src",t.blobUri())}))};e.addAttributeFilter("src",(e=>$(e,t)))}})(e,t)})(g,r),((e,t,o)=>{t.inline_styles&&Kb(e,t,o)})(g,r,t),g},wy=(e,t)=>{const o=(e=>Hf(e)?Tp({validate:!1}).serialize(e):e)(e),n=t(o);if(n.isDefaultPrevented())return n;if(Hf(e)){if(n.content!==o){const t=yy({validate:!1,forced_root_block:!1}).parse(n.content,{context:e.name});return{...n,content:t}}return{...n,content:e}}return n},_y=(e,t)=>{if(t.no_events)return qa.value(t);{const o=((e,t)=>e.dispatch("BeforeGetContent",t))(e,t);return o.isDefaultPrevented()?qa.error(Rh(e,{content:"",...o}).content):qa.value(o)}},xy=(e,t,o)=>o.no_events?t:wy(t,(t=>Rh(e,{...o,content:t}))).content,Cy=(e,t)=>{if(t.no_events)return qa.value(t);{const o=wy(t.content,(o=>((e,t)=>e.dispatch("BeforeSetContent",t))(e,{...t,content:o})));return o.isDefaultPrevented()?(Ph(e,o),qa.error(void 0)):qa.value(o)}},ky=(e,t,o)=>{o.no_events||Ph(e,{...o,content:t})},Sy=(e,t,o)=>({element:e,width:t,rows:o}),Ty=(e,t)=>({element:e,cells:t}),Ey=(e,t)=>({x:e,y:t}),Oy=(e,t)=>Gt(e,t).bind(Ye).getOr(1),Ay=(e,t,o)=>{const n=e.rows;return!!(n[o]?n[o].cells:[])[t]},My=e=>X(e,((e,t)=>t.cells.length>e?t.cells.length:e),0),By=(e,t)=>{const o=e.rows;for(let e=0;e<o.length;e++){const n=o[e].cells;for(let o=0;o<n.length;o++)if(bo(n[o],t))return F.some(Ey(o,e))}return F.none()},Py=(e,t,o,n,r)=>{const i=[],s=e.rows;for(let e=o;e<=r;e++){const o=s[e].cells,r=t<n?o.slice(t,n+1):o.slice(n,t+1);i.push(Ty(s[e].element,r))}return i},Ry=e=>((e,t)=>{const o=$s(e.element),n=uo("tbody");return on(n,t),tn(o,n),o})(e,(e=>U(e.rows,(e=>{const t=U(e.cells,(e=>{const t=Ws(e);return Xt(t,"colspan"),Xt(t,"rowspan"),t})),o=$s(e.element);return on(o,t),o})))(e)),Vy=(e,t)=>{const o=mo(t.commonAncestorContainer),n=qp(o,e),r=G(n,wr),i=((e,t)=>J(e,(e=>"li"===Dt(e)&&Vu(e,t))).fold(O([]),(t=>(e=>J(e,(e=>"ul"===Dt(e)||"ol"===Dt(e))))(e).map((e=>{const t=uo(Dt(e)),o=ye(Xo(e),((e,t)=>He(t,"list-style")));return Wo(t,o),[uo("li"),t]})).getOr([]))))(n,t),s=r.concat(i.length?i:(e=>gr(e)?Co(e).filter(pr).fold(O([]),(t=>[e,t])):pr(e)?[e]:[])(o));return U(s,$s)},Ny=()=>em([]),Dy=(e,t)=>((e,t)=>Sn(t,"table",B(bo,e)))(e,t[0]).bind((e=>{const o=t[0],n=t[t.length-1],r=(e=>{const t=Sy($s(e),0,[]);return $(rr(e,"tr"),((e,o)=>{$(rr(e,"td,th"),((n,r)=>{((e,t,o,n,r)=>{const i=Oy(r,"rowspan"),s=Oy(r,"colspan"),a=e.rows;for(let e=o;e<o+i;e++){a[e]||(a[e]=Ty(Ws(n),[]));for(let n=t;n<t+s;n++)a[e].cells[n]=e===o&&n===t?r:$s(r)}})(t,((e,t,o)=>{for(;Ay(e,t,o);)t++;return t})(t,r,o),o,e,n)}))})),Sy(t.element,My(t.rows),t.rows)})(e);return((e,t,o)=>By(e,t).bind((t=>By(e,o).map((o=>((e,t,o)=>{const n=t.x,r=t.y,i=o.x,s=o.y,a=r<s?Py(e,n,r,i,s):Py(e,n,s,i,r);return Sy(e.element,My(a),a)})(e,t,o))))))(r,o,n).map((e=>em([Ry(e)])))})).getOrThunk(Ny),Fy=(e,t)=>{const o=Au(t,e);return o.length>0?Dy(e,o):((e,t)=>t.length>0&&t[0].collapsed?Ny():((e,t)=>((e,t)=>{const o=X(t,((e,t)=>(tn(t,e),t)),e);return t.length>0?em([o]):o})(mo(t.cloneContents()),Vy(e,t)))(e,t[0]))(e,t)},Iy=(e,t)=>t>=0&&t<e.length&&yu(e.charAt(t)),Ly=e=>Tr(e.innerText),zy=e=>Pn(e)?e.outerHTML:Hn(e)?Li.encodeRaw(e.data,!1):Un(e)?"\x3c!--"+e.data+"--\x3e":"",Hy=(e,t)=>(((e,t)=>{let o=0;$(e,(e=>{0===e[0]?o++:1===e[0]?(((e,t,o)=>{const n=(e=>{let t;const o=document.createElement("div"),n=document.createDocumentFragment();for(e&&(o.innerHTML=e);t=o.firstChild;)n.appendChild(t);return n})(t);if(e.hasChildNodes()&&o<e.childNodes.length){const t=e.childNodes[o];e.insertBefore(n,t)}else e.appendChild(n)})(t,e[1],o),o++):2===e[0]&&((e,t)=>{if(e.hasChildNodes()&&t<e.childNodes.length){const o=e.childNodes[t];e.removeChild(o)}})(t,o)}))})(((e,t)=>{const o=e.length+t.length+2,n=new Array(o),r=new Array(o),i=(o,n,r,s,l)=>{const c=a(o,n,r,s);if(null===c||c.start===n&&c.diag===n-s||c.end===o&&c.diag===o-r){let i=o,a=r;for(;i<n||a<s;)i<n&&a<s&&e[i]===t[a]?(l.push([0,e[i]]),++i,++a):n-o>s-r?(l.push([2,e[i]]),++i):(l.push([1,t[a]]),++a)}else{i(o,c.start,r,c.start-c.diag,l);for(let t=c.start;t<c.end;++t)l.push([0,e[t]]);i(c.end,n,c.end-c.diag,s,l)}},s=(o,n,r,i)=>{let s=o;for(;s-n<i&&s<r&&e[s]===t[s-n];)++s;return((e,t,o)=>({start:e,end:t,diag:o}))(o,s,n)},a=(o,i,a,l)=>{const c=i-o,d=l-a;if(0===c||0===d)return null;const u=c-d,h=d+c,m=(h%2==0?h:h+1)/2;let p,g,f,v,b;for(n[1+m]=o,r[1+m]=i+1,p=0;p<=m;++p){for(g=-p;g<=p;g+=2){for(f=g+m,g===-p||g!==p&&n[f-1]<n[f+1]?n[f]=n[f+1]:n[f]=n[f-1]+1,v=n[f],b=v-o+a-g;v<i&&b<l&&e[v]===t[b];)n[f]=++v,++b;if(u%2!=0&&u-p<=g&&g<=u+p&&r[f-u]<=n[f])return s(r[f-u],g+o-a,i,l)}for(g=u-p;g<=u+p;g+=2){for(f=g+m-u,g===u-p||g!==u+p&&r[f+1]<=r[f-1]?r[f]=r[f+1]-1:r[f]=r[f-1],v=r[f]-1,b=v-o+a-g;v>=o&&b>=a&&e[v]===t[b];)r[f]=v--,b--;if(u%2==0&&-p<=g&&g<=p&&r[f]<=n[f+u])return s(r[f],g+o-a,i,l)}}return null},l=[];return i(0,e.length,0,t.length,l),l})(U(de(t.childNodes),zy),e),t),t),Zy=Ve((()=>document.implementation.createHTMLDocument("undo"))),jy=e=>{const t=(o=e.getBody(),G(U(de(o.childNodes),zy),(e=>e.length>0)));var o;const n=te(t,(t=>{const o=yp(e.serializer,t);return o.length>0?[o]:[]})),r=n.join("");return(e=>-1!==e.indexOf("</iframe>"))(r)?(e=>({type:"fragmented",fragments:e,content:"",bookmark:null,beforeBookmark:null}))(n):(e=>({type:"complete",fragments:null,content:e,bookmark:null,beforeBookmark:null}))(r)},Uy=(e,t,o)=>{const n=o?t.beforeBookmark:t.bookmark;"fragmented"===t.type?Hy(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw",no_selection:!_(n)||!su(n)||!n.isFakeCaret}),n&&(e.selection.moveToBookmark(n),e.selection.scrollIntoView())},$y=e=>"fragmented"===e.type?e.fragments.join(""):e.content,Wy=e=>{const t=uo("body",Zy());return cn(t,$y(e)),$(rr(t,"*[data-mce-bogus]"),sn),ln(t)},qy=(e,t)=>!(!e||!t)&&(!!((e,t)=>$y(e)===$y(t))(e,t)||((e,t)=>Wy(e)===Wy(t))(e,t)),Gy=e=>0===e.get(),Yy=(e,t,o)=>{Gy(o)&&(e.typing=t)},Xy=(e,t)=>{e.typing&&(Yy(e,!1,t),e.add())},Ky=e=>({init:{bindEvents:S},undoManager:{beforeChange:(t,o)=>((e,t,o)=>{Gy(t)&&o.set(Ua(e.selection))})(e,t,o),add:(t,o,n,r,i,s)=>((e,t,o,n,r,i,s)=>{const a=jy(e),l=Pt.extend(i||{},a);if(!Gy(n)||e.removed)return null;const c=t.data[o.get()];if(e.dispatch("BeforeAddUndo",{level:l,lastLevel:c,originalEvent:s}).isDefaultPrevented())return null;if(c&&qy(c,l))return null;t.data[o.get()]&&r.get().each((e=>{t.data[o.get()].beforeBookmark=e}));const d=lc(e);if(d&&t.data.length>d){for(let e=0;e<t.data.length-1;e++)t.data[e]=t.data[e+1];t.data.length--,o.set(t.data.length)}l.bookmark=Ua(e.selection),o.get()<t.data.length-1&&(t.data.length=o.get()+1),t.data.push(l),o.set(t.data.length-1);const u={level:l,lastLevel:c,originalEvent:s};return o.get()>0?(e.setDirty(!0),e.dispatch("AddUndo",u),e.dispatch("change",u)):e.dispatch("AddUndo",u),l})(e,t,o,n,r,i,s),undo:(t,o,n)=>((e,t,o,n)=>{let r;return t.typing&&(t.add(),t.typing=!1,Yy(t,!1,o)),n.get()>0&&(n.set(n.get()-1),r=t.data[n.get()],Uy(e,r,!0),e.setDirty(!0),e.dispatch("Undo",{level:r})),r})(e,t,o,n),redo:(t,o)=>((e,t,o)=>{let n;return t.get()<o.length-1&&(t.set(t.get()+1),n=o[t.get()],Uy(e,n,!1),e.setDirty(!0),e.dispatch("Redo",{level:n})),n})(e,t,o),clear:(t,o)=>((e,t,o)=>{t.data=[],o.set(0),t.typing=!1,e.dispatch("ClearUndos")})(e,t,o),reset:e=>(e=>{e.clear(),e.add()})(e),hasUndo:(t,o)=>((e,t,o)=>o.get()>0||t.typing&&t.data[0]&&!qy(jy(e),t.data[0]))(e,t,o),hasRedo:(e,t)=>((e,t)=>t.get()<e.data.length-1&&!e.typing)(e,t),transact:(e,t,o)=>((e,t,o)=>(Xy(e,t),e.beforeChange(),e.ignore(o),e.add()))(e,t,o),ignore:(e,t)=>((e,t)=>{try{e.set(e.get()+1),t()}finally{e.set(e.get()-1)}})(e,t),extra:(t,o,n,r)=>((e,t,o,n,r)=>{if(t.transact(n)){const n=t.data[o.get()].bookmark,i=t.data[o.get()-1];Uy(e,i,!0),t.transact(r)&&(t.data[o.get()-1].beforeBookmark=n)}})(e,t,o,n,r)},formatter:{match:(t,o,n,r)=>Jf(e,t,o,n,r),matchAll:(t,o)=>((e,t,o)=>{const n=[],r={},i=e.selection.getStart();return e.dom.getParent(i,(i=>{for(let s=0;s<t.length;s++){const a=t[s];!r[a]&&Kf(e,i,a,o)&&(r[a]=!0,n.push(a))}}),e.dom.getRoot()),n})(e,t,o),matchNode:(t,o,n,r)=>Kf(e,t,o,n,r),canApply:t=>((e,t)=>{const o=e.formatter.get(t),n=e.dom;if(o){const t=e.selection.getStart(),r=eh(n,t);for(let e=o.length-1;e>=0;e--){const t=o[e];if(!nh(t))return!0;for(let e=r.length-1;e>=0;e--)if(n.is(r[e],t.selector))return!0}}return!1})(e,t),closest:t=>((e,t)=>{const o=t=>bo(t,mo(e.getBody()));return F.from(e.selection.getStart(!0)).bind((n=>$f(mo(n),(o=>ue(t,(t=>((t,o)=>Kf(e,t.dom,o)?F.some(o):F.none())(o,t)))),o))).getOrNull()})(e,t),apply:(t,o,n)=>$v(e,t,o,n),remove:(t,o,n,r)=>Hv(e,t,o,n,r),toggle:(t,o,n)=>((e,t,o,n)=>{const r=e.formatter.get(t);r&&(!Jf(e,t,o,n)||"toggle"in r[0]&&!r[0].toggle?$v(e,t,o,n):Hv(e,t,o,n))})(e,t,o,n),formatChanged:(t,o,n,r,i)=>((e,t,o,n,r,i)=>(((e,t,o,n,r,i)=>{const s=t.get();$(o.split(","),(t=>{const o=xe(s,t).getOrThunk((()=>{const e={withSimilar:{state:_s(!1),similar:!0,callbacks:[]},withoutSimilar:{state:_s(!1),similar:!1,callbacks:[]},withVars:[]};return s[t]=e,e})),a=()=>{const o=Yv(e);return Gv(e,o,t,r,i).isSome()};if(y(i)){const e=r?o.withSimilar:o.withoutSimilar;e.callbacks.push(n),1===e.callbacks.length&&e.state.set(a())}else o.withVars.push({state:_s(a()),similar:r,vars:i,callback:n})})),t.set(s)})(e,t,o,n,r,i),{unbind:()=>((e,t,o)=>{const n=e.get();$(t.split(","),(e=>xe(n,e).each((t=>{n[e]={withSimilar:{...t.withSimilar,callbacks:G(t.withSimilar.callbacks,(e=>e!==o))},withoutSimilar:{...t.withoutSimilar,callbacks:G(t.withoutSimilar.callbacks,(e=>e!==o))},withVars:G(t.withVars,(e=>e.callback!==o))}})))),e.set(n)})(t,o,n)}))(e,t,o,n,r,i)},editor:{getContent:t=>((e,t)=>F.from(e.getBody()).fold(O("tree"===t.format?new fp("body",11):""),(o=>Cp(e,t,o))))(e,t),setContent:(t,o)=>((e,t,o)=>F.from(e.getBody()).map((n=>Hf(t)?((e,t,o,n)=>{Sf(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),o);const r=Tp({validate:!1},e.schema).serialize(o),i=br(mo(t))?r:Pt.trim(r);return Zf(e,i,n.no_selection),{content:o,html:i}})(e,n,t,o):((e,t,o,n)=>{if(0===o.length||/^\s+$/.test(o)){const r='<br data-mce-bogus="1">';"TABLE"===t.nodeName?o="<tr><td>"+r+"</td></tr>":/^(UL|OL)$/.test(t.nodeName)&&(o="<li>"+r+"</li>");const i=gl(e);return e.schema.isValidChild(t.nodeName.toLowerCase(),i.toLowerCase())?(o=r,o=e.dom.createHTML(i,fl(e),o)):o||(o=r),Zf(e,o,n.no_selection),{content:o,html:o}}{"raw"!==n.format&&(o=Tp({validate:!1},e.schema).serialize(e.parser.parse(o,{isRootContent:!0,insert:!0})));const r=br(mo(t))?o:Pt.trim(o);return Zf(e,r,n.no_selection),{content:r,html:r}}})(e,n,t,o))).getOr({content:t,html:Hf(o.content)?"":o.content}))(e,t,o),insertContent:(t,o)=>zf(e,t,o),addVisual:t=>((e,t)=>{const o=e.dom,n=_(t)?t:e.getBody();$(o.select("table,a",n),(t=>{switch(t.nodeName){case"TABLE":const n=fc(e),r=o.getAttrib(t,"border");r&&"0"!==r||!e.hasVisual?o.removeClass(t,n):o.addClass(t,n);break;case"A":if(!o.getAttrib(t,"href")){const n=o.getAttrib(t,"name")||t.id,r=vc(e);n&&e.hasVisual?o.addClass(t,r):o.removeClass(t,r)}}})),e.dispatch("VisualAid",{element:t,hasVisual:e.hasVisual})})(e,t)},selection:{getContent:(t,o)=>((e,t,o={})=>{const n=((e,t)=>({...e,format:t,get:!0,selection:!0,getInner:!0}))(o,t);return _y(e,n).fold(A,(t=>{const o=((e,t)=>{if("text"===t.format)return(e=>F.from(e.selection.getRng()).map((t=>{var o;const n=F.from(e.dom.getParent(t.commonAncestorContainer,e.dom.isBlock)),r=e.getBody(),i=(e=>e.map((e=>e.nodeName)).getOr("div").toLowerCase())(n),s=mo(t.cloneContents());_p(s),xp(s);const a=e.dom.add(r,i,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},s.dom),l=Ly(a),c=Tr(null!==(o=a.textContent)&&void 0!==o?o:"");if(e.dom.remove(a),Iy(c,0)||Iy(c,c.length-1)){const e=n.getOr(r),t=Ly(e),o=t.indexOf(l);return-1===o?l:(Iy(t,o-1)?" ":"")+l+(Iy(t,o+l.length)?" ":"")}return l})).getOr(""))(e);{const o=((e,t)=>{const o=e.selection.getRng(),n=e.dom.create("body"),r=e.selection.getSel(),i=sp(e,Ou(r)),s=t.contextual?Fy(mo(e.getBody()),i).dom:o.cloneContents();return s&&n.appendChild(s),e.selection.serializer.serialize(n,t)})(e,t);return"tree"===t.format?o:e.selection.isCollapsed()?"":o}})(e,t);return xy(e,o,t)}))})(e,t,o)},autocompleter:{addDecoration:t=>dp(e,t),removeDecoration:()=>((e,t)=>up(t).each((t=>{const o=e.selection.getBookmark();sn(t),e.selection.moveToBookmark(o)})))(e,mo(e.getBody()))},raw:{getModel:()=>F.none()}}),Jy=e=>Ce(e.plugins,"rtc"),Qy=e=>e.rtcInstance?e.rtcInstance:Ky(e),ew=e=>{const t=e.rtcInstance;if(t)return t;throw new Error("Failed to get RTC instance not yet initialized.")},tw=e=>ew(e).init.bindEvents(),ow=e=>0===e.dom.length?(rn(e),F.none()):F.some(e),nw=(e,t,o,n)=>{e.bind((e=>((n?kg:Cg)(e.dom,n?e.dom.length:0),t.filter(zt).map((t=>((e,t,o,n)=>{const r=e.dom,i=t.dom,s=n?r.length:i.length;n?(Sg(r,i,!1,!n),o.setStart(i,s)):(Sg(i,r,!1,!n),o.setEnd(i,s))})(e,t,o,n)))))).orThunk((()=>{const e=((e,t)=>e.filter((e=>Eh.isBookmarkNode(e.dom))).bind(t?Eo:To))(t,n).or(t).filter(zt);return e.map((e=>((e,t)=>{Co(e).each((o=>{const n=e.dom;t&&pg(o,Ca(n,0))?Cg(n,0):!t&&gg(o,Ca(n,n.length))&&kg(n,n.length)}))})(e,n)))}))},rw=(e,t,o)=>{if(Ce(e,t)){const n=G(e[t],(e=>e!==o));0===n.length?delete e[t]:e[t]=n}};const iw=e=>!(!e||!e.ownerDocument)&&yo(mo(e.ownerDocument),mo(e)),sw=(e,t,o,n)=>{let r,i;const{selectorChangedWithUnbind:s}=((e,t)=>{let o,n;const r=(t,o)=>J(o,(o=>e.is(o,t))),i=t=>e.getParents(t,void 0,e.getRoot());return{selectorChangedWithUnbind:(e,s)=>(o||(o={},n={},t.on("NodeChange",(e=>{const t=e.element,s=i(t),a={};pe(o,((e,t)=>{r(t,s).each((o=>{n[t]||($(e,(e=>{e(!0,{node:o,selector:t,parents:s})})),n[t]=e),a[t]=e}))})),pe(n,((e,o)=>{a[o]||(delete n[o],$(e,(e=>{e(!1,{node:t,selector:o,parents:s})})))}))}))),o[e]||(o[e]=[]),o[e].push(s),r(e,i(t.selection.getStart())).each((()=>{n[e]=o[e]})),{unbind:()=>{rw(o,e,s),rw(n,e,s)}})}})(e,n),a=(e,t)=>((e,t,o={})=>{const n=((e,t)=>({format:"html",...e,set:!0,selection:!0,content:t}))(o,t);Cy(e,n).each((t=>{const o=((e,t)=>{if("raw"!==t.format){const o=e.selection.getRng(),n=e.dom.getParent(o.commonAncestorContainer,e.dom.isBlock),r=n?{context:n.nodeName.toLowerCase()}:{},i=e.parser.parse(t.content,{forced_root_block:!1,...r,...t});return Tp({validate:!1},e.schema).serialize(i)}return t.content})(e,t),n=e.selection.getRng();((e,t)=>{const o=F.from(t.firstChild).map(mo),n=F.from(t.lastChild).map(mo);e.deleteContents(),e.insertNode(t);const r=o.bind(To).filter(zt).bind(ow),i=n.bind(Eo).filter(zt).bind(ow);nw(r,o,e,!0),nw(i,n,e,!1),e.collapse(!1)})(n,n.createContextualFragment(o)),e.selection.setRng(n),Rm(e,n),ky(e,o,t)}))})(n,e,t),l=e=>{const t=d();t.collapse(!!e),u(t)},c=()=>t.getSelection?t.getSelection():t.document.selection,d=()=>{let o;const s=(e,t,o)=>{try{return t.compareBoundaryPoints(e,o)}catch(e){return-1}},a=t.document;if(_(n.bookmark)&&!ep(n)){const e=Um(n);if(e.isSome())return e.map((e=>sp(n,[e])[0])).getOr(a.createRange())}try{const e=c();e&&!Bn(e.anchorNode)&&(o=e.rangeCount>0?e.getRangeAt(0):a.createRange(),o=sp(n,[o])[0])}catch(e){}if(o||(o=a.createRange()),$n(o.startContainer)&&o.collapsed){const t=e.getRoot();o.setStart(t,0),o.setEnd(t,0)}return r&&i&&(0===s(o.START_TO_START,o,r)&&0===s(o.END_TO_END,o,r)?o=i:(r=null,i=null)),o},u=(e,t)=>{if(!(e=>!!e&&iw(e.startContainer)&&iw(e.endContainer))(e))return;const o=c();if(e=n.dispatch("SetSelectionRange",{range:e,forward:t}).range,o){i=e;try{o.removeAllRanges(),o.addRange(e)}catch(e){}!1===t&&o.extend&&(o.collapse(e.endContainer,e.endOffset),o.extend(e.startContainer,e.startOffset)),r=o.rangeCount>0?o.getRangeAt(0):null}if(!e.collapsed&&e.startContainer===e.endContainer&&(null==o?void 0:o.setBaseAndExtent)&&e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()){const t=e.startContainer.childNodes[e.startOffset];t&&"IMG"===t.nodeName&&(o.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),o.anchorNode===e.startContainer&&o.focusNode===e.endContainer||o.setBaseAndExtent(t,0,t,1))}n.dispatch("AfterSetSelectionRange",{range:e,forward:t})},h=()=>{const t=c(),o=null==t?void 0:t.anchorNode,n=null==t?void 0:t.focusNode;if(!t||!o||!n||Bn(o)||Bn(n))return!0;const r=e.createRng(),i=e.createRng();try{r.setStart(o,t.anchorOffset),r.collapse(!0),i.setStart(n,t.focusOffset),i.collapse(!0)}catch(e){return!0}return r.compareBoundaryPoints(r.START_TO_START,i)<=0},m={dom:e,win:t,serializer:o,editor:n,expand:(t={type:"word"})=>u(mm(e).expand(d(),t)),collapse:l,setCursorLocation:(t,o)=>{const r=e.createRng();_(t)&&_(o)?(r.setStart(t,o),r.setEnd(t,o),u(r),l(!1)):(Nu(e,r,n.getBody(),!0),u(r))},getContent:e=>((e,t={})=>((e,t,o)=>ew(e).selection.getContent(t,o))(e,t.format?t.format:"html",t))(n,e),setContent:a,getBookmark:(e,t)=>p.getBookmark(e,t),moveToBookmark:e=>p.moveToBookmark(e),select:(t,o)=>(((e,t,o)=>F.from(t).bind((t=>F.from(t.parentNode).map((n=>{const r=e.nodeIndex(t),i=e.createRng();return i.setStart(n,r),i.setEnd(n,r+1),o&&(Nu(e,i,t,!0),Nu(e,i,t,!1)),i})))))(e,t,o).each(u),t),isCollapsed:()=>{const e=d(),t=c();return!(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed)},isForward:h,setNode:t=>(a(e.getOuterHTML(t)),t),getNode:()=>((e,t)=>{if(!t)return e;let o=t.startContainer,n=t.endContainer;const r=t.startOffset,i=t.endOffset;let s=t.commonAncestorContainer;t.collapsed||(o===n&&i-r<2&&o.hasChildNodes()&&(s=o.childNodes[r]),Hn(o)&&Hn(n)&&(o=o.length===r?ip(o.nextSibling,!0):o.parentNode,n=0===i?ip(n.previousSibling,!1):n.parentNode,o&&o===n&&(s=o)));const a=Hn(s)?s.parentNode:s;return Pn(a)?a:e})(n.getBody(),d()),getSel:c,setRng:u,getRng:d,getStart:e=>np(n.getBody(),d(),e),getEnd:e=>rp(n.getBody(),d(),e),getSelectedBlocks:(t,o)=>((e,t,o,n)=>{const r=[],i=e.getRoot(),s=e.getParent(o||np(i,t,t.collapsed),e.isBlock),a=e.getParent(n||rp(i,t,t.collapsed),e.isBlock);if(s&&s!==i&&r.push(s),s&&a&&s!==a){let t=s;const o=new An(s,i);for(;(t=o.next())&&t!==a;)e.isBlock(t)&&r.push(t)}return a&&s!==a&&a!==i&&r.push(a),r})(e,d(),t,o),normalize:()=>{const t=d(),o=c();if(!(Ou(o).length>1)&&Du(n)){const o=dm(e,t);return o.each((e=>{u(e,h())})),o.getOr(t)}return t},selectorChanged:(e,t)=>(s(e,t),m),selectorChangedWithUnbind:s,getScrollContainer:()=>{let t,o=e.getRoot();for(;o&&"BODY"!==o.nodeName;){if(o.scrollHeight>o.clientHeight){t=o;break}o=o.parentNode}return t},scrollIntoView:(e,t)=>{_(e)?((e,t,o)=>{(e.inline?Mm:Pm)(e,t,o)})(n,e,t):Rm(n,d(),t)},placeCaretAt:(e,t)=>u(om(e,t,n.getDoc())),getBoundingClientRect:()=>{const e=d();return e.collapsed?Ca.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:()=>{t=r=i=null,g.destroy()}},p=Eh(m),g=zh(m,n);return m.bookmarkManager=p,m.controlSelection=g,m},aw=(e,t,o)=>{-1===Pt.inArray(t,o)&&(e.addAttributeFilter(o,((e,t)=>{let o=e.length;for(;o--;)e[o].attr(t,null)})),t.push(o))},lw=(e,t)=>{const o=["data-mce-selected"],n=t&&t.dom?t.dom:bs.DOM,r=t&&t.schema?t.schema:Ji(e);e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs=!("remove_trailing_brs"in e)||e.remove_trailing_brs;const i=yy(e,r);return((e,t,o)=>{e.addAttributeFilter("data-mce-tabindex",((e,t)=>{let o=e.length;for(;o--;){const n=e[o];n.attr("tabindex",n.attr("data-mce-tabindex")),n.attr(t,null)}})),e.addAttributeFilter("src,href,style",((e,n)=>{const r="data-mce-"+n,i=t.url_converter,s=t.url_converter_scope;let a=e.length;for(;a--;){const t=e[a];let l=t.attr(r);void 0!==l?(t.attr(n,l.length>0?l:null),t.attr(r,null)):(l=t.attr(n),"style"===n?l=o.serializeStyle(o.parseStyle(l),t.name):i&&(l=i.call(s,l,n,t.name)),t.attr(n,l.length>0?l:null))}})),e.addAttributeFilter("class",(e=>{let t=e.length;for(;t--;){const o=e[t];let n=o.attr("class");n&&(n=n.replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),o.attr("class",n.length>0?n:null))}})),e.addAttributeFilter("data-mce-type",((e,t,o)=>{let n=e.length;for(;n--;){const t=e[n];if("bookmark"===t.attr("data-mce-type")&&!o.cleanup){const e=F.from(t.firstChild).exists((e=>{var t;return!Sr(null!==(t=e.value)&&void 0!==t?t:"")}));e?t.unwrap():t.remove()}}})),e.addNodeFilter("noscript",(e=>{var t;let o=e.length;for(;o--;){const n=e[o].firstChild;n&&(n.value=Li.decode(null!==(t=n.value)&&void 0!==t?t:""))}})),e.addNodeFilter("script,style",((e,o)=>{var n;const r=e=>e.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"");let i=e.length;for(;i--;){const s=e[i],a=s.firstChild,l=null!==(n=null==a?void 0:a.value)&&void 0!==n?n:"";if("script"===o){const e=s.attr("type");e&&s.attr("type","mce-no/type"===e?null:e.replace(/^mce\-/,"")),"xhtml"===t.element_format&&a&&l.length>0&&(a.value="// <![CDATA[\n"+r(l)+"\n// ]]>")}else"xhtml"===t.element_format&&a&&l.length>0&&(a.value="\x3c!--\n"+r(l)+"\n--\x3e")}})),e.addNodeFilter("#comment",(e=>{let n=e.length;for(;n--;){const r=e[n],i=r.value;t.preserve_cdata&&0===(null==i?void 0:i.indexOf("[CDATA["))?(r.name="#cdata",r.type=4,r.value=o.decode(i.replace(/^\[CDATA\[|\]\]$/g,""))):0===(null==i?void 0:i.indexOf("mce:protected "))&&(r.name="#text",r.type=3,r.raw=!0,r.value=unescape(i).substr(14))}})),e.addNodeFilter("xml:namespace,input",((e,t)=>{let o=e.length;for(;o--;){const n=e[o];7===n.type?n.remove():1===n.type&&("input"!==t||n.attr("type")||n.attr("type","text"))}})),e.addAttributeFilter("data-mce-type",(t=>{$(t,(t=>{"format-caret"===t.attr("data-mce-type")&&(t.isEmpty(e.schema.getNonEmptyElements())?t.remove():t.unwrap())}))})),e.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-block,data-mce-type,data-mce-resize,data-mce-placeholder",((e,t)=>{let o=e.length;for(;o--;)e[o].attr(t,null)}))})(i,e,n),{schema:r,addNodeFilter:i.addNodeFilter,addAttributeFilter:i.addAttributeFilter,serialize:(o,s={})=>{const a={format:"html",...s},l=((e,t,o)=>((e,t)=>_(e)&&e.hasEventListeners("PreProcess")&&!t.no_events)(e,o)?((e,t,o)=>{let n;const r=e.dom;let i=t.cloneNode(!0);const s=document.implementation;if(s.createHTMLDocument){const e=s.createHTMLDocument("");Pt.each("BODY"===i.nodeName?i.childNodes:[i],(t=>{e.body.appendChild(e.importNode(t,!0))})),i="BODY"!==i.nodeName?e.body.firstChild:e.body,n=r.doc,r.doc=e}return((e,t)=>{e.dispatch("PreProcess",t)})(e,{...o,node:i}),n&&(r.doc=n),i})(e,t,o):t)(t,o,a),c=((e,t,o)=>{const n=Tr(o.getInner?t.innerHTML:e.getOuterHTML(t));return o.selection||br(mo(t))?n:Pt.trim(n)})(n,l,a),d=((e,t,o)=>{const n=o.selection?{forced_root_block:!1,...o}:o,r=e.parse(t,n);return(e=>{const t=e=>"br"===(null==e?void 0:e.name),o=e.lastChild;if(t(o)){const e=o.prev;t(e)&&(o.remove(),e.remove())}})(r),r})(i,c,a);return"tree"===a.format?d:((e,t,o,n,r)=>{const i=((e,t,o)=>Tp(e,t).serialize(o))(t,o,n);return((e,t,o)=>{if(!t.no_events&&e){const n=((e,t)=>e.dispatch("PostProcess",t))(e,{...t,content:o});return n.content}return o})(e,r,i)})(t,e,r,d,a)},addRules:r.addValidElements,setRules:r.setValidElements,addTempAttr:B(aw,i,o),getTempAttrs:O(o),getNodeFilters:i.getNodeFilters,getAttributeFilters:i.getAttributeFilters,removeNodeFilter:i.removeNodeFilter,removeAttributeFilter:i.removeAttributeFilter}},cw=(e,t)=>{const o=lw(e,t);return{schema:o.schema,addNodeFilter:o.addNodeFilter,addAttributeFilter:o.addAttributeFilter,serialize:o.serialize,addRules:o.addRules,setRules:o.setRules,addTempAttr:o.addTempAttr,getTempAttrs:o.getTempAttrs,getNodeFilters:o.getNodeFilters,getAttributeFilters:o.getAttributeFilters,removeNodeFilter:o.removeNodeFilter,removeAttributeFilter:o.removeAttributeFilter}},dw=(e,t,o={})=>{const n=((e,t)=>({format:"html",...e,set:!0,content:t}))(o,t);return Cy(e,n).map((t=>{const o=((e,t,o)=>Qy(e).editor.setContent(t,o))(e,t.content,t);return ky(e,o.html,t),o.content})).getOr(t)},uw="autoresize_on_init,content_editable_state,padd_empty_with_br,block_elements,boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,tab_focus,tabfocus_elements,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,paste_enable_default_filters,paste_filter_drop,paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists".split(","),hw="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,textcolor".split(","),mw=e=>{const t=G(uw,(t=>Ce(e,t))),o=e.forced_root_block;return!1!==o&&""!==o||t.push("forced_root_block (false only)"),se(t)},pw=e=>{const t=Pt.makeMap(e.plugins," "),o=G(hw,(e=>Ce(t,e)));return se(o)},gw=bs.DOM,fw=e=>F.from(e).each((e=>e.destroy())),vw=(()=>{const e={};return{add:(t,o)=>{e[t]=o},get:t=>e[t]?e[t]:{icons:{}},has:t=>Ce(e,t)}})(),bw=Ts.ModelManager,yw=(e,t)=>t.dom[e],ww=(e,t)=>parseInt(qo(t,e),10),_w=B(yw,"clientWidth"),xw=B(yw,"clientHeight"),Cw=B(ww,"margin-top"),kw=B(ww,"margin-left"),Sw=e=>{const t=[],o=()=>{const t=e.theme;return t&&t.getNotificationManagerImpl?t.getNotificationManagerImpl():(()=>{const e=()=>{throw new Error("Theme did not provide a NotificationManager implementation.")};return{open:e,close:e,getArgs:e}})()},n=()=>F.from(t[0]),r=()=>{$(t,(e=>{e.reposition()}))},i=e=>{Q(t,(t=>t===e)).each((e=>{t.splice(e,1)}))},s=(s,a=!0)=>e.removed||!(e=>{return(t=e.inline?e.getBody():e.getContentAreaContainer(),F.from(t).map(mo)).map(jo).getOr(!1);var t})(e)?{}:(a&&e.dispatch("BeforeOpenNotification",{notification:s}),J(t,(e=>{return t=o().getArgs(e),n=s,!(t.type!==n.type||t.text!==n.text||t.progressBar||t.timeout||n.progressBar||n.timeout);var t,n})).getOrThunk((()=>{e.editorManager.setActive(e);const a=o().open(s,(()=>{i(a),r(),n().fold((()=>e.focus()),(e=>Vm(mo(e.getEl()))))}));return(e=>{t.push(e)})(a),r(),e.dispatch("OpenNotification",{notification:{...a}}),a}))),a=O(t);return(e=>{e.on("SkinLoaded",(()=>{const t=Wl(e);t&&s({text:t,type:"warning",timeout:0},!1),r()})),e.on("show ResizeEditor ResizeWindow NodeChange",(()=>{requestAnimationFrame(r)})),e.on("remove",(()=>{$(t.slice(),(e=>{o().close(e)}))}))})(e),{open:s,close:()=>{n().each((e=>{o().close(e),i(e),r()}))},getNotifications:a}},Tw=Ts.PluginManager,Ew=Ts.ThemeManager,Ow=e=>{let t=[];const o=()=>{const t=e.theme;return t&&t.getWindowManagerImpl?t.getWindowManagerImpl():(()=>{const e=()=>{throw new Error("Theme did not provide a WindowManager implementation.")};return{open:e,openUrl:e,alert:e,confirm:e,close:e}})()},n=(e,t)=>(...o)=>t?t.apply(e,o):void 0,r=o=>{(t=>{e.dispatch("CloseWindow",{dialog:t})})(o),t=G(t,(e=>e!==o)),0===t.length&&e.focus()},i=o=>{e.editorManager.setActive(e),jm(e),e.ui.show();const n=o();return(o=>{t.push(o),(t=>{e.dispatch("OpenWindow",{dialog:t})})(o)})(n),n};return e.on("remove",(()=>{$(t,(e=>{o().close(e)}))})),{open:(e,t)=>i((()=>o().open(e,t,r))),openUrl:e=>i((()=>o().openUrl(e,r))),alert:(e,t,r)=>{const i=o();i.alert(e,n(r||i,t))},confirm:(e,t,r)=>{const i=o();i.confirm(e,n(r||i,t))},close:()=>{F.from(t[t.length-1]).each((e=>{o().close(e),r(e)}))}}},Aw=(e,t)=>{e.notificationManager.open({type:"error",text:t})},Mw=(e,t)=>{e._skinLoaded?Aw(e,t):e.on("SkinLoaded",(()=>{Aw(e,t)}))},Bw=(e,t,o)=>{Ah(e,t,{message:o}),console.error(o)},Pw=(e,t,o)=>o?`Failed to load ${e}: ${o} from url ${t}`:`Failed to load ${e} url: ${t}`,Rw=(e,...t)=>{const o=window.console;o&&(o.error?o.error(e,...t):o.log(e,...t))},Vw=(e,t)=>{const o=e.editorManager.baseURL+"/skins/content",n=`content${e.editorManager.suffix}.css`;return U(t,(t=>(e=>/^[a-z0-9\-]+$/i.test(e))(t)&&!e.inline?`${o}/${t}/${n}`:e.documentBaseURI.toAbsolute(t)))},Nw=D,Dw=(e,t)=>{const o={};return{findAll:(n,r=D)=>{const i=G((e=>e?de(e.getElementsByTagName("img")):[])(n),(t=>{const o=t.src;return!t.hasAttribute("data-mce-bogus")&&!t.hasAttribute("data-mce-placeholder")&&!(!o||o===Ot.transparentSrc)&&(He(o,"blob:")?!e.isUploaded(o)&&r(t):!!He(o,"data:")&&r(t))})),s=U(i,(e=>{const n=e.src;if(Ce(o,n))return o[n].then((t=>m(t)?t:{image:e,blobInfo:t.blobInfo}));{const r=((e,t)=>{const o=()=>Promise.reject("Invalid data URI");if(He(t,"blob:")){const i=e.getByUri(t);return _(i)?Promise.resolve(i):(n=t,He(n,"blob:")?(e=>fetch(e).then((e=>e.ok?e.blob():Promise.reject())).catch((()=>Promise.reject(`Cannot convert ${e} to Blob. Resource might not exist or is inaccessible.`))))(n):He(n,"data:")?(r=n,new Promise(((e,t)=>{Jb(r).bind((({type:e,data:t,base64Encoded:o})=>Qb(e,t,o))).fold((()=>t("Invalid data URI")),e)}))):Promise.reject("Unknown URI format")).then((t=>ey(t).then((n=>oy(n,!1,(o=>F.some(ny(e,t,o)))).getOrThunk(o)))))}var n,r;return He(t,"data:")?ry(e,t).fold(o,(e=>Promise.resolve(e))):Promise.reject("Unknown image data format")})(t,n).then((t=>(delete o[n],{image:e,blobInfo:t}))).catch((e=>(delete o[n],e)));return o[n]=r,r}}));return Promise.all(s)}}},Fw=()=>{let e={};const t=(e,t)=>({status:e,resultUri:t}),o=t=>t in e;return{hasBlobUri:o,getResultUri:t=>{const o=e[t];return o?o.resultUri:null},isPending:t=>!!o(t)&&1===e[t].status,isUploaded:t=>!!o(t)&&2===e[t].status,markPending:o=>{e[o]=t(1,null)},markUploaded:(o,n)=>{e[o]=t(2,n)},removeFailed:t=>{delete e[t]},destroy:()=>{e={}}}};let Iw=0;const Lw=(e,t)=>{const o={},n=(e,o)=>new Promise(((n,r)=>{const i=new XMLHttpRequest;i.open("POST",t.url),i.withCredentials=t.credentials,i.upload.onprogress=e=>{o(e.loaded/e.total*100)},i.onerror=()=>{r("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=()=>{if(i.status<200||i.status>=300)return void r("HTTP Error: "+i.status);const e=JSON.parse(i.responseText);var o,s;e&&m(e.location)?n((o=t.basePath,s=e.location,o?o.replace(/\/$/,"")+"/"+s.replace(/^\//,""):s)):r("Invalid JSON: "+i.responseText)};const s=new FormData;s.append("file",e.blob(),e.filename()),i.send(s)})),r=x(t.handler)?t.handler:n,i=(e,t)=>({url:t,blobInfo:e,status:!0}),s=(e,t)=>({url:"",blobInfo:e,status:!1,error:t}),a=(e,t)=>{Pt.each(o[e],(e=>{e(t)})),delete o[e]};return{upload:(l,c)=>t.url||r!==n?((t,n)=>(t=Pt.grep(t,(t=>!e.isUploaded(t.blobUri()))),Promise.all(Pt.map(t,(t=>e.isPending(t.blobUri())?(e=>{const t=e.blobUri();return new Promise((e=>{o[t]=o[t]||[],o[t].push(e)}))})(t):((t,o,n)=>(e.markPending(t.blobUri()),new Promise((r=>{let l,c;try{const d=()=>{l&&(l.close(),c=S)},u=o=>{d(),e.markUploaded(t.blobUri(),o),a(t.blobUri(),i(t,o)),r(i(t,o))},h=o=>{d(),e.removeFailed(t.blobUri()),a(t.blobUri(),s(t,o)),r(s(t,o))};c=e=>{e<0||e>100||F.from(l).orThunk((()=>F.from(n).map(R))).each((t=>{l=t,t.progressBar.value(e)}))},o(t,c).then(u,(e=>{h(m(e)?{message:e}:e)}))}catch(e){r(s(t,e))}}))))(t,r,n))))))(l,c):new Promise((e=>{e([])}))}},zw=e=>()=>e.notificationManager.open({text:e.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0}),Hw=(e,t)=>Lw(t,{url:El(e),basePath:Ol(e),credentials:Al(e),handler:Ml(e)}),Zw=e=>{const t=(()=>{let e=[];const t=e=>{if(!e.blob||!e.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");const t=e.id||"blobid"+Iw+++(()=>{const e=()=>Math.round(4294967295*Math.random()).toString(36);return"s"+(new Date).getTime().toString(36)+e()+e()+e()})(),o=e.name||t,n=e.blob;var r;return{id:O(t),name:O(o),filename:O(e.filename||o+"."+(r=n.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"}[r.toLowerCase()]||"dat")),blob:O(n),base64:O(e.base64),blobUri:O(e.blobUri||URL.createObjectURL(n)),uri:O(e.uri)}},o=t=>J(e,t).getOrUndefined(),n=e=>o((t=>t.id()===e));return{create:(e,o,n,r,i)=>{if(m(e))return t({id:e,name:r,filename:i,blob:o,base64:n});if(p(e))return t(e);throw new Error("Unknown input type")},add:t=>{n(t.id())||e.push(t)},get:n,getByUri:e=>o((t=>t.blobUri()===e)),getByData:(e,t)=>o((o=>o.base64()===e&&o.blob().type===t)),findFirst:o,removeByUri:t=>{e=G(e,(e=>e.blobUri()!==t||(URL.revokeObjectURL(e.blobUri()),!1)))},destroy:()=>{$(e,(e=>{URL.revokeObjectURL(e.blobUri())})),e=[]}}})();let o,n;const r=Fw(),i=[],s=t=>o=>e.selection?t(o):[],a=(e,t,o)=>{let n=0;do{n=e.indexOf(t,n),-1!==n&&(e=e.substring(0,n)+o+e.substr(n+t.length),n+=o.length-t.length+1)}while(-1!==n);return e},l=(e,t,o)=>{const n=`src="${o}"${o===Ot.transparentSrc?' data-mce-placeholder="1"':""}`;return e=a(e,`src="${t}"`,n),a(e,'data-mce-src="'+t+'"','data-mce-src="'+o+'"')},c=(t,o)=>{$(e.undoManager.data,(e=>{"fragmented"===e.type?e.fragments=U(e.fragments,(e=>l(e,t,o))):e.content=l(e.content,t,o)}))},d=()=>(o||(o=Hw(e,r)),g().then(s((n=>{const r=U(n,(e=>e.blobInfo));return o.upload(r,zw(e)).then(s((o=>{const r=[];let i=!1;const s=U(o,((o,s)=>{const{blobInfo:a,image:l}=n[s];let d=!1;return o.status&&kl(e)?(o.url&&!ze(l.src,o.url)&&(i=!0),t.removeByUri(l.src),Jy(e)||((t,o)=>{const n=e.convertURL(o,"src");var r;c(t.src,o),Wt(mo(t),{src:Cl(e)?(r=o,r+(-1===r.indexOf("?")?"?":"&")+(new Date).getTime()):o,"data-mce-src":n})})(l,o.url)):o.error&&(o.error.remove&&(c(l.src,Ot.transparentSrc),r.push(l),d=!0),((e,t)=>{Mw(e,Ss.translate(["Failed to upload image: {0}",t]))})(e,o.error.message)),{element:l,status:o.status,uploadUri:o.url,blobInfo:a,removed:d}}));return r.length>0&&!Jy(e)?e.undoManager.transact((()=>{$(r,(o=>{e.dom.remove(o),t.removeByUri(o.src)}))})):i&&e.undoManager.dispatchChange(),s})))})))),u=()=>xl(e)?d():Promise.resolve([]),h=e=>oe(i,(t=>t(e))),g=()=>(n||(n=Dw(r,t)),n.findAll(e.getBody(),h).then(s((t=>{const o=G(t,(t=>!m(t)||(Mw(e,t),!1)));return Jy(e)||$(o,(e=>{c(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")})),o})))),f=o=>o.replace(/src="(blob:[^"]+)"/g,((o,n)=>{const i=r.getResultUri(n);if(i)return'src="'+i+'"';let s=t.getByUri(n);return s||(s=X(e.editorManager.get(),((e,t)=>e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n)),void 0)),s?'src="data:'+s.blob().type+";base64,"+s.base64()+'"':o}));return e.on("SetContent",(()=>{xl(e)?u():g()})),e.on("RawSaveContent",(e=>{e.content=f(e.content)})),e.on("GetContent",(e=>{e.source_view||"raw"===e.format||"tree"===e.format||(e.content=f(e.content))})),e.on("PostRender",(()=>{e.parser.addNodeFilter("img",(e=>{$(e,(e=>{const o=e.attr("src");if(!o||t.getByUri(o))return;const n=r.getResultUri(o);n&&e.attr("src",n)}))}))})),{blobCache:t,addFilter:e=>{i.push(e)},uploadImages:d,uploadImagesAuto:u,scanForImages:g,destroy:()=>{t.destroy(),r.destroy(),n=o=null}}},jw={remove_similar:!0,inherit:!1},Uw={selector:"td,th",...jw},$w={tablecellbackgroundcolor:{styles:{backgroundColor:"%value"},...Uw},tablecellverticalalign:{styles:{"vertical-align":"%value"},...Uw},tablecellbordercolor:{styles:{borderColor:"%value"},...Uw},tablecellclass:{classes:["%value"],...Uw},tableclass:{selector:"table",classes:["%value"],...jw},tablecellborderstyle:{styles:{borderStyle:"%value"},...Uw},tablecellborderwidth:{styles:{borderWidth:"%value"},...Uw}},Ww=O($w),qw=Pt.each,Gw=bs.DOM,Yw=e=>_(e)&&p(e),Xw=(e,t)=>{const o=t&&t.schema||Ji({}),n=e=>{const t=m(e)?{name:e,classes:[],attrs:{}}:e,o=Gw.create(t.name);return((e,t)=>{t.classes.length>0&&Gw.addClass(e,t.classes.join(" ")),Gw.setAttribs(e,t.attrs)})(o,t),o},r=(e,t,i)=>{let s;const a=t[0],l=Yw(a)?a.name:void 0,c=((e,t)=>{const n=o.getElementRule(e.nodeName.toLowerCase()),r=null==n?void 0:n.parentsRequired;return!(!r||!r.length)&&(t&&Z(r,t)?t:r[0])})(e,l);if(c)l===c?(s=a,t=t.slice(1)):s=c;else if(a)s=a,t=t.slice(1);else if(!i)return e;const d=s?n(s):Gw.create("div");d.appendChild(e),i&&Pt.each(i,(t=>{const o=n(t);d.insertBefore(o,e)}));const u=Yw(s)?s.siblings:void 0;return r(d,t,u)},i=Gw.create("div");if(e.length>0){const t=e[0],o=n(t),s=Yw(t)?t.siblings:void 0;i.appendChild(r(o,e.slice(1),s))}return i},Kw=e=>{let t="div";const o={name:t,classes:[],attrs:{},selector:e=Pt.trim(e)};return"*"!==e&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,((e,t,n,r,i)=>{switch(t){case"#":o.attrs.id=n;break;case".":o.classes.push(n);break;case":":-1!==Pt.inArray("checked disabled enabled read-only required".split(" "),n)&&(o.attrs[n]=n)}if("["===r){const e=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/);e&&(o.attrs[e[1]]=e[2])}return""}))),o.name=t||"div",o},Jw=(e,t)=>{let o="",n=Ql(e);if(""===n)return"";const r=e=>m(e)?e.replace(/%(\w+)/g,""):"",i=(t,o)=>Gw.getStyle(null!=o?o:e.getBody(),t,!0);if(m(t)){const o=e.formatter.get(t);if(!o)return"";t=o[0]}if("preview"in t){const e=t.preview;if(!1===e)return"";n=e||n}let s,a=t.block||t.inline||"span";const l=(c=t.selector,m(c)?(c=(c=c.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),Pt.map(c.split(/(?:>|\s+(?![^\[\]]+\]))/),(e=>{const t=Pt.map(e.split(/(?:~\+|~|\+)/),Kw),o=t.pop();return t.length&&(o.siblings=t),o})).reverse()):[]);var c;l.length>0?(l[0].name||(l[0].name=a),a=t.selector,s=Xw(l,e)):s=Xw([a],e);const d=Gw.select(a,s)[0]||s.firstChild;qw(t.styles,((e,t)=>{const o=r(e);o&&Gw.setStyle(d,t,o)})),qw(t.attributes,((e,t)=>{const o=r(e);o&&Gw.setAttrib(d,t,o)})),qw(t.classes,(e=>{const t=r(e);Gw.hasClass(d,t)||Gw.addClass(d,t)})),e.dispatch("PreviewFormats"),Gw.setStyles(s,{position:"absolute",left:-65535}),e.getBody().appendChild(s);const u=i("fontSize"),h=/px$/.test(u)?parseInt(u,10):0;return qw(n.split(" "),(e=>{let t=i(e,d);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=i(e),"#ffffff"===Eu(t).toLowerCase())||"color"===e&&"#000000"===Eu(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===h)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*h+"px"}"border"===e&&t&&(o+="padding:0 2px;"),o+=e+":"+t+";"}})),e.dispatch("AfterPreviewFormats"),Gw.remove(s),o},Qw=e=>{const t=(e=>{const t={},o=(e,n)=>{e&&(m(e)?(f(n)||(n=[n]),$(n,(e=>{y(e.deep)&&(e.deep=!nh(e)),y(e.split)&&(e.split=!nh(e)||rh(e)),y(e.remove)&&nh(e)&&!rh(e)&&(e.remove="none"),nh(e)&&rh(e)&&(e.mixed=!0,e.block_expand=!0),m(e.classes)&&(e.classes=e.classes.split(/\s+/))})),t[e]=n):pe(e,((e,t)=>{o(t,e)})))};return o((e=>{const t=e.dom,o=e.schema.type,n={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"left"},inherit:!1,preview:!1},{selector:"img,audio,video",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"},{selector:"table",collapsed:!1,styles:{marginLeft:"0px",marginRight:"auto"},onformat:e=>{t.setStyle(e,"float",null)},preview:"font-family font-size"},{selector:".mce-preview-object,[data-ephox-embed-iri]",ceFalseOverride:!0,styles:{float:"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"},{selector:".mce-preview-object",ceFalseOverride:!0,styles:{display:"table",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"[data-ephox-embed-iri]",ceFalseOverride:!0,styles:{marginLeft:"auto",marginRight:"auto"},preview:!1}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"},{selector:"table",collapsed:!1,styles:{marginRight:"0px",marginLeft:"auto"},onformat:e=>{t.setStyle(e,"float",null)},preview:"font-family font-size"},{selector:".mce-preview-object,[data-ephox-embed-iri]",ceFalseOverride:!0,styles:{float:"right"},preview:!1}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"justify"},inherit:!1,preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:(()=>{const e={inline:"span",styles:{textDecoration:"line-through"},exact:!0},t={inline:"strike",remove:"all",preserve_attributes:["class","style"]},n={inline:"s",remove:"all",preserve_attributes:["class","style"]};return"html4"!==o?[n,e,t]:[e,n,t]})(),forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},lineheight:{selector:"h1,h2,h3,h4,h5,h6,p,li,td,th,div",styles:{lineHeight:"%value"}},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:(e,t,o)=>Pn(e)&&e.hasAttribute("href"),onformat:(e,o,n)=>{Pt.each(n,((o,n)=>{t.setAttrib(e,n,o)}))}},lang:{inline:"span",clear_child_styles:!0,remove_similar:!0,attributes:{lang:"%value","data-mce-lang":e=>{var t;return null!==(t=null==e?void 0:e.customValue)&&void 0!==t?t:null}}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,small",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return Pt.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd samp".split(/\s/),(e=>{n[e]={block:e,remove:"all"}})),n})(e)),o(Ww()),o(Jl(e)),{get:e=>_(e)?t[e]:t,has:e=>Ce(t,e),register:o,unregister:e=>(e&&t[e]&&delete t[e],t)}})(e),o=_s({});return(e=>{e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(let t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])})(e),(e=>{e.on("mouseup keydown",(t=>{((e,t)=>{const o=e.selection,n=e.getBody();rv(e,null,!1),8!==t&&46!==t||!o.isCollapsed()||o.getStart().innerHTML!==Qf||rv(e,ru(n,o.getStart())),37!==t&&39!==t||rv(e,ru(n,o.getStart()))})(e,t.keyCode)}))})(e),Jy(e)||((e,t)=>{e.set({}),t.on("NodeChange",(o=>{Xv(t,o.element,e.get())})),t.on("FormatApply FormatRemove",(o=>{const n=F.from(o.node).map((e=>Lu(e)?e:e.startContainer)).bind((e=>Pn(e)?F.some(e):F.from(e.parentElement))).getOrThunk((()=>qv(t)));Xv(t,n,e.get())}))})(o,e),{get:t.get,has:t.has,register:t.register,unregister:t.unregister,apply:(t,o,n)=>{((e,t,o,n)=>{ew(e).formatter.apply(t,o,n)})(e,t,o,n)},remove:(t,o,n,r)=>{((e,t,o,n,r)=>{ew(e).formatter.remove(t,o,n,r)})(e,t,o,n,r)},toggle:(t,o,n)=>{((e,t,o,n)=>{ew(e).formatter.toggle(t,o,n)})(e,t,o,n)},match:(t,o,n,r)=>((e,t,o,n,r)=>ew(e).formatter.match(t,o,n,r))(e,t,o,n,r),closest:t=>((e,t)=>ew(e).formatter.closest(t))(e,t),matchAll:(t,o)=>((e,t,o)=>ew(e).formatter.matchAll(t,o))(e,t,o),matchNode:(t,o,n,r)=>((e,t,o,n,r)=>ew(e).formatter.matchNode(t,o,n,r))(e,t,o,n,r),canApply:t=>((e,t)=>ew(e).formatter.canApply(t))(e,t),formatChanged:(t,n,r,i)=>((e,t,o,n,r,i)=>ew(e).formatter.formatChanged(t,o,n,r,i))(e,o,t,n,r,i),getCssText:B(Jw,e)}},e_=e=>{switch(e.toLowerCase()){case"undo":case"redo":case"mcefocus":return!0;default:return!1}},t_=e=>{const t=Os(),o=_s(0),n=_s(0),r={data:[],typing:!1,beforeChange:()=>{((e,t,o)=>{ew(e).undoManager.beforeChange(t,o)})(e,o,t)},add:(i,s)=>((e,t,o,n,r,i,s)=>ew(e).undoManager.add(t,o,n,r,i,s))(e,r,n,o,t,i,s),dispatchChange:()=>{e.setDirty(!0);const t=jy(e);t.bookmark=Ua(e.selection),e.dispatch("change",{level:t,lastLevel:ae(r.data,n.get()).getOrUndefined()})},undo:()=>((e,t,o,n)=>ew(e).undoManager.undo(t,o,n))(e,r,o,n),redo:()=>((e,t,o)=>ew(e).undoManager.redo(t,o))(e,n,r.data),clear:()=>{((e,t,o)=>{ew(e).undoManager.clear(t,o)})(e,r,n)},reset:()=>{((e,t)=>{ew(e).undoManager.reset(t)})(e,r)},hasUndo:()=>((e,t,o)=>ew(e).undoManager.hasUndo(t,o))(e,r,n),hasRedo:()=>((e,t,o)=>ew(e).undoManager.hasRedo(t,o))(e,r,n),transact:t=>((e,t,o,n)=>ew(e).undoManager.transact(t,o,n))(e,r,o,t),ignore:t=>{((e,t,o)=>{ew(e).undoManager.ignore(t,o)})(e,o,t)},extra:(t,o)=>{((e,t,o,n,r)=>{ew(e).undoManager.extra(t,o,n,r)})(e,r,n,t,o)}};return Jy(e)||((e,t,o)=>{const n=_s(!1),r=e=>{Yy(t,!1,o),t.add({},e)};e.on("init",(()=>{t.add()})),e.on("BeforeExecCommand",(e=>{const n=e.command;e_(n)||(Xy(t,o),t.beforeChange())})),e.on("ExecCommand",(e=>{const t=e.command;e_(t)||r(e)})),e.on("ObjectResizeStart cut",(()=>{t.beforeChange()})),e.on("SaveContent ObjectResized blur",r),e.on("dragend",r),e.on("keyup",(o=>{const i=o.keyCode;o.isDefaultPrevented()||((i>=33&&i<=36||i>=37&&i<=40||45===i||o.ctrlKey)&&(r(),e.nodeChanged()),46!==i&&8!==i||e.nodeChanged(),n.get()&&t.typing&&!qy(jy(e),t.data[0])&&(e.isDirty()||e.setDirty(!0),e.dispatch("TypingUndo"),n.set(!1),e.nodeChanged()))})),e.on("keydown",(e=>{const i=e.keyCode;if(e.isDefaultPrevented())return;if(i>=33&&i<=36||i>=37&&i<=40||45===i)return void(t.typing&&r(e));const s=e.ctrlKey&&!e.altKey||e.metaKey;!(i<16||i>20)||224===i||91===i||t.typing||s||(t.beforeChange(),Yy(t,!0,o),t.add({},e),n.set(!0))})),e.on("mousedown",(e=>{t.typing&&r(e)})),e.on("input",(e=>{var t;e.inputType&&("insertReplacementText"===e.inputType||"insertText"===(t=e).inputType&&null===t.data||(e=>"insertFromPaste"===e.inputType||"insertFromDrop"===e.inputType)(e))&&r(e)})),e.on("AddUndo Undo Redo ClearUndos",(t=>{t.isDefaultPrevented()||e.nodeChanged()}))})(e,r,o),(e=>{e.addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo")})(e),r},o_=[9,27,Nh.HOME,Nh.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,Nh.DOWN,Nh.UP,Nh.LEFT,Nh.RIGHT].concat(Ot.browser.isFirefox()?[224]:[]),n_="data-mce-placeholder",r_=e=>"keydown"===e.type||"keyup"===e.type,i_=e=>{const t=e.keyCode;return t===Nh.BACKSPACE||t===Nh.DELETE},s_=(e,t)=>({from:e,to:t}),a_=(e,t)=>{const o=mo(e),n=mo(t.container());return jg(o,n).map((e=>((e,t)=>({block:e,position:t}))(e,t)))},l_=(e,t)=>kn(t,(e=>vr(e)||Yn(e.dom)),(t=>bo(t,e))).filter(Lt).getOr(e),c_=e=>{const t=(e=>{const t=Mo(e);return Q(t,dr).fold(O(t),(e=>t.slice(0,e)))})(e);return $(t,rn),t},d_=(e,t)=>{const o=qp(t,e);return J(o.reverse(),(e=>ri(e))).each(rn)},u_=(e,t,o,n)=>{if(ri(o))return xr(o),eu(o.dom);0===G(Oo(n),(e=>!ri(e))).length&&ri(t)&&Jo(n,uo("br"));const r=Qd(o.dom,Ca.before(n.dom));return $(c_(t),(e=>{Jo(n,e)})),d_(e,t),r},h_=(e,t,o)=>{if(ri(o))return rn(o),ri(t)&&xr(t),eu(t.dom);const n=tu(o.dom);return $(c_(t),(e=>{tn(o,e)})),d_(e,t),n},m_=(e,t)=>{Kd(e,t.dom).bind((e=>F.from(e.getNode()))).map(mo).filter(hr).each(rn)},p_=(e,t,o)=>(m_(!0,t),m_(!1,o),((e,t)=>yo(t,e)?((e,t)=>{const o=qp(t,e);return F.from(o[o.length-1])})(t,e):F.none())(t,o).fold(B(h_,e,t,o),B(u_,e,t,o))),g_=(e,t,o,n)=>t?p_(e,n,o):p_(e,o,n),f_=(e,t)=>{const o=mo(e.getBody()),n=((e,t,o)=>o.collapsed?((e,t,o)=>{const n=a_(e,Ca.fromRangeStart(o)),r=n.bind((o=>Gd(t,e,o.position).bind((o=>a_(e,o).map((o=>((e,t,o)=>qn(o.position.getNode())&&!ri(o.block)?Kd(!1,o.block.dom).bind((n=>n.isEqual(o.position)?Gd(t,e,n).bind((t=>a_(e,t))):F.some(o))).getOr(o):o)(e,t,o)))))));return Vt(n,r,s_).filter((t=>(e=>!bo(e.from.block,e.to.block))(t)&&((e,t)=>{const o=mo(e);return bo(l_(o,t.from.block),l_(o,t.to.block))})(e,t)&&(e=>!1===Xn(e.from.block.dom)&&!1===Xn(e.to.block.dom))(t)&&(e=>{const t=e=>mr(e)||mi(e.dom);return t(e.from.block)&&t(e.to.block)})(t)))})(e,t,o):F.none())(o.dom,t,e.selection.getRng()).map((n=>()=>{g_(o,t,n.from.block,n.to.block).each((t=>{e.selection.setRng(t.toRange())}))}));return n},v_=(e,t)=>{const o=mo(t),n=B(bo,e);return Cn(o,vr,n).isSome()},b_=e=>{const t=mo(e.getBody());return((e,t)=>{const o=Qd(e.dom,Ca.fromRangeStart(t)).isNone(),n=Jd(e.dom,Ca.fromRangeEnd(t)).isNone();return!((e,t)=>v_(e,t.startContainer)||v_(e,t.endContainer))(e,t)&&o&&n})(t,e.selection.getRng())?(e=>F.some((()=>{e.setContent(""),e.selection.setCursorLocation()})))(e):((e,t)=>{const o=t.getRng();return Vt(jg(e,mo(o.startContainer)),jg(e,mo(o.endContainer)),((n,r)=>bo(n,r)?F.none():F.some((()=>{o.deleteContents(),g_(e,!0,n,r).each((e=>{t.setRng(e.toRange())}))})))).getOr(F.none())})(t,e.selection)},y_=(e,t)=>e.selection.isCollapsed()?F.none():b_(e),w_=(e,t,o,n,r)=>F.from(t._selectionOverrides.showCaret(e,o,n,r)),__=(e,t)=>e.dispatch("BeforeObjectSelected",{target:t}).isDefaultPrevented()?F.none():F.some((e=>{const t=e.ownerDocument.createRange();return t.selectNode(e),t})(t)),x_=(e,t,o)=>t.collapsed?((e,t,o)=>{const n=Ed(1,e.getBody(),t),r=Ca.fromRangeStart(n),i=r.getNode();if(rd(i))return w_(1,e,i,!r.isAtEnd(),!1);const s=r.getNode(!0);if(rd(s))return w_(1,e,s,!1,!1);const a=yf(e.dom.getRoot(),r.getNode());return rd(a)?w_(1,e,a,!1,o):F.none()})(e,t,o).getOr(t):t,C_=e=>Up(e)||zp(e),k_=e=>$p(e)||Hp(e),S_=(e,t,o,n,r,i)=>{w_(n,e,i.getNode(!r),r,!0).each((o=>{if(t.collapsed){const e=t.cloneRange();r?e.setEnd(o.startContainer,o.startOffset):e.setStart(o.endContainer,o.endOffset),e.deleteContents()}else t.deleteContents();e.selection.setRng(o)})),((e,t)=>{Hn(t)&&0===t.data.length&&e.remove(t)})(e.dom,o)},T_=(e,t)=>((e,t)=>{const o=e.selection.getRng();if(!Hn(o.commonAncestorContainer))return F.none();const n=t?Rd.Forwards:Rd.Backwards,r=Ud(e.getBody()),i=B(Bd,t?r.next:r.prev),s=t?C_:k_,a=Ad(n,e.getBody(),o),l=i(a),c=l?Fg(t,l):l;if(!c||!Pd(a,c))return F.none();if(s(c))return F.some((()=>S_(e,o,a.getNode(),n,t,c)));const d=i(c);return d&&s(d)&&Pd(c,d)?F.some((()=>S_(e,o,a.getNode(),n,t,d))):F.none()})(e,t),E_=(e,t)=>{const o=e.getBody();return t?eu(o).filter(Up):tu(o).filter($p)},O_=e=>{const t=e.selection.getRng();return!t.collapsed&&(E_(e,!0).exists((e=>e.isEqual(Ca.fromRangeStart(t))))||E_(e,!1).exists((e=>e.isEqual(Ca.fromRangeEnd(t)))))},A_=Ga([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),M_=(e,t,o)=>Gd(t,e,o).bind((n=>{return r=n.getNode(),_(r)&&(vr(mo(r))||gr(mo(r)))||((e,t,o,n)=>{const r=t=>ur(mo(t))&&!wd(o,n,e);return Od(!t,o).fold((()=>Od(t,n).fold(N,r)),r)})(e,t,o,n)?F.none():t&&Xn(n.getNode())||!t&&Xn(n.getNode(!0))?((e,t,o,n)=>{const r=n.getNode(!t);return jg(mo(e),mo(o.getNode())).map((e=>ri(e)?A_.remove(e.dom):A_.moveToElement(r))).orThunk((()=>F.some(A_.moveToElement(r))))})(e,t,o,n):t&&$p(o)||!t&&Up(o)?F.some(A_.moveToPosition(n)):F.none();var r})),B_=(e,t)=>F.from(yf(e.getBody(),t)),P_=(e,t)=>{const o=e.selection.getNode();return B_(e,o).filter(Xn).fold((()=>((e,t,o)=>{const n=Ed(t?1:-1,e,o),r=Ca.fromRangeStart(n),i=mo(e);return!t&&$p(r)?F.some(A_.remove(r.getNode(!0))):t&&Up(r)?F.some(A_.remove(r.getNode())):!t&&Up(r)&&ig(i,r)?sg(i,r).map((e=>A_.remove(e.getNode()))):t&&$p(r)&&rg(i,r)?ag(i,r).map((e=>A_.remove(e.getNode()))):((e,t,o)=>((e,t)=>{const o=t.getNode(!e),n=e?"after":"before";return Pn(o)&&o.getAttribute("data-mce-caret")===n})(t,o)?((e,t)=>w(t)?F.none():e&&Xn(t.nextSibling)?F.some(A_.moveToElement(t.nextSibling)):!e&&Xn(t.previousSibling)?F.some(A_.moveToElement(t.previousSibling)):F.none())(t,o.getNode(!t)).orThunk((()=>M_(e,t,o))):M_(e,t,o).bind((t=>((e,t,o)=>o.fold((e=>F.some(A_.remove(e))),(e=>F.some(A_.moveToElement(e))),(o=>wd(t,o,e)?F.none():F.some(A_.moveToPosition(o)))))(e,o,t))))(e,t,r)})(e.getBody(),t,e.selection.getRng()).map((o=>()=>o.fold(((e,t)=>o=>(e._selectionOverrides.hideFakeCaret(),Rg(e,t,mo(o)),!0))(e,t),((e,t)=>o=>{const n=t?Ca.before(o):Ca.after(o);return e.selection.setRng(n.toRange()),!0})(e,t),(e=>t=>(e.selection.setRng(t.toRange()),!0))(e))))),(()=>F.some(S)))},R_=e=>{const t=e.dom,o=e.selection,n=yf(e.getBody(),o.getNode());if(Yn(n)&&t.isBlock(n)&&t.isEmpty(n)){const e=t.create("br",{"data-mce-bogus":"1"});t.setHTML(n,""),n.appendChild(e),o.setRng(Ca.before(e).toRange())}return!0},V_=(e,t)=>e.selection.isCollapsed()?P_(e,t):((e,t)=>{const o=e.selection.getNode();return Xn(o)&&!Kn(o)?B_(e,o.parentNode).filter(Xn).fold((()=>F.some((()=>{var o;o=mo(e.getBody()),$(rr(o,".mce-offscreen-selection"),rn),Rg(e,t,mo(e.selection.getNode())),Ug(e)}))),(()=>F.some(S))):O_(e)?F.some((()=>{Wg(e,e.selection.getRng(),mo(e.getBody()))})):F.none()})(e,t),N_=(e,t)=>e.selection.isCollapsed()?((e,t)=>{const o=Ca.fromRangeStart(e.selection.getRng());return Gd(t,e.getBody(),o).filter((e=>t?Ip(e):Lp(e))).bind((e=>_d(t?0:-1,e))).map((t=>()=>e.selection.select(t)))})(e,t):F.none(),D_=Hn,F_=e=>D_(e)&&e.data[0]===kr,I_=e=>D_(e)&&e.data[e.data.length-1]===kr,L_=e=>{var t;return(null!==(t=e.ownerDocument)&&void 0!==t?t:document).createTextNode(kr)},z_=(e,t)=>e?(e=>{var t;if(D_(e.previousSibling))return I_(e.previousSibling)||e.previousSibling.appendData(kr),e.previousSibling;if(D_(e))return F_(e)||e.insertData(0,kr),e;{const o=L_(e);return null===(t=e.parentNode)||void 0===t||t.insertBefore(o,e),o}})(t):(e=>{var t,o;if(D_(e.nextSibling))return F_(e.nextSibling)||e.nextSibling.insertData(0,kr),e.nextSibling;if(D_(e))return I_(e)||e.appendData(kr),e;{const n=L_(e);return e.nextSibling?null===(t=e.parentNode)||void 0===t||t.insertBefore(n,e.nextSibling):null===(o=e.parentNode)||void 0===o||o.appendChild(n),n}})(t),H_=B(z_,!0),Z_=B(z_,!1),j_=(e,t)=>Hn(e.container())?z_(t,e.container()):z_(t,e.getNode()),U_=(e,t)=>{const o=t.get();return o&&e.container()===o&&Mr(o)},$_=(e,t)=>t.fold((t=>{Kc(e.get());const o=H_(t);return e.set(o),F.some(Ca(o,o.length-1))}),(t=>eu(t).map((t=>{if(U_(t,e)){const t=e.get();return Ca(t,1)}{Kc(e.get());const o=j_(t,!0);return e.set(o),Ca(o,1)}}))),(t=>tu(t).map((t=>{if(U_(t,e)){const t=e.get();return Ca(t,t.length-1)}{Kc(e.get());const o=j_(t,!1);return e.set(o),Ca(o,o.length-1)}}))),(t=>{Kc(e.get());const o=Z_(t);return e.set(o),F.some(Ca(o,1))})),W_=(e,t)=>{for(let o=0;o<e.length;o++){const n=e[o].apply(null,t);if(n.isSome())return n}return F.none()},q_=Ga([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),G_=(e,t)=>yd(t,e)||e,Y_=(e,t,o)=>{const n=Ig(o),r=G_(t,n.container());return Dg(e,r,n).fold((()=>Jd(r,n).bind(B(Dg,e,r)).map((e=>q_.before(e)))),F.none)},X_=(e,t)=>null===ru(e,t),K_=(e,t,o)=>Dg(e,t,o).filter(B(X_,t)),J_=(e,t,o)=>{const n=Lg(o);return K_(e,t,n).bind((e=>Qd(e,n).isNone()?F.some(q_.start(e)):F.none()))},Q_=(e,t,o)=>{const n=Ig(o);return K_(e,t,n).bind((e=>Jd(e,n).isNone()?F.some(q_.end(e)):F.none()))},ex=(e,t,o)=>{const n=Lg(o),r=G_(t,n.container());return Dg(e,r,n).fold((()=>Qd(r,n).bind(B(Dg,e,r)).map((e=>q_.after(e)))),F.none)},tx=e=>{return t=nx(e),!("rtl"===bs.DOM.getStyle(t,"direction",!0)||(e=>Vg.test(e))(null!==(o=t.textContent)&&void 0!==o?o:""));var t,o},ox=(e,t,o)=>W_([Y_,J_,Q_,ex],[e,t,o]).filter(tx),nx=e=>e.fold(A,A,A,A),rx=e=>e.fold(O("before"),O("start"),O("end"),O("after")),ix=e=>e.fold(q_.before,q_.before,q_.after,q_.after),sx=e=>e.fold(q_.start,q_.start,q_.end,q_.end),ax=(e,t,o,n,r,i)=>Vt(Dg(t,o,n),Dg(t,o,r),((t,n)=>t!==n&&((e,t,o)=>{const n=yd(t,e),r=yd(o,e);return _(n)&&n===r})(o,t,n)?q_.after(e?t:n):i)).getOr(i),lx=(e,t)=>e.fold(D,(e=>{return n=t,!(rx(o=e)===rx(n)&&nx(o)===nx(n));var o,n})),cx=(e,t)=>e?t.fold(T(F.some,q_.start),F.none,T(F.some,q_.after),F.none):t.fold(F.none,T(F.some,q_.before),F.none,T(F.some,q_.end)),dx=(e,t,o)=>{const n=e?1:-1;return t.setRng(Ca(o.container(),o.offset()+n).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0};var ux;!function(e){e[e.Br=0]="Br",e[e.Block=1]="Block",e[e.Wrap=2]="Wrap",e[e.Eol=3]="Eol"}(ux||(ux={}));const hx=(e,t)=>e===Rd.Backwards?ne(t):t,mx=(e,t,o)=>e===Rd.Forwards?t.next(o):t.prev(o),px=(e,t,o,n)=>qn(n.getNode(t===Rd.Forwards))?ux.Br:!1===wd(o,n)?ux.Block:ux.Wrap,gx=(e,t,o,n)=>{const r=Ud(o);let i=n;const s=[];for(;i;){const o=mx(t,r,i);if(!o)break;if(qn(o.getNode(!1)))return t===Rd.Forwards?{positions:hx(t,s).concat([o]),breakType:ux.Br,breakAt:F.some(o)}:{positions:hx(t,s),breakType:ux.Br,breakAt:F.some(o)};if(o.isVisible()){if(e(i,o)){const e=px(0,t,i,o);return{positions:hx(t,s),breakType:e,breakAt:F.some(o)}}s.push(o),i=o}else i=o}return{positions:hx(t,s),breakType:ux.Eol,breakAt:F.none()}},fx=(e,t,o,n)=>t(o,n).breakAt.map((n=>{const r=t(o,n).positions;return e===Rd.Backwards?r.concat(n):[n].concat(r)})).getOr([]),vx=(e,t)=>X(e,((e,o)=>e.fold((()=>F.some(o)),(n=>Vt(le(n.getClientRects()),le(o.getClientRects()),((e,r)=>{const i=Math.abs(t-e.left);return Math.abs(t-r.left)<=i?o:n})).or(e)))),F.none()),bx=(e,t)=>le(t.getClientRects()).bind((t=>vx(e,t.left))),yx=B(gx,Ca.isAbove,-1),wx=B(gx,Ca.isBelow,1),_x=B(fx,-1,yx),xx=B(fx,1,wx),Cx=(e,t)=>bx(_x(e,t),t),kx=(e,t)=>bx(xx(e,t),t),Sx=Xn,Tx=(e,t)=>Math.abs(e.left-t),Ex=(e,t)=>Math.abs(e.right-t),Ox=(e,t)=>Be(e,((e,o)=>{const n=Math.min(Tx(e,t),Ex(e,t)),r=Math.min(Tx(o,t),Ex(o,t));return r===n&&ke(o,"node")&&Sx(o.node)||r<n?o:e})),Ax=e=>{const t=t=>U(t,(t=>{const o=Xs(t);return o.node=e,o}));if(Pn(e))return t(e.getClientRects());if(Hn(e)){const o=e.ownerDocument.createRange();return o.setStart(e,0),o.setEnd(e,e.data.length),t(o.getClientRects())}return[]},Mx=e=>te(e,Ax);var Bx;!function(e){e[e.Up=-1]="Up",e[e.Down=1]="Down"}(Bx||(Bx={}));const Px=(e,t,o,n,r,i)=>{let s=0;const a=[],l=n=>{let i=Mx([n]);-1===e&&(i=i.reverse());for(let e=0;e<i.length;e++){const n=i[e];if(!o(n,c)){if(a.length>0&&t(n,Re(a))&&s++,n.line=s,r(n))return!0;a.push(n)}}return!1},c=Re(i.getClientRects());if(!c)return a;const d=i.getNode();return d&&(l(d),((e,t,o,n)=>{let r=n;for(;r=bd(r,e,Yr,t);)if(o(r))return})(e,n,l,d)),a},Rx=B(Px,Bx.Up,Qs,ea),Vx=B(Px,Bx.Down,ea,Qs),Nx=e=>Re(e.getClientRects()),Dx=e=>t=>((e,t)=>t.line>e)(e,t),Fx=e=>t=>((e,t)=>t.line===e)(e,t),Ix=(e,t)=>{e.selection.setRng(t),Rm(e,e.selection.getRng())},Lx=(e,t,o)=>F.some(x_(e,t,o)),zx=(e,t,o,n,r,i)=>{const s=t===Rd.Forwards,a=Ud(e.getBody()),l=B(Bd,s?a.next:a.prev),c=s?n:r;if(!o.collapsed){const n=oa(o);if(i(n))return w_(t,e,n,t===Rd.Backwards,!1);if(O_(e)){const e=o.cloneRange();return e.collapse(t===Rd.Backwards),F.from(e)}}const d=Ad(t,e.getBody(),o);if(c(d))return __(e,d.getNode(!s));let u=l(d);const h=Ir(o);if(!u)return h?F.some(o):F.none();if(u=Fg(s,u),c(u))return w_(t,e,u.getNode(!s),s,!1);const m=l(u);return m&&c(m)&&Pd(u,m)?w_(t,e,m.getNode(!s),s,!1):h?Lx(e,u.toRange(),!1):F.none()},Hx=(e,t,o,n,r,i)=>{const s=Ad(t,e.getBody(),o),a=Re(s.getClientRects()),l=t===Bx.Down,c=e.getBody();if(!a)return F.none();if(O_(e)){const e=l?Ca.fromRangeEnd(o):Ca.fromRangeStart(o);return(l?kx:Cx)(c,e).orThunk((()=>F.from(e))).map((e=>e.toRange()))}const d=(l?Vx:Rx)(c,Dx(1),s),u=G(d,Fx(1)),h=a.left,m=Ox(u,h);if(m&&i(m.node)){const o=Math.abs(h-m.left),n=Math.abs(h-m.right);return w_(t,e,m.node,o<n,!1)}let p;if(p=n(s)?s.getNode():r(s)?s.getNode(!0):oa(o),p){const o=((e,t,o,n)=>{const r=Ud(t);let i,s,a,l;const c=[];let d=0;1===e?(i=r.next,s=ea,a=Qs,l=Ca.after(n)):(i=r.prev,s=Qs,a=ea,l=Ca.before(n));const u=Nx(l);do{if(!l.isVisible())continue;const e=Nx(l);if(a(e,u))continue;c.length>0&&s(e,Re(c))&&d++;const t=Xs(e);if(t.position=l,t.line=d,o(t))return c;c.push(t)}while(l=i(l));return c})(t,c,Dx(1),p);let n=Ox(G(o,Fx(1)),h);if(n)return Lx(e,n.position.toRange(),!1);if(n=Re(G(o,Fx(0))),n)return Lx(e,n.position.toRange(),!1)}return 0===u.length?Zx(e,l).filter(l?r:n).map((t=>x_(e,t.toRange(),!1))):F.none()},Zx=(e,t)=>{const o=e.selection.getRng(),n=t?Ca.fromRangeEnd(o):Ca.fromRangeStart(o),r=(i=n.container(),s=e.getBody(),Cn(mo(i),(e=>sd(e.dom)),(e=>e.dom===s)).map((e=>e.dom)).getOr(s));var i,s;if(t){const e=wx(r,n);return ce(e.positions)}{const e=yx(r,n);return le(e.positions)}},jx=(e,t,o)=>Zx(e,t).filter(o).exists((t=>(e.selection.setRng(t.toRange()),!0))),Ux=(e,t)=>{const o=e.dom.createRng();o.setStart(t.container(),t.offset()),o.setEnd(t.container(),t.offset()),e.selection.setRng(o)},$x=(e,t)=>{e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected")},Wx=(e,t,o)=>$_(t,o).map((t=>(Ux(e,t),o))),qx=(e,t,o)=>{const n=e.getBody(),r=((e,t,o)=>{const n=Ca.fromRangeStart(e);if(e.collapsed)return n;{const r=Ca.fromRangeEnd(e);return o?Qd(t,r).getOr(r):Jd(t,n).getOr(n)}})(e.selection.getRng(),n,o);return((e,t,o,n)=>{const r=Fg(e,n),i=ox(t,o,r);return ox(t,o,r).bind(B(cx,e)).orThunk((()=>((e,t,o,n,r)=>{const i=Fg(e,r);return Gd(e,o,i).map(B(Fg,e)).fold((()=>n.map(ix)),(r=>ox(t,o,r).map(B(ax,e,t,o,i,r)).filter(B(lx,n)))).filter(tx)})(e,t,o,i,n)))})(o,B(Ng,e),n,r).bind((o=>Wx(e,t,o)))},Gx=(e,t,o)=>!!Kl(e)&&qx(e,t,o).isSome(),Yx=(e,t,o)=>!!Kl(t)&&((e,t)=>{const o=t.selection.getRng(),n=e?Ca.fromRangeEnd(o):Ca.fromRangeStart(o);return!!(e=>x(e.selection.getSel().modify))(t)&&(e&&Rr(n)?dx(!0,t.selection,n):!(e||!Vr(n))&&dx(!1,t.selection,n))})(e,t),Xx=e=>{const t=_s(null),o=B(Ng,e);return e.on("NodeChange",(n=>{Kl(e)&&(((e,t,o)=>{const n=U(rr(mo(t.getRoot()),'*[data-mce-selected="inline-boundary"]'),(e=>e.dom)),r=G(n,e),i=G(o,e);$(re(r,i),B($x,!1)),$(re(i,r),B($x,!0))})(o,e.dom,n.parents),((e,t)=>{const o=t.get();if(e.selection.isCollapsed()&&!e.composing&&o){const n=Ca.fromRangeStart(e.selection.getRng());Ca.isTextPosition(n)&&!(e=>Rr(e)||Vr(e))(n)&&(Ux(e,Xc(o,n)),t.set(null))}})(e,t),((e,t,o,n)=>{if(t.selection.isCollapsed()){const r=G(n,e);$(r,(n=>{const r=Ca.fromRangeStart(t.selection.getRng());ox(e,t.getBody(),r).bind((e=>Wx(t,o,e)))}))}})(o,e,t,n.parents))})),t},Kx=B(Yx,!0),Jx=B(Yx,!1),Qx=(e,t,o)=>{if(Kl(e)){const n=Zx(e,t).getOrThunk((()=>{const o=e.selection.getRng();return t?Ca.fromRangeEnd(o):Ca.fromRangeStart(o)}));return ox(B(Ng,e),e.getBody(),n).exists((t=>{const n=ix(t);return $_(o,n).exists((t=>(Ux(e,t),!0)))}))}return!1},eC=(e,t)=>o=>$_(t,o).map((t=>()=>Ux(e,t))),tC=(e,t,o,n)=>{const r=e.getBody(),i=B(Ng,e);e.undoManager.ignore((()=>{e.selection.setRng(((e,t)=>{const o=document.createRange();return o.setStart(e.container(),e.offset()),o.setEnd(t.container(),t.offset()),o})(o,n)),Hg(e),ox(i,r,Ca.fromRangeStart(e.selection.getRng())).map(sx).bind(eC(e,t)).each(V)})),e.nodeChanged()},oC=(e,t,o)=>{if(e.selection.isCollapsed()&&Kl(e)){const n=Ca.fromRangeStart(e.selection.getRng());return((e,t,o,n)=>{const r=((e,t)=>yd(t,e)||e)(e.getBody(),n.container()),i=B(Ng,e),s=ox(i,r,n);return s.bind((e=>o?e.fold(O(F.some(sx(e))),F.none,O(F.some(ix(e))),F.none):e.fold(F.none,O(F.some(ix(e))),F.none,O(F.some(sx(e)))))).map(eC(e,t)).getOrThunk((()=>{const a=Yd(o,r,n),l=a.bind((e=>ox(i,r,e)));return Vt(s,l,(()=>Dg(i,r,n).bind((t=>(e=>Vt(eu(e),tu(e),((t,o)=>{const n=Fg(!0,t),r=Fg(!1,o);return Jd(e,n).forall((e=>e.isEqual(r)))})).getOr(!0))(t)?F.some((()=>{Rg(e,o,mo(t))})):F.none())))).getOrThunk((()=>l.bind((()=>a.map((r=>()=>{o?tC(e,t,n,r):tC(e,t,r,n)}))))))}))})(e,t,o,n)}return F.none()},nC=e=>1===Vo(e),rC=(e,t)=>{const o=mo(e.getBody()),n=mo(e.selection.getStart()),r=G(((e,t)=>{const o=qp(t,e);return Q(o,dr).fold(O(o),(e=>o.slice(0,e)))})(o,n),nC);return ce(r).bind((o=>{const n=Ca.fromRangeStart(e.selection.getRng());return!((e,t,o)=>Vt(eu(o),tu(o),((n,r)=>{const i=Fg(!0,n),s=Fg(!1,r),a=Fg(!1,t);return e?Jd(o,a).exists((e=>e.isEqual(s)&&t.isEqual(i))):Qd(o,a).exists((e=>e.isEqual(i)&&t.isEqual(s)))})).getOr(!0))(t,n,o.dom)||nu((i=o).dom)&&ev(i.dom)?F.none():F.some((()=>((e,t,o,n)=>{const r=B(lv,t),i=U(G(n,r),(e=>e.dom));if(0===i.length)Rg(t,e,o);else{const e=((e,t)=>{const o=ov(!1),n=sv(t,o.dom);return Jo(mo(e),o),rn(mo(e)),Ca(n,0)})(o.dom,i);t.selection.setRng(e.toRange())}})(t,e,o,r)));var i}))},iC=(e,t)=>e.selection.isCollapsed()?rC(e,t):F.none(),sC=(e,t,o)=>_(o)?F.some((()=>{e._selectionOverrides.hideFakeCaret(),Rg(e,t,mo(o))})):F.none(),aC=(e,t)=>e.selection.isCollapsed()?((e,t)=>{const o=t?zp:Hp,n=t?Rd.Forwards:Rd.Backwards,r=Ad(n,e.getBody(),e.selection.getRng());return o(r)?sC(e,t,r.getNode(!t)):F.from(Fg(t,r)).filter((e=>o(e)&&Pd(r,e))).bind((o=>sC(e,t,o.getNode(!t))))})(e,t):((e,t)=>{const o=e.selection.getNode();return Qn(o)?sC(e,t,o):F.none()})(e,t),lC=e=>Ye(null!=e?e:"").getOr(0),cC=(e,t)=>(e||"table"===Dt(t)?"margin":"padding")+("rtl"===qo(t,"direction")?"-right":"-left"),dC=e=>{const t=hC(e);return!e.mode.isReadOnly()&&(t.length>1||((e,t)=>oe(t,(t=>{const o=cC(Nl(e),t),n=Yo(t,o).map(lC).getOr(0);return"false"!==e.dom.getContentEditable(t.dom)&&n>0})))(e,t))},uC=e=>pr(e)||gr(e),hC=e=>G(an(e.selection.getSelectedBlocks()),(e=>!uC(e)&&!(e=>Co(e).exists(uC))(e)&&kn(e,(e=>Yn(e.dom)||Xn(e.dom))).exists((e=>Yn(e.dom))))),mC=(e,t)=>{var o,n;const{dom:r}=e,i=Dl(e),s=null!==(n=null===(o=/[a-z%]+$/i.exec(i))||void 0===o?void 0:o[0])&&void 0!==n?n:"px",a=lC(i),l=Nl(e);$(hC(e),(e=>{((e,t,o,n,r,i)=>{const s=cC(o,mo(i)),a=lC(e.getStyle(i,s));if("outdent"===t){const t=Math.max(0,a-n);e.setStyle(i,s,t?t+r:"")}else{const t=a+n+r;e.setStyle(i,s,t)}})(r,t,l,a,s,e.dom)}))},pC=e=>mC(e,"outdent"),gC=e=>{if(e.selection.isCollapsed()&&dC(e)){const t=e.dom,o=e.selection.getRng(),n=Ca.fromRangeStart(o),r=t.getParent(o.startContainer,t.isBlock);if(null!==r&&Jp(mo(r),n))return F.some((()=>pC(e)))}return F.none()},fC=(e,t,o)=>ue([gC,V_,T_,(e,o)=>oC(e,t,o),f_,bf,N_,aC,y_,iC],(t=>t(e,o))),vC=(e,t)=>{e.addCommand("delete",(()=>{((e,t)=>{fC(e,t,!1).fold((()=>{Hg(e),Ug(e)}),V)})(e,t)})),e.addCommand("forwardDelete",(()=>{((e,t)=>{fC(e,t,!0).fold((()=>(e=>zg(e,"ForwardDelete"))(e)),V)})(e,t)}))},bC=e=>void 0===e.touches||1!==e.touches.length?F.none():F.some(e.touches[0]),yC=(e,t)=>Ce(e,t.nodeName),wC=(e,t)=>!!Hn(t)||!!Pn(t)&&!yC(e.getBlockElements(),t)&&!fu(t)&&!fi(e,t),_C=(e,t)=>{if(Hn(t)){if(0===t.data.length)return!0;if(/^\s+$/.test(t.data)&&(!t.nextSibling||yC(e,t.nextSibling)))return!0}return!1},xC=e=>e.dom.create(gl(e),fl(e)),CC=e=>{const t=e.dom,o=e.selection,n=e.schema,r=n.getBlockElements(),i=o.getStart(),s=e.getBody();let a,l,c=!1;const d=gl(e);if(!i||!Pn(i))return;const u=s.nodeName.toLowerCase();if(!n.isValidChild(u,d.toLowerCase())||((e,t,o)=>j(Wp(mo(o),mo(t)),(t=>yC(e,t.dom))))(r,s,i))return;const h=o.getRng(),{startContainer:m,startOffset:p,endContainer:g,endOffset:f}=h,v=ep(e);let b=s.firstChild;for(;b;)if(Pn(b)&&hi(n,b),wC(n,b)){if(_C(r,b)){l=b,b=b.nextSibling,t.remove(l);continue}a||(a=xC(e),s.insertBefore(a,b),c=!0),l=b,b=b.nextSibling,a.appendChild(l)}else a=null,b=b.nextSibling;c&&v&&(h.setStart(m,p),h.setEnd(g,f),o.setRng(h),e.nodeChanged())},kC=(e,t,o)=>{const n=mo(xC(e)),r=_r();tn(n,r),o(t,n);const i=document.createRange();return i.setStartBefore(r.dom),i.setEndBefore(r.dom),i},SC=e=>t=>-1!==(" "+t.attr("class")+" ").indexOf(e),TC=(e,t,o)=>function(n){const r=arguments,i=r[r.length-2],s=i>0?t.charAt(i-1):"";if('"'===s)return n;if(">"===s){const e=t.lastIndexOf("<",i);if(-1!==e&&-1!==t.substring(e,i).indexOf('contenteditable="false"'))return n}return'<span class="'+o+'" data-mce-content="'+e.dom.encode(r[0])+'">'+e.dom.encode("string"==typeof r[1]?r[1]:r[0])+"</span>"},EC=(e,t)=>{t.hasAttribute("data-mce-caret")&&(Fr(t),e.selection.setRng(e.selection.getRng()),e.selection.scrollIntoView(t))},OC=(e,t)=>{const o=(e=>Tn(mo(e.getBody()),"*[data-mce-caret]").map((e=>e.dom)).getOrNull())(e);if(o)return"compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void EC(e,o)):void(Pr(o)&&(EC(e,o),e.undoManager.add()))},AC=Xn,MC=(e,t,o)=>{const n=Ud(e.getBody()),r=B(Bd,1===t?n.next:n.prev);if(o.collapsed){const n=e.dom.getParent(o.startContainer,"PRE");if(!n)return;if(!r(Ca.fromRangeStart(o))){const o=mo((e=>{const t=e.dom.create(gl(e));return t.innerHTML='<br data-mce-bogus="1">',t})(e));1===t?Qo(mo(n),o):Jo(mo(n),o),e.selection.select(o.dom,!0),e.selection.collapse()}}},BC=(e,t)=>((e,t)=>{const o=t?Rd.Forwards:Rd.Backwards,n=e.selection.getRng();return((e,t,o)=>zx(t,e,o,Up,$p,AC))(o,e,n).orThunk((()=>(MC(e,o,n),F.none())))})(e,t).exists((t=>(Ix(e,t),!0))),PC=(e,t)=>((e,t)=>{const o=t?1:-1,n=e.selection.getRng();return((e,t,o)=>Hx(t,e,o,(e=>Up(e)||Zp(e)),(e=>$p(e)||jp(e)),AC))(o,e,n).orThunk((()=>(MC(e,o,n),F.none())))})(e,t).exists((t=>(Ix(e,t),!0))),RC=(e,t)=>jx(e,t,t?$p:Up),VC=(e,t)=>E_(e,!t).map((o=>{const n=o.toRange(),r=e.selection.getRng();return t?n.setStart(r.startContainer,r.startOffset):n.setEnd(r.endContainer,r.endOffset),n})).exists((t=>(Ix(e,t),!0))),NC=e=>Z(["figcaption"],Dt(e)),DC=(e,t)=>{const o=mo(e.getBody()),n=Ca.fromRangeStart(e.selection.getRng());return((e,t)=>{const o=B(bo,t);return kn(mo(e.container()),dr,o).filter(NC)})(n,o).exists((()=>{if(((e,t,o)=>t?((e,t)=>wx(e,t).breakAt.isNone())(e.dom,o):((e,t)=>yx(e,t).breakAt.isNone())(e.dom,o))(o,t,n)){const n=kC(e,o,t?tn:en);return e.selection.setRng(n),!0}return!1}))},FC=(e,t)=>!!e.selection.isCollapsed()&&DC(e,t),IC={shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0},LC=(e,t)=>t.keyCode===e.keyCode&&t.shiftKey===e.shiftKey&&t.altKey===e.altKey&&t.ctrlKey===e.ctrlKey&&t.metaKey===e.metaKey,zC=(e,...t)=>()=>e.apply(null,t),HC=(e,t)=>J(((e,t)=>te((e=>U(e,(e=>({...IC,...e}))))(e),(e=>LC(e,t)?[e]:[])))(e,t),(e=>e.action())),ZC=(e,t)=>ue(((e,t)=>te((e=>U(e,(e=>({...IC,...e}))))(e),(e=>LC(e,t)?[e]:[])))(e,t),(e=>e.action())),jC=(e,t)=>{const o=t?Rd.Forwards:Rd.Backwards,n=e.selection.getRng();return zx(e,o,n,zp,Hp,Qn).exists((t=>(Ix(e,t),!0)))},UC=(e,t)=>{const o=t?1:-1,n=e.selection.getRng();return Hx(e,o,n,zp,Hp,Qn).exists((t=>(Ix(e,t),!0)))},$C=(e,t)=>jx(e,t,t?Hp:zp),WC=Ga([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),qC={...WC,none:e=>WC.none(e)},GC=(e,t,o)=>te(Mo(e),(e=>fo(e,t)?o(e)?[e]:[]:GC(e,t,o))),YC=(e,t)=>En(e,"table",t),XC=(e,t,o,n,r=D)=>{const i=1===n;if(!i&&o<=0)return qC.first(e[0]);if(i&&o>=e.length-1)return qC.last(e[e.length-1]);{const i=o+n,s=e[i];return r(s)?qC.middle(t,s):XC(e,t,i,n,r)}},KC=(e,t)=>YC(e,t).bind((t=>{const o=GC(t,"th,td",D);return Q(o,(t=>bo(e,t))).map((e=>({index:e,all:o})))})),JC=(e,t=!1)=>{return jo(e)?e.dom.isContentEditable:(o=e,En(o,"[contenteditable]")).fold(O(t),(e=>"true"===QC(e)));var o},QC=e=>e.dom.contentEditable,ek=(e,t,o,n,r)=>{const i=rr(mo(o),"td,th,caption").map((e=>e.dom)),s=G(((e,t)=>te(t,(t=>{const o=((e,t)=>({left:e.left-t,top:e.top-t,right:e.right+-2,bottom:e.bottom+-2,width:e.width+t,height:e.height+t}))(Xs(t.getBoundingClientRect()),-1);return[{x:o.left,y:e(o),cell:t},{x:o.right,y:e(o),cell:t}]})))(e,i),(e=>t(e,r)));return((e,t,o)=>X(e,((e,n)=>e.fold((()=>F.some(n)),(e=>{const r=Math.sqrt(Math.abs(e.x-t)+Math.abs(e.y-o)),i=Math.sqrt(Math.abs(n.x-t)+Math.abs(n.y-o));return F.some(i<r?n:e)}))),F.none()))(s,n,r).map((e=>e.cell))},tk=B(ek,(e=>e.bottom),((e,t)=>e.y<t)),ok=B(ek,(e=>e.top),((e,t)=>e.y>t)),nk=(e,t,o)=>{const n=e(t,o);return(e=>e.breakType===ux.Wrap&&0===e.positions.length)(n)||!qn(o.getNode())&&(e=>e.breakType===ux.Br&&1===e.positions.length)(n)?!((e,t,o)=>o.breakAt.exists((o=>e(t,o).breakAt.isSome())))(e,t,n):n.breakAt.isNone()},rk=B(nk,yx),ik=B(nk,wx),sk=(e,t,o,n)=>{const r=e.selection.getRng(),i=t?1:-1;return!(!nd()||!((e,t,o)=>{const n=Ca.fromRangeStart(t);return Kd(!e,o).exists((e=>e.isEqual(n)))})(t,r,o)||(w_(i,e,o,!t,!1).each((t=>{Ix(e,t)})),0))},ak=(e,t,o)=>{const n=((e,t)=>{const o=t.getNode(e);return In(o)?F.some(o):F.none()})(!!t,o),r=!1===t;n.fold((()=>Ix(e,o.toRange())),(n=>Kd(r,e.getBody()).filter((e=>e.isEqual(o))).fold((()=>Ix(e,o.toRange())),(o=>((e,t,o)=>{t.undoManager.transact((()=>{const n=e?Qo:Jo,r=kC(t,mo(o),n);Ix(t,r)}))})(t,e,n)))))},lk=(e,t,o,n)=>{const r=e.selection.getRng(),i=Ca.fromRangeStart(r),s=e.getBody();if(!t&&rk(n,i)){const n=((e,t,o)=>((e,t)=>le(t.getClientRects()).bind((t=>tk(e,t.left,t.top))).bind((e=>{return bx(tu(o=e).map((e=>yx(o,e).positions.concat(e))).getOr([]),t);var o})))(t,o).orThunk((()=>le(o.getClientRects()).bind((o=>vx(_x(e,Ca.before(t)),o.left))))).getOr(Ca.before(t)))(s,o,i);return ak(e,t,n),!0}if(t&&ik(n,i)){const n=((e,t,o)=>((e,t)=>ce(t.getClientRects()).bind((t=>ok(e,t.left,t.top))).bind((e=>{return bx(eu(o=e).map((e=>[e].concat(wx(o,e).positions))).getOr([]),t);var o})))(t,o).orThunk((()=>le(o.getClientRects()).bind((o=>vx(xx(e,Ca.after(t)),o.left))))).getOr(Ca.after(t)))(s,o,i);return ak(e,t,n),!0}return!1},ck=(e,t,o)=>F.from(e.dom.getParent(e.selection.getNode(),"td,th")).bind((n=>F.from(e.dom.getParent(n,"table")).map((r=>o(e,t,r,n))))).getOr(!1),dk=(e,t)=>ck(e,t,sk),uk=(e,t)=>ck(e,t,lk),hk=(e,t,o)=>o.fold(F.none,F.none,((e,t)=>{return(o=t,((e,t)=>{const o=e=>{for(let n=0;n<e.childNodes.length;n++){const r=mo(e.childNodes[n]);if(t(r))return F.some(r);const i=o(e.childNodes[n]);if(i.isSome())return i}return F.none()};return o(e.dom)})(o,lp)).map((e=>(e=>{const t=Xh.exact(e,0,e,0);return tm(t)})(e)));var o}),(o=>(e.execCommand("mceTableInsertRowAfter"),mk(e,t,o)))),mk=(e,t,o)=>{return hk(e,t,(r=JC,KC(n=o,void 0).fold((()=>qC.none(n)),(e=>XC(e.all,n,e.index,1,r)))));var n,r},pk=(e,t,o)=>{return hk(e,t,(r=JC,KC(n=o,void 0).fold((()=>qC.none()),(e=>XC(e.all,n,e.index,-1,r)))));var n,r},gk=(e,t)=>{const o=["table","li","dl"],n=mo(e.getBody()),r=e=>{const t=Dt(e);return bo(e,n)||Z(o,t)},i=e.selection.getRng();return((e,t)=>((e,t,o=N)=>o(t)?F.none():Z(e,Dt(t))?F.some(t):Sn(t,e.join(","),(e=>fo(e,"table")||o(e))))(["td","th"],e,t))(mo(t?i.endContainer:i.startContainer),r).map((o=>(YC(o,r).each((t=>{e.model.table.clearSelectedCells(t.dom)})),e.selection.collapse(!t),(t?mk:pk)(e,r,o).each((t=>{e.selection.setRng(t)})),!0))).getOr(!1)},fk=(e,t)=>({container:e,offset:t}),vk=bs.DOM,bk=e=>t=>e===t?-1:0,yk=(e,t,o)=>{if(Hn(e)&&t>=0)return F.some(fk(e,t));{const n=Gs(vk);return F.from(n.backwards(e,t,bk(e),o)).map((e=>fk(e.container,e.container.data.length)))}},wk=(e,t,o)=>{if(!Hn(e))return F.none();const n=e.data;if(t>=0&&t<=n.length)return F.some(fk(e,t));{const n=Gs(vk);return F.from(n.backwards(e,t,bk(e),o)).bind((e=>{const n=e.container.data;return wk(e.container,t+n.length,o)}))}},_k=(e,t,o)=>{if(!Hn(e))return F.none();const n=e.data;if(t<=n.length)return F.some(fk(e,t));{const r=Gs(vk);return F.from(r.forwards(e,t,bk(e),o)).bind((e=>_k(e.container,t-n.length,o)))}},xk=(e,t,o,n,r)=>{const i=Gs(e,(e=>t=>e.isBlock(t)||Z(["BR","IMG","HR","INPUT"],t.nodeName)||"false"===e.getContentEditable(t))(e));return F.from(i.backwards(t,o,n,r))},Ck=e=>Tr(e.toString().replace(/\u00A0/g," ")),kk=e=>""!==e&&-1!=="  \f\n\r\t\v".indexOf(e),Sk=(e,t)=>e.substring(t.length),Tk=(e,t,o,n=0)=>{return(r=mo(t.startContainer),En(r,cp)).fold((()=>((e,t,o,n=0)=>{if(!(r=t).collapsed||!Hn(r.startContainer))return F.none();var r;const i={text:"",offset:0},s=e.getParent(t.startContainer,e.isBlock)||e.getRoot();return xk(e,t.startContainer,t.startOffset,((e,t,n)=>(i.text=n+i.text,i.offset+=t,((e,t,o)=>{let n;const r=o.charAt(0);for(n=t-1;n>=0;n--){const i=e.charAt(n);if(kk(i))return F.none();if(r===i&&ze(e,o,n,t))break}return F.some(n)})(i.text,i.offset,o).getOr(t))),s).bind((e=>{const r=t.cloneRange();if(r.setStart(e.container,e.offset),r.setEnd(t.endContainer,t.endOffset),r.collapsed)return F.none();const i=Ck(r);return 0!==i.lastIndexOf(o)||Sk(i,o).length<n?F.none():F.some({text:Sk(i,o),range:r,trigger:o})}))})(e,t,o,n)),(t=>{const n=e.createRng();n.selectNode(t.dom);const r=Ck(n);return F.some({range:n,text:Sk(r,o),trigger:o})}));var r},Ek=e=>{if((e=>3===e.nodeType)(e))return fk(e,e.data.length);{const t=e.childNodes;return t.length>0?Ek(t[t.length-1]):fk(e,t.length)}},Ok=(e,t)=>{const o=e.childNodes;return o.length>0&&t<o.length?Ok(o[t],0):o.length>0&&(e=>1===e.nodeType)(e)&&o.length===t?Ek(o[o.length-1]):fk(e,t)},Ak=(e,t,o,n={})=>{var r;const i=t(),s=null!==(r=e.selection.getRng().startContainer.nodeValue)&&void 0!==r?r:"",a=G(i.lookupByTrigger(o.trigger),(t=>o.text.length>=t.minChars&&t.matches.getOrThunk((()=>(e=>t=>{const o=Ok(t.startContainer,t.startOffset);return!((e,t)=>{var o;const n=null!==(o=e.getParent(t.container,e.isBlock))&&void 0!==o?o:e.getRoot();return xk(e,t.container,t.offset,((e,t)=>0===t?-1:t),n).filter((e=>{const t=e.container.data.charAt(e.offset-1);return!kk(t)})).isSome()})(e,o)})(e.dom)))(o.range,s,o.text)));if(0===a.length)return F.none();const l=Promise.all(U(a,(e=>e.fetch(o.text,e.maxResults,n).then((t=>({matchText:o.text,items:t,columns:e.columns,onAction:e.onAction,highlightOn:e.highlightOn}))))));return F.some({lookupData:l,context:o})};var Mk;!function(e){e[e.Error=0]="Error",e[e.Value=1]="Value"}(Mk||(Mk={}));const Bk=(e,t,o)=>e.stype===Mk.Error?t(e.serror):o(e.svalue),Pk=e=>({stype:Mk.Value,svalue:e}),Rk=e=>({stype:Mk.Error,serror:e}),Vk=Bk,Nk=e=>p(e)&&he(e).length>100?" removed due to size":JSON.stringify(e,null,2),Dk=(e,t)=>Rk([{path:e,getErrorInfo:t}]),Fk=(e,t)=>({extract:(o,n)=>xe(n,e).fold((()=>((e,t)=>Dk(e,(()=>'Choice schema did not contain choice key: "'+t+'"')))(o,e)),(e=>((e,t,o,n)=>xe(o,n).fold((()=>((e,t,o)=>Dk(e,(()=>'The chosen schema: "'+o+'" did not exist in branches: '+Nk(t))))(e,o,n)),(o=>o.extract(e.concat(["branch: "+n]),t))))(o,n,t,e))),toString:()=>"chooseOn("+e+"). Possible values: "+he(t)}),Ik=e=>(...t)=>{if(0===t.length)throw new Error("Can't merge zero objects");const o={};for(let n=0;n<t.length;n++){const r=t[n];for(const t in r)Ce(r,t)&&(o[t]=e(o[t],r[t]))}return o},Lk=Ik(((e,t)=>g(e)&&g(t)?Lk(e,t):t)),zk=(Ik(((e,t)=>t)),e=>({tag:"defaultedThunk",process:O(e)})),Hk=e=>{const t=(e=>{const t=[],o=[];return $(e,(e=>{Bk(e,(e=>o.push(e)),(e=>t.push(e)))})),{values:t,errors:o}})(e);return t.errors.length>0?(o=t.errors,T(Rk,ee)(o)):Pk(t.values);var o},Zk=(e,t,o)=>{switch(e.tag){case"field":return t(e.key,e.newKey,e.presence,e.prop);case"custom":return o(e.newKey,e.instantiator)}},jk=e=>({extract:(t,o)=>{return n=e(o),r=e=>((e,t)=>Dk(e,O(t)))(t,e),n.stype===Mk.Error?r(n.serror):n;var n,r},toString:O("val")}),Uk=jk(Pk),$k=(e,t,o,n)=>n(xe(e,t).getOrThunk((()=>o(e)))),Wk=(e,t,o,n,r)=>{const i=e=>r.extract(t.concat([n]),e),s=e=>e.fold((()=>Pk(F.none())),(e=>{const o=r.extract(t.concat([n]),e);return i=o,s=F.some,i.stype===Mk.Value?{stype:Mk.Value,svalue:s(i.svalue)}:i;var i,s}));switch(e.tag){case"required":return((e,t,o,n)=>xe(t,o).fold((()=>((e,t,o)=>Dk(e,(()=>'Could not find valid *required* value for "'+t+'" in '+Nk(o))))(e,o,t)),n))(t,o,n,i);case"defaultedThunk":return $k(o,n,e.process,i);case"option":return((e,t,o)=>o(xe(e,t)))(o,n,s);case"defaultedOptionThunk":return((e,t,o,n)=>n(xe(e,t).map((t=>!0===t?o(e):t))))(o,n,e.process,s);case"mergeWithThunk":return $k(o,n,O({}),(t=>{const n=Lk(e.process(o),t);return i(n)}))}},qk=e=>({extract:(t,o)=>((e,t,o)=>{const n={},r=[];for(const i of o)Zk(i,((o,i,s,a)=>{const l=Wk(s,e,t,o,a);Vk(l,(e=>{r.push(...e)}),(e=>{n[i]=e}))}),((e,o)=>{n[e]=o(t)}));return r.length>0?Rk(r):Pk(n)})(t,o,e),toString:()=>{const t=U(e,(e=>Zk(e,((e,t,o,n)=>e+" -> "+n.toString()),((e,t)=>"state("+e+")"))));return"obj{\n"+t.join("\n")+"}"}}),Gk=e=>({extract:(t,o)=>{const n=U(o,((o,n)=>e.extract(t.concat(["["+n+"]"]),o)));return Hk(n)},toString:()=>"array("+e.toString()+")"}),Yk=(e,t,o)=>{return n=((e,t,o)=>((e,t)=>e.stype===Mk.Error?{stype:Mk.Error,serror:t(e.serror)}:e)(t.extract([e],o),(e=>({input:o,errors:e}))))(e,t,o),Bk(n,qa.error,qa.value);var n},Xk=(e,t)=>Fk(e,ge(t,qk)),Kk=O(Uk),Jk=(e,t)=>jk((o=>{const n=typeof o;return e(o)?Pk(o):Rk(`Expected type: ${t} but got: ${n}`)})),Qk=Jk(C,"number"),eS=Jk(m,"string"),tS=Jk(b,"boolean"),oS=Jk(x,"function"),nS=(e,t,o,n)=>({tag:"field",key:e,newKey:t,presence:o,prop:n}),rS=(e,t)=>({tag:"custom",newKey:e,instantiator:t}),iS=(e,t)=>nS(e,e,{tag:"required",process:{}},t),sS=e=>iS(e,eS),aS=e=>iS(e,oS),lS=(e,t)=>nS(e,e,{tag:"option",process:{}},t),cS=e=>lS(e,eS),dS=(e,t,o)=>nS(e,e,zk(t),o),uS=(e,t)=>dS(e,t,Qk),hS=(e,t,o)=>dS(e,t,(e=>{return t=t=>Z(e,t)?qa.value(t):qa.error(`Unsupported value: "${t}", choose one of "${e.join(", ")}".`),jk((e=>t(e).fold(Rk,Pk)));var t})(o)),mS=(e,t)=>dS(e,t,tS),pS=(e,t)=>dS(e,t,oS),gS=sS("type"),fS=aS("fetch"),vS=aS("onAction"),bS=pS("onSetup",(()=>S)),yS=cS("text"),wS=cS("icon"),_S=cS("tooltip"),xS=cS("label"),CS=mS("active",!1),kS=mS("enabled",!0),SS=mS("primary",!1),TS=e=>((e,t)=>dS("type",t,eS))(0,e),ES=qk([gS,sS("trigger"),uS("minChars",1),(1,((e,t)=>nS(e,e,zk(1),Kk()))("columns")),uS("maxResults",10),("matches",lS("matches",oS)),fS,vS,(OS=eS,dS("highlightOn",[],Gk(OS)))]);var OS;const AS=[kS,_S,wS,yS,bS],MS=[CS].concat(AS),BS=[pS("predicate",N),hS("scope","node",["node","editor"]),hS("position","selection",["node","selection","line"])],PS=AS.concat([TS("contextformbutton"),SS,vS,rS("original",A)]),RS=MS.concat([TS("contextformbutton"),SS,vS,rS("original",A)]),VS=AS.concat([TS("contextformbutton")]),NS=MS.concat([TS("contextformtogglebutton")]),DS=Xk("type",{contextformbutton:PS,contextformtogglebutton:RS});qk([TS("contextform"),pS("initValue",O("")),xS,((e,t)=>nS(e,e,{tag:"required",process:{}},Gk(t)))("commands",DS),lS("launch",Xk("type",{contextformbutton:VS,contextformtogglebutton:NS}))].concat(BS));const FS=e=>{const t=e.ui.registry.getAll().popups,o=ge(t,(e=>{return(t=e,Yk("Autocompleter",ES,{trigger:t.ch,...t})).fold((e=>{throw new Error("Errors: \n"+(e=>{const t=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:O("... (only showing first ten failures)")}]):e;return U(t,(e=>"Failed path: ("+e.path.join(" > ")+")\n"+e.getErrorInfo()))})((t=e).errors).join("\n")+"\n\nInput object: "+Nk(t.input));var t}),A);var t})),n=Se(we(o,(e=>e.trigger))),r=_e(o);return{dataset:o,triggers:n,lookupByTrigger:e=>G(r,(t=>t.trigger===e))}},IS=e=>{const t=Os(),o=_s(!1),n=t.isSet,r=()=>{n()&&((e=>{ew(e).autocompleter.removeDecoration()})(e),(e=>{e.dispatch("AutocompleterEnd")})(e),o.set(!1),t.clear())},i=Ve((()=>FS(e))),s=s=>{(o=>t.get().map((t=>Tk(e.dom,e.selection.getRng(),t.trigger).bind((t=>Ak(e,i,t,o))))).getOrThunk((()=>((e,t)=>{const o=t(),n=e.selection.getRng();return((e,t,o)=>ue(o.triggers,(o=>Tk(e,t,o))))(e.dom,n,o).bind((o=>Ak(e,t,o)))})(e,i))))(s).fold(r,(i=>{(o=>{n()||(((e,t)=>{ew(e).autocompleter.addDecoration(t)})(e,o.range),t.set({trigger:o.trigger,matchLength:o.text.length}))})(i.context),i.lookupData.then((n=>{t.get().map((s=>{const a=i.context;s.trigger===a.trigger&&(a.text.length-s.matchLength>=10?r():(t.set({...s,matchLength:a.text.length}),o.get()?((e,t)=>{e.dispatch("AutocompleterUpdate",t)})(e,{lookupData:n}):(o.set(!0),((e,t)=>{e.dispatch("AutocompleterStart",t)})(e,{lookupData:n}))))}))}))}))};e.addCommand("mceAutocompleterReload",((e,t)=>{const o=p(t)?t.fetchOptions:{};s(o)})),e.addCommand("mceAutocompleterClose",r),((e,t)=>{const o=Ms(t.load,50);e.on("keypress compositionend",(e=>{27!==e.which&&o.throttle()})),e.on("keydown",(e=>{const n=e.which;8===n?o.throttle():27===n&&t.cancelIfNecessary()})),e.on("remove",o.cancel)})(e,{cancelIfNecessary:r,load:s})},LS=e=>(t,o,n={})=>{const r=t.getBody(),i={bubbles:!0,composed:!0,data:null,isComposing:!1,detail:0,view:null,target:r,currentTarget:r,eventPhase:Event.AT_TARGET,originalTarget:r,explicitOriginalTarget:r,isTrusted:!1,srcElement:r,cancelable:!1,preventDefault:S,inputType:o},s=ts(new InputEvent(e));return t.dispatch(e,{...s,...i,...n})},zS=LS("input"),HS=LS("beforeinput"),ZS=(e,t)=>{const o=e.dom,n=e.schema.getMoveCaretBeforeOnEnterElements();if(!t)return;if(/^(LI|DT|DD)$/.test(t.nodeName)){const e=(e=>{for(;e;){if(Pn(e)||Hn(e)&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}return null})(t.firstChild);e&&/^(UL|OL|DL)$/.test(e.nodeName)&&t.insertBefore(o.doc.createTextNode(or),t.firstChild)}const r=o.createRng();if(t.normalize(),t.hasChildNodes()){const e=new An(t,t);let o,i=t;for(;o=e.current();){if(Hn(o)){r.setStart(o,0),r.setEnd(o,0);break}if(n[o.nodeName.toLowerCase()]){r.setStartBefore(o),r.setEndBefore(o);break}i=o,o=e.next()}o||(r.setStart(i,0),r.setEnd(i,0))}else qn(t)?t.nextSibling&&o.isBlock(t.nextSibling)?(r.setStartBefore(t),r.setEndBefore(t)):(r.setStartAfter(t),r.setEndAfter(t)):(r.setStart(t,0),r.setEnd(t,0));e.selection.setRng(r),Rm(e,r)},jS=(e,t)=>{const o=e.getRoot();let n,r=t;for(;r!==o&&r&&"false"!==e.getContentEditable(r);)"true"===e.getContentEditable(r)&&(n=r),r=r.parentNode;return r!==o?n:o},US=e=>F.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock)),$S=(e,t)=>{const o=null==e?void 0:e.parentNode;return _(o)&&o.nodeName===t},WS=e=>_(e)&&/^(OL|UL|LI)$/.test(e.nodeName),qS=e=>{const t=e.parentNode;return _(o=t)&&/^(LI|DT|DD)$/.test(o.nodeName)?t:e;var o},GS=(e,t,o)=>{let n=e[o?"firstChild":"lastChild"];for(;n&&!Pn(n);)n=n[o?"nextSibling":"previousSibling"];return n===t},YS=(e,t)=>t&&"A"===t.nodeName&&e.isEmpty(t),XS=e=>{e.innerHTML='<br data-mce-bogus="1">'},KS=(e,t)=>e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t,JS=(e,t)=>_(t)&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t),QS=(e,t,o)=>Hn(t)?e?1===o&&t.data.charAt(o-1)===kr?0:o:o===t.data.length-1&&t.data.charAt(o)===kr?t.data.length:o:o,eT=(e,t)=>{gl(e).toLowerCase()===t.tagName.toLowerCase()&&((e,t,o)=>{const n=e.dom;F.from(o.style).map(n.parseStyle).each((e=>{const o={...Xo(mo(t)),...e};n.setStyles(t,o)}));const r=F.from(o.class).map((e=>e.split(/\s+/))),i=F.from(t.className).map((e=>G(e.split(/\s+/),(e=>""!==e))));Vt(r,i,((e,o)=>{const r=G(o,(t=>!Z(e,t))),i=[...e,...r];n.setAttrib(t,"class",i.join(" "))}));const s=["style","class"],a=ye(o,((e,t)=>!Z(s,t)));n.setAttribs(t,a)})(e,t,fl(e))},tT={insert:(e,t)=>{let o,n,r,i,s=!1;const a=e.dom,l=e.schema,c=l.getNonEmptyElements(),d=e.selection.getRng(),u=gl(e),h=t=>{let n=o;const i=l.getTextInlineElements();let s;s=t||"TABLE"===r||"HR"===r?a.create(t||u):y.cloneNode(!1);let c=s;if(!1===wl(e))a.setAttrib(s,"style",null),a.setAttrib(s,"class",null);else do{if(i[n.nodeName]){if(nu(n)||fu(n))continue;const e=n.cloneNode(!1);a.setAttrib(e,"id",""),s.hasChildNodes()?(e.appendChild(s.firstChild),s.appendChild(e)):(c=e,s.appendChild(e))}}while((n=n.parentNode)&&n!==b);return eT(e,s),XS(c),s},p=e=>{const t=QS(e,o,n);if(Hn(o)&&(e?t>0:t<o.data.length))return!1;if(o.parentNode===y&&s&&!e)return!0;if(e&&Pn(o)&&o===y.firstChild)return!0;if(KS(o,"TABLE")||KS(o,"HR"))return s&&!e||!s&&e;const r=new An(o,y);let i;for(Hn(o)&&(e&&0===t?r.prev():e||t!==o.data.length||r.next());i=r.current();){if(Pn(i)){if(!i.getAttribute("data-mce-bogus")){const e=i.nodeName.toLowerCase();if(c[e]&&"br"!==e)return!1}}else if(Hn(i)&&!Kr(i.data))return!1;e?r.prev():r.next()}return!0},g=()=>{let t;return t=/^(H[1-6]|PRE|FIGURE)$/.test(r)&&"HGROUP"!==x?h(u):h(),((e,t)=>{const o=_l(e);return!w(t)&&(m(o)?Z(Pt.explode(o),t.nodeName.toLowerCase()):o)})(e,i)&&JS(a,i)&&a.isEmpty(y)?t=a.split(i,y):a.insertAfter(t,y),ZS(e,t),t};dm(a,d).each((e=>{d.setStart(e.startContainer,e.startOffset),d.setEnd(e.endContainer,e.endOffset)})),o=d.startContainer,n=d.startOffset;const f=!(!t||!t.shiftKey),v=!(!t||!t.ctrlKey);Pn(o)&&o.hasChildNodes()&&(s=n>o.childNodes.length-1,o=o.childNodes[Math.min(n,o.childNodes.length-1)]||o,n=s&&Hn(o)?o.data.length:0);const b=jS(a,o);if(!b||((e,t)=>{const o=e.dom.getParent(t,"ol,ul,dl");return null!==o&&"false"===e.dom.getContentEditableParent(o)})(e,o))return;f||(o=((e,t,o,n,r)=>{var i;const s=e.dom,a=null!==(i=jS(s,n))&&void 0!==i?i:s.getRoot();let l=s.getParent(n,s.isBlock);if(!l||!JS(s,l)){let i;if(l=l||a,i=l===e.getBody()||Jn(l)?l.nodeName.toLowerCase():l.parentNode?l.parentNode.nodeName.toLowerCase():"",!l.hasChildNodes()){const n=s.create(t);return eT(e,n),l.appendChild(n),o.setStart(n,0),o.setEnd(n,0),n}let c,d=n;for(;d&&d.parentNode!==l;)d=d.parentNode;for(;d&&!s.isBlock(d);)c=d,d=d.previousSibling;if(c&&e.schema.isValidChild(i,t.toLowerCase())){const i=c.parentNode,a=s.create(t);for(eT(e,a),i.insertBefore(a,c),d=c;d&&!s.isBlock(d);){const e=d.nextSibling;a.appendChild(d),d=e}o.setStart(n,r),o.setEnd(n,r)}}return n})(e,u,d,o,n));let y=a.getParent(o,a.isBlock)||a.getRoot();i=_(null==y?void 0:y.parentNode)?a.getParent(y.parentNode,a.isBlock):null,r=y?y.nodeName.toUpperCase():"";const x=i?i.nodeName.toUpperCase():"";if("LI"!==x||v||(y=i,i=i.parentNode,r=x),/^(LI|DT|DD)$/.test(r)&&Pn(i)&&a.isEmpty(y))return void((e,t,o,n,r)=>{const i=e.dom,s=e.selection.getRng(),a=o.parentNode;if(o===e.getBody()||!a)return;var l;WS(l=o)&&WS(l.parentNode)&&(r="LI");let c=t(r);if(GS(o,n,!0)&&GS(o,n,!1))if($S(o,"LI")){const e=qS(o);i.insertAfter(c,e),(e=>{var t;return(null===(t=e.parentNode)||void 0===t?void 0:t.firstChild)===e})(o)?i.remove(e):i.remove(o)}else i.replace(c,o);else if(GS(o,n,!0))$S(o,"LI")?(i.insertAfter(c,qS(o)),c.appendChild(i.doc.createTextNode(" ")),c.appendChild(o)):a.insertBefore(c,o),i.remove(n);else if(GS(o,n,!1))i.insertAfter(c,qS(o)),i.remove(n);else{o=qS(o);const e=s.cloneRange();e.setStartAfter(n),e.setEndAfter(o);const t=e.extractContents();"LI"===r&&((e,t)=>e.firstChild&&"LI"===e.firstChild.nodeName)(t)?(c=t.firstChild,i.insertAfter(t,o)):(i.insertAfter(t,o),i.insertAfter(c,o)),i.remove(n)}ZS(e,c)})(e,h,i,y,u);if(y===e.getBody())return;const C=y.parentNode;let k;if(Ar(y))k=Fr(y),a.isEmpty(y)&&XS(y),eT(e,k),ZS(e,k);else if(p(!1))k=g();else if(p(!0)&&C)k=C.insertBefore(h(),y),ZS(e,KS(y,"HR")?k:y);else{const t=(e=>{const t=e.cloneRange();return t.setStart(e.startContainer,QS(!0,e.startContainer,e.startOffset)),t.setEnd(e.endContainer,QS(!1,e.endContainer,e.endOffset)),t})(d).cloneRange();t.setEndAfter(y);const o=t.extractContents();(e=>{$(_n(mo(e),zt),(e=>{const t=e.dom;t.nodeValue=Tr(t.data)}))})(o),(e=>{let t=e;do{Hn(t)&&(t.data=t.data.replace(/^[\r\n]+/,"")),t=t.firstChild}while(t)})(o),k=o.firstChild,a.insertAfter(o,y),((e,t,o)=>{var n;const r=[];if(!o)return;let i=o;for(;i=i.firstChild;){if(e.isBlock(i))return;Pn(i)&&!t[i.nodeName.toLowerCase()]&&r.push(i)}let s=r.length;for(;s--;)i=r[s],(!i.hasChildNodes()||i.firstChild===i.lastChild&&""===(null===(n=i.firstChild)||void 0===n?void 0:n.nodeValue)||YS(e,i))&&e.remove(i)})(a,c,k),((e,t)=>{t.normalize();const o=t.lastChild;(!o||Pn(o)&&/^(left|right)$/gi.test(e.getStyle(o,"float",!0)))&&e.add(t,"br")})(a,y),a.isEmpty(y)&&XS(y),k.normalize(),a.isEmpty(k)?(a.remove(k),g()):(eT(e,k),ZS(e,k))}a.setAttrib(k,"id",""),e.dispatch("NewBlock",{newBlock:k})},fakeEventName:"insertParagraph"},oT=(e,t,o)=>{const n=e.dom.createRng();o?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),e.selection.setRng(n),Rm(e,n)},nT=(e,t)=>{const o=uo("br");Jo(mo(t),o),e.undoManager.add()},rT=(e,t)=>{iT(e.getBody(),t)||Qo(mo(t),uo("br"));const o=uo("br");Qo(mo(t),o),oT(e,o.dom,!1),e.undoManager.add()},iT=(e,t)=>{return o=Ca.after(t),!!qn(o.getNode())||Jd(e,Ca.after(t)).map((e=>qn(e.getNode()))).getOr(!1);var o},sT=e=>e&&"A"===e.nodeName&&"href"in e,aT=e=>e.fold(N,sT,sT,N),lT=(e,t)=>{t.fold(S,B(nT,e),B(rT,e),S)},cT={insert:(e,t)=>{const o=(e=>{const t=B(Ng,e),o=Ca.fromRangeStart(e.selection.getRng());return ox(t,e.getBody(),o).filter(aT)})(e);o.isSome()?o.each(B(lT,e)):((e,t)=>{const o=e.selection,n=e.dom,r=o.getRng();let i,s=!1;dm(n,r).each((e=>{r.setStart(e.startContainer,e.startOffset),r.setEnd(e.endContainer,e.endOffset)}));let a=r.startOffset,l=r.startContainer;if(Pn(l)&&l.hasChildNodes()){const e=a>l.childNodes.length-1;l=l.childNodes[Math.min(a,l.childNodes.length-1)]||l,a=e&&Hn(l)?l.data.length:0}let c=n.getParent(l,n.isBlock);const d=c&&c.parentNode?n.getParent(c.parentNode,n.isBlock):null,u=d?d.nodeName.toUpperCase():"",h=!(!t||!t.ctrlKey);"LI"!==u||h||(c=d),Hn(l)&&a>=l.data.length&&(((e,t,o)=>{const n=new An(t,o);let r;const i=e.getNonEmptyElements();for(;r=n.next();)if(i[r.nodeName.toLowerCase()]||Hn(r)&&r.length>0)return!0;return!1})(e.schema,l,c||n.getRoot())||(i=n.create("br"),r.insertNode(i),r.setStartAfter(i),r.setEndAfter(i),s=!0)),i=n.create("br"),Sa(n,r,i),oT(e,i,s),e.undoManager.add()})(e,t)},fakeEventName:"insertLineBreak"},dT=(e,t)=>US(e).filter((e=>t.length>0&&fo(mo(e),t))).isSome(),uT=Ga([{br:[]},{block:[]},{none:[]}]),hT=(e,t)=>(e=>dT(e,yl(e)))(e),mT=e=>(t,o)=>(e=>US(e).filter((e=>gr(mo(e)))).isSome())(t)===e,pT=(e,t)=>(o,n)=>{const r=(e=>US(e).fold(O(""),(e=>e.nodeName.toUpperCase())))(o)===e.toUpperCase();return r===t},gT=e=>{const t=jS(e.dom,e.selection.getStart());return w(t)},fT=e=>pT("pre",e),vT=e=>(t,o)=>pl(t)===e,bT=(e,t)=>(e=>dT(e,bl(e)))(e),yT=(e,t)=>t,wT=e=>{const t=gl(e),o=jS(e.dom,e.selection.getStart());return _(o)&&e.schema.isValidChild(o.nodeName,t)},_T=(e,t)=>(o,n)=>X(e,((e,t)=>e&&t(o,n)),!0)?F.some(t):F.none(),xT=(e,t,o)=>{t.selection.isCollapsed()||(e=>{e.execCommand("delete")})(t),_(o)&&HS(t,e.fakeEventName).isDefaultPrevented()||(e.insert(t,o),_(o)&&zS(t,e.fakeEventName))},CT=(e,t)=>{const o=()=>xT(cT,e,t),n=()=>xT(tT,e,t),r=((e,t)=>W_([_T([hT],uT.none()),_T([fT(!0),gT],uT.none()),_T([pT("summary",!0)],uT.br()),_T([fT(!0),vT(!1),yT],uT.br()),_T([fT(!0),vT(!1)],uT.block()),_T([fT(!0),vT(!0),yT],uT.block()),_T([fT(!0),vT(!0)],uT.br()),_T([mT(!0),yT],uT.br()),_T([mT(!0)],uT.block()),_T([bT],uT.br()),_T([yT],uT.br()),_T([wT],uT.block())],[e,!(!t||!t.shiftKey)]).getOr(uT.none()))(e,t);switch(vl(e)){case"linebreak":r.fold(o,o,S);break;case"block":r.fold(n,n,S);break;case"invert":r.fold(n,o,S);break;default:r.fold(o,n,S)}},kT=_t(),ST=e=>e.stopImmediatePropagation(),TT=e=>e.keyCode===Nh.PAGE_UP||e.keyCode===Nh.PAGE_DOWN,ET=(e,t,o)=>{o&&!e.get()?t.on("NodeChange",ST,!0):!o&&e.get()&&t.off("NodeChange",ST),e.set(o)},OT=(e,t)=>{const o=t.container(),n=t.offset();return Hn(o)?(o.insertData(n,e),F.some(Ca(o,n+e.length))):Md(t).map((o=>{const n=ho(e);return t.isAtEnd()?Qo(o,n):Jo(o,n),Ca(n.dom,e.length)}))},AT=B(OT,or),MT=B(OT," "),BT=(e,t)=>o=>((e,t)=>!hg(t)&&(((e,t)=>((e,t)=>Qd(e.dom,t).isNone())(e,t)||((e,t)=>Jd(e.dom,t).isNone())(e,t)||Jp(e,t)||Qp(e,t)||ig(e,t)||rg(e,t))(e,t)||dg(e,t)||ug(e,t)))(e,o)?AT(t):MT(t),PT=e=>{const t=Ca.fromRangeStart(e.selection.getRng()),o=mo(e.getBody());if(e.selection.isCollapsed()){const n=B(Ng,e),r=Ca.fromRangeStart(e.selection.getRng());return ox(n,e.getBody(),r).bind((e=>t=>t.fold((t=>Qd(e.dom,Ca.before(t))),(e=>eu(e)),(e=>tu(e)),(t=>Jd(e.dom,Ca.after(t)))))(o)).map((n=>()=>BT(o,t)(n).each((e=>t=>(e.selection.setRng(t.toRange()),e.nodeChanged(),!0))(e))))}return F.none()},RT=e=>jc(e)?[{keyCode:Nh.TAB,action:zC(gk,e,!0)},{keyCode:Nh.TAB,shiftKey:!0,action:zC(gk,e,!1)}]:[],VT=e=>{if(e.addShortcut("Meta+P","","mcePrint"),IS(e),Jy(e))return _s(null);{const t=Xx(e);return(e=>{e.on("keyup compositionstart",B(OC,e))})(e),((e,t)=>{e.on("keydown",(o=>{o.isDefaultPrevented()||((e,t,o)=>{const n=Ot.os.isMacOS()||Ot.os.isiOS();HC([{keyCode:Nh.RIGHT,action:zC(BC,e,!0)},{keyCode:Nh.LEFT,action:zC(BC,e,!1)},{keyCode:Nh.UP,action:zC(PC,e,!1)},{keyCode:Nh.DOWN,action:zC(PC,e,!0)},...n?[{keyCode:Nh.UP,action:zC(VC,e,!1),metaKey:!0,shiftKey:!0},{keyCode:Nh.DOWN,action:zC(VC,e,!0),metaKey:!0,shiftKey:!0}]:[],{keyCode:Nh.RIGHT,action:zC(dk,e,!0)},{keyCode:Nh.LEFT,action:zC(dk,e,!1)},{keyCode:Nh.UP,action:zC(uk,e,!1)},{keyCode:Nh.DOWN,action:zC(uk,e,!0)},{keyCode:Nh.RIGHT,action:zC(jC,e,!0)},{keyCode:Nh.LEFT,action:zC(jC,e,!1)},{keyCode:Nh.UP,action:zC(UC,e,!1)},{keyCode:Nh.DOWN,action:zC(UC,e,!0)},{keyCode:Nh.RIGHT,action:zC(Gx,e,t,!0)},{keyCode:Nh.LEFT,action:zC(Gx,e,t,!1)},{keyCode:Nh.RIGHT,ctrlKey:!n,altKey:n,action:zC(Kx,e,t)},{keyCode:Nh.LEFT,ctrlKey:!n,altKey:n,action:zC(Jx,e,t)},{keyCode:Nh.UP,action:zC(FC,e,!1)},{keyCode:Nh.DOWN,action:zC(FC,e,!0)}],o).each((e=>{o.preventDefault()}))})(e,t,o)}))})(e,t),((e,t)=>{e.on("keydown",(o=>{o.isDefaultPrevented()||((e,t,o)=>{const n=o.keyCode===Nh.BACKSPACE?"deleteContentBackward":"deleteContentForward";ZC([{keyCode:Nh.BACKSPACE,action:zC(gC,e)},{keyCode:Nh.BACKSPACE,action:zC(V_,e,!1)},{keyCode:Nh.DELETE,action:zC(V_,e,!0)},{keyCode:Nh.BACKSPACE,action:zC(T_,e,!1)},{keyCode:Nh.DELETE,action:zC(T_,e,!0)},{keyCode:Nh.BACKSPACE,action:zC(oC,e,t,!1)},{keyCode:Nh.DELETE,action:zC(oC,e,t,!0)},{keyCode:Nh.BACKSPACE,action:zC(bf,e,!1)},{keyCode:Nh.DELETE,action:zC(bf,e,!0)},{keyCode:Nh.BACKSPACE,action:zC(N_,e,!1)},{keyCode:Nh.DELETE,action:zC(N_,e,!0)},{keyCode:Nh.BACKSPACE,action:zC(aC,e,!1)},{keyCode:Nh.DELETE,action:zC(aC,e,!0)},{keyCode:Nh.BACKSPACE,action:zC(y_,e,!1)},{keyCode:Nh.DELETE,action:zC(y_,e,!0)},{keyCode:Nh.BACKSPACE,action:zC(f_,e,!1)},{keyCode:Nh.DELETE,action:zC(f_,e,!0)},{keyCode:Nh.BACKSPACE,action:zC(iC,e,!1)},{keyCode:Nh.DELETE,action:zC(iC,e,!0)}],o).each((t=>{o.preventDefault(),HS(e,n).isDefaultPrevented()||(t(),zS(e,n))}))})(e,t,o)})),e.on("keyup",(t=>{t.isDefaultPrevented()||((e,t)=>{HC([{keyCode:Nh.BACKSPACE,action:zC(R_,e)},{keyCode:Nh.DELETE,action:zC(R_,e)}],t)})(e,t)}))})(e,t),(e=>{e.on("keydown",(t=>{t.keyCode===Nh.ENTER&&((e,t)=>{var o;t.isDefaultPrevented()||(t.preventDefault(),(o=e.undoManager).typing&&(o.typing=!1,o.add()),e.undoManager.transact((()=>{CT(e,t)})))})(e,t)}))})(e),(e=>{e.on("keydown",(t=>{t.isDefaultPrevented()||((e,t)=>{ZC([{keyCode:Nh.SPACEBAR,action:zC(PT,e)}],t).each((o=>{t.preventDefault(),HS(e,"insertText",{data:" "}).isDefaultPrevented()||(o(),zS(e,"insertText",{data:" "}))}))})(e,t)}))})(e),(e=>{e.on("input",(t=>{t.isComposing||(e=>{const t=mo(e.getBody());e.selection.isCollapsed()&&_g(t,Ca.fromRangeStart(e.selection.getRng())).each((t=>{e.selection.setRng(t.toRange())}))})(e)}))})(e),(e=>{e.on("keydown",(t=>{t.isDefaultPrevented()||((e,t)=>{HC([...RT(e)],t).each((e=>{t.preventDefault()}))})(e,t)}))})(e),((e,t)=>{e.on("keydown",(o=>{o.isDefaultPrevented()||((e,t,o)=>{const n=Ot.os.isMacOS()||Ot.os.isiOS();HC([{keyCode:Nh.END,action:zC(RC,e,!0)},{keyCode:Nh.HOME,action:zC(RC,e,!1)},...n?[]:[{keyCode:Nh.HOME,action:zC(VC,e,!1),ctrlKey:!0,shiftKey:!0},{keyCode:Nh.END,action:zC(VC,e,!0),ctrlKey:!0,shiftKey:!0}],{keyCode:Nh.END,action:zC($C,e,!0)},{keyCode:Nh.HOME,action:zC($C,e,!1)},{keyCode:Nh.END,action:zC(Qx,e,!0,t)},{keyCode:Nh.HOME,action:zC(Qx,e,!1,t)}],o).each((e=>{o.preventDefault()}))})(e,t,o)}))})(e,t),((e,t)=>{if(kT.os.isMacOS())return;const o=_s(!1);e.on("keydown",(t=>{TT(t)&&ET(o,e,!0)})),e.on("keyup",(n=>{n.isDefaultPrevented()||((e,t,o)=>{HC([{keyCode:Nh.PAGE_UP,action:zC(Qx,e,!1,t)},{keyCode:Nh.PAGE_DOWN,action:zC(Qx,e,!0,t)}],o)})(e,t,n),TT(n)&&o.get()&&(ET(o,e,!1),e.nodeChanged())}))})(e,t),t}};class NT{constructor(e){let t;this.lastPath=[],this.editor=e;const o=this;"onselectionchange"in e.getDoc()||e.on("NodeChange click mouseup keyup focus",(o=>{const n=e.selection.getRng(),r={startContainer:n.startContainer,startOffset:n.startOffset,endContainer:n.endContainer,endOffset:n.endOffset};"nodechange"!==o.type&&nm(r,t)||e.dispatch("SelectionChange"),t=r})),e.on("contextmenu",(()=>{e.dispatch("SelectionChange")})),e.on("SelectionChange",(()=>{const t=e.selection.getStart(!0);t&&Du(e)&&!o.isSameElementPath(t)&&e.dom.isChildOf(t,e.getBody())&&e.nodeChanged({selectionChange:!0})})),e.on("mouseup",(t=>{!t.isDefaultPrevented()&&Du(e)&&("IMG"===e.selection.getNode().nodeName?Wm.setEditorTimeout(e,(()=>{e.nodeChanged()})):e.nodeChanged())}))}nodeChanged(e={}){const t=this.editor.selection;let o;if(this.editor.initialized&&t&&!cc(this.editor)&&!this.editor.mode.isReadOnly()){const n=this.editor.getBody();o=t.getStart(!0)||n,o.ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(o,n)||(o=n);const r=[];this.editor.dom.getParent(o,(e=>e===n||(r.push(e),!1))),this.editor.dispatch("NodeChange",{...e,element:o,parents:r})}}isSameElementPath(e){let t;const o=this.editor,n=ne(o.dom.getParents(e,D,o.getBody()));if(n.length===this.lastPath.length){for(t=n.length;t>=0&&n[t]===this.lastPath[t];t--);if(-1===t)return this.lastPath=n,!0}return this.lastPath=n,!1}}const DT="x-tinymce/html",FT=O(DT),IT="\x3c!-- "+DT+" --\x3e",LT=e=>IT+e,zT=e=>-1!==e.indexOf(IT),HT="%MCEPASTEBIN%",ZT=e=>e.dom.get("mcepastebin"),jT=e=>_(e)&&"mcepastebin"===e.id,UT=e=>e===HT,$T=(e,t)=>(Pt.each(t,(t=>{e=h(t,RegExp)?e.replace(t,""):e.replace(t[0],t[1])})),e),WT=e=>$T(e,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,(e,t,o)=>t||o?or:" "],/<br class="Apple-interchange-newline">/g,/<br>$/i]),qT=(e,t)=>({content:e,cancelled:t}),GT=(e,t)=>(e.insertContent(t,{merge:Bc(e),paste:!0}),!0),YT=e=>/^https?:\/\/[\w\-\/+=.,!;:&%@^~(){}?#]+$/i.test(e),XT=(e,t,o)=>!(e.selection.isCollapsed()||!YT(t))&&((e,t,o)=>(e.undoManager.extra((()=>{o(e,t)}),(()=>{e.execCommand("mceInsertLink",!1,t)})),!0))(e,t,o),KT=(e,t,o)=>!!((e,t)=>YT(t)&&j(Zc(e),(e=>Ze(t.toLowerCase(),`.${e.toLowerCase()}`))))(e,t)&&((e,t,o)=>(e.undoManager.extra((()=>{o(e,t)}),(()=>{e.insertContent('<img src="'+t+'">')})),!0))(e,t,o),JT=(e=>{let t=0;return()=>"mceclip"+t++})(),QT=(e,t,o,n)=>{const r=((e,t,o)=>((e,t,o)=>{const n=((e,t,o)=>e.dispatch("PastePreProcess",{content:t,internal:o}))(e,t,o),r=((e,t)=>{const o=yy({},e.schema);o.addNodeFilter("meta",(e=>{Pt.each(e,(e=>{e.remove()}))}));const n=o.parse(t,{forced_root_block:!1,isRootContent:!0});return Tp({validate:!0},e.schema).serialize(n)})(e,n.content);return e.hasEventListeners("PastePostProcess")&&!n.isDefaultPrevented()?((e,t,o)=>{const n=e.dom.create("div",{style:"display:none"},t),r=((e,t,o)=>e.dispatch("PastePostProcess",{node:t,internal:o}))(e,n,o);return qT(r.node.innerHTML,r.isDefaultPrevented())})(e,r,o):qT(r,n.isDefaultPrevented())})(e,t,o))(e,t,o);r.cancelled||((e,t,o)=>{o||!Pc(e)?GT(e,t):((e,t)=>{Pt.each([XT,KT,GT],(o=>!o(e,t,GT)))})(e,t)})(e,r.content,n)},eE=(e,t,o)=>{const n=o||zT(t);QT(e,(e=>e.replace(IT,""))(t),n,!1)},tE=(e,t)=>{const o=e.dom.encode(t).replace(/\r\n/g,"\n"),n=((e,t,o)=>{const n=e.split(/\n\n/),r=((e,t)=>{let o="<"+e;const n=we(t,((e,t)=>t+'="'+Li.encodeAllRaw(e)+'"'));return n.length&&(o+=" "+n.join(" ")),o+">"})(t,o),i="</"+t+">",s=U(n,(e=>e.split(/\n/).join("<br />")));return 1===s.length?s[0]:U(s,(e=>r+e+i)).join("")})(Qr(o,Vc(e)),gl(e),fl(e));QT(e,n,!1,!0)},oE=e=>{const t={};if(e&&e.types)for(let o=0;o<e.types.length;o++){const n=e.types[o];try{t[n]=e.getData(n)}catch(e){t[n]=""}}return t},nE=(e,t)=>t in e&&e[t].length>0,rE=e=>nE(e,"text/html")||nE(e,"text/plain"),iE=(e,t,o)=>{const n="paste"===t.type?t.clipboardData:t.dataTransfer;var r;if(Tc(e)&&n){const i=((e,t)=>{const o=t.items?te(de(t.items),(e=>"file"===e.kind?[e.getAsFile()]:[])):[],n=t.files?de(t.files):[];return G(o.length>0?o:n,(e=>{const t=Zc(e);return e=>He(e.type,"image/")&&j(t,(t=>(e=>{const t=e.toLowerCase(),o={jpg:"jpeg",jpe:"jpeg",jfi:"jpeg",jif:"jpeg",jfif:"jpeg",pjpeg:"jpeg",pjp:"jpeg",svg:"svg+xml"};return Pt.hasOwn(o,t)?"image/"+o[t]:"image/"+t})(t)===e.type))})(e))})(e,n);if(i.length>0)return t.preventDefault(),(r=i,Promise.all(U(r,(e=>ey(e).then((t=>({file:e,uri:t}))))))).then((t=>{o&&e.selection.setRng(o),$(t,(t=>{((e,t)=>{Jb(t.uri).each((({data:o,type:n,base64Encoded:r})=>{const i=r?o:btoa(o),s=t.file,a=e.editorUpload.blobCache,l=a.getByData(i,n),c=null!=l?l:((e,t,o,n)=>{const r=JT(),i=Cl(e)&&_(o.name),s=i?((e,t)=>{const o=t.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i);return _(o)?e.dom.encode(o[1]):void 0})(e,o.name):r,a=i?o.name:void 0,l=t.create(r,o,n,s,a);return t.add(l),l})(e,a,s,i);eE(e,`<img src="${c.blobUri()}">`,!1)}))})(e,t)}))})),!0}return!1},sE=(e,t,o,n)=>{let r=WT(o);const i=nE(t,FT())||zT(o),s=!i&&(e=>!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(e))(r),a=YT(r);(UT(r)||!r.length||s&&!a)&&(n=!0),(n||a)&&(r=nE(t,"text/plain")&&s?t["text/plain"]:(e=>{const t=Ji(),o=yy({},t);let n="";const r=t.getVoidElements(),i=Pt.makeMap("script noscript style textarea video audio iframe object"," "),s=t.getBlockElements(),a=e=>{const o=e.name,l=e;if("br"!==o){if("wbr"!==o)if(r[o]&&(n+=" "),i[o])n+=" ";else{if(3===e.type&&(n+=e.value),!(e.name in t.getVoidElements())){let t=e.firstChild;if(t)do{a(t)}while(t=t.next)}s[o]&&l.next&&(n+="\n","p"===o&&(n+="\n"))}}else n+="\n"};return e=$T(e,[/<!\[[^\]]+\]>/g]),a(o.parse(e)),n})(r)),UT(r)||(n?tE(e,r):eE(e,r,i))},aE=(e,t,o)=>{((e,t,o)=>{let n;e.on("keydown",(e=>{(e=>Nh.metaKeyPressed(e)&&86===e.keyCode||e.shiftKey&&45===e.keyCode)(e)&&!e.isDefaultPrevented()&&(n=e.shiftKey&&86===e.keyCode)})),e.on("paste",(r=>{if(r.isDefaultPrevented()||(e=>{var t,o;return Ot.os.isAndroid()&&0===(null===(o=null===(t=e.clipboardData)||void 0===t?void 0:t.items)||void 0===o?void 0:o.length)})(r))return;const i="text"===o.get()||n;n=!1;const s=oE(r.clipboardData);!rE(s)&&iE(e,r,t.getLastRng()||e.selection.getRng())||(nE(s,"text/html")?(r.preventDefault(),sE(e,s,s["text/html"],i)):(t.create(),Wm.setEditorTimeout(e,(()=>{const o=t.getHtml();t.remove(),sE(e,s,o,i)}),0)))}))})(e,t,o),(e=>{const t=e=>He(e,"webkit-fake-url"),o=e=>He(e,"data:");e.parser.addNodeFilter("img",((n,r,i)=>{if(!Tc(e)&&(e=>{var t;return!0===(null===(t=e.data)||void 0===t?void 0:t.paste)})(i))for(const r of n){const n=r.attr("src");m(n)&&!r.attr("data-mce-object")&&n!==Ot.transparentSrc&&(t(n)||!Nc(e)&&o(n))&&r.remove()}}))})(e)},lE=(e,t,o,n)=>{((e,t,o)=>{if(!e)return!1;try{return e.clearData(),e.setData("text/html",t),e.setData("text/plain",o),e.setData(FT(),t),!0}catch(e){return!1}})(e.clipboardData,t.html,t.text)?(e.preventDefault(),n()):o(t.html,n)},cE=e=>(t,o)=>{const{dom:n,selection:r}=e,i=n.create("div",{contenteditable:"false","data-mce-bogus":"all"}),s=n.create("div",{contenteditable:"true"},t);n.setStyles(i,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),i.appendChild(s),n.add(e.getBody(),i);const a=r.getRng();s.focus();const l=n.createRng();l.selectNodeContents(s),r.setRng(l),Wm.setEditorTimeout(e,(()=>{r.setRng(a),n.remove(i),o()}),0)},dE=e=>({html:LT(e.selection.getContent({contextual:!0})),text:e.selection.getContent({format:"text"})}),uE=e=>!e.selection.isCollapsed()||(e=>!!e.dom.getParent(e.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",e.getBody()))(e),hE=(e,t)=>{var o,n;return mm.getCaretRangeFromPoint(null!==(o=t.clientX)&&void 0!==o?o:0,null!==(n=t.clientY)&&void 0!==n?n:0,e.getDoc())},mE=(e,t)=>{e.focus(),t&&e.selection.setRng(t)},pE=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,gE=e=>Pt.trim(e).replace(pE,Eu).toLowerCase(),fE=(e,t,o)=>{const n=Ac(e);if(o||"all"===n||!Mc(e))return t;const r=n?n.split(/[, ]/):[];if(r&&"none"!==n){const o=e.dom,n=e.selection.getNode();t=t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,((e,t,i,s)=>{const a=o.parseStyle(o.decode(i)),l={};for(let e=0;e<r.length;e++){const t=a[r[e]];let i=t,s=o.getStyle(n,r[e],!0);/color/.test(r[e])&&(i=gE(i),s=gE(s)),s!==i&&(l[r[e]]=t)}const c=o.serializeStyle(l,"span");return c?t+' style="'+c+'"'+s:t+s}))}else t=t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return t=t.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,((e,t,o,n)=>t+' style="'+o+'"'+n)),t},vE=e=>{const t=_s(!1),o=_s(Rc(e)?"text":"html"),n=(e=>{const t=_s(null);return{create:()=>((e,t)=>{const{dom:o,selection:n}=e,r=e.getBody();t.set(n.getRng());const i=o.add(e.getBody(),"div",{id:"mcepastebin",class:"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},HT);Ot.browser.isFirefox()&&o.setStyle(i,"left","rtl"===o.getStyle(r,"direction",!0)?65535:-65535),o.bind(i,"beforedeactivate focusin focusout",(e=>{e.stopPropagation()})),i.focus(),n.select(i,!0)})(e,t),remove:()=>((e,t)=>{const o=e.dom;if(ZT(e)){let n;const r=t.get();for(;n=ZT(e);)o.remove(n),o.unbind(n);r&&e.selection.setRng(r)}t.set(null)})(e,t),getEl:()=>ZT(e),getHtml:()=>(e=>{const t=e.dom,o=(e,o)=>{e.appendChild(o),t.remove(o,!0)},[n,...r]=G(e.getBody().childNodes,jT);$(r,(e=>{o(n,e)}));const i=t.select("div[id=mcepastebin]",n);for(let e=i.length-1;e>=0;e--){const r=t.create("div");n.insertBefore(r,i[e]),o(r,i[e])}return n?n.innerHTML:""})(e),getLastRng:t.get}})(e);(e=>{(Ot.browser.isChromium()||Ot.browser.isSafari())&&((e,t)=>{e.on("PastePreProcess",(o=>{o.content=t(e,o.content,o.internal)}))})(e,fE)})(e),((e,t)=>{e.addCommand("mceTogglePlainTextPaste",(()=>{((e,t)=>{"text"===t.get()?(t.set("html"),Vh(e,!1)):(t.set("text"),Vh(e,!0)),e.focus()})(e,t)})),e.addCommand("mceInsertClipboardContent",((t,o)=>{o.html&&eE(e,o.html,o.internal),o.text&&tE(e,o.text)}))})(e,o),(e=>{const t=t=>o=>{t(e,o)},o=Ec(e);x(o)&&e.on("PastePreProcess",t(o));const n=Oc(e);x(n)&&e.on("PastePostProcess",t(n))})(e),e.on("PreInit",(()=>{(e=>{e.on("cut",(e=>t=>{!t.isDefaultPrevented()&&uE(e)&&lE(t,dE(e),cE(e),(()=>{if(Ot.browser.isChromium()||Ot.browser.isFirefox()){const t=e.selection.getRng();Wm.setEditorTimeout(e,(()=>{e.selection.setRng(t),e.execCommand("Delete")}),0)}else e.execCommand("Delete")}))})(e)),e.on("copy",(e=>t=>{!t.isDefaultPrevented()&&uE(e)&&lE(t,dE(e),cE(e),S)})(e))})(e),((e,t)=>{Sc(e)&&e.on("dragend dragover draggesture dragdrop drop drag",(e=>{e.preventDefault(),e.stopPropagation()})),Tc(e)||e.on("drop",(e=>{const t=e.dataTransfer;t&&(e=>j(e.files,(e=>/^image\//.test(e.type))))(t)&&e.preventDefault()})),e.on("drop",(o=>{if(o.isDefaultPrevented()||t.get())return;const n=hE(e,o);if(w(n))return;const r=oE(o.dataTransfer),i=nE(r,FT());if((!rE(r)||(e=>{const t=e["text/plain"];return!!t&&0===t.indexOf("file://")})(r))&&iE(e,o,n))return;const s=r[FT()],a=s||r["text/html"]||r["text/plain"];a&&(o.preventDefault(),Wm.setEditorTimeout(e,(()=>{e.undoManager.transact((()=>{s&&e.execCommand("Delete"),mE(e,n);const t=WT(a);r["text/html"]?eE(e,t,i):tE(e,t)}))})))})),e.on("dragstart",(e=>{t.set(!0)})),e.on("dragover dragend",(o=>{Tc(e)&&!t.get()&&(o.preventDefault(),mE(e,hE(e,o))),"dragend"===o.type&&t.set(!1)}))})(e,t),aE(e,n,o)}))},bE=qn,yE=Hn,wE=e=>Xn(e.dom),_E=e=>t=>bo(mo(e),t),xE=(e,t)=>kn(mo(e),wE,_E(t)),CE=(e,t,o)=>{const n=new An(e,t),r=o?n.next.bind(n):n.prev.bind(n);let i=e;for(let t=o?e:r();t&&!bE(t);t=r())qr(t)&&(i=t);return i},kE=e=>{const t=((e,t)=>{const o=Ca.fromRangeStart(e).getNode(),n=((e,t)=>kn(mo(e),(e=>(e=>Yn(e.dom))(e)||dr(e)),_E(t)).getOr(mo(t)).dom)(o,t),r=CE(o,n,!1),i=CE(o,n,!0),s=document.createRange();return xE(r,n).fold((()=>{yE(r)?s.setStart(r,0):s.setStartBefore(r)}),(e=>s.setStartBefore(e.dom))),xE(i,n).fold((()=>{yE(i)?s.setEnd(i,i.data.length):s.setEndAfter(i)}),(e=>s.setEndAfter(e.dom))),s})(e.selection.getRng(),e.getBody());e.selection.setRng(Pf(t))};var SE;!function(e){e.Before="before",e.After="after"}(SE||(SE={}));const TE=(e,t)=>Math.abs(e.left-t),EE=(e,t)=>Math.abs(e.right-t),OE=(e,t)=>(e=>X(e,((e,t)=>e.fold((()=>F.some(t)),(e=>{const o=Math.min(t.left,e.left),n=Math.min(t.top,e.top),r=Math.max(t.right,e.right),i=Math.max(t.bottom,e.bottom);return F.some({top:n,right:r,bottom:i,left:o,width:r-o,height:i-n})}))),F.none()))(G(e,(e=>{return(o=t)>=(n=e).top&&o<=n.bottom;var o,n}))).fold((()=>[[],e]),(t=>{const{pass:o,fail:n}=q(e,(e=>((e,t)=>{const o=((e,t)=>Math.max(0,Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top)))(e,t)/Math.min(e.height,t.height);return((e,t)=>e.top<t.bottom&&e.bottom>t.top)(e,t)&&o>.5})(e,t)));return[o,n]})),AE=(e,t,o)=>t>e.left&&t<e.right?0:Math.min(Math.abs(e.left-t),Math.abs(e.right-t)),ME=(e,t,o)=>{const n=e=>qr(e.node)?F.some(e):Pn(e.node)?ME(de(e.node.childNodes),t,o):F.none(),r=(e,r)=>{const i=se(e,((e,n)=>r(e,t,o)-r(n,t,o)));return((e,r)=>{if(e.length>=2){const i=n(e[0]).getOr(e[0]),s=n(e[1]).getOr(e[1]);if(Math.abs(r(i,t,o)-r(s,t,o))<2){if(Hn(i.node))return F.some(i);if(Hn(s.node))return F.some(s)}}return F.none()})(i,r).orThunk((()=>ue(i,n)))},[i,s]=OE(Mx(e),o),{pass:a,fail:l}=q(s,(e=>e.top<o));return r(i,AE).orThunk((()=>r(l,ta))).orThunk((()=>r(a,ta)))},BE=(e,t,o)=>((e,t,o)=>{const n=mo(e),r=_o(n),i=po(r,t,o).filter((e=>yo(n,e))).getOr(n);return((e,t,o,n)=>{const r=(t,i)=>{const s=G(t.dom.childNodes,P((e=>Pn(e)&&e.classList.contains("mce-drag-container"))));return i.fold((()=>ME(s,o,n)),(e=>{const t=G(s,(t=>t!==e.dom));return ME(t,o,n)})).orThunk((()=>(bo(t,e)?F.none():ko(t)).bind((e=>r(e,F.some(t))))))};return r(t,F.none())})(n,i,t,o)})(e,t,o).filter((e=>id(e.node))).map((e=>((e,t)=>({node:e.node,position:TE(e,t)<EE(e,t)?SE.Before:SE.After}))(e,t))),PE=e=>{var t,o;const n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.documentElement,s=r.defaultView;return{top:n.top+(null!==(t=null==s?void 0:s.scrollY)&&void 0!==t?t:0)-i.clientTop,left:n.left+(null!==(o=null==s?void 0:s.scrollX)&&void 0!==o?o:0)-i.clientLeft}},RE=Xn,VE=((...e)=>t=>{for(let o=0;o<e.length;o++)if(e[o](t))return!0;return!1})(RE,Yn),NE=(e,t,o,n)=>{const r=e.dom,i=t.cloneNode(!0);r.setStyles(i,{width:o,height:n}),r.setAttrib(i,"data-mce-selected",null);const s=r.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return r.setStyles(s,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:o,height:n}),r.setStyles(i,{margin:0,boxSizing:"border-box"}),s.appendChild(i),s},DE=(e,t)=>o=>()=>{const n="left"===e?o.scrollX:o.scrollY;o.scroll({[e]:n+t,behavior:"smooth"})},FE=DE("left",-32),IE=DE("left",32),LE=DE("top",-32),zE=DE("top",32),HE=e=>{e&&e.parentNode&&e.parentNode.removeChild(e)},ZE=(e,t)=>{const o=As(((e,o)=>{t._selectionOverrides.hideFakeCaret(),BE(t.getBody(),e,o).fold((()=>t.selection.placeCaretAt(e,o)),(n=>{const r=t._selectionOverrides.showCaret(1,n.node,n.position===SE.Before,!1);r?t.selection.setRng(r):t.selection.placeCaretAt(e,o)}))}),0);t.on("remove",o.cancel);const n=e;return r=>e.on((e=>{const i=Math.max(Math.abs(r.screenX-e.screenX),Math.abs(r.screenY-e.screenY));if(!e.dragging&&i>10){if(t.dispatch("dragstart",{target:e.element}).isDefaultPrevented())return;e.dragging=!0,t.focus()}if(e.dragging){const i=r.currentTarget===t.getDoc().documentElement,l=((e,t)=>({pageX:t.pageX-e.relX,pageY:t.pageY+5}))(e,((e,t)=>{return o=(e=>e.inline?PE(e.getBody()):{left:0,top:0})(e),n=(e=>{const t=e.getBody();return e.inline?{left:t.scrollLeft,top:t.scrollTop}:{left:0,top:0}})(e),r=((e,t)=>{if(t.target.ownerDocument!==e.getDoc()){const o=PE(e.getContentAreaContainer()),n=(e=>{const t=e.getBody(),o=e.getDoc().documentElement,n={left:t.scrollLeft,top:t.scrollTop},r={left:t.scrollLeft||o.scrollLeft,top:t.scrollTop||o.scrollTop};return e.inline?n:r})(e);return{left:t.pageX-o.left+n.left,top:t.pageY-o.top+n.top}}return{left:t.pageX,top:t.pageY}})(e,t),{pageX:r.left-o.left+n.left,pageY:r.top-o.top+n.top};var o,n,r})(t,r));s=e.ghost,a=t.getBody(),s.parentNode!==a&&a.appendChild(s),((e,t,o,n,r,i,s,a,l,c,d,u)=>{let h=0,m=0;e.style.left=t.pageX+"px",e.style.top=t.pageY+"px",t.pageX+o>r&&(h=t.pageX+o-r),t.pageY+n>i&&(m=t.pageY+n-i),e.style.width=o-h+"px",e.style.height=n-m+"px";const p=l.clientHeight,g=l.clientWidth,f=s+l.getBoundingClientRect().top,v=a+l.getBoundingClientRect().left;d.on((e=>{e.intervalId.clear(),e.dragging&&u&&(s+8>=p?e.intervalId.set(zE(c)):s-8<=0?e.intervalId.set(LE(c)):a+8>=g?e.intervalId.set(IE(c)):a-8<=0?e.intervalId.set(FE(c)):f+16>=window.innerHeight?e.intervalId.set(zE(window)):f-16<=0?e.intervalId.set(LE(window)):v+16>=window.innerWidth?e.intervalId.set(IE(window)):v-16<=0&&e.intervalId.set(FE(window)))}))})(e.ghost,l,e.width,e.height,e.maxX,e.maxY,r.clientY,r.clientX,t.getContentAreaContainer(),t.getWin(),n,i),o.throttle(r.clientX,r.clientY)}var s,a}))},jE=e=>{e.on((e=>{e.intervalId.clear(),HE(e.ghost)})),e.clear()},UE=e=>{const t=Os(),o=bs.DOM,n=document,r=((e,t)=>o=>{if((e=>0===e.button)(o)){const i=J(t.dom.getParents(o.target),VE).getOr(null);if(_(i)&&(n=t.getBody(),RE(r=i)&&r!==n)){const n=t.dom.getPos(i),r=t.getBody(),s=t.getDoc().documentElement;e.set({element:i,dragging:!1,screenX:o.screenX,screenY:o.screenY,maxX:(t.inline?r.scrollWidth:s.offsetWidth)-2,maxY:(t.inline?r.scrollHeight:s.offsetHeight)-2,relX:o.pageX-n.x,relY:o.pageY-n.y,width:i.offsetWidth,height:i.offsetHeight,ghost:NE(t,i,i.offsetWidth,i.offsetHeight),intervalId:Es(100)})}}var n,r})(t,e),i=ZE(t,e),s=((e,t)=>o=>{e.on((e=>{if(e.intervalId.clear(),e.dragging){if(((e,t,o)=>!w(t)&&t!==o&&!e.dom.isChildOf(t,o)&&!RE(t))(t,(e=>{const t=e.getSel();if(_(t)){const e=t.getRangeAt(0).startContainer;return Hn(e)?e.parentNode:e}return null})(t.selection),e.element)){const n=(e=>{const t=e.cloneNode(!0);return t.removeAttribute("data-mce-selected"),t})(e.element);t.dispatch("drop",{clientX:o.clientX,clientY:o.clientY}).isDefaultPrevented()||t.undoManager.transact((()=>{HE(e.element),t.insertContent(t.dom.getOuterHTML(n)),t._selectionOverrides.hideFakeCaret()}))}t.dispatch("dragend")}})),jE(e)})(t,e),a=((e,t)=>()=>{e.on((e=>{e.intervalId.clear(),e.dragging&&t.dispatch("dragend")})),jE(e)})(t,e);e.on("mousedown",r),e.on("mousemove",i),e.on("mouseup",s),o.bind(n,"mousemove",i),o.bind(n,"mouseup",a),e.on("remove",(()=>{o.unbind(n,"mousemove",i),o.unbind(n,"mouseup",a)})),e.on("keydown",(e=>{e.keyCode===Nh.ESC&&a()}))},$E=Xn,WE=(e,t)=>yf(e.getBody(),t),qE=e=>{const t=e.selection,o=e.dom,n=e.getBody(),r=od(e,n,o.isBlock,(()=>ep(e))),i="sel-"+o.uniqueId(),s="data-mce-selected";let a;const l=e=>e!==n&&($E(e)||Qn(e))&&o.isChildOf(e,n),c=(o,n,i,s=!0)=>e.dispatch("ShowCaret",{target:n,direction:o,before:i}).isDefaultPrevented()?null:(s&&t.scrollIntoView(n,-1===o),r.show(i,n)),d=e=>Br(e)||Nr(e)||Dr(e),u=e=>d(e.startContainer)||d(e.endContainer),h=t=>{const n=e.schema.getVoidElements(),r=o.createRng(),i=t.startContainer,s=t.startOffset,a=t.endContainer,l=t.endOffset;return Ce(n,i.nodeName.toLowerCase())?0===s?r.setStartBefore(i):r.setStartAfter(i):r.setStart(i,s),Ce(n,a.nodeName.toLowerCase())?0===l?r.setEndBefore(a):r.setEndAfter(a):r.setEnd(a,l),r},m=(r,d)=>{if(!r)return null;if(r.collapsed){if(!u(r)){const e=d?1:-1,t=Ad(e,n,r),i=t.getNode(!d);if(_(i)){if(id(i))return c(e,i,!!d&&!t.isAtEnd(),!1);if(Mr(i)&&Xn(i.nextSibling)){const e=o.createRng();return e.setStart(i,0),e.setEnd(i,0),e}}const s=t.getNode(d);if(_(s)){if(id(s))return c(e,s,!d&&!t.isAtEnd(),!1);if(Mr(s)&&Xn(s.previousSibling)){const e=o.createRng();return e.setStart(s,1),e.setEnd(s,1),e}}}return null}let h=r.startContainer,m=r.startOffset;const p=r.endOffset;if(Hn(h)&&0===m&&$E(h.parentNode)&&(h=h.parentNode,m=o.nodeIndex(h),h=h.parentNode),!Pn(h))return null;if(p===m+1&&h===r.endContainer){const n=h.childNodes[m];if(l(n))return(n=>{const r=n.cloneNode(!0),l=e.dispatch("ObjectSelected",{target:n,targetClone:r});if(l.isDefaultPrevented())return null;const c=((n,r)=>{const s=mo(e.getBody()),a=e.getDoc(),l=Tn(s,"#"+i).getOrThunk((()=>{const e=co('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>',a);return $t(e,"id",i),tn(s,e),e})),c=o.createRng();nn(l),on(l,[ho(or,a),mo(r),ho(or,a)]),c.setStart(l.dom.firstChild,1),c.setEnd(l.dom.lastChild,0),Wo(l,{top:o.getPos(n,e.getBody()).y+"px"}),Vm(l);const d=t.getSel();return d&&(d.removeAllRanges(),d.addRange(c)),c})(n,l.targetClone),d=mo(n);return $(rr(mo(e.getBody()),`*[${s}]`),(e=>{bo(d,e)||Xt(e,s)})),o.getAttrib(n,s)||n.setAttribute(s,"1"),a=n,g(),c})(n)}return null},p=()=>{a&&a.removeAttribute(s),Tn(mo(e.getBody()),"#"+i).each(rn),a=null},g=()=>{r.hide()};return Jy(e)||(e.on("click",(t=>{const o=WE(e,t.target);o&&$E(o)&&(t.preventDefault(),e.focus())})),e.on("blur NewBlock",p),e.on("ResizeWindow FullscreenStateChanged",r.reposition),e.on("tap",(t=>{const o=t.target,n=WE(e,o);$E(n)?(t.preventDefault(),__(e,n).each(m)):l(o)&&__(e,o).each(m)}),!0),e.on("mousedown",(r=>{const i=r.target;if(i!==n&&"HTML"!==i.nodeName&&!o.isChildOf(i,n))return;if(!((e,t,o)=>{const n=mo(e.getBody()),r=e.inline?n:mo(_o(n).dom.documentElement),i=((e,t,o,n)=>{const r=(e=>e.dom.getBoundingClientRect())(t);return{x:o-(e?r.left+t.dom.clientLeft+kw(t):0),y:n-(e?r.top+t.dom.clientTop+Cw(t):0)}})(e.inline,r,t,o);return((e,t,o)=>{const n=_w(e),r=xw(e);return t>=0&&o>=0&&t<=n&&o<=r})(r,i.x,i.y)})(e,r.clientX,r.clientY))return;p(),g();const s=WE(e,i);$E(s)?(r.preventDefault(),__(e,s).each(m)):BE(n,r.clientX,r.clientY).each((o=>{var n;r.preventDefault(),(n=c(1,o.node,o.position===SE.Before,!1))&&t.setRng(n),Pn(s)?s.focus():e.getBody().focus()}))})),e.on("keypress",(e=>{Nh.modifierPressed(e)||$E(t.getNode())&&e.preventDefault()})),e.on("GetSelectionRange",(e=>{let t=e.range;if(a){if(!a.parentNode)return void(a=null);t=t.cloneRange(),t.selectNode(a),e.range=t}})),e.on("SetSelectionRange",(e=>{e.range=h(e.range);const t=m(e.range,e.forward);t&&(e.range=t)})),e.on("AfterSetSelectionRange",(e=>{const t=e.range,n=t.startContainer.parentElement;var r;u(t)||Pn(r=n)&&"mcepastebin"===r.id||g(),(e=>_(e)&&o.hasClass(e,"mce-offscreen-selection"))(n)||p()})),(e=>{UE(e),pc(e)&&(e=>{const t=t=>{if(!t.isDefaultPrevented()){const o=t.dataTransfer;o&&(Z(o.types,"Files")||o.files.length>0)&&(t.preventDefault(),"drop"===t.type&&Mw(e,"Dropped file type is not supported"))}},o=o=>{Ym(e,o.target)&&t(o)},n=()=>{const n=bs.DOM,r=e.dom,i=document,s=e.inline?e.getBody():e.getDoc(),a=["drop","dragover"];$(a,(e=>{n.bind(i,e,o),r.bind(s,e,t)})),e.on("remove",(()=>{$(a,(e=>{n.unbind(i,e,o),r.unbind(s,e,t)}))}))};e.on("init",(()=>{Wm.setEditorTimeout(e,n,0)}))})(e)})(e),(e=>{const t=As((()=>{if(!e.removed&&e.getBody().contains(document.activeElement)){const t=e.selection.getRng();if(t.collapsed){const o=x_(e,t,!1);e.selection.setRng(o)}}}),0);e.on("focus",(()=>{t.throttle()})),e.on("blur",(()=>{t.cancel()}))})(e),(e=>{e.on("init",(()=>{e.on("focusin",(t=>{const o=t.target;if(Qn(o)){const t=yf(e.getBody(),o),n=Xn(t)?t:o;e.selection.getNode()!==n&&__(e,n).each((t=>e.selection.setRng(t)))}}))}))})(e)),{showCaret:c,showBlockCaretContainer:e=>{e.hasAttribute("data-mce-caret")&&(Fr(e),t.scrollIntoView(e))},hideFakeCaret:g,destroy:()=>{r.destroy(),a=null}}},GE=(e,t)=>{let o=t;for(let t=e.previousSibling;Hn(t);t=t.previousSibling)o+=t.data.length;return o},YE=(e,t,o,n,r)=>{if(Hn(o)&&(n<0||n>o.data.length))return[];const i=r&&Hn(o)?[GE(o,n)]:[n];let s=o;for(;s!==t&&s.parentNode;)i.push(e.nodeIndex(s,r)),s=s.parentNode;return s===t?i.reverse():[]},XE=(e,t,o,n,r,i,s=!1)=>({start:YE(e,t,o,n,s),end:YE(e,t,r,i,s)}),KE=(e,t)=>{const o=t.slice(),n=o.pop();return C(n)?X(o,((e,t)=>e.bind((e=>F.from(e.childNodes[t])))),F.some(e)).bind((e=>Hn(e)&&(n<0||n>e.data.length)?F.none():F.some({node:e,offset:n}))):F.none()},JE=(e,t)=>KE(e,t.start).bind((({node:o,offset:n})=>KE(e,t.end).map((({node:e,offset:t})=>{const r=document.createRange();return r.setStart(o,n),r.setEnd(e,t),r})))),QE=(e,t,o)=>{if(t&&e.isEmpty(t)&&!o(t)){const n=t.parentNode;e.remove(t),QE(e,n,o)}},eO=(e,t,o,n=!0)=>{const r=t.startContainer.parentNode,i=t.endContainer.parentNode;t.deleteContents(),n&&!o(t.startContainer)&&(Hn(t.startContainer)&&0===t.startContainer.data.length&&e.remove(t.startContainer),Hn(t.endContainer)&&0===t.endContainer.data.length&&e.remove(t.endContainer),QE(e,r,o),r!==i&&QE(e,i,o))},tO=(e,t)=>F.from(e.dom.getParent(t.startContainer,e.dom.isBlock)),oO=(e,t,o)=>{const n=e.dynamicPatternsLookup({text:o,block:t});return{...e,blockPatterns:Ja(n).concat(e.blockPatterns),inlinePatterns:Qa(n).concat(e.inlinePatterns)}},nO=(e,t,o,n)=>{const r=e.createRng();return r.setStart(t,0),r.setEnd(o,n),r.toString()},rO=(e,t,o)=>{((e,t,o)=>{if(Hn(e)&&0>=e.length)return F.some(fk(e,0));{const t=Gs(vk);return F.from(t.forwards(e,0,bk(e),o)).map((e=>fk(e.container,0)))}})(t,0,t).each((n=>{const r=n.container;_k(r,o.start.length,t).each((o=>{const n=e.createRng();n.setStart(r,0),n.setEnd(o.container,o.offset),eO(e,n,(e=>e===t))}))}))},iO=(e,t)=>e.create("span",{"data-mce-type":"bookmark",id:t}),sO=(e,t)=>{const o=e.createRng();return o.setStartAfter(t.start),o.setEndBefore(t.end),o},aO=(e,t,o)=>{const n=JE(e.getRoot(),o).getOrDie("Unable to resolve path range"),r=n.startContainer,i=n.endContainer,s=0===n.endOffset?i:i.splitText(n.endOffset),a=0===n.startOffset?r:r.splitText(n.startOffset),l=a.parentNode;return{prefix:t,end:s.parentNode.insertBefore(iO(e,t+"-end"),s),start:l.insertBefore(iO(e,t+"-start"),a)}},lO=(e,t,o)=>{QE(e,e.get(t.prefix+"-end"),o),QE(e,e.get(t.prefix+"-start"),o)},cO=e=>0===e.start.length,dO=(e,t,o,n)=>{const r=t.start;var i;return xk(e,n.container,n.offset,(i=r,(e,t)=>{const o=e.data.substring(0,t),n=o.lastIndexOf(i.charAt(i.length-1)),r=o.lastIndexOf(i);return-1!==r?r+i.length:-1!==n?n+1:-1}),o).bind((n=>{var i,s;const a=null!==(s=null===(i=o.textContent)||void 0===i?void 0:i.indexOf(r))&&void 0!==s?s:-1;if(-1!==a&&n.offset>=a+r.length){const t=e.createRng();return t.setStart(n.container,n.offset-r.length),t.setEnd(n.container,n.offset),F.some(t)}{const i=n.offset-r.length;return wk(n.container,i,o).map((t=>{const o=e.createRng();return o.setStart(t.container,t.offset),o.setEnd(n.container,n.offset),o})).filter((e=>e.toString()===r)).orThunk((()=>dO(e,t,o,fk(n.container,0))))}}))},uO=(e,t,o,n)=>{const r=e.dom,i=r.getRoot(),s=o.pattern,a=o.position.container,l=o.position.offset;return wk(a,l-o.pattern.end.length,t).bind((c=>{const d=XE(r,i,c.container,c.offset,a,l,n);if(cO(s))return F.some({matches:[{pattern:s,startRng:d,endRng:d}],position:c});{const a=hO(e,o.remainingPatterns,c.container,c.offset,t,n),l=a.getOr({matches:[],position:c}),u=l.position,h=((e,t,o,n,r,i=!1)=>{if(0===t.start.length&&!i){const t=e.createRng();return t.setStart(o,n),t.setEnd(o,n),F.some(t)}return yk(o,n,r).bind((o=>dO(e,t,r,o).bind((e=>{var t;if(i){if(e.endContainer===o.container&&e.endOffset===o.offset)return F.none();if(0===o.offset&&(null===(t=e.endContainer.textContent)||void 0===t?void 0:t.length)===e.endOffset)return F.none()}return F.some(e)}))))})(r,s,u.container,u.offset,t,a.isNone());return h.map((e=>{const t=((e,t,o,n=!1)=>XE(e,t,o.startContainer,o.startOffset,o.endContainer,o.endOffset,n))(r,i,e,n);return{matches:l.matches.concat([{pattern:s,startRng:t,endRng:d}]),position:fk(e.startContainer,e.startOffset)}}))}}))},hO=(e,t,o,n,r,i)=>{const s=e.dom;return yk(o,n,s.getRoot()).bind((a=>{const l=nO(s,r,o,n);for(let s=0;s<t.length;s++){const c=t[s];if(!Ze(l,c.end))continue;const d=t.slice();d.splice(s,1);const u=uO(e,r,{pattern:c,remainingPatterns:d,position:a},i);if(u.isNone()&&n>0)return hO(e,t,o,n-1,r,i);if(u.isSome())return u}return F.none()}))},mO=(e,t,o)=>{e.selection.setRng(o),"inline-format"===t.type?$(t.format,(t=>{e.formatter.apply(t)})):e.execCommand(t.cmd,!1,t.value)},pO=(e,t,o,n,r,i)=>{var s;return((e,t)=>{const o=oe(e,(e=>j(t,(t=>e.pattern.start===t.pattern.start&&e.pattern.end===t.pattern.end))));return e.length===t.length?o?e:t:e.length>t.length?e:t})(hO(e,r.inlinePatterns,o,n,t,i).fold((()=>[]),(e=>e.matches)),hO(e,(s=r.inlinePatterns,se(s,((e,t)=>t.end.length-e.end.length))),o,n,t,i).fold((()=>[]),(e=>e.matches)))},gO=(e,t)=>{if(0===t.length)return;const o=e.dom,n=e.selection.getBookmark(),r=((e,t)=>{const o=js("mce_textpattern"),n=Y(t,((t,n)=>{const r=aO(e,o+`_end${t.length}`,n.endRng);return t.concat([{...n,endMarker:r}])}),[]);return Y(n,((t,r)=>{const i=n.length-t.length-1,s=cO(r.pattern)?r.endMarker:aO(e,o+`_start${i}`,r.startRng);return t.concat([{...r,startMarker:s}])}),[])})(o,t);$(r,(t=>{const n=o.getParent(t.startMarker.start,o.isBlock),r=e=>e===n;cO(t.pattern)?((e,t,o,n)=>{const r=sO(e.dom,o);eO(e.dom,r,n),mO(e,t,r)})(e,t.pattern,t.endMarker,r):((e,t,o,n,r)=>{const i=e.dom,s=sO(i,n),a=sO(i,o);eO(i,a,r),eO(i,s,r);const l={prefix:o.prefix,start:o.end,end:n.start},c=sO(i,l);mO(e,t,c)})(e,t.pattern,t.startMarker,t.endMarker,r),lO(o,t.endMarker,r),lO(o,t.startMarker,r)})),e.selection.moveToBookmark(n)},fO=(e,t)=>{const o=e.selection.getRng();return tO(e,o).map((n=>{var r;const i=Math.max(0,o.startOffset),s=oO(t,n,null!==(r=n.textContent)&&void 0!==r?r:""),a=pO(e,n,o.startContainer,i,s,!0),l=((e,t,o,n)=>{var r;const i=e.dom,s=gl(e);if(!i.is(t,s))return[];const a=null!==(r=t.textContent)&&void 0!==r?r:"";return((e,t)=>{const o=(e=>se(e,((e,t)=>t.start.length-e.start.length)))(e),n=t.replace(or," ");return J(o,(e=>0===t.indexOf(e.start)||0===n.indexOf(e.start)))})(o.blockPatterns,a).map((e=>Pt.trim(a).length===e.start.length?[]:[{pattern:e,range:XE(i,i.getRoot(),t,0,t,0,true)}])).getOr([])})(e,n,s);return(l.length>0||a.length>0)&&(e.undoManager.add(),e.undoManager.extra((()=>{e.execCommand("mceInsertNewLine")}),(()=>{e.insertContent(tr),gO(e,a),((e,t)=>{if(0===t.length)return;const o=e.selection.getBookmark();$(t,(t=>((e,t)=>{const o=e.dom,n=t.pattern,r=JE(o.getRoot(),t.range).getOrDie("Unable to resolve path range");return tO(e,r).each((t=>{"block-format"===n.type?((e,t)=>{const o=t.get(e);return f(o)&&le(o).exists((e=>Ce(e,"block")))})(n.format,e.formatter)&&e.undoManager.transact((()=>{rO(e.dom,t,n),e.formatter.apply(n.format)})):"block-command"===n.type&&e.undoManager.transact((()=>{rO(e.dom,t,n),e.execCommand(n.cmd,!1,n.value)}))})),!0})(e,t))),e.selection.moveToBookmark(o)})(e,l);const t=e.selection.getRng(),o=yk(t.startContainer,t.startOffset,e.dom.getRoot());e.execCommand("mceInsertNewLine"),o.each((t=>{const o=t.container;o.data.charAt(t.offset-1)===tr&&(o.deleteData(t.offset-1,1),QE(e.dom,o.parentNode,(t=>t===e.dom.getRoot())))}))})),!0)})).getOr(!1)},vO=(e,t,o)=>{for(let n=0;n<e.length;n++)if(o(e[n],t))return!0;return!1},bO=e=>{const t=Pt.each,o=Nh.BACKSPACE,n=Nh.DELETE,r=e.dom,i=e.selection,s=e.parser,a=Ot.browser,l=a.isFirefox(),c=a.isChromium()||a.isSafari(),d=Ot.deviceType.isiPhone()||Ot.deviceType.isiPad(),u=Ot.os.isMacOS()||Ot.os.isiOS(),h=(t,o)=>{try{e.getDoc().execCommand(t,!1,String(o))}catch(e){}},m=e=>e.isDefaultPrevented(),p=()=>{e.shortcuts.add("meta+a",null,"SelectAll")},g=()=>{e.inline||r.bind(e.getDoc(),"mousedown mouseup",(t=>{let o;if(t.target===e.getDoc().documentElement)if(o=i.getRng(),e.getBody().focus(),"mousedown"===t.type){if(Br(o.startContainer))return;i.placeCaretAt(t.clientX,t.clientY)}else i.setRng(o)}))},f=()=>{Range.prototype.getClientRects||e.on("mousedown",(t=>{if(!m(t)&&"HTML"===t.target.nodeName){const t=e.getBody();t.blur(),Wm.setEditorTimeout(e,(()=>{t.focus()}))}}))},v=()=>{const t=vc(e);e.on("click",(o=>{const n=o.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==r.getContentEditableParent(n)&&(o.preventDefault(),e.selection.select(n),e.nodeChanged()),"A"===n.nodeName&&r.hasClass(n,t)&&0===n.childNodes.length&&(o.preventDefault(),i.select(n))}))},b=()=>{e.on("keydown",(e=>{if(!m(e)&&e.keyCode===o&&i.isCollapsed()&&0===i.getRng().startOffset){const t=i.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}return!0}))},y=()=>{dc(e)||e.on("BeforeExecCommand mousedown",(()=>{h("StyleWithCSS",!1),h("enableInlineTableEditing",!1),Zl(e)||h("enableObjectResizing",!1)}))},w=()=>{e.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")},_=()=>{e.inline||e.on("keydown",(()=>{document.activeElement===document.body&&e.getWin().focus()}))},x=()=>{e.inline||(e.contentStyles.push("body {min-height: 150px}"),e.on("click",(t=>{let o;"HTML"===t.target.nodeName&&(o=e.selection.getRng(),e.getBody().focus(),e.selection.setRng(o),e.selection.normalize(),e.nodeChanged())})))},C=()=>{u&&e.on("keydown",(t=>{!Nh.metaKeyPressed(t)||t.shiftKey||37!==t.keyCode&&39!==t.keyCode||(t.preventDefault(),e.selection.getSel().modify("move",37===t.keyCode?"backward":"forward","lineboundary"))}))},k=()=>{e.on("click",(e=>{let t=e.target;do{if("A"===t.tagName)return void e.preventDefault()}while(t=t.parentNode)})),e.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")},T=()=>{e.on("init",(()=>{e.dom.bind(e.getBody(),"submit",(e=>{e.preventDefault()}))}))},E=S;return Jy(e)?(c&&(g(),v(),T(),p(),d&&(_(),x(),k())),l&&(f(),y(),w(),C())):(e.on("keydown",(t=>{if(m(t)||t.keyCode!==Nh.BACKSPACE)return;let o=i.getRng();const n=o.startContainer,s=o.startOffset,a=r.getRoot();let l=n;if(o.collapsed&&0===s){for(;l.parentNode&&l.parentNode.firstChild===l&&l.parentNode!==a;)l=l.parentNode;"BLOCKQUOTE"===l.nodeName&&(e.formatter.toggle("blockquote",void 0,l),o=r.createRng(),o.setStart(n,0),o.setEnd(n,0),i.setRng(o))}})),(()=>{const t=e=>{const t=r.create("body"),o=e.cloneContents();return t.appendChild(o),i.serializer.serialize(t,{format:"html"})};e.on("keydown",(i=>{const s=i.keyCode;if(!m(i)&&(s===n||s===o)){const o=e.selection.isCollapsed(),n=e.getBody();if(o&&!r.isEmpty(n))return;if(!o&&!(o=>{const n=t(o),i=r.createRng();return i.selectNode(e.getBody()),n===t(i)})(e.selection.getRng()))return;i.preventDefault(),e.setContent(""),n.firstChild&&r.isBlock(n.firstChild)?e.selection.setCursorLocation(n.firstChild,0):e.selection.setCursorLocation(n,0),e.nodeChanged()}}))})(),Ot.windowsPhone||e.on("keyup focusin mouseup",(t=>{Nh.modifierPressed(t)||(e=>{const t=e.getBody(),o=e.selection.getRng();return o.startContainer===o.endContainer&&o.startContainer===t&&0===o.startOffset&&o.endOffset===t.childNodes.length})(e)||i.normalize()}),!0),c&&(g(),v(),e.on("init",(()=>{h("DefaultParagraphSeparator",gl(e))})),T(),b(),s.addNodeFilter("br",(e=>{let t=e.length;for(;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove()})),d?(_(),x(),k()):p()),l&&(e.on("keydown",(t=>{if(!m(t)&&t.keyCode===o){if(!e.getBody().getElementsByTagName("hr").length)return;if(i.isCollapsed()&&0===i.getRng().startOffset){const e=i.getNode(),o=e.previousSibling;if("HR"===e.nodeName)return r.remove(e),void t.preventDefault();o&&o.nodeName&&"hr"===o.nodeName.toLowerCase()&&(r.remove(o),t.preventDefault())}}})),f(),(()=>{const o=()=>{const o=r.getAttribs(i.getStart().cloneNode(!1));return()=>{const n=i.getStart();n!==e.getBody()&&(r.setAttrib(n,"style",null),t(o,(e=>{n.setAttributeNode(e.cloneNode(!0))})))}},n=()=>!i.isCollapsed()&&r.getParent(i.getStart(),r.isBlock)!==r.getParent(i.getEnd(),r.isBlock);e.on("keypress",(t=>{let r;return!(!(m(t)||8!==t.keyCode&&46!==t.keyCode)&&n()&&(r=o(),e.getDoc().execCommand("delete",!1),r(),t.preventDefault(),1))})),r.bind(e.getDoc(),"cut",(t=>{if(!m(t)&&n()){const t=o();Wm.setEditorTimeout(e,(()=>{t()}))}}))})(),y(),e.on("SetContent ExecCommand",(e=>{"setcontent"!==e.type&&"mceInsertLink"!==e.command||t(r.select("a:not([data-mce-block])"),(e=>{var t;let o=e.parentNode;const n=r.getRoot();if((null==o?void 0:o.lastChild)===e){for(;o&&!r.isBlock(o);){if((null===(t=o.parentNode)||void 0===t?void 0:t.lastChild)!==o||o===n)return;o=o.parentNode}r.add(o,"br",{"data-mce-bogus":1})}}))})),w(),C(),b())),{refreshContentEditable:E,isHidden:()=>{if(!l||e.removed)return!1;const t=e.selection.getSel();return!t||!t.rangeCount||0===t.rangeCount}}},yO=bs.DOM,wO=e=>e.inline?e.getElement().nodeName.toLowerCase():void 0,_O=e=>ye(e,(e=>!1===y(e))),xO=e=>{const t=e.options.get,o=e.editorUpload.blobCache;return _O({allow_conditional_comments:t("allow_conditional_comments"),allow_html_data_urls:t("allow_html_data_urls"),allow_svg_data_urls:t("allow_svg_data_urls"),allow_html_in_named_anchor:t("allow_html_in_named_anchor"),allow_script_urls:t("allow_script_urls"),allow_unsafe_link_target:t("allow_unsafe_link_target"),convert_fonts_to_spans:t("convert_fonts_to_spans"),fix_list_elements:t("fix_list_elements"),font_size_legacy_values:t("font_size_legacy_values"),forced_root_block:t("forced_root_block"),forced_root_block_attrs:t("forced_root_block_attrs"),preserve_cdata:t("preserve_cdata"),remove_trailing_brs:t("remove_trailing_brs"),inline_styles:t("inline_styles"),root_name:wO(e),validate:!0,blob_cache:o,document:e.getDoc()})},CO=e=>{const t=e.options.get;return _O({custom_elements:t("custom_elements"),extended_valid_elements:t("extended_valid_elements"),invalid_elements:t("invalid_elements"),invalid_styles:t("invalid_styles"),schema:t("schema"),valid_children:t("valid_children"),valid_classes:t("valid_classes"),valid_elements:t("valid_elements"),valid_styles:t("valid_styles"),verify_html:t("verify_html"),padd_empty_block_inline_children:t("format_empty_lines")})},kO=e=>e.inline?e.ui.styleSheetLoader:e.dom.styleSheetLoader,SO=e=>{const t=kO(e),o=Ll(e),n=e.contentCSS,r=()=>{t.unloadAll(n),e.inline||e.ui.styleSheetLoader.unloadAll(o)},i=()=>{e.removed?r():e.on("remove",r)};if(e.contentStyles.length>0){let t="";Pt.each(e.contentStyles,(e=>{t+=e+"\r\n"})),e.dom.addStyle(t)}const s=Promise.all(((e,t,o)=>{const n=[kO(e).loadAll(t)];return e.inline?n:n.concat([e.ui.styleSheetLoader.loadAll(o)])})(e,n,o)).then(i).catch(i),a=Il(e);return a&&((e,t)=>{const o=mo(e.getBody()),n=Lo(Io(o)),r=uo("style");$t(r,"type","text/css"),tn(r,ho(t)),tn(n,r),e.on("remove",(()=>{rn(r)}))})(e,a),s},TO=e=>{!0!==e.removed&&((e=>{Jy(e)||e.load({initial:!0,format:"html"}),e.startContent=e.getContent({format:"raw"})})(e),(e=>{e.bindPendingEventDelegates(),e.initialized=!0,(e=>{e.dispatch("Init")})(e),e.focus(!0),(e=>{const t=e.dom.getRoot();e.inline||Du(e)&&e.selection.getStart(!0)!==t||eu(t).each((t=>{const o=t.getNode(),n=In(o)?eu(o).getOr(t):t;e.selection.setRng(n.toRange())}))})(e),e.nodeChanged({initial:!0});const t=wc(e);x(t)&&t.call(e,e),(e=>{const t=xc(e);t&&Wm.setEditorTimeout(e,(()=>{let o;o=!0===t?e:e.editorManager.get(t),o&&!o.destroyed&&(o.focus(),o.selection.scrollIntoView())}),100)})(e)})(e))},EO=e=>{const t=e.getElement();let o=e.getDoc();e.inline&&(yO.addClass(t,"mce-content-body"),e.contentDocument=o=document,e.contentWindow=window,e.bodyElement=t,e.contentAreaContainer=t);const n=e.getBody();n.disabled=!0,e.readonly=dc(e),e.readonly||(e.inline&&"static"===yO.getStyle(n,"position",!0)&&(n.style.position="relative"),n.contentEditable="true"),n.disabled=!1,e.editorUpload=Zw(e),e.schema=Ji(CO(e)),e.dom=bs(o,{keep_values:!0,url_converter:e.convertURL,url_converter_scope:e,update_styles:!0,root_element:e.inline?e.getBody():null,collect:e.inline,schema:e.schema,contentCssCors:Bl(e),referrerPolicy:Pl(e),onSetAttrib:t=>{e.dispatch("SetAttrib",t)}}),e.parser=(e=>{const t=yy(xO(e),e.schema);return t.addAttributeFilter("src,href,style,tabindex",((t,o)=>{const n=e.dom,r="data-mce-"+o;let i=t.length;for(;i--;){const s=t[i];let a=s.attr(o);if(a&&!s.attr(r)){if(0===a.indexOf("data:")||0===a.indexOf("blob:"))continue;"style"===o?(a=n.serializeStyle(n.parseStyle(a),s.name),a.length||(a=null),s.attr(r,a),s.attr(o,a)):"tabindex"===o?(s.attr(r,a),s.attr(o,null)):s.attr(r,e.convertURL(a,o,s.name))}}})),t.addNodeFilter("script",(e=>{let t=e.length;for(;t--;){const o=e[t],n=o.attr("type")||"no/type";0!==n.indexOf("mce-")&&o.attr("type","mce-"+n)}})),Hc(e)&&t.addNodeFilter("#cdata",(t=>{var o;let n=t.length;for(;n--;){const r=t[n];r.type=8,r.name="#comment",r.value="[CDATA["+e.dom.encode(null!==(o=r.value)&&void 0!==o?o:"")+"]]"}})),t.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(t=>{let o=t.length;const n=e.schema.getNonEmptyElements();for(;o--;){const e=t[o];e.isEmpty(n)&&0===e.getAll("br").length&&e.append(new fp("br",1))}})),t})(e),e.serializer=cw((e=>{const t=e.options.get;return{...xO(e),...CO(e),..._O({url_converter:t("url_converter"),url_converter_scope:t("url_converter_scope"),element_format:t("element_format"),entities:t("entities"),entity_encoding:t("entity_encoding"),indent:t("indent"),indent_after:t("indent_after"),indent_before:t("indent_before")})}})(e),e),e.selection=sw(e.dom,e.getWin(),e.serializer,e),e.annotator=Th(e),e.formatter=Qw(e),e.undoManager=t_(e),e._nodeChangeDispatcher=new NT(e),e._selectionOverrides=qE(e),(e=>{const t=Os(),o=_s(!1),n=Ms((t=>{e.dispatch("longpress",{...t,type:"longpress"}),o.set(!0)}),400);e.on("touchstart",(e=>{bC(e).each((r=>{n.cancel();const i={x:r.clientX,y:r.clientY,target:e.target};n.throttle(e),o.set(!1),t.set(i)}))}),!0),e.on("touchmove",(r=>{n.cancel(),bC(r).each((n=>{t.on((r=>{((e,t)=>{const o=Math.abs(e.clientX-t.x),n=Math.abs(e.clientY-t.y);return o>5||n>5})(n,r)&&(t.clear(),o.set(!1),e.dispatch("longpresscancel"))}))}))}),!0),e.on("touchend touchcancel",(r=>{n.cancel(),"touchcancel"!==r.type&&t.get().filter((e=>e.target.isEqualNode(r.target))).each((()=>{o.get()?r.preventDefault():e.dispatch("tap",{...r,type:"tap"})}))}),!0)})(e),(e=>{(e=>{e.on("click",(t=>{e.dom.getParent(t.target,"details")&&t.preventDefault()}))})(e),(e=>{e.parser.addNodeFilter("details",(e=>{$(e,(e=>{e.attr("data-mce-open",e.attr("open")),e.attr("open","open")}))})),e.serializer.addNodeFilter("details",(e=>{$(e,(e=>{const t=e.attr("data-mce-open");e.attr("open",m(t)?t:null),e.attr("data-mce-open",null)}))}))})(e)})(e),(e=>{const t="contenteditable",o=" "+Pt.trim(Lc(e))+" ",n=" "+Pt.trim(Ic(e))+" ",r=SC(o),i=SC(n),s=zc(e);s.length>0&&e.on("BeforeSetContent",(t=>{((e,t,o)=>{let n=t.length,r=o.content;if("raw"!==o.format){for(;n--;)r=r.replace(t[n],TC(e,r,Ic(e)));o.content=r}})(e,s,t)})),e.parser.addAttributeFilter("class",(e=>{let o=e.length;for(;o--;){const n=e[o];r(n)?n.attr(t,"true"):i(n)&&n.attr(t,"false")}})),e.serializer.addAttributeFilter(t,(e=>{let o=e.length;for(;o--;){const n=e[o];(r(n)||i(n))&&(s.length>0&&n.attr("data-mce-content")?(n.name="#text",n.type=3,n.raw=!0,n.value=n.attr("data-mce-content")):n.attr(t,null))}}))})(e),Jy(e)||((e=>{e.on("mousedown",(t=>{t.detail>=3&&(t.preventDefault(),kE(e))}))})(e),(e=>{(e=>{const t=[",",".",";",":","!","?"],o=[32],n=()=>{return t=Dc(e),o=Fc(e),{inlinePatterns:Qa(t),blockPatterns:Ja(t),dynamicPatternsLookup:o};var t,o},r=()=>(e=>e.options.isSet("text_patterns_lookup"))(e);e.on("keydown",(t=>{if(13===t.keyCode&&!Nh.modifierPressed(t)&&e.selection.isCollapsed()){const o=n();(o.inlinePatterns.length>0||o.blockPatterns.length>0||r())&&fO(e,o)&&t.preventDefault()}}),!0);const i=()=>{if(e.selection.isCollapsed()){const t=n();(t.inlinePatterns.length>0||r())&&((e,t)=>{const o=e.selection.getRng();tO(e,o).map((n=>{const r=Math.max(0,o.startOffset-1),i=nO(e.dom,n,o.startContainer,r),s=oO(t,n,i),a=pO(e,n,o.startContainer,r,s,!1);a.length>0&&e.undoManager.transact((()=>{gO(e,a)}))}))})(e,t)}};e.on("keyup",(e=>{vO(o,e,((e,t)=>e===t.keyCode&&!Nh.modifierPressed(t)))&&i()})),e.on("keypress",(o=>{vO(t,o,((e,t)=>e.charCodeAt(0)===t.charCode))&&Wm.setEditorTimeout(e,i)}))})(e)})(e));const r=VT(e);vC(e,r),(e=>{e.on("NodeChange",B(CC,e))})(e),(e=>{var t;const o=e.dom,n=gl(e),r=null!==(t=Ul(e))&&void 0!==t?t:"",i=(t,s)=>{if((e=>{if(r_(e)){const t=e.keyCode;return!i_(e)&&(Nh.metaKeyPressed(e)||e.altKey||t>=112&&t<=123||Z(o_,t))}return!1})(t))return;const a=e.getBody(),l=!(e=>r_(e)&&!(i_(e)||"keyup"===e.type&&229===e.keyCode))(t)&&((e,t,o)=>{if(ri(mo(t),!1)){const n=t.firstElementChild;return!n||!e.getStyle(t.firstElementChild,"padding-left")&&!e.getStyle(t.firstElementChild,"padding-right")&&o===n.nodeName.toLowerCase()}return!1})(o,a,n);(""!==o.getAttrib(a,n_)!==l||s)&&(o.setAttrib(a,n_,l?r:null),o.setAttrib(a,"aria-placeholder",l?r:null),((e,t)=>{e.dispatch("PlaceholderToggle",{state:t})})(e,l),e.on(l?"keydown":"keyup",i),e.off(l?"keyup":"keydown",i))};qe(r)&&e.on("init",(t=>{i(t,!0),e.on("change SetContent ExecCommand",i),e.on("paste",(t=>Wm.setEditorTimeout(e,(()=>i(t)))))}))})(e),vE(e);const i=(e=>{const t=e;return(e=>xe(e.plugins,"rtc").bind((e=>F.from(e.setup))))(e).fold((()=>(t.rtcInstance=Ky(e),F.none())),(e=>(t.rtcInstance=(()=>{const e=O(null),t=O("");return{init:{bindEvents:S},undoManager:{beforeChange:S,add:e,undo:e,redo:e,clear:S,reset:S,hasUndo:N,hasRedo:N,transact:e,ignore:S,extra:S},formatter:{match:N,matchAll:O([]),matchNode:O(void 0),canApply:N,closest:t,apply:S,remove:S,toggle:S,formatChanged:O({unbind:S})},editor:{getContent:t,setContent:O({content:"",html:""}),insertContent:O(""),addVisual:S},selection:{getContent:t},autocompleter:{addDecoration:S,removeDecoration:S},raw:{getModel:O(F.none())}}})(),F.some((()=>e().then((e=>(t.rtcInstance=(e=>{const t=e=>p(e)?e:{},{init:o,undoManager:n,formatter:r,editor:i,selection:s,autocompleter:a,raw:l}=e;return{init:{bindEvents:o.bindEvents},undoManager:{beforeChange:n.beforeChange,add:n.add,undo:n.undo,redo:n.redo,clear:n.clear,reset:n.reset,hasUndo:n.hasUndo,hasRedo:n.hasRedo,transact:(e,t,o)=>n.transact(o),ignore:(e,t)=>n.ignore(t),extra:(e,t,o,r)=>n.extra(o,r)},formatter:{match:(e,o,n,i)=>r.match(e,t(o),i),matchAll:r.matchAll,matchNode:r.matchNode,canApply:e=>r.canApply(e),closest:e=>r.closest(e),apply:(e,o,n)=>r.apply(e,t(o)),remove:(e,o,n,i)=>r.remove(e,t(o)),toggle:(e,o,n)=>r.toggle(e,t(o)),formatChanged:(e,t,o,n,i)=>r.formatChanged(t,o,n,i)},editor:{getContent:e=>i.getContent(e),setContent:(e,t)=>({content:i.setContent(e,t),html:""}),insertContent:(e,t)=>(i.insertContent(e),""),addVisual:i.addVisual},selection:{getContent:(e,t)=>s.getContent(t)},autocompleter:{addDecoration:a.addDecoration,removeDecoration:a.removeDecoration},raw:{getModel:()=>F.some(l.getRawModel())}}})(e),e.rtc.isRemote))))))))})(e);(e=>{const t=e.getDoc(),o=e.getBody();(e=>{e.dispatch("PreInit")})(e),Cc(e)||(t.body.spellcheck=!1,yO.setAttrib(o,"spellcheck","false")),e.quirks=bO(e),(e=>{e.dispatch("PostRender")})(e);const n=zl(e);void 0!==n&&(o.dir=n);const r=kc(e);r&&e.on("BeforeSetContent",(e=>{Pt.each(r,(t=>{e.content=e.content.replace(t,(e=>"\x3c!--mce:protected "+escape(e)+"--\x3e"))}))})),e.on("SetContent",(()=>{e.addVisual(e.getBody())})),e.on("compositionstart compositionend",(t=>{e.composing="compositionstart"===t.type}))})(e),i.fold((()=>{SO(e).then((()=>TO(e)))}),(t=>{e.setProgressState(!0),SO(e).then((()=>{t().then((t=>{e.setProgressState(!1),TO(e),tw(e)}),(t=>{e.notificationManager.open({type:"error",text:String(t)}),TO(e),tw(e)}))}))}))},OO=(e,t)=>{if(e.inline||(e.getElement().style.visibility=e.orgVisibility),t||e.inline)EO(e);else{const t=e.iframeElement,n=(o=mo(t),dn(o,"load",Nw,(()=>{n.unbind(),e.contentDocument=t.contentDocument,EO(e)})));if(Ot.browser.isFirefox()){const t=e.getDoc();t.open(),t.write(e.iframeHTML),t.close()}else t.srcdoc=e.iframeHTML}var o},AO=bs.DOM,MO=bs.DOM,BO=(e,t)=>({editorContainer:e,iframeContainer:t,api:{}}),PO=e=>{const t=e.getElement();return e.inline?BO(null):(e=>{const t=MO.create("div");return MO.insertAfter(t,e),BO(t,t)})(t)},RO=e=>{e.dispatch("ScriptsLoaded"),(e=>{const t=Pt.trim(Sl(e)),o=e.ui.registry.getAll().icons,n={...vw.get("default").icons,...vw.get(t).icons};pe(n,((t,n)=>{Ce(o,n)||e.ui.registry.addIcon(n,t)}))})(e),(e=>{const t=ql(e);if(m(t)){const o=Ew.get(t);e.theme=o(e,Ew.urls[t])||{},x(e.theme.init)&&e.theme.init(e,Ew.urls[t]||e.documentBaseUrl.replace(/\/$/,""))}else e.theme={}})(e),(e=>{const t=Yl(e),o=bw.get(t);e.model=o(e,bw.urls[t])})(e),(e=>{const t=[];$(hc(e),(o=>{((e,t,o)=>{const n=Tw.get(o),r=Tw.urls[o]||e.documentBaseUrl.replace(/\/$/,"");if(o=Pt.trim(o),n&&-1===Pt.inArray(t,o)){if(e.plugins[o])return;try{const i=n(e,r)||{};e.plugins[o]=i,x(i.init)&&(i.init(e,r),t.push(o))}catch(t){((e,t,o)=>{const n=Ss.translate(["Failed to initialize plugin: {0}",t]);Ah(e,"PluginLoadError",{message:n}),Rw(n,o),Mw(e,n)})(e,o,t)}}})(e,t,(e=>e.replace(/^\-/,""))(o))}))})(e);const t=(e=>{const t=e.getElement();return e.orgDisplay=t.style.display,m(ql(e))?(e=>{const t=e.theme.renderUI;return t?t():PO(e)})(e):x(ql(e))?(e=>{const t=e.getElement(),o=ql(e)(e,t);return o.editorContainer.nodeType&&(o.editorContainer.id=o.editorContainer.id||e.id+"_parent"),o.iframeContainer&&o.iframeContainer.nodeType&&(o.iframeContainer.id=o.iframeContainer.id||e.id+"_iframecontainer"),o.height=o.iframeHeight?o.iframeHeight:t.offsetHeight,o})(e):PO(e)})(e);((e,t)=>{const o={show:F.from(t.show).getOr(S),hide:F.from(t.hide).getOr(S),isEnabled:F.from(t.isEnabled).getOr(D),setEnabled:o=>{e.mode.isReadOnly()||F.from(t.setEnabled).each((e=>e(o)))}};e.ui={...e.ui,...o}})(e,F.from(t.api).getOr({})),e.editorContainer=t.editorContainer,(e=>{e.contentCSS=e.contentCSS.concat((e=>Vw(e,Fl(e)))(e),(e=>Vw(e,Ll(e)))(e))})(e),e.inline?OO(e):((e,t)=>{((e,t)=>{const o=e.translate("Rich Text Area"),n=Gt(mo(e.getElement()),"tabindex").bind(Ye),r=((e,t,o,n)=>{const r=uo("iframe");return n.each((e=>$t(r,"tabindex",e))),Wt(r,o),Wt(r,{id:e+"_ifr",frameBorder:"0",allowTransparency:"true",title:t}),no(r,"tox-edit-area__iframe"),r})(e.id,o,ll(e),n).dom;r.onload=()=>{r.onload=null,e.dispatch("load")},e.contentAreaContainer=t.iframeContainer,e.iframeElement=r,e.iframeHTML=(e=>{let t=cl(e)+"<html><head>";dl(e)!==e.documentBaseUrl&&(t+='<base href="'+e.documentBaseURI.getURI()+'" />'),t+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';const o=ul(e),n=hl(e),r=e.translate(bc(e));return ml(e)&&(t+='<meta http-equiv="Content-Security-Policy" content="'+ml(e)+'" />'),t+=`</head><body id="${o}" class="mce-content-body ${n}" data-id="${e.id}" aria-label="${r}"><br></body></html>`,t})(e),AO.add(t.iframeContainer,r)})(e,t),t.editorContainer&&(t.editorContainer.style.display=e.orgDisplay,e.hidden=AO.isHidden(t.editorContainer)),e.getElement().style.display="none",AO.setAttrib(e.id,"aria-hidden","true"),OO(e)})(e,{editorContainer:t.editorContainer,iframeContainer:t.iframeContainer})},VO=bs.DOM,NO=e=>"-"===e.charAt(0),DO=(e,t,o)=>F.from(t).filter((e=>qe(e)&&!vw.has(e))).map((t=>({url:`${e.editorManager.baseURL}/icons/${t}/icons${o}.js`,name:F.some(t)}))),FO=(e,t)=>{const o=ws.ScriptLoader,n=()=>{!e.removed&&(e=>{const t=ql(e);return!m(t)||_(Ew.get(t))})(e)&&(e=>{const t=Yl(e);return _(bw.get(t))})(e)&&RO(e)};((e,t)=>{const o=ql(e);if(m(o)&&!NO(o)&&!Ce(Ew.urls,o)){const n=Gl(e),r=n?e.documentBaseURI.toAbsolute(n):`themes/${o}/theme${t}.js`;Ew.load(o,r).catch((()=>{((e,t,o)=>{Bw(e,"ThemeLoadError",Pw("theme",t,o))})(e,r,o)}))}})(e,t),((e,t)=>{const o=Yl(e);if("plugin"!==o&&!Ce(bw.urls,o)){const n=Xl(e),r=m(n)?e.documentBaseURI.toAbsolute(n):`models/${o}/model${t}.js`;bw.load(o,r).catch((()=>{((e,t,o)=>{Bw(e,"ModelLoadError",Pw("model",t,o))})(e,r,o)}))}})(e,t),((e,t)=>{const o=Rl(t),n=Vl(t);if(!Ss.hasCode(o)&&"en"!==o){const r=qe(n)?n:`${t.editorManager.baseURL}/langs/${o}.js`;e.add(r).catch((()=>{((e,t,o)=>{Bw(e,"LanguageLoadError",Pw("language",t,o))})(t,r,o)}))}})(o,e),((e,t,o)=>{const n=DO(t,"default",o),r=(e=>F.from(Tl(e)).filter(qe).map((e=>({url:e,name:F.none()}))))(t).orThunk((()=>DO(t,Sl(t),"")));$((e=>{const t=[],o=e=>{t.push(e)};for(let t=0;t<e.length;t++)e[t].each(o);return t})([n,r]),(o=>{e.add(o.url).catch((()=>{((e,t,o)=>{Bw(e,"IconsLoadError",Pw("icons",t,o))})(t,o.url,o.name.getOrUndefined())}))}))})(o,e,t),((e,t)=>{const o=(t,o)=>{Tw.load(t,o).catch((()=>{((e,t,o)=>{Bw(e,"PluginLoadError",Pw("plugin",t,o))})(e,o,t)}))};pe(mc(e),((t,n)=>{o(n,t),e.options.set("plugins",hc(e).concat(n))})),$(hc(e),(e=>{!(e=Pt.trim(e))||Tw.urls[e]||NO(e)||o(e,`plugins/${e}/plugin${t}.js`)}))})(e,t),o.loadQueue().then(n,n)},IO=_t().deviceType,LO=IO.isPhone(),zO=IO.isTablet(),HO=e=>{if(w(e))return[];{const t=f(e)?e:e.split(/[ ,]/),o=U(t,Ue);return G(o,qe)}},ZO=(e,t)=>{const o=((t,o)=>{const n={},r={};return be(t,((t,o)=>Z(e,o)),ve(n),ve(r)),{t:n,f:r}})(t);return n=o.t,r=o.f,{sections:O(n),options:O(r)};var n,r},jO=(e,t)=>Ce(e.sections(),t),UO=(e,t)=>({table_grid:!1,object_resizing:!1,resize:!1,toolbar_mode:xe(e,"toolbar_mode").getOr("scrolling"),toolbar_sticky:!1,...t?{menubar:!1}:{}}),$O=(e,t)=>{var o;const n=null!==(o=t.external_plugins)&&void 0!==o?o:{};return e&&e.external_plugins?Pt.extend({},e.external_plugins,n):n},WO=(e,t,o,n,r)=>{var i;const s=e?{mobile:UO(null!==(i=r.mobile)&&void 0!==i?i:{},t)}:{},a=ZO(["mobile"],Lk(s,r)),l=Pt.extend(o,n,a.options(),((e,t)=>e&&jO(t,"mobile"))(e,a)?((e,t,o={})=>{const n=e.sections(),r=xe(n,t).getOr({});return Pt.extend({},o,r)})(a,"mobile"):{},{external_plugins:$O(n,a.options())});return((e,t,o,n)=>{const r=HO(o.forced_plugins),i=HO(n.plugins),s=((e,t)=>jO(e,t)?e.sections()[t]:{})(t,"mobile"),a=((e,t,o,n)=>e&&jO(t,"mobile")?n:o)(e,t,i,s.plugins?HO(s.plugins):i),l=((e,t)=>[...HO(e),...HO(t)])(r,a);return Pt.extend(n,{forced_plugins:r,plugins:l})})(e,a,n,l)},qO=e=>{(e=>{const t=t=>()=>{$("left,center,right,justify".split(","),(o=>{t!==o&&e.formatter.remove("align"+o)})),"none"!==t&&((t,o)=>{e.formatter.toggle(t,void 0),e.nodeChanged()})("align"+t)};e.editorCommands.addCommands({JustifyLeft:t("left"),JustifyCenter:t("center"),JustifyRight:t("right"),JustifyFull:t("justify"),JustifyNone:t("none")})})(e),(e=>{const t=t=>()=>{const o=e.selection,n=o.isCollapsed()?[e.dom.getParent(o.getNode(),e.dom.isBlock)]:o.getSelectedBlocks();return j(n,(o=>_(e.formatter.matchNode(o,t))))};e.editorCommands.addCommands({JustifyLeft:t("alignleft"),JustifyCenter:t("aligncenter"),JustifyRight:t("alignright"),JustifyFull:t("alignjustify")},"state")})(e)},GO=(e,t)=>{const o=e.selection,n=e.dom;return/^ | $/.test(t)?((e,t,o)=>{const n=mo(e.getRoot());return o=pg(n,Ca.fromRangeStart(t))?o.replace(/^ /,"&nbsp;"):o.replace(/^&nbsp;/," "),gg(n,Ca.fromRangeEnd(t))?o.replace(/(&nbsp;| )(<br( \/)>)?$/,"&nbsp;"):o.replace(/&nbsp;(<br( \/)?>)?$/," ")})(n,o.getRng(),t):t},YO=(e,t)=>{const{content:o,details:n}=(e=>{if("string"!=typeof e){const t=Pt.extend({paste:e.paste,data:{paste:e.paste}},e);return{content:e.content,details:t}}return{content:e,details:{}}})(t);Cy(e,{...n,content:GO(e,o),format:"html",set:!1,selection:!0}).each((t=>{const o=((e,t,o)=>Qy(e).editor.insertContent(t,o))(e,t.content,n);ky(e,o,t),e.addVisual()}))},XO={"font-size":"size","font-family":"face"},KO=jt("font"),JO=e=>(t,o)=>F.from(o).map(mo).filter(Lt).bind((o=>((e,t,o)=>$f(mo(o),(t=>(t=>Yo(t,e).orThunk((()=>KO(t)?xe(XO,e).bind((e=>Gt(t,e))):F.none())))(t)),(e=>bo(mo(t),e))))(e,t,o.dom).or(((e,t)=>F.from(bs.DOM.getStyle(t,e,!0)))(e,o.dom)))).getOr(""),QO=JO("font-size"),eA=T((e=>e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")),JO("font-family")),tA=e=>eu(e.getBody()).bind((e=>{const t=e.container();return F.from(Hn(t)?t.parentNode:t)})),oA=(e,t)=>((e,t)=>(e=>F.from(e.selection.getRng()).bind((t=>{const o=e.getBody();return t.startContainer===o&&0===t.startOffset?F.none():F.from(e.selection.getStart(!0))})))(e).orThunk(B(tA,e)).map(mo).filter(Lt).bind(t))(e,E(F.some,t)),nA=(e,t)=>{if(/^[0-9.]+$/.test(t)){const o=parseInt(t,10);if(o>=1&&o<=7){const n=(e=>Pt.explode(e.options.get("font_size_style_values")))(e),r=(e=>Pt.explode(e.options.get("font_size_classes")))(e);return r.length>0?r[o-1]||t:n[o-1]||t}return t}return t},rA=e=>{const t=e.split(/\s*,\s*/);return U(t,(e=>-1===e.indexOf(" ")||He(e,'"')||He(e,"'")?e:`'${e}'`)).join(",")},iA=e=>{qO(e),(e=>{e.editorCommands.addCommands({"Cut,Copy,Paste":t=>{const o=e.getDoc();let n;try{o.execCommand(t)}catch(e){n=!0}if("paste"!==t||o.queryCommandEnabled(t)||(n=!0),n||!o.queryCommandSupported(t)){let t=e.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");(Ot.os.isMacOS()||Ot.os.isiOS())&&(t=t.replace(/Ctrl\+/g,"⌘+")),e.notificationManager.open({text:t,type:"error"})}}})})(e),(e=>{e.editorCommands.addCommands({mceAddUndoLevel:()=>{e.undoManager.add()},mceEndUndoLevel:()=>{e.undoManager.add()},Undo:()=>{e.undoManager.undo()},Redo:()=>{e.undoManager.redo()}})})(e),(e=>{e.editorCommands.addCommands({mceSelectNodeDepth:(t,o,n)=>{let r=0;e.dom.getParent(e.selection.getNode(),(t=>!Pn(t)||r++!==n||(e.selection.select(t),!1)),e.getBody())},mceSelectNode:(t,o,n)=>{e.selection.select(n)},selectAll:()=>{const t=e.dom.getParent(e.selection.getStart(),Yn);if(t){const o=e.dom.createRng();o.selectNodeContents(t),e.selection.setRng(o)}}})})(e),(e=>{e.editorCommands.addCommands({mceCleanup:()=>{const t=e.selection.getBookmark();e.setContent(e.getContent()),e.selection.moveToBookmark(t)},insertImage:(t,o,n)=>{YO(e,e.dom.createHTML("img",{src:n}))},insertHorizontalRule:()=>{e.execCommand("mceInsertContent",!1,"<hr>")},insertText:(t,o,n)=>{YO(e,e.dom.encode(n))},insertHTML:(t,o,n)=>{YO(e,n)},mceInsertContent:(t,o,n)=>{YO(e,n)},mceSetContent:(t,o,n)=>{e.setContent(n)},mceReplaceContent:(t,o,n)=>{e.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,e.selection.getContent({format:"text"})))},mceNewDocument:()=>{e.setContent("")}})})(e),(e=>{const t=(t,o,n)=>{const r=m(n)?{href:n}:n,i=e.dom.getParent(e.selection.getNode(),"a");p(r)&&m(r.href)&&(r.href=r.href.replace(/ /g,"%20"),i&&r.href||e.formatter.remove("link"),r.href&&e.formatter.apply("link",r,i))};e.editorCommands.addCommands({unlink:()=>{if(e.selection.isCollapsed()){const t=e.dom.getParent(e.selection.getStart(),"a");t&&e.dom.remove(t,!0)}else e.formatter.remove("link")},mceInsertLink:t,createLink:t})})(e),(e=>{e.editorCommands.addCommands({Indent:()=>{(e=>{mC(e,"indent")})(e)},Outdent:()=>{pC(e)}}),e.editorCommands.addCommands({Outdent:()=>dC(e)},"state")})(e),(e=>{e.editorCommands.addCommands({insertParagraph:()=>{xT(tT,e)},mceInsertNewLine:(t,o,n)=>{CT(e,n)},InsertLineBreak:(t,o,n)=>{xT(cT,e)}})})(e),(e=>{(e=>{e.editorCommands.addCommands({"InsertUnorderedList,InsertOrderedList":t=>{e.getDoc().execCommand(t);const o=e.dom.getParent(e.selection.getNode(),"ol,ul");if(o){const t=o.parentNode;if(t&&/^(H[1-6]|P|ADDRESS|PRE)$/.test(t.nodeName)){const n=e.selection.getBookmark();e.dom.split(t,o),e.selection.moveToBookmark(n)}}}})})(e),(e=>{e.editorCommands.addCommands({"InsertUnorderedList,InsertOrderedList":t=>{const o=e.dom.getParent(e.selection.getNode(),"ul,ol");return o&&("insertunorderedlist"===t&&"UL"===o.tagName||"insertorderedlist"===t&&"OL"===o.tagName)}},"state")})(e)})(e),(e=>{(e=>{const t=(t,o)=>{e.formatter.toggle(t,o),e.nodeChanged()};e.editorCommands.addCommands({"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":e=>{t(e)},"ForeColor,HiliteColor":(e,o,n)=>{t(e,{value:n})},BackColor:(e,o,n)=>{t("hilitecolor",{value:n})},FontName:(t,o,n)=>{((e,t)=>{const o=nA(e,t);e.formatter.toggle("fontname",{value:rA(o)}),e.nodeChanged()})(e,n)},FontSize:(t,o,n)=>{((e,t)=>{e.formatter.toggle("fontsize",{value:nA(e,t)}),e.nodeChanged()})(e,n)},LineHeight:(t,o,n)=>{((e,t)=>{e.formatter.toggle("lineheight",{value:String(t)}),e.nodeChanged()})(e,n)},Lang:(e,o,n)=>{var r;t(e,{value:n.code,customValue:null!==(r=n.customCode)&&void 0!==r?r:null})},RemoveFormat:t=>{e.formatter.remove(t)},mceBlockQuote:()=>{t("blockquote")},FormatBlock:(e,o,n)=>{t(m(n)?n:"p")},mceToggleFormat:(e,o,n)=>{t(n)}})})(e),(e=>{const t=t=>e.formatter.match(t);e.editorCommands.addCommands({"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":e=>t(e),mceBlockQuote:()=>t("blockquote")},"state"),e.editorCommands.addQueryValueHandler("FontName",(()=>(e=>oA(e,(t=>eA(e.getBody(),t.dom))).getOr(""))(e))),e.editorCommands.addQueryValueHandler("FontSize",(()=>(e=>oA(e,(t=>QO(e.getBody(),t.dom))).getOr(""))(e))),e.editorCommands.addQueryValueHandler("LineHeight",(()=>(e=>oA(e,(t=>{const o=mo(e.getBody()),n=$f(t,(e=>Yo(e,"line-height")),B(bo,o));return n.getOrThunk((()=>{const e=parseFloat(qo(t,"line-height")),o=parseFloat(qo(t,"font-size"));return String(e/o)}))})).getOr(""))(e)))})(e)})(e),(e=>{e.editorCommands.addCommands({mceRemoveNode:(t,o,n)=>{const r=null!=n?n:e.selection.getNode();if(r!==e.getBody()){const t=e.selection.getBookmark();e.dom.remove(r,!0),e.selection.moveToBookmark(t)}},mcePrint:()=>{e.getWin().print()},mceFocus:(t,o,n)=>{((e,t)=>{e.removed||(t?tp(e):(e=>{const t=e.selection,o=e.getBody();let n=t.getRng();e.quirks.refreshContentEditable(),_(e.bookmark)&&!ep(e)&&Um(e).each((t=>{e.selection.setRng(t),n=t}));const r=((e,t)=>e.dom.getParent(t,(t=>"true"===e.dom.getContentEditable(t))))(e,t.getNode());if(r&&e.dom.isChildOf(r,o))return Qm(r),Jm(e,n),void tp(e);e.inline||(Ot.browser.isOpera()||Qm(o),e.getWin().focus()),(Ot.browser.isFirefox()||e.inline)&&(Qm(o),Jm(e,n)),tp(e)})(e))})(e,!0===n)},mceToggleVisualAid:()=>{e.hasVisual=!e.hasVisual,e.addVisual()}})})(e)},sA=["toggleview"],aA=e=>Z(sA,e.toLowerCase());class lA{constructor(e){this.commands={state:{},exec:{},value:{}},this.editor=e}execCommand(e,t=!1,o,n){const r=this.editor,i=e.toLowerCase(),s=null==n?void 0:n.skip_focus;if(r.removed)return!1;if("mcefocus"!==i&&(/^(mceAddUndoLevel|mceEndUndoLevel)$/i.test(i)||s?(e=>{Um(e).each((t=>e.selection.setRng(t)))})(r):r.focus()),r.dispatch("BeforeExecCommand",{command:e,ui:t,value:o}).isDefaultPrevented())return!1;const a=this.commands.exec[i];return!!x(a)&&(a(i,t,o),r.dispatch("ExecCommand",{command:e,ui:t,value:o}),!0)}queryCommandState(e){if(!aA(e)&&this.editor.quirks.isHidden()||this.editor.removed)return!1;const t=e.toLowerCase(),o=this.commands.state[t];return!!x(o)&&o(t)}queryCommandValue(e){if(!aA(e)&&this.editor.quirks.isHidden()||this.editor.removed)return"";const t=e.toLowerCase(),o=this.commands.value[t];return x(o)?o(t):""}addCommands(e,t="exec"){const o=this.commands;pe(e,((e,n)=>{$(n.toLowerCase().split(","),(n=>{o[t][n]=e}))}))}addCommand(e,t,o){const n=e.toLowerCase();this.commands.exec[n]=(e,n,r)=>t.call(null!=o?o:this.editor,n,r)}queryCommandSupported(e){const t=e.toLowerCase();return!!this.commands.exec[t]}addQueryStateHandler(e,t,o){this.commands.state[e.toLowerCase()]=()=>t.call(null!=o?o:this.editor)}addQueryValueHandler(e,t,o){this.commands.value[e.toLowerCase()]=()=>t.call(null!=o?o:this.editor)}}const cA="data-mce-contenteditable",dA=(e,t,o)=>{try{e.getDoc().execCommand(t,!1,String(o))}catch(e){}},uA=(e,t)=>{e.dom.contentEditable=t?"true":"false"},hA=(e,t)=>{const o=mo(e.getBody());((e,t,o)=>{so(e,t)&&!o?io(e,t):o&&no(e,t)})(o,"mce-content-readonly",t),t?(e.selection.controlSelection.hideResizeRect(),e._selectionOverrides.hideFakeCaret(),(e=>{F.from(e.selection.getNode()).each((e=>{e.removeAttribute("data-mce-selected")}))})(e),e.readonly=!0,uA(o,!1),$(rr(o,'*[contenteditable="true"]'),(e=>{$t(e,cA,"true"),uA(e,!1)}))):(e.readonly=!1,uA(o,!0),$(rr(o,`*[${cA}="true"]`),(e=>{Xt(e,cA),uA(e,!0)})),dA(e,"StyleWithCSS",!1),dA(e,"enableInlineTableEditing",!1),dA(e,"enableObjectResizing",!1),(e=>ep(e)||(e=>{const t=Io(mo(e.getElement()));return Dm(t).filter((t=>!(e=>{const t=e.classList;return void 0!==t&&(t.contains("tox-edit-area")||t.contains("tox-edit-area__iframe")||t.contains("mce-content-body"))})(t.dom)&&Ym(e,t.dom))).isSome()})(e))(e)&&e.focus(),(e=>{e.selection.setRng(e.selection.getRng())})(e),e.nodeChanged())},mA=e=>e.readonly,pA=e=>{e.parser.addAttributeFilter("contenteditable",(t=>{mA(e)&&$(t,(e=>{e.attr(cA,e.attr("contenteditable")),e.attr("contenteditable","false")}))})),e.serializer.addAttributeFilter(cA,(t=>{mA(e)&&$(t,(e=>{e.attr("contenteditable",e.attr(cA))}))})),e.serializer.addTempAttr(cA)},gA=["copy"],fA=Pt.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," ");class vA{constructor(e){this.bindings={},this.settings=e||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||N}static isNative(e){return!!fA[e.toLowerCase()]}fire(e,t){return this.dispatch(e,t)}dispatch(e,t){const o=e.toLowerCase(),n=os(o,null!=t?t:{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(n);const r=this.bindings[o];if(r)for(let e=0,t=r.length;e<t;e++){const t=r[e];if(!t.removed){if(t.once&&this.off(o,t.func),n.isImmediatePropagationStopped())return n;if(!1===t.func.call(this.scope,n))return n.preventDefault(),n}}return n}on(e,t,o,n){if(!1===t&&(t=N),t){const r={func:t,removed:!1};n&&Pt.extend(r,n);const i=e.toLowerCase().split(" ");let s=i.length;for(;s--;){const e=i[s];let t=this.bindings[e];t||(t=[],this.toggleEvent(e,!0)),t=o?[r,...t]:[...t,r],this.bindings[e]=t}}return this}off(e,t){if(e){const o=e.toLowerCase().split(" ");let n=o.length;for(;n--;){const r=o[n];let i=this.bindings[r];if(!r)return pe(this.bindings,((e,t)=>{this.toggleEvent(t,!1),delete this.bindings[t]})),this;if(i){if(t){const e=q(i,(e=>e.func===t));i=e.fail,this.bindings[r]=i,$(e.pass,(e=>{e.removed=!0}))}else i.length=0;i.length||(this.toggleEvent(e,!1),delete this.bindings[r])}}}else pe(this.bindings,((e,t)=>{this.toggleEvent(t,!1)})),this.bindings={};return this}once(e,t,o){return this.on(e,t,o,{once:!0})}has(e){e=e.toLowerCase();const t=this.bindings[e];return!(!t||0===t.length)}}const bA=e=>(e._eventDispatcher||(e._eventDispatcher=new vA({scope:e,toggleEvent:(t,o)=>{vA.isNative(t)&&e.toggleNativeEvent&&e.toggleNativeEvent(t,o)}})),e._eventDispatcher),yA={fire(e,t,o){return this.dispatch(e,t,o)},dispatch(e,t,o){const n=this;if(n.removed&&"remove"!==e&&"detach"!==e)return os(e.toLowerCase(),null!=t?t:{},n);const r=bA(n).dispatch(e,t);if(!1!==o&&n.parent){let t=n.parent();for(;t&&!r.isPropagationStopped();)t.dispatch(e,r,!1),t=t.parent?t.parent():void 0}return r},on(e,t,o){return bA(this).on(e,t,o)},off(e,t){return bA(this).off(e,t)},once(e,t){return bA(this).once(e,t)},hasEventListeners(e){return bA(this).has(e)}},wA=bs.DOM;let _A;const xA=(e,t)=>{if("selectionchange"===t)return e.getDoc();if(!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t))return e.getDoc().documentElement;const o=$l(e);return o?(e.eventRoot||(e.eventRoot=wA.select(o)[0]),e.eventRoot):e.getBody()},CA=(e,t,o)=>{(e=>!e.hidden&&!mA(e))(e)?e.dispatch(t,o):mA(e)&&((e,t)=>{if((e=>"click"===e.type)(t)&&!Nh.metaKeyPressed(t)){const o=mo(t.target);((e,t)=>En(t,"a",(t=>bo(t,mo(e.getBody())))).bind((e=>Gt(e,"href"))))(e,o).each((o=>{if(t.preventDefault(),/^#/.test(o)){const t=e.dom.select(`${o},[name="${n=o,He(n,"#")?((e,t)=>e.substring(t))(n,"#".length):n}"]`);t.length&&e.selection.scrollIntoView(t[0],!0)}else window.open(o,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes");var n}))}else(e=>Z(gA,e.type))(t)&&e.dispatch(t.type,t)})(e,o)},kA=(e,t)=>{if(e.delegates||(e.delegates={}),e.delegates[t]||e.removed)return;const o=xA(e,t);if($l(e)){if(_A||(_A={},e.editorManager.on("removeEditor",(()=>{e.editorManager.activeEditor||_A&&(pe(_A,((t,o)=>{e.dom.unbind(xA(e,o))})),_A=null)}))),_A[t])return;const n=o=>{const n=o.target,r=e.editorManager.get();let i=r.length;for(;i--;){const e=r[i].getBody();(e===n||wA.isChildOf(n,e))&&CA(r[i],t,o)}};_A[t]=n,wA.bind(o,t,n)}else{const n=o=>{CA(e,t,o)};wA.bind(o,t,n),e.delegates[t]=n}},SA={...yA,bindPendingEventDelegates(){const e=this;Pt.each(e._pendingNativeEvents,(t=>{kA(e,t)}))},toggleNativeEvent(e,t){const o=this;"focus"!==e&&"blur"!==e&&(o.removed||(t?o.initialized?kA(o,e):o._pendingNativeEvents?o._pendingNativeEvents.push(e):o._pendingNativeEvents=[e]:o.initialized&&o.delegates&&(o.dom.unbind(xA(o,e),e,o.delegates[e]),delete o.delegates[e])))},unbindAllNativeEvents(){const e=this,t=e.getBody(),o=e.dom;e.delegates&&(pe(e.delegates,((t,o)=>{e.dom.unbind(xA(e,o),o,t)})),delete e.delegates),!e.inline&&t&&o&&(t.onload=null,o.unbind(e.getWin()),o.unbind(e.getDoc())),o&&(o.unbind(t),o.unbind(e.getContainer()))}},TA=e=>m(e)?{value:e.split(/[ ,]/),valid:!0}:k(e,m)?{value:e,valid:!0}:{valid:!1,message:"The value must be a string[] or a comma/space separated string."},EA=(e,t)=>e+(Ge(t.message)?"":`. ${t.message}`),OA=e=>e.valid,AA=(e,t,o="")=>{const n=t(e);return b(n)?n?{value:e,valid:!0}:{valid:!1,message:o}:n},MA=["design","readonly"],BA=(e,t,o,n)=>{const r=o[t.get()],i=o[n];try{i.activate()}catch(e){return void console.error(`problem while activating editor mode ${n}:`,e)}r.deactivate(),r.editorReadOnly!==i.editorReadOnly&&hA(e,i.editorReadOnly),t.set(n),((e,t)=>{e.dispatch("SwitchMode",{mode:t})})(e,n)},PA=Pt.each,RA=Pt.explode,VA={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},NA=Pt.makeMap("alt,ctrl,shift,meta,access"),DA=e=>{const t={},o=Ot.os.isMacOS()||Ot.os.isiOS();PA(RA(e.toLowerCase(),"+"),(e=>{(e=>e in NA)(e)?t[e]=!0:/^[0-9]{2,}$/.test(e)?t.keyCode=parseInt(e,10):(t.charCode=e.charCodeAt(0),t.keyCode=VA[e]||e.toUpperCase().charCodeAt(0))}));const n=[t.keyCode];let r;for(r in NA)t[r]?n.push(r):t[r]=!1;return t.id=n.join(","),t.access&&(t.alt=!0,o?t.ctrl=!0:t.shift=!0),t.meta&&(o?t.meta=!0:(t.ctrl=!0,t.meta=!1)),t};class FA{constructor(e){this.shortcuts={},this.pendingPatterns=[],this.editor=e;const t=this;e.on("keyup keypress keydown",(e=>{!t.hasModifier(e)&&!t.isFunctionKey(e)||e.isDefaultPrevented()||(PA(t.shortcuts,(o=>{t.matchShortcut(e,o)&&(t.pendingPatterns=o.subpatterns.slice(0),"keydown"===e.type&&t.executeShortcutAction(o))})),t.matchShortcut(e,t.pendingPatterns[0])&&(1===t.pendingPatterns.length&&"keydown"===e.type&&t.executeShortcutAction(t.pendingPatterns[0]),t.pendingPatterns.shift()))}))}add(e,t,o,n){const r=this,i=r.normalizeCommandFunc(o);return PA(RA(Pt.trim(e)),(e=>{const o=r.createShortcut(e,t,i,n);r.shortcuts[o.id]=o})),!0}remove(e){const t=this.createShortcut(e);return!!this.shortcuts[t.id]&&(delete this.shortcuts[t.id],!0)}normalizeCommandFunc(e){const t=this,o=e;return"string"==typeof o?()=>{t.editor.execCommand(o,!1,null)}:Pt.isArray(o)?()=>{t.editor.execCommand(o[0],o[1],o[2])}:o}createShortcut(e,t,o,n){const r=Pt.map(RA(e,">"),DA);return r[r.length-1]=Pt.extend(r[r.length-1],{func:o,scope:n||this.editor}),Pt.extend(r[0],{desc:this.editor.translate(t),subpatterns:r.slice(1)})}hasModifier(e){return e.altKey||e.ctrlKey||e.metaKey}isFunctionKey(e){return"keydown"===e.type&&e.keyCode>=112&&e.keyCode<=123}matchShortcut(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)}executeShortcutAction(e){return e.func?e.func.call(e.scope):null}}const IA=()=>{const e=(()=>{const e={},t={},o={},n={},r={},i={},s={},a={},l=(e,t)=>(o,n)=>{e[o.toLowerCase()]={...n,type:t}};return{addButton:l(e,"button"),addGroupToolbarButton:l(e,"grouptoolbarbutton"),addToggleButton:l(e,"togglebutton"),addMenuButton:l(e,"menubutton"),addSplitButton:l(e,"splitbutton"),addMenuItem:l(t,"menuitem"),addNestedMenuItem:l(t,"nestedmenuitem"),addToggleMenuItem:l(t,"togglemenuitem"),addAutocompleter:l(o,"autocompleter"),addContextMenu:l(r,"contextmenu"),addContextToolbar:l(i,"contexttoolbar"),addContextForm:l(i,"contextform"),addSidebar:l(s,"sidebar"),addView:l(a,"views"),addIcon:(e,t)=>n[e.toLowerCase()]=t,getAll:()=>({buttons:e,menuItems:t,icons:n,popups:o,contextMenus:r,contextToolbars:i,sidebars:s,views:a})}})();return{addAutocompleter:e.addAutocompleter,addButton:e.addButton,addContextForm:e.addContextForm,addContextMenu:e.addContextMenu,addContextToolbar:e.addContextToolbar,addIcon:e.addIcon,addMenuButton:e.addMenuButton,addMenuItem:e.addMenuItem,addNestedMenuItem:e.addNestedMenuItem,addSidebar:e.addSidebar,addSplitButton:e.addSplitButton,addToggleButton:e.addToggleButton,addGroupToolbarButton:e.addGroupToolbarButton,addToggleMenuItem:e.addToggleMenuItem,addView:e.addView,getAll:e.getAll}},LA=bs.DOM,zA=Pt.extend,HA=Pt.each;class ZA{constructor(e,t,o){this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.composing=!1,this.destroyed=!1,this.hasHiddenInput=!1,this.iframeElement=null,this.initialized=!1,this.readonly=!1,this.removed=!1,this.startContent="",this._pendingNativeEvents=[],this._skinLoaded=!1,this.editorManager=o,this.documentBaseUrl=o.documentBaseURL,zA(this,SA);const n=this;this.id=e,this.hidden=!1;const r=((e,t)=>WO(LO||zO,LO,t,e,t))(o.defaultOptions,t);this.options=((e,t)=>{const o={},n={},r=(e,t,o)=>{const r=AA(t,o);return OA(r)?(n[e]=r.value,!0):(console.warn(EA(`Invalid value passed for the ${e} option`,r)),!1)},i=e=>Ce(o,e);return{register:(e,i)=>{const s=(e=>m(e.processor))(i)?(e=>{const t=(()=>{switch(e){case"array":return f;case"boolean":return b;case"function":return x;case"number":return C;case"object":return p;case"string":return m;case"string[]":return TA;case"object[]":return e=>k(e,p);case"regexp":return e=>h(e,RegExp);default:return D}})();return o=>AA(o,t,`The value must be a ${e}.`)})(i.processor):i.processor,a=((e,t,o)=>{if(!y(t)){const n=AA(t,o);if(OA(n))return n.value;console.error(EA(`Invalid default value passed for the "${e}" option`,n))}})(e,i.default,s);o[e]={...i,default:a,processor:s},xe(n,e).orThunk((()=>xe(t,e))).each((t=>r(e,t,s)))},isRegistered:i,get:e=>xe(n,e).orThunk((()=>xe(o,e).map((e=>e.default)))).getOrUndefined(),set:(e,t)=>{if(i(e)){const n=o[e];return n.immutable?(console.error(`"${e}" is an immutable option and cannot be updated`),!1):r(e,t,n.processor)}return console.warn(`"${e}" is not a registered option. Ensure the option has been registered before setting a value.`),!1},unset:e=>{const t=i(e);return t&&delete n[e],t},isSet:e=>Ce(n,e)}})(0,r),(e=>{const t=e.options.register;t("id",{processor:"string",default:e.id}),t("selector",{processor:"string"}),t("target",{processor:"object"}),t("suffix",{processor:"string"}),t("cache_suffix",{processor:"string"}),t("base_url",{processor:"string"}),t("referrer_policy",{processor:"string",default:""}),t("language_load",{processor:"boolean",default:!0}),t("inline",{processor:"boolean",default:!1}),t("iframe_attrs",{processor:"object",default:{}}),t("doctype",{processor:"string",default:"<!DOCTYPE html>"}),t("document_base_url",{processor:"string",default:e.documentBaseUrl}),t("body_id",{processor:al(e,"tinymce"),default:"tinymce"}),t("body_class",{processor:al(e),default:""}),t("content_security_policy",{processor:"string",default:""}),t("br_in_pre",{processor:"boolean",default:!0}),t("forced_root_block",{processor:e=>{const t=m(e)&&qe(e);return t?{value:e,valid:t}:{valid:!1,message:"Must be a non-empty string."}},default:"p"}),t("forced_root_block_attrs",{processor:"object",default:{}}),t("newline_behavior",{processor:e=>{const t=Z(["block","linebreak","invert","default"],e);return t?{value:e,valid:t}:{valid:!1,message:"Must be one of: block, linebreak, invert or default."}},default:"default"}),t("br_newline_selector",{processor:"string",default:".mce-toc h2,figcaption,caption"}),t("no_newline_selector",{processor:"string",default:""}),t("keep_styles",{processor:"boolean",default:!0}),t("end_container_on_empty_block",{processor:e=>b(e)||m(e)?{valid:!0,value:e}:{valid:!1,message:"Must be boolean or a string"},default:"blockquote"}),t("font_size_style_values",{processor:"string",default:"xx-small,x-small,small,medium,large,x-large,xx-large"}),t("font_size_legacy_values",{processor:"string",default:"xx-small,small,medium,large,x-large,xx-large,300%"}),t("font_size_classes",{processor:"string",default:""}),t("automatic_uploads",{processor:"boolean",default:!0}),t("images_reuse_filename",{processor:"boolean",default:!1}),t("images_replace_blob_uris",{processor:"boolean",default:!0}),t("icons",{processor:"string",default:""}),t("icons_url",{processor:"string",default:""}),t("images_upload_url",{processor:"string",default:""}),t("images_upload_base_path",{processor:"string",default:""}),t("images_upload_credentials",{processor:"boolean",default:!1}),t("images_upload_handler",{processor:"function"}),t("language",{processor:"string",default:"en"}),t("language_url",{processor:"string",default:""}),t("entity_encoding",{processor:"string",default:"named"}),t("indent",{processor:"boolean",default:!0}),t("indent_before",{processor:"string",default:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist"}),t("indent_after",{processor:"string",default:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist"}),t("indent_use_margin",{processor:"boolean",default:!1}),t("indentation",{processor:"string",default:"40px"}),t("content_css",{processor:e=>{const t=!1===e||m(e)||k(e,m);return t?m(e)?{value:U(e.split(","),Ue),valid:t}:f(e)?{value:e,valid:t}:!1===e?{value:[],valid:t}:{value:e,valid:t}:{valid:!1,message:"Must be false, a string or an array of strings."}},default:nc(e)?[]:["default"]}),t("content_style",{processor:"string"}),t("content_css_cors",{processor:"boolean",default:!1}),t("font_css",{processor:e=>{const t=m(e)||k(e,m);return t?{value:f(e)?e:U(e.split(","),Ue),valid:t}:{valid:!1,message:"Must be a string or an array of strings."}},default:[]}),t("inline_boundaries",{processor:"boolean",default:!0}),t("inline_boundaries_selector",{processor:"string",default:"a[href],code,span.mce-annotation"}),t("object_resizing",{processor:e=>{const t=b(e)||m(e);return t?!1===e||tl.isiPhone()||tl.isiPad()?{value:"",valid:t}:{value:!0===e?"table,img,figure.image,div,video,iframe":e,valid:t}:{valid:!1,message:"Must be boolean or a string"}},default:!ol}),t("resize_img_proportional",{processor:"boolean",default:!0}),t("event_root",{processor:"object"}),t("service_message",{processor:"string"}),t("theme",{processor:e=>!1===e||m(e)||x(e),default:"silver"}),t("theme_url",{processor:"string"}),t("formats",{processor:"object"}),t("format_empty_lines",{processor:"boolean",default:!1}),t("format_noneditable_selector",{processor:"string",default:""}),t("preview_styles",{processor:e=>{const t=!1===e||m(e);return t?{value:!1===e?"":e,valid:t}:{valid:!1,message:"Must be false or a string"}},default:"font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"}),t("custom_ui_selector",{processor:"string",default:""}),t("hidden_input",{processor:"boolean",default:!0}),t("submit_patch",{processor:"boolean",default:!0}),t("encoding",{processor:"string"}),t("add_form_submit_trigger",{processor:"boolean",default:!0}),t("add_unload_trigger",{processor:"boolean",default:!0}),t("custom_undo_redo_levels",{processor:"number",default:0}),t("disable_nodechange",{processor:"boolean",default:!1}),t("readonly",{processor:"boolean",default:!1}),t("plugins",{processor:"string[]",default:[]}),t("external_plugins",{processor:"object"}),t("forced_plugins",{processor:"string[]"}),t("model",{processor:"string",default:e.hasPlugin("rtc")?"plugin":"dom"}),t("model_url",{processor:"string"}),t("block_unsupported_drop",{processor:"boolean",default:!0}),t("visual",{processor:"boolean",default:!0}),t("visual_table_class",{processor:"string",default:"mce-item-table"}),t("visual_anchor_class",{processor:"string",default:"mce-item-anchor"}),t("iframe_aria_text",{processor:"string",default:"Rich Text Area. Press ALT-0 for help."}),t("setup",{processor:"function"}),t("init_instance_callback",{processor:"function"}),t("url_converter",{processor:"function",default:e.convertURL}),t("url_converter_scope",{processor:"object",default:e}),t("urlconverter_callback",{processor:"function"}),t("allow_conditional_comments",{processor:"boolean",default:!1}),t("allow_html_data_urls",{processor:"boolean",default:!1}),t("allow_svg_data_urls",{processor:"boolean"}),t("allow_html_in_named_anchor",{processor:"boolean",default:!1}),t("allow_script_urls",{processor:"boolean",default:!1}),t("allow_unsafe_link_target",{processor:"boolean",default:!1}),t("convert_fonts_to_spans",{processor:"boolean",default:!0,deprecated:!0}),t("fix_list_elements",{processor:"boolean",default:!1}),t("preserve_cdata",{processor:"boolean",default:!1}),t("remove_trailing_brs",{processor:"boolean"}),t("inline_styles",{processor:"boolean",default:!0,deprecated:!0}),t("element_format",{processor:"string",default:"html"}),t("entities",{processor:"string"}),t("schema",{processor:"string",default:"html5"}),t("convert_urls",{processor:"boolean",default:!0}),t("relative_urls",{processor:"boolean",default:!0}),t("remove_script_host",{processor:"boolean",default:!0}),t("custom_elements",{processor:"string"}),t("extended_valid_elements",{processor:"string"}),t("invalid_elements",{processor:"string"}),t("invalid_styles",{processor:sl}),t("valid_children",{processor:"string"}),t("valid_classes",{processor:sl}),t("valid_elements",{processor:"string"}),t("valid_styles",{processor:sl}),t("verify_html",{processor:"boolean",default:!0}),t("auto_focus",{processor:e=>m(e)||!0===e}),t("browser_spellcheck",{processor:"boolean",default:!1}),t("protect",{processor:"array"}),t("images_file_types",{processor:"string",default:"jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp"}),t("deprecation_warnings",{processor:"boolean",default:!0}),t("a11y_advanced_options",{processor:"boolean",default:!1}),t("api_key",{processor:"string"}),t("paste_block_drop",{processor:"boolean",default:!1}),t("paste_data_images",{processor:"boolean",default:!0}),t("paste_preprocess",{processor:"function"}),t("paste_postprocess",{processor:"function"}),t("paste_webkit_styles",{processor:"string",default:"none"}),t("paste_remove_styles_if_webkit",{processor:"boolean",default:!0}),t("paste_merge_formats",{processor:"boolean",default:!0}),t("smart_paste",{processor:"boolean",default:!0}),t("paste_as_text",{processor:"boolean",default:!1}),t("paste_tab_spaces",{processor:"number",default:4}),t("text_patterns",{processor:e=>k(e,p)||!1===e?{value:el(!1===e?[]:e),valid:!0}:{valid:!1,message:"Must be an array of objects or false."},default:[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"#",format:"h1"},{start:"##",format:"h2"},{start:"###",format:"h3"},{start:"####",format:"h4"},{start:"#####",format:"h5"},{start:"######",format:"h6"},{start:"1. ",cmd:"InsertOrderedList"},{start:"* ",cmd:"InsertUnorderedList"},{start:"- ",cmd:"InsertUnorderedList"}]}),t("text_patterns_lookup",{processor:e=>{return x(e)?{value:(t=e,e=>{const o=t(e);return el(o)}),valid:!0}:{valid:!1,message:"Must be a single function"};var t},default:e=>[]}),t("noneditable_class",{processor:"string",default:"mceNonEditable"}),t("editable_class",{processor:"string",default:"mceEditable"}),t("noneditable_regexp",{processor:e=>k(e,rl)?{value:e,valid:!0}:rl(e)?{value:[e],valid:!0}:{valid:!1,message:"Must be a RegExp or an array of RegExp."},default:[]}),t("table_tab_navigation",{processor:"boolean",default:!0}),e.on("ScriptsLoaded",(()=>{t("directionality",{processor:"string",default:Ss.isRtl()?"rtl":void 0}),t("placeholder",{processor:"string",default:nl.getAttrib(e.getElement(),"placeholder")})}))})(n);const i=this.options.get;i("deprecation_warnings")&&((e,t)=>{((e,t)=>{const o=mw(e),n=pw(t),r=n.length>0,i=o.length>0,s="mobile"===t.theme;if(r||i||s){const e="\n- ",t=s?`\n\nThemes:${e}mobile`:"",a=r?`\n\nPlugins:${e}${n.join(e)}`:"",l=i?`\n\nOptions:${e}${o.join(e)}`:"";console.warn("The following deprecated features are currently enabled and have been removed in TinyMCE 6.0. These features will no longer work and should be removed from the TinyMCE configuration. See https://www.tiny.cloud/docs/tinymce/6/migration-from-5x/ for more information."+t+a+l)}})(e,t)})(t,r);const s=i("suffix");s&&(o.suffix=s),this.suffix=o.suffix;const a=i("base_url");a&&o._setBaseUrl(a),this.baseUri=o.baseURI;const l=Pl(n);l&&(ws.ScriptLoader._setReferrerPolicy(l),bs.DOM.styleSheetLoader._setReferrerPolicy(l));const c=uc(n);_(c)&&bs.DOM.styleSheetLoader._setContentCssCors(c),Ts.languageLoad=i("language_load"),Ts.baseURL=o.baseURL,this.setDirty(!1),this.documentBaseURI=new uy(dl(n),{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=nc(n),this.hasVisual=gc(n),this.shortcuts=new FA(this),this.editorCommands=new lA(this),iA(this);const d=i("cache_suffix");d&&(Ot.cacheSuffix=d.replace(/^[\?\&]+/,"")),this.ui={registry:IA(),styleSheetLoader:void 0,show:S,hide:S,setEnabled:S,isEnabled:D},this.mode=(e=>{const t=_s("design"),o=_s({design:{activate:S,deactivate:S,editorReadOnly:!1},readonly:{activate:S,deactivate:S,editorReadOnly:!0}});return(e=>{e.serializer?pA(e):e.on("PreInit",(()=>{pA(e)}))})(e),(e=>{e.on("ShowCaret",(t=>{mA(e)&&t.preventDefault()})),e.on("ObjectSelected",(t=>{mA(e)&&t.preventDefault()}))})(e),{isReadOnly:()=>mA(e),set:n=>((e,t,o,n)=>{if(n!==o.get()){if(!Ce(t,n))throw new Error(`Editor mode '${n}' is invalid`);e.initialized?BA(e,o,t,n):e.on("init",(()=>BA(e,o,t,n)))}})(e,o.get(),t,n),get:()=>t.get(),register:(e,t)=>{o.set(((e,t,o)=>{if(Z(MA,t))throw new Error(`Cannot override default mode ${t}`);return{...e,[t]:{...o,deactivate:()=>{try{o.deactivate()}catch(e){console.error(`problem while deactivating editor mode ${t}:`,e)}}}}})(o.get(),e,t))}}})(n),o.dispatch("SetupEditor",{editor:this});const u=yc(n);x(u)&&u.call(n,n)}render(){(e=>{const t=e.id;Ss.setCode(Rl(e));const o=()=>{VO.unbind(window,"ready",o),e.render()};if(!ls.Event.domLoaded)return void VO.bind(window,"ready",o);if(!e.getElement())return;const n=mo(e.getElement()),r=Kt(n);e.on("remove",(()=>{W(n.dom.attributes,(e=>Xt(n,e.name))),Wt(n,r)})),e.ui.styleSheetLoader=((e,t)=>xi.forElement(e,{contentCssCors:uc(t),referrerPolicy:Pl(t)}))(n,e),nc(e)?e.inline=!0:(e.orgVisibility=e.getElement().style.visibility,e.getElement().style.visibility="hidden");const i=e.getElement().form||VO.getParent(t,"form");i&&(e.formElement=i,rc(e)&&!zn(e.getElement())&&(VO.insertAfter(VO.create("input",{type:"hidden",name:t}),t),e.hasHiddenInput=!0),e.formEventDelegate=t=>{e.dispatch(t.type,t)},VO.bind(i,"submit reset",e.formEventDelegate),e.on("reset",(()=>{e.resetContent()})),!ic(e)||i.submit.nodeType||i.submit.length||i._mceOldSubmit||(i._mceOldSubmit=i.submit,i.submit=()=>(e.editorManager.triggerSave(),e.setDirty(!1),i._mceOldSubmit(i)))),e.windowManager=Ow(e),e.notificationManager=Sw(e),(e=>"xml"===e.options.get("encoding"))(e)&&e.on("GetContent",(e=>{e.save&&(e.content=VO.encode(e.content))})),sc(e)&&e.on("submit",(()=>{e.initialized&&e.save()})),ac(e)&&(e._beforeUnload=()=>{!e.initialized||e.destroyed||e.isHidden()||e.save({format:"raw",no_events:!0,set_dirty:!1})},e.editorManager.on("BeforeUnload",e._beforeUnload)),e.editorManager.add(e),FO(e,e.suffix)})(this)}focus(e){this.execCommand("mceFocus",!1,e)}hasFocus(){return ep(this)}translate(e){return Ss.translate(e)}getParam(e,t,o){const n=this.options;return n.isRegistered(e)||(_(o)?n.register(e,{processor:o,default:t}):n.register(e,{processor:D,default:t})),n.isSet(e)||y(t)?n.get(e):t}hasPlugin(e,t){return!(!Z(hc(this),e)||t&&void 0===Tw.get(e))}nodeChanged(e){this._nodeChangeDispatcher.nodeChanged(e)}addCommand(e,t,o){this.editorCommands.addCommand(e,t,o)}addQueryStateHandler(e,t,o){this.editorCommands.addQueryStateHandler(e,t,o)}addQueryValueHandler(e,t,o){this.editorCommands.addQueryValueHandler(e,t,o)}addShortcut(e,t,o,n){this.shortcuts.add(e,t,o,n)}execCommand(e,t,o,n){return this.editorCommands.execCommand(e,t,o,n)}queryCommandState(e){return this.editorCommands.queryCommandState(e)}queryCommandValue(e){return this.editorCommands.queryCommandValue(e)}queryCommandSupported(e){return this.editorCommands.queryCommandSupported(e)}show(){const e=this;e.hidden&&(e.hidden=!1,e.inline?e.getBody().contentEditable="true":(LA.show(e.getContainer()),LA.hide(e.id)),e.load(),e.dispatch("show"))}hide(){const e=this;e.hidden||(e.save(),e.inline?(e.getBody().contentEditable="false",e===e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(LA.hide(e.getContainer()),LA.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.dispatch("hide"))}isHidden(){return this.hidden}setProgressState(e,t){this.dispatch("ProgressState",{state:e,time:t})}load(e={}){const t=this,o=t.getElement();if(t.removed)return"";if(o){const n={...e,load:!0},r=zn(o)?o.value:o.innerHTML,i=t.setContent(r,n);return n.no_events||t.dispatch("LoadContent",{...n,element:o}),i}return""}save(e={}){const t=this;let o=t.getElement();if(!o||!t.initialized||t.removed)return"";const n={...e,save:!0,element:o};let r=t.getContent(n);const i={...n,content:r};if(i.no_events||t.dispatch("SaveContent",i),"raw"===i.format&&t.dispatch("RawSaveContent",i),r=i.content,zn(o))o.value=r;else{!e.is_removing&&t.inline||(o.innerHTML=r);const n=LA.getParent(t.id,"form");n&&HA(n.elements,(e=>e.name!==t.id||(e.value=r,!1)))}return i.element=n.element=o=null,!1!==i.set_dirty&&t.setDirty(!1),r}setContent(e,t){return dw(this,e,t)}getContent(e){return((e,t={})=>{const o=((e,t)=>({...e,format:t,get:!0,getInner:!0}))(t,t.format?t.format:"html");return _y(e,o).fold(A,(t=>{const o=((e,t)=>Qy(e).editor.getContent(t))(e,t);return xy(e,o,t)}))})(this,e)}insertContent(e,t){t&&(e=zA({content:e},t)),this.execCommand("mceInsertContent",!1,e)}resetContent(e){void 0===e?dw(this,this.startContent,{format:"raw"}):dw(this,e),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()}isDirty(){return!this.isNotDirty}setDirty(e){const t=!this.isNotDirty;this.isNotDirty=!e,e&&e!==t&&this.dispatch("dirty")}getContainer(){const e=this;return e.container||(e.container=e.editorContainer||LA.get(e.id+"_parent")),e.container}getContentAreaContainer(){return this.contentAreaContainer}getElement(){return this.targetElm||(this.targetElm=LA.get(this.id)),this.targetElm}getWin(){const e=this;if(!e.contentWindow){const t=e.iframeElement;t&&(e.contentWindow=t.contentWindow)}return e.contentWindow}getDoc(){const e=this;if(!e.contentDocument){const t=e.getWin();t&&(e.contentDocument=t.document)}return e.contentDocument}getBody(){var e,t;const o=this.getDoc();return null!==(t=null!==(e=this.bodyElement)&&void 0!==e?e:null==o?void 0:o.body)&&void 0!==t?t:null}convertURL(e,t,o){const n=this,r=n.options.get,i=_c(n);return x(i)?i.call(n,e,o,!0,t):!r("convert_urls")||"link"===o||p(o)&&"LINK"===o.nodeName||0===e.indexOf("file:")||0===e.length?e:r("relative_urls")?n.documentBaseURI.toRelative(e):e=n.documentBaseURI.toAbsolute(e,r("remove_script_host"))}addVisual(e){((e,t)=>{((e,t)=>{ew(e).editor.addVisual(t)})(e,t)})(this,e)}remove(){(e=>{if(!e.removed){const{_selectionOverrides:t,editorUpload:o}=e,n=e.getBody(),r=e.getElement();n&&e.save({is_removing:!0}),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&_(null==r?void 0:r.nextSibling)&&gw.remove(r.nextSibling),(e=>{e.dispatch("remove")})(e),e.editorManager.remove(e),!e.inline&&n&&(e=>{gw.setStyle(e.id,"display",e.orgDisplay)})(e),(e=>{e.dispatch("detach")})(e),gw.remove(e.getContainer()),fw(t),fw(o),e.destroy()}})(this)}destroy(e){((e,t)=>{const{selection:o,dom:n}=e;e.destroyed||(t||e.removed?(t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),fw(o),fw(n)),(e=>{const t=e.formElement;t&&(t._mceOldSubmit&&(t.submit=t._mceOldSubmit,delete t._mceOldSubmit),gw.unbind(t,"submit reset",e.formEventDelegate))})(e),(e=>{const t=e;t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.bodyElement=t.contentDocument=t.contentWindow=null,t.iframeElement=t.targetElm=null;const o=e.selection;if(o){const e=o.dom;t.selection=o.win=o.dom=e.doc=null}})(e),e.destroyed=!0):e.remove())})(this,e)}uploadImages(){return this.editorUpload.uploadImages()}_scanForImages(){return this.editorUpload.scanForImages()}}const jA=bs.DOM,UA=Pt.each;let $A,WA=!1,qA=[];const GA=e=>{const t=e.type;UA(JA.get(),(o=>{switch(t){case"scroll":o.dispatch("ScrollWindow",e);break;case"resize":o.dispatch("ResizeWindow",e)}}))},YA=e=>{if(e!==WA){const t=bs.DOM;e?(t.bind(window,"resize",GA),t.bind(window,"scroll",GA)):(t.unbind(window,"resize",GA),t.unbind(window,"scroll",GA)),WA=e}},XA=e=>{const t=qA;return qA=G(qA,(t=>e!==t)),JA.activeEditor===e&&(JA.activeEditor=qA.length>0?qA[0]:null),JA.focusedEditor===e&&(JA.focusedEditor=null),t.length!==qA.length},KA="CSS1Compat"!==document.compatMode,JA={...yA,baseURI:null,baseURL:null,defaultOptions:{},documentBaseURL:null,suffix:null,majorVersion:"6",minorVersion:"3.1",releaseDate:"2022-12-06",i18n:Ss,activeEditor:null,focusedEditor:null,setup(){const e=this;let t="",o="",n=uy.getDocumentBaseUrl(document.location);/^[^:]+:\/\/\/?[^\/]+\//.test(n)&&(n=n.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/"));const r=window.mailpoetTinymce||window.mailpoetTinyMCEPreInit;if(r)t=r.base||r.baseURL,o=r.suffix;else{const e=document.getElementsByTagName("script");for(let n=0;n<e.length;n++){const r=e[n].src||"";if(""===r)continue;const i=r.substring(r.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(r)){-1!==i.indexOf(".min")&&(o=".min"),t=r.substring(0,r.lastIndexOf("/"));break}}if(!t&&document.currentScript){const e=document.currentScript.src;-1!==e.indexOf(".min")&&(o=".min"),t=e.substring(0,e.lastIndexOf("/"))}}var i;e.baseURL=new uy(n).toAbsolute(t),e.documentBaseURL=n,e.baseURI=new uy(e.baseURL),e.suffix=o,(i=e).on("AddEditor",B(Xm,i)),i.on("RemoveEditor",B(Km,i))},overrideDefaults(e){const t=e.base_url;t&&this._setBaseUrl(t);const o=e.suffix;o&&(this.suffix=o),this.defaultOptions=e;const n=e.plugin_base_urls;void 0!==n&&pe(n,((e,t)=>{Ts.PluginManager.urls[t]=e}))},init(e){const t=this;let o;const n=Pt.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," ");let r=e=>{o=e};const i=()=>{let o=0;const s=[];let a;jA.unbind(window,"ready",i),(o=>{const n=e.onpageload;n&&n.apply(t,[])})(),a=((e,t)=>{const o=[],n=x(t)?e=>j(o,(o=>t(o,e))):e=>Z(o,e);for(let t=0,r=e.length;t<r;t++){const r=e[t];n(r)||o.push(r)}return o})((e=>Ot.browser.isIE()||Ot.browser.isEdge()?(Rw("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tiny.cloud/docs/tinymce/6/support/#supportedwebbrowsers"),[]):KA?(Rw("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[]):m(e.selector)?jA.select(e.selector):_(e.target)?[e.target]:[])(e)),Pt.each(a,(e=>{var o;(o=t.get(e.id))&&o.initialized&&!(o.getContainer()||o.getBody()).parentNode&&(XA(o),o.unbindAllNativeEvents(),o.destroy(!0),o.removed=!0)})),a=Pt.grep(a,(e=>!t.get(e.id))),0===a.length?r([]):UA(a,(i=>{((e,t)=>e.inline&&t.tagName.toLowerCase()in n)(e,i)?Rw("Could not initialize inline editor on invalid inline target element",i):((e,n,i)=>{const l=new ZA(e,n,t);s.push(l),l.on("init",(()=>{++o===a.length&&r(s)})),l.targetElm=l.targetElm||i,l.render()})((e=>{let t=e.id;return t||(t=xe(e,"name").filter((e=>!jA.get(e))).getOrThunk(jA.uniqueId),e.setAttribute("id",t)),t})(i),e,i)}))};return jA.bind(window,"ready",i),new Promise((e=>{o?e(o):r=t=>{e(t)}}))},get(e){return 0===arguments.length?qA.slice(0):m(e)?J(qA,(t=>t.id===e)).getOr(null):C(e)&&qA[e]?qA[e]:null},add(e){const t=this,o=t.get(e.id);return o===e||(null===o&&qA.push(e),YA(!0),t.activeEditor=e,t.dispatch("AddEditor",{editor:e}),$A||($A=e=>{const o=t.dispatch("BeforeUnload");if(o.returnValue)return e.preventDefault(),e.returnValue=o.returnValue,o.returnValue},window.addEventListener("beforeunload",$A))),e},createEditor(e,t){return this.add(new ZA(e,t,this))},remove(e){const t=this;let o;if(e){if(!m(e))return o=e,v(t.get(o.id))?null:(XA(o)&&t.dispatch("RemoveEditor",{editor:o}),0===qA.length&&window.removeEventListener("beforeunload",$A),o.remove(),YA(qA.length>0),o);UA(jA.select(e),(e=>{o=t.get(e.id),o&&t.remove(o)}))}else for(let e=qA.length-1;e>=0;e--)t.remove(qA[e])},execCommand(e,t,o){var n;const r=this,i=p(o)?null!==(n=o.id)&&void 0!==n?n:o.index:o;switch(e){case"mceAddEditor":if(!r.get(i)){const e=o.options;new ZA(i,e,r).render()}return!0;case"mceRemoveEditor":{const e=r.get(i);return e&&e.remove(),!0}case"mceToggleEditor":{const e=r.get(i);return e?(e.isHidden()?e.show():e.hide(),!0):(r.execCommand("mceAddEditor",!1,o),!0)}}return!!r.activeEditor&&r.activeEditor.execCommand(e,t,o)},triggerSave:()=>{UA(qA,(e=>{e.save()}))},addI18n:(e,t)=>{Ss.add(e,t)},translate:e=>Ss.translate(e),setActive(e){const t=this.activeEditor;this.activeEditor!==e&&(t&&t.dispatch("deactivate",{relatedTarget:e}),e.dispatch("activate",{relatedTarget:t})),this.activeEditor=e},_setBaseUrl(e){this.baseURL=new uy(this.documentBaseURL).toAbsolute(e.replace(/\/+$/,"")),this.baseURI=new uy(this.baseURL)}};JA.setup();const QA=(()=>{const e=Os();return{FakeClipboardItem:e=>({items:e,types:he(e),getType:t=>xe(e,t).getOrUndefined()}),write:t=>{e.set(t)},read:()=>e.get().getOrUndefined(),clear:e.clear}})(),eM=Math.min,tM=Math.max,oM=Math.round,nM=(e,t,o)=>{let n=t.x,r=t.y;const i=e.w,s=e.h,a=t.w,l=t.h,c=(o||"").split("");return"b"===c[0]&&(r+=l),"r"===c[1]&&(n+=a),"c"===c[0]&&(r+=oM(l/2)),"c"===c[1]&&(n+=oM(a/2)),"b"===c[3]&&(r-=s),"r"===c[4]&&(n-=i),"c"===c[3]&&(r-=oM(s/2)),"c"===c[4]&&(n-=oM(i/2)),rM(n,r,i,s)},rM=(e,t,o,n)=>({x:e,y:t,w:o,h:n}),iM={inflate:(e,t,o)=>rM(e.x-t,e.y-o,e.w+2*t,e.h+2*o),relativePosition:nM,findBestRelativePosition:(e,t,o,n)=>{for(let r=0;r<n.length;r++){const i=nM(e,t,n[r]);if(i.x>=o.x&&i.x+i.w<=o.w+o.x&&i.y>=o.y&&i.y+i.h<=o.h+o.y)return n[r]}return null},intersect:(e,t)=>{const o=tM(e.x,t.x),n=tM(e.y,t.y),r=eM(e.x+e.w,t.x+t.w),i=eM(e.y+e.h,t.y+t.h);return r-o<0||i-n<0?null:rM(o,n,r-o,i-n)},clamp:(e,t,o)=>{let n=e.x,r=e.y,i=e.x+e.w,s=e.y+e.h;const a=t.x+t.w,l=t.y+t.h,c=tM(0,t.x-n),d=tM(0,t.y-r),u=tM(0,i-a),h=tM(0,s-l);return n+=c,r+=d,o&&(i+=c,s+=d,n-=u,r-=h),i-=u,s-=h,rM(n,r,i-n,s-r)},create:rM,fromClientRect:e=>rM(e.left,e.top,e.width,e.height)},sM=(()=>{const e={},t={};return{load:(o,n)=>{const r=`Script at URL "${n}" failed to load`,i=`Script at URL "${n}" did not call \`tinymce.Resource.add('${o}', data)\` within 1 second`;if(void 0!==e[o])return e[o];{const s=new Promise(((e,s)=>{const a=((e,t,o=1e3)=>{let n=!1,r=null;const i=e=>(...t)=>{n||(n=!0,null!==r&&(clearTimeout(r),r=null),e.apply(null,t))},s=i(e),a=i(t);return{start:(...e)=>{n||null!==r||(r=setTimeout((()=>a.apply(null,e)),o))},resolve:s,reject:a}})(e,s);t[o]=a.resolve,ws.ScriptLoader.loadScript(n).then((()=>a.start(i)),(()=>a.reject(r)))}));return e[o]=s,s}},add:(o,n)=>{void 0!==t[o]&&(t[o](n),delete t[o]),e[o]=Promise.resolve(n)},unload:t=>{delete e[t]}}})();let aM;try{const e="__storage_test__";aM=window.localStorage,aM.setItem(e,e),aM.removeItem(e)}catch(e){aM=(()=>{let e={},t=[];const o={getItem:t=>e[t]||null,setItem:(o,n)=>{t.push(o),e[o]=String(n)},key:e=>t[e],removeItem:o=>{t=t.filter((e=>e===o)),delete e[o]},clear:()=>{t=[],e={}},length:0};return Object.defineProperty(o,"length",{get:()=>t.length,configurable:!1,enumerable:!1}),o})()}const lM={geom:{Rect:iM},util:{Delay:Wm,Tools:Pt,VK:Nh,URI:uy,EventDispatcher:vA,Observable:yA,I18n:Ss,LocalStorage:aM,ImageUploader:e=>{const t=Fw(),o=Hw(e,t);return{upload:(t,n=!0)=>o.upload(t,n?zw(e):void 0)}}},dom:{EventUtils:ls,TreeWalker:An,TextSeeker:Gs,DOMUtils:bs,ScriptLoader:ws,RangeUtils:mm,Serializer:cw,StyleSheetLoader:_i,ControlSelection:zh,BookmarkManager:Eh,Selection:sw,Event:ls.Event},html:{Styles:Qi,Entities:Li,Node:fp,Schema:Ji,DomParser:yy,Writer:Sp,Serializer:Tp},Env:Ot,AddOnManager:Ts,Annotator:Th,Formatter:Qw,UndoManager:t_,EditorCommands:lA,WindowManager:Ow,NotificationManager:Sw,EditorObservable:SA,Shortcuts:FA,Editor:ZA,FocusManager:$m,EditorManager:JA,DOM:bs.DOM,ScriptLoader:ws.ScriptLoader,PluginManager:Tw,ThemeManager:Ew,ModelManager:bw,IconManager:vw,Resource:sM,FakeClipboard:QA,trim:Pt.trim,isArray:Pt.isArray,is:Pt.is,toArray:Pt.toArray,makeMap:Pt.makeMap,each:Pt.each,map:Pt.map,grep:Pt.grep,inArray:Pt.inArray,extend:Pt.extend,walk:Pt.walk,resolve:Pt.resolve,explode:Pt.explode,_addCacheSuffix:Pt._addCacheSuffix},cM=Pt.extend(JA,lM);(e=>{window.mailpoetTinymce=e,window.mailpoetTinyMCE=e})(cM),(t=>{try{e.exports=t}catch(e){}})(cM)}()},65311:e=>{"use strict";e.exports=jQuery},37062:function(e,t,o){e.exports=function(){var e="1.13.4",t="object"==typeof self&&self.self===self&&self||"object"==typeof o.g&&o.g.global===o.g&&o.g||Function("return this")()||{},n=Array.prototype,r=Object.prototype,i="undefined"!=typeof Symbol?Symbol.prototype:null,s=n.push,a=n.slice,l=r.toString,c=r.hasOwnProperty,d="undefined"!=typeof ArrayBuffer,u="undefined"!=typeof DataView,h=Array.isArray,m=Object.keys,p=Object.create,g=d&&ArrayBuffer.isView,f=isNaN,v=isFinite,b=!{toString:null}.propertyIsEnumerable("toString"),y=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],w=Math.pow(2,53)-1;function _(e,t){return t=null==t?e.length-1:+t,function(){for(var o=Math.max(arguments.length-t,0),n=Array(o),r=0;r<o;r++)n[r]=arguments[r+t];switch(t){case 0:return e.call(this,n);case 1:return e.call(this,arguments[0],n);case 2:return e.call(this,arguments[0],arguments[1],n)}var i=Array(t+1);for(r=0;r<t;r++)i[r]=arguments[r];return i[t]=n,e.apply(this,i)}}function x(e){var t=typeof e;return"function"===t||"object"===t&&!!e}function C(e){return void 0===e}function k(e){return!0===e||!1===e||"[object Boolean]"===l.call(e)}function S(e){var t="[object "+e+"]";return function(e){return l.call(e)===t}}var T=S("String"),E=S("Number"),O=S("Date"),A=S("RegExp"),M=S("Error"),B=S("Symbol"),P=S("ArrayBuffer"),R=S("Function"),V=t.document&&t.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof V&&(R=function(e){return"function"==typeof e||!1});var N=R,D=S("Object"),F=u&&D(new DataView(new ArrayBuffer(8))),I="undefined"!=typeof Map&&D(new Map),L=S("DataView"),z=F?function(e){return null!=e&&N(e.getInt8)&&P(e.buffer)}:L,H=h||S("Array");function Z(e,t){return null!=e&&c.call(e,t)}var j=S("Arguments");!function(){j(arguments)||(j=function(e){return Z(e,"callee")})}();var U=j;function $(e){return E(e)&&f(e)}function W(e){return function(){return e}}function q(e){return function(t){var o=e(t);return"number"==typeof o&&o>=0&&o<=w}}function G(e){return function(t){return null==t?void 0:t[e]}}var Y=G("byteLength"),X=q(Y),K=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/,J=d?function(e){return g?g(e)&&!z(e):X(e)&&K.test(l.call(e))}:W(!1),Q=G("length");function ee(e,t){t=function(e){for(var t={},o=e.length,n=0;n<o;++n)t[e[n]]=!0;return{contains:function(e){return!0===t[e]},push:function(o){return t[o]=!0,e.push(o)}}}(t);var o=y.length,n=e.constructor,i=N(n)&&n.prototype||r,s="constructor";for(Z(e,s)&&!t.contains(s)&&t.push(s);o--;)(s=y[o])in e&&e[s]!==i[s]&&!t.contains(s)&&t.push(s)}function te(e){if(!x(e))return[];if(m)return m(e);var t=[];for(var o in e)Z(e,o)&&t.push(o);return b&&ee(e,t),t}function oe(e,t){var o=te(t),n=o.length;if(null==e)return!n;for(var r=Object(e),i=0;i<n;i++){var s=o[i];if(t[s]!==r[s]||!(s in r))return!1}return!0}function ne(e){return e instanceof ne?e:this instanceof ne?void(this._wrapped=e):new ne(e)}function re(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,Y(e))}ne.VERSION=e,ne.prototype.value=function(){return this._wrapped},ne.prototype.valueOf=ne.prototype.toJSON=ne.prototype.value,ne.prototype.toString=function(){return String(this._wrapped)};var ie="[object DataView]";function se(e,t,o,n){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var r=typeof e;return("function"===r||"object"===r||"object"==typeof t)&&function e(t,o,n,r){t instanceof ne&&(t=t._wrapped),o instanceof ne&&(o=o._wrapped);var s=l.call(t);if(s!==l.call(o))return!1;if(F&&"[object Object]"==s&&z(t)){if(!z(o))return!1;s=ie}switch(s){case"[object RegExp]":case"[object String]":return""+t==""+o;case"[object Number]":return+t!=+t?+o!=+o:0==+t?1/+t==1/o:+t==+o;case"[object Date]":case"[object Boolean]":return+t==+o;case"[object Symbol]":return i.valueOf.call(t)===i.valueOf.call(o);case"[object ArrayBuffer]":case ie:return e(re(t),re(o),n,r)}var a="[object Array]"===s;if(!a&&J(t)){if(Y(t)!==Y(o))return!1;if(t.buffer===o.buffer&&t.byteOffset===o.byteOffset)return!0;a=!0}if(!a){if("object"!=typeof t||"object"!=typeof o)return!1;var c=t.constructor,d=o.constructor;if(c!==d&&!(N(c)&&c instanceof c&&N(d)&&d instanceof d)&&"constructor"in t&&"constructor"in o)return!1}r=r||[];for(var u=(n=n||[]).length;u--;)if(n[u]===t)return r[u]===o;if(n.push(t),r.push(o),a){if((u=t.length)!==o.length)return!1;for(;u--;)if(!se(t[u],o[u],n,r))return!1}else{var h,m=te(t);if(u=m.length,te(o).length!==u)return!1;for(;u--;)if(!Z(o,h=m[u])||!se(t[h],o[h],n,r))return!1}return n.pop(),r.pop(),!0}(e,t,o,n)}function ae(e){if(!x(e))return[];var t=[];for(var o in e)t.push(o);return b&&ee(e,t),t}function le(e){var t=Q(e);return function(o){if(null==o)return!1;var n=ae(o);if(Q(n))return!1;for(var r=0;r<t;r++)if(!N(o[e[r]]))return!1;return e!==me||!N(o[ce])}}var ce="forEach",de=["clear","delete"],ue=["get","has","set"],he=de.concat(ce,ue),me=de.concat(ue),pe=["add"].concat(de,ce,"has"),ge=I?le(he):S("Map"),fe=I?le(me):S("WeakMap"),ve=I?le(pe):S("Set"),be=S("WeakSet");function ye(e){for(var t=te(e),o=t.length,n=Array(o),r=0;r<o;r++)n[r]=e[t[r]];return n}function we(e){for(var t={},o=te(e),n=0,r=o.length;n<r;n++)t[e[o[n]]]=o[n];return t}function _e(e){var t=[];for(var o in e)N(e[o])&&t.push(o);return t.sort()}function xe(e,t){return function(o){var n=arguments.length;if(t&&(o=Object(o)),n<2||null==o)return o;for(var r=1;r<n;r++)for(var i=arguments[r],s=e(i),a=s.length,l=0;l<a;l++){var c=s[l];t&&void 0!==o[c]||(o[c]=i[c])}return o}}var Ce=xe(ae),ke=xe(te),Se=xe(ae,!0);function Te(e){if(!x(e))return{};if(p)return p(e);var t=function(){};t.prototype=e;var o=new t;return t.prototype=null,o}function Ee(e){return H(e)?e:[e]}function Oe(e){return ne.toPath(e)}function Ae(e,t){for(var o=t.length,n=0;n<o;n++){if(null==e)return;e=e[t[n]]}return o?e:void 0}function Me(e,t,o){var n=Ae(e,Oe(t));return C(n)?o:n}function Be(e){return e}function Pe(e){return e=ke({},e),function(t){return oe(t,e)}}function Re(e){return e=Oe(e),function(t){return Ae(t,e)}}function Ve(e,t,o){if(void 0===t)return e;switch(null==o?3:o){case 1:return function(o){return e.call(t,o)};case 3:return function(o,n,r){return e.call(t,o,n,r)};case 4:return function(o,n,r,i){return e.call(t,o,n,r,i)}}return function(){return e.apply(t,arguments)}}function Ne(e,t,o){return null==e?Be:N(e)?Ve(e,t,o):x(e)&&!H(e)?Pe(e):Re(e)}function De(e,t){return Ne(e,t,1/0)}function Fe(e,t,o){return ne.iteratee!==De?ne.iteratee(e,t):Ne(e,t,o)}function Ie(){}function Le(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}ne.toPath=Ee,ne.iteratee=De;var ze=Date.now||function(){return(new Date).getTime()};function He(e){var t=function(t){return e[t]},o="(?:"+te(e).join("|")+")",n=RegExp(o),r=RegExp(o,"g");return function(e){return e=null==e?"":""+e,n.test(e)?e.replace(r,t):e}}var Ze={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},je=He(Ze),Ue=He(we(Ze)),$e=ne.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},We=/(.)^/,qe={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Ge=/\\|'|\r|\n|\u2028|\u2029/g;function Ye(e){return"\\"+qe[e]}var Xe=/^\s*(\w|\$)+\s*$/,Ke=0;function Je(e,t,o,n,r){if(!(n instanceof t))return e.apply(o,r);var i=Te(e.prototype),s=e.apply(i,r);return x(s)?s:i}var Qe=_((function(e,t){var o=Qe.placeholder,n=function(){for(var r=0,i=t.length,s=Array(i),a=0;a<i;a++)s[a]=t[a]===o?arguments[r++]:t[a];for(;r<arguments.length;)s.push(arguments[r++]);return Je(e,n,this,this,s)};return n}));Qe.placeholder=ne;var et=_((function(e,t,o){if(!N(e))throw new TypeError("Bind must be called on a function");var n=_((function(r){return Je(e,n,t,this,o.concat(r))}));return n})),tt=q(Q);function ot(e,t,o,n){if(n=n||[],t||0===t){if(t<=0)return n.concat(e)}else t=1/0;for(var r=n.length,i=0,s=Q(e);i<s;i++){var a=e[i];if(tt(a)&&(H(a)||U(a)))if(t>1)ot(a,t-1,o,n),r=n.length;else for(var l=0,c=a.length;l<c;)n[r++]=a[l++];else o||(n[r++]=a)}return n}var nt=_((function(e,t){var o=(t=ot(t,!1,!1)).length;if(o<1)throw new Error("bindAll must be passed function names");for(;o--;){var n=t[o];e[n]=et(e[n],e)}return e})),rt=_((function(e,t,o){return setTimeout((function(){return e.apply(null,o)}),t)})),it=Qe(rt,ne,1);function st(e){return function(){return!e.apply(this,arguments)}}function at(e,t){var o;return function(){return--e>0&&(o=t.apply(this,arguments)),e<=1&&(t=null),o}}var lt=Qe(at,2);function ct(e,t,o){t=Fe(t,o);for(var n,r=te(e),i=0,s=r.length;i<s;i++)if(t(e[n=r[i]],n,e))return n}function dt(e){return function(t,o,n){o=Fe(o,n);for(var r=Q(t),i=e>0?0:r-1;i>=0&&i<r;i+=e)if(o(t[i],i,t))return i;return-1}}var ut=dt(1),ht=dt(-1);function mt(e,t,o,n){for(var r=(o=Fe(o,n,1))(t),i=0,s=Q(e);i<s;){var a=Math.floor((i+s)/2);o(e[a])<r?i=a+1:s=a}return i}function pt(e,t,o){return function(n,r,i){var s=0,l=Q(n);if("number"==typeof i)e>0?s=i>=0?i:Math.max(i+l,s):l=i>=0?Math.min(i+1,l):i+l+1;else if(o&&i&&l)return n[i=o(n,r)]===r?i:-1;if(r!=r)return(i=t(a.call(n,s,l),$))>=0?i+s:-1;for(i=e>0?s:l-1;i>=0&&i<l;i+=e)if(n[i]===r)return i;return-1}}var gt=pt(1,ut,mt),ft=pt(-1,ht);function vt(e,t,o){var n=(tt(e)?ut:ct)(e,t,o);if(void 0!==n&&-1!==n)return e[n]}function bt(e,t,o){var n,r;if(t=Ve(t,o),tt(e))for(n=0,r=e.length;n<r;n++)t(e[n],n,e);else{var i=te(e);for(n=0,r=i.length;n<r;n++)t(e[i[n]],i[n],e)}return e}function yt(e,t,o){t=Fe(t,o);for(var n=!tt(e)&&te(e),r=(n||e).length,i=Array(r),s=0;s<r;s++){var a=n?n[s]:s;i[s]=t(e[a],a,e)}return i}function wt(e){var t=function(t,o,n,r){var i=!tt(t)&&te(t),s=(i||t).length,a=e>0?0:s-1;for(r||(n=t[i?i[a]:a],a+=e);a>=0&&a<s;a+=e){var l=i?i[a]:a;n=o(n,t[l],l,t)}return n};return function(e,o,n,r){var i=arguments.length>=3;return t(e,Ve(o,r,4),n,i)}}var _t=wt(1),xt=wt(-1);function Ct(e,t,o){var n=[];return t=Fe(t,o),bt(e,(function(e,o,r){t(e,o,r)&&n.push(e)})),n}function kt(e,t,o){t=Fe(t,o);for(var n=!tt(e)&&te(e),r=(n||e).length,i=0;i<r;i++){var s=n?n[i]:i;if(!t(e[s],s,e))return!1}return!0}function St(e,t,o){t=Fe(t,o);for(var n=!tt(e)&&te(e),r=(n||e).length,i=0;i<r;i++){var s=n?n[i]:i;if(t(e[s],s,e))return!0}return!1}function Tt(e,t,o,n){return tt(e)||(e=ye(e)),("number"!=typeof o||n)&&(o=0),gt(e,t,o)>=0}var Et=_((function(e,t,o){var n,r;return N(t)?r=t:(t=Oe(t),n=t.slice(0,-1),t=t[t.length-1]),yt(e,(function(e){var i=r;if(!i){if(n&&n.length&&(e=Ae(e,n)),null==e)return;i=e[t]}return null==i?i:i.apply(e,o)}))}));function Ot(e,t){return yt(e,Re(t))}function At(e,t,o){var n,r,i=-1/0,s=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var a=0,l=(e=tt(e)?e:ye(e)).length;a<l;a++)null!=(n=e[a])&&n>i&&(i=n);else t=Fe(t,o),bt(e,(function(e,o,n){((r=t(e,o,n))>s||r===-1/0&&i===-1/0)&&(i=e,s=r)}));return i}var Mt=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function Bt(e){return e?H(e)?a.call(e):T(e)?e.match(Mt):tt(e)?yt(e,Be):ye(e):[]}function Pt(e,t,o){if(null==t||o)return tt(e)||(e=ye(e)),e[Le(e.length-1)];var n=Bt(e),r=Q(n);t=Math.max(Math.min(t,r),0);for(var i=r-1,s=0;s<t;s++){var a=Le(s,i),l=n[s];n[s]=n[a],n[a]=l}return n.slice(0,t)}function Rt(e,t){return function(o,n,r){var i=t?[[],[]]:{};return n=Fe(n,r),bt(o,(function(t,r){var s=n(t,r,o);e(i,t,s)})),i}}var Vt=Rt((function(e,t,o){Z(e,o)?e[o].push(t):e[o]=[t]})),Nt=Rt((function(e,t,o){e[o]=t})),Dt=Rt((function(e,t,o){Z(e,o)?e[o]++:e[o]=1})),Ft=Rt((function(e,t,o){e[o?0:1].push(t)}),!0);function It(e,t,o){return t in o}var Lt=_((function(e,t){var o={},n=t[0];if(null==e)return o;N(n)?(t.length>1&&(n=Ve(n,t[1])),t=ae(e)):(n=It,t=ot(t,!1,!1),e=Object(e));for(var r=0,i=t.length;r<i;r++){var s=t[r],a=e[s];n(a,s,e)&&(o[s]=a)}return o})),zt=_((function(e,t){var o,n=t[0];return N(n)?(n=st(n),t.length>1&&(o=t[1])):(t=yt(ot(t,!1,!1),String),n=function(e,o){return!Tt(t,o)}),Lt(e,n,o)}));function Ht(e,t,o){return a.call(e,0,Math.max(0,e.length-(null==t||o?1:t)))}function Zt(e,t,o){return null==e||e.length<1?null==t||o?void 0:[]:null==t||o?e[0]:Ht(e,e.length-t)}function jt(e,t,o){return a.call(e,null==t||o?1:t)}var Ut=_((function(e,t){return t=ot(t,!0,!0),Ct(e,(function(e){return!Tt(t,e)}))})),$t=_((function(e,t){return Ut(e,t)}));function Wt(e,t,o,n){k(t)||(n=o,o=t,t=!1),null!=o&&(o=Fe(o,n));for(var r=[],i=[],s=0,a=Q(e);s<a;s++){var l=e[s],c=o?o(l,s,e):l;t&&!o?(s&&i===c||r.push(l),i=c):o?Tt(i,c)||(i.push(c),r.push(l)):Tt(r,l)||r.push(l)}return r}var qt=_((function(e){return Wt(ot(e,!0,!0))}));function Gt(e){for(var t=e&&At(e,Q).length||0,o=Array(t),n=0;n<t;n++)o[n]=Ot(e,n);return o}var Yt=_(Gt);function Xt(e,t){return e._chain?ne(t).chain():t}function Kt(e){return bt(_e(e),(function(t){var o=ne[t]=e[t];ne.prototype[t]=function(){var e=[this._wrapped];return s.apply(e,arguments),Xt(this,o.apply(ne,e))}})),ne}bt(["pop","push","reverse","shift","sort","splice","unshift"],(function(e){var t=n[e];ne.prototype[e]=function(){var o=this._wrapped;return null!=o&&(t.apply(o,arguments),"shift"!==e&&"splice"!==e||0!==o.length||delete o[0]),Xt(this,o)}})),bt(["concat","join","slice"],(function(e){var t=n[e];ne.prototype[e]=function(){var e=this._wrapped;return null!=e&&(e=t.apply(e,arguments)),Xt(this,e)}}));var Jt=Kt({__proto__:null,VERSION:e,restArguments:_,isObject:x,isNull:function(e){return null===e},isUndefined:C,isBoolean:k,isElement:function(e){return!(!e||1!==e.nodeType)},isString:T,isNumber:E,isDate:O,isRegExp:A,isError:M,isSymbol:B,isArrayBuffer:P,isDataView:z,isArray:H,isFunction:N,isArguments:U,isFinite:function(e){return!B(e)&&v(e)&&!isNaN(parseFloat(e))},isNaN:$,isTypedArray:J,isEmpty:function(e){if(null==e)return!0;var t=Q(e);return"number"==typeof t&&(H(e)||T(e)||U(e))?0===t:0===Q(te(e))},isMatch:oe,isEqual:function(e,t){return se(e,t)},isMap:ge,isWeakMap:fe,isSet:ve,isWeakSet:be,keys:te,allKeys:ae,values:ye,pairs:function(e){for(var t=te(e),o=t.length,n=Array(o),r=0;r<o;r++)n[r]=[t[r],e[t[r]]];return n},invert:we,functions:_e,methods:_e,extend:Ce,extendOwn:ke,assign:ke,defaults:Se,create:function(e,t){var o=Te(e);return t&&ke(o,t),o},clone:function(e){return x(e)?H(e)?e.slice():Ce({},e):e},tap:function(e,t){return t(e),e},get:Me,has:function(e,t){for(var o=(t=Oe(t)).length,n=0;n<o;n++){var r=t[n];if(!Z(e,r))return!1;e=e[r]}return!!o},mapObject:function(e,t,o){t=Fe(t,o);for(var n=te(e),r=n.length,i={},s=0;s<r;s++){var a=n[s];i[a]=t(e[a],a,e)}return i},identity:Be,constant:W,noop:Ie,toPath:Ee,property:Re,propertyOf:function(e){return null==e?Ie:function(t){return Me(e,t)}},matcher:Pe,matches:Pe,times:function(e,t,o){var n=Array(Math.max(0,e));t=Ve(t,o,1);for(var r=0;r<e;r++)n[r]=t(r);return n},random:Le,now:ze,escape:je,unescape:Ue,templateSettings:$e,template:function(e,t,o){!t&&o&&(t=o),t=Se({},t,ne.templateSettings);var n=RegExp([(t.escape||We).source,(t.interpolate||We).source,(t.evaluate||We).source].join("|")+"|$","g"),r=0,i="__p+='";e.replace(n,(function(t,o,n,s,a){return i+=e.slice(r,a).replace(Ge,Ye),r=a+t.length,o?i+="'+\n((__t=("+o+"))==null?'':_.escape(__t))+\n'":n?i+="'+\n((__t=("+n+"))==null?'':__t)+\n'":s&&(i+="';\n"+s+"\n__p+='"),t})),i+="';\n";var s,a=t.variable;if(a){if(!Xe.test(a))throw new Error("variable is not a bare identifier: "+a)}else i="with(obj||{}){\n"+i+"}\n",a="obj";i="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{s=new Function(a,"_",i)}catch(e){throw e.source=i,e}var l=function(e){return s.call(this,e,ne)};return l.source="function("+a+"){\n"+i+"}",l},result:function(e,t,o){var n=(t=Oe(t)).length;if(!n)return N(o)?o.call(e):o;for(var r=0;r<n;r++){var i=null==e?void 0:e[t[r]];void 0===i&&(i=o,r=n),e=N(i)?i.call(e):i}return e},uniqueId:function(e){var t=++Ke+"";return e?e+t:t},chain:function(e){var t=ne(e);return t._chain=!0,t},iteratee:De,partial:Qe,bind:et,bindAll:nt,memoize:function(e,t){var o=function(n){var r=o.cache,i=""+(t?t.apply(this,arguments):n);return Z(r,i)||(r[i]=e.apply(this,arguments)),r[i]};return o.cache={},o},delay:rt,defer:it,throttle:function(e,t,o){var n,r,i,s,a=0;o||(o={});var l=function(){a=!1===o.leading?0:ze(),n=null,s=e.apply(r,i),n||(r=i=null)},c=function(){var c=ze();a||!1!==o.leading||(a=c);var d=t-(c-a);return r=this,i=arguments,d<=0||d>t?(n&&(clearTimeout(n),n=null),a=c,s=e.apply(r,i),n||(r=i=null)):n||!1===o.trailing||(n=setTimeout(l,d)),s};return c.cancel=function(){clearTimeout(n),a=0,n=r=i=null},c},debounce:function(e,t,o){var n,r,i,s,a,l=function(){var c=ze()-r;t>c?n=setTimeout(l,t-c):(n=null,o||(s=e.apply(a,i)),n||(i=a=null))},c=_((function(c){return a=this,i=c,r=ze(),n||(n=setTimeout(l,t),o&&(s=e.apply(a,i))),s}));return c.cancel=function(){clearTimeout(n),n=i=a=null},c},wrap:function(e,t){return Qe(t,e)},negate:st,compose:function(){var e=arguments,t=e.length-1;return function(){for(var o=t,n=e[t].apply(this,arguments);o--;)n=e[o].call(this,n);return n}},after:function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},before:at,once:lt,findKey:ct,findIndex:ut,findLastIndex:ht,sortedIndex:mt,indexOf:gt,lastIndexOf:ft,find:vt,detect:vt,findWhere:function(e,t){return vt(e,Pe(t))},each:bt,forEach:bt,map:yt,collect:yt,reduce:_t,foldl:_t,inject:_t,reduceRight:xt,foldr:xt,filter:Ct,select:Ct,reject:function(e,t,o){return Ct(e,st(Fe(t)),o)},every:kt,all:kt,some:St,any:St,contains:Tt,includes:Tt,include:Tt,invoke:Et,pluck:Ot,where:function(e,t){return Ct(e,Pe(t))},max:At,min:function(e,t,o){var n,r,i=1/0,s=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var a=0,l=(e=tt(e)?e:ye(e)).length;a<l;a++)null!=(n=e[a])&&n<i&&(i=n);else t=Fe(t,o),bt(e,(function(e,o,n){((r=t(e,o,n))<s||r===1/0&&i===1/0)&&(i=e,s=r)}));return i},shuffle:function(e){return Pt(e,1/0)},sample:Pt,sortBy:function(e,t,o){var n=0;return t=Fe(t,o),Ot(yt(e,(function(e,o,r){return{value:e,index:n++,criteria:t(e,o,r)}})).sort((function(e,t){var o=e.criteria,n=t.criteria;if(o!==n){if(o>n||void 0===o)return 1;if(o<n||void 0===n)return-1}return e.index-t.index})),"value")},groupBy:Vt,indexBy:Nt,countBy:Dt,partition:Ft,toArray:Bt,size:function(e){return null==e?0:tt(e)?e.length:te(e).length},pick:Lt,omit:zt,first:Zt,head:Zt,take:Zt,initial:Ht,last:function(e,t,o){return null==e||e.length<1?null==t||o?void 0:[]:null==t||o?e[e.length-1]:jt(e,Math.max(0,e.length-t))},rest:jt,tail:jt,drop:jt,compact:function(e){return Ct(e,Boolean)},flatten:function(e,t){return ot(e,t,!1)},without:$t,uniq:Wt,unique:Wt,union:qt,intersection:function(e){for(var t=[],o=arguments.length,n=0,r=Q(e);n<r;n++){var i=e[n];if(!Tt(t,i)){var s;for(s=1;s<o&&Tt(arguments[s],i);s++);s===o&&t.push(i)}}return t},difference:Ut,unzip:Gt,transpose:Gt,zip:Yt,object:function(e,t){for(var o={},n=0,r=Q(e);n<r;n++)t?o[e[n]]=t[n]:o[e[n][0]]=e[n][1];return o},range:function(e,t,o){null==t&&(t=e||0,e=0),o||(o=t<e?-1:1);for(var n=Math.max(Math.ceil((t-e)/o),0),r=Array(n),i=0;i<n;i++,e+=o)r[i]=e;return r},chunk:function(e,t){if(null==t||t<1)return[];for(var o=[],n=0,r=e.length;n<r;)o.push(a.call(e,n,n+=t));return o},mixin:Kt,default:ne});return Jt._=Jt,Jt}()}},e=>{e.O(0,[351],(()=>(90858,e(e.s=90858)))),e.O()}]);

Youez - 2016 - github.com/yon3zu
LinuXploit