summaryrefslogtreecommitdiffstats
path: root/wp-includes/js/dist/format-library.min.js
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/js/dist/format-library.min.js')
-rw-r--r--wp-includes/js/dist/format-library.min.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/wp-includes/js/dist/format-library.min.js b/wp-includes/js/dist/format-library.min.js
index 5230229..3e79d3a 100644
--- a/wp-includes/js/dist/format-library.min.js
+++ b/wp-includes/js/dist/format-library.min.js
@@ -1,2 +1,2 @@
/*! This file is auto-generated */
-!function(){"use strict";var e={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);var n=window.wp.richText,r=window.wp.element,o=window.wp.i18n,a=window.wp.blockEditor,l=window.wp.primitives;var c=(0,r.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(l.Path,{d:"M14.7 11.3c1-.6 1.5-1.6 1.5-3 0-2.3-1.3-3.4-4-3.4H7v14h5.8c1.4 0 2.5-.3 3.3-1 .8-.7 1.2-1.7 1.2-2.9.1-1.9-.8-3.1-2.6-3.7zm-5.1-4h2.3c.6 0 1.1.1 1.4.4.3.3.5.7.5 1.2s-.2 1-.5 1.2c-.3.3-.8.4-1.4.4H9.6V7.3zm4.6 9c-.4.3-1 .4-1.7.4H9.6v-3.9h2.9c.7 0 1.3.2 1.7.5.4.3.6.8.6 1.5s-.2 1.2-.6 1.5z"}));const i="core/bold",s=(0,o.__)("Bold"),u={name:i,title:s,tagName:"strong",className:null,edit({isActive:e,value:t,onChange:o,onFocus:l}){function u(){o((0,n.toggleFormat)(t,{type:i,title:s}))}return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.RichTextShortcut,{type:"primary",character:"b",onUse:u}),(0,r.createElement)(a.RichTextToolbarButton,{name:"bold",icon:c,title:s,onClick:function(){o((0,n.toggleFormat)(t,{type:i})),l()},isActive:e,shortcutType:"primary",shortcutCharacter:"b"}),(0,r.createElement)(a.__unstableRichTextInputEvent,{inputType:"formatBold",onInput:u}))}};var m=(0,r.createElement)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(l.Path,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"}));const h="core/code",p=(0,o.__)("Inline code"),g={name:h,title:p,tagName:"code",className:null,__unstableInputRule(e){const{start:t,text:r}=e;if("`"!==r[t-1])return e;if(t-2<0)return e;const o=r.lastIndexOf("`",t-2);if(-1===o)return e;const a=o,l=t-2;return a===l?e:(e=(0,n.remove)(e,a,a+1),e=(0,n.remove)(e,l,l+1),e=(0,n.applyFormat)(e,{type:h},a,l))},edit({value:e,onChange:t,onFocus:o,isActive:l}){function c(){t((0,n.toggleFormat)(e,{type:h,title:p})),o()}return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.RichTextShortcut,{type:"access",character:"x",onUse:c}),(0,r.createElement)(a.RichTextToolbarButton,{icon:m,title:p,onClick:c,isActive:l,role:"menuitemcheckbox"}))}};var d=window.wp.components;var v=(0,r.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,r.createElement)(l.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"}));const w=["image"],b="core/image",f=(0,o.__)("Inline image"),y={name:b,title:f,keywords:[(0,o.__)("photo"),(0,o.__)("media")],object:!0,tagName:"img",className:null,attributes:{className:"class",style:"style",url:"src",alt:"alt"},edit:function({value:e,onChange:t,onFocus:o,isObjectActive:l,activeObjectAttributes:c,contentRef:i}){const[s,u]=(0,r.useState)(!1);function m(){u(!1)}return(0,r.createElement)(a.MediaUploadCheck,null,(0,r.createElement)(a.RichTextToolbarButton,{icon:(0,r.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(d.Path,{d:"M4 18.5h16V17H4v1.5zM16 13v1.5h4V13h-4zM5.1 15h7.8c.6 0 1.1-.5 1.1-1.1V6.1c0-.6-.5-1.1-1.1-1.1H5.1C4.5 5 4 5.5 4 6.1v7.8c0 .6.5 1.1 1.1 1.1zm.4-8.5h7V10l-1-1c-.3-.3-.8-.3-1 0l-1.6 1.5-1.2-.7c-.3-.2-.6-.2-.9 0l-1.3 1V6.5zm0 6.1l1.8-1.3 1.3.8c.3.2.7.2.9-.1l1.5-1.4 1.5 1.4v1.5h-7v-.9z"})),title:f,onClick:function(){u(!0)},isActive:l}),s&&(0,r.createElement)(a.MediaUpload,{allowedTypes:w,onSelect:({id:r,url:a,alt:l,width:c})=>{m(),t((0,n.insertObject)(e,{type:b,attributes:{className:`wp-image-${r}`,style:`width: ${Math.min(c,150)}px;`,url:a,alt:l}})),o()},onClose:m,render:({open:e})=>(e(),null)}),l&&(0,r.createElement)(E,{value:e,onChange:t,activeObjectAttributes:c,contentRef:i}))}};function E({value:e,onChange:t,activeObjectAttributes:a,contentRef:l}){const{style:c}=a,[i,s]=(0,r.useState)(c?.replace(/\D/g,"")),u=(0,n.useAnchor)({editableContentElement:l.current,settings:y});return(0,r.createElement)(d.Popover,{placement:"bottom",focusOnMount:!1,anchor:u,className:"block-editor-format-toolbar__image-popover"},(0,r.createElement)("form",{className:"block-editor-format-toolbar__image-container-content",onSubmit:n=>{const r=e.replacements.slice();r[e.start]={type:b,attributes:{...a,style:i?`width: ${i}px;`:""}},t({...e,replacements:r}),n.preventDefault()}},(0,r.createElement)(d.__experimentalHStack,{alignment:"bottom",spacing:"0"},(0,r.createElement)(d.__experimentalNumberControl,{className:"block-editor-format-toolbar__image-container-value",label:(0,o.__)("Width"),value:i,min:1,onChange:e=>s(e)}),(0,r.createElement)(d.Button,{className:"block-editor-format-toolbar__image-container-button",icon:v,label:(0,o.__)("Apply"),type:"submit"}))))}var _=(0,r.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(l.Path,{d:"M12.5 5L10 19h1.9l2.5-14z"}));const k="core/italic",C=(0,o.__)("Italic"),x={name:k,title:C,tagName:"em",className:null,edit({isActive:e,value:t,onChange:o,onFocus:l}){function c(){o((0,n.toggleFormat)(t,{type:k,title:C}))}return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.RichTextShortcut,{type:"primary",character:"i",onUse:c}),(0,r.createElement)(a.RichTextToolbarButton,{name:"italic",icon:_,title:C,onClick:function(){o((0,n.toggleFormat)(t,{type:k})),l()},isActive:e,shortcutType:"primary",shortcutCharacter:"i"}),(0,r.createElement)(a.__unstableRichTextInputEvent,{inputType:"formatItalic",onInput:c}))}};var T=window.wp.url,S=window.wp.htmlEntities;var A=(0,r.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(l.Path,{d:"M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z"}));var F=(0,r.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(l.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"})),N=window.wp.a11y,R=window.wp.data;function V(e){if(!e)return!1;const t=e.trim();if(!t)return!1;if(/^\S+:/.test(t)){const e=(0,T.getProtocol)(t);if(!(0,T.isValidProtocol)(e))return!1;if(e.startsWith("http")&&!/^https?:\/\/[^\/\s]/i.test(t))return!1;const n=(0,T.getAuthority)(t);if(!(0,T.isValidAuthority)(n))return!1;const r=(0,T.getPath)(t);if(r&&!(0,T.isValidPath)(r))return!1;const o=(0,T.getQueryString)(t);if(o&&!(0,T.isValidQueryString)(o))return!1;const a=(0,T.getFragment)(t);if(a&&!(0,T.isValidFragment)(a))return!1}return!(t.startsWith("#")&&!(0,T.isValidFragment)(t))}function B(e,t,n=e.start,r=e.end){const o={start:null,end:null},{formats:a}=e;let l,c;if(!a?.length)return o;const i=a.slice(),s=i[n]?.find((({type:e})=>e===t.type)),u=i[r]?.find((({type:e})=>e===t.type)),m=i[r-1]?.find((({type:e})=>e===t.type));if(s)l=s,c=n;else if(u)l=u,c=r;else{if(!m)return o;l=m,c=r-1}const h=i[c].indexOf(l),p=[i,c,l,h];return{start:n=(n=L(...p))<0?0:n,end:r=z(...p)}}function M(e,t,n,r,o){let a=t;const l={forwards:1,backwards:-1}[o]||1,c=-1*l;for(;e[a]&&e[a][r]===n;)a+=l;return a+=c,a}const P=(e,...t)=>(...n)=>e(...n,...t),L=P(M,"backwards"),z=P(M,"forwards"),H=new WeakMap;let I=-1;const j="link-control-instance";function U(e){return`${j}-${e}`}var G=function(e){if(e)return H.has(e)?U(H.get(e)):(I+=1,H.set(e,I),U(I))};const O=[...a.__experimentalLinkControl.DEFAULT_LINK_SETTINGS,{id:"nofollow",title:(0,o.__)("Mark as nofollow")}];var W=function({isActive:e,activeAttributes:t,addingLink:l,value:c,onChange:i,stopAddingLink:s,contentRef:u}){const m=function(e,t){let r=e.start,o=e.end;if(t){const t=B(e,{type:"core/link"});r=t.start,o=t.end+1}return(0,n.slice)(e,r,o)}(c,e).text,{createPageEntity:h,userCanCreatePages:p}=(0,R.useSelect)((e=>{const{getSettings:t}=e(a.store),n=t();return{createPageEntity:n.__experimentalCreatePageEntity,userCanCreatePages:n.__experimentalUserCanCreatePages}}),[]),g=(0,r.useMemo)((()=>({url:t.url,type:t.type,id:t.id,opensInNewTab:"_blank"===t.target,nofollow:t.rel?.includes("nofollow"),title:m})),[t.id,t.rel,t.target,t.type,t.url,m]),v=(0,n.useAnchor)({editableContentElement:u.current,settings:D}),w=G(v),b=(0,r.useRef)(!!l&&"firstElement");return(0,r.createElement)(d.Popover,{anchor:v,focusOnMount:b.current,onClose:s,onFocusOutside:()=>s(!1),placement:"bottom",shift:!0},(0,r.createElement)(a.__experimentalLinkControl,{key:w,value:g,onChange:function(t){const r=g.opensInNewTab!==t.opensInNewTab&&void 0===t.url;t={...g,...t};const a=(0,T.prependHTTP)(t.url),l=function({url:e,type:t,id:n,opensInNewWindow:r,nofollow:o}){const a={type:"core/link",attributes:{url:e}};return t&&(a.attributes.type=t),n&&(a.attributes.id=n),r&&(a.attributes.target="_blank",a.attributes.rel=a.attributes.rel?a.attributes.rel+" noreferrer noopener":"noreferrer noopener"),o&&(a.attributes.rel=a.attributes.rel?a.attributes.rel+" nofollow":"nofollow"),a}({url:a,type:t.type,id:void 0!==t.id&&null!==t.id?String(t.id):void 0,opensInNewWindow:t.opensInNewTab,nofollow:t.nofollow}),u=t.title||a;if((0,n.isCollapsed)(c)&&!e){const e=(0,n.applyFormat)((0,n.create)({text:u}),l,0,u.length);i((0,n.insert)(c,e))}else{let e;if(u===m)e=(0,n.applyFormat)(c,l);else{e=(0,n.create)({text:u}),e=(0,n.applyFormat)(e,l,0,u.length);const t=B(c,{type:"core/link"}),[r,o]=(0,n.split)(c,t.start,t.start),a=(0,n.replace)(o,m,e);e=(0,n.concat)(r,a)}e.start=e.end,e.activeFormats=[],i(e)}r||s(),V(a)?e?(0,N.speak)((0,o.__)("Link edited."),"assertive"):(0,N.speak)((0,o.__)("Link inserted."),"assertive"):(0,N.speak)((0,o.__)("Warning: the link has been inserted but may have errors. Please test it."),"assertive")},onRemove:function(){const e=(0,n.removeFormat)(c,"core/link");i(e),s(),(0,N.speak)((0,o.__)("Link removed."),"assertive")},forceIsEditingLink:l,hasRichPreviews:!0,createSuggestion:h&&async function(e){const t=await h({title:e,status:"draft"});return{id:t.id,type:t.type,title:t.title.rendered,url:t.link,kind:"post-type"}},withCreateSuggestion:p,createSuggestionButtonText:function(e){return(0,r.createInterpolateElement)((0,o.sprintf)((0,o.__)("Create page: <mark>%s</mark>"),e),{mark:(0,r.createElement)("mark",null)})},hasTextControl:!0,settings:O}))};const Z="core/link",$=(0,o.__)("Link");const D={name:Z,title:$,tagName:"a",className:null,attributes:{url:"href",type:"data-type",id:"data-id",target:"target",rel:"rel"},__unstablePasteRule(e,{html:t,plainText:r}){if((0,n.isCollapsed)(e))return e;const o=(t||r).replace(/<[^>]+>/g,"").trim();return(0,T.isURL)(o)?(window.console.log("Created link:\n\n",o),(0,n.applyFormat)(e,{type:Z,attributes:{url:(0,S.decodeEntities)(o)}})):e},edit:function({isActive:e,activeAttributes:t,value:l,onChange:c,onFocus:i,contentRef:s}){const[u,m]=(0,r.useState)(!1);function h(){const e=(0,n.getTextContent)((0,n.slice)(l));e&&(0,T.isURL)(e)&&V(e)?c((0,n.applyFormat)(l,{type:Z,attributes:{url:e}})):e&&(0,T.isEmail)(e)?c((0,n.applyFormat)(l,{type:Z,attributes:{url:`mailto:${e}`}})):m(!0)}function p(){c((0,n.removeFormat)(l,Z)),(0,N.speak)((0,o.__)("Link removed."),"assertive")}return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.RichTextShortcut,{type:"primary",character:"k",onUse:h}),(0,r.createElement)(a.RichTextShortcut,{type:"primaryShift",character:"k",onUse:p}),e&&(0,r.createElement)(a.RichTextToolbarButton,{name:"link",icon:A,title:(0,o.__)("Unlink"),onClick:p,isActive:e,shortcutType:"primaryShift",shortcutCharacter:"k","aria-haspopup":"true","aria-expanded":u||e}),!e&&(0,r.createElement)(a.RichTextToolbarButton,{name:"link",icon:F,title:$,onClick:h,isActive:e,shortcutType:"primary",shortcutCharacter:"k","aria-haspopup":"true","aria-expanded":u||e}),(u||e)&&(0,r.createElement)(W,{addingLink:u,stopAddingLink:function(e=!0){m(!1),e&&i()},isActive:e,activeAttributes:t,value:l,onChange:c,contentRef:s}))}};var K=(0,r.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(l.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"}));const Q="core/strikethrough",q=(0,o.__)("Strikethrough"),J={name:Q,title:q,tagName:"s",className:null,edit({isActive:e,value:t,onChange:o,onFocus:l}){function c(){o((0,n.toggleFormat)(t,{type:Q,title:q})),l()}return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.RichTextShortcut,{type:"access",character:"d",onUse:c}),(0,r.createElement)(a.RichTextToolbarButton,{icon:K,title:q,onClick:c,isActive:e,role:"menuitemcheckbox"}))}},X="core/underline",Y=(0,o.__)("Underline"),ee={name:X,title:Y,tagName:"span",className:null,attributes:{style:"style"},edit({value:e,onChange:t}){const o=()=>{t((0,n.toggleFormat)(e,{type:X,attributes:{style:"text-decoration: underline;"},title:Y}))};return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.RichTextShortcut,{type:"primary",character:"u",onUse:o}),(0,r.createElement)(a.__unstableRichTextInputEvent,{inputType:"formatUnderline",onInput:o}))}};var te=(0,r.forwardRef)((function({icon:e,size:t=24,...n},o){return(0,r.cloneElement)(e,{width:t,height:t,...n,ref:o})}));var ne=(0,r.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(l.Path,{d:"M12.9 6h-2l-4 11h1.9l1.1-3h4.2l1.1 3h1.9L12.9 6zm-2.5 6.5l1.5-4.9 1.7 4.9h-3.2z"}));var re=(0,r.createElement)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(l.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"}));function oe(e=""){return e.split(";").reduce(((e,t)=>{if(t){const[n,r]=t.split(":");"color"===n&&(e.color=r),"background-color"===n&&r!==se&&(e.backgroundColor=r)}return e}),{})}function ae(e="",t){return e.split(" ").reduce(((e,n)=>{if(n.startsWith("has-")&&n.endsWith("-color")){const r=n.replace(/^has-/,"").replace(/-color$/,""),o=(0,a.getColorObjectByAttributeValues)(t,r);e.color=o.color}return e}),{})}function le(e,t,r){const o=(0,n.getActiveFormat)(e,t);return o?{...oe(o.attributes.style),...ae(o.attributes.class,r)}:{}}function ce({name:e,property:t,value:o,onChange:l}){const c=(0,R.useSelect)((e=>{var t;const{getSettings:n}=e(a.store);return null!==(t=n().colors)&&void 0!==t?t:[]}),[]),i=(0,r.useCallback)((r=>{l(function(e,t,r,o){const{color:l,backgroundColor:c}={...le(e,t,r),...o};if(!l&&!c)return(0,n.removeFormat)(e,t);const i=[],s=[],u={};if(c?i.push(["background-color",c].join(":")):i.push(["background-color",se].join(":")),l){const e=(0,a.getColorObjectByColorValue)(r,l);e?s.push((0,a.getColorClassName)("color",e.slug)):i.push(["color",l].join(":"))}return i.length&&(u.style=i.join(";")),s.length&&(u.class=s.join(" ")),(0,n.applyFormat)(e,{type:t,attributes:u})}(o,e,c,{[t]:r}))}),[c,l,t]),s=(0,r.useMemo)((()=>le(o,e,c)),[e,o,c]);return(0,r.createElement)(a.ColorPalette,{value:s[t],onChange:i})}function ie({name:e,value:t,onChange:l,onClose:c,contentRef:i}){const s=(0,n.useAnchor)({editableContentElement:i.current,settings:ge}),u=(0,a.useCachedTruthy)(s.getBoundingClientRect());return s.getBoundingClientRect=()=>u,(0,r.createElement)(d.Popover,{onClose:c,className:"components-inline-color-popover",anchor:s},(0,r.createElement)(d.TabPanel,{tabs:[{name:"color",title:(0,o.__)("Text")},{name:"backgroundColor",title:(0,o.__)("Background")}]},(n=>(0,r.createElement)(ce,{name:e,property:n.name,value:t,onChange:l}))))}const se="rgba(0, 0, 0, 0)",ue="core/text-color",me=(0,o.__)("Highlight"),he=[];function pe(e,t){const{ownerDocument:n}=e,{defaultView:r}=n,o=r.getComputedStyle(e).getPropertyValue(t);return"background-color"===t&&o===se&&e.parentElement?pe(e.parentElement,t):o}const ge={name:ue,title:me,tagName:"mark",className:"has-inline-color",attributes:{style:"style",class:"class"},__unstableFilterAttributeValue(e,t){if("style"!==e)return t;if(t&&t.includes("background-color"))return t;const n=["background-color",se].join(":");return t?[n,t].join(";"):n},edit:function({value:e,onChange:t,isActive:o,activeAttributes:l,contentRef:c}){const i=(0,a.useSetting)("color.custom"),s=(0,a.useSetting)("color.palette")||he,[u,m]=(0,r.useState)(!1),h=(0,r.useCallback)((()=>m(!0)),[m]),p=(0,r.useCallback)((()=>m(!1)),[m]),g=(0,r.useMemo)((()=>function(e,{color:t,backgroundColor:n}){if(t||n)return{color:t||pe(e,"color"),backgroundColor:n===se?pe(e,"background-color"):n}}(c.current,le(e,ue,s))),[e,s]),d=s.length||!i;return d||o?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.RichTextToolbarButton,{className:"format-library-text-color-button",isActive:o,icon:(0,r.createElement)(te,{icon:Object.keys(l).length?ne:re,style:g}),title:me,onClick:d?h:()=>t((0,n.removeFormat)(e,ue)),role:"menuitemcheckbox"}),u&&(0,r.createElement)(ie,{name:ue,onClose:p,activeAttributes:l,value:e,onChange:t,contentRef:c})):null}};var de=(0,r.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(l.Path,{d:"M16.9 18.3l.8-1.2c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.1-.3-.4-.5-.6-.7-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.2 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3L15 19.4h4.3v-1.2h-2.4zM14.1 7.2h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"}));const ve="core/subscript",we=(0,o.__)("Subscript"),be={name:ve,title:we,tagName:"sub",className:null,edit({isActive:e,value:t,onChange:o,onFocus:l}){return(0,r.createElement)(a.RichTextToolbarButton,{icon:de,title:we,onClick:function(){o((0,n.toggleFormat)(t,{type:ve,title:we})),l()},isActive:e,role:"menuitemcheckbox"})}};var fe=(0,r.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(l.Path,{d:"M16.9 10.3l.8-1.3c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.2-.2-.4-.4-.7-.6-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.1 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3l-1.8 2.8h4.3v-1.2h-2.2zm-2.8-3.1h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"}));const ye="core/superscript",Ee=(0,o.__)("Superscript"),_e={name:ye,title:Ee,tagName:"sup",className:null,edit({isActive:e,value:t,onChange:o,onFocus:l}){return(0,r.createElement)(a.RichTextToolbarButton,{icon:fe,title:Ee,onClick:function(){o((0,n.toggleFormat)(t,{type:ye,title:Ee})),l()},isActive:e,role:"menuitemcheckbox"})}};var ke=(0,r.createElement)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(l.Path,{d:"M8 12.5h8V11H8v1.5Z M19 6.5H5a2 2 0 0 0-2 2V15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a2 2 0 0 0-2-2ZM5 8h14a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V8.5A.5.5 0 0 1 5 8Z"}));const Ce="core/keyboard",xe=(0,o.__)("Keyboard input"),Te={name:Ce,title:xe,tagName:"kbd",className:null,edit({isActive:e,value:t,onChange:o,onFocus:l}){return(0,r.createElement)(a.RichTextToolbarButton,{icon:ke,title:xe,onClick:function(){o((0,n.toggleFormat)(t,{type:Ce,title:xe})),l()},isActive:e,role:"menuitemcheckbox"})}};var Se=(0,r.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(l.Path,{d:"M12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zM3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 8.75a1.5 1.5 0 01.167 2.99c-.465.052-.917.44-.917 1.01V14h1.5v-.845A3 3 0 109 10.25h1.5a1.5 1.5 0 011.5-1.5zM11.25 15v1.5h1.5V15h-1.5z"}));const Ae="core/unknown",Fe=(0,o.__)("Clear Unknown Formatting"),Ne={name:Ae,title:Fe,tagName:"*",className:null,edit({isActive:e,value:t,onChange:o,onFocus:l}){const c=(0,n.slice)(t).formats.some((e=>e.some((e=>e.type===Ae))));return e||c?(0,r.createElement)(a.RichTextToolbarButton,{name:"unknown",icon:Se,title:Fe,onClick:function(){o((0,n.removeFormat)(t,Ae)),l()},isActive:!0}):null}};var Re=(0,r.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(l.Path,{d:"M17.5 10h-1.7l-3.7 10.5h1.7l.9-2.6h3.9l.9 2.6h1.7L17.5 10zm-2.2 6.3 1.4-4 1.4 4h-2.8zm-4.8-3.8c1.6-1.8 2.9-3.6 3.7-5.7H16V5.2h-5.8V3H8.8v2.2H3v1.5h9.6c-.7 1.6-1.8 3.1-3.1 4.6C8.6 10.2 7.8 9 7.2 8H5.6c.6 1.4 1.7 2.9 2.9 4.4l-2.4 2.4c-.3.4-.7.8-1.1 1.2l1 1 1.2-1.2c.8-.8 1.6-1.5 2.3-2.3.8.9 1.7 1.7 2.5 2.5l.6-1.5c-.7-.6-1.4-1.3-2.1-2z"}));const Ve="core/language",Be=(0,o.__)("Language"),Me={name:Ve,tagName:"bdo",className:null,edit:function({isActive:e,value:t,onChange:o,contentRef:l}){const[c,i]=(0,r.useState)(!1),s=()=>{i((e=>!e))};return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.RichTextToolbarButton,{icon:Re,label:Be,title:Be,onClick:()=>{e?o((0,n.removeFormat)(t,Ve)):s()},isActive:e,role:"menuitemcheckbox"}),c&&(0,r.createElement)(Pe,{value:t,onChange:o,onClose:s,contentRef:l}))},title:Be};function Pe({value:e,contentRef:t,onChange:a,onClose:l}){const c=(0,n.useAnchor)({editableContentElement:t.current,settings:Me}),[i,s]=(0,r.useState)(""),[u,m]=(0,r.useState)("ltr");return(0,r.createElement)(d.Popover,{className:"block-editor-format-toolbar__language-popover",anchor:c,onClose:l},(0,r.createElement)("form",{className:"block-editor-format-toolbar__language-container-content",onSubmit:t=>{t.preventDefault(),a((0,n.applyFormat)(e,{type:Ve,attributes:{lang:i,dir:u}})),l()}},(0,r.createElement)(d.TextControl,{label:Be,value:i,onChange:e=>s(e),help:(0,o.__)('A valid language attribute, like "en" or "fr".')}),(0,r.createElement)(d.SelectControl,{label:(0,o.__)("Text direction"),value:u,options:[{label:(0,o.__)("Left to right"),value:"ltr"},{label:(0,o.__)("Right to left"),value:"rtl"}],onChange:e=>m(e)}),(0,r.createElement)(d.__experimentalHStack,{alignment:"right"},(0,r.createElement)(d.Button,{variant:"primary",type:"submit",text:(0,o.__)("Apply")}))))}[u,g,y,x,D,J,ee,ge,be,_e,Te,Ne,Me].forEach((({name:e,...t})=>(0,n.registerFormatType)(e,t))),(window.wp=window.wp||{}).formatLibrary=t}(); \ No newline at end of file
+(()=>{"use strict";var e={r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t);const n=window.wp.richText,o=window.React,r=window.wp.i18n,a=window.wp.blockEditor,l=window.wp.primitives,i=(0,o.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(l.Path,{d:"M14.7 11.3c1-.6 1.5-1.6 1.5-3 0-2.3-1.3-3.4-4-3.4H7v14h5.8c1.4 0 2.5-.3 3.3-1 .8-.7 1.2-1.7 1.2-2.9.1-1.9-.8-3.1-2.6-3.7zm-5.1-4h2.3c.6 0 1.1.1 1.4.4.3.3.5.7.5 1.2s-.2 1-.5 1.2c-.3.3-.8.4-1.4.4H9.6V7.3zm4.6 9c-.4.3-1 .4-1.7.4H9.6v-3.9h2.9c.7 0 1.3.2 1.7.5.4.3.6.8.6 1.5s-.2 1.2-.6 1.5z"})),c="core/bold",s=(0,r.__)("Bold"),u={name:c,title:s,tagName:"strong",className:null,edit({isActive:e,value:t,onChange:r,onFocus:l}){function u(){r((0,n.toggleFormat)(t,{type:c,title:s}))}return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(a.RichTextShortcut,{type:"primary",character:"b",onUse:u}),(0,o.createElement)(a.RichTextToolbarButton,{name:"bold",icon:i,title:s,onClick:function(){r((0,n.toggleFormat)(t,{type:c})),l()},isActive:e,shortcutType:"primary",shortcutCharacter:"b"}),(0,o.createElement)(a.__unstableRichTextInputEvent,{inputType:"formatBold",onInput:u}))}},m=(0,o.createElement)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(l.Path,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"})),p="core/code",h=(0,r.__)("Inline code"),g={name:p,title:h,tagName:"code",className:null,__unstableInputRule(e){const{start:t,text:o}=e;if("`"!==o[t-1])return e;if(t-2<0)return e;const r=o.lastIndexOf("`",t-2);if(-1===r)return e;const a=r,l=t-2;return a===l?e:(e=(0,n.remove)(e,a,a+1),e=(0,n.remove)(e,l,l+1),e=(0,n.applyFormat)(e,{type:p},a,l))},edit({value:e,onChange:t,onFocus:r,isActive:l}){function i(){t((0,n.toggleFormat)(e,{type:p,title:h})),r()}return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(a.RichTextShortcut,{type:"access",character:"x",onUse:i}),(0,o.createElement)(a.RichTextToolbarButton,{icon:m,title:h,onClick:i,isActive:l,role:"menuitemcheckbox"}))}},d=window.wp.components,v=window.wp.element,b=(0,o.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,o.createElement)(l.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"})),f=["image"],w="core/image",y=(0,r.__)("Inline image"),E={name:w,title:y,keywords:[(0,r.__)("photo"),(0,r.__)("media")],object:!0,tagName:"img",className:null,attributes:{className:"class",style:"style",url:"src",alt:"alt"},edit:function({value:e,onChange:t,onFocus:r,isObjectActive:l,activeObjectAttributes:i,contentRef:c}){const[s,u]=(0,v.useState)(!1);function m(){u(!1)}return(0,o.createElement)(a.MediaUploadCheck,null,(0,o.createElement)(a.RichTextToolbarButton,{icon:(0,o.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(d.Path,{d:"M4 18.5h16V17H4v1.5zM16 13v1.5h4V13h-4zM5.1 15h7.8c.6 0 1.1-.5 1.1-1.1V6.1c0-.6-.5-1.1-1.1-1.1H5.1C4.5 5 4 5.5 4 6.1v7.8c0 .6.5 1.1 1.1 1.1zm.4-8.5h7V10l-1-1c-.3-.3-.8-.3-1 0l-1.6 1.5-1.2-.7c-.3-.2-.6-.2-.9 0l-1.3 1V6.5zm0 6.1l1.8-1.3 1.3.8c.3.2.7.2.9-.1l1.5-1.4 1.5 1.4v1.5h-7v-.9z"})),title:y,onClick:function(){u(!0)},isActive:l}),s&&(0,o.createElement)(a.MediaUpload,{allowedTypes:f,onSelect:({id:o,url:a,alt:l,width:i})=>{m(),t((0,n.insertObject)(e,{type:w,attributes:{className:`wp-image-${o}`,style:`width: ${Math.min(i,150)}px;`,url:a,alt:l}})),r()},onClose:m,render:({open:e})=>(e(),null)}),l&&(0,o.createElement)(_,{value:e,onChange:t,activeObjectAttributes:i,contentRef:c}))}};function _({value:e,onChange:t,activeObjectAttributes:a,contentRef:l}){const{style:i}=a,[c,s]=(0,v.useState)(i?.replace(/\D/g,"")),u=(0,n.useAnchor)({editableContentElement:l.current,settings:E});return(0,o.createElement)(d.Popover,{placement:"bottom",focusOnMount:!1,anchor:u,className:"block-editor-format-toolbar__image-popover"},(0,o.createElement)("form",{className:"block-editor-format-toolbar__image-container-content",onSubmit:n=>{const o=e.replacements.slice();o[e.start]={type:w,attributes:{...a,style:c?`width: ${c}px;`:""}},t({...e,replacements:o}),n.preventDefault()}},(0,o.createElement)(d.__experimentalHStack,{alignment:"bottom",spacing:"0"},(0,o.createElement)(d.__experimentalNumberControl,{className:"block-editor-format-toolbar__image-container-value",label:(0,r.__)("Width"),value:c,min:1,onChange:e=>s(e)}),(0,o.createElement)(d.Button,{className:"block-editor-format-toolbar__image-container-button",icon:b,label:(0,r.__)("Apply"),type:"submit"}))))}const k=(0,o.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(l.Path,{d:"M12.5 5L10 19h1.9l2.5-14z"})),C="core/italic",x=(0,r.__)("Italic"),S={name:C,title:x,tagName:"em",className:null,edit({isActive:e,value:t,onChange:r,onFocus:l}){function i(){r((0,n.toggleFormat)(t,{type:C,title:x}))}return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(a.RichTextShortcut,{type:"primary",character:"i",onUse:i}),(0,o.createElement)(a.RichTextToolbarButton,{name:"italic",icon:k,title:x,onClick:function(){r((0,n.toggleFormat)(t,{type:C})),l()},isActive:e,shortcutType:"primary",shortcutCharacter:"i"}),(0,o.createElement)(a.__unstableRichTextInputEvent,{inputType:"formatItalic",onInput:i}))}},T=window.wp.url,A=window.wp.htmlEntities,F=(0,o.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(l.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"})),N=window.wp.a11y,R=window.wp.data;function V(e){if(!e)return!1;const t=e.trim();if(!t)return!1;if(/^\S+:/.test(t)){const e=(0,T.getProtocol)(t);if(!(0,T.isValidProtocol)(e))return!1;if(e.startsWith("http")&&!/^https?:\/\/[^\/\s]/i.test(t))return!1;const n=(0,T.getAuthority)(t);if(!(0,T.isValidAuthority)(n))return!1;const o=(0,T.getPath)(t);if(o&&!(0,T.isValidPath)(o))return!1;const r=(0,T.getQueryString)(t);if(r&&!(0,T.isValidQueryString)(r))return!1;const a=(0,T.getFragment)(t);if(a&&!(0,T.isValidFragment)(a))return!1}return!(t.startsWith("#")&&!(0,T.isValidFragment)(t))}function P(e,t,n=e.start,o=e.end){const r={start:null,end:null},{formats:a}=e;let l,i;if(!a?.length)return r;const c=a.slice(),s=c[n]?.find((({type:e})=>e===t.type)),u=c[o]?.find((({type:e})=>e===t.type)),m=c[o-1]?.find((({type:e})=>e===t.type));if(s)l=s,i=n;else if(u)l=u,i=o;else{if(!m)return r;l=m,i=o-1}const p=c[i].indexOf(l),h=[c,i,l,p];return{start:n=(n=L(...h))<0?0:n,end:o=z(...h)}}function M(e,t,n,o,r){let a=t;const l={forwards:1,backwards:-1}[r]||1,i=-1*l;for(;e[a]&&e[a][o]===n;)a+=l;return a+=i,a}const B=(e,...t)=>(...n)=>e(...n,...t),L=B(M,"backwards"),z=B(M,"forwards"),I=[...a.__experimentalLinkControl.DEFAULT_LINK_SETTINGS,{id:"nofollow",title:(0,r.__)("Mark as nofollow")}];const H=function({isActive:e,activeAttributes:t,value:l,onChange:i,onFocusOutside:c,stopAddingLink:s,contentRef:u,focusOnMount:m}){const p=function(e,t){let o=e.start,r=e.end;if(t){const t=P(e,{type:"core/link"});o=t.start,r=t.end+1}return(0,n.slice)(e,o,r)}(l,e).text,{selectionChange:h}=(0,R.useDispatch)(a.store),{createPageEntity:g,userCanCreatePages:b,selectionStart:f}=(0,R.useSelect)((e=>{const{getSettings:t,getSelectionStart:n}=e(a.store),o=t();return{createPageEntity:o.__experimentalCreatePageEntity,userCanCreatePages:o.__experimentalUserCanCreatePages,selectionStart:n()}}),[]),w=(0,v.useMemo)((()=>({url:t.url,type:t.type,id:t.id,opensInNewTab:"_blank"===t.target,nofollow:t.rel?.includes("nofollow"),title:p})),[t.id,t.rel,t.target,t.type,t.url,p]),y=(0,n.useAnchor)({editableContentElement:u.current,settings:{...j,isActive:e}});return(0,o.createElement)(d.Popover,{anchor:y,onClose:s,onFocusOutside:c,placement:"bottom",offset:10,shift:!0,focusOnMount:m,constrainTabbing:!0},(0,o.createElement)(a.__experimentalLinkControl,{value:w,onChange:function(t){const o=w?.url,a=!o;t={...w,...t};const c=(0,T.prependHTTP)(t.url),u=function({url:e,type:t,id:n,opensInNewWindow:o,nofollow:r}){const a={type:"core/link",attributes:{url:e}};return t&&(a.attributes.type=t),n&&(a.attributes.id=n),o&&(a.attributes.target="_blank",a.attributes.rel=a.attributes.rel?a.attributes.rel+" noreferrer noopener":"noreferrer noopener"),r&&(a.attributes.rel=a.attributes.rel?a.attributes.rel+" nofollow":"nofollow"),a}({url:c,type:t.type,id:void 0!==t.id&&null!==t.id?String(t.id):void 0,opensInNewWindow:t.opensInNewTab,nofollow:t.nofollow}),m=t.title||c;let g;if((0,n.isCollapsed)(l)&&!e){const e=(0,n.insert)(l,m);return g=(0,n.applyFormat)(e,u,l.start,l.start+m.length),i(g),s(),void h({clientId:f.clientId,identifier:f.attributeKey,start:l.start+m.length+1})}if(m===p)g=(0,n.applyFormat)(l,u);else{g=(0,n.create)({text:m}),g=(0,n.applyFormat)(g,u,0,m.length);const e=P(l,{type:"core/link"}),[t,o]=(0,n.split)(l,e.start,e.start),r=(0,n.replace)(o,p,g);g=(0,n.concat)(t,r)}i(g),a||s(),V(c)?e?(0,N.speak)((0,r.__)("Link edited."),"assertive"):(0,N.speak)((0,r.__)("Link inserted."),"assertive"):(0,N.speak)((0,r.__)("Warning: the link has been inserted but may have errors. Please test it."),"assertive")},onRemove:function(){const e=(0,n.removeFormat)(l,"core/link");i(e),s(),(0,N.speak)((0,r.__)("Link removed."),"assertive")},hasRichPreviews:!0,createSuggestion:g&&async function(e){const t=await g({title:e,status:"draft"});return{id:t.id,type:t.type,title:t.title.rendered,url:t.link,kind:"post-type"}},withCreateSuggestion:b,createSuggestionButtonText:function(e){return(0,v.createInterpolateElement)((0,r.sprintf)((0,r.__)("Create page: <mark>%s</mark>"),e),{mark:(0,o.createElement)("mark",null)})},hasTextControl:!0,settings:I,showInitialSuggestions:!0,suggestionsQuery:{initialSuggestionsSearchOptions:{type:"post",subtype:"page",perPage:20}}}))},O="core/link",U=(0,r.__)("Link");const j={name:O,title:U,tagName:"a",className:null,attributes:{url:"href",type:"data-type",id:"data-id",_id:"id",target:"target",rel:"rel"},__unstablePasteRule(e,{html:t,plainText:o}){const r=(t||o).replace(/<[^>]+>/g,"").trim();if(!(0,T.isURL)(r)||!/^https?:/.test(r))return e;window.console.log("Created link:\n\n",r);const a={type:O,attributes:{url:(0,A.decodeEntities)(r)}};return(0,n.isCollapsed)(e)?(0,n.insert)(e,(0,n.applyFormat)((0,n.create)({text:o}),a,0,o.length)):(0,n.applyFormat)(e,a)},edit:function({isActive:e,activeAttributes:t,value:l,onChange:i,onFocus:c,contentRef:s}){const[u,m]=(0,v.useState)(!1),[p,h]=(0,v.useState)(!1),[g,d]=(0,v.useState)(null),[b,f]=(0,v.useState)(!0);function w(e,{autoFocus:t=!0}={}){m(e),f(t)}function y(t){!0===t&&e||h(t)}function E(t){f(!0);const o=(0,n.getTextContent)((0,n.slice)(l));!e&&o&&(0,T.isURL)(o)&&V(o)?i((0,n.applyFormat)(l,{type:O,attributes:{url:o}})):!e&&o&&(0,T.isEmail)(o)?i((0,n.applyFormat)(l,{type:O,attributes:{url:`mailto:${o}`}})):(t&&d(t),e?w(!0):y(!0))}(0,v.useEffect)((()=>{e||(m(!1),h(!1))}),[e]),(0,v.useLayoutEffect)((()=>{const t=s.current;if(t)return t.addEventListener("click",n),()=>{t.removeEventListener("click",n)};function n(t){t.target.closest("[contenteditable] a")&&e?w(!0,{autoFocus:!1}):w(!1)}}),[s,e]);const _=u&&e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(a.RichTextShortcut,{type:"primary",character:"k",onUse:E}),(0,o.createElement)(a.RichTextShortcut,{type:"primaryShift",character:"k",onUse:function(){i((0,n.removeFormat)(l,O)),(0,N.speak)((0,r.__)("Link removed."),"assertive")}}),(0,o.createElement)(a.RichTextToolbarButton,{name:"link",icon:F,title:e?(0,r.__)("Link"):U,onClick:e=>{E(e.currentTarget)},isActive:e||u,shortcutType:"primary",shortcutCharacter:"k","aria-haspopup":"true","aria-expanded":u}),(_||p)&&(0,o.createElement)(H,{stopAddingLink:function(){w(!1),y(!1),"BUTTON"===g?.tagName?g.focus():c(),d(null)},onFocusOutside:function(){w(!1),y(!1),d(null)},isActive:e,activeAttributes:t,value:l,onChange:i,contentRef:s,focusOnMount:!!b&&"firstElement"}))}},G=(0,o.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(l.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"})),W="core/strikethrough",D=(0,r.__)("Strikethrough"),Z={name:W,title:D,tagName:"s",className:null,edit({isActive:e,value:t,onChange:r,onFocus:l}){function i(){r((0,n.toggleFormat)(t,{type:W,title:D})),l()}return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(a.RichTextShortcut,{type:"access",character:"d",onUse:i}),(0,o.createElement)(a.RichTextToolbarButton,{icon:G,title:D,onClick:i,isActive:e,role:"menuitemcheckbox"}))}},$="core/underline",K=(0,r.__)("Underline"),Q={name:$,title:K,tagName:"span",className:null,attributes:{style:"style"},edit({value:e,onChange:t}){const r=()=>{t((0,n.toggleFormat)(e,{type:$,attributes:{style:"text-decoration: underline;"},title:K}))};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(a.RichTextShortcut,{type:"primary",character:"u",onUse:r}),(0,o.createElement)(a.__unstableRichTextInputEvent,{inputType:"formatUnderline",onInput:r}))}};const q=(0,v.forwardRef)((function({icon:e,size:t=24,...n},o){return(0,v.cloneElement)(e,{width:t,height:t,...n,ref:o})})),J=(0,o.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(l.Path,{d:"M12.9 6h-2l-4 11h1.9l1.1-3h4.2l1.1 3h1.9L12.9 6zm-2.5 6.5l1.5-4.9 1.7 4.9h-3.2z"})),X=(0,o.createElement)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(l.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"})),Y=window.wp.privateApis,{lock:ee,unlock:te}=(0,Y.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/format-library"),{Tabs:ne}=te(d.privateApis),oe=[{name:"color",title:(0,r.__)("Text")},{name:"backgroundColor",title:(0,r.__)("Background")}];function re(e=""){return e.split(";").reduce(((e,t)=>{if(t){const[n,o]=t.split(":");"color"===n&&(e.color=o),"background-color"===n&&o!==se&&(e.backgroundColor=o)}return e}),{})}function ae(e="",t){return e.split(" ").reduce(((e,n)=>{if(n.startsWith("has-")&&n.endsWith("-color")){const o=n.replace(/^has-/,"").replace(/-color$/,""),r=(0,a.getColorObjectByAttributeValues)(t,o);e.color=r.color}return e}),{})}function le(e,t,o){const r=(0,n.getActiveFormat)(e,t);return r?{...re(r.attributes.style),...ae(r.attributes.class,o)}:{}}function ie({name:e,property:t,value:r,onChange:l}){const i=(0,R.useSelect)((e=>{var t;const{getSettings:n}=e(a.store);return null!==(t=n().colors)&&void 0!==t?t:[]}),[]),c=(0,v.useCallback)((o=>{l(function(e,t,o,r){const{color:l,backgroundColor:i}={...le(e,t,o),...r};if(!l&&!i)return(0,n.removeFormat)(e,t);const c=[],s=[],u={};if(i?c.push(["background-color",i].join(":")):c.push(["background-color",se].join(":")),l){const e=(0,a.getColorObjectByColorValue)(o,l);e?s.push((0,a.getColorClassName)("color",e.slug)):c.push(["color",l].join(":"))}return c.length&&(u.style=c.join(";")),s.length&&(u.class=s.join(" ")),(0,n.applyFormat)(e,{type:t,attributes:u})}(r,e,i,{[t]:o}))}),[i,l,t]),s=(0,v.useMemo)((()=>le(r,e,i)),[e,r,i]);return(0,o.createElement)(a.ColorPalette,{value:s[t],onChange:c})}function ce({name:e,value:t,onChange:r,onClose:a,contentRef:l,isActive:i}){const c=(0,n.useAnchor)({editableContentElement:l.current,settings:{...ge,isActive:i}});return(0,o.createElement)(d.Popover,{onClose:a,className:"format-library__inline-color-popover",anchor:c},(0,o.createElement)(ne,null,(0,o.createElement)(ne.TabList,null,oe.map((e=>(0,o.createElement)(ne.Tab,{tabId:e.name,key:e.name},e.title)))),oe.map((n=>(0,o.createElement)(ne.TabPanel,{tabId:n.name,focusable:!1,key:n.name},(0,o.createElement)(ie,{name:e,property:n.name,value:t,onChange:r}))))))}const se="rgba(0, 0, 0, 0)",ue="core/text-color",me=(0,r.__)("Highlight"),pe=[];function he(e,t){const{ownerDocument:n}=e,{defaultView:o}=n,r=o.getComputedStyle(e).getPropertyValue(t);return"background-color"===t&&r===se&&e.parentElement?he(e.parentElement,t):r}const ge={name:ue,title:me,tagName:"mark",className:"has-inline-color",attributes:{style:"style",class:"class"},edit:function({value:e,onChange:t,isActive:r,activeAttributes:l,contentRef:i}){const[c,s=pe]=(0,a.useSettings)("color.custom","color.palette"),[u,m]=(0,v.useState)(!1),p=(0,v.useCallback)((()=>m(!0)),[m]),h=(0,v.useCallback)((()=>m(!1)),[m]),g=(0,v.useMemo)((()=>function(e,{color:t,backgroundColor:n}){if(t||n)return{color:t||he(e,"color"),backgroundColor:n===se?he(e,"background-color"):n}}(i.current,le(e,ue,s))),[e,s]),d=s.length||!c;return d||r?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(a.RichTextToolbarButton,{className:"format-library-text-color-button",isActive:r,icon:(0,o.createElement)(q,{icon:Object.keys(l).length?J:X,style:g}),title:me,onClick:d?p:()=>t((0,n.removeFormat)(e,ue)),role:"menuitemcheckbox"}),u&&(0,o.createElement)(ce,{name:ue,onClose:h,activeAttributes:l,value:e,onChange:t,contentRef:i,isActive:r})):null}},de=(0,o.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(l.Path,{d:"M16.9 18.3l.8-1.2c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.1-.3-.4-.5-.6-.7-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.2 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3L15 19.4h4.3v-1.2h-2.4zM14.1 7.2h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"})),ve="core/subscript",be=(0,r.__)("Subscript"),fe={name:ve,title:be,tagName:"sub",className:null,edit:({isActive:e,value:t,onChange:r,onFocus:l})=>(0,o.createElement)(a.RichTextToolbarButton,{icon:de,title:be,onClick:function(){r((0,n.toggleFormat)(t,{type:ve,title:be})),l()},isActive:e,role:"menuitemcheckbox"})},we=(0,o.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(l.Path,{d:"M16.9 10.3l.8-1.3c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.2-.2-.4-.4-.7-.6-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.1 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3l-1.8 2.8h4.3v-1.2h-2.2zm-2.8-3.1h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"})),ye="core/superscript",Ee=(0,r.__)("Superscript"),_e={name:ye,title:Ee,tagName:"sup",className:null,edit:({isActive:e,value:t,onChange:r,onFocus:l})=>(0,o.createElement)(a.RichTextToolbarButton,{icon:we,title:Ee,onClick:function(){r((0,n.toggleFormat)(t,{type:ye,title:Ee})),l()},isActive:e,role:"menuitemcheckbox"})},ke=(0,o.createElement)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(l.Path,{d:"M8 12.5h8V11H8v1.5Z M19 6.5H5a2 2 0 0 0-2 2V15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a2 2 0 0 0-2-2ZM5 8h14a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V8.5A.5.5 0 0 1 5 8Z"})),Ce="core/keyboard",xe=(0,r.__)("Keyboard input"),Se={name:Ce,title:xe,tagName:"kbd",className:null,edit:({isActive:e,value:t,onChange:r,onFocus:l})=>(0,o.createElement)(a.RichTextToolbarButton,{icon:ke,title:xe,onClick:function(){r((0,n.toggleFormat)(t,{type:Ce,title:xe})),l()},isActive:e,role:"menuitemcheckbox"})},Te=(0,o.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(l.Path,{d:"M12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zM3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 8.75a1.5 1.5 0 01.167 2.99c-.465.052-.917.44-.917 1.01V14h1.5v-.845A3 3 0 109 10.25h1.5a1.5 1.5 0 011.5-1.5zM11.25 15v1.5h1.5V15h-1.5z"})),Ae="core/unknown",Fe=(0,r.__)("Clear Unknown Formatting"),Ne={name:Ae,title:Fe,tagName:"*",className:null,edit({isActive:e,value:t,onChange:r,onFocus:l}){const i=(0,n.slice)(t).formats.some((e=>e.some((e=>e.type===Ae))));return e||i?(0,o.createElement)(a.RichTextToolbarButton,{name:"unknown",icon:Te,title:Fe,onClick:function(){r((0,n.removeFormat)(t,Ae)),l()},isActive:!0}):null}},Re=(0,o.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(l.Path,{d:"M17.5 10h-1.7l-3.7 10.5h1.7l.9-2.6h3.9l.9 2.6h1.7L17.5 10zm-2.2 6.3 1.4-4 1.4 4h-2.8zm-4.8-3.8c1.6-1.8 2.9-3.6 3.7-5.7H16V5.2h-5.8V3H8.8v2.2H3v1.5h9.6c-.7 1.6-1.8 3.1-3.1 4.6C8.6 10.2 7.8 9 7.2 8H5.6c.6 1.4 1.7 2.9 2.9 4.4l-2.4 2.4c-.3.4-.7.8-1.1 1.2l1 1 1.2-1.2c.8-.8 1.6-1.5 2.3-2.3.8.9 1.7 1.7 2.5 2.5l.6-1.5c-.7-.6-1.4-1.3-2.1-2z"})),Ve="core/language",Pe=(0,r.__)("Language"),Me={name:Ve,tagName:"bdo",className:null,edit:function({isActive:e,value:t,onChange:r,contentRef:l}){const[i,c]=(0,v.useState)(!1),s=()=>{c((e=>!e))};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(a.RichTextToolbarButton,{icon:Re,label:Pe,title:Pe,onClick:()=>{e?r((0,n.removeFormat)(t,Ve)):s()},isActive:e,role:"menuitemcheckbox"}),i&&(0,o.createElement)(Be,{value:t,onChange:r,onClose:s,contentRef:l}))},title:Pe};function Be({value:e,contentRef:t,onChange:a,onClose:l}){const i=(0,n.useAnchor)({editableContentElement:t.current,settings:Me}),[c,s]=(0,v.useState)(""),[u,m]=(0,v.useState)("ltr");return(0,o.createElement)(d.Popover,{className:"block-editor-format-toolbar__language-popover",anchor:i,onClose:l},(0,o.createElement)("form",{className:"block-editor-format-toolbar__language-container-content",onSubmit:t=>{t.preventDefault(),a((0,n.applyFormat)(e,{type:Ve,attributes:{lang:c,dir:u}})),l()}},(0,o.createElement)(d.TextControl,{label:Pe,value:c,onChange:e=>s(e),help:(0,r.__)('A valid language attribute, like "en" or "fr".')}),(0,o.createElement)(d.SelectControl,{label:(0,r.__)("Text direction"),value:u,options:[{label:(0,r.__)("Left to right"),value:"ltr"},{label:(0,r.__)("Right to left"),value:"rtl"}],onChange:e=>m(e)}),(0,o.createElement)(d.__experimentalHStack,{alignment:"right"},(0,o.createElement)(d.Button,{variant:"primary",type:"submit",text:(0,r.__)("Apply")}))))}[u,g,E,S,j,Z,Q,ge,fe,_e,Se,Ne,Me].forEach((({name:e,...t})=>(0,n.registerFormatType)(e,t))),(window.wp=window.wp||{}).formatLibrary=t})(); \ No newline at end of file