PK œqhYî¶J‚ßF ßF ) nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/
Dir : /home/trave494/renownedsubscriptions.online/wp-includes/js/dist/ |
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 IP: 209.182.202.254 |
Dir : /home/trave494/renownedsubscriptions.online/wp-includes/js/dist/rich-text.min.js |
/*! This file is auto-generated */ this.wp=this.wp||{},this.wp.richText=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="yyEc")}({"1OyB":function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.d(t,"a",(function(){return n}))},"1ZqX":function(e,t){!function(){e.exports=this.wp.data}()},"25BE":function(e,t,r){"use strict";function n(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}r.d(t,"a",(function(){return n}))},BsWD:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r("a3WO");function o(e,t){if(e){if("string"==typeof e)return Object(n.a)(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Object(n.a)(e,t):void 0}}},GRId:function(e,t){!function(){e.exports=this.wp.element}()},JX7q:function(e,t,r){"use strict";function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r.d(t,"a",(function(){return n}))},Ji7U:function(e,t,r){"use strict";function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)}r.d(t,"a",(function(){return o}))},K9lf:function(e,t){!function(){e.exports=this.wp.compose}()},KQm4:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r("a3WO");var o=r("25BE"),a=r("BsWD");function i(e){return function(e){if(Array.isArray(e))return Object(n.a)(e)}(e)||Object(o.a)(e)||Object(a.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},NMb1:function(e,t){!function(){e.exports=this.wp.deprecated}()},RxS6:function(e,t){!function(){e.exports=this.wp.keycodes}()},TSYQ:function(e,t,r){var n; /*! Copyright (c) 2017 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)&&n.length){var i=o.apply(null,n);i&&e.push(i)}else if("object"===a)for(var c in n)r.call(n,c)&&n[c]&&e.push(c)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},U8pU:function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}r.d(t,"a",(function(){return n}))},Vx3V:function(e,t){!function(){e.exports=this.wp.escapeHtml}()},YLtl:function(e,t){!function(){e.exports=this.lodash}()},a3WO:function(e,t,r){"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}r.d(t,"a",(function(){return n}))},foSv:function(e,t,r){"use strict";function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}r.d(t,"a",(function(){return n}))},md7G:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r("U8pU"),o=r("JX7q");function a(e,t){return!t||"object"!==Object(n.a)(t)&&"function"!=typeof t?Object(o.a)(e):t}},pPDe:function(e,t,r){"use strict";var n,o;function a(e){return[e]}function i(){var e={clear:function(){e.head=null}};return e}function c(e,t,r){var n;if(e.length!==t.length)return!1;for(n=r;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}n={},o="undefined"!=typeof WeakMap,t.a=function(e,t){var r,s;function u(){r=o?new WeakMap:i()}function l(){var r,n,o,a,i,u=arguments.length;for(a=new Array(u),o=0;o<u;o++)a[o]=arguments[o];for(i=t.apply(null,a),(r=s(i)).isUniqueByDependants||(r.lastDependants&&!c(i,r.lastDependants,0)&&r.clear(),r.lastDependants=i),n=r.head;n;){if(c(n.args,a,1))return n!==r.head&&(n.prev.next=n.next,n.next&&(n.next.prev=n.prev),n.next=r.head,n.prev=null,r.head.prev=n,r.head=n),n.val;n=n.next}return n={val:e.apply(null,a)},a[0]=null,n.args=a,r.head&&(r.head.prev=n,n.next=r.head),r.head=n,n.val}return t||(t=a),s=o?function(e){var t,o,a,c,s,u=r,l=!0;for(t=0;t<e.length;t++){if(o=e[t],!(s=o)||"object"!=typeof s){l=!1;break}u.has(o)?u=u.get(o):(a=new WeakMap,u.set(o,a),u=a)}return u.has(n)||((c=i()).isUniqueByDependants=l,u.set(n,c)),u.get(n)}:function(){return r},l.getDependants=t,l.clear=u,u(),l}},rePB:function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"a",(function(){return n}))},rl8x:function(e,t){!function(){e.exports=this.wp.isShallowEqual}()},vuIU:function(e,t,r){"use strict";function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}r.d(t,"a",(function(){return o}))},wx14:function(e,t,r){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}r.d(t,"a",(function(){return n}))},yyEc:function(e,t,r){"use strict";r.r(t),r.d(t,"applyFormat",(function(){return E})),r.d(t,"concat",(function(){return K})),r.d(t,"create",(function(){return k})),r.d(t,"getActiveFormat",(function(){return V})),r.d(t,"getActiveObject",(function(){return z})),r.d(t,"getTextContent",(function(){return q})),r.d(t,"__unstableIsListRootSelected",(function(){return Y})),r.d(t,"__unstableIsActiveListType",(function(){return X})),r.d(t,"isCollapsed",(function(){return J})),r.d(t,"isEmpty",(function(){return Q})),r.d(t,"__unstableIsEmptyLine",(function(){return Z})),r.d(t,"join",(function(){return $})),r.d(t,"registerFormatType",(function(){return te})),r.d(t,"removeFormat",(function(){return oe})),r.d(t,"remove",(function(){return ce})),r.d(t,"replace",(function(){return se})),r.d(t,"insert",(function(){return ie})),r.d(t,"__unstableInsertLineSeparator",(function(){return ue})),r.d(t,"__unstableRemoveLineSeparator",(function(){return pe})),r.d(t,"insertObject",(function(){return de})),r.d(t,"slice",(function(){return me})),r.d(t,"split",(function(){return ve})),r.d(t,"__unstableToDom",(function(){return Ie})),r.d(t,"toHTMLString",(function(){return Me})),r.d(t,"toggleFormat",(function(){return Je})),r.d(t,"__UNSTABLE_LINE_SEPARATOR",(function(){return S})),r.d(t,"unregisterFormatType",(function(){return Qe})),r.d(t,"__unstableCanIndentListItems",(function(){return Ze})),r.d(t,"__unstableCanOutdentListItems",(function(){return $e})),r.d(t,"__unstableIndentListItems",(function(){return tt})),r.d(t,"__unstableOutdentListItems",(function(){return ot})),r.d(t,"__unstableChangeListType",(function(){return it})),r.d(t,"__unstableCreateElement",(function(){return _})),r.d(t,"__experimentalRichText",(function(){return Kt})),r.d(t,"__unstableFormatEdit",(function(){return xt}));var n={};r.r(n),r.d(n,"getFormatTypes",(function(){return p})),r.d(n,"getFormatType",(function(){return d})),r.d(n,"getFormatTypeForBareElement",(function(){return h})),r.d(n,"getFormatTypeForClassName",(function(){return b}));var o={};r.r(o),r.d(o,"addFormatTypes",(function(){return m})),r.d(o,"removeFormatTypes",(function(){return v}));var a=r("1ZqX"),i=r("rePB"),c=r("YLtl");function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){Object(i.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l=Object(a.combineReducers)({formatTypes:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_FORMAT_TYPES":return u({},e,{},Object(c.keyBy)(t.formatTypes,"name"));case"REMOVE_FORMAT_TYPES":return Object(c.omit)(e,t.names)}return e}}),f=r("pPDe"),p=Object(f.a)((function(e){return Object.values(e.formatTypes)}),(function(e){return[e.formatTypes]}));function d(e,t){return e.formatTypes[t]}function h(e,t){return Object(c.find)(p(e),(function(e){var r=e.className,n=e.tagName;return null===r&&t===n}))}function b(e,t){return Object(c.find)(p(e),(function(e){var r=e.className;return null!==r&&" ".concat(t," ").indexOf(" ".concat(r," "))>=0}))}function m(e){return{type:"ADD_FORMAT_TYPES",formatTypes:Object(c.castArray)(e)}}function v(e){return{type:"REMOVE_FORMAT_TYPES",names:Object(c.castArray)(e)}}Object(a.registerStore)("core/rich-text",{reducer:l,selectors:n,actions:o});var g=r("KQm4");function y(e,t){if(e===t)return!0;if(!e||!t)return!1;if(e.type!==t.type)return!1;var r=e.attributes,n=t.attributes;if(r===n)return!0;if(!r||!n)return!1;var o=Object.keys(r),a=Object.keys(n);if(o.length!==a.length)return!1;for(var i=o.length,c=0;c<i;c++){var s=o[c];if(r[s]!==n[s])return!1}return!0}function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function j(e){var t=e.formats.slice();return t.forEach((function(e,r){var n=t[r-1];if(n){var o=e.slice();o.forEach((function(e,t){var r=n[t];y(e,r)&&(o[t]=r)})),t[r]=o}})),function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){Object(i.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{formats:t})}function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function T(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){Object(i.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function x(e,t,r){return(e=e.slice())[t]=r,e}function E(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.start,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.end,o=e.formats,a=e.activeFormats,i=o.slice();if(r===n){var s=Object(c.find)(i[r],{type:t.type});if(s){for(var u=i[r].indexOf(s);i[r]&&i[r][u]===s;)i[r]=x(i[r],u,t),r--;for(n++;i[n]&&i[n][u]===s;)i[n]=x(i[n],u,t),n++}}else{for(var l=1/0,f=r;f<n;f++)if(i[f]){i[f]=i[f].filter((function(e){return e.type!==t.type}));var p=i[f].length;p<l&&(l=p)}else i[f]=[],l=0;for(var d=r;d<n;d++)i[d].splice(l,0,t)}return j(T({},e,{formats:i,activeFormats:[].concat(Object(g.a)(Object(c.reject)(a,{type:t.type})),[t])}))}var P=r("U8pU");function _(e,t){var r=e.implementation;return _.body||(_.body=r.createHTMLDocument("").body),_.body.innerHTML=t,_.body}var S="\u2028";function C(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var D=window.Node,F=D.TEXT_NODE,N=D.ELEMENT_NODE;function A(e,t){for(var r in e)if(e[r]===t)return r}function k(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.element,r=e.text,n=e.html,o=e.range,a=e.multilineTag,i=e.multilineWrapperTags,c=e.__unstableIsEditableTree,s=e.preserveWhiteSpace;return"string"==typeof r&&r.length>0?{formats:Array(r.length),replacements:Array(r.length),text:r}:("string"==typeof n&&n.length>0&&(t=_(document,n)),"object"!==Object(P.a)(t)?{formats:[],replacements:[],text:""}:a?M({element:t,range:o,multilineTag:a,multilineWrapperTags:i,isEditableTree:c,preserveWhiteSpace:s}):L({element:t,range:o,isEditableTree:c,preserveWhiteSpace:s}))}function R(e,t,r,n){if(r){var o=t.parentNode,a=r.startContainer,i=r.startOffset,c=r.endContainer,s=r.endOffset,u=e.text.length;void 0!==n.start?e.start=u+n.start:t===a&&t.nodeType===F?e.start=u+i:o===a&&t===a.childNodes[i]?e.start=u:o===a&&t===a.childNodes[i-1]?e.start=u+n.text.length:t===a&&(e.start=u),void 0!==n.end?e.end=u+n.end:t===c&&t.nodeType===F?e.end=u+s:o===c&&t===c.childNodes[s-1]?e.end=u+n.text.length:o===c&&t===c.childNodes[s]?e.end=u:t===c&&(e.end=u+s)}}var I=new RegExp("\ufeff","g");function W(e){return e.replace(I,"")}function L(e){var t=e.element,r=e.range,n=e.multilineTag,o=e.multilineWrapperTags,c=e.currentWrapperTags,s=void 0===c?[]:c,u=e.isEditableTree,l=e.preserveWhiteSpace,f={formats:[],replacements:[],text:""};if(!t)return f;if(!t.hasChildNodes())return R(f,t,r,{formats:[],replacements:[],text:""}),f;for(var p=t.childNodes.length,d=function(e){var c=t.childNodes[e],p=c.nodeName.toLowerCase();if(c.nodeType===F){var d=W;l||(d=function(e){return W(function(e){return e.replace(/[\n\r\t]+/g," ")}(e))});var h=d(c.nodeValue);return r=function(e,t,r){if(t){var n=t.startContainer,o=t.endContainer,a=t.startOffset,i=t.endOffset;return e===n&&(a=r(e.nodeValue.slice(0,a)).length),e===o&&(i=r(e.nodeValue.slice(0,i)).length),{startContainer:n,startOffset:a,endContainer:o,endOffset:i}}}(c,r,d),R(f,c,r,{text:h}),f.formats.length+=h.length,f.replacements.length+=h.length,f.text+=h,"continue"}if(c.nodeType!==N)return"continue";if(u&&(c.getAttribute("data-rich-text-placeholder")||"br"===p&&!c.getAttribute("data-rich-text-line-break")))return R(f,c,r,{formats:[],replacements:[],text:""}),"continue";if("script"===p){var b={formats:[,],replacements:[{type:p,attributes:{"data-rich-text-script":c.getAttribute("data-rich-text-script")||encodeURIComponent(c.innerHTML)}}],text:""};return R(f,c,r,b),B(f,b),"continue"}if("br"===p)return R(f,c,r,{formats:[],replacements:[],text:""}),B(f,k({text:"\n"})),"continue";var m=f.formats[f.formats.length-1],v=m&&m[m.length-1],O=function(e){var t,r=e.type,n=e.attributes;if(n&&n.class&&(t=Object(a.select)("core/rich-text").getFormatTypeForClassName(n.class))&&(n.class=" ".concat(n.class," ").replace(" ".concat(t.className," ")," ").trim(),n.class||delete n.class),t||(t=Object(a.select)("core/rich-text").getFormatTypeForBareElement(r)),!t)return n?{type:r,attributes:n}:{type:r};if(t.__experimentalCreatePrepareEditableTree&&!t.__experimentalCreateOnChangeEditableValue)return null;if(!n)return{type:t.name};var o={},i={};for(var c in n){var s=A(t.attributes,c);s?o[s]=n[c]:i[c]=n[c]}return{type:t.name,attributes:o,unregisteredAttributes:i}}({type:p,attributes:U({element:c})}),j=y(O,v)?v:O;if(o&&-1!==o.indexOf(p)){var w=M({element:c,range:r,multilineTag:n,multilineWrapperTags:o,currentWrapperTags:[].concat(Object(g.a)(s),[j]),isEditableTree:u,preserveWhiteSpace:l});return R(f,c,r,w),B(f,w),"continue"}var T=L({element:c,range:r,multilineTag:n,multilineWrapperTags:o,isEditableTree:u,preserveWhiteSpace:l});if(R(f,c,r,T),j)if(0===T.text.length)j.attributes&&B(f,{formats:[,],replacements:[j],text:""});else{function x(e){if(x.formats===e)return x.newFormats;var t=e?[j].concat(Object(g.a)(e)):[j];return x.formats=e,x.newFormats=t,t}x.newFormats=[j],B(f,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?C(Object(r),!0).forEach((function(t){Object(i.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},T,{formats:Array.from(T.formats,x)}))}else B(f,T)},h=0;h<p;h++)d(h);return f}function M(e){var t=e.element,r=e.range,n=e.multilineTag,o=e.multilineWrapperTags,a=e.currentWrapperTags,i=void 0===a?[]:a,c=e.isEditableTree,s=e.preserveWhiteSpace,u={formats:[],replacements:[],text:""};if(!t||!t.hasChildNodes())return u;for(var l=t.children.length,f=0;f<l;f++){var p=t.children[f];if(p.nodeName.toLowerCase()===n){var d=L({element:p,range:r,multilineTag:n,multilineWrapperTags:o,currentWrapperTags:i,isEditableTree:c,preserveWhiteSpace:s});(0!==f||i.length>0)&&B(u,{formats:[,],replacements:i.length>0?[i]:[,],text:S}),R(u,p,r,d),B(u,d)}}return u}function U(e){var t=e.element;if(t.hasAttributes()){for(var r,n=t.attributes.length,o=0;o<n;o++){var a=t.attributes[o],i=a.name,c=a.value;if(0!==i.indexOf("data-rich-text-"))(r=r||{})[/^on/i.test(i)?"data-disable-rich-text-"+i:i]=c}return r}}function B(e,t){return e.formats=e.formats.concat(t.formats),e.replacements=e.replacements.concat(t.replacements),e.text+=t.text,e}function K(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return j(t.reduce(B,k()))}function H(e){var t=e.formats,r=e.start,n=e.end,o=e.activeFormats,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(void 0===r)return a;if(r===n){if(o)return o;var i=t[r-1]||a,c=t[r]||a;return i.length<c.length?i:c}return t[r]||a}function V(e,t){return Object(c.find)(H(e),{type:t})}function z(e){var t=e.start,r=e.end,n=e.replacements,o=e.text;if(t+1===r&&""===o[t])return n[t]}function q(e){return e.text}function G(e){for(var t=e.start,r=e.text,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,o=n;o--;)if(r[o]===S)return o}function Y(e){var t=e.replacements[G(e,e.start)];return!t||t.length<1}function X(e,t,r){var n=e.replacements[G(e,e.start)];return n&&0!==n.length?n[n.length-1].type===t:t===r}function J(e){var t=e.start,r=e.end;if(void 0!==t&&void 0!==r)return t===r}function Q(e){return 0===e.text.length}function Z(e){var t=e.text,r=e.start,n=e.end;return r===n&&(0===t.length||(0===r&&t.slice(0,1)===S||(r===t.length&&t.slice(-1)===S||t.slice(r-1,n+1)==="".concat(S).concat(S))))}function $(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"string"==typeof t&&(t=k({text:t})),j(e.reduce((function(e,r){var n=r.formats,o=r.replacements,a=r.text;return{formats:e.formats.concat(t.formats,n),replacements:e.replacements.concat(t.replacements,o),text:e.text+t.text+a}})))}function ee(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function te(e,t){if("string"==typeof(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ee(Object(r),!0).forEach((function(t){Object(i.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ee(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({name:e},t)).name)if(/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(t.name))if(Object(a.select)("core/rich-text").getFormatType(t.name))window.console.error('Format "'+t.name+'" is already registered.');else if("string"==typeof t.tagName&&""!==t.tagName)if("string"==typeof t.className&&""!==t.className||null===t.className)if(/^[_a-zA-Z]+[a-zA-Z0-9-]*$/.test(t.className)){if(null===t.className){var r=Object(a.select)("core/rich-text").getFormatTypeForBareElement(t.tagName);if(r)return void window.console.error('Format "'.concat(r.name,'" is already registered to handle bare tag name "').concat(t.tagName,'".'))}else{var n=Object(a.select)("core/rich-text").getFormatTypeForClassName(t.className);if(n)return void window.console.error('Format "'.concat(n.name,'" is already registered to handle class name "').concat(t.className,'".'))}if("title"in t&&""!==t.title)if("keywords"in t&&t.keywords.length>3)window.console.error('The format "'+t.name+'" can have a maximum of 3 keywords.');else{if("string"==typeof t.title)return Object(a.dispatch)("core/rich-text").addFormatTypes(t),t;window.console.error("Format titles must be strings.")}else window.console.error('The format "'+t.name+'" must have a title.')}else window.console.error("A class name must begin with a letter, followed by any number of hyphens, letters, or numbers.");else window.console.error("Format class names must be a string, or null to handle bare elements.");else window.console.error("Format tag names must be a string.");else window.console.error("Format names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-format");else window.console.error("Format names must be strings.")}function re(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ne(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?re(Object(r),!0).forEach((function(t){Object(i.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):re(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function oe(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.start,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.end,o=e.formats,a=e.activeFormats,i=o.slice();if(r===n){var s=Object(c.find)(i[r],{type:t});if(s){for(;Object(c.find)(i[r],s);)ae(i,r,t),r--;for(n++;Object(c.find)(i[n],s);)ae(i,n,t),n++}}else for(var u=r;u<n;u++)i[u]&&ae(i,u,t);return j(ne({},e,{formats:i,activeFormats:Object(c.reject)(a,{type:t})}))}function ae(e,t,r){var n=e[t].filter((function(e){return e.type!==r}));n.length?e[t]=n:delete e[t]}function ie(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.start,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.end,o=e.formats,a=e.replacements,i=e.text;"string"==typeof t&&(t=k({text:t}));var c=r+t.text.length;return j({formats:o.slice(0,r).concat(t.formats,o.slice(n)),replacements:a.slice(0,r).concat(t.replacements,a.slice(n)),text:i.slice(0,r)+t.text+i.slice(n),start:c,end:c})}function ce(e,t,r){return ie(e,k(),t,r)}function se(e,t,r){var n=e.formats,o=e.replacements,a=e.text,i=e.start,c=e.end;return a=a.replace(t,(function(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),s=1;s<t;s++)a[s-1]=arguments[s];var u,l,f=a[a.length-2],p=r;return"function"==typeof p&&(p=r.apply(void 0,[e].concat(a))),"object"===Object(P.a)(p)?(u=p.formats,l=p.replacements,p=p.text):(u=Array(p.length),l=Array(p.length),n[f]&&(u=u.fill(n[f]))),n=n.slice(0,f).concat(u,n.slice(f+e.length)),o=o.slice(0,f).concat(l,o.slice(f+e.length)),i&&(i=c=f+p.length),p})),j({formats:n,replacements:o,text:a,start:i,end:c})}function ue(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.start,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.end,n=q(e).slice(0,t),o=n.lastIndexOf(S),a=e.replacements[o],i=[,];a&&(i=[a]);var c={formats:[,],replacements:i,text:S};return ie(e,c,t,r)}function le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?le(Object(r),!0).forEach((function(t){Object(i.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):le(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function pe(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=e.replacements,n=e.text,o=e.start,a=e.end,i=J(e),c=o-1,s=i?o-1:o,u=a;if(t||(c=a,s=o,u=i?a+1:a),n[c]===S){var l;if(i&&r[c]&&r[c].length){var f=r.slice();f[c]=r[c].slice(0,-1),l=fe({},e,{replacements:f})}else l=ce(e,s,u);return l}}function de(e,t,r,n){return ie(e,{formats:[,],replacements:[t],text:""},r,n)}function he(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function be(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?he(Object(r),!0).forEach((function(t){Object(i.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):he(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function me(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.start,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.end,n=e.formats,o=e.replacements,a=e.text;return void 0===t||void 0===r?be({},e):{formats:n.slice(t,r),replacements:o.slice(t,r),text:a.slice(t,r)}}function ve(e,t){var r=e.formats,n=e.replacements,o=e.text,a=e.start,i=e.end;if("string"!=typeof t)return ge.apply(void 0,arguments);var c=0;return o.split(t).map((function(e){var o=c,s={formats:r.slice(o,o+e.length),replacements:n.slice(o,o+e.length),text:e};return c+=t.length+e.length,void 0!==a&&void 0!==i&&(a>=o&&a<c?s.start=a-o:a<o&&i>o&&(s.start=0),i>=o&&i<c?s.end=i-o:a<c&&i>c&&(s.end=e.length)),s}))}function ge(e){var t=e.formats,r=e.replacements,n=e.text,o=e.start,a=e.end,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a,s={formats:t.slice(0,i),replacements:r.slice(0,i),text:n.slice(0,i)},u={formats:t.slice(c),replacements:r.slice(c),text:n.slice(c),start:0,end:0};return[se(s,/\u2028+$/,""),se(u,/^\u2028+/,"")]}function ye(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Oe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ye(Object(r),!0).forEach((function(t){Object(i.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ye(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function je(e,t){if(t)return e;var r={};for(var n in e){var o=n;n.startsWith("data-disable-rich-text-")&&(o=n.slice("data-disable-rich-text-".length)),r[o]=e[n]}return r}function we(e){var t=e.type,r=e.attributes,n=e.unregisteredAttributes,o=e.object,i=e.boundaryClass,c=e.isEditableTree,s=function(e){return Object(a.select)("core/rich-text").getFormatType(e)}(t),u={};if(i&&(u["data-rich-text-format-boundary"]="true"),!s)return r&&(u=Oe({},r,{},u)),{type:t,attributes:je(u,c),object:o};for(var l in u=Oe({},n,{},u),r){var f=!!s.attributes&&s.attributes[l];f?u[f]=r[l]:u[l]=r[l]}return s.className&&(u.class?u.class="".concat(s.className," ").concat(u.class):u.class=s.className),{type:s.tagName,object:s.object,attributes:je(u,c)}}function Te(e){var t,r,n,o=e.value,a=e.multilineTag,i=e.preserveWhiteSpace,c=e.createEmpty,s=e.append,u=e.getLastChild,l=e.getParent,f=e.isText,p=e.getText,d=e.remove,h=e.appendText,b=e.onStartIndex,m=e.onEndIndex,v=e.isEditableTree,y=e.placeholder,O=o.formats,j=o.replacements,w=o.text,T=o.start,x=o.end,E=O.length+1,P=c(),_={type:a},C=H(o),D=C[C.length-1];a?(s(s(P,{type:a}),""),r=t=[_]):s(P,"");for(var F=function(e){var o=w.charAt(e),c=v&&(!n||n===S||"\n"===n),E=O[e];a&&(E=o===S?t=(j[e]||[]).reduce((function(e,t){return e.push(t,_),e}),[_]):[].concat(Object(g.a)(t),Object(g.a)(E||[])));var C=u(P);if(c&&o===S){for(var F=C;!f(F);)F=u(F);s(l(F),"\ufeff")}if(n===S){for(var N=C;!f(N);)N=u(N);b&&T===e&&b(P,N),m&&x===e&&m(P,N)}if(E&&E.forEach((function(e,t){if(C&&r&&function(e,t,r){do{if(e[r]!==t[r])return!1}while(r--);return!0}(E,r,t)&&(o!==S||E.length-1!==t))C=u(C);else{var n=e.type,a=e.attributes,i=e.unregisteredAttributes,c=v&&o!==S&&e===D,h=l(C),b=s(h,we({type:n,attributes:a,unregisteredAttributes:i,boundaryClass:c,isEditableTree:v}));f(C)&&0===p(C).length&&d(C),C=s(b,"")}})),o===S)return r=E,n=o,"continue";0===e&&(b&&0===T&&b(P,C),m&&0===x&&m(P,C)),""===o?(v||"script"!==j[e].type?C=s(l(C),we(Oe({},j[e],{object:!0,isEditableTree:v}))):(C=s(l(C),we({type:"script",isEditableTree:v})),s(C,{html:decodeURIComponent(j[e].attributes["data-rich-text-script"])})),C=s(l(C),"")):i||"\n"!==o?f(C)?h(C,o):C=s(l(C),o):(C=s(l(C),{type:"br",attributes:v?{"data-rich-text-line-break":"true"}:void 0,object:!0}),C=s(l(C),"")),b&&T===e+1&&b(P,C),m&&x===e+1&&m(P,C),c&&e===w.length&&(s(l(C),"\ufeff"),y&&0===w.length&&s(l(C),{type:"span",attributes:{"data-rich-text-placeholder":y,contenteditable:"false"}})),r=E,n=o},N=0;N<E;N++)F(N);return P}function xe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var Ee=window.Node.TEXT_NODE;function Pe(e,t,r){for(var n=e.parentNode,o=0;e=e.previousSibling;)o++;return r=[o].concat(Object(g.a)(r)),n!==t&&(r=Pe(n,t,r)),r}function _e(e,t){for(t=Object(g.a)(t);e&&t.length>1;)e=e.childNodes[t.shift()];return{node:e,offset:t[0]}}var Se=function(){return _(document,"")};function Ce(e,t){"string"==typeof t&&(t=e.ownerDocument.createTextNode(t));var r=t,n=r.type,o=r.attributes;if(n)for(var a in t=e.ownerDocument.createElement(n),o)t.setAttribute(a,o[a]);return e.appendChild(t)}function De(e,t){e.appendData(t)}function Fe(e){return e.lastChild}function Ne(e){return e.parentNode}function Ae(e){return e.nodeType===Ee}function ke(e){return e.nodeValue}function Re(e){return e.parentNode.removeChild(e)}function Ie(e){var t=e.value,r=e.multilineTag,n=e.prepareEditableTree,o=e.isEditableTree,a=void 0===o||o,c=e.placeholder,s=[],u=[];return n&&(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xe(Object(r),!0).forEach((function(t){Object(i.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t,{formats:n(t)})),{body:Te({value:t,multilineTag:r,createEmpty:Se,append:Ce,getLastChild:Fe,getParent:Ne,isText:Ae,getText:ke,remove:Re,appendText:De,onStartIndex:function(e,t){s=Pe(t,e,[t.nodeValue.length])},onEndIndex:function(e,t){u=Pe(t,e,[t.nodeValue.length])},isEditableTree:a,placeholder:c}),selection:{startPath:s,endPath:u}}}function We(e){var t=e.value,r=e.current,n=e.multilineTag,o=e.prepareEditableTree,a=e.__unstableDomOnly,i=Ie({value:t,multilineTag:n,prepareEditableTree:o,placeholder:e.placeholder}),c=i.body,s=i.selection;!function e(t,r){var n,o=0;for(;n=t.firstChild;){var a=r.childNodes[o];if(a)if(a.isEqualNode(n))t.removeChild(n);else if(a.nodeName!==n.nodeName||a.nodeType===Ee&&a.data!==n.data)r.replaceChild(n,a);else{var i=a.attributes,c=n.attributes;if(i)for(var s=i.length;s--;){var u=i[s].name;n.getAttribute(u)||a.removeAttribute(u)}if(c)for(var l=0;l<c.length;l++){var f=c[l],p=f.name,d=f.value;a.getAttribute(p)!==d&&a.setAttribute(p,d)}e(n,a),t.removeChild(n)}else r.appendChild(n);o++}for(;r.childNodes[o];)r.removeChild(r.childNodes[o])}(c,r),void 0===t.start||a||function(e,t){var r=e.startPath,n=e.endPath,o=_e(t,r),a=o.node,i=o.offset,c=_e(t,n),s=c.node,u=c.offset,l=window.getSelection(),f=t.ownerDocument,p=f.createRange();p.setStart(a,i),p.setEnd(s,u);var d=f.activeElement;if(l.rangeCount>0){if(h=p,b=l.getRangeAt(0),h.startContainer===b.startContainer&&h.startOffset===b.startOffset&&h.endContainer===b.endContainer&&h.endOffset===b.endOffset)return;l.removeAllRanges()}var h,b;l.addRange(p),d!==document.activeElement&&d instanceof window.HTMLElement&&d.focus()}(s,r)}var Le=r("Vx3V");function Me(e){return Xe(Te({value:e.value,multilineTag:e.multilineTag,preserveWhiteSpace:e.preserveWhiteSpace,createEmpty:Ue,append:Ke,getLastChild:Be,getParent:Ve,isText:ze,getText:qe,remove:Ge,appendText:He}).children)}function Ue(){return{}}function Be(e){var t=e.children;return t&&t[t.length-1]}function Ke(e,t){return"string"==typeof t&&(t={text:t}),t.parent=e,e.children=e.children||[],e.children.push(t),t}function He(e,t){e.text+=t}function Ve(e){return e.parent}function ze(e){return"string"==typeof e.text}function qe(e){return e.text}function Ge(e){var t=e.parent.children.indexOf(e);return-1!==t&&e.parent.children.splice(t,1),e}function Ye(e){var t=e.type,r=e.attributes,n=e.object,o=e.children,a="";for(var i in r)Object(Le.isValidAttributeName)(i)&&(a+=" ".concat(i,'="').concat(Object(Le.escapeAttribute)(r[i]),'"'));return n?"<".concat(t).concat(a,">"):"<".concat(t).concat(a,">").concat(Xe(o),"</").concat(t,">")}function Xe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((function(e){return void 0!==e.html?e.html:void 0===e.text?Ye(e):Object(Le.escapeEditableHTML)(e.text)})).join("")}function Je(e,t){return V(e,t.type)?oe(e,t.type):E(e,t)}function Qe(e){var t=Object(a.select)("core/rich-text").getFormatType(e);if(t)return Object(a.dispatch)("core/rich-text").removeFormatTypes(e),t;window.console.error("Format ".concat(e," is not registered."))}function Ze(e){var t=G(e);if(void 0===t)return!1;var r=e.replacements,n=G(e,t),o=r[t]||[],a=r[n]||[];return o.length<=a.length}function $e(e){return void 0!==e.replacements[G(e,e.start)]}function et(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tt(e,t){if(!Ze(e))return e;for(var r=G(e),n=G(e,r),o=e.text,a=e.replacements,c=e.end,s=a.slice(),u=function(e,t){for(var r=e.text,n=e.replacements,o=n[t]||[],a=t;a-- >=0;)if(r[a]===S){var i=n[a]||[];if(i.length===o.length+1)return a;if(i.length<=o.length)return}}(e,r),l=r;l<c;l++)if(o[l]===S)if(u){var f=a[u]||[];s[l]=f.concat((s[l]||[]).slice(f.length-1))}else{var p=a[n]||[],d=p[p.length-1]||t;s[l]=p.concat([d],(s[l]||[]).slice(p.length))}return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?et(Object(r),!0).forEach((function(t){Object(i.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):et(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{replacements:s})}function rt(e,t){for(var r=e.text,n=e.replacements,o=n[t]||[],a=t;a-- >=0;){if(r[a]===S)if((n[a]||[]).length===o.length-1)return a}}function nt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ot(e){if(!$e(e))return e;for(var t=e.text,r=e.replacements,n=e.start,o=e.end,a=G(e,n),c=r.slice(0),s=r[rt(e,a)]||[],u=function(e,t){for(var r=e.text,n=e.replacements,o=n[t]||[],a=t,i=t||0;i<r.length;i++)if(r[i]===S){if(!((n[i]||[]).length>=o.length))return a;a=i}return a}(e,G(e,o)),l=a;l<=u;l++)if(t[l]===S){var f=c[l]||[];c[l]=s.concat(f.slice(s.length+1)),0===c[l].length&&delete c[l]}return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?nt(Object(r),!0).forEach((function(t){Object(i.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{replacements:c})}function at(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function it(e,t){for(var r,n=e.text,o=e.replacements,a=e.start,c=e.end,s=G(e,a),u=o[s]||[],l=o[G(e,c)]||[],f=rt(e,s),p=o.slice(),d=u.length-1,h=l.length-1,b=f+1||0;b<n.length;b++)if(n[b]===S){if((p[b]||[]).length<=d)break;p[b]&&(r=!0,p[b]=p[b].map((function(e,r){return r<d||r>h?e:t})))}return r?function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?at(Object(r),!0).forEach((function(t){Object(i.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):at(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{replacements:p}):e}var ct=r("wx14"),st=r("1OyB"),ut=r("vuIU"),lt=r("md7G"),ft=r("foSv"),pt=r("JX7q"),dt=r("Ji7U"),ht=r("GRId"),bt=r("TSYQ"),mt=r.n(bt),vt=r("RxS6"),gt=r("K9lf"),yt=r("rl8x"),Ot=r.n(yt),jt=r("NMb1"),wt=r.n(jt),Tt=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function xt(e){var t=e.formatTypes,r=e.onChange,n=e.onFocus,o=e.value,a=e.allowedFormats,i=e.withoutInteractiveFormatting;return t.map((function(e){var t=e.name,c=e.edit,s=e.tagName;if(!c)return null;if(a&&-1===a.indexOf(t))return null;if(i&&Tt.has(s))return null;var u=V(o,t),l=void 0!==u,f=z(o),p=void 0!==f&&f.type===t;return Object(ht.createElement)(c,{key:t,isActive:l,activeAttributes:l&&u.attributes||{},isObjectActive:p,activeObjectAttributes:p&&f.attributes||{},value:o,onChange:r,onFocus:n})}))}function Et(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Pt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Et(Object(r),!0).forEach((function(t){Object(i.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Et(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _t(e){return e("core/rich-text").getFormatTypes()}var St=document.createElement("style");function Ct(e){var t=e.activeFormats,r=e.forwardedRef;return Object(ht.useEffect)((function(){if(t&&t.length){var e=r.current.querySelector("*[data-rich-text-format-boundary]");if(e){var n=window.getComputedStyle(e).color.replace(")",", 0.2)").replace("rgb","rgba"),o=".rich-text:focus ".concat("*[data-rich-text-format-boundary]"),a="background-color: ".concat(n),i="".concat(o," {").concat(a,"}");St.innerHTML!==i&&(St.innerHTML=i)}}}),[t]),null}function Dt(e){e.forwardedRef;return Object(ht.useEffect)((function(){}),[]),null}function Ft(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Nt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ft(Object(r),!0).forEach((function(t){Object(i.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ft(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}document.head.appendChild(St);var At=window,kt=At.getSelection,Rt=At.getComputedStyle,It=new Set(["insertParagraph","insertOrderedList","insertUnorderedList","insertHorizontalRule","insertLink"]),Wt={whiteSpace:"pre-wrap"},Lt=[];function Mt(e,t){var r=Object.keys(e).reduce((function(r,n){return n.startsWith(t)&&r.push(e[n]),r}),[]);return function(e){return r.reduce((function(t,r){return r(t,e.text)}),e.formats)}}var Ut=function(e){function t(e){var r,n=e.value,o=e.selectionStart,a=e.selectionEnd;return Object(st.a)(this,t),(r=Object(lt.a)(this,Object(ft.a)(t).apply(this,arguments))).onFocus=r.onFocus.bind(Object(pt.a)(r)),r.onBlur=r.onBlur.bind(Object(pt.a)(r)),r.onChange=r.onChange.bind(Object(pt.a)(r)),r.handleDelete=r.handleDelete.bind(Object(pt.a)(r)),r.handleEnter=r.handleEnter.bind(Object(pt.a)(r)),r.handleSpace=r.handleSpace.bind(Object(pt.a)(r)),r.handleHorizontalNavigation=r.handleHorizontalNavigation.bind(Object(pt.a)(r)),r.onPaste=r.onPaste.bind(Object(pt.a)(r)),r.onCreateUndoLevel=r.onCreateUndoLevel.bind(Object(pt.a)(r)),r.onInput=r.onInput.bind(Object(pt.a)(r)),r.onCompositionStart=r.onCompositionStart.bind(Object(pt.a)(r)),r.onCompositionEnd=r.onCompositionEnd.bind(Object(pt.a)(r)),r.onSelectionChange=r.onSelectionChange.bind(Object(pt.a)(r)),r.createRecord=r.createRecord.bind(Object(pt.a)(r)),r.applyRecord=r.applyRecord.bind(Object(pt.a)(r)),r.valueToFormat=r.valueToFormat.bind(Object(pt.a)(r)),r.onPointerDown=r.onPointerDown.bind(Object(pt.a)(r)),r.formatToValue=r.formatToValue.bind(Object(pt.a)(r)),r.Editable=r.Editable.bind(Object(pt.a)(r)),r.onKeyDown=function(e){e.defaultPrevented||(r.handleDelete(e),r.handleEnter(e),r.handleSpace(e),r.handleHorizontalNavigation(e))},r.state={},r.lastHistoryValue=n,r.value=n,r.record=r.formatToValue(n),r.record.start=o,r.record.end=a,r}return Object(dt.a)(t,e),Object(ut.a)(t,[{key:"componentWillUnmount",value:function(){document.removeEventListener("selectionchange",this.onSelectionChange),window.cancelAnimationFrame(this.rafId)}},{key:"componentDidMount",value:function(){this.applyRecord(this.record,{domOnly:!0})}},{key:"createRecord",value:function(){var e=this.props,t=e.__unstableMultilineTag,r=e.forwardedRef,n=e.preserveWhiteSpace,o=kt(),a=o.rangeCount>0?o.getRangeAt(0):null;return k({element:r.current,range:a,multilineTag:t,multilineWrapperTags:"li"===t?["ul","ol"]:void 0,__unstableIsEditableTree:!0,preserveWhiteSpace:n})}},{key:"applyRecord",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.domOnly,n=this.props,o=n.__unstableMultilineTag,a=n.forwardedRef;We({value:e,current:a.current,multilineTag:o,multilineWrapperTags:"li"===o?["ul","ol"]:void 0,prepareEditableTree:Mt(this.props,"format_prepare_functions"),__unstableDomOnly:r,placeholder:this.props.placeholder})}},{key:"onPaste",value:function(e){var t=this.props,r=t.formatTypes,n=t.onPaste,o=t.__unstableIsSelected,a=this.state.activeFormats,i=void 0===a?[]:a;if(o){var s=e.clipboardData,u=s.items,l=s.files;u=Object(c.isNil)(u)?[]:u,l=Object(c.isNil)(l)?[]:l;var f="",p="";try{f=s.getData("text/plain"),p=s.getData("text/html")}catch(e){try{p=s.getData("Text")}catch(e){return}}e.preventDefault(),window.console.log("Received HTML:\n\n",p),window.console.log("Received plain text:\n\n",f);var d=this.record,h=r.reduce((function(e,t){var r=t.__unstablePasteRule;return r&&e===d&&(e=r(d,{html:p,plainText:f})),e}),d);h===d?n&&(l=Array.from(l),Array.from(u).forEach((function(e){if(e.getAsFile){var t=e.getAsFile();if(t){var r=t.name,n=t.type,o=t.size;Object(c.find)(l,{name:r,type:n,size:o})||l.push(t)}}})),n({value:this.removeEditorOnlyFormats(d),onChange:this.onChange,html:p,plainText:f,files:l,activeFormats:i})):this.onChange(h)}else e.preventDefault()}},{key:"onFocus",value:function(){var e=this.props.unstableOnFocus;if(e&&e(),this.props.__unstableIsSelected)this.props.onSelectionChange(this.record.start,this.record.end),this.setState({activeFormats:H(Nt({},this.record,{activeFormats:void 0}),Lt)});else{var t=Lt;this.record=Nt({},this.record,{start:void 0,end:void 0,activeFormats:t}),this.props.onSelectionChange(void 0,void 0),this.setState({activeFormats:t})}this.rafId=window.requestAnimationFrame(this.onSelectionChange),document.addEventListener("selectionchange",this.onSelectionChange),this.props.setFocusedElement&&(wt()("wp.blockEditor.RichText setFocusedElement prop",{alternative:"selection state from the block editor store."}),this.props.setFocusedElement(this.props.instanceId))}},{key:"onBlur",value:function(){document.removeEventListener("selectionchange",this.onSelectionChange)}},{key:"onInput",value:function(e){var t;if(!this.isComposing)if(e&&(t=e.inputType),!t&&e&&e.nativeEvent&&(t=e.nativeEvent.inputType),!t||0!==t.indexOf("format")&&!It.has(t)){var r=this.createRecord(),n=this.record,o=n.start,a=n.activeFormats,i=void 0===a?[]:a,c=function(e){var t=e.value,r=e.start,n=e.end,o=e.formats,a=t.formats[r-1]||[],i=t.formats[n]||[];for(t.activeFormats=o.map((function(e,t){if(a[t]){if(y(e,a[t]))return a[t]}else if(i[t]&&y(e,i[t]))return i[t];return e}));--n>=r;)t.activeFormats.length>0?t.formats[n]=t.activeFormats:delete t.formats[n];return t}({value:r,start:o,end:r.start,formats:i});this.onChange(c,{withoutHistory:!0});var s=this.props,u=s.__unstableInputRule,l=s.__unstableMarkAutomaticChange,f=s.__unstableAllowPrefixTransformations,p=s.formatTypes,d=s.setTimeout;if((0,s.clearTimeout)(this.onInput.timeout),this.onInput.timeout=d(this.onCreateUndoLevel,1e3),"insertText"===t){f&&u&&u(c,this.valueToFormat);var h=p.reduce((function(e,t){var r=t.__unstableInputRule;return r&&(e=r(e)),e}),c);h!==c&&(this.onCreateUndoLevel(),this.onChange(Nt({},h,{activeFormats:i})),l())}}else this.applyRecord(this.record)}},{key:"onCompositionStart",value:function(){this.isComposing=!0,document.removeEventListener("selectionchange",this.onSelectionChange)}},{key:"onCompositionEnd",value:function(){this.isComposing=!1,this.onInput({inputType:"insertText"}),document.addEventListener("selectionchange",this.onSelectionChange)}},{key:"onSelectionChange",value:function(e){if(("selectionchange"===e.type||this.props.__unstableIsSelected)&&!this.props.disabled&&!this.isComposing){var t=this.createRecord(),r=t.start,n=t.end,o=t.text,a=this.record;if(o===a.text)if(r!==a.start||n!==a.end){var i=this.props,c=i.__unstableIsCaretWithinFormattedText,s=i.__unstableOnEnterFormattedText,u=i.__unstableOnExitFormattedText,l=Nt({},a,{start:r,end:n,activeFormats:void 0}),f=H(l,Lt);l.activeFormats=f,!c&&f.length?s():c&&!f.length&&u(),this.record=l,this.applyRecord(l,{domOnly:!0}),this.props.onSelectionChange(r,n),this.setState({activeFormats:f})}else 0===a.text.length&&0===r&&function(){var e=window.getSelection(),t=e.anchorNode,r=e.anchorOffset;if(t.nodeType===t.ELEMENT_NODE){var n=t.childNodes[r];n&&n.nodeType===n.ELEMENT_NODE&&n.getAttribute("data-rich-text-placeholder")&&e.collapseToStart()}}();else this.onInput()}}},{key:"onChange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.withoutHistory;this.applyRecord(e);var n=e.start,o=e.end,a=e.activeFormats,i=void 0===a?[]:a,s=Object(c.pickBy)(this.props,(function(e,t){return t.startsWith("format_on_change_functions_")}));Object.values(s).forEach((function(t){t(e.formats,e.text)})),this.value=this.valueToFormat(e),this.record=e,this.props.onSelectionChange(n,o),this.props.onChange(this.value),this.setState({activeFormats:i}),r||this.onCreateUndoLevel()}},{key:"onCreateUndoLevel",value:function(){this.lastHistoryValue!==this.value&&(this.props.__unstableOnCreateUndoLevel(),this.lastHistoryValue=this.value)}},{key:"handleDelete",value:function(e){var t=e.keyCode;if(t===vt.DELETE||t===vt.BACKSPACE||t===vt.ESCAPE){if(this.props.__unstableDidAutomaticChange)return e.preventDefault(),void this.props.__unstableUndo();if(t!==vt.ESCAPE){var r,n=this.props,o=n.onDelete,a=n.__unstableMultilineTag,i=this.state.activeFormats,c=void 0===i?[]:i,s=this.createRecord(),u=s.start,l=s.end,f=s.text,p=t===vt.BACKSPACE;if(0===u&&0!==l&&l===f.length)return this.onChange(ce(s)),void e.preventDefault();if(a)if(r=p&&0===s.start&&0===s.end&&Z(s)?pe(s,!p):pe(s,p))return this.onChange(r),void e.preventDefault();!o||!J(s)||c.length||p&&0!==u||!p&&l!==f.length||(o({isReverse:p,value:s}),e.preventDefault())}}}},{key:"handleEnter",value:function(e){if(e.keyCode===vt.ENTER){e.preventDefault();var t=this.props.onEnter;t&&t({value:this.removeEditorOnlyFormats(this.createRecord()),onChange:this.onChange,shiftKey:e.shiftKey})}}},{key:"handleSpace",value:function(e){var t=e.keyCode,r=e.shiftKey,n=e.altKey,o=e.metaKey,a=e.ctrlKey,i=this.props,c=i.tagName,s=i.__unstableMultilineTag;if(!(r||n||o||a||t!==vt.SPACE||"li"!==s)){var u=this.createRecord();if(J(u)){var l=u.text[u.start-1];l&&l!==S||(this.onChange(tt(u,{type:c})),e.preventDefault())}}}},{key:"handleHorizontalNavigation",value:function(e){var t=e.keyCode,r=e.shiftKey,n=e.altKey,o=e.metaKey,a=e.ctrlKey;if(!(r||n||o||a||t!==vt.LEFT&&t!==vt.RIGHT)){var i=this.record,c=i.text,s=i.formats,u=i.start,l=i.end,f=i.activeFormats,p=void 0===f?[]:f,d=J(i),h="rtl"===Rt(this.props.forwardedRef.current).direction?vt.RIGHT:vt.LEFT,b=e.keyCode===h;if(d&&0===p.length){if(0===u&&b)return;if(l===c.length&&!b)return}if(d){e.preventDefault();var m=s[u-1]||Lt,v=s[u]||Lt,g=p.length,y=v;if(m.length>v.length&&(y=m),m.length<v.length?(!b&&p.length<v.length&&g++,b&&p.length>m.length&&g--):m.length>v.length&&(!b&&p.length>v.length&&g--,b&&p.length<m.length&&g++),g!==p.length){var O=y.slice(0,g),j=Nt({},i,{activeFormats:O});return this.record=j,this.applyRecord(j),void this.setState({activeFormats:O})}var w=u+(b?-1:1),T=b?m:v,x=Nt({},i,{start:w,end:w,activeFormats:T});this.record=x,this.applyRecord(x),this.props.onSelectionChange(w,w),this.setState({activeFormats:T})}}}},{key:"onPointerDown",value:function(e){var t=e.target;if(t!==this.props.forwardedRef.current&&!t.textContent){var r=t.parentNode,n=Array.from(r.childNodes).indexOf(t),o=t.ownerDocument.createRange(),a=kt();o.setStart(t.parentNode,n),o.setEnd(t.parentNode,n+1),a.removeAllRanges(),a.addRange(o)}}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.tagName,n=t.value,o=t.selectionStart,a=t.selectionEnd,i=t.placeholder,s=t.__unstableIsSelected,u=r!==e.tagName;u=u||n!==e.value&&n!==this.value;var l=o!==e.selectionStart&&o!==this.record.start||a!==e.selectionEnd&&a!==this.record.end;u=u||s&&!e.isSelected&&l;var f=function(e,t){return t.startsWith("format_prepare_props_")},p=Object(c.pickBy)(this.props,f),d=Object(c.pickBy)(e,f);(u=(u=u||!Ot()(p,d))||i!==e.placeholder)?(this.value=n,this.record=this.formatToValue(n),this.record.start=o,this.record.end=a,this.applyRecord(this.record)):l&&(this.record=Nt({},this.record,{start:o,end:a}))}},{key:"formatToValue",value:function(e){var t=this.props,r=t.format,n=t.__unstableMultilineTag,o=t.preserveWhiteSpace;if("string"!==r)return e;var a=Mt(this.props,"format_value_functions");return(e=k({html:e,multilineTag:n,multilineWrapperTags:"li"===n?["ul","ol"]:void 0,preserveWhiteSpace:o})).formats=a(e),e}},{key:"removeEditorOnlyFormats",value:function(e){return this.props.formatTypes.forEach((function(t){t.__experimentalCreatePrepareEditableTree&&(e=oe(e,t.name,0,e.text.length))})),e}},{key:"valueToFormat",value:function(e){var t=this.props,r=t.format,n=t.__unstableMultilineTag,o=t.preserveWhiteSpace;if(e=this.removeEditorOnlyFormats(e),"string"===r)return Me({value:e,multilineTag:n,preserveWhiteSpace:o})}},{key:"Editable",value:function(e){var t=this,r=this.props,n=r.tagName,o=void 0===n?"div":n,a=r.style,i=r.className,s=r.placeholder,u=r.forwardedRef,l=r.disabled,f=Object(c.pickBy)(this.props,(function(e,t){return Object(c.startsWith)(t,"aria-")}));return Object(ht.createElement)(o,Object(ct.a)({role:"textbox","aria-multiline":!0,"aria-label":s},e,f,{ref:u,style:a?Nt({},a,{whiteSpace:"pre-wrap"}):Wt,className:mt()("rich-text",i),onPaste:this.onPaste,onInput:this.onInput,onCompositionStart:this.onCompositionStart,onCompositionEnd:this.onCompositionEnd,onKeyDown:e.onKeyDown?function(r){e.onKeyDown(r),t.onKeyDown(r)}:this.onKeyDown,onFocus:this.onFocus,onBlur:this.onBlur,onMouseDown:this.onPointerDown,onTouchStart:this.onPointerDown,onKeyUp:this.onSelectionChange,onMouseUp:this.onSelectionChange,onTouchEnd:this.onSelectionChange,contentEditable:!l||void 0,suppressContentEditableWarning:!l}))}},{key:"render",value:function(){var e=this,t=this.props,r=t.__unstableIsSelected,n=t.children,o=t.allowedFormats,a=t.withoutInteractiveFormatting,i=t.formatTypes,c=t.forwardedRef,s=this.state.activeFormats,u=function(){c.current.focus(),e.applyRecord(e.record)};return Object(ht.createElement)(ht.Fragment,null,Object(ht.createElement)(Ct,{activeFormats:s,forwardedRef:c}),Object(ht.createElement)(Dt,{forwardedRef:c}),r&&Object(ht.createElement)(xt,{allowedFormats:o,withoutInteractiveFormatting:a,value:this.record,onChange:this.onChange,onFocus:u,formatTypes:i}),n&&n({isSelected:r,value:this.record,onChange:this.onChange,onFocus:u,Editable:this.Editable}),!n&&Object(ht.createElement)(this.Editable,null))}}]),t}(ht.Component);Ut.defaultProps={format:"string",value:""};var Bt=Object(gt.compose)([gt.withSafeTimeout,function(e){return function(t){var r=t.clientId,n=t.identifier,o=Object(a.useSelect)(_t,[]),s=Object(a.useSelect)((function(e){return o.reduce((function(t,o){if(!o.__experimentalGetPropsForEditableTreePreparation)return t;var a="format_prepare_props_(".concat(o.name,")_");return Pt({},t,{},Object(c.mapKeys)(o.__experimentalGetPropsForEditableTreePreparation(e,{richTextIdentifier:n,blockClientId:r}),(function(e,t){return a+t})))}),{})}),[o,r,n]),u=Object(a.__unstableUseDispatchWithMap)((function(e){return o.reduce((function(t,o){if(!o.__experimentalGetPropsForEditableTreeChangeHandler)return t;var a="format_on_change_props_(".concat(o.name,")_");return Pt({},t,{},Object(c.mapKeys)(o.__experimentalGetPropsForEditableTreeChangeHandler(e,{richTextIdentifier:n,blockClientId:r}),(function(e,t){return a+t})))}),{})}),[o,r,n]),l=Object(ht.useMemo)((function(){return o.reduce((function(e,t){if(!t.__experimentalCreatePrepareEditableTree)return e;var o,a={richTextIdentifier:n,blockClientId:r},c=Pt({},s,{},u),l=t.name,f="format_prepare_props_(".concat(l,")_"),p="format_on_change_props_(".concat(l,")_"),d=Object.keys(c).reduce((function(e,t){return t.startsWith(f)&&(e[t.slice(f.length)]=c[t]),t.startsWith(p)&&(e[t.slice(p.length)]=c[t]),e}),{});return t.__experimentalCreateOnChangeEditableValue?Pt({},e,(o={},Object(i.a)(o,"format_value_functions_(".concat(l,")"),t.__experimentalCreatePrepareEditableTree(d,a)),Object(i.a)(o,"format_on_change_functions_(".concat(l,")"),t.__experimentalCreateOnChangeEditableValue(d,a)),o)):Pt({},e,Object(i.a)({},"format_prepare_functions_(".concat(l,")"),t.__experimentalCreatePrepareEditableTree(d,a)))}),{})}),[o,r,n,s,u]);return Object(ht.createElement)(e,Object(ct.a)({},t,s,l,{formatTypes:o}))}}])(Ut),Kt=Object(ht.forwardRef)((function(e,t){return Object(ht.createElement)(Bt,Object(ct.a)({},e,{forwardedRef:t}))}))}});