2023-07-11 02:59:09 -04:00
|
|
|
!function(){"use strict";var e={n:function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,{a:n}),n},d:function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{__UNSTABLE_LINE_SEPARATOR:function(){return T},__experimentalRichText:function(){return et},__unstableCreateElement:function(){return E},__unstableFormatEdit:function(){return tt},__unstableInsertLineSeparator:function(){return G},__unstableIsEmptyLine:function(){return H},__unstableToDom:function(){return ge},__unstableUseRichText:function(){return Qe},applyFormat:function(){return b},concat:function(){return W},create:function(){return N},getActiveFormat:function(){return M},getActiveFormats:function(){return k},getActiveObject:function(){return $},getTextContent:function(){return P},insert:function(){return q},insertObject:function(){return Z},isCollapsed:function(){return V},isEmpty:function(){return I},join:function(){return B},registerFormatType:function(){return z},remove:function(){return X},removeFormat:function(){return U},replace:function(){return Y},slice:function(){return J},split:function(){return Q},store:function(){return g},toHTMLString:function(){return be},toggleFormat:function(){return Se},unregisterFormatType:function(){return De},useAnchor:function(){return je},useAnchorRef:function(){return Me}});var n={};e.r(n),e.d(n,{getFormatType:function(){return l},getFormatTypeForBareElement:function(){return f},getFormatTypeForClassName:function(){return d},getFormatTypes:function(){return u}});var r={};e.r(r),e.d(r,{addFormatTypes:function(){return m},removeFormatTypes:function(){return p}});var a=window.wp.data;var o=(0,a.combineReducers)({formatTypes:function(e={},t){switch(t.type){case"ADD_FORMAT_TYPES":return{...e,...t.formatTypes.reduce(((e,t)=>({...e,[t.name]:t})),{})};case"REMOVE_FORMAT_TYPES":return Object.fromEntries(Object.entries(e).filter((([e])=>!t.names.includes(e))))}return e}}),i={};function s(e){return[e]}function c(e,t,n){var r;if(e.length!==t.length)return!1;for(r=n;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}const u=function(e,t){var n,r=t||s;function a(){n=new WeakMap}function o(){var t,a,o,s,u,l=arguments.length;for(s=new Array(l),o=0;o<l;o++)s[o]=arguments[o];for(t=function(e){var t,r,a,o,s,c=n,u=!0;for(t=0;t<e.length;t++){if(!(s=r=e[t])||"object"!=typeof s){u=!1;break}c.has(r)?c=c.get(r):(a=new WeakMap,c.set(r,a),c=a)}return c.has(i)||((o=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=u,c.set(i,o)),c.get(i)}(u=r.apply(null,s)),t.isUniqueByDependants||(t.lastDependants&&!c(u,t.lastDependants,0)&&t.clear(),t.lastDependants=u),a=t.head;a;){if(c(a.args,s,1))return a!==t.head&&(a.prev.next=a.next,a.next&&(a.next.prev=a.prev),a.next=t.head,a.prev=null,t.head.prev=a,t.head=a),a.val;a=a.next}return a={val:e.apply(null,s)},s[0]=null,a.args=s,t.head&&(t.head.prev=a,a.next=t.head),t.head=a,a.val}return o.getDependants=r,o.clear=a,a(),o}((e=>Object.values(e.formatTypes)),(e=>[e.formatTypes]));function l(e,t){return e.formatTypes[t]}function f(e,t){const n=u(e);return n.find((({className:e,tagName:n})=>null===e&&t===n))||n.find((({className:e,tagName:t})=>null===e&&"*"===t))}function d(e,t){return u(e).find((({className:e})=>null!==e&&` ${t} `.indexOf(` ${e} `)>=0))}function m(e){return{type:"ADD_FORMAT_TYPES",formatTypes:Array.isArray(e)?e:[e]}}function p(e){return{type:"REMOVE_FORMAT_TYPES",names:Array.isArray(e)?e:[e]}}const g=(0,a.createReduxStore)("core/rich-text",{reducer:o,selectors:n,actions:r});function h(e,t){if(e===t)return!0;if(!e||!t)return!1;if(e.type!==t.type)return!1;const n=e.attributes,r=t.attributes;if(n===r)return!0;if(!n||!r)return!1;const a=Object.keys(n),o=Object.keys(r);if(a.length!==o.length)return!1;const i=a.length;for(let e=0;e<i;e++
|