This commit is contained in:
zbatte committed 2026-07-02 15:54:39 -06:00
commit 9883323161
17470 files changed
+4470592

No files matched your search

File diff suppressed because it is too large. Load diff
@@ -0,0 +1 @@
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-private-apis', 'wp-style-engine'), 'version' => '30ab62f45bfe9f971ea0');
@@ -0,0 +1,37 @@
var We=Object.create;var Tt=Object.defineProperty;var De=Object.getOwnPropertyDescriptor;var Ke=Object.getOwnPropertyNames;var He=Object.getPrototypeOf,Xe=Object.prototype.hasOwnProperty;var P=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ye=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ke(e))!Xe.call(t,n)&&n!==o&&Tt(t,n,{get:()=>e[n],enumerable:!(r=De(e,n))||r.enumerable});return t};var h=(t,e,o)=>(o=t!=null?We(He(t)):{},Ye(e||!t||!t.__esModule?Tt(o,"default",{value:t,enumerable:!0}):o,t));var pt=P((Bo,Ct)=>{Ct.exports=window.wp.editor});var U=P((No,Vt)=>{Vt.exports=window.wp.coreData});var G=P((Wo,zt)=>{zt.exports=window.wp.data});var Lt=P((Do,Mt)=>{Mt.exports=window.wp.components});var B=P((Ko,Gt)=>{Gt.exports=window.wp.element});var dt=P((Jo,Wt)=>{Wt.exports=window.wp.styleEngine});var Jt=P((nr,Zt)=>{Zt.exports=window.wp.i18n});var ht=P((sr,qt)=>{qt.exports=window.wp.blocks});var $e=P((Fr,xe)=>{xe.exports=window.wp.privateApis});var It=P((Br,Re)=>{Re.exports=window.ReactJSXRuntime});var Me=P((Xr,ze)=>{ze.exports=window.wp.blockEditor});var Te=h(pt(),1),Pt=h(U(),1),jt=h(G(),1),Ce=h(Lt(),1),Ve=h(B(),1);var Ut=h(U(),1),Bt=h(G(),1);function ot({templateId:t}={}){let{globalStylesId:e,stylesId:o}=(0,Bt.useSelect)(r=>{let n=r(Ut.store),s=t?n.getEntityRecord("postType","wp_template",t):null;return{globalStylesId:n.__experimentalGetCurrentGlobalStylesId(),stylesId:s?.styles_id}},[t]);return o||e}function rt(t,e,o){e=Array.isArray(e)?[...e]:[e],t=Array.isArray(t)?[...t]:{...t};let r=e.pop(),n=t;for(let s of e){let i=n[s];n=n[s]=Array.isArray(i)?[...i]:{...i}}return n[r]=o,t}var S=(t,e,o)=>{let r=Array.isArray(e)?e:e.split("."),n=t;return r.forEach(s=>{n=n?.[s]}),n??o};var Ze=["appearanceTools","useRootPaddingAwareAlignments","background.backgroundImage","background.backgroundRepeat","background.backgroundSize","background.backgroundPosition","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.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"];function Nt(t,e,o){let r=o?".blocks."+o:"",n=e?"."+e:"",s=`settings${r}${n}`,i=`settings${n}`;if(e)return S(t,s)??S(t,i);let a={};return Ze.forEach(l=>{let c=S(t,`settings${r}.${l}`)??S(t,`settings.${l}`);c!==void 0&&(a=rt(a,l.split("."),c))}),a}var Kt=h(dt(),1);var Je="1600px",qe="320px",Qe=1,to=.25,eo=.75,oo="14px";function Dt({minimumFontSize:t,maximumFontSize:e,fontSize:o,minimumViewportWidth:r=qe,maximumViewportWidth:n=Je,scaleFactor:s=Qe,minimumFontSizeLimit:i}){if(i=R(i)?i:oo,o){let b=R(o);if(!b?.unit||!b?.value)return null;let E=R(i,{coerceTo:b.unit});if(E?.value&&!t&&!e&&b?.value<=E?.value)return null;if(e||(e=`${b.value}${b.unit}`),!t){let M=b.unit==="px"?b.value:b.value*16,ut=Math.min(Math.max(1-.075*Math.log2(M),to),eo),D=H(b.value*ut,3);E?.value&&D<E?.value?t=`${E.value}${E.unit}`:t=`${D}${b.unit}`}}let a=R(t),l=a?.unit||"rem",c=R(e,{coerceTo:l});if(!a||!c)return null;let d=R(t,{coerceTo:"rem"}),f=R(n,{coerceTo:l}),p=R(r,{coerceTo:l});if(!f||!p||!d)return null;let g=f.value-p.value;if(!g)return null;let u=H(p.value/100,3),m=H(u,3)+l,v=100*((c.value-a.value)/g),y=H((v||1)*s,3),O=`${d.value}${d.unit} + ((1vw - ${m}) * ${y})`;return`clamp(${t}, ${O}, ${e})`}function R(t,e={}){if(typeof t!="string"&&typeof t!="number")return null;isFinite(t)&&(t=`${t}px`);let{coerceTo:o,rootSizeValue:r,acceptableUnits:n}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...e},s=n?.join("|"),i=new RegExp(`^(\\d*\\.?\\d+)(${s}){1,1}$`),a=t.toString().match(i);if(!a||a.length<3)return null;let[,l,c]=a,d=parseFloat(l);return o==="px"&&(c==="em"||c==="rem")&&(d=d*r,c=o),c==="px"&&(o==="em"||o==="rem")&&(d=d/r,c=o),(o==="em"||o==="rem")&&(c==="em"||c==="rem")&&(c=o),c?{value:H(d,3),unit:c}:null}function H(t,e=3){let o=Math.pow(10,e);return Math.round(t*o)/o}function gt(t){let e=t?.fluid;return e===!0||e&&typeof e=="object"&&ObjecLine truncated
<svg
xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 0 0"
width="0"
height="0"
focusable="false"
role="none"
aria-hidden="true"
style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;"
>
<defs>
<filter id="${t}">
<!--
Use sRGB instead of linearRGB so transparency looks correct.
Use perceptual brightness to convert to grayscale.
-->
<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>
<!-- Use sRGB instead of linearRGB to be consistent with how CSS gradients work. -->
<feComponentTransfer color-interpolation-filters="sRGB">
<feFuncR type="table" tableValues="${o.r.join(" ")}"></feFuncR>
<feFuncG type="table" tableValues="${o.g.join(" ")}"></feFuncG>
<feFuncB type="table" tableValues="${o.b.join(" ")}"></feFuncB>
<feFuncA type="table" tableValues="${o.a.join(" ")}"></feFuncA>
</feComponentTransfer>
<!-- Re-mask the image with the original transparency since the feColorMatrix above loses that information. -->
<feComposite in2="SourceGraphic" operator="in"></feComposite>
</filter>
</defs>
</svg>`}function V(t){return t.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()}function vt(t){if(!t)return;let e=t.match(/var:preset\|spacing\|(.+)/);return e?`var(--wp--preset--spacing--${e[1]})`:t}function mo(t){if(!t)return null;let e=typeof t=="string";return{top:e?t:t?.top,left:e?t:t?.left}}function wt(t,e="0"){let o=mo(t);if(!o)return null;let r=vt(o?.top)||e,n=vt(o?.left)||e;return r===n?r:`${r} ${n}`}var fe={backgroundSize:"cover",backgroundPosition:"50% 50%"};function pe(t){if(!t||!t?.backgroundImage?.url)return;let e;return t?.backgroundSize||(e={backgroundSize:fe.backgroundSize}),t?.backgroundSize==="contain"&&!t?.backgroundPosition&&(e={backgroundPosition:fe.backgroundPosition}),e}var de={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}}]}};var ho={button:"wp-element-button",caption:"wp-element-caption"},yo={__experimentalBorder:"border",color:"color",dimensions:"dimensions",spacing:"spacing",typography:"typography"};function bo(t={},e){return Y.reduce((o,{path:r,valueKey:n,valueFunc:s,cssVarInfix:i})=>{let a=S(t,r,[]);return["default","theme","custom"].forEach(l=>{a[l]&&a[l].forEach(c=>{n&&!s?o.push(`--wp--preset--${i}--${V(c.slug)}: ${c[n]}`):s&&typeof s=="function"&&o.push(`--wp--preset--${i}--${V(c.slug)}: ${s(c,e)}`)})}),o},[])}function So(t="*",e={}){return Y.reduce((o,{path:r,cssVarInfix:n,classes:s})=>{if(!s)return o;let i=S(e,r,[]);return["default","theme","custom"].forEach(a=>{i[a]&&i[a].forEach(({slug:l})=>{s.forEach(({classSuffix:c,propertyName:d})=>{let f=`.has-${V(l)}-${c}`,p=t.split(",").map(u=>`${u}${f}`).join(","),g=`var(--wp--preset--${n}--${V(l)})`;o+=`${p}{${d}: ${g} !important;}`})})}),o},"")}function vo(t={}){return Y.filter(e=>e.path.at(-1)==="duotone").flatMap(e=>{let o=S(t,e.path,{});return["default","theme"].filter(r=>o[r]).flatMap(r=>o[r].map(n=>ue(`wp-duotone-${n.slug}`,n.colors))).join("")})}function be(t={},e,o){let r=[];return Object.keys(t).forEach(n=>{let s=e+V(n.replace("/","-")),i=t[n];if(i instanceof Object){let a=s+o;r=[...r,...be(i,a,o)]}else r.push(`${s}: ${i}`)}),r}function wo(t,e){let o=t.split(","),r=[];return o.forEach(n=>{r.push(`${e.trim()}${n.trim()}`)}),r.join(", ")}var ge=(t,e,o)=>{if(o!=="core/paragraph"||(e?.blocks?.["core/paragraph"]?.typography?.textIndent??e?.typography?.textIndent??"subsequent")!=="all")return t;let s=".wp-block-paragraph + .wp-block-paragraph",i=".wp-block-paragraph";if(s in t){let a=t[s],l={...t};return delete l[s],l[i]=a,l}return t},me=(t,e)=>{let o={};return Object.entries(t).forEach(([r,n])=>{if(r==="root"||!e?.[r])return;let s=typeof n=="string";if(!s&&typeof n=="object"&&n!==null&&Object.entries(n).forEach(([i,a])=>{if(i==="root"||!e?.[r][i])return;let l={[r]:{[i]:e[r][i]}},c=W(l);o[a]=[...o[a]||[],...c],delete e[r][i]}),s||typeof n=="object"&&n!==null&&"root"in n){let i=s?n:n.root,a={[r]:e[r]},l=W(a);o[i]=[...o[i]||[],...l],delete e[r]}}),o};function W(t={},e="",o,r={},n=!1){let s=T===e,i=Object.entries(x.__EXPERIMENTAL_STYLE_PROPERTY).reduce((l,[c,{value:d,properties:f,useEngine:p,Line truncated
.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }
.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }
.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) { padding-right: 0; padding-left: 0; }
.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) > .alignfull { margin-left: 0; margin-right: 0;
`),u+="}"),a.blockStyles&&l.forEach(({selector:m,duotoneSelector:v,styles:y,fallbackGapValue:O,hasLayoutSupport:b,featureSelectors:E,styleVariationSelectors:M,skipSelectorWrapper:ut,name:D})=>{if(E){let $=me(E,y);$=ge($,t.settings,D),Object.entries($).forEach(([k,_])=>{if(_.length){let K=_.join(";");u+=`:root :where(${k}){${K};}`}})}if(v){let $={};y?.filter&&($.filter=y.filter,delete y.filter);let k=W($);k.length&&(u+=`${v}{${k.join(";")};}`)}!n&&(T===m||b)&&(u+=he({style:y,selector:m,hasBlockGapSupport:o,hasFallbackGapSupport:r,fallbackGapValue:O}));let At=W(y,m,d,t,s);if(At?.length){let $=ut?m:`:root :where(${m})`;u+=`${$}{${At.join(";")};}`}y?.css&&(u+=Et(y.css,`:root :where(${m})`)),a.variationStyles&&M&&Object.entries(M).forEach(([$,k])=>{let _=y?.variations?.[$];if(_){if(E){let L=me(E,_);L=ge(L,t.settings,D),Object.entries(L).forEach(([ft,Rt])=>{if(Rt.length){let Be=wo(ft,k),Ne=Rt.join(";");u+=`:root :where(${Be}){${Ne};}`}})}let K=W(_,k,d,t);if(K.length&&(u+=`:root :where(${k}){${K.join(";")};}`),_?.css&&(u+=Et(_.css,`:root :where(${k})`)),b&&_?.spacing?.blockGap){let L=k+m;u+=he({style:_,selector:L,hasBlockGapSupport:!0,hasFallbackGapSupport:r,fallbackGapValue:O})}}});let Ft=Object.entries(y).filter(([$])=>$.startsWith(":"));Ft?.length&&Ft.forEach(([$,k])=>{let _=W(k);if(!_?.length)return;let L=`:root :where(${m.split(",").map(ft=>ft+$).join(",")}){${_.join(";")};}`;u+=L})}),a.layoutStyles&&(u=u+".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",u=u+".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",u=u+".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }"),a.blockGap&&o){let m=wt(t?.styles?.spacing?.blockGap)||"0.5em";u=u+`:root :where(.wp-site-blocks) > * { margin-block-start: ${m}; margin-block-end: 0; }`,u=u+":root :where(.wp-site-blocks) > :first-child { margin-block-start: 0; }",u=u+":root :where(.wp-site-blocks) > :last-child { margin-block-end: 0; }"}return a.presets&&c.forEach(({selector:m,presets:v})=>{(T===m||X===m)&&(m="");let y=So(m,v);y.length>0&&(u+=y)}),u};function Oo(t,e){return xt(t,e).flatMap(({presets:r})=>vo(r))}var ko=(t,e)=>{if(t?.selectors&&Object.keys(t.selectors).length>0)return t.selectors;let o={root:e};return Object.entries(yo).forEach(([r,n])=>{let s=N(t,r);s&&(o[n]=s)}),o},Io=(t,e)=>{let{getBlockStyles:o}=(0,ye.select)(x.store),r={};return t.forEach(n=>{let s=n.name,i=N(n);if(!i)return;let a=N(n,"filter.duotone");if(!a){let g=N(n),u=(0,x.getBlockSupport)(n,"color.__experimentalDuotone",!1);a=u&&g&&j(g,u)}let l=!!n?.supports?.layout||!!n?.supports?.__experimentalLayout,c=n?.supports?.spacing?.blockGap?.__experimentalDefault,d=o(s),f={};d?.forEach(g=>{let u=e?`-${e}`:"",m=`${g.name}${u}`,v=Yt(m,i);f[m]=v});let p=ko(n,i);r[s]={duotoneSelector:a??void 0,fallbackGapValue:c,featureSelectors:Object.keys(p).length?p:void 0,hasLayoutSupport:l,name:s,selector:i,styleVariationSelectors:d?.length?f:void 0}}),r};function Po(t){let e=t.styles?.blocks,o=e?.["core/separator"];return o&&o.color?.background&&!o.color?.text&&!o.border?.color?{...t,styles:{...t.styles,blocks:{...e,"core/separator":{...o,color:{...o.color,text:o.color?.background}}}}}:t}function Et(t,e){let o="";return!t||t.trim()===""||t.split("&").forEach(n=>{if(!n||n.trim()==="")return;if(!n.includes("{"))o+=`:root :where(${e}){${n.trim()}}`;else{let i=n.replace("}","").split("{");if(i.length!==2)return;let[a,l]=i,c=a.match(/([>+~\s]*::[a-zA-Z-]+)/),d=c?c[1]:"",f=c?a.replace(d,"").trim():a.trim(),p;f===""?p=e:p=a.startsWith(" ")?j(e,f):Xt(e,f),o+=`:root :where(${p})${d}{${l.trim()}}`}}),o}function $t(t={},e=[],o={}){let{hasBlockGapSupport:r,hasFallbackGapSupport:n,disableLayoutStyles:s=!1,disableRootPadding:i=!1,styleOptions:a={}}=o,l=e.length>0?e:(0,x.getBlockTypes)(),c=Nt(t,"spacing.blockGap"),d=r??c!==null,f=n??!d;if(!t?.styles||!t?.settings)return[[],{}];let p=Po(t),g=Io(l),u=$o(p,g),m=_o(p,g,d,f,s,i,a),v=Oo(p,g),y=[{css:u,isGlobalStyles:!0},{css:m,isGlobalStyles:!0},{css:p?.styles?.css??"",isGlobalStyles:!0},{assets:v,__unstableType:"svg",isGlobalStyles:!0}];return l.forEach(O=>{let b=p?.styles?.blocks?.[O.name];if(b?.css){let E=g[O.name].selector;y.push({css:Et(b.css,E),isGlobalStyles:!0})}}),[y,p.settings]}var Oe=h(U(),1),_t=h(B(),1),ke=h(G(),1);var Se=h(U(),1),ve=h(G(),1),we=h(B(),1);function Ee(t){let{userGlobalStyles:e}=(0,ve.useSelect)(o=>{let{getEntityRecord:r,getEditedEntityRecord:n,canUser:s}=o(Se.store),i=s("update",{kind:"root",name:"globalStyles",id:t}),a;return typeof i=="boolean"&&(i?a=n("root","globalStyles",t):a=r("root","globalStyles",t,{context:"view"})),{userGlobalStyles:a}},[t]);return(0,we.useMemo)(()=>e?{user:e}:{user:void 0},[e])}var _e=h($e(),1),{unlock:F}=(0,_e.__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/lazy-editor");function at({stylesId:t}){let{editorSettings:e Line truncated
`):typeof e=="string"&&(r=e),r&&r.trim()){let n=t+"-"+o+"-inline-css";if(!document.getElementById(n)){let s=document.createElement("style");s.id=n,s.textContent=r.trim(),document.head.appendChild(s)}}}function Pe(t,e,o){let r=e;Array.isArray(r)&&(r=r.join(`
`));let n=document.createElement("script");return n.id=t+"-"+o+"-js",n.textContent=r.trim(),n}function je(t){let e=new Set,o=new Set,r=[];function n(s){if(!e.has(s)){if(o.has(s)){console.warn(`Circular dependency detected for handle: ${s}`);return}o.add(s),t[s]&&(t[s].deps||[]).forEach(a=>{t[a]&&n(a)}),o.delete(s),e.add(s),t[s]&&r.push(s)}}return Object.keys(t).forEach(s=>{n(s)}),r}async function Ro(t,e){let o=[];for(let r of t){if(r.src){let n=Promise.withResolvers();r.onload=()=>n.resolve(),r.onerror=()=>{console.error(`Failed to load script: ${r.id}`),n.resolve()},o.push(n.promise)}else await Promise.all(o),o=[];e.appendChild(r)}await Promise.all(o),o=[]}async function To(t,e,o,r,n,s){s&&jo(s);let i=je(o),a=je(t),l=[];for(let f of i){let p=r.before?.[f];p&&Ie(f,p,"before"),l.push(Ao(f,o[f]));let g=r.after?.[f];g&&Ie(f,g,"after")}let c=[];for(let f of a){let p=e.before?.[f];p&&c.push(Pe(f,p,"before")),c.push(Fo(f,t[f]));let g=e.after?.[f];g&&c.push(Pe(f,g,"after"))}let d=Ro(c,document.body);await Promise.all([Promise.all(l),d]),n&&n.length>0&&n.forEach(f=>{let p=f.match(/<script([^>]*)>(.*?)<\/script>/is);if(p){let g=p[1],u=p[2],m=document.createElement("script"),v=g.match(/id=["']([^"']+)["']/);v&&(m.id=v[1]);let y=g.match(/type=["']([^"']+)["']/);y&&(m.type=y[1]),m.textContent=u,document.body.appendChild(m)}})}var Ae=To;var kt=h(U(),1),lt=h(B(),1),ct=h(G(),1);var Ot;async function Fe(){return Ot||(Ot=(async()=>{let e=await F((0,ct.resolveSelect)(kt.store)).getEditorAssets();await Ae(e.scripts||{},e.inline_scripts||{before:{},after:{}},e.styles||{},e.inline_styles||{before:{},after:{}},e.html_templates||[],e.script_modules||{})})()),Ot}function q(){let t=(0,ct.useSelect)(r=>F(r(kt.store)).getEditorAssets(),[]),[e,o]=(0,lt.useState)(!1);return(0,lt.useEffect)(()=>{t&&!e&&Fe().then(()=>{o(!0)}).catch(r=>{console.error("Failed to load editor assets:",r)})},[t,e]),{isReady:!!t&&e,assetsLoaded:e}}var Q=h(It(),1),{Editor:Co,BackButton:Vo}=F(Te.privateApis);function zo({postType:t,postId:e,settings:o,backButton:r}){let n=(0,jt.useSelect)(g=>{if(t||e)return null;let{getHomePage:u}=F(g(Pt.store));return u()},[t,e]),s=t||n?.postType,i=e||n?.postId,a=(0,jt.useSelect)(g=>{if(!(!s||!i))return s==="wp_template"?i:F(g(Pt.store)).getTemplateId(s,i)},[s,i]),l=ot({templateId:a}),{isReady:c,editorSettings:d}=at({stylesId:l}),{isReady:f}=q(),p=(0,Ve.useMemo)(()=>({...d,...o}),[d,o]);return!c||!f?(0,Q.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:(0,Q.jsx)(Ce.Spinner,{})}):(0,Q.jsx)(Co,{postType:s,postId:i,templateId:a,settings:p,styles:p.styles,children:r&&(0,Q.jsx)(Vo,{children:r})})}var Le=h(Jt(),1),et=h(B(),1),tt=h(Me(),1),Ge=h(pt(),1),Ue=h(ht(),1);var z=h(It(),1);if(typeof document<"u"&&!document.head.querySelector("style[data-wp-hash='5619aa31a1']")){let t=document.createElement("style");t.setAttribute("data-wp-hash","5619aa31a1"),t.appendChild(document.createTextNode(".lazy-editor-block-preview__container{align-items:center;border-radius:4px;display:flex;flex-direction:column;height:100%;justify-content:center}.dataviews-view-grid .lazy-editor-block-preview__container .block-editor-block-preview__container{height:100%}.dataviews-view-table .lazy-editor-block-preview__container{text-wrap:balance;text-wrap:pretty;flex-grow:0;width:96px}")),document.head.appendChild(t)}var{useStyle:Mo}=F(Ge.privateApis);function Lo({blocks:t,content:e,description:o}){let r=(0,et.useId)(),n=Mo("color.background"),s=(0,et.useMemo)(()=>t??(0,Ue.parse)(e,{__unstableSkipMigrationLogs:!0}),[e,t]),i=!s?.length;return(0,z.jsxs)("div",{className:"lazy-editor-block-preview__container",style:{backgroundColor:n},"aria-describedby":o?r:void 0,children:[i&&(0,Le.__)("Empty."),!i&&(0,z.jsx)(tt.BlockPreview.Async,{children:(0,z.jsx)(tt.BlockPreview,{blocks:s})}),!!o&&(0,z.jsx)("div",{hidden:!0,id:r,children:o})]})}function Go({blocks:t,content:e,description:o}){let r=ot(),{isReady:n,editorSettings:s}=at({stylesId:r}),{isReady:i}=q(),a=(0,et.useMemo)(()=>({...s,isPreviewMode:!0}),[s]);return!n||!i?null:(0,z.jsx)(tt.BlockEditorProvider,{settings:a,children:(0,z.jsx)(Lo,{blocks:t,content:e,description:o})})}export{zo as Editor,Go as Preview,Fe as loadEditorAssets,q as useEditorAssets};