PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.5
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.5
16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 All 506 releases
← All changes | _inc/build/email-design-editor.js +6 -6 16.2 → 16.3-a.5 View file →
@@ -1,5 +1,5 @@
1 -(()=>{"use strict";var e={3764(e){var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===o}(e)}(e)};var o="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((o=e,Array.isArray(o)?[]:{}),e,t):e;var o}function r(e,t,o){return e.concat(t).map(function(e){return n(e,o)})}function s(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}(e))}function a(e,t){try{return t in e}catch(e){return!1}}function i(e,t,o){var r={};return o.isMergeableObject(e)&&s(e).forEach(function(t){r[t]=n(e[t],o)}),s(t).forEach(function(s){(function(e,t){return a(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,s)||(a(e,s)&&o.isMergeableObject(t[s])?r[s]=function(e,t){if(!t.customMerge)return l;var o=t.customMerge(e);return"function"==typeof o?o:l}(s,o)(e[s],t[s],o):r[s]=n(t[s],o))}),r}function l(e,o,s){(s=s||{}).arrayMerge=s.arrayMerge||r,s.isMergeableObject=s.isMergeableObject||t,s.cloneUnlessOtherwiseSpecified=n;var a=Array.isArray(o);return a===Array.isArray(e)?a?s.arrayMerge(e,o,s):i(e,o,s):n(o,s)}l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,o){return l(e,o,t)},{})};var c=l;e.exports=c},8686(e,t,o){o.d(t,{M:()=>i});var n=o(790),r=o(6087),s=o(7847);const a=e=>t=>{const{setAttributes:o}=t,s=(0,r.useCallback)(e=>{e?.url&&e.url?.startsWith("http://[")&&(e.url=e.url.replace("http://[","[")),o(e)},[o]);return(0,n.jsx)(e,{...t,setAttributes:s})};function i(){(0,s.HY)("editor.BlockEdit","woocommerce-email-editor/filter-set-url-attribute",a)}},7789(e,t,o){o.d(t,{l:()=>r});var n=o(8992);function r(){(0,n.G)("core/buttons",e=>({...e,supports:{...e.supports??{},layout:!1,__experimentalEmailFlexLayout:!0}}))}},1135(e,t,o){o.d(t,{I:()=>c,R:()=>u});var n=o(790),r=o(4715),s=o(9491),a=o(8992),i=o(7847);const l=(0,s.createHigherOrderComponent)(e=>function(t){if("core/columns"!==t.name)return(0,n.jsx)(e,{...t});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e,{...t}),(0,n.jsx)(r.InspectorControls,{children:(0,n.jsx)("style",{children:"\n .components-panel__body .components-toggle-control .components-form-toggle { opacity: 0.3; }\n .components-panel__body .components-toggle-control .components-form-toggle__input { pointer-events: none; }\n .components-panel__body .components-toggle-control label { pointer-events: none; }\n "})})]})},"columnsEditCallback");function c(){(0,i.HY)("editor.BlockEdit","woocommerce-email-editor/deactivate-stack-on-mobile",l)}const d=["core/column","core/columns"];function u(){d.forEach(e=>{(0,a.G)(e,e=>({...e,supports:{...e.supports||{},layout:!1,background:{...e.support?.background||{},backgroundImage:!0}}}))})}},8757(e,t,o){o.d(t,{H:()=>g});var n=o(790),r=o(6427),s=o(9491),a=o(7143),i=o(6087),l=o(7723),c=o(8992),d=o(7847);const u={youtube:["youtube.com","youtu.be"],videopress:["videopress.com","video.wordpress.com"],vimeo:["vimeo.com","player.vimeo.com"],tiktok:["tiktok.com"],dailymotion:["dailymotion.com","dai.ly"]};const p=(0,s.createHigherOrderComponent)(e=>function(t){const o="core/embed"===t.name,{responsive:s}=t.attributes,{setAttributes:c}=t,d=(0,a.useDispatch)("core/block-editor");if((0,i.useEffect)(()=>{o&&s&&(d.__unstableMarkNextChangeAsNotPersistent(),c({responsive:!1}))},[o,s,c,d]),!o)return(0,n.jsx)(e,{...t});const{url:p,type:m}=t.attributes;return!p||"wp-embed"===m||function(e){let t="";try{t=new URL(e).hostname}catch{return!1}return Object.values(u).some(e=>e.some(e=>t===e||t.endsWith(`.${e}`)))}(p)?(0,n.jsx)(e,{...t}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.Notice,{status:"warning",isDismissible:!1,children:(0,l.__)("This embed is not supported in emails. It will be sent as a link.","jetpack")}),(0,n.jsx)(e,{...t})]})},"withEmailEmbedAdjustments"),m=[...Object.keys(u),"wordpress"];function g(){(0,c.G)("core/embed",e=>({...e,variations:(e.variations||[]).filter(e=>m.includes(e.name)).map(e=>{const{responsive:t,...o}=e.attributes||{};return{...e,attributes:o}})})),(0,d.HY)("editor.BlockEdit","woocommerce-email-editor/embed-adjustments",p)}},306(e,t,o){o.d(t,{R:()=>f});var n=o(790),r=o(3022),s=o(9491),a=o(7143),i=o(4715),l=o(7847),c=o(3598);const d=["core/column","core/columns"],u=["core/post-content","woocommerce/email-content"];function p(e){const t=e=>null==e||function(e){return null!=e&&0===parseFloat(String(e))}(e)?null:(0,c.DJ)(String(e));if(!e)return{left:null,right:null};if("string"==typeof e){const o=t(e);return{left:o,right:o}}return{left:t(e.left),right:t(e.right)}}function m({block:e,props:t}){const o="full"===t.attributes?.align,s=(l=t.clientId,c=o,(0,a.useSelect)(e=>{if(!c)return{left:null,right:null};const{getBlockParents:t,getBlockName:o,getBlockAttributes:n}=e(i.store),r=t(l);let s=!1;for(let e=r.length-1;e>=0;e--){const t=r[e],a=o(t);if(d.includes(a))return!1;if(u.includes(a)){s=!0;continue}const i=p(n(t)?.style?.spacing?.padding);if(i.left||i.right)return i;if(!s)return{left:null,right:null}}return{left:null,right:null}},[l,c]));var l,c;if(!o||!1===s)return(0,n.jsx)(e,{...t});const m={...t.wrapperProps?.style||{}};return s.left&&(m.marginLeft=`calc(-1 * ${s.left})`),s.right&&(m.marginRight=`calc(-1 * ${s.right})`),(0,n.jsx)(e,{...t,className:(0,r.A)(t.className,"is-email-full-width"),wrapperProps:{...t.wrapperProps,style:m}})}const g=(0,s.createHigherOrderComponent)(e=>function(t){return(0,n.jsx)(m,{block:e,props:t})},"withFullWidthClassName");function f(){(0,l.HY)("editor.BlockListBlock","woocommerce-email-editor/full-width-blocks",g)}},5594(e,t,o){o.d(t,{G:()=>d,J:()=>p});var n=o(8490),r=o.n(n),s=o(4997),a=o(7143),i=o(8992),l=o(8845);const c=["core/social-links"];function d(){(0,s.getBlockTypes)().forEach(e=>{e.supports?.shadow&&(0,i.G)(e.name,e=>({...e,supports:{...e.supports,shadow:!1}}))})}function u(){(0,s.getBlockTypes)().forEach(e=>{const t=e.name;if(c.includes(t))return;const o=(0,a.select)("core/blocks").getBlockStyles(t);Array.isArray(o)&&0!==o?.length&&o.forEach(e=>{(0,l.oj)(t,e.name)})})}function p(){r()(u)}},1007(e,t,o){o.d(t,{u:()=>r});var n=o(8992);function r(){(0,n.G)("core/group",e=>{const t=e.variations??[];return{...e,variations:t.filter(e=>"group"===e.name),supports:{...e.supports||{},layout:!1}}})}},9289(e,t,o){o.d(t,{G:()=>c,y:()=>d});var n=o(790),r=o(4715),s=o(9491),a=o(8992),i=o(7847);const l=(0,s.createHigherOrderComponent)(e=>function(t){if("core/image"!==t.name)return(0,n.jsx)(e,{...t});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e,{...t}),(0,n.jsx)(r.InspectorControls,{children:(0,n.jsx)("style",{children:"\n .components-tools-panel .components-toggle-control { display: none; }\n "})})]})},"imageEditCallback");function c(){(0,a.G)("core/image",e=>({...e,supports:{...e.supports||{},filter:{...e.supports?.filter||{},duetone:!1}}}))}function d(){(0,i.HY)("editor.BlockEdit","woocommerce-email-editor/hide-expand-on-click",l)}},7960(e,t,o){o.d(t,{l:()=>l});var n=o(790),r=o(7723),s=o(4715),a=o(8992);function i({layoutClassNames:e}){const t=(0,s.useBlockProps)({className:e});return(0,n.jsxs)("div",{...t,children:[(0,n.jsx)("p",{children:(0,r.__)("This is the Content block.","jetpack")}),(0,n.jsx)("p",{children:(0,r.__)("It will display all the blocks in the email content, which might be only simple text paragraphs. You can enrich your message with images, incorporate data through tables, explore different layout designs with columns, or use any other block type.","jetpack")})]})}function l(){(0,a.G)("core/post-content",e=>{return{...e,edit:(t=e.edit,function(e){const{postId:o,postType:r}=e.context,{__unstableLayoutClassNames:s}=e;return o&&r?(0,n.jsx)(t,{...e}):(0,n.jsx)(i,{layoutClassNames:s})})};var t})}},6736(e,t,o){o.d(t,{I:()=>r});var n=o(8992);function r(){(0,n.G)("core/quote",e=>({...e,styles:[],supports:{...e.supports,align:[]}}))}},5658(e,t,o){o.d(t,{Ug:()=>b,iO:()=>k,qQ:()=>v});var n=o(790),r=o(876),s=o(7723),a=o(4715),i=o(6427),l=o(7143),c=o(6087),d=o(9491),u=o(8389),p=o(7845),m=o(3124),g=o(2553),f=o(646),h=o(6816),y=o(444),_=o(7847);function b(){["core/image","core/code","core/language"].forEach(e=>{(0,y.le)(e)})}function x({contentRef:e}){const[t,o]=(0,c.useState)(!1),d=(0,l.useSelect)(e=>e("core/block-editor").getSelectedBlockClientId()),{updateBlockAttributes:m}=(0,l.useDispatch)("core/block-editor"),y=(0,l.useSelect)(e=>e("core/block-editor").getBlockAttributes(d)),_="text"in y?"text":"content",b=y?.[_]?.originalHTML||y?.[_]||"",x=(0,c.useCallback)((t,o)=>{let{start:n,end:s}=(0,u.E)(e,b),a="";if(o){let e=(0,r.create)({html:b});e=(0,r.insert)(e,o,n,s),s=n+o.length,e=(0,r.applyFormat)(e,{type:"woocommerce-email-editor/link-shortcode",attributes:{"data-link-href":t,contenteditable:"false",style:"text-decoration: underline;"}},n,s),a=(0,r.toHTMLString)({value:e})}else{let e=(0,r.create)({html:b});e=(0,r.insert)(e,(0,r.create)({html:`\x3c!--${t}--\x3e&nbsp;`}),n,s),a=(0,r.toHTMLString)({value:e})}m(d,{[_]:a})},[b,_,e,d,m]);return(0,n.jsx)(a.BlockControls,{children:(0,n.jsxs)(i.ToolbarGroup,{children:[(0,n.jsx)(i.ToolbarButton,{icon:"shortcode",title:(0,s.__)("Personalization Tags","jetpack"),onClick:()=>{o(!0),(0,h.yM)("block_controls_personalization_tags_button_clicked")}}),(0,n.jsx)(g.t,{contentRef:e,onUpdate:(e,t)=>{const o=b.replace(`\x3c!--[${e}]--\x3e`,`\x3c!--[${t}]--\x3e`);m(d,{[_]:o})}}),(0,n.jsx)(f.N,{contentRef:e,onUpdate:(e,t,o)=>{const n=e.getAttribute("data-link-href").replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`<a([^>]*?)data-link-href="${n}"([^>]*?)>${e.textContent}</a>`,"gi"),s=b.replace(r,(e,n,r)=>`<a${n}data-link-href="${t}"${r}>${o}</a>`);m(d,{content:s})}}),(0,n.jsx)(p.x,{isOpened:t,onInsert:(e,t)=>{x(e,t),o(!1)},closeCallback:()=>o(!1),canInsertLink:!0,openedBy:"block-controls"})]})})}function v(){(0,y.gG)("woocommerce-email-editor/shortcode",{name:"woocommerce-email-editor/shortcode",title:(0,s.__)("Personalization Tags","jetpack"),className:"woocommerce-email-editor-personalization-tags",tagName:"span",attributes:{},interactive:!1,edit:x}),(0,y.gG)("woocommerce-email-editor/link-shortcode",{name:"woocommerce-email-editor/link-shortcode",title:(0,s.__)("Personalization Tags Link","jetpack"),className:"woocommerce-email-editor-personalization-tags-link",tagName:"a",attributes:{"data-link-href":"data-link-href",contenteditable:"contenteditable",style:"style"},interactive:!0,edit:null})}const w=(0,d.createHigherOrderComponent)(e=>t=>{const{attributes:o,setAttributes:r,name:s}=t,{content:a}=o,i=(0,l.useSelect)(e=>e(m.H).getPersonalizationTagsList(),[]),d=(0,c.useCallback)(()=>a?(0,u.D)(a,i):"",[a,i]),p=(0,c.useCallback)(e=>{if(void 0!==e.content){const t=(0,u.D)(e.content,i);r({...e,content:t})}else r(e)},[i,r]);return"core/paragraph"===s||"core/heading"===s||"core/list-item"===s?(0,n.jsx)(e,{...t,attributes:{...o,content:d()},setAttributes:p}):(0,n.jsx)(e,{...t})},"personalizationTagsLiveContentUpdate");function k(){(0,_.HY)("editor.BlockEdit","woocommerce-email-editor/with-live-content-update",w)}},8485(e,t,o){o.d(t,{U:()=>r});var n=o(8848);function r(){(0,n.z)("core/site-logo",{name:"site-logo-default",title:"Site Logo",attributes:{align:"center",width:120},isDefault:!0})}},5437(e,t,o){o.d(t,{_:()=>u});var n=o(790),r=o(4715),s=o(7723),a=o(8992),i=o(8848),l=o(7847);const c=["behance","bluesky","chain","discord","facebook","feed","github","gravatar","instagram","linkedin","mail","mastodon","medium","patreon","pinterest","reddit","spotify","telegram","threads","tiktok","tumblr","twitch","twitter","vimeo","wordpress","whatsapp","x","youtube"];const d=e=>t=>{if("core/social-links"!==t.name)return(0,n.jsx)(e,{...t});const o=`\n\t\t.block-editor-tools-panel-color-gradient-settings__item:has([title="${(0,s.__)("Icon color","jetpack")}"]) {\n\t\t\tdisplay: none !important;\n\t\t}\n\t\t.block-editor-tools-panel-color-gradient-settings__item:nth-child(2 of .block-editor-tools-panel-color-gradient-settings__item){\n\t\t\tborder-top:1px solid #ddd;\n\t\t\tborder-top-left-radius:2px;\n\t\t\tborder-top-right-radius:2px;\n\t\t}\n\t\t`;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e,{...t}),(0,n.jsx)(r.InspectorControls,{group:"color",children:(0,n.jsx)("style",{children:o})})]})};function u(){(0,a.G)("core/social-link",e=>({...e,variations:(e.variations||[]).filter(e=>c.includes(e.name)),supports:{...e.supports,layout:!1}})),(0,i.z)("core/social-links",{name:"social-links-default",title:"Social Icons",attributes:{openInNewTab:!0,showLabels:!1,align:"center",className:"is-style-logos-only"},isDefault:!0,innerBlocks:[{name:"core/social-link",attributes:{service:"wordpress",url:"https://wordpress.org"}},{name:"core/social-link",attributes:{service:"facebook",url:"https://www.facebook.com/WordPress/"}},{name:"core/social-link",attributes:{service:"x",url:"https://x.com/WordPress"}}]}),(0,l.HY)("editor.BlockEdit","woocommerce-email-editor/disable-social-links-icon-color",d)}},2318(e,t,o){o.d(t,{X:()=>b});var n=o(9363),r=o(4997),s=o(1135),a=o(7960),i=o(1007),l=o(9289),c=o(5658),d=o(7789),u=o(8757),p=o(5594),m=o(6736),g=o(8686),f=o(5437),h=o(8485),y=o(306),_=o(2642);function b(){(0,r.getBlockType)("core/paragraph")||(0,n.registerCoreBlocks)(),(0,g.M)(),(0,s.I)(),(0,l.y)(),(0,l.G)(),(0,c.Ug)(),(0,s.R)(),(0,i.u)(),(0,d.l)(),(0,u.H)(),(0,a.l)(),(0,m.I)(),(0,c.qQ)(),(0,c.iO)(),(0,p.G)(),(0,f._)(),(0,h.U)(),(0,y.R)(),(0,_.D)(),(0,p.J)()}},9791(e,t,o){o.d(t,{G:()=>r});var n=o(4997);function r(){try{return(0,n.getBlockTypes)().filter(e=>!0===e.supports?.email).map(e=>e.name)}catch(e){return console.error("Failed to get allowed block names:",e),[]}}},2642(e,t,o){o.d(t,{D:()=>r});var n=o(8992);function r(){(0,n.G)("woocommerce/product-image",e=>({...e,supports:{...e.supports||{},align:["full"]}}))}},5183(e,t,o){o.d(t,{w:()=>P});var n=o(790),r=o(7143),s=o(6087),a=o(6427),i=o(3582),l=o(2165),c=o(2279),d=o(3656),u=o(3124),p=o(3707),m=o(1847),g=o(1128),f=o(7709),h=o(1513),y=o(639),_=o(7680),b=o(8287),x=o(5209),v=o(3364),w=o(4291),k=o(7159),j=o(3373),S=o(2570),E=o(4095),C=o(6816);const T=d.AutosaveMonitor,N=d.EditorKeyboardShortcutsRegister;function P({postId:e,postType:t,settings:o,contentRef:P,customSavePanel:M,customSaveButton:B}){const{currentPost:A,onNavigateToEntityRecord:$,onNavigateToPreviousEntityRecord:I}=(0,p.c)(e,t,"post-only"),{post:z,template:L}=(0,r.useSelect)(e=>{const{getEditedEntityRecord:t}=e(i.store),o=t("postType",A.postType,A.postId);if(!o||"boolean"==typeof o)return{post:null,template:null};const n=o;if("wp_template"===A.postType)return{post:n,template:null};const{getEditedPostTemplate:r}=e(u.H);return{post:n,template:r(n.template)}},[A.postType,A.postId]),{isFullscreenEnabled:R,allCommands:H}=(0,r.useSelect)(e=>({isFullscreenEnabled:e(u.H).isFeatureActive("fullscreenMode"),allCommands:e(l.store).getCommands()}),[]),{isFullScreenForced:F,displaySendEmailButton:V,disableSnackbarNotices:O}=o,{removeEditorPanel:D}=(0,r.useDispatch)(d.store);(0,s.useEffect)(()=>{D("post-status")},[D]);const[G]=(0,g.b)(),W=(0,s.useMemo)(()=>({...o,onNavigateToEntityRecord:$,onNavigateToPreviousEntityRecord:I,defaultRenderingMode:"wp_template"===A.postType?"post-only":"template-locked",supportsTemplateMode:!0,styles:G}),[o,$,I,A.postType,G]);if(!(z&&("wp_template"===A.postType||z.template===L?.slug||!z.template&&L)))return(0,n.jsx)("div",{className:"spinner-container",children:(0,n.jsx)(a.ProgressBar,{})});const q=H.every(({name:e})=>e.includes("woocommerce"));return(0,C.xW)("editor_layout_loaded"),(0,n.jsx)(a.SlotFillProvider,{children:(0,n.jsxs)(d.ErrorBoundary,{canCopyContent:!0,children:[q&&(0,n.jsx)(l.CommandMenu,{}),(0,n.jsxs)(m.KE,{postId:A.postId,postType:A.postType,settings:W,templateId:L&&L.id,contentRef:P,styles:G,customSavePanel:M,customSaveButton:"wp_template"===A.postType?void 0:B,children:[(0,n.jsx)(T,{}),(0,n.jsx)(d.LocalAutosaveMonitor,{}),(0,n.jsx)(d.UnsavedChangesWarning,{}),(0,n.jsx)(N,{}),(0,n.jsx)(d.PostLockedModal,{}),(0,n.jsx)(h.x,{}),(0,n.jsx)(E.O,{}),(0,n.jsx)(y.r,{}),(0,n.jsx)(_.h,{}),(0,n.jsx)(f.p,{}),(0,n.jsx)(m.fA,{isActive:F||R}),(F||R)&&(0,n.jsx)(S.R,{}),!F&&(0,n.jsx)(b.n,{}),"wp_template"===A.postType?(0,n.jsx)(v.c,{}):(0,n.jsx)(x.O,{}),V&&(0,n.jsx)(w.L,{}),(0,n.jsx)(k.D,{disableSnackbarNotices:O}),(0,n.jsx)(j.x,{}),(0,n.jsx)(c.PluginArea,{scope:"woocommerce-email-editor"})]})]})})}},2570(e,t,o){o.d(t,{R:()=>k});var n=o(790),r=o(6427),s=o(6087),a=o(7723),i=o(3109),l=o(2344),c=o(9558),d=o(8329),u=o(6168),p=o(2619),m=o(7143),g=o(1847),f=o(6816),h=o(3124);const y={edit:{opacity:0,scale:.2},hover:{opacity:1,scale:1,clipPath:"inset( 22% round 2px )"}},_={edit:{clipPath:"inset(0% round 0px)"},hover:{clipPath:"inset( 22% round 2px )"},tap:{clipPath:"inset(0% round 0px)"}};function b(){const{urls:e}=(0,m.useSelect)(e=>({urls:e(h.H).getUrls()}),[]);return()=>{(0,f.yM)("header_close_button_clicked");const t=()=>{if(e.back)try{const t=new URL(e.back,window.location.href);["http:","https:"].includes(t.protocol)&&(window.location.href=t.href)}catch{}},o=(0,p.applyFilters)("woocommerce_email_editor_close_action_callback",t);("function"==typeof o?o:t)()}}const x=()=>{const e=b();return(0,n.jsx)(r.Button,{size:"compact",icon:(0,a.isRTL)()?d.A:c.A,label:(0,a.__)("Close editor","jetpack"),showTooltip:!0,tooltipPosition:"middle right",onClick:e})},v=()=>{const e=b();return(0,n.jsxs)(r.__unstableMotion.div,{className:"woocommerce-email-editor__view-mode-toggle",transition:{duration:.2},animate:"edit",initial:"edit",whileHover:"hover",whileTap:"tap",children:[(0,n.jsx)(r.Button,{label:(0,a.__)("Close editor","jetpack"),showTooltip:!0,tooltipPosition:"middle right",onClick:e,children:(0,n.jsx)(r.__unstableMotion.div,{variants:_,children:(0,n.jsx)("div",{className:"woocommerce-email-editor__view-mode-toggle-icon",children:(0,n.jsx)(i.A,{className:"woocommerce-email-editor-icon__icon",icon:u.A,size:48})})})}),(0,n.jsx)(r.__unstableMotion.div,{className:"woocommerce-email-editor-icon",variants:y,children:(0,n.jsx)(i.A,{icon:l.A})})]})},w=()=>{const e=(0,s.useRef)(null),[t,o]=(0,s.useState)(null);return(0,s.useLayoutEffect)(()=>{const t=e.current?.closest(".editor-header__back-button"),n=t?.getBoundingClientRect().width;o(void 0!==n&&n<=48)},[]),null===t?(0,n.jsx)("div",{ref:e}):t?(0,n.jsx)(x,{}):(0,n.jsx)(v,{})},k=()=>{const e=(0,p.applyFilters)("woocommerce_email_editor_close_content",w);return(0,n.jsx)(g.oq,{children:({length:t})=>t<=1&&(0,n.jsx)(e,{})})}},2614(e,t,o){o.d(t,{J:()=>u});var n=o(790),r=o(7723),s=o(6427),a=o(2619),i=o(7143),l=o(3656),c=o(3124),d=o(6816);function u(){const{isDirty:e}=(0,l.useEntitiesSavedStatesIsDirty)(),{hasEmptyContent:t,isEmailSent:o,urls:u}=(0,i.useSelect)(e=>({hasEmptyContent:e(c.H).hasEmptyContent(),isEmailSent:e(c.H).isEmailSent(),urls:e(c.H).getUrls()}),[]);function p(){u.send&&(window.location.href=u.send)}const m=t||o||e,g=(0,a.applyFilters)("woocommerce_email_editor_send_button_disabled",m,{hasEmptyContent:t,isEmailSent:o,isDirty:e}),f="boolean"==typeof g?g:m,h=(0,a.applyFilters)("woocommerce_email_editor_send_button_label",(0,r.__)("Send","jetpack"));return(0,n.jsx)(s.Button,{variant:"primary",size:"compact",onClick:()=>{(0,d.yM)("header_send_button_clicked");(0,a.applyFilters)("woocommerce_email_editor_send_action_callback",p)()},disabled:f,"data-automation-id":"email_editor_send_button",children:h})}},3242(e,t,o){o.d(t,{A:()=>y});var n=o(790),r=o(3582),s=o(7723),a=o(692),i=o(7839),l=o(6087),c=o(7143),d=o(6427),u=o(8537),p=o(2619),m=o(3124),g=o(6816);function f(e){return"string"==typeof e.title?(0,u.decodeEntities)(e.title):e.title&&"rendered"in e.title?(0,u.decodeEntities)(e.title.rendered):e.title&&"raw"in e.title?(0,u.decodeEntities)(e.title.raw):""}function h(e,t){return t?e.length>1?(0,s.sprintf)(
1 +(()=>{"use strict";var e={3764(e){var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===o}(e)}(e)};var o="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((o=e,Array.isArray(o)?[]:{}),e,t):e;var o}function r(e,t,o){return e.concat(t).map(function(e){return n(e,o)})}function s(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}(e))}function a(e,t){try{return t in e}catch(e){return!1}}function i(e,t,o){var r={};return o.isMergeableObject(e)&&s(e).forEach(function(t){r[t]=n(e[t],o)}),s(t).forEach(function(s){(function(e,t){return a(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,s)||(a(e,s)&&o.isMergeableObject(t[s])?r[s]=function(e,t){if(!t.customMerge)return l;var o=t.customMerge(e);return"function"==typeof o?o:l}(s,o)(e[s],t[s],o):r[s]=n(t[s],o))}),r}function l(e,o,s){(s=s||{}).arrayMerge=s.arrayMerge||r,s.isMergeableObject=s.isMergeableObject||t,s.cloneUnlessOtherwiseSpecified=n;var a=Array.isArray(o);return a===Array.isArray(e)?a?s.arrayMerge(e,o,s):i(e,o,s):n(o,s)}l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,o){return l(e,o,t)},{})};var c=l;e.exports=c},6125(e,t,o){o.d(t,{Q:()=>s});var n=o(2619),r=o(7723);const _x=r._x,s="null:email-styles-sidebar",a=new Set(["Text","Headings","Layout"]);let i=!0;Promise.resolve().then(()=>{i=!1});let l=null;(0,n.addFilter)("i18n.gettext_jetpack","jetpack/email-design-labels",function(e,t){const o=(l||(l=new Map([["Text",_x("Default text","email design styles","jetpack")],["Manage the fonts and typography used on text.",_x("The default for the whole email: post body, byline and footer. Headings and buttons inherit anything you don’t set for them.","email design styles","jetpack")],["Manage the fonts and typography used on links.",_x("Links inside your post. Footer links take their color from Default text.","email design styles","jetpack")],["Headings",_x("Titles & headings","email design styles","jetpack")],["Manage the fonts and typography used on headings.",_x("H1 styles your post title, H2 your site title and post headings, and H3–H6 the headings inside your post. The site title follows H2’s font only, not its size. All headings applies wherever you haven’t styled a level individually.","email design styles","jetpack")],["Manage the fonts and typography used on buttons.",_x("Buttons in your post. The Comment and Like buttons follow the font here, but nothing else. A button that sets its own style in the post keeps it.","email design styles","jetpack")],["Layout",_x("Spacing","email design styles","jetpack")],["Manage the background color of the email.",_x("The color behind the whole email, both the page and the content card.","email design styles","jetpack")]])),l);return o.has(t)&&(!a.has(t)||i||document.getElementById(s))?o.get(t):e})},8686(e,t,o){o.d(t,{M:()=>i});var n=o(790),r=o(6087),s=o(7847);const a=e=>t=>{const{setAttributes:o}=t,s=(0,r.useCallback)(e=>{e?.url&&e.url?.startsWith("http://[")&&(e.url=e.url.replace("http://[","[")),o(e)},[o]);return(0,n.jsx)(e,{...t,setAttributes:s})};function i(){(0,s.HY)("editor.BlockEdit","woocommerce-email-editor/filter-set-url-attribute",a)}},7789(e,t,o){o.d(t,{l:()=>r});var n=o(8992);function r(){(0,n.G)("core/buttons",e=>({...e,supports:{...e.supports??{},layout:!1,__experimentalEmailFlexLayout:!0}}))}},1135(e,t,o){o.d(t,{I:()=>c,R:()=>u});var n=o(790),r=o(4715),s=o(9491),a=o(8992),i=o(7847);const l=(0,s.createHigherOrderComponent)(e=>function(t){if("core/columns"!==t.name)return(0,n.jsx)(e,{...t});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e,{...t}),(0,n.jsx)(r.InspectorControls,{children:(0,n.jsx)("style",{children:"\n .components-panel__body .components-toggle-control .components-form-toggle { opacity: 0.3; }\n .components-panel__body .components-toggle-control .components-form-toggle__input { pointer-events: none; }\n .components-panel__body .components-toggle-control label { pointer-events: none; }\n "})})]})},"columnsEditCallback");function c(){(0,i.HY)("editor.BlockEdit","woocommerce-email-editor/deactivate-stack-on-mobile",l)}const d=["core/column","core/columns"];function u(){d.forEach(e=>{(0,a.G)(e,e=>({...e,supports:{...e.supports||{},layout:!1,background:{...e.support?.background||{},backgroundImage:!0}}}))})}},8757(e,t,o){o.d(t,{H:()=>g});var n=o(790),r=o(6427),s=o(9491),a=o(7143),i=o(6087),l=o(7723),c=o(8992),d=o(7847);const u={youtube:["youtube.com","youtu.be"],videopress:["videopress.com","video.wordpress.com"],vimeo:["vimeo.com","player.vimeo.com"],tiktok:["tiktok.com"],dailymotion:["dailymotion.com","dai.ly"]};const p=(0,s.createHigherOrderComponent)(e=>function(t){const o="core/embed"===t.name,{responsive:s}=t.attributes,{setAttributes:c}=t,d=(0,a.useDispatch)("core/block-editor");if((0,i.useEffect)(()=>{o&&s&&(d.__unstableMarkNextChangeAsNotPersistent(),c({responsive:!1}))},[o,s,c,d]),!o)return(0,n.jsx)(e,{...t});const{url:p,type:m}=t.attributes;return!p||"wp-embed"===m||function(e){let t="";try{t=new URL(e).hostname}catch{return!1}return Object.values(u).some(e=>e.some(e=>t===e||t.endsWith(`.${e}`)))}(p)?(0,n.jsx)(e,{...t}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.Notice,{status:"warning",isDismissible:!1,children:(0,l.__)("This embed is not supported in emails. It will be sent as a link.","jetpack")}),(0,n.jsx)(e,{...t})]})},"withEmailEmbedAdjustments"),m=[...Object.keys(u),"wordpress"];function g(){(0,c.G)("core/embed",e=>({...e,variations:(e.variations||[]).filter(e=>m.includes(e.name)).map(e=>{const{responsive:t,...o}=e.attributes||{};return{...e,attributes:o}})})),(0,d.HY)("editor.BlockEdit","woocommerce-email-editor/embed-adjustments",p)}},306(e,t,o){o.d(t,{R:()=>f});var n=o(790),r=o(3022),s=o(9491),a=o(7143),i=o(4715),l=o(7847),c=o(3598);const d=["core/column","core/columns"],u=["core/post-content","woocommerce/email-content"];function p(e){const t=e=>null==e||function(e){return null!=e&&0===parseFloat(String(e))}(e)?null:(0,c.DJ)(String(e));if(!e)return{left:null,right:null};if("string"==typeof e){const o=t(e);return{left:o,right:o}}return{left:t(e.left),right:t(e.right)}}function m({block:e,props:t}){const o="full"===t.attributes?.align,s=(l=t.clientId,c=o,(0,a.useSelect)(e=>{if(!c)return{left:null,right:null};const{getBlockParents:t,getBlockName:o,getBlockAttributes:n}=e(i.store),r=t(l);let s=!1;for(let e=r.length-1;e>=0;e--){const t=r[e],a=o(t);if(d.includes(a))return!1;if(u.includes(a)){s=!0;continue}const i=p(n(t)?.style?.spacing?.padding);if(i.left||i.right)return i;if(!s)return{left:null,right:null}}return{left:null,right:null}},[l,c]));var l,c;if(!o||!1===s)return(0,n.jsx)(e,{...t});const m={...t.wrapperProps?.style||{}};return s.left&&(m.marginLeft=`calc(-1 * ${s.left})`),s.right&&(m.marginRight=`calc(-1 * ${s.right})`),(0,n.jsx)(e,{...t,className:(0,r.A)(t.className,"is-email-full-width"),wrapperProps:{...t.wrapperProps,style:m}})}const g=(0,s.createHigherOrderComponent)(e=>function(t){return(0,n.jsx)(m,{block:e,props:t})},"withFullWidthClassName");function f(){(0,l.HY)("editor.BlockListBlock","woocommerce-email-editor/full-width-blocks",g)}},5594(e,t,o){o.d(t,{G:()=>d,J:()=>p});var n=o(8490),r=o.n(n),s=o(4997),a=o(7143),i=o(8992),l=o(8845);const c=["core/social-links"];function d(){(0,s.getBlockTypes)().forEach(e=>{e.supports?.shadow&&(0,i.G)(e.name,e=>({...e,supports:{...e.supports,shadow:!1}}))})}function u(){(0,s.getBlockTypes)().forEach(e=>{const t=e.name;if(c.includes(t))return;const o=(0,a.select)("core/blocks").getBlockStyles(t);Array.isArray(o)&&0!==o?.length&&o.forEach(e=>{(0,l.oj)(t,e.name)})})}function p(){r()(u)}},1007(e,t,o){o.d(t,{u:()=>r});var n=o(8992);function r(){(0,n.G)("core/group",e=>{const t=e.variations??[];return{...e,variations:t.filter(e=>"group"===e.name),supports:{...e.supports||{},layout:!1}}})}},9289(e,t,o){o.d(t,{G:()=>c,y:()=>d});var n=o(790),r=o(4715),s=o(9491),a=o(8992),i=o(7847);const l=(0,s.createHigherOrderComponent)(e=>function(t){if("core/image"!==t.name)return(0,n.jsx)(e,{...t});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e,{...t}),(0,n.jsx)(r.InspectorControls,{children:(0,n.jsx)("style",{children:"\n .components-tools-panel .components-toggle-control { display: none; }\n "})})]})},"imageEditCallback");function c(){(0,a.G)("core/image",e=>({...e,supports:{...e.supports||{},filter:{...e.supports?.filter||{},duetone:!1}}}))}function d(){(0,i.HY)("editor.BlockEdit","woocommerce-email-editor/hide-expand-on-click",l)}},7960(e,t,o){o.d(t,{l:()=>l});var n=o(790),r=o(7723),s=o(4715),a=o(8992);function i({layoutClassNames:e}){const t=(0,s.useBlockProps)({className:e});return(0,n.jsxs)("div",{...t,children:[(0,n.jsx)("p",{children:(0,r.__)("This is the Content block.","jetpack")}),(0,n.jsx)("p",{children:(0,r.__)("It will display all the blocks in the email content, which might be only simple text paragraphs. You can enrich your message with images, incorporate data through tables, explore different layout designs with columns, or use any other block type.","jetpack")})]})}function l(){(0,a.G)("core/post-content",e=>{return{...e,edit:(t=e.edit,function(e){const{postId:o,postType:r}=e.context,{__unstableLayoutClassNames:s}=e;return o&&r?(0,n.jsx)(t,{...e}):(0,n.jsx)(i,{layoutClassNames:s})})};var t})}},6736(e,t,o){o.d(t,{I:()=>r});var n=o(8992);function r(){(0,n.G)("core/quote",e=>({...e,styles:[],supports:{...e.supports,align:[]}}))}},5658(e,t,o){o.d(t,{Ug:()=>b,iO:()=>w,qQ:()=>v});var n=o(790),r=o(876),s=o(7723),a=o(4715),i=o(6427),l=o(7143),c=o(6087),d=o(9491),u=o(8389),p=o(7845),m=o(3124),g=o(2553),f=o(646),h=o(6816),y=o(444),_=o(7847);function b(){["core/image","core/code","core/language"].forEach(e=>{(0,y.le)(e)})}function x({contentRef:e}){const[t,o]=(0,c.useState)(!1),d=(0,l.useSelect)(e=>e("core/block-editor").getSelectedBlockClientId()),{updateBlockAttributes:m}=(0,l.useDispatch)("core/block-editor"),y=(0,l.useSelect)(e=>e("core/block-editor").getBlockAttributes(d)),_="text"in y?"text":"content",b=y?.[_]?.originalHTML||y?.[_]||"",x=(0,c.useCallback)((t,o)=>{let{start:n,end:s}=(0,u.E)(e,b),a="";if(o){let e=(0,r.create)({html:b});e=(0,r.insert)(e,o,n,s),s=n+o.length,e=(0,r.applyFormat)(e,{type:"woocommerce-email-editor/link-shortcode",attributes:{"data-link-href":t,contenteditable:"false",style:"text-decoration: underline;"}},n,s),a=(0,r.toHTMLString)({value:e})}else{let e=(0,r.create)({html:b});e=(0,r.insert)(e,(0,r.create)({html:`\x3c!--${t}--\x3e&nbsp;`}),n,s),a=(0,r.toHTMLString)({value:e})}m(d,{[_]:a})},[b,_,e,d,m]);return(0,n.jsx)(a.BlockControls,{children:(0,n.jsxs)(i.ToolbarGroup,{children:[(0,n.jsx)(i.ToolbarButton,{icon:"shortcode",title:(0,s.__)("Personalization Tags","jetpack"),onClick:()=>{o(!0),(0,h.yM)("block_controls_personalization_tags_button_clicked")}}),(0,n.jsx)(g.t,{contentRef:e,onUpdate:(e,t)=>{const o=b.replace(`\x3c!--[${e}]--\x3e`,`\x3c!--[${t}]--\x3e`);m(d,{[_]:o})}}),(0,n.jsx)(f.N,{contentRef:e,onUpdate:(e,t,o)=>{const n=e.getAttribute("data-link-href").replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`<a([^>]*?)data-link-href="${n}"([^>]*?)>${e.textContent}</a>`,"gi"),s=b.replace(r,(e,n,r)=>`<a${n}data-link-href="${t}"${r}>${o}</a>`);m(d,{content:s})}}),(0,n.jsx)(p.x,{isOpened:t,onInsert:(e,t)=>{x(e,t),o(!1)},closeCallback:()=>o(!1),canInsertLink:!0,openedBy:"block-controls"})]})})}function v(){(0,y.gG)("woocommerce-email-editor/shortcode",{name:"woocommerce-email-editor/shortcode",title:(0,s.__)("Personalization Tags","jetpack"),className:"woocommerce-email-editor-personalization-tags",tagName:"span",attributes:{},interactive:!1,edit:x}),(0,y.gG)("woocommerce-email-editor/link-shortcode",{name:"woocommerce-email-editor/link-shortcode",title:(0,s.__)("Personalization Tags Link","jetpack"),className:"woocommerce-email-editor-personalization-tags-link",tagName:"a",attributes:{"data-link-href":"data-link-href",contenteditable:"contenteditable",style:"style"},interactive:!0,edit:null})}const k=(0,d.createHigherOrderComponent)(e=>t=>{const{attributes:o,setAttributes:r,name:s}=t,{content:a}=o,i=(0,l.useSelect)(e=>e(m.H).getPersonalizationTagsList(),[]),d=(0,c.useCallback)(()=>a?(0,u.D)(a,i):"",[a,i]),p=(0,c.useCallback)(e=>{if(void 0!==e.content){const t=(0,u.D)(e.content,i);r({...e,content:t})}else r(e)},[i,r]);return"core/paragraph"===s||"core/heading"===s||"core/list-item"===s?(0,n.jsx)(e,{...t,attributes:{...o,content:d()},setAttributes:p}):(0,n.jsx)(e,{...t})},"personalizationTagsLiveContentUpdate");function w(){(0,_.HY)("editor.BlockEdit","woocommerce-email-editor/with-live-content-update",k)}},8485(e,t,o){o.d(t,{U:()=>r});var n=o(8848);function r(){(0,n.z)("core/site-logo",{name:"site-logo-default",title:"Site Logo",attributes:{align:"center",width:120},isDefault:!0})}},5437(e,t,o){o.d(t,{_:()=>u});var n=o(790),r=o(4715),s=o(7723),a=o(8992),i=o(8848),l=o(7847);const c=["behance","bluesky","chain","discord","facebook","feed","github","gravatar","instagram","linkedin","mail","mastodon","medium","patreon","pinterest","reddit","spotify","telegram","threads","tiktok","tumblr","twitch","twitter","vimeo","wordpress","whatsapp","x","youtube"];const d=e=>t=>{if("core/social-links"!==t.name)return(0,n.jsx)(e,{...t});const o=`\n\t\t.block-editor-tools-panel-color-gradient-settings__item:has([title="${(0,s.__)("Icon color","jetpack")}"]) {\n\t\t\tdisplay: none !important;\n\t\t}\n\t\t.block-editor-tools-panel-color-gradient-settings__item:nth-child(2 of .block-editor-tools-panel-color-gradient-settings__item){\n\t\t\tborder-top:1px solid #ddd;\n\t\t\tborder-top-left-radius:2px;\n\t\t\tborder-top-right-radius:2px;\n\t\t}\n\t\t`;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e,{...t}),(0,n.jsx)(r.InspectorControls,{group:"color",children:(0,n.jsx)("style",{children:o})})]})};function u(){(0,a.G)("core/social-link",e=>({...e,variations:(e.variations||[]).filter(e=>c.includes(e.name)),supports:{...e.supports,layout:!1}})),(0,i.z)("core/social-links",{name:"social-links-default",title:"Social Icons",attributes:{openInNewTab:!0,showLabels:!1,align:"center",className:"is-style-logos-only"},isDefault:!0,innerBlocks:[{name:"core/social-link",attributes:{service:"wordpress",url:"https://wordpress.org"}},{name:"core/social-link",attributes:{service:"facebook",url:"https://www.facebook.com/WordPress/"}},{name:"core/social-link",attributes:{service:"x",url:"https://x.com/WordPress"}}]}),(0,l.HY)("editor.BlockEdit","woocommerce-email-editor/disable-social-links-icon-color",d)}},2318(e,t,o){o.d(t,{X:()=>b});var n=o(9363),r=o(4997),s=o(1135),a=o(7960),i=o(1007),l=o(9289),c=o(5658),d=o(7789),u=o(8757),p=o(5594),m=o(6736),g=o(8686),f=o(5437),h=o(8485),y=o(306),_=o(2642);function b(){(0,r.getBlockType)("core/paragraph")||(0,n.registerCoreBlocks)(),(0,g.M)(),(0,s.I)(),(0,l.y)(),(0,l.G)(),(0,c.Ug)(),(0,s.R)(),(0,i.u)(),(0,d.l)(),(0,u.H)(),(0,a.l)(),(0,m.I)(),(0,c.qQ)(),(0,c.iO)(),(0,p.G)(),(0,f._)(),(0,h.U)(),(0,y.R)(),(0,_.D)(),(0,p.J)()}},9791(e,t,o){o.d(t,{G:()=>r});var n=o(4997);function r(){try{return(0,n.getBlockTypes)().filter(e=>!0===e.supports?.email).map(e=>e.name)}catch(e){return console.error("Failed to get allowed block names:",e),[]}}},2642(e,t,o){o.d(t,{D:()=>r});var n=o(8992);function r(){(0,n.G)("woocommerce/product-image",e=>({...e,supports:{...e.supports||{},align:["full"]}}))}},5183(e,t,o){o.d(t,{w:()=>N});var n=o(790),r=o(7143),s=o(6087),a=o(6427),i=o(3582),l=o(2165),c=o(2279),d=o(3656),u=o(3124),p=o(3707),m=o(1847),g=o(1128),f=o(7709),h=o(1513),y=o(639),_=o(7680),b=o(8287),x=o(5209),v=o(3364),k=o(4291),w=o(7159),j=o(3373),S=o(2570),E=o(4095),C=o(6816);const T=d.AutosaveMonitor,P=d.EditorKeyboardShortcutsRegister;function N({postId:e,postType:t,settings:o,contentRef:N,customSavePanel:M,customSaveButton:A}){const{currentPost:B,onNavigateToEntityRecord:L,onNavigateToPreviousEntityRecord:I}=(0,p.c)(e,t,"post-only"),{post:$,template:R}=(0,r.useSelect)(e=>{const{getEditedEntityRecord:t}=e(i.store),o=t("postType",B.postType,B.postId);if(!o||"boolean"==typeof o)return{post:null,template:null};const n=o;if("wp_template"===B.postType)return{post:n,template:null};const{getEditedPostTemplate:r}=e(u.H);return{post:n,template:r(n.template)}},[B.postType,B.postId]),{isFullscreenEnabled:z,allCommands:F}=(0,r.useSelect)(e=>({isFullscreenEnabled:e(u.H).isFeatureActive("fullscreenMode"),allCommands:e(l.store).getCommands()}),[]),{isFullScreenForced:H,displaySendEmailButton:O,disableSnackbarNotices:V}=o,{removeEditorPanel:D}=(0,r.useDispatch)(d.store);(0,s.useEffect)(()=>{D("post-status")},[D]);const[G]=(0,g.b)(),W=(0,s.useMemo)(()=>({...o,onNavigateToEntityRecord:L,onNavigateToPreviousEntityRecord:I,defaultRenderingMode:"wp_template"===B.postType?"post-only":"template-locked",supportsTemplateMode:!0,styles:G}),[o,L,I,B.postType,G]);if(!($&&("wp_template"===B.postType||$.template===R?.slug||!$.template&&R)))return(0,n.jsx)("div",{className:"spinner-container",children:(0,n.jsx)(a.ProgressBar,{})});const q=F.every(({name:e})=>e.includes("woocommerce"));return(0,C.xW)("editor_layout_loaded"),(0,n.jsx)(a.SlotFillProvider,{children:(0,n.jsxs)(d.ErrorBoundary,{canCopyContent:!0,children:[q&&(0,n.jsx)(l.CommandMenu,{}),(0,n.jsxs)(m.KE,{postId:B.postId,postType:B.postType,settings:W,templateId:R&&R.id,contentRef:N,styles:G,customSavePanel:M,customSaveButton:"wp_template"===B.postType?void 0:A,children:[(0,n.jsx)(T,{}),(0,n.jsx)(d.LocalAutosaveMonitor,{}),(0,n.jsx)(d.UnsavedChangesWarning,{}),(0,n.jsx)(P,{}),(0,n.jsx)(d.PostLockedModal,{}),(0,n.jsx)(h.x,{}),(0,n.jsx)(E.O,{}),(0,n.jsx)(y.r,{}),(0,n.jsx)(_.h,{}),(0,n.jsx)(f.p,{}),(0,n.jsx)(m.fA,{isActive:H||z}),(H||z)&&(0,n.jsx)(S.R,{}),!H&&(0,n.jsx)(b.n,{}),"wp_template"===B.postType?(0,n.jsx)(v.c,{}):(0,n.jsx)(x.O,{}),O&&(0,n.jsx)(k.L,{}),(0,n.jsx)(w.D,{disableSnackbarNotices:V}),(0,n.jsx)(j.x,{}),(0,n.jsx)(c.PluginArea,{scope:"woocommerce-email-editor"})]})]})})}},2570(e,t,o){o.d(t,{R:()=>w});var n=o(790),r=o(6427),s=o(6087),a=o(7723),i=o(3109),l=o(2344),c=o(9558),d=o(8329),u=o(6168),p=o(2619),m=o(7143),g=o(1847),f=o(6816),h=o(3124);const y={edit:{opacity:0,scale:.2},hover:{opacity:1,scale:1,clipPath:"inset( 22% round 2px )"}},_={edit:{clipPath:"inset(0% round 0px)"},hover:{clipPath:"inset( 22% round 2px )"},tap:{clipPath:"inset(0% round 0px)"}};function b(){const{urls:e}=(0,m.useSelect)(e=>({urls:e(h.H).getUrls()}),[]);return()=>{(0,f.yM)("header_close_button_clicked");const t=()=>{if(e.back)try{const t=new URL(e.back,window.location.href);["http:","https:"].includes(t.protocol)&&(window.location.href=t.href)}catch{}},o=(0,p.applyFilters)("woocommerce_email_editor_close_action_callback",t);("function"==typeof o?o:t)()}}const x=()=>{const e=b();return(0,n.jsx)(r.Button,{size:"compact",icon:(0,a.isRTL)()?d.A:c.A,label:(0,a.__)("Close editor","jetpack"),showTooltip:!0,tooltipPosition:"middle right",onClick:e})},v=()=>{const e=b();return(0,n.jsxs)(r.__unstableMotion.div,{className:"woocommerce-email-editor__view-mode-toggle",transition:{duration:.2},animate:"edit",initial:"edit",whileHover:"hover",whileTap:"tap",children:[(0,n.jsx)(r.Button,{label:(0,a.__)("Close editor","jetpack"),showTooltip:!0,tooltipPosition:"middle right",onClick:e,children:(0,n.jsx)(r.__unstableMotion.div,{variants:_,children:(0,n.jsx)("div",{className:"woocommerce-email-editor__view-mode-toggle-icon",children:(0,n.jsx)(i.A,{className:"woocommerce-email-editor-icon__icon",icon:u.A,size:48})})})}),(0,n.jsx)(r.__unstableMotion.div,{className:"woocommerce-email-editor-icon",variants:y,children:(0,n.jsx)(i.A,{icon:l.A})})]})},k=()=>{const e=(0,s.useRef)(null),[t,o]=(0,s.useState)(null);return(0,s.useLayoutEffect)(()=>{const t=e.current?.closest(".editor-header__back-button"),n=t?.getBoundingClientRect().width;o(void 0!==n&&n<=48)},[]),null===t?(0,n.jsx)("div",{ref:e}):t?(0,n.jsx)(x,{}):(0,n.jsx)(v,{})},w=()=>{const e=(0,p.applyFilters)("woocommerce_email_editor_close_content",k);return(0,n.jsx)(g.oq,{children:({length:t})=>t<=1&&(0,n.jsx)(e,{})})}},2614(e,t,o){o.d(t,{J:()=>u});var n=o(790),r=o(7723),s=o(6427),a=o(2619),i=o(7143),l=o(3656),c=o(3124),d=o(6816);function u(){const{isDirty:e}=(0,l.useEntitiesSavedStatesIsDirty)(),{hasEmptyContent:t,isEmailSent:o,urls:u}=(0,i.useSelect)(e=>({hasEmptyContent:e(c.H).hasEmptyContent(),isEmailSent:e(c.H).isEmailSent(),urls:e(c.H).getUrls()}),[]);function p(){u.send&&(window.location.href=u.send)}const m=t||o||e,g=(0,a.applyFilters)("woocommerce_email_editor_send_button_disabled",m,{hasEmptyContent:t,isEmailSent:o,isDirty:e}),f="boolean"==typeof g?g:m,h=(0,a.applyFilters)("woocommerce_email_editor_send_button_label",(0,r.__)("Send","jetpack"));return(0,n.jsx)(s.Button,{variant:"primary",size:"compact",onClick:()=>{(0,d.yM)("header_send_button_clicked");(0,a.applyFilters)("woocommerce_email_editor_send_action_callback",p)()},disabled:f,"data-automation-id":"email_editor_send_button",children:h})}},3242(e,t,o){o.d(t,{A:()=>y});var n=o(790),r=o(3582),s=o(7723),a=o(692),i=o(7839),l=o(6087),c=o(7143),d=o(6427),u=o(8537),p=o(2619),m=o(3124),g=o(6816);function f(e){return"string"==typeof e.title?(0,u.decodeEntities)(e.title):e.title&&"rendered"in e.title?(0,u.decodeEntities)(e.title.rendered):e.title&&"raw"in e.title?(0,u.decodeEntities)(e.title.raw):""}function h(e,t){return t?e.length>1?(0,s.sprintf)(
2 2 // translators: %d: number of items to delete.
3 3 // translators: %d: number of items to delete.
4 4 (0,s._n)("Are you sure you want to permanently delete %d item?","Are you sure you want to permanently delete %d items?",e.length,"jetpack"),e.length):(0,s.sprintf)(
5 5 // translators: %s: The post's title
@@ -14,15 +14,15 @@
14 14 (0,s.__)('"%s" permanently deleted.',"jetpack"),f(t[0])):(0,s.sprintf)(/* translators: The item's title. */ /* translators: The item's title. */
15 15 (0,s.__)('"%s" moved to the trash.',"jetpack"),f(t[0])):e?(0,s.__)("The items were permanently deleted.","jetpack"):(0,s.sprintf)(/* translators: The number of items. */ /* translators: The number of items. */
16 16 (0,s._n)("%s item moved to the trash.","%s items moved to the trash.",t.length,"jetpack"),t.length),y(o,{type:"snackbar",id:"trash-email-post-action"}),i?.(t),x?.listings&&(window.location.href=x.listings)}else{let e;if(1===n.length){const t=n[0];e=t.reason?.message?t.reason.message:(0,s.__)("An error occurred while performing the action.","jetpack")}else{const t=new Set,o=n.filter(({status:e})=>"rejected"===e);for(const e of o){const o=e;o.reason?.message&&t.add(o.reason.message)}e=0===t.size?(0,s.__)("An error occurred while performing the action.","jetpack"):1===t.size?(0,s.sprintf)(/* translators: %s: an error message */ /* translators: %s: an error message */
17 17 (0,s.__)("An error occurred while performing the action: %s","jetpack"),[...t][0]):(0,s.sprintf)(/* translators: %s: a list of comma separated error messages */ /* translators: %s: a list of comma separated error messages */
18 -(0,s.__)("Some errors occurred while performing the action: %s","jetpack"),[...t].join(","))}(0,g.yM)("trash_modal_move_to_trash_error",{errorMessage:e}),_(e,{type:"snackbar"})}p(!1),o?.()},isBusy:u,disabled:u,__next40pxDefaultSize:!0,children:e?(0,s.__)("Delete permanently","jetpack"):(0,s.__)("Move to trash","jetpack")})]})]})}}}},8287(e,t,o){o.d(t,{n:()=>d});var n=o(790),r=o(7723),s=o(9491),a=o(8558),i=o(1233),l=o(1847),c=o(3124);const d=()=>{const e=(0,s.useViewportMatch)("large");return(0,n.jsx)(n.Fragment,{children:e&&(0,n.jsx)(l.Lf,{children:(0,n.jsx)(i.PreferenceToggleMenuItem,{scope:c.H,name:"fullscreenMode",label:(0,r.__)("Fullscreen mode","jetpack"),info:(0,r.__)("Show and hide the admin user interface","jetpack"),messageActivated:(0,r.__)("Fullscreen mode activated.","jetpack"),messageDeactivated:(0,r.__)("Fullscreen mode deactivated.","jetpack"),shortcut:a.displayShortcut.secondary("f")})})})}},7159(e,t,o){o.d(t,{D:()=>d});var n=o(790),r=o(6427),s=o(7143),a=o(692),i=o(9455),l=o(7442),c=o(1324);function d({disableSnackbarNotices:e=!1}={}){const{notices:t}=(0,s.useSelect)(e=>({notices:e(a.store).getNotices("email-editor")}),[]),{removeNotice:o}=(0,s.useDispatch)(a.store),d=t.filter(({isDismissible:e,type:t})=>e&&"default"===t),u=t.filter(({isDismissible:e,type:t})=>!e&&"default"===t);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(c.g,{children:[(0,n.jsx)(r.NoticeList,{notices:u,className:"components-editor-notices__pinned"}),(0,n.jsx)(r.NoticeList,{notices:d,className:"components-editor-notices__dismissible",onRemove:e=>o(e,"email-editor")}),(0,n.jsx)(i.V,{})]}),!e&&(0,n.jsx)(l.G,{})]})}},7442(e,t,o){o.d(t,{G:()=>i});var n=o(790),r=o(6427),s=o(7143),a=o(692);function i(){const e=(0,s.useSelect)(e=>e(a.store).getNotices(),[]),{removeNotice:t}=(0,s.useDispatch)(a.store),o=e.filter(({type:e})=>"snackbar"===e).slice(-3);return(0,n.jsx)(r.SnackbarList,{notices:o,className:"components-editor-notices__snackbar edit-post-layout__snackbar",onRemove:t})}},9455(e,t,o){o.d(t,{V:()=>i});var n=o(790),r=o(7723),s=o(6427),a=o(7711);function i(){const{notices:e}=(0,a.k)();return 0===e.length?null:(0,n.jsx)(s.Notice,{status:"error",className:"woocommerce-email-editor-validation-errors components-editor-notices__pinned",isDismissible:!1,children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("strong",{children:(0,r.__)("Fix errors to continue:","jetpack")}),(0,n.jsx)("ul",{children:e.map(({id:e,content:t,actions:o})=>(0,n.jsxs)("li",{children:[t,o.length>0?o.map(({label:e,onClick:t})=>(0,n.jsx)(s.Button,{onClick:t,variant:"link",children:e},e)):null]},e))})]})})}},3475(e,t,o){o.d(t,{M:()=>i});var n=o(790),r=o(6087),s=o(6427),a=o(7723);const i=({groupedTags:e,activeCategory:t,onCategorySelect:o})=>{const i=e=>e===t?"woocommerce-personalization-tags-modal-menu-item-active":"";return(0,n.jsxs)(s.MenuGroup,{className:"woocommerce-personalization-tags-modal-menu",children:[(0,n.jsx)(s.MenuItem,{onClick:()=>o(null),className:i(null),children:(0,a.__)("All","jetpack")}),(0,n.jsx)("div",{className:"woocommerce-personalization-tags-modal-menu-separator","aria-hidden":"true",role:"presentation","data-testid":"woocommerce-personalization-tags-modal-menu-separator"}),Object.keys(e).map((e,t,a)=>(0,n.jsxs)(r.Fragment,{children:[(0,n.jsx)(s.MenuItem,{onClick:()=>o(e),className:i(e),children:e}),t<a.length-1&&(0,n.jsx)("div",{className:"woocommerce-personalization-tags-modal-menu-separator","aria-hidden":"true",role:"presentation","data-testid":"woocommerce-personalization-tags-modal-menu-separator"})]},e))]})}},2433(e,t,o){o.d(t,{a:()=>l});var n=o(790),r=o(6427),s=o(7723),a=o(7143),i=o(4715);const l=({groupedTags:e,activeCategory:t,onInsert:o,canInsertLink:l,closeCallback:c,openLinkModal:d})=>{const{updateBlockAttributes:u}=(0,a.useDispatch)(i.store),p=(0,a.useSelect)(e=>e(i.store).getSelectedBlockClientId()),m=(0,a.useSelect)(e=>e(i.store).getBlock(p)),g=["core/button"].includes(m?.name),f=null===t?Object.entries(e):[[t,e[t]||[]]];return(0,n.jsx)(n.Fragment,{children:f.map(([e,t])=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"woocommerce-personalization-tags-modal-category",children:e}),(0,n.jsx)("div",{className:"woocommerce-personalization-tags-modal-category-group",children:t.map(t=>{const a=/\burl\b/.test(t.token);return(0,n.jsxs)("div",{className:"woocommerce-personalization-tags-modal-category-group-item",children:[(0,n.jsxs)("div",{className:"woocommerce-personalization-tags-modal-item-text",children:[(0,n.jsx)("strong",{children:t.name}),t.valueToInsert]}),(0,n.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end"},children:[(0,n.jsx)(r.Button,{variant:"link",onClick:()=>{o&&o(t.valueToInsert,!1)},children:(0,s.__)("Insert","jetpack")}),g&&a&&(0,n.jsx)(r.Button,{variant:"link",onClick:()=>{u(p,{url:t.valueToInsert}),c()},children:(0,s.__)("Set as URL","jetpack")}),e===(0,s.__)("Link","jetpack")&&l&&(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(r.Button,{variant:"link",onClick:()=>{c(),d(t)},children:(0,s.__)("Insert as link","jetpack")})})]})]},t.token)})})]},e))})}},3571(e,t,o){o.d(t,{U:()=>i});var n=o(790),r=o(6427),s=o(7723),a=o(6087);const i=({onInsert:e,isOpened:t,closeCallback:o,tag:i})=>{const[l,c]=(0,a.useState)((0,s.__)("Link","jetpack"));return t?(0,n.jsxs)(r.Modal,{size:"small",title:(0,s.__)("Insert Link","jetpack"),onRequestClose:o,className:"woocommerce-personalization-tags-modal",children:[(0,n.jsx)(r.TextControl,{label:(0,s.__)("Link Text","jetpack"),value:l,onChange:e=>c(e)}),(0,n.jsx)(r.Button,{isPrimary:!0,onClick:()=>{e&&e(i.token,l)},children:(0,s.__)("Insert","jetpack")})]}):null}},646(e,t,o){o.d(t,{N:()=>c});var n=o(790),r=o(6087),s=o(7723),a=o(7143),i=o(6427),l=o(3124);const c=({contentRef:e,onUpdate:t})=>{const[o,c]=(0,r.useState)(!1),[d,u]=(0,r.useState)(null),[p,m]=(0,r.useState)(""),[g,f]=(0,r.useState)(""),h=(0,a.useSelect)(e=>e(l.H).getPersonalizationTagsList(),[]);return(0,r.useEffect)(()=>{if(!e||!e.current)return;const t=e.current,o=e=>{const t=e.target.closest("a[data-link-href]");t&&(u(t),f(t.getAttribute("data-link-href")||""),m(t.textContent||""),c(!0))};return t.addEventListener("click",o),()=>{t.removeEventListener("click",o)}},[e]),(0,n.jsx)(n.Fragment,{children:o&&d&&(0,n.jsx)(i.Popover,{position:"bottom left",onClose:()=>c(!1),anchor:d,className:"woocommerce-personalization-tag-popover",children:(0,n.jsxs)("div",{className:"woocommerce-personalization-tag-popover-content",children:[(0,n.jsx)(i.TextControl,{label:(0,s.__)("Link Text","jetpack"),value:p,onChange:e=>m(e),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,autoComplete:"off"}),(0,n.jsx)(i.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,s.__)("Link tag","jetpack"),value:g,onChange:e=>{f(e)},options:h.filter(e=>e.category===(0,s.__)("Link","jetpack")).map(e=>({label:e.name,value:e.token}))}),(0,n.jsxs)("div",{className:"woocommerce-personalization-tag-popover-content-buttons",children:[(0,n.jsx)(i.Button,{isTertiary:!0,onClick:()=>{c(!1)},children:(0,s.__)("Cancel","jetpack")}),(0,n.jsx)(i.Button,{isPrimary:!0,onClick:()=>{c(!1),t(d,g,p)},children:(0,s.__)("Update link","jetpack")})]})]})})})}},7845(e,t,o){o.d(t,{x:()=>m});var n=o(790),r=o(6427),s=o(7723),a=o(6087),i=o(7143),l=o(3475),c=o(2433),d=o(3571),u=o(6816),p=o(3124);const m=({onInsert:e,isOpened:t,closeCallback:o,canInsertLink:m=!1,openedBy:g=""})=>{const[f,h]=(0,a.useState)(null),[y,_]=(0,a.useState)(""),[b,x]=(0,a.useState)(null),[v,w]=(0,a.useState)(!1),k=(0,i.useSelect)(e=>e(p.H).getPersonalizationTagsList(),[]);if(v)return(0,n.jsx)(d.U,{onInsert:(t,o)=>{e(t,o),w(!1)},isOpened:v,closeCallback:()=>w(!1),tag:b});if(!t)return null;(0,u.xW)("personalization_tags_modal_opened",{openedBy:g});const j=k.reduce((e,t)=>{const{category:o,name:n,token:r}=t;return(!y||n.toLowerCase().includes(y.toLowerCase())||r.toLowerCase().includes(y.toLowerCase()))&&(e[o]||(e[o]=[]),e[o].push(t)),e},{});return(0,n.jsxs)(r.Modal,{size:"medium",title:(0,s.__)("Personalization Tags","jetpack"),onRequestClose:()=>{o(),(0,u.yM)("personalization_tags_modal_closed",{openedBy:g})},className:"woocommerce-personalization-tags-modal",children:[(0,n.jsxs)("p",{children:[(0,s.__)("Insert personalization tags to dynamically fill in information and personalize your emails.","jetpack")," ",(0,n.jsx)(r.ExternalLink,{href:"https://kb.mailpoet.com/article/435-a-guide-to-personalisation-tags-for-tailored-newsletters#list",onClick:()=>(0,u.yM)("personalization_tags_modal_learn_more_link_clicked",{openedBy:g}),children:(0,s.__)("Learn more","jetpack")})]}),(0,n.jsx)(r.SearchControl,{onChange:e=>{_(e),(0,u.xW)("personalization_tags_modal_search_control_input_updated",{openedBy:g})},value:y}),(0,n.jsx)(l.M,{groupedTags:j,activeCategory:f,onCategorySelect:e=>{h(e),(0,u.yM)("personalization_tags_modal_category_menu_clicked",{category:e,openedBy:g})}}),(0,n.jsx)(c.a,{groupedTags:j,activeCategory:f,onInsert:t=>{e(t),(0,u.yM)("personalization_tags_modal_tag_insert_button_clicked",{insertedTag:t,activeCategory:f,openedBy:g})},closeCallback:o,canInsertLink:m,openLinkModal:e=>{x(e),w(!0)}})]})}},2553(e,t,o){o.d(t,{t:()=>i});var n=o(790),r=o(6087),s=o(6427),a=o(7723);const i=({contentRef:e,onUpdate:t})=>{const[o,i]=(0,r.useState)(!1),[l,c]=(0,r.useState)(null),[d,u]=(0,r.useState)(""),[p,m]=(0,r.useState)("");return(0,r.useEffect)(()=>{if(!e||!e.current)return;const t=e.current,o=e=>{const t=e.target.closest("span[data-rich-text-comment]");if(t){const e=t.innerText.replace(/^\[|\]$/g,"");m(e),u(e),c(t),i(!0)}};return t.addEventListener("click",o),()=>{t.removeEventListener("click",o)}},[e]),(0,n.jsx)(n.Fragment,{children:o&&l&&(0,n.jsx)(s.Popover,{position:"bottom right",onClose:()=>i(!1),anchor:l,className:"woocommerce-personalization-tag-popover",children:(0,n.jsxs)("div",{className:"woocommerce-personalization-tag-popover-content",children:[(0,n.jsx)(s.TextControl,{label:(0,a.__)("Personalization Tag","jetpack"),value:d,onChange:e=>u(e),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,n.jsxs)("div",{className:"woocommerce-personalization-tag-popover-content-buttons",children:[(0,n.jsx)(s.Button,{isTertiary:!0,onClick:()=>{i(!1)},children:(0,a.__)("Cancel","jetpack")}),(0,n.jsx)(s.Button,{isPrimary:!0,onClick:()=>{t(p,d),i(!1)},children:(0,a.__)("Update","jetpack")})]})]})})})}},8389(e,t,o){o.d(t,{D:()=>s,E:()=>r});var n=o(876);const r=(e,t)=>{const o=e.current.ownerDocument.defaultView.getSelection();if(!o.rangeCount)return{start:0,end:0};const r=o.getRangeAt(0);if(null===o.anchorNode.previousSibling)return{start:o.anchorOffset,end:o.anchorOffset+r.toString().length};const s=(0,n.create)({html:t});let a=o.anchorNode.previousSibling;a=function(e){let t=e;for(;t&&t?.children?.length>0;)t=t.children[0];return t}(a);const i=function(e,t){let o=null;for(const[n,r]of t.entries())if(r)for(const t of r)t?.attributes&&e.tagName.toLowerCase()===t.tagName?.toLowerCase()&&e.getAttribute("data-link-href")===t?.attributes["data-link-href"]&&(o=n);return o}(a,s.formats);if(null!==i)return{start:i+o.anchorOffset+1,end:i+o.anchorOffset+r.toString().length};const l=function(e,t){for(const[o,n]of t.entries()){if(!n)continue;const{attributes:t}=n;if(e.getAttribute("data-rich-text-comment")===t["data-rich-text-comment"])return o}return null}(a,s.replacements);return null!==l?{start:l+o.anchorOffset+1,end:l+o.anchorOffset+r.toString().length}:{start:s.text.length,end:s.text.length+r.toString().length}},s=(e,t)=>(t.forEach(t=>{if(!e.includes(t.token.slice(0,t.token.length-1)))return;const o=t.token.substring(1,t.token.length-1).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`(?<!\x3c!--)(?<!["'])\\[(${o}(\\s[^\\]]*)?)\\](?!--\x3e)`,"g");e=e.replace(n,e=>`\x3c!--${e}--\x3e`)}),e)},9155(e,t,o){o.d(t,{O:()=>f});var n=o(790),r=o(6427),s=o(7143),a=o(6087),i=o(876),l=o(4715),c=o(7723),d=o(7845),u=o(8389),p=o(3124),m=o(2553),g=o(6816);function f({label:e,labelSuffix:t,help:o,placeholder:f,attributeName:h,attributeValue:y,updateProperty:_=()=>{}}){const[b,x]=(0,a.useState)(null),[v,w]=(0,a.useState)(!1),k=(0,s.useSelect)(e=>e(p.H).getPersonalizationTagsList(),[]),j=(0,a.useRef)(null),S=(0,a.useCallback)((e,t,o)=>{const n=o?.start??t.length,r=o?.end??t.length;let s=(0,i.create)({html:t});s=(0,i.insert)(s,(0,i.create)({html:`\x3c!--${e}--\x3e`}),n,r);const a=(0,i.toHTMLString)({value:s});_(h,a),x(null)},[h,_]),E=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{children:e}),(0,n.jsx)(r.Button,{className:"woocommerce-settings-panel-personalization-tags-button",icon:"shortcode",title:(0,c.__)("Personalization Tags","jetpack"),onClick:()=>{w(!0),(0,g.yM)("rich_text_with_button_personalization_tags_shortcode_icon_clicked",{attributeName:h,label:e})}}),t]});return h?(0,n.jsxs)(r.BaseControl,{id:"",label:E,className:`woocommerce-settings-panel-${h}-text`,help:o,__nextHasNoMarginBottom:!0,children:[(0,n.jsx)(d.x,{isOpened:v,onInsert:e=>{S(e,y??"",b),w(!1),(0,g.yM)("rich_text_with_button_personalization_tags_inserted",{attributeName:h,value:e})},closeCallback:()=>w(!1),openedBy:"RichTextWithButton-BaseControl"}),(0,n.jsx)(m.t,{contentRef:j,onUpdate:(e,t)=>{const o=(y??"").replace(`\x3c!--[${e}]--\x3e`,`\x3c!--[${t}]--\x3e`);_(h,o)}}),(0,n.jsx)(l.RichText,{ref:j,className:"woocommerce-settings-panel-richtext",placeholder:f,onFocus:()=>{x((0,u.E)(j,y??""))},onKeyUp:()=>{x((0,u.E)(j,y??""))},onClick:()=>{x((0,u.E)(j,y??""))},onChange:e=>{e=(0,u.D)(e??"",k),_(h,e),(0,g.xW)("rich_text_with_button_input_field_updated",{attributeName:h})},value:y??"","data-automation-id":`email_${h}`})]}):null}},7709(e,t,o){o.d(t,{p:()=>l});var n=o(7723),r=o(6087),s=o(7143),a=o(3656),i=o(692);const l=()=>{const e='.editor-preview-dropdown__button-external, a[role="menuitem"][target^="wp-preview-"]',t=async t=>{const o=t.target,r=o?.closest(e);if(!r)return;const l=(0,s.select)(a.store),c=l?.isEditedPostDirty();c&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),(0,s.dispatch)(i.store).createNotice("warning",(0,n.__)("You have unsaved changes. Please save the post before previewing.","jetpack"),{context:"email-editor",isDismissible:!0}))},o=(0,r.useCallback)(o=>{try{const n=o.target;"Enter"!==o.key&&" "!==o.key||!n?.closest(e)||t(o)}catch(e){console.warn("Preview save message guard error:",e)}},[e]);return(0,r.useEffect)(()=>(document.addEventListener("click",t,!0),document.addEventListener("auxclick",t,!0),document.addEventListener("keydown",o,!0),()=>{document.removeEventListener("click",t,!0),document.removeEventListener("auxclick",t,!0),document.removeEventListener("keydown",o,!0)}),[o]),null}},4089(e,t,o){o.d(t,{P:()=>h});var n=o(790),r=o(6427),s=o(7143),a=o(3109),i=o(8901),l=o(7723),c=o(6087),d=o(8558),u=o(3832),p=o(2619),m=o(3124),g=o(8311),f=o(6816);const h=(0,c.memo)(function(){const e=(0,c.useRef)(null),{requestSendingNewsletterPreview:t,togglePreviewModal:o,updateSendPreviewEmail:h}=(0,s.useDispatch)(m.H),{toEmail:y,isSendingPreviewEmail:_,sendingPreviewStatus:b,isModalOpened:x,errorMessage:v,postType:w}=(0,s.useSelect)(e=>({...e(m.H).getPreviewState(),postType:e(m.H).getEmailPostType()}),[]),k=()=>{t(y)},j=(0,c.useMemo)(()=>(0,p.applyFilters)("woocommerce_email_editor_check_sending_method_configuration_link",`https://www.mailpoet.com/blog/mailpoet-smtp-plugin/?utm_source=woocommerce_email_editor&utm_medium=plugin&utm_source_platform=${w}`),[w]),S=()=>{(0,f.yM)("send_preview_email_modal_closed"),o(!1)};return(0,c.useEffect)(()=>{x&&(e.current?.focus(),(0,f.yM)("send_preview_email_modal_opened"))},[x]),x?(0,n.jsxs)(r.Modal,{className:"woocommerce-send-preview-email",title:(0,l.__)("Send a test email","jetpack"),onRequestClose:S,focusOnMount:!1,children:[b===g.T.ERROR?(0,n.jsxs)("div",{className:"woocommerce-send-preview-modal-notice-error",children:[(0,n.jsx)("p",{children:(0,l.__)("Sorry, we were unable to send this email.","jetpack")}),(0,n.jsx)("strong",{children:v&&(0,l.sprintf)(
18 +(0,s.__)("Some errors occurred while performing the action: %s","jetpack"),[...t].join(","))}(0,g.yM)("trash_modal_move_to_trash_error",{errorMessage:e}),_(e,{type:"snackbar"})}p(!1),o?.()},isBusy:u,disabled:u,__next40pxDefaultSize:!0,children:e?(0,s.__)("Delete permanently","jetpack"):(0,s.__)("Move to trash","jetpack")})]})]})}}}},8287(e,t,o){o.d(t,{n:()=>d});var n=o(790),r=o(7723),s=o(9491),a=o(8558),i=o(1233),l=o(1847),c=o(3124);const d=()=>{const e=(0,s.useViewportMatch)("large");return(0,n.jsx)(n.Fragment,{children:e&&(0,n.jsx)(l.Lf,{children:(0,n.jsx)(i.PreferenceToggleMenuItem,{scope:c.H,name:"fullscreenMode",label:(0,r.__)("Fullscreen mode","jetpack"),info:(0,r.__)("Show and hide the admin user interface","jetpack"),messageActivated:(0,r.__)("Fullscreen mode activated.","jetpack"),messageDeactivated:(0,r.__)("Fullscreen mode deactivated.","jetpack"),shortcut:a.displayShortcut.secondary("f")})})})}},7159(e,t,o){o.d(t,{D:()=>d});var n=o(790),r=o(6427),s=o(7143),a=o(692),i=o(9455),l=o(7442),c=o(1324);function d({disableSnackbarNotices:e=!1}={}){const{notices:t}=(0,s.useSelect)(e=>({notices:e(a.store).getNotices("email-editor")}),[]),{removeNotice:o}=(0,s.useDispatch)(a.store),d=t.filter(({isDismissible:e,type:t})=>e&&"default"===t),u=t.filter(({isDismissible:e,type:t})=>!e&&"default"===t);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(c.g,{children:[(0,n.jsx)(r.NoticeList,{notices:u,className:"components-editor-notices__pinned"}),(0,n.jsx)(r.NoticeList,{notices:d,className:"components-editor-notices__dismissible",onRemove:e=>o(e,"email-editor")}),(0,n.jsx)(i.V,{})]}),!e&&(0,n.jsx)(l.G,{})]})}},7442(e,t,o){o.d(t,{G:()=>i});var n=o(790),r=o(6427),s=o(7143),a=o(692);function i(){const e=(0,s.useSelect)(e=>e(a.store).getNotices(),[]),{removeNotice:t}=(0,s.useDispatch)(a.store),o=e.filter(({type:e})=>"snackbar"===e).slice(-3);return(0,n.jsx)(r.SnackbarList,{notices:o,className:"components-editor-notices__snackbar edit-post-layout__snackbar",onRemove:t})}},9455(e,t,o){o.d(t,{V:()=>i});var n=o(790),r=o(7723),s=o(6427),a=o(7711);function i(){const{notices:e}=(0,a.k)();return 0===e.length?null:(0,n.jsx)(s.Notice,{status:"error",className:"woocommerce-email-editor-validation-errors components-editor-notices__pinned",isDismissible:!1,children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("strong",{children:(0,r.__)("Fix errors to continue:","jetpack")}),(0,n.jsx)("ul",{children:e.map(({id:e,content:t,actions:o})=>(0,n.jsxs)("li",{children:[t,o.length>0?o.map(({label:e,onClick:t})=>(0,n.jsx)(s.Button,{onClick:t,variant:"link",children:e},e)):null]},e))})]})})}},3475(e,t,o){o.d(t,{M:()=>i});var n=o(790),r=o(6087),s=o(6427),a=o(7723);const i=({groupedTags:e,activeCategory:t,onCategorySelect:o})=>{const i=e=>e===t?"woocommerce-personalization-tags-modal-menu-item-active":"";return(0,n.jsxs)(s.MenuGroup,{className:"woocommerce-personalization-tags-modal-menu",children:[(0,n.jsx)(s.MenuItem,{onClick:()=>o(null),className:i(null),children:(0,a.__)("All","jetpack")}),(0,n.jsx)("div",{className:"woocommerce-personalization-tags-modal-menu-separator","aria-hidden":"true",role:"presentation","data-testid":"woocommerce-personalization-tags-modal-menu-separator"}),Object.keys(e).map((e,t,a)=>(0,n.jsxs)(r.Fragment,{children:[(0,n.jsx)(s.MenuItem,{onClick:()=>o(e),className:i(e),children:e}),t<a.length-1&&(0,n.jsx)("div",{className:"woocommerce-personalization-tags-modal-menu-separator","aria-hidden":"true",role:"presentation","data-testid":"woocommerce-personalization-tags-modal-menu-separator"})]},e))]})}},2433(e,t,o){o.d(t,{a:()=>l});var n=o(790),r=o(6427),s=o(7723),a=o(7143),i=o(4715);const l=({groupedTags:e,activeCategory:t,onInsert:o,canInsertLink:l,closeCallback:c,openLinkModal:d})=>{const{updateBlockAttributes:u}=(0,a.useDispatch)(i.store),p=(0,a.useSelect)(e=>e(i.store).getSelectedBlockClientId()),m=(0,a.useSelect)(e=>e(i.store).getBlock(p)),g=["core/button"].includes(m?.name),f=null===t?Object.entries(e):[[t,e[t]||[]]];return(0,n.jsx)(n.Fragment,{children:f.map(([e,t])=>(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"woocommerce-personalization-tags-modal-category",children:e}),(0,n.jsx)("div",{className:"woocommerce-personalization-tags-modal-category-group",children:t.map(t=>{const a=/\burl\b/.test(t.token);return(0,n.jsxs)("div",{className:"woocommerce-personalization-tags-modal-category-group-item",children:[(0,n.jsxs)("div",{className:"woocommerce-personalization-tags-modal-item-text",children:[(0,n.jsx)("strong",{children:t.name}),t.valueToInsert]}),(0,n.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end"},children:[(0,n.jsx)(r.Button,{variant:"link",onClick:()=>{o&&o(t.valueToInsert,!1)},children:(0,s.__)("Insert","jetpack")}),g&&a&&(0,n.jsx)(r.Button,{variant:"link",onClick:()=>{u(p,{url:t.valueToInsert}),c()},children:(0,s.__)("Set as URL","jetpack")}),e===(0,s.__)("Link","jetpack")&&l&&(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(r.Button,{variant:"link",onClick:()=>{c(),d(t)},children:(0,s.__)("Insert as link","jetpack")})})]})]},t.token)})})]},e))})}},3571(e,t,o){o.d(t,{U:()=>i});var n=o(790),r=o(6427),s=o(7723),a=o(6087);const i=({onInsert:e,isOpened:t,closeCallback:o,tag:i})=>{const[l,c]=(0,a.useState)((0,s.__)("Link","jetpack"));return t?(0,n.jsxs)(r.Modal,{size:"small",title:(0,s.__)("Insert Link","jetpack"),onRequestClose:o,className:"woocommerce-personalization-tags-modal",children:[(0,n.jsx)(r.TextControl,{label:(0,s.__)("Link Text","jetpack"),value:l,onChange:e=>c(e)}),(0,n.jsx)(r.Button,{isPrimary:!0,onClick:()=>{e&&e(i.token,l)},children:(0,s.__)("Insert","jetpack")})]}):null}},646(e,t,o){o.d(t,{N:()=>c});var n=o(790),r=o(6087),s=o(7723),a=o(7143),i=o(6427),l=o(3124);const c=({contentRef:e,onUpdate:t})=>{const[o,c]=(0,r.useState)(!1),[d,u]=(0,r.useState)(null),[p,m]=(0,r.useState)(""),[g,f]=(0,r.useState)(""),h=(0,a.useSelect)(e=>e(l.H).getPersonalizationTagsList(),[]);return(0,r.useEffect)(()=>{if(!e||!e.current)return;const t=e.current,o=e=>{const t=e.target.closest("a[data-link-href]");t&&(u(t),f(t.getAttribute("data-link-href")||""),m(t.textContent||""),c(!0))};return t.addEventListener("click",o),()=>{t.removeEventListener("click",o)}},[e]),(0,n.jsx)(n.Fragment,{children:o&&d&&(0,n.jsx)(i.Popover,{position:"bottom left",onClose:()=>c(!1),anchor:d,className:"woocommerce-personalization-tag-popover",children:(0,n.jsxs)("div",{className:"woocommerce-personalization-tag-popover-content",children:[(0,n.jsx)(i.TextControl,{label:(0,s.__)("Link Text","jetpack"),value:p,onChange:e=>m(e),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,autoComplete:"off"}),(0,n.jsx)(i.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,s.__)("Link tag","jetpack"),value:g,onChange:e=>{f(e)},options:h.filter(e=>e.category===(0,s.__)("Link","jetpack")).map(e=>({label:e.name,value:e.token}))}),(0,n.jsxs)("div",{className:"woocommerce-personalization-tag-popover-content-buttons",children:[(0,n.jsx)(i.Button,{isTertiary:!0,onClick:()=>{c(!1)},children:(0,s.__)("Cancel","jetpack")}),(0,n.jsx)(i.Button,{isPrimary:!0,onClick:()=>{c(!1),t(d,g,p)},children:(0,s.__)("Update link","jetpack")})]})]})})})}},7845(e,t,o){o.d(t,{x:()=>m});var n=o(790),r=o(6427),s=o(7723),a=o(6087),i=o(7143),l=o(3475),c=o(2433),d=o(3571),u=o(6816),p=o(3124);const m=({onInsert:e,isOpened:t,closeCallback:o,canInsertLink:m=!1,openedBy:g=""})=>{const[f,h]=(0,a.useState)(null),[y,_]=(0,a.useState)(""),[b,x]=(0,a.useState)(null),[v,k]=(0,a.useState)(!1),w=(0,i.useSelect)(e=>e(p.H).getPersonalizationTagsList(),[]);if(v)return(0,n.jsx)(d.U,{onInsert:(t,o)=>{e(t,o),k(!1)},isOpened:v,closeCallback:()=>k(!1),tag:b});if(!t)return null;(0,u.xW)("personalization_tags_modal_opened",{openedBy:g});const j=w.reduce((e,t)=>{const{category:o,name:n,token:r}=t;return(!y||n.toLowerCase().includes(y.toLowerCase())||r.toLowerCase().includes(y.toLowerCase()))&&(e[o]||(e[o]=[]),e[o].push(t)),e},{});return(0,n.jsxs)(r.Modal,{size:"medium",title:(0,s.__)("Personalization Tags","jetpack"),onRequestClose:()=>{o(),(0,u.yM)("personalization_tags_modal_closed",{openedBy:g})},className:"woocommerce-personalization-tags-modal",children:[(0,n.jsxs)("p",{children:[(0,s.__)("Insert personalization tags to dynamically fill in information and personalize your emails.","jetpack")," ",(0,n.jsx)(r.ExternalLink,{href:"https://kb.mailpoet.com/article/435-a-guide-to-personalisation-tags-for-tailored-newsletters#list",onClick:()=>(0,u.yM)("personalization_tags_modal_learn_more_link_clicked",{openedBy:g}),children:(0,s.__)("Learn more","jetpack")})]}),(0,n.jsx)(r.SearchControl,{onChange:e=>{_(e),(0,u.xW)("personalization_tags_modal_search_control_input_updated",{openedBy:g})},value:y}),(0,n.jsx)(l.M,{groupedTags:j,activeCategory:f,onCategorySelect:e=>{h(e),(0,u.yM)("personalization_tags_modal_category_menu_clicked",{category:e,openedBy:g})}}),(0,n.jsx)(c.a,{groupedTags:j,activeCategory:f,onInsert:t=>{e(t),(0,u.yM)("personalization_tags_modal_tag_insert_button_clicked",{insertedTag:t,activeCategory:f,openedBy:g})},closeCallback:o,canInsertLink:m,openLinkModal:e=>{x(e),k(!0)}})]})}},2553(e,t,o){o.d(t,{t:()=>i});var n=o(790),r=o(6087),s=o(6427),a=o(7723);const i=({contentRef:e,onUpdate:t})=>{const[o,i]=(0,r.useState)(!1),[l,c]=(0,r.useState)(null),[d,u]=(0,r.useState)(""),[p,m]=(0,r.useState)("");return(0,r.useEffect)(()=>{if(!e||!e.current)return;const t=e.current,o=e=>{const t=e.target.closest("span[data-rich-text-comment]");if(t){const e=t.innerText.replace(/^\[|\]$/g,"");m(e),u(e),c(t),i(!0)}};return t.addEventListener("click",o),()=>{t.removeEventListener("click",o)}},[e]),(0,n.jsx)(n.Fragment,{children:o&&l&&(0,n.jsx)(s.Popover,{position:"bottom right",onClose:()=>i(!1),anchor:l,className:"woocommerce-personalization-tag-popover",children:(0,n.jsxs)("div",{className:"woocommerce-personalization-tag-popover-content",children:[(0,n.jsx)(s.TextControl,{label:(0,a.__)("Personalization Tag","jetpack"),value:d,onChange:e=>u(e),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,n.jsxs)("div",{className:"woocommerce-personalization-tag-popover-content-buttons",children:[(0,n.jsx)(s.Button,{isTertiary:!0,onClick:()=>{i(!1)},children:(0,a.__)("Cancel","jetpack")}),(0,n.jsx)(s.Button,{isPrimary:!0,onClick:()=>{t(p,d),i(!1)},children:(0,a.__)("Update","jetpack")})]})]})})})}},8389(e,t,o){o.d(t,{D:()=>s,E:()=>r});var n=o(876);const r=(e,t)=>{const o=e.current.ownerDocument.defaultView.getSelection();if(!o.rangeCount)return{start:0,end:0};const r=o.getRangeAt(0);if(null===o.anchorNode.previousSibling)return{start:o.anchorOffset,end:o.anchorOffset+r.toString().length};const s=(0,n.create)({html:t});let a=o.anchorNode.previousSibling;a=function(e){let t=e;for(;t&&t?.children?.length>0;)t=t.children[0];return t}(a);const i=function(e,t){let o=null;for(const[n,r]of t.entries())if(r)for(const t of r)t?.attributes&&e.tagName.toLowerCase()===t.tagName?.toLowerCase()&&e.getAttribute("data-link-href")===t?.attributes["data-link-href"]&&(o=n);return o}(a,s.formats);if(null!==i)return{start:i+o.anchorOffset+1,end:i+o.anchorOffset+r.toString().length};const l=function(e,t){for(const[o,n]of t.entries()){if(!n)continue;const{attributes:t}=n;if(e.getAttribute("data-rich-text-comment")===t["data-rich-text-comment"])return o}return null}(a,s.replacements);return null!==l?{start:l+o.anchorOffset+1,end:l+o.anchorOffset+r.toString().length}:{start:s.text.length,end:s.text.length+r.toString().length}},s=(e,t)=>(t.forEach(t=>{if(!e.includes(t.token.slice(0,t.token.length-1)))return;const o=t.token.substring(1,t.token.length-1).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`(?<!\x3c!--)(?<!["'])\\[(${o}(\\s[^\\]]*)?)\\](?!--\x3e)`,"g");e=e.replace(n,e=>`\x3c!--${e}--\x3e`)}),e)},9155(e,t,o){o.d(t,{O:()=>f});var n=o(790),r=o(6427),s=o(7143),a=o(6087),i=o(876),l=o(4715),c=o(7723),d=o(7845),u=o(8389),p=o(3124),m=o(2553),g=o(6816);function f({label:e,labelSuffix:t,help:o,placeholder:f,attributeName:h,attributeValue:y,updateProperty:_=()=>{}}){const[b,x]=(0,a.useState)(null),[v,k]=(0,a.useState)(!1),w=(0,s.useSelect)(e=>e(p.H).getPersonalizationTagsList(),[]),j=(0,a.useRef)(null),S=(0,a.useCallback)((e,t,o)=>{const n=o?.start??t.length,r=o?.end??t.length;let s=(0,i.create)({html:t});s=(0,i.insert)(s,(0,i.create)({html:`\x3c!--${e}--\x3e`}),n,r);const a=(0,i.toHTMLString)({value:s});_(h,a),x(null)},[h,_]),E=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{children:e}),(0,n.jsx)(r.Button,{className:"woocommerce-settings-panel-personalization-tags-button",icon:"shortcode",title:(0,c.__)("Personalization Tags","jetpack"),onClick:()=>{k(!0),(0,g.yM)("rich_text_with_button_personalization_tags_shortcode_icon_clicked",{attributeName:h,label:e})}}),t]});return h?(0,n.jsxs)(r.BaseControl,{id:"",label:E,className:`woocommerce-settings-panel-${h}-text`,help:o,__nextHasNoMarginBottom:!0,children:[(0,n.jsx)(d.x,{isOpened:v,onInsert:e=>{S(e,y??"",b),k(!1),(0,g.yM)("rich_text_with_button_personalization_tags_inserted",{attributeName:h,value:e})},closeCallback:()=>k(!1),openedBy:"RichTextWithButton-BaseControl"}),(0,n.jsx)(m.t,{contentRef:j,onUpdate:(e,t)=>{const o=(y??"").replace(`\x3c!--[${e}]--\x3e`,`\x3c!--[${t}]--\x3e`);_(h,o)}}),(0,n.jsx)(l.RichText,{ref:j,className:"woocommerce-settings-panel-richtext",placeholder:f,onFocus:()=>{x((0,u.E)(j,y??""))},onKeyUp:()=>{x((0,u.E)(j,y??""))},onClick:()=>{x((0,u.E)(j,y??""))},onChange:e=>{e=(0,u.D)(e??"",w),_(h,e),(0,g.xW)("rich_text_with_button_input_field_updated",{attributeName:h})},value:y??"","data-automation-id":`email_${h}`})]}):null}},7709(e,t,o){o.d(t,{p:()=>l});var n=o(7723),r=o(6087),s=o(7143),a=o(3656),i=o(692);const l=()=>{const e='.editor-preview-dropdown__button-external, a[role="menuitem"][target^="wp-preview-"]',t=async t=>{const o=t.target,r=o?.closest(e);if(!r)return;const l=(0,s.select)(a.store),c=l?.isEditedPostDirty();c&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),(0,s.dispatch)(i.store).createNotice("warning",(0,n.__)("You have unsaved changes. Please save the post before previewing.","jetpack"),{context:"email-editor",isDismissible:!0}))},o=(0,r.useCallback)(o=>{try{const n=o.target;"Enter"!==o.key&&" "!==o.key||!n?.closest(e)||t(o)}catch(e){console.warn("Preview save message guard error:",e)}},[e]);return(0,r.useEffect)(()=>(document.addEventListener("click",t,!0),document.addEventListener("auxclick",t,!0),document.addEventListener("keydown",o,!0),()=>{document.removeEventListener("click",t,!0),document.removeEventListener("auxclick",t,!0),document.removeEventListener("keydown",o,!0)}),[o]),null}},4089(e,t,o){o.d(t,{P:()=>h});var n=o(790),r=o(6427),s=o(7143),a=o(3109),i=o(8901),l=o(7723),c=o(6087),d=o(8558),u=o(3832),p=o(2619),m=o(3124),g=o(8311),f=o(6816);const h=(0,c.memo)(function(){const e=(0,c.useRef)(null),{requestSendingNewsletterPreview:t,togglePreviewModal:o,updateSendPreviewEmail:h}=(0,s.useDispatch)(m.H),{toEmail:y,isSendingPreviewEmail:_,sendingPreviewStatus:b,isModalOpened:x,errorMessage:v,postType:k}=(0,s.useSelect)(e=>({...e(m.H).getPreviewState(),postType:e(m.H).getEmailPostType()}),[]),w=()=>{t(y)},j=(0,c.useMemo)(()=>(0,p.applyFilters)("woocommerce_email_editor_check_sending_method_configuration_link",`https://www.mailpoet.com/blog/mailpoet-smtp-plugin/?utm_source=woocommerce_email_editor&utm_medium=plugin&utm_source_platform=${k}`),[k]),S=()=>{(0,f.yM)("send_preview_email_modal_closed"),o(!1)};return(0,c.useEffect)(()=>{x&&(e.current?.focus(),(0,f.yM)("send_preview_email_modal_opened"))},[x]),x?(0,n.jsxs)(r.Modal,{className:"woocommerce-send-preview-email",title:(0,l.__)("Send a test email","jetpack"),onRequestClose:S,focusOnMount:!1,children:[b===g.T.ERROR?(0,n.jsxs)("div",{className:"woocommerce-send-preview-modal-notice-error",children:[(0,n.jsx)("p",{children:(0,l.__)("Sorry, we were unable to send this email.","jetpack")}),(0,n.jsx)("strong",{children:v&&(0,l.sprintf)(
19 19 // translators: %s is an error message.
20 20 // translators: %s is an error message.
21 -(0,l.__)("Error: %s","jetpack"),v)}),(0,n.jsxs)("ul",{children:[(0,n.jsx)("li",{children:j&&(0,c.createInterpolateElement)((0,l.__)("Please check your <link>sending method configuration</link> with your hosting provider.","jetpack"),{link:(0,n.jsx)("a",{href:j,target:"_blank",rel:"noopener noreferrer",onClick:()=>(0,f.yM)("send_preview_email_modal_check_sending_method_configuration_link_clicked")})})}),(0,n.jsx)("li",{children:(0,c.createInterpolateElement)((0,l.__)("Or, sign up for MailPoet Sending Service to easily send emails. <link>Sign up for free</link>","jetpack"),{link:(0,n.jsx)("a",{href:`https://account.mailpoet.com/?s=1&g=1&utm_source=woocommerce_email_editor&utm_medium=plugin&utm_source_platform=${w}`,target:"_blank",rel:"noopener noreferrer",onClick:()=>(0,f.yM)("send_preview_email_modal_sign_up_for_mailpoet_sending_service_link_clicked")},"sign-up-for-free")})})]})]}):null,(0,n.jsx)("p",{children:(0,l.__)("Send yourself a test email to test how your email would look like in different email apps.","jetpack")}),(0,n.jsx)(r.TextControl,{label:(0,l.__)("Send to","jetpack"),onChange:e=>{h(e),(0,f.xW)("send_preview_email_modal_send_to_field_updated")},onKeyDown:e=>{const{keyCode:t}=e;t===d.ENTER&&(e.preventDefault(),k(),(0,f.yM)("send_preview_email_modal_send_to_field_key_code_enter"))},className:"woocommerce-send-preview-email__send-to-field",value:y,type:"email",ref:e,required:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),b===g.T.SUCCESS?(0,n.jsxs)("p",{className:"woocommerce-send-preview-modal-notice-success",children:[(0,n.jsx)(a.A,{icon:i.A,style:{fill:"#4AB866"}}),(0,l.__)("Test email sent successfully!","jetpack")]}):null,(0,n.jsxs)("div",{className:"woocommerce-send-preview-modal-footer",children:[(0,n.jsx)(r.Button,{variant:"tertiary",onClick:()=>{(0,f.yM)("send_preview_email_modal_close_button_clicked"),S()},children:(0,l.__)("Cancel","jetpack")}),(0,n.jsx)(r.Button,{variant:"primary",onClick:()=>{k(),(0,f.yM)("send_preview_email_modal_send_test_email_button_clicked")},disabled:_||!(0,u.isEmail)(y),children:_?(0,l.__)("Sending…","jetpack"):(0,l.__)("Send test email","jetpack")})]})]}):null})},7680(e,t,o){o.d(t,{h:()=>u});var n=o(790),r=o(7143),s=o(7723),a=o(1866),i=o(3656),l=o(3124),c=o(4089),d=o(6816);function u(){const{togglePreviewModal:e}=(0,r.useDispatch)(l.H);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.PluginPreviewMenuItem,{icon:a.A,onClick:()=>{(0,d.yM)("header_preview_dropdown_send_test_email_selected"),e(!0)},children:(0,s.__)("Send a test email","jetpack")}),(0,n.jsx)(c.P,{})]})}},3373(e,t,o){o.d(t,{x:()=>c});var n=o(790),r=o(4997),s=o(6427),a=o(7143),i=o(7723);const l=e=>{const t=(0,r.getBlockSupport)(e,"background");return t&&!1!==t?.backgroundImage};function c(){const e=(0,a.useSelect)(e=>e("core/block-editor").getSelectedBlock(),[]),t=(0,r.hasBlockSupport)(e?.name,"border",!1)||(0,r.hasBlockSupport)(e?.name,"__experimentalBorder",!1);return(0,n.jsxs)(n.Fragment,{children:[t&&(0,n.jsx)(s.Fill,{name:"InspectorControlsBorder",children:(0,n.jsxs)(s.Notice,{className:"woocommerce-grid-full-width",status:"warning",isDismissible:!1,children:[(0,i.__)("Border display may vary or be unsupported in some email clients.","jetpack"),(0,n.jsx)("br",{}),(0,i.__)("Units other than pixels (px) lack support in old email clients.","jetpack")]})}),l(e?.name)&&(0,n.jsx)(s.Fill,{name:"InspectorControlsBackground",children:(0,n.jsx)(s.Notice,{className:"woocommerce-grid-full-width",status:"warning",isDismissible:!1,children:(0,i.__)("Select a background color for email clients that do not support background images.","jetpack")})})]})}},1584(e,t,o){o.d(t,{A:()=>y});var n=o(790),r=o(7723),s=o(692),a=o(3582),i=o(8929),l=o(6087),c=o(7143),d=o(6427),u=o(8537),p=o(4997),m=o(1455),g=o.n(m),f=o(6816);function h(e){return"string"==typeof e.title?(0,u.decodeEntities)(e.title):e.title&&"rendered"in e.title?(0,u.decodeEntities)(e.title.rendered):e.title&&"raw"in e.title?(0,u.decodeEntities)(e.title.raw):""}var y=()=>({id:"reset-email-template",label:(0,r.__)("Reset","jetpack"),supportsBulk:!1,icon:i.A,isEligible(e){if("wp_template"!==e.type)return!1;if("custom"!==e.source)return!1;if(!Boolean(e.plugin)&&!Boolean(e.has_theme_file))return!1;const{permissions:t}=e;return t?.delete},hideModalHeader:!0,modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t,onActionPerformed:o})=>{const[i,u]=(0,l.useState)(!1),{createSuccessNotice:m,createErrorNotice:y}=(0,c.useDispatch)(s.store),{invalidateResolution:_,editEntityRecord:b,saveEditedEntityRecord:x}=(0,c.useDispatch)(a.store),v=e[0],w=(0,r.sprintf)(
21 +(0,l.__)("Error: %s","jetpack"),v)}),(0,n.jsxs)("ul",{children:[(0,n.jsx)("li",{children:j&&(0,c.createInterpolateElement)((0,l.__)("Please check your <link>sending method configuration</link> with your hosting provider.","jetpack"),{link:(0,n.jsx)("a",{href:j,target:"_blank",rel:"noopener noreferrer",onClick:()=>(0,f.yM)("send_preview_email_modal_check_sending_method_configuration_link_clicked")})})}),(0,n.jsx)("li",{children:(0,c.createInterpolateElement)((0,l.__)("Or, sign up for MailPoet Sending Service to easily send emails. <link>Sign up for free</link>","jetpack"),{link:(0,n.jsx)("a",{href:`https://account.mailpoet.com/?s=1&g=1&utm_source=woocommerce_email_editor&utm_medium=plugin&utm_source_platform=${k}`,target:"_blank",rel:"noopener noreferrer",onClick:()=>(0,f.yM)("send_preview_email_modal_sign_up_for_mailpoet_sending_service_link_clicked")},"sign-up-for-free")})})]})]}):null,(0,n.jsx)("p",{children:(0,l.__)("Send yourself a test email to test how your email would look like in different email apps.","jetpack")}),(0,n.jsx)(r.TextControl,{label:(0,l.__)("Send to","jetpack"),onChange:e=>{h(e),(0,f.xW)("send_preview_email_modal_send_to_field_updated")},onKeyDown:e=>{const{keyCode:t}=e;t===d.ENTER&&(e.preventDefault(),w(),(0,f.yM)("send_preview_email_modal_send_to_field_key_code_enter"))},className:"woocommerce-send-preview-email__send-to-field",value:y,type:"email",ref:e,required:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),b===g.T.SUCCESS?(0,n.jsxs)("p",{className:"woocommerce-send-preview-modal-notice-success",children:[(0,n.jsx)(a.A,{icon:i.A,style:{fill:"#4AB866"}}),(0,l.__)("Test email sent successfully!","jetpack")]}):null,(0,n.jsxs)("div",{className:"woocommerce-send-preview-modal-footer",children:[(0,n.jsx)(r.Button,{variant:"tertiary",onClick:()=>{(0,f.yM)("send_preview_email_modal_close_button_clicked"),S()},children:(0,l.__)("Cancel","jetpack")}),(0,n.jsx)(r.Button,{variant:"primary",onClick:()=>{w(),(0,f.yM)("send_preview_email_modal_send_test_email_button_clicked")},disabled:_||!(0,u.isEmail)(y),children:_?(0,l.__)("Sending…","jetpack"):(0,l.__)("Send test email","jetpack")})]})]}):null})},7680(e,t,o){o.d(t,{h:()=>u});var n=o(790),r=o(7143),s=o(7723),a=o(1866),i=o(3656),l=o(3124),c=o(4089),d=o(6816);function u(){const{togglePreviewModal:e}=(0,r.useDispatch)(l.H);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.PluginPreviewMenuItem,{icon:a.A,onClick:()=>{(0,d.yM)("header_preview_dropdown_send_test_email_selected"),e(!0)},children:(0,s.__)("Send a test email","jetpack")}),(0,n.jsx)(c.P,{})]})}},3373(e,t,o){o.d(t,{x:()=>c});var n=o(790),r=o(4997),s=o(6427),a=o(7143),i=o(7723);const l=e=>{const t=(0,r.getBlockSupport)(e,"background");return t&&!1!==t?.backgroundImage};function c(){const e=(0,a.useSelect)(e=>e("core/block-editor").getSelectedBlock(),[]),t=(0,r.hasBlockSupport)(e?.name,"border",!1)||(0,r.hasBlockSupport)(e?.name,"__experimentalBorder",!1);return(0,n.jsxs)(n.Fragment,{children:[t&&(0,n.jsx)(s.Fill,{name:"InspectorControlsBorder",children:(0,n.jsxs)(s.Notice,{className:"woocommerce-grid-full-width",status:"warning",isDismissible:!1,children:[(0,i.__)("Border display may vary or be unsupported in some email clients.","jetpack"),(0,n.jsx)("br",{}),(0,i.__)("Units other than pixels (px) lack support in old email clients.","jetpack")]})}),l(e?.name)&&(0,n.jsx)(s.Fill,{name:"InspectorControlsBackground",children:(0,n.jsx)(s.Notice,{className:"woocommerce-grid-full-width",status:"warning",isDismissible:!1,children:(0,i.__)("Select a background color for email clients that do not support background images.","jetpack")})})]})}},1584(e,t,o){o.d(t,{A:()=>y});var n=o(790),r=o(7723),s=o(692),a=o(3582),i=o(8929),l=o(6087),c=o(7143),d=o(6427),u=o(8537),p=o(4997),m=o(1455),g=o.n(m),f=o(6816);function h(e){return"string"==typeof e.title?(0,u.decodeEntities)(e.title):e.title&&"rendered"in e.title?(0,u.decodeEntities)(e.title.rendered):e.title&&"raw"in e.title?(0,u.decodeEntities)(e.title.raw):""}var y=()=>({id:"reset-email-template",label:(0,r.__)("Reset","jetpack"),supportsBulk:!1,icon:i.A,isEligible(e){if("wp_template"!==e.type)return!1;if("custom"!==e.source)return!1;if(!Boolean(e.plugin)&&!Boolean(e.has_theme_file))return!1;const{permissions:t}=e;return t?.delete},hideModalHeader:!0,modalFocusOnMount:"firstContentElement",RenderModal:({items:e,closeModal:t,onActionPerformed:o})=>{const[i,u]=(0,l.useState)(!1),{createSuccessNotice:m,createErrorNotice:y}=(0,c.useDispatch)(s.store),{invalidateResolution:_,editEntityRecord:b,saveEditedEntityRecord:x}=(0,c.useDispatch)(a.store),v=e[0],k=(0,r.sprintf)(
22 22 // translators: %s: The template's title
23 23 // translators: %s: The template's title
24 -(0,r.__)('Are you sure you want to reset "%s" to default?',"jetpack"),h(v));return(0,n.jsxs)(d.__experimentalVStack,{spacing:"5",children:[(0,n.jsx)(d.__experimentalText,{children:w}),(0,n.jsxs)(d.__experimentalHStack,{justify:"right",children:[(0,n.jsx)(d.Button,{variant:"tertiary",onClick:()=>{t?.(),(0,f.yM)("reset_modal_cancel_button_clicked")},disabled:i,__next40pxDefaultSize:!0,children:(0,r.__)("Cancel","jetpack")}),(0,n.jsx)(d.Button,{variant:"primary",onClick:async()=>{(0,f.yM)("reset_modal_confirm_button_clicked"),u(!0);try{const n=await g()({path:`/wp/v2/templates/${v.id}?context=edit&source=${v.origin}`}),s=(0,p.parse)(n.content?.raw||"");b("postType",v.type,v.id,{blocks:s,content:(0,p.serialize)(s),source:v.origin}),await x("postType",v.type,v.id,{}),await g()({path:`/wp/v2/templates/${v.id}`,method:"DELETE"}),_("getEntityRecord",["postType",v.type,v.id]);const a=(0,r.sprintf)(/* translators: The template's title. */ /* translators: The template's title. */
25 -(0,r.__)('"%s" reset to default.',"jetpack"),h(v));m(a,{type:"snackbar",id:"reset-email-template-action"}),o?.(e),u(!1),t?.()}catch(e){let o=(0,r.__)("An error occurred while resetting the template.","jetpack");e&&"object"==typeof e&&"message"in e&&(o=e.message),(0,f.yM)("reset_modal_error",{errorMessage:o}),y(o,{type:"snackbar"}),u(!1),t?.()}},isBusy:i,disabled:i,__next40pxDefaultSize:!0,children:(0,r.__)("Reset","jetpack")})]})]})}})},5209(e,t,o){o.d(t,{O:()=>g});var n=o(790),r=o(7723),s=o(2619),a=o(6087),i=o(6427),l=o(3656),c=o(9155),d=o(6816);const u={recordEvent:d.yM,recordEventOnce:d.xW,debouncedRecordEvent:d.T7},{Fill:p,Slot:m}=(0,i.createSlotFill)("WooCommerceEmailEditorPostSummarySection");function g(){const e=(0,a.useMemo)(()=>(0,s.applyFilters)("woocommerce_email_editor_setting_sidebar_extension_component",c.O,u),[]);return(0,n.jsxs)(l.PluginDocumentSettingPanel,{name:"email-settings-panel",title:(0,r.__)("Settings","jetpack"),className:"woocommerce-email-editor__settings-panel",children:[(0,n.jsx)(m,{}),(0,n.jsx)(l.ErrorBoundary,{canCopyContent:!0,children:(0,n.jsx)(e,{})})]})}},3364(e,t,o){o.d(t,{c:()=>c});var n=o(790),r=o(7723),s=o(2619),a=o(3656),i=o(6816);const l={recordEvent:i.yM,recordEventOnce:i.xW,debouncedRecordEvent:i.T7};function c(){const e=(0,s.applyFilters)("woocommerce_email_editor_template_sections",[],l);return 0===e.length?null:(0,n.jsx)(a.PluginDocumentSettingPanel,{name:"template-settings-panel",title:(0,r.__)("Settings","jetpack"),className:"woocommerce-email-editor__settings-panel",children:e.map(e=>(0,n.jsx)(a.ErrorBoundary,{children:(0,n.jsx)("div",{children:e.render()},e.id)},`error-boundary-${e.id}`))})}},9034(e,t,o){o.d(t,{Cx:()=>l,DL:()=>c,SG:()=>d});var n=o(6087),r=o(7143),s=o(3124),a=o(1847);const i={color:{text:!0,background:!0,custom:!0}};function l(){return!(0,a.H7)(i)}function c(){const e=(0,r.useSelect)(e=>e(s.H).getTheme(),[]);return(0,n.useMemo)(()=>({...e?.settings,background:{backgroundImage:!1,backgroundSize:!1,gradient:!1}}),[e?.settings])}function d(){return(0,a.sV)(c())}},4751(e,t,o){o.d(t,{m:()=>r});var n=o(6427);const r=n.Navigator||n.__experimentalNavigatorProvider;n.Navigator||(r.Screen=n.__experimentalNavigatorScreen,r.BackButton=n.__experimentalNavigatorBackButton)},9457(e,t,o){o.d(t,{Q:()=>u});var n=o(790),r=o(3022),s=o(7723),a=o(6087),i=o(2484),l=o(6427),c=o(4715);const d={placement:"left-start",offset:36,shift:!0};function u({label:e,hasValue:t,resetValue:o,isShownByDefault:u,inheritedValue:p,userValue:m,setValue:g,colorGradientControlSettings:f}){const h=(0,a.useRef)(null);return(0,n.jsx)(l.__experimentalToolsPanelItem,{className:"block-editor-color-gradient-item block-editor-tools-panel-color-gradient-settings__item",hasValue:t,label:e,onDeselect:o,isShownByDefault:u,children:(0,n.jsx)(l.Dropdown,{popoverProps:d,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:a,isOpen:c})=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.Button,{onClick:a,className:(0,r.A)("block-editor-panel-color-gradient-settings__dropdown",{"is-open":c}),"aria-expanded":c,ref:h,__next40pxDefaultSize:!0,children:(0,n.jsxs)(l.__experimentalHStack,{justify:"flex-start",children:[(0,n.jsx)(l.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:p}),(0,n.jsx)(l.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:e,children:e})]})}),t()&&(0,n.jsx)(l.Button,{__next40pxDefaultSize:!0,label:(0,s.__)("Reset","jetpack"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:i.A,onClick:()=>{o(),c&&a(),h.current?.focus()}})]}),renderContent:()=>(0,n.jsx)(l.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,n.jsx)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:(0,n.jsx)(c.__experimentalColorGradientControl,{...f,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:p,onColorChange:g,clearable:p===m,headingLevel:3})})})})})}},7256(e,t,o){o.d(t,{W:()=>d});var n=o(790),r=o(7723),s=o(8468),a=o(4715),i=o(6427),l=o(665),c=o(6816);function d(){const[e]=(0,a.useSettings)("spacing.units"),t=(0,i.__experimentalUseCustomUnits)({availableUnits:e}),{styles:o,defaultStyles:d,updateStyleProp:u}=(0,l.u)();return(0,n.jsxs)(i.__experimentalToolsPanel,{label:(0,r.__)("Dimensions","jetpack"),resetAll:()=>{u(["spacing"],d.spacing),(0,c.yM)("styles_sidebar_screen_layout_dimensions_reset_all_selected")},children:[(0,n.jsx)(i.__experimentalToolsPanelItem,{isShownByDefault:!0,hasValue:()=>!(0,s.isEqual)(o.spacing.padding,d.spacing.padding),label:(0,r.__)("Padding","jetpack"),onDeselect:()=>{u(["spacing","padding"],d.spacing.padding),(0,c.yM)("styles_sidebar_screen_layout_dimensions_padding_reset_clicked")},className:"tools-panel-item-spacing",children:(0,n.jsx)(a.__experimentalSpacingSizesControl,{allowReset:!0,values:o.spacing.padding,onChange:e=>{u(["spacing","padding"],e),(0,c.T7)("styles_sidebar_screen_layout_dimensions_padding_updated",{value:e})},label:(0,r.__)("Padding","jetpack"),sides:["horizontal","vertical","top","left","right","bottom"],units:t})}),(0,n.jsx)(i.__experimentalToolsPanelItem,{isShownByDefault:!0,label:(0,r.__)("Block spacing","jetpack"),hasValue:()=>o.spacing.blockGap!==d.spacing.blockGap,onDeselect:()=>{u(["spacing","blockGap"],d.spacing.blockGap),(0,c.yM)("styles_sidebar_screen_layout_dimensions_block_spacing_reset_clicked")},className:"tools-panel-item-spacing",children:(0,n.jsx)(a.__experimentalSpacingSizesControl,{label:(0,r.__)("Block spacing","jetpack"),min:0,onChange:e=>{u(["spacing","blockGap"],e.top),(0,c.T7)("styles_sidebar_screen_layout_dimensions_block_spacing_updated",{value:e})},showSideInLabel:!1,sides:["top"],values:{top:o.spacing.blockGap},allowReset:!0})})]})}},4013(e,t,o){o.d(t,{Ay:()=>y,bf:()=>h});var n=o(790),r=o(7723),s=o(6087),a=o(7143),i=o(2267),l=o(6427),c=o(4715),d=o(665),u=o(3124),p=o(1935),m=o(9034),g=o(9457),f=o(6816);const h={textColor:!0,fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!1,textTransform:!1,textDecoration:!1,writingMode:!0,textColumns:!0};var y=function({element:e,headingLevel:t,defaultControls:o=h}){const[y,_]=(0,c.useSettings)("typography.fontSizes","typography.fontFamilies"),b=_?.default||[],x=(0,a.useSelect)(e=>e(u.H).getTheme(),[]),v=(0,c.__experimentalUseMultipleOriginColorsAndGradients)(),w=(0,m.Cx)()&&"text"===e,{styles:k,defaultStyles:j,userStyles:S,updateStyleProp:E,updateStyles:C}=(0,d.u)(),T=(0,p.B)(k,e,t),N=(0,p.B)(j,e,t),{fontFamily:P,fontSize:M,fontStyle:B,fontWeight:A,lineHeight:$,letterSpacing:I,textDecoration:z,textTransform:L}=T.typography,{fontFamily:R,fontSize:H,fontStyle:F,fontWeight:V,lineHeight:O,letterSpacing:D,textDecoration:G,textTransform:W}=N.typography,q=S?.color?.text,U=N.color?.text,K=(0,i.yQ)({settings:x?.settings},"",T.color?.text),J=q?(0,i.yQ)({settings:x?.settings},"",q):void 0,X="heading"!==e||"heading"!==t,Z=(0,s.useCallback)((o,n)=>{E("heading"===e?["elements",t,...o]:"text"===e?[...o]:["elements",e,...o],n)},[e,E,t]),Y=t=>{const o=void 0===t?void 0:(0,i.Px)(x?.settings,void 0,"color.text",t);Z(["color","text"],o),(0,f.T7)("styles_sidebar_screen_typography_element_panel_set_text_color",{element:e,newValue:t,selectedDefaultTextColor:o===U})},Q=t=>{Z(["typography","letterSpacing"],t),(0,f.T7)("styles_sidebar_screen_typography_element_panel_set_letter_spacing",{element:e,newValue:t,selectedDefaultLetterSpacing:t===D})},ee=t=>{Z(["typography","lineHeight"],t),(0,f.T7)("styles_sidebar_screen_typography_element_panel_set_line_height",{element:e,newValue:t,selectedDefaultLineHeight:t===O})},te=o=>{Z(["typography","fontSize"],o),(0,f.T7)("styles_sidebar_screen_typography_element_panel_set_font_size",{element:e,headingLevel:t,newValue:o,selectedDefaultFontSize:o===H})},oe=t=>{Z(["typography","fontFamily"],t),(0,f.T7)("styles_sidebar_screen_typography_element_panel_set_font_family",{element:e,newValue:t,selectedDefaultFontFamily:t===R})},ne=t=>{Z(["typography","textDecoration"],t),(0,f.T7)("styles_sidebar_screen_typography_element_panel_set_text_decoration",{element:e,newValue:t,selectedDefaultTextDecoration:t===G})},re=t=>{Z(["typography","textTransform"],t),(0,f.T7)("styles_sidebar_screen_typography_element_panel_set_text_transform",{element:e,newValue:t,selectedDefaultTextTransform:t===W})},se=({fontStyle:t,fontWeight:o})=>{Z(["typography","fontStyle"],t),Z(["typography","fontWeight"],o),(0,f.T7)("styles_sidebar_screen_typography_element_panel_set_font_appearance",{element:e,newFontStyle:t,newFontWeight:o,selectedDefaultFontStyle:t===F,selectedDefaultFontWeight:o===V})};return(0,n.jsxs)(l.__experimentalToolsPanel,{label:(0,r.__)("Typography","jetpack"),resetAll:()=>{w?C((0,d.n)((0,d.n)(S??{},["color","text"],void 0),["typography"],{})):Z(["typography"],{}),(0,f.yM)("styles_sidebar_screen_typography_element_panel_reset_all_styles_selected",{element:e,headingLevel:t})},children:[w&&(0,n.jsx)(g.Q,{label:(0,r.__)("Color","jetpack"),hasValue:()=>!!q,resetValue:()=>Y(void 0),isShownByDefault:o.textColor,inheritedValue:K,userValue:J,setValue:Y,colorGradientControlSettings:v}),(0,n.jsx)(l.__experimentalToolsPanelItem,{label:(0,r.__)("Font family","jetpack"),hasValue:()=>P!==R,onDeselect:()=>oe(void 0),isShownByDefault:o.fontFamily,children:(0,n.jsx)(c.__experimentalFontFamilyControl,{value:P,onChange:oe,size:"__unstable-large",fontFamilies:b,__nextHasNoMarginBottom:!0})}),X&&(0,n.jsx)(l.__experimentalToolsPanelItem,{label:(0,r.__)("Font size","jetpack"),hasValue:()=>M!==H,onDeselect:()=>te(void 0),isShownByDefault:o.fontSize,children:(0,n.jsx)(l.FontSizePicker,{value:M,onChange:te,fontSizes:y,disableCustomFontSizes:!1,withReset:!1,withSlider:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),(0,n.jsx)(l.__experimentalToolsPanelItem,{className:"single-column",label:(0,r.__)("Appearance","jetpack"),hasValue:()=>A!==V||B!==F,onDeselect:()=>{se({fontStyle:void 0,fontWeight:void 0})},isShownByDefault:o.fontAppearance,children:(0,n.jsx)(c.__experimentalFontAppearanceControl,{value:{fontStyle:B,fontWeight:A},onChange:se,hasFontStyles:!0,hasFontWeights:!0,size:"__unstable-large"})}),(0,n.jsx)(l.__experimentalToolsPanelItem,{className:"single-column",label:(0,r.__)("Line height","jetpack"),hasValue:()=>$!==O,onDeselect:()=>ee(void 0),isShownByDefault:o.lineHeight,children:(0,n.jsx)(c.LineHeightControl,{__nextHasNoMarginBottom:!0,__unstableInputWidth:"auto",value:$,onChange:ee,size:"__unstable-large"})}),(0,n.jsx)(l.__experimentalToolsPanelItem,{className:"single-column",label:(0,r.__)("Letter spacing","jetpack"),hasValue:()=>I!==D,onDeselect:()=>Q(void 0),isShownByDefault:o.letterSpacing,children:(0,n.jsx)(c.__experimentalLetterSpacingControl,{value:I,onChange:Q,size:"__unstable-large",__unstableInputWidth:"auto"})}),(0,n.jsx)(l.__experimentalToolsPanelItem,{className:"single-column",label:(0,r.__)("Text decoration","jetpack"),hasValue:()=>z!==G,onDeselect:()=>ne(void 0),isShownByDefault:o.textDecoration,children:(0,n.jsx)(c.__experimentalTextDecorationControl,{value:z,onChange:ne,size:"__unstable-large",__unstableInputWidth:"auto"})}),(0,n.jsx)(l.__experimentalToolsPanelItem,{label:(0,r.__)("Letter case","jetpack"),hasValue:()=>L!==W,onDeselect:()=>re(W),isShownByDefault:o.textTransform,children:(0,n.jsx)(c.__experimentalTextTransformControl,{value:L,onChange:re,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})})]})}},2620(e,t,o){o.d(t,{A:()=>d});var n=o(790),r=o(7723),s=o(6427),a=o(665),i=o(1935),l=o(6816);function c({element:e,label:t}){const{styles:o}=(0,a.u)(),c=(0,i.B)(o,e,null,!0),{fontFamily:d,fontStyle:u,fontWeight:p,letterSpacing:m,textDecoration:g,textTransform:f}=c.typography,h=c.color?.text||"inherit",y=c.color?.background||"#f0f0f0",_=(0,r.sprintf)(
24 +(0,r.__)('Are you sure you want to reset "%s" to default?',"jetpack"),h(v));return(0,n.jsxs)(d.__experimentalVStack,{spacing:"5",children:[(0,n.jsx)(d.__experimentalText,{children:k}),(0,n.jsxs)(d.__experimentalHStack,{justify:"right",children:[(0,n.jsx)(d.Button,{variant:"tertiary",onClick:()=>{t?.(),(0,f.yM)("reset_modal_cancel_button_clicked")},disabled:i,__next40pxDefaultSize:!0,children:(0,r.__)("Cancel","jetpack")}),(0,n.jsx)(d.Button,{variant:"primary",onClick:async()=>{(0,f.yM)("reset_modal_confirm_button_clicked"),u(!0);try{const n=await g()({path:`/wp/v2/templates/${v.id}?context=edit&source=${v.origin}`}),s=(0,p.parse)(n.content?.raw||"");b("postType",v.type,v.id,{blocks:s,content:(0,p.serialize)(s),source:v.origin}),await x("postType",v.type,v.id,{}),await g()({path:`/wp/v2/templates/${v.id}`,method:"DELETE"}),_("getEntityRecord",["postType",v.type,v.id]);const a=(0,r.sprintf)(/* translators: The template's title. */ /* translators: The template's title. */
25 +(0,r.__)('"%s" reset to default.',"jetpack"),h(v));m(a,{type:"snackbar",id:"reset-email-template-action"}),o?.(e),u(!1),t?.()}catch(e){let o=(0,r.__)("An error occurred while resetting the template.","jetpack");e&&"object"==typeof e&&"message"in e&&(o=e.message),(0,f.yM)("reset_modal_error",{errorMessage:o}),y(o,{type:"snackbar"}),u(!1),t?.()}},isBusy:i,disabled:i,__next40pxDefaultSize:!0,children:(0,r.__)("Reset","jetpack")})]})]})}})},5209(e,t,o){o.d(t,{O:()=>g});var n=o(790),r=o(7723),s=o(2619),a=o(6087),i=o(6427),l=o(3656),c=o(9155),d=o(6816);const u={recordEvent:d.yM,recordEventOnce:d.xW,debouncedRecordEvent:d.T7},{Fill:p,Slot:m}=(0,i.createSlotFill)("WooCommerceEmailEditorPostSummarySection");function g(){const e=(0,a.useMemo)(()=>(0,s.applyFilters)("woocommerce_email_editor_setting_sidebar_extension_component",c.O,u),[]);return(0,n.jsxs)(l.PluginDocumentSettingPanel,{name:"email-settings-panel",title:(0,r.__)("Settings","jetpack"),className:"woocommerce-email-editor__settings-panel",children:[(0,n.jsx)(m,{}),(0,n.jsx)(l.ErrorBoundary,{canCopyContent:!0,children:(0,n.jsx)(e,{})})]})}},3364(e,t,o){o.d(t,{c:()=>c});var n=o(790),r=o(7723),s=o(2619),a=o(3656),i=o(6816);const l={recordEvent:i.yM,recordEventOnce:i.xW,debouncedRecordEvent:i.T7};function c(){const e=(0,s.applyFilters)("woocommerce_email_editor_template_sections",[],l);return 0===e.length?null:(0,n.jsx)(a.PluginDocumentSettingPanel,{name:"template-settings-panel",title:(0,r.__)("Settings","jetpack"),className:"woocommerce-email-editor__settings-panel",children:e.map(e=>(0,n.jsx)(a.ErrorBoundary,{children:(0,n.jsx)("div",{children:e.render()},e.id)},`error-boundary-${e.id}`))})}},9034(e,t,o){o.d(t,{Cx:()=>l,DL:()=>c,SG:()=>d});var n=o(6087),r=o(7143),s=o(3124),a=o(1847);const i={color:{text:!0,background:!0,custom:!0}};function l(){return!(0,a.H7)(i)}function c(){const e=(0,r.useSelect)(e=>e(s.H).getTheme(),[]);return(0,n.useMemo)(()=>({...e?.settings,background:{backgroundImage:!1,backgroundSize:!1,gradient:!1}}),[e?.settings])}function d(){return(0,a.sV)(c())}},4751(e,t,o){o.d(t,{m:()=>r});var n=o(6427);const r=n.Navigator||n.__experimentalNavigatorProvider;n.Navigator||(r.Screen=n.__experimentalNavigatorScreen,r.BackButton=n.__experimentalNavigatorBackButton)},9457(e,t,o){o.d(t,{Q:()=>u});var n=o(790),r=o(3022),s=o(7723),a=o(6087),i=o(2484),l=o(6427),c=o(4715);const d={placement:"left-start",offset:36,shift:!0};function u({label:e,hasValue:t,resetValue:o,isShownByDefault:u,inheritedValue:p,userValue:m,setValue:g,colorGradientControlSettings:f}){const h=(0,a.useRef)(null);return(0,n.jsx)(l.__experimentalToolsPanelItem,{className:"block-editor-color-gradient-item block-editor-tools-panel-color-gradient-settings__item",hasValue:t,label:e,onDeselect:o,isShownByDefault:u,children:(0,n.jsx)(l.Dropdown,{popoverProps:d,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:a,isOpen:c})=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.Button,{onClick:a,className:(0,r.A)("block-editor-panel-color-gradient-settings__dropdown",{"is-open":c}),"aria-expanded":c,ref:h,__next40pxDefaultSize:!0,children:(0,n.jsxs)(l.__experimentalHStack,{justify:"flex-start",children:[(0,n.jsx)(l.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:p}),(0,n.jsx)(l.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:e,children:e})]})}),t()&&(0,n.jsx)(l.Button,{__next40pxDefaultSize:!0,label:(0,s.__)("Reset","jetpack"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:i.A,onClick:()=>{o(),c&&a(),h.current?.focus()}})]}),renderContent:()=>(0,n.jsx)(l.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,n.jsx)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:(0,n.jsx)(c.__experimentalColorGradientControl,{...f,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:p,onColorChange:g,clearable:p===m,headingLevel:3})})})})})}},7256(e,t,o){o.d(t,{W:()=>d});var n=o(790),r=o(7723),s=o(8468),a=o(4715),i=o(6427),l=o(665),c=o(6816);function d(){const[e]=(0,a.useSettings)("spacing.units"),t=(0,i.__experimentalUseCustomUnits)({availableUnits:e}),{styles:o,defaultStyles:d,updateStyleProp:u}=(0,l.u)();return(0,n.jsxs)(i.__experimentalToolsPanel,{label:(0,r.__)("Dimensions","jetpack"),resetAll:()=>{u(["spacing"],d.spacing),(0,c.yM)("styles_sidebar_screen_layout_dimensions_reset_all_selected")},children:[(0,n.jsx)(i.__experimentalToolsPanelItem,{isShownByDefault:!0,hasValue:()=>!(0,s.isEqual)(o.spacing.padding,d.spacing.padding),label:(0,r.__)("Padding","jetpack"),onDeselect:()=>{u(["spacing","padding"],d.spacing.padding),(0,c.yM)("styles_sidebar_screen_layout_dimensions_padding_reset_clicked")},className:"tools-panel-item-spacing",children:(0,n.jsx)(a.__experimentalSpacingSizesControl,{allowReset:!0,values:o.spacing.padding,onChange:e=>{u(["spacing","padding"],e),(0,c.T7)("styles_sidebar_screen_layout_dimensions_padding_updated",{value:e})},label:(0,r.__)("Padding","jetpack"),sides:["horizontal","vertical","top","left","right","bottom"],units:t})}),(0,n.jsx)(i.__experimentalToolsPanelItem,{isShownByDefault:!0,label:(0,r.__)("Block spacing","jetpack"),hasValue:()=>o.spacing.blockGap!==d.spacing.blockGap,onDeselect:()=>{u(["spacing","blockGap"],d.spacing.blockGap),(0,c.yM)("styles_sidebar_screen_layout_dimensions_block_spacing_reset_clicked")},className:"tools-panel-item-spacing",children:(0,n.jsx)(a.__experimentalSpacingSizesControl,{label:(0,r.__)("Block spacing","jetpack"),min:0,onChange:e=>{u(["spacing","blockGap"],e.top),(0,c.T7)("styles_sidebar_screen_layout_dimensions_block_spacing_updated",{value:e})},showSideInLabel:!1,sides:["top"],values:{top:o.spacing.blockGap},allowReset:!0})})]})}},4013(e,t,o){o.d(t,{Ay:()=>y,bf:()=>h});var n=o(790),r=o(7723),s=o(6087),a=o(7143),i=o(2267),l=o(6427),c=o(4715),d=o(665),u=o(3124),p=o(1935),m=o(9034),g=o(9457),f=o(6816);const h={textColor:!0,fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!1,textTransform:!1,textDecoration:!1,writingMode:!0,textColumns:!0};var y=function({element:e,headingLevel:t,defaultControls:o=h}){const[y,_]=(0,c.useSettings)("typography.fontSizes","typography.fontFamilies"),b=_?.default||[],x=(0,a.useSelect)(e=>e(u.H).getTheme(),[]),v=(0,c.__experimentalUseMultipleOriginColorsAndGradients)(),k=(0,m.Cx)()&&"text"===e,{styles:w,defaultStyles:j,userStyles:S,updateStyleProp:E,updateStyles:C}=(0,d.u)(),T=(0,p.B)(w,e,t),P=(0,p.B)(j,e,t),{fontFamily:N,fontSize:M,fontStyle:A,fontWeight:B,lineHeight:L,letterSpacing:I,textDecoration:$,textTransform:R}=T.typography,{fontFamily:z,fontSize:F,fontStyle:H,fontWeight:O,lineHeight:V,letterSpacing:D,textDecoration:G,textTransform:W}=P.typography,q=S?.color?.text,U=P.color?.text,K=(0,i.yQ)({settings:x?.settings},"",T.color?.text),J=q?(0,i.yQ)({settings:x?.settings},"",q):void 0,X="heading"!==e||"heading"!==t,Y=(0,s.useCallback)((o,n)=>{E("heading"===e?["elements",t,...o]:"text"===e?[...o]:["elements",e,...o],n)},[e,E,t]),Z=t=>{const o=void 0===t?void 0:(0,i.Px)(x?.settings,void 0,"color.text",t);Y(["color","text"],o),(0,f.T7)("styles_sidebar_screen_typography_element_panel_set_text_color",{element:e,newValue:t,selectedDefaultTextColor:o===U})},Q=t=>{Y(["typography","letterSpacing"],t),(0,f.T7)("styles_sidebar_screen_typography_element_panel_set_letter_spacing",{element:e,newValue:t,selectedDefaultLetterSpacing:t===D})},ee=t=>{Y(["typography","lineHeight"],t),(0,f.T7)("styles_sidebar_screen_typography_element_panel_set_line_height",{element:e,newValue:t,selectedDefaultLineHeight:t===V})},te=o=>{Y(["typography","fontSize"],o),(0,f.T7)("styles_sidebar_screen_typography_element_panel_set_font_size",{element:e,headingLevel:t,newValue:o,selectedDefaultFontSize:o===F})},oe=t=>{Y(["typography","fontFamily"],t),(0,f.T7)("styles_sidebar_screen_typography_element_panel_set_font_family",{element:e,newValue:t,selectedDefaultFontFamily:t===z})},ne=t=>{Y(["typography","textDecoration"],t),(0,f.T7)("styles_sidebar_screen_typography_element_panel_set_text_decoration",{element:e,newValue:t,selectedDefaultTextDecoration:t===G})},re=t=>{Y(["typography","textTransform"],t),(0,f.T7)("styles_sidebar_screen_typography_element_panel_set_text_transform",{element:e,newValue:t,selectedDefaultTextTransform:t===W})},se=({fontStyle:t,fontWeight:o})=>{Y(["typography","fontStyle"],t),Y(["typography","fontWeight"],o),(0,f.T7)("styles_sidebar_screen_typography_element_panel_set_font_appearance",{element:e,newFontStyle:t,newFontWeight:o,selectedDefaultFontStyle:t===H,selectedDefaultFontWeight:o===O})};return(0,n.jsxs)(l.__experimentalToolsPanel,{label:(0,r.__)("Typography","jetpack"),resetAll:()=>{k?C((0,d.n)((0,d.n)(S??{},["color","text"],void 0),["typography"],{})):Y(["typography"],{}),(0,f.yM)("styles_sidebar_screen_typography_element_panel_reset_all_styles_selected",{element:e,headingLevel:t})},children:[k&&(0,n.jsx)(g.Q,{label:(0,r.__)("Color","jetpack"),hasValue:()=>!!q,resetValue:()=>Z(void 0),isShownByDefault:o.textColor,inheritedValue:K,userValue:J,setValue:Z,colorGradientControlSettings:v}),(0,n.jsx)(l.__experimentalToolsPanelItem,{label:(0,r.__)("Font family","jetpack"),hasValue:()=>N!==z,onDeselect:()=>oe(void 0),isShownByDefault:o.fontFamily,children:(0,n.jsx)(c.__experimentalFontFamilyControl,{value:N,onChange:oe,size:"__unstable-large",fontFamilies:b,__nextHasNoMarginBottom:!0})}),X&&(0,n.jsx)(l.__experimentalToolsPanelItem,{label:(0,r.__)("Font size","jetpack"),hasValue:()=>M!==F,onDeselect:()=>te(void 0),isShownByDefault:o.fontSize,children:(0,n.jsx)(l.FontSizePicker,{value:M,onChange:te,fontSizes:y,disableCustomFontSizes:!1,withReset:!1,withSlider:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),(0,n.jsx)(l.__experimentalToolsPanelItem,{className:"single-column",label:(0,r.__)("Appearance","jetpack"),hasValue:()=>B!==O||A!==H,onDeselect:()=>{se({fontStyle:void 0,fontWeight:void 0})},isShownByDefault:o.fontAppearance,children:(0,n.jsx)(c.__experimentalFontAppearanceControl,{value:{fontStyle:A,fontWeight:B},onChange:se,hasFontStyles:!0,hasFontWeights:!0,size:"__unstable-large"})}),(0,n.jsx)(l.__experimentalToolsPanelItem,{className:"single-column",label:(0,r.__)("Line height","jetpack"),hasValue:()=>L!==V,onDeselect:()=>ee(void 0),isShownByDefault:o.lineHeight,children:(0,n.jsx)(c.LineHeightControl,{__nextHasNoMarginBottom:!0,__unstableInputWidth:"auto",value:L,onChange:ee,size:"__unstable-large"})}),(0,n.jsx)(l.__experimentalToolsPanelItem,{className:"single-column",label:(0,r.__)("Letter spacing","jetpack"),hasValue:()=>I!==D,onDeselect:()=>Q(void 0),isShownByDefault:o.letterSpacing,children:(0,n.jsx)(c.__experimentalLetterSpacingControl,{value:I,onChange:Q,size:"__unstable-large",__unstableInputWidth:"auto"})}),(0,n.jsx)(l.__experimentalToolsPanelItem,{className:"single-column",label:(0,r.__)("Text decoration","jetpack"),hasValue:()=>$!==G,onDeselect:()=>ne(void 0),isShownByDefault:o.textDecoration,children:(0,n.jsx)(c.__experimentalTextDecorationControl,{value:$,onChange:ne,size:"__unstable-large",__unstableInputWidth:"auto"})}),(0,n.jsx)(l.__experimentalToolsPanelItem,{label:(0,r.__)("Letter case","jetpack"),hasValue:()=>R!==W,onDeselect:()=>re(W),isShownByDefault:o.textTransform,children:(0,n.jsx)(c.__experimentalTextTransformControl,{value:R,onChange:re,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})})]})}},2620(e,t,o){o.d(t,{A:()=>d});var n=o(790),r=o(7723),s=o(6427),a=o(665),i=o(1935),l=o(6816);function c({element:e,label:t}){const{styles:o}=(0,a.u)(),c=(0,i.B)(o,e,null,!0),{fontFamily:d,fontStyle:u,fontWeight:p,letterSpacing:m,textDecoration:g,textTransform:f}=c.typography,h=c.color?.text||"inherit",y=c.color?.background||"#f0f0f0",_=(0,r.sprintf)(
26 26 // translators: %s: is a subset of Typography, e.g., 'text' or 'links'.
27 27 // translators: %s: is a subset of Typography, e.g., 'text' or 'links'.
28 -(0,r.__)("Typography %s styles","jetpack"),t);return(0,n.jsx)(s.__experimentalItem,{children:(0,n.jsx)(s.__experimentalNavigatorButton,{path:`/typography/${e}`,"aria-label":_,onClick:()=>(0,l.yM)("styles_sidebar_screen_typography_button_click",{element:e,label:t,path:`typography/${e}`}),children:(0,n.jsxs)(s.__experimentalHStack,{justify:"flex-start",children:[(0,n.jsx)(s.FlexItem,{className:"edit-site-global-styles-screen-typography__indicator",style:{fontFamily:d??"serif",background:y,color:h,fontStyle:u??"normal",fontWeight:p??"normal",letterSpacing:m??"normal",textDecoration:g??("link"===e?"underline":"none"),textTransform:f??"none"},children:"Aa"}),(0,n.jsx)(s.FlexItem,{children:t})]})})})}var d=function(){return(0,n.jsx)(s.Card,{size:"small",variant:"primary",isBorderless:!0,children:(0,n.jsx)(s.CardBody,{children:(0,n.jsxs)(s.__experimentalVStack,{spacing:3,children:[(0,n.jsx)(s.__experimentalHeading,{level:3,className:"edit-site-global-styles-subtitle",children:(0,r.__)("Elements","jetpack")}),(0,n.jsxs)(s.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,size:"small",children:[(0,n.jsx)(c,{element:"text",label:(0,r.__)("Text","jetpack")}),(0,n.jsx)(c,{element:"link",label:(0,r.__)("Links","jetpack")}),(0,n.jsx)(c,{element:"heading",label:(0,r.__)("Headings","jetpack")}),(0,n.jsx)(c,{element:"button",label:(0,r.__)("Buttons","jetpack")})]})]})})})}},7096(e,t,o){o.d(t,{A:()=>a});var n=o(790),r=o(665),s=o(1935);function a({element:e,headingLevel:t}){const{styles:o}=(0,r.u)(),a=(0,s.B)(o,e,t,!0),{fontFamily:i,fontSize:l,fontStyle:c,fontWeight:d,lineHeight:u,letterSpacing:p,textDecoration:m,textTransform:g}=a.typography,f=a.color?.text||"inherit",h=a.color?.background||"#f0f0f0",y="link"===e?{textDecoration:m??"underline"}:{};return(0,n.jsx)("div",{className:"edit-site-typography-preview",style:{fontFamily:i??"serif",background:h,color:f,lineHeight:u,fontSize:l,fontStyle:c,fontWeight:d,letterSpacing:p,textDecoration:m,textTransform:g,...y},children:"Aa"})}},6380(e,t,o){o.d(t,{l:()=>g});var n=o(790),r=o(7143),s=o(6087),a=o(6427),i=o(3124),l=o(665),c=o(3598);const d=[],u={start:{scale:1,opacity:1},hover:{scale:0,opacity:0}},p={hover:{opacity:1},start:{opacity:.5}},m={hover:{scale:1,opacity:1},start:{scale:0,opacity:0}};function g({label:e,isFocused:t,withHoverView:o}){const{colors:g}=(0,r.useSelect)(e=>({colors:e(i.H).getPaletteColors()}),[]),f=(0,s.useMemo)(()=>(g?.theme||d).concat(g?.default||d),[g]),{styles:h}=(0,l.u)(),{backgroundColor:y,headingColor:_,highlightedColors:b}=(0,s.useMemo)(()=>{const e=(0,c.pr)(h?.color?.background)||"white",t=(0,c.pr)(h?.color?.text)||"black",o=(0,c.pr)(h?.elements?.h1?.color?.text)||t,n=(0,c.pr)(h?.elements?.link?.color?.text)||o,r=(0,c.pr)(h?.elements?.button?.color?.background)||n,s=f.find(({color:e})=>e.toLowerCase()===t.toLowerCase()),a=f.find(({color:e})=>e.toLowerCase()===r.toLowerCase()),i=[...s?[s]:d,...a?[a]:d,...f].filter(({color:t},o,n)=>t.toLowerCase()!==e.toLowerCase()&&o===n.findIndex(e=>e.color.toLowerCase()===t.toLowerCase())).slice(0,2);return{backgroundColor:e,headingColor:o,highlightedColors:i}},[h,f]),x=h?.elements?.heading?.typography?.fontWeight||"inherit",v=h?.elements?.heading?.typography?.fontFamily||"inherit",[w,k]=(0,s.useState)(!1);return(0,n.jsx)("div",{onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),children:(0,n.jsxs)(a.__unstableMotion.div,{style:{height:152,width:"100%",background:y,cursor:o?"pointer":void 0},initial:"start",animate:(w||t)&&e?"hover":"start",children:[(0,n.jsx)(a.__unstableMotion.div,{variants:u,style:{height:"100%",overflow:"hidden"},children:(0,n.jsxs)(a.__experimentalHStack,{spacing:10,justify:"center",style:{height:"100%",overflow:"hidden"},children:[(0,n.jsx)(a.__unstableMotion.div,{style:{fontFamily:v,fontSize:65,color:_,fontWeight:x},animate:{scale:1,opacity:1},initial:{scale:.1,opacity:0},transition:{delay:.3,type:"tween"},children:"Aa"}),(0,n.jsx)(a.__experimentalVStack,{spacing:4,children:b.map(({slug:e,color:t},o)=>(0,n.jsx)(a.__unstableMotion.div,{style:{height:32,width:32,background:t,borderRadius:16},animate:{scale:1,opacity:1},initial:{scale:.1,opacity:0},transition:{delay:1===o?.2:.1}},e))})]})}),(0,n.jsx)(a.__unstableMotion.div,{variants:o&&p,style:{height:"100%",width:"100%",position:"absolute",top:0,overflow:"hidden",filter:"blur(60px)",opacity:.1},children:(0,n.jsx)(a.__experimentalHStack,{spacing:0,justify:"flex-start",style:{height:"100%",overflow:"hidden"},children:f.slice(0,4).map(({color:e})=>(0,n.jsx)("div",{style:{height:"100%",background:e,flexGrow:1}},e))})}),(0,n.jsx)(a.__unstableMotion.div,{variants:m,style:{height:"100%",width:"100%",overflow:"hidden",position:"absolute",top:0},children:(0,n.jsx)(a.__experimentalVStack,{spacing:3,justify:"center",style:{height:"100%",overflow:"hidden",padding:10,boxSizing:"border-box"},children:e&&(0,n.jsx)("div",{style:{fontSize:40,fontFamily:v,color:_,fontWeight:x,lineHeight:"1em",textAlign:"center"},children:e})})})]})})}},335(e,t,o){o.d(t,{l:()=>d});var n=o(790),r=o(7723),s=o(6234),a=o(665),i=o(9034),l=o(6816),c=o(1847);function d(){(0,l.xW)("styles_sidebar_screen_background_opened");const{userStyles:e,styles:t,updateStyles:o}=(0,a.u)(),d=(0,i.DL)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.A,{title:(0,r.__)("Background","jetpack"),description:(0,r.__)("Manage the background color of the email.","jetpack")}),(0,n.jsx)(c.D_,{value:e,inheritedValue:t,onChange:e=>{o(e),(0,l.yM)("styles_sidebar_screen_background_styles_updated")},settings:d,panelId:"background"})]})}},423(e,t,o){o.d(t,{f:()=>u});var n=o(790),r=o(7723),s=o(7143),a=o(6234),i=o(665),l=o(3124),c=o(6816),d=o(1847);function u(){(0,c.xW)("styles_sidebar_screen_colors_opened");const{userStyles:e,styles:t,updateStyles:o}=(0,i.u)(),u=(0,s.useSelect)(e=>e(l.H).getTheme(),[]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.A,{title:(0,r.__)("Colors","jetpack"),description:(0,r.__)("Manage palettes and the default color of different global elements.","jetpack")}),(0,n.jsx)(d.oz,{value:e,inheritedValue:t,onChange:e=>{o(e),(0,c.yM)("styles_sidebar_screen_colors_styles_updated")},settings:u?.settings,panelId:"colors"})]})}},6234(e,t,o){o.d(t,{A:()=>c,a:()=>l});var n=o(790),r=o(7723),s=o(9558),a=o(6427),i=o(4751);function l({title:e,description:t,onBack:o}){return(0,n.jsxs)(a.__experimentalVStack,{spacing:0,children:[(0,n.jsx)(a.__experimentalView,{children:(0,n.jsx)(a.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3,children:(0,n.jsxs)(a.__experimentalHStack,{spacing:2,children:[(0,n.jsx)(i.m.BackButton,{style:{minWidth:24,padding:0},icon:s.A,size:"small","aria-label":(0,r.__)("Navigate to the previous view","jetpack"),onClick:o}),(0,n.jsx)(a.__experimentalSpacer,{children:(0,n.jsx)(a.__experimentalHeading,{className:"woocommerce-email-editor-styles-header",level:2,size:13,children:e})})]})})}),t&&(0,n.jsx)("p",{className:"woocommerce-email-editor-styles-header-description",children:t})]})}var c=l},421(e,t,o){o.d(t,{z:()=>l});var n=o(790),r=o(7723),s=o(7256),a=o(6234),i=o(6816);function l(){return(0,i.xW)("styles_sidebar_screen_layout_opened"),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.a,{title:(0,r.__)("Layout","jetpack")}),(0,n.jsx)(s.W,{})]})}},1659(e,t,o){o.d(t,{r:()=>m});var n=o(790),r=o(7723),s=o(135),a=o(4532),i=o(7217),l=o(7480),c=o(6427),d=o(6380),u=o(9034),p=o(6816);function m(){const e=(0,u.SG)();return(0,n.jsx)(c.Card,{size:"small",className:"edit-site-global-styles-screen-root",variant:"primary",children:(0,n.jsx)(c.CardBody,{children:(0,n.jsxs)(c.__experimentalVStack,{spacing:4,children:[(0,n.jsx)(c.Card,{children:(0,n.jsx)(c.CardMedia,{children:(0,n.jsx)(d.l,{})})}),(0,n.jsxs)(c.__experimentalItemGroup,{children:[(0,n.jsx)(c.__experimentalNavigatorButton,{path:"/typography",onClick:()=>(0,p.yM)("styles_sidebar_navigation_click",{path:"typography"}),children:(0,n.jsx)(c.__experimentalItem,{children:(0,n.jsxs)(c.__experimentalHStack,{justify:"flex-start",children:[(0,n.jsx)(c.Icon,{icon:l.A,size:24}),(0,n.jsx)(c.FlexItem,{children:(0,r.__)("Typography","jetpack")})]})})}),(0,n.jsx)(c.__experimentalNavigatorButton,{path:"/colors",onClick:()=>(0,p.yM)("styles_sidebar_navigation_click",{path:"colors"}),children:(0,n.jsx)(c.__experimentalItem,{children:(0,n.jsxs)(c.__experimentalHStack,{justify:"flex-start",children:[(0,n.jsx)(c.Icon,{icon:a.A,size:24}),(0,n.jsx)(c.FlexItem,{children:(0,r.__)("Colors","jetpack")})]})})}),e&&(0,n.jsx)(c.__experimentalNavigatorButton,{path:"/background",onClick:()=>(0,p.yM)("styles_sidebar_navigation_click",{path:"background"}),children:(0,n.jsx)(c.__experimentalItem,{children:(0,n.jsxs)(c.__experimentalHStack,{justify:"flex-start",children:[(0,n.jsx)(c.Icon,{icon:s.A,size:24}),(0,n.jsx)(c.FlexItem,{children:(0,r.__)("Background","jetpack")})]})})}),(0,n.jsx)(c.__experimentalNavigatorButton,{path:"/layout",onClick:()=>(0,p.yM)("styles_sidebar_navigation_click",{path:"layout"}),children:(0,n.jsx)(c.__experimentalItem,{children:(0,n.jsxs)(c.__experimentalHStack,{justify:"flex-start",children:[(0,n.jsx)(c.Icon,{icon:i.A,size:24}),(0,n.jsx)(c.FlexItem,{children:(0,r.__)("Layout","jetpack")})]})})})]})]})})})}},2643(e,t,o){o.d(t,{A:()=>p});var n=o(790),r=o(7723),s=o(6087),a=o(6427),i=o(4013),l=o(7096),c=o(6234),d=o(6816);const u={text:{title:(0,r.__)("Text","jetpack"),description:(0,r.__)("Manage the fonts and typography used on text.","jetpack"),defaultControls:i.bf},link:{title:(0,r.__)("Links","jetpack"),description:(0,r.__)("Manage the fonts and typography used on links.","jetpack"),defaultControls:{...i.bf,textDecoration:!0}},heading:{title:(0,r.__)("Headings","jetpack"),description:(0,r.__)("Manage the fonts and typography used on headings.","jetpack"),defaultControls:{...i.bf,textTransform:!0}},button:{title:(0,r.__)("Buttons","jetpack"),description:(0,r.__)("Manage the fonts and typography used on buttons.","jetpack"),defaultControls:i.bf}};function p({element:e}){(0,d.xW)("styles_sidebar_screen_typography_element_opened",{element:e});const[t,o]=(0,s.useState)("heading");return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.A,{title:u[e].title,description:u[e].description}),(0,n.jsx)(a.__experimentalSpacer,{marginX:4,children:(0,n.jsx)(l.A,{element:e,headingLevel:t})}),"heading"===e&&(0,n.jsx)(a.__experimentalSpacer,{marginX:4,marginBottom:"1em",children:(0,n.jsxs)(a.__experimentalToggleGroupControl,{label:(0,r.__)("Select heading level","jetpack"),hideLabelFromVision:!0,value:t,onChange:e=>{o(e.toString()),(0,d.yM)("styles_sidebar_screen_typography_element_heading_level_selected",{value:e})},isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0,children:[(0,n.jsx)(a.__experimentalToggleGroupControlOption,{value:"heading",label:(0,r._x)("All","heading levels","jetpack")}),(0,n.jsx)(a.__experimentalToggleGroupControlOption,{value:"h1",label:(0,r._x)("H1","Heading Level","jetpack")}),(0,n.jsx)(a.__experimentalToggleGroupControlOption,{value:"h2",label:(0,r._x)("H2","Heading Level","jetpack")}),(0,n.jsx)(a.__experimentalToggleGroupControlOption,{value:"h3",label:(0,r._x)("H3","Heading Level","jetpack")}),(0,n.jsx)(a.__experimentalToggleGroupControlOption,{value:"h4",label:(0,r._x)("H4","Heading Level","jetpack")}),(0,n.jsx)(a.__experimentalToggleGroupControlOption,{value:"h5",label:(0,r._x)("H5","Heading Level","jetpack")}),(0,n.jsx)(a.__experimentalToggleGroupControlOption,{value:"h6",label:(0,r._x)("H6","Heading Level","jetpack")})]})}),(0,n.jsx)(i.Ay,{element:e,headingLevel:t,defaultControls:u[e].defaultControls})]})}},5642(e,t,o){o.d(t,{w:()=>l});var n=o(790),r=o(7723),s=o(2620),a=o(6234),i=o(6816);function l(){return(0,i.xW)("styles_sidebar_screen_typography_opened"),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.A,{title:(0,r.__)("Typography","jetpack"),description:(0,r.__)("Manage the typography settings for different elements.","jetpack")}),(0,n.jsx)(s.A,{})]})}},639(e,t,o){o.d(t,{r:()=>y});var n=o(790),r=o(6087),s=o(7723),a=o(7143),i=o(2141),l=o(3656),c=o(3124),d=o(5642),u=o(421),p=o(1659),m=o(2643),g=o(423),f=o(335),h=o(4751);const y=(0,r.memo)(function(){const{userCanEditGlobalStyles:e}=(0,a.useSelect)(e=>{const{canEdit:t}=e(c.H).canUserEditGlobalEmailStyles();return{userCanEditGlobalStyles:t}},[]);return e&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.PluginSidebarMoreMenuItem,{target:"email-styles-sidebar",icon:i.A,children:(0,s.__)("Email styles","jetpack")}),(0,n.jsx)(l.PluginSidebar,{name:"email-styles-sidebar",icon:i.A,title:(0,s.__)("Styles","jetpack"),className:"woocommerce-email-editor-styles-panel",children:(0,n.jsxs)(h.m,{initialPath:"/",children:[(0,n.jsx)(h.m.Screen,{path:"/",children:(0,n.jsx)(p.r,{})}),(0,n.jsx)(h.m.Screen,{path:"/typography",children:(0,n.jsx)(d.w,{})}),(0,n.jsx)(h.m.Screen,{path:"/typography/text",children:(0,n.jsx)(m.A,{element:"text"})}),(0,n.jsx)(h.m.Screen,{path:"/typography/link",children:(0,n.jsx)(m.A,{element:"link"})}),(0,n.jsx)(h.m.Screen,{path:"/typography/heading",children:(0,n.jsx)(m.A,{element:"heading"})}),(0,n.jsx)(h.m.Screen,{path:"/typography/button",children:(0,n.jsx)(m.A,{element:"button"})}),(0,n.jsx)(h.m.Screen,{path:"/colors",children:(0,n.jsx)(g.f,{})}),(0,n.jsx)(h.m.Screen,{path:"/background",children:(0,n.jsx)(f.l,{})}),(0,n.jsx)(h.m.Screen,{path:"/layout",children:(0,n.jsx)(u.z,{})})]})})]})})},1935(e,t,o){o.d(t,{B:()=>a});var n=o(3764),r=o.n(n);const s={typography:{},color:{}},a=(e,t,o="heading",n=!1)=>{let a;switch(t){case"text":a={typography:e.typography,color:e.color};break;case"heading":a=((e,t="heading",o=!1)=>o?r().all([s,e.elements?.heading||{},e.elements?.[t]||{}]):{...s,...e.elements?.heading||{},...e.elements?.[t]||{}})(e,o??"heading",n);break;default:a=e.elements?.[t]||s}return{...a,typography:a.typography??{},color:a.color??{}}}},4095(e,t,o){o.d(t,{O:()=>f});var n=o(790),r=o(6427),s=o(7143),a=o(3656),i=o(6087),l=o(7723),c=o(3109),d=o(7217),u=o(3124),p=o(6816);const m="woocommerce-email-editor-template-area-affordance-slot",g="woocommerce-email-editor-template-area-affordance-style";function f(){const[e,t]=(0,i.useState)(!1),[o,f]=(0,i.useState)(null),[h,y]=(0,i.useState)(null),_=(0,i.useRef)(null),{canEditTemplates:b,currentPostType:x,onNavigateToEntityRecord:v,template:w}=(0,s.useSelect)(e=>{const t=e(a.store).getEditorSettings();return{canEditTemplates:e(u.H).canUserEditTemplates(),currentPostType:e(a.store).getCurrentPostType(),onNavigateToEntityRecord:t?.onNavigateToEntityRecord,template:e(u.H).getCurrentTemplate()}},[]),k="wp_template"!==x&&b&&!!w?.id&&!!v,j=(0,i.useCallback)(()=>{const e=_.current,t=e?.ownerDocument,o=t?.defaultView;if(!e||!t||!o)return void y(null);const n=e.getBoundingClientRect();if(!n.width||!n.height)return void y(null);const r=o.scrollX,s=o.scrollY,a=n.top>54?n.top+s-50-4:n.bottom+s+4;y({frame:{height:n.height+2,left:n.left+r-1,top:n.top+s-1,width:n.width+2},toolbar:{left:n.left+r-1,top:a}})},[]);(0,i.useEffect)(()=>{if(!k)return t(!1),f(null),y(null),void(_.current=null);let e=0,o=null,n=120;const r=()=>{const t=function(){const e=Array.from(document.querySelectorAll("iframe"));for(const t of e)try{const e=t.contentDocument;if(e?.querySelector(".block-editor-block-list__layout.is-root-container, .is-root-container"))return e}catch(e){}return null}(),s=t&&function(e){const t=e.querySelector('[data-type="core/site-logo"], [data-type="core/site-title"], .wp-block-site-logo, .wp-block-site-title');return t?(o=t).closest("[data-block], .block-editor-block-list__block")||o.closest("[data-type]")||o:null;var o}(t);t&&s?(!function(e){if(e.getElementById(g))return;const t=e.createElement("style");t.id=g,t.textContent='\n.woocommerce-email-editor-template-area-affordance-slot {\n\tbox-sizing: border-box;\n\tinset: 0 auto auto 0;\n\tpointer-events: none;\n\tposition: absolute;\n\tz-index: 29;\n}\n.woocommerce-email-editor-template-area-affordance {\n\talign-items: stretch;\n\tbackground: #fff;\n\tborder: 1px solid #1e1e1e;\n\tborder-radius: 2px;\n\tbox-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);\n\tdisplay: inline-flex;\n\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;\n\tfont-size: 13px;\n\tline-height: 1;\n\tpointer-events: auto;\n\tposition: absolute;\n\tz-index: 30;\n}\n.woocommerce-email-editor-template-area-affordance__frame {\n\tappearance: none;\n\tbackground: transparent;\n\tborder: 1.5px solid transparent;\n\tbox-sizing: border-box;\n\tcursor: pointer;\n\tfont: inherit;\n\tmargin: 0;\n\tpadding: 0;\n\tpointer-events: auto;\n\tposition: absolute;\n\tz-index: 29;\n}\n.woocommerce-email-editor-template-area-affordance__frame:hover,\n.woocommerce-email-editor-template-area-affordance__frame:focus-visible,\n.woocommerce-email-editor-template-area-affordance__frame.is-active {\n\tborder-color: var(--wp-components-color-accent, #3858e9);\n\toutline: none;\n}\n.woocommerce-email-editor-template-area-affordance__label {\n\talign-items: center;\n\tborder-right: 1px solid #ddd;\n\tdisplay: inline-flex;\n\tfont-weight: 500;\n\tgap: 8px;\n\theight: 48px;\n\tpadding: 0 16px;\n\twhite-space: nowrap;\n}\n.woocommerce-email-editor-template-area-affordance__label svg {\n\tfill: currentColor;\n}\n.woocommerce-email-editor-template-area-affordance__button.components-button {\n\tborder-radius: 0;\n\tbox-shadow: none;\n\tcolor: var(--wp-components-color-accent, #3858e9);\n\theight: 48px;\n\tpadding: 0 18px;\n\twhite-space: nowrap;\n}\n.woocommerce-email-editor-template-area-affordance__button.components-button:hover:not(:disabled) {\n\tcolor: var(--wp-components-color-accent, #3858e9);\n}\n.woocommerce-email-editor-template-area-affordance__button.components-button:focus-visible {\n\tbox-shadow: inset 0 0 0 1.5px var(--wp-components-color-accent, #3858e9);\n}\n',e.head.appendChild(t)}(t),o=function(e){let t=e.getElementById(m);return t||(t=e.createElement("div"),t.id=m,t.className="woocommerce-email-editor-template-area-affordance-slot",e.body.appendChild(t)),t}(t),_.current=s,f(o),j()):n>0&&(n--,e=window.requestAnimationFrame(r))};return r(),()=>{e&&window.cancelAnimationFrame(e);const n=o?.ownerDocument;o?.remove(),n?.getElementById(g)?.remove(),t(!1),f(null),y(null),_.current=null}},[k,j]),(0,i.useEffect)(()=>{const e=o?.ownerDocument,n=e?.defaultView;if(!o||!e||!n)return;const r=e=>{e.target instanceof Node&&o.contains(e.target)||t(!1)};return e.addEventListener("mousedown",r),e.addEventListener("scroll",j,!0),n.addEventListener("resize",j),window.addEventListener("resize",j),j(),()=>{e.removeEventListener("mousedown",r),e.removeEventListener("scroll",j,!0),n.removeEventListener("resize",j),window.removeEventListener("resize",j)}},[o,j]);const S=(0,i.useRef)(null),E=(0,i.useRef)(null),C=(0,i.useCallback)(()=>t(!0),[]),T=(0,i.useCallback)(()=>{w?.id&&v&&((0,p.yM)("template_canvas_affordance_edit_template_clicked",{templateId:w.id}),v({postId:w.id,postType:"wp_template"}))},[v,w?.id]),N=(0,i.useCallback)(e=>{e.stopPropagation()},[]);if((0,i.useEffect)(()=>{const e=S.current;if(e)return e.addEventListener("mousedown",N),e.addEventListener("pointerdown",N),e.addEventListener("click",C),()=>{e.removeEventListener("mousedown",N),e.removeEventListener("pointerdown",N),e.removeEventListener("click",C)}},[o,C,N]),(0,i.useEffect)(()=>{const e=E.current;if(e)return e.addEventListener("mousedown",N),e.addEventListener("pointerdown",N),e.addEventListener("click",T),()=>{e.removeEventListener("mousedown",N),e.removeEventListener("pointerdown",N),e.removeEventListener("click",T)}},[e,T,N]),!k||!o||!h)return null;const P=`${m}-toolbar`;return(0,i.createPortal)((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{ref:S,type:"button",className:e?"woocommerce-email-editor-template-area-affordance__frame is-active":"woocommerce-email-editor-template-area-affordance__frame","aria-label":(0,l.__)("Template area","jetpack"),"aria-expanded":e,"aria-controls":e?P:void 0,style:h.frame}),e&&(0,n.jsxs)("div",{id:P,className:"woocommerce-email-editor-template-area-affordance",style:h.toolbar,children:[(0,n.jsxs)("span",{className:"woocommerce-email-editor-template-area-affordance__label",children:[(0,n.jsx)(c.A,{icon:d.A,size:24}),(0,n.jsx)("span",{children:(0,l.__)("Template","jetpack")})]}),(0,n.jsx)(r.Button,{ref:E,className:"woocommerce-email-editor-template-area-affordance__button",variant:"tertiary",children:(0,l.__)("Edit template","jetpack")})]})]}),o)}},7666(e,t,o){o.d(t,{j:()=>a});var n=o(6087),r=o(7494);const s=(0,r.createQueue)();function a({children:e,placeholder:t}){const[o,r]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{const e={};return s.add(e,()=>{(0,n.flushSync)(()=>{r(!0)})}),()=>{s.cancel(e)}},[]),o?e:t}},4324(e,t,o){o.d(t,{i:()=>h});var n=o(790),r=o(6087),s=o(3656),a=o(3582),i=o(7143),l=o(6427),c=o(7723),d=o(528),u=o(3124),p=o(7695),m=o(3345),g=o(6816);const f=(0,r.memo)(function({templates:e,handleTemplateSelection:t,templateSelectMode:o}){const s=(0,i.useSelect)(e=>e(a.store).getBlockPatternCategories(),[]),l="swap"===o,d=(0,r.useMemo)(()=>{const t=function(e,t){const o=new Map(t.map(e=>[e.name,e.label]));o.set("recent",(0,c.__)("Recent","jetpack"));const n=new Set;for(const t of e)t.category&&n.add(t.category);return[...n].map(e=>({name:e,label:o.get(e)??e}))}(e,s??[]);return l?t.filter(e=>"recent"!==e.name):t.sort((e,t)=>"recent"===e.name?-1:"recent"===t.name?1:0)},[e,s,l]),[u,f]=(0,r.useState)(null);return(0,r.useEffect)(()=>{if(null!==u||0===d.length)return;const e=setTimeout(()=>{const e=d.find(e=>"recent"!==e.name)?.name??d[0]?.name;f(e)},1e3);return()=>clearTimeout(e)},[d,u]),(0,n.jsxs)("div",{className:"block-editor-block-patterns-explorer"+(0===d.length?" no-sidebar":""),children:[d.length>0&&(0,n.jsx)(m.t,{templateCategories:d,selectedCategory:u,onClickCategory:e=>{(0,g.yM)("template_select_modal_category_change",{category:e}),f(e)}}),(0,n.jsx)(p.J,{templates:e,onTemplateSelection:t,selectedCategory:u})]})});function h({onSelectCallback:e,closeCallback:t=null,previewContent:o="",postType:r}){const a=o?"swap":"new";(0,g.xW)("template_select_modal_opened",{templateSelectMode:a});const[p,m]=(0,d.p)(o),h=p?.length>0,y=t=>{const n=t.type===r,l=t.template;(0,g.yM)("template_select_modal_template_selected",{templateSlug:t.slug,templateSelectMode:a,templateType:t.type}),o||(0,i.dispatch)(s.store).resetEditorBlocks(t.emailParsed),(0,i.dispatch)(u.H).setTemplateToPost(n?l.template:t.slug),e()},_=()=>{const e=p[0]??null;e&&((0,g.yM)("template_select_modal_handle_close_without_template_selected"),y(e))};return(0,n.jsxs)(l.Modal,{title:"new"===a?(0,c.__)("Start with an email preset","jetpack"):(0,c.__)("Select a template","jetpack"),onRequestClose:()=>((0,g.yM)("template_select_modal_closed",{templateSelectMode:a}),t?t():_()),isFullScreen:!0,children:[(0,n.jsx)(f,{templates:[...p,...m],handleTemplateSelection:y,templateSelectMode:a}),(0,n.jsx)(l.Flex,{className:"email-editor-modal-footer",justify:"flex-end",children:(0,n.jsx)(l.FlexItem,{children:(0,n.jsx)(l.Button,{variant:"tertiary",className:"email-editor-start_from_scratch_button",onClick:()=>((0,g.yM)("template_select_modal_start_from_scratch_clicked"),_()),isBusy:!h,children:(0,c.__)("Start from scratch","jetpack")})})})]})}},3345(e,t,o){o.d(t,{t:()=>s});var n=o(790),r=o(6427);function s({selectedCategory:e,templateCategories:t,onClickCategory:o}){const s="block-editor-block-patterns-explorer__sidebar";return(0,n.jsx)("div",{className:s,children:(0,n.jsx)("div",{className:`${s}__categories-list`,children:t.map(({name:t,label:a})=>(0,n.jsx)(r.Button,{label:a,className:`${s}__categories-list__item`,isPressed:e===t,onClick:()=>{o(t)},children:a},t))})})}},7695(e,t,o){o.d(t,{J:()=>y});var n=o(790),r=o(6087),s=o(3656),a=o(7143),i=o(3109),l=o(2478),c=o(8847),d=o(7723),u=o(6427),p=o(4715),m=o(7666),g=o(1128);function f(){return(0,n.jsxs)("div",{className:"block-editor-inserter__no-results",children:[(0,n.jsx)(i.A,{className:"block-editor-inserter__no-results-icon",icon:l.A}),(0,n.jsx)("p",{children:(0,d.__)("No recent templates.","jetpack")}),(0,n.jsx)("p",{children:(0,d.__)("Your recent creations will appear here as soon as you begin.","jetpack")})]})}const h=(0,r.memo)(function({templates:e,onTemplateSelection:t,selectedCategory:o}){const{layout:r}=(0,a.useSelect)(e=>{const{getEditorSettings:t}=e(s.store),o=t();return{layout:o?.__experimentalFeatures?.layout}}),[i]=(0,g.b)(),l=i.reduce((e,t)=>e+(t.css??""),"")+`.is-root-container { width: ${r?.contentSize||"660px"}; margin: 0 auto; }`;return"recent"===o&&0===e.length?(0,n.jsx)(f,{}):(0,n.jsx)("div",{className:"block-editor-block-patterns-list",role:"listbox",children:e.map(e=>(0,n.jsx)("div",{className:"block-editor-block-patterns-list__list-item email-editor-pattern__list-item",children:(0,n.jsx)("div",{className:"block-editor-block-patterns-list__item",role:"button",tabIndex:0,onClick:()=>{t(e)},onKeyPress:o=>{"Enter"!==o.key&&" "!==o.key||t(e)},children:(0,n.jsxs)(m.j,{placeholder:(0,n.jsx)("p",{children:(0,d.__)("rendering template","jetpack")}),children:[(0,n.jsx)(p.BlockPreview,{blocks:e.previewContentParsed,viewportWidth:900,minHeight:300,additionalStyles:[{css:l}]}),(0,n.jsx)(u.__experimentalHStack,{className:"block-editor-patterns__pattern-details",children:(0,n.jsx)("h4",{className:"block-editor-block-patterns-list__item-title",children:e.displayName})})]})})},`${e.slug}_${e.displayName}_${e.id}`))})},(e,t)=>e.templates.length===t.templates.length&&e.selectedCategory===t.selectedCategory);function y({templates:e,onTemplateSelection:t,selectedCategory:o}){const s=(0,r.useMemo)(()=>null!=o?e.filter(e=>e.category===o):e,[o,e]);return(0,n.jsxs)("div",{className:"block-editor-block-patterns-explorer__list",children:["recent"===o&&(0,n.jsx)("div",{className:"email-editor-recent-templates-info",children:(0,n.jsxs)(u.__experimentalHStack,{spacing:1,expanded:!1,justify:"start",children:[(0,n.jsx)(i.A,{icon:c.A}),(0,n.jsx)("p",{children:(0,d.__)("Templates created on the legacy editor will not appear here.","jetpack")})]})}),(0,n.jsx)(h,{templates:s,onTemplateSelection:t,selectedCategory:o})]})}},1513(e,t,o){o.d(t,{x:()=>i});var n=o(790),r=o(7143),s=o(3124),a=o(4324);function i(){const{emailContentIsEmpty:e,templateSelected:t,postType:o}=(0,r.useSelect)(e=>({emailContentIsEmpty:e(s.H).hasEmptyContent(),templateSelected:e(s.H).isTemplateSelected(),postType:e(s.H).getEmailPostType()}),[]),{setTemplateSelected:i}=(0,r.useDispatch)(s.H);return!e||t?null:(0,n.jsx)(a.i,{onSelectCallback:()=>{i()},postType:o})}},8992(e,t,o){o.d(t,{G:()=>s,h:()=>a});var n=o(4997);const r=new Map;function s(e,t){const o=(0,n.getBlockType)(e);if(!o)return!1;const{name:s,...a}=o;try{r.has(s)||r.set(s,{...a});const e=t(a),o={...a,...e};return(0,n.unregisterBlockType)(s),(0,n.registerBlockType)(s,o),!0}catch(t){return console.error("Failed to update block settings for",e,t),!1}}function a(){const e=[];for(const[t,o]of r.entries())try{(0,n.unregisterBlockType)(t),(0,n.registerBlockType)(t,o),e.push(t),r.delete(t)}catch(e){console.error("Failed to restore block settings for",t,e)}return e}},8845(e,t,o){o.d(t,{oj:()=>i,r8:()=>l});var n=o(4997),r=o(7143);const s=new Set,a=new Map;function i(e,t){const o=((0,r.select)("core/blocks").getBlockStyles(e)||[]).find(e=>e.name===t);if(o){const n=a.get(e)||[];n.find(e=>e.name===t)||(n.push(o),a.set(e,n))}(0,n.unregisterBlockStyle)(e,t)}function l(){for(const e of s){const[t,o]=e.split("||");(0,n.unregisterBlockStyle)(t,o)}s.clear();for(const[e,t]of a.entries())t.forEach(t=>(0,n.registerBlockStyle)(e,t)),a.delete(e)}},8848(e,t,o){o.d(t,{$:()=>a,z:()=>s});var n=o(4997);const r=new Set;function s(e,t){(0,n.registerBlockVariation)(e,t),r.add(function(e,t){return`${e}||${t}`}(e,t.name))}function a(){for(const e of r){const[t,o]=e.split("||");(0,n.unregisterBlockVariation)(t,o)}r.clear()}},7847(e,t,o){o.d(t,{HY:()=>i,hC:()=>c,tN:()=>l});var n=o(2619);const r=new Set,s=new Set;function a(e,t){return`${e}||${t}`}function i(e,t,o,s){(0,n.addFilter)(e,t,o,s),r.add(a(e,t))}function l(e,t,o,r){(0,n.addAction)(e,t,o,r),s.add(a(e,t))}function c(){!function(){for(const e of r){const[t,o]=e.split("||");(0,n.removeFilter)(t,o),r.delete(e)}}(),function(){for(const e of s){const[t,o]=e.split("||");(0,n.removeAction)(t,o),s.delete(e)}}()}},444(e,t,o){o.d(t,{aW:()=>l,gG:()=>a,le:()=>i});var n=o(876);const r=new Set,s=new Map;function a(e,t){(0,n.registerFormatType)(e,{object:!1,...t}),r.add(e)}function i(e){const t=(0,n.unregisterFormatType)(e);t&&s.set(e,t)}function l(){for(const e of r)(0,n.unregisterFormatType)(e);r.clear();for(const[e,t]of s.entries())(0,n.registerFormatType)(e,{object:!1,...t}),s.delete(e)}},3588(e,t,o){o.d(t,{IF:()=>l});var n=o(8845),r=o(8848),s=o(444),a=o(7847),i=o(8992);function l(){(0,i.h)(),(0,n.r8)(),(0,r.$)(),(0,s.aW)(),(0,a.hC)()}},390(e,t,o){o.d(t,{w:()=>N});var n=o(790),r=o(7143),s=o(6087),a=o(2619),i=o(3656),l=o(9491),c=(o(2005),o(2318)),d=o(9791),u=o(265),p=o(5183),m=o(3124),g=o(7380),f=o(5885),h=o(2743),y=o(256),_=o(2259),b=o(721),x=o(38),v=o(9971),w=o(6477),k=o(8766),j=o(2104),S=o(3588),E=o(4368);function C({postId:e,postType:t,isPreview:o=!1,contentRef:a=null,customSavePanel:i,customSaveButton:c}){const[u,g]=(0,s.useState)(!1),{settings:f}=(0,r.useSelect)(e=>({settings:e(m.H).getInitialEditorSettings()}),[]);(0,v.M)(),(0,w.u)(),(0,j.T)();const{setEmailPost:h}=(0,r.useDispatch)(m.H);(0,s.useEffect)(()=>{h(e,t),g(!0)},[e,t,h]);const y=(0,k.r)(),_=(0,l.useMergeRefs)([y,a]),b=(0,s.useMemo)(()=>({...f,allowedBlockTypes:(0,d.G)(),isPreviewMode:o,responsiveEditingEnabled:!1}),[f,o]);return u?(0,n.jsx)(s.StrictMode,{children:(0,n.jsx)(p.w,{postId:e,postType:t,settings:b,contentRef:_,customSavePanel:i,customSaveButton:c})}):null}function T(){(0,a.hasFilter)("sync.providers","woocommerce/email-editor/disable-collab")||(window._wpCollaborationEnabled&&(window._wpCollaborationEnabled=!1),(0,a.addFilter)("sync.providers","woocommerce/email-editor/disable-collab",()=>[],1e3)),(0,h.K)(),(0,y.h)(),(0,_.Y)(),(0,g.y$)(),(0,b.J)(),(0,c.X)(),(0,x.X)(),(0,f.I)(),(0,u.xc)()}function N({postId:e,postType:t,isPreview:o=!1,contentRef:l=null,config:c,customSavePanel:d,customSaveButton:u}){const[p,g]=(0,s.useState)(!1);(0,s.useEffect)(()=>{const e=(0,r.select)(i.store).getEditorSettings(),t=c||(0,E.q)();return T(),(0,r.dispatch)(m.H).setEditorConfig(t),g(!0),()=>{try{(0,S.IF)()}finally{(0,r.dispatch)(i.store).updateEditorSettings(e)}}},[c]);const f=(0,a.applyFilters)("woocommerce_email_editor_wrap_editor_component",C);return p?(0,n.jsx)(f,{postId:e,postType:t,isPreview:o,contentRef:l,customSavePanel:d,customSaveButton:u}):null}},2259(e,t,o){o.d(t,{Y:()=>i});var n=o(7723),r=o(6816);let s=[];function a(e){s.forEach(t=>{const o=e.target?.matches?.(t.selector)?e.target:e.target?.closest?.(t.selector);o&&("function"==typeof t.track?t.track(o,e):(0,r.yM)(t.track))})}function i(){(0,r.V1)()&&(s=[{track:"header_preview_dropdown_preview_in_new_tab_selected",selector:'.editor-preview-dropdown__button-external, a[role="menuitem"][target^="wp-preview-"]'},{track:()=>{const e=document.getElementsByClassName("is-collapsed editor-collapsible-block-toolbar").length;(0,r.yM)("header_blocks_tool_button_clicked",{isBlockToolsCollapsed:e})},selector:".editor-collapsible-block-toolbar__toggle"},{track:e=>{const t=e.classList.contains("is-opened");(0,r.yM)("header_more_menu_dropdown_toggle",{isOpened:t})},selector:`.components-dropdown-menu__toggle[aria-label="${(0,n.__)("Options","jetpack")}"]`},{track:e=>{(e.textContent===(0,n.__)("Save","jetpack")&&"false"===e.getAttribute("aria-disabled")||e.textContent===(0,n.__)("Saving…","jetpack"))&&(0,r.yM)("header_save_button_clicked")},selector:".editor-post-publish-button"},{track:"header_save_email_button_clicked",selector:".editor-post-saved-state.is-saving"},{track:"inserter_sidebar_library_close_icon_clicked",selector:".block-editor-inserter__menu .block-editor-tabbed-sidebar__close-button"},{track:e=>{const t=e.classList.contains("is-opened");(0,r.yM)("header_preview_dropdown_clicked",{isOpened:t})},selector:".editor-preview-dropdown__toggle"},{track:()=>{(0,r.yM)("sidebar_tab_selected",{tab:"document"})},selector:'[data-tab-id="edit-post/document"]'},{track:()=>{(0,r.yM)("sidebar_tab_selected",{tab:"block"})},selector:'[data-tab-id="edit-post/block"]'},{track:e=>{const t=e.classList.contains("is-pressed");(0,r.yM)("header_inserter_sidebar_clicked",{isOpened:t})},selector:".editor-document-tools__inserter-toggle"},{track:e=>{const t=e.classList.contains("is-pressed");(0,r.yM)("header_listview_sidebar_clicked",{isOpened:t})},selector:".editor-document-tools__document-overview-toggle"},{track:e=>{(0,r.yM)("command_bar_command_clicked",{command:e.dataset?.value})},selector:'.commands-command-menu__container [role="option"]'}],document.addEventListener("click",a))}},2743(e,t,o){o.d(t,{K:()=>a});var n=o(2619),r=o(6816);const s=e=>{(0,n.doAction)("woocommerce_email_editor_events",e.detail)},a=()=>{(0,r.V1)()&&r.oh.addEventListener(r.vD,s)};window.addEventListener("unload",function(){(0,r.V1)()&&r.oh.removeEventListener(r.vD,s)})},6816(e,t,o){o.d(t,{T7:()=>d,V1:()=>s,oh:()=>i,vD:()=>a,xW:()=>c,yM:()=>l});var n=o(8468),r=o(2619);const s=()=>(0,r.applyFilters)("woocommerce_email_editor_events_tracking_enabled",!1),a="email_editor_events",i=new EventTarget,l=(e,t={})=>{if(!s())return;const o={name:`${a}_${e}`,..."object"!=typeof t?{data:t}:t};i.dispatchEvent(new CustomEvent(a,{detail:o}))},c=function(){const e={};return(t,o={})=>{if(!s())return;const n=`${t}_${JSON.stringify(o).length}`;e[n]||(l(t,o),e[n]=!0)}}(),d=(0,n.debounce)(l,700)},256(e,t,o){o.d(t,{h:()=>p});var n=o(7143),r=o(1233),s=o(3656),a=o(7723),i=o(6816);const l=(...e)=>{const t=(0,n.select)(s.store).isInserterOpened(),o=!!document.getElementsByClassName("block-editor-inserter__quick-inserter").length;let r="other_inserter";t?r="inserter_sidebar":o&&(r="quick_inserter");const a=e[0],l=e[5];!1===Array.isArray(a)&&"object"==typeof a&&(0,i.yM)(`${r}_library_block_selected`,{blockName:a.name}),Array.isArray(a)&&l&&l.patternName&&(0,i.yM)(`${r}_library_pattern_selected`,{patternName:l.patternName})},c={"core/editor":{autosave:"editor_content_auto_saved",setDeviceType:e=>{(0,i.yM)(`header_preview_dropdown_${e.toLowerCase()}_selected`)},setRenderingMode:e=>{if((0,n.select)(s.store).getRenderingMode()===e)return;!!document.querySelector(`[aria-label="${(0,a.__)("View options","jetpack")}"]`)&&(0,i.yM)("preview_dropdown_rendering_mode_changed",{renderingMode:e})}},"core/block-editor":{insertBlock:l,insertBlocks:l},"core/preferences":{set:(e,t,o)=>{if((0,n.select)(r.store).get(e,t)===o)return;const s={focusMode:"focus_mode_toggle",fullscreenMode:"full_screen_mode_toggle",distractionFree:"distraction_free_toggle",fixedToolbar:"fixed_toolbar_toggle"};s[t]&&(0,i.yM)(s[t],{isEnabled:o})}},"core/commands":{open:"command_menu_opened",close:"command_menu_closed"}},d={},u={},p=()=>{(0,i.V1)()&&(0,n.use)(e=>({dispatch:t=>{const o="object"==typeof t?t.name:t,n=e.dispatch(o),r=c[o];if(!r)return n;d[o]||(d[o]={}),u[o]||(u[o]={});for(const[e,t]of Object.entries(r))u[o][e]||(u[o][e]=n[e],d[o][e]=(...n)=>{try{"function"==typeof t?t(...n):"string"==typeof t&&(0,i.yM)(t)}catch(e){console.error("Error tracking event",e)}return u[o][e](...n)}),n[e]=d[o][e];return n}}))}},38(e,t,o){o.d(t,{X:()=>s});var n=o(8611),r=o(4744);function s(){(0,r.X)(),(0,n._)()}},8611(e,t,o){o.d(t,{_:()=>i});var n=o(1847),r=o(7847),s=o(1584);const a=e=>{"wp_template"===e&&((0,n.yd)("postType",e,"duplicate-post"),(0,n.yd)("postType",e,"reset-post"),(0,n.Bi)("postType",e,(0,s.A)()))};function i(){(0,r.tN)("core.registerPostTypeSchema","woocommerce-email-editor/modify-template-actions",e=>{a(e)}),(0,r.tN)("core.registerPostTypeActions","woocommerce-email-editor/modify-template-actions",e=>{a(e)})}},4744(e,t,o){o.d(t,{X:()=>i});var n=o(1847),r=o(7847),s=o(3242);const a=e=>{(0,n.yd)("postType",e,"move-to-trash"),(0,n.Bi)("postType",e,(0,s.A)())};function i(){(0,r.tN)("core.registerPostTypeSchema","woocommerce-email-editor/modify-move-to-trash-action",e=>{a(e)}),(0,r.tN)("core.registerPostTypeActions","woocommerce-email-editor/modify-move-to-trash-action",e=>{a(e)})}},1324(e,t,o){o.d(t,{g:()=>s});var n=o(790),r=o(6087);function s({children:e}){const[t]=(0,r.useState)(document.createElement("div"));return(0,r.useEffect)(()=>{const e=document.getElementsByClassName("editor-visual-editor ")[0];e&&e.parentNode?.insertBefore(t,e)},[t]),(0,r.createPortal)((0,n.jsx)(n.Fragment,{children:e}),t)}},4291(e,t,o){o.d(t,{L:()=>c});var n=o(790),r=o(6087),s=o(7143),a=o(3656),i=o(2614);function l({children:e}){const t=(0,r.useRef)(document.createElement("div"));return(0,r.useEffect)(()=>{const e=document.getElementsByClassName("editor-post-publish-button__button")[0];e&&e.parentNode?.insertBefore(t.current,e.nextSibling)},[t]),(0,r.createPortal)((0,n.jsx)(n.Fragment,{children:e}),t.current)}function c(){const e=(0,r.useRef)(null),{hasNonPostEntityChanges:t,isEditedPostDirty:o,isEditingTemplate:c}=(0,s.useSelect)(e=>({hasNonPostEntityChanges:e(a.store).hasNonPostEntityChanges(),isEditedPostDirty:e(a.store).isEditedPostDirty(),isEditingTemplate:"wp_template"===e(a.store).getCurrentPostType()}),[]),d=c||t||o&&t,u=(0,r.useCallback)((e,t)=>{t&&e.classList.contains("force-hidden")&&e.classList.remove("force-hidden"),t||e.classList.contains("force-hidden")||e.classList.add("force-hidden")},[]);return(0,r.useEffect)(()=>{const t=document.getElementsByClassName("editor-post-publish-button__button")[0];return u(t,d),t?(e.current&&e.current.disconnect(),e.current=new MutationObserver(()=>{u(t,d)}),e.current.observe(t,{attributes:!0,childList:!0,subtree:!1}),()=>e.current?.disconnect()):()=>e.current?.disconnect()},[d,u]),(0,n.jsx)(l,{children:!d&&(0,n.jsx)(i.J,{})})}},9971(e,t,o){o.d(t,{M:()=>u});var n=o(6087),r=o(7143),s=o(3582),a=o(2619),i=o(3124),l=o(4515),c=o(7711);const d=[],u=()=>{const{addValidationNotice:e,hasValidationNotice:t,removeValidationNotice:o}=(0,c.k)(),{editedContent:u,editedTemplateContent:p}=(0,r.useSelect)(e=>({editedContent:e(i.H).getEditedEmailContent(),editedTemplateContent:e(i.H).getCurrentTemplateContent()})),m=(0,l.c)(u),g=(0,l.c)(p),f=(0,n.useCallback)(()=>((e,t,{addValidationNotice:o,hasValidationNotice:n,removeValidationNotice:r})=>{const s=(0,a.applyFilters)("woocommerce_email_editor_content_validation_rules",d);let i=!0;return s.forEach(({id:s,testContent:a,message:l,actions:c})=>{a(e+t)?(o(s,l,c),i=!1):n(s)&&r(s)}),i})(m,g,{addValidationNotice:e,hasValidationNotice:t,removeValidationNotice:o}),[m,g,e,o,t]);return(0,n.useEffect)(()=>((0,r.dispatch)(i.H).setContentValidation({validateContent:f}),()=>{(0,r.dispatch)(i.H).setContentValidation(void 0)}),[f]),(0,n.useEffect)(()=>{const e=(0,r.subscribe)(()=>{t()&&f()},s.store);return()=>e()},[t,f]),{validateContent:f}}},1128(e,t,o){o.d(t,{b:()=>m});var n=o(6087),r=o(7143),s=o(3656),a=o(3764),i=o.n(a),l=o(3124),c=o(6967),d=o(8498),u=o(3598);const p=[];function m(){const{userTheme:e}=(0,c.u)(),{editorTheme:t,layout:o,deviceType:a,initialEditorSettingsStyles:m}=(0,r.useSelect)(e=>{const{getEditorSettings:t,getDeviceType:o}=e(s.store),n=t(),r=e(l.H).getInitialEditorSettings();return{editorTheme:e(l.H).getTheme(),layout:n?.__experimentalFeatures?.layout,deviceType:o(),initialEditorSettingsStyles:r?.styles}},[]),g=(0,n.useMemo)(()=>i().all([{},t||{},e||{}]),[t,e]),[f]=(0,d.e)(g);let h="";o&&"Mobile"!==a&&(h=`display:flow-root; width:${o?.contentSize||"660px"}; margin: 0 auto;box-sizing: border-box;max-width: 100%;`);const y=g.styles?.spacing?.padding;y&&(h+=`padding-left:${(0,u.DJ)(y.left)};`,h+=`padding-right:${(0,u.DJ)(y.right)};`);return[(0,n.useMemo)(()=>[...f??[],{css:`.is-root-container{ ${h} }`},...m??[]],[f,m,h])||p]}},665(e,t,o){o.d(t,{n:()=>u,u:()=>m});var n=o(3764),r=o.n(n),s=o(7143),a=o(6087),i=o(3124),l=o(6967);const c={};function d(e){return!Object.keys(e).some(t=>Object.keys(e[t]).length>0)}function u(e,t,o){const n=Array.isArray(t)?[...t]:[t],r=Array.isArray(e)?[...e]:{...e},s=n.pop();let a=r;return n.forEach(e=>{const t=a[e];a[e]=Array.isArray(t)?[...t]:{...t},a=a[e]}),a[s]=o,r}function p(e){const t=e=>{if("object"==typeof e&&null!==e||void 0===e){if(Array.isArray(e)&&0===e.length)return;for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)){const n=t(e[o]);void 0===n||d(n)?delete e[o]:e[o]=n}}return e};return t(e)}const m=()=>{const{userTheme:e,updateUserTheme:t}=(0,l.u)(),o=(0,a.useMemo)(()=>e?p(function(e){const t=e=>{if("object"==typeof e&&null!==e)for(const o in e)e.hasOwnProperty(o)&&(e[o]=t(e[o]));else if("string"==typeof e)return e.replace(/var\(--([a-z]+)--([a-z]+(?:--[a-z0-9]+(?:-[a-z0-9]+)*)*)--([a-z0-9-]+)\)/g,(e,t,o,n)=>`var:${o.split("--").concat(n).join("|")}`);return e};return t(e)}(e?.styles)):c,[e]),{styles:n}=(0,s.useSelect)(e=>({styles:e(i.H).getStyles()})),d=(0,a.useCallback)(o=>{const n={...e,styles:p(o)};t(n)},[t,e]),m=(0,a.useCallback)((o,n)=>{const r=u(e,["styles",...o],n);t(r)},[t,e]);return{styles:(0,a.useMemo)(()=>n?o?r().all([n,o]):n:c,[n,o]),userStyles:e?.styles,defaultStyles:n,updateStyleProp:m,updateStyles:d}}},8766(e,t,o){o.d(t,{r:()=>i});var n=o(6087),r=o(2619),s=o(7143),a=o(3656);const i=()=>{const e=(0,n.useRef)(null),[t,o]=(0,n.useState)(0),i=(0,n.useCallback)(t=>{e.current=t,o(e=>++e)},[e,o]),l=(0,s.useSelect)(e=>{const{getEditorSettings:t}=e(a.store);return t()?.allowedIframeStyleHandles??[]});return(0,n.useEffect)(()=>{if(!e.current)return;const{ownerDocument:t}=e.current;Array.from(document.styleSheets).filter(e=>{if(!(e?.ownerNode instanceof Element))return!1;const t=e.ownerNode.getAttribute("id"),o=t&&!l.includes(t);return(0,r.applyFilters)("woocommerce_email_editor_iframe_stylesheet_should_remove",o,e)}).map(e=>e.ownerNode.getAttribute("id")).forEach(e=>{const o=t.getElementById(e);o&&o.remove();const n=t.createElement("style");n.id=e,t.head.appendChild(n)})},[l,t]),i}},8498(e,t,o){o.d(t,{e:()=>i});var n=o(5046),r=o(6087);const s={},a=[],i=(e={})=>(0,r.useMemo)(()=>{if(!e?.styles||!e?.settings)return[a,s];return(0,n.xn)(e,[],{hasBlockGapSupport:!0,hasFallbackGapSupport:!1,disableLayoutStyles:!1,disableRootPadding:!1})},[e])},3707(e,t,o){o.d(t,{c:()=>a});var n=o(6087),r=o(7143),s=o(3656);function a(e,t,o){const[a,i]=(0,n.useReducer)((e,{type:t,post:o,previousRenderingMode:n})=>"push"===t?[...e,{post:o,previousRenderingMode:n}]:"pop"===t&&e.length>1?e.slice(0,-1):e,[{post:{postId:e,postType:t}}]),{post:l,previousRenderingMode:c}=a[a.length-1],{getRenderingMode:d}=(0,r.useSelect)(s.store),{setRenderingMode:u}=(0,r.useDispatch)(s.store),p=(0,n.useCallback)(e=>{i({type:"push",post:{postId:e.postId,postType:e.postType},previousRenderingMode:d()}),u(o)},[d,u,o]),m=(0,n.useCallback)(()=>{i({type:"pop"}),c&&u(c)},[u,c]);return{currentPost:l,onNavigateToEntityRecord:p,onNavigateToPreviousEntityRecord:a.length>1?m:void 0}}},2104(e,t,o){o.d(t,{T:()=>c});var n=o(6087),r=o(7143),s=o(7723),a=o(692);function i(e){const t={"site-editor-save-success":{content:(0,s.__)("Email design updated.","jetpack"),removeActions:!0},"editor-save":{content:(0,s.__)("Email saved.","jetpack"),removeActions:!1,contentCheck:e=>e.includes((0,s.__)("Post updated.","jetpack"))||e.includes((0,s.__)("Post published.","jetpack"))}}[e.id];return t?t.contentCheck&&!t.contentCheck(e.content)?e:{...e,content:t.content,spokenMessage:t.content,actions:t.removeActions?[]:e.actions}:e}const l=(0,r.createSelector)(e=>function(e){return e.map(e=>i(e))}(e),e=>[e]);function c(){(0,n.useEffect)(()=>{let e;return(0,r.use)(t=>(e=t.select,{select:t=>{if(function(e){return"object"==typeof e?e.name:e}(t)!==a.store.name)return e(t);const o=e(t),n=o.getNotices;return n?{...o,getNotices:e=>l(n(e))}:o}})),()=>{(0,r.use)(()=>({select:e}))}},[])}},528(e,t,o){o.d(t,{p:()=>u});var n=o(6087),r=o(4997),s=o(7143),a=o(2619),i=o(3124);const l=[];function c(e,t){return e.map(e=>"core/post-content"===e.name?{...e,name:"core/group",innerBlocks:t}:e.innerBlocks?.length?{...e,innerBlocks:c(e.innerBlocks,t)}:e)}const d={};function u(e="",t=!0){const{templates:o,patterns:u,emailPosts:p,hasEmailPosts:m}=(0,s.useSelect)(o=>{const n=t&&"swap"!==e?o(i.H).getSentEmailEditorPosts():void 0;return{templates:o(i.H).getEmailTemplates(),patterns:o(i.H).getBlockPatternsForEmailTemplate(),emailPosts:n,hasEmailPosts:!(!n||!n?.length)}},[e,t]),g=(0,n.useMemo)(()=>{let t=[];const n=e&&(0,r.parse)(e);if(t=n?[{blocks:n}]:u,!t||!o)return l;const s=[];return o?.filter(e=>"email-general"!==e.slug)?.forEach(e=>{t?.forEach(t=>{let o=(0,r.parse)(e.content?.raw);o=c(o,t.blocks),s.push({id:e.id,slug:e.slug,previewContentParsed:o,emailParsed:t.emailBlocks??t.blocks,template:e,category:t.categories?.[0],type:e.type,displayName:t.title?`${e.title.rendered} - ${t.title}`:e.title.rendered})})}),s},[o,u,e]),f=(0,n.useMemo)(()=>p?.map(e=>{const t=(0,a.applyFilters)("woocommerce_email_editor_preferred_template_title","",e),{postTemplateContent:o}=function(e,t=[]){const o=e.template,n={postTemplateContent:null};if(!o)return n;if(d[o])return d[o];const r=t.find(e=>e.slug===o);if(!r)return n;const s={postTemplateContent:r?.template};return d[o]=s,s}(e,g),n=(0,r.parse)(e.content?.raw);let s=n;o?.content?.raw&&(s=c((0,r.parse)(o?.content?.raw),n));const i={...e,title:{raw:e.title.raw,rendered:t||e.title.rendered}};return{id:e.id,slug:e.slug,previewContentParsed:s,emailParsed:n,category:"recent",type:e.type,displayName:i.title.rendered,template:i}}),[p,g]);return[g||l,f||l,m]}},6477(e,t,o){o.d(t,{u:()=>i});var n=o(6087),r=o(7143),s=o(7723),a=o(692);const i=()=>{const e=(0,n.useMemo)(()=>{const e=(0,s.__)("Saving failed.","jetpack");return new RegExp("^"+e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))},[]);(0,n.useEffect)(()=>{const t=(0,r.subscribe)(()=>{(0,r.select)(a.store).getNotices().forEach(t=>{"string"==typeof t.content&&e.test(t.content)&&(0,r.dispatch)(a.store).removeNotice(t.id)})});return()=>{t()}},[e])}},4515(e,t,o){o.d(t,{c:()=>a});var n=o(6087),r=o(923),s=o.n(r);function a(e){const t=(0,n.useRef)(e);return s()(e,t.current)||(t.current=e),t.current}},6967(e,t,o){o.d(t,{u:()=>i});var n=o(6087),r=o(7143),s=o(3582),a=o(3124);function i(){const{globalStylePost:e}=(0,r.useSelect)(e=>({globalStylePost:e(a.H).getGlobalEmailStylesPost()||null}),[]);return{userTheme:(0,n.useMemo)(()=>({settings:e?.settings,styles:e?.styles}),[e?.settings,e?.styles]),updateUserTheme:(0,n.useCallback)(t=>{e&&(0,r.dispatch)(s.store).editEntityRecord("root","globalStyles",e.id,{styles:t.styles,settings:t.settings})},[e])}}},7711(e,t,o){o.d(t,{k:()=>a});var n=o(6087),r=o(7143),s=o(692);const a=()=>{const e="email-validation",t=(0,r.useSelect)(t=>t(s.store).getNotices(e),[]);return{notices:t,hasValidationNotice:(0,n.useCallback)(e=>e?void 0!==t.find(t=>t.id===e):t?.length>0,[t]),addValidationNotice:(0,n.useCallback)((t,o,n=[])=>{const a=n;(0,r.dispatch)(s.store).createNotice("error",o,{id:t,isDismissible:!1,actions:a,context:e})},[e]),removeValidationNotice:(0,n.useCallback)(t=>{(0,r.dispatch)(s.store).removeNotice(t,e)},[e])}}},265(e,t,o){o.d(t,{xc:()=>w});var n=o(790),r=o(3022),s=o(9491),a=o(4997),i=o(7723),l=o(4361),c=o(7105),d=o(3172),u=o(6427),p=o(4715),m=o(8992),g=o(7847);const f="__experimentalEmailFlexLayout";function h(e){return(0,a.hasBlockSupport)(e,f)}function y({justificationValue:e,onChange:t,isToolbar:o=!1}){const r=[{value:"left",icon:c.A,label:(0,i.__)("Justify items left","jetpack")},{value:"center",icon:l.A,label:(0,i.__)("Justify items center","jetpack")},{value:"right",icon:d.A,label:(0,i.__)("Justify items right","jetpack")}];if(o){const o=r.map(e=>e.value);return(0,n.jsx)(p.JustifyContentControl,{value:e,onChange:t,allowedControls:o,popoverProps:{placement:"bottom-start"}})}return(0,n.jsx)(u.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,i.__)("Justification","jetpack"),value:e,onChange:t,className:"block-editor-hooks__flex-layout-justification-controls",children:r.map(({value:e,icon:t,label:o})=>(0,n.jsx)(u.__experimentalToggleGroupControlOptionIcon,{value:e,icon:t,label:o},e))})}function _({setAttributes:e,attributes:t,name:o}){if(!(0,a.getBlockSupport)(o,f,{}))return null;const{justifyContent:r="left"}=t.layout||{},s=o=>{e({layout:{...t.layout,justifyContent:o}})},l=()=>{const{justifyContent:o,...n}=t.layout||{};e({layout:n})};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(p.InspectorControls,{children:(0,n.jsx)(u.__experimentalToolsPanel,{label:(0,i.__)("Layout","jetpack"),resetAll:l,children:(0,n.jsx)(u.__experimentalToolsPanelItem,{isShownByDefault:!0,onDeselect:l,hasValue:()=>t.layout?.justifyContent||!1,label:(0,i.__)("Justification","jetpack"),children:(0,n.jsx)(u.Flex,{children:(0,n.jsx)(u.FlexItem,{children:(0,n.jsx)(y,{justificationValue:r,onChange:s})})})})})}),(0,n.jsx)(p.BlockControls,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,n.jsx)(y,{justificationValue:r,onChange:s,isToolbar:!0})})]})}const b=(0,s.createHigherOrderComponent)(e=>t=>[h(t.name)&&(0,n.jsx)(_,{...t},"layout"),(0,n.jsx)(e,{...t},"edit")],"withLayoutControls");function x({block:e,props:t}){const{attributes:o}=t,{layout:s}=o,a=`is-content-justification-${s?.justifyContent||"left"}`,i=(0,r.A)(a,"is-layout-email-flex is-layout-flex");return(0,n.jsx)(e,{...t,className:i})}const v=(0,s.createHigherOrderComponent)(e=>function(t){return h(t.name)?(0,n.jsx)(x,{block:e,props:t}):(0,n.jsx)(e,{...t})},"withLayoutStyles");function w(){(0,a.getBlockTypes)().forEach(e=>{h(e.name)&&(0,m.G)(e.name,e=>({...e,attributes:{...e.attributes,layout:{type:"object"}}}))}),(0,g.HY)("editor.BlockListBlock","woocommerce-email-editor/with-layout-styles",v),(0,g.HY)("editor.BlockEdit","woocommerce-email-editor/with-inspector-controls",b)}},721(e,t,o){o.d(t,{J:()=>l});var n=o(7143),r=o(7723),s=o(3124);const a=new WeakMap,i={core:["saveEditedEntityRecord","saveEntityRecord"]},l=()=>{Object.keys(a).length>0||(0,n.use)(e=>({dispatch:t=>{const o="object"==typeof t?t.name:t;if(!i[o])return e.dispatch(o);const n=e.dispatch(o);a[o]||(a[o]={});const l=i[o].filter(e=>!a[o][e]);if(l.length>0)for(const t of l)a[o][t]=n[t],n[t]=async(...n)=>{const i=e.select(s.H).getContentValidation(),l=i?.validateContent;if(l){let e;try{e=l()}catch(t){e=!1}if(!e)return Promise.reject(new Error((0,r.__)("Content validation failed.","jetpack")))}return await a[o][t](...n)};return n}}))}},1847(e,t,o){o.d(t,{Bi:()=>b,D_:()=>p,H7:()=>m,KE:()=>f,Lf:()=>y,fA:()=>h,oq:()=>_,oz:()=>l,sV:()=>g,yd:()=>x});var n=o(7143),r=o(3053),s=o(3656),a=o(4715);const{unlock:i}=(0,r.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/edit-site"),{ColorPanel:l,BackgroundPanel:c,useHasColorPanel:d,useHasBackgroundPanel:u}=i(a.privateApis),p=c??(()=>null),m=d??(()=>!0),g=u??(()=>!1),{Editor:f,FullscreenMode:h,ViewMoreMenuGroup:y,BackButton:_}=i(s.privateApis),{registerEntityAction:b,unregisterEntityAction:x}=i((0,n.dispatch)(s.store))},8046(e,t,o){o.r(t),o.d(t,{invalidatePersonalizationTagsCache:()=>m,requestSendingNewsletterPreview:()=>y,setContentValidation:()=>_,setEditorConfig:()=>w,setEditorSettings:()=>b,setEditorTheme:()=>x,setEditorUrls:()=>v,setEmailPost:()=>p,setEmailPostType:()=>g,setTemplateSelected:()=>h,setTemplateToPost:()=>f,togglePreviewModal:()=>d,updateSendPreviewEmail:()=>u});var n=o(7143),r=o(3582),s=o(6161),a=o(3124),i=o(970),l=o(8311),c=o(6816);function d(e){return{type:"CHANGE_PREVIEW_STATE",state:{isModalOpened:e}}}function u(e){return{type:"CHANGE_PREVIEW_STATE",state:{toEmail:e}}}const p=(e,t)=>async({dispatch:o})=>{if(!e||!t)throw new Error("setEmailPost requires valid postId and postType parameters");o({type:"SET_EMAIL_POST",state:{postId:e,postType:t}})},m=()=>async({registry:e})=>{const t=e.select(a.H).getEmailPostId();e.dispatch(r.store).invalidateResolution("getEntityRecords",[a.q.kind,a.q.name,(0,i.O)(t)])};function g(e){if(!e)throw new Error("setEmailPostType requires a valid postType parameter");return{type:"SET_EMAIL_POST",state:{postType:e}}}const f=e=>async({registry:t})=>{const o=t.select(a.H).getEmailPostId(),n=t.select(a.H).getEmailPostType();t.dispatch(r.store).editEntityRecord("postType",n,o,{template:e})};function h(){return{type:"SET_TEMPLATE_SELECTED"}}function*y(e){if(!(0,n.select)(a.H).getPreviewState().isSendingPreviewEmail){yield{type:"CHANGE_PREVIEW_STATE",state:{sendingPreviewStatus:null,isSendingPreviewEmail:!0}};try{const t=(0,n.select)(a.H).getEmailPostId();yield(0,s.apiFetch)({path:"/woocommerce-email-editor/v1/send_preview_email",method:"POST",data:{email:e,postId:t}}),yield{type:"CHANGE_PREVIEW_STATE",state:{sendingPreviewStatus:l.T.SUCCESS,isSendingPreviewEmail:!1}},(0,c.yM)("sent_preview_email",{postId:t,email:e})}catch(t){(0,c.yM)("sent_preview_email_error",{email:e}),yield{type:"CHANGE_PREVIEW_STATE",state:{sendingPreviewStatus:l.T.ERROR,isSendingPreviewEmail:!1,errorMessage:JSON.stringify(t?.error)}}}}}function _(e){return{type:"SET_CONTENT_VALIDATION",validation:e}}function b(e){return{type:"SET_EDITOR_SETTINGS",editorSettings:e}}function x(e){return{type:"SET_EDITOR_THEME",theme:e}}function v(e){return{type:"SET_EDITOR_URLS",urls:e}}function w(e){return{type:"SET_EDITOR_CONFIG",config:e}}},3124(e,t,o){o.d(t,{H:()=>n,q:()=>r});const n="email-editor/editor",r={name:"personalization_tag",kind:"root",baseURL:"/woocommerce-email-editor/v1/personalization_tags",key:"token"}},8105(e,t,o){function n(){return{editorSettings:void 0,theme:void 0,styles:{globalStylesPostId:null},urls:{back:"",listings:""},preview:{toEmail:"",isModalOpened:!1,isSendingPreviewEmail:!1,sendingPreviewStatus:null},contentValidation:void 0,templateSelected:!1}}o.d(t,{C:()=>n})},970(e,t,o){o.d(t,{O:()=>r});const n=new Map;function r(e){let t=n.get(e);return t||(t={context:"view",per_page:-1,...e?{post_id:e}:{}},n.set(e,t)),t}},4405(e,t,o){function n(e,t){switch(t.type){case"CHANGE_PREVIEW_STATE":return{...e,preview:{...e.preview,...t.state}};case"SET_EMAIL_POST":return{...e,...t.state};case"SET_CONTENT_VALIDATION":return{...e,contentValidation:t.validation};case"SET_TEMPLATE_SELECTED":return{...e,templateSelected:!0};case"SET_EDITOR_SETTINGS":return{...e,editorSettings:t.editorSettings};case"SET_EDITOR_THEME":return{...e,theme:t.theme};case"SET_EDITOR_URLS":return{...e,urls:{...e.urls,...t.urls}};case"SET_EDITOR_CONFIG":return{...e,editorSettings:t.config.editorSettings,theme:t.config.theme,urls:t.config.urls,preview:{...e.preview,toEmail:t.config.userEmail},styles:{...e.styles,globalStylesPostId:t.config.globalStylesPostId??null}};default:return e}}o.d(t,{F:()=>n})},6799(e,t,o){o.r(t),o.d(t,{canUserEditGlobalEmailStyles:()=>N,canUserEditTemplates:()=>j,getBlockPatternsForEmailTemplate:()=>k,getContentValidation:()=>D,getCurrentTemplate:()=>C,getCurrentTemplateContent:()=>T,getEditedEmailContent:()=>x,getEditedPostTemplate:()=>E,getEmailPostId:()=>B,getEmailPostType:()=>A,getEmailTemplates:()=>M,getGlobalEmailStylesPost:()=>P,getGlobalStylesPostId:()=>V,getInitialEditorSettings:()=>$,getPaletteColors:()=>I,getPersonalizationTagsList:()=>R,getPreviewState:()=>z,getSentEmailEditorPosts:()=>w,getStyles:()=>H,getTheme:()=>F,getUrls:()=>O,hasEdits:()=>y,hasEmptyContent:()=>_,isEmailSent:()=>b,isFeatureActive:()=>h,isTemplateSelected:()=>G});var n=o(7143),r=o(3582),s=o(3656),a=o(1233),i=o(4997),l=o(2619),c=o(3124),d=o(970);function u(e){return e?.content&&"function"==typeof e.content?e.content(e):e?.blocks?(0,i.serialize)(e.blocks):e?.content?e.content:""}const p=new WeakMap;function m(e){let t=p.get(e);return t||(t={...e,get blocks(){return(0,i.parse)(e.content)},get emailBlocks(){return e.emailContent?(0,i.parse)(e.emailContent):null}},p.set(e,t)),t}const g=new WeakMap;function f(e){if(!e)return null;const t=g.get(e);if(t)return t;const o={...e,title:e?.title?.raw||e?.title||"",content:e?.content?.raw||e?.content||""};return g.set(e,o),o}const h=(0,n.createRegistrySelector)(e=>(t,o)=>!!e(a.store).get(c.H,o)),y=(0,n.createRegistrySelector)(e=>()=>{const t=e(c.H).getEmailPostId(),o=e(c.H).getEmailPostType();return!!e(r.store).hasEditsForEntityRecord("postType",o,t)}),_=(0,n.createRegistrySelector)(e=>()=>{const t=e(c.H).getEmailPostId(),o=e(c.H).getEmailPostType(),n=e(r.store).getEntityRecord("postType",o,t);if(!n)return!0;const{content:s}=n;return!s.raw}),b=(0,n.createRegistrySelector)(e=>()=>{const t=e(c.H).getEmailPostId(),o=e(c.H).getEmailPostType(),n=e(r.store).getEntityRecord("postType",o,t);if(!n)return!1;return"sent"===n.status}),x=(0,n.createRegistrySelector)(e=>()=>{const t=e(c.H).getEmailPostId(),o=e(c.H).getEmailPostType(),n=e(r.store).getEditedEntityRecord("postType",o,t);return n?u(n):""}),v={per_page:30,status:"publish,sent"};const w=(0,n.createRegistrySelector)(e=>()=>{const t=e(c.H).getEmailPostType(),o=(0,l.applyFilters)("woocommerce_email_editor_recent_emails_query",{...v},t),n=(s=o)&&"object"==typeof s&&!Array.isArray(s)?o:v;var s;return e(r.store).getEntityRecords("postType",t,n)?.filter(e=>""!==e?.content?.raw)||[]}),k=(0,n.createRegistrySelector)(e=>{const t=e(c.H).getEmailPostType();return(0,n.createSelector)(()=>t?e(r.store).getBlockPatterns().filter(({templateTypes:e,postTypes:o})=>Array.isArray(e)&&e.includes("email-template")&&(void 0===o||0===o.length||o.includes(t))).map(m):[],()=>[e(r.store).getBlockPatterns(),t])}),j=(0,n.createRegistrySelector)(e=>()=>e(r.store).canUser("create",{kind:"postType",name:"wp_template"}));function S(e,t){return j()?e(r.store).getEditedEntityRecord("postType","wp_template",t):f(e(r.store).getEntityRecord("postType","wp_template",t,{context:"view"}))}const E=(0,n.createRegistrySelector)(e=>(t,o)=>{const n=o||e(s.store).getEditedPostAttribute("template");if(n){const t={context:"view",per_page:-1,_woocommerce_email_editor:"fetch-all-templates"},o=e(r.store).getEntityRecords("postType","wp_template",t)?.find(e=>e.slug===n);return o?S(e,o.id):null}const a=e(r.store).getDefaultTemplateId({slug:"email-general"});return S(e,a)}),C=(0,n.createRegistrySelector)(e=>()=>{if("wp_template"===e(s.store).getCurrentPostType()){const t=e(s.store).getCurrentPostId();return e(r.store).getEditedEntityRecord("postType","wp_template",t)}return e(c.H).getEditedPostTemplate()}),T=()=>{const e=C();return e?u(e):""},N=(0,n.createRegistrySelector)(e=>()=>{const t=e(c.H).getGlobalStylesPostId();return{postId:t,canEdit:e(r.store).canUser("update",{kind:"root",name:"globalStyles",id:t})}}),P=(0,n.createRegistrySelector)(e=>()=>{const{postId:t,canEdit:o}=N();return t&&void 0!==o&&t?o?e(r.store).getEditedEntityRecord("root","globalStyles",t):f(e(r.store).getEntityRecord("root","globalStyles",t,{context:"view"})):null}),M=(0,n.createRegistrySelector)(e=>{const t=e(c.H).getEmailPostType();return(0,n.createSelector)(()=>e(r.store).getEntityRecords("postType","wp_template",{per_page:-1,post_type:t,context:"view"})?.filter(e=>e.post_types.includes(t)),()=>[e(r.store).getEntityRecords("postType","wp_template",{per_page:-1,post_type:t,context:"view"})])});function B(e){return e.postId}function A(e){return e.postType}function $(e){return e.editorSettings}function I(e){return e.editorSettings?.__experimentalFeatures?.color?.palette}function z(e){return e.preview}const L=[],R=(0,n.createRegistrySelector)(e=>{let t=null;return()=>{const o=e(c.H).getEmailPostId(),n=e(r.store).getEntityRecords(c.q.kind,c.q.name,(0,d.O)(o))||L,s=e(c.H).getEmailPostType();if(!s)return n;const a="wp_template"===s?e(c.H).getCurrentTemplate()?.post_types:void 0;if(t&&t.tags===n&&t.postType===s&&t.templatePostTypes===a)return t.result;const i=n.filter(e=>void 0===e.postTypes||0===e.postTypes.length||("wp_template"===s?Array.isArray(a)&&a.some(t=>e.postTypes.includes(t)):e.postTypes.includes(s)));return t={tags:n,postType:s,templatePostTypes:a,result:i},i}});function H(e){return e.theme?.styles}function F(e){return e.theme}function V(e){return e.styles.globalStylesPostId}function O(e){return e.urls}function D(e){return e.contentValidation}function G(e){return e.templateSelected}},4368(e,t,o){function n(){if(!window.WooCommerceEmailEditor)throw new Error("WooCommerceEmailEditor global object is not available. This is required for the email editor to work.");const e=window.WooCommerceEmailEditor.editor_settings,t=window.WooCommerceEmailEditor.editor_theme,o=window.WooCommerceEmailEditor.urls,n=window.WooCommerceEmailEditor.current_wp_user_email,r=window.WooCommerceEmailEditor.user_theme_post_id;if(!e)throw new Error("window.WooCommerceEmailEditor.editor_settings is required.");if(!t)throw new Error("window.WooCommerceEmailEditor.editor_theme is required.");if(!o||"string"!=typeof o.back||"string"!=typeof o.listings)throw new Error("window.WooCommerceEmailEditor.urls.back and .listings are required strings.");return{editorSettings:e,theme:t,urls:o,userEmail:n,globalStylesPostId:r??null}}o.d(t,{q:()=>n})},7380(e,t,o){o.d(t,{y$:()=>u});var n=o(7143),r=o(3582),s=o(6161),a=o(8046),i=o(3124),l=o(8105),c=o(4405),d=o(6799);const u=()=>{if(void 0!==(0,n.select)(i.H))return(0,n.select)(i.H);const e=(0,n.createReduxStore)(i.H,{actions:a,controls:s.controls,selectors:d,resolvers:{},reducer:c.F,initialState:(0,l.C)()});return(0,n.register)(e),(0,n.dispatch)(r.store).addEntities([i.q]),e}},8311(e,t,o){o.d(t,{T:()=>n});var n=(e=>(e.SUCCESS="success",e.ERROR="error",e))(n||{})},3598(e,t,o){function n(e){if("string"!=typeof e)return null;const t=e.match(/^var:preset\|([a-zA-Z0-9-]+)\|([a-zA-Z0-9-]+)$/);return t?`--wp--preset--${t[1]}--${t[2]}`:null}function r(e){const t=n(e);return t?`var(${t})`:e}function s(e){const t=n(e);if(!t)return e;const o=document.querySelector(":root");if(!o)return e;return getComputedStyle(o).getPropertyValue(t).trim()||e}o.d(t,{DJ:()=>r,pr:()=>s})},5885(e,t,o){o.d(t,{I:()=>s});var n=o(7723),r=o(7847);const s=()=>{const e={"You’ve tried to select a block that is part of a template that may be used elsewhere on your site. Would you like to edit the template?":{domain:"default",replacementText:(0,n.__)("You’ve tried to select a block that is part of a template that may be used in other emails. Would you like to edit the template?","jetpack")}};(0,r.HY)("i18n.gettext","woocommerce/email-editor/override-text",(t,o,n)=>e[o]&&e[o].domain===(n||"default")?e[o].replacementText:t)}},790(e){e.exports=window.ReactJSXRuntime},8468(e){e.exports=window.lodash},1455(e){e.exports=window.wp.apiFetch},4715(e){e.exports=window.wp.blockEditor},9363(e){e.exports=window.wp.blockLibrary},4997(e){e.exports=window.wp.blocks},2165(e){e.exports=window.wp.commands},6427(e){e.exports=window.wp.components},9491(e){e.exports=window.wp.compose},3582(e){e.exports=window.wp.coreData},7143(e){e.exports=window.wp.data},6161(e){e.exports=window.wp.dataControls},8490(e){e.exports=window.wp.domReady},3656(e){e.exports=window.wp.editor},6087(e){e.exports=window.wp.element},2005(e){e.exports=window.wp.formatLibrary},2619(e){e.exports=window.wp.hooks},8537(e){e.exports=window.wp.htmlEntities},7723(e){e.exports=window.wp.i18n},923(e){e.exports=window.wp.isShallowEqual},8558(e){e.exports=window.wp.keycodes},692(e){e.exports=window.wp.notices},2279(e){e.exports=window.wp.plugins},1233(e){e.exports=window.wp.preferences},5573(e){e.exports=window.wp.primitives},7494(e){e.exports=window.wp.priorityQueue},3053(e){e.exports=window.wp.privateApis},876(e){e.exports=window.wp.richText},9786(e){e.exports=window.wp.styleEngine},3832(e){e.exports=window.wp.url},5046(e,t,o){o.d(t,{xn:()=>L});var n=o(4997),r=o(9786),s=o(7143),a=o(2267),i=o(7336),l=o(7731),c=o(912),d=o(1355),u=o(8472),p=o(7436),m=o(4022),g=o(233),f=o(4694),h=o(6767),y=o(6410),_={button:"wp-element-button",caption:"wp-element-caption"},b={__experimentalBorder:"border",color:"color",dimensions:"dimensions",spacing:"spacing",typography:"typography"},x={"core/button":[":hover",":focus",":focus-visible",":active"],"core/navigation-link":[":hover",":focus",":focus-visible",":active"]},v={link:[":link",":any-link",":visited",":hover",":focus",":focus-visible",":active"],button:[":link",":any-link",":visited",":hover",":focus",":focus-visible",":active"]};function w(e={},t,o){let n=[];return Object.keys(e).forEach(r=>{const s=t+(0,d.k)(r.replace("/","-")),a=e[r];if(a instanceof Object){const e=s+o;n=[...n,...w(a,e,o)]}else n.push(`${s}: ${a}`)}),n}function k(e={},t="",o,s={},i=!1){const c=a.B4===t,u=Object.entries(n.__EXPERIMENTAL_STYLE_PROPERTY).reduce((t,[n,{value:s,properties:a,useEngine:i,rootOnly:l}])=>{if(l&&!c)return t;const u=s;if("elements"===u[0]||i)return t;const p=(0,g.K)(e,u);if("--wp--style--root--padding"===n&&("string"==typeof p||!o))return t;if(a&&"string"!=typeof p)Object.entries(a).forEach(e=>{const[o,n]=e;if(!(0,g.K)(p,[n],!1))return;const s=o.startsWith("--")?o:(0,d.k)(o);t.push(`${s}: ${(0,r.getCSSValueFromRawStyle)((0,g.K)(p,[n]))}`)});else if((0,g.K)(e,u,!1)){const o=n.startsWith("--")?n:(0,d.k)(n);t.push(`${o}: ${(0,r.getCSSValueFromRawStyle)((0,g.K)(e,u))}`)}return t},[]);e.background&&(e.background?.backgroundImage&&(e.background.backgroundImage=(0,a.y_)(e.background.backgroundImage,s)),!c&&e.background?.backgroundImage?.id&&(e={...e,background:{...e.background,...(0,p.g)(e.background)}}));return(0,r.getCSSRules)(e).forEach(e=>{if(c&&(o||i)&&e.key.startsWith("padding"))return;const t=e.key.startsWith("--")?e.key:(0,d.k)(e.key);let n=(0,a.y_)(e.value,s);"font-size"===t&&(n=(0,l.j)({name:"",slug:"",size:n},s?.settings)),"aspect-ratio"===t&&u.push("min-height: unset"),u.push(`${t}: ${n}`)}),u}var j=["border","color","dimensions","spacing","typography","filter","outline","shadow","background"];function S(e,t,o){if(!e)return{};const n=Object.entries(e),r=t?x[t]??[]:[],s=n.filter(([e])=>j.includes(e)||r.includes(e)||o[e]).map(([e,t])=>[e,JSON.parse(JSON.stringify(t))]);return Object.fromEntries(s)}function E(e){const{styles:t,selector:o,featureSelectors:n,name:r,elementName:s,mediaQuery:a,variationName:i}=e,l=r?x[r]??[]:v[s??""]??[];return l.length?l.flatMap(e=>{const l=t?.[e];return l&&"object"==typeof l?[{styles:JSON.parse(JSON.stringify(l)),selector:o,selectorSuffix:e,mediaQuery:a,featureSelectors:n&&"string"!=typeof n?n:void 0,name:r,elementName:s,variationName:i}]:[]}):[]}function C(e,t){const o={...e?.elements??{}};return Object.keys(t).forEach(t=>{Object.entries(e?.[t]?.elements??{}).forEach(([e,n])=>{o[e]={...o[e]??{},[t]:n}})}),o}var T=(e,t)=>{const o=[];if(!e?.styles)return o;const r=(0,f.hG)(e),s=function(e,t){return S(e,void 0,t)}(e.styles,r);return s&&o.push({styles:s,selector:a.B4,skipSelectorWrapper:!0}),Object.entries(n.__EXPERIMENTAL_ELEMENTS).forEach(([t,n])=>{e.styles?.elements?.[t]&&o.push({styles:e.styles?.elements?.[t]??{},selector:n,elementName:t,skipSelectorWrapper:!_[t]})}),Object.entries(e.styles?.blocks??{}).forEach(([e,s])=>{const i=S(s,e,r),l=s,c=[],d=[];l?.variations&&Object.entries(l.variations).forEach(([o,s])=>{const i=s,l=S(i,e,r);i?.css&&(l.css=i.css);const u="string"!=typeof t?t[e]?.styleVariationSelectors?.[o]:void 0;if(u&&"string"!=typeof t){const n=t[e];d.push({styles:l,selector:u,featureSelectors:n?.featureSelectors,fallbackGapValue:n?.fallbackGapValue,hasLayoutSupport:n?.hasLayoutSupport,isStyleVariation:!0,variationName:o,layoutSelector:u+n.selector,layoutHasBlockGapSupport:!0,name:e})}Object.entries(C(i,r)).forEach(([e,t])=>{t&&n.__EXPERIMENTAL_ELEMENTS[e]&&c.push({styles:t,selector:(0,a.q1)(u,n.__EXPERIMENTAL_ELEMENTS[e]),elementName:e,isStyleVariation:!0})}),Object.entries(i?.blocks??{}).forEach(([e,o])=>{const s="string"!=typeof t?(0,a.q1)(u,t[e]?.selector):void 0,i="string"!=typeof t?(0,a.q1)(u,t[e]?.duotoneSelector):void 0,l="string"!=typeof t?(0,a.hX)(u,t[e]?.featureSelectors??{}):void 0,d=S(o,e,r);o?.css&&(d.css=o.css),s&&"string"!=typeof t&&(c.push({selector:s,name:e,isStyleVariation:!0,duotoneSelector:i,featureSelectors:l,fallbackGapValue:t[e]?.fallbackGapValue,hasLayoutSupport:t[e]?.hasLayoutSupport,styles:d}),Object.entries(C(o,r)).forEach(([e,t])=>{t&&n.__EXPERIMENTAL_ELEMENTS[e]&&c.push({styles:t,selector:(0,a.q1)(s,n.__EXPERIMENTAL_ELEMENTS[e]),elementName:e,isStyleVariation:!0})}))})}),"string"!=typeof t&&t?.[e]?.selector&&o.push({duotoneSelector:t[e].duotoneSelector,fallbackGapValue:t[e].fallbackGapValue,hasLayoutSupport:t[e].hasLayoutSupport,selector:t[e].selector,styles:i,featureSelectors:t[e].featureSelectors,name:e}),o.push(...d),Object.entries(C(l,r)).forEach(([r,s])=>{"string"!=typeof t&&s&&t?.[e]&&n.__EXPERIMENTAL_ELEMENTS[r]&&o.push({styles:s,selector:t[e]?.selector.split(",").map(e=>n.__EXPERIMENTAL_ELEMENTS[r].split(",").map(t=>e+" "+t)).join(","),elementName:r})}),o.push(...c)}),o},N=(e,t)=>{const o=[];if(!e?.settings)return o;const n=e=>{let t={};return a.EA.forEach(({path:o})=>{const n=(0,g.K)(e,o,!1);!1!==n&&(t=(0,g.n)(t,o,n))}),t},r=n(e.settings),s=e.settings?.custom;return(Object.keys(r).length>0||s)&&o.push({presets:r,custom:s,selector:a.bB}),Object.entries(e.settings?.blocks??{}).forEach(([e,r])=>{const s=r.custom;if("string"==typeof t||!t[e])return;const a=n(r);(Object.keys(a).length>0||s)&&o.push({presets:a,custom:s,selector:t[e]?.selector,featureSelectors:t[e]?.featureSelectors})}),o};function P(e,t,o){if(!e||"string"==typeof e)return o;const n=e[t];return"string"==typeof n?n:"object"==typeof n&&n.root?n.root:o}function M(e,t,{path:o,valueKey:n,valueFunc:r,cssVarInfix:s}){const a=(0,g.K)(e,o,[]),i=[];for(const e of["default","theme","custom"])if(a[e])for(const o of a[e]){const e=(0,d.k)(o.slug);n&&!r?i.push(`--wp--preset--${s}--${e}: ${o[n]}`):r&&"function"==typeof r&&i.push(`--wp--preset--${s}--${e}: ${r(o,t)}`)}return i}function B(e,{tree:t,useRootPaddingAlign:o,disableLayoutStyles:n,hasBlockGapSupport:r,hasFallbackGapSupport:s,disableRootPadding:i}){const{selector:l,selectorSuffix:c,mediaQuery:d,duotoneSelector:p,styles:g,fallbackGapValue:f,hasLayoutSupport:h,featureSelectors:y,layoutSelector:_,layoutHasBlockGapSupport:b,skipSelectorWrapper:x,name:v,variationName:w}=e;let j="";const S=c?(0,a.fx)(l,c):l;if(y&&"string"!=typeof y){let e=((e,t)=>{const o={};return Object.entries(e).forEach(([e,n])=>{if("root"===e||!t?.[e])return;const r="string"==typeof n;if(r||"object"!=typeof n||null===n||Object.entries(n).forEach(([n,r])=>{if("root"===n||!t?.[e][n])return;const s=k({[e]:{[n]:t[e][n]}});o[r]=[...o[r]||[],...s],delete t[e][n]}),r||"object"==typeof n&&null!==n&&"root"in n){const s=r?n:n.root,a=k({[e]:t[e]});o[s]=[...o[s]||[],...a],delete t[e]}}),o})(y,g);e=((e,t,o)=>{if("core/paragraph"!==o)return e;const n=t?.blocks?.["core/paragraph"];if("all"!==(n?.typography?.textIndent??t?.typography?.textIndent??"subsequent"))return e;const r=".wp-block-paragraph + .wp-block-paragraph";if(r in e){const t=e[r],o={...e};return delete o[r],o[".wp-block-paragraph"]=t,o}return e})(e,t.settings,v),e=((e,t)=>{const o=".wp-block-button";if(!(o in e))return e;const n={...e};return n[o]=n[o].map(e=>{const o=e.match(/^width:\s*(.+)$/);if(!o)return e;const n=o[1];let r=null;n.endsWith("%")&&(r=parseFloat(n));const s="var(--wp--preset--dimension--";if(null===r&&n.startsWith(s)&&n.endsWith(")")){const e=n.slice(29,-1),o={...t?.dimensions?.dimensionSizes??{},...t?.blocks?.["core/button"]?.dimensions?.dimensionSizes??{}};for(const t of Object.values(o))if(Array.isArray(t)){for(const o of t)if(o.slug===e&&"string"==typeof o.size&&o.size.endsWith("%")){r=parseFloat(o.size);break}if(null!==r)break}}return null===r||isNaN(r)?e:`width: calc(${r} * 1% - (var(--wp--style--block-gap, 0.5em) * (1 - ${r} / 100)))`}),n})(e,t.settings),Object.entries(e).forEach(([e,t])=>{if(t.length){let o=w?(0,a.Pn)(w,e):e;o=c?(0,a.fx)(o,c):o;const n=t.join(";");j+=`:root :where(${o}){${n};}`}})}if(p){const e={};g?.filter&&(e.filter=g.filter,delete g.filter);const t=k(e);t.length&&(j+=`${p}{${t.join(";")};}`)}const E=_??S,C=b??r;n||a.B4!==E&&!h||(j+=function({layoutDefinitions:e=m.o,style:t,selector:o,hasBlockGapSupport:n,hasFallbackGapSupport:r,fallbackGapValue:s}){let i="";const l=t?.spacing?.blockGap;let c=n?(0,u.$)(l):"";r&&(o===a.B4?c=c||"0.5em":!n&&s&&(c=s));const d=n&&l&&"string"!=typeof l?(0,u.$)(l.top):c;if(c&&e&&(Object.values(e).forEach(({className:e,name:t,spacingStyles:r})=>{if(!n&&"flex"!==t&&"grid"!==t)return;const s=["default","constrained"].includes(t)?d:c;r?.length&&r.forEach(t=>{const r=[];if(t.rules&&Object.entries(t.rules).forEach(([e,t])=>{r.push(`${e}: ${t||s}`)}),r.length){let s="";s=n?o===a.B4?`:root :where(.${e})${t?.selector||""}`:`:root :where(${o}-${e})${t?.selector||""}`:o===a.B4?`:where(.${e}${t?.selector||""})`:`:where(${o}.${e}${t?.selector||""})`,i+=`${s} { ${r.join("; ")}; }`}})}),o===a.B4&&n&&(i+=`${a.bB} { --wp--style--block-gap: ${c}; }`)),o===a.B4&&e){const t=["block","flex","grid"];Object.values(e).forEach(({className:e,displayMode:n,baseStyles:r})=>{n&&t.includes(n)&&(i+=`${o} .${e} { display:${n}; }`),r?.length&&r.forEach(t=>{const o=[];t.rules&&Object.entries(t.rules).forEach(([e,t])=>{o.push(`${e}: ${t}`)}),o.length&&(i+=`.${e}${t?.selector||""} { ${o.join("; ")}; }`)})})}return i}({style:g,selector:E,hasBlockGapSupport:C,hasFallbackGapSupport:s,fallbackGapValue:f}));const T=k(g,S,o,t,i);if(T?.length){j+=`${x?S:`:root :where(${S})`}{${T.join(";")};}`}return g?.css&&(j+=z(g.css,`:root :where(${S})`)),d&&j?`${d}{${j}}`:j}var A=(e,t,o,n,r=!1,s=!1,i={})=>{const l={blockGap:!0,blockStyles:!0,layoutStyles:!0,marginReset:!0,presets:!0,rootPadding:!0,variationStyles:!1,...i},c=(0,y.k)(e),p=T(c,t),m=N(c,t),h=c?.settings?.useRootPaddingAwareAlignments,{contentSize:_,wideSize:b}=c?.settings?.layout||{},x=l.marginReset||l.rootPadding||l.layoutStyles;let v="";if(l.presets&&(_||b)&&(v+=`${a.bB} {`,v=_?v+` --wp--style--global--content-size: ${_};`:v,v=b?v+` --wp--style--global--wide-size: ${b};`:v,v+="}"),x&&(v+=":where(body) {margin: 0;",l.rootPadding&&h&&(v+="padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }\n\t\t\t\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t\t.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }\n\t\t\t\t.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) { padding-right: 0; padding-left: 0; }\n\t\t\t\t.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) > .alignfull { margin-left: 0; margin-right: 0;\n\t\t\t\t"),v+="}"),l.blockStyles){const t=(0,f.hG)(e);p.forEach(e=>{if(e.isStyleVariation&&!l.variationStyles)return;const a=function(e,t){const{styles:o,selector:n,fallbackGapValue:r,featureSelectors:s,hasLayoutSupport:a,layoutHasBlockGapSupport:i,layoutSelector:l,name:c,elementName:d,isStyleVariation:u,variationName:p}=e;return c||d?Object.entries(t).flatMap(([e,t])=>{const m=o?.[e];return m&&"object"==typeof m?[{styles:JSON.parse(JSON.stringify(m)),selector:n,mediaQuery:t,featureSelectors:s&&"string"!=typeof s?s:void 0,fallbackGapValue:r,hasLayoutSupport:a,name:c,elementName:d,isStyleVariation:u,variationName:p,layoutSelector:l,layoutHasBlockGapSupport:i}]:[]}):[]}(e,t);[e,...a,...E(e),...a.flatMap(E)].forEach(e=>{v+=B(e,{tree:c,useRootPaddingAlign:h,disableLayoutStyles:r,hasBlockGapSupport:o,hasFallbackGapSupport:n,disableRootPadding:s})})})}if(l.layoutStyles&&(v+=".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",v+=".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",v+=".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }"),l.blockGap&&o){const e=(0,u.$)(c?.styles?.spacing?.blockGap)||"0.5em";v+=`:root :where(.wp-site-blocks) > * { margin-block-start: ${e}; margin-block-end: 0; }`,v+=":root :where(.wp-site-blocks) > :first-child { margin-block-start: 0; }",v+=":root :where(.wp-site-blocks) > :last-child { margin-block-end: 0; }"}return l.presets&&m.forEach(({selector:e,presets:t})=>{a.B4!==e&&a.bB!==e||(e="");const o=function(e="*",t={}){return a.EA.reduce((o,{path:n,cssVarInfix:r,classes:s})=>{if(!s)return o;const a=(0,g.K)(t,n,[]);return["default","theme","custom"].forEach(t=>{a[t]&&a[t].forEach(({slug:t})=>{s.forEach(({classSuffix:n,propertyName:s})=>{const a=`.has-${(0,d.k)(t)}-${n}`,i=e?`:where(${e})${a}`:a,l=`var(--wp--preset--${r}--${(0,d.k)(t)})`;o+=`${i}{${s}: ${l} !important;}`})})}),o},"")}(e,t);o.length>0&&(v+=o)}),v};function $(e,t){return N(e,t).flatMap(({presets:e})=>function(e={}){return a.EA.filter(e=>"duotone"===e.path.at(-1)).flatMap(t=>{const o=(0,g.K)(e,t.path,{});return["default","theme","custom"].filter(e=>o[e]).flatMap(e=>o[e].map(e=>(0,c.xX)(`wp-duotone-${e.slug}`,e.colors))).join("")})}(e))}var I=(e,t)=>{const{getBlockStyles:o}=(0,s.select)(n.store),r={};return e.forEach(e=>{const s=e.name,l=(0,i.$)(e);if(!l)return;let c=(0,i.$)(e,"filter.duotone");if(!c){const t=(0,i.$)(e),o=(0,n.getBlockSupport)(e,"color.__experimentalDuotone",!1);"string"==typeof o&&t&&(c=(0,a.q1)(t,o))}const d=!!e?.supports?.layout||!!e?.supports?.__experimentalLayout,u=e?.supports?.spacing?.blockGap,p="object"!=typeof u||Array.isArray(u)?void 0:u.__experimentalDefault,m=o(s),g={};m?.forEach(e=>{const o=t?`-${t}`:"",n=`${e.name}${o}`,r=(0,a.NJ)(n,l);g[n]=r});const f=((e,t)=>{if(e?.selectors&&Object.keys(e.selectors).length>0)return e.selectors;const o={root:t};return Object.entries(b).forEach(([t,n])=>{const r=(0,i.$)(e,t);r&&(o[n]=r)}),o})(e,l);r[s]={duotoneSelector:c??void 0,fallbackGapValue:p,featureSelectors:Object.keys(f).length?f:void 0,hasLayoutSupport:d,name:s,selector:l,styleVariationSelectors:m?.length?g:void 0}}),r};function z(e,t){let o="";if(!e||""===e.trim())return o;return e.split("&").forEach(e=>{if(!e||""===e.trim())return;if(!e.includes("{"))o+=`:root :where(${t}){${e.trim()}}`;else{const n=e.replace("}","").split("{");if(2!==n.length)return;const[r,s]=n,i=r.match(/([>+~\s]*::[a-zA-Z-]+)/),l=i?i[1]:"",c=i?r.replace(l,"").trim():r.trim();let d;d=""===c?t:r.startsWith(" ")?(0,a.q1)(t,c):(0,a.fx)(t,c),o+=`:root :where(${d})${l}{${s.trim()}}`}}),o}function L(e={},t=[],o={}){const{hasBlockGapSupport:r,hasFallbackGapSupport:s,disableLayoutStyles:i=!1,disableRootPadding:l=!1,styleOptions:c={}}=o,d=t.length>0?t:(0,n.getBlockTypes)(),u=(0,h.P)(e,"spacing.blockGap"),p=r??null!==u,m=s??!p;if(!e?.styles||!e?.settings)return[[],{}];const g=function(e){const t=e.styles?.blocks,o=t?.["core/separator"];return o&&o.color?.background&&!o.color?.text&&!o.border?.color?{...e,styles:{...e.styles,blocks:{...t,"core/separator":{...o,color:{...o.color,text:o.color?.background}}}}}:e}(e),f=I(d),y=((e,t)=>{const o=N(e,t);let n="";for(const{presets:t,custom:r,selector:s,featureSelectors:i}of o){const o=s,l={[o]:[]};if(e?.settings)for(const n of a.EA){const r=M(t,e.settings,n);if(0===r.length)continue;const s=P(i,n.path[0],o);l[s]||(l[s]=[]),l[s].push(...r)}const c=w(r,"--wp--custom--","--");c.length>0&&l[o].push(...c);for(const[e,t]of Object.entries(l))t.length>0&&(n+=`${e}{${t.join(";")};}`)}return n})(g,f),_=A(g,f,p,m,i,l,c),b=$(g,f),x=[{css:y,isGlobalStyles:!0},{css:_,isGlobalStyles:!0},{css:g?.styles?.css??"",isGlobalStyles:!0},{assets:b,__unstableType:"svgs",isGlobalStyles:!0}];return d.forEach(e=>{const t=g?.styles?.blocks?.[e.name];if(t?.css){const{featureSelectors:o}=f[e.name],n="object"==typeof o?o?.css:void 0;let r;"string"==typeof n?r=n:"object"==typeof n&&(r=n?.root);const s=r??f[e.name].selector;x.push({css:z(t.css,s),isGlobalStyles:!0})}}),[x,g.settings]}},7336(e,t,o){o.d(t,{$:()=>s});var n=o(2267),r=o(233);function s(e,t="root",o={}){if(!t)return null;const{fallback:a=!1}=o,{name:i,selectors:l,supports:c}=e,d=l&&Object.keys(l).length>0,u=Array.isArray(t)?t.join("."):t;let p=null;if(p=d&&l.root?l?.root:c?.__experimentalSelector?c.__experimentalSelector:".wp-block-"+i.replace("core/","").replace("/","-"),"root"===u)return p;const m=Array.isArray(t)?t:t.split(".");if(1===m.length){const e=a?p:null;if(d){return(0,r.K)(l,`${u}.root`,null)||(0,r.K)(l,u,null)||e}const t=c?(0,r.K)(c,`${u}.__experimentalSelector`,null):void 0;return t?(0,n.q1)(p,t):e}let g;return d&&(g=(0,r.K)(l,u,null)),g||(a?s(e,m[0],o):null)}},6767(e,t,o){o.d(t,{P:()=>s});var n=o(233),r=["appearanceTools","useRootPaddingAwareAlignments","background.backgroundImage","background.backgroundRepeat","background.backgroundSize","background.backgroundPosition","background.gradient","border.color","border.radius","border.radiusSizes","border.style","border.width","shadow.presets","shadow.defaultPresets","color.background","color.button","color.caption","color.custom","color.customDuotone","color.customGradient","color.defaultDuotone","color.defaultGradients","color.defaultPalette","color.duotone","color.gradients","color.heading","color.link","color.palette","color.text","custom","dimensions.aspectRatio","dimensions.height","dimensions.minHeight","dimensions.minWidth","dimensions.width","dimensions.dimensionSizes","layout.contentSize","layout.definitions","layout.wideSize","lightbox.enabled","lightbox.allowEditing","position.fixed","position.sticky","spacing.customSpacingSize","spacing.defaultSpacingSizes","spacing.spacingSizes","spacing.spacingScale","spacing.blockGap","spacing.margin","spacing.padding","spacing.units","typography.fluid","typography.customFontSize","typography.defaultFontSizes","typography.dropCap","typography.fontFamilies","typography.fontSizes","typography.fontStyle","typography.fontWeight","typography.letterSpacing","typography.lineHeight","typography.textAlign","typography.textColumns","typography.textDecoration","typography.textIndent","typography.textTransform","typography.writingMode","viewport.mobile","viewport.tablet"];function s(e,t,o){const s=o?".blocks."+o:"",a=t?"."+t:"",i=`settings${s}${a}`,l=`settings${a}`;if(t)return(0,n.K)(e,i)??(0,n.K)(e,l);let c={};return r.forEach(t=>{const o=(0,n.K)(e,`settings${s}.${t}`)??(0,n.K)(e,`settings.${t}`);void 0!==o&&(c=(0,n.n)(c,t.split("."),o))}),c}},6410(e,t,o){o.d(t,{k:()=>a});var n={"@mobile":"mobile","@tablet":"tablet","-current":"@current"};function r(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function s(e){if(!r(e))return e;let t=e;return Object.entries(n).forEach(([o,n])=>{Object.hasOwn(e,n)&&(t===e&&(t={...e}),Object.hasOwn(e,o)||(t[o]=e[n]),delete t[n])}),Object.entries(t).forEach(([o,n])=>{if(!r(n))return;const a=s(n);a!==n&&(t===e&&(t={...e}),t[o]=a)}),t}function a(e){if(!globalThis.IS_GUTENBERG_PLUGIN)return e;if(!e?.styles)return e;const t=s(e.styles);return t===e.styles?e:{...e,styles:t}}},7436(e,t,o){o.d(t,{g:()=>s});var n="cover",r="50% 50%";function s(e){if(!e||("object"!=typeof(t=e.backgroundImage)||null===t||!("url"in t)||!t.url))return;var t;let o;return e?.backgroundSize||(o={backgroundSize:n}),"contain"!==e?.backgroundSize||e?.backgroundPosition||(o={backgroundPosition:r}),o}},2267(e,t,o){o.d(t,{B4:()=>a,EA:()=>c,NJ:()=>g,Pn:()=>f,Px:()=>b,bB:()=>i,fx:()=>m,hX:()=>p,q1:()=>u,yQ:()=>_,y_:()=>h});var n=o(9786),r=o(7731),s=o(233),a="body",i=":root";function l(e){if(!e.includes(","))return[e];const t=[];let o="",n=0;for(const r of e){if("("===r)n++;else if(")"===r&&n>0)n--;else if(","===r&&0===n){t.push(o),o="";continue}o+=r}return t.push(o),t}var c=[{path:["color","palette"],valueKey:"color",cssVarInfix:"color",classes:[{classSuffix:"color",propertyName:"color"},{classSuffix:"background-color",propertyName:"background-color"},{classSuffix:"border-color",propertyName:"border-color"}]},{path:["color","gradients"],valueKey:"gradient",cssVarInfix:"gradient",classes:[{classSuffix:"gradient-background",propertyName:"background"}]},{path:["color","duotone"],valueKey:"colors",cssVarInfix:"duotone",valueFunc:({slug:e})=>`url( '#wp-duotone-${e}' )`,classes:[]},{path:["shadow","presets"],valueKey:"shadow",cssVarInfix:"shadow",classes:[]},{path:["typography","fontSizes"],valueFunc:(e,t)=>(0,r.j)(e,t),valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]},{path:["spacing","spacingSizes"],valueKey:"size",cssVarInfix:"spacing",valueFunc:({size:e})=>e,classes:[]},{path:["border","radiusSizes"],valueKey:"size",cssVarInfix:"border-radius",classes:[]},{path:["dimensions","dimensionSizes"],valueKey:"size",cssVarInfix:"dimension",classes:[]}],d={"color.background":"color","color.text":"color","filter.duotone":"duotone","elements.link.color.text":"color","elements.link.:hover.color.text":"color","elements.link.typography.fontFamily":"font-family","elements.link.typography.fontSize":"font-size","elements.button.color.text":"color","elements.button.color.background":"color","elements.caption.color.text":"color","elements.button.typography.fontFamily":"font-family","elements.button.typography.fontSize":"font-size","elements.heading.color":"color","elements.heading.color.background":"color","elements.heading.typography.fontFamily":"font-family","elements.heading.gradient":"gradient","elements.heading.color.gradient":"gradient","elements.h1.color":"color","elements.h1.color.background":"color","elements.h1.typography.fontFamily":"font-family","elements.h1.color.gradient":"gradient","elements.h2.color":"color","elements.h2.color.background":"color","elements.h2.typography.fontFamily":"font-family","elements.h2.color.gradient":"gradient","elements.h3.color":"color","elements.h3.color.background":"color","elements.h3.typography.fontFamily":"font-family","elements.h3.color.gradient":"gradient","elements.h4.color":"color","elements.h4.color.background":"color","elements.h4.typography.fontFamily":"font-family","elements.h4.color.gradient":"gradient","elements.h5.color":"color","elements.h5.color.background":"color","elements.h5.typography.fontFamily":"font-family","elements.h5.color.gradient":"gradient","elements.h6.color":"color","elements.h6.color.background":"color","elements.h6.typography.fontFamily":"font-family","elements.h6.color.gradient":"gradient","color.gradient":"gradient",shadow:"shadow","typography.fontSize":"font-size","typography.fontFamily":"font-family"};function u(e,t){if(!e||!t)return t;const o=l(e),n=l(t),r=[];return o.forEach(e=>{n.forEach(t=>{r.push(`${e.trim()} ${t.trim()}`)})}),r.join(", ")}function p(e,t){if(!e||!t)return;const o={};return Object.entries(t).forEach(([t,n])=>{"string"==typeof n&&(o[t]=u(e,n)),"object"==typeof n&&(o[t]={},Object.entries(n).forEach(([n,r])=>{o[t][n]=u(e,r)}))}),o}function m(e,t){if(!e.includes(","))return e+t;return l(e).map(e=>e+t).join(",")}function g(e,t){const o=`.is-style-${e}`;if(!t)return o;const n=/[^\s:]+/,r=e=>e+o;return l(t).map(e=>e.replace(n,r)).join(",")}function f(e,t){const o=`.is-style-${e}`;return g(e,l(t).map(e=>{const t=e.trim(),n=`${o} `;return t.startsWith(n)?t.slice(n.length):t}).join(","))}function h(e,t){if(!e||!t)return e;const o=function(e,t){if(!e||!t)return e;if("object"==typeof e&&"ref"in e&&e?.ref){const o=(0,n.getCSSValueFromRawStyle)((0,s.K)(t,e.ref));if("object"==typeof o&&null!==o&&"ref"in o&&o?.ref)return;return void 0===o?e:o}return e}(e,t);return"object"==typeof o&&null!==o&&"url"in o&&o?.url&&(o.url=function(e,t){if(!e||!t||!Array.isArray(t))return e;const o=t.find(t=>t?.name===e);return o?.href?o?.href:e}(o.url,t?._links?.["wp:theme-file"])),o}function y(e,t,o=[],n="slug",r){const a=[t?(0,s.K)(e,["blocks",t,...o]):void 0,(0,s.K)(e,o)].filter(Boolean);for(const s of a)if(s){const a=["custom","theme","default"];for(const i of a){const a=s[i];if(a){const s=a.find(e=>e[n]===r);if(s){if("slug"===n)return s;return y(e,t,o,"slug",s.slug)[n]===s[n]?s:void 0}}}}}function _(e,t,o){if(!o||"string"!=typeof o){if("object"!=typeof o||null===o||!("ref"in o)||"string"!=typeof o.ref)return o;{const t=(0,s.K)(e,o.ref);if(!t||"object"==typeof t&&"ref"in t)return t;o=t}}const n="var:",r="var(--wp--";let a;if(o.startsWith(n))a=o.slice(4).split("|");else{if(!o.startsWith(r)||!o.endsWith(")"))return o;a=o.slice(10,-1).split("--")}const[i,...l]=a;return"preset"===i?function(e,t,o,[n,r]=[]){const s=c.find(e=>e.cssVarInfix===n);if(!s||!e.settings)return o;const a=y(e.settings,t,s.path,"slug",r);if(a){const{valueKey:o}=s;return _(e,t,a[o])}return o}(e,t,o,l):"custom"===i?function(e,t,o,n=[]){const r=(t?(0,s.K)(e?.settings??{},["blocks",t,"custom",...n]):void 0)??(0,s.K)(e?.settings??{},["custom",...n]);return r?_(e,t,r):o}(e,t,o,l):o}function b(e,t,o,n){if(!n)return n;const r=d[o],s=c.find(e=>e.cssVarInfix===r);if(!s)return n;const{valueKey:a,path:i}=s,l=y(e,t,i,a,n);return l?`var:preset|${r}|${l.slug}`:n}},912(e,t,o){o.d(t,{xX:()=>r});var n=o(3270);function r(e,t){const o=function(e=[]){const t={r:[],g:[],b:[],a:[]};return e.forEach(e=>{const o=(0,n.Mj)(e).toRgb();t.r.push(o.r/255),t.g.push(o.g/255),t.b.push(o.b/255),t.a.push(o.a)}),t}(t);return`\n<svg\n\txmlns:xlink="http://www.w3.org/1999/xlink"\n\tviewBox="0 0 0 0"\n\twidth="0"\n\theight="0"\n\tfocusable="false"\n\trole="none"\n\taria-hidden="true"\n\tstyle="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;"\n>\n\t<defs>\n\t\t<filter id="${e}">\n\t\t\t\x3c!--\n\t\t\t\tUse sRGB instead of linearRGB so transparency looks correct.\n\t\t\t\tUse perceptual brightness to convert to grayscale.\n\t\t\t--\x3e\n\t\t\t<feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "></feColorMatrix>\n\t\t\t\x3c!-- Use sRGB instead of linearRGB to be consistent with how CSS gradients work. --\x3e\n\t\t\t<feComponentTransfer color-interpolation-filters="sRGB">\n\t\t\t\t<feFuncR type="table" tableValues="${o.r.join(" ")}"></feFuncR>\n\t\t\t\t<feFuncG type="table" tableValues="${o.g.join(" ")}"></feFuncG>\n\t\t\t\t<feFuncB type="table" tableValues="${o.b.join(" ")}"></feFuncB>\n\t\t\t\t<feFuncA type="table" tableValues="${o.a.join(" ")}"></feFuncA>\n\t\t\t</feComponentTransfer>\n\t\t\t\x3c!-- Re-mask the image with the original transparency since the feColorMatrix above loses that information. --\x3e\n\t\t\t<feComposite in2="SourceGraphic" operator="in"></feComposite>\n\t\t</filter>\n\t</defs>\n</svg>`}},2636(e,t,o){o.d(t,{Of:()=>r,UE:()=>n});function n({minimumFontSize:e,maximumFontSize:t,fontSize:o,minimumViewportWidth:n="320px",maximumViewportWidth:a="1600px",scaleFactor:i=1,minimumFontSizeLimit:l}){if(l=r(l)?l:"14px",o){const n=r(o);if(!n?.unit||!n?.value)return null;const a=r(l,{coerceTo:n.unit});if(a?.value&&!e&&!t&&n?.value<=a?.value)return null;if(t||(t=`${n.value}${n.unit}`),!e){const t="px"===n.unit?n.value:16*n.value,o=Math.min(Math.max(1-.075*Math.log2(t),.25),.75),r=s(n.value*o,3);e=a?.value&&r<a?.value?`${a.value}${a.unit}`:`${r}${n.unit}`}}const c=r(e),d=c?.unit||"rem",u=r(t,{coerceTo:d});if(!c||!u)return null;const p=r(e,{coerceTo:"rem"}),m=r(a,{coerceTo:d}),g=r(n,{coerceTo:d});if(!m||!g||!p)return null;const f=m.value-g.value;if(!f)return null;const h=s(g.value/100,3),y=s(h,3)+d,_=s(((u.value-c.value)/f*100||1)*i,3);return`clamp(${e}, ${`${p.value}${p.unit} + ((1vw - ${y}) * ${_})`}, ${t})`}function r(e,t={}){if("string"!=typeof e&&"number"!=typeof e)return null;isFinite(e)&&(e=`${e}px`);const{coerceTo:o,rootSizeValue:n,acceptableUnits:r}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},a=r?.join("|"),i=new RegExp(`^(\\d*\\.?\\d+)(${a}){1,1}$`),l=e.toString().match(i);if(!l||l.length<3)return null;let[,c,d]=l,u=parseFloat(c);return"px"!==o||"em"!==d&&"rem"!==d||(u*=n,d=o),"px"!==d||"em"!==o&&"rem"!==o||(u/=n,d=o),"em"!==o&&"rem"!==o||"em"!==d&&"rem"!==d||(d=o),d?{value:s(u,3),unit:d}:null}function s(e,t=3){const o=Math.pow(10,t);return Math.round(e*o)/o}},8472(e,t,o){o.d(t,{$:()=>r});var n=o(7479);function r(e,t="0"){const o=function(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:e?.top,left:t?e:e?.left}}(e);if(!o)return null;const r=(0,n.X)(o?.top)||t,s=(0,n.X)(o?.left)||t;return r===s?r:`${r} ${s}`}},4022(e,t,o){o.d(t,{o:()=>n});var n={default:{name:"default",slug:"flow",className:"is-layout-flow",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}}],spacingStyles:[{selector:" > :first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},constrained:{name:"constrained",slug:"constrained",className:"is-layout-constrained",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > :where(:not(.alignleft):not(.alignright):not(.alignfull))",rules:{"max-width":"var(--wp--style--global--content-size)","margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > .alignwide",rules:{"max-width":"var(--wp--style--global--wide-size)"}}],spacingStyles:[{selector:" > :first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},flex:{name:"flex",slug:"flex",className:"is-layout-flex",displayMode:"flex",baseStyles:[{selector:"",rules:{"flex-wrap":"wrap","align-items":"center"}},{selector:" > :is(*, div)",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]},grid:{name:"grid",slug:"grid",className:"is-layout-grid",displayMode:"grid",baseStyles:[{selector:" > :is(*, div)",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]}}},233(e,t,o){function n(e,t,o){t=Array.isArray(t)?[...t]:[t],e=Array.isArray(e)?[...e]:{...e};const n=t.pop();let r=e;for(const e of t){const t=r[e];r=r[e]=Array.isArray(t)?[...t]:{...t}}return r[n]=o,e}o.d(t,{K:()=>r,n:()=>n});var r=(e,t,o)=>{const n=Array.isArray(t)?t:t.split(".");let r=e;return n.forEach(e=>{r=r?.[e]}),r??o}},7479(e,t,o){function n(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}o.d(t,{X:()=>n})},1355(e,t,o){function n(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([0-9])([a-zA-Z])/g,"$1-$2").replace(/([a-zA-Z])([0-9])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}o.d(t,{k:()=>n})},7731(e,t,o){o.d(t,{j:()=>s});var n=o(2636);function r(e){const t=e?.fluid;return!0===t||t&&"object"==typeof t&&Object.keys(t).length>0}function s(e,t){const{size:o}=e;if(!o||"0"===o||!1===e?.fluid)return o;if(!r(t?.typography)&&!r(e))return o;const s=function(e){const t=e?.typography??{},o=e?.layout,s=(0,n.Of)(o?.wideSize)?o?.wideSize:null;return r(t)&&s?{fluid:{maxViewportWidth:s,..."object"==typeof t.fluid?t.fluid:{}}}:{fluid:t?.fluid}}(t)?.fluid??{},a=(0,n.UE)({minimumFontSize:"boolean"==typeof e?.fluid?void 0:e?.fluid?.min,maximumFontSize:"boolean"==typeof e?.fluid?void 0:e?.fluid?.max,fontSize:o,minimumFontSizeLimit:"object"==typeof s?s?.minFontSize:void 0,maximumViewportWidth:"object"==typeof s?s?.maxViewportWidth:void 0,minimumViewportWidth:"object"==typeof s?s?.minViewportWidth:void 0});return a||o}},4694(e,t,o){o.d(t,{hG:()=>a});var n={mobile:"480px",tablet:"782px"},r=/^(\d+|\d*\.\d+)(px|em|rem)$/;function s(e){const t=function(e){return e&&"object"==typeof e?function(e){return"mobile"in e||"tablet"in e}(e)?e:e.settings?.viewport??{}:{}}(e),o={},s={};Object.keys(n).forEach(e=>{const n=e,a=t[n],i=function(e){if("number"==typeof e)return e;if("string"!=typeof e)return;const t=e.trim().match(r);if(!t)return;const o=Number.parseFloat(t[1]);return"px"===t[2]?o:16*o}(a);void 0!==i&&function(e){return"string"==typeof e&&r.test(e.trim())}(a)&&(o[n]=a.trim(),s[n]=i)});const a=Object.keys(o);if(!a.length)return{...n};if(1===a.length)return o;const i=o.mobile,l=o.tablet;return s.mobile>=s.tablet?{mobile:i}:{mobile:i,tablet:l}}function a(e){const t=s(e),o={};return t.mobile&&(o["@mobile"]=`@media (width <= ${t.mobile})`),t.tablet&&(o["@tablet"]=t.mobile?`@media (${t.mobile} < width <= ${t.tablet})`:`@media (width <= ${t.tablet})`),o}},3109(e,t,o){o.d(t,{A:()=>r});var n=o(6087),r=(0,n.forwardRef)(({icon:e,size:t=24,...o},r)=>(0,n.cloneElement)(e,{width:t,height:t,...o,ref:r}))},2344(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"})})},135(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M11.53 4.47a.75.75 0 1 0-1.06 1.06l8 8a.75.75 0 1 0 1.06-1.06l-8-8Zm5 1a.75.75 0 1 0-1.06 1.06l2 2a.75.75 0 1 0 1.06-1.06l-2-2Zm-11.06 10a.75.75 0 0 1 1.06 0l2 2a.75.75 0 1 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06Zm.06-5a.75.75 0 0 0-1.06 1.06l8 8a.75.75 0 1 0 1.06-1.06l-8-8Zm-.06-3a.75.75 0 0 1 1.06 0l10 10a.75.75 0 1 1-1.06 1.06l-10-10a.75.75 0 0 1 0-1.06Zm3.06-2a.75.75 0 0 0-1.06 1.06l10 10a.75.75 0 1 0 1.06-1.06l-10-10Z"})})},8929(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{d:"M13.75 4.194a8 8 0 0 0-4.812.415l-.301.132a8 8 0 0 0-3.203 2.692L4 6.001v4h4L6.517 8.516q.333-.526.758-.977l.011-.012q.341-.359.733-.662l.025-.02a6.5 6.5 0 0 1 2.469-1.172l.034-.008q.117-.027.236-.05l.015-.002q.32-.06.65-.088.08-.008.16-.013a7 7 0 0 1 .323-.01L12 5.5h.05l.203.005.101.003q.146.008.293.023l.12.014.158.02q.103.015.205.033l.058.011q.107.02.212.043l.068.016a6.5 6.5 0 0 1 1.447.521l.02.01a7 7 0 0 1 .452.25l.02.014a7 7 0 0 1 .468.317l.07.054a7 7 0 0 1 .403.334l.034.03q.091.084.18.172l.047.045q.293.294.548.627l.03.038.07.097.096.135q.037.053.072.107a6 6 0 0 1 .167.265l.042.073q.236.411.413.857l.027.07a6.5 6.5 0 0 1 .418 2.014 6.6 6.6 0 0 1-.034 1.04 6 6 0 0 1-.063.424q-.109.597-.32 1.152-.016.034-.028.07a6.5 6.5 0 0 1-.413.856l-.042.073a6 6 0 0 1-.327.497l-.087.118-.02.028a7 7 0 0 1-.526.604l-.035.035-.035.032q-.089.088-.18.172l-.034.03a7 7 0 0 1-.38.317l-.093.071q-.09.067-.183.13l-.076.053q-.112.076-.227.146-.218.133-.446.247l-.028.015-.192.093-.081.036a6.5 6.5 0 0 1-1.184.396l-.058.012a7 7 0 0 1-.475.087q-.08.012-.157.02l-.122.014q-.145.015-.292.023l-.136.005-.139.003L12 18.5q-.053-.002-.104-.003l-.127-.004-.162-.007q-.08-.005-.159-.013a7 7 0 0 1-.65-.088q-.008 0-.015-.002a7 7 0 0 1-.236-.05l-.034-.008a6.5 6.5 0 0 1-4.14-3.077l-1.3.75a8 8 0 0 0 3.564 3.26l.301.131a8 8 0 0 0 11.055-7.061l.007-.33c0-1.76-.581-3.473-1.653-4.87l-.206-.256a8 8 0 0 0-4.07-2.6zM12 7.75a.75.75 0 0 0-.75.75V12a.75.75 0 0 0 .218.529l1.282-.839-1.28.84 2.5 2.5a.75.75 0 1 0 1.06-1.06l-2.28-2.28V8.5a.75.75 0 0 0-.75-.75"})})},2478(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})})},8901(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{d:"M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z"})})},9558(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})})},8329(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})})},4532(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.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"})})},1866(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})})},8847(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z"})})},4361(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{d:"M12.5 15v5H11v-5H4V9h7V4h1.5v5h7v6h-7Z"})})},7105(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})})},3172(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})})},7217(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})})},2484(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{d:"M7 11.5h10V13H7z"})})},2141(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 0 1-6.5 6.5v-13a6.5 6.5 0 0 1 6.5 6.5Z"})})},7839(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})})},7480(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{d:"m8.6 7 3.9 10.8h-1.7l-1-2.8H5.7l-1 2.8H3L6.9 7h1.7Zm-2.4 6.6h3L7.7 9.3l-1.5 4.3ZM17.691 8.879c.473 0 .88.055 1.221.165.352.1.643.264.875.495.274.253.456.572.544.957.088.374.132.83.132 1.37v4.554c0 .274.033.472.099.593.077.11.198.166.363.166.11 0 .215-.028.313-.083.11-.055.237-.137.38-.247l.165.28a3.304 3.304 0 0 1-.71.446c-.23.11-.527.165-.89.165-.352 0-.639-.055-.858-.165-.22-.11-.386-.27-.495-.479-.1-.209-.149-.468-.149-.775-.286.462-.627.814-1.023 1.056-.396.242-.858.363-1.386.363-.462 0-.858-.088-1.188-.264a1.752 1.752 0 0 1-.742-.726 2.201 2.201 0 0 1-.248-1.056c0-.484.11-.875.33-1.172.22-.308.5-.556.841-.742.352-.187.721-.341 1.106-.462.396-.132.765-.253 1.106-.363.351-.121.637-.259.857-.413.232-.154.347-.357.347-.61V10.81c0-.396-.066-.71-.198-.941a1.05 1.05 0 0 0-.511-.511 1.763 1.763 0 0 0-.76-.149c-.253 0-.522.039-.808.116a1.165 1.165 0 0 0-.677.412 1.1 1.1 0 0 1 .595.396c.165.187.247.424.247.71 0 .307-.104.55-.313.726-.198.176-.451.263-.76.263-.34 0-.594-.104-.758-.313a1.231 1.231 0 0 1-.248-.759c0-.297.072-.539.214-.726.154-.187.352-.363.595-.528.264-.176.6-.324 1.006-.445.418-.121.88-.182 1.386-.182Zm.99 3.729a1.57 1.57 0 0 1-.528.462c-.231.121-.479.248-.742.38a5.377 5.377 0 0 0-.76.462c-.23.165-.423.38-.577.643-.154.264-.231.6-.231 1.007 0 .429.11.77.33 1.023.22.242.517.363.891.363.308 0 .594-.088.858-.264.275-.176.528-.44.759-.792v-3.284Z"})})},6168(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{d:"M 22 12 C 22 6.49 17.51 2 12 2 C 6.48 2 2 6.49 2 12 C 2 17.52 6.48 22 12 22 C 17.51 22 22 17.52 22 12 M 9.78 17.37 L 6.37 8.22 C 6.92 8.2 7.54 8.14 7.54 8.14 C 8.04 8.08 7.98 7.01 7.48 7.03 C 7.48 7.03 6.03 7.14 5.11 7.14 C 4.93 7.14 4.74 7.14 4.53 7.13 C 6.12 4.69 8.87 3.11 12 3.11 C 14.33 3.11 16.45 3.98 18.05 5.45 C 17.37 5.34 16.4 5.84 16.4 7.03 C 16.4 7.77 16.85 8.39 17.3 9.13 C 17.65 9.74 17.85 10.49 17.85 11.59 C 17.85 13.08 16.45 16.59 16.45 16.59 L 13.42 8.22 C 13.96 8.2 14.24 8.05 14.24 8.05 C 14.74 8 14.68 6.8 14.18 6.83 C 14.18 6.83 12.74 6.95 11.8 6.95 C 10.93 6.95 9.47 6.83 9.47 6.83 C 8.97 6.8 8.91 8.03 9.41 8.05 L 10.33 8.13 L 11.59 11.54 L 9.78 17.37 M 19.41 12 C 19.65 11.36 20.15 10.13 19.84 7.75 C 20.54 9.04 20.89 10.46 20.89 12 C 20.89 15.29 19.16 18.24 16.49 19.78 C 17.46 17.19 18.43 14.58 19.41 12 M 8.1 20.09 C 5.12 18.65 3.11 15.53 3.11 12 C 3.11 10.7 3.34 9.52 3.83 8.41 C 5.25 12.3 6.67 16.2 8.1 20.09 M 12.13 13.46 L 14.71 20.44 C 13.85 20.73 12.95 20.89 12 20.89 C 11.21 20.89 10.43 20.78 9.71 20.56 C 10.52 18.18 11.33 15.82 12.13 13.46 L 12.13 13.46"})})},3022(e,t,o){function n(e){var t,o,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(o=n(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}o.d(t,{A:()=>r});const r=function(){for(var e,t,o=0,r="",s=arguments.length;o<s;o++)(e=arguments[o])&&(t=n(e))&&(r&&(r+=" "),r+=t);return r}},3270(e,t,o){o.d(t,{Mj:()=>$});for(var n={grad:.9,turn:360,rad:360/(2*Math.PI)},r=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},s=function(e,t,o){return void 0===t&&(t=0),void 0===o&&(o=Math.pow(10,t)),Math.round(o*e)/o+0},a=function(e,t,o){return void 0===t&&(t=0),void 0===o&&(o=1),e>o?o:e>t?e:t},i=function(e){return(e=isFinite(e)?e%360:0)<0?e+360:e},l=function(e,t){return void 0===t&&(t=0),s(e,t)%360},c=function(e){return{r:a(e.r,0,255),g:a(e.g,0,255),b:a(e.b,0,255),a:a(e.a)}},d=function(e){return{r:s(e.r),g:s(e.g),b:s(e.b),a:s(e.a,3)}},u=/^#([0-9a-f]{3,8})$/i,p=function(e,t){var o=e.charCodeAt(t);return(15&o)+9*(o>>6)},m=function(e,t){return p(e,t)<<4|p(e,t+1)},g=[],f=0;f<256;f++)g.push((f<16?"0":"")+f.toString(16));var h=function(e){return g[a(e,0,255)]},y=function(e){var t=e.r,o=e.g,n=e.b,r=e.a,s=Math.max(t,o,n),a=s-Math.min(t,o,n),i=a?s===t?(o-n)/a:s===o?2+(n-t)/a:4+(t-o)/a:0;return{h:60*(i<0?i+6:i),s:s?a/s*100:0,v:s/255*100,a:r}},_=function(e){var t=e.h,o=e.s,n=e.v,r=e.a;t=t/360*6,o/=100,n/=100;var s=Math.floor(t),a=n*(1-o),i=n*(1-(t-s)*o),l=n*(1-(1-t+s)*o),c=s%6;return{r:255*[n,i,a,a,l,n][c],g:255*[l,n,n,i,a,a][c],b:255*[a,a,l,n,n,i][c],a:r}},b=function(e){return{h:i(e.h),s:a(e.s,0,100),l:a(e.l,0,100),a:a(e.a)}},x=function(e){return{h:l(e.h),s:s(e.s),l:s(e.l),a:s(e.a,3)}},v=function(e){return _((o=(t=e).s,{h:t.h,s:(o*=((n=t.l)<50?n:100-n)/100)>0?2*o/(n+o)*100:0,v:n+o,a:t.a}));var t,o,n},w=function(e){return{h:(t=y(e)).h,s:(r=(200-(o=t.s))*(n=t.v)/100)>0&&r<200?o*n/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,o,n,r},k=/^hsla?\(\s*([+-]?(?:\d*\.\d+|\d+))(deg|rad|grad|turn)?\s*,\s*([+-]?(?:\d*\.\d+|\d+))%\s*,\s*([+-]?(?:\d*\.\d+|\d+))%\s*(?:,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i,j=/^hsla?\(\s*([+-]?(?:\d*\.\d+|\d+))(deg|rad|grad|turn)?\s+([+-]?(?:\d*\.\d+|\d+))%\s+([+-]?(?:\d*\.\d+|\d+))%\s*(?:\/\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i,S=/^rgba?\(\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*(?:,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i,E=/^rgba?\(\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s+([+-]?(?:\d*\.\d+|\d+))(%)?\s+([+-]?(?:\d*\.\d+|\d+))(%)?\s*(?:\/\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i,C={string:[[function(e){if(!u.test(e))return null;var t=e.length;return t<=5?{r:17*p(e,1),g:17*p(e,2),b:17*p(e,3),a:5===t?s(17*p(e,4)/255,2):1}:7===t||9===t?{r:m(e,1),g:m(e,3),b:m(e,5),a:9===t?s(m(e,7)/255,2):1}:null},"hex"],[function(e){var t=S.exec(e)||E.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:c({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=k.exec(e)||j.exec(e);if(!t)return null;var o,r,s=b({h:(o=t[1],r=t[2],void 0===r&&(r="deg"),Number(o)*(n[r]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return v(s)},"hsl"]],object:[[function(e){var t=e.r,o=e.g,n=e.b,s=e.a,a=void 0===s?1:s;return r(t)&&r(o)&&r(n)?c({r:Number(t),g:Number(o),b:Number(n),a:Number(a)}):null},"rgb"],[function(e){var t=e.h,o=e.s,n=e.l,s=e.a,a=void 0===s?1:s;if(!r(t)||!r(o)||!r(n))return null;var i=b({h:Number(t),s:Number(o),l:Number(n),a:Number(a)});return v(i)},"hsl"],[function(e){var t=e.h,o=e.s,n=e.v,s=e.a,l=void 0===s?1:s;if(!r(t)||!r(o)||!r(n))return null;var c=function(e){return{h:i(e.h),s:a(e.s,0,100),v:a(e.v,0,100),a:a(e.a)}}({h:Number(t),s:Number(o),v:Number(n),a:Number(l)});return _(c)},"hsv"]]},T=function(e,t){for(var o=0;o<t.length;o++){var n=t[o][0](e);if(n)return[n,t[o][1]]}return[null,void 0]},N=function(e){return"string"==typeof e?T(e.trim(),C.string):"object"==typeof e&&null!==e?T(e,C.object):[null,void 0]},P=function(e,t){var o=w(e);return{h:o.h,s:a(o.s+100*t,0,100),l:o.l,a:o.a}},M=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},B=function(e,t){var o=w(e);return{h:o.h,s:o.s,l:a(o.l+100*t,0,100),a:o.a}},A=function(){function e(e){this.parsed=N(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return s(M(this.rgba),2)},e.prototype.isDark=function(){return M(this.rgba)<.5},e.prototype.isLight=function(){return M(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=d(this.rgba)).r,o=e.g,n=e.b,a=(r=e.a)<1?h(s(255*r)):"","#"+h(t)+h(o)+h(n)+a;var e,t,o,n,r,a},e.prototype.toRgb=function(){return d(this.rgba)},e.prototype.toRgbString=function(){return t=(e=d(this.rgba)).r,o=e.g,n=e.b,(r=e.a)<1?"rgba("+t+", "+o+", "+n+", "+r+")":"rgb("+t+", "+o+", "+n+")";var e,t,o,n,r},e.prototype.toHsl=function(){return x(w(this.rgba))},e.prototype.toHslString=function(){return t=(e=x(w(this.rgba))).h,o=e.s,n=e.l,(r=e.a)<1?"hsla("+t+", "+o+"%, "+n+"%, "+r+")":"hsl("+t+", "+o+"%, "+n+"%)";var e,t,o,n,r},e.prototype.toHsv=function(){return e=y(this.rgba),{h:l(e.h),s:s(e.s),v:s(e.v),a:s(e.a,3)};var e},e.prototype.invert=function(){return $({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),$(P(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),$(P(this.rgba,-e))},e.prototype.grayscale=function(){return $(P(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),$(B(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),$(B(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(w(this.rgba).h+e)},e.prototype.alpha=function(e){return"number"==typeof e?$({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):s(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=w(this.rgba);return"number"==typeof e?$({h:e,s:t.s,l:t.l,a:t.a}):l(t.h)},e.prototype.isEqual=function(e){return this.toHex()===$(e).toHex()},e}(),$=function(e){return e instanceof A?e:new A(e)}}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,o),s.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e=o(390),t=o(1455),n=o.n(t),r=o(6427),s=o(6087),a=o(7723),i=o(3832),l=o(790);const __=a.__,c="/wpcom/v2/email-editor-bootstrap",d=["http:","https:"];function u(e,t){const{editorSettings:o,urls:n,userEmail:r,globalStylesPostId:s}=t;if(!e?.editor_settings)throw new Error("The email editor bundle is missing editor_settings.");if(!e?.editor_theme)throw new Error("The email editor bundle is missing editor_theme.");if("string"!=typeof n?.back||"string"!=typeof n?.listings)throw new Error("JetpackEmailDesignEditor.urls.back and .listings are required strings.");return Object.entries(n).forEach(([e,t])=>function(e,t){if("string"!=typeof e)throw new Error(`JetpackEmailDesignEditor.urls.${t} must be a string.`);let o;try{o=new URL(e,window.location.href)}catch{throw new Error(`JetpackEmailDesignEditor.urls.${t} is not a valid URL.`)}if(!d.includes(o.protocol))throw new Error(`JetpackEmailDesignEditor.urls.${t} must be an http or https URL.`)}(t,e)),{editorSettings:{...e.editor_settings,...o},theme:e.editor_theme,urls:n,userEmail:r,globalStylesPostId:p(e)??s??null}}function p(e){const t=e?.global_styles?.post_id;return Number.isInteger(t)&&t>0?t:null}function m(e){const t=e?.global_styles,o=p(e);if(!o||!t?.record)return{};const n=t.can_edit?"GET, POST, PUT":"GET",r={body:t.record,headers:{Allow:n}};return{[`/wp/v2/global-styles/${o}`]:r,[`/wp/v2/global-styles/${o}?context=view`]:r,[`/wp/v2/global-styles/${o}?context=edit`]:r,OPTIONS:{[`/wp/v2/global-styles/${o}`]:{body:{},headers:{Allow:n}}}}}function g(e,t){const o=e?.templates;if(!Array.isArray(o)||0===o.length)return{};const n={body:o,headers:{"X-WP-Total":String(o.length),"X-WP-TotalPages":"1"}},r={"/wp/v2/templates":n,"/wp/v2/templates?context=edit":n,"/wp/v2/templates?context=view":n},s=o.find(e=>e?.id===t);if(s){const e={body:s,headers:{Allow:"GET"}};r[`/wp/v2/templates/${t}`]=e,r[`/wp/v2/templates/${t}?context=edit`]=e}return r}function f(){return(0,l.jsx)(r.Notice,{status:"error",isDismissible:!1,children:__("The email design editor could not be loaded. Please reload the page to try again.","jetpack")})}async function h(){const t=window.JetpackEmailDesignEditor;if(!t||"object"!=typeof t)return;const o=document.getElementById(t.elementId);if(!o)return;const r=(0,s.createRoot)(o);try{const o=await n()({path:t.templateSlug?(0,i.addQueryArgs)(c,{template_slug:t.templateSlug}):c}),a=u(o,t),d=function(e){const t=e?.template?.id;if("string"!=typeof t||""===t)throw new Error("The email editor bundle is missing its template id.");return t}(o),p=function(e,t){const o={...g(e,t),...m(e)};return Object.keys(o).length>0?o:null}(o,d);p&&n().use(n().createPreloadingMiddleware(p)),r.render((0,l.jsx)(s.StrictMode,{children:(0,l.jsx)(e.w,{postId:d,postType:"wp_template",config:a})}))}catch(e){console.error("Jetpack email design editor:",e),r.render((0,l.jsx)(f,{}))}}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",h,{once:!0}):h()})()})();
28 +(0,r.__)("Typography %s styles","jetpack"),t);return(0,n.jsx)(s.__experimentalItem,{children:(0,n.jsx)(s.__experimentalNavigatorButton,{path:`/typography/${e}`,"aria-label":_,onClick:()=>(0,l.yM)("styles_sidebar_screen_typography_button_click",{element:e,label:t,path:`typography/${e}`}),children:(0,n.jsxs)(s.__experimentalHStack,{justify:"flex-start",children:[(0,n.jsx)(s.FlexItem,{className:"edit-site-global-styles-screen-typography__indicator",style:{fontFamily:d??"serif",background:y,color:h,fontStyle:u??"normal",fontWeight:p??"normal",letterSpacing:m??"normal",textDecoration:g??("link"===e?"underline":"none"),textTransform:f??"none"},children:"Aa"}),(0,n.jsx)(s.FlexItem,{children:t})]})})})}var d=function(){return(0,n.jsx)(s.Card,{size:"small",variant:"primary",isBorderless:!0,children:(0,n.jsx)(s.CardBody,{children:(0,n.jsxs)(s.__experimentalVStack,{spacing:3,children:[(0,n.jsx)(s.__experimentalHeading,{level:3,className:"edit-site-global-styles-subtitle",children:(0,r.__)("Elements","jetpack")}),(0,n.jsxs)(s.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,size:"small",children:[(0,n.jsx)(c,{element:"text",label:(0,r.__)("Text","jetpack")}),(0,n.jsx)(c,{element:"link",label:(0,r.__)("Links","jetpack")}),(0,n.jsx)(c,{element:"heading",label:(0,r.__)("Headings","jetpack")}),(0,n.jsx)(c,{element:"button",label:(0,r.__)("Buttons","jetpack")})]})]})})})}},7096(e,t,o){o.d(t,{A:()=>a});var n=o(790),r=o(665),s=o(1935);function a({element:e,headingLevel:t}){const{styles:o}=(0,r.u)(),a=(0,s.B)(o,e,t,!0),{fontFamily:i,fontSize:l,fontStyle:c,fontWeight:d,lineHeight:u,letterSpacing:p,textDecoration:m,textTransform:g}=a.typography,f=a.color?.text||"inherit",h=a.color?.background||"#f0f0f0",y="link"===e?{textDecoration:m??"underline"}:{};return(0,n.jsx)("div",{className:"edit-site-typography-preview",style:{fontFamily:i??"serif",background:h,color:f,lineHeight:u,fontSize:l,fontStyle:c,fontWeight:d,letterSpacing:p,textDecoration:m,textTransform:g,...y},children:"Aa"})}},6380(e,t,o){o.d(t,{l:()=>g});var n=o(790),r=o(7143),s=o(6087),a=o(6427),i=o(3124),l=o(665),c=o(3598);const d=[],u={start:{scale:1,opacity:1},hover:{scale:0,opacity:0}},p={hover:{opacity:1},start:{opacity:.5}},m={hover:{scale:1,opacity:1},start:{scale:0,opacity:0}};function g({label:e,isFocused:t,withHoverView:o}){const{colors:g}=(0,r.useSelect)(e=>({colors:e(i.H).getPaletteColors()}),[]),f=(0,s.useMemo)(()=>(g?.theme||d).concat(g?.default||d),[g]),{styles:h}=(0,l.u)(),{backgroundColor:y,headingColor:_,highlightedColors:b}=(0,s.useMemo)(()=>{const e=(0,c.pr)(h?.color?.background)||"white",t=(0,c.pr)(h?.color?.text)||"black",o=(0,c.pr)(h?.elements?.h1?.color?.text)||t,n=(0,c.pr)(h?.elements?.link?.color?.text)||o,r=(0,c.pr)(h?.elements?.button?.color?.background)||n,s=f.find(({color:e})=>e.toLowerCase()===t.toLowerCase()),a=f.find(({color:e})=>e.toLowerCase()===r.toLowerCase()),i=[...s?[s]:d,...a?[a]:d,...f].filter(({color:t},o,n)=>t.toLowerCase()!==e.toLowerCase()&&o===n.findIndex(e=>e.color.toLowerCase()===t.toLowerCase())).slice(0,2);return{backgroundColor:e,headingColor:o,highlightedColors:i}},[h,f]),x=h?.elements?.heading?.typography?.fontWeight||"inherit",v=h?.elements?.heading?.typography?.fontFamily||"inherit",[k,w]=(0,s.useState)(!1);return(0,n.jsx)("div",{onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:(0,n.jsxs)(a.__unstableMotion.div,{style:{height:152,width:"100%",background:y,cursor:o?"pointer":void 0},initial:"start",animate:(k||t)&&e?"hover":"start",children:[(0,n.jsx)(a.__unstableMotion.div,{variants:u,style:{height:"100%",overflow:"hidden"},children:(0,n.jsxs)(a.__experimentalHStack,{spacing:10,justify:"center",style:{height:"100%",overflow:"hidden"},children:[(0,n.jsx)(a.__unstableMotion.div,{style:{fontFamily:v,fontSize:65,color:_,fontWeight:x},animate:{scale:1,opacity:1},initial:{scale:.1,opacity:0},transition:{delay:.3,type:"tween"},children:"Aa"}),(0,n.jsx)(a.__experimentalVStack,{spacing:4,children:b.map(({slug:e,color:t},o)=>(0,n.jsx)(a.__unstableMotion.div,{style:{height:32,width:32,background:t,borderRadius:16},animate:{scale:1,opacity:1},initial:{scale:.1,opacity:0},transition:{delay:1===o?.2:.1}},e))})]})}),(0,n.jsx)(a.__unstableMotion.div,{variants:o&&p,style:{height:"100%",width:"100%",position:"absolute",top:0,overflow:"hidden",filter:"blur(60px)",opacity:.1},children:(0,n.jsx)(a.__experimentalHStack,{spacing:0,justify:"flex-start",style:{height:"100%",overflow:"hidden"},children:f.slice(0,4).map(({color:e})=>(0,n.jsx)("div",{style:{height:"100%",background:e,flexGrow:1}},e))})}),(0,n.jsx)(a.__unstableMotion.div,{variants:m,style:{height:"100%",width:"100%",overflow:"hidden",position:"absolute",top:0},children:(0,n.jsx)(a.__experimentalVStack,{spacing:3,justify:"center",style:{height:"100%",overflow:"hidden",padding:10,boxSizing:"border-box"},children:e&&(0,n.jsx)("div",{style:{fontSize:40,fontFamily:v,color:_,fontWeight:x,lineHeight:"1em",textAlign:"center"},children:e})})})]})})}},335(e,t,o){o.d(t,{l:()=>d});var n=o(790),r=o(7723),s=o(6234),a=o(665),i=o(9034),l=o(6816),c=o(1847);function d(){(0,l.xW)("styles_sidebar_screen_background_opened");const{userStyles:e,styles:t,updateStyles:o}=(0,a.u)(),d=(0,i.DL)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.A,{title:(0,r.__)("Background","jetpack"),description:(0,r.__)("Manage the background color of the email.","jetpack")}),(0,n.jsx)(c.D_,{value:e,inheritedValue:t,onChange:e=>{o(e),(0,l.yM)("styles_sidebar_screen_background_styles_updated")},settings:d,panelId:"background"})]})}},423(e,t,o){o.d(t,{f:()=>u});var n=o(790),r=o(7723),s=o(7143),a=o(6234),i=o(665),l=o(3124),c=o(6816),d=o(1847);function u(){(0,c.xW)("styles_sidebar_screen_colors_opened");const{userStyles:e,styles:t,updateStyles:o}=(0,i.u)(),u=(0,s.useSelect)(e=>e(l.H).getTheme(),[]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.A,{title:(0,r.__)("Colors","jetpack"),description:(0,r.__)("Manage palettes and the default color of different global elements.","jetpack")}),(0,n.jsx)(d.oz,{value:e,inheritedValue:t,onChange:e=>{o(e),(0,c.yM)("styles_sidebar_screen_colors_styles_updated")},settings:u?.settings,panelId:"colors"})]})}},6234(e,t,o){o.d(t,{A:()=>c,a:()=>l});var n=o(790),r=o(7723),s=o(9558),a=o(6427),i=o(4751);function l({title:e,description:t,onBack:o}){return(0,n.jsxs)(a.__experimentalVStack,{spacing:0,children:[(0,n.jsx)(a.__experimentalView,{children:(0,n.jsx)(a.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3,children:(0,n.jsxs)(a.__experimentalHStack,{spacing:2,children:[(0,n.jsx)(i.m.BackButton,{style:{minWidth:24,padding:0},icon:s.A,size:"small","aria-label":(0,r.__)("Navigate to the previous view","jetpack"),onClick:o}),(0,n.jsx)(a.__experimentalSpacer,{children:(0,n.jsx)(a.__experimentalHeading,{className:"woocommerce-email-editor-styles-header",level:2,size:13,children:e})})]})})}),t&&(0,n.jsx)("p",{className:"woocommerce-email-editor-styles-header-description",children:t})]})}var c=l},421(e,t,o){o.d(t,{z:()=>l});var n=o(790),r=o(7723),s=o(7256),a=o(6234),i=o(6816);function l(){return(0,i.xW)("styles_sidebar_screen_layout_opened"),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.a,{title:(0,r.__)("Layout","jetpack")}),(0,n.jsx)(s.W,{})]})}},1659(e,t,o){o.d(t,{r:()=>m});var n=o(790),r=o(7723),s=o(135),a=o(4532),i=o(7217),l=o(7480),c=o(6427),d=o(6380),u=o(9034),p=o(6816);function m(){const e=(0,u.SG)();return(0,n.jsx)(c.Card,{size:"small",className:"edit-site-global-styles-screen-root",variant:"primary",children:(0,n.jsx)(c.CardBody,{children:(0,n.jsxs)(c.__experimentalVStack,{spacing:4,children:[(0,n.jsx)(c.Card,{children:(0,n.jsx)(c.CardMedia,{children:(0,n.jsx)(d.l,{})})}),(0,n.jsxs)(c.__experimentalItemGroup,{children:[(0,n.jsx)(c.__experimentalNavigatorButton,{path:"/typography",onClick:()=>(0,p.yM)("styles_sidebar_navigation_click",{path:"typography"}),children:(0,n.jsx)(c.__experimentalItem,{children:(0,n.jsxs)(c.__experimentalHStack,{justify:"flex-start",children:[(0,n.jsx)(c.Icon,{icon:l.A,size:24}),(0,n.jsx)(c.FlexItem,{children:(0,r.__)("Typography","jetpack")})]})})}),(0,n.jsx)(c.__experimentalNavigatorButton,{path:"/colors",onClick:()=>(0,p.yM)("styles_sidebar_navigation_click",{path:"colors"}),children:(0,n.jsx)(c.__experimentalItem,{children:(0,n.jsxs)(c.__experimentalHStack,{justify:"flex-start",children:[(0,n.jsx)(c.Icon,{icon:a.A,size:24}),(0,n.jsx)(c.FlexItem,{children:(0,r.__)("Colors","jetpack")})]})})}),e&&(0,n.jsx)(c.__experimentalNavigatorButton,{path:"/background",onClick:()=>(0,p.yM)("styles_sidebar_navigation_click",{path:"background"}),children:(0,n.jsx)(c.__experimentalItem,{children:(0,n.jsxs)(c.__experimentalHStack,{justify:"flex-start",children:[(0,n.jsx)(c.Icon,{icon:s.A,size:24}),(0,n.jsx)(c.FlexItem,{children:(0,r.__)("Background","jetpack")})]})})}),(0,n.jsx)(c.__experimentalNavigatorButton,{path:"/layout",onClick:()=>(0,p.yM)("styles_sidebar_navigation_click",{path:"layout"}),children:(0,n.jsx)(c.__experimentalItem,{children:(0,n.jsxs)(c.__experimentalHStack,{justify:"flex-start",children:[(0,n.jsx)(c.Icon,{icon:i.A,size:24}),(0,n.jsx)(c.FlexItem,{children:(0,r.__)("Layout","jetpack")})]})})})]})]})})})}},2643(e,t,o){o.d(t,{A:()=>p});var n=o(790),r=o(7723),s=o(6087),a=o(6427),i=o(4013),l=o(7096),c=o(6234),d=o(6816);const u={text:{title:(0,r.__)("Text","jetpack"),description:(0,r.__)("Manage the fonts and typography used on text.","jetpack"),defaultControls:i.bf},link:{title:(0,r.__)("Links","jetpack"),description:(0,r.__)("Manage the fonts and typography used on links.","jetpack"),defaultControls:{...i.bf,textDecoration:!0}},heading:{title:(0,r.__)("Headings","jetpack"),description:(0,r.__)("Manage the fonts and typography used on headings.","jetpack"),defaultControls:{...i.bf,textTransform:!0}},button:{title:(0,r.__)("Buttons","jetpack"),description:(0,r.__)("Manage the fonts and typography used on buttons.","jetpack"),defaultControls:i.bf}};function p({element:e}){(0,d.xW)("styles_sidebar_screen_typography_element_opened",{element:e});const[t,o]=(0,s.useState)("heading");return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.A,{title:u[e].title,description:u[e].description}),(0,n.jsx)(a.__experimentalSpacer,{marginX:4,children:(0,n.jsx)(l.A,{element:e,headingLevel:t})}),"heading"===e&&(0,n.jsx)(a.__experimentalSpacer,{marginX:4,marginBottom:"1em",children:(0,n.jsxs)(a.__experimentalToggleGroupControl,{label:(0,r.__)("Select heading level","jetpack"),hideLabelFromVision:!0,value:t,onChange:e=>{o(e.toString()),(0,d.yM)("styles_sidebar_screen_typography_element_heading_level_selected",{value:e})},isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0,children:[(0,n.jsx)(a.__experimentalToggleGroupControlOption,{value:"heading",label:(0,r._x)("All","heading levels","jetpack")}),(0,n.jsx)(a.__experimentalToggleGroupControlOption,{value:"h1",label:(0,r._x)("H1","Heading Level","jetpack")}),(0,n.jsx)(a.__experimentalToggleGroupControlOption,{value:"h2",label:(0,r._x)("H2","Heading Level","jetpack")}),(0,n.jsx)(a.__experimentalToggleGroupControlOption,{value:"h3",label:(0,r._x)("H3","Heading Level","jetpack")}),(0,n.jsx)(a.__experimentalToggleGroupControlOption,{value:"h4",label:(0,r._x)("H4","Heading Level","jetpack")}),(0,n.jsx)(a.__experimentalToggleGroupControlOption,{value:"h5",label:(0,r._x)("H5","Heading Level","jetpack")}),(0,n.jsx)(a.__experimentalToggleGroupControlOption,{value:"h6",label:(0,r._x)("H6","Heading Level","jetpack")})]})}),(0,n.jsx)(i.Ay,{element:e,headingLevel:t,defaultControls:u[e].defaultControls})]})}},5642(e,t,o){o.d(t,{w:()=>l});var n=o(790),r=o(7723),s=o(2620),a=o(6234),i=o(6816);function l(){return(0,i.xW)("styles_sidebar_screen_typography_opened"),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.A,{title:(0,r.__)("Typography","jetpack"),description:(0,r.__)("Manage the typography settings for different elements.","jetpack")}),(0,n.jsx)(s.A,{})]})}},639(e,t,o){o.d(t,{r:()=>y});var n=o(790),r=o(6087),s=o(7723),a=o(7143),i=o(2141),l=o(3656),c=o(3124),d=o(5642),u=o(421),p=o(1659),m=o(2643),g=o(423),f=o(335),h=o(4751);const y=(0,r.memo)(function(){const{userCanEditGlobalStyles:e}=(0,a.useSelect)(e=>{const{canEdit:t}=e(c.H).canUserEditGlobalEmailStyles();return{userCanEditGlobalStyles:t}},[]);return e&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.PluginSidebarMoreMenuItem,{target:"email-styles-sidebar",icon:i.A,children:(0,s.__)("Email styles","jetpack")}),(0,n.jsx)(l.PluginSidebar,{name:"email-styles-sidebar",icon:i.A,title:(0,s.__)("Styles","jetpack"),className:"woocommerce-email-editor-styles-panel",children:(0,n.jsxs)(h.m,{initialPath:"/",children:[(0,n.jsx)(h.m.Screen,{path:"/",children:(0,n.jsx)(p.r,{})}),(0,n.jsx)(h.m.Screen,{path:"/typography",children:(0,n.jsx)(d.w,{})}),(0,n.jsx)(h.m.Screen,{path:"/typography/text",children:(0,n.jsx)(m.A,{element:"text"})}),(0,n.jsx)(h.m.Screen,{path:"/typography/link",children:(0,n.jsx)(m.A,{element:"link"})}),(0,n.jsx)(h.m.Screen,{path:"/typography/heading",children:(0,n.jsx)(m.A,{element:"heading"})}),(0,n.jsx)(h.m.Screen,{path:"/typography/button",children:(0,n.jsx)(m.A,{element:"button"})}),(0,n.jsx)(h.m.Screen,{path:"/colors",children:(0,n.jsx)(g.f,{})}),(0,n.jsx)(h.m.Screen,{path:"/background",children:(0,n.jsx)(f.l,{})}),(0,n.jsx)(h.m.Screen,{path:"/layout",children:(0,n.jsx)(u.z,{})})]})})]})})},1935(e,t,o){o.d(t,{B:()=>a});var n=o(3764),r=o.n(n);const s={typography:{},color:{}},a=(e,t,o="heading",n=!1)=>{let a;switch(t){case"text":a={typography:e.typography,color:e.color};break;case"heading":a=((e,t="heading",o=!1)=>o?r().all([s,e.elements?.heading||{},e.elements?.[t]||{}]):{...s,...e.elements?.heading||{},...e.elements?.[t]||{}})(e,o??"heading",n);break;default:a=e.elements?.[t]||s}return{...a,typography:a.typography??{},color:a.color??{}}}},4095(e,t,o){o.d(t,{O:()=>f});var n=o(790),r=o(6427),s=o(7143),a=o(3656),i=o(6087),l=o(7723),c=o(3109),d=o(7217),u=o(3124),p=o(6816);const m="woocommerce-email-editor-template-area-affordance-slot",g="woocommerce-email-editor-template-area-affordance-style";function f(){const[e,t]=(0,i.useState)(!1),[o,f]=(0,i.useState)(null),[h,y]=(0,i.useState)(null),_=(0,i.useRef)(null),{canEditTemplates:b,currentPostType:x,onNavigateToEntityRecord:v,template:k}=(0,s.useSelect)(e=>{const t=e(a.store).getEditorSettings();return{canEditTemplates:e(u.H).canUserEditTemplates(),currentPostType:e(a.store).getCurrentPostType(),onNavigateToEntityRecord:t?.onNavigateToEntityRecord,template:e(u.H).getCurrentTemplate()}},[]),w="wp_template"!==x&&b&&!!k?.id&&!!v,j=(0,i.useCallback)(()=>{const e=_.current,t=e?.ownerDocument,o=t?.defaultView;if(!e||!t||!o)return void y(null);const n=e.getBoundingClientRect();if(!n.width||!n.height)return void y(null);const r=o.scrollX,s=o.scrollY,a=n.top>54?n.top+s-50-4:n.bottom+s+4;y({frame:{height:n.height+2,left:n.left+r-1,top:n.top+s-1,width:n.width+2},toolbar:{left:n.left+r-1,top:a}})},[]);(0,i.useEffect)(()=>{if(!w)return t(!1),f(null),y(null),void(_.current=null);let e=0,o=null,n=120;const r=()=>{const t=function(){const e=Array.from(document.querySelectorAll("iframe"));for(const t of e)try{const e=t.contentDocument;if(e?.querySelector(".block-editor-block-list__layout.is-root-container, .is-root-container"))return e}catch(e){}return null}(),s=t&&function(e){const t=e.querySelector('[data-type="core/site-logo"], [data-type="core/site-title"], .wp-block-site-logo, .wp-block-site-title');return t?(o=t).closest("[data-block], .block-editor-block-list__block")||o.closest("[data-type]")||o:null;var o}(t);t&&s?(!function(e){if(e.getElementById(g))return;const t=e.createElement("style");t.id=g,t.textContent='\n.woocommerce-email-editor-template-area-affordance-slot {\n\tbox-sizing: border-box;\n\tinset: 0 auto auto 0;\n\tpointer-events: none;\n\tposition: absolute;\n\tz-index: 29;\n}\n.woocommerce-email-editor-template-area-affordance {\n\talign-items: stretch;\n\tbackground: #fff;\n\tborder: 1px solid #1e1e1e;\n\tborder-radius: 2px;\n\tbox-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);\n\tdisplay: inline-flex;\n\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;\n\tfont-size: 13px;\n\tline-height: 1;\n\tpointer-events: auto;\n\tposition: absolute;\n\tz-index: 30;\n}\n.woocommerce-email-editor-template-area-affordance__frame {\n\tappearance: none;\n\tbackground: transparent;\n\tborder: 1.5px solid transparent;\n\tbox-sizing: border-box;\n\tcursor: pointer;\n\tfont: inherit;\n\tmargin: 0;\n\tpadding: 0;\n\tpointer-events: auto;\n\tposition: absolute;\n\tz-index: 29;\n}\n.woocommerce-email-editor-template-area-affordance__frame:hover,\n.woocommerce-email-editor-template-area-affordance__frame:focus-visible,\n.woocommerce-email-editor-template-area-affordance__frame.is-active {\n\tborder-color: var(--wp-components-color-accent, #3858e9);\n\toutline: none;\n}\n.woocommerce-email-editor-template-area-affordance__label {\n\talign-items: center;\n\tborder-right: 1px solid #ddd;\n\tdisplay: inline-flex;\n\tfont-weight: 500;\n\tgap: 8px;\n\theight: 48px;\n\tpadding: 0 16px;\n\twhite-space: nowrap;\n}\n.woocommerce-email-editor-template-area-affordance__label svg {\n\tfill: currentColor;\n}\n.woocommerce-email-editor-template-area-affordance__button.components-button {\n\tborder-radius: 0;\n\tbox-shadow: none;\n\tcolor: var(--wp-components-color-accent, #3858e9);\n\theight: 48px;\n\tpadding: 0 18px;\n\twhite-space: nowrap;\n}\n.woocommerce-email-editor-template-area-affordance__button.components-button:hover:not(:disabled) {\n\tcolor: var(--wp-components-color-accent, #3858e9);\n}\n.woocommerce-email-editor-template-area-affordance__button.components-button:focus-visible {\n\tbox-shadow: inset 0 0 0 1.5px var(--wp-components-color-accent, #3858e9);\n}\n',e.head.appendChild(t)}(t),o=function(e){let t=e.getElementById(m);return t||(t=e.createElement("div"),t.id=m,t.className="woocommerce-email-editor-template-area-affordance-slot",e.body.appendChild(t)),t}(t),_.current=s,f(o),j()):n>0&&(n--,e=window.requestAnimationFrame(r))};return r(),()=>{e&&window.cancelAnimationFrame(e);const n=o?.ownerDocument;o?.remove(),n?.getElementById(g)?.remove(),t(!1),f(null),y(null),_.current=null}},[w,j]),(0,i.useEffect)(()=>{const e=o?.ownerDocument,n=e?.defaultView;if(!o||!e||!n)return;const r=e=>{e.target instanceof Node&&o.contains(e.target)||t(!1)};return e.addEventListener("mousedown",r),e.addEventListener("scroll",j,!0),n.addEventListener("resize",j),window.addEventListener("resize",j),j(),()=>{e.removeEventListener("mousedown",r),e.removeEventListener("scroll",j,!0),n.removeEventListener("resize",j),window.removeEventListener("resize",j)}},[o,j]);const S=(0,i.useRef)(null),E=(0,i.useRef)(null),C=(0,i.useCallback)(()=>t(!0),[]),T=(0,i.useCallback)(()=>{k?.id&&v&&((0,p.yM)("template_canvas_affordance_edit_template_clicked",{templateId:k.id}),v({postId:k.id,postType:"wp_template"}))},[v,k?.id]),P=(0,i.useCallback)(e=>{e.stopPropagation()},[]);if((0,i.useEffect)(()=>{const e=S.current;if(e)return e.addEventListener("mousedown",P),e.addEventListener("pointerdown",P),e.addEventListener("click",C),()=>{e.removeEventListener("mousedown",P),e.removeEventListener("pointerdown",P),e.removeEventListener("click",C)}},[o,C,P]),(0,i.useEffect)(()=>{const e=E.current;if(e)return e.addEventListener("mousedown",P),e.addEventListener("pointerdown",P),e.addEventListener("click",T),()=>{e.removeEventListener("mousedown",P),e.removeEventListener("pointerdown",P),e.removeEventListener("click",T)}},[e,T,P]),!w||!o||!h)return null;const N=`${m}-toolbar`;return(0,i.createPortal)((0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{ref:S,type:"button",className:e?"woocommerce-email-editor-template-area-affordance__frame is-active":"woocommerce-email-editor-template-area-affordance__frame","aria-label":(0,l.__)("Template area","jetpack"),"aria-expanded":e,"aria-controls":e?N:void 0,style:h.frame}),e&&(0,n.jsxs)("div",{id:N,className:"woocommerce-email-editor-template-area-affordance",style:h.toolbar,children:[(0,n.jsxs)("span",{className:"woocommerce-email-editor-template-area-affordance__label",children:[(0,n.jsx)(c.A,{icon:d.A,size:24}),(0,n.jsx)("span",{children:(0,l.__)("Template","jetpack")})]}),(0,n.jsx)(r.Button,{ref:E,className:"woocommerce-email-editor-template-area-affordance__button",variant:"tertiary",children:(0,l.__)("Edit template","jetpack")})]})]}),o)}},7666(e,t,o){o.d(t,{j:()=>a});var n=o(6087),r=o(7494);const s=(0,r.createQueue)();function a({children:e,placeholder:t}){const[o,r]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{const e={};return s.add(e,()=>{(0,n.flushSync)(()=>{r(!0)})}),()=>{s.cancel(e)}},[]),o?e:t}},4324(e,t,o){o.d(t,{i:()=>h});var n=o(790),r=o(6087),s=o(3656),a=o(3582),i=o(7143),l=o(6427),c=o(7723),d=o(528),u=o(3124),p=o(7695),m=o(3345),g=o(6816);const f=(0,r.memo)(function({templates:e,handleTemplateSelection:t,templateSelectMode:o}){const s=(0,i.useSelect)(e=>e(a.store).getBlockPatternCategories(),[]),l="swap"===o,d=(0,r.useMemo)(()=>{const t=function(e,t){const o=new Map(t.map(e=>[e.name,e.label]));o.set("recent",(0,c.__)("Recent","jetpack"));const n=new Set;for(const t of e)t.category&&n.add(t.category);return[...n].map(e=>({name:e,label:o.get(e)??e}))}(e,s??[]);return l?t.filter(e=>"recent"!==e.name):t.sort((e,t)=>"recent"===e.name?-1:"recent"===t.name?1:0)},[e,s,l]),[u,f]=(0,r.useState)(null);return(0,r.useEffect)(()=>{if(null!==u||0===d.length)return;const e=setTimeout(()=>{const e=d.find(e=>"recent"!==e.name)?.name??d[0]?.name;f(e)},1e3);return()=>clearTimeout(e)},[d,u]),(0,n.jsxs)("div",{className:"block-editor-block-patterns-explorer"+(0===d.length?" no-sidebar":""),children:[d.length>0&&(0,n.jsx)(m.t,{templateCategories:d,selectedCategory:u,onClickCategory:e=>{(0,g.yM)("template_select_modal_category_change",{category:e}),f(e)}}),(0,n.jsx)(p.J,{templates:e,onTemplateSelection:t,selectedCategory:u})]})});function h({onSelectCallback:e,closeCallback:t=null,previewContent:o="",postType:r}){const a=o?"swap":"new";(0,g.xW)("template_select_modal_opened",{templateSelectMode:a});const[p,m]=(0,d.p)(o),h=p?.length>0,y=t=>{const n=t.type===r,l=t.template;(0,g.yM)("template_select_modal_template_selected",{templateSlug:t.slug,templateSelectMode:a,templateType:t.type}),o||(0,i.dispatch)(s.store).resetEditorBlocks(t.emailParsed),(0,i.dispatch)(u.H).setTemplateToPost(n?l.template:t.slug),e()},_=()=>{const e=p[0]??null;e&&((0,g.yM)("template_select_modal_handle_close_without_template_selected"),y(e))};return(0,n.jsxs)(l.Modal,{title:"new"===a?(0,c.__)("Start with an email preset","jetpack"):(0,c.__)("Select a template","jetpack"),onRequestClose:()=>((0,g.yM)("template_select_modal_closed",{templateSelectMode:a}),t?t():_()),isFullScreen:!0,children:[(0,n.jsx)(f,{templates:[...p,...m],handleTemplateSelection:y,templateSelectMode:a}),(0,n.jsx)(l.Flex,{className:"email-editor-modal-footer",justify:"flex-end",children:(0,n.jsx)(l.FlexItem,{children:(0,n.jsx)(l.Button,{variant:"tertiary",className:"email-editor-start_from_scratch_button",onClick:()=>((0,g.yM)("template_select_modal_start_from_scratch_clicked"),_()),isBusy:!h,children:(0,c.__)("Start from scratch","jetpack")})})})]})}},3345(e,t,o){o.d(t,{t:()=>s});var n=o(790),r=o(6427);function s({selectedCategory:e,templateCategories:t,onClickCategory:o}){const s="block-editor-block-patterns-explorer__sidebar";return(0,n.jsx)("div",{className:s,children:(0,n.jsx)("div",{className:`${s}__categories-list`,children:t.map(({name:t,label:a})=>(0,n.jsx)(r.Button,{label:a,className:`${s}__categories-list__item`,isPressed:e===t,onClick:()=>{o(t)},children:a},t))})})}},7695(e,t,o){o.d(t,{J:()=>y});var n=o(790),r=o(6087),s=o(3656),a=o(7143),i=o(3109),l=o(2478),c=o(8847),d=o(7723),u=o(6427),p=o(4715),m=o(7666),g=o(1128);function f(){return(0,n.jsxs)("div",{className:"block-editor-inserter__no-results",children:[(0,n.jsx)(i.A,{className:"block-editor-inserter__no-results-icon",icon:l.A}),(0,n.jsx)("p",{children:(0,d.__)("No recent templates.","jetpack")}),(0,n.jsx)("p",{children:(0,d.__)("Your recent creations will appear here as soon as you begin.","jetpack")})]})}const h=(0,r.memo)(function({templates:e,onTemplateSelection:t,selectedCategory:o}){const{layout:r}=(0,a.useSelect)(e=>{const{getEditorSettings:t}=e(s.store),o=t();return{layout:o?.__experimentalFeatures?.layout}}),[i]=(0,g.b)(),l=i.reduce((e,t)=>e+(t.css??""),"")+`.is-root-container { width: ${r?.contentSize||"660px"}; margin: 0 auto; }`;return"recent"===o&&0===e.length?(0,n.jsx)(f,{}):(0,n.jsx)("div",{className:"block-editor-block-patterns-list",role:"listbox",children:e.map(e=>(0,n.jsx)("div",{className:"block-editor-block-patterns-list__list-item email-editor-pattern__list-item",children:(0,n.jsx)("div",{className:"block-editor-block-patterns-list__item",role:"button",tabIndex:0,onClick:()=>{t(e)},onKeyPress:o=>{"Enter"!==o.key&&" "!==o.key||t(e)},children:(0,n.jsxs)(m.j,{placeholder:(0,n.jsx)("p",{children:(0,d.__)("rendering template","jetpack")}),children:[(0,n.jsx)(p.BlockPreview,{blocks:e.previewContentParsed,viewportWidth:900,minHeight:300,additionalStyles:[{css:l}]}),(0,n.jsx)(u.__experimentalHStack,{className:"block-editor-patterns__pattern-details",children:(0,n.jsx)("h4",{className:"block-editor-block-patterns-list__item-title",children:e.displayName})})]})})},`${e.slug}_${e.displayName}_${e.id}`))})},(e,t)=>e.templates.length===t.templates.length&&e.selectedCategory===t.selectedCategory);function y({templates:e,onTemplateSelection:t,selectedCategory:o}){const s=(0,r.useMemo)(()=>null!=o?e.filter(e=>e.category===o):e,[o,e]);return(0,n.jsxs)("div",{className:"block-editor-block-patterns-explorer__list",children:["recent"===o&&(0,n.jsx)("div",{className:"email-editor-recent-templates-info",children:(0,n.jsxs)(u.__experimentalHStack,{spacing:1,expanded:!1,justify:"start",children:[(0,n.jsx)(i.A,{icon:c.A}),(0,n.jsx)("p",{children:(0,d.__)("Templates created on the legacy editor will not appear here.","jetpack")})]})}),(0,n.jsx)(h,{templates:s,onTemplateSelection:t,selectedCategory:o})]})}},1513(e,t,o){o.d(t,{x:()=>i});var n=o(790),r=o(7143),s=o(3124),a=o(4324);function i(){const{emailContentIsEmpty:e,templateSelected:t,postType:o}=(0,r.useSelect)(e=>({emailContentIsEmpty:e(s.H).hasEmptyContent(),templateSelected:e(s.H).isTemplateSelected(),postType:e(s.H).getEmailPostType()}),[]),{setTemplateSelected:i}=(0,r.useDispatch)(s.H);return!e||t?null:(0,n.jsx)(a.i,{onSelectCallback:()=>{i()},postType:o})}},8992(e,t,o){o.d(t,{G:()=>s,h:()=>a});var n=o(4997);const r=new Map;function s(e,t){const o=(0,n.getBlockType)(e);if(!o)return!1;const{name:s,...a}=o;try{r.has(s)||r.set(s,{...a});const e=t(a),o={...a,...e};return(0,n.unregisterBlockType)(s),(0,n.registerBlockType)(s,o),!0}catch(t){return console.error("Failed to update block settings for",e,t),!1}}function a(){const e=[];for(const[t,o]of r.entries())try{(0,n.unregisterBlockType)(t),(0,n.registerBlockType)(t,o),e.push(t),r.delete(t)}catch(e){console.error("Failed to restore block settings for",t,e)}return e}},8845(e,t,o){o.d(t,{oj:()=>i,r8:()=>l});var n=o(4997),r=o(7143);const s=new Set,a=new Map;function i(e,t){const o=((0,r.select)("core/blocks").getBlockStyles(e)||[]).find(e=>e.name===t);if(o){const n=a.get(e)||[];n.find(e=>e.name===t)||(n.push(o),a.set(e,n))}(0,n.unregisterBlockStyle)(e,t)}function l(){for(const e of s){const[t,o]=e.split("||");(0,n.unregisterBlockStyle)(t,o)}s.clear();for(const[e,t]of a.entries())t.forEach(t=>(0,n.registerBlockStyle)(e,t)),a.delete(e)}},8848(e,t,o){o.d(t,{$:()=>a,z:()=>s});var n=o(4997);const r=new Set;function s(e,t){(0,n.registerBlockVariation)(e,t),r.add(function(e,t){return`${e}||${t}`}(e,t.name))}function a(){for(const e of r){const[t,o]=e.split("||");(0,n.unregisterBlockVariation)(t,o)}r.clear()}},7847(e,t,o){o.d(t,{HY:()=>i,hC:()=>c,tN:()=>l});var n=o(2619);const r=new Set,s=new Set;function a(e,t){return`${e}||${t}`}function i(e,t,o,s){(0,n.addFilter)(e,t,o,s),r.add(a(e,t))}function l(e,t,o,r){(0,n.addAction)(e,t,o,r),s.add(a(e,t))}function c(){!function(){for(const e of r){const[t,o]=e.split("||");(0,n.removeFilter)(t,o),r.delete(e)}}(),function(){for(const e of s){const[t,o]=e.split("||");(0,n.removeAction)(t,o),s.delete(e)}}()}},444(e,t,o){o.d(t,{aW:()=>l,gG:()=>a,le:()=>i});var n=o(876);const r=new Set,s=new Map;function a(e,t){(0,n.registerFormatType)(e,{object:!1,...t}),r.add(e)}function i(e){const t=(0,n.unregisterFormatType)(e);t&&s.set(e,t)}function l(){for(const e of r)(0,n.unregisterFormatType)(e);r.clear();for(const[e,t]of s.entries())(0,n.registerFormatType)(e,{object:!1,...t}),s.delete(e)}},3588(e,t,o){o.d(t,{IF:()=>l});var n=o(8845),r=o(8848),s=o(444),a=o(7847),i=o(8992);function l(){(0,i.h)(),(0,n.r8)(),(0,r.$)(),(0,s.aW)(),(0,a.hC)()}},390(e,t,o){o.d(t,{w:()=>P});var n=o(790),r=o(7143),s=o(6087),a=o(2619),i=o(3656),l=o(9491),c=(o(2005),o(2318)),d=o(9791),u=o(265),p=o(5183),m=o(3124),g=o(7380),f=o(5885),h=o(2743),y=o(256),_=o(2259),b=o(721),x=o(38),v=o(9971),k=o(6477),w=o(8766),j=o(2104),S=o(3588),E=o(4368);function C({postId:e,postType:t,isPreview:o=!1,contentRef:a=null,customSavePanel:i,customSaveButton:c}){const[u,g]=(0,s.useState)(!1),{settings:f}=(0,r.useSelect)(e=>({settings:e(m.H).getInitialEditorSettings()}),[]);(0,v.M)(),(0,k.u)(),(0,j.T)();const{setEmailPost:h}=(0,r.useDispatch)(m.H);(0,s.useEffect)(()=>{h(e,t),g(!0)},[e,t,h]);const y=(0,w.r)(),_=(0,l.useMergeRefs)([y,a]),b=(0,s.useMemo)(()=>({...f,allowedBlockTypes:(0,d.G)(),isPreviewMode:o,responsiveEditingEnabled:!1}),[f,o]);return u?(0,n.jsx)(s.StrictMode,{children:(0,n.jsx)(p.w,{postId:e,postType:t,settings:b,contentRef:_,customSavePanel:i,customSaveButton:c})}):null}function T(){(0,a.hasFilter)("sync.providers","woocommerce/email-editor/disable-collab")||(window._wpCollaborationEnabled&&(window._wpCollaborationEnabled=!1),(0,a.addFilter)("sync.providers","woocommerce/email-editor/disable-collab",()=>[],1e3)),(0,h.K)(),(0,y.h)(),(0,_.Y)(),(0,g.y$)(),(0,b.J)(),(0,c.X)(),(0,x.X)(),(0,f.I)(),(0,u.xc)()}function P({postId:e,postType:t,isPreview:o=!1,contentRef:l=null,config:c,customSavePanel:d,customSaveButton:u}){const[p,g]=(0,s.useState)(!1);(0,s.useEffect)(()=>{const e=(0,r.select)(i.store).getEditorSettings(),t=c||(0,E.q)();return T(),(0,r.dispatch)(m.H).setEditorConfig(t),g(!0),()=>{try{(0,S.IF)()}finally{(0,r.dispatch)(i.store).updateEditorSettings(e)}}},[c]);const f=(0,a.applyFilters)("woocommerce_email_editor_wrap_editor_component",C);return p?(0,n.jsx)(f,{postId:e,postType:t,isPreview:o,contentRef:l,customSavePanel:d,customSaveButton:u}):null}},2259(e,t,o){o.d(t,{Y:()=>i});var n=o(7723),r=o(6816);let s=[];function a(e){s.forEach(t=>{const o=e.target?.matches?.(t.selector)?e.target:e.target?.closest?.(t.selector);o&&("function"==typeof t.track?t.track(o,e):(0,r.yM)(t.track))})}function i(){(0,r.V1)()&&(s=[{track:"header_preview_dropdown_preview_in_new_tab_selected",selector:'.editor-preview-dropdown__button-external, a[role="menuitem"][target^="wp-preview-"]'},{track:()=>{const e=document.getElementsByClassName("is-collapsed editor-collapsible-block-toolbar").length;(0,r.yM)("header_blocks_tool_button_clicked",{isBlockToolsCollapsed:e})},selector:".editor-collapsible-block-toolbar__toggle"},{track:e=>{const t=e.classList.contains("is-opened");(0,r.yM)("header_more_menu_dropdown_toggle",{isOpened:t})},selector:`.components-dropdown-menu__toggle[aria-label="${(0,n.__)("Options","jetpack")}"]`},{track:e=>{(e.textContent===(0,n.__)("Save","jetpack")&&"false"===e.getAttribute("aria-disabled")||e.textContent===(0,n.__)("Saving…","jetpack"))&&(0,r.yM)("header_save_button_clicked")},selector:".editor-post-publish-button"},{track:"header_save_email_button_clicked",selector:".editor-post-saved-state.is-saving"},{track:"inserter_sidebar_library_close_icon_clicked",selector:".block-editor-inserter__menu .block-editor-tabbed-sidebar__close-button"},{track:e=>{const t=e.classList.contains("is-opened");(0,r.yM)("header_preview_dropdown_clicked",{isOpened:t})},selector:".editor-preview-dropdown__toggle"},{track:()=>{(0,r.yM)("sidebar_tab_selected",{tab:"document"})},selector:'[data-tab-id="edit-post/document"]'},{track:()=>{(0,r.yM)("sidebar_tab_selected",{tab:"block"})},selector:'[data-tab-id="edit-post/block"]'},{track:e=>{const t=e.classList.contains("is-pressed");(0,r.yM)("header_inserter_sidebar_clicked",{isOpened:t})},selector:".editor-document-tools__inserter-toggle"},{track:e=>{const t=e.classList.contains("is-pressed");(0,r.yM)("header_listview_sidebar_clicked",{isOpened:t})},selector:".editor-document-tools__document-overview-toggle"},{track:e=>{(0,r.yM)("command_bar_command_clicked",{command:e.dataset?.value})},selector:'.commands-command-menu__container [role="option"]'}],document.addEventListener("click",a))}},2743(e,t,o){o.d(t,{K:()=>a});var n=o(2619),r=o(6816);const s=e=>{(0,n.doAction)("woocommerce_email_editor_events",e.detail)},a=()=>{(0,r.V1)()&&r.oh.addEventListener(r.vD,s)};window.addEventListener("unload",function(){(0,r.V1)()&&r.oh.removeEventListener(r.vD,s)})},6816(e,t,o){o.d(t,{T7:()=>d,V1:()=>s,oh:()=>i,vD:()=>a,xW:()=>c,yM:()=>l});var n=o(8468),r=o(2619);const s=()=>(0,r.applyFilters)("woocommerce_email_editor_events_tracking_enabled",!1),a="email_editor_events",i=new EventTarget,l=(e,t={})=>{if(!s())return;const o={name:`${a}_${e}`,..."object"!=typeof t?{data:t}:t};i.dispatchEvent(new CustomEvent(a,{detail:o}))},c=function(){const e={};return(t,o={})=>{if(!s())return;const n=`${t}_${JSON.stringify(o).length}`;e[n]||(l(t,o),e[n]=!0)}}(),d=(0,n.debounce)(l,700)},256(e,t,o){o.d(t,{h:()=>p});var n=o(7143),r=o(1233),s=o(3656),a=o(7723),i=o(6816);const l=(...e)=>{const t=(0,n.select)(s.store).isInserterOpened(),o=!!document.getElementsByClassName("block-editor-inserter__quick-inserter").length;let r="other_inserter";t?r="inserter_sidebar":o&&(r="quick_inserter");const a=e[0],l=e[5];!1===Array.isArray(a)&&"object"==typeof a&&(0,i.yM)(`${r}_library_block_selected`,{blockName:a.name}),Array.isArray(a)&&l&&l.patternName&&(0,i.yM)(`${r}_library_pattern_selected`,{patternName:l.patternName})},c={"core/editor":{autosave:"editor_content_auto_saved",setDeviceType:e=>{(0,i.yM)(`header_preview_dropdown_${e.toLowerCase()}_selected`)},setRenderingMode:e=>{if((0,n.select)(s.store).getRenderingMode()===e)return;!!document.querySelector(`[aria-label="${(0,a.__)("View options","jetpack")}"]`)&&(0,i.yM)("preview_dropdown_rendering_mode_changed",{renderingMode:e})}},"core/block-editor":{insertBlock:l,insertBlocks:l},"core/preferences":{set:(e,t,o)=>{if((0,n.select)(r.store).get(e,t)===o)return;const s={focusMode:"focus_mode_toggle",fullscreenMode:"full_screen_mode_toggle",distractionFree:"distraction_free_toggle",fixedToolbar:"fixed_toolbar_toggle"};s[t]&&(0,i.yM)(s[t],{isEnabled:o})}},"core/commands":{open:"command_menu_opened",close:"command_menu_closed"}},d={},u={},p=()=>{(0,i.V1)()&&(0,n.use)(e=>({dispatch:t=>{const o="object"==typeof t?t.name:t,n=e.dispatch(o),r=c[o];if(!r)return n;d[o]||(d[o]={}),u[o]||(u[o]={});for(const[e,t]of Object.entries(r))u[o][e]||(u[o][e]=n[e],d[o][e]=(...n)=>{try{"function"==typeof t?t(...n):"string"==typeof t&&(0,i.yM)(t)}catch(e){console.error("Error tracking event",e)}return u[o][e](...n)}),n[e]=d[o][e];return n}}))}},38(e,t,o){o.d(t,{X:()=>s});var n=o(8611),r=o(4744);function s(){(0,r.X)(),(0,n._)()}},8611(e,t,o){o.d(t,{_:()=>i});var n=o(1847),r=o(7847),s=o(1584);const a=e=>{"wp_template"===e&&((0,n.yd)("postType",e,"duplicate-post"),(0,n.yd)("postType",e,"reset-post"),(0,n.Bi)("postType",e,(0,s.A)()))};function i(){(0,r.tN)("core.registerPostTypeSchema","woocommerce-email-editor/modify-template-actions",e=>{a(e)}),(0,r.tN)("core.registerPostTypeActions","woocommerce-email-editor/modify-template-actions",e=>{a(e)})}},4744(e,t,o){o.d(t,{X:()=>i});var n=o(1847),r=o(7847),s=o(3242);const a=e=>{(0,n.yd)("postType",e,"move-to-trash"),(0,n.Bi)("postType",e,(0,s.A)())};function i(){(0,r.tN)("core.registerPostTypeSchema","woocommerce-email-editor/modify-move-to-trash-action",e=>{a(e)}),(0,r.tN)("core.registerPostTypeActions","woocommerce-email-editor/modify-move-to-trash-action",e=>{a(e)})}},1324(e,t,o){o.d(t,{g:()=>s});var n=o(790),r=o(6087);function s({children:e}){const[t]=(0,r.useState)(document.createElement("div"));return(0,r.useEffect)(()=>{const e=document.getElementsByClassName("editor-visual-editor ")[0];e&&e.parentNode?.insertBefore(t,e)},[t]),(0,r.createPortal)((0,n.jsx)(n.Fragment,{children:e}),t)}},4291(e,t,o){o.d(t,{L:()=>c});var n=o(790),r=o(6087),s=o(7143),a=o(3656),i=o(2614);function l({children:e}){const t=(0,r.useRef)(document.createElement("div"));return(0,r.useEffect)(()=>{const e=document.getElementsByClassName("editor-post-publish-button__button")[0];e&&e.parentNode?.insertBefore(t.current,e.nextSibling)},[t]),(0,r.createPortal)((0,n.jsx)(n.Fragment,{children:e}),t.current)}function c(){const e=(0,r.useRef)(null),{hasNonPostEntityChanges:t,isEditedPostDirty:o,isEditingTemplate:c}=(0,s.useSelect)(e=>({hasNonPostEntityChanges:e(a.store).hasNonPostEntityChanges(),isEditedPostDirty:e(a.store).isEditedPostDirty(),isEditingTemplate:"wp_template"===e(a.store).getCurrentPostType()}),[]),d=c||t||o&&t,u=(0,r.useCallback)((e,t)=>{t&&e.classList.contains("force-hidden")&&e.classList.remove("force-hidden"),t||e.classList.contains("force-hidden")||e.classList.add("force-hidden")},[]);return(0,r.useEffect)(()=>{const t=document.getElementsByClassName("editor-post-publish-button__button")[0];return u(t,d),t?(e.current&&e.current.disconnect(),e.current=new MutationObserver(()=>{u(t,d)}),e.current.observe(t,{attributes:!0,childList:!0,subtree:!1}),()=>e.current?.disconnect()):()=>e.current?.disconnect()},[d,u]),(0,n.jsx)(l,{children:!d&&(0,n.jsx)(i.J,{})})}},9971(e,t,o){o.d(t,{M:()=>u});var n=o(6087),r=o(7143),s=o(3582),a=o(2619),i=o(3124),l=o(4515),c=o(7711);const d=[],u=()=>{const{addValidationNotice:e,hasValidationNotice:t,removeValidationNotice:o}=(0,c.k)(),{editedContent:u,editedTemplateContent:p}=(0,r.useSelect)(e=>({editedContent:e(i.H).getEditedEmailContent(),editedTemplateContent:e(i.H).getCurrentTemplateContent()})),m=(0,l.c)(u),g=(0,l.c)(p),f=(0,n.useCallback)(()=>((e,t,{addValidationNotice:o,hasValidationNotice:n,removeValidationNotice:r})=>{const s=(0,a.applyFilters)("woocommerce_email_editor_content_validation_rules",d);let i=!0;return s.forEach(({id:s,testContent:a,message:l,actions:c})=>{a(e+t)?(o(s,l,c),i=!1):n(s)&&r(s)}),i})(m,g,{addValidationNotice:e,hasValidationNotice:t,removeValidationNotice:o}),[m,g,e,o,t]);return(0,n.useEffect)(()=>((0,r.dispatch)(i.H).setContentValidation({validateContent:f}),()=>{(0,r.dispatch)(i.H).setContentValidation(void 0)}),[f]),(0,n.useEffect)(()=>{const e=(0,r.subscribe)(()=>{t()&&f()},s.store);return()=>e()},[t,f]),{validateContent:f}}},1128(e,t,o){o.d(t,{b:()=>m});var n=o(6087),r=o(7143),s=o(3656),a=o(3764),i=o.n(a),l=o(3124),c=o(6967),d=o(8498),u=o(3598);const p=[];function m(){const{userTheme:e}=(0,c.u)(),{editorTheme:t,layout:o,deviceType:a,initialEditorSettingsStyles:m}=(0,r.useSelect)(e=>{const{getEditorSettings:t,getDeviceType:o}=e(s.store),n=t(),r=e(l.H).getInitialEditorSettings();return{editorTheme:e(l.H).getTheme(),layout:n?.__experimentalFeatures?.layout,deviceType:o(),initialEditorSettingsStyles:r?.styles}},[]),g=(0,n.useMemo)(()=>i().all([{},t||{},e||{}]),[t,e]),[f]=(0,d.e)(g);let h="";o&&"Mobile"!==a&&(h=`display:flow-root; width:${o?.contentSize||"660px"}; margin: 0 auto;box-sizing: border-box;max-width: 100%;`);const y=g.styles?.spacing?.padding;y&&(h+=`padding-left:${(0,u.DJ)(y.left)};`,h+=`padding-right:${(0,u.DJ)(y.right)};`);return[(0,n.useMemo)(()=>[...f??[],{css:`.is-root-container{ ${h} }`},...m??[]],[f,m,h])||p]}},665(e,t,o){o.d(t,{n:()=>u,u:()=>m});var n=o(3764),r=o.n(n),s=o(7143),a=o(6087),i=o(3124),l=o(6967);const c={};function d(e){return!Object.keys(e).some(t=>Object.keys(e[t]).length>0)}function u(e,t,o){const n=Array.isArray(t)?[...t]:[t],r=Array.isArray(e)?[...e]:{...e},s=n.pop();let a=r;return n.forEach(e=>{const t=a[e];a[e]=Array.isArray(t)?[...t]:{...t},a=a[e]}),a[s]=o,r}function p(e){const t=e=>{if("object"==typeof e&&null!==e||void 0===e){if(Array.isArray(e)&&0===e.length)return;for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)){const n=t(e[o]);void 0===n||d(n)?delete e[o]:e[o]=n}}return e};return t(e)}const m=()=>{const{userTheme:e,updateUserTheme:t}=(0,l.u)(),o=(0,a.useMemo)(()=>e?p(function(e){const t=e=>{if("object"==typeof e&&null!==e)for(const o in e)e.hasOwnProperty(o)&&(e[o]=t(e[o]));else if("string"==typeof e)return e.replace(/var\(--([a-z]+)--([a-z]+(?:--[a-z0-9]+(?:-[a-z0-9]+)*)*)--([a-z0-9-]+)\)/g,(e,t,o,n)=>`var:${o.split("--").concat(n).join("|")}`);return e};return t(e)}(e?.styles)):c,[e]),{styles:n}=(0,s.useSelect)(e=>({styles:e(i.H).getStyles()})),d=(0,a.useCallback)(o=>{const n={...e,styles:p(o)};t(n)},[t,e]),m=(0,a.useCallback)((o,n)=>{const r=u(e,["styles",...o],n);t(r)},[t,e]);return{styles:(0,a.useMemo)(()=>n?o?r().all([n,o]):n:c,[n,o]),userStyles:e?.styles,defaultStyles:n,updateStyleProp:m,updateStyles:d}}},8766(e,t,o){o.d(t,{r:()=>i});var n=o(6087),r=o(2619),s=o(7143),a=o(3656);const i=()=>{const e=(0,n.useRef)(null),[t,o]=(0,n.useState)(0),i=(0,n.useCallback)(t=>{e.current=t,o(e=>++e)},[e,o]),l=(0,s.useSelect)(e=>{const{getEditorSettings:t}=e(a.store);return t()?.allowedIframeStyleHandles??[]});return(0,n.useEffect)(()=>{if(!e.current)return;const{ownerDocument:t}=e.current;Array.from(document.styleSheets).filter(e=>{if(!(e?.ownerNode instanceof Element))return!1;const t=e.ownerNode.getAttribute("id"),o=t&&!l.includes(t);return(0,r.applyFilters)("woocommerce_email_editor_iframe_stylesheet_should_remove",o,e)}).map(e=>e.ownerNode.getAttribute("id")).forEach(e=>{const o=t.getElementById(e);o&&o.remove();const n=t.createElement("style");n.id=e,t.head.appendChild(n)})},[l,t]),i}},8498(e,t,o){o.d(t,{e:()=>i});var n=o(5046),r=o(6087);const s={},a=[],i=(e={})=>(0,r.useMemo)(()=>{if(!e?.styles||!e?.settings)return[a,s];return(0,n.xn)(e,[],{hasBlockGapSupport:!0,hasFallbackGapSupport:!1,disableLayoutStyles:!1,disableRootPadding:!1})},[e])},3707(e,t,o){o.d(t,{c:()=>a});var n=o(6087),r=o(7143),s=o(3656);function a(e,t,o){const[a,i]=(0,n.useReducer)((e,{type:t,post:o,previousRenderingMode:n})=>"push"===t?[...e,{post:o,previousRenderingMode:n}]:"pop"===t&&e.length>1?e.slice(0,-1):e,[{post:{postId:e,postType:t}}]),{post:l,previousRenderingMode:c}=a[a.length-1],{getRenderingMode:d}=(0,r.useSelect)(s.store),{setRenderingMode:u}=(0,r.useDispatch)(s.store),p=(0,n.useCallback)(e=>{i({type:"push",post:{postId:e.postId,postType:e.postType},previousRenderingMode:d()}),u(o)},[d,u,o]),m=(0,n.useCallback)(()=>{i({type:"pop"}),c&&u(c)},[u,c]);return{currentPost:l,onNavigateToEntityRecord:p,onNavigateToPreviousEntityRecord:a.length>1?m:void 0}}},2104(e,t,o){o.d(t,{T:()=>c});var n=o(6087),r=o(7143),s=o(7723),a=o(692);function i(e){const t={"site-editor-save-success":{content:(0,s.__)("Email design updated.","jetpack"),removeActions:!0},"editor-save":{content:(0,s.__)("Email saved.","jetpack"),removeActions:!1,contentCheck:e=>e.includes((0,s.__)("Post updated.","jetpack"))||e.includes((0,s.__)("Post published.","jetpack"))}}[e.id];return t?t.contentCheck&&!t.contentCheck(e.content)?e:{...e,content:t.content,spokenMessage:t.content,actions:t.removeActions?[]:e.actions}:e}const l=(0,r.createSelector)(e=>function(e){return e.map(e=>i(e))}(e),e=>[e]);function c(){(0,n.useEffect)(()=>{let e;return(0,r.use)(t=>(e=t.select,{select:t=>{if(function(e){return"object"==typeof e?e.name:e}(t)!==a.store.name)return e(t);const o=e(t),n=o.getNotices;return n?{...o,getNotices:e=>l(n(e))}:o}})),()=>{(0,r.use)(()=>({select:e}))}},[])}},528(e,t,o){o.d(t,{p:()=>u});var n=o(6087),r=o(4997),s=o(7143),a=o(2619),i=o(3124);const l=[];function c(e,t){return e.map(e=>"core/post-content"===e.name?{...e,name:"core/group",innerBlocks:t}:e.innerBlocks?.length?{...e,innerBlocks:c(e.innerBlocks,t)}:e)}const d={};function u(e="",t=!0){const{templates:o,patterns:u,emailPosts:p,hasEmailPosts:m}=(0,s.useSelect)(o=>{const n=t&&"swap"!==e?o(i.H).getSentEmailEditorPosts():void 0;return{templates:o(i.H).getEmailTemplates(),patterns:o(i.H).getBlockPatternsForEmailTemplate(),emailPosts:n,hasEmailPosts:!(!n||!n?.length)}},[e,t]),g=(0,n.useMemo)(()=>{let t=[];const n=e&&(0,r.parse)(e);if(t=n?[{blocks:n}]:u,!t||!o)return l;const s=[];return o?.filter(e=>"email-general"!==e.slug)?.forEach(e=>{t?.forEach(t=>{let o=(0,r.parse)(e.content?.raw);o=c(o,t.blocks),s.push({id:e.id,slug:e.slug,previewContentParsed:o,emailParsed:t.emailBlocks??t.blocks,template:e,category:t.categories?.[0],type:e.type,displayName:t.title?`${e.title.rendered} - ${t.title}`:e.title.rendered})})}),s},[o,u,e]),f=(0,n.useMemo)(()=>p?.map(e=>{const t=(0,a.applyFilters)("woocommerce_email_editor_preferred_template_title","",e),{postTemplateContent:o}=function(e,t=[]){const o=e.template,n={postTemplateContent:null};if(!o)return n;if(d[o])return d[o];const r=t.find(e=>e.slug===o);if(!r)return n;const s={postTemplateContent:r?.template};return d[o]=s,s}(e,g),n=(0,r.parse)(e.content?.raw);let s=n;o?.content?.raw&&(s=c((0,r.parse)(o?.content?.raw),n));const i={...e,title:{raw:e.title.raw,rendered:t||e.title.rendered}};return{id:e.id,slug:e.slug,previewContentParsed:s,emailParsed:n,category:"recent",type:e.type,displayName:i.title.rendered,template:i}}),[p,g]);return[g||l,f||l,m]}},6477(e,t,o){o.d(t,{u:()=>i});var n=o(6087),r=o(7143),s=o(7723),a=o(692);const i=()=>{const e=(0,n.useMemo)(()=>{const e=(0,s.__)("Saving failed.","jetpack");return new RegExp("^"+e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))},[]);(0,n.useEffect)(()=>{const t=(0,r.subscribe)(()=>{(0,r.select)(a.store).getNotices().forEach(t=>{"string"==typeof t.content&&e.test(t.content)&&(0,r.dispatch)(a.store).removeNotice(t.id)})});return()=>{t()}},[e])}},4515(e,t,o){o.d(t,{c:()=>a});var n=o(6087),r=o(923),s=o.n(r);function a(e){const t=(0,n.useRef)(e);return s()(e,t.current)||(t.current=e),t.current}},6967(e,t,o){o.d(t,{u:()=>i});var n=o(6087),r=o(7143),s=o(3582),a=o(3124);function i(){const{globalStylePost:e}=(0,r.useSelect)(e=>({globalStylePost:e(a.H).getGlobalEmailStylesPost()||null}),[]);return{userTheme:(0,n.useMemo)(()=>({settings:e?.settings,styles:e?.styles}),[e?.settings,e?.styles]),updateUserTheme:(0,n.useCallback)(t=>{e&&(0,r.dispatch)(s.store).editEntityRecord("root","globalStyles",e.id,{styles:t.styles,settings:t.settings})},[e])}}},7711(e,t,o){o.d(t,{k:()=>a});var n=o(6087),r=o(7143),s=o(692);const a=()=>{const e="email-validation",t=(0,r.useSelect)(t=>t(s.store).getNotices(e),[]);return{notices:t,hasValidationNotice:(0,n.useCallback)(e=>e?void 0!==t.find(t=>t.id===e):t?.length>0,[t]),addValidationNotice:(0,n.useCallback)((t,o,n=[])=>{const a=n;(0,r.dispatch)(s.store).createNotice("error",o,{id:t,isDismissible:!1,actions:a,context:e})},[e]),removeValidationNotice:(0,n.useCallback)(t=>{(0,r.dispatch)(s.store).removeNotice(t,e)},[e])}}},265(e,t,o){o.d(t,{xc:()=>k});var n=o(790),r=o(3022),s=o(9491),a=o(4997),i=o(7723),l=o(4361),c=o(7105),d=o(3172),u=o(6427),p=o(4715),m=o(8992),g=o(7847);const f="__experimentalEmailFlexLayout";function h(e){return(0,a.hasBlockSupport)(e,f)}function y({justificationValue:e,onChange:t,isToolbar:o=!1}){const r=[{value:"left",icon:c.A,label:(0,i.__)("Justify items left","jetpack")},{value:"center",icon:l.A,label:(0,i.__)("Justify items center","jetpack")},{value:"right",icon:d.A,label:(0,i.__)("Justify items right","jetpack")}];if(o){const o=r.map(e=>e.value);return(0,n.jsx)(p.JustifyContentControl,{value:e,onChange:t,allowedControls:o,popoverProps:{placement:"bottom-start"}})}return(0,n.jsx)(u.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,i.__)("Justification","jetpack"),value:e,onChange:t,className:"block-editor-hooks__flex-layout-justification-controls",children:r.map(({value:e,icon:t,label:o})=>(0,n.jsx)(u.__experimentalToggleGroupControlOptionIcon,{value:e,icon:t,label:o},e))})}function _({setAttributes:e,attributes:t,name:o}){if(!(0,a.getBlockSupport)(o,f,{}))return null;const{justifyContent:r="left"}=t.layout||{},s=o=>{e({layout:{...t.layout,justifyContent:o}})},l=()=>{const{justifyContent:o,...n}=t.layout||{};e({layout:n})};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(p.InspectorControls,{children:(0,n.jsx)(u.__experimentalToolsPanel,{label:(0,i.__)("Layout","jetpack"),resetAll:l,children:(0,n.jsx)(u.__experimentalToolsPanelItem,{isShownByDefault:!0,onDeselect:l,hasValue:()=>t.layout?.justifyContent||!1,label:(0,i.__)("Justification","jetpack"),children:(0,n.jsx)(u.Flex,{children:(0,n.jsx)(u.FlexItem,{children:(0,n.jsx)(y,{justificationValue:r,onChange:s})})})})})}),(0,n.jsx)(p.BlockControls,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,n.jsx)(y,{justificationValue:r,onChange:s,isToolbar:!0})})]})}const b=(0,s.createHigherOrderComponent)(e=>t=>[h(t.name)&&(0,n.jsx)(_,{...t},"layout"),(0,n.jsx)(e,{...t},"edit")],"withLayoutControls");function x({block:e,props:t}){const{attributes:o}=t,{layout:s}=o,a=`is-content-justification-${s?.justifyContent||"left"}`,i=(0,r.A)(a,"is-layout-email-flex is-layout-flex");return(0,n.jsx)(e,{...t,className:i})}const v=(0,s.createHigherOrderComponent)(e=>function(t){return h(t.name)?(0,n.jsx)(x,{block:e,props:t}):(0,n.jsx)(e,{...t})},"withLayoutStyles");function k(){(0,a.getBlockTypes)().forEach(e=>{h(e.name)&&(0,m.G)(e.name,e=>({...e,attributes:{...e.attributes,layout:{type:"object"}}}))}),(0,g.HY)("editor.BlockListBlock","woocommerce-email-editor/with-layout-styles",v),(0,g.HY)("editor.BlockEdit","woocommerce-email-editor/with-inspector-controls",b)}},721(e,t,o){o.d(t,{J:()=>l});var n=o(7143),r=o(7723),s=o(3124);const a=new WeakMap,i={core:["saveEditedEntityRecord","saveEntityRecord"]},l=()=>{Object.keys(a).length>0||(0,n.use)(e=>({dispatch:t=>{const o="object"==typeof t?t.name:t;if(!i[o])return e.dispatch(o);const n=e.dispatch(o);a[o]||(a[o]={});const l=i[o].filter(e=>!a[o][e]);if(l.length>0)for(const t of l)a[o][t]=n[t],n[t]=async(...n)=>{const i=e.select(s.H).getContentValidation(),l=i?.validateContent;if(l){let e;try{e=l()}catch(t){e=!1}if(!e)return Promise.reject(new Error((0,r.__)("Content validation failed.","jetpack")))}return await a[o][t](...n)};return n}}))}},1847(e,t,o){o.d(t,{Bi:()=>b,D_:()=>p,H7:()=>m,KE:()=>f,Lf:()=>y,fA:()=>h,oq:()=>_,oz:()=>l,sV:()=>g,yd:()=>x});var n=o(7143),r=o(3053),s=o(3656),a=o(4715);const{unlock:i}=(0,r.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/edit-site"),{ColorPanel:l,BackgroundPanel:c,useHasColorPanel:d,useHasBackgroundPanel:u}=i(a.privateApis),p=c??(()=>null),m=d??(()=>!0),g=u??(()=>!1),{Editor:f,FullscreenMode:h,ViewMoreMenuGroup:y,BackButton:_}=i(s.privateApis),{registerEntityAction:b,unregisterEntityAction:x}=i((0,n.dispatch)(s.store))},8046(e,t,o){o.r(t),o.d(t,{invalidatePersonalizationTagsCache:()=>m,requestSendingNewsletterPreview:()=>y,setContentValidation:()=>_,setEditorConfig:()=>k,setEditorSettings:()=>b,setEditorTheme:()=>x,setEditorUrls:()=>v,setEmailPost:()=>p,setEmailPostType:()=>g,setTemplateSelected:()=>h,setTemplateToPost:()=>f,togglePreviewModal:()=>d,updateSendPreviewEmail:()=>u});var n=o(7143),r=o(3582),s=o(6161),a=o(3124),i=o(970),l=o(8311),c=o(6816);function d(e){return{type:"CHANGE_PREVIEW_STATE",state:{isModalOpened:e}}}function u(e){return{type:"CHANGE_PREVIEW_STATE",state:{toEmail:e}}}const p=(e,t)=>async({dispatch:o})=>{if(!e||!t)throw new Error("setEmailPost requires valid postId and postType parameters");o({type:"SET_EMAIL_POST",state:{postId:e,postType:t}})},m=()=>async({registry:e})=>{const t=e.select(a.H).getEmailPostId();e.dispatch(r.store).invalidateResolution("getEntityRecords",[a.q.kind,a.q.name,(0,i.O)(t)])};function g(e){if(!e)throw new Error("setEmailPostType requires a valid postType parameter");return{type:"SET_EMAIL_POST",state:{postType:e}}}const f=e=>async({registry:t})=>{const o=t.select(a.H).getEmailPostId(),n=t.select(a.H).getEmailPostType();t.dispatch(r.store).editEntityRecord("postType",n,o,{template:e})};function h(){return{type:"SET_TEMPLATE_SELECTED"}}function*y(e){if(!(0,n.select)(a.H).getPreviewState().isSendingPreviewEmail){yield{type:"CHANGE_PREVIEW_STATE",state:{sendingPreviewStatus:null,isSendingPreviewEmail:!0}};try{const t=(0,n.select)(a.H).getEmailPostId();yield(0,s.apiFetch)({path:"/woocommerce-email-editor/v1/send_preview_email",method:"POST",data:{email:e,postId:t}}),yield{type:"CHANGE_PREVIEW_STATE",state:{sendingPreviewStatus:l.T.SUCCESS,isSendingPreviewEmail:!1}},(0,c.yM)("sent_preview_email",{postId:t,email:e})}catch(t){(0,c.yM)("sent_preview_email_error",{email:e}),yield{type:"CHANGE_PREVIEW_STATE",state:{sendingPreviewStatus:l.T.ERROR,isSendingPreviewEmail:!1,errorMessage:JSON.stringify(t?.error)}}}}}function _(e){return{type:"SET_CONTENT_VALIDATION",validation:e}}function b(e){return{type:"SET_EDITOR_SETTINGS",editorSettings:e}}function x(e){return{type:"SET_EDITOR_THEME",theme:e}}function v(e){return{type:"SET_EDITOR_URLS",urls:e}}function k(e){return{type:"SET_EDITOR_CONFIG",config:e}}},3124(e,t,o){o.d(t,{H:()=>n,q:()=>r});const n="email-editor/editor",r={name:"personalization_tag",kind:"root",baseURL:"/woocommerce-email-editor/v1/personalization_tags",key:"token"}},8105(e,t,o){function n(){return{editorSettings:void 0,theme:void 0,styles:{globalStylesPostId:null},urls:{back:"",listings:""},preview:{toEmail:"",isModalOpened:!1,isSendingPreviewEmail:!1,sendingPreviewStatus:null},contentValidation:void 0,templateSelected:!1}}o.d(t,{C:()=>n})},970(e,t,o){o.d(t,{O:()=>r});const n=new Map;function r(e){let t=n.get(e);return t||(t={context:"view",per_page:-1,...e?{post_id:e}:{}},n.set(e,t)),t}},4405(e,t,o){function n(e,t){switch(t.type){case"CHANGE_PREVIEW_STATE":return{...e,preview:{...e.preview,...t.state}};case"SET_EMAIL_POST":return{...e,...t.state};case"SET_CONTENT_VALIDATION":return{...e,contentValidation:t.validation};case"SET_TEMPLATE_SELECTED":return{...e,templateSelected:!0};case"SET_EDITOR_SETTINGS":return{...e,editorSettings:t.editorSettings};case"SET_EDITOR_THEME":return{...e,theme:t.theme};case"SET_EDITOR_URLS":return{...e,urls:{...e.urls,...t.urls}};case"SET_EDITOR_CONFIG":return{...e,editorSettings:t.config.editorSettings,theme:t.config.theme,urls:t.config.urls,preview:{...e.preview,toEmail:t.config.userEmail},styles:{...e.styles,globalStylesPostId:t.config.globalStylesPostId??null}};default:return e}}o.d(t,{F:()=>n})},6799(e,t,o){o.r(t),o.d(t,{canUserEditGlobalEmailStyles:()=>P,canUserEditTemplates:()=>j,getBlockPatternsForEmailTemplate:()=>w,getContentValidation:()=>D,getCurrentTemplate:()=>C,getCurrentTemplateContent:()=>T,getEditedEmailContent:()=>x,getEditedPostTemplate:()=>E,getEmailPostId:()=>A,getEmailPostType:()=>B,getEmailTemplates:()=>M,getGlobalEmailStylesPost:()=>N,getGlobalStylesPostId:()=>O,getInitialEditorSettings:()=>L,getPaletteColors:()=>I,getPersonalizationTagsList:()=>z,getPreviewState:()=>$,getSentEmailEditorPosts:()=>k,getStyles:()=>F,getTheme:()=>H,getUrls:()=>V,hasEdits:()=>y,hasEmptyContent:()=>_,isEmailSent:()=>b,isFeatureActive:()=>h,isTemplateSelected:()=>G});var n=o(7143),r=o(3582),s=o(3656),a=o(1233),i=o(4997),l=o(2619),c=o(3124),d=o(970);function u(e){return e?.content&&"function"==typeof e.content?e.content(e):e?.blocks?(0,i.serialize)(e.blocks):e?.content?e.content:""}const p=new WeakMap;function m(e){let t=p.get(e);return t||(t={...e,get blocks(){return(0,i.parse)(e.content)},get emailBlocks(){return e.emailContent?(0,i.parse)(e.emailContent):null}},p.set(e,t)),t}const g=new WeakMap;function f(e){if(!e)return null;const t=g.get(e);if(t)return t;const o={...e,title:e?.title?.raw||e?.title||"",content:e?.content?.raw||e?.content||""};return g.set(e,o),o}const h=(0,n.createRegistrySelector)(e=>(t,o)=>!!e(a.store).get(c.H,o)),y=(0,n.createRegistrySelector)(e=>()=>{const t=e(c.H).getEmailPostId(),o=e(c.H).getEmailPostType();return!!e(r.store).hasEditsForEntityRecord("postType",o,t)}),_=(0,n.createRegistrySelector)(e=>()=>{const t=e(c.H).getEmailPostId(),o=e(c.H).getEmailPostType(),n=e(r.store).getEntityRecord("postType",o,t);if(!n)return!0;const{content:s}=n;return!s.raw}),b=(0,n.createRegistrySelector)(e=>()=>{const t=e(c.H).getEmailPostId(),o=e(c.H).getEmailPostType(),n=e(r.store).getEntityRecord("postType",o,t);if(!n)return!1;return"sent"===n.status}),x=(0,n.createRegistrySelector)(e=>()=>{const t=e(c.H).getEmailPostId(),o=e(c.H).getEmailPostType(),n=e(r.store).getEditedEntityRecord("postType",o,t);return n?u(n):""}),v={per_page:30,status:"publish,sent"};const k=(0,n.createRegistrySelector)(e=>()=>{const t=e(c.H).getEmailPostType(),o=(0,l.applyFilters)("woocommerce_email_editor_recent_emails_query",{...v},t),n=(s=o)&&"object"==typeof s&&!Array.isArray(s)?o:v;var s;return e(r.store).getEntityRecords("postType",t,n)?.filter(e=>""!==e?.content?.raw)||[]}),w=(0,n.createRegistrySelector)(e=>{const t=e(c.H).getEmailPostType();return(0,n.createSelector)(()=>t?e(r.store).getBlockPatterns().filter(({templateTypes:e,postTypes:o})=>Array.isArray(e)&&e.includes("email-template")&&(void 0===o||0===o.length||o.includes(t))).map(m):[],()=>[e(r.store).getBlockPatterns(),t])}),j=(0,n.createRegistrySelector)(e=>()=>e(r.store).canUser("create",{kind:"postType",name:"wp_template"}));function S(e,t){return j()?e(r.store).getEditedEntityRecord("postType","wp_template",t):f(e(r.store).getEntityRecord("postType","wp_template",t,{context:"view"}))}const E=(0,n.createRegistrySelector)(e=>(t,o)=>{const n=o||e(s.store).getEditedPostAttribute("template");if(n){const t={context:"view",per_page:-1,_woocommerce_email_editor:"fetch-all-templates"},o=e(r.store).getEntityRecords("postType","wp_template",t)?.find(e=>e.slug===n);return o?S(e,o.id):null}const a=e(r.store).getDefaultTemplateId({slug:"email-general"});return S(e,a)}),C=(0,n.createRegistrySelector)(e=>()=>{if("wp_template"===e(s.store).getCurrentPostType()){const t=e(s.store).getCurrentPostId();return e(r.store).getEditedEntityRecord("postType","wp_template",t)}return e(c.H).getEditedPostTemplate()}),T=()=>{const e=C();return e?u(e):""},P=(0,n.createRegistrySelector)(e=>()=>{const t=e(c.H).getGlobalStylesPostId();return{postId:t,canEdit:e(r.store).canUser("update",{kind:"root",name:"globalStyles",id:t})}}),N=(0,n.createRegistrySelector)(e=>()=>{const{postId:t,canEdit:o}=P();return t&&void 0!==o&&t?o?e(r.store).getEditedEntityRecord("root","globalStyles",t):f(e(r.store).getEntityRecord("root","globalStyles",t,{context:"view"})):null}),M=(0,n.createRegistrySelector)(e=>{const t=e(c.H).getEmailPostType();return(0,n.createSelector)(()=>e(r.store).getEntityRecords("postType","wp_template",{per_page:-1,post_type:t,context:"view"})?.filter(e=>e.post_types.includes(t)),()=>[e(r.store).getEntityRecords("postType","wp_template",{per_page:-1,post_type:t,context:"view"})])});function A(e){return e.postId}function B(e){return e.postType}function L(e){return e.editorSettings}function I(e){return e.editorSettings?.__experimentalFeatures?.color?.palette}function $(e){return e.preview}const R=[],z=(0,n.createRegistrySelector)(e=>{let t=null;return()=>{const o=e(c.H).getEmailPostId(),n=e(r.store).getEntityRecords(c.q.kind,c.q.name,(0,d.O)(o))||R,s=e(c.H).getEmailPostType();if(!s)return n;const a="wp_template"===s?e(c.H).getCurrentTemplate()?.post_types:void 0;if(t&&t.tags===n&&t.postType===s&&t.templatePostTypes===a)return t.result;const i=n.filter(e=>void 0===e.postTypes||0===e.postTypes.length||("wp_template"===s?Array.isArray(a)&&a.some(t=>e.postTypes.includes(t)):e.postTypes.includes(s)));return t={tags:n,postType:s,templatePostTypes:a,result:i},i}});function F(e){return e.theme?.styles}function H(e){return e.theme}function O(e){return e.styles.globalStylesPostId}function V(e){return e.urls}function D(e){return e.contentValidation}function G(e){return e.templateSelected}},4368(e,t,o){function n(){if(!window.WooCommerceEmailEditor)throw new Error("WooCommerceEmailEditor global object is not available. This is required for the email editor to work.");const e=window.WooCommerceEmailEditor.editor_settings,t=window.WooCommerceEmailEditor.editor_theme,o=window.WooCommerceEmailEditor.urls,n=window.WooCommerceEmailEditor.current_wp_user_email,r=window.WooCommerceEmailEditor.user_theme_post_id;if(!e)throw new Error("window.WooCommerceEmailEditor.editor_settings is required.");if(!t)throw new Error("window.WooCommerceEmailEditor.editor_theme is required.");if(!o||"string"!=typeof o.back||"string"!=typeof o.listings)throw new Error("window.WooCommerceEmailEditor.urls.back and .listings are required strings.");return{editorSettings:e,theme:t,urls:o,userEmail:n,globalStylesPostId:r??null}}o.d(t,{q:()=>n})},7380(e,t,o){o.d(t,{y$:()=>u});var n=o(7143),r=o(3582),s=o(6161),a=o(8046),i=o(3124),l=o(8105),c=o(4405),d=o(6799);const u=()=>{if(void 0!==(0,n.select)(i.H))return(0,n.select)(i.H);const e=(0,n.createReduxStore)(i.H,{actions:a,controls:s.controls,selectors:d,resolvers:{},reducer:c.F,initialState:(0,l.C)()});return(0,n.register)(e),(0,n.dispatch)(r.store).addEntities([i.q]),e}},8311(e,t,o){o.d(t,{T:()=>n});var n=(e=>(e.SUCCESS="success",e.ERROR="error",e))(n||{})},3598(e,t,o){function n(e){if("string"!=typeof e)return null;const t=e.match(/^var:preset\|([a-zA-Z0-9-]+)\|([a-zA-Z0-9-]+)$/);return t?`--wp--preset--${t[1]}--${t[2]}`:null}function r(e){const t=n(e);return t?`var(${t})`:e}function s(e){const t=n(e);if(!t)return e;const o=document.querySelector(":root");if(!o)return e;return getComputedStyle(o).getPropertyValue(t).trim()||e}o.d(t,{DJ:()=>r,pr:()=>s})},5885(e,t,o){o.d(t,{I:()=>s});var n=o(7723),r=o(7847);const s=()=>{const e={"You’ve tried to select a block that is part of a template that may be used elsewhere on your site. Would you like to edit the template?":{domain:"default",replacementText:(0,n.__)("You’ve tried to select a block that is part of a template that may be used in other emails. Would you like to edit the template?","jetpack")}};(0,r.HY)("i18n.gettext","woocommerce/email-editor/override-text",(t,o,n)=>e[o]&&e[o].domain===(n||"default")?e[o].replacementText:t)}},790(e){e.exports=window.ReactJSXRuntime},8468(e){e.exports=window.lodash},1455(e){e.exports=window.wp.apiFetch},4715(e){e.exports=window.wp.blockEditor},9363(e){e.exports=window.wp.blockLibrary},4997(e){e.exports=window.wp.blocks},2165(e){e.exports=window.wp.commands},6427(e){e.exports=window.wp.components},9491(e){e.exports=window.wp.compose},3582(e){e.exports=window.wp.coreData},7143(e){e.exports=window.wp.data},6161(e){e.exports=window.wp.dataControls},8490(e){e.exports=window.wp.domReady},3656(e){e.exports=window.wp.editor},6087(e){e.exports=window.wp.element},2005(e){e.exports=window.wp.formatLibrary},2619(e){e.exports=window.wp.hooks},8537(e){e.exports=window.wp.htmlEntities},7723(e){e.exports=window.wp.i18n},923(e){e.exports=window.wp.isShallowEqual},8558(e){e.exports=window.wp.keycodes},692(e){e.exports=window.wp.notices},2279(e){e.exports=window.wp.plugins},1233(e){e.exports=window.wp.preferences},5573(e){e.exports=window.wp.primitives},7494(e){e.exports=window.wp.priorityQueue},3053(e){e.exports=window.wp.privateApis},876(e){e.exports=window.wp.richText},9786(e){e.exports=window.wp.styleEngine},3832(e){e.exports=window.wp.url},5046(e,t,o){o.d(t,{xn:()=>R});var n=o(4997),r=o(9786),s=o(7143),a=o(2267),i=o(7336),l=o(7731),c=o(912),d=o(1355),u=o(8472),p=o(7436),m=o(4022),g=o(233),f=o(4694),h=o(6767),y=o(6410),_={button:"wp-element-button",caption:"wp-element-caption"},b={__experimentalBorder:"border",color:"color",dimensions:"dimensions",spacing:"spacing",typography:"typography"},x={"core/button":[":hover",":focus",":focus-visible",":active"],"core/navigation-link":[":hover",":focus",":focus-visible",":active"]},v={link:[":link",":any-link",":visited",":hover",":focus",":focus-visible",":active"],button:[":link",":any-link",":visited",":hover",":focus",":focus-visible",":active"]};function k(e={},t,o){let n=[];return Object.keys(e).forEach(r=>{const s=t+(0,d.k)(r.replace("/","-")),a=e[r];if(a instanceof Object){const e=s+o;n=[...n,...k(a,e,o)]}else n.push(`${s}: ${a}`)}),n}function w(e={},t="",o,s={},i=!1){const c=a.B4===t,u=Object.entries(n.__EXPERIMENTAL_STYLE_PROPERTY).reduce((t,[n,{value:s,properties:a,useEngine:i,rootOnly:l}])=>{if(l&&!c)return t;const u=s;if("elements"===u[0]||i)return t;const p=(0,g.K)(e,u);if("--wp--style--root--padding"===n&&("string"==typeof p||!o))return t;if(a&&"string"!=typeof p)Object.entries(a).forEach(e=>{const[o,n]=e;if(!(0,g.K)(p,[n],!1))return;const s=o.startsWith("--")?o:(0,d.k)(o);t.push(`${s}: ${(0,r.getCSSValueFromRawStyle)((0,g.K)(p,[n]))}`)});else if((0,g.K)(e,u,!1)){const o=n.startsWith("--")?n:(0,d.k)(n);t.push(`${o}: ${(0,r.getCSSValueFromRawStyle)((0,g.K)(e,u))}`)}return t},[]);e.background&&(e.background?.backgroundImage&&(e.background.backgroundImage=(0,a.y_)(e.background.backgroundImage,s)),!c&&e.background?.backgroundImage?.id&&(e={...e,background:{...e.background,...(0,p.g)(e.background)}}));return(0,r.getCSSRules)(e).forEach(e=>{if(c&&(o||i)&&e.key.startsWith("padding"))return;const t=e.key.startsWith("--")?e.key:(0,d.k)(e.key);let n=(0,a.y_)(e.value,s);"font-size"===t&&(n=(0,l.j)({name:"",slug:"",size:n},s?.settings)),"aspect-ratio"===t&&u.push("min-height: unset"),u.push(`${t}: ${n}`)}),u}var j=["border","color","dimensions","spacing","typography","filter","outline","shadow","background"];function S(e,t,o){if(!e)return{};const n=Object.entries(e),r=t?x[t]??[]:[],s=n.filter(([e])=>j.includes(e)||r.includes(e)||o[e]).map(([e,t])=>[e,JSON.parse(JSON.stringify(t))]);return Object.fromEntries(s)}function E(e){const{styles:t,selector:o,featureSelectors:n,name:r,elementName:s,mediaQuery:a,variationName:i}=e,l=r?x[r]??[]:v[s??""]??[];return l.length?l.flatMap(e=>{const l=t?.[e];return l&&"object"==typeof l?[{styles:JSON.parse(JSON.stringify(l)),selector:o,selectorSuffix:e,mediaQuery:a,featureSelectors:n&&"string"!=typeof n?n:void 0,name:r,elementName:s,variationName:i}]:[]}):[]}function C(e,t){const o={...e?.elements??{}};return Object.keys(t).forEach(t=>{Object.entries(e?.[t]?.elements??{}).forEach(([e,n])=>{o[e]={...o[e]??{},[t]:n}})}),o}var T=(e,t)=>{const o=[];if(!e?.styles)return o;const r=(0,f.hG)(e),s=function(e,t){return S(e,void 0,t)}(e.styles,r);return s&&o.push({styles:s,selector:a.B4,skipSelectorWrapper:!0}),Object.entries(n.__EXPERIMENTAL_ELEMENTS).forEach(([t,n])=>{e.styles?.elements?.[t]&&o.push({styles:e.styles?.elements?.[t]??{},selector:n,elementName:t,skipSelectorWrapper:!_[t]})}),Object.entries(e.styles?.blocks??{}).forEach(([e,s])=>{const i=S(s,e,r),l=s,c=[],d=[];l?.variations&&Object.entries(l.variations).forEach(([o,s])=>{const i=s,l=S(i,e,r);i?.css&&(l.css=i.css);const u="string"!=typeof t?t[e]?.styleVariationSelectors?.[o]:void 0;if(u&&"string"!=typeof t){const n=t[e];d.push({styles:l,selector:u,featureSelectors:n?.featureSelectors,fallbackGapValue:n?.fallbackGapValue,hasLayoutSupport:n?.hasLayoutSupport,isStyleVariation:!0,variationName:o,layoutSelector:u+n.selector,layoutHasBlockGapSupport:!0,name:e})}Object.entries(C(i,r)).forEach(([e,t])=>{t&&n.__EXPERIMENTAL_ELEMENTS[e]&&c.push({styles:t,selector:(0,a.q1)(u,n.__EXPERIMENTAL_ELEMENTS[e]),elementName:e,isStyleVariation:!0})}),Object.entries(i?.blocks??{}).forEach(([e,o])=>{const s="string"!=typeof t?(0,a.q1)(u,t[e]?.selector):void 0,i="string"!=typeof t?(0,a.q1)(u,t[e]?.duotoneSelector):void 0,l="string"!=typeof t?(0,a.hX)(u,t[e]?.featureSelectors??{}):void 0,d=S(o,e,r);o?.css&&(d.css=o.css),s&&"string"!=typeof t&&(c.push({selector:s,name:e,isStyleVariation:!0,duotoneSelector:i,featureSelectors:l,fallbackGapValue:t[e]?.fallbackGapValue,hasLayoutSupport:t[e]?.hasLayoutSupport,styles:d}),Object.entries(C(o,r)).forEach(([e,t])=>{t&&n.__EXPERIMENTAL_ELEMENTS[e]&&c.push({styles:t,selector:(0,a.q1)(s,n.__EXPERIMENTAL_ELEMENTS[e]),elementName:e,isStyleVariation:!0})}))})}),"string"!=typeof t&&t?.[e]?.selector&&o.push({duotoneSelector:t[e].duotoneSelector,fallbackGapValue:t[e].fallbackGapValue,hasLayoutSupport:t[e].hasLayoutSupport,selector:t[e].selector,styles:i,featureSelectors:t[e].featureSelectors,name:e}),o.push(...d),Object.entries(C(l,r)).forEach(([r,s])=>{"string"!=typeof t&&s&&t?.[e]&&n.__EXPERIMENTAL_ELEMENTS[r]&&o.push({styles:s,selector:t[e]?.selector.split(",").map(e=>n.__EXPERIMENTAL_ELEMENTS[r].split(",").map(t=>e+" "+t)).join(","),elementName:r})}),o.push(...c)}),o},P=(e,t)=>{const o=[];if(!e?.settings)return o;const n=e=>{let t={};return a.EA.forEach(({path:o})=>{const n=(0,g.K)(e,o,!1);!1!==n&&(t=(0,g.n)(t,o,n))}),t},r=n(e.settings),s=e.settings?.custom;return(Object.keys(r).length>0||s)&&o.push({presets:r,custom:s,selector:a.bB}),Object.entries(e.settings?.blocks??{}).forEach(([e,r])=>{const s=r.custom;if("string"==typeof t||!t[e])return;const a=n(r);(Object.keys(a).length>0||s)&&o.push({presets:a,custom:s,selector:t[e]?.selector,featureSelectors:t[e]?.featureSelectors})}),o};function N(e,t,o){if(!e||"string"==typeof e)return o;const n=e[t];return"string"==typeof n?n:"object"==typeof n&&n.root?n.root:o}function M(e,t,{path:o,valueKey:n,valueFunc:r,cssVarInfix:s}){const a=(0,g.K)(e,o,[]),i=[];for(const e of["default","theme","custom"])if(a[e])for(const o of a[e]){const e=(0,d.k)(o.slug);n&&!r?i.push(`--wp--preset--${s}--${e}: ${o[n]}`):r&&"function"==typeof r&&i.push(`--wp--preset--${s}--${e}: ${r(o,t)}`)}return i}function A(e,{tree:t,useRootPaddingAlign:o,disableLayoutStyles:n,hasBlockGapSupport:r,hasFallbackGapSupport:s,disableRootPadding:i}){const{selector:l,selectorSuffix:c,mediaQuery:d,duotoneSelector:p,styles:g,fallbackGapValue:f,hasLayoutSupport:h,featureSelectors:y,layoutSelector:_,layoutHasBlockGapSupport:b,skipSelectorWrapper:x,name:v,variationName:k}=e;let j="";const S=c?(0,a.fx)(l,c):l;if(y&&"string"!=typeof y){let e=((e,t)=>{const o={};return Object.entries(e).forEach(([e,n])=>{if("root"===e||!t?.[e])return;const r="string"==typeof n;if(r||"object"!=typeof n||null===n||Object.entries(n).forEach(([n,r])=>{if("root"===n||!t?.[e][n])return;const s=w({[e]:{[n]:t[e][n]}});o[r]=[...o[r]||[],...s],delete t[e][n]}),r||"object"==typeof n&&null!==n&&"root"in n){const s=r?n:n.root,a=w({[e]:t[e]});o[s]=[...o[s]||[],...a],delete t[e]}}),o})(y,g);e=((e,t,o)=>{if("core/paragraph"!==o)return e;const n=t?.blocks?.["core/paragraph"];if("all"!==(n?.typography?.textIndent??t?.typography?.textIndent??"subsequent"))return e;const r=".wp-block-paragraph + .wp-block-paragraph";if(r in e){const t=e[r],o={...e};return delete o[r],o[".wp-block-paragraph"]=t,o}return e})(e,t.settings,v),e=((e,t)=>{const o=".wp-block-button";if(!(o in e))return e;const n={...e};return n[o]=n[o].map(e=>{const o=e.match(/^width:\s*(.+)$/);if(!o)return e;const n=o[1];let r=null;n.endsWith("%")&&(r=parseFloat(n));const s="var(--wp--preset--dimension--";if(null===r&&n.startsWith(s)&&n.endsWith(")")){const e=n.slice(29,-1),o={...t?.dimensions?.dimensionSizes??{},...t?.blocks?.["core/button"]?.dimensions?.dimensionSizes??{}};for(const t of Object.values(o))if(Array.isArray(t)){for(const o of t)if(o.slug===e&&"string"==typeof o.size&&o.size.endsWith("%")){r=parseFloat(o.size);break}if(null!==r)break}}return null===r||isNaN(r)?e:`width: calc(${r} * 1% - (var(--wp--style--block-gap, 0.5em) * (1 - ${r} / 100)))`}),n})(e,t.settings),Object.entries(e).forEach(([e,t])=>{if(t.length){let o=k?(0,a.Pn)(k,e):e;o=c?(0,a.fx)(o,c):o;const n=t.join(";");j+=`:root :where(${o}){${n};}`}})}if(p){const e={};g?.filter&&(e.filter=g.filter,delete g.filter);const t=w(e);t.length&&(j+=`${p}{${t.join(";")};}`)}const E=_??S,C=b??r;n||a.B4!==E&&!h||(j+=function({layoutDefinitions:e=m.o,style:t,selector:o,hasBlockGapSupport:n,hasFallbackGapSupport:r,fallbackGapValue:s}){let i="";const l=t?.spacing?.blockGap;let c=n?(0,u.$)(l):"";r&&(o===a.B4?c=c||"0.5em":!n&&s&&(c=s));const d=n&&l&&"string"!=typeof l?(0,u.$)(l.top):c;if(c&&e&&(Object.values(e).forEach(({className:e,name:t,spacingStyles:r})=>{if(!n&&"flex"!==t&&"grid"!==t)return;const s=["default","constrained"].includes(t)?d:c;r?.length&&r.forEach(t=>{const r=[];if(t.rules&&Object.entries(t.rules).forEach(([e,t])=>{r.push(`${e}: ${t||s}`)}),r.length){let s="";s=n?o===a.B4?`:root :where(.${e})${t?.selector||""}`:`:root :where(${o}-${e})${t?.selector||""}`:o===a.B4?`:where(.${e}${t?.selector||""})`:`:where(${o}.${e}${t?.selector||""})`,i+=`${s} { ${r.join("; ")}; }`}})}),o===a.B4&&n&&(i+=`${a.bB} { --wp--style--block-gap: ${c}; }`)),o===a.B4&&e){const t=["block","flex","grid"];Object.values(e).forEach(({className:e,displayMode:n,baseStyles:r})=>{n&&t.includes(n)&&(i+=`${o} .${e} { display:${n}; }`),r?.length&&r.forEach(t=>{const o=[];t.rules&&Object.entries(t.rules).forEach(([e,t])=>{o.push(`${e}: ${t}`)}),o.length&&(i+=`.${e}${t?.selector||""} { ${o.join("; ")}; }`)})})}return i}({style:g,selector:E,hasBlockGapSupport:C,hasFallbackGapSupport:s,fallbackGapValue:f}));const T=w(g,S,o,t,i);if(T?.length){j+=`${x?S:`:root :where(${S})`}{${T.join(";")};}`}return g?.css&&(j+=$(g.css,`:root :where(${S})`)),d&&j?`${d}{${j}}`:j}var B=(e,t,o,n,r=!1,s=!1,i={})=>{const l={blockGap:!0,blockStyles:!0,layoutStyles:!0,marginReset:!0,presets:!0,rootPadding:!0,variationStyles:!1,...i},c=(0,y.k)(e),p=T(c,t),m=P(c,t),h=c?.settings?.useRootPaddingAwareAlignments,{contentSize:_,wideSize:b}=c?.settings?.layout||{},x=l.marginReset||l.rootPadding||l.layoutStyles;let v="";if(l.presets&&(_||b)&&(v+=`${a.bB} {`,v=_?v+` --wp--style--global--content-size: ${_};`:v,v=b?v+` --wp--style--global--wide-size: ${b};`:v,v+="}"),x&&(v+=":where(body) {margin: 0;",l.rootPadding&&h&&(v+="padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }\n\t\t\t\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t\t.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }\n\t\t\t\t.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) { padding-right: 0; padding-left: 0; }\n\t\t\t\t.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) > .alignfull { margin-left: 0; margin-right: 0;\n\t\t\t\t"),v+="}"),l.blockStyles){const t=(0,f.hG)(e);p.forEach(e=>{if(e.isStyleVariation&&!l.variationStyles)return;const a=function(e,t){const{styles:o,selector:n,fallbackGapValue:r,featureSelectors:s,hasLayoutSupport:a,layoutHasBlockGapSupport:i,layoutSelector:l,name:c,elementName:d,isStyleVariation:u,variationName:p}=e;return c||d?Object.entries(t).flatMap(([e,t])=>{const m=o?.[e];return m&&"object"==typeof m?[{styles:JSON.parse(JSON.stringify(m)),selector:n,mediaQuery:t,featureSelectors:s&&"string"!=typeof s?s:void 0,fallbackGapValue:r,hasLayoutSupport:a,name:c,elementName:d,isStyleVariation:u,variationName:p,layoutSelector:l,layoutHasBlockGapSupport:i}]:[]}):[]}(e,t);[e,...a,...E(e),...a.flatMap(E)].forEach(e=>{v+=A(e,{tree:c,useRootPaddingAlign:h,disableLayoutStyles:r,hasBlockGapSupport:o,hasFallbackGapSupport:n,disableRootPadding:s})})})}if(l.layoutStyles&&(v+=".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",v+=".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",v+=".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }"),l.blockGap&&o){const e=(0,u.$)(c?.styles?.spacing?.blockGap)||"0.5em";v+=`:root :where(.wp-site-blocks) > * { margin-block-start: ${e}; margin-block-end: 0; }`,v+=":root :where(.wp-site-blocks) > :first-child { margin-block-start: 0; }",v+=":root :where(.wp-site-blocks) > :last-child { margin-block-end: 0; }"}return l.presets&&m.forEach(({selector:e,presets:t})=>{a.B4!==e&&a.bB!==e||(e="");const o=function(e="*",t={}){return a.EA.reduce((o,{path:n,cssVarInfix:r,classes:s})=>{if(!s)return o;const a=(0,g.K)(t,n,[]);return["default","theme","custom"].forEach(t=>{a[t]&&a[t].forEach(({slug:t})=>{s.forEach(({classSuffix:n,propertyName:s})=>{const a=`.has-${(0,d.k)(t)}-${n}`,i=e?`:where(${e})${a}`:a,l=`var(--wp--preset--${r}--${(0,d.k)(t)})`;o+=`${i}{${s}: ${l} !important;}`})})}),o},"")}(e,t);o.length>0&&(v+=o)}),v};function L(e,t){return P(e,t).flatMap(({presets:e})=>function(e={}){return a.EA.filter(e=>"duotone"===e.path.at(-1)).flatMap(t=>{const o=(0,g.K)(e,t.path,{});return["default","theme","custom"].filter(e=>o[e]).flatMap(e=>o[e].map(e=>(0,c.xX)(`wp-duotone-${e.slug}`,e.colors))).join("")})}(e))}var I=(e,t)=>{const{getBlockStyles:o}=(0,s.select)(n.store),r={};return e.forEach(e=>{const s=e.name,l=(0,i.$)(e);if(!l)return;let c=(0,i.$)(e,"filter.duotone");if(!c){const t=(0,i.$)(e),o=(0,n.getBlockSupport)(e,"color.__experimentalDuotone",!1);"string"==typeof o&&t&&(c=(0,a.q1)(t,o))}const d=!!e?.supports?.layout||!!e?.supports?.__experimentalLayout,u=e?.supports?.spacing?.blockGap,p="object"!=typeof u||Array.isArray(u)?void 0:u.__experimentalDefault,m=o(s),g={};m?.forEach(e=>{const o=t?`-${t}`:"",n=`${e.name}${o}`,r=(0,a.NJ)(n,l);g[n]=r});const f=((e,t)=>{if(e?.selectors&&Object.keys(e.selectors).length>0)return e.selectors;const o={root:t};return Object.entries(b).forEach(([t,n])=>{const r=(0,i.$)(e,t);r&&(o[n]=r)}),o})(e,l);r[s]={duotoneSelector:c??void 0,fallbackGapValue:p,featureSelectors:Object.keys(f).length?f:void 0,hasLayoutSupport:d,name:s,selector:l,styleVariationSelectors:m?.length?g:void 0}}),r};function $(e,t){let o="";if(!e||""===e.trim())return o;return e.split("&").forEach(e=>{if(!e||""===e.trim())return;if(!e.includes("{"))o+=`:root :where(${t}){${e.trim()}}`;else{const n=e.replace("}","").split("{");if(2!==n.length)return;const[r,s]=n,i=r.match(/([>+~\s]*::[a-zA-Z-]+)/),l=i?i[1]:"",c=i?r.replace(l,"").trim():r.trim();let d;d=""===c?t:r.startsWith(" ")?(0,a.q1)(t,c):(0,a.fx)(t,c),o+=`:root :where(${d})${l}{${s.trim()}}`}}),o}function R(e={},t=[],o={}){const{hasBlockGapSupport:r,hasFallbackGapSupport:s,disableLayoutStyles:i=!1,disableRootPadding:l=!1,styleOptions:c={}}=o,d=t.length>0?t:(0,n.getBlockTypes)(),u=(0,h.P)(e,"spacing.blockGap"),p=r??null!==u,m=s??!p;if(!e?.styles||!e?.settings)return[[],{}];const g=function(e){const t=e.styles?.blocks,o=t?.["core/separator"];return o&&o.color?.background&&!o.color?.text&&!o.border?.color?{...e,styles:{...e.styles,blocks:{...t,"core/separator":{...o,color:{...o.color,text:o.color?.background}}}}}:e}(e),f=I(d),y=((e,t)=>{const o=P(e,t);let n="";for(const{presets:t,custom:r,selector:s,featureSelectors:i}of o){const o=s,l={[o]:[]};if(e?.settings)for(const n of a.EA){const r=M(t,e.settings,n);if(0===r.length)continue;const s=N(i,n.path[0],o);l[s]||(l[s]=[]),l[s].push(...r)}const c=k(r,"--wp--custom--","--");c.length>0&&l[o].push(...c);for(const[e,t]of Object.entries(l))t.length>0&&(n+=`${e}{${t.join(";")};}`)}return n})(g,f),_=B(g,f,p,m,i,l,c),b=L(g,f),x=[{css:y,isGlobalStyles:!0},{css:_,isGlobalStyles:!0},{css:g?.styles?.css??"",isGlobalStyles:!0},{assets:b,__unstableType:"svgs",isGlobalStyles:!0}];return d.forEach(e=>{const t=g?.styles?.blocks?.[e.name];if(t?.css){const{featureSelectors:o}=f[e.name],n="object"==typeof o?o?.css:void 0;let r;"string"==typeof n?r=n:"object"==typeof n&&(r=n?.root);const s=r??f[e.name].selector;x.push({css:$(t.css,s),isGlobalStyles:!0})}}),[x,g.settings]}},7336(e,t,o){o.d(t,{$:()=>s});var n=o(2267),r=o(233);function s(e,t="root",o={}){if(!t)return null;const{fallback:a=!1}=o,{name:i,selectors:l,supports:c}=e,d=l&&Object.keys(l).length>0,u=Array.isArray(t)?t.join("."):t;let p=null;if(p=d&&l.root?l?.root:c?.__experimentalSelector?c.__experimentalSelector:".wp-block-"+i.replace("core/","").replace("/","-"),"root"===u)return p;const m=Array.isArray(t)?t:t.split(".");if(1===m.length){const e=a?p:null;if(d){return(0,r.K)(l,`${u}.root`,null)||(0,r.K)(l,u,null)||e}const t=c?(0,r.K)(c,`${u}.__experimentalSelector`,null):void 0;return t?(0,n.q1)(p,t):e}let g;return d&&(g=(0,r.K)(l,u,null)),g||(a?s(e,m[0],o):null)}},6767(e,t,o){o.d(t,{P:()=>s});var n=o(233),r=["appearanceTools","useRootPaddingAwareAlignments","background.backgroundImage","background.backgroundRepeat","background.backgroundSize","background.backgroundPosition","background.gradient","border.color","border.radius","border.radiusSizes","border.style","border.width","shadow.presets","shadow.defaultPresets","color.background","color.button","color.caption","color.custom","color.customDuotone","color.customGradient","color.defaultDuotone","color.defaultGradients","color.defaultPalette","color.duotone","color.gradients","color.heading","color.link","color.palette","color.text","custom","dimensions.aspectRatio","dimensions.height","dimensions.minHeight","dimensions.minWidth","dimensions.width","dimensions.dimensionSizes","layout.contentSize","layout.definitions","layout.wideSize","lightbox.enabled","lightbox.allowEditing","position.fixed","position.sticky","spacing.customSpacingSize","spacing.defaultSpacingSizes","spacing.spacingSizes","spacing.spacingScale","spacing.blockGap","spacing.margin","spacing.padding","spacing.units","typography.fluid","typography.customFontSize","typography.defaultFontSizes","typography.dropCap","typography.fontFamilies","typography.fontSizes","typography.fontStyle","typography.fontWeight","typography.letterSpacing","typography.lineHeight","typography.textAlign","typography.textColumns","typography.textDecoration","typography.textIndent","typography.textTransform","typography.writingMode","viewport.mobile","viewport.tablet"];function s(e,t,o){const s=o?".blocks."+o:"",a=t?"."+t:"",i=`settings${s}${a}`,l=`settings${a}`;if(t)return(0,n.K)(e,i)??(0,n.K)(e,l);let c={};return r.forEach(t=>{const o=(0,n.K)(e,`settings${s}.${t}`)??(0,n.K)(e,`settings.${t}`);void 0!==o&&(c=(0,n.n)(c,t.split("."),o))}),c}},6410(e,t,o){o.d(t,{k:()=>a});var n={"@mobile":"mobile","@tablet":"tablet","-current":"@current"};function r(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function s(e){if(!r(e))return e;let t=e;return Object.entries(n).forEach(([o,n])=>{Object.hasOwn(e,n)&&(t===e&&(t={...e}),Object.hasOwn(e,o)||(t[o]=e[n]),delete t[n])}),Object.entries(t).forEach(([o,n])=>{if(!r(n))return;const a=s(n);a!==n&&(t===e&&(t={...e}),t[o]=a)}),t}function a(e){if(!globalThis.IS_GUTENBERG_PLUGIN)return e;if(!e?.styles)return e;const t=s(e.styles);return t===e.styles?e:{...e,styles:t}}},7436(e,t,o){o.d(t,{g:()=>s});var n="cover",r="50% 50%";function s(e){if(!e||("object"!=typeof(t=e.backgroundImage)||null===t||!("url"in t)||!t.url))return;var t;let o;return e?.backgroundSize||(o={backgroundSize:n}),"contain"!==e?.backgroundSize||e?.backgroundPosition||(o={backgroundPosition:r}),o}},2267(e,t,o){o.d(t,{B4:()=>a,EA:()=>c,NJ:()=>g,Pn:()=>f,Px:()=>x,bB:()=>i,fx:()=>m,hX:()=>p,q1:()=>u,yQ:()=>b,y_:()=>y});var n=o(9786),r=o(7731),s=o(233),a="body",i=":root";function l(e){if(!e.includes(","))return[e];const t=[];let o="",n=0;for(const r of e){if("("===r)n++;else if(")"===r&&n>0)n--;else if(","===r&&0===n){t.push(o),o="";continue}o+=r}return t.push(o),t}var c=[{path:["color","palette"],valueKey:"color",cssVarInfix:"color",classes:[{classSuffix:"color",propertyName:"color"},{classSuffix:"background-color",propertyName:"background-color"},{classSuffix:"border-color",propertyName:"border-color"}]},{path:["color","gradients"],valueKey:"gradient",cssVarInfix:"gradient",classes:[{classSuffix:"gradient-background",propertyName:"background"}]},{path:["color","duotone"],valueKey:"colors",cssVarInfix:"duotone",valueFunc:({slug:e})=>`url( '#wp-duotone-${e}' )`,classes:[]},{path:["shadow","presets"],valueKey:"shadow",cssVarInfix:"shadow",classes:[]},{path:["typography","fontSizes"],valueFunc:(e,t)=>(0,r.j)(e,t),valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]},{path:["spacing","spacingSizes"],valueKey:"size",cssVarInfix:"spacing",valueFunc:({size:e})=>e,classes:[]},{path:["border","radiusSizes"],valueKey:"size",cssVarInfix:"border-radius",classes:[]},{path:["dimensions","dimensionSizes"],valueKey:"size",cssVarInfix:"dimension",classes:[]}],d={"color.background":"color","color.text":"color","filter.duotone":"duotone","elements.link.color.text":"color","elements.link.:hover.color.text":"color","elements.link.typography.fontFamily":"font-family","elements.link.typography.fontSize":"font-size","elements.button.color.text":"color","elements.button.color.background":"color","elements.caption.color.text":"color","elements.button.typography.fontFamily":"font-family","elements.button.typography.fontSize":"font-size","elements.heading.color":"color","elements.heading.color.background":"color","elements.heading.typography.fontFamily":"font-family","elements.heading.gradient":"gradient","elements.heading.color.gradient":"gradient","elements.h1.color":"color","elements.h1.color.background":"color","elements.h1.typography.fontFamily":"font-family","elements.h1.color.gradient":"gradient","elements.h2.color":"color","elements.h2.color.background":"color","elements.h2.typography.fontFamily":"font-family","elements.h2.color.gradient":"gradient","elements.h3.color":"color","elements.h3.color.background":"color","elements.h3.typography.fontFamily":"font-family","elements.h3.color.gradient":"gradient","elements.h4.color":"color","elements.h4.color.background":"color","elements.h4.typography.fontFamily":"font-family","elements.h4.color.gradient":"gradient","elements.h5.color":"color","elements.h5.color.background":"color","elements.h5.typography.fontFamily":"font-family","elements.h5.color.gradient":"gradient","elements.h6.color":"color","elements.h6.color.background":"color","elements.h6.typography.fontFamily":"font-family","elements.h6.color.gradient":"gradient","color.gradient":"gradient",shadow:"shadow","typography.fontSize":"font-size","typography.fontFamily":"font-family"};function u(e,t){if(!e||!t)return t;const o=l(e),n=l(t),r=[];return o.forEach(e=>{n.forEach(t=>{r.push(`${e.trim()} ${t.trim()}`)})}),r.join(", ")}function p(e,t){if(!e||!t)return;const o={};return Object.entries(t).forEach(([t,n])=>{"string"==typeof n&&(o[t]=u(e,n)),"object"==typeof n&&(o[t]={},Object.entries(n).forEach(([n,r])=>{o[t][n]=u(e,r)}))}),o}function m(e,t){if(!e.includes(","))return e+t;return l(e).map(e=>e+t).join(",")}function g(e,t){const o=`.is-style-${e}`;if(!t)return o;const n=/[^\s:]+/,r=e=>e+o;return l(t).map(e=>e.replace(n,r)).join(",")}function f(e,t){const o=`.is-style-${e}`;return g(e,l(t).map(e=>{const t=e.trim(),n=`${o} `;return t.startsWith(n)?t.slice(n.length):t}).join(","))}function h(e,t){if(!e||!t||!Array.isArray(t))return e;const o=t.find(t=>t?.name===e);return o?.href?o?.href:e}function y(e,t){if(!e||!t)return e;const o=function(e,t){if(!e||!t)return e;if("object"==typeof e&&"ref"in e&&e?.ref){const o=(0,n.getCSSValueFromRawStyle)((0,s.K)(t,e.ref));if("object"==typeof o&&null!==o&&"ref"in o&&o?.ref)return;return void 0===o?e:o}return e}(e,t);return"object"==typeof o&&null!==o&&"url"in o&&o?.url?{...o,url:h(o.url,t?._links?.["wp:theme-file"])}:o}function _(e,t,o=[],n="slug",r){const a=[t?(0,s.K)(e,["blocks",t,...o]):void 0,(0,s.K)(e,o)].filter(Boolean);for(const s of a)if(s){const a=["custom","theme","default"];for(const i of a){const a=s[i];if(a){const s=a.find(e=>e[n]===r);if(s){if("slug"===n)return s;return _(e,t,o,"slug",s.slug)[n]===s[n]?s:void 0}}}}}function b(e,t,o){if(!o||"string"!=typeof o){if("object"!=typeof o||null===o||!("ref"in o)||"string"!=typeof o.ref)return o;{const t=(0,s.K)(e,o.ref);if(!t||"object"==typeof t&&"ref"in t)return t;o=t}}const n="var:",r="var(--wp--";let a;if(o.startsWith(n))a=o.slice(4).split("|");else{if(!o.startsWith(r)||!o.endsWith(")"))return o;a=o.slice(10,-1).split("--")}const[i,...l]=a;return"preset"===i?function(e,t,o,[n,r]=[]){const s=c.find(e=>e.cssVarInfix===n);if(!s||!e.settings)return o;const a=_(e.settings,t,s.path,"slug",r);if(a){const{valueKey:o}=s;return b(e,t,a[o])}return o}(e,t,o,l):"custom"===i?function(e,t,o,n=[]){const r=(t?(0,s.K)(e?.settings??{},["blocks",t,"custom",...n]):void 0)??(0,s.K)(e?.settings??{},["custom",...n]);return r?b(e,t,r):o}(e,t,o,l):o}function x(e,t,o,n){if(!n)return n;const r=d[o],s=c.find(e=>e.cssVarInfix===r);if(!s)return n;const{valueKey:a,path:i}=s,l=_(e,t,i,a,n);return l?`var:preset|${r}|${l.slug}`:n}},912(e,t,o){o.d(t,{xX:()=>r});var n=o(3270);function r(e,t){const o=function(e=[]){const t={r:[],g:[],b:[],a:[]};return e.forEach(e=>{const o=(0,n.Mj)(e).toRgb();t.r.push(o.r/255),t.g.push(o.g/255),t.b.push(o.b/255),t.a.push(o.a)}),t}(t);return`\n<svg\n\txmlns:xlink="http://www.w3.org/1999/xlink"\n\tviewBox="0 0 0 0"\n\twidth="0"\n\theight="0"\n\tfocusable="false"\n\trole="none"\n\taria-hidden="true"\n\tstyle="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;"\n>\n\t<defs>\n\t\t<filter id="${e}">\n\t\t\t\x3c!--\n\t\t\t\tUse sRGB instead of linearRGB so transparency looks correct.\n\t\t\t\tUse perceptual brightness to convert to grayscale.\n\t\t\t--\x3e\n\t\t\t<feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "></feColorMatrix>\n\t\t\t\x3c!-- Use sRGB instead of linearRGB to be consistent with how CSS gradients work. --\x3e\n\t\t\t<feComponentTransfer color-interpolation-filters="sRGB">\n\t\t\t\t<feFuncR type="table" tableValues="${o.r.join(" ")}"></feFuncR>\n\t\t\t\t<feFuncG type="table" tableValues="${o.g.join(" ")}"></feFuncG>\n\t\t\t\t<feFuncB type="table" tableValues="${o.b.join(" ")}"></feFuncB>\n\t\t\t\t<feFuncA type="table" tableValues="${o.a.join(" ")}"></feFuncA>\n\t\t\t</feComponentTransfer>\n\t\t\t\x3c!-- Re-mask the image with the original transparency since the feColorMatrix above loses that information. --\x3e\n\t\t\t<feComposite in2="SourceGraphic" operator="in"></feComposite>\n\t\t</filter>\n\t</defs>\n</svg>`}},2636(e,t,o){o.d(t,{Of:()=>r,UE:()=>n});function n({minimumFontSize:e,maximumFontSize:t,fontSize:o,minimumViewportWidth:n="320px",maximumViewportWidth:a="1600px",scaleFactor:i=1,minimumFontSizeLimit:l}){if(l=r(l)?l:"14px",o){const n=r(o);if(!n?.unit||!n?.value)return null;const a=r(l,{coerceTo:n.unit});if(a?.value&&!e&&!t&&n?.value<=a?.value)return null;if(t||(t=`${n.value}${n.unit}`),!e){const t="px"===n.unit?n.value:16*n.value,o=Math.min(Math.max(1-.075*Math.log2(t),.25),.75),r=s(n.value*o,3);e=a?.value&&r<a?.value?`${a.value}${a.unit}`:`${r}${n.unit}`}}const c=r(e),d=c?.unit||"rem",u=r(t,{coerceTo:d});if(!c||!u)return null;const p=r(e,{coerceTo:"rem"}),m=r(a,{coerceTo:d}),g=r(n,{coerceTo:d});if(!m||!g||!p)return null;const f=m.value-g.value;if(!f)return null;const h=s(g.value/100,3),y=s(h,3)+d,_=s(((u.value-c.value)/f*100||1)*i,3);return`clamp(${e}, ${`${p.value}${p.unit} + ((1vw - ${y}) * ${_})`}, ${t})`}function r(e,t={}){if("string"!=typeof e&&"number"!=typeof e)return null;isFinite(e)&&(e=`${e}px`);const{coerceTo:o,rootSizeValue:n,acceptableUnits:r}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},a=r?.join("|"),i=new RegExp(`^(\\d*\\.?\\d+)(${a}){1,1}$`),l=e.toString().match(i);if(!l||l.length<3)return null;let[,c,d]=l,u=parseFloat(c);return"px"!==o||"em"!==d&&"rem"!==d||(u*=n,d=o),"px"!==d||"em"!==o&&"rem"!==o||(u/=n,d=o),"em"!==o&&"rem"!==o||"em"!==d&&"rem"!==d||(d=o),d?{value:s(u,3),unit:d}:null}function s(e,t=3){const o=Math.pow(10,t);return Math.round(e*o)/o}},8472(e,t,o){o.d(t,{$:()=>r});var n=o(7479);function r(e,t="0"){const o=function(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:e?.top,left:t?e:e?.left}}(e);if(!o)return null;const r=(0,n.X)(o?.top)||t,s=(0,n.X)(o?.left)||t;return r===s?r:`${r} ${s}`}},4022(e,t,o){o.d(t,{o:()=>n});var n={default:{name:"default",slug:"flow",className:"is-layout-flow",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}}],spacingStyles:[{selector:" > :first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},constrained:{name:"constrained",slug:"constrained",className:"is-layout-constrained",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > :where(:not(.alignleft):not(.alignright):not(.alignfull))",rules:{"max-width":"var(--wp--style--global--content-size)","margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > .alignwide",rules:{"max-width":"var(--wp--style--global--wide-size)"}}],spacingStyles:[{selector:" > :first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},flex:{name:"flex",slug:"flex",className:"is-layout-flex",displayMode:"flex",baseStyles:[{selector:"",rules:{"flex-wrap":"wrap","align-items":"center"}},{selector:" > :is(*, div)",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]},grid:{name:"grid",slug:"grid",className:"is-layout-grid",displayMode:"grid",baseStyles:[{selector:" > :is(*, div)",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]}}},233(e,t,o){function n(e,t,o){t=Array.isArray(t)?[...t]:[t],e=Array.isArray(e)?[...e]:{...e};const n=t.pop();let r=e;for(const e of t){const t=r[e];r=r[e]=Array.isArray(t)?[...t]:{...t}}return r[n]=o,e}o.d(t,{K:()=>r,n:()=>n});var r=(e,t,o)=>{const n=Array.isArray(t)?t:t.split(".");let r=e;return n.forEach(e=>{r=r?.[e]}),r??o}},7479(e,t,o){function n(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}o.d(t,{X:()=>n})},1355(e,t,o){function n(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([0-9])([a-zA-Z])/g,"$1-$2").replace(/([a-zA-Z])([0-9])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}o.d(t,{k:()=>n})},7731(e,t,o){o.d(t,{j:()=>s});var n=o(2636);function r(e){const t=e?.fluid;return!0===t||t&&"object"==typeof t&&Object.keys(t).length>0}function s(e,t){const{size:o}=e;if(!o||"0"===o||!1===e?.fluid)return o;if(!r(t?.typography)&&!r(e))return o;const s=function(e){const t=e?.typography??{},o=e?.layout,s=(0,n.Of)(o?.wideSize)?o?.wideSize:null;return r(t)&&s?{fluid:{maxViewportWidth:s,..."object"==typeof t.fluid?t.fluid:{}}}:{fluid:t?.fluid}}(t)?.fluid??{},a=(0,n.UE)({minimumFontSize:"boolean"==typeof e?.fluid?void 0:e?.fluid?.min,maximumFontSize:"boolean"==typeof e?.fluid?void 0:e?.fluid?.max,fontSize:o,minimumFontSizeLimit:"object"==typeof s?s?.minFontSize:void 0,maximumViewportWidth:"object"==typeof s?s?.maxViewportWidth:void 0,minimumViewportWidth:"object"==typeof s?s?.minViewportWidth:void 0});return a||o}},4694(e,t,o){o.d(t,{hG:()=>a});var n={mobile:"480px",tablet:"782px"},r=/^(\d+|\d*\.\d+)(px|em|rem)$/;function s(e){const t=function(e){return e&&"object"==typeof e?function(e){return"mobile"in e||"tablet"in e}(e)?e:e.settings?.viewport??{}:{}}(e),o={},s={};Object.keys(n).forEach(e=>{const n=e,a=t[n],i=function(e){if("number"==typeof e)return e;if("string"!=typeof e)return;const t=e.trim().match(r);if(!t)return;const o=Number.parseFloat(t[1]);return"px"===t[2]?o:16*o}(a);void 0!==i&&function(e){return"string"==typeof e&&r.test(e.trim())}(a)&&(o[n]=a.trim(),s[n]=i)});const a=Object.keys(o);if(!a.length)return{...n};if(1===a.length)return o;const i=o.mobile,l=o.tablet;return s.mobile>=s.tablet?{mobile:i}:{mobile:i,tablet:l}}function a(e){const t=s(e),o={};return t.mobile&&(o["@mobile"]=`@media (width <= ${t.mobile})`),t.tablet&&(o["@tablet"]=t.mobile?`@media (${t.mobile} < width <= ${t.tablet})`:`@media (width <= ${t.tablet})`),o}},3109(e,t,o){o.d(t,{A:()=>r});var n=o(6087),r=(0,n.forwardRef)(({icon:e,size:t=24,style:o,...r},s)=>{const a=e.props.style,i=a||o?{...a,...o}:void 0;return(0,n.cloneElement)(e,{width:t,height:t,...r,...i?{style:i}:{},ref:s})})},2344(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,r.jsx)(n.Path,{d:"M20 12L5 12M10 7L5 12L10 17",vectorEffect:"non-scaling-stroke"})})},135(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M11.53 4.47a.75.75 0 1 0-1.06 1.06l8 8a.75.75 0 1 0 1.06-1.06l-8-8Zm5 1a.75.75 0 1 0-1.06 1.06l2 2a.75.75 0 1 0 1.06-1.06l-2-2Zm-11.06 10a.75.75 0 0 1 1.06 0l2 2a.75.75 0 1 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06Zm.06-5a.75.75 0 0 0-1.06 1.06l8 8a.75.75 0 1 0 1.06-1.06l-8-8Zm-.06-3a.75.75 0 0 1 1.06 0l10 10a.75.75 0 1 1-1.06 1.06l-10-10a.75.75 0 0 1 0-1.06Zm3.06-2a.75.75 0 0 0-1.06 1.06l10 10a.75.75 0 1 0 1.06-1.06l-10-10Z"})})},8929(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{d:"M13.75 4.194a8 8 0 0 0-4.812.415l-.301.132a8 8 0 0 0-3.203 2.692L4 6.001v4h4L6.517 8.516q.333-.526.758-.977l.011-.012q.341-.359.733-.662l.025-.02a6.5 6.5 0 0 1 2.469-1.172l.034-.008q.117-.027.236-.05l.015-.002q.32-.06.65-.088.08-.008.16-.013a7 7 0 0 1 .323-.01L12 5.5h.05l.203.005.101.003q.146.008.293.023l.12.014.158.02q.103.015.205.033l.058.011q.107.02.212.043l.068.016a6.5 6.5 0 0 1 1.447.521l.02.01a7 7 0 0 1 .452.25l.02.014a7 7 0 0 1 .468.317l.07.054a7 7 0 0 1 .403.334l.034.03q.091.084.18.172l.047.045q.293.294.548.627l.03.038.07.097.096.135q.037.053.072.107a6 6 0 0 1 .167.265l.042.073q.236.411.413.857l.027.07a6.5 6.5 0 0 1 .418 2.014 6.6 6.6 0 0 1-.034 1.04 6 6 0 0 1-.063.424q-.109.597-.32 1.152-.016.034-.028.07a6.5 6.5 0 0 1-.413.856l-.042.073a6 6 0 0 1-.327.497l-.087.118-.02.028a7 7 0 0 1-.526.604l-.035.035-.035.032q-.089.088-.18.172l-.034.03a7 7 0 0 1-.38.317l-.093.071q-.09.067-.183.13l-.076.053q-.112.076-.227.146-.218.133-.446.247l-.028.015-.192.093-.081.036a6.5 6.5 0 0 1-1.184.396l-.058.012a7 7 0 0 1-.475.087q-.08.012-.157.02l-.122.014q-.145.015-.292.023l-.136.005-.139.003L12 18.5q-.053-.002-.104-.003l-.127-.004-.162-.007q-.08-.005-.159-.013a7 7 0 0 1-.65-.088q-.008 0-.015-.002a7 7 0 0 1-.236-.05l-.034-.008a6.5 6.5 0 0 1-4.14-3.077l-1.3.75a8 8 0 0 0 3.564 3.26l.301.131a8 8 0 0 0 11.055-7.061l.007-.33c0-1.76-.581-3.473-1.653-4.87l-.206-.256a8 8 0 0 0-4.07-2.6zM12 7.75a.75.75 0 0 0-.75.75V12a.75.75 0 0 0 .218.529l1.282-.839-1.28.84 2.5 2.5a.75.75 0 1 0 1.06-1.06l-2.28-2.28V8.5a.75.75 0 0 0-.75-.75"})})},2478(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})})},8901(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,r.jsx)(n.Path,{d:"M7 12L10 15L17 8",vectorEffect:"non-scaling-stroke"})})},9558(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,r.jsx)(n.Path,{d:"M14 6.5L9 12L14 17.5",vectorEffect:"non-scaling-stroke"})})},8329(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,r.jsx)(n.Path,{d:"M10 6.5L15 12L10 17.5",vectorEffect:"non-scaling-stroke"})})},4532(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.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"})})},1866(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})})},8847(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,r.jsx)(n.Path,{d:"M12 16V11M12 9.5V8M19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12C4.75 7.99594 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12Z",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})})},4361(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsxs)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)(n.Path,{d:"M12 20V4",vectorEffect:"non-scaling-stroke"}),(0,r.jsx)(n.Rect,{x:"4",y:"9",width:"16",height:"6",fill:"currentColor",stroke:"none"})]})},7105(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsxs)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)(n.Path,{d:"M4.75 4V20",vectorEffect:"non-scaling-stroke"}),(0,r.jsx)(n.Rect,{x:"9",y:"9",width:"11",height:"6",fill:"currentColor",stroke:"none"})]})},3172(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsxs)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)(n.Rect,{x:"4",y:"9",width:"11",height:"6",fill:"currentColor",stroke:"none"}),(0,r.jsx)(n.Path,{d:"M19.25 20V4",vectorEffect:"non-scaling-stroke"})]})},7217(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})})},2484(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,r.jsx)(n.Path,{d:"M7 12H17",vectorEffect:"non-scaling-stroke"})})},2141(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsxs)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)(n.Path,{d:"M12 4.75C7.99594 4.75 4.75 7.99593 4.75 12C4.75 16.0041 7.99594 19.25 12 19.25L12 4.75Z",fill:"currentColor",stroke:"none"}),(0,r.jsx)(n.Path,{d:"M12 19.25C16.0041 19.25 19.25 16.0041 19.25 12C19.25 7.99594 16.0041 4.75 12 4.75C7.99594 4.75 4.75 7.99594 4.75 12C4.75 16.0041 7.99594 19.25 12 19.25Z",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})]})},7839(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})})},7480(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{d:"m8.6 7 3.9 10.8h-1.7l-1-2.8H5.7l-1 2.8H3L6.9 7h1.7Zm-2.4 6.6h3L7.7 9.3l-1.5 4.3ZM17.691 8.879c.473 0 .88.055 1.221.165.352.1.643.264.875.495.274.253.456.572.544.957.088.374.132.83.132 1.37v4.554c0 .274.033.472.099.593.077.11.198.166.363.166.11 0 .215-.028.313-.083.11-.055.237-.137.38-.247l.165.28a3.304 3.304 0 0 1-.71.446c-.23.11-.527.165-.89.165-.352 0-.639-.055-.858-.165-.22-.11-.386-.27-.495-.479-.1-.209-.149-.468-.149-.775-.286.462-.627.814-1.023 1.056-.396.242-.858.363-1.386.363-.462 0-.858-.088-1.188-.264a1.752 1.752 0 0 1-.742-.726 2.201 2.201 0 0 1-.248-1.056c0-.484.11-.875.33-1.172.22-.308.5-.556.841-.742.352-.187.721-.341 1.106-.462.396-.132.765-.253 1.106-.363.351-.121.637-.259.857-.413.232-.154.347-.357.347-.61V10.81c0-.396-.066-.71-.198-.941a1.05 1.05 0 0 0-.511-.511 1.763 1.763 0 0 0-.76-.149c-.253 0-.522.039-.808.116a1.165 1.165 0 0 0-.677.412 1.1 1.1 0 0 1 .595.396c.165.187.247.424.247.71 0 .307-.104.55-.313.726-.198.176-.451.263-.76.263-.34 0-.594-.104-.758-.313a1.231 1.231 0 0 1-.248-.759c0-.297.072-.539.214-.726.154-.187.352-.363.595-.528.264-.176.6-.324 1.006-.445.418-.121.88-.182 1.386-.182Zm.99 3.729a1.57 1.57 0 0 1-.528.462c-.231.121-.479.248-.742.38a5.377 5.377 0 0 0-.76.462c-.23.165-.423.38-.577.643-.154.264-.231.6-.231 1.007 0 .429.11.77.33 1.023.22.242.517.363.891.363.308 0 .594-.088.858-.264.275-.176.528-.44.759-.792v-3.284Z"})})},6168(e,t,o){o.d(t,{A:()=>s});var n=o(5573),r=o(790),s=(0,r.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)(n.Path,{d:"M 22 12 C 22 6.49 17.51 2 12 2 C 6.48 2 2 6.49 2 12 C 2 17.52 6.48 22 12 22 C 17.51 22 22 17.52 22 12 M 9.78 17.37 L 6.37 8.22 C 6.92 8.2 7.54 8.14 7.54 8.14 C 8.04 8.08 7.98 7.01 7.48 7.03 C 7.48 7.03 6.03 7.14 5.11 7.14 C 4.93 7.14 4.74 7.14 4.53 7.13 C 6.12 4.69 8.87 3.11 12 3.11 C 14.33 3.11 16.45 3.98 18.05 5.45 C 17.37 5.34 16.4 5.84 16.4 7.03 C 16.4 7.77 16.85 8.39 17.3 9.13 C 17.65 9.74 17.85 10.49 17.85 11.59 C 17.85 13.08 16.45 16.59 16.45 16.59 L 13.42 8.22 C 13.96 8.2 14.24 8.05 14.24 8.05 C 14.74 8 14.68 6.8 14.18 6.83 C 14.18 6.83 12.74 6.95 11.8 6.95 C 10.93 6.95 9.47 6.83 9.47 6.83 C 8.97 6.8 8.91 8.03 9.41 8.05 L 10.33 8.13 L 11.59 11.54 L 9.78 17.37 M 19.41 12 C 19.65 11.36 20.15 10.13 19.84 7.75 C 20.54 9.04 20.89 10.46 20.89 12 C 20.89 15.29 19.16 18.24 16.49 19.78 C 17.46 17.19 18.43 14.58 19.41 12 M 8.1 20.09 C 5.12 18.65 3.11 15.53 3.11 12 C 3.11 10.7 3.34 9.52 3.83 8.41 C 5.25 12.3 6.67 16.2 8.1 20.09 M 12.13 13.46 L 14.71 20.44 C 13.85 20.73 12.95 20.89 12 20.89 C 11.21 20.89 10.43 20.78 9.71 20.56 C 10.52 18.18 11.33 15.82 12.13 13.46 L 12.13 13.46"})})},3022(e,t,o){function n(e){var t,o,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(o=n(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}o.d(t,{A:()=>r});const r=function(){for(var e,t,o=0,r="",s=arguments.length;o<s;o++)(e=arguments[o])&&(t=n(e))&&(r&&(r+=" "),r+=t);return r}},3270(e,t,o){o.d(t,{Mj:()=>L});for(var n={grad:.9,turn:360,rad:360/(2*Math.PI)},r=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},s=function(e,t,o){return void 0===t&&(t=0),void 0===o&&(o=Math.pow(10,t)),Math.round(o*e)/o+0},a=function(e,t,o){return void 0===t&&(t=0),void 0===o&&(o=1),e>o?o:e>t?e:t},i=function(e){return(e=isFinite(e)?e%360:0)<0?e+360:e},l=function(e,t){return void 0===t&&(t=0),s(e,t)%360},c=function(e){return{r:a(e.r,0,255),g:a(e.g,0,255),b:a(e.b,0,255),a:a(e.a)}},d=function(e){return{r:s(e.r),g:s(e.g),b:s(e.b),a:s(e.a,3)}},u=/^#([0-9a-f]{3,8})$/i,p=function(e,t){var o=e.charCodeAt(t);return(15&o)+9*(o>>6)},m=function(e,t){return p(e,t)<<4|p(e,t+1)},g=[],f=0;f<256;f++)g.push((f<16?"0":"")+f.toString(16));var h=function(e){return g[a(e,0,255)]},y=function(e){var t=e.r,o=e.g,n=e.b,r=e.a,s=Math.max(t,o,n),a=s-Math.min(t,o,n),i=a?s===t?(o-n)/a:s===o?2+(n-t)/a:4+(t-o)/a:0;return{h:60*(i<0?i+6:i),s:s?a/s*100:0,v:s/255*100,a:r}},_=function(e){var t=e.h,o=e.s,n=e.v,r=e.a;t=t/360*6,o/=100,n/=100;var s=Math.floor(t),a=n*(1-o),i=n*(1-(t-s)*o),l=n*(1-(1-t+s)*o),c=s%6;return{r:255*[n,i,a,a,l,n][c],g:255*[l,n,n,i,a,a][c],b:255*[a,a,l,n,n,i][c],a:r}},b=function(e){return{h:i(e.h),s:a(e.s,0,100),l:a(e.l,0,100),a:a(e.a)}},x=function(e){return{h:l(e.h),s:s(e.s),l:s(e.l),a:s(e.a,3)}},v=function(e){return _((o=(t=e).s,{h:t.h,s:(o*=((n=t.l)<50?n:100-n)/100)>0?2*o/(n+o)*100:0,v:n+o,a:t.a}));var t,o,n},k=function(e){return{h:(t=y(e)).h,s:(r=(200-(o=t.s))*(n=t.v)/100)>0&&r<200?o*n/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,o,n,r},w=/^hsla?\(\s*([+-]?(?:\d*\.\d+|\d+))(deg|rad|grad|turn)?\s*,\s*([+-]?(?:\d*\.\d+|\d+))%\s*,\s*([+-]?(?:\d*\.\d+|\d+))%\s*(?:,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i,j=/^hsla?\(\s*([+-]?(?:\d*\.\d+|\d+))(deg|rad|grad|turn)?\s+([+-]?(?:\d*\.\d+|\d+))%\s+([+-]?(?:\d*\.\d+|\d+))%\s*(?:\/\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i,S=/^rgba?\(\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*(?:,\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i,E=/^rgba?\(\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s+([+-]?(?:\d*\.\d+|\d+))(%)?\s+([+-]?(?:\d*\.\d+|\d+))(%)?\s*(?:\/\s*([+-]?(?:\d*\.\d+|\d+))(%)?\s*)?\)$/i,C={string:[[function(e){if(!u.test(e))return null;var t=e.length;return t<=5?{r:17*p(e,1),g:17*p(e,2),b:17*p(e,3),a:5===t?s(17*p(e,4)/255,2):1}:7===t||9===t?{r:m(e,1),g:m(e,3),b:m(e,5),a:9===t?s(m(e,7)/255,2):1}:null},"hex"],[function(e){var t=S.exec(e)||E.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:c({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=w.exec(e)||j.exec(e);if(!t)return null;var o,r,s=b({h:(o=t[1],r=t[2],void 0===r&&(r="deg"),Number(o)*(n[r]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return v(s)},"hsl"]],object:[[function(e){var t=e.r,o=e.g,n=e.b,s=e.a,a=void 0===s?1:s;return r(t)&&r(o)&&r(n)?c({r:Number(t),g:Number(o),b:Number(n),a:Number(a)}):null},"rgb"],[function(e){var t=e.h,o=e.s,n=e.l,s=e.a,a=void 0===s?1:s;if(!r(t)||!r(o)||!r(n))return null;var i=b({h:Number(t),s:Number(o),l:Number(n),a:Number(a)});return v(i)},"hsl"],[function(e){var t=e.h,o=e.s,n=e.v,s=e.a,l=void 0===s?1:s;if(!r(t)||!r(o)||!r(n))return null;var c=function(e){return{h:i(e.h),s:a(e.s,0,100),v:a(e.v,0,100),a:a(e.a)}}({h:Number(t),s:Number(o),v:Number(n),a:Number(l)});return _(c)},"hsv"]]},T=function(e,t){for(var o=0;o<t.length;o++){var n=t[o][0](e);if(n)return[n,t[o][1]]}return[null,void 0]},P=function(e){return"string"==typeof e?T(e.trim(),C.string):"object"==typeof e&&null!==e?T(e,C.object):[null,void 0]},N=function(e,t){var o=k(e);return{h:o.h,s:a(o.s+100*t,0,100),l:o.l,a:o.a}},M=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},A=function(e,t){var o=k(e);return{h:o.h,s:o.s,l:a(o.l+100*t,0,100),a:o.a}},B=function(){function e(e){this.parsed=P(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return s(M(this.rgba),2)},e.prototype.isDark=function(){return M(this.rgba)<.5},e.prototype.isLight=function(){return M(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=d(this.rgba)).r,o=e.g,n=e.b,a=(r=e.a)<1?h(s(255*r)):"","#"+h(t)+h(o)+h(n)+a;var e,t,o,n,r,a},e.prototype.toRgb=function(){return d(this.rgba)},e.prototype.toRgbString=function(){return t=(e=d(this.rgba)).r,o=e.g,n=e.b,(r=e.a)<1?"rgba("+t+", "+o+", "+n+", "+r+")":"rgb("+t+", "+o+", "+n+")";var e,t,o,n,r},e.prototype.toHsl=function(){return x(k(this.rgba))},e.prototype.toHslString=function(){return t=(e=x(k(this.rgba))).h,o=e.s,n=e.l,(r=e.a)<1?"hsla("+t+", "+o+"%, "+n+"%, "+r+")":"hsl("+t+", "+o+"%, "+n+"%)";var e,t,o,n,r},e.prototype.toHsv=function(){return e=y(this.rgba),{h:l(e.h),s:s(e.s),v:s(e.v),a:s(e.a,3)};var e},e.prototype.invert=function(){return L({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),L(N(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),L(N(this.rgba,-e))},e.prototype.grayscale=function(){return L(N(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),L(A(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),L(A(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(k(this.rgba).h+e)},e.prototype.alpha=function(e){return"number"==typeof e?L({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):s(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=k(this.rgba);return"number"==typeof e?L({h:e,s:t.s,l:t.l,a:t.a}):l(t.h)},e.prototype.isEqual=function(e){return this.toHex()===L(e).toHex()},e}(),L=function(e){return e instanceof B?e:new B(e)}}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,o),s.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e=o(6125),t=o(390),n=o(1455),r=o.n(n),s=o(4715),a=o(4997),i=o(6427),l=o(3582),c=o(7143),d=o(3656),u=o(6087),p=o(7723),m=o(692),g=o(2279),f=o(3832),h=o(790);const __=p.__,y="/wpcom/v2/email-editor-bootstrap",_=["http:","https:"],b=["POST","PUT","PATCH"],x="core/interface",v="core",k="null/email-styles-sidebar",w="jetpack-email-design",j="email-styles",S=`${w}/${j}`,E="jetpack/email-design",C="core/editor",T="core/preferences";function P(e,t){const{editorSettings:o,urls:n,userEmail:r,globalStylesPostId:s}=t;if(!e?.editor_settings)throw new Error("The email editor bundle is missing editor_settings.");if(!e?.editor_theme)throw new Error("The email editor bundle is missing editor_theme.");if("string"!=typeof n?.back||"string"!=typeof n?.listings)throw new Error("JetpackEmailDesignEditor.urls.back and .listings are required strings.");return Object.entries(n).forEach(([e,t])=>function(e,t){if("string"!=typeof e)throw new Error(`JetpackEmailDesignEditor.urls.${t} must be a string.`);let o;try{o=new URL(e,window.location.href)}catch{throw new Error(`JetpackEmailDesignEditor.urls.${t} is not a valid URL.`)}if(!_.includes(o.protocol))throw new Error(`JetpackEmailDesignEditor.urls.${t} must be an http or https URL.`)}(t,e)),{editorSettings:N({...e.editor_settings,...o,isFullScreenForced:!0},e),theme:e.editor_theme,urls:n,userEmail:r,globalStylesPostId:M(e)??s??null}}function N(e,t){return!1!==t?.shows_featured_image?e:{...e,styles:[...Array.isArray(e.styles)?e.styles:[],{css:".wp-block-post-featured-image { display: none; }"}]}}function M(e){const t=e?.global_styles?.post_id;return Number.isInteger(t)&&t>0?t:null}function A(e){return e&&"object"==typeof e&&!Array.isArray(e)?e:{}}function B(e){const t=e?.global_styles,o=M(e);if(!o||!t?.record)return{};const n=t.can_edit?"GET, POST, PUT":"GET",r={body:{...t.record,styles:A(t.record.styles),settings:A(t.record.settings)},headers:{Allow:n}};return{[`/wp/v2/global-styles/${o}`]:r,[`/wp/v2/global-styles/${o}?context=view`]:r,[`/wp/v2/global-styles/${o}?context=edit`]:r,OPTIONS:{[`/wp/v2/global-styles/${o}`]:{body:{},headers:{Allow:n}}}}}function L(e,t){const o=e?.templates;if(!Array.isArray(o)||0===o.length)return{};const n={body:o,headers:{"X-WP-Total":String(o.length),"X-WP-TotalPages":"1"}},r={"/wp/v2/templates":n,"/wp/v2/templates?context=edit":n,"/wp/v2/templates?context=view":n},s=o.find(e=>e?.id===t);if(s){const e={body:s,headers:{Allow:"GET"}};r[`/wp/v2/templates/${t}`]=e,r[`/wp/v2/templates/${t}?context=edit`]=e}return r}function I(){(0,c.dispatch)(x)?.enableComplementaryArea(v,k)}function $(e){return!!e?.global_styles?.can_edit}function R(t=10){const o=document.getElementById(e.Q);if(o)return o.tabIndex=-1,void o.focus();t>0&&window.requestAnimationFrame(()=>R(t-1))}function z(){I(),R()}const F=()=>window.location.reload();function H(e){return null!=e&&("object"!=typeof e||Object.values(e).some(H))}function O({id:e}){const[t,o]=(0,u.useState)(!1),[n,r]=(0,u.useState)(!1),s=(0,c.useSelect)(t=>{return o=t(l.store).getEditedEntityRecord("root","globalStyles",e),H(o?.styles)||H(o?.settings);var o},[e]),a=(0,u.useCallback)(()=>o(!0),[]),d=(0,u.useCallback)(()=>o(!1),[]),p=(0,u.useCallback)(async()=>{o(!1),r(!0);try{await async function(e){(0,c.dispatch)(l.store).editEntityRecord("root","globalStyles",e,{styles:{},settings:{}}),await(0,c.dispatch)(l.store).saveEditedEntityRecord("root","globalStyles",e,{throwOnError:!0})}(e),F()}catch(e){console.error("Jetpack email design reset:",e),(0,c.dispatch)(m.store).createNotice("error",__("Your email design could not be reset. Please try again.","jetpack"),{type:"snackbar",isDismissible:!0}),r(!1)}},[e]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(i.Button,{variant:"secondary",disabled:!s||n,accessibleWhenDisabled:!0,isBusy:n,onClick:a,children:__("Reset to defaults","jetpack")}),(0,h.jsx)(i.__experimentalConfirmDialog,{title:__("Reset email design","jetpack"),isOpen:t,onCancel:d,onConfirm:p,confirmButtonText:__("Reset","jetpack"),size:"medium",children:__("Are you sure you want to reset your email design? It will go back to the one based on your site, and the changes you made will be lost.","jetpack")})]})}function V({id:e}){return(0,h.jsx)(d.PluginDocumentSettingPanel,{name:j,title:__("Email styles","jetpack"),children:(0,h.jsxs)(i.__experimentalVStack,{alignment:"left",children:[(0,h.jsx)(i.Button,{variant:"secondary",onClick:z,children:__("Edit email styles","jetpack")}),!!e&&(0,h.jsx)(O,{id:e})]})})}class D extends Error{constructor(e){super(e),this.name="TestSendError",this.error=e}}function G(e){return async(t,o)=>{const n="string"==typeof t.path?t.path.split("?")[0]:"",s=(t.method||"GET").toUpperCase();if("/woocommerce-email-editor/v1/send_preview_email"!==n||"POST"!==s)return o(t);try{await async function(e){e&&(0,c.select)(l.store).hasEditsForEntityRecord("root","globalStyles",e)&&await(0,c.dispatch)(l.store).saveEditedEntityRecord("root","globalStyles",e,{throwOnError:!0})}(e);const o=await async function(){const e=await r()({path:(0,f.addQueryArgs)("/wp/v2/posts",{status:"publish",per_page:1,orderby:"date",order:"desc",_fields:"id"})});return Array.isArray(e)&&e[0]?.id?e[0].id:null}();if(!o)throw new D(__("Publish a post first — test emails are sent using your most recent post.","jetpack"));return await r()({path:"/wpcom/v2/send-email-preview",method:"POST",data:{id:o,email:t.data?.email}})}catch(e){if(e instanceof D)throw e;throw new D(e?.message??__("Your test email could not be sent.","jetpack"))}}}function W(){return(0,h.jsx)(i.Notice,{status:"error",isDismissible:!1,children:__("The email design editor could not be loaded. Please reload the page to try again.","jetpack")})}async function q(){const e=window.JetpackEmailDesignEditor;if(!e||"object"!=typeof e)return;const o=document.getElementById(e.elementId);if(!o)return;const n=(0,u.createRoot)(o);let d=null;try{const o=await r()({path:e.templateSlug?(0,f.addQueryArgs)(y,{template_slug:e.templateSlug}):y}),p=P(o,e);!function(e){(Array.isArray(e?.blocks)?e.blocks:[]).forEach(e=>{if(!e?.name||(0,a.getBlockType)(e.name))return;const t="string"==typeof e.title&&e.title?e.title:e.name,o="string"==typeof e.preview_html&&e.preview_html?e.preview_html:"";(0,a.registerBlockType)(e.name,{apiVersion:3,title:t,description:e.description||"",category:e.category||"design",attributes:e.attributes||{},supports:{...e.supports||{},html:!1,inserter:!1},edit:()=>(0,h.jsx)("div",{...(0,s.useBlockProps)(),children:o?(0,h.jsx)(i.Disabled,{children:(0,h.jsx)(u.RawHTML,{children:o})}):t}),save:()=>null})})}(o),function(){const e=(0,c.dispatch)("core/block-editor");e&&(e.__unstableMarkNextChangeAsNotPersistent(),e.setBlockEditingMode("","disabled"))}(),function(e){!1===e?.renders_through_email_editor&&(0,c.dispatch)(m.store).createNotice("warning",__("Email design is not active on this site, so changes saved here will not affect the emails your subscribers receive.","jetpack"),{context:"email-editor",type:"default",isDismissible:!1})}(o),$(o)&&(function(e=null){(0,g.registerPlugin)(w,{scope:"woocommerce-email-editor",render:()=>(0,h.jsx)(V,{id:e})})}(p.globalStylesPostId),function(){const e=(0,c.dispatch)(T),t=(0,c.select)(T),o=(0,c.dispatch)(C),n=(0,c.select)(C);e&&t&&o&&n&&(t.get(E,"expandedStylesPanel")||(e.set(E,"expandedStylesPanel",!0),n.isEditorPanelOpened(S)||o.toggleEditorPanelOpened(S)))}());const _=function(e){const t=e?.template?.id;if("string"!=typeof t||""===t)throw new Error("The email editor bundle is missing its template id.");return t}(o),j=function(e,t){const o={...L(e,t),...B(e)};return Object.keys(o).length>0?o:null}(o,_);p.globalStylesPostId&&r().use(function(e){const t=`/wp/v2/global-styles/${e}`;return async(o,n)=>{const s="string"==typeof o.path?o.path.split("?")[0]:"",a=(o.method||"GET").toUpperCase();if(t!==s||!b.includes(a))return n(o);const i=(0,c.select)(l.store).getEditedEntityRecord("root","globalStyles",e);if(!i)throw new Error("Email design save found no global styles record to read.");const d={styles:i.styles??{},settings:i.settings??{}},u=await r()({path:y,method:"POST",data:{design:d}}),p=u?.design??{};return u?.discarded&&(0,c.dispatch)(m.store).createNotice("error",__("Those changes could not be saved to your email design.","jetpack"),{type:"snackbar",isDismissible:!0}),{id:e,settings:A(p.settings),styles:A(p.styles)}}}(p.globalStylesPostId)),r().use(G(p.globalStylesPostId)),j&&r().use(r().createPreloadingMiddleware(j)),$(o)&&(d=function(){const e=(0,c.select)(x);if(!e)return()=>{};const t=(0,c.subscribe)(()=>{const t=e.getActiveComplementaryArea(v);void 0!==t&&(null===t?o():k!==t&&I())});function o(){t(),window.removeEventListener("pointerdown",o,!0),window.removeEventListener("keydown",o,!0)}return window.addEventListener("pointerdown",o,!0),window.addEventListener("keydown",o,!0),o}()),n.render((0,h.jsx)(u.StrictMode,{children:(0,h.jsx)(t.w,{postId:_,postType:"wp_template",config:p})}))}catch(e){d?.(),console.error("Jetpack email design editor:",e),n.render((0,h.jsx)(W,{}))}}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",q,{once:!0}):q()})()})();