diff --git a/.gitmodules b/.gitmodules index d1e8320f..b4064182 100644 --- a/.gitmodules +++ b/.gitmodules @@ -46,6 +46,3 @@ [submodule "example/tools/warning"] path = example/tools/warning url = https://github.com/editor-js/warning -[submodule "src/components/external/codex.tooltips"] - path = src/components/external/codex.tooltips - url = https://github.com/codex-team/codex.tooltips diff --git a/dist/editor.js b/dist/editor.js index 9c6feec1..58cbc1e2 100644 --- a/dist/editor.js +++ b/dist/editor.js @@ -9,7 +9,7 @@ * @uses html-janitor * @licence Apache-2.0 (https://github.com/guardian/html-janitor/blob/master/LICENSE) */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.EditorJS=e():t.EditorJS=e()}(window,(function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=171)}([function(t,e,n){var o=n(8),i=n(17),r=n(24),a=n(21),s=n(29),l=function(t,e,n){var c,u,f,d,p=t&l.F,h=t&l.G,v=t&l.S,g=t&l.P,y=t&l.B,b=h?o:v?o[e]||(o[e]={}):(o[e]||{}).prototype,m=h?i:i[e]||(i[e]={}),k=m.prototype||(m.prototype={});for(c in h&&(n=e),n)f=((u=!p&&b&&void 0!==b[c])?b:n)[c],d=y&&u?s(f,o):g&&"function"==typeof f?s(Function.call,f):f,b&&a(b,c,f,t&l.U),m[c]!=f&&r(m,c,d),g&&k[c]!=f&&(k[c]=f)};o.core=i,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,t.exports=l},function(t,e){t.exports=function(t){return t&&t.__esModule?t:{default:t}}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=document.createElement(t);for(var a in Array.isArray(n)?(e=i.classList).add.apply(e,(0,r.default)(n)):n&&i.classList.add(n),o)o.hasOwnProperty(a)&&(i[a]=o[a]);return i}},{key:"text",value:function(t){return document.createTextNode(t)}},{key:"svg",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:14,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:14,o=document.createElementNS("http://www.w3.org/2000/svg","svg");return o.classList.add("icon","icon--"+t),o.setAttribute("width",e+"px"),o.setAttribute("height",n+"px"),o.innerHTML=''),o}},{key:"append",value:function(t,e){Array.isArray(e)?e.forEach((function(e){return t.appendChild(e)})):t.appendChild(e)}},{key:"prepend",value:function(t,e){Array.isArray(e)?(e=e.reverse()).forEach((function(e){return t.prepend(e)})):t.prepend(e)}},{key:"swap",value:function(t,e){var n=document.createElement("div"),o=t.parentNode;o.insertBefore(n,t),o.insertBefore(t,e),o.insertBefore(e,n),o.removeChild(n)}},{key:"find",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=arguments.length>1?arguments[1]:void 0;return t.querySelector(e)}},{key:"get",value:function(t){return document.getElementById(t)}},{key:"findAll",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=arguments.length>1?arguments[1]:void 0;return t.querySelectorAll(e)}},{key:"getDeepestNode",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=n?"lastChild":"firstChild",i=n?"previousSibling":"nextSibling";if(e&&e.nodeType===Node.ELEMENT_NODE&&e[o]){var r=e[o];if(t.isSingleTag(r)&&!t.isNativeInput(r)&&!t.isLineBreakTag(r))if(r[i])r=r[i];else{if(!r.parentNode[i])return r.parentNode;r=r.parentNode[i]}return this.getDeepestNode(r,n)}return e}},{key:"isElement",value:function(t){return t&&"object"===(0,i.default)(t)&&t.nodeType&&t.nodeType===Node.ELEMENT_NODE}},{key:"isFragment",value:function(t){return t&&"object"===(0,i.default)(t)&&t.nodeType&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE}},{key:"isContentEditable",value:function(t){return"true"===t.contentEditable}},{key:"isNativeInput",value:function(t){return!(!t||!t.tagName)&&["INPUT","TEXTAREA"].includes(t.tagName)}},{key:"canSetCaret",value:function(e){var n=!0;if(t.isNativeInput(e))switch(e.type){case"file":case"checkbox":case"radio":case"hidden":case"submit":case"button":case"image":case"reset":n=!1}else n=t.isContentEditable(e);return n}},{key:"isNodeEmpty",value:function(t){return!(this.isSingleTag(t)&&!this.isLineBreakTag(t))&&0===(this.isElement(t)&&this.isNativeInput(t)?t.value:t.textContent.replace("​","")).trim().length}},{key:"isLeaf",value:function(t){return!!t&&0===t.childNodes.length}},{key:"isEmpty",value:function(t){var e=this,n=[],o=[];if(!t)return!0;if(!t.childNodes.length)return this.isNodeEmpty(t);for(t.normalize(),n.push(t.firstChild);n.length>0;)if(t=n.shift()){for(this.isLeaf(t)?o.push(t):n.push(t.firstChild);t&&t.nextSibling;)(t=t.nextSibling)&&n.push(t);if(t&&!this.isNodeEmpty(t))return!1}return o.every((function(t){return e.isNodeEmpty(t)}))}},{key:"isHTMLString",value:function(e){var n=t.make("div");return n.innerHTML=e,n.childElementCount>0}},{key:"getContentLength",value:function(e){return t.isNativeInput(e)?e.value.length:e.nodeType===Node.TEXT_NODE?e.length:e.textContent.length}},{key:"containsOnlyInlineElements",value:function(e){var n;return"string"==typeof e?(n=document.createElement("div")).innerHTML=e:n=e,Array.from(n.children).every((function e(n){return!t.blockElements.includes(n.tagName.toLowerCase())&&Array.from(n.children).every(e)}))}},{key:"getDeepestBlockElements",value:function(e){return t.containsOnlyInlineElements(e)?[e]:Array.from(e.children).reduce((function(e,n){return[].concat((0,r.default)(e),(0,r.default)(t.getDeepestBlockElements(n)))}),[])}},{key:"getHolder",value:function(t){return"string"==typeof t?document.getElementById(t):t}},{key:"isExtensionNode",value:function(t){return t&&["GRAMMARLY-EXTENSION"].includes(t.nodeName)}},{key:"blockElements",get:function(){return["address","article","aside","blockquote","canvas","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","nav","noscript","ol","output","p","pre","ruby","section","table","tr","tfoot","ul","video"]}}]),t}();o.default=c,c.displayName="Dom",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(355),n(27),n(13)],void 0===(r="function"==typeof(o=function(t,e,o,i){"use strict";var r,a=n(1);function s(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"log",o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"color: inherit";if("console"in window&&window.console[n]){var a=["info","log","warn","error"].includes(n),l=[];switch(s.logLevel){case r.ERROR:if("error"!==n)return;break;case r.WARN:if(!["error","warn"].includes(n))return;break;case r.INFO:if(!a||t)return}o&&l.push(o);var c="Editor.js ".concat("2.16.1");t&&(a?(l.unshift("line-height: 1em;\n color: #006FEA;\n display: inline-block;\n font-size: 11px;\n line-height: 1em;\n background-color: #fff;\n padding: 4px 9px;\n border-radius: 30px;\n border: 1px solid rgba(56, 138, 229, 0.16);\n margin: 4px 5px 4px 0;",i),e="%c".concat(c,"%c ").concat(e)):e="( ".concat(c," )").concat(e));try{if(a)if(o){var u;(u=console)[n].apply(u,["".concat(e," %o")].concat(l))}else{var f;(f=console)[n].apply(f,[e].concat(l))}else console[n](e)}catch(t){}}}Object.defineProperty(t,"__esModule",{value:!0}),t.setLogLevel=function(t){s.logLevel=t},t.isPrintableKey=function(t){return t>47&&t<58||32===t||13===t||t>64&&t<91||t>95&&t<112||t>185&&t<193||t>218&&t<223},t.sequence=function(t){var e,n,i,r=arguments;return o.default.async((function(a){for(;;)switch(a.prev=a.next){case 0:return i=function(t,e,n){return o.default.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,o.default.awrap(t.function(t.data));case 3:return i.next=5,o.default.awrap(e(void 0!==t.data?t.data:{}));case 5:i.next=10;break;case 7:i.prev=7,i.t0=i.catch(0),n(void 0!==t.data?t.data:{});case 10:case"end":return i.stop()}}),null,null,[[0,7]])},e=r.length>1&&void 0!==r[1]?r[1]:function(){},n=r.length>2&&void 0!==r[2]?r[2]:function(){},a.next=5,o.default.awrap(t.reduce((function(t,r){return o.default.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,o.default.awrap(t);case 2:return a.abrupt("return",i(r,e,n));case 3:case"end":return a.stop()}}))}),Promise.resolve()));case 5:return a.abrupt("return",a.sent);case 6:case"end":return a.stop()}}))},t.array=function(t){return Array.prototype.slice.call(t)},t.isFunction=function(t){return"function"==typeof t},t.isClass=function(t){return"function"==typeof t&&/^\s*class\s+/.test(t.toString())},t.isEmpty=function(t){return!t||0===Object.keys(t).length&&t.constructor===Object},t.isPromise=function(t){return Promise.resolve(t)===t},t.delay=function(t,e){return function(){var n=this,o=arguments;window.setTimeout((function(){return t.apply(n,o)}),e)}},t.getFileExtension=function(t){return t.name.split(".").pop()},t.isValidMimeType=function(t){return/^[-\w]+\/([-+\w]+|\*)$/.test(t)},t.debounce=function(t,e,n){var o,i=arguments,r=this;return function(){var a=r,s=i,l=n&&!o;window.clearTimeout(o),o=window.setTimeout((function(){o=null,n||t.apply(a,s)}),e),l&&t.apply(a,s)}},t.copyTextToClipboard=function(t){var e=i.default.make("div","codex-editor-clipboard",{innerHTML:t});document.body.appendChild(e);var n=window.getSelection(),o=document.createRange();o.selectNode(e),window.getSelection().removeAllRanges(),n.addRange(o),document.execCommand("copy"),document.body.removeChild(e)},t.getUserOS=u,t.capitalize=function(t){return t[0].toUpperCase()+t.slice(1)},t.deepMerge=function t(n){for(var o=function(t){return t&&"object"===d(t)},i=arguments.length,r=new Array(i>1?i-1:0),a=1;a0?i(o(t),9007199254740991):0}},function(t,e){var n=t.exports={version:"2.6.10"};"number"==typeof __e&&(__e=n)},function(t,e,n){t.exports=!n(9)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e,n){var o=n(10),i=n(104),r=n(38),a=Object.defineProperty;e.f=n(18)?Object.defineProperty:function(t,e,n){if(o(t),e=r(e,!0),o(n),i)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var o=n(36);t.exports=function(t){return Object(o(t))}},function(t,e,n){var o=n(8),i=n(24),r=n(23),a=n(41)("src"),s=n(176),l=(""+s).split("toString");n(17).inspectSource=function(t){return s.call(t)},(t.exports=function(t,e,n,s){var c="function"==typeof n;c&&(r(n,"name")||i(n,"name",e)),t[e]!==n&&(c&&(r(n,a)||i(n,a,t[e]?""+t[e]:l.join(String(e)))),t===o?t[e]=n:s?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[a]||s.call(this)}))},function(t,e,n){var o=n(0),i=n(9),r=n(36),a=/"/g,s=function(t,e,n,o){var i=String(r(t)),s="<"+e;return""!==n&&(s+=" "+n+'="'+String(o).replace(a,""")+'"'),s+">"+i+""};t.exports=function(t,e){var n={};n[t]=e(s),o(o.P+o.F*i((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3})),"String",n)}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var o=n(19),i=n(40);t.exports=n(18)?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var o=n(60),i=n(36);t.exports=function(t){return o(i(t))}},function(t,e,n){"use strict";var o=n(9);t.exports=function(t,e){return!!t&&o((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},function(t,e,n){t.exports=n(135)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(14),n(13)],void 0===(r="function"==typeof(o=function(o,i,r,a,s){"use strict";var l=n(15),c=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=c(i),r=c(r),a=l(a),s=c(s);var u=function(){function t(){(0,i.default)(this,t),this.instance=null,this.selection=null,this.savedSelectionRange=null,this.isFakeBackgroundEnabled=!1,this.commandBackground="backColor",this.commandRemoveFormat="removeFormat"}return(0,r.default)(t,[{key:"removeFakeBackground",value:function(){this.isFakeBackgroundEnabled&&(this.isFakeBackgroundEnabled=!1,document.execCommand(this.commandRemoveFormat))}},{key:"setFakeBackground",value:function(){document.execCommand(this.commandBackground,!1,"#a8d6ff"),this.isFakeBackgroundEnabled=!0}},{key:"save",value:function(){this.savedSelectionRange=t.range}},{key:"restore",value:function(){if(this.savedSelectionRange){var t=window.getSelection();t.removeAllRanges(),t.addRange(this.savedSelectionRange)}}},{key:"clearSaved",value:function(){this.savedSelectionRange=null}},{key:"collapseToEnd",value:function(){var t=window.getSelection(),e=document.createRange();e.selectNodeContents(t.focusNode),e.collapse(!1),t.removeAllRanges(),t.addRange(e)}},{key:"findParentTag",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,o=window.getSelection(),i=null;if(!o||!o.anchorNode||!o.focusNode)return null;var r=[o.anchorNode,o.focusNode];return r.forEach((function(o){for(var r=n;r>0&&o.parentNode&&(o.tagName!==t||(i=o,e&&o.classList&&!o.classList.contains(e)&&(i=null),!i));)o=o.parentNode,r--})),i}},{key:"expandToTag",value:function(t){var e=window.getSelection();e.removeAllRanges();var n=document.createRange();n.selectNodeContents(t),e.addRange(n)}}],[{key:"get",value:function(){return window.getSelection()}},{key:"CSS",get:function(){return{editorWrapper:"codex-editor",editorZone:"codex-editor__redactor"}}},{key:"anchorNode",get:function(){var t=window.getSelection();return t?t.anchorNode:null}},{key:"anchorElement",get:function(){var t=window.getSelection();if(!t)return null;var e=t.anchorNode;return e?s.default.isElement(e)?e:e.parentElement:null}},{key:"anchorOffset",get:function(){var t=window.getSelection();return t?t.anchorOffset:null}},{key:"isCollapsed",get:function(){var t=window.getSelection();return t?t.isCollapsed:null}},{key:"isAtEditor",get:function(){var e=t.get(),n=e.anchorNode||e.focusNode;n&&n.nodeType===Node.TEXT_NODE&&(n=n.parentNode);var o=null;return n&&(o=n.closest(".".concat(t.CSS.editorZone))),o&&o.nodeType===Node.ELEMENT_NODE}},{key:"range",get:function(){var t=window.getSelection();return t&&t.rangeCount?t.getRangeAt(0):null}},{key:"rect",get:function(){var t,e=document.selection,n={x:0,y:0,width:0,height:0};if(e&&"Control"!==e.type)return t=(e=e).createRange(),n.x=t.boundingLeft,n.y=t.boundingTop,n.width=t.boundingWidth,n.height=t.boundingHeight,n;if(!window.getSelection)return a.log("Method window.getSelection is not supported","warn"),n;if(null===(e=window.getSelection()).rangeCount||isNaN(e.rangeCount))return a.log("Method SelectionUtils.rangeCount is not supported","warn"),n;if(0===e.rangeCount)return n;if((t=e.getRangeAt(0).cloneRange()).getBoundingClientRect&&(n=t.getBoundingClientRect()),0===n.x&&0===n.y){var o=document.createElement("span");if(o.getBoundingClientRect){o.appendChild(document.createTextNode("​")),t.insertNode(o),n=o.getBoundingClientRect();var i=o.parentNode;i.removeChild(o),i.normalize()}}return n}},{key:"text",get:function(){return window.getSelection?window.getSelection().toString():""}}]),t}();o.default=u,u.displayName="SelectionUtils",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o=n(30);t.exports=function(t,e,n){if(o(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,o){return t.call(e,n,o)};case 3:return function(n,o,i){return t.call(e,n,o,i)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){var n=Math.ceil,o=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?o:n)(t)}},function(t,e,n){var o=n(61),i=n(40),r=n(25),a=n(38),s=n(23),l=n(104),c=Object.getOwnPropertyDescriptor;e.f=n(18)?c:function(t,e){if(t=r(t),e=a(e,!0),l)try{return c(t,e)}catch(t){}if(s(t,e))return i(!o.f.call(t,e),t[e])}},function(t,e,n){var o=n(0),i=n(17),r=n(9);t.exports=function(t,e){var n=(i.Object||{})[t]||Object[t],a={};a[t]=e(n),o(o.S+o.F*r((function(){n(1)})),"Object",a)}},function(t,e,n){var o=n(29),i=n(60),r=n(20),a=n(16),s=n(120);t.exports=function(t,e){var n=1==t,l=2==t,c=3==t,u=4==t,f=6==t,d=5==t||f,p=e||s;return function(e,s,h){for(var v,g,y=r(e),b=i(y),m=o(s,h,3),k=a(b.length),x=0,w=n?p(e,k):l?p(e,0):void 0;k>x;x++)if((d||x in b)&&(g=m(v=b[x],x,y),t))if(n)w[x]=g;else if(g)switch(t){case 3:return!0;case 5:return v;case 6:return x;case 2:w.push(v)}else if(u)return!1;return f?-1:c||u?u:w}}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){"use strict";if(n(18)){var o=n(42),i=n(8),r=n(9),a=n(0),s=n(75),l=n(102),c=n(29),u=n(56),f=n(40),d=n(24),p=n(57),h=n(31),v=n(16),g=n(131),y=n(44),b=n(38),m=n(23),k=n(62),x=n(11),w=n(20),S=n(94),E=n(45),T=n(47),C=n(46).f,B=n(96),_=n(41),I=n(12),O=n(34),N=n(65),L=n(63),M=n(98),A=n(54),P=n(68),R=n(55),j=n(97),F=n(122),D=n(19),U=n(32),H=D.f,z=U.f,G=i.RangeError,W=i.TypeError,X=i.Uint8Array,V=Array.prototype,Y=l.ArrayBuffer,K=l.DataView,Z=O(0),q=O(2),$=O(3),J=O(4),Q=O(5),tt=O(6),et=N(!0),nt=N(!1),ot=M.values,it=M.keys,rt=M.entries,at=V.lastIndexOf,st=V.reduce,lt=V.reduceRight,ct=V.join,ut=V.sort,ft=V.slice,dt=V.toString,pt=V.toLocaleString,ht=I("iterator"),vt=I("toStringTag"),gt=_("typed_constructor"),yt=_("def_constructor"),bt=s.CONSTR,mt=s.TYPED,kt=s.VIEW,xt=O(1,(function(t,e){return Ct(L(t,t[yt]),e)})),wt=r((function(){return 1===new X(new Uint16Array([1]).buffer)[0]})),St=!!X&&!!X.prototype.set&&r((function(){new X(1).set({})})),Et=function(t,e){var n=h(t);if(n<0||n%e)throw G("Wrong offset!");return n},Tt=function(t){if(x(t)&&mt in t)return t;throw W(t+" is not a typed array!")},Ct=function(t,e){if(!(x(t)&> in t))throw W("It is not a typed array constructor!");return new t(e)},Bt=function(t,e){return _t(L(t,t[yt]),e)},_t=function(t,e){for(var n=0,o=e.length,i=Ct(t,o);o>n;)i[n]=e[n++];return i},It=function(t,e,n){H(t,e,{get:function(){return this._d[n]}})},Ot=function(t){var e,n,o,i,r,a,s=w(t),l=arguments.length,u=l>1?arguments[1]:void 0,f=void 0!==u,d=B(s);if(null!=d&&!S(d)){for(a=d.call(s),o=[],e=0;!(r=a.next()).done;e++)o.push(r.value);s=o}for(f&&l>2&&(u=c(u,arguments[2],2)),e=0,n=v(s.length),i=Ct(this,n);n>e;e++)i[e]=f?u(s[e],e):s[e];return i},Nt=function(){for(var t=0,e=arguments.length,n=Ct(this,e);e>t;)n[t]=arguments[t++];return n},Lt=!!X&&r((function(){pt.call(new X(1))})),Mt=function(){return pt.apply(Lt?ft.call(Tt(this)):Tt(this),arguments)},At={copyWithin:function(t,e){return F.call(Tt(this),t,e,arguments.length>2?arguments[2]:void 0)},every:function(t){return J(Tt(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return j.apply(Tt(this),arguments)},filter:function(t){return Bt(this,q(Tt(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return Q(Tt(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return tt(Tt(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){Z(Tt(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return nt(Tt(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return et(Tt(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return ct.apply(Tt(this),arguments)},lastIndexOf:function(t){return at.apply(Tt(this),arguments)},map:function(t){return xt(Tt(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return st.apply(Tt(this),arguments)},reduceRight:function(t){return lt.apply(Tt(this),arguments)},reverse:function(){for(var t,e=Tt(this).length,n=Math.floor(e/2),o=0;o1?arguments[1]:void 0)},sort:function(t){return ut.call(Tt(this),t)},subarray:function(t,e){var n=Tt(this),o=n.length,i=y(t,o);return new(L(n,n[yt]))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,v((void 0===e?o:y(e,o))-i))}},Pt=function(t,e){return Bt(this,ft.call(Tt(this),t,e))},Rt=function(t){Tt(this);var e=Et(arguments[1],1),n=this.length,o=w(t),i=v(o.length),r=0;if(i+e>n)throw G("Wrong length!");for(;r255?255:255&o),i.v[p](n*e+i.o,o,wt)}(this,n,t)},enumerable:!0})};m?(h=n((function(t,n,o,i){u(t,h,c,"_d");var r,a,s,l,f=0,p=0;if(x(n)){if(!(n instanceof Y||"ArrayBuffer"==(l=k(n))||"SharedArrayBuffer"==l))return mt in n?_t(h,n):Ot.call(h,n);r=n,p=Et(o,e);var y=n.byteLength;if(void 0===i){if(y%e)throw G("Wrong length!");if((a=y-p)<0)throw G("Wrong length!")}else if((a=v(i)*e)+p>y)throw G("Wrong length!");s=a/e}else s=g(n),r=new Y(a=s*e);for(d(t,"_d",{b:r,o:p,l:a,e:s,v:new K(r)});fdocument.F=Object<\/script>"),t.close(),l=t.F;o--;)delete l.prototype[r[o]];return l()};t.exports=Object.create||function(t,e){var n;return null!==t?(s.prototype=o(t),n=new s,s.prototype=null,n[a]=t):n=l(),void 0===e?n:i(n,e)}},function(t,e,n){var o=n(106),i=n(81).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return o(t,i)}},function(t,e,n){var o=n(23),i=n(20),r=n(80)("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),o(t,r)?t[r]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},function(t,e,n){var o=n(12)("unscopables"),i=Array.prototype;null==i[o]&&n(24)(i,o,{}),t.exports=function(t){i[o][t]=!0}},function(t,e,n){var o=n(11);t.exports=function(t,e){if(!o(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},function(t,e,n){var o=n(345),i=n(346),r=n(347);t.exports=function(t,e){return o(t)||i(t,e)||r()}},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(e){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?t.exports=o=function(t){return n(t)}:t.exports=o=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},o(e)}t.exports=o},function(t,e,n){var o=n(19).f,i=n(23),r=n(12)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,r)&&o(t,r,{configurable:!0,value:e})}},function(t,e,n){var o=n(0),i=n(36),r=n(9),a=n(84),s="["+a+"]",l=RegExp("^"+s+s+"*"),c=RegExp(s+s+"*$"),u=function(t,e,n){var i={},s=r((function(){return!!a[t]()||"​…"!="​…"[t]()})),l=i[t]=s?e(f):a[t];n&&(i[n]=l),o(o.P+o.F*s,"String",i)},f=u.trim=function(t,e){return t=String(i(t)),1&e&&(t=t.replace(l,"")),2&e&&(t=t.replace(c,"")),t};t.exports=u},function(t,e){t.exports={}},function(t,e,n){"use strict";var o=n(8),i=n(19),r=n(18),a=n(12)("species");t.exports=function(t){var e=o[t];r&&e&&!e[a]&&i.f(e,a,{configurable:!0,get:function(){return this}})}},function(t,e){t.exports=function(t,e,n,o){if(!(t instanceof e)||void 0!==o&&o in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){var o=n(21);t.exports=function(t,e,n){for(var i in e)o(t,i,e[i],n);return t}},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(359),n(14)],void 0===(r="function"==typeof(o=function(o,i,r,a,s){"use strict";var l=n(15),c=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=c(i),r=c(r),a=c(a),s=l(s);var u=function(){function t(e){var n=this;(0,i.default)(this,t),this.iterator=null,this.activated=!1,this.allowArrows=!0,this.allowArrows="boolean"!=typeof e.allowArrows||e.allowArrows,this.iterator=new a.default(e.items,e.focusedItemClass),this.activateCallback=e.activateCallback,document.addEventListener("keydown",(function(e){if(n.isEventReadyForHandling(e))switch(t.usedKeys.includes(e.keyCode)&&e.preventDefault(),e.keyCode){case s.keyCodes.TAB:n.handleTabPress(e);break;case s.keyCodes.LEFT:case s.keyCodes.UP:n.flipLeft();break;case s.keyCodes.RIGHT:case s.keyCodes.DOWN:n.flipRight();break;case s.keyCodes.ENTER:n.handleEnterPress(e)}}),!1)}return(0,r.default)(t,[{key:"activate",value:function(t){this.activated=!0,t&&this.iterator.setItems(t)}},{key:"deactivate",value:function(){this.activated=!1,this.dropCursor()}},{key:"focusFirst",value:function(){this.dropCursor(),this.flipRight()}},{key:"dropCursor",value:function(){this.iterator.dropCursor()}},{key:"isEventReadyForHandling",value:function(t){var e=[s.keyCodes.TAB,s.keyCodes.ENTER];return this.allowArrows&&e.push(s.keyCodes.LEFT,s.keyCodes.RIGHT,s.keyCodes.UP,s.keyCodes.DOWN),!(!this.activated||-1===e.indexOf(t.keyCode))}},{key:"handleTabPress",value:function(t){switch(t.shiftKey?a.default.directions.LEFT:a.default.directions.RIGHT){case a.default.directions.RIGHT:this.flipRight();break;case a.default.directions.LEFT:this.flipLeft()}}},{key:"flipLeft",value:function(){this.iterator.previous()}},{key:"flipRight",value:function(){this.iterator.next()}},{key:"handleEnterPress",value:function(t){this.activated&&(this.iterator.currentItem&&this.iterator.currentItem.click(),"function"==typeof this.activateCallback&&this.activateCallback(),t.preventDefault(),t.stopPropagation())}},{key:"currentItem",get:function(){return this.iterator.currentItem}}],[{key:"usedKeys",get:function(){return[s.keyCodes.TAB,s.keyCodes.LEFT,s.keyCodes.RIGHT,s.keyCodes.ENTER,s.keyCodes.UP,s.keyCodes.DOWN]}}]),t}();o.default=u,u.displayName="Flipper",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(103),n(27),n(2),n(3),n(13),n(14),n(360),n(361),n(362),n(28)],void 0===(r="function"==typeof(o=function(t,e,o,i,r,a,s,l,c,u,f){"use strict";var d,p=n(15),h=n(1);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.BlockToolAPI=void 0,e=h(e),o=h(o),i=h(i),r=h(r),a=h(a),s=p(s),l=h(l),c=h(c),u=h(u),f=h(f),t.BlockToolAPI=d,function(t){t.APPEND_CALLBACK="appendCallback",t.RENDERED="rendered",t.UPDATED="updated",t.REMOVED="removed",t.ON_PASTE="onPaste"}(d||(t.BlockToolAPI=d={}));var v=function(){function t(e,n,o,r,a){var l=this;(0,i.default)(this,t),this.cachedInputs=[],this.inputIndex=0,this.modificationDebounceTimer=450,this.didMutated=s.debounce((function(){l.cachedInputs=[],l.updateCurrentInput(),l.call(d.UPDATED)}),this.modificationDebounceTimer),this.name=e,this.tool=n,this.class=o,this.settings=r,this.api=a,this.holder=this.compose(),this.mutationObserver=new MutationObserver(this.didMutated),this.tunes=this.makeTunes()}return(0,r.default)(t,[{key:"call",value:function(t,e){if(this.tool[t]&&this.tool[t]instanceof Function)try{this.tool[t].call(this.tool,e)}catch(e){s.log("Error during '".concat(t,"' call: ").concat(e.message),"error")}}},{key:"mergeWith",value:function(t){return o.default.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.default.awrap(this.tool.merge(t));case 2:case"end":return e.stop()}}),null,this)}},{key:"save",value:function(){var t,e,n,i=this;return o.default.async((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,o.default.awrap(this.tool.save(this.pluginsContent));case 2:return t=r.sent,e=window.performance.now(),r.abrupt("return",Promise.resolve(t).then((function(t){return n=window.performance.now(),{tool:i.name,data:t,time:n-e}})).catch((function(t){s.log("Saving proccess for ".concat(i.name," tool failed due to the ").concat(t),"log","red")})));case 5:case"end":return r.stop()}}),null,this)}},{key:"validate",value:function(t){var e;return o.default.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(e=!0,!(this.tool.validate instanceof Function)){n.next=5;break}return n.next=4,o.default.awrap(this.tool.validate(t));case 4:e=n.sent;case 5:return n.abrupt("return",e);case 6:case"end":return n.stop()}}),null,this)}},{key:"makeTunes",value:function(){var t=this;return[l.default,c.default,u.default].map((function(e){return new e({api:t.api,settings:t.settings})}))}},{key:"renderTunes",value:function(){var t=document.createDocumentFragment();return this.tunes.forEach((function(e){a.default.append(t,e.render())})),t}},{key:"updateCurrentInput",value:function(){this.currentInput=f.default.anchorNode}},{key:"willSelect",value:function(){this.mutationObserver.observe(this.holder.firstElementChild,{childList:!0,subtree:!0,characterData:!0,attributes:!0})}},{key:"willUnselect",value:function(){this.mutationObserver.disconnect()}},{key:"compose",value:function(){var e=a.default.make("div",t.CSS.wrapper),n=a.default.make("div",t.CSS.content),o=this.tool.render();return n.appendChild(o),e.appendChild(n),e}},{key:"inputs",get:function(){if(0!==this.cachedInputs.length)return this.cachedInputs;var t=this.holder,n="[contenteditable], textarea, input:not([type]), "+["text","password","email","number","search","tel","url"].map((function(t){return'input[type="'.concat(t,'"]')})).join(", "),o=s.array(t.querySelectorAll(n));return o=o.reduce((function(t,n){return a.default.isNativeInput(n)||a.default.containsOnlyInlineElements(n)?[].concat((0,e.default)(t),[n]):[].concat((0,e.default)(t),(0,e.default)(a.default.getDeepestBlockElements(n)))}),[]),this.inputIndex>o.length-1&&(this.inputIndex=o.length-1),this.cachedInputs=o,o}},{key:"currentInput",get:function(){return this.inputs[this.inputIndex]},set:function(t){var e=this.inputs.findIndex((function(e){return e===t||e.contains(t)}));-1!==e&&(this.inputIndex=e)}},{key:"firstInput",get:function(){return this.inputs[0]}},{key:"lastInput",get:function(){var t=this.inputs;return t[t.length-1]}},{key:"nextInput",get:function(){return this.inputs[this.inputIndex+1]}},{key:"previousInput",get:function(){return this.inputs[this.inputIndex-1]}},{key:"pluginsContent",get:function(){var e=this.holder.querySelector(".".concat(t.CSS.content));if(e&&e.childNodes.length)for(var n=e.childNodes.length-1;n>=0;n--){var o=e.childNodes[n];if(!a.default.isExtensionNode(o))return o}return null}},{key:"data",get:function(){return this.save().then((function(t){return t&&!s.isEmpty(t.data)?t.data:{}}))}},{key:"sanitize",get:function(){return this.tool.sanitize}},{key:"mergeable",get:function(){return"function"==typeof this.tool.merge}},{key:"isEmpty",get:function(){var t=a.default.isEmpty(this.pluginsContent),e=!this.hasMedia;return t&&e}},{key:"hasMedia",get:function(){return!!this.holder.querySelector(["img","iframe","video","audio","source","input","textarea","twitterwidget"].join(","))}},{key:"focused",set:function(e){this.holder.classList.toggle(t.CSS.focused,e)}},{key:"selected",set:function(e){e?this.holder.classList.add(t.CSS.selected):this.holder.classList.remove(t.CSS.selected)},get:function(){return this.holder.classList.contains(t.CSS.selected)}},{key:"stretched",set:function(e){this.holder.classList.toggle(t.CSS.wrapperStretched,e)}},{key:"dropTarget",set:function(e){this.holder.classList.toggle(t.CSS.dropTarget,e)}}],[{key:"CSS",get:function(){return{wrapper:"ce-block",wrapperStretched:"ce-block--stretched",content:"ce-block__content",focused:"ce-block--focused",selected:"ce-block--selected",dropTarget:"ce-block--drop-target"}}}]),t}();t.default=v,v.displayName="Block"})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o=n(35);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==o(t)?t.split(""):Object(t)}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var o=n(35),i=n(12)("toStringTag"),r="Arguments"==o(function(){return arguments}());t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?n:r?o(e):"Object"==(a=o(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,n){var o=n(10),i=n(30),r=n(12)("species");t.exports=function(t,e){var n,a=o(t).constructor;return void 0===a||null==(n=o(a)[r])?e:i(n)}},function(t,e,n){var o=n(17),i=n(8),r=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(t.exports=function(t,e){return r[t]||(r[t]=void 0!==e?e:{})})("versions",[]).push({version:o.version,mode:n(42)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,e,n){var o=n(25),i=n(16),r=n(44);t.exports=function(t){return function(e,n,a){var s,l=o(e),c=i(l.length),u=r(a,c);if(t&&n!=n){for(;c>u;)if((s=l[u++])!=s)return!0}else for(;c>u;u++)if((t||u in l)&&l[u]===n)return t||u||0;return!t&&-1}}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var o=n(35);t.exports=Array.isArray||function(t){return"Array"==o(t)}},function(t,e,n){var o=n(12)("iterator"),i=!1;try{var r=[7][o]();r.return=function(){i=!0},Array.from(r,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var r=[7],a=r[o]();a.next=function(){return{done:n=!0}},r[o]=function(){return a},t(r)}catch(t){}return n}},function(t,e,n){"use strict";var o=n(10);t.exports=function(){var t=o(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},function(t,e,n){"use strict";var o=n(62),i=RegExp.prototype.exec;t.exports=function(t,e){var n=t.exec;if("function"==typeof n){var r=n.call(t,e);if("object"!=typeof r)throw new TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==o(t))throw new TypeError("RegExp#exec called on incompatible receiver");return i.call(t,e)}},function(t,e,n){"use strict";n(124);var o=n(21),i=n(24),r=n(9),a=n(36),s=n(12),l=n(99),c=s("species"),u=!r((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")})),f=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();t.exports=function(t,e,n){var d=s(t),p=!r((function(){var e={};return e[d]=function(){return 7},7!=""[t](e)})),h=p?!r((function(){var e=!1,n=/a/;return n.exec=function(){return e=!0,null},"split"===t&&(n.constructor={},n.constructor[c]=function(){return n}),n[d](""),!e})):void 0;if(!p||!h||"replace"===t&&!u||"split"===t&&!f){var v=/./[d],g=n(a,d,""[t],(function(t,e,n,o,i){return e.exec===l?p&&!i?{done:!0,value:v.call(e,n,o)}:{done:!0,value:t.call(n,e,o)}:{done:!1}})),y=g[0],b=g[1];o(String.prototype,t,y),i(RegExp.prototype,d,2==e?function(t,e){return b.call(t,this,e)}:function(t){return b.call(t,this)})}}},function(t,e,n){var o=n(29),i=n(119),r=n(94),a=n(10),s=n(16),l=n(96),c={},u={};(e=t.exports=function(t,e,n,f,d){var p,h,v,g,y=d?function(){return t}:l(t),b=o(n,f,e?2:1),m=0;if("function"!=typeof y)throw TypeError(t+" is not iterable!");if(r(y)){for(p=s(t.length);p>m;m++)if((g=e?b(a(h=t[m])[0],h[1]):b(t[m]))===c||g===u)return g}else for(v=y.call(t);!(h=v.next()).done;)if((g=i(v,b,h.value,e))===c||g===u)return g}).BREAK=c,e.RETURN=u},function(t,e,n){var o=n(8).navigator;t.exports=o&&o.userAgent||""},function(t,e,n){"use strict";var o=n(8),i=n(0),r=n(21),a=n(57),s=n(39),l=n(72),c=n(56),u=n(11),f=n(9),d=n(68),p=n(52),h=n(85);t.exports=function(t,e,n,v,g,y){var b=o[t],m=b,k=g?"set":"add",x=m&&m.prototype,w={},S=function(t){var e=x[t];r(x,t,"delete"==t?function(t){return!(y&&!u(t))&&e.call(this,0===t?0:t)}:"has"==t?function(t){return!(y&&!u(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return y&&!u(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,n){return e.call(this,0===t?0:t,n),this})};if("function"==typeof m&&(y||x.forEach&&!f((function(){(new m).entries().next()})))){var E=new m,T=E[k](y?{}:-0,1)!=E,C=f((function(){E.has(1)})),B=d((function(t){new m(t)})),_=!y&&f((function(){for(var t=new m,e=5;e--;)t[k](e,e);return!t.has(-0)}));B||((m=e((function(e,n){c(e,m,t);var o=h(new b,e,m);return null!=n&&l(n,g,o[k],o),o}))).prototype=x,x.constructor=m),(C||_)&&(S("delete"),S("has"),g&&S("get")),(_||T)&&S(k),y&&x.clear&&delete x.clear}else m=v.getConstructor(e,t,g,k),a(m.prototype,n),s.NEED=!0;return p(m,t),w[t]=m,i(i.G+i.W+i.F*(m!=b),w),y||v.setStrong(m,t,g),m}},function(t,e,n){for(var o,i=n(8),r=n(24),a=n(41),s=a("typed_array"),l=a("view"),c=!(!i.ArrayBuffer||!i.DataView),u=c,f=0,d="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");f<9;)(o=i[d[f++]])?(r(o.prototype,s,!0),r(o.prototype,l,!0)):u=!1;t.exports={ABV:c,CONSTR:u,TYPED:s,VIEW:l}},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c){"use strict";var u=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=u(i),r=u(r),a=u(a),s=u(s),l=u(l);var f=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"methods",get:function(){return{blocks:this.Editor.BlocksAPI.methods,caret:this.Editor.CaretAPI.methods,events:this.Editor.EventsAPI.methods,listeners:this.Editor.ListenersAPI.methods,notifier:this.Editor.NotifierAPI.methods,sanitizer:this.Editor.SanitizerAPI.methods,saver:this.Editor.SaverAPI.methods,selection:this.Editor.SelectionAPI.methods,styles:this.Editor.StylesAPI.classes,toolbar:this.Editor.ToolbarAPI.methods,inlineToolbar:this.Editor.InlineToolbarAPI.methods,tooltip:this.Editor.TooltipAPI.methods}}}]),e}((c=u(c)).default);o.default=f,f.displayName="API",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7),n(13),n(14)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u,f){"use strict";var d=n(15),p=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=p(i),r=p(r),a=p(a),s=p(s),l=p(l),c=p(c),u=p(u),f=d(f);var h=function(t){function e(){var t;return(0,i.default)(this,e),(t=(0,a.default)(this,(0,s.default)(e).apply(this,arguments))).nodes={wrapper:null,content:null,actions:null,plusButton:null,blockActionsButtons:null,settingsToggler:null},t}return(0,l.default)(e,t),(0,r.default)(e,[{key:"make",value:function(){var t=this;this.nodes.wrapper=u.default.make("div",this.CSS.toolbar),["content","actions"].forEach((function(e){t.nodes[e]=u.default.make("div",t.CSS[e]),u.default.append(t.nodes.wrapper,t.nodes[e])})),this.nodes.plusButton=u.default.make("div",this.CSS.plusButton),u.default.append(this.nodes.plusButton,u.default.svg("plus",14,14)),u.default.append(this.nodes.content,this.nodes.plusButton),this.Editor.Listeners.on(this.nodes.plusButton,"click",(function(){return t.plusButtonClicked()}),!1);var e=u.default.make("div");e.appendChild(document.createTextNode("Add")),e.appendChild(u.default.make("div",this.CSS.plusButtonShortcut,{textContent:"⇥ Tab"})),this.Editor.Tooltip.onHover(this.nodes.plusButton,e),this.Editor.Toolbox.make(),this.nodes.blockActionsButtons=u.default.make("div",this.CSS.blockActionsButtons),this.nodes.settingsToggler=u.default.make("span",this.CSS.settingsToggler);var n=u.default.svg("dots",18,4);u.default.append(this.nodes.settingsToggler,n),u.default.append(this.nodes.blockActionsButtons,this.nodes.settingsToggler),u.default.append(this.nodes.actions,this.nodes.blockActionsButtons),this.Editor.Tooltip.onHover(this.nodes.settingsToggler,"Click to tune",{placement:"top"}),this.Editor.BlockSettings.make(),u.default.append(this.nodes.actions,this.Editor.BlockSettings.nodes.wrapper),u.default.append(this.Editor.UI.nodes.wrapper,this.nodes.wrapper),this.bindEvents()}},{key:"move",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t&&(this.Editor.Toolbox.close(),this.Editor.BlockSettings.close());var e=this.Editor.BlockManager.currentBlock.holder;if(e){var n=this.Editor.UI.isMobile,o=e.offsetHeight,i=e.offsetTop;if(n)i+=o;else{var r=Math.floor(o/2);this.nodes.plusButton.style.transform="translate3d(0, calc(".concat(r,"px - 50%), 0)"),this.Editor.Toolbox.nodes.toolbox.style.transform="translate3d(0, calc(".concat(r,"px - 50%), 0)")}this.nodes.wrapper.style.transform="translate3D(0, ".concat(Math.floor(i),"px, 0)")}}},{key:"open",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];f.delay((function(){t.move(n),t.nodes.wrapper.classList.add(t.CSS.toolbarOpened),e?t.blockActions.show():t.blockActions.hide()}),50)()}},{key:"close",value:function(){this.nodes.wrapper.classList.remove(this.CSS.toolbarOpened),this.blockActions.hide(),this.Editor.Toolbox.close(),this.Editor.BlockSettings.close()}},{key:"plusButtonClicked",value:function(){this.Editor.Toolbox.toggle()}},{key:"bindEvents",value:function(){var t=this;this.Editor.Listeners.on(this.nodes.settingsToggler,"click",(function(){return t.settingsTogglerClicked()}))}},{key:"settingsTogglerClicked",value:function(){this.Editor.BlockSettings.opened?this.Editor.BlockSettings.close():this.Editor.BlockSettings.open()}},{key:"CSS",get:function(){return{toolbar:"ce-toolbar",content:"ce-toolbar__content",actions:"ce-toolbar__actions",actionsOpened:"ce-toolbar__actions--opened",toolbarOpened:"ce-toolbar--opened",plusButton:"ce-toolbar__plus",plusButtonShortcut:"ce-toolbar__plus-shortcut",plusButtonHidden:"ce-toolbar__plus--hidden",blockActionsButtons:"ce-toolbar__actions-buttons",settingsToggler:"ce-toolbar__settings-btn"}}},{key:"opened",get:function(){return this.nodes.wrapper.classList.contains(this.CSS.toolbarOpened)}},{key:"plusButton",get:function(){var t=this;return{hide:function(){return t.nodes.plusButton.classList.add(t.CSS.plusButtonHidden)},show:function(){t.Editor.Toolbox.isEmpty||t.nodes.plusButton.classList.remove(t.CSS.plusButtonHidden)}}}},{key:"blockActions",get:function(){var t=this;return{hide:function(){t.nodes.actions.classList.remove(t.CSS.actionsOpened)},show:function(){t.nodes.actions.classList.add(t.CSS.actionsOpened)}}}}]),e}(c.default);o.default=h,h.displayName="Toolbar",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o=n(11),i=n(8).document,r=o(i)&&o(i.createElement);t.exports=function(t){return r?i.createElement(t):{}}},function(t,e,n){e.f=n(12)},function(t,e,n){var o=n(64)("keys"),i=n(41);t.exports=function(t){return o[t]||(o[t]=i(t))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var o=n(8).document;t.exports=o&&o.documentElement},function(t,e,n){var o=n(11),i=n(10),r=function(t,e){if(i(t),!o(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,o){try{(o=n(29)(Function.call,n(32).f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return r(t,n),e?t.__proto__=n:o(t,n),t}}({},!1):void 0),check:r}},function(t,e){t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(t,e,n){var o=n(11),i=n(83).set;t.exports=function(t,e,n){var r,a=e.constructor;return a!==n&&"function"==typeof a&&(r=a.prototype)!==n.prototype&&o(r)&&i&&i(t,r),t}},function(t,e,n){"use strict";var o=n(31),i=n(36);t.exports=function(t){var e=String(i(this)),n="",r=o(t);if(r<0||r==1/0)throw RangeError("Count can't be negative");for(;r>0;(r>>>=1)&&(e+=e))1&r&&(n+=e);return n}},function(t,e){t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,e){var n=Math.expm1;t.exports=!n||n(10)>22025.465794806718||n(10)<22025.465794806718||-2e-17!=n(-2e-17)?function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:n},function(t,e,n){var o=n(31),i=n(36);t.exports=function(t){return function(e,n){var r,a,s=String(i(e)),l=o(n),c=s.length;return l<0||l>=c?t?"":void 0:(r=s.charCodeAt(l))<55296||r>56319||l+1===c||(a=s.charCodeAt(l+1))<56320||a>57343?t?s.charAt(l):r:t?s.slice(l,l+2):a-56320+(r-55296<<10)+65536}}},function(t,e,n){"use strict";var o=n(42),i=n(0),r=n(21),a=n(24),s=n(54),l=n(118),c=n(52),u=n(47),f=n(12)("iterator"),d=!([].keys&&"next"in[].keys()),p=function(){return this};t.exports=function(t,e,n,h,v,g,y){l(n,e,h);var b,m,k,x=function(t){if(!d&&t in T)return T[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},w=e+" Iterator",S="values"==v,E=!1,T=t.prototype,C=T[f]||T["@@iterator"]||v&&T[v],B=C||x(v),_=v?S?x("entries"):B:void 0,I="Array"==e&&T.entries||C;if(I&&(k=u(I.call(new t)))!==Object.prototype&&k.next&&(c(k,w,!0),o||"function"==typeof k[f]||a(k,f,p)),S&&C&&"values"!==C.name&&(E=!0,B=function(){return C.call(this)}),o&&!y||!d&&!E&&T[f]||a(T,f,B),s[e]=B,s[w]=p,v)if(b={values:S?B:x("values"),keys:g?B:x("keys"),entries:_},y)for(m in b)m in T||r(T,m,b[m]);else i(i.P+i.F*(d||E),e,b);return b}},function(t,e,n){var o=n(92),i=n(36);t.exports=function(t,e,n){if(o(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(t))}},function(t,e,n){var o=n(11),i=n(35),r=n(12)("match");t.exports=function(t){var e;return o(t)&&(void 0!==(e=t[r])?!!e:"RegExp"==i(t))}},function(t,e,n){var o=n(12)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[o]=!1,!"/./"[t](e)}catch(t){}}return!0}},function(t,e,n){var o=n(54),i=n(12)("iterator"),r=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||r[i]===t)}},function(t,e,n){"use strict";var o=n(19),i=n(40);t.exports=function(t,e,n){e in t?o.f(t,e,i(0,n)):t[e]=n}},function(t,e,n){var o=n(62),i=n(12)("iterator"),r=n(54);t.exports=n(17).getIteratorMethod=function(t){if(null!=t)return t[i]||t["@@iterator"]||r[o(t)]}},function(t,e,n){"use strict";var o=n(20),i=n(44),r=n(16);t.exports=function(t){for(var e=o(this),n=r(e.length),a=arguments.length,s=i(a>1?arguments[1]:void 0,n),l=a>2?arguments[2]:void 0,c=void 0===l?n:i(l,n);c>s;)e[s++]=t;return e}},function(t,e,n){"use strict";var o=n(48),i=n(123),r=n(54),a=n(25);t.exports=n(90)(Array,"Array",(function(t,e){this._t=a(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])}),"values"),r.Arguments=r.Array,o("keys"),o("values"),o("entries")},function(t,e,n){"use strict";var o,i,r=n(69),a=RegExp.prototype.exec,s=String.prototype.replace,l=a,c=(o=/a/,i=/b*/g,a.call(o,"a"),a.call(i,"a"),0!==o.lastIndex||0!==i.lastIndex),u=void 0!==/()??/.exec("")[1];(c||u)&&(l=function(t){var e,n,o,i,l=this;return u&&(n=new RegExp("^"+l.source+"$(?!\\s)",r.call(l))),c&&(e=l.lastIndex),o=a.call(l,t),c&&o&&(l.lastIndex=l.global?o.index+o[0].length:e),u&&o&&o.length>1&&s.call(o[0],n,(function(){for(i=1;in;)e.push(arguments[n++]);return y[++g]=function(){s("function"==typeof t?t:Function(t),e)},o(g),g},p=function(t){delete y[t]},"process"==n(35)(f)?o=function(t){f.nextTick(a(b,t,1))}:v&&v.now?o=function(t){v.now(a(b,t,1))}:h?(r=(i=new h).port2,i.port1.onmessage=m,o=a(r.postMessage,r,1)):u.addEventListener&&"function"==typeof postMessage&&!u.importScripts?(o=function(t){u.postMessage(t+"","*")},u.addEventListener("message",m,!1)):o="onreadystatechange"in c("script")?function(t){l.appendChild(c("script")).onreadystatechange=function(){l.removeChild(this),b.call(t)}}:function(t){setTimeout(a(b,t,1),0)}),t.exports={set:d,clear:p}},function(t,e,n){"use strict";var o=n(8),i=n(18),r=n(42),a=n(75),s=n(24),l=n(57),c=n(9),u=n(56),f=n(31),d=n(16),p=n(131),h=n(46).f,v=n(19).f,g=n(97),y=n(52),b="prototype",m="Wrong index!",k=o.ArrayBuffer,x=o.DataView,w=o.Math,S=o.RangeError,E=o.Infinity,T=k,C=w.abs,B=w.pow,_=w.floor,I=w.log,O=w.LN2,N=i?"_b":"buffer",L=i?"_l":"byteLength",M=i?"_o":"byteOffset";function A(t,e,n){var o,i,r,a=new Array(n),s=8*n-e-1,l=(1<>1,u=23===e?B(2,-24)-B(2,-77):0,f=0,d=t<0||0===t&&1/t<0?1:0;for((t=C(t))!=t||t===E?(i=t!=t?1:0,o=l):(o=_(I(t)/O),t*(r=B(2,-o))<1&&(o--,r*=2),(t+=o+c>=1?u/r:u*B(2,1-c))*r>=2&&(o++,r/=2),o+c>=l?(i=0,o=l):o+c>=1?(i=(t*r-1)*B(2,e),o+=c):(i=t*B(2,c-1)*B(2,e),o=0));e>=8;a[f++]=255&i,i/=256,e-=8);for(o=o<0;a[f++]=255&o,o/=256,s-=8);return a[--f]|=128*d,a}function P(t,e,n){var o,i=8*n-e-1,r=(1<>1,s=i-7,l=n-1,c=t[l--],u=127&c;for(c>>=7;s>0;u=256*u+t[l],l--,s-=8);for(o=u&(1<<-s)-1,u>>=-s,s+=e;s>0;o=256*o+t[l],l--,s-=8);if(0===u)u=1-a;else{if(u===r)return o?NaN:c?-E:E;o+=B(2,e),u-=a}return(c?-1:1)*o*B(2,u-e)}function R(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function j(t){return[255&t]}function F(t){return[255&t,t>>8&255]}function D(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function U(t){return A(t,52,8)}function H(t){return A(t,23,4)}function z(t,e,n){v(t[b],e,{get:function(){return this[n]}})}function G(t,e,n,o){var i=p(+n);if(i+e>t[L])throw S(m);var r=t[N]._b,a=i+t[M],s=r.slice(a,a+e);return o?s:s.reverse()}function W(t,e,n,o,i,r){var a=p(+n);if(a+e>t[L])throw S(m);for(var s=t[N]._b,l=a+t[M],c=o(+i),u=0;uK;)(X=Y[K++])in k||s(k,X,T[X]);r||(V.constructor=k)}var Z=new x(new k(2)),q=x[b].setInt8;Z.setInt8(0,2147483648),Z.setInt8(1,2147483649),!Z.getInt8(0)&&Z.getInt8(1)||l(x[b],{setInt8:function(t,e){q.call(this,t,e<<24>>24)},setUint8:function(t,e){q.call(this,t,e<<24>>24)}},!0)}else k=function(t){u(this,k,"ArrayBuffer");var e=p(t);this._b=g.call(new Array(e),0),this[L]=e},x=function(t,e,n){u(this,x,"DataView"),u(t,k,"DataView");var o=t[L],i=f(e);if(i<0||i>o)throw S("Wrong offset!");if(i+(n=void 0===n?o-i:d(n))>o)throw S("Wrong length!");this[N]=t,this[M]=i,this[L]=n},i&&(z(k,"byteLength","_l"),z(x,"buffer","_b"),z(x,"byteLength","_l"),z(x,"byteOffset","_o")),l(x[b],{getInt8:function(t){return G(this,1,t)[0]<<24>>24},getUint8:function(t){return G(this,1,t)[0]},getInt16:function(t){var e=G(this,2,t,arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=G(this,2,t,arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return R(G(this,4,t,arguments[1]))},getUint32:function(t){return R(G(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return P(G(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return P(G(this,8,t,arguments[1]),52,8)},setInt8:function(t,e){W(this,1,t,j,e)},setUint8:function(t,e){W(this,1,t,j,e)},setInt16:function(t,e){W(this,2,t,F,e,arguments[2])},setUint16:function(t,e){W(this,2,t,F,e,arguments[2])},setInt32:function(t,e){W(this,4,t,D,e,arguments[2])},setUint32:function(t,e){W(this,4,t,D,e,arguments[2])},setFloat32:function(t,e){W(this,4,t,H,e,arguments[2])},setFloat64:function(t,e){W(this,8,t,U,e,arguments[2])}});y(k,"ArrayBuffer"),y(x,"DataView"),s(x[b],a.VIEW,!0),e.ArrayBuffer=k,e.DataView=x},function(t,e,n){var o=n(352),i=n(353),r=n(354);t.exports=function(t){return o(t)||i(t)||r()}},function(t,e,n){t.exports=!n(18)&&!n(9)((function(){return 7!=Object.defineProperty(n(78)("div"),"a",{get:function(){return 7}}).a}))},function(t,e,n){var o=n(8),i=n(17),r=n(42),a=n(79),s=n(19).f;t.exports=function(t){var e=i.Symbol||(i.Symbol=r?{}:o.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:a.f(t)})}},function(t,e,n){var o=n(23),i=n(25),r=n(65)(!1),a=n(80)("IE_PROTO");t.exports=function(t,e){var n,s=i(t),l=0,c=[];for(n in s)n!=a&&o(s,n)&&c.push(n);for(;e.length>l;)o(s,n=e[l++])&&(~r(c,n)||c.push(n));return c}},function(t,e,n){var o=n(19),i=n(10),r=n(43);t.exports=n(18)?Object.defineProperties:function(t,e){i(t);for(var n,a=r(e),s=a.length,l=0;s>l;)o.f(t,n=a[l++],e[n]);return t}},function(t,e,n){var o=n(25),i=n(46).f,r={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==r.call(t)?function(t){try{return i(t)}catch(t){return a.slice()}}(t):i(o(t))}},function(t,e,n){"use strict";var o=n(18),i=n(43),r=n(66),a=n(61),s=n(20),l=n(60),c=Object.assign;t.exports=!c||n(9)((function(){var t={},e={},n=Symbol(),o="abcdefghijklmnopqrst";return t[n]=7,o.split("").forEach((function(t){e[t]=t})),7!=c({},t)[n]||Object.keys(c({},e)).join("")!=o}))?function(t,e){for(var n=s(t),c=arguments.length,u=1,f=r.f,d=a.f;c>u;)for(var p,h=l(arguments[u++]),v=f?i(h).concat(f(h)):i(h),g=v.length,y=0;g>y;)p=v[y++],o&&!d.call(h,p)||(n[p]=h[p]);return n}:c},function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},function(t,e,n){"use strict";var o=n(30),i=n(11),r=n(112),a=[].slice,s={},l=function(t,e,n){if(!(e in s)){for(var o=[],i=0;i>>0||(a.test(n)?16:10))}:o},function(t,e,n){var o=n(8).parseFloat,i=n(53).trim;t.exports=1/o(n(84)+"-0")!=-1/0?function(t){var e=i(String(t),3),n=o(e);return 0===n&&"-"==e.charAt(0)?-0:n}:o},function(t,e,n){var o=n(35);t.exports=function(t,e){if("number"!=typeof t&&"Number"!=o(t))throw TypeError(e);return+t}},function(t,e,n){var o=n(11),i=Math.floor;t.exports=function(t){return!o(t)&&isFinite(t)&&i(t)===t}},function(t,e){t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},function(t,e,n){"use strict";var o=n(45),i=n(40),r=n(52),a={};n(24)(a,n(12)("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=o(a,{next:i(1,n)}),r(t,e+" Iterator")}},function(t,e,n){var o=n(10);t.exports=function(t,e,n,i){try{return i?e(o(n)[0],n[1]):e(n)}catch(e){var r=t.return;throw void 0!==r&&o(r.call(t)),e}}},function(t,e,n){var o=n(266);t.exports=function(t,e){return new(o(t))(e)}},function(t,e,n){var o=n(30),i=n(20),r=n(60),a=n(16);t.exports=function(t,e,n,s,l){o(e);var c=i(t),u=r(c),f=a(c.length),d=l?f-1:0,p=l?-1:1;if(n<2)for(;;){if(d in u){s=u[d],d+=p;break}if(d+=p,l?d<0:f<=d)throw TypeError("Reduce of empty array with no initial value")}for(;l?d>=0:f>d;d+=p)d in u&&(s=e(s,u[d],d,c));return s}},function(t,e,n){"use strict";var o=n(20),i=n(44),r=n(16);t.exports=[].copyWithin||function(t,e){var n=o(this),a=r(n.length),s=i(t,a),l=i(e,a),c=arguments.length>2?arguments[2]:void 0,u=Math.min((void 0===c?a:i(c,a))-l,a-s),f=1;for(l0;)l in n?n[s]=n[l]:delete n[s],s+=f,l+=f;return n}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){"use strict";var o=n(99);n(0)({target:"RegExp",proto:!0,forced:o!==/./.exec},{exec:o})},function(t,e,n){n(18)&&"g"!=/./g.flags&&n(19).f(RegExp.prototype,"flags",{configurable:!0,get:n(69)})},function(t,e,n){"use strict";var o,i,r,a,s=n(42),l=n(8),c=n(29),u=n(62),f=n(0),d=n(11),p=n(30),h=n(56),v=n(72),g=n(63),y=n(101).set,b=n(286)(),m=n(127),k=n(287),x=n(73),w=n(128),S=l.TypeError,E=l.process,T=E&&E.versions,C=T&&T.v8||"",B=l.Promise,_="process"==u(E),I=function(){},O=i=m.f,N=!!function(){try{var t=B.resolve(1),e=(t.constructor={})[n(12)("species")]=function(t){t(I,I)};return(_||"function"==typeof PromiseRejectionEvent)&&t.then(I)instanceof e&&0!==C.indexOf("6.6")&&-1===x.indexOf("Chrome/66")}catch(t){}}(),L=function(t){var e;return!(!d(t)||"function"!=typeof(e=t.then))&&e},M=function(t,e){if(!t._n){t._n=!0;var n=t._c;b((function(){for(var o=t._v,i=1==t._s,r=0,a=function(e){var n,r,a,s=i?e.ok:e.fail,l=e.resolve,c=e.reject,u=e.domain;try{s?(i||(2==t._h&&R(t),t._h=1),!0===s?n=o:(u&&u.enter(),n=s(o),u&&(u.exit(),a=!0)),n===e.promise?c(S("Promise-chain cycle")):(r=L(n))?r.call(n,l,c):l(n)):c(o)}catch(t){u&&!a&&u.exit(),c(t)}};n.length>r;)a(n[r++]);t._c=[],t._n=!1,e&&!t._h&&A(t)}))}},A=function(t){y.call(l,(function(){var e,n,o,i=t._v,r=P(t);if(r&&(e=k((function(){_?E.emit("unhandledRejection",i,t):(n=l.onunhandledrejection)?n({promise:t,reason:i}):(o=l.console)&&o.error&&o.error("Unhandled promise rejection",i)})),t._h=_||P(t)?2:1),t._a=void 0,r&&e.e)throw e.v}))},P=function(t){return 1!==t._h&&0===(t._a||t._c).length},R=function(t){y.call(l,(function(){var e;_?E.emit("rejectionHandled",t):(e=l.onrejectionhandled)&&e({promise:t,reason:t._v})}))},j=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),M(e,!0))},F=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw S("Promise can't be resolved itself");(e=L(t))?b((function(){var o={_w:n,_d:!1};try{e.call(t,c(F,o,1),c(j,o,1))}catch(t){j.call(o,t)}})):(n._v=t,n._s=1,M(n,!1))}catch(t){j.call({_w:n,_d:!1},t)}}};N||(B=function(t){h(this,B,"Promise","_h"),p(t),o.call(this);try{t(c(F,this,1),c(j,this,1))}catch(t){j.call(this,t)}},(o=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(57)(B.prototype,{then:function(t,e){var n=O(g(this,B));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=_?E.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&M(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),r=function(){var t=new o;this.promise=t,this.resolve=c(F,t,1),this.reject=c(j,t,1)},m.f=O=function(t){return t===B||t===a?new r(t):i(t)}),f(f.G+f.W+f.F*!N,{Promise:B}),n(52)(B,"Promise"),n(55)("Promise"),a=n(17).Promise,f(f.S+f.F*!N,"Promise",{reject:function(t){var e=O(this);return(0,e.reject)(t),e.promise}}),f(f.S+f.F*(s||!N),"Promise",{resolve:function(t){return w(s&&this===a?B:this,t)}}),f(f.S+f.F*!(N&&n(68)((function(t){B.all(t).catch(I)}))),"Promise",{all:function(t){var e=this,n=O(e),o=n.resolve,i=n.reject,r=k((function(){var n=[],r=0,a=1;v(t,!1,(function(t){var s=r++,l=!1;n.push(void 0),a++,e.resolve(t).then((function(t){l||(l=!0,n[s]=t,--a||o(n))}),i)})),--a||o(n)}));return r.e&&i(r.v),n.promise},race:function(t){var e=this,n=O(e),o=n.reject,i=k((function(){v(t,!1,(function(t){e.resolve(t).then(n.resolve,o)}))}));return i.e&&o(i.v),n.promise}})},function(t,e,n){"use strict";var o=n(30);function i(t){var e,n;this.promise=new t((function(t,o){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=o})),this.resolve=o(e),this.reject=o(n)}t.exports.f=function(t){return new i(t)}},function(t,e,n){var o=n(10),i=n(11),r=n(127);t.exports=function(t,e){if(o(t),i(e)&&e.constructor===t)return e;var n=r.f(t);return(0,n.resolve)(e),n.promise}},function(t,e,n){"use strict";var o=n(19).f,i=n(45),r=n(57),a=n(29),s=n(56),l=n(72),c=n(90),u=n(123),f=n(55),d=n(18),p=n(39).fastKey,h=n(49),v=d?"_s":"size",g=function(t,e){var n,o=p(e);if("F"!==o)return t._i[o];for(n=t._f;n;n=n.n)if(n.k==e)return n};t.exports={getConstructor:function(t,e,n,c){var u=t((function(t,o){s(t,u,e,"_i"),t._t=e,t._i=i(null),t._f=void 0,t._l=void 0,t[v]=0,null!=o&&l(o,n,t[c],t)}));return r(u.prototype,{clear:function(){for(var t=h(this,e),n=t._i,o=t._f;o;o=o.n)o.r=!0,o.p&&(o.p=o.p.n=void 0),delete n[o.i];t._f=t._l=void 0,t[v]=0},delete:function(t){var n=h(this,e),o=g(n,t);if(o){var i=o.n,r=o.p;delete n._i[o.i],o.r=!0,r&&(r.n=i),i&&(i.p=r),n._f==o&&(n._f=i),n._l==o&&(n._l=r),n[v]--}return!!o},forEach:function(t){h(this,e);for(var n,o=a(t,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(o(n.v,n.k,this);n&&n.r;)n=n.p},has:function(t){return!!g(h(this,e),t)}}),d&&o(u.prototype,"size",{get:function(){return h(this,e)[v]}}),u},def:function(t,e,n){var o,i,r=g(t,e);return r?r.v=n:(t._l=r={i:i=p(e,!0),k:e,v:n,p:o=t._l,n:void 0,r:!1},t._f||(t._f=r),o&&(o.n=r),t[v]++,"F"!==i&&(t._i[i]=r)),t},getEntry:g,setStrong:function(t,e,n){c(t,e,(function(t,n){this._t=h(t,e),this._k=n,this._l=void 0}),(function(){for(var t=this._k,e=this._l;e&&e.r;)e=e.p;return this._t&&(this._l=e=e?e.n:this._t._f)?u(0,"keys"==t?e.k:"values"==t?e.v:[e.k,e.v]):(this._t=void 0,u(1))}),n?"entries":"values",!n,!0),f(e)}}},function(t,e,n){"use strict";var o=n(57),i=n(39).getWeak,r=n(10),a=n(11),s=n(56),l=n(72),c=n(34),u=n(23),f=n(49),d=c(5),p=c(6),h=0,v=function(t){return t._l||(t._l=new g)},g=function(){this.a=[]},y=function(t,e){return d(t.a,(function(t){return t[0]===e}))};g.prototype={get:function(t){var e=y(this,t);if(e)return e[1]},has:function(t){return!!y(this,t)},set:function(t,e){var n=y(this,t);n?n[1]=e:this.a.push([t,e])},delete:function(t){var e=p(this.a,(function(e){return e[0]===t}));return~e&&this.a.splice(e,1),!!~e}},t.exports={getConstructor:function(t,e,n,r){var c=t((function(t,o){s(t,c,e,"_i"),t._t=e,t._i=h++,t._l=void 0,null!=o&&l(o,n,t[r],t)}));return o(c.prototype,{delete:function(t){if(!a(t))return!1;var n=i(t);return!0===n?v(f(this,e)).delete(t):n&&u(n,this._i)&&delete n[this._i]},has:function(t){if(!a(t))return!1;var n=i(t);return!0===n?v(f(this,e)).has(t):n&&u(n,this._i)}}),c},def:function(t,e,n){var o=i(r(e),!0);return!0===o?v(t).set(e,n):o[t._i]=n,t},ufstore:v}},function(t,e,n){var o=n(31),i=n(16);t.exports=function(t){if(void 0===t)return 0;var e=o(t),n=i(e);if(e!==n)throw RangeError("Wrong length!");return n}},function(t,e,n){var o=n(46),i=n(66),r=n(10),a=n(8).Reflect;t.exports=a&&a.ownKeys||function(t){var e=o.f(r(t)),n=i.f;return n?e.concat(n(t)):e}},function(t,e,n){var o=n(16),i=n(86),r=n(36);t.exports=function(t,e,n,a){var s=String(r(t)),l=s.length,c=void 0===n?" ":String(n),u=o(e);if(u<=l||""==c)return s;var f=u-l,d=i.call(c,Math.ceil(f/c.length));return d.length>f&&(d=d.slice(0,f)),a?d+s:s+d}},function(t,e,n){var o=n(18),i=n(43),r=n(25),a=n(61).f;t.exports=function(t){return function(e){for(var n,s=r(e),l=i(s),c=l.length,u=0,f=[];c>u;)n=l[u++],o&&!a.call(s,n)||f.push(t?[n,s[n]]:s[n]);return f}}},function(t,e,n){var o=function(t){"use strict";var e,n=Object.prototype,o=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},r=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(t,e,n,o){var i=e&&e.prototype instanceof v?e:v,r=Object.create(i.prototype),a=new B(o||[]);return r._invoke=function(t,e,n){var o=u;return function(i,r){if(o===d)throw new Error("Generator is already running");if(o===p){if("throw"===i)throw r;return I()}for(n.method=i,n.arg=r;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===u)throw o=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=c(t,e,n);if("normal"===l.type){if(o=n.done?p:f,l.arg===h)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=p,n.method="throw",n.arg=l.arg)}}}(t,n,a),r}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var u="suspendedStart",f="suspendedYield",d="executing",p="completed",h={};function v(){}function g(){}function y(){}var b={};b[r]=function(){return this};var m=Object.getPrototypeOf,k=m&&m(m(_([])));k&&k!==n&&o.call(k,r)&&(b=k);var x=y.prototype=v.prototype=Object.create(b);function w(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function S(t){var e;this._invoke=function(n,i){function r(){return new Promise((function(e,r){!function e(n,i,r,a){var s=c(t[n],t,i);if("throw"!==s.type){var l=s.arg,u=l.value;return u&&"object"==typeof u&&o.call(u,"__await")?Promise.resolve(u.__await).then((function(t){e("next",t,r,a)}),(function(t){e("throw",t,r,a)})):Promise.resolve(u).then((function(t){l.value=t,r(l)}),(function(t){return e("throw",t,r,a)}))}a(s.arg)}(n,i,e,r)}))}return e=e?e.then(r,r):r()}}function E(t,n){var o=t.iterator[n.method];if(o===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var i=c(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,h;var r=i.arg;return r?r.done?(n[t.resultName]=r.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):r:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function _(t){if(t){var n=t[r];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function n(){for(;++i=0;--r){var a=this.tryEntries[r],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var l=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(l&&c){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&o.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),C(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var o=n.completion;if("throw"===o.type){var i=o.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,o){return this.delegate={iterator:_(t),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=e),h}},t}(t.exports);try{regeneratorRuntime=o}catch(t){Function("r","regeneratorRuntime = r")(o)}},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7),n(14)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u){"use strict";var f=n(15),d=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=d(i),r=d(r),a=d(a),s=d(s),l=d(l),c=d(c),u=f(u);var p=function(t){function e(){var t;return(0,i.default)(this,e),(t=(0,a.default)(this,(0,s.default)(e).apply(this,arguments))).insert=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.config.initialBlock,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;t.Editor.BlockManager.insert(e,n,o,i,r)},t}return(0,l.default)(e,t),(0,r.default)(e,[{key:"getBlocksCount",value:function(){return this.Editor.BlockManager.blocks.length}},{key:"getCurrentBlockIndex",value:function(){return this.Editor.BlockManager.currentBlockIndex}},{key:"getBlockByIndex",value:function(t){return this.Editor.BlockManager.getBlockByIndex(t).holder}},{key:"swap",value:function(t,e){this.Editor.BlockManager.swap(t,e),this.Editor.Toolbar.move(!1)}},{key:"delete",value:function(t){this.Editor.BlockManager.removeBlock(t),0===this.Editor.BlockManager.blocks.length&&this.Editor.BlockManager.insert(),this.Editor.Caret.setToBlock(this.Editor.BlockManager.currentBlock,this.Editor.Caret.positions.END),this.Editor.Toolbar.close()}},{key:"clear",value:function(){this.Editor.BlockManager.clear(!0),this.Editor.InlineToolbar.close()}},{key:"render",value:function(t){return this.Editor.BlockManager.clear(),this.Editor.Renderer.render(t.blocks)}},{key:"renderFromHTML",value:function(t){return this.Editor.BlockManager.clear(),this.Editor.Paste.processText(t,!0)}},{key:"stretchBlock",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.Editor.BlockManager.getBlockByIndex(t);n&&(n.stretched=e)}},{key:"insertNewBlock",value:function(){u.log("Method blocks.insertNewBlock() is deprecated and it will be removed in next major release. Use blocks.insert() instead.","warn"),this.insert()}},{key:"methods",get:function(){var t=this;return{clear:function(){return t.clear()},render:function(e){return t.render(e)},renderFromHTML:function(e){return t.renderFromHTML(e)},delete:function(){return t.delete()},swap:function(e,n){return t.swap(e,n)},getBlockByIndex:function(e){return t.getBlockByIndex(e)},getCurrentBlockIndex:function(){return t.getCurrentBlockIndex()},getBlocksCount:function(){return t.getBlocksCount()},stretchBlock:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t.stretchBlock(e,n)},insertNewBlock:function(){return t.insertNewBlock()},insert:this.insert}}}]),e}(c.default);o.default=p,p.displayName="BlocksAPI",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c){"use strict";var u=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=u(i),r=u(r),a=u(a),s=u(s),l=u(l);var f=function(t){function e(){var t;return(0,i.default)(this,e),(t=(0,a.default)(this,(0,s.default)(e).apply(this,arguments))).setToFirstBlock=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.Editor.Caret.positions.DEFAULT,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!!t.Editor.BlockManager.firstBlock&&(t.Editor.Caret.setToBlock(t.Editor.BlockManager.firstBlock,e,n),!0)},t.setToLastBlock=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.Editor.Caret.positions.DEFAULT,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!!t.Editor.BlockManager.lastBlock&&(t.Editor.Caret.setToBlock(t.Editor.BlockManager.lastBlock,e,n),!0)},t.setToPreviousBlock=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.Editor.Caret.positions.DEFAULT,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!!t.Editor.BlockManager.previousBlock&&(t.Editor.Caret.setToBlock(t.Editor.BlockManager.previousBlock,e,n),!0)},t.setToNextBlock=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.Editor.Caret.positions.DEFAULT,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!!t.Editor.BlockManager.nextBlock&&(t.Editor.Caret.setToBlock(t.Editor.BlockManager.nextBlock,e,n),!0)},t.setToBlock=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.Editor.Caret.positions.DEFAULT,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return!!t.Editor.BlockManager.blocks[e]&&(t.Editor.Caret.setToBlock(t.Editor.BlockManager.blocks[e],n,o),!0)},t.focus=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?t.setToLastBlock(t.Editor.Caret.positions.END):t.setToFirstBlock(t.Editor.Caret.positions.START)},t}return(0,l.default)(e,t),(0,r.default)(e,[{key:"methods",get:function(){return{setToFirstBlock:this.setToFirstBlock,setToLastBlock:this.setToLastBlock,setToPreviousBlock:this.setToPreviousBlock,setToNextBlock:this.setToNextBlock,setToBlock:this.setToBlock,focus:this.focus}}}]),e}((c=u(c)).default);o.default=f,f.displayName="CaretAPI",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c){"use strict";var u=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=u(i),r=u(r),a=u(a),s=u(s),l=u(l);var f=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"on",value:function(t,e){this.Editor.Events.on(t,e)}},{key:"emit",value:function(t,e){this.Editor.Events.emit(t,e)}},{key:"off",value:function(t,e){this.Editor.Events.off(t,e)}},{key:"methods",get:function(){var t=this;return{emit:function(e,n){return t.emit(e,n)},off:function(e,n){return t.off(e,n)},on:function(e,n){return t.on(e,n)}}}}]),e}((c=u(c)).default);o.default=f,f.displayName="EventsAPI",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c){"use strict";var u=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=u(i),r=u(r),a=u(a),s=u(s),l=u(l);var f=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"open",value:function(){this.Editor.InlineToolbar.tryToShow()}},{key:"close",value:function(){this.Editor.InlineToolbar.close()}},{key:"methods",get:function(){var t=this;return{close:function(){return t.close()},open:function(){return t.open()}}}}]),e}((c=u(c)).default);o.default=f,f.displayName="InlineToolbarAPI",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c){"use strict";var u=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=u(i),r=u(r),a=u(a),s=u(s),l=u(l);var f=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"on",value:function(t,e,n,o){this.Editor.Listeners.on(t,e,n,o)}},{key:"off",value:function(t,e,n){this.Editor.Listeners.off(t,e,n)}},{key:"methods",get:function(){var t=this;return{on:function(e,n,o,i){return t.on(e,n,o,i)},off:function(e,n,o){return t.off(e,n,o)}}}}]),e}((c=u(c)).default);o.default=f,f.displayName="ListenersAPI",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c){"use strict";var u=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=u(i),r=u(r),a=u(a),s=u(s),l=u(l);var f=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"show",value:function(t){return this.Editor.Notifier.show(t)}},{key:"methods",get:function(){var t=this;return{show:function(e){return t.show(e)}}}}]),e}((c=u(c)).default);o.default=f,f.displayName="NotifierAPI",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c){"use strict";var u=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=u(i),r=u(r),a=u(a),s=u(s),l=u(l);var f=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"clean",value:function(t,e){return this.Editor.Sanitizer.clean(t,e)}},{key:"methods",get:function(){var t=this;return{clean:function(e,n){return t.clean(e,n)}}}}]),e}((c=u(c)).default);o.default=f,f.displayName="SanitizerAPI",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c){"use strict";var u=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=u(i),r=u(r),a=u(a),s=u(s),l=u(l);var f=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"save",value:function(){return this.Editor.Saver.save()}},{key:"methods",get:function(){var t=this;return{save:function(){return t.save()}}}}]),e}((c=u(c)).default);o.default=f,f.displayName="SaverAPI",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7),n(28)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u){"use strict";var f=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=f(i),r=f(r),a=f(a),s=f(s),l=f(l),c=f(c),u=f(u);var d=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"findParentTag",value:function(t,e){return(new u.default).findParentTag(t,e)}},{key:"expandToTag",value:function(t){(new u.default).expandToTag(t)}},{key:"methods",get:function(){var t=this;return{findParentTag:function(e,n){return t.findParentTag(e,n)},expandToTag:function(e){return t.expandToTag(e)}}}}]),e}(c.default);o.default=d,d.displayName="SelectionAPI",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c){"use strict";var u=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=u(i),r=u(r),a=u(a),s=u(s),l=u(l);var f=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"classes",get:function(){return{block:"cdx-block",inlineToolButton:"ce-inline-tool",inlineToolButtonActive:"ce-inline-tool--active",input:"cdx-input",loader:"cdx-loader",button:"cdx-button",settingsButton:"cdx-settings-button",settingsButtonActive:"cdx-settings-button--active"}}}]),e}((c=u(c)).default);o.default=f,f.displayName="StylesAPI",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c){"use strict";var u=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=u(i),r=u(r),a=u(a),s=u(s),l=u(l);var f=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"open",value:function(){this.Editor.Toolbar.open()}},{key:"close",value:function(){this.Editor.Toolbar.close()}},{key:"methods",get:function(){var t=this;return{close:function(){return t.close()},open:function(){return t.open()}}}}]),e}((c=u(c)).default);o.default=f,f.displayName="ToolbarAPI",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c){"use strict";var u=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=u(i),r=u(r),a=u(a),s=u(s),l=u(l);var f=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"show",value:function(t,e,n){this.Editor.Tooltip.show(t,e,n)}},{key:"hide",value:function(){this.Editor.Tooltip.hide()}},{key:"onHover",value:function(t,e,n){this.Editor.Tooltip.onHover(t,e,n)}},{key:"methods",get:function(){var t=this;return{show:function(e,n,o){return t.show(e,n,o)},hide:function(){return t.hide()},onHover:function(e,n,o){return t.onHover(e,n,o)}}}}]),e}((c=u(c)).default);o.default=f,f.displayName="TooltipAPI",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7),n(14),n(28),n(58)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u,f,d){"use strict";var p=n(15),h=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=h(i),r=h(r),a=h(a),s=h(s),l=h(l),c=h(c),u=p(u),f=h(f),d=h(d);var v=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"keydown",value:function(t){switch(this.beforeKeydownProcessing(t),t.keyCode){case u.keyCodes.BACKSPACE:this.backspace(t);break;case u.keyCodes.ENTER:this.enter(t);break;case u.keyCodes.DOWN:case u.keyCodes.RIGHT:this.arrowRightAndDown(t);break;case u.keyCodes.UP:case u.keyCodes.LEFT:this.arrowLeftAndUp(t);break;case u.keyCodes.TAB:this.tabPressed(t);break;case u.keyCodes.ESC:this.escapePressed(t);break;default:this.defaultHandler()}}},{key:"beforeKeydownProcessing",value:function(t){this.needToolbarClosing(t)&&u.isPrintableKey(t.keyCode)&&(this.Editor.Toolbar.close(),this.Editor.ConversionToolbar.close(),t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||(this.Editor.BlockManager.clearFocused(),this.Editor.BlockSelection.clearSelection(t)))}},{key:"keyup",value:function(t){t.shiftKey||this.Editor.UI.checkEmptiness()}},{key:"mouseUp",value:function(){}},{key:"mouseDown",value:function(t){f.default.isCollapsed||this.Editor.BlockSelection.clearSelection(t),this.Editor.CrossBlockSelection.watchSelection(t)}},{key:"tabPressed",value:function(t){this.Editor.BlockSelection.clearSelection(t);var e=this.Editor,n=e.BlockManager,o=e.Tools,i=e.InlineToolbar,r=e.ConversionToolbar,a=n.currentBlock;if(a){var s=o.isInitial(a.tool)&&a.isEmpty,l=!a.isEmpty&&r.opened,c=!a.isEmpty&&!f.default.isCollapsed&&i.opened;s?this.activateToolbox():l||c||this.activateBlockSettings()}}},{key:"escapePressed",value:function(t){this.Editor.BlockSelection.clearSelection(t),this.Editor.Toolbox.opened?this.Editor.Toolbox.close():this.Editor.BlockSettings.opened?this.Editor.BlockSettings.close():this.Editor.ConversionToolbar.opened?this.Editor.ConversionToolbar.close():this.Editor.InlineToolbar.opened?this.Editor.InlineToolbar.close():this.Editor.Toolbar.close()}},{key:"dragOver",value:function(t){this.Editor.BlockManager.getBlockByChildNode(t.target).dropTarget=!0}},{key:"dragLeave",value:function(t){this.Editor.BlockManager.getBlockByChildNode(t.target).dropTarget=!1}},{key:"handleCommandC",value:function(t){var e=this.Editor.BlockSelection;e.anyBlockSelected&&(t.preventDefault(),e.copySelectedBlocks())}},{key:"handleCommandX",value:function(t){var e=this.Editor,n=e.BlockSelection,o=e.BlockManager,i=e.Caret;if(n.anyBlockSelected){t.preventDefault(),n.copySelectedBlocks();var r=o.removeSelectedBlocks();i.setToBlock(o.insertInitialBlockAtIndex(r,!0),i.positions.START),n.clearSelection(t)}}},{key:"enter",value:function(t){var e=this.Editor,n=e.BlockManager,o=e.Tools,i=e.UI,r=n.currentBlock,a=o.available[r.name];if(!(a&&a[o.INTERNAL_SETTINGS.IS_ENABLED_LINE_BREAKS]||i.someToolbarOpened&&i.someFlipperButtonFocused||t.shiftKey)){var s=this.Editor.BlockManager.currentBlock;this.Editor.Caret.isAtStart&&!this.Editor.BlockManager.currentBlock.hasMedia?this.Editor.BlockManager.insertInitialBlockAtIndex(this.Editor.BlockManager.currentBlockIndex):s=this.Editor.BlockManager.split(),this.Editor.Caret.setToBlock(s),this.Editor.Tools.isInitial(s.tool)&&s.isEmpty&&(this.Editor.Toolbar.open(!1),this.Editor.Toolbar.plusButton.show()),t.preventDefault()}}},{key:"backspace",value:function(t){var e=this.Editor,n=e.BlockManager,o=e.BlockSelection,i=e.Caret,r=n.currentBlock,a=this.Editor.Tools.available[r.name];if(r.selected||r.isEmpty&&r.currentInput===r.firstInput){t.preventDefault();var s=n.currentBlockIndex;return n.previousBlock&&0===n.previousBlock.inputs.length?n.removeBlock(s-1):n.removeBlock(),i.setToBlock(n.currentBlock,s?i.positions.END:i.positions.START),this.Editor.Toolbar.close(),void o.clearSelection(t)}if(!a||!a[this.Editor.Tools.INTERNAL_SETTINGS.IS_ENABLED_LINE_BREAKS]||i.isAtStart){var l=0===n.currentBlockIndex;i.isAtStart&&f.default.isCollapsed&&r.currentInput===r.firstInput&&!l&&(t.preventDefault(),this.mergeBlocks())}}},{key:"mergeBlocks",value:function(){var t=this.Editor,e=t.BlockManager,n=t.Caret,o=t.Toolbar,i=e.previousBlock,r=e.currentBlock;if(r.name!==i.name||!i.mergeable)return 0===i.inputs.length||i.isEmpty?(e.removeBlock(e.currentBlockIndex-1),n.setToBlock(e.currentBlock),void o.close()):void(n.navigatePrevious()&&o.close());n.createShadow(i.pluginsContent),e.mergeBlocks(i,r).then((function(){n.restoreCaret(i.pluginsContent),i.pluginsContent.normalize(),o.close()}))}},{key:"arrowRightAndDown",value:function(t){var e=this,n=d.default.usedKeys.includes(t.keyCode)&&(!t.shiftKey||t.keyCode===u.keyCodes.TAB);if(!this.Editor.UI.someToolbarOpened||!n){this.Editor.BlockManager.clearFocused(),this.Editor.Toolbar.close();var o=this.Editor.Caret.isAtEnd||this.Editor.BlockSelection.anyBlockSelected;t.shiftKey&&t.keyCode===u.keyCodes.DOWN&&o?this.Editor.CrossBlockSelection.toggleBlockSelectedState():(this.Editor.Caret.navigateNext()?t.preventDefault():u.delay((function(){e.Editor.BlockManager.currentBlock&&e.Editor.BlockManager.currentBlock.updateCurrentInput()}),20)(),this.Editor.BlockSelection.clearSelection(t))}}},{key:"arrowLeftAndUp",value:function(t){var e=this;if(this.Editor.UI.someToolbarOpened){if(d.default.usedKeys.includes(t.keyCode)&&(!t.shiftKey||t.keyCode===u.keyCodes.TAB))return;this.Editor.UI.closeAllToolbars()}this.Editor.BlockManager.clearFocused(),this.Editor.Toolbar.close();var n=this.Editor.Caret.isAtStart||this.Editor.BlockSelection.anyBlockSelected;t.shiftKey&&t.keyCode===u.keyCodes.UP&&n?this.Editor.CrossBlockSelection.toggleBlockSelectedState(!1):(this.Editor.Caret.navigatePrevious()?t.preventDefault():u.delay((function(){e.Editor.BlockManager.currentBlock&&e.Editor.BlockManager.currentBlock.updateCurrentInput()}),20)(),this.Editor.BlockSelection.clearSelection(t))}},{key:"defaultHandler",value:function(){}},{key:"needToolbarClosing",value:function(t){var e=t.keyCode===u.keyCodes.ENTER&&this.Editor.Toolbox.opened,n=t.keyCode===u.keyCodes.ENTER&&this.Editor.BlockSettings.opened,o=t.keyCode===u.keyCodes.ENTER&&this.Editor.InlineToolbar.opened,i=t.keyCode===u.keyCodes.ENTER&&this.Editor.ConversionToolbar.opened,r=t.keyCode===u.keyCodes.TAB;return!(t.shiftKey||r||e||n||o||i)}},{key:"activateToolbox",value:function(){this.Editor.Toolbar.opened||(this.Editor.Toolbar.open(!1,!1),this.Editor.Toolbar.plusButton.show()),this.Editor.Toolbox.open()}},{key:"activateBlockSettings",value:function(){this.Editor.Toolbar.opened||(this.Editor.BlockManager.currentBlock.focused=!0,this.Editor.Toolbar.open(!0,!1),this.Editor.Toolbar.plusButton.hide()),this.Editor.BlockSettings.opened||this.Editor.BlockSettings.open()}}]),e}(c.default);o.default=v,v.displayName="BlockEvents",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(27),n(2),n(3),n(4),n(5),n(6),n(59),n(7),n(13),n(14),n(363)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u,f,d,p,h){"use strict";var v=n(15),g=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=g(i),r=g(r),a=g(a),s=g(s),l=g(l),c=g(c),u=v(u),f=g(f),d=g(d),p=v(p),h=g(h);var y=function(t){function e(){var t;return(0,r.default)(this,e),(t=(0,s.default)(this,(0,l.default)(e).apply(this,arguments)))._currentBlockIndex=-1,t._blocks=null,t}return(0,c.default)(e,t),(0,a.default)(e,[{key:"prepare",value:function(){var t,e,n,o;return i.default.async((function(i){for(;;)switch(i.prev=i.next){case 0:t=new h.default(this.Editor.UI.nodes.redactor),e=this.Editor,n=e.BlockEvents,o=e.Shortcuts,this._blocks=new Proxy(t,{set:h.default.set,get:h.default.get}),o.add({name:"CMD+C",handler:function(t){n.handleCommandC(t)}}),o.add({name:"CMD+X",handler:function(t){n.handleCommandX(t)}});case 5:case"end":return i.stop()}}),null,this)}},{key:"composeBlock",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=this.Editor.Tools.construct(t,e),i=this.Editor.Tools.available[t],r=new u.default(t,o,i,n,this.Editor.API.methods);return this.bindEvents(r),r}},{key:"insert",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.initialBlock,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.currentBlockIndex+1,i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],r=this.composeBlock(t,e,n);return this._blocks[o]=r,i&&(this.currentBlockIndex=o),r}},{key:"paste",value:function(t,e){var n,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n=o?this.replace(t):this.insert(t);try{n.call(u.BlockToolAPI.ON_PASTE,e)}catch(e){p.log("".concat(t,": onPaste callback call is failed"),"error",e)}return n}},{key:"insertInitialBlockAtIndex",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.composeBlock(this.config.initialBlock,{},{});return this._blocks[t]=n,e?this.currentBlockIndex=t:t<=this.currentBlockIndex&&this.currentBlockIndex++,n}},{key:"insertAtEnd",value:function(){return this.currentBlockIndex=this.blocks.length-1,this.insert()}},{key:"mergeBlocks",value:function(t,e){var n,o;return i.default.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=this._blocks.indexOf(e),!e.isEmpty){r.next=3;break}return r.abrupt("return");case 3:return r.next=5,i.default.awrap(e.data);case 5:if(o=r.sent,p.isEmpty(o)){r.next=9;break}return r.next=9,i.default.awrap(t.mergeWith(o));case 9:this.removeBlock(n),this.currentBlockIndex=this._blocks.indexOf(t);case 11:case"end":return r.stop()}}),null,this)}},{key:"removeBlock",value:function(t){if(void 0===t&&(t=this.currentBlockIndex),this._blocks.remove(t),this.currentBlockIndex>=t&&this.currentBlockIndex--,!this.blocks.length)return this.currentBlockIndex=-1,void this.insert();0===t&&(this.currentBlockIndex=0)}},{key:"removeSelectedBlocks",value:function(){for(var t,e=this.blocks.length-1;e>=0;e--)this.blocks[e].selected&&(this.removeBlock(e),t=e);return t}},{key:"removeAllBlocks",value:function(){for(var t=this.blocks.length-1;t>=0;t--)this._blocks.remove(t);this.currentBlockIndex=-1,this.insert(),this.currentBlock.firstInput.focus()}},{key:"split",value:function(){var t=this.Editor.Caret.extractFragmentFromCaretPosition(),e=d.default.make("div");e.appendChild(t);var n={text:d.default.isEmpty(e)?"":e.innerHTML};return this.insert(this.config.initialBlock,n)}},{key:"replace",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.initialBlock,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.composeBlock(t,e);return this._blocks.insert(this.currentBlockIndex,n,!0),n}},{key:"getBlockByIndex",value:function(t){return this._blocks[t]}},{key:"getBlock",value:function(t){d.default.isElement(t)||(t=t.parentNode);var e=this._blocks.nodes,n=t.closest(".".concat(u.default.CSS.wrapper)),o=e.indexOf(n);if(o>=0)return this._blocks[o]}},{key:"highlightCurrentNode",value:function(){this.clearFocused(),this.currentBlock.focused=!0}},{key:"clearFocused",value:function(){this.blocks.forEach((function(t){return t.focused=!1}))}},{key:"setCurrentBlockByChildNode",value:function(t){d.default.isElement(t)||(t=t.parentNode);var e=t.closest(".".concat(u.default.CSS.wrapper));if(e)return this.currentBlockIndex=this._blocks.nodes.indexOf(e),this.currentBlock;throw new Error("Can not find a Block from this child Node")}},{key:"getBlockByChildNode",value:function(t){d.default.isElement(t)||(t=t.parentNode);var e=t.closest(".".concat(u.default.CSS.wrapper));return this.blocks.find((function(t){return t.holder===e}))}},{key:"swap",value:function(t,e){this._blocks.swap(t,e),this.currentBlockIndex=e}},{key:"dropPointer",value:function(){this.currentBlockIndex=-1,this.clearFocused()}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._blocks.removeAll(),this.dropPointer(),t&&this.insert(this.config.initialBlock),this.Editor.UI.checkEmptiness()}},{key:"bindEvents",value:function(t){var e=this.Editor,n=e.BlockEvents,o=e.Listeners;o.on(t.holder,"keydown",(function(t){return n.keydown(t)}),!0),o.on(t.holder,"mouseup",(function(t){return n.mouseUp()})),o.on(t.holder,"mousedown",(function(t){return n.mouseDown(t)})),o.on(t.holder,"keyup",(function(t){return n.keyup(t)})),o.on(t.holder,"dragover",(function(t){return n.dragOver(t)})),o.on(t.holder,"dragleave",(function(t){return n.dragLeave(t)}))}},{key:"currentBlockIndex",get:function(){return this._currentBlockIndex},set:function(t){this._blocks[this._currentBlockIndex]&&this._blocks[this._currentBlockIndex].willUnselect(),this._blocks[t]&&this._blocks[t].willSelect(),this._currentBlockIndex=t}},{key:"firstBlock",get:function(){return this._blocks[0]}},{key:"lastBlock",get:function(){return this._blocks[this._blocks.length-1]}},{key:"currentBlock",get:function(){return this._blocks[this.currentBlockIndex]}},{key:"nextBlock",get:function(){return this.currentBlockIndex===this._blocks.length-1?null:this._blocks[this.currentBlockIndex+1]}},{key:"nextContentfulBlock",get:function(){return this.blocks.slice(this.currentBlockIndex+1).find((function(t){return!!t.inputs.length}))}},{key:"previousContentfulBlock",get:function(){return this.blocks.slice(0,this.currentBlockIndex).reverse().find((function(t){return!!t.inputs.length}))}},{key:"previousBlock",get:function(){return 0===this.currentBlockIndex?null:this._blocks[this.currentBlockIndex-1]}},{key:"blocks",get:function(){return this._blocks.array}},{key:"isEditorEmpty",get:function(){return this.blocks.every((function(t){return t.isEmpty}))}}]),e}(f.default);o.default=y,y.displayName="BlockManager",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7),n(14),n(13),n(28)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u,f,d){"use strict";var p=n(15),h=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=h(i),r=h(r),a=h(a),s=h(s),l=h(l),c=h(c),u=p(u),f=h(f),d=h(d);var v=function(t){function e(){var t;return(0,i.default)(this,e),(t=(0,a.default)(this,(0,s.default)(e).apply(this,arguments))).needToSelectAll=!1,t.nativeInputSelected=!1,t.readyToBlockSelection=!1,t}return(0,l.default)(e,t),(0,r.default)(e,[{key:"prepare",value:function(){var t=this;this.Editor.Shortcuts.add({name:"CMD+A",handler:function(e){t.Editor.BlockManager.currentBlock&&t.handleCommandA(e)}}),this.selection=new d.default}},{key:"unSelectBlockByIndex",value:function(t){var e=this.Editor.BlockManager;(isNaN(t)?e.currentBlock:e.getBlockByIndex(t)).selected=!1}},{key:"clearSelection",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.Editor,o=n.BlockManager,i=n.Caret,r=n.RectangleSelection;if(this.needToSelectAll=!1,this.nativeInputSelected=!1,this.readyToBlockSelection=!1,this.anyBlockSelected&&t&&t instanceof KeyboardEvent&&u.isPrintableKey(t.keyCode)){var a=o.removeSelectedBlocks();o.insertInitialBlockAtIndex(a,!0),i.setToBlock(o.currentBlock),u.delay((function(){i.insertContentAtCaretPosition(t.key)}),20)()}this.Editor.CrossBlockSelection.clear(t),this.anyBlockSelected&&!r.isRectActivated()?(e&&this.selection.restore(),this.allBlocksSelected=!1):this.Editor.RectangleSelection.clearSelection()}},{key:"copySelectedBlocks",value:function(){var t=this,e=f.default.make("div");this.selectedBlocks.forEach((function(n){var o=t.Editor.Sanitizer.clean(n.holder.innerHTML,t.sanitizerConfig),i=f.default.make("p");i.innerHTML=o,e.appendChild(i)})),u.copyTextToClipboard(e.innerHTML)}},{key:"selectBlockByIndex",value:function(t){var e,n=this.Editor.BlockManager;n.clearFocused(),e=isNaN(t)?n.currentBlock:n.getBlockByIndex(t),this.selection.save(),d.default.get().removeAllRanges(),e.selected=!0,this.Editor.InlineToolbar.close()}},{key:"handleCommandA",value:function(t){if(this.Editor.RectangleSelection.clearSelection(),!f.default.isNativeInput(t.target)||this.readyToBlockSelection){var e=this.Editor.BlockManager.getBlock(t.target).inputs;e.length>1&&!this.readyToBlockSelection?this.readyToBlockSelection=!0:1!==e.length||this.needToSelectAll?this.needToSelectAll?(t.preventDefault(),this.selectAllBlocks(),this.needToSelectAll=!1,this.readyToBlockSelection=!1,this.Editor.ConversionToolbar.close()):this.readyToBlockSelection&&(t.preventDefault(),this.selectBlockByIndex(),this.needToSelectAll=!0):this.needToSelectAll=!0}else this.readyToBlockSelection=!0}},{key:"selectAllBlocks",value:function(){this.selection.save(),d.default.get().removeAllRanges(),this.allBlocksSelected=!0,this.Editor.InlineToolbar.close()}},{key:"sanitizerConfig",get:function(){return{p:{},h1:{},h2:{},h3:{},h4:{},h5:{},h6:{},ol:{},ul:{},li:{},br:!0,img:{src:!0,width:!0,height:!0},a:{href:!0},b:{},i:{},u:{}}}},{key:"allBlocksSelected",get:function(){return this.Editor.BlockManager.blocks.every((function(t){return!0===t.selected}))},set:function(t){this.Editor.BlockManager.blocks.forEach((function(e){return e.selected=t}))}},{key:"anyBlockSelected",get:function(){return this.Editor.BlockManager.blocks.some((function(t){return!0===t.selected}))}},{key:"selectedBlocks",get:function(){return this.Editor.BlockManager.blocks.filter((function(t){return t.selected}))}}]),e}(c.default);o.default=v,v.displayName="BlockSelection",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(28),n(7),n(13),n(14)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u,f,d){"use strict";var p=n(15),h=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=h(i),r=h(r),a=h(a),s=h(s),l=h(l),c=h(c),u=h(u),f=h(f),d=p(d);var v=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"setToBlock",value:function(t){var e,n=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.positions.DEFAULT,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.Editor.BlockManager;switch(o){case this.positions.START:e=t.firstInput;break;case this.positions.END:e=t.lastInput;break;default:e=t.currentInput}if(e){var a=f.default.getDeepestNode(e,o===this.positions.END),s=f.default.getContentLength(a);switch(!0){case o===this.positions.START:i=0;break;case o===this.positions.END:case i>s:i=s}d.delay((function(){n.set(a,i)}),20)(),r.setCurrentBlockByChildNode(t.holder),r.currentBlock.currentInput=e}}},{key:"setToInput",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.positions.DEFAULT,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=this.Editor.BlockManager.currentBlock,i=f.default.getDeepestNode(t);switch(e){case this.positions.START:this.set(i,0);break;case this.positions.END:var r=f.default.getContentLength(i);this.set(i,r);break;default:n&&this.set(i,n)}o.currentInput=t}},{key:"set",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=document.createRange(),o=c.default.get();if(f.default.isNativeInput(t)){if(!f.default.canSetCaret(t))return;return t.focus(),void(t.selectionStart=t.selectionEnd=e)}n.setStart(t,e),n.setEnd(t,e),o.removeAllRanges(),o.addRange(n);var i=t.nodeType===Node.ELEMENT_NODE?t.getBoundingClientRect():n.getBoundingClientRect(),r=i.top,a=i.bottom,s=window,l=s.innerHeight;r<0&&window.scrollBy(0,r),a>l&&window.scrollBy(0,a-l)}},{key:"setToTheLastBlock",value:function(){var t=this.Editor.BlockManager.lastBlock;if(t)if(this.Editor.Tools.isInitial(t.tool)&&t.isEmpty)this.setToBlock(t);else{var e=this.Editor.BlockManager.insertAtEnd();this.setToBlock(e)}}},{key:"extractFragmentFromCaretPosition",value:function(){var t=c.default.get();if(t.rangeCount){var e=t.getRangeAt(0),n=this.Editor.BlockManager.currentBlock.currentInput;if(e.deleteContents(),n){var o=e.cloneRange();return o.selectNodeContents(n),o.setStart(e.endContainer,e.endOffset),o.extractContents()}}}},{key:"navigateNext",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.Editor.BlockManager,n=e.currentBlock,o=e.nextContentfulBlock,i=n.nextInput;return!(!o&&!i||!t&&!this.isAtEnd||(i?this.setToInput(i,this.positions.START):this.setToBlock(o,this.positions.START),0))}},{key:"navigatePrevious",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.Editor.BlockManager,n=e.currentBlock,o=e.previousContentfulBlock;if(!n)return!1;var i=n.previousInput;return!(!o&&!i||!t&&!this.isAtStart||(i?this.setToInput(i,this.positions.END):this.setToBlock(o,this.positions.END),0))}},{key:"createShadow",value:function(t){var n=document.createElement("span");n.classList.add(e.CSS.shadowCaret),t.insertAdjacentElement("beforeEnd",n)}},{key:"restoreCaret",value:function(t){var n=t.querySelector(".".concat(e.CSS.shadowCaret));n&&((new c.default).expandToTag(n),setTimeout((function(){var t=document.createRange();t.selectNode(n),t.extractContents()}),50))}},{key:"insertContentAtCaretPosition",value:function(t){var e=document.createDocumentFragment(),n=document.createElement("div"),o=c.default.get(),i=c.default.range;n.innerHTML=t,Array.from(n.childNodes).forEach((function(t){return e.appendChild(t)}));var r=e.lastChild;i.deleteContents(),i.insertNode(e);var a=document.createRange();a.setStart(r,r.textContent.length),o.removeAllRanges(),o.addRange(a)}},{key:"getHigherLevelSiblings",value:function(t,e){for(var n=t,o=[];n.parentNode&&"true"!==n.parentNode.contentEditable;)n=n.parentNode;for(var i="left"===e?"previousSibling":"nextSibling";n[i];)n=n[i],o.push(n);return o}},{key:"positions",get:function(){return{START:"start",END:"end",DEFAULT:"default"}}},{key:"isAtStart",get:function(){var t=c.default.get(),e=f.default.getDeepestNode(this.Editor.BlockManager.currentBlock.currentInput),n=t.focusNode;if(f.default.isNativeInput(e))return 0===e.selectionEnd;if(!t.anchorNode)return!1;var o=n.textContent.search(/\S/);-1===o&&(o=0);var i=t.focusOffset;return n.nodeType!==Node.TEXT_NODE&&n.childNodes.length&&(n.childNodes[i]?(n=n.childNodes[i],i=0):i=(n=n.childNodes[i-1]).textContent.length),!(!f.default.isLineBreakTag(e)&&!f.default.isEmpty(e)||!this.getHigherLevelSiblings(n,"left").every((function(t){var e=f.default.isLineBreakTag(t),n=1===t.children.length&&f.default.isLineBreakTag(t.children[0]),o=e||n;return f.default.isEmpty(t)&&!o}))||i!==o)||(null===e||n===e&&i<=o)}},{key:"isAtEnd",get:function(){var t=c.default.get(),e=t.focusNode,n=f.default.getDeepestNode(this.Editor.BlockManager.currentBlock.currentInput,!0);if(f.default.isNativeInput(n))return n.selectionEnd===n.value.length;if(!t.focusNode)return!1;var o=t.focusOffset;if(e.nodeType!==Node.TEXT_NODE&&e.childNodes.length&&(e.childNodes[o-1]?o=(e=e.childNodes[o-1]).textContent.length:(e=e.childNodes[0],o=0)),f.default.isLineBreakTag(n)||f.default.isEmpty(n)){var i=this.getHigherLevelSiblings(e,"right");if(i.every((function(t,e){return e===i.length-1&&f.default.isLineBreakTag(t)||f.default.isEmpty(t)&&!f.default.isLineBreakTag(t)}))&&o===e.textContent.length)return!0}var r=n.textContent.replace(/\s+$/,"");return e===n&&o>=r.length}}],[{key:"CSS",get:function(){return{shadowCaret:"cdx-shadow-caret"}}}]),e}(u.default);o.default=v,v.displayName="Caret",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7),n(28),n(14)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u,f){"use strict";var d=n(15),p=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=p(i),r=p(r),a=p(a),s=p(s),l=p(l),c=p(c),u=p(u),f=d(f);var h=function(t){function e(){var t;return(0,i.default)(this,e),(t=(0,a.default)(this,(0,s.default)(e).apply(this,arguments))).onMouseUp=function(){var e=t.Editor.Listeners;e.off(document,"mouseover",t.onMouseOver),e.off(document,"mouseup",t.onMouseUp)},t.onMouseOver=function(e){var n=t.Editor.BlockManager,o=n.getBlockByChildNode(e.relatedTarget)||t.lastSelectedBlock,i=n.getBlockByChildNode(e.target);if(o&&i&&i!==o){if(o===t.firstSelectedBlock)return u.default.get().removeAllRanges(),o.selected=!0,void(i.selected=!0);if(i===t.firstSelectedBlock)return o.selected=!1,void(i.selected=!1);t.Editor.InlineToolbar.close(),t.toggleBlocksSelectedState(o,i),t.lastSelectedBlock=i}},t}return(0,l.default)(e,t),(0,r.default)(e,[{key:"watchSelection",value:function(t){if(t.button===f.mouseButtons.LEFT){var e=this.Editor,n=e.BlockManager,o=(e.UI,e.Listeners);this.firstSelectedBlock=n.getBlock(t.target),this.lastSelectedBlock=this.firstSelectedBlock,o.on(document,"mouseover",this.onMouseOver),o.on(document,"mouseup",this.onMouseUp)}}},{key:"toggleBlockSelectedState",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.Editor.BlockManager;this.lastSelectedBlock||(this.lastSelectedBlock=this.firstSelectedBlock=e.currentBlock),this.firstSelectedBlock===this.lastSelectedBlock&&(this.firstSelectedBlock.selected=!0,u.default.get().removeAllRanges());var n=e.blocks.indexOf(this.lastSelectedBlock)+(t?1:-1),o=e.blocks[n];o&&(this.lastSelectedBlock.selected!==o.selected?o.selected=!0:this.lastSelectedBlock.selected=!1,this.lastSelectedBlock=o,this.Editor.InlineToolbar.close())}},{key:"clear",value:function(t){var e=this.Editor,n=e.BlockManager,o=e.BlockSelection,i=e.Caret,r=n.blocks.indexOf(this.firstSelectedBlock),a=n.blocks.indexOf(this.lastSelectedBlock);if(o.anyBlockSelected&&r>-1&&a>-1)if(t&&t instanceof KeyboardEvent)switch(t.keyCode){case f.keyCodes.DOWN:case f.keyCodes.RIGHT:i.setToBlock(n.blocks[Math.max(r,a)],i.positions.END);break;case f.keyCodes.UP:case f.keyCodes.LEFT:i.setToBlock(n.blocks[Math.min(r,a)],i.positions.START);break;default:i.setToBlock(n.blocks[Math.max(r,a)],i.positions.END)}else i.setToBlock(n.blocks[Math.max(r,a)],i.positions.END);this.firstSelectedBlock=this.lastSelectedBlock=null}},{key:"toggleBlocksSelectedState",value:function(t,e){for(var n=this.Editor.BlockManager,o=n.blocks.indexOf(t),i=n.blocks.indexOf(e),r=t.selected!==e.selected,a=Math.min(o,i);a<=Math.max(o,i);a++){var s=n.blocks[a];s!==this.firstSelectedBlock&&s!==(r?t:e)&&(n.blocks[a].selected=!n.blocks[a].selected)}}},{key:"isCrossBlockSelectionStarted",get:function(){return!!this.firstSelectedBlock&&!!this.lastSelectedBlock}}]),e}(c.default);o.default=h,h.displayName="CrossBlockSelection",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(27),n(2),n(3),n(4),n(5),n(6),n(28),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u,f){"use strict";var d=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=d(i),r=d(r),a=d(a),s=d(s),l=d(l),c=d(c),u=d(u);var p=function(t){function e(){var t;return(0,r.default)(this,e),(t=(0,s.default)(this,(0,l.default)(e).apply(this,arguments))).isStartedAtEditor=!1,t.processDrop=function(e){var n,o,r,a,s,l;return i.default.async((function(i){for(;;)switch(i.prev=i.next){case 0:n=t.Editor,o=n.BlockManager,r=n.Caret,a=n.Paste,e.preventDefault(),o.blocks.forEach((function(t){return t.dropTarget=!1})),u.default.isAtEditor&&!u.default.isCollapsed&&t.isStartedAtEditor&&document.execCommand("delete"),t.isStartedAtEditor=!1;try{s=o.setCurrentBlockByChildNode(e.target),t.Editor.Caret.setToBlock(s,r.positions.END)}catch(e){l=o.setCurrentBlockByChildNode(o.lastBlock.holder),t.Editor.Caret.setToBlock(l,r.positions.END)}a.processDataTransfer(e.dataTransfer,!0);case 7:case"end":return i.stop()}}))},t}return(0,c.default)(e,t),(0,a.default)(e,[{key:"prepare",value:function(){this.bindEvents()}},{key:"bindEvents",value:function(){var t=this;this.Editor.Listeners.on(this.Editor.UI.nodes.holder,"drop",this.processDrop,!0),this.Editor.Listeners.on(this.Editor.UI.nodes.holder,"dragstart",(function(e){u.default.isAtEditor&&!u.default.isCollapsed&&(t.isStartedAtEditor=!0),t.Editor.InlineToolbar.close()})),this.Editor.Listeners.on(this.Editor.UI.nodes.holder,"dragover",(function(t){return t.preventDefault()}),!0)}}]),e}((f=d(f)).default);o.default=p,p.displayName="DragNDrop",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c){"use strict";var u=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=u(i),r=u(r),a=u(a),s=u(s),l=u(l);var f=function(t){function e(){var t;return(0,i.default)(this,e),(t=(0,a.default)(this,(0,s.default)(e).apply(this,arguments))).subscribers={},t}return(0,l.default)(e,t),(0,r.default)(e,[{key:"on",value:function(t,e){t in this.subscribers||(this.subscribers[t]=[]),this.subscribers[t].push(e)}},{key:"once",value:function(t,e){var n=this;t in this.subscribers||(this.subscribers[t]=[]),this.subscribers[t].push((function o(i){var r=e(i),a=n.subscribers[t].indexOf(o);return-1!==a&&n.subscribers[t].splice(a,1),r}))}},{key:"emit",value:function(t,e){this.subscribers[t]&&this.subscribers[t].reduce((function(t,e){var n=e(t);return n||t}),e)}},{key:"off",value:function(t,e){for(var n=0;n3&&void 0!==arguments[3]&&arguments[3],i={element:t,eventType:e,handler:n,options:o},r=this.findOne(t,e,n);r||(this.allListeners.push(i),t.addEventListener(e,n,o))}},{key:"off",value:function(t,e,n,o){var i=this,r=this.findAll(t,e,n);r.forEach((function(t,e){var n=i.allListeners.indexOf(r[e]);n>0&&(i.allListeners.splice(n,1),t.element.removeEventListener(t.eventType,t.handler,t.options))}))}},{key:"findOne",value:function(t,e,n){var o=this.findAll(t,e,n);return o.length>0?o[0]:null}},{key:"findAll",value:function(t,e,n){var o=t?this.findByEventTarget(t):[];return t&&e&&n?o.filter((function(t){return t.eventType===e&&t.handler===n})):t&&e?o.filter((function(t){return t.eventType===e})):o}},{key:"removeAll",value:function(){this.allListeners.map((function(t){t.element.removeEventListener(t.eventType,t.handler,t.options)})),this.allListeners=[]}},{key:"findByEventTarget",value:function(t){return this.allListeners.filter((function(e){if(e.element===t)return e}))}},{key:"findByType",value:function(t){return this.allListeners.filter((function(e){if(e.eventType===t)return e}))}},{key:"findByHandler",value:function(t){return this.allListeners.filter((function(e){if(e.handler===t)return e}))}}]),e}((c=u(c)).default);o.default=f,f.displayName="Listeners",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(27),n(2),n(3),n(4),n(5),n(6),n(7),n(14),n(59)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u,f,d){"use strict";var p=n(15),h=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=h(i),r=h(r),a=h(a),s=h(s),l=h(l),c=h(c),u=h(u),f=p(f),d=h(d);var v=function(t){function e(){var t;return(0,r.default)(this,e),(t=(0,s.default)(this,(0,l.default)(e).apply(this,arguments))).mutationDebouncer=f.debounce((function(){t.updateNativeInputs(),t.config.onChange()}),e.DebounceTimer),t.nativeInputs=[],t}return(0,c.default)(e,t),(0,a.default)(e,[{key:"destroy",value:function(){var t=this;this.mutationDebouncer=null,this.observer&&this.observer.disconnect(),this.observer=null,this.nativeInputs.forEach((function(e){return t.Editor.Listeners.off(e,"input",t.mutationDebouncer)}))}},{key:"prepare",value:function(){var t=this;return i.default.async((function(e){for(;;)switch(e.prev=e.next){case 0:window.setTimeout((function(){t.setObserver()}),1e3);case 1:case"end":return e.stop()}}))}},{key:"disable",value:function(){this.disabled=!0}},{key:"enable",value:function(){this.disabled=!1}},{key:"setObserver",value:function(){var t=this,e=this.Editor.UI;this.observer=new MutationObserver((function(e,n){t.mutationHandler(e,n)})),this.observer.observe(e.nodes.redactor,{childList:!0,attributes:!0,subtree:!0,characterData:!0,characterDataOldValue:!0})}},{key:"mutationHandler",value:function(t,e){if(!this.disabled){var n=!1;t.forEach((function(t){switch(t.type){case"childList":case"subtree":case"characterData":case"characterDataOldValue":n=!0;break;case"attributes":if(!t.target.classList.contains(d.default.CSS.wrapper))return void(n=!0)}})),n&&this.mutationDebouncer()}}},{key:"updateNativeInputs",value:function(){var t=this;this.nativeInputs&&this.nativeInputs.forEach((function(e){t.Editor.Listeners.off(e,"input")})),this.nativeInputs=Array.from(this.Editor.UI.nodes.redactor.querySelectorAll("textarea, input, select")),this.nativeInputs.forEach((function(e){return t.Editor.Listeners.on(e,"input",t.mutationDebouncer)}))}}]),e}(u.default);o.default=v,v.displayName="ModificationsObserver",v.DebounceTimer=450,t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7),n(364)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u){"use strict";var f=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=f(i),r=f(r),a=f(a),s=f(s),l=f(l),c=f(c),u=f(u);var d=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"show",value:function(t){u.default.show(t)}}]),e}(c.default);o.default=d,d.displayName="Notifier",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(103),n(27),n(50),n(2),n(3),n(4),n(5),n(6),n(7),n(13),n(14)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u,f,d,p,h){"use strict";var v=n(15),g=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=g(i),r=g(r),a=g(a),s=g(s),l=g(l),c=g(c),u=g(u),f=g(f),d=g(d),p=g(p),h=v(h);var y=function(t){function e(){var t;return(0,s.default)(this,e),(t=(0,c.default)(this,(0,u.default)(e).apply(this,arguments))).toolsTags={},t.tagsByTool={},t.toolsPatterns=[],t.toolsFiles={},t.exceptionList=[],t.processTool=function(e){var n=(0,a.default)(e,2),o=n[0],i=n[1];try{var r=new t.Editor.Tools.blockTools[o]({api:t.Editor.API.methods,config:{},data:{}});if(!1===i.pasteConfig)return void t.exceptionList.push(o);if("function"!=typeof r.onPaste)return;var s=i.pasteConfig||{};t.getTagsConfig(o,s),t.getFilesConfig(o,s),t.getPatternsConfig(o,s)}catch(t){h.log("Paste handling for «".concat(o,"» Tool hasn't been set up because of the error"),"warn",t)}},t.handlePasteEvent=function(e){var n,o,i;return r.default.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=t.Editor,o=n.BlockManager,i=n.Toolbar,o.currentBlock&&(!t.isNativeBehaviour(e.target)||e.clipboardData.types.includes("Files"))){r.next=3;break}return r.abrupt("return");case 3:if(!o.currentBlock||!t.exceptionList.includes(o.currentBlock.name)){r.next=5;break}return r.abrupt("return");case 5:e.preventDefault(),t.processDataTransfer(e.clipboardData),o.clearFocused(),i.close();case 9:case"end":return r.stop()}}))},t}return(0,f.default)(e,t),(0,l.default)(e,[{key:"prepare",value:function(){return r.default.async((function(t){for(;;)switch(t.prev=t.next){case 0:this.setCallback(),this.processTools();case 2:case"end":return t.stop()}}),null,this)}},{key:"processDataTransfer",value:function(t){var e,n,o,i,a,s,l,c,u=arguments;return r.default.async((function(f){for(;;)switch(f.prev=f.next){case 0:if(e=u.length>1&&void 0!==u[1]&&u[1],n=this.Editor.Sanitizer,!((o=t.types).includes?o.includes("Files"):o.contains("Files"))){f.next=8;break}return f.next=7,r.default.awrap(this.processFiles(t.files));case 7:return f.abrupt("return");case 8:if(i=t.getData("text/plain"),a=t.getData("text/html"),e&&i.trim()&&a.trim()&&(a="

