(()=>{"use strict";vare={d:(t,n)=>{for(varrinn)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeofSymbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{privateApis:()=>X,store:()=>C});varn={};e.r(n),e.d(n,{convertSyncedPatternToStatic:()=>y,createPattern:()=>m,createPatternFromFile:()=>g,setEditingPattern:()=>h});varr={};e.r(r),e.d(r,{isEditingPattern:()=>f});consta=window.wp.data;consts=(0,a.combineReducers)({isEditingPattern:function(e={},t){return"SET_EDITING_PATTERN"===t?.type?{...e,[t.clientId]:t.isEditing}:e}}),o=window.wp.blocks,i=window.wp.coreData,c=window.wp.blockEditor,l={theme:"pattern",user:"wp_block"},u="all-patterns",d={full:"fully",unsynced:"unsynced"},p={"core/paragraph":["content"],"core/heading":["content"],"core/button":["text","url","linkTarget","rel"],"core/image":["id","url","title","alt"]},_="core/pattern-overrides",m=(e,t,n,r)=>async({registry:a})=>{consts=t===d.unsynced?{wp_pattern_sync_status:t}:void0,o={title:e,content:n,status:"publish",meta:s,wp_pattern_category:r};returnawaita.dispatch(i.store).saveEntityRecord("postType","wp_block",o)},g=(e,t)=>async({dispatch:n})=>{constr=awaite.text();leta;try{a=JSON.parse(r)}catch(e){thrownewError("Invalid JSON file")}if("wp_block"!==a.__file||!a.title||!a.content||"string"!=typeofa.title||"string"!=typeofa.content||a.syncStatus&&"string"!=typeofa.syncStatus)thrownewError("Invalid pattern JSON file");returnawaitn.createPattern(a.title,a.syncStatus,a.content,t)},y=e=>({registry:t})=>{constn=t.select(c.store).getBlock(e),r=n.attributes?.content;consta=t.select(c.store).getBlocks(n.clientId);t.dispatch(c.store).replaceBlocks(n.clientId,functione(t){returnt.map((t=>{letn=t.attributes.metadata;if(n&&(n={...n},deleten.id,deleten.bindings,r?.[n.name]))for(const[e,a]ofObject.entries(r[n.name]))(0,o.getBlockType)(t.name)?.attributes[e]&&(t.attributes[e]=a);return(0,o.cloneBlock)(t,{metadata:n&&Object.keys(n).length>0?n:void0},e(t.innerBlocks))}))}(a))};functionh(e,t){return{type:"SET_EDITING_PATTERN",clientId:e,isEditing:t}}functionf(e,t){returne.isEditingPattern[t]}constx=window.wp.privateApis,{lock:b,unlock:w}=(0,x.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/patterns"),S={reducer:s},C=(0,a.createReduxStore)("core/patterns",{...S});(0,a.register)(C),w(C).registerPrivateActions(n),w(C).registerPrivateSelectors(r);constv=window.wp.components,k=window.wp.element,j=window.wp.i18n;functionP(e){returnObject.keys(p).includes(e.name)&&!!e.attributes.metadata?.name&&!!e.attributes.metadata?.bindings&&Object.values(e.attributes.metadata.bindings).some((e=>"core/pattern-overrides"===e.source))}constB=window.ReactJSXRuntime,{BlockQuickNavigation:T}=w(c.privateApis);constE=window.wp.notices,D=window.wp.compose,I=window.wp.htmlEntities,R=e=>(0,I.decodeEntities)(e),N="wp_pattern_category";functionO({categoryTerms:e,onChange:t,categoryMap:n}){const[r,a]=(0,k.useState)(""),s=(0,D.useDebounce)(a,500),o=(0,k.useMemo)((()=>Array.from(n.values()).map((e=>R(e.label))).filter((e=>""===r||e.toLowerCase().includes(r.toLowerCase()))).sort(((e,t)=>e.localeCompare(t)))),[r,n]);return(0,B.jsx)(v.FormTokenField,{className:"patterns-menu-items__convert-modal-categories",value:e,suggestions:o,onChange:function(e){constn=e.reduce(((e,t)=>(e.some((e=>e.toLowerCase()===t.toLowerCase()))||e.push(t),e)),[]);t(n)},onInputChange:s,label:(0,j.__)("Categories"),tokenizeOnBlur:!0,__experimentalExpandOnFocus:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})}functionM(){const{saveEntityRecord:e,invalidateResolution:t}=(0,a.useDispatch)(i.store),{corePatternCategories:n,userPatternCategories:r}=(0,a.useSelect)((e=>{const{getUserPatternCategories:t,getBlockPatternCategories:n}=e(i.store);return{corePatternCategories:n(),use