"+(a.trim()?a:i)+"

"),s=Object.keys(this.toolsTags).reduce((function(t,e){return t[e.toLowerCase()]=!0,t}),{}),l=Object.assign({},s,n.getAllInlineToolsConfig(),{br:{}}),(c=n.clean(a,l)).trim()&&c.trim()!==i&&p.default.isHTMLString(c)){f.next=19;break}return f.next=17,r.default.awrap(this.processText(i));case 17:f.next=21;break;case 19:return f.next=21,r.default.awrap(this.processText(c,!0));case 21:case"end":return f.stop()}}),null,this)}},{key:"processText",value:function(t){var e,n,o,i,a,s,l,c,u=this,f=arguments;return r.default.async((function(d){for(;;)switch(d.prev=d.next){case 0:if(e=f.length>1&&void 0!==f[1]&&f[1],n=this.Editor,o=n.Caret,i=n.BlockManager,a=n.Tools,(s=e?this.processHTML(t):this.processPlain(t)).length){d.next=5;break}return d.abrupt("return");case 5:if(1!==s.length){d.next=8;break}return s[0].isBlock?this.processSingleBlock(s.pop()):this.processInlinePaste(s.pop()),d.abrupt("return");case 8:return l=i.currentBlock&&a.isInitial(i.currentBlock.tool),c=l&&i.currentBlock.isEmpty,d.next=12,r.default.awrap(Promise.all(s.map((function(t,e){return r.default.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,r.default.awrap(u.insertBlock(t,0===e&&c));case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}))}))));case 12:i.currentBlock&&o.setToBlock(i.currentBlock,o.positions.END);case 13:case"end":return d.stop()}}),null,this)}},{key:"setCallback",value:function(){this.Editor.Listeners.on(document,"paste",this.handlePasteEvent)}},{key:"processTools",value:function(){var t=this.Editor.Tools.blockTools;Object.entries(t).forEach(this.processTool)}},{key:"getTagsConfig",value:function(t,e){var n=this,o=e.tags||[];o.forEach((function(e){n.toolsTags.hasOwnProperty(e)?h.log("Paste handler for «".concat(t,"» Tool on «").concat(e,"» tag is skipped ")+"because it is already used by «".concat(n.toolsTags[e].tool,"» Tool."),"warn"):n.toolsTags[e.toUpperCase()]={tool:t}})),this.tagsByTool[t]=o.map((function(t){return t.toUpperCase()}))}},{key:"getFilesConfig",value:function(t,e){var n=e.files,o=void 0===n?{}:n,i=o.extensions,r=o.mimeTypes;(i||r)&&(i&&!Array.isArray(i)&&(h.log("«extensions» property of the onDrop config for «".concat(t,"» Tool should be an array")),i=[]),r&&!Array.isArray(r)&&(h.log("«mimeTypes» property of the onDrop config for «".concat(t,"» Tool should be an array")),r=[]),r&&(r=r.filter((function(e){return!!h.isValidMimeType(e)||(h.log("MIME type value «".concat(e,"» for the «").concat(t,"» Tool is not a valid MIME type"),"warn"),!1)}))),this.toolsFiles[t]={extensions:i||[],mimeTypes:r||[]})}},{key:"getPatternsConfig",value:function(t,e){var n=this;e.patterns&&!h.isEmpty(e.patterns)&&Object.entries(e.patterns).forEach((function(e){var o=(0,a.default)(e,2),i=o[0],r=o[1];r instanceof RegExp||h.log("Pattern ".concat(r," for «").concat(t,"» Tool is skipped because it should be a Regexp instance."),"warn"),n.toolsPatterns.push({key:i,pattern:r,tool:t})}))}},{key:"isNativeBehaviour",value:function(t){return p.default.isNativeInput(t)}},{key:"processFiles",value:function(t){var e,n,o,i,a,s,l=this;return r.default.async((function(c){for(;;)switch(c.prev=c.next){case 0:return e=this.Editor,n=e.BlockManager,o=e.Tools,c.next=3,r.default.awrap(Promise.all(Array.from(t).map((function(t){return l.processFile(t)}))));case 3:i=(i=c.sent).filter((function(t){return!!t})),a=o.isInitial(n.currentBlock.tool),s=a&&n.currentBlock.isEmpty,i.forEach((function(t,e){n.paste(t.type,t.event,0===e&&s)}));case 8:case"end":return c.stop()}}),null,this)}},{key:"processFile",value:function(t){var e,n,o,i,s;return r.default.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(e=h.getFileExtension(t),n=Object.entries(this.toolsFiles).find((function(n){var o=(0,a.default)(n,2),i=(o[0],o[1]),r=i.mimeTypes,s=i.extensions,l=t.type.split("/"),c=(0,a.default)(l,2),u=c[0],f=c[1],d=s.find((function(t){return t.toLowerCase()===e.toLowerCase()})),p=r.find((function(t){var e=t.split("/"),n=(0,a.default)(e,2),o=n[0],i=n[1];return o===u&&(i===f||"*"===i)}));return!!d||!!p}))){r.next=4;break}return r.abrupt("return");case 4:return o=(0,a.default)(n,1),i=o[0],s=this.composePasteEvent("file",{file:t}),r.abrupt("return",{event:s,type:i});case 7:case"end":return r.stop()}}),null,this)}},{key:"processHTML",value:function(t){var e=this,n=this.Editor,o=n.Tools,i=n.Sanitizer,r=this.config.initialBlock,a=p.default.make("DIV");return a.innerHTML=t,this.getNodes(a).map((function(t){var n,a=r,s=!1;switch(t.nodeType){case Node.DOCUMENT_FRAGMENT_NODE:(n=p.default.make("div")).appendChild(t);break;case Node.ELEMENT_NODE:n=t,s=!0,e.toolsTags[n.tagName]&&(a=e.toolsTags[n.tagName].tool)}var l=o.blockTools[a].pasteConfig.tags.reduce((function(t,e){return t[e.toLowerCase()]={},t}),{}),c=Object.assign({},l,i.getInlineToolsConfig(a));return n.innerHTML=i.clean(n.innerHTML,c),{content:n,isBlock:s,tool:a,event:e.composePasteEvent("tag",{data:n})}})).filter((function(t){return!p.default.isNodeEmpty(t.content)||p.default.isSingleTag(t.content)}))}},{key:"processPlain",value:function(t){var e=this,n=this.config.initialBlock;if(this.Editor.Tools,!t)return[];var o=n;return t.split(/\r?\n/).filter((function(t){return t.trim()})).map((function(t){var n=p.default.make("div");n.innerHTML=t;var i=e.composePasteEvent("tag",{data:n});return{content:n,tool:o,isBlock:!1,event:i}}))}},{key:"processSingleBlock",value:function(t){var e,n,o,i,a;return r.default.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(e=this.Editor,n=e.Caret,o=e.BlockManager,i=e.Tools,(a=o.currentBlock)&&t.tool===a.name&&p.default.containsOnlyInlineElements(t.content.innerHTML)){r.next=5;break}return this.insertBlock(t,a&&i.isInitial(a.tool)&&a.isEmpty),r.abrupt("return");case 5:n.insertContentAtCaretPosition(t.content.innerHTML);case 6:case"end":return r.stop()}}),null,this)}},{key:"processInlinePaste",value:function(t){var n,o,i,a,s,l,c,u,f,d;return r.default.async((function(p){for(;;)switch(p.prev=p.next){case 0:if(n=this.Editor,o=n.BlockManager,i=n.Caret,a=n.Sanitizer,s=n.Tools,l=t.content,t.tool,!(o.currentBlock&&s.isInitial(o.currentBlock.tool)&&l.textContent.length1&&void 0!==l[1]&&l[1],n=this.Editor,o=n.BlockManager,i=n.Caret,a=o.currentBlock,!(e&&a&&a.isEmpty)){r.next=7;break}return s=o.paste(t.tool,t.event,!0),i.setToBlock(s,i.positions.END),r.abrupt("return");case 7:s=o.paste(t.tool,t.event),i.setToBlock(s,i.positions.END);case 9:case"end":return r.stop()}}),null,this)}},{key:"getNodes",value:function(t){var e=this,n=Array.from(t.childNodes),o=Object.keys(this.toolsTags);return n.reduce((function t(n,r){if(p.default.isEmpty(r)&&!p.default.isSingleTag(r))return n;var a=n[n.length-1],s=new DocumentFragment;switch(a&&p.default.isFragment(a)&&(s=n.pop()),r.nodeType){case Node.ELEMENT_NODE:var l=r;if("BR"===l.tagName)return[].concat((0,i.default)(n),[s,new DocumentFragment]);var c=(e.toolsTags[l.tagName]||{}).tool,u=void 0===c?"":c,f=e.tagsByTool[u]||[],d=o.includes(l.tagName),h=p.default.blockElements.includes(l.tagName.toLowerCase()),v=Array.from(l.children).some((function(t){var e=t.tagName;return o.includes(e)&&!f.includes(e)})),g=Array.from(l.children).some((function(t){var e=t.tagName;return p.default.blockElements.includes(e.toLowerCase())}));if(!h&&!d&&!v)return s.appendChild(l),[].concat((0,i.default)(n),[s]);if(d&&!v||h&&!g&&!v)return[].concat((0,i.default)(n),[s,l]);break;case Node.TEXT_NODE:return s.appendChild(r),[].concat((0,i.default)(n),[s]);default:return[].concat((0,i.default)(n),[s])}return[].concat((0,i.default)(n),(0,i.default)(Array.from(r.childNodes).reduce(t,[])))}),[])}},{key:"composePasteEvent",value:function(t,e){return new CustomEvent(t,{detail:e})}}]),e}(d.default);o.default=y,y.displayName="Paste",y.PATTERN_PROCESSING_MAX_LENGTH=450,t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7),n(13),n(28),n(59)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u,f,d){"use strict";var p=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=p(i),r=p(r),a=p(a),s=p(s),l=p(l),c=p(c),u=p(u),f=p(f),d=p(d);var h=function(t){function e(){var t;return(0,i.default)(this,e),(t=(0,a.default)(this,(0,s.default)(e).apply(this,arguments))).isRectSelectionActivated=!1,t.SCROLL_SPEED=3,t.HEIGHT_OF_SCROLL_ZONE=40,t.BOTTOM_SCROLL_ZONE=1,t.TOP_SCROLL_ZONE=2,t.MAIN_MOUSE_BUTTON=0,t.mousedown=!1,t.isScrolling=!1,t.inScrollZone=null,t.startX=0,t.startY=0,t.mouseX=0,t.mouseY=0,t.stackOfSelected=[],t}return(0,l.default)(e,t),(0,r.default)(e,[{key:"prepare",value:function(){var t=this,e=this.Editor.Listeners,n=this.genHTML().container;e.on(n,"mousedown",(function(e){e.button===t.MAIN_MOUSE_BUTTON&&t.startSelection(e.pageX,e.pageY)}),!1),e.on(document.body,"mousemove",(function(e){t.changingRectangle(e),t.scrollByZones(e.clientY)}),!1),e.on(document.body,"mouseleave",(function(){t.clearSelection(),t.endSelection()})),e.on(window,"scroll",(function(e){t.changingRectangle(e)}),!1),e.on(document.body,"mouseup",(function(){t.endSelection()}),!1)}},{key:"startSelection",value:function(t,e){this.Editor.BlockSelection.allBlocksSelected=!1,this.clearSelection(),this.stackOfSelected=[];var n=document.elementFromPoint(t-window.pageXOffset,e-window.pageYOffset),o=[".".concat(d.default.CSS.content),".".concat(this.Editor.Toolbar.CSS.toolbar),".".concat(this.Editor.InlineToolbar.CSS.inlineToolbar)],i=n.closest("."+this.Editor.UI.CSS.editorWrapper),r=o.some((function(t){return!!n.closest(t)}));i&&!r&&(this.mousedown=!0,this.startX=t,this.startY=e)}},{key:"endSelection",value:function(){this.mousedown=!1,this.startX=0,this.startY=0,this.overlayRectangle.style.display="none"}},{key:"isRectActivated",value:function(){return this.isRectSelectionActivated}},{key:"clearSelection",value:function(){this.isRectSelectionActivated=!1}},{key:"scrollByZones",value:function(t){this.inScrollZone=null,t<=this.HEIGHT_OF_SCROLL_ZONE&&(this.inScrollZone=this.TOP_SCROLL_ZONE),document.documentElement.clientHeight-t<=this.HEIGHT_OF_SCROLL_ZONE&&(this.inScrollZone=this.BOTTOM_SCROLL_ZONE),this.inScrollZone?this.isScrolling||(this.scrollVertical(this.inScrollZone===this.TOP_SCROLL_ZONE?-this.SCROLL_SPEED:this.SCROLL_SPEED),this.isScrolling=!0):this.isScrolling=!1}},{key:"genHTML",value:function(){var t=this.Editor.UI,n=t.nodes.holder.querySelector("."+t.CSS.editorWrapper),o=u.default.make("div",e.CSS.overlay,{}),i=u.default.make("div",e.CSS.overlayContainer,{}),r=u.default.make("div",e.CSS.rect,{});return i.appendChild(r),o.appendChild(i),n.appendChild(o),this.overlayRectangle=r,{container:n,overlay:o}}},{key:"scrollVertical",value:function(t){var e=this;if(this.inScrollZone&&this.mousedown){var n=window.pageYOffset;window.scrollBy(0,t),this.mouseY+=window.pageYOffset-n,setTimeout((function(){e.scrollVertical(t)}),0)}}},{key:"changingRectangle",value:function(t){if(this.mousedown){void 0!==t.pageY&&(this.mouseX=t.pageX,this.mouseY=t.pageY);var e=this.genInfoForMouseSelection(),n=e.rightPos,o=e.leftPos,i=e.index,r=this.startX>n&&this.mouseX>n,a=this.startX=this.startY?(this.overlayRectangle.style.top="".concat(this.startY-window.pageYOffset,"px"),this.overlayRectangle.style.bottom="calc(100% - ".concat(this.mouseY-window.pageYOffset,"px")):(this.overlayRectangle.style.bottom="calc(100% - ".concat(this.startY-window.pageYOffset,"px"),this.overlayRectangle.style.top="".concat(this.mouseY-window.pageYOffset,"px")),this.mouseX>=this.startX?(this.overlayRectangle.style.left="".concat(this.startX-window.pageXOffset,"px"),this.overlayRectangle.style.right="calc(100% - ".concat(this.mouseX-window.pageXOffset,"px")):(this.overlayRectangle.style.right="calc(100% - ".concat(this.startX-window.pageXOffset,"px"),this.overlayRectangle.style.left="".concat(this.mouseX-window.pageXOffset,"px"))}},{key:"genInfoForMouseSelection",value:function(){var t,e=document.body.offsetWidth/2,n=this.mouseY-window.pageYOffset,o=document.elementFromPoint(e,n),i=this.Editor.BlockManager.getBlockByChildNode(o);void 0!==i&&(t=this.Editor.BlockManager.blocks.findIndex((function(t){return t.holder===i.holder})));var r=this.Editor.BlockManager.lastBlock.holder.querySelector("."+d.default.CSS.content),a=Number.parseInt(window.getComputedStyle(r).width,10)/2;return{index:t,leftPos:e-a,rightPos:e+a}}},{key:"addBlockInSelection",value:function(t){this.rectCrossesBlocks&&this.Editor.BlockSelection.selectBlockByIndex(t),this.stackOfSelected.push(t)}},{key:"trySelectNextBlock",value:function(t){var e=this,n=this.stackOfSelected[this.stackOfSelected.length-1]===t,o=this.stackOfSelected.length;if(!n){var i=this.stackOfSelected[o-1]-this.stackOfSelected[o-2]>0,r=o<=1?0:i?1:-1,a=t>this.stackOfSelected[o-1]&&1===r,s=tthis.stackOfSelected[o-1]||void 0===this.stackOfSelected[o-1])){if(!l&&t=t;c--)this.addBlockInSelection(c);else if(l){var u,f=o-1;for(u=t>this.stackOfSelected[o-1]?function(){return t>e.stackOfSelected[f]}:function(){return t1&&void 0!==arguments[1]?arguments[1]:{},n={tags:e},o=this.createHTMLJanitorInstance(n);return o.clean(t)}},{key:"composeToolConfig",value:function(t){if(this.configCache[t])return this.configCache[t];var e=this.Editor.Tools.INTERNAL_SETTINGS.SANITIZE_CONFIG,n=this.Editor.Tools.available[t],o=this.getInlineToolsConfig(t);if(!n.sanitize||n[e]&&d.isEmpty(n[e]))return o;var i=n.sanitize,a={};for(var s in i)if(i.hasOwnProperty(s)){var l=i[s];"object"===(0,r.default)(l)?a[s]=Object.assign({},o,l):a[s]=l}return this.configCache[t]=a,a}},{key:"getInlineToolsConfig",value:function(t){var e=this.Editor.Tools,n=e.getToolSettings(t).inlineToolbar||[],o={};return"boolean"==typeof n&&n?o=this.getAllInlineToolsConfig():n.map((function(t){o=Object.assign(o,e.inline[t][e.INTERNAL_SETTINGS.SANITIZE_CONFIG])})),o}},{key:"getAllInlineToolsConfig",value:function(){var t=this.Editor.Tools;if(this.inlineToolsConfigCache)return this.inlineToolsConfigCache;var e={};return Object.entries(t.inline).forEach((function(n){var o=(0,i.default)(n,2),r=(o[0],o[1]);Object.assign(e,r[t.INTERNAL_SETTINGS.SANITIZE_CONFIG])})),this.inlineToolsConfigCache=e,this.inlineToolsConfigCache}},{key:"cleanArray",value:function(t,e){var n=this;return t.map((function(t){return n.deepSanitize(t,e)}))}},{key:"cleanObject",value:function(t,e){var n={};for(var o in t)if(t.hasOwnProperty(o)){var i=t[o],r=this.isRule(e[o])?e[o]:e;n[o]=this.deepSanitize(i,r)}return n}},{key:"cleanOneItem",value:function(t,e){return"object"===(0,r.default)(e)?this.clean(t,e):!1===e?this.clean(t,{}):t}},{key:"isRule",value:function(t){return"object"===(0,r.default)(t)||"boolean"==typeof t||"function"==typeof t} +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.EditorJS=e():t.EditorJS=e()}(window,(function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=171)}([function(t,e,n){var o=n(8),i=n(17),r=n(24),a=n(21),s=n(29),l=function(t,e,n){var c,u,f,d,p=t&l.F,h=t&l.G,v=t&l.S,g=t&l.P,y=t&l.B,b=h?o:v?o[e]||(o[e]={}):(o[e]||{}).prototype,m=h?i:i[e]||(i[e]={}),k=m.prototype||(m.prototype={});for(c in h&&(n=e),n)f=((u=!p&&b&&void 0!==b[c])?b:n)[c],d=y&&u?s(f,o):g&&"function"==typeof f?s(Function.call,f):f,b&&a(b,c,f,t&l.U),m[c]!=f&&r(m,c,d),g&&k[c]!=f&&(k[c]=f)};o.core=i,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,t.exports=l},function(t,e){t.exports=function(t){return t&&t.__esModule?t:{default:t}}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=document.createElement(t);for(var a in Array.isArray(n)?(e=i.classList).add.apply(e,(0,r.default)(n)):n&&i.classList.add(n),o)o.hasOwnProperty(a)&&(i[a]=o[a]);return i}},{key:"text",value:function(t){return document.createTextNode(t)}},{key:"svg",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:14,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:14,o=document.createElementNS("http://www.w3.org/2000/svg","svg");return o.classList.add("icon","icon--"+t),o.setAttribute("width",e+"px"),o.setAttribute("height",n+"px"),o.innerHTML=''),o}},{key:"append",value:function(t,e){Array.isArray(e)?e.forEach((function(e){return t.appendChild(e)})):t.appendChild(e)}},{key:"prepend",value:function(t,e){Array.isArray(e)?(e=e.reverse()).forEach((function(e){return t.prepend(e)})):t.prepend(e)}},{key:"swap",value:function(t,e){var n=document.createElement("div"),o=t.parentNode;o.insertBefore(n,t),o.insertBefore(t,e),o.insertBefore(e,n),o.removeChild(n)}},{key:"find",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=arguments.length>1?arguments[1]:void 0;return t.querySelector(e)}},{key:"get",value:function(t){return document.getElementById(t)}},{key:"findAll",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=arguments.length>1?arguments[1]:void 0;return t.querySelectorAll(e)}},{key:"getDeepestNode",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=n?"lastChild":"firstChild",i=n?"previousSibling":"nextSibling";if(e&&e.nodeType===Node.ELEMENT_NODE&&e[o]){var r=e[o];if(t.isSingleTag(r)&&!t.isNativeInput(r)&&!t.isLineBreakTag(r))if(r[i])r=r[i];else{if(!r.parentNode[i])return r.parentNode;r=r.parentNode[i]}return this.getDeepestNode(r,n)}return e}},{key:"isElement",value:function(t){return t&&"object"===(0,i.default)(t)&&t.nodeType&&t.nodeType===Node.ELEMENT_NODE}},{key:"isFragment",value:function(t){return t&&"object"===(0,i.default)(t)&&t.nodeType&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE}},{key:"isContentEditable",value:function(t){return"true"===t.contentEditable}},{key:"isNativeInput",value:function(t){return!(!t||!t.tagName)&&["INPUT","TEXTAREA"].includes(t.tagName)}},{key:"canSetCaret",value:function(e){var n=!0;if(t.isNativeInput(e))switch(e.type){case"file":case"checkbox":case"radio":case"hidden":case"submit":case"button":case"image":case"reset":n=!1}else n=t.isContentEditable(e);return n}},{key:"isNodeEmpty",value:function(t){return!(this.isSingleTag(t)&&!this.isLineBreakTag(t))&&0===(this.isElement(t)&&this.isNativeInput(t)?t.value:t.textContent.replace("​","")).trim().length}},{key:"isLeaf",value:function(t){return!!t&&0===t.childNodes.length}},{key:"isEmpty",value:function(t){var e=this,n=[],o=[];if(!t)return!0;if(!t.childNodes.length)return this.isNodeEmpty(t);for(t.normalize(),n.push(t.firstChild);n.length>0;)if(t=n.shift()){for(this.isLeaf(t)?o.push(t):n.push(t.firstChild);t&&t.nextSibling;)(t=t.nextSibling)&&n.push(t);if(t&&!this.isNodeEmpty(t))return!1}return o.every((function(t){return e.isNodeEmpty(t)}))}},{key:"isHTMLString",value:function(e){var n=t.make("div");return n.innerHTML=e,n.childElementCount>0}},{key:"getContentLength",value:function(e){return t.isNativeInput(e)?e.value.length:e.nodeType===Node.TEXT_NODE?e.length:e.textContent.length}},{key:"containsOnlyInlineElements",value:function(e){var n;return"string"==typeof e?(n=document.createElement("div")).innerHTML=e:n=e,Array.from(n.children).every((function e(n){return!t.blockElements.includes(n.tagName.toLowerCase())&&Array.from(n.children).every(e)}))}},{key:"getDeepestBlockElements",value:function(e){return t.containsOnlyInlineElements(e)?[e]:Array.from(e.children).reduce((function(e,n){return[].concat((0,r.default)(e),(0,r.default)(t.getDeepestBlockElements(n)))}),[])}},{key:"getHolder",value:function(t){return"string"==typeof t?document.getElementById(t):t}},{key:"isExtensionNode",value:function(t){return t&&["GRAMMARLY-EXTENSION"].includes(t.nodeName)}},{key:"blockElements",get:function(){return["address","article","aside","blockquote","canvas","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","li","main","nav","noscript","ol","output","p","pre","ruby","section","table","tr","tfoot","ul","video"]}}]),t}();o.default=c,c.displayName="Dom",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(355),n(27),n(13)],void 0===(r="function"==typeof(o=function(t,e,o,i){"use strict";var r,a=n(1);function s(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"log",o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"color: inherit";if("console"in window&&window.console[n]){var a=["info","log","warn","error"].includes(n),l=[];switch(s.logLevel){case r.ERROR:if("error"!==n)return;break;case r.WARN:if(!["error","warn"].includes(n))return;break;case r.INFO:if(!a||t)return}o&&l.push(o);var c="Editor.js ".concat("2.16.1");t&&(a?(l.unshift("line-height: 1em;\n color: #006FEA;\n display: inline-block;\n font-size: 11px;\n line-height: 1em;\n background-color: #fff;\n padding: 4px 9px;\n border-radius: 30px;\n border: 1px solid rgba(56, 138, 229, 0.16);\n margin: 4px 5px 4px 0;",i),e="%c".concat(c,"%c ").concat(e)):e="( ".concat(c," )").concat(e));try{if(a)if(o){var u;(u=console)[n].apply(u,["".concat(e," %o")].concat(l))}else{var f;(f=console)[n].apply(f,[e].concat(l))}else console[n](e)}catch(t){}}}Object.defineProperty(t,"__esModule",{value:!0}),t.setLogLevel=function(t){s.logLevel=t},t.isPrintableKey=function(t){return t>47&&t<58||32===t||13===t||t>64&&t<91||t>95&&t<112||t>185&&t<193||t>218&&t<223},t.sequence=function(t){var e,n,i,r=arguments;return o.default.async((function(a){for(;;)switch(a.prev=a.next){case 0:return i=function(t,e,n){return o.default.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,o.default.awrap(t.function(t.data));case 3:return i.next=5,o.default.awrap(e(void 0!==t.data?t.data:{}));case 5:i.next=10;break;case 7:i.prev=7,i.t0=i.catch(0),n(void 0!==t.data?t.data:{});case 10:case"end":return i.stop()}}),null,null,[[0,7]])},e=r.length>1&&void 0!==r[1]?r[1]:function(){},n=r.length>2&&void 0!==r[2]?r[2]:function(){},a.next=5,o.default.awrap(t.reduce((function(t,r){return o.default.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,o.default.awrap(t);case 2:return a.abrupt("return",i(r,e,n));case 3:case"end":return a.stop()}}))}),Promise.resolve()));case 5:return a.abrupt("return",a.sent);case 6:case"end":return a.stop()}}))},t.array=function(t){return Array.prototype.slice.call(t)},t.isFunction=function(t){return"function"==typeof t},t.isClass=function(t){return"function"==typeof t&&/^\s*class\s+/.test(t.toString())},t.isEmpty=function(t){return!t||0===Object.keys(t).length&&t.constructor===Object},t.isPromise=function(t){return Promise.resolve(t)===t},t.delay=function(t,e){return function(){var n=this,o=arguments;window.setTimeout((function(){return t.apply(n,o)}),e)}},t.getFileExtension=function(t){return t.name.split(".").pop()},t.isValidMimeType=function(t){return/^[-\w]+\/([-+\w]+|\*)$/.test(t)},t.debounce=function(t,e,n){var o,i=arguments,r=this;return function(){var a=r,s=i,l=n&&!o;window.clearTimeout(o),o=window.setTimeout((function(){o=null,n||t.apply(a,s)}),e),l&&t.apply(a,s)}},t.copyTextToClipboard=function(t){var e=i.default.make("div","codex-editor-clipboard",{innerHTML:t});document.body.appendChild(e);var n=window.getSelection(),o=document.createRange();o.selectNode(e),window.getSelection().removeAllRanges(),n.addRange(o),document.execCommand("copy"),document.body.removeChild(e)},t.getUserOS=u,t.capitalize=function(t){return t[0].toUpperCase()+t.slice(1)},t.deepMerge=function t(n){for(var o=function(t){return t&&"object"===d(t)},i=arguments.length,r=new Array(i>1?i-1:0),a=1;a0?i(o(t),9007199254740991):0}},function(t,e){var n=t.exports={version:"2.6.10"};"number"==typeof __e&&(__e=n)},function(t,e,n){t.exports=!n(9)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e,n){var o=n(10),i=n(104),r=n(38),a=Object.defineProperty;e.f=n(18)?Object.defineProperty:function(t,e,n){if(o(t),e=r(e,!0),o(n),i)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var o=n(36);t.exports=function(t){return Object(o(t))}},function(t,e,n){var o=n(8),i=n(24),r=n(23),a=n(41)("src"),s=n(176),l=(""+s).split("toString");n(17).inspectSource=function(t){return s.call(t)},(t.exports=function(t,e,n,s){var c="function"==typeof n;c&&(r(n,"name")||i(n,"name",e)),t[e]!==n&&(c&&(r(n,a)||i(n,a,t[e]?""+t[e]:l.join(String(e)))),t===o?t[e]=n:s?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[a]||s.call(this)}))},function(t,e,n){var o=n(0),i=n(9),r=n(36),a=/"/g,s=function(t,e,n,o){var i=String(r(t)),s="<"+e;return""!==n&&(s+=" "+n+'="'+String(o).replace(a,""")+'"'),s+">"+i+""};t.exports=function(t,e){var n={};n[t]=e(s),o(o.P+o.F*i((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3})),"String",n)}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var o=n(19),i=n(40);t.exports=n(18)?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var o=n(60),i=n(36);t.exports=function(t){return o(i(t))}},function(t,e,n){"use strict";var o=n(9);t.exports=function(t,e){return!!t&&o((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},function(t,e,n){t.exports=n(135)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(14),n(13)],void 0===(r="function"==typeof(o=function(o,i,r,a,s){"use strict";var l=n(15),c=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=c(i),r=c(r),a=l(a),s=c(s);var u=function(){function t(){(0,i.default)(this,t),this.instance=null,this.selection=null,this.savedSelectionRange=null,this.isFakeBackgroundEnabled=!1,this.commandBackground="backColor",this.commandRemoveFormat="removeFormat"}return(0,r.default)(t,[{key:"removeFakeBackground",value:function(){this.isFakeBackgroundEnabled&&(this.isFakeBackgroundEnabled=!1,document.execCommand(this.commandRemoveFormat))}},{key:"setFakeBackground",value:function(){document.execCommand(this.commandBackground,!1,"#a8d6ff"),this.isFakeBackgroundEnabled=!0}},{key:"save",value:function(){this.savedSelectionRange=t.range}},{key:"restore",value:function(){if(this.savedSelectionRange){var t=window.getSelection();t.removeAllRanges(),t.addRange(this.savedSelectionRange)}}},{key:"clearSaved",value:function(){this.savedSelectionRange=null}},{key:"collapseToEnd",value:function(){var t=window.getSelection(),e=document.createRange();e.selectNodeContents(t.focusNode),e.collapse(!1),t.removeAllRanges(),t.addRange(e)}},{key:"findParentTag",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,o=window.getSelection(),i=null;if(!o||!o.anchorNode||!o.focusNode)return null;var r=[o.anchorNode,o.focusNode];return r.forEach((function(o){for(var r=n;r>0&&o.parentNode&&(o.tagName!==t||(i=o,e&&o.classList&&!o.classList.contains(e)&&(i=null),!i));)o=o.parentNode,r--})),i}},{key:"expandToTag",value:function(t){var e=window.getSelection();e.removeAllRanges();var n=document.createRange();n.selectNodeContents(t),e.addRange(n)}}],[{key:"get",value:function(){return window.getSelection()}},{key:"CSS",get:function(){return{editorWrapper:"codex-editor",editorZone:"codex-editor__redactor"}}},{key:"anchorNode",get:function(){var t=window.getSelection();return t?t.anchorNode:null}},{key:"anchorElement",get:function(){var t=window.getSelection();if(!t)return null;var e=t.anchorNode;return e?s.default.isElement(e)?e:e.parentElement:null}},{key:"anchorOffset",get:function(){var t=window.getSelection();return t?t.anchorOffset:null}},{key:"isCollapsed",get:function(){var t=window.getSelection();return t?t.isCollapsed:null}},{key:"isAtEditor",get:function(){var e=t.get(),n=e.anchorNode||e.focusNode;n&&n.nodeType===Node.TEXT_NODE&&(n=n.parentNode);var o=null;return n&&(o=n.closest(".".concat(t.CSS.editorZone))),o&&o.nodeType===Node.ELEMENT_NODE}},{key:"range",get:function(){var t=window.getSelection();return t&&t.rangeCount?t.getRangeAt(0):null}},{key:"rect",get:function(){var t,e=document.selection,n={x:0,y:0,width:0,height:0};if(e&&"Control"!==e.type)return t=(e=e).createRange(),n.x=t.boundingLeft,n.y=t.boundingTop,n.width=t.boundingWidth,n.height=t.boundingHeight,n;if(!window.getSelection)return a.log("Method window.getSelection is not supported","warn"),n;if(null===(e=window.getSelection()).rangeCount||isNaN(e.rangeCount))return a.log("Method SelectionUtils.rangeCount is not supported","warn"),n;if(0===e.rangeCount)return n;if((t=e.getRangeAt(0).cloneRange()).getBoundingClientRect&&(n=t.getBoundingClientRect()),0===n.x&&0===n.y){var o=document.createElement("span");if(o.getBoundingClientRect){o.appendChild(document.createTextNode("​")),t.insertNode(o),n=o.getBoundingClientRect();var i=o.parentNode;i.removeChild(o),i.normalize()}}return n}},{key:"text",get:function(){return window.getSelection?window.getSelection().toString():""}}]),t}();o.default=u,u.displayName="SelectionUtils",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o=n(30);t.exports=function(t,e,n){if(o(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,o){return t.call(e,n,o)};case 3:return function(n,o,i){return t.call(e,n,o,i)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){var n=Math.ceil,o=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?o:n)(t)}},function(t,e,n){var o=n(61),i=n(40),r=n(25),a=n(38),s=n(23),l=n(104),c=Object.getOwnPropertyDescriptor;e.f=n(18)?c:function(t,e){if(t=r(t),e=a(e,!0),l)try{return c(t,e)}catch(t){}if(s(t,e))return i(!o.f.call(t,e),t[e])}},function(t,e,n){var o=n(0),i=n(17),r=n(9);t.exports=function(t,e){var n=(i.Object||{})[t]||Object[t],a={};a[t]=e(n),o(o.S+o.F*r((function(){n(1)})),"Object",a)}},function(t,e,n){var o=n(29),i=n(60),r=n(20),a=n(16),s=n(120);t.exports=function(t,e){var n=1==t,l=2==t,c=3==t,u=4==t,f=6==t,d=5==t||f,p=e||s;return function(e,s,h){for(var v,g,y=r(e),b=i(y),m=o(s,h,3),k=a(b.length),x=0,w=n?p(e,k):l?p(e,0):void 0;k>x;x++)if((d||x in b)&&(g=m(v=b[x],x,y),t))if(n)w[x]=g;else if(g)switch(t){case 3:return!0;case 5:return v;case 6:return x;case 2:w.push(v)}else if(u)return!1;return f?-1:c||u?u:w}}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){"use strict";if(n(18)){var o=n(42),i=n(8),r=n(9),a=n(0),s=n(75),l=n(102),c=n(29),u=n(56),f=n(40),d=n(24),p=n(57),h=n(31),v=n(16),g=n(131),y=n(44),b=n(38),m=n(23),k=n(62),x=n(11),w=n(20),S=n(94),E=n(45),T=n(47),C=n(46).f,B=n(96),_=n(41),I=n(12),O=n(34),N=n(65),L=n(63),M=n(98),A=n(54),P=n(68),R=n(55),j=n(97),F=n(122),D=n(19),U=n(32),H=D.f,z=U.f,G=i.RangeError,W=i.TypeError,X=i.Uint8Array,V=Array.prototype,Y=l.ArrayBuffer,K=l.DataView,Z=O(0),q=O(2),$=O(3),J=O(4),Q=O(5),tt=O(6),et=N(!0),nt=N(!1),ot=M.values,it=M.keys,rt=M.entries,at=V.lastIndexOf,st=V.reduce,lt=V.reduceRight,ct=V.join,ut=V.sort,ft=V.slice,dt=V.toString,pt=V.toLocaleString,ht=I("iterator"),vt=I("toStringTag"),gt=_("typed_constructor"),yt=_("def_constructor"),bt=s.CONSTR,mt=s.TYPED,kt=s.VIEW,xt=O(1,(function(t,e){return Ct(L(t,t[yt]),e)})),wt=r((function(){return 1===new X(new Uint16Array([1]).buffer)[0]})),St=!!X&&!!X.prototype.set&&r((function(){new X(1).set({})})),Et=function(t,e){var n=h(t);if(n<0||n%e)throw G("Wrong offset!");return n},Tt=function(t){if(x(t)&&mt in t)return t;throw W(t+" is not a typed array!")},Ct=function(t,e){if(!(x(t)&> in t))throw W("It is not a typed array constructor!");return new t(e)},Bt=function(t,e){return _t(L(t,t[yt]),e)},_t=function(t,e){for(var n=0,o=e.length,i=Ct(t,o);o>n;)i[n]=e[n++];return i},It=function(t,e,n){H(t,e,{get:function(){return this._d[n]}})},Ot=function(t){var e,n,o,i,r,a,s=w(t),l=arguments.length,u=l>1?arguments[1]:void 0,f=void 0!==u,d=B(s);if(null!=d&&!S(d)){for(a=d.call(s),o=[],e=0;!(r=a.next()).done;e++)o.push(r.value);s=o}for(f&&l>2&&(u=c(u,arguments[2],2)),e=0,n=v(s.length),i=Ct(this,n);n>e;e++)i[e]=f?u(s[e],e):s[e];return i},Nt=function(){for(var t=0,e=arguments.length,n=Ct(this,e);e>t;)n[t]=arguments[t++];return n},Lt=!!X&&r((function(){pt.call(new X(1))})),Mt=function(){return pt.apply(Lt?ft.call(Tt(this)):Tt(this),arguments)},At={copyWithin:function(t,e){return F.call(Tt(this),t,e,arguments.length>2?arguments[2]:void 0)},every:function(t){return J(Tt(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return j.apply(Tt(this),arguments)},filter:function(t){return Bt(this,q(Tt(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return Q(Tt(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return tt(Tt(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){Z(Tt(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return nt(Tt(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return et(Tt(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return ct.apply(Tt(this),arguments)},lastIndexOf:function(t){return at.apply(Tt(this),arguments)},map:function(t){return xt(Tt(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return st.apply(Tt(this),arguments)},reduceRight:function(t){return lt.apply(Tt(this),arguments)},reverse:function(){for(var t,e=Tt(this).length,n=Math.floor(e/2),o=0;o1?arguments[1]:void 0)},sort:function(t){return ut.call(Tt(this),t)},subarray:function(t,e){var n=Tt(this),o=n.length,i=y(t,o);return new(L(n,n[yt]))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,v((void 0===e?o:y(e,o))-i))}},Pt=function(t,e){return Bt(this,ft.call(Tt(this),t,e))},Rt=function(t){Tt(this);var e=Et(arguments[1],1),n=this.length,o=w(t),i=v(o.length),r=0;if(i+e>n)throw G("Wrong length!");for(;r255?255:255&o),i.v[p](n*e+i.o,o,wt)}(this,n,t)},enumerable:!0})};m?(h=n((function(t,n,o,i){u(t,h,c,"_d");var r,a,s,l,f=0,p=0;if(x(n)){if(!(n instanceof Y||"ArrayBuffer"==(l=k(n))||"SharedArrayBuffer"==l))return mt in n?_t(h,n):Ot.call(h,n);r=n,p=Et(o,e);var y=n.byteLength;if(void 0===i){if(y%e)throw G("Wrong length!");if((a=y-p)<0)throw G("Wrong length!")}else if((a=v(i)*e)+p>y)throw G("Wrong length!");s=a/e}else s=g(n),r=new Y(a=s*e);for(d(t,"_d",{b:r,o:p,l:a,e:s,v:new K(r)});fdocument.F=Object<\/script>"),t.close(),l=t.F;o--;)delete l.prototype[r[o]];return l()};t.exports=Object.create||function(t,e){var n;return null!==t?(s.prototype=o(t),n=new s,s.prototype=null,n[a]=t):n=l(),void 0===e?n:i(n,e)}},function(t,e,n){var o=n(106),i=n(81).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return o(t,i)}},function(t,e,n){var o=n(23),i=n(20),r=n(80)("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),o(t,r)?t[r]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},function(t,e,n){var o=n(12)("unscopables"),i=Array.prototype;null==i[o]&&n(24)(i,o,{}),t.exports=function(t){i[o][t]=!0}},function(t,e,n){var o=n(11);t.exports=function(t,e){if(!o(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},function(t,e,n){var o=n(345),i=n(346),r=n(347);t.exports=function(t,e){return o(t)||i(t,e)||r()}},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(e){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?t.exports=o=function(t){return n(t)}:t.exports=o=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},o(e)}t.exports=o},function(t,e,n){var o=n(19).f,i=n(23),r=n(12)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,r)&&o(t,r,{configurable:!0,value:e})}},function(t,e,n){var o=n(0),i=n(36),r=n(9),a=n(84),s="["+a+"]",l=RegExp("^"+s+s+"*"),c=RegExp(s+s+"*$"),u=function(t,e,n){var i={},s=r((function(){return!!a[t]()||"​…"!="​…"[t]()})),l=i[t]=s?e(f):a[t];n&&(i[n]=l),o(o.P+o.F*s,"String",i)},f=u.trim=function(t,e){return t=String(i(t)),1&e&&(t=t.replace(l,"")),2&e&&(t=t.replace(c,"")),t};t.exports=u},function(t,e){t.exports={}},function(t,e,n){"use strict";var o=n(8),i=n(19),r=n(18),a=n(12)("species");t.exports=function(t){var e=o[t];r&&e&&!e[a]&&i.f(e,a,{configurable:!0,get:function(){return this}})}},function(t,e){t.exports=function(t,e,n,o){if(!(t instanceof e)||void 0!==o&&o in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){var o=n(21);t.exports=function(t,e,n){for(var i in e)o(t,i,e[i],n);return t}},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(359),n(14)],void 0===(r="function"==typeof(o=function(o,i,r,a,s){"use strict";var l=n(15),c=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=c(i),r=c(r),a=c(a),s=l(s);var u=function(){function t(e){var n=this;(0,i.default)(this,t),this.iterator=null,this.activated=!1,this.allowArrows=!0,this.allowArrows="boolean"!=typeof e.allowArrows||e.allowArrows,this.iterator=new a.default(e.items,e.focusedItemClass),this.activateCallback=e.activateCallback,document.addEventListener("keydown",(function(e){if(n.isEventReadyForHandling(e))switch(t.usedKeys.includes(e.keyCode)&&e.preventDefault(),e.keyCode){case s.keyCodes.TAB:n.handleTabPress(e);break;case s.keyCodes.LEFT:case s.keyCodes.UP:n.flipLeft();break;case s.keyCodes.RIGHT:case s.keyCodes.DOWN:n.flipRight();break;case s.keyCodes.ENTER:n.handleEnterPress(e)}}),!1)}return(0,r.default)(t,[{key:"activate",value:function(t){this.activated=!0,t&&this.iterator.setItems(t)}},{key:"deactivate",value:function(){this.activated=!1,this.dropCursor()}},{key:"focusFirst",value:function(){this.dropCursor(),this.flipRight()}},{key:"dropCursor",value:function(){this.iterator.dropCursor()}},{key:"isEventReadyForHandling",value:function(t){var e=[s.keyCodes.TAB,s.keyCodes.ENTER];return this.allowArrows&&e.push(s.keyCodes.LEFT,s.keyCodes.RIGHT,s.keyCodes.UP,s.keyCodes.DOWN),!(!this.activated||-1===e.indexOf(t.keyCode))}},{key:"handleTabPress",value:function(t){switch(t.shiftKey?a.default.directions.LEFT:a.default.directions.RIGHT){case a.default.directions.RIGHT:this.flipRight();break;case a.default.directions.LEFT:this.flipLeft()}}},{key:"flipLeft",value:function(){this.iterator.previous()}},{key:"flipRight",value:function(){this.iterator.next()}},{key:"handleEnterPress",value:function(t){this.activated&&(this.iterator.currentItem&&this.iterator.currentItem.click(),"function"==typeof this.activateCallback&&this.activateCallback(),t.preventDefault(),t.stopPropagation())}},{key:"currentItem",get:function(){return this.iterator.currentItem}}],[{key:"usedKeys",get:function(){return[s.keyCodes.TAB,s.keyCodes.LEFT,s.keyCodes.RIGHT,s.keyCodes.ENTER,s.keyCodes.UP,s.keyCodes.DOWN]}}]),t}();o.default=u,u.displayName="Flipper",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(103),n(27),n(2),n(3),n(13),n(14),n(360),n(361),n(362),n(28)],void 0===(r="function"==typeof(o=function(t,e,o,i,r,a,s,l,c,u,f){"use strict";var d,p=n(15),h=n(1);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.BlockToolAPI=void 0,e=h(e),o=h(o),i=h(i),r=h(r),a=h(a),s=p(s),l=h(l),c=h(c),u=h(u),f=h(f),t.BlockToolAPI=d,function(t){t.APPEND_CALLBACK="appendCallback",t.RENDERED="rendered",t.UPDATED="updated",t.REMOVED="removed",t.ON_PASTE="onPaste"}(d||(t.BlockToolAPI=d={}));var v=function(){function t(e,n,o,r,a){var l=this;(0,i.default)(this,t),this.cachedInputs=[],this.inputIndex=0,this.modificationDebounceTimer=450,this.didMutated=s.debounce((function(){l.cachedInputs=[],l.updateCurrentInput(),l.call(d.UPDATED)}),this.modificationDebounceTimer),this.name=e,this.tool=n,this.class=o,this.settings=r,this.api=a,this.holder=this.compose(),this.mutationObserver=new MutationObserver(this.didMutated),this.tunes=this.makeTunes()}return(0,r.default)(t,[{key:"call",value:function(t,e){if(this.tool[t]&&this.tool[t]instanceof Function)try{this.tool[t].call(this.tool,e)}catch(e){s.log("Error during '".concat(t,"' call: ").concat(e.message),"error")}}},{key:"mergeWith",value:function(t){return o.default.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.default.awrap(this.tool.merge(t));case 2:case"end":return e.stop()}}),null,this)}},{key:"save",value:function(){var t,e,n,i=this;return o.default.async((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,o.default.awrap(this.tool.save(this.pluginsContent));case 2:return t=r.sent,e=window.performance.now(),r.abrupt("return",Promise.resolve(t).then((function(t){return n=window.performance.now(),{tool:i.name,data:t,time:n-e}})).catch((function(t){s.log("Saving proccess for ".concat(i.name," tool failed due to the ").concat(t),"log","red")})));case 5:case"end":return r.stop()}}),null,this)}},{key:"validate",value:function(t){var e;return o.default.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(e=!0,!(this.tool.validate instanceof Function)){n.next=5;break}return n.next=4,o.default.awrap(this.tool.validate(t));case 4:e=n.sent;case 5:return n.abrupt("return",e);case 6:case"end":return n.stop()}}),null,this)}},{key:"makeTunes",value:function(){var t=this;return[l.default,c.default,u.default].map((function(e){return new e({api:t.api,settings:t.settings})}))}},{key:"renderTunes",value:function(){var t=document.createDocumentFragment();return this.tunes.forEach((function(e){a.default.append(t,e.render())})),t}},{key:"updateCurrentInput",value:function(){this.currentInput=f.default.anchorNode}},{key:"willSelect",value:function(){this.mutationObserver.observe(this.holder.firstElementChild,{childList:!0,subtree:!0,characterData:!0,attributes:!0})}},{key:"willUnselect",value:function(){this.mutationObserver.disconnect()}},{key:"compose",value:function(){var e=a.default.make("div",t.CSS.wrapper),n=a.default.make("div",t.CSS.content),o=this.tool.render();return n.appendChild(o),e.appendChild(n),e}},{key:"inputs",get:function(){if(0!==this.cachedInputs.length)return this.cachedInputs;var t=this.holder,n="[contenteditable], textarea, input:not([type]), "+["text","password","email","number","search","tel","url"].map((function(t){return'input[type="'.concat(t,'"]')})).join(", "),o=s.array(t.querySelectorAll(n));return o=o.reduce((function(t,n){return a.default.isNativeInput(n)||a.default.containsOnlyInlineElements(n)?[].concat((0,e.default)(t),[n]):[].concat((0,e.default)(t),(0,e.default)(a.default.getDeepestBlockElements(n)))}),[]),this.inputIndex>o.length-1&&(this.inputIndex=o.length-1),this.cachedInputs=o,o}},{key:"currentInput",get:function(){return this.inputs[this.inputIndex]},set:function(t){var e=this.inputs.findIndex((function(e){return e===t||e.contains(t)}));-1!==e&&(this.inputIndex=e)}},{key:"firstInput",get:function(){return this.inputs[0]}},{key:"lastInput",get:function(){var t=this.inputs;return t[t.length-1]}},{key:"nextInput",get:function(){return this.inputs[this.inputIndex+1]}},{key:"previousInput",get:function(){return this.inputs[this.inputIndex-1]}},{key:"pluginsContent",get:function(){var e=this.holder.querySelector(".".concat(t.CSS.content));if(e&&e.childNodes.length)for(var n=e.childNodes.length-1;n>=0;n--){var o=e.childNodes[n];if(!a.default.isExtensionNode(o))return o}return null}},{key:"data",get:function(){return this.save().then((function(t){return t&&!s.isEmpty(t.data)?t.data:{}}))}},{key:"sanitize",get:function(){return this.tool.sanitize}},{key:"mergeable",get:function(){return"function"==typeof this.tool.merge}},{key:"isEmpty",get:function(){var t=a.default.isEmpty(this.pluginsContent),e=!this.hasMedia;return t&&e}},{key:"hasMedia",get:function(){return!!this.holder.querySelector(["img","iframe","video","audio","source","input","textarea","twitterwidget"].join(","))}},{key:"focused",set:function(e){this.holder.classList.toggle(t.CSS.focused,e)}},{key:"selected",set:function(e){e?this.holder.classList.add(t.CSS.selected):this.holder.classList.remove(t.CSS.selected)},get:function(){return this.holder.classList.contains(t.CSS.selected)}},{key:"stretched",set:function(e){this.holder.classList.toggle(t.CSS.wrapperStretched,e)}},{key:"dropTarget",set:function(e){this.holder.classList.toggle(t.CSS.dropTarget,e)}}],[{key:"CSS",get:function(){return{wrapper:"ce-block",wrapperStretched:"ce-block--stretched",content:"ce-block__content",focused:"ce-block--focused",selected:"ce-block--selected",dropTarget:"ce-block--drop-target"}}}]),t}();t.default=v,v.displayName="Block"})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o=n(35);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==o(t)?t.split(""):Object(t)}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var o=n(35),i=n(12)("toStringTag"),r="Arguments"==o(function(){return arguments}());t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?n:r?o(e):"Object"==(a=o(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,n){var o=n(10),i=n(30),r=n(12)("species");t.exports=function(t,e){var n,a=o(t).constructor;return void 0===a||null==(n=o(a)[r])?e:i(n)}},function(t,e,n){var o=n(17),i=n(8),r=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(t.exports=function(t,e){return r[t]||(r[t]=void 0!==e?e:{})})("versions",[]).push({version:o.version,mode:n(42)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e,n){var o=n(25),i=n(16),r=n(44);t.exports=function(t){return function(e,n,a){var s,l=o(e),c=i(l.length),u=r(a,c);if(t&&n!=n){for(;c>u;)if((s=l[u++])!=s)return!0}else for(;c>u;u++)if((t||u in l)&&l[u]===n)return t||u||0;return!t&&-1}}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var o=n(35);t.exports=Array.isArray||function(t){return"Array"==o(t)}},function(t,e,n){var o=n(12)("iterator"),i=!1;try{var r=[7][o]();r.return=function(){i=!0},Array.from(r,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var r=[7],a=r[o]();a.next=function(){return{done:n=!0}},r[o]=function(){return a},t(r)}catch(t){}return n}},function(t,e,n){"use strict";var o=n(10);t.exports=function(){var t=o(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},function(t,e,n){"use strict";var o=n(62),i=RegExp.prototype.exec;t.exports=function(t,e){var n=t.exec;if("function"==typeof n){var r=n.call(t,e);if("object"!=typeof r)throw new TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==o(t))throw new TypeError("RegExp#exec called on incompatible receiver");return i.call(t,e)}},function(t,e,n){"use strict";n(124);var o=n(21),i=n(24),r=n(9),a=n(36),s=n(12),l=n(99),c=s("species"),u=!r((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$
")})),f=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();t.exports=function(t,e,n){var d=s(t),p=!r((function(){var e={};return e[d]=function(){return 7},7!=""[t](e)})),h=p?!r((function(){var e=!1,n=/a/;return n.exec=function(){return e=!0,null},"split"===t&&(n.constructor={},n.constructor[c]=function(){return n}),n[d](""),!e})):void 0;if(!p||!h||"replace"===t&&!u||"split"===t&&!f){var v=/./[d],g=n(a,d,""[t],(function(t,e,n,o,i){return e.exec===l?p&&!i?{done:!0,value:v.call(e,n,o)}:{done:!0,value:t.call(n,e,o)}:{done:!1}})),y=g[0],b=g[1];o(String.prototype,t,y),i(RegExp.prototype,d,2==e?function(t,e){return b.call(t,this,e)}:function(t){return b.call(t,this)})}}},function(t,e,n){var o=n(29),i=n(119),r=n(94),a=n(10),s=n(16),l=n(96),c={},u={};(e=t.exports=function(t,e,n,f,d){var p,h,v,g,y=d?function(){return t}:l(t),b=o(n,f,e?2:1),m=0;if("function"!=typeof y)throw TypeError(t+" is not iterable!");if(r(y)){for(p=s(t.length);p>m;m++)if((g=e?b(a(h=t[m])[0],h[1]):b(t[m]))===c||g===u)return g}else for(v=y.call(t);!(h=v.next()).done;)if((g=i(v,b,h.value,e))===c||g===u)return g}).BREAK=c,e.RETURN=u},function(t,e,n){var o=n(8).navigator;t.exports=o&&o.userAgent||""},function(t,e,n){"use strict";var o=n(8),i=n(0),r=n(21),a=n(57),s=n(39),l=n(72),c=n(56),u=n(11),f=n(9),d=n(68),p=n(52),h=n(85);t.exports=function(t,e,n,v,g,y){var b=o[t],m=b,k=g?"set":"add",x=m&&m.prototype,w={},S=function(t){var e=x[t];r(x,t,"delete"==t?function(t){return!(y&&!u(t))&&e.call(this,0===t?0:t)}:"has"==t?function(t){return!(y&&!u(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return y&&!u(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,n){return e.call(this,0===t?0:t,n),this})};if("function"==typeof m&&(y||x.forEach&&!f((function(){(new m).entries().next()})))){var E=new m,T=E[k](y?{}:-0,1)!=E,C=f((function(){E.has(1)})),B=d((function(t){new m(t)})),_=!y&&f((function(){for(var t=new m,e=5;e--;)t[k](e,e);return!t.has(-0)}));B||((m=e((function(e,n){c(e,m,t);var o=h(new b,e,m);return null!=n&&l(n,g,o[k],o),o}))).prototype=x,x.constructor=m),(C||_)&&(S("delete"),S("has"),g&&S("get")),(_||T)&&S(k),y&&x.clear&&delete x.clear}else m=v.getConstructor(e,t,g,k),a(m.prototype,n),s.NEED=!0;return p(m,t),w[t]=m,i(i.G+i.W+i.F*(m!=b),w),y||v.setStrong(m,t,g),m}},function(t,e,n){for(var o,i=n(8),r=n(24),a=n(41),s=a("typed_array"),l=a("view"),c=!(!i.ArrayBuffer||!i.DataView),u=c,f=0,d="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");f<9;)(o=i[d[f++]])?(r(o.prototype,s,!0),r(o.prototype,l,!0)):u=!1;t.exports={ABV:c,CONSTR:u,TYPED:s,VIEW:l}},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c){"use strict";var u=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=u(i),r=u(r),a=u(a),s=u(s),l=u(l);var f=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"methods",get:function(){return{blocks:this.Editor.BlocksAPI.methods,caret:this.Editor.CaretAPI.methods,events:this.Editor.EventsAPI.methods,listeners:this.Editor.ListenersAPI.methods,notifier:this.Editor.NotifierAPI.methods,sanitizer:this.Editor.SanitizerAPI.methods,saver:this.Editor.SaverAPI.methods,selection:this.Editor.SelectionAPI.methods,styles:this.Editor.StylesAPI.classes,toolbar:this.Editor.ToolbarAPI.methods,inlineToolbar:this.Editor.InlineToolbarAPI.methods,tooltip:this.Editor.TooltipAPI.methods}}}]),e}((c=u(c)).default);o.default=f,f.displayName="API",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7),n(13),n(14)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u,f){"use strict";var d=n(15),p=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=p(i),r=p(r),a=p(a),s=p(s),l=p(l),c=p(c),u=p(u),f=d(f);var h=function(t){function e(){var t;return(0,i.default)(this,e),(t=(0,a.default)(this,(0,s.default)(e).apply(this,arguments))).nodes={wrapper:null,content:null,actions:null,plusButton:null,blockActionsButtons:null,settingsToggler:null},t}return(0,l.default)(e,t),(0,r.default)(e,[{key:"make",value:function(){var t=this;this.nodes.wrapper=u.default.make("div",this.CSS.toolbar),["content","actions"].forEach((function(e){t.nodes[e]=u.default.make("div",t.CSS[e]),u.default.append(t.nodes.wrapper,t.nodes[e])})),this.nodes.plusButton=u.default.make("div",this.CSS.plusButton),u.default.append(this.nodes.plusButton,u.default.svg("plus",14,14)),u.default.append(this.nodes.content,this.nodes.plusButton),this.Editor.Listeners.on(this.nodes.plusButton,"click",(function(){return t.plusButtonClicked()}),!1);var e=u.default.make("div");e.appendChild(document.createTextNode("Add")),e.appendChild(u.default.make("div",this.CSS.plusButtonShortcut,{textContent:"⇥ Tab"})),this.Editor.Tooltip.onHover(this.nodes.plusButton,e),this.Editor.Toolbox.make(),this.nodes.blockActionsButtons=u.default.make("div",this.CSS.blockActionsButtons),this.nodes.settingsToggler=u.default.make("span",this.CSS.settingsToggler);var n=u.default.svg("dots",18,4);u.default.append(this.nodes.settingsToggler,n),u.default.append(this.nodes.blockActionsButtons,this.nodes.settingsToggler),u.default.append(this.nodes.actions,this.nodes.blockActionsButtons),this.Editor.Tooltip.onHover(this.nodes.settingsToggler,"Click to tune",{placement:"top"}),this.Editor.BlockSettings.make(),u.default.append(this.nodes.actions,this.Editor.BlockSettings.nodes.wrapper),u.default.append(this.Editor.UI.nodes.wrapper,this.nodes.wrapper),this.bindEvents()}},{key:"move",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t&&(this.Editor.Toolbox.close(),this.Editor.BlockSettings.close());var e=this.Editor.BlockManager.currentBlock.holder;if(e){var n=this.Editor.UI.isMobile,o=e.offsetHeight,i=e.offsetTop;if(n)i+=o;else{var r=Math.floor(o/2);this.nodes.plusButton.style.transform="translate3d(0, calc(".concat(r,"px - 50%), 0)"),this.Editor.Toolbox.nodes.toolbox.style.transform="translate3d(0, calc(".concat(r,"px - 50%), 0)")}this.nodes.wrapper.style.transform="translate3D(0, ".concat(Math.floor(i),"px, 0)")}}},{key:"open",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];f.delay((function(){t.move(n),t.nodes.wrapper.classList.add(t.CSS.toolbarOpened),e?t.blockActions.show():t.blockActions.hide()}),50)()}},{key:"close",value:function(){this.nodes.wrapper.classList.remove(this.CSS.toolbarOpened),this.blockActions.hide(),this.Editor.Toolbox.close(),this.Editor.BlockSettings.close()}},{key:"plusButtonClicked",value:function(){this.Editor.Toolbox.toggle()}},{key:"bindEvents",value:function(){var t=this;this.Editor.Listeners.on(this.nodes.settingsToggler,"click",(function(){return t.settingsTogglerClicked()}))}},{key:"settingsTogglerClicked",value:function(){this.Editor.BlockSettings.opened?this.Editor.BlockSettings.close():this.Editor.BlockSettings.open()}},{key:"CSS",get:function(){return{toolbar:"ce-toolbar",content:"ce-toolbar__content",actions:"ce-toolbar__actions",actionsOpened:"ce-toolbar__actions--opened",toolbarOpened:"ce-toolbar--opened",plusButton:"ce-toolbar__plus",plusButtonShortcut:"ce-toolbar__plus-shortcut",plusButtonHidden:"ce-toolbar__plus--hidden",blockActionsButtons:"ce-toolbar__actions-buttons",settingsToggler:"ce-toolbar__settings-btn"}}},{key:"opened",get:function(){return this.nodes.wrapper.classList.contains(this.CSS.toolbarOpened)}},{key:"plusButton",get:function(){var t=this;return{hide:function(){return t.nodes.plusButton.classList.add(t.CSS.plusButtonHidden)},show:function(){t.Editor.Toolbox.isEmpty||t.nodes.plusButton.classList.remove(t.CSS.plusButtonHidden)}}}},{key:"blockActions",get:function(){var t=this;return{hide:function(){t.nodes.actions.classList.remove(t.CSS.actionsOpened)},show:function(){t.nodes.actions.classList.add(t.CSS.actionsOpened)}}}}]),e}(c.default);o.default=h,h.displayName="Toolbar",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o=n(11),i=n(8).document,r=o(i)&&o(i.createElement);t.exports=function(t){return r?i.createElement(t):{}}},function(t,e,n){e.f=n(12)},function(t,e,n){var o=n(64)("keys"),i=n(41);t.exports=function(t){return o[t]||(o[t]=i(t))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var o=n(8).document;t.exports=o&&o.documentElement},function(t,e,n){var o=n(11),i=n(10),r=function(t,e){if(i(t),!o(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,o){try{(o=n(29)(Function.call,n(32).f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return r(t,n),e?t.__proto__=n:o(t,n),t}}({},!1):void 0),check:r}},function(t,e){t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(t,e,n){var o=n(11),i=n(83).set;t.exports=function(t,e,n){var r,a=e.constructor;return a!==n&&"function"==typeof a&&(r=a.prototype)!==n.prototype&&o(r)&&i&&i(t,r),t}},function(t,e,n){"use strict";var o=n(31),i=n(36);t.exports=function(t){var e=String(i(this)),n="",r=o(t);if(r<0||r==1/0)throw RangeError("Count can't be negative");for(;r>0;(r>>>=1)&&(e+=e))1&r&&(n+=e);return n}},function(t,e){t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,e){var n=Math.expm1;t.exports=!n||n(10)>22025.465794806718||n(10)<22025.465794806718||-2e-17!=n(-2e-17)?function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:n},function(t,e,n){var o=n(31),i=n(36);t.exports=function(t){return function(e,n){var r,a,s=String(i(e)),l=o(n),c=s.length;return l<0||l>=c?t?"":void 0:(r=s.charCodeAt(l))<55296||r>56319||l+1===c||(a=s.charCodeAt(l+1))<56320||a>57343?t?s.charAt(l):r:t?s.slice(l,l+2):a-56320+(r-55296<<10)+65536}}},function(t,e,n){"use strict";var o=n(42),i=n(0),r=n(21),a=n(24),s=n(54),l=n(118),c=n(52),u=n(47),f=n(12)("iterator"),d=!([].keys&&"next"in[].keys()),p=function(){return this};t.exports=function(t,e,n,h,v,g,y){l(n,e,h);var b,m,k,x=function(t){if(!d&&t in T)return T[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},w=e+" Iterator",S="values"==v,E=!1,T=t.prototype,C=T[f]||T["@@iterator"]||v&&T[v],B=C||x(v),_=v?S?x("entries"):B:void 0,I="Array"==e&&T.entries||C;if(I&&(k=u(I.call(new t)))!==Object.prototype&&k.next&&(c(k,w,!0),o||"function"==typeof k[f]||a(k,f,p)),S&&C&&"values"!==C.name&&(E=!0,B=function(){return C.call(this)}),o&&!y||!d&&!E&&T[f]||a(T,f,B),s[e]=B,s[w]=p,v)if(b={values:S?B:x("values"),keys:g?B:x("keys"),entries:_},y)for(m in b)m in T||r(T,m,b[m]);else i(i.P+i.F*(d||E),e,b);return b}},function(t,e,n){var o=n(92),i=n(36);t.exports=function(t,e,n){if(o(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(t))}},function(t,e,n){var o=n(11),i=n(35),r=n(12)("match");t.exports=function(t){var e;return o(t)&&(void 0!==(e=t[r])?!!e:"RegExp"==i(t))}},function(t,e,n){var o=n(12)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[o]=!1,!"/./"[t](e)}catch(t){}}return!0}},function(t,e,n){var o=n(54),i=n(12)("iterator"),r=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||r[i]===t)}},function(t,e,n){"use strict";var o=n(19),i=n(40);t.exports=function(t,e,n){e in t?o.f(t,e,i(0,n)):t[e]=n}},function(t,e,n){var o=n(62),i=n(12)("iterator"),r=n(54);t.exports=n(17).getIteratorMethod=function(t){if(null!=t)return t[i]||t["@@iterator"]||r[o(t)]}},function(t,e,n){"use strict";var o=n(20),i=n(44),r=n(16);t.exports=function(t){for(var e=o(this),n=r(e.length),a=arguments.length,s=i(a>1?arguments[1]:void 0,n),l=a>2?arguments[2]:void 0,c=void 0===l?n:i(l,n);c>s;)e[s++]=t;return e}},function(t,e,n){"use strict";var o=n(48),i=n(123),r=n(54),a=n(25);t.exports=n(90)(Array,"Array",(function(t,e){this._t=a(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])}),"values"),r.Arguments=r.Array,o("keys"),o("values"),o("entries")},function(t,e,n){"use strict";var o,i,r=n(69),a=RegExp.prototype.exec,s=String.prototype.replace,l=a,c=(o=/a/,i=/b*/g,a.call(o,"a"),a.call(i,"a"),0!==o.lastIndex||0!==i.lastIndex),u=void 0!==/()??/.exec("")[1];(c||u)&&(l=function(t){var e,n,o,i,l=this;return u&&(n=new RegExp("^"+l.source+"$(?!\\s)",r.call(l))),c&&(e=l.lastIndex),o=a.call(l,t),c&&o&&(l.lastIndex=l.global?o.index+o[0].length:e),u&&o&&o.length>1&&s.call(o[0],n,(function(){for(i=1;in;)e.push(arguments[n++]);return y[++g]=function(){s("function"==typeof t?t:Function(t),e)},o(g),g},p=function(t){delete y[t]},"process"==n(35)(f)?o=function(t){f.nextTick(a(b,t,1))}:v&&v.now?o=function(t){v.now(a(b,t,1))}:h?(r=(i=new h).port2,i.port1.onmessage=m,o=a(r.postMessage,r,1)):u.addEventListener&&"function"==typeof postMessage&&!u.importScripts?(o=function(t){u.postMessage(t+"","*")},u.addEventListener("message",m,!1)):o="onreadystatechange"in c("script")?function(t){l.appendChild(c("script")).onreadystatechange=function(){l.removeChild(this),b.call(t)}}:function(t){setTimeout(a(b,t,1),0)}),t.exports={set:d,clear:p}},function(t,e,n){"use strict";var o=n(8),i=n(18),r=n(42),a=n(75),s=n(24),l=n(57),c=n(9),u=n(56),f=n(31),d=n(16),p=n(131),h=n(46).f,v=n(19).f,g=n(97),y=n(52),b="prototype",m="Wrong index!",k=o.ArrayBuffer,x=o.DataView,w=o.Math,S=o.RangeError,E=o.Infinity,T=k,C=w.abs,B=w.pow,_=w.floor,I=w.log,O=w.LN2,N=i?"_b":"buffer",L=i?"_l":"byteLength",M=i?"_o":"byteOffset";function A(t,e,n){var o,i,r,a=new Array(n),s=8*n-e-1,l=(1<>1,u=23===e?B(2,-24)-B(2,-77):0,f=0,d=t<0||0===t&&1/t<0?1:0;for((t=C(t))!=t||t===E?(i=t!=t?1:0,o=l):(o=_(I(t)/O),t*(r=B(2,-o))<1&&(o--,r*=2),(t+=o+c>=1?u/r:u*B(2,1-c))*r>=2&&(o++,r/=2),o+c>=l?(i=0,o=l):o+c>=1?(i=(t*r-1)*B(2,e),o+=c):(i=t*B(2,c-1)*B(2,e),o=0));e>=8;a[f++]=255&i,i/=256,e-=8);for(o=o<0;a[f++]=255&o,o/=256,s-=8);return a[--f]|=128*d,a}function P(t,e,n){var o,i=8*n-e-1,r=(1<>1,s=i-7,l=n-1,c=t[l--],u=127&c;for(c>>=7;s>0;u=256*u+t[l],l--,s-=8);for(o=u&(1<<-s)-1,u>>=-s,s+=e;s>0;o=256*o+t[l],l--,s-=8);if(0===u)u=1-a;else{if(u===r)return o?NaN:c?-E:E;o+=B(2,e),u-=a}return(c?-1:1)*o*B(2,u-e)}function R(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function j(t){return[255&t]}function F(t){return[255&t,t>>8&255]}function D(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function U(t){return A(t,52,8)}function H(t){return A(t,23,4)}function z(t,e,n){v(t[b],e,{get:function(){return this[n]}})}function G(t,e,n,o){var i=p(+n);if(i+e>t[L])throw S(m);var r=t[N]._b,a=i+t[M],s=r.slice(a,a+e);return o?s:s.reverse()}function W(t,e,n,o,i,r){var a=p(+n);if(a+e>t[L])throw S(m);for(var s=t[N]._b,l=a+t[M],c=o(+i),u=0;uK;)(X=Y[K++])in k||s(k,X,T[X]);r||(V.constructor=k)}var Z=new x(new k(2)),q=x[b].setInt8;Z.setInt8(0,2147483648),Z.setInt8(1,2147483649),!Z.getInt8(0)&&Z.getInt8(1)||l(x[b],{setInt8:function(t,e){q.call(this,t,e<<24>>24)},setUint8:function(t,e){q.call(this,t,e<<24>>24)}},!0)}else k=function(t){u(this,k,"ArrayBuffer");var e=p(t);this._b=g.call(new Array(e),0),this[L]=e},x=function(t,e,n){u(this,x,"DataView"),u(t,k,"DataView");var o=t[L],i=f(e);if(i<0||i>o)throw S("Wrong offset!");if(i+(n=void 0===n?o-i:d(n))>o)throw S("Wrong length!");this[N]=t,this[M]=i,this[L]=n},i&&(z(k,"byteLength","_l"),z(x,"buffer","_b"),z(x,"byteLength","_l"),z(x,"byteOffset","_o")),l(x[b],{getInt8:function(t){return G(this,1,t)[0]<<24>>24},getUint8:function(t){return G(this,1,t)[0]},getInt16:function(t){var e=G(this,2,t,arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=G(this,2,t,arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return R(G(this,4,t,arguments[1]))},getUint32:function(t){return R(G(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return P(G(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return P(G(this,8,t,arguments[1]),52,8)},setInt8:function(t,e){W(this,1,t,j,e)},setUint8:function(t,e){W(this,1,t,j,e)},setInt16:function(t,e){W(this,2,t,F,e,arguments[2])},setUint16:function(t,e){W(this,2,t,F,e,arguments[2])},setInt32:function(t,e){W(this,4,t,D,e,arguments[2])},setUint32:function(t,e){W(this,4,t,D,e,arguments[2])},setFloat32:function(t,e){W(this,4,t,H,e,arguments[2])},setFloat64:function(t,e){W(this,8,t,U,e,arguments[2])}});y(k,"ArrayBuffer"),y(x,"DataView"),s(x[b],a.VIEW,!0),e.ArrayBuffer=k,e.DataView=x},function(t,e,n){var o=n(352),i=n(353),r=n(354);t.exports=function(t){return o(t)||i(t)||r()}},function(t,e,n){t.exports=!n(18)&&!n(9)((function(){return 7!=Object.defineProperty(n(78)("div"),"a",{get:function(){return 7}}).a}))},function(t,e,n){var o=n(8),i=n(17),r=n(42),a=n(79),s=n(19).f;t.exports=function(t){var e=i.Symbol||(i.Symbol=r?{}:o.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:a.f(t)})}},function(t,e,n){var o=n(23),i=n(25),r=n(65)(!1),a=n(80)("IE_PROTO");t.exports=function(t,e){var n,s=i(t),l=0,c=[];for(n in s)n!=a&&o(s,n)&&c.push(n);for(;e.length>l;)o(s,n=e[l++])&&(~r(c,n)||c.push(n));return c}},function(t,e,n){var o=n(19),i=n(10),r=n(43);t.exports=n(18)?Object.defineProperties:function(t,e){i(t);for(var n,a=r(e),s=a.length,l=0;s>l;)o.f(t,n=a[l++],e[n]);return t}},function(t,e,n){var o=n(25),i=n(46).f,r={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==r.call(t)?function(t){try{return i(t)}catch(t){return a.slice()}}(t):i(o(t))}},function(t,e,n){"use strict";var o=n(18),i=n(43),r=n(66),a=n(61),s=n(20),l=n(60),c=Object.assign;t.exports=!c||n(9)((function(){var t={},e={},n=Symbol(),o="abcdefghijklmnopqrst";return t[n]=7,o.split("").forEach((function(t){e[t]=t})),7!=c({},t)[n]||Object.keys(c({},e)).join("")!=o}))?function(t,e){for(var n=s(t),c=arguments.length,u=1,f=r.f,d=a.f;c>u;)for(var p,h=l(arguments[u++]),v=f?i(h).concat(f(h)):i(h),g=v.length,y=0;g>y;)p=v[y++],o&&!d.call(h,p)||(n[p]=h[p]);return n}:c},function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},function(t,e,n){"use strict";var o=n(30),i=n(11),r=n(112),a=[].slice,s={},l=function(t,e,n){if(!(e in s)){for(var o=[],i=0;i>>0||(a.test(n)?16:10))}:o},function(t,e,n){var o=n(8).parseFloat,i=n(53).trim;t.exports=1/o(n(84)+"-0")!=-1/0?function(t){var e=i(String(t),3),n=o(e);return 0===n&&"-"==e.charAt(0)?-0:n}:o},function(t,e,n){var o=n(35);t.exports=function(t,e){if("number"!=typeof t&&"Number"!=o(t))throw TypeError(e);return+t}},function(t,e,n){var o=n(11),i=Math.floor;t.exports=function(t){return!o(t)&&isFinite(t)&&i(t)===t}},function(t,e){t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},function(t,e,n){"use strict";var o=n(45),i=n(40),r=n(52),a={};n(24)(a,n(12)("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=o(a,{next:i(1,n)}),r(t,e+" Iterator")}},function(t,e,n){var o=n(10);t.exports=function(t,e,n,i){try{return i?e(o(n)[0],n[1]):e(n)}catch(e){var r=t.return;throw void 0!==r&&o(r.call(t)),e}}},function(t,e,n){var o=n(266);t.exports=function(t,e){return new(o(t))(e)}},function(t,e,n){var o=n(30),i=n(20),r=n(60),a=n(16);t.exports=function(t,e,n,s,l){o(e);var c=i(t),u=r(c),f=a(c.length),d=l?f-1:0,p=l?-1:1;if(n<2)for(;;){if(d in u){s=u[d],d+=p;break}if(d+=p,l?d<0:f<=d)throw TypeError("Reduce of empty array with no initial value")}for(;l?d>=0:f>d;d+=p)d in u&&(s=e(s,u[d],d,c));return s}},function(t,e,n){"use strict";var o=n(20),i=n(44),r=n(16);t.exports=[].copyWithin||function(t,e){var n=o(this),a=r(n.length),s=i(t,a),l=i(e,a),c=arguments.length>2?arguments[2]:void 0,u=Math.min((void 0===c?a:i(c,a))-l,a-s),f=1;for(l0;)l in n?n[s]=n[l]:delete n[s],s+=f,l+=f;return n}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){"use strict";var o=n(99);n(0)({target:"RegExp",proto:!0,forced:o!==/./.exec},{exec:o})},function(t,e,n){n(18)&&"g"!=/./g.flags&&n(19).f(RegExp.prototype,"flags",{configurable:!0,get:n(69)})},function(t,e,n){"use strict";var o,i,r,a,s=n(42),l=n(8),c=n(29),u=n(62),f=n(0),d=n(11),p=n(30),h=n(56),v=n(72),g=n(63),y=n(101).set,b=n(286)(),m=n(127),k=n(287),x=n(73),w=n(128),S=l.TypeError,E=l.process,T=E&&E.versions,C=T&&T.v8||"",B=l.Promise,_="process"==u(E),I=function(){},O=i=m.f,N=!!function(){try{var t=B.resolve(1),e=(t.constructor={})[n(12)("species")]=function(t){t(I,I)};return(_||"function"==typeof PromiseRejectionEvent)&&t.then(I)instanceof e&&0!==C.indexOf("6.6")&&-1===x.indexOf("Chrome/66")}catch(t){}}(),L=function(t){var e;return!(!d(t)||"function"!=typeof(e=t.then))&&e},M=function(t,e){if(!t._n){t._n=!0;var n=t._c;b((function(){for(var o=t._v,i=1==t._s,r=0,a=function(e){var n,r,a,s=i?e.ok:e.fail,l=e.resolve,c=e.reject,u=e.domain;try{s?(i||(2==t._h&&R(t),t._h=1),!0===s?n=o:(u&&u.enter(),n=s(o),u&&(u.exit(),a=!0)),n===e.promise?c(S("Promise-chain cycle")):(r=L(n))?r.call(n,l,c):l(n)):c(o)}catch(t){u&&!a&&u.exit(),c(t)}};n.length>r;)a(n[r++]);t._c=[],t._n=!1,e&&!t._h&&A(t)}))}},A=function(t){y.call(l,(function(){var e,n,o,i=t._v,r=P(t);if(r&&(e=k((function(){_?E.emit("unhandledRejection",i,t):(n=l.onunhandledrejection)?n({promise:t,reason:i}):(o=l.console)&&o.error&&o.error("Unhandled promise rejection",i)})),t._h=_||P(t)?2:1),t._a=void 0,r&&e.e)throw e.v}))},P=function(t){return 1!==t._h&&0===(t._a||t._c).length},R=function(t){y.call(l,(function(){var e;_?E.emit("rejectionHandled",t):(e=l.onrejectionhandled)&&e({promise:t,reason:t._v})}))},j=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),M(e,!0))},F=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw S("Promise can't be resolved itself");(e=L(t))?b((function(){var o={_w:n,_d:!1};try{e.call(t,c(F,o,1),c(j,o,1))}catch(t){j.call(o,t)}})):(n._v=t,n._s=1,M(n,!1))}catch(t){j.call({_w:n,_d:!1},t)}}};N||(B=function(t){h(this,B,"Promise","_h"),p(t),o.call(this);try{t(c(F,this,1),c(j,this,1))}catch(t){j.call(this,t)}},(o=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(57)(B.prototype,{then:function(t,e){var n=O(g(this,B));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=_?E.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&M(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),r=function(){var t=new o;this.promise=t,this.resolve=c(F,t,1),this.reject=c(j,t,1)},m.f=O=function(t){return t===B||t===a?new r(t):i(t)}),f(f.G+f.W+f.F*!N,{Promise:B}),n(52)(B,"Promise"),n(55)("Promise"),a=n(17).Promise,f(f.S+f.F*!N,"Promise",{reject:function(t){var e=O(this);return(0,e.reject)(t),e.promise}}),f(f.S+f.F*(s||!N),"Promise",{resolve:function(t){return w(s&&this===a?B:this,t)}}),f(f.S+f.F*!(N&&n(68)((function(t){B.all(t).catch(I)}))),"Promise",{all:function(t){var e=this,n=O(e),o=n.resolve,i=n.reject,r=k((function(){var n=[],r=0,a=1;v(t,!1,(function(t){var s=r++,l=!1;n.push(void 0),a++,e.resolve(t).then((function(t){l||(l=!0,n[s]=t,--a||o(n))}),i)})),--a||o(n)}));return r.e&&i(r.v),n.promise},race:function(t){var e=this,n=O(e),o=n.reject,i=k((function(){v(t,!1,(function(t){e.resolve(t).then(n.resolve,o)}))}));return i.e&&o(i.v),n.promise}})},function(t,e,n){"use strict";var o=n(30);function i(t){var e,n;this.promise=new t((function(t,o){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=o})),this.resolve=o(e),this.reject=o(n)}t.exports.f=function(t){return new i(t)}},function(t,e,n){var o=n(10),i=n(11),r=n(127);t.exports=function(t,e){if(o(t),i(e)&&e.constructor===t)return e;var n=r.f(t);return(0,n.resolve)(e),n.promise}},function(t,e,n){"use strict";var o=n(19).f,i=n(45),r=n(57),a=n(29),s=n(56),l=n(72),c=n(90),u=n(123),f=n(55),d=n(18),p=n(39).fastKey,h=n(49),v=d?"_s":"size",g=function(t,e){var n,o=p(e);if("F"!==o)return t._i[o];for(n=t._f;n;n=n.n)if(n.k==e)return n};t.exports={getConstructor:function(t,e,n,c){var u=t((function(t,o){s(t,u,e,"_i"),t._t=e,t._i=i(null),t._f=void 0,t._l=void 0,t[v]=0,null!=o&&l(o,n,t[c],t)}));return r(u.prototype,{clear:function(){for(var t=h(this,e),n=t._i,o=t._f;o;o=o.n)o.r=!0,o.p&&(o.p=o.p.n=void 0),delete n[o.i];t._f=t._l=void 0,t[v]=0},delete:function(t){var n=h(this,e),o=g(n,t);if(o){var i=o.n,r=o.p;delete n._i[o.i],o.r=!0,r&&(r.n=i),i&&(i.p=r),n._f==o&&(n._f=i),n._l==o&&(n._l=r),n[v]--}return!!o},forEach:function(t){h(this,e);for(var n,o=a(t,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(o(n.v,n.k,this);n&&n.r;)n=n.p},has:function(t){return!!g(h(this,e),t)}}),d&&o(u.prototype,"size",{get:function(){return h(this,e)[v]}}),u},def:function(t,e,n){var o,i,r=g(t,e);return r?r.v=n:(t._l=r={i:i=p(e,!0),k:e,v:n,p:o=t._l,n:void 0,r:!1},t._f||(t._f=r),o&&(o.n=r),t[v]++,"F"!==i&&(t._i[i]=r)),t},getEntry:g,setStrong:function(t,e,n){c(t,e,(function(t,n){this._t=h(t,e),this._k=n,this._l=void 0}),(function(){for(var t=this._k,e=this._l;e&&e.r;)e=e.p;return this._t&&(this._l=e=e?e.n:this._t._f)?u(0,"keys"==t?e.k:"values"==t?e.v:[e.k,e.v]):(this._t=void 0,u(1))}),n?"entries":"values",!n,!0),f(e)}}},function(t,e,n){"use strict";var o=n(57),i=n(39).getWeak,r=n(10),a=n(11),s=n(56),l=n(72),c=n(34),u=n(23),f=n(49),d=c(5),p=c(6),h=0,v=function(t){return t._l||(t._l=new g)},g=function(){this.a=[]},y=function(t,e){return d(t.a,(function(t){return t[0]===e}))};g.prototype={get:function(t){var e=y(this,t);if(e)return e[1]},has:function(t){return!!y(this,t)},set:function(t,e){var n=y(this,t);n?n[1]=e:this.a.push([t,e])},delete:function(t){var e=p(this.a,(function(e){return e[0]===t}));return~e&&this.a.splice(e,1),!!~e}},t.exports={getConstructor:function(t,e,n,r){var c=t((function(t,o){s(t,c,e,"_i"),t._t=e,t._i=h++,t._l=void 0,null!=o&&l(o,n,t[r],t)}));return o(c.prototype,{delete:function(t){if(!a(t))return!1;var n=i(t);return!0===n?v(f(this,e)).delete(t):n&&u(n,this._i)&&delete n[this._i]},has:function(t){if(!a(t))return!1;var n=i(t);return!0===n?v(f(this,e)).has(t):n&&u(n,this._i)}}),c},def:function(t,e,n){var o=i(r(e),!0);return!0===o?v(t).set(e,n):o[t._i]=n,t},ufstore:v}},function(t,e,n){var o=n(31),i=n(16);t.exports=function(t){if(void 0===t)return 0;var e=o(t),n=i(e);if(e!==n)throw RangeError("Wrong length!");return n}},function(t,e,n){var o=n(46),i=n(66),r=n(10),a=n(8).Reflect;t.exports=a&&a.ownKeys||function(t){var e=o.f(r(t)),n=i.f;return n?e.concat(n(t)):e}},function(t,e,n){var o=n(16),i=n(86),r=n(36);t.exports=function(t,e,n,a){var s=String(r(t)),l=s.length,c=void 0===n?" ":String(n),u=o(e);if(u<=l||""==c)return s;var f=u-l,d=i.call(c,Math.ceil(f/c.length));return d.length>f&&(d=d.slice(0,f)),a?d+s:s+d}},function(t,e,n){var o=n(18),i=n(43),r=n(25),a=n(61).f;t.exports=function(t){return function(e){for(var n,s=r(e),l=i(s),c=l.length,u=0,f=[];c>u;)n=l[u++],o&&!a.call(s,n)||f.push(t?[n,s[n]]:s[n]);return f}}},function(t,e,n){var o=function(t){"use strict";var e,n=Object.prototype,o=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},r=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(t,e,n,o){var i=e&&e.prototype instanceof v?e:v,r=Object.create(i.prototype),a=new B(o||[]);return r._invoke=function(t,e,n){var o=u;return function(i,r){if(o===d)throw new Error("Generator is already running");if(o===p){if("throw"===i)throw r;return I()}for(n.method=i,n.arg=r;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===u)throw o=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=c(t,e,n);if("normal"===l.type){if(o=n.done?p:f,l.arg===h)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=p,n.method="throw",n.arg=l.arg)}}}(t,n,a),r}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var u="suspendedStart",f="suspendedYield",d="executing",p="completed",h={};function v(){}function g(){}function y(){}var b={};b[r]=function(){return this};var m=Object.getPrototypeOf,k=m&&m(m(_([])));k&&k!==n&&o.call(k,r)&&(b=k);var x=y.prototype=v.prototype=Object.create(b);function w(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function S(t){var e;this._invoke=function(n,i){function r(){return new Promise((function(e,r){!function e(n,i,r,a){var s=c(t[n],t,i);if("throw"!==s.type){var l=s.arg,u=l.value;return u&&"object"==typeof u&&o.call(u,"__await")?Promise.resolve(u.__await).then((function(t){e("next",t,r,a)}),(function(t){e("throw",t,r,a)})):Promise.resolve(u).then((function(t){l.value=t,r(l)}),(function(t){return e("throw",t,r,a)}))}a(s.arg)}(n,i,e,r)}))}return e=e?e.then(r,r):r()}}function E(t,n){var o=t.iterator[n.method];if(o===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,E(t,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var i=c(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,h;var r=i.arg;return r?r.done?(n[t.resultName]=r.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):r:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function _(t){if(t){var n=t[r];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function n(){for(;++i=0;--r){var a=this.tryEntries[r],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var l=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(l&&c){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&o.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),C(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var o=n.completion;if("throw"===o.type){var i=o.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,o){return this.delegate={iterator:_(t),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=e),h}},t}(t.exports);try{regeneratorRuntime=o}catch(t){Function("r","regeneratorRuntime = r")(o)}},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7),n(14)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u){"use strict";var f=n(15),d=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=d(i),r=d(r),a=d(a),s=d(s),l=d(l),c=d(c),u=f(u);var p=function(t){function e(){var t;return(0,i.default)(this,e),(t=(0,a.default)(this,(0,s.default)(e).apply(this,arguments))).insert=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.config.initialBlock,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;t.Editor.BlockManager.insert(e,n,o,i,r)},t}return(0,l.default)(e,t),(0,r.default)(e,[{key:"getBlocksCount",value:function(){return this.Editor.BlockManager.blocks.length}},{key:"getCurrentBlockIndex",value:function(){return this.Editor.BlockManager.currentBlockIndex}},{key:"getBlockByIndex",value:function(t){return this.Editor.BlockManager.getBlockByIndex(t).holder}},{key:"swap",value:function(t,e){this.Editor.BlockManager.swap(t,e),this.Editor.Toolbar.move(!1)}},{key:"delete",value:function(t){this.Editor.BlockManager.removeBlock(t),0===this.Editor.BlockManager.blocks.length&&this.Editor.BlockManager.insert(),this.Editor.Caret.setToBlock(this.Editor.BlockManager.currentBlock,this.Editor.Caret.positions.END),this.Editor.Toolbar.close()}},{key:"clear",value:function(){this.Editor.BlockManager.clear(!0),this.Editor.InlineToolbar.close()}},{key:"render",value:function(t){return this.Editor.BlockManager.clear(),this.Editor.Renderer.render(t.blocks)}},{key:"renderFromHTML",value:function(t){return this.Editor.BlockManager.clear(),this.Editor.Paste.processText(t,!0)}},{key:"stretchBlock",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.Editor.BlockManager.getBlockByIndex(t);n&&(n.stretched=e)}},{key:"insertNewBlock",value:function(){u.log("Method blocks.insertNewBlock() is deprecated and it will be removed in next major release. Use blocks.insert() instead.","warn"),this.insert()}},{key:"methods",get:function(){var t=this;return{clear:function(){return t.clear()},render:function(e){return t.render(e)},renderFromHTML:function(e){return t.renderFromHTML(e)},delete:function(){return t.delete()},swap:function(e,n){return t.swap(e,n)},getBlockByIndex:function(e){return t.getBlockByIndex(e)},getCurrentBlockIndex:function(){return t.getCurrentBlockIndex()},getBlocksCount:function(){return t.getBlocksCount()},stretchBlock:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t.stretchBlock(e,n)},insertNewBlock:function(){return t.insertNewBlock()},insert:this.insert}}}]),e}(c.default);o.default=p,p.displayName="BlocksAPI",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c){"use strict";var u=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=u(i),r=u(r),a=u(a),s=u(s),l=u(l);var f=function(t){function e(){var t;return(0,i.default)(this,e),(t=(0,a.default)(this,(0,s.default)(e).apply(this,arguments))).setToFirstBlock=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.Editor.Caret.positions.DEFAULT,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!!t.Editor.BlockManager.firstBlock&&(t.Editor.Caret.setToBlock(t.Editor.BlockManager.firstBlock,e,n),!0)},t.setToLastBlock=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.Editor.Caret.positions.DEFAULT,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!!t.Editor.BlockManager.lastBlock&&(t.Editor.Caret.setToBlock(t.Editor.BlockManager.lastBlock,e,n),!0)},t.setToPreviousBlock=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.Editor.Caret.positions.DEFAULT,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!!t.Editor.BlockManager.previousBlock&&(t.Editor.Caret.setToBlock(t.Editor.BlockManager.previousBlock,e,n),!0)},t.setToNextBlock=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.Editor.Caret.positions.DEFAULT,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!!t.Editor.BlockManager.nextBlock&&(t.Editor.Caret.setToBlock(t.Editor.BlockManager.nextBlock,e,n),!0)},t.setToBlock=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.Editor.Caret.positions.DEFAULT,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return!!t.Editor.BlockManager.blocks[e]&&(t.Editor.Caret.setToBlock(t.Editor.BlockManager.blocks[e],n,o),!0)},t.focus=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?t.setToLastBlock(t.Editor.Caret.positions.END):t.setToFirstBlock(t.Editor.Caret.positions.START)},t}return(0,l.default)(e,t),(0,r.default)(e,[{key:"methods",get:function(){return{setToFirstBlock:this.setToFirstBlock,setToLastBlock:this.setToLastBlock,setToPreviousBlock:this.setToPreviousBlock,setToNextBlock:this.setToNextBlock,setToBlock:this.setToBlock,focus:this.focus}}}]),e}((c=u(c)).default);o.default=f,f.displayName="CaretAPI",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c){"use strict";var u=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=u(i),r=u(r),a=u(a),s=u(s),l=u(l);var f=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"on",value:function(t,e){this.Editor.Events.on(t,e)}},{key:"emit",value:function(t,e){this.Editor.Events.emit(t,e)}},{key:"off",value:function(t,e){this.Editor.Events.off(t,e)}},{key:"methods",get:function(){var t=this;return{emit:function(e,n){return t.emit(e,n)},off:function(e,n){return t.off(e,n)},on:function(e,n){return t.on(e,n)}}}}]),e}((c=u(c)).default);o.default=f,f.displayName="EventsAPI",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c){"use strict";var u=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=u(i),r=u(r),a=u(a),s=u(s),l=u(l);var f=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"open",value:function(){this.Editor.InlineToolbar.tryToShow()}},{key:"close",value:function(){this.Editor.InlineToolbar.close()}},{key:"methods",get:function(){var t=this;return{close:function(){return t.close()},open:function(){return t.open()}}}}]),e}((c=u(c)).default);o.default=f,f.displayName="InlineToolbarAPI",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c){"use strict";var u=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=u(i),r=u(r),a=u(a),s=u(s),l=u(l);var f=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"on",value:function(t,e,n,o){this.Editor.Listeners.on(t,e,n,o)}},{key:"off",value:function(t,e,n){this.Editor.Listeners.off(t,e,n)}},{key:"methods",get:function(){var t=this;return{on:function(e,n,o,i){return t.on(e,n,o,i)},off:function(e,n,o){return t.off(e,n,o)}}}}]),e}((c=u(c)).default);o.default=f,f.displayName="ListenersAPI",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c){"use strict";var u=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=u(i),r=u(r),a=u(a),s=u(s),l=u(l);var f=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"show",value:function(t){return this.Editor.Notifier.show(t)}},{key:"methods",get:function(){var t=this;return{show:function(e){return t.show(e)}}}}]),e}((c=u(c)).default);o.default=f,f.displayName="NotifierAPI",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c){"use strict";var u=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=u(i),r=u(r),a=u(a),s=u(s),l=u(l);var f=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"clean",value:function(t,e){return this.Editor.Sanitizer.clean(t,e)}},{key:"methods",get:function(){var t=this;return{clean:function(e,n){return t.clean(e,n)}}}}]),e}((c=u(c)).default);o.default=f,f.displayName="SanitizerAPI",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c){"use strict";var u=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=u(i),r=u(r),a=u(a),s=u(s),l=u(l);var f=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"save",value:function(){return this.Editor.Saver.save()}},{key:"methods",get:function(){var t=this;return{save:function(){return t.save()}}}}]),e}((c=u(c)).default);o.default=f,f.displayName="SaverAPI",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7),n(28)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u){"use strict";var f=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=f(i),r=f(r),a=f(a),s=f(s),l=f(l),c=f(c),u=f(u);var d=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"findParentTag",value:function(t,e){return(new u.default).findParentTag(t,e)}},{key:"expandToTag",value:function(t){(new u.default).expandToTag(t)}},{key:"methods",get:function(){var t=this;return{findParentTag:function(e,n){return t.findParentTag(e,n)},expandToTag:function(e){return t.expandToTag(e)}}}}]),e}(c.default);o.default=d,d.displayName="SelectionAPI",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c){"use strict";var u=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=u(i),r=u(r),a=u(a),s=u(s),l=u(l);var f=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"classes",get:function(){return{block:"cdx-block",inlineToolButton:"ce-inline-tool",inlineToolButtonActive:"ce-inline-tool--active",input:"cdx-input",loader:"cdx-loader",button:"cdx-button",settingsButton:"cdx-settings-button",settingsButtonActive:"cdx-settings-button--active"}}}]),e}((c=u(c)).default);o.default=f,f.displayName="StylesAPI",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c){"use strict";var u=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=u(i),r=u(r),a=u(a),s=u(s),l=u(l);var f=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"open",value:function(){this.Editor.Toolbar.open()}},{key:"close",value:function(){this.Editor.Toolbar.close()}},{key:"methods",get:function(){var t=this;return{close:function(){return t.close()},open:function(){return t.open()}}}}]),e}((c=u(c)).default);o.default=f,f.displayName="ToolbarAPI",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c){"use strict";var u=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=u(i),r=u(r),a=u(a),s=u(s),l=u(l);var f=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"show",value:function(t,e,n){this.Editor.Tooltip.show(t,e,n)}},{key:"hide",value:function(){this.Editor.Tooltip.hide()}},{key:"onHover",value:function(t,e,n){this.Editor.Tooltip.onHover(t,e,n)}},{key:"methods",get:function(){var t=this;return{show:function(e,n,o){return t.show(e,n,o)},hide:function(){return t.hide()},onHover:function(e,n,o){return t.onHover(e,n,o)}}}}]),e}((c=u(c)).default);o.default=f,f.displayName="TooltipAPI",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7),n(14),n(28),n(58)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u,f,d){"use strict";var p=n(15),h=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=h(i),r=h(r),a=h(a),s=h(s),l=h(l),c=h(c),u=p(u),f=h(f),d=h(d);var v=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"keydown",value:function(t){switch(this.beforeKeydownProcessing(t),t.keyCode){case u.keyCodes.BACKSPACE:this.backspace(t);break;case u.keyCodes.ENTER:this.enter(t);break;case u.keyCodes.DOWN:case u.keyCodes.RIGHT:this.arrowRightAndDown(t);break;case u.keyCodes.UP:case u.keyCodes.LEFT:this.arrowLeftAndUp(t);break;case u.keyCodes.TAB:this.tabPressed(t);break;case u.keyCodes.ESC:this.escapePressed(t);break;default:this.defaultHandler()}}},{key:"beforeKeydownProcessing",value:function(t){this.needToolbarClosing(t)&&u.isPrintableKey(t.keyCode)&&(this.Editor.Toolbar.close(),this.Editor.ConversionToolbar.close(),t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||(this.Editor.BlockManager.clearFocused(),this.Editor.BlockSelection.clearSelection(t)))}},{key:"keyup",value:function(t){t.shiftKey||this.Editor.UI.checkEmptiness()}},{key:"mouseUp",value:function(){}},{key:"mouseDown",value:function(t){f.default.isCollapsed||this.Editor.BlockSelection.clearSelection(t),this.Editor.CrossBlockSelection.watchSelection(t)}},{key:"tabPressed",value:function(t){this.Editor.BlockSelection.clearSelection(t);var e=this.Editor,n=e.BlockManager,o=e.Tools,i=e.InlineToolbar,r=e.ConversionToolbar,a=n.currentBlock;if(a){var s=o.isInitial(a.tool)&&a.isEmpty,l=!a.isEmpty&&r.opened,c=!a.isEmpty&&!f.default.isCollapsed&&i.opened;s?this.activateToolbox():l||c||this.activateBlockSettings()}}},{key:"escapePressed",value:function(t){this.Editor.BlockSelection.clearSelection(t),this.Editor.Toolbox.opened?this.Editor.Toolbox.close():this.Editor.BlockSettings.opened?this.Editor.BlockSettings.close():this.Editor.ConversionToolbar.opened?this.Editor.ConversionToolbar.close():this.Editor.InlineToolbar.opened?this.Editor.InlineToolbar.close():this.Editor.Toolbar.close()}},{key:"dragOver",value:function(t){this.Editor.BlockManager.getBlockByChildNode(t.target).dropTarget=!0}},{key:"dragLeave",value:function(t){this.Editor.BlockManager.getBlockByChildNode(t.target).dropTarget=!1}},{key:"handleCommandC",value:function(t){var e=this.Editor.BlockSelection;e.anyBlockSelected&&(t.preventDefault(),e.copySelectedBlocks())}},{key:"handleCommandX",value:function(t){var e=this.Editor,n=e.BlockSelection,o=e.BlockManager,i=e.Caret;if(n.anyBlockSelected){t.preventDefault(),n.copySelectedBlocks();var r=o.removeSelectedBlocks();i.setToBlock(o.insertInitialBlockAtIndex(r,!0),i.positions.START),n.clearSelection(t)}}},{key:"enter",value:function(t){var e=this.Editor,n=e.BlockManager,o=e.Tools,i=e.UI,r=n.currentBlock,a=o.available[r.name];if(!(a&&a[o.INTERNAL_SETTINGS.IS_ENABLED_LINE_BREAKS]||i.someToolbarOpened&&i.someFlipperButtonFocused||t.shiftKey)){var s=this.Editor.BlockManager.currentBlock;this.Editor.Caret.isAtStart&&!this.Editor.BlockManager.currentBlock.hasMedia?this.Editor.BlockManager.insertInitialBlockAtIndex(this.Editor.BlockManager.currentBlockIndex):s=this.Editor.BlockManager.split(),this.Editor.Caret.setToBlock(s),this.Editor.Tools.isInitial(s.tool)&&s.isEmpty&&(this.Editor.Toolbar.open(!1),this.Editor.Toolbar.plusButton.show()),t.preventDefault()}}},{key:"backspace",value:function(t){var e=this.Editor,n=e.BlockManager,o=e.BlockSelection,i=e.Caret,r=n.currentBlock,a=this.Editor.Tools.available[r.name];if(r.selected||r.isEmpty&&r.currentInput===r.firstInput){t.preventDefault();var s=n.currentBlockIndex;return n.previousBlock&&0===n.previousBlock.inputs.length?n.removeBlock(s-1):n.removeBlock(),i.setToBlock(n.currentBlock,s?i.positions.END:i.positions.START),this.Editor.Toolbar.close(),void o.clearSelection(t)}if(!a||!a[this.Editor.Tools.INTERNAL_SETTINGS.IS_ENABLED_LINE_BREAKS]||i.isAtStart){var l=0===n.currentBlockIndex;i.isAtStart&&f.default.isCollapsed&&r.currentInput===r.firstInput&&!l&&(t.preventDefault(),this.mergeBlocks())}}},{key:"mergeBlocks",value:function(){var t=this.Editor,e=t.BlockManager,n=t.Caret,o=t.Toolbar,i=e.previousBlock,r=e.currentBlock;if(r.name!==i.name||!i.mergeable)return 0===i.inputs.length||i.isEmpty?(e.removeBlock(e.currentBlockIndex-1),n.setToBlock(e.currentBlock),void o.close()):void(n.navigatePrevious()&&o.close());n.createShadow(i.pluginsContent),e.mergeBlocks(i,r).then((function(){n.restoreCaret(i.pluginsContent),i.pluginsContent.normalize(),o.close()}))}},{key:"arrowRightAndDown",value:function(t){var e=this,n=d.default.usedKeys.includes(t.keyCode)&&(!t.shiftKey||t.keyCode===u.keyCodes.TAB);if(!this.Editor.UI.someToolbarOpened||!n){this.Editor.BlockManager.clearFocused(),this.Editor.Toolbar.close();var o=this.Editor.Caret.isAtEnd||this.Editor.BlockSelection.anyBlockSelected;t.shiftKey&&t.keyCode===u.keyCodes.DOWN&&o?this.Editor.CrossBlockSelection.toggleBlockSelectedState():(this.Editor.Caret.navigateNext()?t.preventDefault():u.delay((function(){e.Editor.BlockManager.currentBlock&&e.Editor.BlockManager.currentBlock.updateCurrentInput()}),20)(),this.Editor.BlockSelection.clearSelection(t))}}},{key:"arrowLeftAndUp",value:function(t){var e=this;if(this.Editor.UI.someToolbarOpened){if(d.default.usedKeys.includes(t.keyCode)&&(!t.shiftKey||t.keyCode===u.keyCodes.TAB))return;this.Editor.UI.closeAllToolbars()}this.Editor.BlockManager.clearFocused(),this.Editor.Toolbar.close();var n=this.Editor.Caret.isAtStart||this.Editor.BlockSelection.anyBlockSelected;t.shiftKey&&t.keyCode===u.keyCodes.UP&&n?this.Editor.CrossBlockSelection.toggleBlockSelectedState(!1):(this.Editor.Caret.navigatePrevious()?t.preventDefault():u.delay((function(){e.Editor.BlockManager.currentBlock&&e.Editor.BlockManager.currentBlock.updateCurrentInput()}),20)(),this.Editor.BlockSelection.clearSelection(t))}},{key:"defaultHandler",value:function(){}},{key:"needToolbarClosing",value:function(t){var e=t.keyCode===u.keyCodes.ENTER&&this.Editor.Toolbox.opened,n=t.keyCode===u.keyCodes.ENTER&&this.Editor.BlockSettings.opened,o=t.keyCode===u.keyCodes.ENTER&&this.Editor.InlineToolbar.opened,i=t.keyCode===u.keyCodes.ENTER&&this.Editor.ConversionToolbar.opened,r=t.keyCode===u.keyCodes.TAB;return!(t.shiftKey||r||e||n||o||i)}},{key:"activateToolbox",value:function(){this.Editor.Toolbar.opened||(this.Editor.Toolbar.open(!1,!1),this.Editor.Toolbar.plusButton.show()),this.Editor.Toolbox.open()}},{key:"activateBlockSettings",value:function(){this.Editor.Toolbar.opened||(this.Editor.BlockManager.currentBlock.focused=!0,this.Editor.Toolbar.open(!0,!1),this.Editor.Toolbar.plusButton.hide()),this.Editor.BlockSettings.opened||this.Editor.BlockSettings.open()}}]),e}(c.default);o.default=v,v.displayName="BlockEvents",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(27),n(2),n(3),n(4),n(5),n(6),n(59),n(7),n(13),n(14),n(363)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u,f,d,p,h){"use strict";var v=n(15),g=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=g(i),r=g(r),a=g(a),s=g(s),l=g(l),c=g(c),u=v(u),f=g(f),d=g(d),p=v(p),h=g(h);var y=function(t){function e(){var t;return(0,r.default)(this,e),(t=(0,s.default)(this,(0,l.default)(e).apply(this,arguments)))._currentBlockIndex=-1,t._blocks=null,t}return(0,c.default)(e,t),(0,a.default)(e,[{key:"prepare",value:function(){var t,e,n,o;return i.default.async((function(i){for(;;)switch(i.prev=i.next){case 0:t=new h.default(this.Editor.UI.nodes.redactor),e=this.Editor,n=e.BlockEvents,o=e.Shortcuts,this._blocks=new Proxy(t,{set:h.default.set,get:h.default.get}),o.add({name:"CMD+C",handler:function(t){n.handleCommandC(t)}}),o.add({name:"CMD+X",handler:function(t){n.handleCommandX(t)}});case 5:case"end":return i.stop()}}),null,this)}},{key:"composeBlock",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=this.Editor.Tools.construct(t,e),i=this.Editor.Tools.available[t],r=new u.default(t,o,i,n,this.Editor.API.methods);return this.bindEvents(r),r}},{key:"insert",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.initialBlock,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.currentBlockIndex+1,i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],r=this.composeBlock(t,e,n);return this._blocks[o]=r,i&&(this.currentBlockIndex=o),r}},{key:"paste",value:function(t,e){var n,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n=o?this.replace(t):this.insert(t);try{n.call(u.BlockToolAPI.ON_PASTE,e)}catch(e){p.log("".concat(t,": onPaste callback call is failed"),"error",e)}return n}},{key:"insertInitialBlockAtIndex",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.composeBlock(this.config.initialBlock,{},{});return this._blocks[t]=n,e?this.currentBlockIndex=t:t<=this.currentBlockIndex&&this.currentBlockIndex++,n}},{key:"insertAtEnd",value:function(){return this.currentBlockIndex=this.blocks.length-1,this.insert()}},{key:"mergeBlocks",value:function(t,e){var n,o;return i.default.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=this._blocks.indexOf(e),!e.isEmpty){r.next=3;break}return r.abrupt("return");case 3:return r.next=5,i.default.awrap(e.data);case 5:if(o=r.sent,p.isEmpty(o)){r.next=9;break}return r.next=9,i.default.awrap(t.mergeWith(o));case 9:this.removeBlock(n),this.currentBlockIndex=this._blocks.indexOf(t);case 11:case"end":return r.stop()}}),null,this)}},{key:"removeBlock",value:function(t){if(void 0===t&&(t=this.currentBlockIndex),this._blocks.remove(t),this.currentBlockIndex>=t&&this.currentBlockIndex--,!this.blocks.length)return this.currentBlockIndex=-1,void this.insert();0===t&&(this.currentBlockIndex=0)}},{key:"removeSelectedBlocks",value:function(){for(var t,e=this.blocks.length-1;e>=0;e--)this.blocks[e].selected&&(this.removeBlock(e),t=e);return t}},{key:"removeAllBlocks",value:function(){for(var t=this.blocks.length-1;t>=0;t--)this._blocks.remove(t);this.currentBlockIndex=-1,this.insert(),this.currentBlock.firstInput.focus()}},{key:"split",value:function(){var t=this.Editor.Caret.extractFragmentFromCaretPosition(),e=d.default.make("div");e.appendChild(t);var n={text:d.default.isEmpty(e)?"":e.innerHTML};return this.insert(this.config.initialBlock,n)}},{key:"replace",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.initialBlock,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.composeBlock(t,e);return this._blocks.insert(this.currentBlockIndex,n,!0),n}},{key:"getBlockByIndex",value:function(t){return this._blocks[t]}},{key:"getBlock",value:function(t){d.default.isElement(t)||(t=t.parentNode);var e=this._blocks.nodes,n=t.closest(".".concat(u.default.CSS.wrapper)),o=e.indexOf(n);if(o>=0)return this._blocks[o]}},{key:"highlightCurrentNode",value:function(){this.clearFocused(),this.currentBlock.focused=!0}},{key:"clearFocused",value:function(){this.blocks.forEach((function(t){return t.focused=!1}))}},{key:"setCurrentBlockByChildNode",value:function(t){d.default.isElement(t)||(t=t.parentNode);var e=t.closest(".".concat(u.default.CSS.wrapper));if(e)return this.currentBlockIndex=this._blocks.nodes.indexOf(e),this.currentBlock;throw new Error("Can not find a Block from this child Node")}},{key:"getBlockByChildNode",value:function(t){d.default.isElement(t)||(t=t.parentNode);var e=t.closest(".".concat(u.default.CSS.wrapper));return this.blocks.find((function(t){return t.holder===e}))}},{key:"swap",value:function(t,e){this._blocks.swap(t,e),this.currentBlockIndex=e}},{key:"dropPointer",value:function(){this.currentBlockIndex=-1,this.clearFocused()}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._blocks.removeAll(),this.dropPointer(),t&&this.insert(this.config.initialBlock),this.Editor.UI.checkEmptiness()}},{key:"bindEvents",value:function(t){var e=this.Editor,n=e.BlockEvents,o=e.Listeners;o.on(t.holder,"keydown",(function(t){return n.keydown(t)}),!0),o.on(t.holder,"mouseup",(function(t){return n.mouseUp()})),o.on(t.holder,"mousedown",(function(t){return n.mouseDown(t)})),o.on(t.holder,"keyup",(function(t){return n.keyup(t)})),o.on(t.holder,"dragover",(function(t){return n.dragOver(t)})),o.on(t.holder,"dragleave",(function(t){return n.dragLeave(t)}))}},{key:"currentBlockIndex",get:function(){return this._currentBlockIndex},set:function(t){this._blocks[this._currentBlockIndex]&&this._blocks[this._currentBlockIndex].willUnselect(),this._blocks[t]&&this._blocks[t].willSelect(),this._currentBlockIndex=t}},{key:"firstBlock",get:function(){return this._blocks[0]}},{key:"lastBlock",get:function(){return this._blocks[this._blocks.length-1]}},{key:"currentBlock",get:function(){return this._blocks[this.currentBlockIndex]}},{key:"nextBlock",get:function(){return this.currentBlockIndex===this._blocks.length-1?null:this._blocks[this.currentBlockIndex+1]}},{key:"nextContentfulBlock",get:function(){return this.blocks.slice(this.currentBlockIndex+1).find((function(t){return!!t.inputs.length}))}},{key:"previousContentfulBlock",get:function(){return this.blocks.slice(0,this.currentBlockIndex).reverse().find((function(t){return!!t.inputs.length}))}},{key:"previousBlock",get:function(){return 0===this.currentBlockIndex?null:this._blocks[this.currentBlockIndex-1]}},{key:"blocks",get:function(){return this._blocks.array}},{key:"isEditorEmpty",get:function(){return this.blocks.every((function(t){return t.isEmpty}))}}]),e}(f.default);o.default=y,y.displayName="BlockManager",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7),n(14),n(13),n(28)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u,f,d){"use strict";var p=n(15),h=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=h(i),r=h(r),a=h(a),s=h(s),l=h(l),c=h(c),u=p(u),f=h(f),d=h(d);var v=function(t){function e(){var t;return(0,i.default)(this,e),(t=(0,a.default)(this,(0,s.default)(e).apply(this,arguments))).needToSelectAll=!1,t.nativeInputSelected=!1,t.readyToBlockSelection=!1,t}return(0,l.default)(e,t),(0,r.default)(e,[{key:"prepare",value:function(){var t=this;this.Editor.Shortcuts.add({name:"CMD+A",handler:function(e){t.Editor.BlockManager.currentBlock&&t.handleCommandA(e)}}),this.selection=new d.default}},{key:"unSelectBlockByIndex",value:function(t){var e=this.Editor.BlockManager;(isNaN(t)?e.currentBlock:e.getBlockByIndex(t)).selected=!1}},{key:"clearSelection",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.Editor,o=n.BlockManager,i=n.Caret,r=n.RectangleSelection;if(this.needToSelectAll=!1,this.nativeInputSelected=!1,this.readyToBlockSelection=!1,this.anyBlockSelected&&t&&t instanceof KeyboardEvent&&u.isPrintableKey(t.keyCode)){var a=o.removeSelectedBlocks();o.insertInitialBlockAtIndex(a,!0),i.setToBlock(o.currentBlock),u.delay((function(){i.insertContentAtCaretPosition(t.key)}),20)()}this.Editor.CrossBlockSelection.clear(t),this.anyBlockSelected&&!r.isRectActivated()?(e&&this.selection.restore(),this.allBlocksSelected=!1):this.Editor.RectangleSelection.clearSelection()}},{key:"copySelectedBlocks",value:function(){var t=this,e=f.default.make("div");this.selectedBlocks.forEach((function(n){var o=t.Editor.Sanitizer.clean(n.holder.innerHTML,t.sanitizerConfig),i=f.default.make("p");i.innerHTML=o,e.appendChild(i)})),u.copyTextToClipboard(e.innerHTML)}},{key:"selectBlockByIndex",value:function(t){var e,n=this.Editor.BlockManager;n.clearFocused(),e=isNaN(t)?n.currentBlock:n.getBlockByIndex(t),this.selection.save(),d.default.get().removeAllRanges(),e.selected=!0,this.Editor.InlineToolbar.close()}},{key:"handleCommandA",value:function(t){if(this.Editor.RectangleSelection.clearSelection(),!f.default.isNativeInput(t.target)||this.readyToBlockSelection){var e=this.Editor.BlockManager.getBlock(t.target).inputs;e.length>1&&!this.readyToBlockSelection?this.readyToBlockSelection=!0:1!==e.length||this.needToSelectAll?this.needToSelectAll?(t.preventDefault(),this.selectAllBlocks(),this.needToSelectAll=!1,this.readyToBlockSelection=!1,this.Editor.ConversionToolbar.close()):this.readyToBlockSelection&&(t.preventDefault(),this.selectBlockByIndex(),this.needToSelectAll=!0):this.needToSelectAll=!0}else this.readyToBlockSelection=!0}},{key:"selectAllBlocks",value:function(){this.selection.save(),d.default.get().removeAllRanges(),this.allBlocksSelected=!0,this.Editor.InlineToolbar.close()}},{key:"sanitizerConfig",get:function(){return{p:{},h1:{},h2:{},h3:{},h4:{},h5:{},h6:{},ol:{},ul:{},li:{},br:!0,img:{src:!0,width:!0,height:!0},a:{href:!0},b:{},i:{},u:{}}}},{key:"allBlocksSelected",get:function(){return this.Editor.BlockManager.blocks.every((function(t){return!0===t.selected}))},set:function(t){this.Editor.BlockManager.blocks.forEach((function(e){return e.selected=t}))}},{key:"anyBlockSelected",get:function(){return this.Editor.BlockManager.blocks.some((function(t){return!0===t.selected}))}},{key:"selectedBlocks",get:function(){return this.Editor.BlockManager.blocks.filter((function(t){return t.selected}))}}]),e}(c.default);o.default=v,v.displayName="BlockSelection",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(28),n(7),n(13),n(14)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u,f,d){"use strict";var p=n(15),h=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=h(i),r=h(r),a=h(a),s=h(s),l=h(l),c=h(c),u=h(u),f=h(f),d=p(d);var v=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"setToBlock",value:function(t){var e,n=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.positions.DEFAULT,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.Editor.BlockManager;switch(o){case this.positions.START:e=t.firstInput;break;case this.positions.END:e=t.lastInput;break;default:e=t.currentInput}if(e){var a=f.default.getDeepestNode(e,o===this.positions.END),s=f.default.getContentLength(a);switch(!0){case o===this.positions.START:i=0;break;case o===this.positions.END:case i>s:i=s}d.delay((function(){n.set(a,i)}),20)(),r.setCurrentBlockByChildNode(t.holder),r.currentBlock.currentInput=e}}},{key:"setToInput",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.positions.DEFAULT,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=this.Editor.BlockManager.currentBlock,i=f.default.getDeepestNode(t);switch(e){case this.positions.START:this.set(i,0);break;case this.positions.END:var r=f.default.getContentLength(i);this.set(i,r);break;default:n&&this.set(i,n)}o.currentInput=t}},{key:"set",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=document.createRange(),o=c.default.get();if(f.default.isNativeInput(t)){if(!f.default.canSetCaret(t))return;return t.focus(),void(t.selectionStart=t.selectionEnd=e)}n.setStart(t,e),n.setEnd(t,e),o.removeAllRanges(),o.addRange(n);var i=t.nodeType===Node.ELEMENT_NODE?t.getBoundingClientRect():n.getBoundingClientRect(),r=i.top,a=i.bottom,s=window,l=s.innerHeight;r<0&&window.scrollBy(0,r),a>l&&window.scrollBy(0,a-l)}},{key:"setToTheLastBlock",value:function(){var t=this.Editor.BlockManager.lastBlock;if(t)if(this.Editor.Tools.isInitial(t.tool)&&t.isEmpty)this.setToBlock(t);else{var e=this.Editor.BlockManager.insertAtEnd();this.setToBlock(e)}}},{key:"extractFragmentFromCaretPosition",value:function(){var t=c.default.get();if(t.rangeCount){var e=t.getRangeAt(0),n=this.Editor.BlockManager.currentBlock.currentInput;if(e.deleteContents(),n){var o=e.cloneRange();return o.selectNodeContents(n),o.setStart(e.endContainer,e.endOffset),o.extractContents()}}}},{key:"navigateNext",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.Editor.BlockManager,n=e.currentBlock,o=e.nextContentfulBlock,i=n.nextInput;return!(!o&&!i||!t&&!this.isAtEnd||(i?this.setToInput(i,this.positions.START):this.setToBlock(o,this.positions.START),0))}},{key:"navigatePrevious",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.Editor.BlockManager,n=e.currentBlock,o=e.previousContentfulBlock;if(!n)return!1;var i=n.previousInput;return!(!o&&!i||!t&&!this.isAtStart||(i?this.setToInput(i,this.positions.END):this.setToBlock(o,this.positions.END),0))}},{key:"createShadow",value:function(t){var n=document.createElement("span");n.classList.add(e.CSS.shadowCaret),t.insertAdjacentElement("beforeEnd",n)}},{key:"restoreCaret",value:function(t){var n=t.querySelector(".".concat(e.CSS.shadowCaret));n&&((new c.default).expandToTag(n),setTimeout((function(){var t=document.createRange();t.selectNode(n),t.extractContents()}),50))}},{key:"insertContentAtCaretPosition",value:function(t){var e=document.createDocumentFragment(),n=document.createElement("div"),o=c.default.get(),i=c.default.range;n.innerHTML=t,Array.from(n.childNodes).forEach((function(t){return e.appendChild(t)}));var r=e.lastChild;i.deleteContents(),i.insertNode(e);var a=document.createRange();a.setStart(r,r.textContent.length),o.removeAllRanges(),o.addRange(a)}},{key:"getHigherLevelSiblings",value:function(t,e){for(var n=t,o=[];n.parentNode&&"true"!==n.parentNode.contentEditable;)n=n.parentNode;for(var i="left"===e?"previousSibling":"nextSibling";n[i];)n=n[i],o.push(n);return o}},{key:"positions",get:function(){return{START:"start",END:"end",DEFAULT:"default"}}},{key:"isAtStart",get:function(){var t=c.default.get(),e=f.default.getDeepestNode(this.Editor.BlockManager.currentBlock.currentInput),n=t.focusNode;if(f.default.isNativeInput(e))return 0===e.selectionEnd;if(!t.anchorNode)return!1;var o=n.textContent.search(/\S/);-1===o&&(o=0);var i=t.focusOffset;return n.nodeType!==Node.TEXT_NODE&&n.childNodes.length&&(n.childNodes[i]?(n=n.childNodes[i],i=0):i=(n=n.childNodes[i-1]).textContent.length),!(!f.default.isLineBreakTag(e)&&!f.default.isEmpty(e)||!this.getHigherLevelSiblings(n,"left").every((function(t){var e=f.default.isLineBreakTag(t),n=1===t.children.length&&f.default.isLineBreakTag(t.children[0]),o=e||n;return f.default.isEmpty(t)&&!o}))||i!==o)||(null===e||n===e&&i<=o)}},{key:"isAtEnd",get:function(){var t=c.default.get(),e=t.focusNode,n=f.default.getDeepestNode(this.Editor.BlockManager.currentBlock.currentInput,!0);if(f.default.isNativeInput(n))return n.selectionEnd===n.value.length;if(!t.focusNode)return!1;var o=t.focusOffset;if(e.nodeType!==Node.TEXT_NODE&&e.childNodes.length&&(e.childNodes[o-1]?o=(e=e.childNodes[o-1]).textContent.length:(e=e.childNodes[0],o=0)),f.default.isLineBreakTag(n)||f.default.isEmpty(n)){var i=this.getHigherLevelSiblings(e,"right");if(i.every((function(t,e){return e===i.length-1&&f.default.isLineBreakTag(t)||f.default.isEmpty(t)&&!f.default.isLineBreakTag(t)}))&&o===e.textContent.length)return!0}var r=n.textContent.replace(/\s+$/,"");return e===n&&o>=r.length}}],[{key:"CSS",get:function(){return{shadowCaret:"cdx-shadow-caret"}}}]),e}(u.default);o.default=v,v.displayName="Caret",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7),n(28),n(14)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u,f){"use strict";var d=n(15),p=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=p(i),r=p(r),a=p(a),s=p(s),l=p(l),c=p(c),u=p(u),f=d(f);var h=function(t){function e(){var t;return(0,i.default)(this,e),(t=(0,a.default)(this,(0,s.default)(e).apply(this,arguments))).onMouseUp=function(){var e=t.Editor.Listeners;e.off(document,"mouseover",t.onMouseOver),e.off(document,"mouseup",t.onMouseUp)},t.onMouseOver=function(e){var n=t.Editor.BlockManager,o=n.getBlockByChildNode(e.relatedTarget)||t.lastSelectedBlock,i=n.getBlockByChildNode(e.target);if(o&&i&&i!==o){if(o===t.firstSelectedBlock)return u.default.get().removeAllRanges(),o.selected=!0,void(i.selected=!0);if(i===t.firstSelectedBlock)return o.selected=!1,void(i.selected=!1);t.Editor.InlineToolbar.close(),t.toggleBlocksSelectedState(o,i),t.lastSelectedBlock=i}},t}return(0,l.default)(e,t),(0,r.default)(e,[{key:"watchSelection",value:function(t){if(t.button===f.mouseButtons.LEFT){var e=this.Editor,n=e.BlockManager,o=(e.UI,e.Listeners);this.firstSelectedBlock=n.getBlock(t.target),this.lastSelectedBlock=this.firstSelectedBlock,o.on(document,"mouseover",this.onMouseOver),o.on(document,"mouseup",this.onMouseUp)}}},{key:"toggleBlockSelectedState",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.Editor.BlockManager;this.lastSelectedBlock||(this.lastSelectedBlock=this.firstSelectedBlock=e.currentBlock),this.firstSelectedBlock===this.lastSelectedBlock&&(this.firstSelectedBlock.selected=!0,u.default.get().removeAllRanges());var n=e.blocks.indexOf(this.lastSelectedBlock)+(t?1:-1),o=e.blocks[n];o&&(this.lastSelectedBlock.selected!==o.selected?o.selected=!0:this.lastSelectedBlock.selected=!1,this.lastSelectedBlock=o,this.Editor.InlineToolbar.close())}},{key:"clear",value:function(t){var e=this.Editor,n=e.BlockManager,o=e.BlockSelection,i=e.Caret,r=n.blocks.indexOf(this.firstSelectedBlock),a=n.blocks.indexOf(this.lastSelectedBlock);if(o.anyBlockSelected&&r>-1&&a>-1)if(t&&t instanceof KeyboardEvent)switch(t.keyCode){case f.keyCodes.DOWN:case f.keyCodes.RIGHT:i.setToBlock(n.blocks[Math.max(r,a)],i.positions.END);break;case f.keyCodes.UP:case f.keyCodes.LEFT:i.setToBlock(n.blocks[Math.min(r,a)],i.positions.START);break;default:i.setToBlock(n.blocks[Math.max(r,a)],i.positions.END)}else i.setToBlock(n.blocks[Math.max(r,a)],i.positions.END);this.firstSelectedBlock=this.lastSelectedBlock=null}},{key:"toggleBlocksSelectedState",value:function(t,e){for(var n=this.Editor.BlockManager,o=n.blocks.indexOf(t),i=n.blocks.indexOf(e),r=t.selected!==e.selected,a=Math.min(o,i);a<=Math.max(o,i);a++){var s=n.blocks[a];s!==this.firstSelectedBlock&&s!==(r?t:e)&&(n.blocks[a].selected=!n.blocks[a].selected)}}},{key:"isCrossBlockSelectionStarted",get:function(){return!!this.firstSelectedBlock&&!!this.lastSelectedBlock}}]),e}(c.default);o.default=h,h.displayName="CrossBlockSelection",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(27),n(2),n(3),n(4),n(5),n(6),n(28),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u,f){"use strict";var d=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=d(i),r=d(r),a=d(a),s=d(s),l=d(l),c=d(c),u=d(u);var p=function(t){function e(){var t;return(0,r.default)(this,e),(t=(0,s.default)(this,(0,l.default)(e).apply(this,arguments))).isStartedAtEditor=!1,t.processDrop=function(e){var n,o,r,a,s,l;return i.default.async((function(i){for(;;)switch(i.prev=i.next){case 0:n=t.Editor,o=n.BlockManager,r=n.Caret,a=n.Paste,e.preventDefault(),o.blocks.forEach((function(t){return t.dropTarget=!1})),u.default.isAtEditor&&!u.default.isCollapsed&&t.isStartedAtEditor&&document.execCommand("delete"),t.isStartedAtEditor=!1;try{s=o.setCurrentBlockByChildNode(e.target),t.Editor.Caret.setToBlock(s,r.positions.END)}catch(e){l=o.setCurrentBlockByChildNode(o.lastBlock.holder),t.Editor.Caret.setToBlock(l,r.positions.END)}a.processDataTransfer(e.dataTransfer,!0);case 7:case"end":return i.stop()}}))},t}return(0,c.default)(e,t),(0,a.default)(e,[{key:"prepare",value:function(){this.bindEvents()}},{key:"bindEvents",value:function(){var t=this;this.Editor.Listeners.on(this.Editor.UI.nodes.holder,"drop",this.processDrop,!0),this.Editor.Listeners.on(this.Editor.UI.nodes.holder,"dragstart",(function(e){u.default.isAtEditor&&!u.default.isCollapsed&&(t.isStartedAtEditor=!0),t.Editor.InlineToolbar.close()})),this.Editor.Listeners.on(this.Editor.UI.nodes.holder,"dragover",(function(t){return t.preventDefault()}),!0)}}]),e}((f=d(f)).default);o.default=p,p.displayName="DragNDrop",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c){"use strict";var u=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=u(i),r=u(r),a=u(a),s=u(s),l=u(l);var f=function(t){function e(){var t;return(0,i.default)(this,e),(t=(0,a.default)(this,(0,s.default)(e).apply(this,arguments))).subscribers={},t}return(0,l.default)(e,t),(0,r.default)(e,[{key:"on",value:function(t,e){t in this.subscribers||(this.subscribers[t]=[]),this.subscribers[t].push(e)}},{key:"once",value:function(t,e){var n=this;t in this.subscribers||(this.subscribers[t]=[]),this.subscribers[t].push((function o(i){var r=e(i),a=n.subscribers[t].indexOf(o);return-1!==a&&n.subscribers[t].splice(a,1),r}))}},{key:"emit",value:function(t,e){this.subscribers[t]&&this.subscribers[t].reduce((function(t,e){var n=e(t);return n||t}),e)}},{key:"off",value:function(t,e){for(var n=0;n3&&void 0!==arguments[3]&&arguments[3],i={element:t,eventType:e,handler:n,options:o},r=this.findOne(t,e,n);r||(this.allListeners.push(i),t.addEventListener(e,n,o))}},{key:"off",value:function(t,e,n,o){var i=this,r=this.findAll(t,e,n);r.forEach((function(t,e){var n=i.allListeners.indexOf(r[e]);n>0&&(i.allListeners.splice(n,1),t.element.removeEventListener(t.eventType,t.handler,t.options))}))}},{key:"findOne",value:function(t,e,n){var o=this.findAll(t,e,n);return o.length>0?o[0]:null}},{key:"findAll",value:function(t,e,n){var o=t?this.findByEventTarget(t):[];return t&&e&&n?o.filter((function(t){return t.eventType===e&&t.handler===n})):t&&e?o.filter((function(t){return t.eventType===e})):o}},{key:"removeAll",value:function(){this.allListeners.map((function(t){t.element.removeEventListener(t.eventType,t.handler,t.options)})),this.allListeners=[]}},{key:"findByEventTarget",value:function(t){return this.allListeners.filter((function(e){if(e.element===t)return e}))}},{key:"findByType",value:function(t){return this.allListeners.filter((function(e){if(e.eventType===t)return e}))}},{key:"findByHandler",value:function(t){return this.allListeners.filter((function(e){if(e.handler===t)return e}))}}]),e}((c=u(c)).default);o.default=f,f.displayName="Listeners",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(27),n(2),n(3),n(4),n(5),n(6),n(7),n(14),n(59)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u,f,d){"use strict";var p=n(15),h=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=h(i),r=h(r),a=h(a),s=h(s),l=h(l),c=h(c),u=h(u),f=p(f),d=h(d);var v=function(t){function e(){var t;return(0,r.default)(this,e),(t=(0,s.default)(this,(0,l.default)(e).apply(this,arguments))).mutationDebouncer=f.debounce((function(){t.updateNativeInputs(),t.config.onChange()}),e.DebounceTimer),t.nativeInputs=[],t}return(0,c.default)(e,t),(0,a.default)(e,[{key:"destroy",value:function(){var t=this;this.mutationDebouncer=null,this.observer&&this.observer.disconnect(),this.observer=null,this.nativeInputs.forEach((function(e){return t.Editor.Listeners.off(e,"input",t.mutationDebouncer)}))}},{key:"prepare",value:function(){var t=this;return i.default.async((function(e){for(;;)switch(e.prev=e.next){case 0:window.setTimeout((function(){t.setObserver()}),1e3);case 1:case"end":return e.stop()}}))}},{key:"disable",value:function(){this.disabled=!0}},{key:"enable",value:function(){this.disabled=!1}},{key:"setObserver",value:function(){var t=this,e=this.Editor.UI;this.observer=new MutationObserver((function(e,n){t.mutationHandler(e,n)})),this.observer.observe(e.nodes.redactor,{childList:!0,attributes:!0,subtree:!0,characterData:!0,characterDataOldValue:!0})}},{key:"mutationHandler",value:function(t,e){if(!this.disabled){var n=!1;t.forEach((function(t){switch(t.type){case"childList":case"subtree":case"characterData":case"characterDataOldValue":n=!0;break;case"attributes":if(!t.target.classList.contains(d.default.CSS.wrapper))return void(n=!0)}})),n&&this.mutationDebouncer()}}},{key:"updateNativeInputs",value:function(){var t=this;this.nativeInputs&&this.nativeInputs.forEach((function(e){t.Editor.Listeners.off(e,"input")})),this.nativeInputs=Array.from(this.Editor.UI.nodes.redactor.querySelectorAll("textarea, input, select")),this.nativeInputs.forEach((function(e){return t.Editor.Listeners.on(e,"input",t.mutationDebouncer)}))}}]),e}(u.default);o.default=v,v.displayName="ModificationsObserver",v.DebounceTimer=450,t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7),n(364)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u){"use strict";var f=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=f(i),r=f(r),a=f(a),s=f(s),l=f(l),c=f(c),u=f(u);var d=function(t){function e(){return(0,i.default)(this,e),(0,a.default)(this,(0,s.default)(e).apply(this,arguments))}return(0,l.default)(e,t),(0,r.default)(e,[{key:"show",value:function(t){u.default.show(t)}}]),e}(c.default);o.default=d,d.displayName="Notifier",t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(103),n(27),n(50),n(2),n(3),n(4),n(5),n(6),n(7),n(13),n(14)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u,f,d,p,h){"use strict";var v=n(15),g=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=g(i),r=g(r),a=g(a),s=g(s),l=g(l),c=g(c),u=g(u),f=g(f),d=g(d),p=g(p),h=v(h);var y=function(t){function e(){var t;return(0,s.default)(this,e),(t=(0,c.default)(this,(0,u.default)(e).apply(this,arguments))).toolsTags={},t.tagsByTool={},t.toolsPatterns=[],t.toolsFiles={},t.exceptionList=[],t.processTool=function(e){var n=(0,a.default)(e,2),o=n[0],i=n[1];try{var r=new t.Editor.Tools.blockTools[o]({api:t.Editor.API.methods,config:{},data:{}});if(!1===i.pasteConfig)return void t.exceptionList.push(o);if("function"!=typeof r.onPaste)return;var s=i.pasteConfig||{};t.getTagsConfig(o,s),t.getFilesConfig(o,s),t.getPatternsConfig(o,s)}catch(t){h.log("Paste handling for «".concat(o,"» Tool hasn't been set up because of the error"),"warn",t)}},t.handlePasteEvent=function(e){var n,o,i;return r.default.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=t.Editor,o=n.BlockManager,i=n.Toolbar,o.currentBlock&&(!t.isNativeBehaviour(e.target)||e.clipboardData.types.includes("Files"))){r.next=3;break}return r.abrupt("return");case 3:if(!o.currentBlock||!t.exceptionList.includes(o.currentBlock.name)){r.next=5;break}return r.abrupt("return");case 5:e.preventDefault(),t.processDataTransfer(e.clipboardData),o.clearFocused(),i.close();case 9:case"end":return r.stop()}}))},t}return(0,f.default)(e,t),(0,l.default)(e,[{key:"prepare",value:function(){return r.default.async((function(t){for(;;)switch(t.prev=t.next){case 0:this.setCallback(),this.processTools();case 2:case"end":return t.stop()}}),null,this)}},{key:"processDataTransfer",value:function(t){var e,n,o,i,a,s,l,c,u=arguments;return r.default.async((function(f){for(;;)switch(f.prev=f.next){case 0:if(e=u.length>1&&void 0!==u[1]&&u[1],n=this.Editor.Sanitizer,!((o=t.types).includes?o.includes("Files"):o.contains("Files"))){f.next=8;break}return f.next=7,r.default.awrap(this.processFiles(t.files));case 7:return f.abrupt("return");case 8:if(i=t.getData("text/plain"),a=t.getData("text/html"),e&&i.trim()&&a.trim()&&(a="

"+(a.trim()?a:i)+"

"),s=Object.keys(this.toolsTags).reduce((function(t,e){return t[e.toLowerCase()]=!0,t}),{}),l=Object.assign({},s,n.getAllInlineToolsConfig(),{br:{}}),(c=n.clean(a,l)).trim()&&c.trim()!==i&&p.default.isHTMLString(c)){f.next=19;break}return f.next=17,r.default.awrap(this.processText(i));case 17:f.next=21;break;case 19:return f.next=21,r.default.awrap(this.processText(c,!0));case 21:case"end":return f.stop()}}),null,this)}},{key:"processText",value:function(t){var e,n,o,i,a,s,l,c,u=this,f=arguments;return r.default.async((function(d){for(;;)switch(d.prev=d.next){case 0:if(e=f.length>1&&void 0!==f[1]&&f[1],n=this.Editor,o=n.Caret,i=n.BlockManager,a=n.Tools,(s=e?this.processHTML(t):this.processPlain(t)).length){d.next=5;break}return d.abrupt("return");case 5:if(1!==s.length){d.next=8;break}return s[0].isBlock?this.processSingleBlock(s.pop()):this.processInlinePaste(s.pop()),d.abrupt("return");case 8:return l=i.currentBlock&&a.isInitial(i.currentBlock.tool),c=l&&i.currentBlock.isEmpty,d.next=12,r.default.awrap(Promise.all(s.map((function(t,e){return r.default.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,r.default.awrap(u.insertBlock(t,0===e&&c));case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}))}))));case 12:i.currentBlock&&o.setToBlock(i.currentBlock,o.positions.END);case 13:case"end":return d.stop()}}),null,this)}},{key:"setCallback",value:function(){this.Editor.Listeners.on(document,"paste",this.handlePasteEvent)}},{key:"processTools",value:function(){var t=this.Editor.Tools.blockTools;Object.entries(t).forEach(this.processTool)}},{key:"getTagsConfig",value:function(t,e){var n=this,o=e.tags||[];o.forEach((function(e){n.toolsTags.hasOwnProperty(e)?h.log("Paste handler for «".concat(t,"» Tool on «").concat(e,"» tag is skipped ")+"because it is already used by «".concat(n.toolsTags[e].tool,"» Tool."),"warn"):n.toolsTags[e.toUpperCase()]={tool:t}})),this.tagsByTool[t]=o.map((function(t){return t.toUpperCase()}))}},{key:"getFilesConfig",value:function(t,e){var n=e.files,o=void 0===n?{}:n,i=o.extensions,r=o.mimeTypes;(i||r)&&(i&&!Array.isArray(i)&&(h.log("«extensions» property of the onDrop config for «".concat(t,"» Tool should be an array")),i=[]),r&&!Array.isArray(r)&&(h.log("«mimeTypes» property of the onDrop config for «".concat(t,"» Tool should be an array")),r=[]),r&&(r=r.filter((function(e){return!!h.isValidMimeType(e)||(h.log("MIME type value «".concat(e,"» for the «").concat(t,"» Tool is not a valid MIME type"),"warn"),!1)}))),this.toolsFiles[t]={extensions:i||[],mimeTypes:r||[]})}},{key:"getPatternsConfig",value:function(t,e){var n=this;e.patterns&&!h.isEmpty(e.patterns)&&Object.entries(e.patterns).forEach((function(e){var o=(0,a.default)(e,2),i=o[0],r=o[1];r instanceof RegExp||h.log("Pattern ".concat(r," for «").concat(t,"» Tool is skipped because it should be a Regexp instance."),"warn"),n.toolsPatterns.push({key:i,pattern:r,tool:t})}))}},{key:"isNativeBehaviour",value:function(t){return p.default.isNativeInput(t)}},{key:"processFiles",value:function(t){var e,n,o,i,a,s,l=this;return r.default.async((function(c){for(;;)switch(c.prev=c.next){case 0:return e=this.Editor,n=e.BlockManager,o=e.Tools,c.next=3,r.default.awrap(Promise.all(Array.from(t).map((function(t){return l.processFile(t)}))));case 3:i=(i=c.sent).filter((function(t){return!!t})),a=o.isInitial(n.currentBlock.tool),s=a&&n.currentBlock.isEmpty,i.forEach((function(t,e){n.paste(t.type,t.event,0===e&&s)}));case 8:case"end":return c.stop()}}),null,this)}},{key:"processFile",value:function(t){var e,n,o,i,s;return r.default.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(e=h.getFileExtension(t),n=Object.entries(this.toolsFiles).find((function(n){var o=(0,a.default)(n,2),i=(o[0],o[1]),r=i.mimeTypes,s=i.extensions,l=t.type.split("/"),c=(0,a.default)(l,2),u=c[0],f=c[1],d=s.find((function(t){return t.toLowerCase()===e.toLowerCase()})),p=r.find((function(t){var e=t.split("/"),n=(0,a.default)(e,2),o=n[0],i=n[1];return o===u&&(i===f||"*"===i)}));return!!d||!!p}))){r.next=4;break}return r.abrupt("return");case 4:return o=(0,a.default)(n,1),i=o[0],s=this.composePasteEvent("file",{file:t}),r.abrupt("return",{event:s,type:i});case 7:case"end":return r.stop()}}),null,this)}},{key:"processHTML",value:function(t){var e=this,n=this.Editor,o=n.Tools,i=n.Sanitizer,r=this.config.initialBlock,a=p.default.make("DIV");return a.innerHTML=t,this.getNodes(a).map((function(t){var n,a=r,s=!1;switch(t.nodeType){case Node.DOCUMENT_FRAGMENT_NODE:(n=p.default.make("div")).appendChild(t);break;case Node.ELEMENT_NODE:n=t,s=!0,e.toolsTags[n.tagName]&&(a=e.toolsTags[n.tagName].tool)}var l=o.blockTools[a].pasteConfig.tags.reduce((function(t,e){return t[e.toLowerCase()]={},t}),{}),c=Object.assign({},l,i.getInlineToolsConfig(a));return n.innerHTML=i.clean(n.innerHTML,c),{content:n,isBlock:s,tool:a,event:e.composePasteEvent("tag",{data:n})}})).filter((function(t){return!p.default.isNodeEmpty(t.content)||p.default.isSingleTag(t.content)}))}},{key:"processPlain",value:function(t){var e=this,n=this.config.initialBlock;if(this.Editor.Tools,!t)return[];var o=n;return t.split(/\r?\n/).filter((function(t){return t.trim()})).map((function(t){var n=p.default.make("div");n.innerHTML=t;var i=e.composePasteEvent("tag",{data:n});return{content:n,tool:o,isBlock:!1,event:i}}))}},{key:"processSingleBlock",value:function(t){var e,n,o,i,a;return r.default.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(e=this.Editor,n=e.Caret,o=e.BlockManager,i=e.Tools,(a=o.currentBlock)&&t.tool===a.name&&p.default.containsOnlyInlineElements(t.content.innerHTML)){r.next=5;break}return this.insertBlock(t,a&&i.isInitial(a.tool)&&a.isEmpty),r.abrupt("return");case 5:n.insertContentAtCaretPosition(t.content.innerHTML);case 6:case"end":return r.stop()}}),null,this)}},{key:"processInlinePaste",value:function(t){var n,o,i,a,s,l,c,u,f,d;return r.default.async((function(p){for(;;)switch(p.prev=p.next){case 0:if(n=this.Editor,o=n.BlockManager,i=n.Caret,a=n.Sanitizer,s=n.Tools,l=t.content,t.tool,!(o.currentBlock&&s.isInitial(o.currentBlock.tool)&&l.textContent.length1&&void 0!==l[1]&&l[1],n=this.Editor,o=n.BlockManager,i=n.Caret,a=o.currentBlock,!(e&&a&&a.isEmpty)){r.next=7;break}return s=o.paste(t.tool,t.event,!0),i.setToBlock(s,i.positions.END),r.abrupt("return");case 7:s=o.paste(t.tool,t.event),i.setToBlock(s,i.positions.END);case 9:case"end":return r.stop()}}),null,this)}},{key:"getNodes",value:function(t){var e=this,n=Array.from(t.childNodes),o=Object.keys(this.toolsTags);return n.reduce((function t(n,r){if(p.default.isEmpty(r)&&!p.default.isSingleTag(r))return n;var a=n[n.length-1],s=new DocumentFragment;switch(a&&p.default.isFragment(a)&&(s=n.pop()),r.nodeType){case Node.ELEMENT_NODE:var l=r;if("BR"===l.tagName)return[].concat((0,i.default)(n),[s,new DocumentFragment]);var c=(e.toolsTags[l.tagName]||{}).tool,u=void 0===c?"":c,f=e.tagsByTool[u]||[],d=o.includes(l.tagName),h=p.default.blockElements.includes(l.tagName.toLowerCase()),v=Array.from(l.children).some((function(t){var e=t.tagName;return o.includes(e)&&!f.includes(e)})),g=Array.from(l.children).some((function(t){var e=t.tagName;return p.default.blockElements.includes(e.toLowerCase())}));if(!h&&!d&&!v)return s.appendChild(l),[].concat((0,i.default)(n),[s]);if(d&&!v||h&&!g&&!v)return[].concat((0,i.default)(n),[s,l]);break;case Node.TEXT_NODE:return s.appendChild(r),[].concat((0,i.default)(n),[s]);default:return[].concat((0,i.default)(n),[s])}return[].concat((0,i.default)(n),(0,i.default)(Array.from(r.childNodes).reduce(t,[])))}),[])}},{key:"composePasteEvent",value:function(t,e){return new CustomEvent(t,{detail:e})}}]),e}(d.default);o.default=y,y.displayName="Paste",y.PATTERN_PROCESSING_MAX_LENGTH=450,t.exports=e.default})?o.apply(e,i):o)||(t.exports=r)},function(t,e,n){var o,i,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,i=[e,n(2),n(3),n(4),n(5),n(6),n(7),n(13),n(28),n(59)],void 0===(r="function"==typeof(o=function(o,i,r,a,s,l,c,u,f,d){"use strict";var p=n(1);Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0,i=p(i),r=p(r),a=p(a),s=p(s),l=p(l),c=p(c),u=p(u),f=p(f),d=p(d);var h=function(t){function e(){var t;return(0,i.default)(this,e),(t=(0,a.default)(this,(0,s.default)(e).apply(this,arguments))).isRectSelectionActivated=!1,t.SCROLL_SPEED=3,t.HEIGHT_OF_SCROLL_ZONE=40,t.BOTTOM_SCROLL_ZONE=1,t.TOP_SCROLL_ZONE=2,t.MAIN_MOUSE_BUTTON=0,t.mousedown=!1,t.isScrolling=!1,t.inScrollZone=null,t.startX=0,t.startY=0,t.mouseX=0,t.mouseY=0,t.stackOfSelected=[],t}return(0,l.default)(e,t),(0,r.default)(e,[{key:"prepare",value:function(){var t=this,e=this.Editor.Listeners,n=this.genHTML().container;e.on(n,"mousedown",(function(e){e.button===t.MAIN_MOUSE_BUTTON&&t.startSelection(e.pageX,e.pageY)}),!1),e.on(document.body,"mousemove",(function(e){t.changingRectangle(e),t.scrollByZones(e.clientY)}),!1),e.on(document.body,"mouseleave",(function(){t.clearSelection(),t.endSelection()})),e.on(window,"scroll",(function(e){t.changingRectangle(e)}),!1),e.on(document.body,"mouseup",(function(){t.endSelection()}),!1)}},{key:"startSelection",value:function(t,e){this.Editor.BlockSelection.allBlocksSelected=!1,this.clearSelection(),this.stackOfSelected=[];var n=document.elementFromPoint(t-window.pageXOffset,e-window.pageYOffset),o=[".".concat(d.default.CSS.content),".".concat(this.Editor.Toolbar.CSS.toolbar),".".concat(this.Editor.InlineToolbar.CSS.inlineToolbar)],i=n.closest("."+this.Editor.UI.CSS.editorWrapper),r=o.some((function(t){return!!n.closest(t)}));i&&!r&&(this.mousedown=!0,this.startX=t,this.startY=e)}},{key:"endSelection",value:function(){this.mousedown=!1,this.startX=0,this.startY=0,this.overlayRectangle.style.display="none"}},{key:"isRectActivated",value:function(){return this.isRectSelectionActivated}},{key:"clearSelection",value:function(){this.isRectSelectionActivated=!1}},{key:"scrollByZones",value:function(t){this.inScrollZone=null,t<=this.HEIGHT_OF_SCROLL_ZONE&&(this.inScrollZone=this.TOP_SCROLL_ZONE),document.documentElement.clientHeight-t<=this.HEIGHT_OF_SCROLL_ZONE&&(this.inScrollZone=this.BOTTOM_SCROLL_ZONE),this.inScrollZone?this.isScrolling||(this.scrollVertical(this.inScrollZone===this.TOP_SCROLL_ZONE?-this.SCROLL_SPEED:this.SCROLL_SPEED),this.isScrolling=!0):this.isScrolling=!1}},{key:"genHTML",value:function(){var t=this.Editor.UI,n=t.nodes.holder.querySelector("."+t.CSS.editorWrapper),o=u.default.make("div",e.CSS.overlay,{}),i=u.default.make("div",e.CSS.overlayContainer,{}),r=u.default.make("div",e.CSS.rect,{});return i.appendChild(r),o.appendChild(i),n.appendChild(o),this.overlayRectangle=r,{container:n,overlay:o}}},{key:"scrollVertical",value:function(t){var e=this;if(this.inScrollZone&&this.mousedown){var n=window.pageYOffset;window.scrollBy(0,t),this.mouseY+=window.pageYOffset-n,setTimeout((function(){e.scrollVertical(t)}),0)}}},{key:"changingRectangle",value:function(t){if(this.mousedown){void 0!==t.pageY&&(this.mouseX=t.pageX,this.mouseY=t.pageY);var e=this.genInfoForMouseSelection(),n=e.rightPos,o=e.leftPos,i=e.index,r=this.startX>n&&this.mouseX>n,a=this.startX=this.startY?(this.overlayRectangle.style.top="".concat(this.startY-window.pageYOffset,"px"),this.overlayRectangle.style.bottom="calc(100% - ".concat(this.mouseY-window.pageYOffset,"px")):(this.overlayRectangle.style.bottom="calc(100% - ".concat(this.startY-window.pageYOffset,"px"),this.overlayRectangle.style.top="".concat(this.mouseY-window.pageYOffset,"px")),this.mouseX>=this.startX?(this.overlayRectangle.style.left="".concat(this.startX-window.pageXOffset,"px"),this.overlayRectangle.style.right="calc(100% - ".concat(this.mouseX-window.pageXOffset,"px")):(this.overlayRectangle.style.right="calc(100% - ".concat(this.startX-window.pageXOffset,"px"),this.overlayRectangle.style.left="".concat(this.mouseX-window.pageXOffset,"px"))}},{key:"genInfoForMouseSelection",value:function(){var t,e=document.body.offsetWidth/2,n=this.mouseY-window.pageYOffset,o=document.elementFromPoint(e,n),i=this.Editor.BlockManager.getBlockByChildNode(o);void 0!==i&&(t=this.Editor.BlockManager.blocks.findIndex((function(t){return t.holder===i.holder})));var r=this.Editor.BlockManager.lastBlock.holder.querySelector("."+d.default.CSS.content),a=Number.parseInt(window.getComputedStyle(r).width,10)/2;return{index:t,leftPos:e-a,rightPos:e+a}}},{key:"addBlockInSelection",value:function(t){this.rectCrossesBlocks&&this.Editor.BlockSelection.selectBlockByIndex(t),this.stackOfSelected.push(t)}},{key:"trySelectNextBlock",value:function(t){var e=this,n=this.stackOfSelected[this.stackOfSelected.length-1]===t,o=this.stackOfSelected.length;if(!n){var i=this.stackOfSelected[o-1]-this.stackOfSelected[o-2]>0,r=o<=1?0:i?1:-1,a=t>this.stackOfSelected[o-1]&&1===r,s=tthis.stackOfSelected[o-1]||void 0===this.stackOfSelected[o-1])){if(!l&&t=t;c--)this.addBlockInSelection(c);else if(l){var u,f=o-1;for(u=t>this.stackOfSelected[o-1]?function(){return t>e.stackOfSelected[f]}:function(){return t1&&void 0!==arguments[1]?arguments[1]:{},n={tags:e},o=this.createHTMLJanitorInstance(n);return o.clean(t)}},{key:"composeToolConfig",value:function(t){if(this.configCache[t])return this.configCache[t];var e=this.Editor.Tools.INTERNAL_SETTINGS.SANITIZE_CONFIG,n=this.Editor.Tools.available[t],o=this.getInlineToolsConfig(t);if(!n.sanitize||n[e]&&d.isEmpty(n[e]))return o;var i=n.sanitize,a={};for(var s in i)if(i.hasOwnProperty(s)){var l=i[s];"object"===(0,r.default)(l)?a[s]=Object.assign({},o,l):a[s]=l}return this.configCache[t]=a,a}},{key:"getInlineToolsConfig",value:function(t){var e=this.Editor.Tools,n=e.getToolSettings(t).inlineToolbar||[],o={};return"boolean"==typeof n&&n?o=this.getAllInlineToolsConfig():n.map((function(t){o=Object.assign(o,e.inline[t][e.INTERNAL_SETTINGS.SANITIZE_CONFIG])})),o}},{key:"getAllInlineToolsConfig",value:function(){var t=this.Editor.Tools;if(this.inlineToolsConfigCache)return this.inlineToolsConfigCache;var e={};return Object.entries(t.inline).forEach((function(n){var o=(0,i.default)(n,2),r=(o[0],o[1]);Object.assign(e,r[t.INTERNAL_SETTINGS.SANITIZE_CONFIG])})),this.inlineToolsConfigCache=e,this.inlineToolsConfigCache}},{key:"cleanArray",value:function(t,e){var n=this;return t.map((function(t){return n.deepSanitize(t,e)}))}},{key:"cleanObject",value:function(t,e){var n={};for(var o in t)if(t.hasOwnProperty(o)){var i=t[o],r=this.isRule(e[o])?e[o]:e;n[o]=this.deepSanitize(i,r)}return n}},{key:"cleanOneItem",value:function(t,e){return"object"===(0,r.default)(e)?this.clean(t,e):!1===e?this.clean(t,{}):t}},{key:"isRule",value:function(t){return"object"===(0,r.default)(t)||"boolean"==typeof t||"function"==typeof t} /** * If developer uses editor's API, then he can customize sanitize restrictions. * Or, sanitizing config can be defined globally in editors initialization. That config will be used everywhere diff --git a/dist/editor.licenses.txt b/dist/editor.licenses.txt index 3c66a1f8..b8a44d39 100644 --- a/dist/editor.licenses.txt +++ b/dist/editor.licenses.txt @@ -163,7 +163,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI core-js MIT -Copyright (c) 2014-2018 Denis Pushkarev +Copyright (c) 2014-2019 Denis Pushkarev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 863cddf2..d4720a06 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -3,7 +3,8 @@ ### 2.16.1 - `Fix` — Fix Firefox bug with incorrect height and cursor position of empty content editable elements [#947](https://github.com/codex-team/editor.js/issues/947) [#876](https://github.com/codex-team/editor.js/issues/876) [#608](https://github.com/codex-team/editor.js/issues/608) [#876](https://github.com/codex-team/editor.js/issues/876) -- `Fix` - Set initial hidden Inline Toolbar position [#979](https://github.com/codex-team/editor.js/issues/979) +- `Fix` — Set initial hidden Inline Toolbar position [#979](https://github.com/codex-team/editor.js/issues/979) +- `Fix` — Fix issue with CodeX.Toolips TypeScript definitions [#978](https://github.com/codex-team/editor.js/issues/978) ### 2.16 diff --git a/package.json b/package.json index 496c5687..5bcac311 100644 --- a/package.json +++ b/package.json @@ -70,6 +70,7 @@ "url": "https://opencollective.com/editorjs" }, "dependencies": { - "codex-notifier": "^1.1.2" + "codex-notifier": "^1.1.2", + "codex-tooltip": "^1.0.0" } } diff --git a/src/components/external/codex.tooltips b/src/components/external/codex.tooltips deleted file mode 160000 index 72a7c01b..00000000 --- a/src/components/external/codex.tooltips +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 72a7c01b6589fbe5591f63d0501c898a47d22875 diff --git a/src/components/modules/api/tooltip.ts b/src/components/modules/api/tooltip.ts index 920cc488..dffcd456 100644 --- a/src/components/modules/api/tooltip.ts +++ b/src/components/modules/api/tooltip.ts @@ -1,6 +1,6 @@ import Module from '../../__module'; import { Tooltip } from '../../../../types/api'; -import {TooltipContent, TooltipOptions} from '../../external/codex.tooltips'; +import {TooltipContent, TooltipOptions} from 'codex-tooltip'; /** * @class TooltipAPI diff --git a/src/components/modules/tooltip.ts b/src/components/modules/tooltip.ts index 1c2ffdcf..cfb463c2 100644 --- a/src/components/modules/tooltip.ts +++ b/src/components/modules/tooltip.ts @@ -3,7 +3,7 @@ import Module from '../__module'; /** * Use external module CodeX Tooltip */ -import CodeXTooltips, { TooltipContent, TooltipOptions } from '../external/codex.tooltips'; +import CodeXTooltips, { TooltipContent, TooltipOptions } from 'codex-tooltip'; import {ModuleConfig} from '../../types-internal/module-config'; /** diff --git a/types/api/tooltip.d.ts b/types/api/tooltip.d.ts index 485afed8..6ca7c42a 100644 --- a/types/api/tooltip.d.ts +++ b/types/api/tooltip.d.ts @@ -1,7 +1,7 @@ /** * Tooltip API */ -import {TooltipContent, TooltipOptions} from '../../src/components/external/codex.tooltips'; +import {TooltipContent, TooltipOptions} from 'codex-tooltip'; export interface Tooltip { /** diff --git a/yarn.lock b/yarn.lock index 0d805db0..6cab476f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1631,6 +1631,11 @@ codex-notifier@^1.1.2: resolved "https://registry.yarnpkg.com/codex-notifier/-/codex-notifier-1.1.2.tgz#a733079185f4c927fa296f1d71eb8753fe080895" integrity sha512-DCp6xe/LGueJ1N5sXEwcBc3r3PyVkEEDNWCVigfvywAkeXcZMk9K41a31tkEFBW0Ptlwji6/JlAb49E3Yrxbtg== +codex-tooltip@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/codex-tooltip/-/codex-tooltip-1.0.0.tgz#720353b27fadc40f2d054d171479b016ffcb63ea" + integrity sha512-Wa/p/om166GVjg+q436BERBZZz3yvTnCDDzMV2kjKIzsUkj6vCWphTSTo+M0QJRfwODKzhXYaw8+S4EXPW6r0g== + collapse-white-space@^1.0.2: version "1.0.5" resolved "https://registry.yarnpkg.com/collapse-white-space/-/collapse-white-space-1.0.5.tgz#c2495b699ab1ed380d29a1091e01063e75dbbe3a"