/*! For license information please see form_editor.js.LICENSE.txt */ (globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[747],{43575:(e,t,n)=>{e=n.nmd(e),function(t){"use strict";var n,r="function"==typeof(n=t.atob)?n:"function"==typeof Buffer?function(e){return new Buffer(e,"base64").toString("binary")}:"object"==typeof t.base64js?function(e){var n=t.base64js.b64ToByteArray(e);return Array.prototype.map.call(n,(function(e){return String.fromCharCode(e)})).join("")}:function(){throw new Error("You're probably in an old browser or an iOS webworker. It might help to include beatgammit's base64-js.")};t.atob=r,e&&e.exports&&(e.exports=r)}(window)},48198:function(e,t){var n,r;n=function(e,t){"use strict";var n,r,o="function"==typeof Map?new Map:(n=[],r=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return r[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),r.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),r.splice(t,1))}}),i=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){i=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function s(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!o.has(e)){var t=null,n=null,r=null,s=function(){e.clientWidth!==n&&d()},a=function(t){window.removeEventListener("resize",s,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",a,!1),e.removeEventListener("autosize:update",d,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),o.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",a,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",d,!1),window.addEventListener("resize",s,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",o.set(e,{destroy:a,update:d}),"vertical"===(l=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===l.resize&&(e.style.resize="horizontal"),t="content-box"===l.boxSizing?-(parseFloat(l.paddingTop)+parseFloat(l.paddingBottom)):parseFloat(l.borderTopWidth)+parseFloat(l.borderBottomWidth),isNaN(t)&&(t=0),d()}var l;function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(){if(0!==e.scrollHeight){var r=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),o=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,r.forEach((function(e){e.node.scrollTop=e.scrollTop})),o&&(document.documentElement.scrollTop=o)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),o="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(o{"use strict";var r={};n.r(r),n.d(r,{__experimentalBatch:()=>fs,__experimentalReceiveCurrentGlobalStylesId:()=>ns,__experimentalReceiveThemeBaseGlobalStyles:()=>rs,__experimentalReceiveThemeGlobalStyleVariations:()=>os,__experimentalSaveSpecifiedEntityEdits:()=>gs,__unstableCreateUndoLevel:()=>hs,addEntities:()=>Qi,deleteEntityRecord:()=>ls,editEntityRecord:()=>cs,receiveAutosaves:()=>ys,receiveCurrentTheme:()=>ts,receiveCurrentUser:()=>Zi,receiveDefaultTemplateId:()=>xs,receiveEmbedPreview:()=>as,receiveEntityRecords:()=>es,receiveNavigationFallbackId:()=>_s,receiveRevisions:()=>ws,receiveThemeGlobalStyleRevisions:()=>ss,receiveThemeSupports:()=>is,receiveUploadPermissions:()=>bs,receiveUserPermission:()=>vs,receiveUserQuery:()=>Xi,redo:()=>ds,saveEditedEntityRecord:()=>ms,saveEntityRecord:()=>ps,undo:()=>us});var o={};n.r(o),n.d(o,{__experimentalGetCurrentGlobalStylesId:()=>ja,__experimentalGetCurrentThemeBaseGlobalStyles:()=>za,__experimentalGetCurrentThemeGlobalStylesVariations:()=>Ua,__experimentalGetDirtyEntityRecords:()=>pa,__experimentalGetEntitiesBeingSaved:()=>fa,__experimentalGetEntityRecordNoResolver:()=>aa,__experimentalGetTemplateForLink:()=>Fa,canUser:()=>Na,canUserEditEntityRecord:()=>Da,getAuthors:()=>Qs,getAutosave:()=>Pa,getAutosaves:()=>Ma,getBlockPatternCategories:()=>Ha,getBlockPatterns:()=>Va,getCurrentTheme:()=>Ia,getCurrentThemeGlobalStylesRevisions:()=>Wa,getCurrentUser:()=>ea,getDefaultTemplateId:()=>Ga,getEditedEntityRecord:()=>va,getEmbedPreview:()=>Ba,getEntitiesByKind:()=>na,getEntitiesConfig:()=>ra,getEntity:()=>oa,getEntityConfig:()=>ia,getEntityRecord:()=>sa,getEntityRecordEdits:()=>ma,getEntityRecordNonTransientEdits:()=>ga,getEntityRecords:()=>ua,getEntityRecordsTotalItems:()=>da,getEntityRecordsTotalPages:()=>ha,getLastEntityDeleteError:()=>ka,getLastEntitySaveError:()=>wa,getRawEntityRecord:()=>la,getRedoEdit:()=>Sa,getReferenceByDistinctEdits:()=>La,getRevision:()=>Ka,getRevisions:()=>qa,getThemeSupports:()=>Ta,getUndoEdit:()=>Ca,getUserPatternCategories:()=>$a,getUserQueryResults:()=>ta,hasEditsForEntityRecord:()=>ba,hasEntityRecords:()=>ca,hasFetchedAutosaves:()=>Oa,hasRedo:()=>Ea,hasUndo:()=>Aa,isAutosavingEntityRecord:()=>ya,isDeletingEntityRecord:()=>xa,isPreviewEmbedFallback:()=>Ra,isRequestingEmbedPreview:()=>Zs,isSavingEntityRecord:()=>_a});var i={};n.r(i),n.d(i,{getBlockPatternsForPostType:()=>Xa,getNavigationFallbackId:()=>Ja,getUndoManager:()=>Ya});var s={};n.r(s),n.d(s,{__experimentalGetCurrentGlobalStylesId:()=>ml,__experimentalGetCurrentThemeBaseGlobalStyles:()=>gl,__experimentalGetCurrentThemeGlobalStylesVariations:()=>bl,__experimentalGetTemplateForLink:()=>fl,canUser:()=>ul,canUserEditEntityRecord:()=>dl,getAuthors:()=>tl,getAutosave:()=>pl,getAutosaves:()=>hl,getBlockPatternCategories:()=>_l,getBlockPatterns:()=>yl,getCurrentTheme:()=>al,getCurrentThemeGlobalStylesRevisions:()=>vl,getCurrentUser:()=>nl,getDefaultTemplateId:()=>kl,getEditedEntityRecord:()=>il,getEmbedPreview:()=>cl,getEntityRecord:()=>rl,getEntityRecords:()=>sl,getNavigationFallbackId:()=>wl,getRawEntityRecord:()=>ol,getRevision:()=>Sl,getRevisions:()=>Cl,getThemeSupports:()=>ll,getUserPatternCategories:()=>xl});var a={};n.r(a),n.d(a,{__experimentalHasContentRoleAttribute:()=>_u,getActiveBlockVariation:()=>iu,getBlockStyles:()=>ru,getBlockSupport:()=>fu,getBlockType:()=>nu,getBlockTypes:()=>tu,getBlockVariations:()=>ou,getCategories:()=>au,getChildBlockNames:()=>pu,getCollections:()=>lu,getDefaultBlockName:()=>cu,getDefaultBlockVariation:()=>su,getFreeformFallbackBlockName:()=>uu,getGroupingBlockName:()=>hu,getUnregisteredFallbackBlockName:()=>du,hasBlockSupport:()=>mu,hasChildBlocks:()=>vu,hasChildBlocksWithInserterSupport:()=>yu,isMatchingSearchTerm:()=>bu});var l={};n.r(l),n.d(l,{getAllBlockBindingsSources:()=>Au,getBlockBindingsSource:()=>Eu,getBootstrappedBlockType:()=>Cu,getSupportedStyles:()=>ku,getUnprocessedBlockTypes:()=>Su});var c={};n.r(c),n.d(c,{__experimentalReapplyBlockFilters:()=>Ou,addBlockCollection:()=>Yu,addBlockStyles:()=>Fu,addBlockTypes:()=>Mu,addBlockVariations:()=>Uu,reapplyBlockTypeFilters:()=>Pu,removeBlockCollection:()=>Ju,removeBlockStyles:()=>zu,removeBlockTypes:()=>Lu,removeBlockVariations:()=>Vu,setCategories:()=>qu,setDefaultBlockName:()=>Hu,setFreeformFallbackBlockName:()=>$u,setGroupingBlockName:()=>Gu,setUnregisteredFallbackBlockName:()=>Wu,updateCategory:()=>Ku});var u={};n.r(u),n.d(u,{addBootstrappedBlockType:()=>Xu,addUnprocessedBlockType:()=>Zu,registerBlockBindingsSource:()=>Qu});var d={};n.r(d),n.d(d,{getAllPatterns:()=>im,getBlockRemovalRules:()=>Xf,getBlockSettings:()=>Hf,getBlockWithoutAttributes:()=>Gf,getContentLockingParent:()=>hm,getEnabledBlockParents:()=>Yf,getEnabledClientIdsTree:()=>Kf,getExpandedBlock:()=>dm,getInserterMediaCategories:()=>tm,getLastFocus:()=>cm,getLastInsertedBlocksClientIds:()=>Wf,getOpenedBlockSettingsMenu:()=>Zf,getPatternBySlug:()=>om,getRegisteredInserterMediaCategories:()=>em,getRemovalPromptData:()=>Jf,getReusableBlocks:()=>lm,getStyleOverrides:()=>Qf,getTemporarilyEditingAsBlocks:()=>pm,getTemporarilyEditingFocusModeToRevert:()=>fm,hasAllowedPatterns:()=>nm,isBlockInterfaceHidden:()=>$f,isBlockSubtreeDisabled:()=>qf,isDragging:()=>um,isResolvingPatterns:()=>sm});var h={};n.r(h),n.d(h,{__experimentalGetActiveBlockIdByBlockNames:()=>bb,__experimentalGetAllowedBlocks:()=>Yg,__experimentalGetAllowedPatterns:()=>eb,__experimentalGetBlockListSettingsForBlocks:()=>ab,__experimentalGetDirectInsertBlock:()=>Xg,__experimentalGetGlobalBlocksByName:()=>jm,__experimentalGetLastBlockAttributeChanges:()=>ub,__experimentalGetParsedPattern:()=>Zg,__experimentalGetPatternTransformItems:()=>rb,__experimentalGetPatternsByBlockTypes:()=>nb,__experimentalGetReusableBlockTitle:()=>lb,__unstableGetBlockWithoutInnerBlocks:()=>xm,__unstableGetClientIdWithClientIdsTree:()=>km,__unstableGetClientIdsTree:()=>Cm,__unstableGetContentLockingParent:()=>Ab,__unstableGetEditorMode:()=>hb,__unstableGetSelectedBlocksWithPartialSelection:()=>ug,__unstableGetTemporarilyEditingAsBlocks:()=>Eb,__unstableGetTemporarilyEditingFocusModeToRevert:()=>Ib,__unstableGetVisibleBlocks:()=>_b,__unstableHasActiveBlockOverlayActive:()=>xb,__unstableIsFullySelected:()=>sg,__unstableIsLastBlockChangeIgnored:()=>cb,__unstableIsSelectionCollapsed:()=>ag,__unstableIsSelectionMergeable:()=>cg,__unstableIsWithinBlockOverlay:()=>wb,__unstableSelectionHasUnmergeableBlock:()=>lg,areInnerBlocksControlled:()=>gb,canEditBlock:()=>Fg,canInsertBlockType:()=>Ng,canInsertBlocks:()=>Dg,canLockBlockType:()=>zg,canMoveBlock:()=>Og,canMoveBlocks:()=>Lg,canRemoveBlock:()=>Mg,canRemoveBlocks:()=>Pg,didAutomaticChange:()=>fb,getAdjacentBlockClientId:()=>Gm,getAllowedBlocks:()=>Kg,getBlock:()=>_m,getBlockAttributes:()=>ym,getBlockCount:()=>Rm,getBlockEditingMode:()=>kb,getBlockHierarchyRootClientId:()=>$m,getBlockIndex:()=>hg,getBlockInsertionPoint:()=>Eg,getBlockListSettings:()=>ob,getBlockMode:()=>_g,getBlockName:()=>bm,getBlockNamesByClientId:()=>Bm,getBlockOrder:()=>dg,getBlockParents:()=>Vm,getBlockParentsByBlockName:()=>Hm,getBlockRootClientId:()=>Um,getBlockSelectionEnd:()=>Pm,getBlockSelectionStart:()=>Mm,getBlockTransformItems:()=>Gg,getBlocks:()=>wm,getBlocksByClientId:()=>Tm,getBlocksByName:()=>Im,getClientIdsOfDescendants:()=>Sm,getClientIdsWithDescendants:()=>Am,getDirectInsertBlock:()=>Jg,getDraggedBlockClientIds:()=>kg,getFirstMultiSelectedBlockClientId:()=>Qm,getGlobalBlockCount:()=>Em,getInserterItems:()=>Wg,getLastMultiSelectedBlockClientId:()=>eg,getLowestCommonAncestorWithSelectedBlock:()=>Wm,getMultiSelectedBlockClientIds:()=>Xm,getMultiSelectedBlocks:()=>Zm,getMultiSelectedBlocksEndClientId:()=>ig,getMultiSelectedBlocksStartClientId:()=>og,getNextBlockClientId:()=>Km,getPatternsByBlockTypes:()=>tb,getPreviousBlockClientId:()=>qm,getSelectedBlock:()=>zm,getSelectedBlockClientId:()=>Fm,getSelectedBlockClientIds:()=>Jm,getSelectedBlockCount:()=>Om,getSelectedBlocksInitialCaretPosition:()=>Ym,getSelectionEnd:()=>Dm,getSelectionStart:()=>Nm,getSettings:()=>ib,getTemplate:()=>Tg,getTemplateLock:()=>Bg,hasBlockMovingClientId:()=>pb,hasDraggedInnerBlock:()=>mg,hasInserterItems:()=>qg,hasMultiSelection:()=>bg,hasSelectedBlock:()=>Lm,hasSelectedInnerBlock:()=>fg,isAncestorBeingDragged:()=>Sg,isAncestorMultiSelected:()=>rg,isBlockBeingDragged:()=>Cg,isBlockHighlighted:()=>mb,isBlockInsertionPointVisible:()=>Ig,isBlockMultiSelected:()=>ng,isBlockSelected:()=>pg,isBlockValid:()=>vm,isBlockVisible:()=>yb,isBlockWithinSelection:()=>gg,isCaretWithinFormattedText:()=>Ag,isDraggingBlocks:()=>wg,isFirstMultiSelectedBlock:()=>tg,isGroupable:()=>Sb,isLastBlockChangePersistent:()=>sb,isMultiSelecting:()=>vg,isNavigationMode:()=>db,isSelectionEnabled:()=>yg,isTyping:()=>xg,isUngroupable:()=>Cb,isValidTemplate:()=>jg,wasBlockJustInserted:()=>vb});var p={};n.r(p),n.d(p,{__experimentalUpdateSettings:()=>Bb,clearBlockRemovalPrompt:()=>Ob,deleteStyleOverride:()=>Ub,ensureDefaultBlock:()=>Mb,expandBlock:()=>qb,hideBlockInterface:()=>Rb,modifyContentLockBlock:()=>Kb,privateRemoveBlocks:()=>Db,setBlockRemovalRules:()=>Lb,setLastFocus:()=>Hb,setOpenedBlockSettingsMenu:()=>Fb,setStyleOverride:()=>zb,showBlockInterface:()=>Nb,startDragging:()=>Wb,stopDragging:()=>Gb,stopEditingAsBlocks:()=>$b,syncDerivedUpdates:()=>Vb});var f={};n.r(f),n.d(f,{__unstableDeleteSelection:()=>Iv,__unstableExpandSelection:()=>Tv,__unstableMarkAutomaticChange:()=>Yv,__unstableMarkLastChangeAsPersistent:()=>qv,__unstableMarkNextChangeAsNotPersistent:()=>Kv,__unstableSaveReusableBlock:()=>Gv,__unstableSetEditorMode:()=>Xv,__unstableSetTemporarilyEditingAsBlocks:()=>sy,__unstableSplitSelection:()=>jv,clearSelectedBlock:()=>pv,duplicateBlocks:()=>Qv,enterFormattedText:()=>zv,exitFormattedText:()=>Uv,flashBlock:()=>ry,hideInsertionPoint:()=>Sv,insertAfterBlock:()=>ty,insertBeforeBlock:()=>ey,insertBlock:()=>wv,insertBlocks:()=>kv,insertDefaultBlock:()=>Hv,mergeBlocks:()=>Bv,moveBlockToPosition:()=>xv,moveBlocksDown:()=>vv,moveBlocksToPosition:()=>_v,moveBlocksUp:()=>yv,multiSelect:()=>hv,receiveBlocks:()=>ov,registerInserterMediaCategory:()=>ay,removeBlock:()=>Nv,removeBlocks:()=>Rv,replaceBlock:()=>gv,replaceBlocks:()=>mv,replaceInnerBlocks:()=>Dv,resetBlocks:()=>tv,resetSelection:()=>rv,selectBlock:()=>av,selectNextBlock:()=>cv,selectPreviousBlock:()=>lv,selectionChange:()=>Vv,setBlockEditingMode:()=>ly,setBlockMovingClientId:()=>Zv,setBlockVisibility:()=>iy,setHasControlledInnerBlocks:()=>oy,setNavigationMode:()=>Jv,setTemplateValidity:()=>Av,showInsertionPoint:()=>Cv,startDraggingBlocks:()=>Lv,startMultiSelect:()=>uv,startTyping:()=>Pv,stopDraggingBlocks:()=>Fv,stopMultiSelect:()=>dv,stopTyping:()=>Ov,synchronizeTemplate:()=>Ev,toggleBlockHighlight:()=>ny,toggleBlockMode:()=>Mv,toggleSelection:()=>fv,unsetBlockEditingMode:()=>cy,updateBlock:()=>sv,updateBlockAttributes:()=>iv,updateBlockListSettings:()=>$v,updateSettings:()=>Wv,validateBlocksToTemplate:()=>nv});var m={};n.r(m),n.d(m,{Rp:()=>Tx,y0:()=>Sx,ou:()=>Rx,uG:()=>Ex,eh:()=>Ax});var g={};n.r(g),n.d(g,{AdvancedPanel:()=>D1,BackgroundPanel:()=>Nj,BorderPanel:()=>YR,ColorPanel:()=>kD,DimensionsPanel:()=>LO,FiltersPanel:()=>IL,GlobalStylesContext:()=>Ny,ImageSettingsPanel:()=>R1,TypographyPanel:()=>qM,areGlobalStyleConfigsEqual:()=>Ry,getBlockCSSSelector:()=>yL,getBlockSelectors:()=>iF,getGlobalStylesChanges:()=>V1,getLayoutStyles:()=>QL,toStyles:()=>oF,useGlobalSetting:()=>Oy,useGlobalStyle:()=>Ly,useGlobalStyleLinks:()=>Fy,useGlobalStylesOutput:()=>lF,useGlobalStylesOutputWithConfig:()=>aF,useGlobalStylesReset:()=>Py,useHasBackgroundPanel:()=>Sj,useHasBorderPanel:()=>zR,useHasBorderPanelControls:()=>UR,useHasColorPanel:()=>cD,useHasDimensionsPanel:()=>SO,useHasFiltersPanel:()=>wL,useHasImageSettingsPanel:()=>B1,useHasTypographyPanel:()=>DM,useSettingsForBlockElement:()=>zy});var b={};n.r(b),n.d(b,{close:()=>o2,open:()=>r2,registerCommand:()=>Q1,registerCommandLoader:()=>t2,unregisterCommand:()=>e2,unregisterCommandLoader:()=>n2});var v={};n.r(v),n.d(v,{getCommandLoaders:()=>s2,getCommands:()=>i2,getContext:()=>l2,isOpen:()=>a2});var y={};n.r(y),n.d(y,{setContext:()=>c2});var _={};n.r(_),n.d(_,{applyStylesToAllTextInputs:()=>k5,blocksChangedInBlockEditor:()=>w5,changeActiveSidebar:()=>u5,changeFormBlocks:()=>q2,changeFormName:()=>K2,changeFormSettings:()=>s5,changeFormStyles:()=>Z2,changePreviewSettings:()=>d5,createCustomField:()=>_5,createCustomFieldDone:()=>r5,createCustomFieldFailed:()=>i5,createCustomFieldStarted:()=>o5,customFieldEdited:()=>Q2,deleteCustomField:()=>x5,deleteCustomFieldDone:()=>J2,deleteCustomFieldFailed:()=>X2,deleteCustomFieldStarted:()=>Y2,hidePreview:()=>f5,historyRedo:()=>S5,historyUndo:()=>C5,removeNotice:()=>m5,saveCustomField:()=>y5,saveCustomFieldDone:()=>e5,saveCustomFieldFailed:()=>n5,saveCustomFieldStarted:()=>t5,saveForm:()=>v5,saveFormDone:()=>a5,saveFormFailed:()=>c5,saveFormStarted:()=>l5,showPlacementSettings:()=>h5,showPreview:()=>p5,switchDefaultSidebarTab:()=>g5,toggleForm:()=>W2,toggleFullscreen:()=>G2,toggleInserter:()=>H2,toggleListView:()=>$2,toggleSidebar:()=>V2,toggleSidebarPanel:()=>b5,tutorialDismissed:()=>A5});var x={};n.r(x),n.d(x,{selectCategory:()=>Z_e,selectTemplate:()=>X_e});var w={};n.r(w),n.d(w,{CALL_API:()=>F5.p,TRACK_EVENT:()=>Q_e.s});var k=n(7378),C=n(79124),S=n(6997),A=n(50661),E=n(71328),I=n(3698),j=n.n(I),T=n(54132),B=n(31528),R=n(91221),N=n.n(R),D=n(43728),M=n(42891);function P(e,t){const n={...e};return Object.entries(t).forEach((([e,t])=>{n[e]?n[e]={...n[e],to:t.to}:n[e]=t})),n}const O=(e,t)=>{const n=e?.findIndex((({id:e})=>"string"==typeof e?e===t.id:(0,M.default)(e,t.id))),r=[...e];return-1!==n?r[n]={id:t.id,changes:P(r[n].changes,t.changes)}:r.push(t),r};const L=e=>t=>(n,r)=>void 0===n||e(r)?t(n,r):n,F=e=>t=>(n,r)=>t(n,e(r)),z=e=>t=>(n={},r)=>{const o=r[e];if(void 0===o)return n;const i=t(n[o],r);return i===n[o]?n:{...n,[o]:i}};var U=n(61203),V=n(85998),H=n(67268),$=n(43452),W=n(37844),G=n(82321),q=n(67195);function K(e,t,n){if(!e||"object"!=typeof e)return e;const r=Array.isArray(t)?t:t.split(".");return r.reduce(((e,t,o)=>(void 0===e[t]&&(Number.isInteger(r[o+1])?e[t]=[]:e[t]={}),o===r.length-1&&(e[t]=n),e[t])),e),e}function Y(e,t,n){if(!e||"object"!=typeof e||"string"!=typeof t&&!Array.isArray(t))return e;const r=Array.isArray(t)?t:t.split(".");let o=e;return r.forEach((e=>{o=o?.[e]})),void 0!==o?o:n}function J(e,t,n){return{type:"RECEIVE_ITEMS",items:Array.isArray(e)?e:[e],persistedEdits:t,meta:n}}let X=null;async function Z(e){if(null===X){const e=await(0,S.default)({path:"/batch/v1",method:"OPTIONS"});X=e.endpoints[0].args.requests.maxItems}const t=[];for(const n of function(e,t){const n=[...e],r=[];for(;n.length;)r.push(n.splice(0,t));return r}(e,X)){const e=await(0,S.default)({path:"/batch/v1",method:"POST",data:{validation:"require-all-validate",requests:n.map((e=>({path:e.path,body:e.data,method:e.method,headers:e.headers})))}});let r;r=e.failed?e.responses.map((e=>({error:e?.body}))):e.responses.map((e=>{const t={};return e.status>=200&&e.status<300?t.output=e.body:t.error=e.body,t})),t.push(...r)}return t}function Q(e=Z){let t=0,n=[];const r=new ee;return{add(e){const o=++t;r.add(o);const i=e=>new Promise(((t,i)=>{n.push({input:e,resolve:t,reject:i}),r.delete(o)}));return"function"==typeof e?Promise.resolve(e(i)).finally((()=>{r.delete(o)})):i(e)},async run(){let t;r.size&&await new Promise((e=>{const t=r.subscribe((()=>{r.size||(t(),e(void 0))}))}));try{if(t=await e(n.map((({input:e})=>e))),t.length!==n.length)throw new Error("run: Array returned by processor must be same size as input array.")}catch(e){for(const{reject:t}of n)t(e);throw e}let o=!0;return t.forEach(((e,t)=>{const r=n[t];var i;e?.error?(r?.reject(e.error),o=!1):r?.resolve(null!==(i=e?.output)&&void 0!==i?i:e)})),n=[],o}}}class ee{constructor(...e){this.set=new Set(...e),this.subscribers=new Set}get size(){return this.set.size}add(e){return this.set.add(e),this.subscribers.forEach((e=>e())),this}delete(e){const t=this.set.delete(e);return this.subscribers.forEach((e=>e())),t}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}}const te="core",ne=()=>new Map,re=e=>{const t=ne();return e.forEach(((e,n)=>{t.set(n,e)})),t},oe=(e,t,n)=>{let r=e.get(t);return void 0===r&&e.set(t,r=n()),r},ie=()=>new Set,se=e=>e[e.length-1],ae=(e,t)=>{for(let n=0;n{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){const n=this._observers.get(e);void 0!==n&&(n.delete(t),0===n.size&&this._observers.delete(e))}emit(e,t){return le((this._observers.get(e)||ne()).values()).forEach((e=>e(...t)))}destroy(){this._observers=ne()}}const de=Math.floor,he=(Math.ceil,Math.abs),pe=(Math.imul,Math.round,Math.log10),fe=(Math.log2,Math.log,Math.sqrt,(e,t)=>ee>t?e:t,ge=(Number.isNaN,Math.pow,Math.sign,e=>0!==e?e<0:1/e<0),be=64,ve=128,ye=127,_e=Number.MAX_SAFE_INTEGER,xe=(Number.MIN_SAFE_INTEGER,Number.isInteger||(e=>"number"==typeof e&&isFinite(e)&&de(e)===e)),we=(Number.isNaN,Number.parseInt,String.fromCharCode),ke=(String.fromCodePoint,we(65535),/^\s*/g),Ce=/([A-Z])/g,Se=(e,t)=>(e=>e.replace(ke,""))(e.replace(Ce,(e=>`${t}${(e=>e.toLowerCase())(e)}`))),Ae="undefined"!=typeof TextEncoder?new TextEncoder:null,Ee=Ae?e=>Ae.encode(e):e=>{const t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;enew je,Be=e=>{const t=new Uint8Array((e=>{let t=e.cpos;for(let n=0;n{const n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(2*n),e.cpos=0),e.cbuf[e.cpos++]=t},Ne=Re,De=(e,t)=>{for(;t>ye;)Re(e,ve|ye&t),t=de(t/128);Re(e,ye&t)},Me=(e,t)=>{const n=ge(t);for(n&&(t=-t),Re(e,(t>63?ve:0)|(n?be:0)|63&t),t=de(t/64);t>0;)Re(e,(t>ye?ve:0)|ye&t),t=de(t/128)},Pe=new Uint8Array(3e4),Oe=Pe.length/3,Le=Ae&&Ae.encodeInto?(e,t)=>{if(t.length{const n=unescape(encodeURIComponent(t)),r=n.length;De(e,r);for(let t=0;t{const n=e.cbuf.length,r=e.cpos,o=fe(n-r,t.length),i=t.length-o;e.cbuf.set(t.subarray(0,o),r),e.cpos+=o,i>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(me(2*n,i)),e.cbuf.set(t.subarray(o)),e.cpos=i)},ze=(e,t)=>{De(e,t.byteLength),Fe(e,t)},Ue=(e,t)=>{((e,t)=>{const n=e.cbuf.length;n-e.cpos{switch(typeof t){case"string":Re(e,119),Le(e,t);break;case"number":xe(t)&&he(t)<=2147483647?(Re(e,125),Me(e,t)):(n=t,Ve.setFloat32(0,n),Ve.getFloat32(0)===n?(Re(e,124),((e,t)=>{Ue(e,4).setFloat32(0,t,!1)})(e,t)):(Re(e,123),((e,t)=>{Ue(e,8).setFloat64(0,t,!1)})(e,t)));break;case"bigint":Re(e,122),((e,t)=>{Ue(e,8).setBigInt64(0,t,!1)})(e,t);break;case"object":if(null===t)Re(e,126);else if(ce(t)){Re(e,117),De(e,t.length);for(let n=0;n0&&De(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const We=e=>{e.count>0&&(Me(e.encoder,1===e.count?e.s:-e.s),e.count>1&&De(e.encoder,e.count-2))};class Ge{constructor(){this.encoder=new je,this.s=0,this.count=0}write(e){this.s===e?this.count++:(We(this),this.count=1,this.s=e)}toUint8Array(){return We(this),Be(this.encoder)}}const qe=e=>{if(e.count>0){const t=2*e.diff+(1===e.count?0:1);Me(e.encoder,t),e.count>1&&De(e.encoder,e.count-2)}};class Ke{constructor(){this.encoder=new je,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(qe(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return qe(this),Be(this.encoder)}}class Ye{constructor(){this.sarr=[],this.s="",this.lensE=new Ge}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new je;return this.sarr.push(this.s),this.s="",Le(e,this.sarr.join("")),Fe(e,this.lensE.toUint8Array()),Be(e)}}const Je=e=>new Error(e),Xe=()=>{throw Je("Method unimplemented")},Ze=()=>{throw Je("Unexpected case")},Qe=Je("Unexpected end of array"),et=Je("Integer out of Range");class tt{constructor(e){this.arr=e,this.pos=0}}const nt=e=>new tt(e),rt=e=>((e,t)=>{const n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n})(e,it(e)),ot=e=>e.arr[e.pos++],it=e=>{let t=0,n=1;const r=e.arr.length;for(;e.pos_e)throw et}throw Qe},st=e=>{let t=e.arr[e.pos++],n=63&t,r=64;const o=(t&be)>0?-1:1;if(!(t&ve))return o*n;const i=e.arr.length;for(;e.pos_e)throw et}throw Qe},at=Ie?e=>Ie.decode(rt(e)):e=>{let t=it(e);if(0===t)return"";{let n=String.fromCodePoint(ot(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(ot(e));else for(;t>0;){const r=t<1e4?t:1e4,o=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,o),t-=r}return decodeURIComponent(escape(n))}},lt=(e,t)=>{const n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},ct=[e=>{},e=>null,st,e=>lt(e,4).getFloat32(0,!1),e=>lt(e,8).getFloat64(0,!1),e=>lt(e,8).getBigInt64(0,!1),e=>!1,e=>!0,at,e=>{const t=it(e),n={};for(let r=0;r{const t=it(e),n=[];for(let r=0;rct[127-ot(e)](e);class dt extends tt{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){return 0===this.count&&(this.s=this.reader(this),(e=this).pos!==e.arr.length?this.count=it(this)+1:this.count=-1),this.count--,this.s;var e}}class ht extends tt{constructor(e){super(e),this.s=0,this.count=0}read(){if(0===this.count){this.s=st(this);const e=ge(this.s);this.count=1,e&&(this.s=-this.s,this.count=it(this)+2)}return this.count--,this.s}}class pt extends tt{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(0===this.count){const e=st(this),t=1&e;this.diff=de(e/2),this.count=1,t&&(this.count=it(this)+2)}return this.s+=this.diff,this.count--,this.s}}class ft{constructor(e){this.decoder=new ht(e),this.str=at(this.decoder),this.spos=0}read(){const e=this.spos+this.decoder.read(),t=this.str.slice(this.spos,e);return this.spos=e,t}}crypto.subtle;const mt=crypto.getRandomValues.bind(crypto),gt=Math.random,bt=()=>mt(new Uint32Array(1))[0],vt=[1e7]+-1e3+-4e3+-8e3+-1e11,yt=()=>vt.replace(/[018]/g,(e=>(e^bt()&15>>e/4).toString(16))),_t=e=>new Promise(e),xt=(Promise.all.bind(Promise),e=>Promise.resolve(e));let wt=new class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}},kt=!0;try{"undefined"!=typeof localStorage&&localStorage&&(wt=localStorage,kt=!1)}catch(e){}const Ct=wt,St=Object.assign,At=Object.keys,Et=e=>At(e).length,It=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),jt=(e,t,n=0)=>{try{for(;n{},Bt=e=>e,Rt=(e,t)=>{if(null==e||null==t)return((e,t)=>e===t)(e,t);if(e.constructor!==t.constructor)return!1;if(e===t)return!0;switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:if(e.byteLength!==t.byteLength)return!1;for(let n=0;n(()=>{if(void 0===Mt)if(Nt){Mt=ne();const e=process.argv;let t=null;for(let n=0;n{if(0!==e.length){const[t,n]=e.split("=");Mt.set(`--${Se(t,"-")}`,n),Mt.set(`-${Se(t,"-")}`,n)}}))):Mt=ne();return Mt})().has(e),Lt=e=>(e=>void 0===e?null:e)(Nt?process.env[e.toUpperCase()]:Ct.getItem(e));Ot("--"+"production")||Lt("production");const Ft=Nt&&($t=process.env.FORCE_COLOR,["true","1","2"].includes($t)),zt=!Ot("no-colors")&&(!Nt||process.stdout.isTTY||Ft)&&(!Nt||Ot("color")||Ft||null!==Lt("COLORTERM")||(Lt("TERM")||"").includes("color")),Ut=e=>new Uint8Array(e),Vt=Dt?e=>{let t="";for(let n=0;nBuffer.from(e.buffer,e.byteOffset,e.byteLength).toString("base64"),Ht=Dt?e=>{const t=atob(e),n=Ut(t.length);for(let e=0;e{const t=Buffer.from(e,"base64");return n=t.buffer,r=t.byteOffset,o=t.byteLength,new Uint8Array(n,r,o);var n,r,o};var $t;class Wt{constructor(e,t){this.left=e,this.right=t}}const Gt=(e,t)=>new Wt(e,t),qt="undefined"!=typeof document?document:{},Kt=("undefined"!=typeof DOMParser&&new DOMParser,e=>((e,t)=>{const n=[];for(const[r,o]of e)n.push(t(o,r));return n})(e,((e,t)=>`${t}:${e};`)).join("")),Yt=(qt.ELEMENT_NODE,qt.TEXT_NODE,qt.CDATA_SECTION_NODE,qt.COMMENT_NODE,qt.DOCUMENT_NODE,qt.DOCUMENT_TYPE_NODE,qt.DOCUMENT_FRAGMENT_NODE,Symbol),Jt=Date.now,Xt=Yt(),Zt=Yt(),Qt=Yt(),en=Yt(),tn=Yt(),nn=Yt(),rn=Yt(),on=Yt(),sn=Yt(),an=[tn,rn,on,Qt];let ln=0,cn=Jt();const un={[Xt]:Gt("font-weight","bold"),[Zt]:Gt("font-weight","normal"),[Qt]:Gt("color","blue"),[tn]:Gt("color","green"),[en]:Gt("color","grey"),[nn]:Gt("color","red"),[rn]:Gt("color","purple"),[on]:Gt("color","orange"),[sn]:Gt("color","black")},dn=zt?e=>{const t=[],n=[],r=ne();let o=[],i=0;for(;i0||e.length>0?(t.push("%c"+o),n.push(e)):t.push(o)}}}for(i>0&&(o=n,o.unshift(t.join("")));i{const t=[],n=[];let r=0;for(;r{console.log(...dn(e)),pn.forEach((t=>t.print(e)))},pn=ie(),fn=e=>({[Symbol.iterator](){return this},next:e}),mn=(e,t)=>fn((()=>{const{done:n,value:r}=e.next();return{done:n,value:n?void 0:t(r)}}));class gn{constructor(e,t){this.clock=e,this.len=t}}class bn{constructor(){this.clients=new Map}}const vn=(e,t,n)=>t.clients.forEach(((t,r)=>{const o=e.doc.store.clients.get(r);for(let r=0;r{const n=e.clients.get(t.client);return void 0!==n&&null!==((e,t)=>{let n=0,r=e.length-1;for(;n<=r;){const o=de((n+r)/2),i=e[o],s=i.clock;if(s<=t){if(t{e.clients.forEach((e=>{let t,n;for(e.sort(((e,t)=>e.clock-t.clock)),t=1,n=1;t=o.clock?r.len=me(r.len,o.clock+o.len-r.clock):(n{oe(e.clients,t,(()=>[])).push(new gn(n,r))},wn=()=>new bn,kn=(e,t)=>{De(e.restEncoder,t.clients.size),le(t.clients.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([t,n])=>{e.resetDsCurVal(),De(e.restEncoder,t);const r=n.length;De(e.restEncoder,r);for(let t=0;t{const t=new bn,n=it(e.restDecoder);for(let r=0;r0){const o=oe(t.clients,n,(()=>[]));for(let t=0;t{const r=new bn,o=it(e.restDecoder);for(let i=0;i0){const e=new Mn;return De(e.restEncoder,0),kn(e,r),e.toUint8Array()}return null},An=bt;class En extends ue{constructor({guid:e=yt(),collectionid:t=null,gc:n=!0,gcFilter:r=(()=>!0),meta:o=null,autoLoad:i=!1,shouldLoad:s=!0}={}){super(),this.gc=n,this.gcFilter=r,this.clientID=An(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new nr,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=s,this.autoLoad=i,this.meta=o,this.isLoaded=!1,this.isSynced=!1,this.whenLoaded=_t((e=>{this.on("load",(()=>{this.isLoaded=!0,e(this)}))}));const a=()=>_t((e=>{const t=n=>{void 0!==n&&!0!==n||(this.off("sync",t),e())};this.on("sync",t)}));this.on("sync",(e=>{!1===e&&this.isSynced&&(this.whenSynced=a()),this.isSynced=void 0===e||!0===e,this.isSynced&&!this.isLoaded&&this.emit("load",[])})),this.whenSynced=a()}load(){const e=this._item;null===e||this.shouldLoad||br(e.parent.doc,(e=>{e.subdocsLoaded.add(this)}),null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(le(this.subdocs).map((e=>e.guid)))}transact(e,t=null){return br(this,e,t)}get(e,t=Or){const n=oe(this.share,e,(()=>{const e=new t;return e._integrate(this,null),e})),r=n.constructor;if(t!==Or&&r!==t){if(r===Or){const r=new t;r._map=n._map,n._map.forEach((e=>{for(;null!==e;e=e.left)e.parent=r})),r._start=n._start;for(let e=r._start;null!==e;e=e.right)e.parent=r;return r._length=n._length,this.share.set(e,r),r._integrate(this,null),r}throw new Error(`Type with the name ${e} has already been defined with a different constructor`)}return n}getArray(e=""){return this.get(e,to)}getText(e=""){return this.get(e,_o)}getMap(e=""){return this.get(e,ro)}getXmlElement(e=""){return this.get(e,ko)}getXmlFragment(e=""){return this.get(e,wo)}toJSON(){const e={};return this.share.forEach(((t,n)=>{e[n]=t.toJSON()})),e}destroy(){le(this.subdocs).forEach((e=>e.destroy()));const e=this._item;if(null!==e){this._item=null;const t=e.content;t.doc=new En({guid:this.guid,...t.opts,shouldLoad:!1}),t.doc._item=e,br(e.parent.doc,(n=>{const r=t.doc;e.deleted||n.subdocsAdded.add(r),n.subdocsRemoved.add(this)}),null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}on(e,t){super.on(e,t)}off(e,t){super.off(e,t)}}class In{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return it(this.restDecoder)}readDsLen(){return it(this.restDecoder)}}class jn extends In{readLeftID(){return Jn(it(this.restDecoder),it(this.restDecoder))}readRightID(){return Jn(it(this.restDecoder),it(this.restDecoder))}readClient(){return it(this.restDecoder)}readInfo(){return ot(this.restDecoder)}readString(){return at(this.restDecoder)}readParentInfo(){return 1===it(this.restDecoder)}readTypeRef(){return it(this.restDecoder)}readLen(){return it(this.restDecoder)}readAny(){return ut(this.restDecoder)}readBuf(){return(e=>{const t=Ut(e.byteLength);return t.set(e),t})(rt(this.restDecoder))}readJSON(){return JSON.parse(at(this.restDecoder))}readKey(){return at(this.restDecoder)}}class Tn{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=it(this.restDecoder),this.dsCurrVal}readDsLen(){const e=it(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class Bn extends Tn{constructor(e){super(e),this.keys=[],it(e),this.keyClockDecoder=new pt(rt(e)),this.clientDecoder=new ht(rt(e)),this.leftClockDecoder=new pt(rt(e)),this.rightClockDecoder=new pt(rt(e)),this.infoDecoder=new dt(rt(e),ot),this.stringDecoder=new ft(rt(e)),this.parentInfoDecoder=new dt(rt(e),ot),this.typeRefDecoder=new ht(rt(e)),this.lenDecoder=new ht(rt(e))}readLeftID(){return new Kn(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new Kn(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return 1===this.parentInfoDecoder.read()}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return ut(this.restDecoder)}readBuf(){return rt(this.restDecoder)}readJSON(){return ut(this.restDecoder)}readKey(){const e=this.keyClockDecoder.read();if(e{const r=new Map;n.forEach(((e,n)=>{or(t,n)>e&&r.set(n,e)})),rr(t).forEach(((e,t)=>{n.has(t)||r.set(t,0)})),De(e.restEncoder,r.size),le(r.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([n,r])=>{((e,t,n,r)=>{r=me(r,t[0].id.clock);const o=sr(t,r);De(e.restEncoder,t.length-o),e.writeClient(n),De(e.restEncoder,r);const i=t[o];i.write(e,r-i.id.clock);for(let n=o+1;n{const o=nt(t);((e,t,n,r=new Bn(e))=>{br(t,(e=>{e.local=!1;let t=!1;const n=e.doc,o=n.store,i=((e,t)=>{const n=ne(),r=it(e.restDecoder);for(let o=0;o{const r=[];let o=le(n.keys()).sort(((e,t)=>e-t));if(0===o.length)return null;const i=()=>{if(0===o.length)return null;let e=n.get(o[o.length-1]);for(;e.refs.length===e.i;){if(o.pop(),!(o.length>0))return null;e=n.get(o[o.length-1])}return e};let s=i();if(null===s)return null;const a=new nr,l=new Map,c=(e,t)=>{const n=l.get(e);(null==n||n>t)&&l.set(e,t)};let u=s.refs[s.i++];const d=new Map,h=()=>{for(const e of r){const t=e.id.client,r=n.get(t);r?(r.i--,a.clients.set(t,r.refs.slice(r.i)),n.delete(t),r.i=0,r.refs=[]):a.clients.set(t,[e]),o=o.filter((e=>e!==t))}r.length=0};for(;;){if(u.constructor!==Xo){const o=oe(d,u.id.client,(()=>or(t,u.id.client)))-u.id.clock;if(o<0)r.push(u),c(u.id.client,u.id.clock-1),h();else{const i=u.getMissing(e,t);if(null!==i){r.push(u);const e=n.get(i)||{refs:[],i:0};if(e.refs.length!==e.i){u=e.refs[e.i++];continue}c(i,or(t,i)),h()}else(0===o||o0)u=r.pop();else if(null!==s&&s.i0){const e=new Mn;return Pn(e,a,new Map),De(e.restEncoder,0),{missing:l,update:e.toUint8Array()}}return null})(e,o,i),a=o.pendingStructs;if(a){for(const[e,n]of a.missing)if(nt)&&a.missing.set(e,t)}a.update=wr([a.update,s.update])}}else o.pendingStructs=s;const l=Sn(r,e,o);if(o.pendingDs){const t=new Bn(nt(o.pendingDs));it(t.restDecoder);const n=Sn(t,e,o);o.pendingDs=l&&n?wr([l,n]):l||n}else o.pendingDs=l;if(t){const t=o.pendingStructs.update;o.pendingStructs=null,On(e.doc,t)}}),n,!1)})(o,e,n,new r(o))},Ln=(e,t,n)=>On(e,t,n,jn),Fn=(e,t=new Uint8Array([0]),n=new Mn)=>{((e,t,n=new Map)=>{Pn(e,t.store,n),kn(e,(e=>{const t=wn();return e.clients.forEach(((e,n)=>{const r=[];for(let t=0;t0&&t.clients.set(n,r)})),t})(t.store))})(n,e,Un(t));const r=[n.toUint8Array()];if(e.store.pendingDs&&r.push(e.store.pendingDs),e.store.pendingStructs&&r.push(kr(e.store.pendingStructs.update,t)),r.length>1){if(n.constructor===Nn)return _r(r.map(((e,t)=>0===t?e:Er(e))));if(n.constructor===Mn)return wr(r)}return r[0]},zn=(e,t)=>Fn(e,t,new Nn),Un=e=>(e=>{const t=new Map,n=it(e.restDecoder);for(let r=0;r(De(e.restEncoder,t.size),le(t.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([t,n])=>{De(e.restEncoder,t),De(e.restEncoder,n)})),e);class Hn{constructor(){this.l=[]}}const $n=()=>new Hn,Wn=(e,t)=>e.l.push(t),Gn=(e,t)=>{const n=e.l,r=n.length;e.l=n.filter((e=>t!==e)),r===e.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},qn=(e,t,n)=>jt(e.l,[t,n]);class Kn{constructor(e,t){this.client=e,this.clock=t}}const Yn=(e,t)=>e===t||null!==e&&null!==t&&e.client===t.client&&e.clock===t.clock,Jn=(e,t)=>new Kn(e,t);class Xn{constructor(e,t){this.ds=e,this.sv=t}}const Zn=(er=wn(),tr=new Map,new Xn(er,tr),(e,t)=>void 0===t?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!yn(t.ds,e.id)),Qn=(e,t)=>{const n=oe(e.meta,Qn,ie),r=e.doc.store;n.has(t)||(t.sv.forEach(((t,n)=>{t{})),n.add(t))};var er,tr;class nr{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const rr=e=>{const t=new Map;return e.clients.forEach(((e,n)=>{const r=e[e.length-1];t.set(n,r.id.clock+r.length)})),t},or=(e,t)=>{const n=e.clients.get(t);if(void 0===n)return 0;const r=n[n.length-1];return r.id.clock+r.length},ir=(e,t)=>{let n=e.clients.get(t.id.client);if(void 0===n)n=[],e.clients.set(t.id.client,n);else{const e=n[n.length-1];if(e.id.clock+e.length!==t.id.clock)throw Ze()}n.push(t)},sr=(e,t)=>{let n=0,r=e.length-1,o=e[r],i=o.id.clock;if(i===t)return r;let s=de(t/(i+o.length-1)*r);for(;n<=r;){if(o=e[s],i=o.id.clock,i<=t){if(t{const n=e.clients.get(t.client);return n[sr(n,t.clock)]},lr=(e,t,n)=>{const r=sr(t,n),o=t[r];return o.id.clock{const n=e.doc.store.clients.get(t.client);return n[lr(e,n,t.clock)]},ur=(e,t,n)=>{const r=t.clients.get(n.client),o=sr(r,n.clock),i=r[o];return n.clock!==i.id.clock+i.length-1&&i.constructor!==Io&&r.splice(o+1,0,qo(e,i,n.clock-i.id.clock+1)),i},dr=(e,t,n,r,o)=>{if(0===r)return;const i=n+r;let s,a=lr(e,t,n);do{s=t[a++],i!(0===t.deleteSet.clients.size&&!((e,t)=>{for(const[n,r]of e)if(t(r,n))return!0;return!1})(t.afterState,((e,n)=>t.beforeState.get(n)!==e))||(_n(t.deleteSet),((e,t)=>{Pn(e,t.doc.store,t.beforeState)})(e,t),kn(e,t.deleteSet),0)),fr=(e,t,n)=>{const r=t._item;(null===r||r.id.clock<(e.beforeState.get(r.id.client)||0)&&!r.deleted)&&oe(e.changed,t,ie).add(n)},mr=(e,t)=>{let n=e[t],r=e[t-1],o=t;for(;o>0&&r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n);n=r,r=e[--o-1])n instanceof Ko&&null!==n.parentSub&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);const i=t-o;return i&&e.splice(t+1-i,i),i},gr=(e,t)=>{if(te.push((()=>{null!==r._item&&r._item.deleted||r._callObserver(n,t)})))),e.push((()=>{n.changedParentTypes.forEach(((e,t)=>{t._dEH.l.length>0&&(null===t._item||!t._item.deleted)&&((e=e.filter((e=>null===e.target._item||!e.target._item.deleted))).forEach((e=>{e.currentTarget=t,e._path=null})),e.sort(((e,t)=>e.path.length-t.path.length)),qn(t._dEH,e,n))}))})),e.push((()=>r.emit("afterTransaction",[n,r]))),jt(e,[]),n._needFormattingCleanup&&bo(n)}finally{r.gc&&((e,t,n)=>{for(const[r,o]of e.clients.entries()){const e=t.clients.get(r);for(let r=o.length-1;r>=0;r--){const i=o[r],s=i.clock+i.len;for(let r=sr(e,i.clock),o=e[r];r{e.clients.forEach(((e,n)=>{const r=t.clients.get(n);for(let t=e.length-1;t>=0;t--){const n=e[t];for(let e=fe(r.length-1,1+sr(r,n.clock+n.len-1)),t=r[e];e>0&&t.id.clock>=n.clock;t=r[e])e-=1+mr(r,e)}}))})(i,o),n.afterState.forEach(((e,t)=>{const r=n.beforeState.get(t)||0;if(r!==e){const e=o.clients.get(t),n=me(sr(e,r),1);for(let t=e.length-1;t>=n;)t-=1+mr(e,t)}}));for(let e=s.length-1;e>=0;e--){const{client:t,clock:n}=s[e].id,r=o.clients.get(t),i=sr(r,n);i+11||i>0&&mr(r,i)}if(n.local||n.afterState.get(r.clientID)===n.beforeState.get(r.clientID)||(hn(on,Xt,"[yjs] ",Zt,nn,"Changed the client-id because another client seems to be using it."),r.clientID=An()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){const e=new Nn;pr(e,n)&&r.emit("update",[e.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){const e=new Mn;pr(e,n)&&r.emit("updateV2",[e.toUint8Array(),n.origin,r,n])}const{subdocsAdded:a,subdocsLoaded:l,subdocsRemoved:c}=n;(a.size>0||c.size>0||l.size>0)&&(a.forEach((e=>{e.clientID=r.clientID,null==e.collectionid&&(e.collectionid=r.collectionid),r.subdocs.add(e)})),c.forEach((e=>r.subdocs.delete(e))),r.emit("subdocs",[{loaded:l,added:a,removed:c},r,n]),c.forEach((e=>e.destroy()))),e.length<=t+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,e])):gr(e,t+1)}}},br=(e,t,n=null,r=!0)=>{const o=e._transactionCleanups;let i=!1,s=null;null===e._transaction&&(i=!0,e._transaction=new hr(e,n,r),o.push(e._transaction),1===o.length&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{s=t(e._transaction)}finally{if(i){const t=e._transaction===o[0];e._transaction=null,t&&gr(o,0)}}return s};class vr{constructor(e,t){this.gen=function*(e){const t=it(e.restDecoder);for(let n=0;nwr(e,jn,Nn),xr=(e,t)=>{if(e.constructor===Io){const{client:n,clock:r}=e.id;return new Io(Jn(n,r+t),e.length-t)}if(e.constructor===Xo){const{client:n,clock:r}=e.id;return new Xo(Jn(n,r+t),e.length-t)}{const n=e,{client:r,clock:o}=n.id;return new Ko(Jn(r,o+t),null,Jn(r,o+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},wr=(e,t=Bn,n=Mn)=>{if(1===e.length)return e[0];const r=e.map((e=>new t(nt(e))));let o=r.map((e=>new vr(e,!0))),i=null;const s=new n,a=new yr(s);for(;o=o.filter((e=>null!==e.curr)),o.sort(((e,t)=>{if(e.curr.id.client===t.curr.id.client){const n=e.curr.id.clock-t.curr.id.clock;return 0===n?e.curr.constructor===t.curr.constructor?0:e.curr.constructor===Xo?1:-1:n}return t.curr.id.client-e.curr.id.client})),0!==o.length;){const e=o[0],t=e.curr.id.client;if(null!==i){let n=e.curr,r=!1;for(;null!==n&&n.id.clock+n.length<=i.struct.id.clock+i.struct.length&&n.id.client>=i.struct.id.client;)n=e.next(),r=!0;if(null===n||n.id.client!==t||r&&n.id.clock>i.struct.id.clock+i.struct.length)continue;if(t!==i.struct.id.client)Sr(a,i.struct,i.offset),i={struct:n,offset:0},e.next();else if(i.struct.id.clock+i.struct.length0&&(i.struct.constructor===Xo?i.struct.length-=t:n=xr(n,t)),i.struct.mergeWith(n)||(Sr(a,i.struct,i.offset),i={struct:n,offset:0},e.next())}}else i={struct:e.curr,offset:0},e.next();for(let n=e.curr;null!==n&&n.id.client===t&&n.id.clock===i.struct.id.clock+i.struct.length&&n.constructor!==Xo;n=e.next())Sr(a,i.struct,i.offset),i={struct:n,offset:0}}null!==i&&(Sr(a,i.struct,i.offset),i=null),Ar(a);const l=(e=>{const t=new bn;for(let n=0;n{if(!t.clients.has(o)){const i=r.slice();for(let t=n+1;tCn(e))));return kn(s,l),s.toUint8Array()},kr=(e,t,n=Bn,r=Mn)=>{const o=Un(t),i=new r,s=new yr(i),a=new n(nt(e)),l=new vr(a,!1);for(;l.curr;){const e=l.curr,t=e.id.client,n=o.get(t)||0;if(l.curr.constructor!==Xo)if(e.id.clock+e.length>n)for(Sr(s,e,me(n-e.id.clock,0)),l.next();l.curr&&l.curr.id.client===t;)Sr(s,l.curr,0),l.next();else for(;l.curr&&l.curr.id.client===t&&l.curr.id.clock+l.curr.length<=n;)l.next();else l.next()}Ar(s);const c=Cn(a);return kn(i,c),i.toUint8Array()},Cr=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:Be(e.encoder.restEncoder)}),e.encoder.restEncoder=Te(),e.written=0)},Sr=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&Cr(e),0===e.written&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),De(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},Ar=e=>{Cr(e);const t=e.encoder.restEncoder;De(t,e.clientStructs.length);for(let n=0;n((e,t,n,r)=>{const o=new n(nt(e)),i=new vr(o,!1),s=new r,a=new yr(s);for(let e=i.curr;null!==e;e=i.next())Sr(a,t(e),0);Ar(a);const l=Cn(o);return kn(s,l),s.toUint8Array()})(e,Bt,Bn,Nn),Ir="You must not compute changes after the event-handler fired.";class jr{constructor(e,t){this.target=e,this.currentTarget=e,this.transaction=t,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=Tr(this.currentTarget,this.target))}deletes(e){return yn(this.transaction.deleteSet,e.id)}get keys(){if(null===this._keys){if(0===this.transaction.doc._transactionCleanups.length)throw Je(Ir);const e=new Map,t=this.target;this.transaction.changed.get(t).forEach((n=>{if(null!==n){const r=t._map.get(n);let o,i;if(this.adds(r)){let e=r.left;for(;null!==e&&this.adds(e);)e=e.left;if(this.deletes(r)){if(null===e||!this.deletes(e))return;o="delete",i=se(e.content.getContent())}else null!==e&&this.deletes(e)?(o="update",i=se(e.content.getContent())):(o="add",i=void 0)}else{if(!this.deletes(r))return;o="delete",i=se(r.content.getContent())}e.set(n,{action:o,oldValue:i})}})),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(null===e){if(0===this.transaction.doc._transactionCleanups.length)throw Je(Ir);const t=this.target,n=ie(),r=ie(),o=[];if(e={added:n,deleted:r,delta:o,keys:this.keys},this.transaction.changed.get(t).has(null)){let e=null;const i=()=>{e&&o.push(e)};for(let o=t._start;null!==o;o=o.right)o.deleted?this.deletes(o)&&!this.adds(o)&&(null!==e&&void 0!==e.delete||(i(),e={delete:0}),e.delete+=o.length,r.add(o)):this.adds(o)?(null!==e&&void 0!==e.insert||(i(),e={insert:[]}),e.insert=e.insert.concat(o.content.getContent()),n.add(o)):(null!==e&&void 0!==e.retain||(i(),e={retain:0}),e.retain+=o.length);null!==e&&void 0===e.retain&&i()}this._changes=e}return e}}const Tr=(e,t)=>{const n=[];for(;null!==t._item&&t!==e;){if(null!==t._item.parentSub)n.unshift(t._item.parentSub);else{let e=0,r=t._item.parent._start;for(;r!==t._item&&null!==r;)r.deleted||e++,r=r.right;n.unshift(e)}t=t._item.parent}return n};let Br=0;class Rr{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=Br++}}const Nr=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=Br++},Dr=(e,t)=>{if(null===e._start||0===t||null===e._searchMarker)return null;const n=0===e._searchMarker.length?null:e._searchMarker.reduce(((e,n)=>he(t-e.index){e.timestamp=Br++})(n));null!==r.right&&ot;)r=r.left,!r.deleted&&r.countable&&(o-=r.length);for(;null!==r.left&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(o-=r.length);return null!==n&&he(n.index-o){if(e.length>=80){const r=e.reduce(((e,t)=>e.timestamp{for(let r=e.length-1;r>=0;r--){const o=e[r];if(n>0){let t=o.p;for(t.marker=!1;t&&(t.deleted||!t.countable);)t=t.left,t&&!t.deleted&&t.countable&&(o.index-=t.length);if(null===t||!0===t.marker){e.splice(r,1);continue}o.p=t,t.marker=!0}(t0&&t===o.index)&&(o.index=me(t,o.index+n))}},Pr=(e,t,n)=>{const r=e,o=t.changedParentTypes;for(;oe(o,e,(()=>[])).push(n),null!==e._item;)e=e._item.parent;qn(r._eH,n,t)};class Or{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=$n(),this._dEH=$n(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw Xe()}clone(){throw Xe()}_write(e){}get _first(){let e=this._start;for(;null!==e&&e.deleted;)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){Wn(this._eH,e)}observeDeep(e){Wn(this._dEH,e)}unobserve(e){Gn(this._eH,e)}unobserveDeep(e){Gn(this._dEH,e)}toJSON(){}}const Lr=(e,t,n)=>{t<0&&(t=e._length+t),n<0&&(n=e._length+n);let r=n-t;const o=[];let i=e._start;for(;null!==i&&r>0;){if(i.countable&&!i.deleted){const e=i.content.getContent();if(e.length<=t)t-=e.length;else{for(let n=t;n0;n++)o.push(e[n]),r--;t=0}}i=i.right}return o},Fr=e=>{const t=[];let n=e._start;for(;null!==n;){if(n.countable&&!n.deleted){const e=n.content.getContent();for(let n=0;n{let n=0,r=e._start;for(;null!==r;){if(r.countable&&!r.deleted){const o=r.content.getContent();for(let r=0;r{const n=[];return zr(e,((r,o)=>{n.push(t(r,o,e))})),n},Vr=e=>{let t=e._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(null===n){for(;null!==t&&t.deleted;)t=t.right;if(null===t)return{done:!0,value:void 0};n=t.content.getContent(),r=0,t=t.right}const e=n[r++];return n.length<=r&&(n=null),{done:!1,value:e}}}},Hr=(e,t)=>{const n=Dr(e,t);let r=e._start;for(null!==n&&(r=n.p,t-=n.index);null!==r;r=r.right)if(!r.deleted&&r.countable){if(t{let o=n;const i=e.doc,s=i.clientID,a=i.store,l=null===n?t._start:n.right;let c=[];const u=()=>{c.length>0&&(o=new Ko(Jn(s,or(a,s)),o,o&&o.lastId,l,l&&l.id,t,null,new Po(c)),o.integrate(e,0),c=[])};r.forEach((n=>{if(null===n)c.push(n);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:c.push(n);break;default:switch(u(),n.constructor){case Uint8Array:case ArrayBuffer:o=new Ko(Jn(s,or(a,s)),o,o&&o.lastId,l,l&&l.id,t,null,new jo(new Uint8Array(n))),o.integrate(e,0);break;case En:o=new Ko(Jn(s,or(a,s)),o,o&&o.lastId,l,l&&l.id,t,null,new Ro(n)),o.integrate(e,0);break;default:if(!(n instanceof Or))throw new Error("Unexpected content type in insert operation");o=new Ko(Jn(s,or(a,s)),o,o&&o.lastId,l,l&&l.id,t,null,new Go(n)),o.integrate(e,0)}}})),u()},Wr=()=>Je("Length exceeded!"),Gr=(e,t,n,r)=>{if(n>t._length)throw Wr();if(0===n)return t._searchMarker&&Mr(t._searchMarker,n,r.length),$r(e,t,null,r);const o=n,i=Dr(t,n);let s=t._start;for(null!==i&&(s=i.p,0==(n-=i.index)&&(s=s.prev,n+=s&&s.countable&&!s.deleted?s.length:0));null!==s;s=s.right)if(!s.deleted&&s.countable){if(n<=s.length){n{if(0===r)return;const o=n,i=r,s=Dr(t,n);let a=t._start;for(null!==s&&(a=s.p,n-=s.index);null!==a&&n>0;a=a.right)!a.deleted&&a.countable&&(n0&&null!==a;)a.deleted||(r0)throw Wr();t._searchMarker&&Mr(t._searchMarker,o,-i+r)},Kr=(e,t,n)=>{const r=t._map.get(n);void 0!==r&&r.delete(e)},Yr=(e,t,n,r)=>{const o=t._map.get(n)||null,i=e.doc,s=i.clientID;let a;if(null==r)a=new Po([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:a=new Po([r]);break;case Uint8Array:a=new jo(r);break;case En:a=new Ro(r);break;default:if(!(r instanceof Or))throw new Error("Unexpected content type");a=new Go(r)}new Ko(Jn(s,or(i.store,s)),o,o&&o.lastId,null,null,t,n,a).integrate(e,0)},Jr=(e,t)=>{const n=e._map.get(t);return void 0===n||n.deleted?void 0:n.content.getContent()[n.length-1]},Xr=e=>{const t={};return e._map.forEach(((e,n)=>{e.deleted||(t[n]=e.content.getContent()[e.length-1])})),t},Zr=(e,t)=>{const n=e._map.get(t);return void 0!==n&&!n.deleted},Qr=e=>{return t=e.entries(),fn((()=>{let e;do{e=t.next()}while(!e.done&&e.value[1].deleted);return e}));var t};class eo extends jr{constructor(e,t){super(e,t),this._transaction=t}}class to extends Or{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const t=new to;return t.push(e),t}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new to}clone(){const e=new to;return e.insert(0,this.toArray().map((e=>e instanceof Or?e.clone():e))),e}get length(){return null===this._prelimContent?this._length:this._prelimContent.length}_callObserver(e,t){super._callObserver(e,t),Pr(this,e,new eo(this,e))}insert(e,t){null!==this.doc?br(this.doc,(n=>{Gr(n,this,e,t)})):this._prelimContent.splice(e,0,...t)}push(e){null!==this.doc?br(this.doc,(t=>{((e,t,n)=>{let r=(t._searchMarker||[]).reduce(((e,t)=>t.index>e.index?t:e),{index:0,p:t._start}).p;if(r)for(;r.right;)r=r.right;$r(e,t,r,n)})(t,this,e)})):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,t=1){null!==this.doc?br(this.doc,(n=>{qr(n,this,e,t)})):this._prelimContent.splice(e,t)}get(e){return Hr(this,e)}toArray(){return Fr(this)}slice(e=0,t=this.length){return Lr(this,e,t)}toJSON(){return this.map((e=>e instanceof Or?e.toJSON():e))}map(e){return Ur(this,e)}forEach(e){zr(this,e)}[Symbol.iterator](){return Vr(this)}_write(e){e.writeTypeRef(Fo)}}class no extends jr{constructor(e,t,n){super(e,t),this.keysChanged=n}}class ro extends Or{constructor(e){super(),this._prelimContent=null,this._prelimContent=void 0===e?new Map:new Map(e)}_integrate(e,t){super._integrate(e,t),this._prelimContent.forEach(((e,t)=>{this.set(t,e)})),this._prelimContent=null}_copy(){return new ro}clone(){const e=new ro;return this.forEach(((t,n)=>{e.set(n,t instanceof Or?t.clone():t)})),e}_callObserver(e,t){Pr(this,e,new no(this,e,t))}toJSON(){const e={};return this._map.forEach(((t,n)=>{if(!t.deleted){const r=t.content.getContent()[t.length-1];e[n]=r instanceof Or?r.toJSON():r}})),e}get size(){return[...Qr(this._map)].length}keys(){return mn(Qr(this._map),(e=>e[0]))}values(){return mn(Qr(this._map),(e=>e[1].content.getContent()[e[1].length-1]))}entries(){return mn(Qr(this._map),(e=>[e[0],e[1].content.getContent()[e[1].length-1]]))}forEach(e){this._map.forEach(((t,n)=>{t.deleted||e(t.content.getContent()[t.length-1],n,this)}))}[Symbol.iterator](){return this.entries()}delete(e){null!==this.doc?br(this.doc,(t=>{Kr(t,this,e)})):this._prelimContent.delete(e)}set(e,t){return null!==this.doc?br(this.doc,(n=>{Yr(n,this,e,t)})):this._prelimContent.set(e,t),t}get(e){return Jr(this,e)}has(e){return Zr(this,e)}clear(){null!==this.doc?br(this.doc,(e=>{this.forEach((function(t,n,r){Kr(e,r,n)}))})):this._prelimContent.clear()}_write(e){e.writeTypeRef(zo)}}const oo=(e,t)=>e===t||"object"==typeof e&&"object"==typeof t&&e&&t&&((e,t)=>e===t||Et(e)===Et(t)&&((e,t)=>{for(const n in e)if(!t(e[n],n))return!1;return!0})(e,((e,n)=>(void 0!==e||It(t,n))&&t[n]===e)))(e,t);class io{constructor(e,t,n,r){this.left=e,this.right=t,this.index=n,this.currentAttributes=r}forward(){null===this.right&&Ze(),this.right.content.constructor===Do?this.right.deleted||co(this.currentAttributes,this.right.content):this.right.deleted||(this.index+=this.right.length),this.left=this.right,this.right=this.right.right}}const so=(e,t,n)=>{for(;null!==t.right&&n>0;)t.right.content.constructor===Do?t.right.deleted||co(t.currentAttributes,t.right.content):t.right.deleted||(n{const o=new Map,i=r?Dr(t,n):null;if(i){const t=new io(i.p.left,i.p,i.index,o);return so(e,t,n-i.index)}{const r=new io(null,t._start,0,o);return so(e,r,n)}},lo=(e,t,n,r)=>{for(;null!==n.right&&(!0===n.right.deleted||n.right.content.constructor===Do&&oo(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();const o=e.doc,i=o.clientID;r.forEach(((r,s)=>{const a=n.left,l=n.right,c=new Ko(Jn(i,or(o.store,i)),a,a&&a.lastId,l,l&&l.id,t,null,new Do(s,r));c.integrate(e,0),n.right=c,n.forward()}))},co=(e,t)=>{const{key:n,value:r}=t;null===r?e.delete(n):e.set(n,r)},uo=(e,t)=>{for(;null!==e.right&&(e.right.deleted||e.right.content.constructor===Do&&oo(t[e.right.content.key]||null,e.right.content.value));)e.forward()},ho=(e,t,n,r)=>{const o=e.doc,i=o.clientID,s=new Map;for(const a in r){const l=r[a],c=n.currentAttributes.get(a)||null;if(!oo(c,l)){s.set(a,c);const{left:r,right:u}=n;n.right=new Ko(Jn(i,or(o.store,i)),r,r&&r.lastId,u,u&&u.id,t,null,new Do(a,l)),n.right.integrate(e,0),n.forward()}}return s},po=(e,t,n,r,o)=>{n.currentAttributes.forEach(((e,t)=>{void 0===o[t]&&(o[t]=null)}));const i=e.doc,s=i.clientID;uo(n,o);const a=ho(e,t,n,o),l=r.constructor===String?new Oo(r):r instanceof Or?new Go(r):new No(r);let{left:c,right:u,index:d}=n;t._searchMarker&&Mr(t._searchMarker,n.index,l.getLength()),u=new Ko(Jn(s,or(i.store,s)),c,c&&c.lastId,u,u&&u.id,t,null,l),u.integrate(e,0),n.right=u,n.index=d,n.forward(),lo(e,t,n,a)},fo=(e,t,n,r,o)=>{const i=e.doc,s=i.clientID;uo(n,o);const a=ho(e,t,n,o);e:for(;null!==n.right&&(r>0||a.size>0&&(n.right.deleted||n.right.content.constructor===Do));){if(!n.right.deleted)switch(n.right.content.constructor){case Do:{const{key:t,value:i}=n.right.content,s=o[t];if(void 0!==s){if(oo(s,i))a.delete(t);else{if(0===r)break e;a.set(t,i)}n.right.delete(e)}else n.currentAttributes.set(t,i);break}default:r0){let o="";for(;r>0;r--)o+="\n";n.right=new Ko(Jn(s,or(i.store,s)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new Oo(o)),n.right.integrate(e,0),n.forward()}lo(e,t,n,a)},mo=(e,t,n,r,o)=>{let i=t;const s=ne();for(;i&&(!i.countable||i.deleted);){if(!i.deleted&&i.content.constructor===Do){const e=i.content;s.set(e.key,e)}i=i.right}let a=0,l=!1;for(;t!==i;){if(n===t&&(l=!0),!t.deleted){const n=t.content;switch(n.constructor){case Do:{const{key:i,value:c}=n,u=r.get(i)||null;s.get(i)===n&&u!==c||(t.delete(e),a++,l||(o.get(i)||null)!==c||u===c||(null===u?o.delete(i):o.set(i,u))),l||t.deleted||co(o,n);break}}}t=t.right}return a},go=e=>{let t=0;return br(e.doc,(n=>{let r=e._start,o=e._start,i=ne();const s=re(i);for(;o;)!1===o.deleted&&(o.content.constructor===Do?co(s,o.content):(t+=mo(n,r,o,i,s),i=re(s),r=o)),o=o.right})),t},bo=e=>{const t=new Set,n=e.doc;for(const[r,o]of e.afterState.entries()){const i=e.beforeState.get(r)||0;o!==i&&dr(e,n.store.clients.get(r),i,o,(e=>{e.deleted||e.content.constructor!==Do||e.constructor===Io||t.add(e.parent)}))}br(n,(n=>{vn(e,e.deleteSet,(e=>{if(e instanceof Io||!e.parent._hasFormatting||t.has(e.parent))return;const r=e.parent;e.content.constructor===Do?t.add(r):((e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;const n=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===Do){const r=t.content.key;n.has(r)?t.delete(e):n.add(r)}t=t.left}})(n,e)}));for(const e of t)go(e)}))},vo=(e,t,n)=>{const r=n,o=re(t.currentAttributes),i=t.right;for(;n>0&&null!==t.right;){if(!1===t.right.deleted)switch(t.right.content.constructor){case Go:case No:case Oo:n{null===e?this.childListChanged=!0:this.keysChanged.add(e)}))}get changes(){if(null===this._changes){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(null===this._delta){const e=this.target.doc,t=[];br(e,(e=>{const n=new Map,r=new Map;let o=this.target._start,i=null;const s={};let a="",l=0,c=0;const u=()=>{if(null!==i){let e=null;switch(i){case"delete":c>0&&(e={delete:c}),c=0;break;case"insert":("object"==typeof a||a.length>0)&&(e={insert:a},n.size>0&&(e.attributes={},n.forEach(((t,n)=>{null!==t&&(e.attributes[n]=t)})))),a="";break;case"retain":l>0&&(e={retain:l},(e=>{for(const t in e)return!1;return!0})(s)||(e.attributes=St({},s))),l=0}e&&t.push(e),i=null}};for(;null!==o;){switch(o.content.constructor){case Go:case No:this.adds(o)?this.deletes(o)||(u(),i="insert",a=o.content.getContent()[0],u()):this.deletes(o)?("delete"!==i&&(u(),i="delete"),c+=1):o.deleted||("retain"!==i&&(u(),i="retain"),l+=1);break;case Oo:this.adds(o)?this.deletes(o)||("insert"!==i&&(u(),i="insert"),a+=o.content.str):this.deletes(o)?("delete"!==i&&(u(),i="delete"),c+=o.length):o.deleted||("retain"!==i&&(u(),i="retain"),l+=o.length);break;case Do:{const{key:t,value:a}=o.content;if(this.adds(o)){if(!this.deletes(o)){const l=n.get(t)||null;oo(l,a)?null!==a&&o.delete(e):("retain"===i&&u(),oo(a,r.get(t)||null)?delete s[t]:s[t]=a)}}else if(this.deletes(o)){r.set(t,a);const e=n.get(t)||null;oo(e,a)||("retain"===i&&u(),s[t]=e)}else if(!o.deleted){r.set(t,a);const n=s[t];void 0!==n&&(oo(n,a)?null!==n&&o.delete(e):("retain"===i&&u(),null===a?delete s[t]:s[t]=a))}o.deleted||("insert"===i&&u(),co(n,o.content));break}}o=o.right}for(u();t.length>0;){const e=t[t.length-1];if(void 0===e.retain||void 0!==e.attributes)break;t.pop()}})),this._delta=t}return this._delta}}class _o extends Or{constructor(e){super(),this._pending=void 0!==e?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach((e=>e()))}catch(e){console.error(e)}this._pending=null}_copy(){return new _o}clone(){const e=new _o;return e.applyDelta(this.toDelta()),e}_callObserver(e,t){super._callObserver(e,t);const n=new yo(this,e,t);Pr(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){let e="",t=this._start;for(;null!==t;)!t.deleted&&t.countable&&t.content.constructor===Oo&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){null!==this.doc?br(this.doc,(n=>{const r=new io(null,this._start,0,new Map);for(let o=0;o0)&&po(n,this,r,s,i.attributes||{})}else void 0!==i.retain?fo(n,this,r,i.retain,i.attributes||{}):void 0!==i.delete&&vo(n,r,i.delete)}})):this._pending.push((()=>this.applyDelta(e)))}toDelta(e,t,n){const r=[],o=new Map,i=this.doc;let s="",a=this._start;function l(){if(s.length>0){const e={};let t=!1;o.forEach(((n,r)=>{t=!0,e[r]=n}));const n={insert:s};t&&(n.attributes=e),r.push(n),s=""}}const c=()=>{for(;null!==a;){if(Zn(a,e)||void 0!==t&&Zn(a,t))switch(a.content.constructor){case Oo:{const r=o.get("ychange");void 0===e||Zn(a,e)?void 0===t||Zn(a,t)?void 0!==r&&(l(),o.delete("ychange")):void 0!==r&&r.user===a.id.client&&"added"===r.type||(l(),o.set("ychange",n?n("added",a.id):{type:"added"})):void 0!==r&&r.user===a.id.client&&"removed"===r.type||(l(),o.set("ychange",n?n("removed",a.id):{type:"removed"})),s+=a.content.str;break}case Go:case No:{l();const e={insert:a.content.getContent()[0]};if(o.size>0){const t={};e.attributes=t,o.forEach(((e,n)=>{t[n]=e}))}r.push(e);break}case Do:Zn(a,e)&&(l(),co(o,a.content))}a=a.right}l()};return e||t?br(i,(n=>{e&&Qn(n,e),t&&Qn(n,t),c()}),"cleanup"):c(),r}insert(e,t,n){if(t.length<=0)return;const r=this.doc;null!==r?br(r,(r=>{const o=ao(r,this,e,!n);n||(n={},o.currentAttributes.forEach(((e,t)=>{n[t]=e}))),po(r,this,o,t,n)})):this._pending.push((()=>this.insert(e,t,n)))}insertEmbed(e,t,n){const r=this.doc;null!==r?br(r,(r=>{const o=ao(r,this,e,!n);po(r,this,o,t,n||{})})):this._pending.push((()=>this.insertEmbed(e,t,n||{})))}delete(e,t){if(0===t)return;const n=this.doc;null!==n?br(n,(n=>{vo(n,ao(n,this,e,!0),t)})):this._pending.push((()=>this.delete(e,t)))}format(e,t,n){if(0===t)return;const r=this.doc;null!==r?br(r,(r=>{const o=ao(r,this,e,!1);null!==o.right&&fo(r,this,o,t,n)})):this._pending.push((()=>this.format(e,t,n)))}removeAttribute(e){null!==this.doc?br(this.doc,(t=>{Kr(t,this,e)})):this._pending.push((()=>this.removeAttribute(e)))}setAttribute(e,t){null!==this.doc?br(this.doc,(n=>{Yr(n,this,e,t)})):this._pending.push((()=>this.setAttribute(e,t)))}getAttribute(e){return Jr(this,e)}getAttributes(){return Xr(this)}_write(e){e.writeTypeRef(Uo)}}class xo{constructor(e,t=(()=>!0)){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(null!==e&&(!this._firstCall||e.deleted||!this._filter(t)))do{if(t=e.content.type,e.deleted||t.constructor!==ko&&t.constructor!==wo||null===t._start)for(;null!==e;){if(null!==e.right){e=e.right;break}e=e.parent===this._root?null:e.parent._item}else e=t._start}while(null!==e&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,null===e?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class wo extends Or{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new wo}clone(){const e=new wo;return e.insert(0,this.toArray().map((e=>e instanceof Or?e.clone():e))),e}get length(){return null===this._prelimContent?this._length:this._prelimContent.length}createTreeWalker(e){return new xo(this,e)}querySelector(e){e=e.toUpperCase();const t=new xo(this,(t=>t.nodeName&&t.nodeName.toUpperCase()===e)).next();return t.done?null:t.value}querySelectorAll(e){return e=e.toUpperCase(),le(new xo(this,(t=>t.nodeName&&t.nodeName.toUpperCase()===e)))}_callObserver(e,t){Pr(this,e,new Co(this,t,e))}toString(){return Ur(this,(e=>e.toString())).join("")}toJSON(){return this.toString()}toDOM(e=document,t={},n){const r=e.createDocumentFragment();return void 0!==n&&n._createAssociation(r,this),zr(this,(o=>{r.insertBefore(o.toDOM(e,t,n),null)})),r}insert(e,t){null!==this.doc?br(this.doc,(n=>{Gr(n,this,e,t)})):this._prelimContent.splice(e,0,...t)}insertAfter(e,t){if(null!==this.doc)br(this.doc,(n=>{const r=e&&e instanceof Or?e._item:e;$r(n,this,r,t)}));else{const n=this._prelimContent,r=null===e?0:n.findIndex((t=>t===e))+1;if(0===r&&null!==e)throw Je("Reference item not found");n.splice(r,0,...t)}}delete(e,t=1){null!==this.doc?br(this.doc,(n=>{qr(n,this,e,t)})):this._prelimContent.splice(e,t)}toArray(){return Fr(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return Hr(this,e)}slice(e=0,t=this.length){return Lr(this,e,t)}forEach(e){zr(this,e)}_write(e){e.writeTypeRef(Ho)}}class ko extends wo{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach(((e,t)=>{this.setAttribute(t,e)})),this._prelimAttrs=null}_copy(){return new ko(this.nodeName)}clone(){const e=new ko(this.nodeName);return((e,t)=>{for(const n in e)t(e[n],n)})(this.getAttributes(),((t,n)=>{"string"==typeof t&&e.setAttribute(n,t)})),e.insert(0,this.toArray().map((e=>e instanceof Or?e.clone():e))),e}toString(){const e=this.getAttributes(),t=[],n=[];for(const t in e)n.push(t);n.sort();const r=n.length;for(let o=0;o0?" "+t.join(" "):""}>${super.toString()}`}removeAttribute(e){null!==this.doc?br(this.doc,(t=>{Kr(t,this,e)})):this._prelimAttrs.delete(e)}setAttribute(e,t){null!==this.doc?br(this.doc,(n=>{Yr(n,this,e,t)})):this._prelimAttrs.set(e,t)}getAttribute(e){return Jr(this,e)}hasAttribute(e){return Zr(this,e)}getAttributes(e){return e?((e,t)=>{const n={};return this._map.forEach(((e,r)=>{let o=e;for(;null!==o&&(!t.sv.has(o.id.client)||o.id.clock>=(t.sv.get(o.id.client)||0));)o=o.left;null!==o&&Zn(o,t)&&(n[r]=o.content.getContent()[o.length-1])})),n})(0,e):Xr(this)}toDOM(e=document,t={},n){const r=e.createElement(this.nodeName),o=this.getAttributes();for(const e in o){const t=o[e];"string"==typeof t&&r.setAttribute(e,t)}return zr(this,(o=>{r.appendChild(o.toDOM(e,t,n))})),void 0!==n&&n._createAssociation(r,this),r}_write(e){e.writeTypeRef(Vo),e.writeKey(this.nodeName)}}class Co extends jr{constructor(e,t,n){super(e,n),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach((e=>{null===e?this.childListChanged=!0:this.attributesChanged.add(e)}))}}class So extends ro{constructor(e){super(),this.hookName=e}_copy(){return new So(this.hookName)}clone(){const e=new So(this.hookName);return this.forEach(((t,n)=>{e.set(n,t)})),e}toDOM(e=document,t={},n){const r=t[this.hookName];let o;return o=void 0!==r?r.createDom(this):document.createElement(this.hookName),o.setAttribute("data-yjs-hook",this.hookName),void 0!==n&&n._createAssociation(o,this),o}_write(e){e.writeTypeRef($o),e.writeKey(this.hookName)}}class Ao extends _o{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new Ao}clone(){const e=new Ao;return e.applyDelta(this.toDelta()),e}toDOM(e=document,t,n){const r=e.createTextNode(this.toString());return void 0!==n&&n._createAssociation(r,this),r}toString(){return this.toDelta().map((e=>{const t=[];for(const n in e.attributes){const r=[];for(const t in e.attributes[n])r.push({key:t,value:e.attributes[n][t]});r.sort(((e,t)=>e.keye.nodeName=0;e--)n+=``;return n})).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(Wo)}}class Eo{constructor(e,t){this.id=e,this.length=t}get deleted(){throw Xe()}mergeWith(e){return!1}write(e,t,n){throw Xe()}integrate(e,t){throw Xe()}}class Io extends Eo{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),ir(e.doc.store,this)}write(e,t){e.writeInfo(0),e.writeLen(this.length-t)}getMissing(e,t){return null}}class jo{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new jo(this.content)}splice(e){throw Xe()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}}class To{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new To(this.len)}splice(e){const t=new To(this.len-e);return this.len=e,t}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){xn(e.deleteSet,t.id.client,t.id.clock,this.len),t.markDeleted()}delete(e){}gc(e){}write(e,t){e.writeLen(this.len-t)}getRef(){return 1}}const Bo=(e,t)=>new En({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1});class Ro{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),null!==e.meta&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new Ro(Bo(this.doc.guid,this.opts))}splice(e){throw Xe()}mergeWith(e){return!1}integrate(e,t){this.doc._item=t,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,t){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}class No{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new No(this.embed)}splice(e){throw Xe()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}}class Do{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new Do(this.key,this.value)}splice(e){throw Xe()}mergeWith(e){return!1}integrate(e,t){const n=t.parent;n._searchMarker=null,n._hasFormatting=!0}delete(e){}gc(e){}write(e,t){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}class Mo{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Mo(this.arr)}splice(e){const t=new Mo(this.arr.slice(e));return this.arr=this.arr.slice(0,e),t}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){const n=this.arr.length;e.writeLen(n-t);for(let r=t;r=55296&&n<=56319&&(this.str=this.str.slice(0,e-1)+"�",t.str="�"+t.str.slice(1)),t}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(0===t?this.str:this.str.slice(t))}getRef(){return 4}}const Lo=[e=>new to,e=>new ro,e=>new _o,e=>new ko(e.readKey()),e=>new wo,e=>new So(e.readKey()),e=>new Ao],Fo=0,zo=1,Uo=2,Vo=3,Ho=4,$o=5,Wo=6;class Go{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new Go(this.type._copy())}splice(e){throw Xe()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;for(;null!==t;)t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e),t=t.right;this.type._map.forEach((t=>{t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e)})),e.changed.delete(this.type)}gc(e){let t=this.type._start;for(;null!==t;)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach((t=>{for(;null!==t;)t.gc(e,!0),t=t.left})),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}}const qo=(e,t,n)=>{const{client:r,clock:o}=t.id,i=new Ko(Jn(r,o+n),t,Jn(r,o+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&i.markDeleted(),t.keep&&(i.keep=!0),null!==t.redone&&(i.redone=Jn(t.redone.client,t.redone.clock+n)),t.right=i,null!==i.right&&(i.right.left=i),e._mergeStructs.push(i),null!==i.parentSub&&null===i.right&&i.parent._map.set(i.parentSub,i),t.length=n,i};class Ko extends Eo{constructor(e,t,n,r,o,i,s,a){super(e,a.getLength()),this.origin=n,this.left=t,this.right=r,this.rightOrigin=o,this.parent=i,this.parentSub=s,this.redone=null,this.content=a,this.info=this.content.isCountable()?2:0}set marker(e){(8&this.info)>0!==e&&(this.info^=8)}get marker(){return(8&this.info)>0}get keep(){return(1&this.info)>0}set keep(e){this.keep!==e&&(this.info^=1)}get countable(){return(2&this.info)>0}get deleted(){return(4&this.info)>0}set deleted(e){this.deleted!==e&&(this.info^=4)}markDeleted(){this.info|=4}getMissing(e,t){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=or(t,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=or(t,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===Kn&&this.id.client!==this.parent.client&&this.parent.clock>=or(t,this.parent.client))return this.parent.client;if(this.origin&&(this.left=ur(e,t,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=cr(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===Io||this.right&&this.right.constructor===Io)this.parent=null;else if(this.parent){if(this.parent.constructor===Kn){const e=ar(t,this.parent);e.constructor===Io?this.parent=null:this.parent=e.content.type}}else this.left&&this.left.constructor===Ko&&(this.parent=this.left.parent,this.parentSub=this.left.parentSub),this.right&&this.right.constructor===Ko&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=ur(e,e.doc.store,Jn(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||null!==this.right.left)||this.left&&this.left.right!==this.right){let t,n=this.left;if(null!==n)t=n.right;else if(null!==this.parentSub)for(t=this.parent._map.get(this.parentSub)||null;null!==t&&null!==t.left;)t=t.left;else t=this.parent._start;const r=new Set,o=new Set;for(;null!==t&&t!==this.right;){if(o.add(t),r.add(t),Yn(this.origin,t.origin)){if(t.id.client{t.p===e&&(t.p=this,!this.deleted&&this.countable&&(t.index-=this.length))})),e.keep&&(this.keep=!0),this.right=e.right,null!==this.right&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const t=this.parent;this.countable&&null===this.parentSub&&(t._length-=this.length),this.markDeleted(),xn(e.deleteSet,this.id.client,this.id.clock,this.length),fr(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw Ze();this.content.gc(e),t?((e,t,n)=>{const r=e.clients.get(t.id.client);r[sr(r,t.id.clock)]=n})(e,this,new Io(this.id,this.length)):this.content=new To(this.length)}write(e,t){const n=t>0?Jn(this.id.client,this.id.clock+t-1):this.origin,r=this.rightOrigin,o=this.parentSub,i=31&this.content.getRef()|(null===n?0:ve)|(null===r?0:be)|(null===o?0:32);if(e.writeInfo(i),null!==n&&e.writeLeftID(n),null!==r&&e.writeRightID(r),null===n&&null===r){const t=this.parent;if(void 0!==t._item){const n=t._item;if(null===n){const n=(e=>{for(const[t,n]of e.doc.share.entries())if(n===e)return t;throw Ze()})(t);e.writeParentInfo(!0),e.writeString(n)}else e.writeParentInfo(!1),e.writeLeftID(n.id)}else t.constructor===String?(e.writeParentInfo(!0),e.writeString(t)):t.constructor===Kn?(e.writeParentInfo(!1),e.writeLeftID(t)):Ze();null!==o&&e.writeString(o)}this.content.write(e,t)}}const Yo=(e,t)=>Jo[31&t](e),Jo=[()=>{Ze()},e=>new To(e.readLen()),e=>{const t=e.readLen(),n=[];for(let r=0;rnew jo(e.readBuf()),e=>new Oo(e.readString()),e=>new No(e.readJSON()),e=>new Do(e.readKey(),e.readJSON()),e=>new Go(Lo[e.readTypeRef()](e)),e=>{const t=e.readLen(),n=[];for(let r=0;rnew Ro(Bo(e.readString(),e.readAny())),()=>{Ze()}];class Xo extends Eo{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){Ze()}write(e,t){e.writeInfo(10),De(e.restEncoder,this.length-t)}getMissing(e,t){return null}}const Zo="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},Qo="__ $YJS$ __";!0===Zo[Qo]&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438"),Zo[Qo]=!0;const ei=(e,t)=>{const n={},r={},o={};return{register:function(e,t){n[e]=t},bootstrap:async function(i,s,a){const l=new En;o[i]=o[i]||{},o[i][s]=l;const c=()=>{const e=n[i].fromCRDTDoc(l);a(e)};l.on("update",c);const u=await e(s,i,l);t&&await t(s,i,l);const d=n[i].fetch;d&&d(s).then((e=>{l.transact((()=>{n[i].applyChangesToDoc(l,e)}))})),r[i]=r[i]||{},r[i][s]=()=>{u(),l.off("update",c)}},update:async function(e,t,r){const i=o[e][t];if(!i)throw"Error doc "+e+" "+t+" not found";i.transact((()=>{n[e].applyChangesToDoc(i,r)}))},discard:async function(e,t){r?.[e]?.[t]&&r[e][t]()}}},ti=e=>_t(((t,n)=>{e.onerror=e=>n(new Error(e.target.error)),e.onsuccess=e=>t(e.target.result)})),ni=(e,t,n="readwrite")=>{const r=e.transaction(t,n);return t.map((e=>ai(r,e)))},ri=(e,t)=>ti(e.count(t)),oi=(e,t)=>ti(e.delete(t)),ii=(e,t)=>ti(e.add(t)),si=(e,t,n,r="next")=>((e,t)=>_t(((n,r)=>{e.onerror=r,e.onsuccess=async e=>{const r=e.target.result;if(null===r||!1===await t(r))return n();r.continue()}})))(e.openKeyCursor(t,r),(e=>n(e.key))),ai=(e,t)=>e.objectStore(t),li="custom",ci="updates",ui=(e,t=(()=>{}),n=(()=>{}))=>{const[r]=ni(e.db,[ci]);return((e,t,n)=>ti(e.getAll(t,n)))(r,(o=e._dbref,IDBKeyRange.lowerBound(o,false))).then((o=>{e._destroyed||(t(r),br(e.doc,(()=>{o.forEach((t=>Ln(e.doc,t)))}),e,!1),n(r))})).then((()=>((e,t=null)=>((e,t,n)=>{let r=null;return si(e,t,(e=>(r=e,!1)),n).then((()=>r))})(e,t,"prev"))(r).then((t=>{e._dbref=t+1})))).then((()=>ri(r).then((t=>{e._dbsize=t})))).then((()=>r));var o};class di extends ue{constructor(e,t){super(),this.doc=t,this.name=e,this._dbref=0,this._dbsize=0,this._destroyed=!1,this.db=null,this.synced=!1,this._db=((e,t)=>_t(((t,n)=>{const r=indexedDB.open(e);r.onupgradeneeded=e=>((e,t)=>[["updates",{autoIncrement:!0}],["custom"]].forEach((t=>e.createObjectStore.apply(e,t))))(e.target.result),r.onerror=e=>n(Je(e.target.error)),r.onsuccess=e=>{const n=e.target.result;n.onversionchange=()=>{n.close()},t(n)}})))(e),this.whenSynced=_t((e=>this.on("synced",(()=>e(this))))),this._db.then((e=>{this.db=e,ui(this,(e=>ii(e,zn(t))),(()=>{if(this._destroyed)return this;this.synced=!0,this.emit("synced",[this])}))})),this._storeTimeout=1e3,this._storeTimeoutId=null,this._storeUpdate=(e,t)=>{if(this.db&&t!==this){const[t]=ni(this.db,[ci]);ii(t,e),++this._dbsize>=500&&(null!==this._storeTimeoutId&&clearTimeout(this._storeTimeoutId),this._storeTimeoutId=setTimeout((()=>{((e,t=!0)=>{ui(e).then((n=>{(t||e._dbsize>=500)&&ii(n,zn(e.doc)).then((()=>{return oi(n,(t=e._dbref,IDBKeyRange.upperBound(t,!0)));var t})).then((()=>ri(n).then((t=>{e._dbsize=t}))))}))})(this,!1),this._storeTimeoutId=null}),this._storeTimeout))}},t.on("update",this._storeUpdate),this.destroy=this.destroy.bind(this),t.on("destroy",this.destroy)}destroy(){return this._storeTimeoutId&&clearTimeout(this._storeTimeoutId),this.doc.off("update",this._storeUpdate),this.doc.off("destroy",this.destroy),this._destroyed=!0,this._db.then((e=>{e.close()}))}clearData(){return this.destroy().then((()=>{(e=>{ti(indexedDB.deleteDatabase(e))})(this.name)}))}get(e){return this._db.then((t=>{const[n]=ni(t,[li],"readonly");return((e,t)=>ti(e.get(t)))(n,e)}))}set(e,t){return this._db.then((n=>{const[r]=ni(n,[li]);return((e,t,n)=>ti(e.put(t,n)))(r,t,e)}))}del(e){return this._db.then((t=>{const[n]=ni(t,[li]);return oi(n,e)}))}}function hi(e,t,n){const r=new di(`${t}-${e}`,n);return new Promise((e=>{r.on("synced",(()=>{e((()=>r.destroy()))}))}))}const pi=e=>{if(e.shouldConnect&&null===e.ws){const t=new WebSocket(e.url),n=e.binaryType;let r=null;n&&(t.binaryType=n),e.ws=t,e.connecting=!0,e.connected=!1,t.onmessage=t=>{e.lastMessageReceived=Jt();const n=t.data,o="string"==typeof n?JSON.parse(n):n;o&&"pong"===o.type&&(clearTimeout(r),r=setTimeout(i,15e3)),e.emit("message",[o,e])};const o=t=>{null!==e.ws&&(e.ws=null,e.connecting=!1,e.connected?(e.connected=!1,e.emit("disconnect",[{type:"disconnect",error:t},e])):e.unsuccessfulReconnects++,setTimeout(pi,fe(1200*pe(e.unsuccessfulReconnects+1),2500),e)),clearTimeout(r)},i=()=>{e.ws===t&&e.send({type:"ping"})};t.onclose=()=>o(null),t.onerror=e=>o(e),t.onopen=()=>{e.lastMessageReceived=Jt(),e.connecting=!1,e.connected=!0,e.unsuccessfulReconnects=0,e.emit("connect",[{type:"connect"},e]),r=setTimeout(i,15e3)}}};class fi extends ue{constructor(e,{binaryType:t}={}){super(),this.url=e,this.ws=null,this.binaryType=t||null,this.connected=!1,this.connecting=!1,this.unsuccessfulReconnects=0,this.lastMessageReceived=0,this.shouldConnect=!0,this._checkInterval=setInterval((()=>{this.connected&&3e4t.key===e&&null!==this.onmessage&&this.onmessage({data:Ht(t.newValue||"")}),t=this._onChange,kt||addEventListener("storage",t)}postMessage(e){Ct.setItem(this.room,Vt(new Uint8Array(e)))}close(){var e;e=this._onChange,kt||removeEventListener("storage",e)}}:BroadcastChannel,bi=e=>oe(mi,e,(()=>{const t=ie(),n=new gi(e);return n.onmessage=e=>t.forEach((t=>t(e.data,"broadcastchannel"))),{bc:n,subs:t}}));var vi=n(39239),yi=n.n(vi);const _i=(e,t)=>{De(e,0);const n=(e=>((e,t=new Dn)=>(e instanceof Map?Vn(t,e):((e,t)=>{Vn(e,rr(t.store))})(t,e),t.toUint8Array()))(e,new Rn))(t);ze(e,n)},xi=(e,t,n)=>{De(e,1),ze(e,zn(t,n))},wi=(e,t,n)=>{try{Ln(t,rt(e),n)}catch(e){console.error("Caught error while handling a Yjs update",e)}},ki=wi;class Ci extends ue{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval((()=>{const e=Jt();null!==this.getLocalState()&&15e3<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const t=[];this.meta.forEach(((n,r)=>{r!==this.clientID&&3e4<=e-n.lastUpdated&&this.states.has(r)&&t.push(r)})),t.length>0&&Si(this,t,"timeout")}),de(3e3)),e.on("destroy",(()=>{this.destroy()})),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){const t=this.clientID,n=this.meta.get(t),r=void 0===n?0:n.clock+1,o=this.states.get(t);null===e?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:r,lastUpdated:Jt()});const i=[],s=[],a=[],l=[];null===e?l.push(t):null==o?null!=e&&i.push(t):(s.push(t),Rt(o,e)||a.push(t)),(i.length>0||a.length>0||l.length>0)&&this.emit("change",[{added:i,updated:a,removed:l},"local"]),this.emit("update",[{added:i,updated:s,removed:l},"local"])}setLocalStateField(e,t){const n=this.getLocalState();null!==n&&this.setLocalState({...n,[e]:t})}getStates(){return this.states}}const Si=(e,t,n)=>{const r=[];for(let n=0;n0&&(e.emit("change",[{added:[],updated:[],removed:r},n]),e.emit("update",[{added:[],updated:[],removed:r},n]))},Ai=(e,t,n=e.states)=>{const r=t.length,o=Te();De(o,r);for(let i=0;i{if(!t)return xt(e);const n=crypto.getRandomValues(new Uint8Array(12));return crypto.subtle.encrypt({name:"AES-GCM",iv:n},t,e).then((e=>{const t=Te();return Le(t,"AES-GCM"),ze(t,n),ze(t,new Uint8Array(e)),Be(t)}))},Ii=(e,t)=>{if(!t)return xt(e);const n=nt(e);var r;"AES-GCM"!==at(n)&&(r=Je("Unknown encryption algorithm"),Promise.reject(r));const o=rt(n),i=rt(n);return crypto.subtle.decrypt({name:"AES-GCM",iv:o},t,i).then((e=>new Uint8Array(e)))},ji=(e,t)=>Ii(e,t).then((e=>ut(nt(new Uint8Array(e))))),Ti=((e,t)=>{const n=an[ln],r=Lt("log"),o=null!==r&&("*"===r||"true"===r||new RegExp(r,"gi").test(t));return ln=(ln+1)%an.length,t+=": ",o?(...r)=>{const o=Jt(),i=o-cn;cn=o,e(n,t,sn,...r.map((e=>"string"==typeof e||"symbol"==typeof e?e:JSON.stringify(e))),n," +"+i+"ms")}:Tt})(hn,"y-webrtc"),Bi=new Map,Ri=new Map,Ni=e=>{let t=!0;e.webrtcConns.forEach((e=>{e.synced||(t=!1)})),(!t&&e.synced||t&&!e.synced)&&(e.synced=t,e.provider.emit("synced",[{synced:t}]),Ti("synced ",Xt,e.name,Zt," with all peers"))},Di=(e,t,n)=>{const r=nt(t),o=Te(),i=it(r);if(void 0===e)return null;const s=e.awareness,a=e.doc;let l=!1;switch(i){case 0:{De(o,0);const t=((e,t,n,r)=>{const o=it(e);switch(o){case 0:((e,t,n)=>{xi(t,n,rt(e))})(e,t,n);break;case 1:wi(e,n,r);break;case 2:ki(e,n,r);break;default:throw new Error("Unknown message type")}return o})(r,o,a,e);1!==t||e.synced||n(),0===t&&(l=!0);break}case 3:De(o,1),ze(o,Ai(s,Array.from(s.getStates().keys()))),l=!0;break;case 1:((e,t,n)=>{const r=nt(t),o=Jt(),i=[],s=[],a=[],l=[],c=it(r);for(let t=0;t0||a.length>0||l.length>0)&&e.emit("change",[{added:i,updated:a,removed:l},n]),(i.length>0||s.length>0||l.length>0)&&e.emit("update",[{added:i,updated:s,removed:l},n])})(s,rt(r),e);break;case 4:{const t=1===ot(r),n=at(r);if(n!==e.peerId&&(e.bcConns.has(n)&&!t||!e.bcConns.has(n)&&t)){const r=[],o=[];t?(e.bcConns.add(n),o.push(n)):(e.bcConns.delete(n),r.push(n)),e.provider.emit("peers",[{added:o,removed:r,webrtcPeers:Array.from(e.webrtcConns.keys()),bcPeers:Array.from(e.bcConns)}]),zi(e)}break}default:return console.error("Unable to compute message"),o}return l?o:null},Mi=(e,t)=>{Ti("send message to ",Xt,e.remotePeerId,Zt,en," (",e.room.name,")",sn);try{e.peer.send(Be(t))}catch(e){}};class Pi{constructor(e,t,n,r){Ti("establishing connection to ",Xt,n),this.room=r,this.remotePeerId=n,this.glareToken=void 0,this.closed=!1,this.connected=!1,this.synced=!1,this.peer=new(yi())({initiator:t,...r.provider.peerOpts}),this.peer.on("signal",(t=>{void 0===this.glareToken&&(this.glareToken=Date.now()+Math.random()),Vi(e,r,{to:n,from:r.peerId,type:"signal",token:this.glareToken,signal:t})})),this.peer.on("connect",(()=>{Ti("connected to ",Xt,n),this.connected=!0;const e=r.provider.doc,t=r.awareness,o=Te();De(o,0),_i(o,e),Mi(this,o);const i=t.getStates();if(i.size>0){const e=Te();De(e,1),ze(e,Ai(t,Array.from(i.keys()))),Mi(this,e)}})),this.peer.on("close",(()=>{this.connected=!1,this.closed=!0,r.webrtcConns.has(this.remotePeerId)&&(r.webrtcConns.delete(this.remotePeerId),r.provider.emit("peers",[{removed:[this.remotePeerId],added:[],webrtcPeers:Array.from(r.webrtcConns.keys()),bcPeers:Array.from(r.bcConns)}])),Ni(r),this.peer.destroy(),Ti("closed connection to ",Xt,n),Fi(r)})),this.peer.on("error",(e=>{Ti("Error in connection to ",Xt,n,": ",e),Fi(r)})),this.peer.on("data",(e=>{const t=((e,t)=>{const n=e.room;return Ti("received message from ",Xt,e.remotePeerId,en," (",n.name,")",Zt,sn),Di(n,t,(()=>{e.synced=!0,Ti("synced ",Xt,n.name,Zt," with ",Xt,e.remotePeerId),Ni(n)}))})(this,e);null!==t&&Mi(this,t)}))}destroy(){this.peer.destroy()}}const Oi=(e,t)=>Ei(t,e.key).then((t=>e.mux((()=>((e,t,n=null)=>{const r=bi(e);r.bc.postMessage(t),r.subs.forEach((e=>e(t,n)))})(e.name,t))))),Li=(e,t)=>{e.bcconnected&&Oi(e,t),((e,t)=>{Ti("broadcast message in ",Xt,e.name,Zt),e.webrtcConns.forEach((e=>{try{e.peer.send(t)}catch(e){}}))})(e,t)},Fi=e=>{Bi.forEach((t=>{t.connected&&(t.send({type:"subscribe",topics:[e.name]}),e.webrtcConns.size{if(e.provider.filterBcConns){const t=Te();De(t,4),Ne(t,1),Le(t,e.peerId),Oi(e,Be(t))}};class Ui{constructor(e,t,n,r){this.peerId=yt(),this.doc=e,this.awareness=t.awareness,this.provider=t,this.synced=!1,this.name=n,this.key=r,this.webrtcConns=new Map,this.bcConns=new Set,this.mux=(()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else void 0!==n&&n()}})(),this.bcconnected=!1,this._bcSubscriber=e=>Ii(new Uint8Array(e),r).then((e=>this.mux((()=>{const t=Di(this,e,(()=>{}));t&&Oi(this,Be(t))})))),this._docUpdateHandler=(e,t)=>{const n=Te();De(n,0),((e,t)=>{De(e,2),ze(e,t)})(n,e),Li(this,Be(n))},this._awarenessUpdateHandler=({added:e,updated:t,removed:n},r)=>{const o=e.concat(t).concat(n),i=Te();De(i,1),ze(i,Ai(this.awareness,o)),Li(this,Be(i))},this._beforeUnloadHandler=()=>{Si(this.awareness,[e.clientID],"window unload"),Ri.forEach((e=>{e.disconnect()}))},"undefined"!=typeof window?window.addEventListener("beforeunload",this._beforeUnloadHandler):"undefined"!=typeof process&&process.on("exit",this._beforeUnloadHandler)}connect(){var e,t;this.doc.on("update",this._docUpdateHandler),this.awareness.on("update",this._awarenessUpdateHandler),Fi(this),e=this.name,t=this._bcSubscriber,bi(e).subs.add(t),this.bcconnected=!0,zi(this);const n=Te();De(n,0),_i(n,this.doc),Oi(this,Be(n));const r=Te();De(r,0),xi(r,this.doc),Oi(this,Be(r));const o=Te();De(o,3),Oi(this,Be(o));const i=Te();De(i,1),ze(i,Ai(this.awareness,[this.doc.clientID])),Oi(this,Be(i))}disconnect(){Bi.forEach((e=>{e.connected&&e.send({type:"unsubscribe",topics:[this.name]})})),Si(this.awareness,[this.doc.clientID],"disconnect");const e=Te();De(e,4),Ne(e,0),Le(e,this.peerId),Oi(this,Be(e)),((e,t)=>{const n=bi(e);n.subs.delete(t)&&0===n.subs.size&&(n.bc.close(),mi.delete(e))})(this.name,this._bcSubscriber),this.bcconnected=!1,this.doc.off("update",this._docUpdateHandler),this.awareness.off("update",this._awarenessUpdateHandler),this.webrtcConns.forEach((e=>e.destroy()))}destroy(){this.disconnect(),"undefined"!=typeof window?window.removeEventListener("beforeunload",this._beforeUnloadHandler):"undefined"!=typeof process&&process.off("exit",this._beforeUnloadHandler)}}const Vi=(e,t,n)=>{t.key?((e,t)=>{const n=Te();return He(n,e),Ei(Be(n),t)})(n,t.key).then((n=>{e.send({type:"publish",topic:t.name,data:Vt(n)})})):e.send({type:"publish",topic:t.name,data:n})};class Hi extends fi{constructor(e){super(e),this.providers=new Set,this.on("connect",(()=>{Ti(`connected (${e})`);const t=Array.from(Ri.keys());this.send({type:"subscribe",topics:t}),Ri.forEach((e=>Vi(this,e,{type:"announce",from:e.peerId})))})),this.on("message",(e=>{if("publish"===e.type){const t=e.topic,n=Ri.get(t);if(null==n||"string"!=typeof t)return;const r=e=>{const t=n.webrtcConns,r=n.peerId;if(null==e||e.from===r||void 0!==e.to&&e.to!==r||n.bcConns.has(e.from))return;const o=t.has(e.from)?()=>{}:()=>n.provider.emit("peers",[{removed:[],added:[e.from],webrtcPeers:Array.from(n.webrtcConns.keys()),bcPeers:Array.from(n.bcConns)}]);switch(e.type){case"announce":t.sizenew Pi(this,!0,e.from,n))),o());break;case"signal":if("offer"===e.signal.type){const n=t.get(e.from);if(n){const t=e.token,r=n.glareToken;if(r&&r>t)return void Ti("offer rejected: ",e.from);n.glareToken=void 0}}"answer"===e.signal.type&&(Ti("offer answered by: ",e.from),t.get(e.from).glareToken=void 0),e.to===r&&(oe(t,e.from,(()=>new Pi(this,!1,e.from,n))).peer.signal(e.signal),o())}};n.key?"string"==typeof e.data&&ji(Ht(e.data),n.key).then(r):r(e.data)}})),this.on("disconnect",(()=>Ti(`disconnect (${e})`)))}}class $i extends ue{constructor(e,t,{signaling:n=["wss://y-webrtc-eu.fly.dev"],password:r=null,awareness:o=new Ci(t),maxConns:i=20+de(15*gt()),filterBcConns:s=!0,peerOpts:a={}}={}){super(),this.roomName=e,this.doc=t,this.filterBcConns=s,this.awareness=o,this.shouldConnect=!1,this.signalingUrls=n,this.signalingConns=[],this.maxConns=i,this.peerOpts=a,this.key=r?((e,t)=>{const n=Ee(e).buffer,r=Ee(t).buffer;return crypto.subtle.importKey("raw",n,"PBKDF2",!1,["deriveKey"]).then((e=>crypto.subtle.deriveKey({name:"PBKDF2",salt:r,iterations:1e5,hash:"SHA-256"},e,{name:"AES-GCM",length:256},!0,["encrypt","decrypt"])))})(r,e):xt(null),this.room=null,this.key.then((n=>{this.room=((e,t,n,r)=>{if(Ri.has(n))throw Je(`A Yjs Doc connected to room "${n}" already exists!`);const o=new Ui(e,t,n,r);return Ri.set(n,o),o})(t,this,e,n),this.shouldConnect?this.room.connect():this.room.disconnect()})),this.connect(),this.destroy=this.destroy.bind(this),t.on("destroy",this.destroy)}get connected(){return null!==this.room&&this.shouldConnect}connect(){this.shouldConnect=!0,this.signalingUrls.forEach((e=>{const t=oe(Bi,e,(()=>new Hi(e)));this.signalingConns.push(t),t.providers.add(this)})),this.room&&this.room.connect()}disconnect(){this.shouldConnect=!1,this.signalingConns.forEach((e=>{e.providers.delete(this),0===e.providers.size&&(e.destroy(),Bi.delete(e.url))})),this.room&&this.room.disconnect()}destroy(){this.doc.off("destroy",this.destroy),this.key.then((()=>{this.room.destroy(),Ri.delete(this.roomName)})),super.destroy()}}function Wi(e){if(e.shouldConnect&&null===e.ws){const t=Math.floor(1e5+9e5*Math.random()),n=e.url,r=new window.EventSource((0,G.F)(n,{subscriber_id:t,action:"gutenberg_signaling_server"}));let o=null;r.onmessage=t=>{e.lastMessageReceived=Date.now();const n=t.data;if(n){const e=JSON.parse(n);Array.isArray(e)&&e.forEach(i)}},e.ws=r,e.connecting=!0,e.connected=!1;const i=t=>{t&&"pong"===t.type&&(clearTimeout(o),o=setTimeout(a,Gi/2)),e.emit("message",[t,e])},s=t=>{null!==e.ws&&(e.ws.close(),e.ws=null,e.connecting=!1,e.connected?(e.connected=!1,e.emit("disconnect",[{type:"disconnect",error:t},e])):e.unsuccessfulReconnects++),clearTimeout(o)},a=()=>{e.ws&&e.ws.readyState===window.EventSource.OPEN&&e.send({type:"ping"})};e.ws&&(e.ws.onclose=()=>{s(null)},e.ws.send=function(e){window.fetch(n,{body:new URLSearchParams({subscriber_id:t.toString(),action:"gutenberg_signaling_server",message:e}),method:"POST"}).catch((()=>{Ti("Error sending to server with message: "+e)}))}),r.onerror=()=>{},r.onopen=()=>{e.connected||r.readyState===window.EventSource.OPEN&&(e.lastMessageReceived=Date.now(),e.connecting=!1,e.connected=!0,e.unsuccessfulReconnects=0,e.emit("connect",[{type:"connect"},e]),o=setTimeout(a,Gi/2))}}}const Gi=3e4;class qi extends ue{constructor(e){super(),this.url=e,this.ws=null,this.binaryType=null,this.connected=!1,this.connecting=!1,this.unsuccessfulReconnects=0,this.lastMessageReceived=0,this.shouldConnect=!0,this._checkInterval=setInterval((()=>{this.connected&&Gi{Ti(`connected (${t})`);const n=Array.from(Ri.keys());e.send({type:"subscribe",topics:n}),Ri.forEach((t=>Vi(e,t,{type:"announce",from:t.peerId})))})),e.on("message",(t=>{if("publish"===t.type){const n=t.topic,r=Ri.get(n);if(null===r||"string"!=typeof n||void 0===r)return;const o=t=>{const n=r.webrtcConns,o=r.peerId;if(null===t||t.from===o||void 0!==t.to&&t.to!==o||r.bcConns.has(t.from))return;const i=n.has(t.from)?()=>{}:()=>r.provider.emit("peers",[{removed:[],added:[t.from],webrtcPeers:Array.from(r.webrtcConns.keys()),bcPeers:Array.from(r.bcConns)}]);switch(t.type){case"announce":n.sizenew Pi(e,!0,t.from,r))),i());break;case"signal":if("offer"===t.signal.type){const e=n.get(t.from);if(e){const n=t.token,r=e.glareToken;if(r&&r>n)return void Ti("offer rejected: ",t.from);e.glareToken=void 0}}if("answer"===t.signal.type){Ti("offer answered by: ",t.from);const e=n.get(t.from);e&&(e.glareToken=void 0)}t.to===o&&(oe(n,t.from,(()=>new Pi(e,!1,t.from,r))).peer.signal(t.signal),i())}};r.key?"string"==typeof t.data&&ji(Ht(t.data),r.key).then(o):o(t.data)}})),e.on("disconnect",(()=>Ti(`disconnect (${t})`)))}(this,e)}send(e){this.ws&&this.ws.send(JSON.stringify(e))}destroy(){clearInterval(this._checkInterval),this.disconnect(),super.destroy()}disconnect(){this.shouldConnect=!1,null!==this.ws&&this.ws.close()}connect(){this.shouldConnect=!0,this.connected||null!==this.ws||Wi(this)}}class Ki extends $i{connect(){this.shouldConnect=!0,this.signalingUrls.forEach((e=>{const t=oe(Bi,e,e.startsWith("ws://")||e.startsWith("wss://")?()=>new Hi(e):()=>new qi(e));this.signalingConns.push(t),t.providers.add(this)})),this.room&&this.room.connect()}}let Yi;function Ji(){return Yi||(Yi=ei(hi,function({signaling:e,password:t}){return function(n,r,o){return new Ki(`${r}-${n}`,o,{signaling:e,password:t}),Promise.resolve((()=>!0))}}({signaling:[window?.wp?.ajax?.settings?.url],password:window?.__experimentalCollaborativeEditingSecret}))),Yi}function Xi(e,t){return{type:"RECEIVE_USER_QUERY",users:Array.isArray(t)?t:[t],queryID:e}}function Zi(e){return{type:"RECEIVE_CURRENT_USER",currentUser:e}}function Qi(e){return{type:"ADD_ENTITIES",entities:e}}function es(e,t,n,r,o=!1,i,s){let a;return"postType"===e&&(n=(Array.isArray(n)?n:[n]).map((e=>"auto-draft"===e.status?{...e,title:""}:e))),a=r?function(e,t={},n,r){return{...J(e,n,r),query:t}}(n,r,i,s):J(n,i,s),{...a,kind:e,name:t,invalidateCache:o}}function ts(e){return{type:"RECEIVE_CURRENT_THEME",currentTheme:e}}function ns(e){return{type:"RECEIVE_CURRENT_GLOBAL_STYLES_ID",id:e}}function rs(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLES",stylesheet:e,globalStyles:t}}function os(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS",stylesheet:e,variations:t}}function is(){return(0,q.default)("wp.data.dispatch( 'core' ).receiveThemeSupports",{since:"5.9"}),{type:"DO_NOTHING"}}function ss(e,t){return(0,q.default)("wp.data.dispatch( 'core' ).receiveThemeGlobalStyleRevisions()",{since:"6.5.0",alternative:"wp.data.dispatch( 'core' ).receiveRevisions"}),{type:"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS",currentId:e,revisions:t}}function as(e,t){return{type:"RECEIVE_EMBED_PREVIEW",url:e,preview:t}}const ls=(e,t,n,r,{__unstableFetch:o=S.default,throwOnError:i=!1}={})=>async({dispatch:s})=>{const a=(await s(Ns(e,t))).find((n=>n.kind===e&&n.name===t));let l,c=!1;if(!a||a?.__experimentalNoFetch)return;const u=await s.__unstableAcquireStoreLock(te,["entities","records",e,t,n],{exclusive:!0});try{s({type:"DELETE_ENTITY_RECORD_START",kind:e,name:t,recordId:n});let u=!1;try{let i=`${a.baseURL}/${n}`;r&&(i=(0,G.F)(i,r)),c=await o({path:i,method:"DELETE"}),await s(function(e,t,n,r=!1){return{type:"REMOVE_ITEMS",itemIds:Array.isArray(n)?n:[n],kind:e,name:t,invalidateCache:r}}(e,t,n,!0))}catch(e){u=!0,l=e}if(s({type:"DELETE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:n,error:l}),u&&i)throw l;return c}finally{s.__unstableReleaseStoreLock(u)}},cs=(e,t,n,r,o={})=>({select:i,dispatch:s})=>{const a=i.getEntityConfig(e,t);if(!a)throw new Error(`The entity being edited (${e}, ${t}) does not have a loaded config.`);const{mergedEdits:l={}}=a,c=i.getRawEntityRecord(e,t,n),u=i.getEditedEntityRecord(e,t,n),d={kind:e,name:t,recordId:n,edits:Object.keys(r).reduce(((e,t)=>{const n=c[t],o=u[t],i=l[t]?{...o,...r[t]}:r[t];return e[t]=N()(n,i)?void 0:i,e}),{})};if(window.__experimentalEnableSync&&a.syncConfig){if(globalThis.IS_GUTENBERG_PLUGIN){const e=a.getSyncObjectId(n);Ji().update(a.syncObjectType+"--edit",e,d.edits)}}else o.undoIgnore||i.getUndoManager().addRecord([{id:{kind:e,name:t,recordId:n},changes:Object.keys(r).reduce(((e,t)=>(e[t]={from:u[t],to:r[t]},e)),{})}],o.isCached),s({type:"EDIT_ENTITY_RECORD",...d})},us=()=>({select:e,dispatch:t})=>{const n=e.getUndoManager().undo();n&&t({type:"UNDO",record:n})},ds=()=>({select:e,dispatch:t})=>{const n=e.getUndoManager().redo();n&&t({type:"REDO",record:n})},hs=()=>({select:e})=>{e.getUndoManager().addRecord()},ps=(e,t,n,{isAutosave:r=!1,__unstableFetch:o=S.default,throwOnError:i=!1}={})=>async({select:s,resolveSelect:a,dispatch:l})=>{const c=(await l(Ns(e,t))).find((n=>n.kind===e&&n.name===t));if(!c||c?.__experimentalNoFetch)return;const u=c.key||ks,d=n[u],h=await l.__unstableAcquireStoreLock(te,["entities","records",e,t,d||(0,W.A)()],{exclusive:!0});try{for(const[r,o]of Object.entries(n))if("function"==typeof o){const i=o(s.getEditedEntityRecord(e,t,d));l.editEntityRecord(e,t,d,{[r]:i},{undoIgnore:!0}),n[r]=i}let u,h;l({type:"SAVE_ENTITY_RECORD_START",kind:e,name:t,recordId:d,isAutosave:r});let p=!1;try{const i=`${c.baseURL}${d?"/"+d:""}`,h=s.getRawEntityRecord(e,t,d);if(r){const r=s.getCurrentUser(),c=r?r.id:void 0,d=await a.getAutosave(h.type,h.id,c);let p={...h,...d,...n};if(p=Object.keys(p).reduce(((e,t)=>(["title","excerpt","content","meta"].includes(t)&&(e[t]=p[t]),e)),{status:"auto-draft"===p.status?"draft":void 0}),u=await o({path:`${i}/autosaves`,method:"POST",data:p}),h.id===u.id){let n={...h,...p,...u};n=Object.keys(n).reduce(((e,t)=>(["title","excerpt","content"].includes(t)?e[t]=n[t]:e[t]="status"===t?"auto-draft"===h.status&&"draft"===n.status?n.status:h.status:h[t],e)),{}),l.receiveEntityRecords(e,t,n,void 0,!0)}else l.receiveAutosaves(h.id,u)}else{let r=n;c.__unstablePrePersist&&(r={...r,...c.__unstablePrePersist(h,r)}),u=await o({path:i,method:d?"PUT":"POST",data:r}),l.receiveEntityRecords(e,t,u,void 0,!0,r)}}catch(e){p=!0,h=e}if(l({type:"SAVE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:d,error:h,isAutosave:r}),p&&i)throw h;return u}finally{l.__unstableReleaseStoreLock(h)}},fs=e=>async({dispatch:t})=>{const n=Q(),r={saveEntityRecord:(e,r,o,i)=>n.add((n=>t.saveEntityRecord(e,r,o,{...i,__unstableFetch:n}))),saveEditedEntityRecord:(e,r,o,i)=>n.add((n=>t.saveEditedEntityRecord(e,r,o,{...i,__unstableFetch:n}))),deleteEntityRecord:(e,r,o,i,s)=>n.add((n=>t.deleteEntityRecord(e,r,o,i,{...s,__unstableFetch:n})))},o=e.map((e=>e(r))),[,...i]=await Promise.all([n.run(),...o]);return i},ms=(e,t,n,r)=>async({select:o,dispatch:i})=>{if(!o.hasEditsForEntityRecord(e,t,n))return;const s=(await i(Ns(e,t))).find((n=>n.kind===e&&n.name===t));if(!s)return;const a=s.key||ks,l=o.getEntityRecordNonTransientEdits(e,t,n),c={[a]:n,...l};return await i.saveEntityRecord(e,t,c,r)},gs=(e,t,n,r,o)=>async({select:i,dispatch:s})=>{if(!i.hasEditsForEntityRecord(e,t,n))return;const a=i.getEntityRecordNonTransientEdits(e,t,n),l={};for(const e of r)K(l,e,Y(a,e));const c=(await s(Ns(e,t))).find((n=>n.kind===e&&n.name===t));return n&&(l[c?.key||ks]=n),await s.saveEntityRecord(e,t,l,o)};function bs(e){return(0,q.default)("wp.data.dispatch( 'core' ).receiveUploadPermissions",{since:"5.9",alternative:"receiveUserPermission"}),vs("create/media",e)}function vs(e,t){return{type:"RECEIVE_USER_PERMISSION",key:e,isAllowed:t}}function ys(e,t){return{type:"RECEIVE_AUTOSAVES",postId:e,autosaves:Array.isArray(t)?t:[t]}}function _s(e){return{type:"RECEIVE_NAVIGATION_FALLBACK_ID",fallbackId:e}}function xs(e,t){return{type:"RECEIVE_DEFAULT_TEMPLATE",query:e,templateId:t}}const ws=(e,t,n,r,o,i=!1,s)=>async({dispatch:a})=>{const l=(await a(Ns(e,t))).find((n=>n.kind===e&&n.name===t));a({type:"RECEIVE_ITEM_REVISIONS",key:l&&l?.revisionKey?l.revisionKey:ks,items:Array.isArray(r)?r:[r],recordKey:n,meta:s,query:o,kind:e,name:t,invalidateCache:i})},ks="id",Cs=["title","excerpt","content"],Ss=[{label:(0,H.__)("Base"),kind:"root",name:"__unstableBase",baseURL:"/",baseURLParams:{_fields:["description","gmt_offset","home","name","site_icon","site_icon_url","site_logo","timezone_string","url"].join(",")},plural:"__unstableBases",syncConfig:{fetch:async()=>(0,S.default)({path:"/"}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach((([e,t])=>{n.get(e)!==t&&n.set(e,t)}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/base",getSyncObjectId:()=>"index"},{label:(0,H.__)("Post Type"),name:"postType",kind:"root",key:"slug",baseURL:"/wp/v2/types",baseURLParams:{context:"edit"},plural:"postTypes",syncConfig:{fetch:async e=>(0,S.default)({path:`/wp/v2/types/${e}?context=edit`}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach((([e,t])=>{n.get(e)!==t&&n.set(e,t)}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/postType",getSyncObjectId:e=>e},{name:"media",kind:"root",baseURL:"/wp/v2/media",baseURLParams:{context:"edit"},plural:"mediaItems",label:(0,H.__)("Media"),rawAttributes:["caption","title","description"],supportsPagination:!0},{name:"taxonomy",kind:"root",key:"slug",baseURL:"/wp/v2/taxonomies",baseURLParams:{context:"edit"},plural:"taxonomies",label:(0,H.__)("Taxonomy")},{name:"sidebar",kind:"root",baseURL:"/wp/v2/sidebars",baseURLParams:{context:"edit"},plural:"sidebars",transientEdits:{blocks:!0},label:(0,H.__)("Widget areas")},{name:"widget",kind:"root",baseURL:"/wp/v2/widgets",baseURLParams:{context:"edit"},plural:"widgets",transientEdits:{blocks:!0},label:(0,H.__)("Widgets")},{name:"widgetType",kind:"root",baseURL:"/wp/v2/widget-types",baseURLParams:{context:"edit"},plural:"widgetTypes",label:(0,H.__)("Widget types")},{label:(0,H.__)("User"),name:"user",kind:"root",baseURL:"/wp/v2/users",baseURLParams:{context:"edit"},plural:"users"},{name:"comment",kind:"root",baseURL:"/wp/v2/comments",baseURLParams:{context:"edit"},plural:"comments",label:(0,H.__)("Comment")},{name:"menu",kind:"root",baseURL:"/wp/v2/menus",baseURLParams:{context:"edit"},plural:"menus",label:(0,H.__)("Menu")},{name:"menuItem",kind:"root",baseURL:"/wp/v2/menu-items",baseURLParams:{context:"edit"},plural:"menuItems",label:(0,H.__)("Menu Item"),rawAttributes:["title"]},{name:"menuLocation",kind:"root",baseURL:"/wp/v2/menu-locations",baseURLParams:{context:"edit"},plural:"menuLocations",label:(0,H.__)("Menu Location"),key:"name"},{label:(0,H.__)("Global Styles"),name:"globalStyles",kind:"root",baseURL:"/wp/v2/global-styles",baseURLParams:{context:"edit"},plural:"globalStylesVariations",getTitle:e=>e?.title?.rendered||e?.title,getRevisionsUrl:(e,t)=>`/wp/v2/global-styles/${e}/revisions${t?"/"+t:""}`,supportsPagination:!0},{label:(0,H.__)("Themes"),name:"theme",kind:"root",baseURL:"/wp/v2/themes",baseURLParams:{context:"edit"},plural:"themes",key:"stylesheet"},{label:(0,H.__)("Plugins"),name:"plugin",kind:"root",baseURL:"/wp/v2/plugins",baseURLParams:{context:"edit"},plural:"plugins",key:"plugin"},{label:(0,H.__)("Status"),name:"status",kind:"root",baseURL:"/wp/v2/statuses",baseURLParams:{context:"edit"},plural:"statuses",key:"slug"}],As=[{kind:"postType",loadEntities:async function(){const e=await(0,S.default)({path:"/wp/v2/types?context=view"});return Object.entries(null!=e?e:{}).map((([e,t])=>{var n;const r=["wp_template","wp_template_part"].includes(e),o=null!==(n=t?.rest_namespace)&&void 0!==n?n:"wp/v2";return{kind:"postType",baseURL:`/${o}/${t.rest_base}`,baseURLParams:{context:"edit"},name:e,label:t.name,transientEdits:{blocks:!0,selection:!0},mergedEdits:{meta:!0},rawAttributes:Cs,getTitle:e=>{var t;return e?.title?.rendered||e?.title||(r?(0,U.D)(null!==(t=e.slug)&&void 0!==t?t:""):String(e.id))},__unstablePrePersist:r?void 0:Es,__unstable_rest_base:t.rest_base,syncConfig:{fetch:async e=>(0,S.default)({path:`/${o}/${t.rest_base}/${e}?context=edit`}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach((([e,t])=>{"function"!=typeof t&&("blocks"===e&&(Is.has(t)||Is.set(t,Ts(t)),t=Is.get(t)),n.get(e)!==t&&n.set(e,t))}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"postType/"+t.name,getSyncObjectId:e=>e,supportsPagination:!0,getRevisionsUrl:(e,n)=>`/${o}/${t.rest_base}/${e}/revisions${n?"/"+n:""}`,revisionKey:r?"wp_id":ks}}))}},{kind:"taxonomy",loadEntities:async function(){const e=await(0,S.default)({path:"/wp/v2/taxonomies?context=view"});return Object.entries(null!=e?e:{}).map((([e,t])=>{var n;return{kind:"taxonomy",baseURL:`/${null!==(n=t?.rest_namespace)&&void 0!==n?n:"wp/v2"}/${t.rest_base}`,baseURLParams:{context:"edit"},name:e,label:t.name}}))}},{kind:"root",name:"site",plural:"sites",loadEntities:async function(){var e;const t={label:(0,H.__)("Site"),name:"site",kind:"root",baseURL:"/wp/v2/settings",syncConfig:{fetch:async()=>(0,S.default)({path:"/wp/v2/settings"}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach((([e,t])=>{n.get(e)!==t&&n.set(e,t)}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/site",getSyncObjectId:()=>"index",meta:{}},n=await(0,S.default)({path:t.baseURL,method:"OPTIONS"}),r={};return Object.entries(null!==(e=n?.schema?.properties)&&void 0!==e?e:{}).forEach((([e,t])=>{"object"==typeof t&&t.title&&(r[e]=t.title)})),[{...t,meta:{labels:r}}]}}],Es=(e,t)=>{const n={};return"auto-draft"===e?.status&&(t.status||n.status||(n.status="draft"),t.title&&"Auto Draft"!==t.title||n.title||e?.title&&"Auto Draft"!==e?.title||(n.title="")),n},Is=new WeakMap;function js(e){const t={...e};for(const[n,r]of Object.entries(e))r instanceof $.RichTextData&&(t[n]=r.valueOf());return t}function Ts(e){return e.map((e=>{const{innerBlocks:t,attributes:n,...r}=e;return{...r,attributes:js(n),innerBlocks:Ts(t)}}))}const Bs=(e,t,n="get")=>`${n}${"root"===e?"":(0,V.fL)(e)}${(0,V.fL)(t)}`;function Rs(e){e.forEach((({syncObjectType:e,syncConfig:t})=>{Ji().register(e,t);const n={...t};delete n.fetch,Ji().register(e+"--edit",n)}))}const Ns=(e,t)=>async({select:n,dispatch:r})=>{let o=n.getEntitiesConfig(e);const i=!!n.getEntityConfig(e,t);if(o?.length>0&&i)return window.__experimentalEnableSync&&globalThis.IS_GUTENBERG_PLUGIN&&Rs(o),o;const s=As.find((n=>t&&n.name?n.kind===e&&n.name===t:n.kind===e));return s?(o=await s.loadEntities(),window.__experimentalEnableSync&&globalThis.IS_GUTENBERG_PLUGIN&&Rs(o),r(Qi(o)),o):[]},Ds=function(e){return"string"==typeof e?e.split(","):Array.isArray(e)?e:null},Ms=function(e){const t=new WeakMap;return n=>{let r;return t.has(n)?r=t.get(n):(r=e(n),null!==n&&"object"==typeof n&&t.set(n,r)),r}}((function(e){const t={stableKey:"",page:1,perPage:10,fields:null,include:null,context:"default"},n=Object.keys(e).sort();for(let i=0;i=i&&n!t.some((t=>Number.isInteger(t)?t===+e:t===e)))))}const Fs=(0,D.A)([L((e=>"query"in e)),F((e=>e.query?{...e,...Ms(e.query)}:e)),z("context"),z("stableKey")])(((e={},t)=>{const{type:n,page:r,perPage:o,key:i=ks}=t;return"RECEIVE_ITEMS"!==n?e:{itemIds:Os(e?.itemIds||[],t.items.map((e=>e[i])),r,o),meta:t.meta}})),zs=(0,B.combineReducers)({items:function(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const n=Ps(t),r=t.key||ks;return{...e,[n]:{...e[n],...t.items.reduce(((t,o)=>{const i=o[r];return t[i]=function(e,t){if(!e)return t;let n=!1;const r={};for(const o in t)N()(e[o],t[o])?r[o]=e[o]:(n=!0,r[o]=t[o]);if(!n)return e;for(const t in e)r.hasOwnProperty(t)||(r[t]=e[t]);return r}(e?.[n]?.[i],o),t}),{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map((([e,n])=>[e,Ls(n,t.itemIds)])))}return e},itemIsComplete:function(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const n=Ps(t),{query:r,key:o=ks}=t,i=r?Ms(r):{},s=!r||!Array.isArray(i.fields);return{...e,[n]:{...e[n],...t.items.reduce(((t,r)=>{const i=r[o];return t[i]=e?.[n]?.[i]||s,t}),{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map((([e,n])=>[e,Ls(n,t.itemIds)])))}return e},queries:(e={},t)=>{switch(t.type){case"RECEIVE_ITEMS":return Fs(e,t);case"REMOVE_ITEMS":const n=t.itemIds.reduce(((e,t)=>(e[t]=!0,e)),{});return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,Object.fromEntries(Object.entries(t).map((([e,t])=>[e,{...t,itemIds:t.itemIds.filter((e=>!n[e]))}])))])));default:return e}}}),Us=e=>(t,n)=>{if("UNDO"===n.type||"REDO"===n.type){const{record:r}=n;let o=t;return r.forEach((({id:{kind:t,name:r,recordId:i},changes:s})=>{o=e(o,{type:"EDIT_ENTITY_RECORD",kind:t,name:r,recordId:i,edits:Object.entries(s).reduce(((e,[t,r])=>(e[t]="UNDO"===n.type?r.from:r.to,e)),{})})})),o}return e(t,n)};function Vs(e){return(0,D.A)([Us,L((t=>t.name&&t.kind&&t.name===e.name&&t.kind===e.kind)),F((t=>({key:e.key||ks,...t})))])((0,B.combineReducers)({queriedData:zs,edits:(e={},t)=>{var n;switch(t.type){case"RECEIVE_ITEMS":if("default"!==(null!==(n=t?.query?.context)&&void 0!==n?n:"default"))return e;const r={...e};for(const e of t.items){const n=e[t.key],o=r[n];if(!o)continue;const i=Object.keys(o).reduce(((n,r)=>{var i;return N()(o[r],null!==(i=e[r]?.raw)&&void 0!==i?i:e[r])||t.persistedEdits&&N()(o[r],t.persistedEdits[r])||(n[r]=o[r]),n}),{});Object.keys(i).length?r[n]=i:delete r[n]}return r;case"EDIT_ENTITY_RECORD":const o={...e[t.recordId],...t.edits};return Object.keys(o).forEach((e=>{void 0===o[e]&&delete o[e]})),{...e,[t.recordId]:o}}return e},saving:(e={},t)=>{switch(t.type){case"SAVE_ENTITY_RECORD_START":case"SAVE_ENTITY_RECORD_FINISH":return{...e,[t.recordId]:{pending:"SAVE_ENTITY_RECORD_START"===t.type,error:t.error,isAutosave:t.isAutosave}}}return e},deleting:(e={},t)=>{switch(t.type){case"DELETE_ENTITY_RECORD_START":case"DELETE_ENTITY_RECORD_FINISH":return{...e,[t.recordId]:{pending:"DELETE_ENTITY_RECORD_START"===t.type,error:t.error}}}return e},revisions:(e={},t)=>{if("RECEIVE_ITEM_REVISIONS"===t.type){const n=t.recordKey;delete t.recordKey;const r=zs(e[n],{...t,type:"RECEIVE_ITEMS"});return{...e,[n]:r}}return"REMOVE_ITEMS"===t.type?Object.fromEntries(Object.entries(e).filter((([e])=>!t.itemIds.some((t=>Number.isInteger(t)?t===+e:t===e))))):e}}))}const Hs=(0,B.combineReducers)({terms:function(e={},t){return"RECEIVE_TERMS"===t.type?{...e,[t.taxonomy]:t.terms}:e},users:function(e={byId:{},queries:{}},t){return"RECEIVE_USER_QUERY"===t.type?{byId:{...e.byId,...t.users.reduce(((e,t)=>({...e,[t.id]:t})),{})},queries:{...e.queries,[t.queryID]:t.users.map((e=>e.id))}}:e},currentTheme:function(e=void 0,t){return"RECEIVE_CURRENT_THEME"===t.type?t.currentTheme.stylesheet:e},currentGlobalStylesId:function(e=void 0,t){return"RECEIVE_CURRENT_GLOBAL_STYLES_ID"===t.type?t.id:e},currentUser:function(e={},t){return"RECEIVE_CURRENT_USER"===t.type?t.currentUser:e},themeGlobalStyleVariations:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS"===t.type?{...e,[t.stylesheet]:t.variations}:e},themeBaseGlobalStyles:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLES"===t.type?{...e,[t.stylesheet]:t.globalStyles}:e},themeGlobalStyleRevisions:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS"===t.type?{...e,[t.currentId]:t.revisions}:e},taxonomies:function(e=[],t){return"RECEIVE_TAXONOMIES"===t.type?t.taxonomies:e},entities:(e={},t)=>{const n=function(e=Ss,t){return"ADD_ENTITIES"===t.type?[...e,...t.entities]:e}(e.config,t);let r=e.reducer;if(!r||n!==e.config){const e=n.reduce(((e,t)=>{const{kind:n}=t;return e[n]||(e[n]=[]),e[n].push(t),e}),{});r=(0,B.combineReducers)(Object.entries(e).reduce(((e,[t,n])=>{const r=(0,B.combineReducers)(n.reduce(((e,t)=>({...e,[t.name]:Vs(t)})),{}));return e[t]=r,e}),{}))}const o=r(e.records,t);return o===e.records&&n===e.config&&r===e.reducer?e:{reducer:r,records:o,config:n}},editsReference:function(e={},t){switch(t.type){case"EDIT_ENTITY_RECORD":case"UNDO":case"REDO":return{}}return e},undoManager:function(e=function(){let e=[],t=[],n=0;const r=()=>{e=e.slice(0,n||void 0),n=0},o=()=>{var n;const r=0===e.length?0:e.length-1;let o=null!==(n=e[r])&&void 0!==n?n:[];t.forEach((e=>{o=O(o,e)})),t=[],e[r]=o};return{addRecord(n,i=!1){const s=!n||(e=>!e.filter((({changes:e})=>Object.values(e).some((({from:e,to:t})=>"function"!=typeof e&&"function"!=typeof t&&!(0,M.default)(e,t))))).length)(n);if(i){if(s)return;n.forEach((e=>{t=O(t,e)}))}else{if(r(),t.length&&o(),s)return;e.push(n)}},undo(){t.length&&(r(),o());const i=e[e.length-1+n];if(i)return n-=1,i},redo(){const t=e[e.length+n];if(t)return n+=1,t},hasUndo:()=>!!e[e.length-1+n],hasRedo:()=>!!e[e.length+n]}}()){return e},embedPreviews:function(e={},t){if("RECEIVE_EMBED_PREVIEW"===t.type){const{url:n,preview:r}=t;return{...e,[n]:r}}return e},userPermissions:function(e={},t){return"RECEIVE_USER_PERMISSION"===t.type?{...e,[t.key]:t.isAllowed}:e},autosaves:function(e={},t){if("RECEIVE_AUTOSAVES"===t.type){const{postId:n,autosaves:r}=t;return{...e,[n]:r}}return e},blockPatterns:function(e=[],t){return"RECEIVE_BLOCK_PATTERNS"===t.type?t.patterns:e},blockPatternCategories:function(e=[],t){return"RECEIVE_BLOCK_PATTERN_CATEGORIES"===t.type?t.categories:e},userPatternCategories:function(e=[],t){return"RECEIVE_USER_PATTERN_CATEGORIES"===t.type?t.patternCategories:e},navigationFallbackId:function(e=null,t){return"RECEIVE_NAVIGATION_FALLBACK_ID"===t.type?t.fallbackId:e},defaultTemplates:function(e={},t){return"RECEIVE_DEFAULT_TEMPLATE"===t.type?{...e,[JSON.stringify(t.query)]:t.templateId}:e}});var $s=n(4075),Ws=n(74661),Gs=n(34236),qs=n.n(Gs);const Ks=new WeakMap,Ys=(0,Ws.A)(((e,t={})=>{let n=Ks.get(e);if(n){const e=n.get(t);if(void 0!==e)return e}else n=new(qs()),Ks.set(e,n);const r=function(e,t){const{stableKey:n,page:r,perPage:o,include:i,fields:s,context:a}=Ms(t);let l;if(e.queries?.[a]?.[n]&&(l=e.queries[a][n].itemIds),!l)return null;const c=-1===o?0:(r-1)*o,u=-1===o?l.length:Math.min(c+o,l.length),d=[];for(let t=c;t{n=n?.[e]})),K(o,t,n)}}else{if(!e.itemIsComplete[a]?.[n])return null;o=r}d.push(o)}return d}(e,t);return n.set(t,r),r}));function Js(e,t={}){var n;const{stableKey:r,context:o}=Ms(t);return null!==(n=e.queries?.[o]?.[r]?.meta?.totalItems)&&void 0!==n?n:null}const Xs={},Zs=(0,$s.N)((e=>(t,n)=>e(te).isResolving("getEmbedPreview",[n])));function Qs(e,t){(0,q.default)("select( 'core' ).getAuthors()",{since:"5.9",alternative:"select( 'core' ).getUsers({ who: 'authors' })"});const n=(0,G.F)("/wp/v2/users/?who=authors&per_page=100",t);return ta(e,n)}function ea(e){return e.currentUser}const ta=(0,Ws.A)(((e,t)=>{var n;return(null!==(n=e.users.queries[t])&&void 0!==n?n:[]).map((t=>e.users.byId[t]))}),((e,t)=>[e.users.queries[t],e.users.byId]));function na(e,t){return(0,q.default)("wp.data.select( 'core' ).getEntitiesByKind()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntitiesConfig()"}),ra(e,t)}const ra=(0,Ws.A)(((e,t)=>e.entities.config.filter((e=>e.kind===t))),((e,t)=>e.entities.config));function oa(e,t,n){return(0,q.default)("wp.data.select( 'core' ).getEntity()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntityConfig()"}),ia(e,t,n)}function ia(e,t,n){return e.entities.config?.find((e=>e.kind===t&&e.name===n))}const sa=(0,Ws.A)(((e,t,n,r,o)=>{var i;const s=e.entities.records?.[t]?.[n]?.queriedData;if(!s)return;const a=null!==(i=o?.context)&&void 0!==i?i:"default";if(void 0===o){if(!s.itemIsComplete[a]?.[r])return;return s.items[a][r]}const l=s.items[a]?.[r];if(l&&o._fields){var c;const e={},t=null!==(c=Ds(o._fields))&&void 0!==c?c:[];for(let n=0;n{o=o?.[e]})),K(e,r,o)}return e}return l}),((e,t,n,r,o)=>{var i;const s=null!==(i=o?.context)&&void 0!==i?i:"default";return[e.entities.records?.[t]?.[n]?.queriedData?.items[s]?.[r],e.entities.records?.[t]?.[n]?.queriedData?.itemIsComplete[s]?.[r]]}));function aa(e,t,n,r){return sa(e,t,n,r)}sa.__unstableNormalizeArgs=e=>{const t=[...e],n=t?.[2];return t[2]=function(e){return/^\s*\d+\s*$/.test(e)}(n)?Number(n):n,t};const la=(0,Ws.A)(((e,t,n,r)=>{const o=sa(e,t,n,r);return o&&Object.keys(o).reduce(((r,i)=>{var s;return!function(e,t){return(e.rawAttributes||[]).includes(t)}(ia(e,t,n),i)?r[i]=o[i]:r[i]=null!==(s=o[i]?.raw)&&void 0!==s?s:o[i],r}),{})}),((e,t,n,r,o)=>{var i;const s=null!==(i=o?.context)&&void 0!==i?i:"default";return[e.entities.config,e.entities.records?.[t]?.[n]?.queriedData?.items[s]?.[r],e.entities.records?.[t]?.[n]?.queriedData?.itemIsComplete[s]?.[r]]}));function ca(e,t,n,r){return Array.isArray(ua(e,t,n,r))}const ua=(e,t,n,r)=>{const o=e.entities.records?.[t]?.[n]?.queriedData;return o?Ys(o,r):null},da=(e,t,n,r)=>{const o=e.entities.records?.[t]?.[n]?.queriedData;return o?Js(o,r):null},ha=(e,t,n,r)=>{const o=e.entities.records?.[t]?.[n]?.queriedData;if(!o)return null;if(-1===r.per_page)return 1;const i=Js(o,r);return i?r.per_page?Math.ceil(i/r.per_page):function(e,t={}){var n;const{stableKey:r,context:o}=Ms(t);return null!==(n=e.queries?.[o]?.[r]?.meta?.totalPages)&&void 0!==n?n:null}(o,r):i},pa=(0,Ws.A)((e=>{const{entities:{records:t}}=e,n=[];return Object.keys(t).forEach((r=>{Object.keys(t[r]).forEach((o=>{const i=Object.keys(t[r][o].edits).filter((t=>sa(e,r,o,t)&&ba(e,r,o,t)));if(i.length){const t=ia(e,r,o);i.forEach((i=>{const s=va(e,r,o,i);n.push({key:s?s[t.key||ks]:void 0,title:t?.getTitle?.(s)||"",name:o,kind:r})}))}}))})),n}),(e=>[e.entities.records])),fa=(0,Ws.A)((e=>{const{entities:{records:t}}=e,n=[];return Object.keys(t).forEach((r=>{Object.keys(t[r]).forEach((o=>{const i=Object.keys(t[r][o].saving).filter((t=>_a(e,r,o,t)));if(i.length){const t=ia(e,r,o);i.forEach((i=>{const s=va(e,r,o,i);n.push({key:s?s[t.key||ks]:void 0,title:t?.getTitle?.(s)||"",name:o,kind:r})}))}}))})),n}),(e=>[e.entities.records]));function ma(e,t,n,r){return e.entities.records?.[t]?.[n]?.edits?.[r]}const ga=(0,Ws.A)(((e,t,n,r)=>{const{transientEdits:o}=ia(e,t,n)||{},i=ma(e,t,n,r)||{};return o?Object.keys(i).reduce(((e,t)=>(o[t]||(e[t]=i[t]),e)),{}):i}),((e,t,n,r)=>[e.entities.config,e.entities.records?.[t]?.[n]?.edits?.[r]]));function ba(e,t,n,r){return _a(e,t,n,r)||Object.keys(ga(e,t,n,r)).length>0}const va=(0,Ws.A)(((e,t,n,r)=>{const o=la(e,t,n,r),i=ma(e,t,n,r);return!(!o&&!i)&&{...o,...i}}),((e,t,n,r,o)=>{var i;const s=null!==(i=o?.context)&&void 0!==i?i:"default";return[e.entities.config,e.entities.records?.[t]?.[n]?.queriedData.items[s]?.[r],e.entities.records?.[t]?.[n]?.queriedData.itemIsComplete[s]?.[r],e.entities.records?.[t]?.[n]?.edits?.[r]]}));function ya(e,t,n,r){var o;const{pending:i,isAutosave:s}=null!==(o=e.entities.records?.[t]?.[n]?.saving?.[r])&&void 0!==o?o:{};return Boolean(i&&s)}function _a(e,t,n,r){var o;return null!==(o=e.entities.records?.[t]?.[n]?.saving?.[r]?.pending)&&void 0!==o&&o}function xa(e,t,n,r){var o;return null!==(o=e.entities.records?.[t]?.[n]?.deleting?.[r]?.pending)&&void 0!==o&&o}function wa(e,t,n,r){return e.entities.records?.[t]?.[n]?.saving?.[r]?.error}function ka(e,t,n,r){return e.entities.records?.[t]?.[n]?.deleting?.[r]?.error}function Ca(e){(0,q.default)("select( 'core' ).getUndoEdit()",{since:"6.3"})}function Sa(e){(0,q.default)("select( 'core' ).getRedoEdit()",{since:"6.3"})}function Aa(e){return e.undoManager.hasUndo()}function Ea(e){return e.undoManager.hasRedo()}function Ia(e){return e.currentTheme?sa(e,"root","theme",e.currentTheme):null}function ja(e){return e.currentGlobalStylesId}function Ta(e){var t;return null!==(t=Ia(e)?.theme_supports)&&void 0!==t?t:Xs}function Ba(e,t){return e.embedPreviews[t]}function Ra(e,t){const n=e.embedPreviews[t],r=''+t+"";return!!n&&n.html===r}function Na(e,t,n,r){const o=[t,n,r].filter(Boolean).join("/");return e.userPermissions[o]}function Da(e,t,n,r){const o=ia(e,t,n);return!!o&&Na(e,"update",o.__unstable_rest_base,r)}function Ma(e,t,n){return e.autosaves[n]}function Pa(e,t,n,r){if(void 0===r)return;const o=e.autosaves[n];return o?.find((e=>e.author===r))}const Oa=(0,$s.N)((e=>(t,n,r)=>e(te).hasFinishedResolution("getAutosaves",[n,r])));function La(e){return e.editsReference}function Fa(e,t){const n=ua(e,"postType","wp_template",{"find-template":t});return n?.length?va(e,"postType","wp_template",n[0].id):null}function za(e){const t=Ia(e);return t?e.themeBaseGlobalStyles[t.stylesheet]:null}function Ua(e){const t=Ia(e);return t?e.themeGlobalStyleVariations[t.stylesheet]:null}function Va(e){return e.blockPatterns}function Ha(e){return e.blockPatternCategories}function $a(e){return e.userPatternCategories}function Wa(e){(0,q.default)("select( 'core' ).getCurrentThemeGlobalStylesRevisions()",{since:"6.5.0",alternative:"select( 'core' ).getRevisions( 'root', 'globalStyles', ${ recordKey } )"});const t=ja(e);return t?e.themeGlobalStyleRevisions[t]:null}function Ga(e,t){return e.defaultTemplates[JSON.stringify(t)]}const qa=(e,t,n,r,o)=>{const i=e.entities.records?.[t]?.[n]?.revisions?.[r];return i?Ys(i,o):null},Ka=(0,Ws.A)(((e,t,n,r,o,i)=>{var s;const a=e.entities.records?.[t]?.[n]?.revisions?.[r];if(!a)return;const l=null!==(s=i?.context)&&void 0!==s?s:"default";if(void 0===i){if(!a.itemIsComplete[l]?.[o])return;return a.items[l][o]}const c=a.items[l]?.[o];if(c&&i._fields){var u;const e={},t=null!==(u=Ds(i._fields))&&void 0!==u?u:[];for(let n=0;n{o=o?.[e]})),K(e,r,o)}return e}return c}),((e,t,n,r,o,i)=>{var s;const a=null!==(s=i?.context)&&void 0!==s?s:"default";return[e.entities.records?.[t]?.[n]?.revisions?.[r]?.items?.[a]?.[o],e.entities.records?.[t]?.[n]?.revisions?.[r]?.itemIsComplete?.[a]?.[o]]}));function Ya(e){return e.undoManager}function Ja(e){return e.navigationFallbackId}const Xa=(0,$s.N)((e=>(0,Ws.A)(((t,n)=>e(te).getBlockPatterns().filter((({postTypes:e})=>!e||Array.isArray(e)&&e.includes(n)))),(()=>[e(te).getBlockPatterns()]))));var Za=n(10313),Qa=n(11785);const el=e=>(...t)=>async({resolveSelect:n})=>{await n[e](...t)},tl=e=>async({dispatch:t})=>{const n=(0,G.F)("/wp/v2/users/?who=authors&per_page=100",e),r=await(0,S.default)({path:n});t.receiveUserQuery(n,r)},nl=()=>async({dispatch:e})=>{const t=await(0,S.default)({path:"/wp/v2/users/me"});e.receiveCurrentUser(t)},rl=(e,t,n="",r)=>async({select:o,dispatch:i})=>{const s=(await i(Ns(e,t))).find((n=>n.name===t&&n.kind===e));if(!s||s?.__experimentalNoFetch)return;const a=await i.__unstableAcquireStoreLock(te,["entities","records",e,t,n],{exclusive:!1});try{if(window.__experimentalEnableSync&&s.syncConfig&&!r){if(globalThis.IS_GUTENBERG_PLUGIN){const o=s.getSyncObjectId(n);await Ji().bootstrap(s.syncObjectType,o,(n=>{i.receiveEntityRecords(e,t,n,r)})),await Ji().bootstrap(s.syncObjectType+"--edit",o,(r=>{i({type:"EDIT_ENTITY_RECORD",kind:e,name:t,recordId:n,edits:r,meta:{undo:void 0}})}))}}else{void 0!==r&&r._fields&&(r={...r,_fields:[...new Set([...Ds(r._fields)||[],s.key||ks])].join()});const a=(0,G.F)(s.baseURL+(n?"/"+n:""),{...s.baseURLParams,...r});if(void 0!==r&&(r={...r,include:[n]},o.hasEntityRecords(e,t,r)))return;const l=await(0,S.default)({path:a});i.receiveEntityRecords(e,t,l,r)}}finally{i.__unstableReleaseStoreLock(a)}},ol=el("getEntityRecord"),il=el("getEntityRecord"),sl=(e,t,n={})=>async({dispatch:r,registry:o})=>{const i=(await r(Ns(e,t))).find((n=>n.name===t&&n.kind===e));if(!i||i?.__experimentalNoFetch)return;const s=await r.__unstableAcquireStoreLock(te,["entities","records",e,t],{exclusive:!1});try{n._fields&&(n={...n,_fields:[...new Set([...Ds(n._fields)||[],i.key||ks])].join()});const a=(0,G.F)(i.baseURL,{...i.baseURLParams,...n});let l,c;if(i.supportsPagination&&-1!==n.per_page){const e=await(0,S.default)({path:a,parse:!1});l=Object.values(await e.json()),c={totalItems:parseInt(e.headers.get("X-WP-Total")),totalPages:parseInt(e.headers.get("X-WP-TotalPages"))}}else l=Object.values(await(0,S.default)({path:a}));n._fields&&(l=l.map((e=>(n._fields.split(",").forEach((t=>{e.hasOwnProperty(t)||(e[t]=void 0)})),e)))),o.batch((()=>{if(r.receiveEntityRecords(e,t,l,n,!1,void 0,c),!n?._fields&&!n.context){const n=i.key||ks,o=l.filter((e=>e[n])).map((r=>[e,t,r[n]]));r({type:"START_RESOLUTIONS",selectorName:"getEntityRecord",args:o}),r({type:"FINISH_RESOLUTIONS",selectorName:"getEntityRecord",args:o})}r.__unstableReleaseStoreLock(s)}))}catch(e){r.__unstableReleaseStoreLock(s)}};sl.shouldInvalidate=(e,t,n)=>("RECEIVE_ITEMS"===e.type||"REMOVE_ITEMS"===e.type)&&e.invalidateCache&&t===e.kind&&n===e.name;const al=()=>async({dispatch:e,resolveSelect:t})=>{const n=await t.getEntityRecords("root","theme",{status:"active"});e.receiveCurrentTheme(n[0])},ll=el("getCurrentTheme"),cl=e=>async({dispatch:t})=>{try{const n=await(0,S.default)({path:(0,G.F)("/oembed/1.0/proxy",{url:e})});t.receiveEmbedPreview(e,n)}catch(n){t.receiveEmbedPreview(e,!1)}},ul=(e,t,n)=>async({dispatch:r,registry:o})=>{const{hasStartedResolution:i}=o.select(te),s=n?`${t}/${n}`:t,a=["create","read","update","delete"];if(!a.includes(e))throw new Error(`'${e}' is not a valid action.`);for(const r of a)if(r!==e&&i("canUser",[r,t,n]))return;let l;try{l=await(0,S.default)({path:`/wp/v2/${s}`,method:"OPTIONS",parse:!1})}catch(e){return}const c=l.headers?.get("allow"),u=c?.allow||c||"",d={},h={create:"POST",read:"GET",update:"PUT",delete:"DELETE"};for(const[e,t]of Object.entries(h))d[e]=u.includes(t);for(const e of a)r.receiveUserPermission(`${e}/${s}`,d[e])},dl=(e,t,n)=>async({dispatch:r})=>{const o=(await r(Ns(e,t))).find((n=>n.name===t&&n.kind===e));if(!o)return;const i=o.__unstable_rest_base;await r(ul("update",i,n))},hl=(e,t)=>async({dispatch:n,resolveSelect:r})=>{const{rest_base:o,rest_namespace:i="wp/v2"}=await r.getPostType(e),s=await(0,S.default)({path:`/${i}/${o}/${t}/autosaves?context=edit`});s&&s.length&&n.receiveAutosaves(t,s)},pl=(e,t)=>async({resolveSelect:n})=>{await n.getAutosaves(e,t)},fl=e=>async({dispatch:t,resolveSelect:n})=>{let r;try{r=await(0,S.default)({url:(0,G.F)(e,{"_wp-find-template":!0})}).then((({data:e})=>e))}catch(e){}if(!r)return;const o=await n.getEntityRecord("postType","wp_template",r.id);o&&t.receiveEntityRecords("postType","wp_template",[o],{"find-template":e})};fl.shouldInvalidate=e=>("RECEIVE_ITEMS"===e.type||"REMOVE_ITEMS"===e.type)&&e.invalidateCache&&"postType"===e.kind&&"wp_template"===e.name;const ml=()=>async({dispatch:e,resolveSelect:t})=>{const n=await t.getEntityRecords("root","theme",{status:"active"}),r=n?.[0]?._links?.["wp:user-global-styles"]?.[0]?.href;if(r){const t=await(0,S.default)({url:r});e.__experimentalReceiveCurrentGlobalStylesId(t.id)}},gl=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.getCurrentTheme(),r=await(0,S.default)({path:`/wp/v2/global-styles/themes/${n.stylesheet}`});t.__experimentalReceiveThemeBaseGlobalStyles(n.stylesheet,r)},bl=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.getCurrentTheme(),r=await(0,S.default)({path:`/wp/v2/global-styles/themes/${n.stylesheet}/variations`});t.__experimentalReceiveThemeGlobalStyleVariations(n.stylesheet,r)},vl=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.__experimentalGetCurrentGlobalStylesId(),r=n?await e.getEntityRecord("root","globalStyles",n):void 0,o=r?._links?.["version-history"]?.[0]?.href;if(o){const e=await(0,S.default)({url:o}),r=e?.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[(0,Za.xQ)(e),t])))));t.receiveThemeGlobalStyleRevisions(n,r)}};vl.shouldInvalidate=e=>"SAVE_ENTITY_RECORD_FINISH"===e.type&&"root"===e.kind&&!e.error&&"globalStyles"===e.name;const yl=()=>async({dispatch:e})=>{e({type:"RECEIVE_BLOCK_PATTERNS",patterns:await async function(){const e=await(0,S.default)({path:"/wp/v2/block-patterns/patterns"});return e?e.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[(0,Za.xQ)(e),t]))))):[]}()})},_l=()=>async({dispatch:e})=>{e({type:"RECEIVE_BLOCK_PATTERN_CATEGORIES",categories:await(0,S.default)({path:"/wp/v2/block-patterns/categories"})})},xl=()=>async({dispatch:e,resolveSelect:t})=>{const n=await t.getEntityRecords("taxonomy","wp_pattern_category",{per_page:-1,_fields:"id,name,description,slug",context:"view"});e({type:"RECEIVE_USER_PATTERN_CATEGORIES",patternCategories:n?.map((e=>({...e,label:(0,Qa.decodeEntities)(e.name),name:e.slug})))||[]})},wl=()=>async({dispatch:e,select:t})=>{const n=await(0,S.default)({path:(0,G.F)("/wp-block-editor/v1/navigation-fallback",{_embed:!0})}),r=n?._embedded?.self;if(e.receiveNavigationFallbackId(n?.id),r){const o=!t.getEntityRecord("postType","wp_navigation",n.id);e.receiveEntityRecords("postType","wp_navigation",r,void 0,o),e.finishResolution("getEntityRecord",["postType","wp_navigation",n.id])}},kl=e=>async({dispatch:t})=>{const n=await(0,S.default)({path:(0,G.F)("/wp/v2/templates/lookup",e)});n?.id&&t.receiveDefaultTemplateId(e,n.id)},Cl=(e,t,n,r={})=>async({dispatch:o})=>{const i=(await o(Ns(e,t))).find((n=>n.name===t&&n.kind===e));if(!i||i?.__experimentalNoFetch)return;r._fields&&(r={...r,_fields:[...new Set([...Ds(r._fields)||[],i.revisionKey||ks])].join()});const s=(0,G.F)(i.getRevisionsUrl(n),r);let a,l;const c={},u=i.supportsPagination&&-1!==r.per_page;try{l=await(0,S.default)({path:s,parse:!u})}catch(e){return}if(l&&(u?(a=Object.values(await l.json()),c.totalItems=parseInt(l.headers.get("X-WP-Total"))):a=Object.values(l),r._fields&&(a=a.map((e=>(r._fields.split(",").forEach((t=>{e.hasOwnProperty(t)||(e[t]=void 0)})),e)))),o.receiveRevisions(e,t,n,a,r,!1,c),!r?._fields&&!r.context)){const r=i.key||ks,s=a.filter((e=>e[r])).map((o=>[e,t,n,o[r]]));o({type:"START_RESOLUTIONS",selectorName:"getRevision",args:s}),o({type:"FINISH_RESOLUTIONS",selectorName:"getRevision",args:s})}};Cl.shouldInvalidate=(e,t,n,r)=>"SAVE_ENTITY_RECORD_FINISH"===e.type&&n===e.name&&t===e.kind&&!e.error&&r===e.recordId;const Sl=(e,t,n,r,o)=>async({dispatch:i})=>{const s=(await i(Ns(e,t))).find((n=>n.name===t&&n.kind===e));if(!s||s?.__experimentalNoFetch)return;void 0!==o&&o._fields&&(o={...o,_fields:[...new Set([...Ds(o._fields)||[],s.revisionKey||ks])].join()});const a=(0,G.F)(s.getRevisionsUrl(n,r),o);let l;try{l=await(0,S.default)({path:a})}catch(e){return}l&&i.receiveRevisions(e,t,n,l,o)};function Al(e,t){const n={...e};let r=n;for(const e of t)r.children={...r.children,[e]:{locks:[],children:{},...r.children[e]}},r=r.children[e];return n}function El(e,t){let n=e;for(const e of t){const t=n.children[e];if(!t)return null;n=t}return n}function Il({exclusive:e},t){return!(!e||!t.length)||!(e||!t.filter((e=>e.exclusive)).length)}const jl={requests:[],tree:{locks:[],children:{}}};function Tl(e=jl,t){switch(t.type){case"ENQUEUE_LOCK_REQUEST":{const{request:n}=t;return{...e,requests:[n,...e.requests]}}case"GRANT_LOCK_REQUEST":{const{lock:n,request:r}=t,{store:o,path:i}=r,s=[o,...i],a=Al(e.tree,s),l=El(a,s);return l.locks=[...l.locks,n],{...e,requests:e.requests.filter((e=>e!==r)),tree:a}}case"RELEASE_LOCK":{const{lock:n}=t,r=[n.store,...n.path],o=Al(e.tree,r),i=El(o,r);return i.locks=i.locks.filter((e=>e!==n)),{...e,tree:o}}}return e}function Bl(e,t,n,{exclusive:r}){const o=[t,...n],i=e.tree;for(const e of function*(e,t){let n=e;yield n;for(const e of t){const t=n.children[e];if(!t)break;yield t,n=t}}(i,o))if(Il({exclusive:r},e.locks))return!1;const s=El(i,o);if(!s)return!0;for(const e of function*(e){const t=Object.values(e.children);for(;t.length;){const e=t.pop();yield e,t.push(...Object.values(e.children))}}(s))if(Il({exclusive:r},e.locks))return!1;return!0}function Rl(){let e=Tl(void 0,{type:"@@INIT"});function t(){for(const t of function(e){return e.requests}(e)){const{store:n,path:r,exclusive:o,notifyAcquired:i}=t;if(Bl(e,n,r,{exclusive:o})){const s={store:n,path:r,exclusive:o};e=Tl(e,{type:"GRANT_LOCK_REQUEST",lock:s,request:t}),i(s)}}}return{acquire:function(n,r,o){return new Promise((i=>{e=Tl(e,{type:"ENQUEUE_LOCK_REQUEST",request:{store:n,path:r,exclusive:o,notifyAcquired:i}}),t()}))},release:function(n){e=Tl(e,{type:"RELEASE_LOCK",lock:n}),t()}}}var Nl=n(87520);const{lock:Dl,unlock:Ml}=(0,Nl.yf)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/core-data"),Pl=[...Ss,...As.filter((e=>!!e.name))],Ol=Pl.reduce(((e,t)=>{const{kind:n,name:r,plural:o}=t;return e[Bs(n,r)]=(e,t,o)=>sa(e,n,r,t,o),o&&(e[Bs(n,o,"get")]=(e,t)=>ua(e,n,r,t)),e}),{}),Ll=Pl.reduce(((e,t)=>{const{kind:n,name:r,plural:o}=t;if(e[Bs(n,r)]=(e,t)=>rl(n,r,e,t),o){const t=Bs(n,o,"get");e[t]=(...e)=>sl(n,r,...e),e[t].shouldInvalidate=e=>sl.shouldInvalidate(e,n,r)}return e}),{}),Fl=Pl.reduce(((e,t)=>{const{kind:n,name:r}=t;return e[Bs(n,r,"save")]=(e,t)=>ps(n,r,e,t),e[Bs(n,r,"delete")]=(e,t,o)=>ls(n,r,e,t,o),e}),{}),zl=(0,T.A)(te,{reducer:Hs,actions:{...r,...Fl,...function(){const e=Rl();return{__unstableAcquireStoreLock:function(t,n,{exclusive:r}){return()=>e.acquire(t,n,r)},__unstableReleaseStoreLock:function(t){return()=>e.release(t)}}}()},selectors:{...o,...Ol},resolvers:{...s,...Ll}});Ml(zl).registerPrivateSelectors(i),(0,B.register)(zl);var Ul=n(57257),Vl=n(14687),Hl=n(16221);const $l=[],Wl=()=>{const{wp:e}=window;return e.media.view.MediaFrame.Select.extend({featuredImageToolbar(t){this.createSelectToolbar(t,{text:e.media.view.l10n.setFeaturedImage,state:this.options.state})},editState(){const t=this.state("featured-image").get("selection"),n=new e.media.view.EditImage({model:t.single(),controller:this}).render();this.content.set(n),n.loadEditor()},createStates:function(){this.on("toolbar:create:featured-image",this.featuredImageToolbar,this),this.on("content:render:edit-image",this.editState,this),this.states.add([new e.media.controller.FeaturedImage,new e.media.controller.EditImage({model:this.options.editImage})])}})},Gl=()=>{const{wp:e}=window;return e.media.view.MediaFrame.Post.extend({galleryToolbar(){const t=this.state().get("editing");this.toolbar.set(new e.media.view.Toolbar({controller:this,items:{insert:{style:"primary",text:t?e.media.view.l10n.updateGallery:e.media.view.l10n.insertGallery,priority:80,requires:{library:!0},click(){const e=this.controller,t=e.state();e.close(),t.trigger("update",t.get("library")),e.setState(e.options.state),e.reset()}}}}))},editState(){const t=this.state("gallery").get("selection"),n=new e.media.view.EditImage({model:t.single(),controller:this}).render();this.content.set(n),n.loadEditor()},createStates:function(){this.on("toolbar:create:main-gallery",this.galleryToolbar,this),this.on("content:render:edit-image",this.editState,this),this.states.add([new e.media.controller.Library({id:"gallery",title:e.media.view.l10n.createGalleryTitle,priority:40,toolbar:"main-gallery",filterable:"uploaded",multiple:"add",editable:!1,library:e.media.query({type:"image",...this.options.library})}),new e.media.controller.EditImage({model:this.options.editImage}),new e.media.controller.GalleryEdit({library:this.options.selection,editing:this.options.editing,menu:"gallery",displaySettings:!1,multiple:!0}),new e.media.controller.GalleryAdd])}})},ql=e=>["sizes","mime","type","subtype","id","url","alt","link","caption"].reduce(((t,n)=>(e?.hasOwnProperty(n)&&(t[n]=e[n]),t)),{}),Kl=e=>{const{wp:t}=window;return t.media.query({order:"ASC",orderby:"post__in",post__in:e,posts_per_page:-1,query:!0,type:"image"})};class Yl extends k.Component{constructor(){super(...arguments),this.openModal=this.openModal.bind(this),this.onOpen=this.onOpen.bind(this),this.onSelect=this.onSelect.bind(this),this.onUpdate=this.onUpdate.bind(this),this.onClose=this.onClose.bind(this)}initializeListeners(){this.frame.on("select",this.onSelect),this.frame.on("update",this.onUpdate),this.frame.on("open",this.onOpen),this.frame.on("close",this.onClose)}buildAndSetGalleryFrame(){const{addToGallery:e=!1,allowedTypes:t,multiple:n=!1,value:r=$l}=this.props;if(r===this.lastGalleryValue)return;const{wp:o}=window;let i;this.lastGalleryValue=r,this.frame&&this.frame.remove(),i=e?"gallery-library":r&&r.length?"gallery-edit":"gallery",this.GalleryDetailsMediaFrame||(this.GalleryDetailsMediaFrame=Gl());const s=Kl(r),a=new o.media.model.Selection(s.models,{props:s.props.toJSON(),multiple:n});this.frame=new this.GalleryDetailsMediaFrame({mimeType:t,state:i,multiple:n,selection:a,editing:!(!r||!r.length)}),o.media.frame=this.frame,this.initializeListeners()}buildAndSetFeatureImageFrame(){const{wp:e}=window,{value:t,multiple:n,allowedTypes:r}=this.props,o=Wl(),i=Kl(t),s=new e.media.model.Selection(i.models,{props:i.props.toJSON()});this.frame=new o({mimeType:r,state:"featured-image",multiple:n,selection:s,editing:t}),e.media.frame=this.frame,e.media.view.settings.post={...e.media.view.settings.post,featuredImageId:t||-1}}componentWillUnmount(){this.frame?.remove()}onUpdate(e){const{onSelect:t,multiple:n=!1}=this.props,r=this.frame.state(),o=e||r.get("selection");o&&o.models.length&&t(n?o.models.map((e=>ql(e.toJSON()))):ql(o.models[0].toJSON()))}onSelect(){const{onSelect:e,multiple:t=!1}=this.props,n=this.frame.state().get("selection").toJSON();e(t?n:n[0])}onOpen(){const{wp:e}=window,{value:t}=this.props;if(this.updateCollection(),this.props.mode&&this.frame.content.mode(this.props.mode),!(Array.isArray(t)?t?.length:t))return;const n=this.props.gallery,r=this.frame.state().get("selection"),o=Array.isArray(t)?t:[t];n||o.forEach((t=>{r.add(e.media.attachment(t))}));const i=Kl(o);i.more().done((function(){n&&i?.models?.length&&r.add(i.models)}))}onClose(){const{onClose:e}=this.props;e&&e()}updateCollection(){const e=this.frame.content.get();if(e&&e.collection){const t=e.collection;t.toArray().forEach((e=>e.trigger("destroy",e))),t.mirroring._hasMore=!0,t.more()}}openModal(){const{allowedTypes:e,gallery:t=!1,unstableFeaturedImageFlow:n=!1,modalClass:r,multiple:o=!1,title:i=(0,H.__)("Select or Upload Media")}=this.props,{wp:s}=window;if(t)this.buildAndSetGalleryFrame();else{const t={title:i,multiple:o};e&&(t.library={type:e}),this.frame=s.media(t)}r&&this.frame.$el.addClass(r),n&&this.buildAndSetFeatureImageFrame(),this.initializeListeners(),this.frame.open()}render(){return this.props.render({open:this.openModal})}}const Jl=Yl,Xl={};function Zl(e){const t=window.URL.createObjectURL(e);return Xl[t]=e,t}function Ql(e){Xl[e]&&window.URL.revokeObjectURL(e),delete Xl[e]}function ec(e){return!(!e||!e.indexOf)&&0===e.indexOf("blob:")}const tc=()=>{};async function nc({allowedTypes:e,additionalData:t={},filesList:n,maxUploadFileSize:r,onError:o=tc,onFileChange:i,wpAllowedMimeTypes:s=null}){const a=[...n],l=[],c=(e,t)=>{Ql(l[e]?.url),l[e]=t,i(l.filter(Boolean))},u=t=>!e||e.some((e=>e.includes("/")?e===t:t.startsWith(`${e}/`))),d=(h=s)?Object.entries(h).map((([e,t])=>{const[n]=t.split("/");return[t,...e.split("|").map((e=>`${n}/${e}`))]})).flat():h;var h;const p=[];for(const e of a)d&&e.type&&(f=e.type,!d.includes(f))?o({code:"MIME_TYPE_NOT_ALLOWED_FOR_USER",message:(0,H.sprintf)((0,H.__)("%s: Sorry, you are not allowed to upload this file type."),e.name),file:e}):!e.type||u(e.type)?r&&e.size>r?o({code:"SIZE_ABOVE_LIMIT",message:(0,H.sprintf)((0,H.__)("%s: This file exceeds the maximum upload size for this site."),e.name),file:e}):e.size<=0?o({code:"EMPTY_FILE",message:(0,H.sprintf)((0,H.__)("%s: This file is empty."),e.name),file:e}):(p.push(e),l.push({url:Zl(e)}),i(l)):o({code:"MIME_TYPE_NOT_SUPPORTED",message:(0,H.sprintf)((0,H.__)("%s: Sorry, this file type is not supported here."),e.name),file:e});var f;for(let e=0;en.append(e,t))),(0,S.default)({path:"/wp/v2/media",body:n,method:"POST"})}var oc=n(38245),ic=n(99940),sc=n(99532),ac=n(71848);const lc="block-default",cc=["attributes","supports","save","migrate","isEligible","apiVersion"],uc={"--wp--style--color--link":{value:["color","link"],support:["color","link"]},aspectRatio:{value:["dimensions","aspectRatio"],support:["dimensions","aspectRatio"],useEngine:!0},background:{value:["color","gradient"],support:["color","gradients"],useEngine:!0},backgroundColor:{value:["color","background"],support:["color","background"],requiresOptOut:!0,useEngine:!0},backgroundImage:{value:["background","backgroundImage"],support:["background","backgroundImage"],useEngine:!0},backgroundRepeat:{value:["background","backgroundRepeat"],support:["background","backgroundRepeat"],useEngine:!0},backgroundSize:{value:["background","backgroundSize"],support:["background","backgroundSize"],useEngine:!0},backgroundPosition:{value:["background","backgroundPosition"],support:["background","backgroundPosition"],useEngine:!0},borderColor:{value:["border","color"],support:["__experimentalBorder","color"],useEngine:!0},borderRadius:{value:["border","radius"],support:["__experimentalBorder","radius"],properties:{borderTopLeftRadius:"topLeft",borderTopRightRadius:"topRight",borderBottomLeftRadius:"bottomLeft",borderBottomRightRadius:"bottomRight"},useEngine:!0},borderStyle:{value:["border","style"],support:["__experimentalBorder","style"],useEngine:!0},borderWidth:{value:["border","width"],support:["__experimentalBorder","width"],useEngine:!0},borderTopColor:{value:["border","top","color"],support:["__experimentalBorder","color"],useEngine:!0},borderTopStyle:{value:["border","top","style"],support:["__experimentalBorder","style"],useEngine:!0},borderTopWidth:{value:["border","top","width"],support:["__experimentalBorder","width"],useEngine:!0},borderRightColor:{value:["border","right","color"],support:["__experimentalBorder","color"],useEngine:!0},borderRightStyle:{value:["border","right","style"],support:["__experimentalBorder","style"],useEngine:!0},borderRightWidth:{value:["border","right","width"],support:["__experimentalBorder","width"],useEngine:!0},borderBottomColor:{value:["border","bottom","color"],support:["__experimentalBorder","color"],useEngine:!0},borderBottomStyle:{value:["border","bottom","style"],support:["__experimentalBorder","style"],useEngine:!0},borderBottomWidth:{value:["border","bottom","width"],support:["__experimentalBorder","width"],useEngine:!0},borderLeftColor:{value:["border","left","color"],support:["__experimentalBorder","color"],useEngine:!0},borderLeftStyle:{value:["border","left","style"],support:["__experimentalBorder","style"],useEngine:!0},borderLeftWidth:{value:["border","left","width"],support:["__experimentalBorder","width"],useEngine:!0},color:{value:["color","text"],support:["color","text"],requiresOptOut:!0,useEngine:!0},columnCount:{value:["typography","textColumns"],support:["typography","textColumns"],useEngine:!0},filter:{value:["filter","duotone"],support:["filter","duotone"]},linkColor:{value:["elements","link","color","text"],support:["color","link"]},captionColor:{value:["elements","caption","color","text"],support:["color","caption"]},buttonColor:{value:["elements","button","color","text"],support:["color","button"]},buttonBackgroundColor:{value:["elements","button","color","background"],support:["color","button"]},headingColor:{value:["elements","heading","color","text"],support:["color","heading"]},headingBackgroundColor:{value:["elements","heading","color","background"],support:["color","heading"]},fontFamily:{value:["typography","fontFamily"],support:["typography","__experimentalFontFamily"],useEngine:!0},fontSize:{value:["typography","fontSize"],support:["typography","fontSize"],useEngine:!0},fontStyle:{value:["typography","fontStyle"],support:["typography","__experimentalFontStyle"],useEngine:!0},fontWeight:{value:["typography","fontWeight"],support:["typography","__experimentalFontWeight"],useEngine:!0},lineHeight:{value:["typography","lineHeight"],support:["typography","lineHeight"],useEngine:!0},margin:{value:["spacing","margin"],support:["spacing","margin"],properties:{marginTop:"top",marginRight:"right",marginBottom:"bottom",marginLeft:"left"},useEngine:!0},minHeight:{value:["dimensions","minHeight"],support:["dimensions","minHeight"],useEngine:!0},padding:{value:["spacing","padding"],support:["spacing","padding"],properties:{paddingTop:"top",paddingRight:"right",paddingBottom:"bottom",paddingLeft:"left"},useEngine:!0},textAlign:{value:["typography","textAlign"],support:["typography","textAlign"],useEngine:!1},textDecoration:{value:["typography","textDecoration"],support:["typography","__experimentalTextDecoration"],useEngine:!0},textTransform:{value:["typography","textTransform"],support:["typography","__experimentalTextTransform"],useEngine:!0},letterSpacing:{value:["typography","letterSpacing"],support:["typography","__experimentalLetterSpacing"],useEngine:!0},writingMode:{value:["typography","writingMode"],support:["typography","__experimentalWritingMode"],useEngine:!0},"--wp--style--root--padding":{value:["spacing","padding"],support:["spacing","padding"],properties:{"--wp--style--root--padding-top":"top","--wp--style--root--padding-right":"right","--wp--style--root--padding-bottom":"bottom","--wp--style--root--padding-left":"left"},rootOnly:!0}},dc={link:"a:where(:not(.wp-element-button))",heading:"h1, h2, h3, h4, h5, h6",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",button:".wp-element-button, .wp-block-button__link",caption:".wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption",cite:"cite"},hc={"color.duotone":!0,"color.gradients":!0,"color.palette":!0,"dimensions.aspectRatios":!0,"typography.fontSizes":!0,"spacing.spacingSizes":!0};var pc=n(8301),fc=n(75379);const{lock:mc,unlock:gc}=(0,Nl.yf)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/blocks"),bc={title:"block title",description:"block description",keywords:["block keyword"],styles:[{label:"block style label"}],variations:[{title:"block variation title",description:"block variation description",keywords:["block variation keyword"]}]};function vc(e){return null!==e&&"object"==typeof e}function yc({textdomain:e,...t}){const n=["apiVersion","title","category","parent","ancestor","icon","description","keywords","attributes","providesContext","usesContext","selectors","supports","styles","example","variations","blockHooks","allowedBlocks"],r=Object.fromEntries(Object.entries(t).filter((([e])=>n.includes(e))));return e&&Object.keys(bc).forEach((t=>{r[t]&&(r[t]=xc(bc[t],r[t],e))})),r}function _c(e,t){const n=vc(e)?e.name:e;if("string"!=typeof n)return void console.error("Block names must be strings.");if(!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(n))return void console.error("Block names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-block");if((0,pc.L)(ed).getBlockType(n))return void console.error('Block "'+n+'" is already registered.');const{addBootstrappedBlockType:r,addUnprocessedBlockType:o}=gc((0,fc.J)(ed));return vc(e)&&r(n,yc(e)),o(n,t),(0,pc.L)(ed).getBlockType(n)}function xc(e,t,n){return"string"==typeof e&&"string"==typeof t?(0,H._x)(t,e,n):Array.isArray(e)&&e.length&&Array.isArray(t)?t.map((t=>xc(e[0],t,n))):vc(e)&&Object.entries(e).length&&vc(t)?Object.keys(t).reduce(((r,o)=>e[o]?(r[o]=xc(e[o],t[o],n),r):(r[o]=t[o],r)),{}):t}function wc(){return(0,pc.L)(ed).getFreeformFallbackBlockName()}function kc(){return(0,pc.L)(ed).getUnregisteredFallbackBlockName()}function Cc(){return(0,pc.L)(ed).getDefaultBlockName()}function Sc(e){return(0,pc.L)(ed)?.getBlockType(e)}function Ac(){return(0,pc.L)(ed).getBlockTypes()}function Ec(e,t,n){return(0,pc.L)(ed).getBlockSupport(e,t,n)}function Ic(e,t,n){return(0,pc.L)(ed).hasBlockSupport(e,t,n)}function jc(e){return"core/block"===e?.name}function Tc(e){return"core/template-part"===e?.name}const Bc=(e,t)=>(0,pc.L)(ed).getBlockVariations(e,t);(0,oc.X$)([ic.A,sc.A]);const Rc=["#191e23","#f8f9f9"];function Nc(e){var t;return Object.entries(null!==(t=Sc(e.name)?.attributes)&&void 0!==t?t:{}).every((([t,n])=>{const r=e.attributes[t];return n.hasOwnProperty("default")?r===n.default:"rich-text"===n.type?!r?.length:void 0===r}))}function Dc(e){return e.name===Cc()&&Nc(e)}function Mc(e){return!!e&&("string"==typeof e||(0,k.isValidElement)(e)||"function"==typeof e||e instanceof k.Component)}function Pc(e){return"string"==typeof e?Sc(e):e}function Oc(e,t,n="visual"){const{__experimentalLabel:r,title:o}=e,i=r&&r(t,{context:n});return i?i.toPlainText?i.toPlainText():(0,ac.A)(i):o}function Lc(e,t,n,r="vertical"){const o=e?.title,i=e?Oc(e,t,"accessibility"):"",s=void 0!==n,a=i&&i!==o;return s&&"vertical"===r?a?(0,H.sprintf)((0,H.__)("%1$s Block. Row %2$d. %3$s"),o,n,i):(0,H.sprintf)((0,H.__)("%1$s Block. Row %2$d"),o,n):s&&"horizontal"===r?a?(0,H.sprintf)((0,H.__)("%1$s Block. Column %2$d. %3$s"),o,n,i):(0,H.sprintf)((0,H.__)("%1$s Block. Column %2$d"),o,n):a?(0,H.sprintf)((0,H.__)("%1$s Block. %2$s"),o,i):(0,H.sprintf)((0,H.__)("%s Block"),o)}function Fc(e){return void 0!==e.default?e.default:"rich-text"===e.type?new $.RichTextData:void 0}function zc(e,t){const n=Sc(e);if(void 0===n)throw new Error(`Block type '${e}' is not registered.`);return Object.entries(n.attributes).reduce(((e,[n,r])=>{const o=t[n];if(void 0!==o)"rich-text"===r.type?o instanceof $.RichTextData?e[n]=o:"string"==typeof o&&(e[n]=$.RichTextData.fromHTMLString(o)):"string"===r.type&&o instanceof $.RichTextData?e[n]=o.toHTMLString():e[n]=o;else{const t=Fc(r);void 0!==t&&(e[n]=t)}return-1!==["node","children"].indexOf(r.source)&&("string"==typeof e[n]?e[n]=[e[n]]:Array.isArray(e[n])||(e[n]=[])),e}),{})}function Uc(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.includes(e))))}const Vc=[{slug:"text",title:(0,H.__)("Text")},{slug:"media",title:(0,H.__)("Media")},{slug:"design",title:(0,H.__)("Design")},{slug:"widgets",title:(0,H.__)("Widgets")},{slug:"theme",title:(0,H.__)("Theme")},{slug:"embed",title:(0,H.__)("Embeds")},{slug:"reusable",title:(0,H.__)("Reusable blocks")}];function Hc(e){return e.reduce(((e,t)=>({...e,[t.name]:t})),{})}function $c(e){return e.reduce(((e,t)=>(e.some((e=>e.name===t.name))||e.push(t),e)),[])}function Wc(e){return(t=null,n)=>{switch(n.type){case"REMOVE_BLOCK_TYPES":return-1!==n.names.indexOf(t)?null:t;case e:return n.name||null}return t}}const Gc=Wc("SET_DEFAULT_BLOCK_NAME"),qc=Wc("SET_FREEFORM_FALLBACK_BLOCK_NAME"),Kc=Wc("SET_UNREGISTERED_FALLBACK_BLOCK_NAME"),Yc=Wc("SET_GROUPING_BLOCK_NAME"),Jc=(0,B.combineReducers)({bootstrappedBlockTypes:function(e={},t){switch(t.type){case"ADD_BOOTSTRAPPED_BLOCK_TYPE":const{name:n,blockType:r}=t,o=e[n];let i;return o?(void 0===o.blockHooks&&r.blockHooks&&(i={...o,...i,blockHooks:r.blockHooks}),void 0===o.allowedBlocks&&r.allowedBlocks&&(i={...o,...i,allowedBlocks:r.allowedBlocks})):(i=Object.fromEntries(Object.entries(r).filter((([,e])=>null!=e)).map((([e,t])=>[(0,Za.xQ)(e),t]))),i.name=n),i?{...e,[n]:i}:e;case"REMOVE_BLOCK_TYPES":return Uc(e,t.names)}return e},unprocessedBlockTypes:function(e={},t){switch(t.type){case"ADD_UNPROCESSED_BLOCK_TYPE":return{...e,[t.name]:t.blockType};case"REMOVE_BLOCK_TYPES":return Uc(e,t.names)}return e},blockTypes:function(e={},t){switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Hc(t.blockTypes)};case"REMOVE_BLOCK_TYPES":return Uc(e,t.names)}return e},blockStyles:function(e={},t){var n;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(Hc(t.blockTypes)).map((([t,n])=>{var r,o;return[t,$c([...(null!==(r=n.styles)&&void 0!==r?r:[]).map((e=>({...e,source:"block"}))),...(null!==(o=e[n.name])&&void 0!==o?o:[]).filter((({source:e})=>"block"!==e))])]})))};case"ADD_BLOCK_STYLES":const r={};return t.blockNames.forEach((n=>{var o;r[n]=$c([...null!==(o=e[n])&&void 0!==o?o:[],...t.styles])})),{...e,...r};case"REMOVE_BLOCK_STYLES":return{...e,[t.blockName]:(null!==(n=e[t.blockName])&&void 0!==n?n:[]).filter((e=>-1===t.styleNames.indexOf(e.name)))}}return e},blockVariations:function(e={},t){var n,r;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(Hc(t.blockTypes)).map((([t,n])=>{var r,o;return[t,$c([...(null!==(r=n.variations)&&void 0!==r?r:[]).map((e=>({...e,source:"block"}))),...(null!==(o=e[n.name])&&void 0!==o?o:[]).filter((({source:e})=>"block"!==e))])]})))};case"ADD_BLOCK_VARIATIONS":return{...e,[t.blockName]:$c([...null!==(n=e[t.blockName])&&void 0!==n?n:[],...t.variations])};case"REMOVE_BLOCK_VARIATIONS":return{...e,[t.blockName]:(null!==(r=e[t.blockName])&&void 0!==r?r:[]).filter((e=>-1===t.variationNames.indexOf(e.name)))}}return e},defaultBlockName:Gc,freeformFallbackBlockName:qc,unregisteredFallbackBlockName:Kc,groupingBlockName:Yc,categories:function(e=Vc,t){switch(t.type){case"SET_CATEGORIES":return t.categories||[];case"UPDATE_CATEGORY":if(!t.category||!Object.keys(t.category).length)return e;if(e.find((({slug:e})=>e===t.slug)))return e.map((e=>e.slug===t.slug?{...e,...t.category}:e))}return e},collections:function(e={},t){switch(t.type){case"ADD_BLOCK_COLLECTION":return{...e,[t.namespace]:{title:t.title,icon:t.icon}};case"REMOVE_BLOCK_COLLECTION":return Uc(e,t.namespace)}return e},blockBindingsSources:function(e={},t){return"REGISTER_BLOCK_BINDINGS_SOURCE"===t.type?{...e,[t.sourceName]:{label:t.sourceLabel,getValue:t.getValue,setValue:t.setValue,setValues:t.setValues,getPlaceholder:t.getPlaceholder,canUserEditValue:t.canUserEditValue||(()=>!1)}}:e}});var Xc=n(38986),Zc=n.n(Xc);const Qc=(e,t,n)=>{var r;const o=Array.isArray(t)?t:t.split(".");let i=e;return o.forEach((e=>{i=i?.[e]})),null!==(r=i)&&void 0!==r?r:n},eu=(e,t)=>"string"==typeof t?nu(e,t):t,tu=(0,Ws.A)((e=>Object.values(e.blockTypes)),(e=>[e.blockTypes]));function nu(e,t){return e.blockTypes[t]}function ru(e,t){return e.blockStyles[t]}const ou=(0,Ws.A)(((e,t,n)=>{const r=e.blockVariations[t];return r&&n?r.filter((e=>(e.scope||["block","inserter"]).includes(n))):r}),((e,t)=>[e.blockVariations[t]]));function iu(e,t,n,r){const o=ou(e,t,r);if(!o)return o;const i=nu(e,t),s=Object.keys(i?.attributes||{});let a,l=0;for(const e of o)if(Array.isArray(e.isActive)){const t=e.isActive.filter((e=>{const t=e.split(".")[0];return s.includes(t)})),r=t.length;if(0===r)continue;t.every((t=>{const r=Qc(n,t);return void 0!==r&&r===Qc(e.attributes,t)}))&&r>l&&(a=e,l=r)}else if(e.isActive?.(n,e.attributes))return a||e;return a}function su(e,t,n){const r=ou(e,t,n);return[...r].reverse().find((({isDefault:e})=>!!e))||r[0]}function au(e){return e.categories}function lu(e){return e.collections}function cu(e){return e.defaultBlockName}function uu(e){return e.freeformFallbackBlockName}function du(e){return e.unregisteredFallbackBlockName}function hu(e){return e.groupingBlockName}const pu=(0,Ws.A)(((e,t)=>tu(e).filter((e=>e.parent?.includes(t))).map((({name:e})=>e))),(e=>[e.blockTypes])),fu=(e,t,n,r)=>{const o=eu(e,t);return o?.supports?Qc(o.supports,n,r):r};function mu(e,t,n,r){return!!fu(e,t,n,r)}function gu(e){return Zc()(null!=e?e:"").toLowerCase().trim()}function bu(e,t,n=""){const r=eu(e,t),o=gu(n),i=e=>gu(e).includes(o);return i(r.title)||r.keywords?.some(i)||i(r.category)||"string"==typeof r.description&&i(r.description)}const vu=(e,t)=>pu(e,t).length>0,yu=(e,t)=>pu(e,t).some((t=>mu(e,t,"inserter",!0))),_u=(0,Ws.A)(((e,t)=>{const n=nu(e,t);return!!n&&Object.entries(n.attributes).some((([,{__experimentalRole:e}])=>"content"===e))}),((e,t)=>[e.blockTypes[t]?.attributes])),xu=["background","backgroundColor","color","linkColor","captionColor","buttonColor","headingColor","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","padding","contentSize","wideSize","blockGap","textDecoration","textTransform","letterSpacing"];function wu(e,t,n){return e.filter((e=>!("fontSize"===e&&"heading"===n||"textDecoration"===e&&!t&&"link"!==n||"textTransform"===e&&!t&&!["heading","h1","h2","h3","h4","h5","h6"].includes(n)&&"button"!==n&&"caption"!==n&&"text"!==n||"letterSpacing"===e&&!t&&!["heading","h1","h2","h3","h4","h5","h6"].includes(n)&&"button"!==n&&"caption"!==n&&"text"!==n||"textColumns"===e&&!t)))}const ku=(0,Ws.A)(((e,t,n)=>{if(!t)return wu(xu,t,n);const r=nu(e,t);if(!r)return[];const o=[];return r?.supports?.spacing?.blockGap&&o.push("blockGap"),r?.supports?.shadow&&o.push("shadow"),Object.keys(uc).forEach((e=>{uc[e].support&&(uc[e].requiresOptOut&&uc[e].support[0]in r.supports&&!1!==Qc(r.supports,uc[e].support)||Qc(r.supports,uc[e].support,!1))&&o.push(e)})),wu(o,t,n)}),((e,t)=>[e.blockTypes[t]]));function Cu(e,t){return e.bootstrappedBlockTypes[t]}function Su(e){return e.unprocessedBlockTypes}function Au(e){return e.blockBindingsSources}function Eu(e,t){return e.blockBindingsSources[t]}var Iu=n(94260),ju=n(74448),Tu=n(9067);const Bu=(...e)=>window?.console?.error?.(...e),Ru={common:"text",formatting:"text",layout:"design"};function Nu(e=[],t=[]){const n=[...e];return t.forEach((e=>{const t=n.findIndex((t=>t.name===e.name));-1!==t?n[t]={...n[t],...e}:n.push(e)})),n}const Du=(e,t)=>({select:n})=>{const r=n.getBootstrappedBlockType(e),o={name:e,icon:lc,keywords:[],attributes:{},providesContext:{},usesContext:[],selectors:{},supports:{},styles:[],blockHooks:{},save:()=>null,...r,...t,variations:Nu(r?.variations,t?.variations)},i=(0,Tu.applyFilters)("blocks.registerBlockType",o,e,null);if(i.description&&"string"!=typeof i.description&&(0,q.default)("Declaring non-string block descriptions",{since:"6.2"}),i.deprecated&&(i.deprecated=i.deprecated.map((e=>Object.fromEntries(Object.entries((0,Tu.applyFilters)("blocks.registerBlockType",{...Uc(o,cc),...e},o.name,e)).filter((([e])=>cc.includes(e))))))),(0,Iu.Q)(i))if("function"==typeof i.save)if(!("edit"in i)||(0,ju.isValidElementType)(i.edit))if(Ru.hasOwnProperty(i.category)&&(i.category=Ru[i.category]),"category"in i&&!n.getCategories().some((({slug:e})=>e===i.category))&&(((...e)=>{window?.console?.warn?.(...e)})('The block "'+e+'" is registered with an invalid category "'+i.category+'".'),delete i.category),"title"in i&&""!==i.title)if("string"==typeof i.title){if(i.icon=function(e){if(Mc(e=e||lc))return{src:e};if("background"in e){const t=(0,oc.Mj)(e.background),n=e=>t.contrast(e),r=Math.max(...Rc.map(n));return{...e,foreground:e.foreground?e.foreground:Rc.find((e=>n(e)===r)),shadowColor:t.alpha(.3).toRgbString()}}return e}(i.icon),Mc(i.icon.src))return i;Bu("The icon passed is invalid. The icon should be a string, an element, a function, or an object following the specifications documented in https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#icon-optional")}else Bu("Block titles must be strings.");else Bu('The block "'+e+'" must have a title.');else Bu('The "edit" property must be a valid component.');else Bu('The "save" property must be a valid function.');else Bu("Block settings must be a valid object.")};function Mu(e){return{type:"ADD_BLOCK_TYPES",blockTypes:Array.isArray(e)?e:[e]}}function Pu(){return({dispatch:e,select:t})=>{const n=[];for(const[r,o]of Object.entries(t.getUnprocessedBlockTypes())){const t=e(Du(r,o));t&&n.push(t)}n.length&&e.addBlockTypes(n)}}function Ou(){return(0,q.default)('wp.data.dispatch( "core/blocks" ).__experimentalReapplyBlockFilters',{since:"6.4",alternative:"reapplyBlockFilters"}),Pu()}function Lu(e){return{type:"REMOVE_BLOCK_TYPES",names:Array.isArray(e)?e:[e]}}function Fu(e,t){return{type:"ADD_BLOCK_STYLES",styles:Array.isArray(t)?t:[t],blockNames:Array.isArray(e)?e:[e]}}function zu(e,t){return{type:"REMOVE_BLOCK_STYLES",styleNames:Array.isArray(t)?t:[t],blockName:e}}function Uu(e,t){return{type:"ADD_BLOCK_VARIATIONS",variations:Array.isArray(t)?t:[t],blockName:e}}function Vu(e,t){return{type:"REMOVE_BLOCK_VARIATIONS",variationNames:Array.isArray(t)?t:[t],blockName:e}}function Hu(e){return{type:"SET_DEFAULT_BLOCK_NAME",name:e}}function $u(e){return{type:"SET_FREEFORM_FALLBACK_BLOCK_NAME",name:e}}function Wu(e){return{type:"SET_UNREGISTERED_FALLBACK_BLOCK_NAME",name:e}}function Gu(e){return{type:"SET_GROUPING_BLOCK_NAME",name:e}}function qu(e){return{type:"SET_CATEGORIES",categories:e}}function Ku(e,t){return{type:"UPDATE_CATEGORY",slug:e,category:t}}function Yu(e,t,n){return{type:"ADD_BLOCK_COLLECTION",namespace:e,title:t,icon:n}}function Ju(e){return{type:"REMOVE_BLOCK_COLLECTION",namespace:e}}function Xu(e,t){return{type:"ADD_BOOTSTRAPPED_BLOCK_TYPE",name:e,blockType:t}}function Zu(e,t){return({dispatch:n})=>{n({type:"ADD_UNPROCESSED_BLOCK_TYPE",name:e,blockType:t});const r=n(Du(e,t));r&&n.addBlockTypes(r)}}function Qu(e){return{type:"REGISTER_BLOCK_BINDINGS_SOURCE",sourceName:e.name,sourceLabel:e.label,getValue:e.getValue,setValue:e.setValue,setValues:e.setValues,getPlaceholder:e.getPlaceholder,canUserEditValue:e.canUserEditValue}}const ed=(0,T.A)("core/blocks",{reducer:Jc,selectors:a,actions:c});function td(e,t={},n=[]){const r=zc(e,t);return{clientId:(0,W.A)(),name:e,isValid:!0,attributes:r,innerBlocks:n}}function nd(e=[]){return e.map((e=>{const t=Array.isArray(e)?e:[e.name,e.attributes,e.innerBlocks],[n,r,o=[]]=t;return td(n,r,nd(o))}))}function rd(e,t={},n){const r=(0,W.A)(),o=zc(e.name,{...e.attributes,...t});return{...e,clientId:r,attributes:o,innerBlocks:n||e.innerBlocks.map((e=>rd(e)))}}function od(e,t={},n){const r=(0,W.A)();return{...e,clientId:r,attributes:{...e.attributes,...t},innerBlocks:n||e.innerBlocks.map((e=>od(e)))}}(0,B.register)(ed),gc(ed).registerPrivateSelectors(l),gc(ed).registerPrivateActions(u);const id=(e,t,n)=>{if(!n.length)return!1;const r=n.length>1,o=n[0].name;if(!sd(e)&&r&&!e.isMultiBlock)return!1;if(!sd(e)&&!n.every((e=>e.name===o)))return!1;if("block"!==e.type)return!1;const i=n[0];return!("from"===t&&-1===e.blocks.indexOf(i.name)&&!sd(e)||!r&&"from"===t&&ad(i.name)&&ad(e.blockName)||!ud(e,n))},sd=e=>e&&"block"===e.type&&Array.isArray(e.blocks)&&e.blocks.includes("*"),ad=e=>e===(0,pc.L)(ed).getGroupingBlockName();function ld(e,t){const n=(0,Tu.createHooks)();for(let r=0;re||o),o.priority)}return n.applyFilters("transform",null)}function cd(e,t){if(void 0===t)return Ac().map((({name:t})=>cd(e,t))).flat();const n=Pc(t),{name:r,transforms:o}=n||{};if(!o||!Array.isArray(o[e]))return[];const i=o.supportedMobileTransforms&&Array.isArray(o.supportedMobileTransforms),s=i?o[e].filter((e=>"raw"===e.type||!(!e.blocks||!e.blocks.length)&&(!!sd(e)||e.blocks.every((e=>o.supportedMobileTransforms.includes(e)))))):o[e];return s.map((e=>({...e,blockName:r,usingMobileTransformations:i})))}function ud(e,t){if("function"!=typeof e.isMatch)return!0;const n=t[0],r=e.isMultiBlock?t.map((e=>e.attributes)):n.attributes,o=e.isMultiBlock?t:n;return e.isMatch(r,o)}function dd(e,t){const n=Array.isArray(e)?e:[e],r=n.length>1,o=n[0],i=o.name,s=cd("from",t),a=ld(cd("to",i),(e=>"block"===e.type&&(sd(e)||-1!==e.blocks.indexOf(t))&&(!r||e.isMultiBlock)&&ud(e,n)))||ld(s,(e=>"block"===e.type&&(sd(e)||-1!==e.blocks.indexOf(i))&&(!r||e.isMultiBlock)&&ud(e,n)));if(!a)return null;let l;return l=a.isMultiBlock?"__experimentalConvert"in a?a.__experimentalConvert(n):a.transform(n.map((e=>e.attributes)),n.map((e=>e.innerBlocks))):"__experimentalConvert"in a?a.__experimentalConvert(o):a.transform(o.attributes,o.innerBlocks),null===l||"object"!=typeof l?null:(l=Array.isArray(l)?l:[l],l.some((e=>!Sc(e.name)))?null:l.some((e=>e.name===t))?l.map(((t,n,r)=>(0,Tu.applyFilters)("blocks.switchToBlockType.transformedBlock",t,e,n,r))):null)}const hd=(e,t)=>{try{var n;return td(e,t.attributes,(null!==(n=t.innerBlocks)&&void 0!==n?n:[]).map((e=>hd(e.name,e))))}catch{return td("core/missing",{originalName:e,originalContent:"",originalUndelimitedContent:""})}};let pd,fd,md,gd;const bd=/)[^])*)\5|[^]*?)}\s+)?(\/)?-->/g;function vd(e,t,n,r,o){return{blockName:e,attrs:t,innerBlocks:n,innerHTML:r,innerContent:o}}function yd(e){return vd(null,{},[],e,[e])}const _d=e=>{pd=e,fd=0,md=[],gd=[],bd.lastIndex=0;do{}while(xd());return md};function xd(){const e=gd.length,t=function(){const e=bd.exec(pd);if(null===e)return["no-more-tokens","",null,0,0];const t=e.index,[n,r,o,i,s,,a]=e,l=n.length,c=!!r,u=!!a,d=(o||"core/")+i,h=!!s?function(e){try{return JSON.parse(e)}catch(e){return null}}(s):{};return u?["void-block",d,h,t,l]:c?["block-closer",d,null,t,l]:["block-opener",d,h,t,l]}(),[n,r,o,i,s]=t,a=i>fd?fd:null;switch(n){case"no-more-tokens":if(0===e)return wd(),!1;if(1===e)return Cd(),!1;for(;0)[^\\-]*)*(?:--\x3e)?|!\\[CDATA\\[[^\\]]*(?:](?!]>)[^\\]]*)*?(?:]]>)?)|[^>]*>?))");var Ad=n(19799),Ed=n(49069);function Id(e,t={}){const{isCommentDelimited:n=!0}=t,{blockName:r,attrs:o={},innerBlocks:i=[],innerContent:s=[]}=e;let a=0;const l=s.map((e=>null!==e?e:Id(i[a++],t))).join("\n").replace(/\n+/g,"\n").trim();return n?Ld(r,o,l):l}var jd=n(86106);function Td(e){const t="wp-block-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,Tu.applyFilters)("blocks.getBlockDefaultClassName",t,e)}function Bd(e){const t="editor-block-list-item-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,Tu.applyFilters)("blocks.getBlockMenuDefaultClassName",t,e)}const Rd={},Nd={};function Dd(e={}){const{blockType:t,attributes:n}=Rd;return Dd.skipFilters?e:(0,Tu.applyFilters)("blocks.getSaveContent.extraProps",{...e},t,n)}function Md(e,t,n=[]){const r=Pc(e);if(!r?.save)return null;let{save:o}=r;if(o.prototype instanceof k.Component){const e=new o({attributes:t});o=e.render.bind(e)}Rd.blockType=r,Rd.attributes=t,Nd.innerBlocks=n;let i=o({attributes:t,innerBlocks:n});if(null!==i&&"object"==typeof i&&(0,Tu.hasFilter)("blocks.getSaveContent.extraProps")&&!(r.apiVersion>1)){const e=(0,Tu.applyFilters)("blocks.getSaveContent.extraProps",{...i.props},r,t);(0,M.default)(e,i.props)||(i=(0,k.cloneElement)(i,e))}return(0,Tu.applyFilters)("blocks.getSaveElement",i,r,t)}function Pd(e,t,n){const r=Pc(e);return(0,Ed.Ay)(Md(r,t,n))}function Od(e){let t=e.originalContent;if(e.isValid||e.innerBlocks.length)try{t=Pd(e.name,e.attributes,e.innerBlocks)}catch(e){}return t}function Ld(e,t,n){const r=t&&Object.entries(t).length?function(e){return JSON.stringify(e).replace(/--/g,"\\u002d\\u002d").replace(//g,"\\u003e").replace(/&/g,"\\u0026").replace(/\\"/g,"\\u0022")}(t)+" ":"",o=e?.startsWith("core/")?e.slice(5):e;return n?`\x3c!-- wp:${o} ${r}--\x3e\n`+n+`\n\x3c!-- /wp:${o} --\x3e`:`\x3c!-- wp:${o} ${r}/--\x3e`}function Fd(e,t){return(Array.isArray(e)?e:[e]).map((e=>function(e,{isInnerBlocks:t=!1}={}){if(!e.isValid&&e.__unstableBlockSource)return Id(e.__unstableBlockSource);const n=e.name,r=Od(e);if(n===kc()||!t&&n===wc())return r;const o=Sc(n);if(!o)return r;const i=function(e,t){var n;return Object.entries(null!==(n=e.attributes)&&void 0!==n?n:{}).reduce(((e,[n,r])=>{const o=t[n];return void 0===o||void 0!==r.source||"default"in r&&JSON.stringify(r.default)===JSON.stringify(o)||(e[n]=o),e}),{})}(o,e.attributes);return Ld(n,i,r)}(e,t))).join("\n\n")}var zd=/[\t\n\f ]/,Ud=/[A-Za-z]/,Vd=/\r\n?/g;function Hd(e){return zd.test(e)}function $d(e){return Ud.test(e)}var Wd=function(){function e(e,t,n){void 0===n&&(n="precompile"),this.delegate=e,this.entityParser=t,this.mode=n,this.state="beforeData",this.line=-1,this.column=-1,this.input="",this.index=-1,this.tagNameBuffer="",this.states={beforeData:function(){var e=this.peek();if("<"!==e||this.isIgnoredEndTag()){if("precompile"===this.mode&&"\n"===e){var t=this.tagNameBuffer.toLowerCase();"pre"!==t&&"textarea"!==t||this.consume()}this.transitionTo("data"),this.delegate.beginData()}else this.transitionTo("tagOpen"),this.markTagStart(),this.consume()},data:function(){var e=this.peek(),t=this.tagNameBuffer;"<"!==e||this.isIgnoredEndTag()?"&"===e&&"script"!==t&&"style"!==t?(this.consume(),this.delegate.appendToData(this.consumeCharRef()||"&")):(this.consume(),this.delegate.appendToData(e)):(this.delegate.finishData(),this.transitionTo("tagOpen"),this.markTagStart(),this.consume())},tagOpen:function(){var e=this.consume();"!"===e?this.transitionTo("markupDeclarationOpen"):"/"===e?this.transitionTo("endTagOpen"):("@"===e||":"===e||$d(e))&&(this.transitionTo("tagName"),this.tagNameBuffer="",this.delegate.beginStartTag(),this.appendToTagName(e))},markupDeclarationOpen:function(){var e=this.consume();"-"===e&&"-"===this.peek()?(this.consume(),this.transitionTo("commentStart"),this.delegate.beginComment()):"DOCTYPE"===e.toUpperCase()+this.input.substring(this.index,this.index+6).toUpperCase()&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.transitionTo("doctype"),this.delegate.beginDoctype&&this.delegate.beginDoctype())},doctype:function(){Hd(this.consume())&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var e=this.consume();Hd(e)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(e.toLowerCase()))},doctypeName:function(){var e=this.consume();Hd(e)?this.transitionTo("afterDoctypeName"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(e.toLowerCase())},afterDoctypeName:function(){var e=this.consume();if(!Hd(e))if(">"===e)this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData");else{var t=e.toUpperCase()+this.input.substring(this.index,this.index+5).toUpperCase(),n="PUBLIC"===t.toUpperCase(),r="SYSTEM"===t.toUpperCase();(n||r)&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume()),n?this.transitionTo("afterDoctypePublicKeyword"):r&&this.transitionTo("afterDoctypeSystemKeyword")}},afterDoctypePublicKeyword:function(){var e=this.peek();Hd(e)?(this.transitionTo("beforeDoctypePublicIdentifier"),this.consume()):'"'===e?(this.transitionTo("doctypePublicIdentifierDoubleQuoted"),this.consume()):"'"===e?(this.transitionTo("doctypePublicIdentifierSingleQuoted"),this.consume()):">"===e&&(this.consume(),this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},doctypePublicIdentifierDoubleQuoted:function(){var e=this.consume();'"'===e?this.transitionTo("afterDoctypePublicIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(e)},doctypePublicIdentifierSingleQuoted:function(){var e=this.consume();"'"===e?this.transitionTo("afterDoctypePublicIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypePublicIdentifier&&this.delegate.appendToDoctypePublicIdentifier(e)},afterDoctypePublicIdentifier:function(){var e=this.consume();Hd(e)?this.transitionTo("betweenDoctypePublicAndSystemIdentifiers"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):'"'===e?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):"'"===e&&this.transitionTo("doctypeSystemIdentifierSingleQuoted")},betweenDoctypePublicAndSystemIdentifiers:function(){var e=this.consume();Hd(e)||(">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):'"'===e?this.transitionTo("doctypeSystemIdentifierDoubleQuoted"):"'"===e&&this.transitionTo("doctypeSystemIdentifierSingleQuoted"))},doctypeSystemIdentifierDoubleQuoted:function(){var e=this.consume();'"'===e?this.transitionTo("afterDoctypeSystemIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(e)},doctypeSystemIdentifierSingleQuoted:function(){var e=this.consume();"'"===e?this.transitionTo("afterDoctypeSystemIdentifier"):">"===e?(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData")):this.delegate.appendToDoctypeSystemIdentifier&&this.delegate.appendToDoctypeSystemIdentifier(e)},afterDoctypeSystemIdentifier:function(){var e=this.consume();Hd(e)||">"===e&&(this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData"))},commentStart:function(){var e=this.consume();"-"===e?this.transitionTo("commentStartDash"):">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData(e),this.transitionTo("comment"))},commentStartDash:function(){var e=this.consume();"-"===e?this.transitionTo("commentEnd"):">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("-"),this.transitionTo("comment"))},comment:function(){var e=this.consume();"-"===e?this.transitionTo("commentEndDash"):this.delegate.appendToCommentData(e)},commentEndDash:function(){var e=this.consume();"-"===e?this.transitionTo("commentEnd"):(this.delegate.appendToCommentData("-"+e),this.transitionTo("comment"))},commentEnd:function(){var e=this.consume();">"===e?(this.delegate.finishComment(),this.transitionTo("beforeData")):(this.delegate.appendToCommentData("--"+e),this.transitionTo("comment"))},tagName:function(){var e=this.consume();Hd(e)?this.transitionTo("beforeAttributeName"):"/"===e?this.transitionTo("selfClosingStartTag"):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(e)},endTagName:function(){var e=this.consume();Hd(e)?(this.transitionTo("beforeAttributeName"),this.tagNameBuffer=""):"/"===e?(this.transitionTo("selfClosingStartTag"),this.tagNameBuffer=""):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData"),this.tagNameBuffer=""):this.appendToTagName(e)},beforeAttributeName:function(){var e=this.peek();Hd(e)?this.consume():"/"===e?(this.transitionTo("selfClosingStartTag"),this.consume()):">"===e?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):"="===e?(this.delegate.reportSyntaxError("attribute name cannot start with equals sign"),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(e)):(this.transitionTo("attributeName"),this.delegate.beginAttribute())},attributeName:function(){var e=this.peek();Hd(e)?(this.transitionTo("afterAttributeName"),this.consume()):"/"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"="===e?(this.transitionTo("beforeAttributeValue"),this.consume()):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):'"'===e||"'"===e||"<"===e?(this.delegate.reportSyntaxError(e+" is not a valid character within attribute names"),this.consume(),this.delegate.appendToAttributeName(e)):(this.consume(),this.delegate.appendToAttributeName(e))},afterAttributeName:function(){var e=this.peek();Hd(e)?this.consume():"/"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"="===e?(this.consume(),this.transitionTo("beforeAttributeValue")):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.transitionTo("attributeName"),this.delegate.beginAttribute(),this.consume(),this.delegate.appendToAttributeName(e))},beforeAttributeValue:function(){var e=this.peek();Hd(e)?this.consume():'"'===e?(this.transitionTo("attributeValueDoubleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):"'"===e?(this.transitionTo("attributeValueSingleQuoted"),this.delegate.beginAttributeValue(!0),this.consume()):">"===e?(this.delegate.beginAttributeValue(!1),this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.transitionTo("attributeValueUnquoted"),this.delegate.beginAttributeValue(!1),this.consume(),this.delegate.appendToAttributeValue(e))},attributeValueDoubleQuoted:function(){var e=this.consume();'"'===e?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):"&"===e?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(e)},attributeValueSingleQuoted:function(){var e=this.consume();"'"===e?(this.delegate.finishAttributeValue(),this.transitionTo("afterAttributeValueQuoted")):"&"===e?this.delegate.appendToAttributeValue(this.consumeCharRef()||"&"):this.delegate.appendToAttributeValue(e)},attributeValueUnquoted:function(){var e=this.peek();Hd(e)?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("beforeAttributeName")):"/"===e?(this.delegate.finishAttributeValue(),this.consume(),this.transitionTo("selfClosingStartTag")):"&"===e?(this.consume(),this.delegate.appendToAttributeValue(this.consumeCharRef()||"&")):">"===e?(this.delegate.finishAttributeValue(),this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):(this.consume(),this.delegate.appendToAttributeValue(e))},afterAttributeValueQuoted:function(){var e=this.peek();Hd(e)?(this.consume(),this.transitionTo("beforeAttributeName")):"/"===e?(this.consume(),this.transitionTo("selfClosingStartTag")):">"===e?(this.consume(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},selfClosingStartTag:function(){">"===this.peek()?(this.consume(),this.delegate.markTagAsSelfClosing(),this.delegate.finishTag(),this.transitionTo("beforeData")):this.transitionTo("beforeAttributeName")},endTagOpen:function(){var e=this.consume();("@"===e||":"===e||$d(e))&&(this.transitionTo("endTagName"),this.tagNameBuffer="",this.delegate.beginEndTag(),this.appendToTagName(e))}},this.reset()}return e.prototype.reset=function(){this.transitionTo("beforeData"),this.input="",this.tagNameBuffer="",this.index=0,this.line=1,this.column=0,this.delegate.reset()},e.prototype.transitionTo=function(e){this.state=e},e.prototype.tokenize=function(e){this.reset(),this.tokenizePart(e),this.tokenizeEOF()},e.prototype.tokenizePart=function(e){for(this.input+=function(e){return e.replace(Vd,"\n")}(e);this.index"!==this.input.substring(this.index,this.index+8)||"style"===e&&""!==this.input.substring(this.index,this.index+8)||"script"===e&&"<\/script>"!==this.input.substring(this.index,this.index+9)},e}(),Gd=function(){function e(e,t){void 0===t&&(t={}),this.options=t,this.token=null,this.startLine=1,this.startColumn=0,this.tokens=[],this.tokenizer=new Wd(this,e,t.mode),this._currentAttribute=void 0}return e.prototype.tokenize=function(e){return this.tokens=[],this.tokenizer.tokenize(e),this.tokens},e.prototype.tokenizePart=function(e){return this.tokens=[],this.tokenizer.tokenizePart(e),this.tokens},e.prototype.tokenizeEOF=function(){return this.tokens=[],this.tokenizer.tokenizeEOF(),this.tokens[0]},e.prototype.reset=function(){this.token=null,this.startLine=1,this.startColumn=0},e.prototype.current=function(){var e=this.token;if(null===e)throw new Error("token was unexpectedly null");if(0===arguments.length)return e;for(var t=0;te("Block validation: "+t,...n)}return{error:e(console.error),warning:e(console.warn),getItems:()=>[]}}const Kd=/[\t\n\r\v\f ]+/g,Yd=/^[\t\n\r\v\f ]*$/,Jd=/^url\s*\(['"\s]*(.*?)['"\s]*\)$/,Xd=["allowfullscreen","allowpaymentrequest","allowusermedia","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","typemustmatch"],Zd=[...Xd,"autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"],Qd=[e=>e,function(e){return oh(e).join(" ")}],eh=/^[\da-z]+$/i,th=/^#\d+$/,nh=/^#x[\da-f]+$/i;class rh{parse(e){if(t=e,eh.test(t)||th.test(t)||nh.test(t))return(0,Qa.decodeEntities)("&"+e+";");var t}}function oh(e){return e.trim().split(Kd)}function ih(e){return e.attributes.filter((e=>{const[t,n]=e;return n||0===t.indexOf("data-")||Zd.includes(t)}))}function sh(e,t,n=qd()){let r=e.chars,o=t.chars;for(let e=0;e{const[t,...n]=e.split(":"),r=n.join(":");return[t.trim(),lh(r.trim())]}));return Object.fromEntries(t)}const uh={class:(e,t)=>{const[n,r]=[e,t].map(oh),o=n.filter((e=>!r.includes(e))),i=r.filter((e=>!n.includes(e)));return 0===o.length&&0===i.length},style:(e,t)=>N()(...[e,t].map(ch)),...Object.fromEntries(Xd.map((e=>[e,()=>!0])))},dh={StartTag:(e,t,n=qd())=>e.tagName!==t.tagName&&e.tagName.toLowerCase()!==t.tagName.toLowerCase()?(n.warning("Expected tag name `%s`, instead saw `%s`.",t.tagName,e.tagName),!1):function(e,t,n=qd()){if(e.length!==t.length)return n.warning("Expected attributes %o, instead saw %o.",t,e),!1;const r={};for(let e=0;ee}}(),r=Pc(t);let o;try{o=Pd(r,e.attributes)}catch(e){return n.error("Block validation failed because an error occurred while generating block content:\n\n%s",e.toString()),[!1,n.getItems()]}const i=function(e,t,n=qd()){if(e===t)return!0;const[r,o]=[e,t].map((e=>function(e,t=qd()){try{return new Gd(new rh).tokenize(e)}catch(n){t.warning("Malformed HTML detected: %s",e)}return null}(e,n)));if(!r||!o)return!1;let i,s;for(;i=hh(r);){if(s=hh(o),!s)return n.warning("Expected end of content, instead saw %o.",i),!1;if(i.type!==s.type)return n.warning("Expected token of type `%s` (%o), instead saw `%s` (%o).",s.type,s,i.type,i),!1;const e=dh[i.type];if(e&&!e(i,s,n))return!1;ph(i,o[0])?hh(o):ph(s,r[0])&&hh(r)}return!(s=hh(o))||(n.warning("Expected %o, instead saw end of content.",s),!1)}(e.originalContent,o,n);return i||n.error("Block validation failed for `%s` (%o).\n\nContent generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",r.name,r,o,e.originalContent),[i,n.getItems()]}function mh(e,t){const n={...t};if("core/cover-image"===e&&(e="core/cover"),"core/text"!==e&&"core/cover-text"!==e||(e="core/paragraph"),e&&0===e.indexOf("core/social-link-")&&(n.service=e.substring(17),e="core/social-link"),e&&0===e.indexOf("core-embed/")){const t=e.substring(11),r={speaker:"speaker-deck",polldaddy:"crowdsignal"};n.providerNameSlug=t in r?r[t]:t,["amazon-kindle","wordpress"].includes(t)||(n.responsive=!0),e="core/embed"}if("core/post-comment-author"===e&&(e="core/comment-author-name"),"core/post-comment-content"===e&&(e="core/comment-content"),"core/post-comment-date"===e&&(e="core/comment-date"),"core/comments-query-loop"===e){e="core/comments";const{className:t=""}=n;t.includes("wp-block-comments-query-loop")||(n.className=["wp-block-comments-query-loop",t].join(" "))}if("core/post-comments"===e&&(e="core/comments",n.legacy=!0),globalThis.IS_GUTENBERG_PLUGIN&&n.metadata?.bindings&&("core/paragraph"===e||"core/heading"===e||"core/image"===e||"core/button"===e)&&"core/pattern-overrides"!==n.metadata.bindings.__default?.source){let e=!1;["content","url","title","id","alt","text","linkTarget"].forEach((t=>{"core/pattern-overrides"===n.metadata.bindings[t]?.source&&(e=!0,n.metadata={...n.metadata,bindings:{...n.metadata.bindings}},delete n.metadata.bindings[t])})),e&&(n.metadata.bindings.__default={source:"core/pattern-overrides"})}return[e,n]}var gh=function(){var e;return function(){return e||(e=document.implementation.createHTMLDocument("")),e}}();function bh(e,t){if(t){if("string"==typeof e){var n=gh();n.body.innerHTML=e,e=n.body}if("function"==typeof t)return t(e);if(Object===t.constructor)return Object.keys(t).reduce((function(n,r){var o=t[r];return n[r]=bh(e,o),n}),{})}}function vh(e,t){var n,r;return 1===arguments.length?(n=e,r=void 0):(n=t,r=e),function(e){var t=e;if(r&&(t=e.querySelector(r)),t)return function(e,t){for(var n,r=t.split(".");n=r.shift();){if(!(n in e))return;e=e[n]}return e}(t,n)}}var yh=n(60204);function _h(e){const t={};for(let n=0;n{let n=t;return e&&(n=t.querySelector(e)),n?wh(n.childNodes):[]}}const Ch={concat:function(...e){(0,q.default)("wp.blocks.children.concat",{since:"6.1",version:"6.3",alternative:"wp.richText.concat",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"});const t=[];for(let n=0;nfunction(e,t){switch(t){case"rich-text":return e instanceof $.RichTextData;case"string":return"string"==typeof e;case"boolean":return"boolean"==typeof e;case"object":return!!e&&e.constructor===Object;case"null":return null===e;case"array":return Array.isArray(e);case"integer":case"number":return"number"==typeof e}return!0}(e,t)))}(e,Array.isArray(t)?t:[t])}(i,t.type)&&function(e,t){return!Array.isArray(t)||t.includes(e)}(i,t.enum)||(i=void 0),void 0===i&&(i=Fc(t)),i}const Ah=(0,yh.A)((e=>{switch(e.source){case"attribute":{let t=function(e,t){var n,r;return 1===arguments.length?(n=e,r=void 0):(n=t,r=e),function(e){var t=vh(r,"attributes")(e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n].value}}(e.selector,e.attribute);return"boolean"===e.type&&(t=(e=>t=>void 0!==e(t))(t)),t}case"html":return function(e,t){return n=>{let r=n;if(e&&(r=n.querySelector(e)),!r)return"";if(t){let e="";const n=r.children.length;for(let o=0;on=>{const r=e?n.querySelector(e):n;return r?$.RichTextData.fromHTMLElement(r,{preserveWhiteSpace:t}):$.RichTextData.empty()})(e.selector,e.__unstablePreserveWhiteSpace);case"children":return kh(e.selector);case"node":return function(e){return(0,q.default)("wp.blocks.node.matcher",{since:"6.1",version:"6.3",alternative:"html source",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),t=>{let n=t;e&&(n=t.querySelector(e));try{return xh(n)}catch(e){return null}}}(e.selector);case"query":const t=Object.fromEntries(Object.entries(e.query).map((([e,t])=>[e,Ah(t)])));return function(e,t){return function(n){var r=n.querySelectorAll(e);return[].map.call(r,(function(e){return bh(e,t)}))}}(e.selector,t);case"tag":{const t=vh(e.selector,"nodeName");return e=>t(e)?.toLowerCase()}default:console.error(`Unknown source type "${e.source}"`)}}));function Eh(e){return bh(e,(e=>e))}function Ih(e,t){return Ah(t)(Eh(e))}function jh(e,t,n={}){var r;const o=Eh(t),i=Pc(e),s=Object.fromEntries(Object.entries(null!==(r=i.attributes)&&void 0!==r?r:{}).map((([e,r])=>[e,Sh(e,r,o,n,t)])));return(0,Tu.applyFilters)("blocks.getBlockAttributes",s,i,t,n)}const Th={type:"string",source:"attribute",selector:"[data-custom-class-name] > *",attribute:"class"};function Bh(e){const t=Ih(`
${e}
`,Th);return t?t.trim().split(/\s+/):[]}function Rh(e,t){const n=function(e,t,n){if(Ic(t,"customClassName",!0)){const{className:r,...o}=e,i=Pd(t,o),s=Bh(i),a=Bh(n).filter((e=>!s.includes(e)));a.length?e.className=a.join(" "):i&&delete e.className}return e}(e.attributes,t,e.originalContent);return{...e,attributes:n}}function Nh(){return!1}function Dh(e,t){const n=wc(),r=e.blockName||wc(),o=e.attrs||{},i=e.innerBlocks||[];let s=e.innerHTML.trim();return r!==n||"core/freeform"!==r||t?.__unstableSkipAutop||(s=function(e,t=!0){const n=[];if(""===e.trim())return"";if(-1!==(e+="\n").indexOf(""),r=t.pop();e="";for(let r=0;r";n.push([s,o.substr(i)+""]),e+=o.substr(0,i)+s}e+=r}const r="(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)";-1!==(e=function(e,t){const n=function(e){const t=[];let n,r=e;for(;n=r.match(Sd);){const e=n.index;t.push(r.slice(0,e)),t.push(n[0]),r=r.slice(e+n[0].length)}return r.length&&t.push(r),t}(e);let r=!1;const o=Object.keys(t);for(let e=1;e\s*/g,"\n\n")).replace(new RegExp("(<"+r+"[\\s/>])","g"),"\n\n$1")).replace(new RegExp("()","g"),"$1\n\n")).replace(/\r\n|\r/g,"\n"),{"\n":" \x3c!-- wpnl --\x3e "})).indexOf("\s*/g,"")),-1!==e.indexOf("")&&(e=(e=(e=e.replace(/(]*>)\s*/g,"$1")).replace(/\s*<\/object>/g,"")).replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/g,"$1")),-1===e.indexOf("\]]*[>\]])\s*/g,"$1")).replace(/\s*([<\[]\/(?:audio|video)[>\]])/g,"$1")).replace(/\s*(<(?:source|track)[^>]*>)\s*/g,"$1")),-1!==e.indexOf("]*>)/,"$1")).replace(/<\/figcaption>\s*/,""));const o=(e=e.replace(/\n\n+/g,"\n\n")).split(/\n\s*\n/).filter(Boolean);return e="",o.forEach((t=>{e+="

"+t.replace(/^\n*|\n*$/g,"")+"

\n"})),e=(e=(e=(e=(e=(e=(e=(e=e.replace(/

\s*<\/p>/g,"")).replace(/

([^<]+)<\/(div|address|form)>/g,"

$1

")).replace(new RegExp("

\\s*(]*>)\\s*

","g"),"$1")).replace(/

(/g,"$1")).replace(/

]*)>/gi,"

")).replace(/<\/blockquote><\/p>/g,"

")).replace(new RegExp("

\\s*(]*>)","g"),"$1")).replace(new RegExp("(]*>)\\s*

","g"),"$1"),t&&(e=e.replace(/<(script|style).*?<\/\\1>/g,(e=>e[0].replace(/\n/g,""))),e=(e=e.replace(/
|/g,"
")).replace(/(
)?\s*\n/g,((e,t)=>t?e:"
\n")),e=e.replace(//g,"\n")),e=(e=(e=e.replace(new RegExp("(]*>)\\s*
","g"),"$1")).replace(/
(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g,"$1")).replace(/\n<\/p>$/g,"

"),n.forEach((t=>{const[n,r]=t;e=e.replace(n,r)})),-1!==e.indexOf("\x3c!-- wpnl --\x3e")&&(e=e.replace(/\s?\s?/g,"\n")),e}(s).trim()),{...e,blockName:r,attrs:o,innerHTML:s,innerBlocks:i}}function Mh(e,t){let n=Dh(e,t);n=function(e){const[t,n]=mh(e.blockName,e.attrs);return{...e,blockName:t,attrs:n}}(n);let r=Sc(n.blockName);r||(n=function(e){const t=kc()||wc(),n=Id(e,{isCommentDelimited:!1}),r=Id(e,{isCommentDelimited:!0});return{blockName:t,attrs:{originalName:e.blockName,originalContent:r,originalUndelimitedContent:n},innerHTML:e.blockName?r:e.innerHTML,innerBlocks:e.innerBlocks,innerContent:e.innerContent}}(n),r=Sc(n.blockName));const o=n.blockName===wc()||n.blockName===kc();if(!r||!n.innerHTML&&o)return;const i=n.innerBlocks.map((e=>Mh(e,t))).filter((e=>!!e)),s=td(n.blockName,jh(r,n.innerHTML,n.attrs),i);s.originalContent=n.innerHTML;const a=function(e,t){const[n]=fh(e,t);if(n)return{...e,isValid:n,validationIssues:[]};const r=Rh(e,t),[o,i]=fh(e,t);return{...r,isValid:o,validationIssues:i}}(s,r),{validationIssues:l}=a,c=function(e,t,n){const r=t.attrs,{deprecated:o}=n;if(!o||!o.length)return e;for(let i=0;ie(...t))):(console.groupCollapsed("Updated Block: %s",r.name),console.info("Block successfully updated for `%s` (%o).\n\nNew content generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",r.name,r,Pd(r,c.attributes),c.originalContent),console.groupEnd()),c}function Ph(e,t){return _d(e).reduce(((e,n)=>{const r=Mh(n,t);return r&&e.push(r),e}),[])}var Oh=n(28636);function Lh(){return cd("from").filter((({type:e})=>"raw"===e)).map((e=>e.isMatch?e:{...e,isMatch:t=>e.selector&&t.matches(e.selector)}))}function Fh(e,t){const n=document.implementation.createHTMLDocument("");return n.body.innerHTML=e,Array.from(n.body.children).flatMap((e=>{const n=ld(Lh(),(({isMatch:t})=>t(e)));if(!n)return Oh.A.isNative?Ph(`\x3c!-- wp:html --\x3e${e.outerHTML}\x3c!-- /wp:html --\x3e`):td("core/html",jh("core/html",e.outerHTML));const{transform:r,blockName:o}=n;if(r){const n=r(e,t);return e.hasAttribute("class")&&(n.attributes.className=e.getAttribute("class")),n}return td(o,jh(o,e.outerHTML))}))}var zh=n(37271),Uh=n(8171);function Vh(e,t={}){const n=document.implementation.createHTMLDocument(""),r=document.implementation.createHTMLDocument(""),o=n.body,i=r.body;for(o.innerHTML=e;o.firstChild;){const e=o.firstChild;e.nodeType===e.TEXT_NODE?(0,zh.A)(e)?o.removeChild(e):(i.lastChild&&"P"===i.lastChild.nodeName||i.appendChild(r.createElement("P")),i.lastChild.appendChild(e)):e.nodeType===e.ELEMENT_NODE?"BR"===e.nodeName?(e.nextSibling&&"BR"===e.nextSibling.nodeName&&(i.appendChild(r.createElement("P")),o.removeChild(e.nextSibling)),i.lastChild&&"P"===i.lastChild.nodeName&&i.lastChild.hasChildNodes()?i.lastChild.appendChild(e):o.removeChild(e)):"P"===e.nodeName?(0,zh.A)(e)&&!t.raw?o.removeChild(e):i.appendChild(e):(0,Uh.S)(e)?(i.lastChild&&"P"===i.lastChild.nodeName||i.appendChild(r.createElement("P")),i.lastChild.appendChild(e)):i.appendChild(e):o.removeChild(e)}return i.innerHTML}var Hh=n(52042),$h=n(32664);function Wh(e,t){if(e.nodeType!==e.COMMENT_NODE)return;if("nextpage"!==e.nodeValue&&0!==e.nodeValue.indexOf("more"))return;const n=function(e,t){if("nextpage"===e.nodeValue)return function(e){const t=e.createElement("wp-block");return t.dataset.block="core/nextpage",t}(t);const n=e.nodeValue.slice(4).trim();let r=e,o=!1;for(;r=r.nextSibling;)if(r.nodeType===r.COMMENT_NODE&&"noteaser"===r.nodeValue){o=!0,(0,$h.A)(r);break}return function(e,t,n){const r=n.createElement("wp-block");return r.dataset.block="core/more",e&&(r.dataset.customText=e),t&&(r.dataset.noTeaser=""),r}(n,o,t)}(e,t);if(e.parentNode&&"P"===e.parentNode.nodeName){const r=Array.from(e.parentNode.childNodes),o=r.indexOf(e),i=e.parentNode.parentNode||t.body,s=(e,n)=>(e||(e=t.createElement("p")),e.appendChild(n),e);[r.slice(0,o).reduce(s,null),n,r.slice(o+1).reduce(s,null)].forEach((t=>t&&i.insertBefore(t,e.parentNode))),(0,$h.A)(e.parentNode)}else(0,Hh.A)(e,n)}var Gh=n(58475);function qh(e){return"OL"===e.nodeName||"UL"===e.nodeName}function Kh(e){if(!qh(e))return;const t=e,n=e.previousElementSibling;if(n&&n.nodeName===e.nodeName&&1===t.children.length){for(;t.firstChild;)n.appendChild(t.firstChild);t.parentNode.removeChild(t)}const r=e.parentNode;if(r&&"LI"===r.nodeName&&1===r.children.length&&!/\S/.test((o=r,Array.from(o.childNodes).map((({nodeValue:e=""})=>e)).join("")))){const e=r,n=e.previousElementSibling,o=e.parentNode;n?(n.appendChild(t),o.removeChild(e)):(o.parentNode.insertBefore(t,o),o.parentNode.removeChild(o))}var o;if(r&&qh(r)){const t=e.previousElementSibling;t?t.appendChild(e):(0,Gh.A)(e)}}function Yh(e){return t=>{"BLOCKQUOTE"===t.nodeName&&(t.innerHTML=Vh(t.innerHTML,e))}}function Jh(e,t=e){const n=e.ownerDocument.createElement("figure");t.parentNode.insertBefore(n,t),n.appendChild(e)}function Xh(e,t,n){if(!function(e,t){var n;const r=e.nodeName.toLowerCase();return"figcaption"!==r&&!(0,Uh.jw)(e)&&r in(null!==(n=t?.figure?.children)&&void 0!==n?n:{})}(e,n))return;let r=e;const o=e.parentNode;(function(e,t){var n;return e.nodeName.toLowerCase()in(null!==(n=t?.figure?.children?.a?.children)&&void 0!==n?n:{})})(e,n)&&"A"===o.nodeName&&1===o.childNodes.length&&(r=e.parentNode);const i=r.closest("p,div");i?e.classList?(e.classList.contains("alignright")||e.classList.contains("alignleft")||e.classList.contains("aligncenter")||!i.textContent.trim())&&Jh(r,i):Jh(r,i):"BODY"===r.parentNode.nodeName&&Jh(r)}function Zh(e,t,n=0){const r=Qh(e);r.lastIndex=n;const o=r.exec(t);if(!o)return;if("["===o[1]&&"]"===o[7])return Zh(e,t,r.lastIndex);const i={index:o.index,content:o[0],shortcode:tp(o)};return o[1]&&(i.content=i.content.slice(1),i.index++),o[7]&&(i.content=i.content.slice(0,-1)),i}function Qh(e){return new RegExp("\\[(\\[?)("+e+")(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)","g")}const ep=(0,yh.A)((e=>{const t={},n=[],r=/([\w-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w-]+)\s*=\s*'([^']*)'(?:\s|$)|([\w-]+)\s*=\s*([^\s'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|'([^']*)'(?:\s|$)|(\S+)(?:\s|$)/g;let o;for(e=e.replace(/[\u00a0\u200b]/g," ");o=r.exec(e);)o[1]?t[o[1].toLowerCase()]=o[2]:o[3]?t[o[3].toLowerCase()]=o[4]:o[5]?t[o[5].toLowerCase()]=o[6]:o[7]?n.push(o[7]):o[8]?n.push(o[8]):o[9]&&n.push(o[9]);return{named:t,numeric:n}}));function tp(e){let t;return t=e[4]?"self-closing":e[6]?"closed":"single",new np({tag:e[2],attrs:e[3],type:t,content:e[5]})}const np=Object.assign((function(e){const{tag:t,attrs:n,type:r,content:o}=e||{};if(Object.assign(this,{tag:t,type:r,content:o}),this.attrs={named:{},numeric:[]},!n)return;const i=["named","numeric"];"string"==typeof n?this.attrs=ep(n):n.length===i.length&&i.every(((e,t)=>e===n[t]))?this.attrs=n:Object.entries(n).forEach((([e,t])=>{this.set(e,t)}))}),{next:Zh,replace:function(e,t,n){return t.replace(Qh(e),(function(e,t,r,o,i,s,a,l){if("["===t&&"]"===l)return e;const c=n(tp(arguments));return c||""===c?t+c+l:e}))},string:function(e){return new np(e).string()},regexp:Qh,attrs:ep,fromMatch:tp});Object.assign(np.prototype,{get(e){return this.attrs["number"==typeof e?"numeric":"named"][e]},set(e,t){return this.attrs["number"==typeof e?"numeric":"named"][e]=t,this},string(){let e="["+this.tag;return this.attrs.numeric.forEach((t=>{/\s/.test(t)?e+=' "'+t+'"':e+=" "+t})),Object.entries(this.attrs.named).forEach((([t,n])=>{e+=" "+t+'="'+n+'"'})),"single"===this.type?e+"]":"self-closing"===this.type?e+" /]":(e+="]",this.content&&(e+=this.content),e+"[/"+this.tag+"]")}});const rp=e=>Array.isArray(e)?e:[e],op=/(\n|

)\s*$/,ip=/^\s*(\n|<\/p>)/,sp=function e(t,n=0,r=[]){const o=ld(cd("from"),(e=>-1===r.indexOf(e.blockName)&&"shortcode"===e.type&&rp(e.tag).some((e=>Qh(e).test(t)))));if(!o)return[t];const i=rp(o.tag).find((e=>Qh(e).test(t)));let s;const a=n;if(s=Zh(i,t,n)){n=s.index+s.content.length;const i=t.substr(0,s.index),l=t.substr(n);if(!(s.shortcode.content?.includes("<")||op.test(i)&&ip.test(l)))return e(t,n);if(o.isMatch&&!o.isMatch(s.shortcode.attrs))return e(t,a,[...r,o.blockName]);let c=[];if("function"==typeof o.transform)c=[].concat(o.transform(s.shortcode.attrs,s)),c=c.map((e=>(e.originalContent=s.shortcode.content,Rh(e,Sc(e.name)))));else{const e=Object.fromEntries(Object.entries(o.attributes).filter((([,e])=>e.shortcode)).map((([e,t])=>[e,t.shortcode(s.shortcode.attrs,s)]))),n=Sc(o.blockName);if(!n)return[t];const r={...n,attributes:o.attributes};let i=td(o.blockName,jh(r,s.shortcode.content,e));i.originalContent=s.shortcode.content,i=Rh(i,r),c=[i]}return[...e(i.replace(op,"")),...c,...e(l.replace(ip,""))]}return[t]};function ap(e){return function(e,t){const n={phrasingContentSchema:(0,Uh.dA)(t),isPaste:"paste"===t},r=e.map((({isMatch:e,blockName:t,schema:r})=>{const o=Ic(t,"anchor");return r="function"==typeof r?r(n):r,o||e?r?Object.fromEntries(Object.entries(r).map((([t,n])=>{let r=n.attributes||[];return o&&(r=[...r,"id"]),[t,{...n,attributes:r,isMatch:e||void 0}]}))):{}:r}));function o(e,t,n){switch(n){case"children":return"*"===e||"*"===t?"*":{...e,...t};case"attributes":case"require":return[...e||[],...t||[]];case"isMatch":if(!e||!t)return;return(...n)=>e(...n)||t(...n)}}function i(e,t){for(const n in t)e[n]=e[n]?o(e[n],t[n],n):{...t[n]};return e}return r.reduce((function(e,t){for(const n in t)e[n]=e[n]?i(e[n],t[n]):{...t[n]};return e}),{})}(Lh(),e)}function lp(e,t,n,r){Array.from(e).forEach((e=>{lp(e.childNodes,t,n,r),t.forEach((t=>{n.contains(e)&&t(e,n,r)}))}))}function cp(e,t=[],n){const r=document.implementation.createHTMLDocument("");return r.body.innerHTML=e,lp(r.body.childNodes,t,r,n),r.body.innerHTML}function up(e,t){const n=e[`${t}Sibling`];if(n&&(0,Uh.S)(n))return n;const{parentNode:r}=e;return r&&(0,Uh.S)(r)?up(r,t):void 0}function dp({HTML:e=""}){if(-1!==e.indexOf("\x3c!-- wp:"))return Ph(e);const t=sp(e),n=ap();return t.map((e=>"string"!=typeof e?e:Fh(e=Vh(e=cp(e,[Kh,Wh,Xh,Yh({raw:!0})],n),{raw:!0}),dp))).flat().filter(Boolean)}var hp=n(75450);function pp(e){e.nodeType===e.COMMENT_NODE&&(0,$h.A)(e)}function fp(e,t){return e.every((e=>function(e,t){if((0,Uh.jw)(e))return!0;if(!t)return!1;const n=e.nodeName.toLowerCase();return[["ul","li","ol"],["h1","h2","h3","h4","h5","h6"]].some((e=>0===[n,t].filter((t=>!e.includes(t))).length))}(e,t)&&fp(Array.from(e.children),t)))}function mp(e){return"BR"===e.nodeName&&e.previousSibling&&"BR"===e.previousSibling.nodeName}var gp=n(22676),bp=n(62891);function vp(e,t){if("SPAN"===e.nodeName&&e.style){const{fontWeight:n,fontStyle:r,textDecorationLine:o,textDecoration:i,verticalAlign:s}=e.style;"bold"!==n&&"700"!==n||(0,gp.A)(t.createElement("strong"),e),"italic"===r&&(0,gp.A)(t.createElement("em"),e),("line-through"===o||i.includes("line-through"))&&(0,gp.A)(t.createElement("s"),e),"super"===s?(0,gp.A)(t.createElement("sup"),e):"sub"===s&&(0,gp.A)(t.createElement("sub"),e)}else"B"===e.nodeName?e=(0,bp.A)(e,"strong"):"I"===e.nodeName?e=(0,bp.A)(e,"em"):"A"===e.nodeName&&(e.target&&"_blank"===e.target.toLowerCase()?e.rel="noreferrer noopener":(e.removeAttribute("target"),e.removeAttribute("rel")),e.name&&!e.id&&(e.id=e.name),e.id&&!e.ownerDocument.querySelector(`[href="#${e.id}"]`)&&e.removeAttribute("id"))}function yp(e){"SCRIPT"!==e.nodeName&&"NOSCRIPT"!==e.nodeName&&"TEMPLATE"!==e.nodeName&&"STYLE"!==e.nodeName||e.parentNode.removeChild(e)}function _p(e){if(e.nodeType!==e.ELEMENT_NODE)return;const t=e.getAttribute("style");if(!t||!t.includes("mso-list"))return;const n=t.split(";").reduce(((e,t)=>{const[n,r]=t.split(":");return n&&r&&(e[n.trim().toLowerCase()]=r.trim().toLowerCase()),e}),{});"ignore"===n["mso-list"]&&e.remove()}function xp(e){return"OL"===e.nodeName||"UL"===e.nodeName}function wp(e,t){if("P"!==e.nodeName)return;const n=e.getAttribute("style");if(!n||!n.includes("mso-list"))return;const r=e.previousElementSibling;if(!r||!xp(r)){const n=e.textContent.trim().slice(0,1),r=/[1iIaA]/.test(n),o=t.createElement(r?"ol":"ul");r&&o.setAttribute("type",n),e.parentNode.insertBefore(o,e)}const o=e.previousElementSibling,i=o.nodeName,s=t.createElement("li");let a=o;s.innerHTML=cp(e.innerHTML,[_p]);const l=/mso-list\s*:[^;]+level([0-9]+)/i.exec(n);let c=l&&parseInt(l[1],10)-1||0;for(;c--;)a=a.lastChild||a,xp(a)&&(a=a.lastChild||a);xp(a)||(a=a.appendChild(t.createElement(i))),a.appendChild(s),e.parentNode.removeChild(e)}function kp(e){if("IMG"===e.nodeName){if(0===e.src.indexOf("file:")&&(e.src=""),0===e.src.indexOf("data:")){const[t,n]=e.src.split(","),[r]=t.slice(5).split(";");if(!n||!r)return void(e.src="");let o;try{o=atob(n)}catch(t){return void(e.src="")}const i=new Uint8Array(o.length);for(let e=0;ewindow?.console?.log?.(...e);function Dp(e){return e=cp(e,[yp,Ip,_p,vp,pp]),e=cp(e=(0,hp.A)(e,(0,Uh.dA)("paste"),{inline:!0}),[jp,Tp]),Np("Processed inline HTML:\n\n",e),e}function Mp({HTML:e="",plainText:t="",mode:n="AUTO",tagName:r}){if(e=(e=(e=e.replace(/]+>/g,"")).replace(/^\s*]*>\s*]*>(?:\s*)?/i,"")).replace(/(?:\s*)?<\/body>\s*<\/html>\s*$/i,""),"INLINE"!==n){const n=e||t;if(-1!==n.indexOf("\x3c!-- wp:"))return Ph(n)}String.prototype.normalize&&(e=e.normalize()),e=cp(e,[Rp]);const o=t&&(!e||function(e){return!/<(?!br[ />])/i.test(e)}(e));var i;o&&(e=t,/^\s+$/.test(t)||(i=e,e=Ap.makeHtml(function(e){return e.replace(/((?:^|\n)```)([^\n`]+)(```(?:$|\n))/,((e,t,n,r)=>`${t}\n${n}\n${r}`))}(function(e){return e.replace(/(^|\n)•( +)/g,"$1*$2")}(i)))));const s=sp(e),a=s.length>1;if(o&&!a&&"AUTO"===n&&-1===t.indexOf("\n")&&0!==t.indexOf("

")&&0===e.indexOf("

")&&(n="INLINE"),"INLINE"===n)return Dp(e);if("AUTO"===n&&!a&&function(e,t){const n=document.implementation.createHTMLDocument("");n.body.innerHTML=e;const r=Array.from(n.body.children);return!r.some(mp)&&fp(r,t)}(e,r))return Dp(e);const l=(0,Uh.dA)("paste"),c=ap("paste"),u=s.map((e=>{if("string"!=typeof e)return e;const t=[Ip,wp,yp,Kh,kp,vp,Wh,pp,Ep,Xh,Yh(),Cp],n={...c,...l};return e=cp(e,t,c),e=cp(e=Vh(e=(0,hp.A)(e,n)),[jp,Tp,Bp],c),Np("Processed HTML piece:\n\n",e),Fh(e,Mp)})).flat().filter(Boolean);if("AUTO"===n&&1===u.length&&Ic(u[0].name,"__unstablePasteTextInline",!1)){const e=/^[\n]+|[\n]+$/g,n=t.replace(e,"");if(""!==n&&-1===n.indexOf("\n"))return(0,hp.A)(Od(u[0]),l).replace(e,"")}return u}function Pp(e=[],t=[]){return e.length===t.length&&t.every((([t,,n],r)=>{const o=e[r];return t===o.name&&Pp(o.innerBlocks,n)}))}const Op=e=>"html"===e?.source,Lp=e=>"query"===e?.source;function Fp(e,t){return t?Object.fromEntries(Object.entries(t).map((([t,n])=>[t,zp(e[t],n)]))):{}}function zp(e,t){return Op(e)&&Array.isArray(t)?(0,Ed.Ay)(t):Lp(e)&&t?t.map((t=>Fp(e.query,t))):t}function Up(e=[],t){return t?t.map((([t,n,r],o)=>{var i;const s=e[o];if(s&&s.name===t){const e=Up(s.innerBlocks,r);return{...s,innerBlocks:e}}const a=Sc(t),l=Fp(null!==(i=a?.attributes)&&void 0!==i?i:{},n);let[c,u]=mh(t,l);return void 0===Sc(c)&&(u={originalName:t,originalContent:"",originalUndelimitedContent:""},c="core/missing"),td(c,u,Up([],r))})):e}var Vp=n(90637),Hp=n(26655);const $p=Symbol("mayDisplayControls"),Wp=Symbol("mayDisplayParentControls"),Gp=Symbol("blockEditingMode"),qp=Symbol("blockBindings"),Kp=Symbol("isPreviewMode"),Yp={name:"",isSelected:!1},Jp=(0,k.createContext)(Yp),{Provider:Xp}=Jp;function Zp(){return(0,k.useContext)(Jp)}var Qp=n(10404);const ef={insertUsage:{}},tf={alignWide:!1,supportsLayout:!0,colors:[{name:(0,H.__)("Black"),slug:"black",color:"#000000"},{name:(0,H.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,H.__)("White"),slug:"white",color:"#ffffff"},{name:(0,H.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,H.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,H.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,H.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,H.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,H.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,H.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,H.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,H.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,H._x)("Small","font size name"),size:13,slug:"small"},{name:(0,H._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,H._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,H._x)("Large","font size name"),size:36,slug:"large"},{name:(0,H._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,H.__)("Thumbnail")},{slug:"medium",name:(0,H.__)("Medium")},{slug:"large",name:(0,H.__)("Large")},{slug:"full",name:(0,H.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,enableOpenverseMediaCategory:!0,clearBlockSelection:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__unstableGalleryWithImageBlocks:!1,__unstableIsPreviewMode:!1,blockInspectorAnimation:{animationParent:"core/navigation","core/navigation":{enterDirection:"leftToRight"},"core/navigation-submenu":{enterDirection:"rightToLeft"},"core/navigation-link":{enterDirection:"rightToLeft"},"core/search":{enterDirection:"rightToLeft"},"core/social-links":{enterDirection:"rightToLeft"},"core/page-list":{enterDirection:"rightToLeft"},"core/spacer":{enterDirection:"rightToLeft"},"core/home-link":{enterDirection:"rightToLeft"},"core/site-title":{enterDirection:"rightToLeft"},"core/site-logo":{enterDirection:"rightToLeft"}},generateAnchors:!1,gradients:[{name:(0,H.__)("Vivid cyan blue to vivid purple"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:(0,H.__)("Light green cyan to vivid green cyan"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:(0,H.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,H.__)("Luminous vivid orange to vivid red"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:(0,H.__)("Very light gray to cyan bluish gray"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:(0,H.__)("Cool to warm spectrum"),gradient:"linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",slug:"cool-to-warm-spectrum"},{name:(0,H.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,H.__)("Blush bordeaux"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:(0,H.__)("Luminous dusk"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:(0,H.__)("Pale ocean"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:(0,H.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,H.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function nf(e,t,n){return[...e.slice(0,n),...Array.isArray(t)?t:[t],...e.slice(n)]}function rf(e,t,n,r=1){const o=[...e];return o.splice(t,r),nf(o,e.slice(t,t+r),n)}const of=e=>e;function sf(e,t=""){const n=new Map,r=[];return n.set(t,r),e.forEach((e=>{const{clientId:t,innerBlocks:o}=e;r.push(t),sf(o,t).forEach(((e,t)=>{n.set(t,e)}))})),n}function af(e,t=""){const n=[],r=[[t,e]];for(;r.length;){const[e,t]=r.shift();t.forEach((({innerBlocks:t,...o})=>{n.push([o.clientId,e]),t?.length&&r.push([o.clientId,t])}))}return n}function lf(e,t=of){const n=[],r=[...e];for(;r.length;){const{innerBlocks:e,...o}=r.shift();r.push(...e),n.push([o.clientId,t(o)])}return n}function cf(e){return lf(e,(e=>{const{attributes:t,...n}=e;return n}))}function uf(e){return lf(e,(e=>e.attributes))}function df(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&N()(e.clientIds,t.clientIds)&&function(e,t){return N()(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function hf(e,t){const n=e.tree,r=[...t],o=[...t];for(;r.length;){const e=r.shift();r.push(...e.innerBlocks),o.push(...e.innerBlocks)}for(const e of o)n.set(e.clientId,{});for(const t of o)n.set(t.clientId,Object.assign(n.get(t.clientId),{...e.byClientId.get(t.clientId),attributes:e.attributes.get(t.clientId),innerBlocks:t.innerBlocks.map((e=>n.get(e.clientId)))}))}function pf(e,t,n=!1){const r=e.tree,o=new Set([]),i=new Set;for(const r of t){let t=n?r:e.parents.get(r);do{if(e.controlledInnerBlocks[t]){i.add(t);break}o.add(t),t=e.parents.get(t)}while(void 0!==t)}for(const e of o)r.set(e,{...r.get(e)});for(const t of o)r.get(t).innerBlocks=(e.order.get(t)||[]).map((e=>r.get(e)));for(const t of i)r.set("controlled||"+t,{innerBlocks:(e.order.get(t)||[]).map((e=>r.get(e)))})}const ff=(0,Qp.h)(B.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:r}=n;if(e===r)return t;(t={...t}).attributes=new Map(t.attributes),t.attributes.forEach(((n,o)=>{const{name:i}=t.byClientId.get(o);"core/block"===i&&n.ref===e&&t.attributes.set(o,{...n,ref:r})}))}return e(t,n)}),(e=>(t={},n)=>{const r=e(t,n);if(r===t)return t;switch(r.tree=t.tree?t.tree:new Map,n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":r.tree=new Map(r.tree),hf(r,n.blocks),pf(r,n.rootClientId?[n.rootClientId]:[""],!0);break;case"UPDATE_BLOCK":r.tree=new Map(r.tree),r.tree.set(n.clientId,{...r.tree.get(n.clientId),...r.byClientId.get(n.clientId),attributes:r.attributes.get(n.clientId)}),pf(r,[n.clientId],!1);break;case"SYNC_DERIVED_BLOCK_ATTRIBUTES":case"UPDATE_BLOCK_ATTRIBUTES":r.tree=new Map(r.tree),n.clientIds.forEach((e=>{r.tree.set(e,{...r.tree.get(e),attributes:r.attributes.get(e)})})),pf(r,n.clientIds,!1);break;case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=function(e){const t={},n=[...e];for(;n.length;){const{innerBlocks:e,...r}=n.shift();n.push(...e),t[r.clientId]=!0}return t}(n.blocks);r.tree=new Map(r.tree),n.replacedClientIds.forEach((t=>{r.tree.delete(t),e[t]||r.tree.delete("controlled||"+t)})),hf(r,n.blocks),pf(r,n.blocks.map((e=>e.clientId)),!1);const o=[];for(const e of n.clientIds){const n=t.parents.get(e);void 0===n||""!==n&&!r.byClientId.get(n)||o.push(n)}pf(r,o,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const o of n.clientIds){const n=t.parents.get(o);void 0===n||""!==n&&!r.byClientId.get(n)||e.push(n)}r.tree=new Map(r.tree),n.removedClientIds.forEach((e=>{r.tree.delete(e),r.tree.delete("controlled||"+e)})),pf(r,e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId?e.push(n.fromRootClientId):e.push(""),n.toRootClientId&&e.push(n.toRootClientId),r.tree=new Map(r.tree),pf(r,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];r.tree=new Map(r.tree),pf(r,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=[];r.attributes.forEach(((t,o)=>{"core/block"===r.byClientId.get(o).name&&t.ref===n.updatedId&&e.push(o)})),r.tree=new Map(r.tree),e.forEach((e=>{r.tree.set(e,{...r.byClientId.get(e),attributes:r.attributes.get(e),innerBlocks:r.tree.get(e).innerBlocks})})),pf(r,e,!1)}}return r}),(e=>(t,n)=>{const r=e=>{let r=e;for(let o=0;o(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const r={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...o}=e.shift();e.push(...n),t.controlledInnerBlocks[o.clientId]&&(r[o.clientId]=!0)}}let o=t;t.order.get(n.rootClientId)&&(o=e(o,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:r,clientIds:t.order.get(n.rootClientId)}));let i=o;if(n.blocks.length){i=e(i,{...n,type:"INSERT_BLOCKS",index:0});const o=new Map(i.order);Object.keys(r).forEach((e=>{t.order.get(e)&&o.set(e,t.order.get(e))})),i.order=o,i.tree=new Map(i.tree),Object.keys(r).forEach((e=>{const n=`controlled||${e}`;t.tree.has(n)&&i.tree.set(n,t.tree.get(n))}))}return i}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:new Map(cf(n.blocks)),attributes:new Map(uf(n.blocks)),order:sf(n.blocks),parents:new Map(af(n.blocks)),controlledInnerBlocks:{}};return e.tree=new Map(t?.tree),hf(e,n.blocks),e.tree.set("",{innerBlocks:n.blocks.map((t=>e.tree.get(t.clientId)))}),e}return e(t,n)}),(function(e){let t,n,r=!1;return(o,i)=>{let s,a=e(o,i);var l;if("SET_EXPLICIT_PERSISTENT"===i.type&&(n=i.isPersistentChange,s=null===(l=o.isPersistentChange)||void 0===l||l),void 0!==n)return s=n,s===a.isPersistentChange?a:{...a,isPersistentChange:s};const c="MARK_LAST_CHANGE_AS_PERSISTENT"===i.type||r;var u;return o!==a||c?(a={...a,isPersistentChange:c?!r:!df(i,t)},t=i,r="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===i.type,a):(r="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===i.type,s=null===(u=o?.isPersistentChange)||void 0===u||u,o.isPersistentChange===s?o:{...a,isPersistentChange:s})}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,r)=>{const o=e(n,r);return o!==n&&(o.isIgnoredChange=t.has(r.type)),o}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const r=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(r,n)}return e(t,n)}))({byClientId(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return cf(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"UPDATE_BLOCK":{if(!e.has(t.clientId))return e;const{attributes:n,...r}=t.updates;if(0===Object.values(r).length)return e;const o=new Map(e);return o.set(t.clientId,{...e.get(t.clientId),...r}),o}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),cf(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},attributes(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return uf(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"UPDATE_BLOCK":{if(!e.get(t.clientId)||!t.updates.attributes)return e;const n=new Map(e);return n.set(t.clientId,{...e.get(t.clientId),...t.updates.attributes}),n}case"SYNC_DERIVED_BLOCK_ATTRIBUTES":case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e.get(t))))return e;let r=!1;const o=new Map(e);for(const i of t.clientIds){var n;const s=Object.entries(t.uniqueByBlock?t.attributes[i]:null!==(n=t.attributes)&&void 0!==n?n:{});if(0===s.length)continue;let a=!1;const l=e.get(i),c={};s.forEach((([e,t])=>{l[e]!==t&&(a=!0,c[e]=t)})),r=r||a,a&&o.set(i,{...l,...c})}return r?o:e}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),uf(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},order(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{var n;const r=sf(t.blocks),o=new Map(e);return r.forEach(((e,t)=>{""!==t&&o.set(t,e)})),o.set("",(null!==(n=e.get(""))&&void 0!==n?n:[]).concat(r[""])),o}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,r=e.get(n)||[],o=sf(t.blocks,n),{index:i=r.length}=t,s=new Map(e);return o.forEach(((e,t)=>{s.set(t,e)})),s.set(n,nf(r,o.get(n),i)),s}case"MOVE_BLOCKS_TO_POSITION":{var r;const{fromRootClientId:n="",toRootClientId:o="",clientIds:i}=t,{index:s=e.get(o).length}=t;if(n===o){const t=e.get(o).indexOf(i[0]),n=new Map(e);return n.set(o,rf(e.get(o),t,s,i.length)),n}const a=new Map(e);return a.set(n,null!==(r=e.get(n)?.filter((e=>!i.includes(e))))&&void 0!==r?r:[]),a.set(o,nf(e.get(o),i,s)),a}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:r=""}=t,o=n[0],i=e.get(r);if(!i.length||o===i[0])return e;const s=i.indexOf(o),a=new Map(e);return a.set(r,rf(i,s,s-1,n.length)),a}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:r=""}=t,o=n[0],i=n[n.length-1],s=e.get(r);if(!s.length||i===s[s.length-1])return e;const a=s.indexOf(o),l=new Map(e);return l.set(r,rf(s,a,a+1,n.length)),l}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const r=sf(t.blocks),o=new Map(e);return t.replacedClientIds.forEach((e=>{o.delete(e)})),r.forEach(((e,t)=>{""!==t&&o.set(t,e)})),o.forEach(((e,t)=>{const i=Object.values(e).reduce(((e,t)=>t===n[0]?[...e,...r.get("")]:(-1===n.indexOf(t)&&e.push(t),e)),[]);o.set(t,i)})),o}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n.forEach(((e,r)=>{var o;const i=null!==(o=e?.filter((e=>!t.removedClientIds.includes(e))))&&void 0!==o?o:[];i.length!==e.length&&n.set(r,i)})),n}}return e},parents(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{const n=new Map(e);return af(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"INSERT_BLOCKS":{const n=new Map(e);return af(t.blocks,t.rootClientId||"").forEach((([e,t])=>{n.set(e,t)})),n}case"MOVE_BLOCKS_TO_POSITION":{const n=new Map(e);return t.clientIds.forEach((e=>{n.set(e,t.toRootClientId||"")})),n}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),af(t.blocks,e.get(t.clientIds[0])).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},controlledInnerBlocks:(e={},{type:t,clientId:n,hasControlledInnerBlocks:r})=>"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:r}:e});function mf(e={},t){switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}const gf=(0,B.combineReducers)({blocks:ff,isDragging:function(e=!1,t){switch(t.type){case"START_DRAGGING":return!0;case"STOP_DRAGGING":return!1}return e},isTyping:function(e=!1,t){switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},isBlockInterfaceHidden:function(e=!1,t){switch(t.type){case"HIDE_BLOCK_INTERFACE":return!0;case"SHOW_BLOCK_INTERFACE":return!1}return e},draggedBlocks:function(e=[],t){switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},selection:function(e={},t){switch(t.type){case"SELECTION_CHANGE":return t.clientId?{selectionStart:{clientId:t.clientId,attributeKey:t.attributeKey,offset:t.startOffset},selectionEnd:{clientId:t.clientId,attributeKey:t.attributeKey,offset:t.endOffset}}:{selectionStart:t.start||e.selectionStart,selectionEnd:t.end||e.selectionEnd};case"RESET_SELECTION":const{selectionStart:n,selectionEnd:r}=t;return{selectionStart:n,selectionEnd:r};case"MULTI_SELECT":const{start:o,end:i}=t;return o===e.selectionStart?.clientId&&i===e.selectionEnd?.clientId?e:{selectionStart:{clientId:o},selectionEnd:{clientId:i}};case"RESET_BLOCKS":const s=e?.selectionStart?.clientId,a=e?.selectionEnd?.clientId;if(!s&&!a)return e;if(!t.blocks.some((e=>e.clientId===s)))return{selectionStart:{},selectionEnd:{}};if(!t.blocks.some((e=>e.clientId===a)))return{...e,selectionEnd:e.selectionStart}}const n=mf(e.selectionStart,t),r=mf(e.selectionEnd,t);return n===e.selectionStart&&r===e.selectionEnd?e:{selectionStart:n,selectionEnd:r}},isMultiSelecting:function(e=!1,t){switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(e=!0,t){return"TOGGLE_SELECTION"===t.type?t.isSelectionEnabled:e},initialPosition:function(e=null,t){return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(e={},t){if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:(e={},t)=>{switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return Object.fromEntries(Object.entries(e).filter((([e])=>!t.clientIds.includes(e))));case"UPDATE_BLOCK_LIST_SETTINGS":{const n="string"==typeof t.clientId?{[t.clientId]:t.settings}:t.clientId;for(const t in n)n[t]?N()(e[t],n[t])&&delete n[t]:e[t]||delete n[t];if(0===Object.keys(n).length)return e;const r={...e,...n};for(const e in n)n[e]||delete r[e];return r}}return e},insertionPoint:function(e=null,t){switch(t.type){case"SHOW_INSERTION_POINT":{const{rootClientId:n,index:r,__unstableWithInserter:o,operation:i,nearestSide:s}=t,a={rootClientId:n,index:r,__unstableWithInserter:o,operation:i,nearestSide:s};return N()(e,a)?e:a}case"HIDE_INSERTION_POINT":return null}return e},template:function(e={isValid:!0},t){return"SET_TEMPLATE_VALIDITY"===t.type?{...e,isValid:t.isValid}:e},settings:function(e=tf,t){return"UPDATE_SETTINGS"===t.type?t.reset?{...tf,...t.settings}:{...e,...t.settings}:e},preferences:function(e=ef,t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":{const n=t.blocks.reduce(((e,n)=>{const{attributes:r,name:o}=n;let i=o;const s=(0,pc.L)(ed).getActiveBlockVariation(o,r);return s?.name&&(i+="/"+s.name),"core/block"===o&&(i+="/"+r.ref),{...e,[i]:{time:t.time,count:e[i]?e[i].count+1:1}}}),e.insertUsage);return{...e,insertUsage:n}}}return e},lastBlockAttributesChange:function(e=null,t){switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return e},lastFocus:function(e=!1,t){return"LAST_FOCUS"===t.type?t.lastFocus:e},editorMode:function(e="edit",t){return"INSERT_BLOCKS"===t.type&&"navigation"===e?"edit":"SET_EDITOR_MODE"===t.type?t.mode:e},hasBlockMovingClientId:function(e=null,t){return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_EDITOR_MODE"===t.type?null:e},expandedBlock:function(e=null,t){switch(t.type){case"SET_BLOCK_EXPANDED_IN_LIST_VIEW":return t.clientId;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:r}=t;return r?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(e={},t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":if(!t.blocks.length)return e;const n=t.blocks.map((e=>e.clientId)),r=t.meta?.source;return{clientIds:n,source:r};case"RESET_BLOCKS":return{}}return e},temporarilyEditingAsBlocks:function(e="",t){return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.temporarilyEditingAsBlocks:e},temporarilyEditingFocusModeRevert:function(e="",t){return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.focusModeToRevert:e},blockVisibility:function(e={},t){return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e},blockEditingModes:function(e=new Map,t){switch(t.type){case"SET_BLOCK_EDITING_MODE":return new Map(e).set(t.clientId,t.mode);case"UNSET_BLOCK_EDITING_MODE":{const n=new Map(e);return n.delete(t.clientId),n}case"RESET_BLOCKS":return e.has("")?(new Map).set("",e.get("")):e}return e},styleOverrides:function(e=new Map,t){switch(t.type){case"SET_STYLE_OVERRIDE":return new Map(e).set(t.id,t.style);case"DELETE_STYLE_OVERRIDE":{const n=new Map(e);return n.delete(t.id),n}}return e},removalPromptData:function(e=!1,t){switch(t.type){case"DISPLAY_BLOCK_REMOVAL_PROMPT":const{clientIds:e,selectPrevious:n,message:r}=t;return{clientIds:e,selectPrevious:n,message:r};case"CLEAR_BLOCK_REMOVAL_PROMPT":return!1}return e},blockRemovalRules:function(e=!1,t){return"SET_BLOCK_REMOVAL_RULES"===t.type?t.rules:e},openedBlockSettingsMenu:function(e=null,t){var n;return"SET_OPENED_BLOCK_SETTINGS_MENU"===t.type?null!==(n=t?.clientId)&&void 0!==n?n:null:e},registeredInserterMediaCategories:function(e=[],t){return"REGISTER_INSERTER_MEDIA_CATEGORY"===t.type?[...e,t.category]:e}}),bf=function(e){return(t,n)=>{const r=e(t,n);return t?(r.automaticChangeStatus=t.automaticChangeStatus,"MARK_AUTOMATIC_CHANGE"===n.type?{...r,automaticChangeStatus:"pending"}:"MARK_AUTOMATIC_CHANGE_FINAL"===n.type&&"pending"===t.automaticChangeStatus?{...r,automaticChangeStatus:"final"}:r.blocks===t.blocks&&r.selection===t.selection||"final"!==r.automaticChangeStatus&&r.selection!==t.selection?r:{...r,automaticChangeStatus:void 0}):r}}(gf);var vf=n(28510);const yf=Symbol("globalStylesDataKey"),_f=Symbol("selectBlockPatternsKey"),xf=Symbol("reusableBlocksSelect"),{lock:wf,unlock:kf}=(0,Nl.yf)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/block-editor"),Cf="core/block-editor",Sf=Symbol("withRootClientId"),Af=(e,t,n=null)=>"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n,Ef=(e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){const e=n.shift();if(!Af(t,e.name||e.blockName,!0))return!1;e.innerBlocks?.forEach((e=>{n.push(e)}))}return!0},If=e=>t=>[t.settings.__experimentalBlockPatterns,t.settings.__experimentalUserPatternCategories,t.settings.__experimentalReusableBlocks,t.settings[_f]?.(e),t.blockPatterns,kf(e(Cf)).getReusableBlocks()];function jf(e,t){return[e.blockListSettings[t],e.blocks.byClientId.get(t),e.settings.allowedBlockTypes,e.settings.templateLock,e.blockEditingModes]}const Tf=(e,t,n)=>(r,o)=>{let i,s;if("function"==typeof e?(i=e(r),s=e(o)):(i=r[e],s=o[e]),i>s)return"asc"===n?1:-1;if(s>i)return"asc"===n?-1:1;const a=t.findIndex((e=>e===r)),l=t.findIndex((e=>e===o));return a>l?1:l>a?-1:0};function Bf(e,t,n="asc"){return e.concat().sort(Tf(t,e,n))}const Rf={user:"user",theme:"theme",directory:"directory"},Nf={full:"fully",unsynced:"unsynced"},Df={name:"allPatterns",label:(0,H._x)("All","patterns")},Mf={name:"myPatterns",label:(0,H.__)("My patterns")};function Pf(e,t,n){const r=e.name.startsWith("core/block"),o="core"===e.source||e.source?.startsWith("pattern-directory");return!(t!==Rf.theme||!r&&!o)||!(t!==Rf.directory||!r&&o)||t===Rf.user&&e.type!==Rf.user||n===Nf.full&&""!==e.syncStatus||!(n!==Nf.unsynced||"unsynced"===e.syncStatus||!r)}function Of(e,t,n){t=Array.isArray(t)?[...t]:[t],e=Array.isArray(e)?[...e]:{...e};const r=t.pop();let o=e;for(const e of t){const t=o[e];o=o[e]=Array.isArray(t)?[...t]:{...t}}return o[r]=n,e}const Lf=(e,t,n)=>{var r;const o=Array.isArray(t)?t:t.split(".");let i=e;return o.forEach((e=>{i=i?.[e]})),null!==(r=i)&&void 0!==r?r:n},Ff=["color","border","dimensions","typography","spacing"],zf={"color.palette":e=>e.colors,"color.gradients":e=>e.gradients,"color.custom":e=>void 0===e.disableCustomColors?void 0:!e.disableCustomColors,"color.customGradient":e=>void 0===e.disableCustomGradients?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>e.fontSizes,"typography.customFontSize":e=>void 0===e.disableCustomFontSizes?void 0:!e.disableCustomFontSizes,"typography.lineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(void 0!==e.enableCustomUnits)return!0===e.enableCustomUnits?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.padding":e=>e.enableCustomSpacing},Uf={"border.customColor":"border.color","border.customStyle":"border.style","border.customWidth":"border.width","typography.customFontStyle":"typography.fontStyle","typography.customFontWeight":"typography.fontWeight","typography.customLetterSpacing":"typography.letterSpacing","typography.customTextDecorations":"typography.textDecoration","typography.customTextTransforms":"typography.textTransform","border.customRadius":"border.radius","spacing.customMargin":"spacing.margin","spacing.customPadding":"spacing.padding","typography.customLineHeight":"typography.lineHeight"},Vf=e=>Uf[e]||e;function Hf(e,t,...n){const r=bm(e,t),o=[];if(t){let n=t;do{Ic(bm(e,n),"__experimentalSettings",!1)&&o.push(n)}while(n=e.blocks.parents.get(n))}return n.map((n=>{if(Ff.includes(n))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let i=(0,Tu.applyFilters)("blockEditor.useSetting.before",void 0,n,t,r);if(void 0!==i)return i;const s=Vf(n);for(const t of o){var a;const n=ym(e,t);if(i=null!==(a=Lf(n.settings?.blocks?.[r],s))&&void 0!==a?a:Lf(n.settings,s),void 0!==i)break}const l=ib(e);var c,u;if(void 0===i&&r&&(i=Lf(l.__experimentalFeatures?.blocks?.[r],s)),void 0===i&&(i=Lf(l.__experimentalFeatures,s)),void 0!==i)return hc[s]?null!==(c=null!==(u=i.custom)&&void 0!==u?u:i.theme)&&void 0!==c?c:i.default:i;const d=zf[s]?.(l);return void 0!==d?d:"typography.dropCap"===s||void 0}))}function $f(e){return e.isBlockInterfaceHidden}function Wf(e){return e?.lastBlockInserted?.clientIds}function Gf(e,t){return e.blocks.byClientId.get(t)}const qf=(e,t)=>{const n=t=>"disabled"===kb(e,t)&&dg(e,t).every(n);return dg(e,t).every(n)},Kf=(0,Ws.A)((function e(t,n){const r=dg(t,n),o=[];for(const n of r){const r=e(t,n);"disabled"!==kb(t,n)?o.push({clientId:n,innerBlocks:r}):o.push(...r)}return o}),(e=>[e.blocks.order,e.blockEditingModes,e.settings.templateLock,e.blockListSettings])),Yf=(0,Ws.A)(((e,t,n=!1)=>Vm(e,t,n).filter((t=>"disabled"!==kb(e,t)))),(e=>[e.blocks.parents,e.blockEditingModes,e.settings.templateLock,e.blockListSettings]));function Jf(e){return e.removalPromptData}function Xf(e){return e.blockRemovalRules}function Zf(e){return e.openedBlockSettingsMenu}const Qf=(0,Ws.A)((e=>{const t=Am(e).reduce(((e,t,n)=>(e[t]=n,e)),{});return[...e.styleOverrides].sort(((e,n)=>{var r,o;const[,{clientId:i}]=e,[,{clientId:s}]=n;return(null!==(r=t[i])&&void 0!==r?r:-1)-(null!==(o=t[s])&&void 0!==o?o:-1)}))}),(e=>[e.blocks.order,e.styleOverrides]));function em(e){return e.registeredInserterMediaCategories}const tm=(0,Ws.A)((e=>{const{settings:{inserterMediaCategories:t,allowedMimeTypes:n,enableOpenverseMediaCategory:r},registeredInserterMediaCategories:o}=e;if(!t&&!o.length||!n)return;const i=t?.map((({name:e})=>e))||[],s=[...t||[],...(o||[]).filter((({name:e})=>!i.includes(e)))];return s.filter((e=>!(!r&&"openverse"===e.name)&&Object.values(n).some((t=>t.startsWith(`${e.mediaType}/`)))))}),(e=>[e.settings.inserterMediaCategories,e.settings.allowedMimeTypes,e.settings.enableOpenverseMediaCategory,e.registeredInserterMediaCategories])),nm=(0,$s.N)((e=>(0,Ws.A)(((t,n=null)=>{const{getAllPatterns:r,__experimentalGetParsedPattern:o}=kf(e(Cf)),i=r(),{allowedBlockTypes:s}=ib(t);return i.some((({name:e,inserter:r=!0})=>{if(!r)return!1;const{blocks:i}=o(e);return Ef(i,s)&&i.every((({name:e})=>Ng(t,e,n)))}))}),((t,n)=>[...If(e)(t),...jf(t,n)]))));function rm(e,t=[]){return{name:`core/block/${e.id}`,id:e.id,type:Rf.user,title:e.title.raw,categories:e.wp_pattern_category.map((e=>{const n=t.find((({id:t})=>t===e));return n?n.slug:e})),content:e.content.raw,syncStatus:e.wp_pattern_sync_status}}const om=(0,$s.N)((e=>(0,Ws.A)(((t,n)=>{var r,o;if(n?.startsWith("core/block/")){const r=parseInt(n.slice(11),10),o=kf(e(Cf)).getReusableBlocks().find((({id:e})=>e===r));return o?rm(o,t.settings.__experimentalUserPatternCategories):null}return[...null!==(r=t.settings.__experimentalBlockPatterns)&&void 0!==r?r:[],...null!==(o=t.settings[_f]?.(e))&&void 0!==o?o:[]].find((({name:e})=>e===n))}),((t,n)=>n?.startsWith("core/block/")?[kf(e(Cf)).getReusableBlocks(),t.settings.__experimentalReusableBlocks]:[t.settings.__experimentalBlockPatterns,t.settings[_f]?.(e)])))),im=(0,$s.N)((e=>(0,Ws.A)((t=>{var n,r;return[...kf(e(Cf)).getReusableBlocks().map((e=>rm(e,t.settings.__experimentalUserPatternCategories))),...null!==(n=t.settings.__experimentalBlockPatterns)&&void 0!==n?n:[],...null!==(r=t.settings[_f]?.(e))&&void 0!==r?r:[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name))))}),If(e)))),sm=(0,$s.N)((e=>(0,Ws.A)((t=>{const n=t.settings[_f],r=t.settings[xf];return!!n&&void 0===n(e)||!!r&&void 0===r(e)}),If(e)))),am=[],lm=(0,$s.N)((e=>t=>{var n;const r=t.settings[xf];return r?r(e):null!==(n=t.settings.__experimentalReusableBlocks)&&void 0!==n?n:am}));function cm(e){return e.lastFocus}function um(e){return e.isDragging}function dm(e){return e.expandedBlock}const hm=(0,Ws.A)(((e,t)=>{let n,r=t;for(;r=e.blocks.parents.get(r);)"core/block"!==bm(e,r)&&"contentOnly"!==Bg(e,r)||(n=r);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function pm(e){return e.temporarilyEditingAsBlocks}function fm(e){return e.temporarilyEditingFocusModeRevert}const mm=[],gm=new Set;function bm(e,t){const n=e.blocks.byClientId.get(t),r="core/social-link";if("web"!==Oh.A.OS&&n?.name===r){const n=e.blocks.attributes.get(t),{service:o}=null!=n?n:{};return o?`${r}-${o}`:r}return n?n.name:null}function vm(e,t){const n=e.blocks.byClientId.get(t);return!!n&&n.isValid}function ym(e,t){return e.blocks.byClientId.get(t)?e.blocks.attributes.get(t):null}function _m(e,t){return e.blocks.byClientId.has(t)?e.blocks.tree.get(t):null}const xm=(0,Ws.A)(((e,t)=>{const n=e.blocks.byClientId.get(t);return n?{...n,attributes:ym(e,t)}:null}),((e,t)=>[e.blocks.byClientId.get(t),e.blocks.attributes.get(t)]));function wm(e,t){const n=t&&gb(e,t)?"controlled||"+t:t||"";return e.blocks.tree.get(n)?.innerBlocks||mm}const km=(0,Ws.A)(((e,t)=>((0,q.default)("wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree",{since:"6.3",version:"6.5"}),{clientId:t,innerBlocks:Cm(e,t)})),(e=>[e.blocks.order])),Cm=(0,Ws.A)(((e,t="")=>((0,q.default)("wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree",{since:"6.3",version:"6.5"}),dg(e,t).map((t=>km(e,t))))),(e=>[e.blocks.order])),Sm=(0,Ws.A)(((e,t)=>{t=Array.isArray(t)?[...t]:[t];const n=[];for(const r of t){const t=e.blocks.order.get(r);t&&n.push(...t)}let r=0;for(;r[e.blocks.order])),Am=e=>Sm(e,""),Em=(0,Ws.A)(((e,t)=>{const n=Am(e);if(!t)return n.length;let r=0;for(const o of n)e.blocks.byClientId.get(o).name===t&&r++;return r}),(e=>[e.blocks.order,e.blocks.byClientId])),Im=(0,Ws.A)(((e,t)=>{if(!t)return mm;const n=Array.isArray(t)?t:[t],r=Am(e).filter((t=>{const r=e.blocks.byClientId.get(t);return n.includes(r.name)}));return r.length>0?r:mm}),(e=>[e.blocks.order,e.blocks.byClientId]));function jm(e,t){return(0,q.default)("wp.data.select( 'core/block-editor' ).__experimentalGetGlobalBlocksByName",{since:"6.5",alternative:"wp.data.select( 'core/block-editor' ).getBlocksByName"}),Im(e,t)}const Tm=(0,Ws.A)(((e,t)=>(Array.isArray(t)?t:[t]).map((t=>_m(e,t)))),((e,t)=>(Array.isArray(t)?t:[t]).map((t=>e.blocks.tree.get(t))))),Bm=(0,Ws.A)(((e,t)=>Tm(e,t).filter(Boolean).map((e=>e.name))),((e,t)=>Tm(e,t)));function Rm(e,t){return dg(e,t).length}function Nm(e){return e.selection.selectionStart}function Dm(e){return e.selection.selectionEnd}function Mm(e){return e.selection.selectionStart.clientId}function Pm(e){return e.selection.selectionEnd.clientId}function Om(e){return Xm(e).length||(e.selection.selectionStart.clientId?1:0)}function Lm(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function Fm(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:r}=t;return r&&r===n.clientId?r:null}function zm(e){const t=Fm(e);return t?_m(e,t):null}function Um(e,t){var n;return null!==(n=e.blocks.parents.get(t))&&void 0!==n?n:null}const Vm=(0,Ws.A)(((e,t,n=!1)=>{const r=[];let o=t;for(;o=e.blocks.parents.get(o);)r.push(o);return r.length?n?r:r.reverse():mm}),(e=>[e.blocks.parents])),Hm=(0,Ws.A)(((e,t,n,r=!1)=>{const o=Vm(e,t,r),i=Array.isArray(n)?e=>n.includes(e):e=>n===e;return o.filter((t=>i(bm(e,t))))}),(e=>[e.blocks.parents]));function $m(e,t){let n,r=t;do{n=r,r=e.blocks.parents.get(r)}while(r);return n}function Wm(e,t){const n=Fm(e),r=[...Vm(e,t),t],o=[...Vm(e,n),n];let i;const s=Math.min(r.length,o.length);for(let e=0;e{const{selectionStart:t,selectionEnd:n}=e.selection;if(!t.clientId||!n.clientId)return mm;if(t.clientId===n.clientId)return[t.clientId];const r=Um(e,t.clientId);if(null===r)return mm;const o=dg(e,r),i=o.indexOf(t.clientId),s=o.indexOf(n.clientId);return i>s?o.slice(s,i+1):o.slice(i,s+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Xm(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?mm:Jm(e)}const Zm=(0,Ws.A)((e=>{const t=Xm(e);return t.length?t.map((t=>_m(e,t))):mm}),(e=>[...Jm.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Qm(e){return Xm(e)[0]||null}function eg(e){const t=Xm(e);return t[t.length-1]||null}function tg(e,t){return Qm(e)===t}function ng(e,t){return-1!==Xm(e).indexOf(t)}const rg=(0,Ws.A)(((e,t)=>{let n=t,r=!1;for(;n&&!r;)n=Um(e,n),r=ng(e,n);return r}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function og(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function ig(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function sg(e){const t=Nm(e),n=Dm(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function ag(e){const t=Nm(e),n=Dm(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function lg(e){return Jm(e).some((t=>!Sc(bm(e,t)).merge))}function cg(e,t){const n=Nm(e),r=Dm(e);if(n.clientId===r.clientId)return!1;if(!n.attributeKey||!r.attributeKey||void 0===n.offset||void 0===r.offset)return!1;const o=Um(e,n.clientId);if(o!==Um(e,r.clientId))return!1;const i=dg(e,o);let s,a;i.indexOf(n.clientId)>i.indexOf(r.clientId)?(s=r,a=n):(s=n,a=r);const l=t?a.clientId:s.clientId,c=t?s.clientId:a.clientId,u=bm(e,l);if(!Sc(u).merge)return!1;const d=_m(e,c);if(d.name===u)return!0;const h=dd(d,u);return h&&h.length}const ug=e=>{const t=Nm(e),n=Dm(e);if(t.clientId===n.clientId)return mm;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return mm;const r=Um(e,t.clientId);if(r!==Um(e,n.clientId))return mm;const o=dg(e,r),i=o.indexOf(t.clientId),s=o.indexOf(n.clientId),[a,l]=i>s?[n,t]:[t,n],c=_m(e,a.clientId),u=_m(e,l.clientId),d=c.attributes[a.attributeKey],h=u.attributes[l.attributeKey];let p=(0,$.create)({html:d}),f=(0,$.create)({html:h});return p=(0,$.remove)(p,0,a.offset),f=(0,$.remove)(f,l.offset,f.text.length),[{...c,attributes:{...c.attributes,[a.attributeKey]:(0,$.toHTMLString)({value:p})}},{...u,attributes:{...u.attributes,[l.attributeKey]:(0,$.toHTMLString)({value:f})}}]};function dg(e,t){return e.blocks.order.get(t||"")||mm}function hg(e,t){return dg(e,Um(e,t)).indexOf(t)}function pg(e,t){const{selectionStart:n,selectionEnd:r}=e.selection;return n.clientId===r.clientId&&n.clientId===t}function fg(e,t,n=!1){const r=Jm(e);return!!r.length&&(n?r.some((n=>Vm(e,n,!0).includes(t))):r.some((n=>Um(e,n)===t)))}function mg(e,t,n=!1){return dg(e,t).some((t=>Cg(e,t)||n&&mg(e,t,n)))}function gg(e,t){if(!t)return!1;const n=Xm(e),r=n.indexOf(t);return r>-1&&rCg(e,t)))}function Ag(){return(0,q.default)('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}const Eg=(0,Ws.A)((e=>{let t,n;const{insertionPoint:r,selection:{selectionEnd:o}}=e;if(null!==r)return r;const{clientId:i}=o;return i?(t=Um(e,i)||void 0,n=hg(e,o.clientId)+1):n=dg(e).length,{rootClientId:t,index:n}}),(e=>[e.insertionPoint,e.selection.selectionEnd.clientId,e.blocks.parents,e.blocks.order]));function Ig(e){return null!==e.insertionPoint}function jg(e){return e.template.isValid}function Tg(e){return e.settings.template}function Bg(e,t){var n,r;return t?null!==(n=ob(e,t)?.templateLock)&&void 0!==n&&n:null!==(r=e.settings.templateLock)&&void 0!==r&&r}const Rg=(e,t,n=null)=>{let r;if(t&&"object"==typeof t?(r=t,t=r.name):r=Sc(t),!r)return!1;const{allowedBlockTypes:o}=ib(e);if(!Af(o,t,!0))return!1;if(Bg(e,n))return!1;if("disabled"===kb(e,null!=n?n:""))return!1;const i=ob(e,n);if(n&&void 0===i)return!1;const s=bm(e,n),a=Sc(s),l=a?.allowedBlocks;let c=Af(l,t);if(!1!==c){const e=i?.allowedBlocks,n=Af(e,t);null!==n&&(c=n)}const u=r.parent,d=Af(u,s);let h=!0;const p=r.ancestor;p&&(h=[n,...Vm(e,n)].some((t=>Af(p,bm(e,t)))));const f=h&&(null===c&&null===d||!0===c||!0===d);return f?(0,Tu.applyFilters)("blockEditor.__unstableCanInsertBlockType",f,r,n,{getBlock:_m.bind(null,e),getBlockParentsByBlockName:Hm.bind(null,e)}):f},Ng=(0,Ws.A)(Rg,((e,t,n)=>jf(e,n)));function Dg(e,t,n=null){return t.every((t=>Ng(e,bm(e,t),n)))}function Mg(e,t,n=null){const r=ym(e,t);return null===r||(void 0!==r.lock?.remove?!r.lock.remove:!Bg(e,n)&&"disabled"!==kb(e,n))}function Pg(e,t,n=null){return t.every((t=>Mg(e,t,n)))}function Og(e,t,n=null){const r=ym(e,t);return null===r||(void 0!==r.lock?.move?!r.lock.move:"all"!==Bg(e,n)&&"disabled"!==kb(e,n))}function Lg(e,t,n=null){return t.every((t=>Og(e,t,n)))}function Fg(e,t){const n=ym(e,t);if(null===n)return!0;const{lock:r}=n;return!r?.edit}function zg(e,t){return!!Ic(t,"lock",!0)&&!!e.settings?.canLockBlocks}function Ug(e,t){var n;return null!==(n=e.preferences.insertUsage?.[t])&&void 0!==n?n:null}const Vg=(e,t,n)=>!!Ic(t,"inserter",!0)&&Rg(e,t.name,n),Hg=(e,t)=>{if(!e)return t;const n=Date.now()-e;switch(!0){case n<36e5:return 4*t;case n<864e5:return 2*t;case n<6048e5:return t/2;default:return t/4}},$g=(e,{buildScope:t="inserter"})=>n=>{const r=n.name;let o=!1;Ic(n.name,"multiple",!0)||(o=Tm(e,Am(e)).some((({name:e})=>e===n.name)));const{time:i,count:s=0}=Ug(e,r)||{},a={id:r,name:n.name,title:n.title,icon:n.icon,isDisabled:o,frecency:Hg(i,s)};if("transform"===t)return a;const l=Bc(n.name,"inserter");return{...a,initialAttributes:{},description:n.description,category:n.category,keywords:n.keywords,variations:l,example:n.example,utility:1}},Wg=(0,$s.N)((e=>(0,Ws.A)(((t,n=null,r={})=>{const o=Rg(t,"core/block",n)?kf(e(Cf)).getReusableBlocks().map((e=>{const n=e.wp_pattern_sync_status?vf.A:{src:vf.A,foreground:"var(--wp-block-synced-color)"},r=`core/block/${e.id}`,{time:o,count:i=0}=Ug(t,r)||{},s=Hg(o,i);return{id:r,name:"core/block",initialAttributes:{ref:e.id},title:e.title?.raw,icon:n,category:"reusable",keywords:["reusable"],isDisabled:!1,utility:1,frecency:s,content:e.content?.raw,syncStatus:e.wp_pattern_sync_status}})):[],i=$g(t,{buildScope:"inserter"});let s=Ac().filter((e=>Ic(e,"inserter",!0))).map(i);s=r[Sf]?s.reduce(((e,r)=>{for(r.rootClientId=null!=n?n:"";!Rg(t,r.name,r.rootClientId);){if(!r.rootClientId){let e;try{e=kf(ib(t)).sectionRootClientId}catch(e){}e&&Rg(t,r.name,e)?r.rootClientId=e:delete r.rootClientId;break}{const e=Um(t,r.rootClientId);r.rootClientId=e}}return r.hasOwnProperty("rootClientId")&&e.push(r),e}),[]):s.filter((e=>Vg(t,e,n)));const a=s.reduce(((e,n)=>{const{variations:r=[]}=n;if(r.some((({isDefault:e})=>e))||e.push(n),r.length){const o=((e,t)=>n=>{const r=`${t.id}/${n.name}`,{time:o,count:i=0}=Ug(e,r)||{};return{...t,id:r,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:Hg(o,i)}})(t,n);e.push(...r.map(o))}return e}),[]),{core:l,noncore:c}=a.reduce(((e,t)=>{const{core:n,noncore:r}=e;return(t.name.startsWith("core/")?n:r).push(t),e}),{core:[],noncore:[]});return[...l,...c,...o]}),((t,n)=>[Ac(),kf(e(Cf)).getReusableBlocks(),t.blocks.order,t.preferences.insertUsage,...jf(t,n)])))),Gg=(0,Ws.A)(((e,t,n=null)=>{const r=Array.isArray(t)?t:[t],o=$g(e,{buildScope:"transform"}),i=Ac().filter((t=>Vg(e,t,n))).map(o),s=Object.fromEntries(Object.entries(i).map((([,e])=>[e.name,e]))),a=function(e){if(!e.length)return[];const t=(e=>e.length?Ac().filter((t=>!!ld(cd("from",t.name),(t=>id(t,"from",e))))):[])(e),n=(e=>{if(!e.length)return[];const t=Sc(e[0].name);return(t?cd("to",t.name):[]).filter((t=>t&&id(t,"to",e))).map((e=>e.blocks)).flat().map(Sc)})(e);return[...new Set([...t,...n])]}(r).reduce(((e,t)=>(s[t?.name]&&e.push(s[t.name]),e)),[]);return Bf(a,(e=>s[e.name].frecency),"desc")}),((e,t,n)=>[Ac(),e.preferences.insertUsage,...jf(e,n)])),qg=(0,$s.N)((e=>(t,n=null)=>!!Ac().some((e=>Vg(t,e,n)))||Rg(t,"core/block",n)&&kf(e(Cf)).getReusableBlocks().length>0)),Kg=(0,$s.N)((e=>(0,Ws.A)(((t,n=null)=>{if(!n)return;const r=Ac().filter((e=>Vg(t,e,n)));return Rg(t,"core/block",n)&&kf(e(Cf)).getReusableBlocks().length>0&&r.push("core/block"),r}),((t,n)=>[Ac(),kf(e(Cf)).getReusableBlocks(),...jf(t,n)])))),Yg=(0,Ws.A)(((e,t=null)=>((0,q.default)('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',{alternative:'wp.data.select( "core/block-editor" ).getAllowedBlocks',since:"6.2",version:"6.4"}),Kg(e,t))),((e,t)=>Kg.getDependants(e,t)));function Jg(e,t=null){var n;if(!t)return;const{defaultBlock:r,directInsert:o}=null!==(n=e.blockListSettings[t])&&void 0!==n?n:{};return r&&o?r:void 0}function Xg(e,t=null){return(0,q.default)('wp.data.select( "core/block-editor" ).__experimentalGetDirectInsertBlock',{alternative:'wp.data.select( "core/block-editor" ).getDirectInsertBlock',since:"6.3",version:"6.4"}),Jg(e,t)}const Zg=(0,$s.N)((e=>(0,Ws.A)(((t,n)=>{const r=kf(e(Cf)).getPatternBySlug(n);if(!r)return null;const o=Ph(r.content,{__unstableSkipMigrationLogs:!0});return 1===o.length&&(o[0].attributes={...o[0].attributes,metadata:{...o[0].attributes.metadata||{},categories:r.categories,patternName:r.name,name:o[0].attributes.metadata?.name||r.title}}),{...r,blocks:o}}),((t,n)=>[kf(e(Cf)).getPatternBySlug(n)])))),Qg=e=>(t,n)=>[...If(e)(t),...jf(t,n)],eb=(0,$s.N)((e=>(0,Ws.A)(((t,n=null)=>{const{getAllPatterns:r,__experimentalGetParsedPattern:o}=kf(e(Cf)),i=r(),{allowedBlockTypes:s}=ib(t),a=i.filter((({inserter:e=!0})=>!!e)).map((({name:e})=>o(e))),l=a.filter((({blocks:e})=>Ef(e,s))),c=l.filter((({blocks:e})=>e.every((({name:e})=>Ng(t,e,n)))));return c}),Qg(e)))),tb=(0,$s.N)((e=>(0,Ws.A)(((t,n,r=null)=>{if(!n)return mm;const o=e(Cf).__experimentalGetAllowedPatterns(r),i=Array.isArray(n)?n:[n],s=o.filter((e=>e?.blockTypes?.some?.((e=>i.includes(e)))));return 0===s.length?mm:s}),((t,n,r)=>Qg(e)(t,r))))),nb=(0,$s.N)((e=>((0,q.default)('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',{alternative:'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',since:"6.2",version:"6.4"}),e(Cf).getPatternsByBlockTypes))),rb=(0,$s.N)((e=>(0,Ws.A)(((t,n,r=null)=>{if(!n)return mm;if(n.some((({clientId:e,innerBlocks:n})=>n.length||gb(t,e))))return mm;const o=Array.from(new Set(n.map((({name:e})=>e))));return e(Cf).getPatternsByBlockTypes(o,r)}),((t,n,r)=>Qg(e)(t,r)))));function ob(e,t){return e.blockListSettings[t]}function ib(e){return e.settings}function sb(e){return e.blocks.isPersistentChange}const ab=(0,Ws.A)(((e,t=[])=>t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})),(e=>[e.blockListSettings])),lb=(0,$s.N)((e=>(0,Ws.A)(((t,n)=>{(0,q.default)("wp.data.select( 'core/block-editor' ).__experimentalGetReusableBlockTitle",{since:"6.6",version:"6.8"});const r=kf(e(Cf)).getReusableBlocks().find((e=>e.id===n));return r?r.title?.raw:null}),(()=>[kf(e(Cf)).getReusableBlocks()]))));function cb(e){return e.blocks.isIgnoredChange}function ub(e){return e.lastBlockAttributesChange}function db(e){return"navigation"===e.editorMode}function hb(e){return e.editorMode}function pb(e){return e.hasBlockMovingClientId}function fb(e){return!!e.automaticChangeStatus}function mb(e,t){return e.highlightedBlock===t}function gb(e,t){return!!e.blocks.controlledInnerBlocks[t]}const bb=(0,Ws.A)(((e,t)=>{if(!t.length)return null;const n=Fm(e);if(t.includes(bm(e,n)))return n;const r=Xm(e),o=Hm(e,n||r[0],t);return o?o[o.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function vb(e,t,n){const{lastBlockInserted:r}=e;return r.clientIds?.includes(t)&&r.source===n}function yb(e,t){var n;return null===(n=e.blockVisibility?.[t])||void 0===n||n}const _b=(0,Ws.A)((e=>{const t=new Set(Object.keys(e.blockVisibility).filter((t=>e.blockVisibility[t])));return 0===t.size?gm:t}),(e=>[e.blockVisibility]));function xb(e,t){if("default"!==kb(e,t))return!1;if(!Fg(e,t))return!0;const n=hb(e);if("zoom-out"===n){const{sectionRootClientId:n}=kf(ib(e));if(n){const r=dg(e,n);if(r?.includes(t))return!0}else if(t&&!Um(e,t))return!0}const r=Ic(bm(e,t),"__experimentalDisableBlockOverlay",!1);return("navigation"===n||!r&&gb(e,t))&&!pg(e,t)&&!fg(e,t,!0)}function wb(e,t){let n=e.blocks.parents.get(t);for(;n;){if(xb(e,n))return!0;n=e.blocks.parents.get(n)}return!1}const kb=(0,$s.N)((e=>(t,n="")=>{if(null===n&&(n=""),"zoom-out"===hb(t)){const{sectionRootClientId:e}=kf(ib(t));if(""===n)return e?"disabled":"contentOnly";if(n===e)return"contentOnly";const r=dg(t,e);if(!r?.includes(n))return"disabled"}const r=t.blockEditingModes.get(n);if(r)return r;if(!n)return"default";const o=Um(t,n);if("contentOnly"===Bg(t,o)){const r=bm(t,n);return e(ed).__experimentalHasContentRoleAttribute(r)?"contentOnly":"disabled"}const i=kb(t,o);return"contentOnly"===i?"default":i})),Cb=(0,$s.N)((e=>(t,n="")=>{const r=n||Fm(t);if(!r)return!1;const{getGroupingBlockName:o}=e(ed),i=_m(t,r),s=o();return i&&(i.name===s||Sc(i.name)?.transforms?.ungroup)&&!!i.innerBlocks.length&&Mg(t,r)})),Sb=(0,$s.N)((e=>(t,n=mm)=>{const{getGroupingBlockName:r}=e(ed),o=r(),i=n?.length?n:Jm(t),s=i?.length?Um(t,i[0]):void 0;return Ng(t,o,s)&&i.length&&Pg(t,i,s)})),Ab=(e,t)=>((0,q.default)("wp.data.select( 'core/block-editor' ).__unstableGetContentLockingParent",{since:"6.1",version:"6.7"}),hm(e,t));function Eb(e){return(0,q.default)("wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingAsBlocks",{since:"6.1",version:"6.7"}),pm(e)}function Ib(e){return(0,q.default)("wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingFocusModeToRevert",{since:"6.5",version:"6.7"}),fm(e)}const jb=new WeakSet,Tb=["inserterMediaCategories","blockInspectorAnimation"];function Bb(e,{stripExperimentalSettings:t=!1,reset:n=!1}={}){let r=e;if(t&&"web"===Oh.A.OS){r={};for(const t in e)Tb.includes(t)||(r[t]=e[t])}return{type:"UPDATE_SETTINGS",settings:r,reset:n}}function Rb(){return{type:"HIDE_BLOCK_INTERFACE"}}function Nb(){return{type:"SHOW_BLOCK_INTERFACE"}}const Db=(e,t=!0,n=!1)=>({select:r,dispatch:o,registry:i})=>{if(!e||!e.length)return;var s;s=e,e=Array.isArray(s)?s:[s];const a=r.getBlockRootClientId(e[0]);if(!r.canRemoveBlocks(e,a))return;const l=!n&&r.getBlockRemovalRules();if(l){function c(e){const t=[],n=[...e];for(;n.length;){const{innerBlocks:e,...r}=n.shift();n.push(...e),t.push(r)}return t}const u=c(e.map(r.getBlock));let d;for(const h of l)if(d=h.callback(u),d)return void o(Pb(e,t,d))}t&&o.selectPreviousBlock(e[0],t),i.batch((()=>{o({type:"REMOVE_BLOCKS",clientIds:e}),o(Mb())}))},Mb=()=>({select:e,dispatch:t})=>{if(e.getBlockCount()>0)return;const{__unstableHasCustomAppender:n}=e.getSettings();n||t.insertDefaultBlock()};function Pb(e,t,n){return{type:"DISPLAY_BLOCK_REMOVAL_PROMPT",clientIds:e,selectPrevious:t,message:n}}function Ob(){return{type:"CLEAR_BLOCK_REMOVAL_PROMPT"}}function Lb(e=!1){return{type:"SET_BLOCK_REMOVAL_RULES",rules:e}}function Fb(e){return{type:"SET_OPENED_BLOCK_SETTINGS_MENU",clientId:e}}function zb(e,t){return{type:"SET_STYLE_OVERRIDE",id:e,style:t}}function Ub(e){return{type:"DELETE_STYLE_OVERRIDE",id:e}}function Vb(e){return({dispatch:t,select:n,registry:r})=>{r.batch((()=>{t({type:"SET_EXPLICIT_PERSISTENT",isPersistentChange:!1}),e(),t({type:"SET_EXPLICIT_PERSISTENT",isPersistentChange:void 0});const r=n.getBlocks();jb.add(r)}))}}function Hb(e=null){return{type:"LAST_FOCUS",lastFocus:e}}function $b(e){return({select:t,dispatch:n,registry:r})=>{const o=kf(r.select(dy)).getTemporarilyEditingFocusModeToRevert();n.__unstableMarkNextChangeAsNotPersistent(),n.updateBlockAttributes(e,{templateLock:"contentOnly"}),n.updateBlockListSettings(e,{...t.getBlockListSettings(e),templateLock:"contentOnly"}),n.updateSettings({focusMode:o}),n.__unstableSetTemporarilyEditingAsBlocks()}}function Wb(){return{type:"START_DRAGGING"}}function Gb(){return{type:"STOP_DRAGGING"}}function qb(e){return{type:"SET_BLOCK_EXPANDED_IN_LIST_VIEW",clientId:e}}const Kb=e=>({select:t,dispatch:n})=>{n.__unstableMarkNextChangeAsNotPersistent(),n.updateBlockAttributes(e,{templateLock:void 0}),n.updateBlockListSettings(e,{...t.getBlockListSettings(e),templateLock:!1});const r=t.getSettings().focusMode;n.updateSettings({focusMode:!0}),n.__unstableSetTemporarilyEditingAsBlocks(e,r)};var Yb=n(6012),Jb=n(74679);const Xb="†";function Zb(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return("string"==typeof n||n instanceof $.RichTextData)&&-1!==n.toString().indexOf(Xb)}))}function Qb(e){for(const[t,n]of Object.entries(e.attributes))if("rich-text"===n.source||"html"===n.source)return t}const ev=e=>Array.isArray(e)?e:[e],tv=e=>({dispatch:t})=>{t({type:"RESET_BLOCKS",blocks:e}),t(nv(e))},nv=e=>({select:t,dispatch:n})=>{const r=t.getTemplate(),o=t.getTemplateLock(),i=!r||"all"!==o||Pp(e,r);if(i!==t.isValidTemplate())return n.setTemplateValidity(i),i};function rv(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function ov(e){return(0,q.default)('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function iv(e,t,n=!1){return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:ev(e),attributes:t,uniqueByBlock:n}}function sv(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function av(e,t=0){return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const lv=(e,t=!1)=>({select:n,dispatch:r})=>{const o=n.getPreviousBlockClientId(e);if(o)r.selectBlock(o,-1);else if(t){const t=n.getBlockRootClientId(e);t&&r.selectBlock(t,-1)}},cv=e=>({select:t,dispatch:n})=>{const r=t.getNextBlockClientId(e);r&&n.selectBlock(r)};function uv(){return{type:"START_MULTI_SELECT"}}function dv(){return{type:"STOP_MULTI_SELECT"}}const hv=(e,t,n=0)=>({select:r,dispatch:o})=>{if(r.getBlockRootClientId(e)!==r.getBlockRootClientId(t))return;o({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const i=r.getSelectedBlockCount();(0,Yb.speak)((0,H.sprintf)((0,H._n)("%s block selected.","%s blocks selected.",i),i),"assertive")};function pv(){return{type:"CLEAR_SELECTED_BLOCK"}}function fv(e=!0){return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}const mv=(e,t,n,r=0,o)=>({select:i,dispatch:s,registry:a})=>{e=ev(e),t=ev(t);const l=i.getBlockRootClientId(e[0]);for(let e=0;e{s({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:r,meta:o}),s.ensureDefaultBlock()}))};function gv(e,t){return mv(e,t)}const bv=e=>(t,n)=>({select:r,dispatch:o})=>{r.canMoveBlocks(t,n)&&o({type:e,clientIds:ev(t),rootClientId:n})},vv=bv("MOVE_BLOCKS_DOWN"),yv=bv("MOVE_BLOCKS_UP"),_v=(e,t="",n="",r)=>({select:o,dispatch:i})=>{if(o.canMoveBlocks(e,t)){if(t!==n){if(!o.canRemoveBlocks(e,t))return;if(!o.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:r})}};function xv(e,t="",n="",r){return _v([e],t,n,r)}function wv(e,t,n,r,o){return kv([e],t,n,r,0,o)}const kv=(e,t,n,r=!0,o=0,i)=>({select:s,dispatch:a})=>{null!==o&&"object"==typeof o&&(i=o,o=0,(0,q.default)("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=ev(e);const l=[];for(const t of e)s.canInsertBlockType(t.name,n)&&l.push(t);l.length&&a({type:"INSERT_BLOCKS",blocks:l,index:t,rootClientId:n,time:Date.now(),updateSelection:r,initialPosition:r?o:null,meta:i})};function Cv(e,t,n={}){const{__unstableWithInserter:r,operation:o,nearestSide:i}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:r,operation:o,nearestSide:i}}const Sv=()=>({select:e,dispatch:t})=>{e.isBlockInsertionPointVisible()&&t({type:"HIDE_INSERTION_POINT"})};function Av(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const Ev=()=>({select:e,dispatch:t})=>{t({type:"SYNCHRONIZE_TEMPLATE"});const n=Up(e.getBlocks(),e.getTemplate());t.resetBlocks(n)},Iv=e=>({registry:t,select:n,dispatch:r})=>{const o=n.getSelectionStart(),i=n.getSelectionEnd();if(o.clientId===i.clientId)return;if(!o.attributeKey||!i.attributeKey||void 0===o.offset||void 0===i.offset)return!1;const s=n.getBlockRootClientId(o.clientId);if(s!==n.getBlockRootClientId(i.clientId))return;const a=n.getBlockOrder(s);let l,c;a.indexOf(o.clientId)>a.indexOf(i.clientId)?(l=i,c=o):(l=o,c=i);const u=e?c:l,d=n.getBlock(u.clientId),h=Sc(d.name);if(!h.merge)return;const p=l,f=c,m=n.getBlock(p.clientId),g=n.getBlock(f.clientId),b=m.attributes[p.attributeKey],v=g.attributes[f.attributeKey];let y=(0,$.create)({html:b}),_=(0,$.create)({html:v});y=(0,$.remove)(y,p.offset,y.text.length),_=(0,$.insert)(_,Xb,0,f.offset);const x=od(m,{[p.attributeKey]:(0,$.toHTMLString)({value:y})}),w=od(g,{[f.attributeKey]:(0,$.toHTMLString)({value:_})}),k=e?x:w,C=m.name===g.name?[k]:dd(k,h.name);if(!C||!C.length)return;let S;if(e){const e=C.pop();S=h.merge(e.attributes,w.attributes)}else{const e=C.shift();S=h.merge(x.attributes,e.attributes)}const A=Zb(S),E=S[A],I=(0,$.create)({html:E}),j=I.text.indexOf(Xb),T=(0,$.remove)(I,j,j+1),B=(0,$.toHTMLString)({value:T});S[A]=B;const R=n.getSelectedBlockClientIds(),N=[...e?C:[],{...d,attributes:{...d.attributes,...S}},...e?[]:C];t.batch((()=>{r.selectionChange(d.clientId,A,j,j),r.replaceBlocks(R,N,0,n.getSelectedBlocksInitialCaretPosition())}))},jv=(e=[])=>({registry:t,select:n,dispatch:r})=>{const o=n.getSelectionStart(),i=n.getSelectionEnd(),s=n.getBlockRootClientId(o.clientId),a=n.getBlockRootClientId(i.clientId);if(s!==a)return;const l=n.getBlockOrder(s);let c,u;l.indexOf(o.clientId)>l.indexOf(i.clientId)?(c=i,u=o):(c=o,u=i);const d=c,h=u,p=n.getBlock(d.clientId),f=n.getBlock(h.clientId),m=Sc(p.name),g=Sc(f.name),b="string"==typeof d.attributeKey?d.attributeKey:Qb(m),v="string"==typeof h.attributeKey?h.attributeKey:Qb(g),y=n.getBlockAttributes(d.clientId),_=y?.metadata?.bindings;if(_?.[b]){if(e.length){const{createWarningNotice:M}=t.dispatch(Jb.store);return void M((0,H.__)("Blocks can't be inserted into other blocks with bindings"),{type:"snackbar"})}return void r.insertAfterBlock(d.clientId)}if(!b||!v||void 0===o.offset||void 0===i.offset)return;if(d.clientId===h.clientId&&b===v&&d.offset===h.offset)if(e.length){if(Dc(p))return void r.replaceBlocks([d.clientId],e,e.length-1,-1)}else if(!n.getBlockOrder(d.clientId).length){function P(){const e=Cc();return n.canInsertBlockType(e,s)?td(e):td(n.getBlockName(d.clientId))}const O=y[b].length;if(0===d.offset&&O)return void r.insertBlocks([P()],n.getBlockIndex(d.clientId),s,!1);if(d.offset===O)return void r.insertBlocks([P()],n.getBlockIndex(d.clientId)+1,s)}const x=p.attributes[b],w=f.attributes[v];let k=(0,$.create)({html:x}),C=(0,$.create)({html:w});k=(0,$.remove)(k,d.offset,k.text.length),C=(0,$.remove)(C,0,h.offset);let S={...p,innerBlocks:p.clientId===f.clientId?[]:p.innerBlocks,attributes:{...p.attributes,[b]:(0,$.toHTMLString)({value:k})}};const A={...f,clientId:p.clientId===f.clientId?td(f.name).clientId:f.clientId,attributes:{...f.attributes,[v]:(0,$.toHTMLString)({value:C})}};if(!e.length)return void r.replaceBlocks(n.getSelectedBlockClientIds(),[S,A]);let E;const I=[],j=[...e],T=j.shift(),B=Sc(S.name),R=B.merge&&T.name===B.name?[T]:dd(T,B.name);if(R?.length){const L=R.shift();S={...S,attributes:{...S.attributes,...B.merge(S.attributes,L.attributes)}},I.push(S),E={clientId:S.clientId,attributeKey:b,offset:(0,$.create)({html:S.attributes[b]}).text.length},j.unshift(...R)}else Nc(S)||I.push(S),I.push(T);const N=j.pop(),D=Sc(A.name);if(j.length&&I.push(...j),N){const F=D.merge&&D.name===N.name?[N]:dd(N,D.name);if(F?.length){const z=F.pop();I.push({...A,attributes:{...A.attributes,...D.merge(z.attributes,A.attributes)}}),I.push(...F),E={clientId:A.clientId,attributeKey:v,offset:(0,$.create)({html:z.attributes[v]}).text.length}}else I.push(N),Nc(A)||I.push(A)}else Nc(A)||I.push(A);t.batch((()=>{r.replaceBlocks(n.getSelectedBlockClientIds(),I,I.length-1,0),E&&r.selectionChange(E.clientId,E.attributeKey,E.offset,E.offset)}))},Tv=()=>({select:e,dispatch:t})=>{const n=e.getSelectionStart(),r=e.getSelectionEnd();t.selectionChange({start:{clientId:n.clientId},end:{clientId:r.clientId}})},Bv=(e,t)=>({registry:n,select:r,dispatch:o})=>{const i=e,s=t,a=r.getBlock(i),l=Sc(a.name);if(!l)return;const c=r.getBlock(s);if(!l.merge&&Ec(a.name,"__experimentalOnMerge")){const e=dd(c,l.name);if(1!==e?.length)return void o.selectBlock(a.clientId);const[t]=e;return t.innerBlocks.length<1?void o.selectBlock(a.clientId):void n.batch((()=>{o.insertBlocks(t.innerBlocks,void 0,i),o.removeBlock(s),o.selectBlock(t.innerBlocks[0].clientId);const e=r.getNextBlockClientId(i);if(e&&r.getBlockName(i)===r.getBlockName(e)){const t=r.getBlockAttributes(i),n=r.getBlockAttributes(e);Object.keys(t).every((e=>t[e]===n[e]))&&(o.moveBlocksToPosition(r.getBlockOrder(e),e,i),o.removeBlock(e,!1))}}))}if(Dc(a))return void o.removeBlock(i,r.isBlockSelected(i));if(Dc(c))return void o.removeBlock(s,r.isBlockSelected(s));if(!l.merge)return void o.selectBlock(a.clientId);const u=Sc(c.name),{clientId:d,attributeKey:h,offset:p}=r.getSelectionStart(),f=(d===i?l:u).attributes[h],m=(d===i||d===s)&&void 0!==h&&void 0!==p&&!!f;f||("number"==typeof h?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof h):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const g=od(a),b=od(c);if(m){const e=d===i?g:b,t=e.attributes[h],n=(0,$.insert)((0,$.create)({html:t}),Xb,p,p);e.attributes[h]=(0,$.toHTMLString)({value:n})}const v=a.name===c.name?[b]:dd(b,a.name);if(!v||!v.length)return;const y=l.merge(g.attributes,v[0].attributes);if(m){const e=Zb(y),t=y[e],n=(0,$.create)({html:t}),r=n.text.indexOf(Xb),i=(0,$.remove)(n,r,r+1),s=(0,$.toHTMLString)({value:i});y[e]=s,o.selectionChange(a.clientId,e,r,r)}o.replaceBlocks([a.clientId,c.clientId],[{...a,attributes:{...a.attributes,...y}},...v.slice(1)],0)},Rv=(e,t=!0)=>Db(e,t);function Nv(e,t){return Rv([e],t)}function Dv(e,t,n=!1,r=0){return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?r:null,time:Date.now()}}function Mv(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Pv(){return{type:"START_TYPING"}}function Ov(){return{type:"STOP_TYPING"}}function Lv(e=[]){return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Fv(){return{type:"STOP_DRAGGING_BLOCKS"}}function zv(){return(0,q.default)('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Uv(){return(0,q.default)('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Vv(e,t,n,r){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:r}:{type:"SELECTION_CHANGE",...e}}const Hv=(e,t,n)=>({dispatch:r})=>{const o=Cc();if(!o)return;const i=td(o,e);return r.insertBlock(i,n,t)};function $v(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function Wv(e){return Bb(e,{stripExperimentalSettings:!0})}function Gv(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function qv(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Kv(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Yv=()=>({dispatch:e})=>{e({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:t=(e=>setTimeout(e,100))}=window;t((()=>{e({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},Jv=(e=!0)=>({dispatch:t})=>{t.__unstableSetEditorMode(e?"navigation":"edit")},Xv=e=>({dispatch:t,select:n,registry:r})=>{if("zoom-out"===e){const e=n.getBlockSelectionStart(),{sectionRootClientId:o}=kf(r.select(Cf).getSettings());if(e){let r;if(o){const t=n.getBlockOrder(o);r=n.getBlockParents(e).find((e=>t.includes(e)))}else r=n.getBlockHierarchyRootClientId(e);r?t.selectBlock(r):t.clearSelectedBlock()}}t({type:"SET_EDITOR_MODE",mode:e}),"navigation"===e?(0,Yb.speak)((0,H.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):"edit"===e?(0,Yb.speak)((0,H.__)("You are currently in edit mode. To return to the navigation mode, press Escape.")):"zoom-out"===e&&(0,Yb.speak)((0,H.__)("You are currently in zoom-out mode."))},Zv=(e=null)=>({dispatch:t})=>{t({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,Yb.speak)((0,H.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))},Qv=(e,t=!0)=>({select:n,dispatch:r})=>{if(!e||!e.length)return;const o=n.getBlocksByClientId(e);if(o.some((e=>!e)))return;const i=o.map((e=>e.name));if(i.some((e=>!Ic(e,"multiple",!0))))return;const s=n.getBlockRootClientId(e[0]),a=ev(e),l=n.getBlockIndex(a[a.length-1]),c=o.map((e=>rd(e)));return r.insertBlocks(c,l+1,s,t),c.length>1&&t&&r.multiSelect(c[0].clientId,c[c.length-1].clientId),c.map((e=>e.clientId))},ey=e=>({select:t,dispatch:n})=>{if(!e)return;const r=t.getBlockRootClientId(e);if(t.getTemplateLock(r))return;const o=t.getBlockIndex(e),i=r?t.getDirectInsertBlock(r):null;if(!i)return n.insertDefaultBlock({},r,o);const s={};if(i.attributesToCopy){const n=t.getBlockAttributes(e);i.attributesToCopy.forEach((e=>{n[e]&&(s[e]=n[e])}))}const a=td(i.name,{...i.attributes,...s});return n.insertBlock(a,o,r)},ty=e=>({select:t,dispatch:n})=>{if(!e)return;const r=t.getBlockRootClientId(e);if(t.getTemplateLock(r))return;const o=t.getBlockIndex(e),i=r?t.getDirectInsertBlock(r):null;if(!i)return n.insertDefaultBlock({},r,o+1);const s={};if(i.attributesToCopy){const n=t.getBlockAttributes(e);i.attributesToCopy.forEach((e=>{n[e]&&(s[e]=n[e])}))}const a=td(i.name,{...i.attributes,...s});return n.insertBlock(a,o+1,r)};function ny(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const ry=e=>async({dispatch:t})=>{t(ny(e,!0)),await new Promise((e=>setTimeout(e,150))),t(ny(e,!1))};function oy(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function iy(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function sy(e,t){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e,focusModeToRevert:t}}const ay=e=>({select:t,dispatch:n})=>{if(!e||"object"!=typeof e)return void console.error("Category should be an `InserterMediaCategory` object.");if(!e.name)return void console.error("Category should have a `name` that should be unique among all media categories.");if(!e.labels?.name)return void console.error("Category should have a `labels.name`.");if(!["image","audio","video"].includes(e.mediaType))return void console.error("Category should have `mediaType` property that is one of `image|audio|video`.");if(!e.fetch||"function"!=typeof e.fetch)return void console.error("Category should have a `fetch` function defined with the following signature `(InserterMediaRequest) => Promise`.");const r=t.getRegisteredInserterMediaCategories();r.some((({name:t})=>t===e.name))?console.error(`A category is already registered with the same name: "${e.name}".`):r.some((({labels:{name:t}={}})=>t===e.labels?.name))?console.error(`A category is already registered with the same labels.name: "${e.labels.name}".`):n({type:"REGISTER_INSERTER_MEDIA_CATEGORY",category:{...e,isExternalResource:!0}})};function ly(e="",t){return{type:"SET_BLOCK_EDITING_MODE",clientId:e,mode:t}}function cy(e=""){return{type:"UNSET_BLOCK_EDITING_MODE",clientId:e}}const uy={reducer:bf,selectors:h,actions:f},dy=(0,T.A)(Cf,{...uy,persist:["preferences"]}),hy=(0,B.registerStore)(Cf,{...uy,persist:["preferences"]});function py(...e){const{clientId:t=null}=Zp();return(0,Ul.A)((n=>kf(n(dy)).getBlockSettings(t,...e)),[t,...e])}kf(hy).registerPrivateActions(p),kf(hy).registerPrivateSelectors(d),kf(dy).registerPrivateActions(p),kf(dy).registerPrivateSelectors(d);const fy="1600px",my="320px",gy=1,by=.25,vy=.75,yy="14px";function _y(e,t={}){if("string"!=typeof e&&"number"!=typeof e)return null;isFinite(e)&&(e=`${e}px`);const{coerceTo:n,rootSizeValue:r,acceptableUnits:o}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},i=o?.join("|"),s=new RegExp(`^(\\d*\\.?\\d+)(${i}){1,1}$`),a=e.match(s);if(!a||a.length<3)return null;let[,l,c]=a,u=parseFloat(l);return"px"!==n||"em"!==c&&"rem"!==c||(u*=r,c=n),"px"!==c||"em"!==n&&"rem"!==n||(u/=r,c=n),"em"!==n&&"rem"!==n||"em"!==c&&"rem"!==c||(c=n),{value:xy(u,3),unit:c}}function xy(e,t=3){const n=Math.pow(10,t);return Number.isFinite(e)?parseFloat(Math.round(e*n)/n):void 0}function wy(e,t){const{size:n}=e;if(!ky(t?.typography))return n;if(!n||"0"===n||!1===e?.fluid)return n;let r=function(e){const t=e?.typography,n=e?.layout,r=_y(n?.wideSize)?n?.wideSize:null;return ky(t)&&r?{fluid:{maxViewportWidth:r,...t.fluid}}:{fluid:t?.fluid}}(t);r="object"==typeof r?.fluid?r?.fluid:{};const o=function({minimumFontSize:e,maximumFontSize:t,fontSize:n,minimumViewportWidth:r=my,maximumViewportWidth:o=fy,scaleFactor:i=gy,minimumFontSizeLimit:s}){if(s=_y(s)?s:yy,n){const r=_y(n);if(!r?.unit)return null;const o=_y(s,{coerceTo:r.unit});if(o?.value&&!e&&!t&&r?.value<=o?.value)return null;if(t||(t=`${r.value}${r.unit}`),!e){const t="px"===r.unit?r.value:16*r.value,n=Math.min(Math.max(1-.075*Math.log2(t),by),vy),i=xy(r.value*n,3);e=o?.value&&i0}const Cy="body",Sy=":root",Ay=[{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)=>wy(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:[]}],Ey={"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"},Iy={popoverProps:{placement:"left-start",offset:259}};function jy(e,t,n,r,o){const i=[Lf(e,["blocks",t,...n]),Lf(e,n)];for(const s of i)if(s){const i=["custom","theme","default"];for(const a of i){const i=s[a];if(i){const s=i.find((e=>e[r]===o));if(s)return"slug"===r||jy(e,t,n,"slug",s.slug)[r]===s[r]?s:void 0}}}}function Ty(e,t,n){if(!n||"string"!=typeof n){if(!n?.ref||"string"!=typeof n?.ref)return n;{const t=n.ref.split(".");if(!(n=Lf(e,t))||n?.ref)return n}}let r;if(n.startsWith("var:"))r=n.slice(4).split("|");else{if(!n.startsWith("var(--wp--")||!n.endsWith(")"))return n;r=n.slice(10,-1).split("--")}const[o,...i]=r;return"preset"===o?function(e,t,n,[r,o]){const i=Ay.find((e=>e.cssVarInfix===r));if(!i)return n;const s=jy(e.settings,t,i.path,"slug",o);if(s){const{valueKey:n}=i;return Ty(e,t,s[n])}return n}(e,t,n,i):"custom"===o?function(e,t,n,r){var o;const i=null!==(o=Lf(e.settings,["blocks",t,"custom",...r]))&&void 0!==o?o:Lf(e.settings,["custom",...r]);return i?Ty(e,t,i):n}(e,t,n,i):n}function By(e,t){if(!e||!t)return t;const n=e.split(","),r=t.split(","),o=[];return n.forEach((e=>{r.forEach((t=>{o.push(`${e.trim()} ${t.trim()}`)}))})),o.join(", ")}function Ry(e,t){return"object"!=typeof e||"object"!=typeof t?e===t:N()(e?.styles,t?.styles)&&N()(e?.settings,t?.settings)}const Ny=(0,k.createContext)({user:{},base:{},merged:{},setUserConfig:()=>{}}),Dy={settings:{},styles:{}},My=["appearanceTools","useRootPaddingAwareAlignments","background.backgroundImage","background.backgroundRepeat","background.backgroundSize","background.backgroundPosition","border.color","border.radius","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.minHeight","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.textTransform","typography.writingMode"],Py=()=>{const{user:e,setUserConfig:t}=(0,k.useContext)(Ny);return[!!e&&!N()(e,Dy),(0,k.useCallback)((()=>t((()=>Dy))),[t])]};function Oy(e,t,n="all"){const{setUserConfig:r,...o}=(0,k.useContext)(Ny),i=t?".blocks."+t:"",s=e?"."+e:"",a=`settings${i}${s}`,l=`settings${s}`,c="all"===n?"merged":n;return[(0,k.useMemo)((()=>{const t=o[c];if(!t)throw"Unsupported source";var n;if(e)return null!==(n=Lf(t,a))&&void 0!==n?n:Lf(t,l);let r={};return My.forEach((e=>{var n;const o=null!==(n=Lf(t,`settings${i}.${e}`))&&void 0!==n?n:Lf(t,`settings.${e}`);void 0!==o&&(r=Of(r,e.split("."),o))})),r}),[o,c,e,a,l,i]),e=>{r((t=>Of(t,a.split("."),e)))}]}function Ly(e,t,n="all",{shouldDecodeEncode:r=!0}={}){const{merged:o,base:i,user:s,setUserConfig:a}=(0,k.useContext)(Ny),l=e?"."+e:"",c=t?`styles.blocks.${t}${l}`:`styles${l}`;let u,d;switch(n){case"all":u=Lf(o,c),d=r?Ty(o,t,u):u;break;case"user":u=Lf(s,c),d=r?Ty(o,t,u):u;break;case"base":u=Lf(i,c),d=r?Ty(i,t,u):u;break;default:throw"Unsupported source"}return[d,n=>{a((i=>Of(i,c.split("."),r?function(e,t,n,r){if(!r)return r;const o=Ey[n],i=Ay.find((e=>e.cssVarInfix===o));if(!i)return r;const{valueKey:s,path:a}=i,l=jy(e,t,a,s,r);return l?`var:preset|${o}|${l.slug}`:r}(o.settings,t,e,n):n)))}]}function Fy(){const{merged:e}=(0,k.useContext)(Ny);return e?._links}function zy(e,t,n){const{supportedStyles:r,supports:o}=(0,Ul.A)((e=>({supportedStyles:kf(e(ed)).getSupportedStyles(t,n),supports:e(ed).getBlockType(t)?.supports})),[t,n]);return(0,k.useMemo)((()=>{const t={...e};return r.includes("fontSize")||(t.typography={...t.typography,fontSizes:{},customFontSize:!1,defaultFontSizes:!1}),r.includes("fontFamily")||(t.typography={...t.typography,fontFamilies:{}}),t.color={...t.color,text:t.color?.text&&r.includes("color"),background:t.color?.background&&(r.includes("background")||r.includes("backgroundColor")),button:t.color?.button&&r.includes("buttonColor"),heading:t.color?.heading&&r.includes("headingColor"),link:t.color?.link&&r.includes("linkColor"),caption:t.color?.caption&&r.includes("captionColor")},r.includes("background")||(t.color.gradients=[],t.color.customGradient=!1),r.includes("filter")||(t.color.defaultDuotone=!1,t.color.customDuotone=!1),["lineHeight","fontStyle","fontWeight","letterSpacing","textTransform","textDecoration","writingMode"].forEach((e=>{r.includes(e)||(t.typography={...t.typography,[e]:!1})})),r.includes("columnCount")||(t.typography={...t.typography,textColumns:!1}),["contentSize","wideSize"].forEach((e=>{r.includes(e)||(t.layout={...t.layout,[e]:!1})})),["padding","margin","blockGap"].forEach((e=>{r.includes(e)||(t.spacing={...t.spacing,[e]:!1});const n=Array.isArray(o?.spacing?.[e])?o?.spacing?.[e]:o?.spacing?.[e]?.sides;n?.length&&t.spacing?.[e]&&(t.spacing={...t.spacing,[e]:{...t.spacing?.[e],sides:n}})})),["aspectRatio","minHeight"].forEach((e=>{r.includes(e)||(t.dimensions={...t.dimensions,[e]:!1})})),["radius","color","style","width"].forEach((e=>{r.includes("border"+e.charAt(0).toUpperCase()+e.slice(1))||(t.border={...t.border,[e]:!1})})),t.shadow=!!r.includes("shadow")&&t.shadow,n&&(t.typography.textAlign=!1),t}),[e,r,o,n])}function Uy(e){const t=e?.color?.palette?.custom,n=e?.color?.palette?.theme,r=e?.color?.palette?.default,o=e?.color?.defaultPalette;return(0,k.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,H._x)("Theme","Indicates this palette comes from the theme."),colors:n}),o&&r&&r.length&&e.push({name:(0,H._x)("Default","Indicates this palette comes from WordPress."),colors:r}),t&&t.length&&e.push({name:(0,H._x)("Custom","Indicates this palette is created by the user."),colors:t}),e}),[t,n,r,o])}function Vy(e){const t=e?.color?.gradients?.custom,n=e?.color?.gradients?.theme,r=e?.color?.gradients?.default,o=e?.color?.defaultGradients;return(0,k.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,H._x)("Theme","Indicates this palette comes from the theme."),gradients:n}),o&&r&&r.length&&e.push({name:(0,H._x)("Default","Indicates this palette comes from WordPress."),gradients:r}),t&&t.length&&e.push({name:(0,H._x)("Custom","Indicates this palette is created by the user."),gradients:t}),e}),[t,n,r,o])}var Hy=n(23372);const $y=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.entries(e).map((([e,t])=>[e,$y(t)])).filter((([,e])=>void 0!==e));return t.length?Object.fromEntries(t):void 0};function Wy(e,t,n,r,o,i){if(Object.values(null!=e?e:{}).every((e=>!e)))return n;if(1===i.length&&n.innerBlocks.length===r.length)return n;let s=r[0]?.attributes;if(i.length>1&&r.length>1){if(!r[o])return n;s=r[o]?.attributes}let a=n;return Object.entries(e).forEach((([e,n])=>{n&&t[e].forEach((e=>{const t=Lf(s,e);t&&(a={...a,attributes:Of(a.attributes,e,t)})}))})),a}function Gy(e,t,n){const r=Ec(e,t),o=r?.__experimentalSkipSerialization;return Array.isArray(o)?o.includes(n):o}const qy=new WeakMap;function Ky({id:e,css:t,assets:n,__unstableType:r,clientId:o}={}){const{setStyleOverride:i,deleteStyleOverride:s}=kf((0,Vl.A)(dy)),a=(0,Vp.A)(),l=(0,k.useId)();(0,k.useEffect)((()=>{if(!t&&!n)return;const c=e||l,u={id:e,css:t,assets:n,__unstableType:r,clientId:o};return qy.get(a)||qy.set(a,[]),qy.get(a).push([c,u]),window.queueMicrotask((()=>{qy.get(a)?.length&&a.batch((()=>{qy.get(a).forEach((e=>{i(...e)})),qy.set(a,[])}))})),()=>{const e=qy.get(a)?.find((([e])=>e===c));e?qy.set(a,qy.get(a).filter((([e])=>e!==c))):s(c)}}),[e,t,o,n,r,l,i,s,a])}function Yy(e,t){const[n,r,o,i,s,a,l,c,u,d,h,p,f,m,g,b,v,y,_,x,w,C,S,A,E,I,j,T,B,R,N,D,M,P,O,L,F,z,U,V,H,$,W,G,q,K,Y,J,X,Z,Q,ee,te,ne,re,oe]=py("background.backgroundImage","background.backgroundSize","typography.fontFamilies.custom","typography.fontFamilies.default","typography.fontFamilies.theme","typography.defaultFontSizes","typography.fontSizes.custom","typography.fontSizes.default","typography.fontSizes.theme","typography.customFontSize","typography.fontStyle","typography.fontWeight","typography.lineHeight","typography.textAlign","typography.textColumns","typography.textDecoration","typography.writingMode","typography.textTransform","typography.letterSpacing","spacing.padding","spacing.margin","spacing.blockGap","spacing.defaultSpacingSizes","spacing.customSpacingSize","spacing.spacingSizes.custom","spacing.spacingSizes.default","spacing.spacingSizes.theme","spacing.units","dimensions.aspectRatio","dimensions.minHeight","layout","border.color","border.radius","border.style","border.width","color.custom","color.palette.custom","color.customDuotone","color.palette.theme","color.palette.default","color.defaultPalette","color.defaultDuotone","color.duotone.custom","color.duotone.theme","color.duotone.default","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients","color.customGradient","color.background","color.link","color.text","color.heading","color.button","shadow");return zy((0,k.useMemo)((()=>({background:{backgroundImage:n,backgroundSize:r},color:{palette:{custom:F,theme:U,default:V},gradients:{custom:K,theme:Y,default:J},duotone:{custom:W,theme:G,default:q},defaultGradients:X,defaultPalette:H,defaultDuotone:$,custom:L,customGradient:Z,customDuotone:z,background:Q,link:ee,heading:ne,button:re,text:te},typography:{fontFamilies:{custom:o,default:i,theme:s},fontSizes:{custom:l,default:c,theme:u},customFontSize:d,defaultFontSizes:a,fontStyle:h,fontWeight:p,lineHeight:f,textAlign:m,textColumns:g,textDecoration:b,textTransform:y,letterSpacing:_,writingMode:v},spacing:{spacingSizes:{custom:E,default:I,theme:j},customSpacingSize:A,defaultSpacingSizes:S,padding:x,margin:w,blockGap:C,units:T},border:{color:D,radius:M,style:P,width:O},dimensions:{aspectRatio:B,minHeight:R},layout:N,parentLayout:t,shadow:oe})),[n,r,o,i,s,a,l,c,u,d,h,p,f,m,g,b,y,_,v,x,w,C,S,A,E,I,j,T,B,R,N,t,D,M,P,O,L,F,z,U,V,H,$,W,G,q,K,Y,J,X,Z,Q,ee,te,ne,re,oe]),e)}const Jy=(0,k.memo)((function({index:e,useBlockProps:t,setAllWrapperProps:n,...r}){const o=t(r),i=t=>n((n=>{const r=[...n];return r[e]=t,r}));return(0,k.useEffect)((()=>(i(o),()=>{i(void 0)}))),null}));(0,Tu.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&Ic(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));var Xy=n(66248),Zy=n(20660),Qy=n(29149);const e_=({children:e,className:t})=>(0,jd.jsx)("div",{className:t,children:e}),t_=(0,k.forwardRef)((function({children:e,className:t,containerClassName:n,extraProps:r,isActive:o,isDisabled:i,title:s,...a},l){return(0,k.useContext)(Qy.A)?(0,jd.jsx)(Zy.A,{className:(0,Hy.A)("components-toolbar-button",t),...r,...a,ref:l,children:t=>(0,jd.jsx)(Xy.Ay,{label:s,isPressed:o,disabled:i,...t,children:e})}):(0,jd.jsx)(e_,{className:n,children:(0,jd.jsx)(Xy.Ay,{ref:l,icon:a.icon,label:s,shortcut:a.shortcut,"data-subscript":a.subscript,onClick:e=>{e.stopPropagation(),a.onClick&&a.onClick(e)},className:(0,Hy.A)("components-toolbar__control",t),isPressed:o,disabled:i,"data-toolbar-item":!0,...r,...a,children:e})})})),n_=t_,r_=({className:e,children:t,...n})=>(0,jd.jsx)("div",{className:e,...n,children:t});var o_=n(79855);const i_=function({controls:e=[],toggleProps:t,...n}){const r=t=>(0,jd.jsx)(o_.A,{controls:e,toggleProps:{...t,"data-toolbar-item":!0},...n});return(0,k.useContext)(Qy.A)?(0,jd.jsx)(Zy.A,{...t,children:r}):r(t)},s_=function({controls:e=[],children:t,className:n,isCollapsed:r,title:o,...i}){const s=(0,k.useContext)(Qy.A);if(!(e&&e.length||t))return null;const a=(0,Hy.A)(s?"components-toolbar-group":"components-toolbar",n);let l;var c;return c=e,l=Array.isArray(c)&&Array.isArray(c[0])?e:[e],r?(0,jd.jsx)(i_,{label:o,controls:l,className:a,children:t,...i}):(0,jd.jsxs)(r_,{className:a,...i,children:[l?.flatMap(((e,t)=>e.map(((e,n)=>(0,jd.jsx)(n_,{containerClassName:t>0&&0===n?"has-left-divider":void 0,...e},[t,n].join()))))),t]})};var a_=n(41657);const l_={default:(0,Hl.QJ)("BlockControls"),block:(0,Hl.QJ)("BlockControlsBlock"),inline:(0,Hl.QJ)("BlockFormatControls"),other:(0,Hl.QJ)("BlockControlsOther"),parent:(0,Hl.QJ)("BlockControlsParent")};function c_({group:e="default",controls:t,children:n,__experimentalShareWithChildBlocks:r=!1}){const o=function(e,t){const n=Zp();return n[$p]?l_[e]?.Fill:n[Wp]&&t?l_.parent.Fill:null}(e,r);if(!o)return null;const i=(0,jd.jsxs)(jd.Fragment,{children:["default"===e&&(0,jd.jsx)(s_,{controls:t}),n]});return(0,jd.jsx)(a_.A,{document,children:(0,jd.jsx)(o,{children:e=>{const{forwardedContext:t=[]}=e;return t.reduce(((e,[t,n])=>(0,jd.jsx)(t,{...n,children:e})),i)}})})}var u_=n(96606),d_=n(46e3),h_=n(58595);function p_(e){const t=(0,k.useContext)(h_.A);return(0,d_.A)(t.fills,e)}var f_=n(7532);const{ComponentsContext:m_}=kf(u_.j);function g_({group:e="default",...t}){const n=(0,k.useContext)(Qy.A),r=(0,k.useContext)(m_),o=(0,k.useMemo)((()=>({forwardedContext:[[Qy.A.Provider,{value:n}],[m_.Provider,{value:r}]]})),[n,r]),i=l_[e]?.Slot,s=p_(i?.__unstableName);if(!i)return!0===globalThis.SCRIPT_DEBUG&&(0,f_.default)(`Unknown BlockControls group "${e}" provided.`),null;if(!s?.length)return null;const a=(0,jd.jsx)(i,{...t,bubblesVirtually:!0,fillProps:o});return"default"===e?a:(0,jd.jsx)(s_,{children:a})}const b_=c_;b_.Slot=g_;const v_=e=>(0,jd.jsx)(c_,{group:"inline",...e});v_.Slot=e=>(0,jd.jsx)(g_,{group:"inline",...e});const y_=b_,__=(0,k.forwardRef)((function(e,t){return(0,k.useContext)(Qy.A)?(0,jd.jsx)(Zy.A,{ref:t,...e.toggleProps,children:t=>(0,jd.jsx)(o_.A,{...e,popoverProps:{...e.popoverProps},toggleProps:t})}):(0,jd.jsx)(o_.A,{...e})}));var x_=n(17741),w_=n(32785),k_=n(5180),C_=n(67428),S_=n(70903),A_=n(39526),E_=n(47388),I_=n(87334),j_=n(7278),T_=n(28800),B_=n(9026),R_=n(13555);const N_=(0,k.createContext)(null);var D_=n(42218);const M_=e=>!e.isLayoutDirty&&e.willUpdate(!1);function P_(){const e=new Set,t=new WeakMap,n=()=>e.forEach(M_);return{add:r=>{e.add(r),t.set(r,r.addEventListener("willUpdate",n))},remove:r=>{e.delete(r);const o=t.get(r);o&&(o(),t.delete(r)),n()},dirty:n}}const O_=e=>!0===e,L_=({children:e,id:t,inherit:n=!0})=>{const r=(0,k.useContext)(R_.L),o=(0,k.useContext)(N_),[i,s]=(0,D_.C)(),a=(0,k.useRef)(null),l=r.id||o;null===a.current&&((e=>O_(!0===e)||"id"===e)(n)&&l&&(t=t?l+"-"+t:l),a.current={id:t,group:O_(n)&&r.group||P_()});const c=(0,k.useMemo)((()=>({...a.current,forceRender:i})),[s]);return(0,jd.jsx)(R_.L.Provider,{value:c,children:e})};var F_=n(56138),z_=n(76219),U_=n(36471),V_=n(74493),H_=n(73393),$_=n(54395),W_=n(35366),G_=n(34592),q_=n(73474);var K_={name:"1aqh2c7",styles:"min-height:40px;padding:3px"},Y_={name:"1ndywgm",styles:"min-height:36px;padding:2px"};const J_={name:"7whenc",styles:"display:flex;width:100%"},X_=(0,$_.default)("div",{target:"eakva830"})({name:"zjik7",styles:"display:flex"});var Z_=n(38423),Q_=n(29165),ex=n(31599),tx=n(60810),nx=n(19497),rx=n(26913);function ox(e={}){var t,n=(0,rx.YG)(e,[]);const r=null==(t=n.store)?void 0:t.getState(),o=(0,ex.z)((0,rx.ko)((0,rx.IA)({},n),{focusLoop:(0,nx.Jh)(n.focusLoop,null==r?void 0:r.focusLoop,!0)})),i=(0,rx.ko)((0,rx.IA)({},o.getState()),{value:(0,nx.Jh)(n.value,null==r?void 0:r.value,n.defaultValue,null)}),s=(0,tx.y$)(i,o,n.store);return(0,rx.ko)((0,rx.IA)((0,rx.IA)({},o),s),{setValue:e=>s.setState("value",e)})}var ix=n(21093),sx=n(49200),ax=n(68620),lx=n(50676),cx=n(28977),ux=(0,ax.ab)((e=>{var t=e,{store:n}=t,r=(0,cx.YG)(t,["store"]);const o=(0,ix.XF)();return n=n||o,(0,nx.V1)(n,!1),r=(0,lx.w7)(r,(e=>(0,jd.jsx)(ix.aN,{value:n,children:e})),[n]),r=(0,cx.IA)({role:"radiogroup"},r),(0,sx.T)((0,cx.IA)({store:n},r))})),dx=(0,ax.a0)((e=>{const t=ux(e);return(0,ax.n)("div",t)})),hx=n(29238);const px=(0,k.createContext)({}),fx=px;var mx=n(11800);function gx(e){const t=(0,k.useRef)(!0),n=(0,mx.A)(e),r=(0,k.useRef)(!1);(0,k.useEffect)((()=>{t.current&&(t.current=!1)}),[]);const o=r.current||!t.current&&n!==e;return(0,k.useEffect)((()=>{r.current=o}),[o]),o?{value:null!=e?e:"",defaultValue:void 0}:{value:void 0,defaultValue:e}}const bx=(0,k.forwardRef)((function({children:e,isAdaptiveWidth:t,label:n,onChange:r,size:o,value:i,id:s,...a},l){const c=(0,F_.A)(bx,"toggle-group-control-as-radio-group"),u=s||c,{value:d,defaultValue:h}=gx(i),p=r?e=>{r(null!=e?e:void 0)}:void 0,f=function(e={}){const[t,n]=(0,Q_.Pj)(ox,e);return function(e,t,n){return e=(0,Z_.Y)(e,t,n),(0,Q_.Tz)(e,n,"value","setValue"),e}(t,n,e)}({defaultValue:h,value:d,setValue:p}),m=f.useState("value"),g=f.setValue,b=(0,k.useMemo)((()=>({baseId:u,isBlock:!t,size:o,value:m,setValue:g})),[u,t,o,m,g]);return(0,jd.jsx)(fx.Provider,{value:b,children:(0,jd.jsx)(dx,{store:f,"aria-label":n,render:(0,jd.jsx)(hx.A,{}),...a,id:u,ref:l,children:e})})}));var vx=n(18688);const yx=(0,k.forwardRef)((function({children:e,isAdaptiveWidth:t,label:n,onChange:r,size:o,value:i,id:s,...a},l){const c=(0,F_.A)(yx,"toggle-group-control-as-button-group"),u=s||c,{value:d,defaultValue:h}=gx(i),[p,f]=(0,vx.j)({defaultValue:h,value:d,onChange:r}),m=(0,k.useMemo)((()=>({baseId:u,value:p,setValue:f,isBlock:!t,isDeselectable:!0,size:o})),[u,p,f,t,o]);return(0,jd.jsx)(fx.Provider,{value:m,children:(0,jd.jsx)(hx.A,{"aria-label":n,...a,ref:l,role:"group",children:e})})})),_x=(0,U_.KZ)((function(e,t){const{__nextHasNoMarginBottom:n=!1,__next40pxDefaultSize:r=!1,className:o,isAdaptiveWidth:i=!1,isBlock:s=!1,isDeselectable:a=!1,label:l,hideLabelFromVision:c=!1,help:u,onChange:d,size:h="default",value:p,children:f,...m}=(0,z_.A)(e,"ToggleGroupControl"),g=(0,F_.A)(_x,"toggle-group-control"),b=r&&"default"===h?"__unstable-large":h,v=(0,V_.l)(),y=(0,k.useMemo)((()=>v((({isBlock:e,isDeselectable:t,size:n})=>(0,W_.css)("background:",G_.l.ui.background,";border:1px solid transparent;border-radius:",q_.A.controlBorderRadius,";display:inline-flex;min-width:0;position:relative;",(e=>({default:Y_,"__unstable-large":K_}[e]))(n)," ",!t&&(e=>{const t=(0,W_.css)("border-color:",G_.l.ui.border,";","");return(0,W_.css)(e&&t," &:hover{border-color:",G_.l.ui.borderHover,";}&:focus-within{border-color:",G_.l.ui.borderFocus,";box-shadow:",q_.A.controlBoxShadowFocus,";z-index:1;outline:2px solid transparent;outline-offset:-2px;}","")})(e),";",""))({isBlock:s,isDeselectable:a,size:b}),s&&J_,o)),[o,v,s,a,b]),_=a?yx:bx;return(0,jd.jsxs)(H_.Ay,{help:u,__nextHasNoMarginBottom:n,children:[!c&&(0,jd.jsx)(X_,{children:(0,jd.jsx)(H_.Ay.VisualLabel,{children:l})}),(0,jd.jsx)(_,{...m,className:y,isAdaptiveWidth:i,label:l,onChange:d,ref:t,size:b,value:p,children:(0,jd.jsx)(L_,{id:g,children:f})})]})}),"ToggleGroupControl"),xx=_x;var wx=n(65302),kx=n(57207),Cx=n(44166);const Sx=(0,$_.default)("div",{target:"et6ln9s1"})({name:"sln1fl",styles:"display:inline-flex;max-width:100%;min-width:0;position:relative"}),Ax={name:"82a6rk",styles:"flex:1"},Ex=({isDeselectable:e,isIcon:t,isPressed:n,size:r})=>(0,W_.css)("align-items:center;appearance:none;background:transparent;border:none;border-radius:",q_.A.controlBorderRadius,";color:",G_.l.gray[700],";fill:currentColor;cursor:pointer;display:flex;font-family:inherit;height:100%;justify-content:center;line-height:100%;outline:none;padding:0 12px;position:relative;text-align:center;@media not ( prefers-reduced-motion ){transition:background ",q_.A.transitionDurationFast," linear,color ",q_.A.transitionDurationFast," linear,font-weight 60ms linear;}user-select:none;width:100%;z-index:2;&::-moz-focus-inner{border:0;}&:active{background:",q_.A.toggleGroupControlBackgroundColor,";}",e&&jx," ",t&&Bx({size:r})," ",n&&Ix,";",""),Ix=(0,W_.css)("color:",G_.l.white,";&:active{background:transparent;}",""),jx=(0,W_.css)("color:",G_.l.gray[900],";&:focus{box-shadow:inset 0 0 0 1px ",G_.l.white,",0 0 0 ",q_.A.borderWidthFocus," ",G_.l.theme.accent,";outline:2px solid transparent;}",""),Tx=(0,$_.default)("div",{target:"et6ln9s0"})("display:flex;font-size:",q_.A.fontSize,";line-height:1;"),Bx=({size:e="default"})=>(0,W_.css)("color:",G_.l.gray[900],";height:",{default:"30px","__unstable-large":"32px"}[e],";aspect-ratio:1;padding-left:0;padding-right:0;",""),Rx=(0,W_.css)("background:",G_.l.gray[900],";border-radius:",q_.A.controlBorderRadius,";position:absolute;inset:0;z-index:1;outline:2px solid transparent;outline-offset:-3px;","");var Nx=n(95486);const{Rp:Dx,y0:Mx}=m,Px={duration:0},Ox=({showTooltip:e,text:t,children:n})=>e&&t?(0,jd.jsx)(Nx.Ay,{text:t,placement:"top",children:n}):(0,jd.jsx)(jd.Fragment,{children:n}),Lx=(0,U_.KZ)((function e(t,n){const r=(0,Cx.A)(),o=(0,k.useContext)(px),i=(0,F_.A)(e,o.baseId||"toggle-group-control-option-base"),s=(0,z_.A)({...t,id:i},"ToggleGroupControlOptionBase"),{isBlock:a=!1,isDeselectable:l=!1,size:c="default"}=o,{className:u,isIcon:d=!1,value:h,children:p,showTooltip:f=!1,onFocus:m,...g}=s,b=o.value===h,v=(0,V_.l)(),y=(0,k.useMemo)((()=>v(a&&Ax)),[v,a]),_=(0,k.useMemo)((()=>v(Ex({isDeselectable:l,isIcon:d,isPressed:b,size:c}),u)),[v,l,d,b,c,u]),x=(0,k.useMemo)((()=>v(Rx)),[v]),w={...g,className:_,"data-value":h,ref:n};return(0,jd.jsxs)(Mx,{className:y,children:[(0,jd.jsx)(Ox,{showTooltip:f,text:g["aria-label"],children:l?(0,jd.jsx)("button",{...w,onFocus:m,"aria-pressed":b,type:"button",onClick:()=>{l&&b?o.setValue(void 0):o.setValue(h)},children:(0,jd.jsx)(Dx,{children:p})}):(0,jd.jsx)(wx.s,{render:(0,jd.jsx)("button",{type:"button",...w,onFocus:e=>{m?.(e),e.defaultPrevented||o.setValue(h)}}),value:h,children:(0,jd.jsx)(Dx,{children:p})})}),b?(0,jd.jsx)(kx.P.div,{layout:!0,layoutRoot:!0,children:(0,jd.jsx)(kx.P.div,{className:x,transition:r?Px:void 0,role:"presentation",layoutId:"toggle-group-backdrop-shared-layout-id"})}):null]})}),"ToggleGroupControlOptionBase"),Fx=Lx;var zx=n(56973);const Ux=(0,k.forwardRef)((function(e,t){const{icon:n,label:r,...o}=e;return(0,jd.jsx)(Fx,{...o,isIcon:!0,"aria-label":r,showTooltip:!0,ref:t,children:(0,jd.jsx)(zx.A,{icon:n})})}));var Vx=n(26836);const Hx={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}}]}};function $x(e,t=""){return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function Wx(e,t=Hx,n,r){let o="";return t?.[n]?.spacingStyles?.length&&r&&t[n].spacingStyles.forEach((t=>{o+=`${$x(e,t.selector.trim())} { `,o+=Object.entries(t.rules).map((([e,t])=>`${e}: ${t||r}`)).join("; "),o+="; }"})),o}function Gx(e){const{contentSize:t,wideSize:n,type:r="default"}=e,o={},i=/^(?!0)\d+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i;return i.test(t)&&"constrained"===r&&(o.none=(0,H.sprintf)((0,H.__)("Max %s wide"),t)),i.test(n)&&(o.wide=(0,H.sprintf)((0,H.__)("Max %s wide"),n)),o}var qx=n(80194),Kx=n(19897),Yx=n(68591),Jx=n(9926),Xx=n(67119),Zx=n(91482),Qx=n(61172);const ew=8,tw=["top","right","bottom","left"],nw={top:void 0,right:void 0,bottom:void 0,left:void 0},rw={custom:qx.A,axial:qx.A,horizontal:Kx.A,vertical:Yx.A,top:Jx.A,right:Xx.A,bottom:Zx.A,left:Qx.A},ow={default:(0,H.__)("Spacing control"),top:(0,H.__)("Top"),bottom:(0,H.__)("Bottom"),left:(0,H.__)("Left"),right:(0,H.__)("Right"),mixed:(0,H.__)("Mixed"),vertical:(0,H.__)("Vertical"),horizontal:(0,H.__)("Horizontal"),axial:(0,H.__)("Horizontal & vertical"),custom:(0,H.__)("Custom")},iw={axial:"axial",top:"top",right:"right",bottom:"bottom",left:"left",custom:"custom"};function sw(e){return!!e?.includes&&("0"===e||e.includes("var:preset|spacing|"))}function aw(e,t){if(!e||sw(e)||"0"===e)return e;const n=t.find((t=>String(t.size)===String(e)));return n?.slug?`var:preset|spacing|${n.slug}`:e}function lw(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function cw(e){if(!e)return;if("0"===e||"default"===e)return e;const t=e.match(/var:preset\|spacing\|(.+)/);return t?t[1]:void 0}function uw(e,t){if(!e||!e.length)return!1;const n=e.includes("horizontal")||e.includes("left")&&e.includes("right"),r=e.includes("vertical")||e.includes("top")&&e.includes("bottom");return"horizontal"===t?n:"vertical"===t?r:n||r}function dw(e,t="0"){const n=function(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:e?.top,left:t?e:e?.left}}(e);if(!n)return null;const r=lw(n?.top)||t,o=lw(n?.left)||t;return r===o?r:`${r} ${o}`}var hw=n(64348);const pw=(0,jd.jsx)(hw.t4,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,jd.jsx)(hw.wA,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})}),fw=(0,jd.jsx)(hw.t4,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,jd.jsx)(hw.wA,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})}),mw=(0,jd.jsx)(hw.t4,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,jd.jsx)(hw.wA,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})}),gw=(0,jd.jsx)(hw.t4,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,jd.jsx)(hw.wA,{d:"M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z"})}),bw=(0,jd.jsx)(hw.t4,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,jd.jsx)(hw.wA,{d:"M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z"})}),vw={top:{icon:mw,title:(0,H._x)("Align top","Block vertical alignment setting")},center:{icon:fw,title:(0,H._x)("Align middle","Block vertical alignment setting")},bottom:{icon:pw,title:(0,H._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:gw,title:(0,H._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:bw,title:(0,H._x)("Space between","Block vertical alignment setting")}},yw=["top","center","bottom"],_w=function({value:e,onChange:t,controls:n=yw,isCollapsed:r=!0,isToolbar:o}){function i(n){return()=>t(e===n?void 0:n)}const s=vw[e],a=vw.top,l=o?s_:__,c=o?{isCollapsed:r}:{};return(0,jd.jsx)(l,{icon:s?s.icon:a.icon,label:(0,H._x)("Change vertical alignment","Block vertical alignment setting label"),controls:n.map((t=>({...vw[t],isActive:e===t,role:r?"menuitemradio":void 0,onClick:i(t)}))),...c})},xw=e=>(0,jd.jsx)(_w,{...e,isToolbar:!1}),ww=e=>(0,jd.jsx)(_w,{...e,isToolbar:!0}),kw={left:k_.A,center:C_.A,right:S_.A,"space-between":A_.A,stretch:E_.A},Cw=function({allowedControls:e=["left","center","right","space-between"],isCollapsed:t=!0,onChange:n,value:r,popoverProps:o,isToolbar:i}){const s=e=>{n(e===r?void 0:e)},a=r?kw[r]:kw.left,l=[{name:"left",icon:k_.A,title:(0,H.__)("Justify items left"),isActive:"left"===r,onClick:()=>s("left")},{name:"center",icon:C_.A,title:(0,H.__)("Justify items center"),isActive:"center"===r,onClick:()=>s("center")},{name:"right",icon:S_.A,title:(0,H.__)("Justify items right"),isActive:"right"===r,onClick:()=>s("right")},{name:"space-between",icon:A_.A,title:(0,H.__)("Space between items"),isActive:"space-between"===r,onClick:()=>s("space-between")},{name:"stretch",icon:E_.A,title:(0,H.__)("Stretch items"),isActive:"stretch"===r,onClick:()=>s("stretch")}],c=i?s_:__,u=i?{isCollapsed:t}:{};return(0,jd.jsx)(c,{icon:a,popoverProps:o,label:(0,H.__)("Change items justification"),controls:l.filter((t=>e.includes(t.name))),...u})},Sw=e=>(0,jd.jsx)(Cw,{...e,isToolbar:!1}),Aw={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},Ew={left:"flex-start",right:"flex-end",center:"center",stretch:"stretch"},Iw={top:"flex-start",center:"center",bottom:"flex-end",stretch:"stretch","space-between":"space-between"},jw=["wrap","nowrap"],Tw={name:"flex",label:(0,H.__)("Flex"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowOrientation:r=!0}=n;return(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsxs)(T_.A,{children:[(0,jd.jsx)(B_.A,{children:(0,jd.jsx)(Nw,{layout:e,onChange:t})}),(0,jd.jsx)(B_.A,{children:r&&(0,jd.jsx)(Mw,{layout:e,onChange:t})})]}),(0,jd.jsx)(Dw,{layout:e,onChange:t})]})},toolBarControls:function({layout:e={},onChange:t,layoutBlockSupport:n}){if(n?.allowSwitching)return null;const{allowVerticalAlignment:r=!0}=n;return(0,jd.jsxs)(y_,{group:"block",__experimentalShareWithChildBlocks:!0,children:[(0,jd.jsx)(Nw,{layout:e,onChange:t,isToolbar:!0}),r&&(0,jd.jsx)(Bw,{layout:e,onChange:t,isToolbar:!0})]})},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:r,hasBlockGapSupport:o,layoutDefinitions:i=Hx}){const{orientation:s="horizontal"}=t,a=n?.spacing?.blockGap&&!Gy(r,"spacing","blockGap")?dw(n?.spacing?.blockGap,"0.5em"):void 0,l=Aw[t.justifyContent],c=jw.includes(t.flexWrap)?t.flexWrap:"wrap",u=Iw[t.verticalAlignment],d=Ew[t.justifyContent]||Ew.left;let h="";const p=[];return c&&"wrap"!==c&&p.push(`flex-wrap: ${c}`),"horizontal"===s?(u&&p.push(`align-items: ${u}`),l&&p.push(`justify-content: ${l}`)):(u&&p.push(`justify-content: ${u}`),p.push("flex-direction: column"),p.push(`align-items: ${d}`)),p.length&&(h=`${$x(e)} {\n\t\t\t\t${p.join("; ")};\n\t\t\t}`),o&&a&&(h+=Wx(e,i,"flex",a)),h},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function Bw({layout:e,onChange:t,isToolbar:n=!1}){const{orientation:r="horizontal"}=e,o="horizontal"===r?Iw.center:Iw.top,{verticalAlignment:i=o}=e,s=n=>{t({...e,verticalAlignment:n})};if(n)return(0,jd.jsx)(xw,{onChange:s,value:i,controls:"horizontal"===r?["top","center","bottom","stretch"]:["top","center","bottom","space-between"]});const a=[{value:"flex-start",label:(0,H.__)("Align items top")},{value:"center",label:(0,H.__)("Align items center")},{value:"flex-end",label:(0,H.__)("Align items bottom")}];return(0,jd.jsxs)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control",children:[(0,jd.jsx)("legend",{children:(0,H.__)("Vertical alignment")}),(0,jd.jsx)("div",{children:a.map(((e,t,n)=>(0,jd.jsx)(Xy.Ay,{label:n,icon:t,isPressed:i===e,onClick:()=>s(e)},e)))})]})}const Rw={placement:"bottom-start"};function Nw({layout:e,onChange:t,isToolbar:n=!1}){const{justifyContent:r="left",orientation:o="horizontal"}=e,i=n=>{t({...e,justifyContent:n})},s=["left","center","right"];if("horizontal"===o?s.push("space-between"):s.push("stretch"),n)return(0,jd.jsx)(Sw,{allowedControls:s,value:r,onChange:i,popoverProps:Rw});const a=[{value:"left",icon:k_.A,label:(0,H.__)("Justify items left")},{value:"center",icon:C_.A,label:(0,H.__)("Justify items center")},{value:"right",icon:S_.A,label:(0,H.__)("Justify items right")}];return"horizontal"===o?a.push({value:"space-between",icon:A_.A,label:(0,H.__)("Space between items")}):a.push({value:"stretch",icon:E_.A,label:(0,H.__)("Stretch items")}),(0,jd.jsx)(xx,{__nextHasNoMarginBottom:!0,label:(0,H.__)("Justification"),value:r,onChange:i,className:"block-editor-hooks__flex-layout-justification-controls",children:a.map((({value:e,icon:t,label:n})=>(0,jd.jsx)(Ux,{value:e,icon:t,label:n},e)))})}function Dw({layout:e,onChange:t}){const{flexWrap:n="wrap"}=e;return(0,jd.jsx)(Vx.A,{__nextHasNoMarginBottom:!0,label:(0,H.__)("Allow to wrap to multiple lines"),onChange:n=>{t({...e,flexWrap:n?"wrap":"nowrap"})},checked:"wrap"===n})}function Mw({layout:e,onChange:t}){const{orientation:n="horizontal",verticalAlignment:r,justifyContent:o}=e;return(0,jd.jsxs)(xx,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,H.__)("Orientation"),value:n,onChange:n=>{let i=r,s=o;return"horizontal"===n?("space-between"===r&&(i="center"),"stretch"===o&&(s="left")):("stretch"===r&&(i="top"),"space-between"===o&&(s="left")),t({...e,orientation:n,verticalAlignment:i,justifyContent:s})},children:[(0,jd.jsx)(Ux,{icon:I_.A,value:"horizontal",label:(0,H.__)("Horizontal")}),(0,jd.jsx)(Ux,{icon:j_.A,value:"vertical",label:(0,H.__)("Vertical")})]})}const Pw={name:"default",label:(0,H.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,style:t,blockName:n,hasBlockGapSupport:r,layoutDefinitions:o=Hx}){const i=dw(t?.spacing?.blockGap);let s="";Gy(n,"spacing","blockGap")||(i?.top?s=dw(i?.top):"string"==typeof i&&(s=dw(i)));let a="";return r&&s&&(a+=Wx(e,o,"default",s)),a},getOrientation:()=>"vertical",getAlignments(e,t){const n=Gx(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:n[e]})));const r=[{name:"left"},{name:"center"},{name:"right"}];if(!t){const{contentSize:t,wideSize:o}=e;t&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:n.wide})}return r.unshift({name:"none",info:n.none}),r}},Ow="web"===Oh.A.OS,Lw={px:{value:"px",label:Ow?"px":(0,H.__)("Pixels (px)"),a11yLabel:(0,H.__)("Pixels (px)"),step:1},"%":{value:"%",label:Ow?"%":(0,H.__)("Percentage (%)"),a11yLabel:(0,H.__)("Percent (%)"),step:.1},em:{value:"em",label:Ow?"em":(0,H.__)("Relative to parent font size (em)"),a11yLabel:(0,H._x)("ems","Relative to parent font size (em)"),step:.01},rem:{value:"rem",label:Ow?"rem":(0,H.__)("Relative to root font size (rem)"),a11yLabel:(0,H._x)("rems","Relative to root font size (rem)"),step:.01},vw:{value:"vw",label:Ow?"vw":(0,H.__)("Viewport width (vw)"),a11yLabel:(0,H.__)("Viewport width (vw)"),step:.1},vh:{value:"vh",label:Ow?"vh":(0,H.__)("Viewport height (vh)"),a11yLabel:(0,H.__)("Viewport height (vh)"),step:.1},vmin:{value:"vmin",label:Ow?"vmin":(0,H.__)("Viewport smallest dimension (vmin)"),a11yLabel:(0,H.__)("Viewport smallest dimension (vmin)"),step:.1},vmax:{value:"vmax",label:Ow?"vmax":(0,H.__)("Viewport largest dimension (vmax)"),a11yLabel:(0,H.__)("Viewport largest dimension (vmax)"),step:.1},ch:{value:"ch",label:Ow?"ch":(0,H.__)("Width of the zero (0) character (ch)"),a11yLabel:(0,H.__)("Width of the zero (0) character (ch)"),step:.01},ex:{value:"ex",label:Ow?"ex":(0,H.__)("x-height of the font (ex)"),a11yLabel:(0,H.__)("x-height of the font (ex)"),step:.01},cm:{value:"cm",label:Ow?"cm":(0,H.__)("Centimeters (cm)"),a11yLabel:(0,H.__)("Centimeters (cm)"),step:.001},mm:{value:"mm",label:Ow?"mm":(0,H.__)("Millimeters (mm)"),a11yLabel:(0,H.__)("Millimeters (mm)"),step:.1},in:{value:"in",label:Ow?"in":(0,H.__)("Inches (in)"),a11yLabel:(0,H.__)("Inches (in)"),step:.001},pc:{value:"pc",label:Ow?"pc":(0,H.__)("Picas (pc)"),a11yLabel:(0,H.__)("Picas (pc)"),step:1},pt:{value:"pt",label:Ow?"pt":(0,H.__)("Points (pt)"),a11yLabel:(0,H.__)("Points (pt)"),step:1},svw:{value:"svw",label:Ow?"svw":(0,H.__)("Small viewport width (svw)"),a11yLabel:(0,H.__)("Small viewport width (svw)"),step:.1},svh:{value:"svh",label:Ow?"svh":(0,H.__)("Small viewport height (svh)"),a11yLabel:(0,H.__)("Small viewport height (svh)"),step:.1},svi:{value:"svi",label:Ow?"svi":(0,H.__)("Viewport smallest size in the inline direction (svi)"),a11yLabel:(0,H.__)("Small viewport width or height (svi)"),step:.1},svb:{value:"svb",label:Ow?"svb":(0,H.__)("Viewport smallest size in the block direction (svb)"),a11yLabel:(0,H.__)("Small viewport width or height (svb)"),step:.1},svmin:{value:"svmin",label:Ow?"svmin":(0,H.__)("Small viewport smallest dimension (svmin)"),a11yLabel:(0,H.__)("Small viewport smallest dimension (svmin)"),step:.1},lvw:{value:"lvw",label:Ow?"lvw":(0,H.__)("Large viewport width (lvw)"),a11yLabel:(0,H.__)("Large viewport width (lvw)"),step:.1},lvh:{value:"lvh",label:Ow?"lvh":(0,H.__)("Large viewport height (lvh)"),a11yLabel:(0,H.__)("Large viewport height (lvh)"),step:.1},lvi:{value:"lvi",label:Ow?"lvi":(0,H.__)("Large viewport width or height (lvi)"),a11yLabel:(0,H.__)("Large viewport width or height (lvi)"),step:.1},lvb:{value:"lvb",label:Ow?"lvb":(0,H.__)("Large viewport width or height (lvb)"),a11yLabel:(0,H.__)("Large viewport width or height (lvb)"),step:.1},lvmin:{value:"lvmin",label:Ow?"lvmin":(0,H.__)("Large viewport smallest dimension (lvmin)"),a11yLabel:(0,H.__)("Large viewport smallest dimension (lvmin)"),step:.1},dvw:{value:"dvw",label:Ow?"dvw":(0,H.__)("Dynamic viewport width (dvw)"),a11yLabel:(0,H.__)("Dynamic viewport width (dvw)"),step:.1},dvh:{value:"dvh",label:Ow?"dvh":(0,H.__)("Dynamic viewport height (dvh)"),a11yLabel:(0,H.__)("Dynamic viewport height (dvh)"),step:.1},dvi:{value:"dvi",label:Ow?"dvi":(0,H.__)("Dynamic viewport width or height (dvi)"),a11yLabel:(0,H.__)("Dynamic viewport width or height (dvi)"),step:.1},dvb:{value:"dvb",label:Ow?"dvb":(0,H.__)("Dynamic viewport width or height (dvb)"),a11yLabel:(0,H.__)("Dynamic viewport width or height (dvb)"),step:.1},dvmin:{value:"dvmin",label:Ow?"dvmin":(0,H.__)("Dynamic viewport smallest dimension (dvmin)"),a11yLabel:(0,H.__)("Dynamic viewport smallest dimension (dvmin)"),step:.1},dvmax:{value:"dvmax",label:Ow?"dvmax":(0,H.__)("Dynamic viewport largest dimension (dvmax)"),a11yLabel:(0,H.__)("Dynamic viewport largest dimension (dvmax)"),step:.1},svmax:{value:"svmax",label:Ow?"svmax":(0,H.__)("Small viewport largest dimension (svmax)"),a11yLabel:(0,H.__)("Small viewport largest dimension (svmax)"),step:.1},lvmax:{value:"lvmax",label:Ow?"lvmax":(0,H.__)("Large viewport largest dimension (lvmax)"),a11yLabel:(0,H.__)("Large viewport largest dimension (lvmax)"),step:.1}},Fw=Object.values(Lw),zw=[Lw.px,Lw["%"],Lw.em,Lw.rem,Lw.vw,Lw.vh],Uw=Lw.px;function Vw(e,t,n){return $w(t?`${null!=e?e:""}${t}`:e,n)}function Hw(e){return Array.isArray(e)&&!!e.length}function $w(e,t=Fw){let n,r;if(void 0!==e||null===e){n=`${e}`.trim();const t=parseFloat(n);r=isFinite(t)?t:void 0}const o=n?.match(/[\d.\-\+]*\s*(.*)/),i=o?.[1]?.toLowerCase();let s;if(Hw(t)){const e=t.find((e=>e.value===i));s=e?.value}else s=Uw.value;return[r,s]}const Ww=({units:e=Fw,availableUnits:t=[],defaultValues:n})=>{const r=function(e=[],t){return Array.isArray(t)?t.filter((t=>e.includes(t.value))):[]}(t,e);return n&&r.forEach(((e,t)=>{if(n[e.value]){const[o]=$w(n[e.value]);r[t].default=o}})),r};var Gw=n(2711),qw=n(28795),Kw=n(31110),Yw=n(34579);const Jw=(0,$_.default)(qw.A,{target:"e1bagdl32"})("&&&{input{display:block;width:100%;}",Kw.Hr,"{transition:box-shadow 0.1s linear;}}"),Xw=({selectSize:e})=>({small:(0,W_.css)("box-sizing:border-box;padding:2px 1px;width:20px;color:",G_.l.gray[800],";font-size:8px;line-height:1;letter-spacing:-0.5px;text-transform:uppercase;text-align-last:center;",""),default:(0,W_.css)("box-sizing:border-box;min-width:24px;max-width:48px;height:24px;margin-inline-end:",(0,Yw.x)(2),";padding:",(0,Yw.x)(1),";color:",G_.l.theme.accent,";font-size:13px;line-height:1;text-align-last:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;","")}[e]),Zw=(0,$_.default)("div",{target:"e1bagdl31"})("&&&{pointer-events:none;",Xw,";color:",G_.l.gray[900],";}"),Qw=({selectSize:e="default"})=>({small:(0,W_.css)("height:100%;border:1px solid transparent;transition:box-shadow 0.1s linear,border 0.1s linear;",(0,Gw.h)({borderTopLeftRadius:0,borderBottomLeftRadius:0})()," &:not(:disabled):hover{background-color:",G_.l.gray[100],";}&:focus{border:1px solid ",G_.l.ui.borderFocus,";box-shadow:inset 0 0 0 ",q_.A.borderWidth+" "+G_.l.ui.borderFocus,";outline-offset:0;outline:2px solid transparent;z-index:1;}",""),default:(0,W_.css)("display:flex;justify-content:center;align-items:center;&:hover{color:",G_.l.ui.borderFocus,";box-shadow:inset 0 0 0 ",q_.A.borderWidth+" "+G_.l.ui.borderFocus,";outline:",q_.A.borderWidth," solid transparent;}&:focus{box-shadow:0 0 0 ",q_.A.borderWidthFocus+" "+G_.l.ui.borderFocus,";outline:",q_.A.borderWidthFocus," solid transparent;}","")}[e]),ek=(0,$_.default)("select",{target:"e1bagdl30"})("&&&{appearance:none;background:transparent;border-radius:2px;border:none;display:block;outline:none;margin:0;min-height:auto;font-family:inherit;",Xw,";",Qw,";&:not( :disabled ){cursor:pointer;}}"),tk=(0,k.forwardRef)((function({className:e,isUnitSelectTabbable:t=!0,onChange:n,size:r="default",unit:o="px",units:i=zw,...s},a){if(!Hw(i)||1===i?.length)return(0,jd.jsx)(Zw,{className:"components-unit-control__unit-label",selectSize:r,children:o});const l=(0,Hy.A)("components-unit-control__select",e);return(0,jd.jsx)(ek,{ref:a,className:l,onChange:e=>{const{value:t}=e.target,r=i.find((e=>e.value===t));n?.(t,{event:e,data:r})},selectSize:r,tabIndex:t?void 0:-1,value:o,...s,children:i.map((e=>(0,jd.jsx)("option",{value:e.value,children:e.label},e.value)))})}));var nk=n(31084),rk=n(94647),ok=n(90309);const ik=(0,k.forwardRef)((function(e,t){const{__unstableStateReducer:n,autoComplete:r="off",children:o,className:i,disabled:s=!1,disableUnits:a=!1,isPressEnterToChange:l=!1,isResetValueOnUnitChange:c=!1,isUnitSelectTabbable:u=!0,label:d,onChange:h,onUnitChange:p,size:f="default",unit:m,units:g=zw,value:b,onFocus:v,...y}=(0,ok.R)(e);"unit"in e&&(0,q.default)("UnitControl unit prop",{since:"5.6",hint:"The unit should be provided within the `value` prop.",version:"6.2"});const _=null!=b?b:void 0,[x,w]=(0,k.useMemo)((()=>{const e=function(e,t,n=Fw){const r=Array.isArray(n)?[...n]:[],[,o]=Vw(e,t,Fw);return o&&!r.some((e=>e.value===o))&&Lw[o]&&r.unshift(Lw[o]),r}(_,m,g),[{value:t=""}={},...n]=e,r=n.reduce(((e,{value:t})=>{const n=(0,rk.Nt)(t?.substring(0,1)||"");return e.includes(n)?e:`${e}|${n}`}),(0,rk.Nt)(t.substring(0,1)));return[e,new RegExp(`^(?:${r})$`,"i")]}),[_,m,g]),[C,S]=Vw(_,m,x),[A,E]=(0,nk.A)(1===x.length?x[0].value:m,{initial:S,fallback:""});(0,k.useEffect)((()=>{void 0!==S&&E(S)}),[S,E]);const I=(0,Hy.A)("components-unit-control","components-unit-control-wrapper",i);let j;!a&&u&&x.length&&(j=e=>{y.onKeyDown?.(e),!e.metaKey&&w.test(e.key)&&T.current?.focus()});const T=(0,k.useRef)(null),B=a?null:(0,jd.jsx)(tk,{ref:T,"aria-label":(0,H.__)("Select unit"),disabled:s,isUnitSelectTabbable:u,onChange:(e,t)=>{const{data:n}=t;let r=`${null!=C?C:""}${e}`;c&&void 0!==n?.default&&(r=`${n.default}${e}`),h?.(r,t),p?.(e,t),E(e)},size:["small","compact"].includes(f)||"default"===f&&!y.__next40pxDefaultSize?"small":"default",unit:A,units:x,onFocus:v,onBlur:e.onBlur});let R=y.step;if(!R&&x){var N;const e=x.find((e=>e.value===A));R=null!==(N=e?.step)&&void 0!==N?N:1}return(0,jd.jsx)(Jw,{...y,autoComplete:r,className:I,disabled:s,spinControls:"none",isPressEnterToChange:l,label:d,onKeyDown:j,onChange:(e,t)=>{if(""===e||null==e)return void h?.("",t);const n=function(e,t,n,r){const[o,i]=$w(e,t),s=null!=o?o:n;let a=i||r;return!a&&Hw(t)&&(a=t[0].value),[s,a]}(e,x,C,A).join("");h?.(n,t)},ref:t,size:f,suffix:B,type:l?"text":"number",value:null!=C?C:"",step:R,onFocus:v,__unstableStateReducer:n})})),sk=ik;var ak=n(77780),lk=n(29791),ck=n(59473),uk=n(11789);const dk="var:",hk="|",pk="--",fk=(e,t)=>{let n=e;return t.forEach((e=>{n=n?.[e]})),n};function mk(e,t,n,r){const o=fk(e,n);return o?[{selector:t?.selector,key:r,value:bk(o)}]:[]}function gk(e,t,n,r,o=["top","right","bottom","left"]){const i=fk(e,n);if(!i)return[];const s=[];if("string"==typeof i)s.push({selector:t?.selector,key:r.default,value:i});else{const e=o.reduce(((e,n)=>{const o=bk(fk(i,[n]));return o&&e.push({selector:t?.selector,key:r?.individual.replace("%s",vk(n)),value:o}),e}),[]);s.push(...e)}return s}function bk(e){return"string"==typeof e&&e.startsWith(dk)?`var(--wp--${e.slice(dk.length).split(hk).map((e=>(0,uk.c)(e,{splitRegexp:[/([a-z0-9])([A-Z])/g,/([0-9])([a-z])/g,/([A-Za-z])([0-9])/g,/([A-Z])([A-Z][a-z])/g]}))).join(pk)})`:e}function vk(e){const[t,...n]=e;return t.toUpperCase()+n.join("")}function yk(e){try{return decodeURI(e)}catch(t){return e}}function _k(e){return(t,n)=>mk(t,n,e,function(e){const[t,...n]=e;return t.toLowerCase()+n.map(vk).join("")}(e))}function xk(e){return(t,n)=>["color","style","width"].flatMap((r=>_k(["border",e,r])(t,n)))}const wk={name:"radius",generate:(e,t)=>gk(e,t,["border","radius"],{default:"borderRadius",individual:"border%sRadius"},["topLeft","topRight","bottomLeft","bottomRight"])},kk={name:"background",generate:(e,t)=>mk(e,t,["color","background"],"backgroundColor")},Ck={name:"gradient",generate:(e,t)=>mk(e,t,["color","gradient"],"background")},Sk={name:"text",generate:(e,t)=>mk(e,t,["color","text"],"color")},Ak={name:"minHeight",generate:(e,t)=>mk(e,t,["dimensions","minHeight"],"minHeight")},Ek={name:"aspectRatio",generate:(e,t)=>mk(e,t,["dimensions","aspectRatio"],"aspectRatio")},Ik={name:"backgroundImage",generate:(e,t)=>{const n=e?.background?.backgroundImage;return"object"==typeof n&&n?.url?[{selector:t.selector,key:"backgroundImage",value:`url( '${encodeURI(yk(n.url))}' )`}]:"string"==typeof n?mk(e,t,["background","backgroundImage"],"backgroundImage"):[]}},jk={name:"backgroundPosition",generate:(e,t)=>mk(e,t,["background","backgroundPosition"],"backgroundPosition")},Tk={name:"backgroundRepeat",generate:(e,t)=>mk(e,t,["background","backgroundRepeat"],"backgroundRepeat")},Bk={name:"backgroundSize",generate:(e,t)=>mk(e,t,["background","backgroundSize"],"backgroundSize")},Rk={name:"shadow",generate:(e,t)=>mk(e,t,["shadow"],"boxShadow")},Nk={name:"color",generate:(e,t,n=["outline","color"],r="outlineColor")=>mk(e,t,n,r)},Dk={name:"offset",generate:(e,t,n=["outline","offset"],r="outlineOffset")=>mk(e,t,n,r)},Mk={name:"style",generate:(e,t,n=["outline","style"],r="outlineStyle")=>mk(e,t,n,r)},Pk={name:"width",generate:(e,t,n=["outline","width"],r="outlineWidth")=>mk(e,t,n,r)},Ok={name:"padding",generate:(e,t)=>gk(e,t,["spacing","padding"],{default:"padding",individual:"padding%s"})},Lk={name:"margin",generate:(e,t)=>gk(e,t,["spacing","margin"],{default:"margin",individual:"margin%s"})},Fk={name:"fontSize",generate:(e,t)=>mk(e,t,["typography","fontSize"],"fontSize")},zk={name:"fontStyle",generate:(e,t)=>mk(e,t,["typography","fontStyle"],"fontStyle")},Uk={name:"fontWeight",generate:(e,t)=>mk(e,t,["typography","fontWeight"],"fontWeight")},Vk={name:"fontFamily",generate:(e,t)=>mk(e,t,["typography","fontFamily"],"fontFamily")},Hk={name:"letterSpacing",generate:(e,t)=>mk(e,t,["typography","letterSpacing"],"letterSpacing")},$k={name:"lineHeight",generate:(e,t)=>mk(e,t,["typography","lineHeight"],"lineHeight")},Wk={name:"textColumns",generate:(e,t)=>mk(e,t,["typography","textColumns"],"columnCount")},Gk={name:"textDecoration",generate:(e,t)=>mk(e,t,["typography","textDecoration"],"textDecoration")},qk={name:"textTransform",generate:(e,t)=>mk(e,t,["typography","textTransform"],"textTransform")},Kk={name:"writingMode",generate:(e,t)=>mk(e,t,["typography","writingMode"],"writingMode")},Yk=[{name:"color",generate:_k(["border","color"])},{name:"style",generate:_k(["border","style"])},{name:"width",generate:_k(["border","width"])},wk,{name:"borderTop",generate:xk("top")},{name:"borderRight",generate:xk("right")},{name:"borderBottom",generate:xk("bottom")},{name:"borderLeft",generate:xk("left")},Sk,Ck,kk,Ak,Ek,Nk,Mk,Dk,Pk,Lk,Ok,Vk,Fk,zk,Uk,Hk,$k,Wk,Gk,qk,Kk,Rk,Ik,jk,Tk,Bk];function Jk(e,t={}){const n=Xk(e,t);if(!t?.selector){const e=[];return n.forEach((t=>{e.push(`${(0,uk.c)(t.key)}: ${t.value};`)})),e.join(" ")}const r=n.reduce(((e,t)=>{const{selector:n}=t;return n?(e[n]||(e[n]=[]),e[n].push(t),e):e}),{});return Object.keys(r).reduce(((e,t)=>(e.push(`${t} { ${r[t].map((e=>`${(0,uk.c)(e.key)}: ${e.value};`)).join(" ")} }`),e)),[]).join("\n")}function Xk(e,t={}){const n=[];return Yk.forEach((r=>{"function"==typeof r.generate&&n.push(...r.generate(e,t))})),n}const Zk={name:"constrained",label:(0,H.__)("Constrained"),inspectorControls:function({layout:e,onChange:t,layoutBlockSupport:n={}}){const{wideSize:r,contentSize:o,justifyContent:i="center"}=e,{allowJustification:s=!0,allowCustomContentAndWideSize:a=!0}=n,l=[{value:"left",icon:k_.A,label:(0,H.__)("Justify items left")},{value:"center",icon:C_.A,label:(0,H.__)("Justify items center")},{value:"right",icon:S_.A,label:(0,H.__)("Justify items right")}],[c]=py("spacing.units"),u=Ww({availableUnits:c||["%","px","em","rem","vw"]});return(0,jd.jsxs)(jd.Fragment,{children:[a&&(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsxs)("div",{className:"block-editor-hooks__layout-controls",children:[(0,jd.jsxs)("div",{className:"block-editor-hooks__layout-controls-unit",children:[(0,jd.jsx)(sk,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,H.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,contentSize:n})},units:u}),(0,jd.jsx)(ak.A,{icon:lk.A})]}),(0,jd.jsxs)("div",{className:"block-editor-hooks__layout-controls-unit",children:[(0,jd.jsx)(sk,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,H.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,wideSize:n})},units:u}),(0,jd.jsx)(ak.A,{icon:ck.A})]})]}),(0,jd.jsx)("p",{className:"block-editor-hooks__layout-controls-helptext",children:(0,H.__)("Customize the width for all elements that are assigned to the center or wide columns.")})]}),s&&(0,jd.jsx)(xx,{__nextHasNoMarginBottom:!0,label:(0,H.__)("Justification"),value:i,onChange:n=>{t({...e,justifyContent:n})},children:l.map((({value:e,icon:t,label:n})=>(0,jd.jsx)(Ux,{value:e,icon:t,label:n},e)))})]})},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,layout:t={},style:n,blockName:r,hasBlockGapSupport:o,layoutDefinitions:i=Hx}){const{contentSize:s,wideSize:a,justifyContent:l}=t,c=dw(n?.spacing?.blockGap);let u="";Gy(r,"spacing","blockGap")||(c?.top?u=dw(c?.top):"string"==typeof c&&(u=dw(c)));const d="left"===l?"0 !important":"auto !important",h="right"===l?"0 !important":"auto !important";let p=s||a?`\n\t\t\t\t\t${$x(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=s?s:a};\n\t\t\t\t\t\tmargin-left: ${d};\n\t\t\t\t\t\tmargin-right: ${h};\n\t\t\t\t\t}\n\t\t\t\t\t${$x(e,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=a?a:s};\n\t\t\t\t\t}\n\t\t\t\t\t${$x(e,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return"left"===l?p+=`${$x(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${d}; }`:"right"===l&&(p+=`${$x(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${h}; }`),n?.spacing?.padding&&Xk(n).forEach((t=>{"paddingRight"===t.key?p+=`\n\t\t\t\t\t${$x(e,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${t.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`:"paddingLeft"===t.key&&(p+=`\n\t\t\t\t\t${$x(e,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${t.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`)})),o&&u&&(p+=Wx(e,i,"constrained",u)),p},getOrientation:()=>"vertical",getAlignments(e){const t=Gx(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:r}=e,o=[{name:"left"},{name:"center"},{name:"right"}];return n&&o.unshift({name:"full"}),r&&o.unshift({name:"wide",info:t.wide}),o.unshift({name:"none",info:t.none}),o}};var Qk=n(78128),eC=n(75015);function tC(e,t,n){return"number"!=typeof e?null:parseFloat(`${(0,eC.qE)(e,t,n)}`)}const nC=()=>(0,W_.css)({height:30,minHeight:30},"",""),rC=({__next40pxDefaultSize:e})=>!e&&(0,W_.css)({minHeight:30},"",""),oC=(0,$_.default)("div",{target:"e1epgpqk14"})("-webkit-tap-highlight-color:transparent;align-items:center;display:flex;justify-content:flex-start;padding:0;position:relative;touch-action:none;width:100%;min-height:40px;",rC,";"),iC=({color:e=G_.l.ui.borderFocus})=>(0,W_.css)({color:e},"",""),sC=({marks:e,__nextHasNoMarginBottom:t})=>t?"":(0,W_.css)({marginBottom:e?16:void 0},"",""),aC=(0,$_.default)("div",{target:"e1epgpqk13"})("display:block;flex:1;position:relative;width:100%;",iC,";",nC,";",sC,";"),lC=(0,$_.default)("span",{target:"e1epgpqk12"})("display:flex;margin-top:",4,"px;",(0,Gw.h)({marginRight:6}),";"),cC=(0,$_.default)("span",{target:"e1epgpqk11"})("display:flex;margin-top:",4,"px;",(0,Gw.h)({marginLeft:6}),";"),uC=({disabled:e,railColor:t})=>{let n=t||"";return e&&(n=G_.l.ui.backgroundDisabled),(0,W_.css)({background:n},"","")},dC=(0,$_.default)("span",{target:"e1epgpqk10"})("background-color:",G_.l.gray[300],";left:0;pointer-events:none;right:0;display:block;height:",4,"px;position:absolute;margin-top:",13,"px;top:0;border-radius:",4,"px;",uC,";"),hC=({disabled:e,trackColor:t})=>{let n=t||"currentColor";return e&&(n=G_.l.gray[400]),(0,W_.css)({background:n},"","")},pC=(0,$_.default)("span",{target:"e1epgpqk9"})("background-color:currentColor;border-radius:",4,"px;height:",4,"px;pointer-events:none;display:block;position:absolute;margin-top:",13,"px;top:0;",hC,";"),fC=(0,$_.default)("span",{target:"e1epgpqk8"})({name:"l7tjj5",styles:"display:block;pointer-events:none;position:relative;width:100%;user-select:none"}),mC=({disabled:e,isFilled:t})=>{let n=t?"currentColor":G_.l.gray[300];return e&&(n=G_.l.gray[400]),(0,W_.css)({backgroundColor:n},"","")},gC=(0,$_.default)("span",{target:"e1epgpqk7"})("height:",12,"px;left:0;position:absolute;top:-4px;width:1px;",mC,";"),bC=({isFilled:e})=>(0,W_.css)({color:e?G_.l.gray[700]:G_.l.gray[300]},"",""),vC=(0,$_.default)("span",{target:"e1epgpqk6"})("color:",G_.l.gray[300],";left:0;font-size:11px;position:absolute;top:12px;transform:translateX( -50% );white-space:nowrap;",bC,";"),yC=({disabled:e})=>e?(0,W_.css)("background-color:",G_.l.gray[400],";",""):(0,W_.css)("background-color:",G_.l.theme.accent,";",""),_C=(0,$_.default)("span",{target:"e1epgpqk5"})("align-items:center;display:flex;height:",12,"px;justify-content:center;margin-top:",9,"px;outline:0;pointer-events:none;position:absolute;top:0;user-select:none;width:",12,"px;border-radius:50%;",yC,";",(0,Gw.h)({marginLeft:-10}),";",(0,Gw.h)({transform:"translateX( 4.5px )"},{transform:"translateX( -4.5px )"}),";"),xC=({isFocused:e})=>e?(0,W_.css)("&::before{content:' ';position:absolute;background-color:",G_.l.theme.accent,";opacity:0.4;border-radius:50%;height:",20,"px;width:",20,"px;top:-4px;left:-4px;}",""):"",wC=(0,$_.default)("span",{target:"e1epgpqk4"})("align-items:center;border-radius:50%;height:100%;outline:0;position:absolute;user-select:none;width:100%;",yC,";",xC,";"),kC=(0,$_.default)("input",{target:"e1epgpqk3"})("box-sizing:border-box;cursor:pointer;display:block;height:100%;left:0;margin:0 -",6,"px;opacity:0;outline:none;position:absolute;right:0;top:0;width:calc( 100% + ",12,"px );"),CC=({show:e})=>(0,W_.css)({opacity:e?1:0},"","");var SC={name:"1cypxip",styles:"top:-80%"},AC={name:"1lr98c4",styles:"bottom:-80%"};const EC=({position:e})=>"bottom"===e?AC:SC,IC=(0,$_.default)("span",{target:"e1epgpqk2"})("background:rgba( 0, 0, 0, 0.8 );border-radius:2px;color:white;display:inline-block;font-size:12px;min-width:32px;opacity:0;padding:4px 8px;pointer-events:none;position:absolute;text-align:center;user-select:none;line-height:1.4;@media not ( prefers-reduced-motion ){transition:opacity 120ms ease;}",CC,";",EC,";",(0,Gw.h)({transform:"translateX(-50%)"},{transform:"translateX(50%)"}),";"),jC=(0,$_.default)(qw.A,{target:"e1epgpqk1"})("display:inline-block;font-size:13px;margin-top:0;input[type='number']&{",nC,";}",(0,Gw.h)({marginLeft:`${(0,Yw.x)(4)} !important`}),";"),TC=(0,$_.default)("span",{target:"e1epgpqk0"})("display:block;margin-top:0;button,button.is-small{margin-left:0;",nC,";}",(0,Gw.h)({marginLeft:8}),";"),BC=(0,k.forwardRef)((function(e,t){const{describedBy:n,label:r,value:o,...i}=e;return(0,jd.jsx)(kC,{...i,"aria-describedby":n,"aria-label":r,"aria-hidden":!1,ref:t,tabIndex:0,type:"range",value:o})}));function RC(e){const{className:t,isFilled:n=!1,label:r,style:o={},...i}=e,s=(0,Hy.A)("components-range-control__mark",n&&"is-filled",t),a=(0,Hy.A)("components-range-control__mark-label",n&&"is-filled");return(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsx)(gC,{...i,"aria-hidden":"true",className:s,isFilled:n,style:o}),r&&(0,jd.jsx)(vC,{"aria-hidden":"true",className:a,isFilled:n,style:o,children:r})]})}function NC(e){const{disabled:t=!1,marks:n=!1,min:r=0,max:o=100,step:i=1,value:s=0,...a}=e;return(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsx)(dC,{disabled:t,...a}),n&&(0,jd.jsx)(DC,{disabled:t,marks:n,min:r,max:o,step:i,value:s})]})}function DC(e){const{disabled:t=!1,marks:n=!1,min:r=0,max:o=100,step:i=1,value:s=0}=e,a=function({marks:e,min:t=0,max:n=100,step:r=1,value:o=0}){if(!e)return[];const i=n-t;if(!Array.isArray(e)){e=[];const n=1+Math.round(i/r);for(;n>e.push({value:r*e.length+t}););}const s=[];return e.forEach(((e,r)=>{if(e.valuen)return;const a=`mark-${r}`,l=e.value<=o,c=(e.value-t)/i*100+"%",u={[(0,H.isRTL)()?"right":"left"]:c};s.push({...e,isFilled:l,key:a,style:u})})),s}({marks:n,min:r,max:o,step:"any"===i?1:i,value:s});return(0,jd.jsx)(fC,{"aria-hidden":"true",className:"components-range-control__marks",children:a.map((e=>(0,k.createElement)(RC,{...e,key:e.key,"aria-hidden":"true",disabled:t})))})}function MC(e){const{className:t,inputRef:n,tooltipPosition:r,show:o=!1,style:i={},value:s=0,renderTooltipContent:a=(e=>e),zIndex:l=100,...c}=e,u=function({inputRef:e,tooltipPosition:t}){const[n,r]=(0,k.useState)(),o=(0,k.useCallback)((()=>{e&&e.current&&r(t)}),[t,e]);return(0,k.useEffect)((()=>{o()}),[o]),(0,k.useEffect)((()=>(window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}))),n}({inputRef:n,tooltipPosition:r}),d=(0,Hy.A)("components-simple-tooltip",t),h={...i,zIndex:l};return(0,jd.jsx)(IC,{...c,"aria-hidden":o,className:d,position:u,show:o,role:"tooltip",style:h,children:a(s)})}const PC=()=>{},OC=(0,k.forwardRef)((function e(t,n){const{__nextHasNoMarginBottom:r=!1,afterIcon:o,allowReset:i=!1,beforeIcon:s,className:a,color:l=G_.l.theme.accent,currentInput:c,disabled:u=!1,help:d,hideLabelFromVision:h=!1,initialPosition:p,isShiftStepEnabled:f=!0,label:m,marks:g=!1,max:b=100,min:v=0,onBlur:y=PC,onChange:_=PC,onFocus:x=PC,onMouseLeave:w=PC,onMouseMove:C=PC,railColor:S,renderTooltipContent:A=(e=>e),resetFallbackValue:E,__next40pxDefaultSize:I=!1,shiftStep:j=10,showTooltip:T,step:B=1,trackColor:R,value:N,withInputField:D=!0,...M}=t,[P,O]=function(e){const{min:t,max:n,value:r,initial:o}=e,[i,s]=(0,nk.A)(tC(r,t,n),{initial:tC(null!=o?o:null,t,n),fallback:null});return[i,(0,k.useCallback)((e=>{s(null===e?null:tC(e,t,n))}),[t,n,s])]}({min:v,max:b,value:null!=N?N:null,initial:p}),L=(0,k.useRef)(!1);let F=T,z=D;"any"===B&&(F=!1,z=!1);const[U,V]=(0,k.useState)(F),[$,W]=(0,k.useState)(!1),G=(0,k.useRef)(),q=G.current?.matches(":focus"),K=!u&&$,Y=null===P,J=Y?"":void 0!==P?P:c,X=Y?(b-v)/2+v:P,Z=Y?50:(P-v)/(b-v)*100,Q=`${(0,eC.qE)(Z,0,100)}%`,ee=(0,Hy.A)("components-range-control",a),te=(0,Hy.A)("components-range-control__wrapper",!!g&&"is-marked"),ne=(0,F_.A)(e,"inspector-range-control"),re=d?`${ne}__help`:void 0,oe=!1!==F&&Number.isFinite(P),ie=()=>{let e=parseFloat(`${E}`),t=e;isNaN(e)&&(e=null,t=void 0),O(e),_(t)},se={[(0,H.isRTL)()?"right":"left"]:Q};return(0,jd.jsx)(H_.Ay,{__nextHasNoMarginBottom:r,className:ee,label:m,hideLabelFromVision:h,id:`${ne}`,help:d,children:(0,jd.jsxs)(oC,{className:"components-range-control__root",__next40pxDefaultSize:I,children:[s&&(0,jd.jsx)(lC,{children:(0,jd.jsx)(zx.A,{icon:s})}),(0,jd.jsxs)(aC,{__nextHasNoMarginBottom:r,className:te,color:l,marks:!!g,children:[(0,jd.jsx)(BC,{...M,className:"components-range-control__slider",describedBy:re,disabled:u,id:`${ne}`,label:m,max:b,min:v,onBlur:e=>{y(e),W(!1),V(!1)},onChange:e=>{const t=parseFloat(e.target.value);O(t),_(t)},onFocus:e=>{x(e),W(!0),V(!0)},onMouseMove:C,onMouseLeave:w,ref:(0,Qk.A)([G,n]),step:B,value:null!=J?J:void 0}),(0,jd.jsx)(NC,{"aria-hidden":!0,disabled:u,marks:g,max:b,min:v,railColor:S,step:B,value:X}),(0,jd.jsx)(pC,{"aria-hidden":!0,className:"components-range-control__track",disabled:u,style:{width:Q},trackColor:R}),(0,jd.jsx)(_C,{className:"components-range-control__thumb-wrapper",style:se,disabled:u,children:(0,jd.jsx)(wC,{"aria-hidden":!0,isFocused:K,disabled:u})}),oe&&(0,jd.jsx)(MC,{className:"components-range-control__tooltip",inputRef:G,tooltipPosition:"bottom",renderTooltipContent:A,show:q||U,style:se,value:P})]}),o&&(0,jd.jsx)(cC,{children:(0,jd.jsx)(zx.A,{icon:o})}),z&&(0,jd.jsx)(jC,{"aria-label":m,className:"components-range-control__number",disabled:u,inputMode:"decimal",isShiftStepEnabled:f,max:b,min:v,onBlur:()=>{L.current&&(ie(),L.current=!1)},onChange:e=>{let t=parseFloat(e);O(t),isNaN(t)?i&&(L.current=!0):((tb)&&(t=tC(t,v,b)),_(t),L.current=!1)},shiftStep:j,size:I?"__unstable-large":"default",__unstableInputWidth:I?(0,Yw.x)(20):(0,Yw.x)(16),step:B,value:J}),i&&(0,jd.jsx)(TC,{children:(0,jd.jsx)(Xy.Ay,{className:"components-range-control__reset",disabled:u||void 0===P,variant:"secondary",size:"small",onClick:ie,children:(0,H.__)("Reset")})})]})})})),LC=OC,FC=(0,k.forwardRef)((function(e,t){const{label:n,...r}=e,o=r["aria-label"]||n;return(0,jd.jsx)(Fx,{...r,"aria-label":o,ref:t,children:n})}));var zC=n(47116),UC=n(71642);const VC=(0,k.createContext)({refsMap:(0,UC.u)()});function HC({children:e}){const t=(0,k.useMemo)((()=>({refsMap:(0,UC.u)()})),[]);return(0,jd.jsx)(VC.Provider,{value:t,children:e})}function $C(e){const{refsMap:t}=(0,k.useContext)(VC);return(0,zC.A)((n=>(t.set(e,n),()=>t.delete(e))),[e])}function WC(e){const{refsMap:t}=(0,k.useContext)(VC),n=(0,k.useRef)();return n.current=e,(0,k.useMemo)((()=>({get current(){var e;return null!==(e=t.get(n.current))&&void 0!==e?e:null}})),[t])}function GC(e){var t;const{refsMap:n}=(0,k.useContext)(VC);return null!==(t=(0,d_.A)(n,e))&&void 0!==t?t:null}var qC=n(15915);const KC=function(e){return(0,zC.A)((t=>{if(!e)return;function n(t){const{deltaX:n,deltaY:r}=t;e.current.scrollBy(n,r)}const r={passive:!0};return t.addEventListener("wheel",n,r),()=>{t.removeEventListener("wheel",n,r)}}),[e])},YC=Number.MAX_SAFE_INTEGER,JC=(0,k.forwardRef)((function({clientId:e,bottomClientId:t,children:n,__unstablePopoverSlot:r,__unstableContentRef:o,shift:i=!0,...s},a){const l=GC(e),c=GC(null!=t?t:e),u=(0,Qk.A)([a,KC(o)]),[d,h]=(0,k.useReducer)((e=>(e+1)%YC),0);(0,k.useLayoutEffect)((()=>{if(!l)return;const e=new window.MutationObserver(h);return e.observe(l,{attributes:!0}),()=>{e.disconnect()}}),[l]);const p=(0,k.useMemo)((()=>{if(!(d<0||!l||t&&!c))return{getBoundingClientRect(){var e,t,n,r;const o=l.getBoundingClientRect(),i=c?.getBoundingClientRect(),s=Math.min(o.left,null!==(e=i?.left)&&void 0!==e?e:1/0),a=Math.min(o.top,null!==(t=i?.top)&&void 0!==t?t:1/0),u=Math.max(o.right,null!==(n=i.right)&&void 0!==n?n:-1/0)-s,d=Math.max(o.bottom,null!==(r=i.bottom)&&void 0!==r?r:-1/0)-a;return new window.DOMRect(s,a,u,d)},contextElement:l}}),[t,c,l,d]);return!l||t&&!c?null:(0,jd.jsx)(qC.Ay,{ref:u,animate:!1,focusOnMount:!1,anchor:p,__unstableSlotName:r,inline:!r,placement:"top-start",resize:!1,flip:!1,shift:i,...s,className:(0,Hy.A)("block-editor-block-popover",s.className),variant:"unstyled",children:n})})),XC=(0,k.forwardRef)((({clientId:e,bottomClientId:t,children:n,...r},o)=>(0,jd.jsx)(JC,{...r,bottomClientId:t,clientId:e,__unstableContentRef:void 0,__unstablePopoverSlot:void 0,ref:o,children:n})));function ZC({selectedElement:e,additionalStyles:t={},children:n}){const[r,o]=(0,k.useState)(e.offsetWidth),[i,s]=(0,k.useState)(e.offsetHeight);(0,k.useEffect)((()=>{const t=new window.ResizeObserver((()=>{o(e.offsetWidth),s(e.offsetHeight)}));return t.observe(e,{box:"border-box"}),()=>t.disconnect()}),[e]);const a=(0,k.useMemo)((()=>({position:"absolute",width:r,height:i,...t})),[r,i,t]);return(0,jd.jsx)("div",{style:a,children:n})}const QC=(0,k.forwardRef)((function({clientId:e,bottomClientId:t,children:n,shift:r=!1,additionalStyles:o,...i},s){var a;null!==(a=t)&&void 0!==a||(t=e);const l=GC(e);return(0,jd.jsx)(JC,{ref:s,clientId:e,bottomClientId:t,shift:r,...i,children:l&&e===t?(0,jd.jsx)(ZC,{selectedElement:l,additionalStyles:o,children:n}):n})}));function eS(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function tS({clientId:e,contentRef:t}){const n=(0,Ul.A)((e=>e(dy).getSettings().isDistractionFree),[]),r=GC(e);return n||!r?null:(0,jd.jsx)(QC,{className:"block-editor-grid-visualizer",clientId:e,__unstablePopoverSlot:"block-toolbar",children:(0,jd.jsx)(nS,{ref:t,blockElement:r})})}const nS=(0,k.forwardRef)((({blockElement:e},t)=>{const[n,r]=(0,k.useState)((()=>rS(e)));return(0,k.useEffect)((()=>{const t=[];for(const n of[e,...e.children]){const o=new window.ResizeObserver((()=>{r(rS(e))}));o.observe(n),t.push(o)}return()=>{for(const e of t)e.disconnect()}}),[e]),(0,jd.jsx)("div",{ref:t,className:"block-editor-grid-visualizer__grid",style:n.style,children:Array.from({length:n.numItems},((e,t)=>(0,jd.jsx)("div",{className:"block-editor-grid-visualizer__item",style:{boxShadow:`inset 0 0 0 1px color-mix(in srgb, ${n.currentColor} 20%, #0000)`}},t)))})}));function rS(e){const t=eS(e,"grid-template-columns"),n=eS(e,"grid-template-rows");return{numItems:t.split(" ").length*n.split(" ").length,currentColor:eS(e,"color"),style:{gridTemplateColumns:t,gridTemplateRows:n,gap:eS(e,"gap"),padding:eS(e,"padding")}}}const oS={px:600,"%":100,vw:100,vh:100,em:38,rem:38,svw:100,lvw:100,dvw:100,svh:100,lvh:100,dvh:100,vi:100,svi:100,lvi:100,dvi:100,vb:100,svb:100,lvb:100,dvb:100,vmin:100,svmin:100,lvmin:100,dvmin:100,vmax:100,svmax:100,lvmax:100,dvmax:100},iS=[{value:"px",label:"px",default:0},{value:"rem",label:"rem",default:0},{value:"em",label:"em",default:0}],sS={name:"grid",label:(0,H.__)("Grid"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowSizingOnChildren:r=!1}=n;return(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsx)(cS,{layout:e,onChange:t}),e?.columnCount?(0,jd.jsx)(lS,{layout:e,onChange:t,allowSizingOnChildren:r}):(0,jd.jsx)(aS,{layout:e,onChange:t})]})},toolBarControls:function({clientId:e}){return(0,jd.jsx)(tS,{clientId:e})},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:r,hasBlockGapSupport:o,layoutDefinitions:i=Hx}){const{minimumColumnWidth:s="12rem",columnCount:a=null,rowCount:l=null}=t,c=n?.spacing?.blockGap&&!Gy(r,"spacing","blockGap")?dw(n?.spacing?.blockGap,"0.5em"):void 0;let u="";const d=[];return a?(d.push(`grid-template-columns: repeat(${a}, minmax(0, 1fr))`),l&&d.push(`grid-template-rows: repeat(${l}, minmax(0, 1fr))`)):s&&d.push(`grid-template-columns: repeat(auto-fill, minmax(min(${s}, 100%), 1fr))`,"container-type: inline-size"),d.length&&(u=`${$x(e)} { ${d.join("; ")}; }`),o&&c&&(u+=Wx(e,i,"grid",c)),u},getOrientation:()=>"horizontal",getAlignments:()=>[]};function aS({layout:e,onChange:t}){const{minimumColumnWidth:n="12rem"}=e,[r,o]=$w(n);return(0,jd.jsxs)("fieldset",{children:[(0,jd.jsx)(H_.Ay.VisualLabel,{as:"legend",children:(0,H.__)("Minimum column width")}),(0,jd.jsxs)(T_.A,{gap:4,children:[(0,jd.jsx)(B_.A,{isBlock:!0,children:(0,jd.jsx)(sk,{size:"__unstable-large",onChange:n=>{t({...e,minimumColumnWidth:n})},onUnitChange:n=>{let i;["em","rem"].includes(n)&&"px"===o?i=(r/16).toFixed(2)+n:["em","rem"].includes(o)&&"px"===n&&(i=Math.round(16*r)+n),t({...e,minimumColumnWidth:i})},value:n,units:iS,min:0,label:(0,H.__)("Minimum column width"),hideLabelFromVision:!0})}),(0,jd.jsx)(B_.A,{isBlock:!0,children:(0,jd.jsx)(LC,{onChange:n=>{t({...e,minimumColumnWidth:[n,o].join("")})},value:r,min:0,max:oS[o]||600,withInputField:!1,label:(0,H.__)("Minimum column width"),hideLabelFromVision:!0})})]})]})}function lS({layout:e,onChange:t,allowSizingOnChildren:n}){const{columnCount:r=3,rowCount:o}=e;return(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsxs)("fieldset",{children:[(0,jd.jsx)(H_.Ay.VisualLabel,{as:"legend",children:(0,H.__)("Columns")}),(0,jd.jsxs)(T_.A,{gap:4,children:[(0,jd.jsx)(B_.A,{isBlock:!0,children:(0,jd.jsx)(qw.A,{size:"__unstable-large",onChange:n=>{const r=""!==n?n:"1";t({...e,columnCount:r})},value:r,min:1,label:(0,H.__)("Columns"),hideLabelFromVision:!0})}),(0,jd.jsx)(B_.A,{isBlock:!0,children:(0,jd.jsx)(LC,{value:parseInt(r,10),onChange:n=>t({...e,columnCount:n}),min:1,max:16,withInputField:!1,label:(0,H.__)("Columns"),hideLabelFromVision:!0})})]})]}),n&&window.__experimentalEnableGridInteractivity&&(0,jd.jsxs)("fieldset",{children:[(0,jd.jsx)(H_.Ay.VisualLabel,{as:"legend",children:(0,H.__)("Rows")}),(0,jd.jsxs)(T_.A,{gap:4,children:[(0,jd.jsx)(B_.A,{isBlock:!0,children:(0,jd.jsx)(qw.A,{size:"__unstable-large",onChange:n=>{t({...e,rowCount:n})},value:o,min:1,label:(0,H.__)("Rows"),hideLabelFromVision:!0})}),(0,jd.jsx)(B_.A,{isBlock:!0,children:(0,jd.jsx)(LC,{value:parseInt(o,10),onChange:n=>t({...e,rowCount:n}),min:1,max:16,withInputField:!1,label:(0,H.__)("Rows"),hideLabelFromVision:!0})})]})]})]})}function cS({layout:e,onChange:t}){const{columnCount:n,minimumColumnWidth:r}=e,[o,i]=(0,k.useState)(n||3),[s,a]=(0,k.useState)(r||"12rem"),l=n?"manual":"auto";return(0,jd.jsxs)(xx,{__nextHasNoMarginBottom:!0,label:(0,H.__)("Type"),value:l,onChange:l=>{"manual"===l?a(r||"12rem"):i(n||3),t({...e,columnCount:"manual"===l?o:null,minimumColumnWidth:"auto"===l?s:null})},isBlock:!0,children:[(0,jd.jsx)(FC,{value:"auto",label:(0,H.__)("Auto")},"auto"),(0,jd.jsx)(FC,{value:"manual",label:(0,H.__)("Manual")},"manual")]})}const uS=[Pw,Tw,Zk,sS];function dS(e="default"){return uS.find((t=>t.name===e))}const hS={type:"default"},pS=(0,k.createContext)(hS),fS=pS.Provider;function mS(){return(0,k.useContext)(pS)}const gS=[],bS=["none","left","center","right","wide","full"],vS=["wide","full"];function yS(e=bS){e.includes("none")||(e=["none",...e]);const t=1===e.length&&"none"===e[0],[n,r,o]=(0,Ul.A)((e=>{var n;if(t)return[!1,!1,!1];const r=e(dy).getSettings();return[null!==(n=r.alignWide)&&void 0!==n&&n,r.supportsLayout,r.__unstableIsBlockBasedTheme]}),[t]),i=mS();if(t)return gS;const s=dS(i?.type);if(r){const t=s.getAlignments(i,o).filter((t=>e.includes(t.name)));return 1===t.length&&"none"===t[0].name?gS:t}if("default"!==s.name&&"constrained"!==s.name)return gS;const a=e.filter((e=>i.alignments?i.alignments.includes(e):!(!n&&vS.includes(e))&&bS.includes(e))).map((e=>({name:e})));return 1===a.length&&"none"===a[0].name?gS:a}var _S=n(8336),xS=n(66867),wS=n(88282),kS=n(84122);const CS={none:{icon:_S.A,title:(0,H._x)("None","Alignment option")},left:{icon:xS.A,title:(0,H.__)("Align left")},center:{icon:lk.A,title:(0,H.__)("Align center")},right:{icon:wS.A,title:(0,H.__)("Align right")},wide:{icon:ck.A,title:(0,H.__)("Wide width")},full:{icon:kS.A,title:(0,H.__)("Full width")}},SS=function({value:e,onChange:t,controls:n,isToolbar:r,isCollapsed:o=!0}){const i=yS(n);if(!i.length)return null;function s(n){t([e,"none"].includes(n)?void 0:n)}const a=CS[e],l=CS.none,c=r?s_:__,u={icon:a?a.icon:l.icon,label:(0,H.__)("Align")},d=r?{isCollapsed:o,controls:i.map((({name:t})=>({...CS[t],isActive:e===t||!e&&"none"===t,role:o?"menuitemradio":void 0,onClick:()=>s(t)})))}:{toggleProps:{describedBy:(0,H.__)("Change alignment")},children:({onClose:t})=>(0,jd.jsx)(jd.Fragment,{children:(0,jd.jsx)(x_.A,{className:"block-editor-block-alignment-control__menu-group",children:i.map((({name:n,info:r})=>{const{icon:o,title:i}=CS[n],a=n===e||!e&&"none"===n;return(0,jd.jsx)(w_.A,{icon:o,iconPosition:"left",className:(0,Hy.A)("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{s(n),t()},role:"menuitemradio",info:r,children:i},n)}))})})};return(0,jd.jsx)(c,{...u,...d})},AS=e=>(0,jd.jsx)(SS,{...e,isToolbar:!1});function ES(e){const t=Zp(),{clientId:n=""}=t,{setBlockEditingMode:r,unsetBlockEditingMode:o}=(0,Vl.A)(dy),i=(0,Ul.A)((e=>n?null:e(dy).getBlockEditingMode()),[n]);return(0,k.useEffect)((()=>(e&&r(n,e),()=>{e&&o(n)})),[n,e,r,o]),n?t[Gp]:i}const IS=["left","center","right","wide","full"],jS=["wide","full"];function TS(e,t=!0,n=!0){let r;return r=Array.isArray(e)?IS.filter((t=>e.includes(t))):!0===e?[...IS]:[],!n||!0===e&&!t?r.filter((e=>!jS.includes(e))):r}const BS={shareWithChildBlocks:!0,edit:function({name:e,align:t,setAttributes:n}){const r=yS(TS(Ec(e,"align"),Ic(e,"alignWide",!0))).map((({name:e})=>e)),o=ES();return r.length&&"default"===o?(0,jd.jsx)(y_,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,jd.jsx)(AS,{value:t,onChange:t=>{if(!t){const n=Sc(e),r=n?.attributes?.align?.default;r&&(t="")}n({align:t})},controls:r})}):null},useBlockProps:function({name:e,align:t}){return yS(TS(Ec(e,"align"),Ic(e,"alignWide",!0))).some((e=>e.name===t))?{"data-align":t}:{}},addSaveProps:function(e,t,n){const{align:r}=n;return TS(Ec(t,"align"),Ic(t,"alignWide",!0)).includes(r)&&(e.className=(0,Hy.A)(`align${r}`,e.className)),e},attributeKeys:["align"],hasSupport:e=>Ic(e,"align",!1)};(0,Tu.addFilter)("blocks.registerBlockType","core/editor/align/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.align)&&void 0!==t?t:{})||Ic(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...IS,""]}}),e}));const RS=()=>{},NS=(0,k.createContext)({menuItems:{default:{},optional:{}},hasMenuItems:!1,isResetting:!1,shouldRenderPlaceholderItems:!1,registerPanelItem:RS,deregisterPanelItem:RS,flagItemCustomization:RS,registerResetAllFilter:RS,deregisterResetAllFilter:RS,areAllOptionalControlsHidden:!0}),DS=()=>(0,k.useContext)(NS),MS=(0,Hl.QJ)("InspectorControls"),PS=(0,Hl.QJ)("InspectorAdvancedControls"),OS=(0,Hl.QJ)("InspectorControlsBackground"),LS=(0,Hl.QJ)("InspectorControlsBorder"),FS=(0,Hl.QJ)("InspectorControlsColor"),zS=(0,Hl.QJ)("InspectorControlsFilter"),US=(0,Hl.QJ)("InspectorControlsDimensions"),VS=(0,Hl.QJ)("InspectorControlsPosition"),HS=(0,Hl.QJ)("InspectorControlsTypography"),$S=(0,Hl.QJ)("InspectorControlsListView"),WS=(0,Hl.QJ)("InspectorControlsStyles"),GS={default:MS,advanced:PS,background:OS,border:LS,color:FS,dimensions:US,effects:(0,Hl.QJ)("InspectorControlsEffects"),filter:zS,list:$S,position:VS,settings:MS,styles:WS,typography:HS};function qS({children:e,group:t="default",__experimentalGroup:n,resetAllFilter:r}){n&&((0,q.default)("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=n);const o=Zp(),i=GS[t]?.Fill;return i?o[$p]?(0,jd.jsx)(a_.A,{document,children:(0,jd.jsx)(i,{children:t=>(0,jd.jsx)(YS,{fillProps:t,children:e,resetAllFilter:r})})}):null:(!0===globalThis.SCRIPT_DEBUG&&(0,f_.default)(`Unknown InspectorControls group "${t}" provided.`),null)}function KS({resetAllFilter:e,children:t}){const{registerResetAllFilter:n,deregisterResetAllFilter:r}=(0,k.useContext)(NS);return(0,k.useEffect)((()=>{if(e&&n&&r)return n(e),()=>{r(e)}}),[e,n,r]),t}function YS({children:e,resetAllFilter:t,fillProps:n}){const{forwardedContext:r=[]}=n,o=(0,jd.jsx)(KS,{resetAllFilter:t,children:e});return r.reduce(((e,[t,n])=>(0,jd.jsx)(t,{...n,children:e})),o)}var JS=n(97091),XS=n(39528),ZS=n(48410),QS=n(52710),eA=n(56886),tA=n(82021),nA=n(54894);const rA={columns:e=>(0,W_.css)("grid-template-columns:",`repeat( ${e}, minmax(0, 1fr) )`,";",""),spacing:(0,W_.css)("column-gap:",(0,Yw.x)(2),";row-gap:",(0,Yw.x)(4),";",""),item:{fullWidth:{name:"18iuzk9",styles:"grid-column:1/-1"}}},oA={name:"huufmu",styles:">div:not( :first-of-type ){display:none;}"},iA=(0,W_.css)(rA.item.fullWidth," gap:",(0,Yw.x)(2),";.components-dropdown-menu{margin:",(0,Yw.x)(-1)," 0;line-height:0;}&&&& .components-dropdown-menu__toggle{padding:0;min-width:",(0,Yw.x)(6),";}",""),sA={name:"1pmxm02",styles:"font-size:inherit;font-weight:500;line-height:normal;&&{margin:0;}"},aA=(0,W_.css)(rA.item.fullWidth,"&>div,&>fieldset{padding-bottom:0;margin-bottom:0;max-width:100%;}&& ",nA.mO,"{margin-bottom:0;",nA.mh,":last-child{margin-bottom:0;}}",nA.te,"{margin-bottom:0;}&& ",Kw.cR,"{label{line-height:1.4em;}}",""),lA={name:"eivff4",styles:"display:none"},cA={name:"16gsvie",styles:"min-width:200px"},uA=(0,$_.default)("span",{target:"ews648u0"})("color:",G_.l.theme.accentDarker10,";font-size:11px;font-weight:500;line-height:1.4;",(0,Gw.h)({marginLeft:(0,Yw.x)(3)})," text-transform:uppercase;"),dA=(0,W_.css)("color:",G_.l.gray[900],";&&[aria-disabled='true']{color:",G_.l.gray[700],";opacity:1;&:hover{color:",G_.l.gray[700],";}",uA,"{opacity:0.3;}}",""),hA=({itemClassName:e,items:t,toggleItem:n})=>{if(!t.length)return null;const r=(0,jd.jsx)(uA,{"aria-hidden":!0,children:(0,H.__)("Reset")});return(0,jd.jsx)(jd.Fragment,{children:t.map((([t,o])=>o?(0,jd.jsx)(w_.A,{className:e,role:"menuitem",label:(0,H.sprintf)((0,H.__)("Reset %s"),t),onClick:()=>{n(t),(0,Yb.speak)((0,H.sprintf)((0,H.__)("%s reset to default"),t),"assertive")},suffix:r,children:t},t):(0,jd.jsx)(w_.A,{icon:XS.A,className:e,role:"menuitemcheckbox",isSelected:!0,"aria-disabled":!0,children:t},t)))})},pA=({items:e,toggleItem:t})=>e.length?(0,jd.jsx)(jd.Fragment,{children:e.map((([e,n])=>{const r=n?(0,H.sprintf)((0,H.__)("Hide and reset %s"),e):(0,H.sprintf)((0,H.__)("Show %s"),e);return(0,jd.jsx)(w_.A,{icon:n?XS.A:null,isSelected:n,label:r,onClick:()=>{n?(0,Yb.speak)((0,H.sprintf)((0,H.__)("%s hidden and reset to default"),e),"assertive"):(0,Yb.speak)((0,H.sprintf)((0,H.__)("%s is now visible"),e),"assertive"),t(e)},role:"menuitemcheckbox",children:e},e)}))}):null,fA=(0,U_.KZ)(((e,t)=>{const{areAllOptionalControlsHidden:n,defaultControlsItemClassName:r,dropdownMenuClassName:o,hasMenuItems:i,headingClassName:s,headingLevel:a=2,label:l,menuItems:c,resetAll:u,toggleItem:d,dropdownMenuProps:h,...p}=function(e){const{className:t,headingLevel:n=2,...r}=(0,z_.A)(e,"ToolsPanelHeader"),o=(0,V_.l)(),i=(0,k.useMemo)((()=>o(iA,t)),[t,o]),s=(0,k.useMemo)((()=>o(cA)),[o]),a=(0,k.useMemo)((()=>o(sA)),[o]),l=(0,k.useMemo)((()=>o(dA)),[o]),{menuItems:c,hasMenuItems:u,areAllOptionalControlsHidden:d}=DS();return{...r,areAllOptionalControlsHidden:d,defaultControlsItemClassName:l,dropdownMenuClassName:s,hasMenuItems:u,headingClassName:a,headingLevel:n,menuItems:c,className:i}}(e);if(!l)return null;const f=Object.entries(c?.default||{}),m=Object.entries(c?.optional||{}),g=n?ZS.A:QS.A,b=(0,H.sprintf)((0,H._x)("%s options","Button label to reveal tool panel options"),l),v=n?(0,H.__)("All options are currently hidden"):void 0,y=[...f,...m].some((([,e])=>e));return(0,jd.jsxs)(eA.A,{...p,ref:t,children:[(0,jd.jsx)(tA.A,{level:a,className:s,children:l}),i&&(0,jd.jsx)(o_.A,{...h,icon:g,label:b,menuProps:{className:o},toggleProps:{size:"small",describedBy:v},children:()=>(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsxs)(x_.A,{label:l,children:[(0,jd.jsx)(hA,{items:f,toggleItem:d,itemClassName:r}),(0,jd.jsx)(pA,{items:m,toggleItem:d})]}),(0,jd.jsx)(x_.A,{children:(0,jd.jsx)(w_.A,{"aria-disabled":!y,variant:"tertiary",onClick:()=>{y&&(u(),(0,Yb.speak)((0,H.__)("All options reset"),"assertive"))},children:(0,H.__)("Reset all")})})]})})]})}),"ToolsPanelHeader"),mA=({panelItems:e,shouldReset:t,currentMenuItems:n,menuItemOrder:r})=>{const o={default:{},optional:{}},i={default:{},optional:{}};return e.forEach((({hasValue:e,isShownByDefault:r,label:i})=>{const s=r?"default":"optional",a=n?.[s]?.[i],l=a||e();o[s][i]=!t&&l})),r.forEach((e=>{o.default.hasOwnProperty(e)&&(i.default[e]=o.default[e]),o.optional.hasOwnProperty(e)&&(i.optional[e]=o.optional[e])})),Object.keys(o.default).forEach((e=>{i.default.hasOwnProperty(e)||(i.default[e]=o.default[e])})),Object.keys(o.optional).forEach((e=>{i.optional.hasOwnProperty(e)||(i.optional[e]=o.optional[e])})),i},gA=e=>e&&0===Object.keys(e).length;const bA={bottom:{alignItems:"flex-end",justifyContent:"center"},bottomLeft:{alignItems:"flex-start",justifyContent:"flex-end"},bottomRight:{alignItems:"flex-end",justifyContent:"flex-end"},center:{alignItems:"center",justifyContent:"center"},spaced:{alignItems:"center",justifyContent:"space-between"},left:{alignItems:"center",justifyContent:"flex-start"},right:{alignItems:"center",justifyContent:"flex-end"},stretch:{alignItems:"stretch"},top:{alignItems:"flex-start",justifyContent:"center"},topLeft:{alignItems:"flex-start",justifyContent:"flex-start"},topRight:{alignItems:"flex-start",justifyContent:"flex-end"}};var vA=n(17849);const yA=(0,U_.KZ)((function(e,t){const n=function(e){const{align:t,alignment:n,className:r,columnGap:o,columns:i=2,gap:s=3,isInline:a=!1,justify:l,rowGap:c,rows:u,templateColumns:d,templateRows:h,...p}=(0,z_.A)(e,"Grid"),f=Array.isArray(i)?i:[i],m=(0,vA.t)(f),g=Array.isArray(u)?u:[u],b=(0,vA.t)(g),v=d||!!i&&`repeat( ${m}, 1fr )`,y=h||!!u&&`repeat( ${b}, 1fr )`,_=(0,V_.l)();return{...p,className:(0,k.useMemo)((()=>{const e=function(e){return e?bA[e]:{}}(n),i=(0,W_.css)({alignItems:t,display:a?"inline-grid":"grid",gap:`calc( ${q_.A.gridBase} * ${s} )`,gridTemplateColumns:v||void 0,gridTemplateRows:y||void 0,gridRowGap:c,gridColumnGap:o,justifyContent:l,verticalAlign:a?"middle":void 0,...e},"","");return _(i,r)}),[t,n,r,o,_,s,v,y,a,l,c])}}(e);return(0,jd.jsx)(hx.A,{...n,ref:t})}),"Grid"),_A=(0,U_.KZ)(((e,t)=>{const{children:n,label:r,panelContext:o,resetAllItems:i,toggleItem:s,headingLevel:a,dropdownMenuProps:l,...c}=function(e){const{className:t,headingLevel:n=2,resetAll:r,panelId:o,hasInnerWrapper:i=!1,shouldRenderPlaceholderItems:s=!1,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:l,...c}=(0,z_.A)(e,"ToolsPanel"),u=(0,k.useRef)(!1),d=u.current;(0,k.useEffect)((()=>{d&&(u.current=!1)}),[d]);const[h,p]=(0,k.useState)([]),[f,m]=(0,k.useState)([]),[g,b]=(0,k.useState)([]),v=(0,k.useCallback)((e=>{p((t=>{const n=[...t],r=n.findIndex((t=>t.label===e.label));return-1!==r&&n.splice(r,1),[...n,e]})),m((t=>t.includes(e.label)?t:[...t,e.label]))}),[p,m]),y=(0,k.useCallback)((e=>{p((t=>{const n=[...t],r=n.findIndex((t=>t.label===e));return-1!==r&&n.splice(r,1),n}))}),[p]),_=(0,k.useCallback)((e=>{b((t=>[...t,e]))}),[b]),x=(0,k.useCallback)((e=>{b((t=>t.filter((t=>t!==e))))}),[b]),[w,C]=(0,k.useState)({default:{},optional:{}});(0,k.useEffect)((()=>{C((e=>mA({panelItems:h,shouldReset:!1,currentMenuItems:e,menuItemOrder:f})))}),[h,C,f]);const S=(0,k.useCallback)(((e,t,n="default")=>{C((r=>({...r,[n]:{...r[n],[t]:e}})))}),[C]),[A,E]=(0,k.useState)(!1);(0,k.useEffect)((()=>{if(gA(w?.default)&&!gA(w?.optional)){const e=!Object.entries(w.optional).some((([,e])=>e));E(e)}}),[w,E]);const I=(0,V_.l)(),j=(0,k.useMemo)((()=>{const e=i&&(0,W_.css)(">div:not( :first-of-type ){display:grid;",rA.columns(2)," ",rA.spacing," ",rA.item.fullWidth,";}",""),n=gA(w?.default)&&A&&oA;return I((0,W_.css)(rA.columns(2)," ",rA.spacing," border-top:",q_.A.borderWidth," solid ",G_.l.gray[300],";margin-top:-1px;padding:",(0,Yw.x)(4),";",""),e,n,t)}),[A,t,I,i,w]),T=(0,k.useCallback)((e=>{const t=h.find((t=>t.label===e));if(!t)return;const n=t.isShownByDefault?"default":"optional",r={...w,[n]:{...w[n],[e]:!w[n][e]}};C(r)}),[w,h,C]),B=(0,k.useCallback)((()=>{"function"==typeof r&&(u.current=!0,r(g));const e=mA({panelItems:h,menuItemOrder:f,shouldReset:!0});C(e)}),[h,g,r,C,f]),R=e=>{const t=w.optional||{},n=e.find((e=>e.isShownByDefault||!!t[e.label]));return n?.label},N=R(h),D=R([...h].reverse());return{...c,headingLevel:n,panelContext:(0,k.useMemo)((()=>({areAllOptionalControlsHidden:A,deregisterPanelItem:y,deregisterResetAllFilter:x,firstDisplayedItem:N,flagItemCustomization:S,hasMenuItems:!!h.length,isResetting:u.current,lastDisplayedItem:D,menuItems:w,panelId:o,registerPanelItem:v,registerResetAllFilter:_,shouldRenderPlaceholderItems:s,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:l})),[A,y,x,N,S,D,w,o,h,_,v,s,a,l]),resetAllItems:B,toggleItem:T,className:j}}(e);return(0,jd.jsx)(yA,{...c,columns:2,ref:t,children:(0,jd.jsxs)(NS.Provider,{value:o,children:[(0,jd.jsx)(fA,{label:r,resetAll:i,toggleItem:s,headingLevel:a,dropdownMenuProps:l}),n]})})}),"ToolsPanel"),xA=_A;function wA({children:e,group:t,label:n}){const{updateBlockAttributes:r}=(0,Vl.A)(dy),{getBlockAttributes:o,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:s,hasMultiSelection:a}=(0,Ul.A)(dy),l=s(),c=(0,k.useCallback)(((e=[])=>{const t={},n=a()?i():[l];n.forEach((n=>{const{style:r}=o(n);let i={style:r};e.forEach((e=>{i={...i,...e(i)}})),i={...i,style:$y(i.style)},t[n]=i})),r(n,t,!0)}),[o,i,a,l,r]);return(0,jd.jsx)(xA,{className:`${t}-block-support-panel`,label:n,resetAll:c,panelId:l,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:Iy,children:e},l)}function kA({Slot:e,fillProps:t,...n}){const r=(0,k.useContext)(NS),o=(0,k.useMemo)((()=>{var e;return{...null!=t?t:{},forwardedContext:[...null!==(e=t?.forwardedContext)&&void 0!==e?e:[],[NS.Provider,{value:r}]]}}),[r,t]);return(0,jd.jsx)(e,{...n,fillProps:o,bubblesVirtually:!0})}function CA({__experimentalGroup:e,group:t="default",label:n,fillProps:r,...o}){e&&((0,q.default)("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=e);const i=GS[t]?.Slot,s=p_(i?.__unstableName),a=(0,k.useContext)(JS.A),l=(0,k.useMemo)((()=>{var e;return{...null!=r?r:{},forwardedContext:[...null!==(e=r?.forwardedContext)&&void 0!==e?e:[],[JS.A.Provider,{value:a}]]}}),[a,r]);return i?s?.length?n?(0,jd.jsx)(wA,{group:t,label:n,children:(0,jd.jsx)(kA,{...o,fillProps:l,Slot:i})}):(0,jd.jsx)(i,{...o,fillProps:l,bubblesVirtually:!0}):null:(!0===globalThis.SCRIPT_DEBUG&&(0,f_.default)(`Unknown InspectorControls group "${t}" provided.`),null)}const SA=qS;SA.Slot=CA;const AA=e=>(0,jd.jsx)(qS,{...e,group:"advanced"});AA.Slot=e=>(0,jd.jsx)(CA,{...e,group:"advanced"}),AA.slotName="InspectorAdvancedControls";const EA=SA;var IA=n(34147);const jA={name:"1bcj5ek",styles:"width:100%;display:block"},TA={name:"150ruhm",styles:"box-sizing:border-box;width:100%;display:block;margin:0;color:inherit"},BA=(0,W_.css)("border:1px solid ",q_.A.surfaceBorderColor,";",""),RA=(0,W_.css)(">*:not( marquee )>*{border-bottom:1px solid ",q_.A.surfaceBorderColor,";}>*:last-of-type>*:not( :focus ){border-bottom-color:transparent;}",""),NA=q_.A.controlBorderRadius,DA=(0,W_.css)("border-radius:",NA,";",""),MA=(0,W_.css)("border-radius:",NA,";>*:first-of-type>*{border-top-left-radius:",NA,";border-top-right-radius:",NA,";}>*:last-of-type>*{border-bottom-left-radius:",NA,";border-bottom-right-radius:",NA,";}",""),PA=`calc(${q_.A.fontSize} * ${q_.A.fontLineHeightBase})`,OA=`calc((${q_.A.controlHeight} - ${PA} - 2px) / 2)`,LA=`calc((${q_.A.controlHeightSmall} - ${PA} - 2px) / 2)`,FA=`calc((${q_.A.controlHeightLarge} - ${PA} - 2px) / 2)`,zA={small:(0,W_.css)("padding:",LA," ",q_.A.controlPaddingXSmall,";",""),medium:(0,W_.css)("padding:",OA," ",q_.A.controlPaddingX,";",""),large:(0,W_.css)("padding:",FA," ",q_.A.controlPaddingXLarge,";","")},UA=(0,k.createContext)({size:"medium"}),VA=()=>(0,k.useContext)(UA),HA=(0,U_.KZ)((function(e,t){const{isBordered:n,isSeparated:r,size:o,...i}=function(e){const{className:t,isBordered:n=!1,isRounded:r=!0,isSeparated:o=!1,role:i="list",...s}=(0,z_.A)(e,"ItemGroup");return{isBordered:n,className:(0,V_.l)()(n&&BA,o&&RA,r&&MA,t),role:i,isSeparated:o,...s}}(e),{size:s}=VA(),a={spacedAround:!n&&!r,size:o||s};return(0,jd.jsx)(UA.Provider,{value:a,children:(0,jd.jsx)(hx.A,{...i,ref:t})})}),"ItemGroup");var $A=n(4545),WA=n(11508);const GA=()=>{},qA=(0,U_.KZ)(((e,t)=>{const{children:n,isShown:r,shouldRenderPlaceholder:o,...i}=function(e){const{className:t,hasValue:n,isShownByDefault:r=!1,label:o,panelId:i,resetAllFilter:s=GA,onDeselect:a,onSelect:l,...c}=(0,z_.A)(e,"ToolsPanelItem"),{panelId:u,menuItems:d,registerResetAllFilter:h,deregisterResetAllFilter:p,registerPanelItem:f,deregisterPanelItem:m,flagItemCustomization:g,isResetting:b,shouldRenderPlaceholderItems:v,firstDisplayedItem:y,lastDisplayedItem:_,__experimentalFirstVisibleItemClass:x,__experimentalLastVisibleItemClass:w}=DS(),C=(0,k.useCallback)(n,[i]),S=(0,k.useCallback)(s,[i]),A=(0,mx.A)(u),E=u===i||null===u;(0,k.useLayoutEffect)((()=>(E&&null!==A&&f({hasValue:C,isShownByDefault:r,label:o,panelId:i}),()=>{(null===A&&u||u===i)&&m(o)})),[u,E,r,o,C,i,A,f,m]),(0,k.useEffect)((()=>(E&&h(S),()=>{E&&p(S)})),[h,p,S,E]);const I=r?"default":"optional",j=d?.[I]?.[o],T=(0,mx.A)(j),B=void 0!==d?.[I]?.[o],R=n();(0,k.useEffect)((()=>{(r||R)&&g(R,o,I)}),[R,I,o,g,r]),(0,k.useEffect)((()=>{B&&!b&&E&&(!j||R||T||l?.(),!j&&R&&T&&a?.())}),[E,j,B,b,R,T,l,a]);const N=r?void 0!==d?.[I]?.[o]:j,D=(0,V_.l)(),M=(0,k.useMemo)((()=>{const e=v&&!N;return D(aA,e&&lA,!e&&t,y===o&&x,_===o&&w)}),[N,v,t,D,y,_,x,w,o]);return{...c,isShown:N,shouldRenderPlaceholder:v,className:M}}(e);return r?(0,jd.jsx)(hx.A,{...i,ref:t,children:n}):o?(0,jd.jsx)(hx.A,{...i,ref:t}):null}),"ToolsPanelItem"),KA=qA;var YA=n(37815),JA=n(95893),XA=n(19991);function ZA({dropZoneElement:e,isDisabled:t,onDrop:n,onDragStart:r,onDragEnter:o,onDragLeave:i,onDragEnd:s,onDragOver:a}){const l=(0,XA.A)(n),c=(0,XA.A)(r),u=(0,XA.A)(o),d=(0,XA.A)(i),h=(0,XA.A)(s),p=(0,XA.A)(a);return(0,zC.A)((f=>{if(t)return;const m=e??f;let g=!1;const{ownerDocument:b}=m;function v(e){g||(g=!0,b.addEventListener("dragend",k),b.addEventListener("mousemove",k),r&&c(e))}function y(e){e.preventDefault(),m.contains(e.relatedTarget)||o&&u(e)}function _(e){!e.defaultPrevented&&a&&p(e),e.preventDefault()}function x(e){(function(e){const{defaultView:t}=b;if(!(e&&t&&e instanceof t.HTMLElement&&m.contains(e)))return!1;let n=e;do{if(n.dataset.isDropZone)return n===m}while(n=n.parentElement);return!1})(e.relatedTarget)||i&&d(e)}function w(e){e.defaultPrevented||(e.preventDefault(),e.dataTransfer&&e.dataTransfer.files.length,n&&l(e),k(e))}function k(e){g&&(g=!1,b.removeEventListener("dragend",k),b.removeEventListener("mousemove",k),s&&h(e))}return m.setAttribute("data-is-drop-zone","true"),m.addEventListener("drop",w),m.addEventListener("dragenter",y),m.addEventListener("dragover",_),m.addEventListener("dragleave",x),b.addEventListener("dragenter",v),()=>{m.removeAttribute("data-is-drop-zone"),m.removeEventListener("drop",w),m.removeEventListener("dragenter",y),m.removeEventListener("dragover",_),m.removeEventListener("dragleave",x),b.removeEventListener("dragend",k),b.removeEventListener("mousemove",k),b.removeEventListener("dragenter",v)}}),[t,e])}var QA=n(44907);const eE={hidden:{opacity:0},show:{opacity:1,transition:{type:"tween",duration:.2,delay:0,delayChildren:.1}},exit:{opacity:0,transition:{duration:.2,delayChildren:0}}},tE={hidden:{opacity:0,scale:.9},show:{opacity:1,scale:1,transition:{duration:.1}},exit:{opacity:0,scale:.9}};function nE({label:e}){const t=(0,Cx.A)(),n=(0,jd.jsx)(kx.P.div,{variants:eE,initial:t?"show":"hidden",animate:"show",exit:t?"show":"exit",className:"components-drop-zone__content",style:{pointerEvents:"none"},children:(0,jd.jsxs)(kx.P.div,{variants:tE,children:[(0,jd.jsx)(ak.A,{icon:YA.A,className:"components-drop-zone__content-icon"}),(0,jd.jsx)("span",{className:"components-drop-zone__content-text",children:e||(0,H.__)("Drop files to upload")})]})});return t?n:(0,jd.jsx)(QA.N,{children:n})}const rE=function({className:e,label:t,onFilesDrop:n,onHTMLDrop:r,onDrop:o,...i}){const[s,a]=(0,k.useState)(),[l,c]=(0,k.useState)(),[u,d]=(0,k.useState)(),h=ZA({onDrop(e){const t=e.dataTransfer?(0,JA.$)(e.dataTransfer):[],i=e.dataTransfer?.getData("text/html");i&&r?r(i):t.length&&n?n(t):o&&o(e)},onDragStart(e){a(!0);let t="default";e.dataTransfer?.types.includes("text/html")?t="html":(e.dataTransfer?.types.includes("Files")||(e.dataTransfer?(0,JA.$)(e.dataTransfer):[]).length>0)&&(t="file"),d(t)},onDragEnd(){a(!1),d(void 0)},onDragEnter(){c(!0)},onDragLeave(){c(!1)}}),p=(0,Hy.A)("components-drop-zone",e,{"is-active":(s||l)&&("file"===u&&n||"html"===u&&r||"default"===u&&o),"is-dragging-over-document":s,"is-dragging-over-element":l,[`is-dragging-${u}`]:!!u});return(0,jd.jsx)("div",{...i,ref:h,className:p,children:l&&(0,jd.jsx)(nE,{label:t})})};var oE=n(53926),iE=n(14671);function sE({onDragStart:e,onDragMove:t,onDragEnd:n}){const[r,o]=(0,k.useState)(!1),i=(0,k.useRef)({onDragStart:e,onDragMove:t,onDragEnd:n});(0,iE.A)((()=>{i.current.onDragStart=e,i.current.onDragMove=t,i.current.onDragEnd=n}),[e,t,n]);const s=(0,k.useCallback)((e=>i.current.onDragMove&&i.current.onDragMove(e)),[]),a=(0,k.useCallback)((e=>{i.current.onDragEnd&&i.current.onDragEnd(e),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a),o(!1)}),[]),l=(0,k.useCallback)((e=>{i.current.onDragStart&&i.current.onDragStart(e),document.addEventListener("mousemove",s),document.addEventListener("mouseup",a),o(!0)}),[]);return(0,k.useEffect)((()=>()=>{r&&(document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a))}),[r]),{startDrag:l,endDrag:a,isDragging:r}}const aE={width:200,height:170},lE=["avi","mpg","mpeg","mov","mp4","m4v","ogg","ogv","webm","wmv"];function cE(e){return Math.round(100*e)}const uE=(0,$_.default)("div",{target:"eeew7dm8"})({name:"jqnsxy",styles:"background-color:transparent;display:flex;text-align:center;width:100%"}),dE=(0,$_.default)("div",{target:"eeew7dm7"})("align-items:center;border-radius:",q_.A.radiusBlockUi,";cursor:pointer;display:inline-flex;justify-content:center;margin:auto;position:relative;height:100%;&:after{border-radius:inherit;bottom:0;box-shadow:inset 0 0 0 1px rgba( 0, 0, 0, 0.1 );content:'';left:0;pointer-events:none;position:absolute;right:0;top:0;}img,video{border-radius:inherit;box-sizing:border-box;display:block;height:auto;margin:0;max-height:100%;max-width:100%;pointer-events:none;user-select:none;width:auto;}"),hE=(0,$_.default)("div",{target:"eeew7dm6"})("background:",G_.l.gray[100],";border-radius:inherit;box-sizing:border-box;height:",aE.height,"px;max-width:280px;min-width:",aE.width,"px;width:100%;"),pE=(0,$_.default)(sk,{target:"eeew7dm5"})({name:"1d3w5wq",styles:"width:100%"});var fE={name:"1mn7kwb",styles:"padding-bottom:1em"};const mE=({__nextHasNoMarginBottom:e})=>e?void 0:fE;var gE={name:"1mn7kwb",styles:"padding-bottom:1em"};const bE=({hasHelpText:e=!1})=>e?gE:void 0,vE=(0,$_.default)(T_.A,{target:"eeew7dm4"})("max-width:320px;padding-top:1em;",bE," ",mE,";"),yE=(0,$_.default)("div",{target:"eeew7dm3"})("left:50%;overflow:hidden;pointer-events:none;position:absolute;top:50%;transform:translate3d( -50%, -50%, 0 );z-index:1;@media not ( prefers-reduced-motion ){transition:opacity 100ms linear;}opacity:",(({showOverlay:e})=>e?1:0),";"),_E=(0,$_.default)("div",{target:"eeew7dm2"})({name:"1yzbo24",styles:"background:rgba( 255, 255, 255, 0.4 );backdrop-filter:blur( 16px ) saturate( 180% );position:absolute;transform:translateZ( 0 )"}),xE=(0,$_.default)(_E,{target:"eeew7dm1"})({name:"1sw8ur",styles:"height:1px;left:1px;right:1px"}),wE=(0,$_.default)(_E,{target:"eeew7dm0"})({name:"188vg4t",styles:"width:1px;top:1px;bottom:1px"}),kE=0,CE=100,SE=()=>{};function AE({__nextHasNoMarginBottom:e,__next40pxDefaultSize:t,hasHelpText:n,onChange:r=SE,point:o={x:.5,y:.5}}){const i=cE(o.x),s=cE(o.y),a=(e,t)=>{if(void 0===e)return;const n=parseInt(e,10);isNaN(n)||r({...o,[t]:n/100})};return(0,jd.jsxs)(vE,{className:"focal-point-picker__controls",__nextHasNoMarginBottom:e,hasHelpText:n,gap:4,children:[(0,jd.jsx)(EE,{__next40pxDefaultSize:t,label:(0,H.__)("Left"),"aria-label":(0,H.__)("Focal point left position"),value:[i,"%"].join(""),onChange:e=>a(e,"x"),dragDirection:"e"}),(0,jd.jsx)(EE,{__next40pxDefaultSize:t,label:(0,H.__)("Top"),"aria-label":(0,H.__)("Focal point top position"),value:[s,"%"].join(""),onChange:e=>a(e,"y"),dragDirection:"s"})]})}function EE(e){return(0,jd.jsx)(pE,{className:"focal-point-picker__controls-position-unit-control",labelPosition:"top",max:CE,min:kE,units:[{value:"%",label:"%"}],...e})}const IE=(0,$_.default)("div",{target:"e19snlhg0"})("background-color:transparent;cursor:grab;height:40px;margin:-20px 0 0 -20px;position:absolute;user-select:none;width:40px;will-change:transform;z-index:10000;background:rgba( 255, 255, 255, 0.4 );border:1px solid rgba( 255, 255, 255, 0.4 );border-radius:50%;backdrop-filter:blur( 16px ) saturate( 180% );box-shadow:rgb( 0 0 0 / 10% ) 0px 0px 8px;@media not ( prefers-reduced-motion ){transition:transform 100ms linear;}",(({isDragging:e})=>e&&"\n\t\t\tbox-shadow: rgb( 0 0 0 / 12% ) 0px 0px 10px;\n\t\t\ttransform: scale( 1.1 );\n\t\t\tcursor: grabbing;\n\t\t\t"),";");function jE({left:e="50%",top:t="50%",...n}){const r={left:e,top:t};return(0,jd.jsx)(IE,{...n,className:"components-focal-point-picker__icon_container",style:r})}function TE({bounds:e,...t}){return(0,jd.jsxs)(yE,{...t,className:"components-focal-point-picker__grid",style:{width:e.width,height:e.height},children:[(0,jd.jsx)(xE,{style:{top:"33%"}}),(0,jd.jsx)(xE,{style:{top:"66%"}}),(0,jd.jsx)(wE,{style:{left:"33%"}}),(0,jd.jsx)(wE,{style:{left:"66%"}})]})}function BE({alt:e,autoPlay:t,src:n,onLoad:r,mediaRef:o,muted:i=!0,...s}){return n?function(e=""){return!!e&&(e.startsWith("data:video/")||lE.includes(function(e=""){const t=e.split(".");return t[t.length-1]}(e)))}(n)?(0,jd.jsx)("video",{...s,autoPlay:t,className:"components-focal-point-picker__media components-focal-point-picker__media--video",loop:!0,muted:i,onLoadedData:r,ref:o,src:n}):(0,jd.jsx)("img",{...s,alt:e,className:"components-focal-point-picker__media components-focal-point-picker__media--image",onLoad:r,ref:o,src:n}):(0,jd.jsx)(hE,{className:"components-focal-point-picker__media components-focal-point-picker__media--placeholder",ref:o,...s})}var RE=n(70573);const NE=function e({__nextHasNoMarginBottom:t,__next40pxDefaultSize:n=!1,autoPlay:r=!0,className:o,help:i,label:s,onChange:a,onDrag:l,onDragEnd:c,onDragStart:u,resolvePoint:d,url:h,value:p={x:.5,y:.5},...f}){const[m,g]=(0,k.useState)(p),[b,v]=(0,k.useState)(!1),{startDrag:y,endDrag:_,isDragging:x}=sE({onDragStart:e=>{S.current?.focus();const t=j(e);t&&(u?.(t,e),g(t))},onDragMove:e=>{e.preventDefault();const t=j(e);t&&(l?.(t,e),g(t))},onDragEnd:()=>{c?.(),a?.(m)}}),{x:w,y:C}=x?m:p,S=(0,k.useRef)(null),[A,E]=(0,k.useState)(aE),I=(0,k.useRef)((()=>{if(!S.current)return;const{clientWidth:e,clientHeight:t}=S.current;E(e>0&&t>0?{width:e,height:t}:{...aE})}));(0,k.useEffect)((()=>{const e=I.current;if(!S.current)return;const{defaultView:t}=S.current.ownerDocument;return t?.addEventListener("resize",e),()=>t?.removeEventListener("resize",e)}),[]),(0,iE.A)((()=>{I.current()}),[]);const j=({clientX:e,clientY:t,shiftKey:n})=>{if(!S.current)return;const{top:r,left:o}=S.current.getBoundingClientRect();let i=(e-o)/A.width,s=(t-r)/A.height;return n&&(i=.1*Math.round(i/.1),s=.1*Math.round(s/.1)),T({x:i,y:s})},T=e=>{var t;const n=null!==(t=d?.(e))&&void 0!==t?t:e;n.x=Math.max(0,Math.min(n.x,1)),n.y=Math.max(0,Math.min(n.y,1));const r=e=>Math.round(100*e)/100;return{x:r(n.x),y:r(n.y)}},B={left:void 0!==w?w*A.width:.5*A.width,top:void 0!==C?C*A.height:.5*A.height},R=(0,Hy.A)("components-focal-point-picker-control",o),N=`inspector-focal-point-picker-control-${(0,F_.A)(e)}`;return(0,RE.A)((()=>{v(!0);const e=window.setTimeout((()=>{v(!1)}),600);return()=>window.clearTimeout(e)}),[w,C]),(0,jd.jsxs)(H_.Ay,{...f,__nextHasNoMarginBottom:t,label:s,id:N,help:i,className:R,children:[(0,jd.jsx)(uE,{className:"components-focal-point-picker-wrapper",children:(0,jd.jsxs)(dE,{className:"components-focal-point-picker",onKeyDown:e=>{const{code:t,shiftKey:n}=e;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t))return;e.preventDefault();const r={x:w,y:C},o=n?.1:.01,i="ArrowUp"===t||"ArrowLeft"===t?-1*o:o,s="ArrowUp"===t||"ArrowDown"===t?"y":"x";r[s]=r[s]+i,a?.(T(r))},onMouseDown:y,onBlur:()=>{x&&_()},ref:S,role:"button",tabIndex:-1,children:[(0,jd.jsx)(TE,{bounds:A,showOverlay:b}),(0,jd.jsx)(BE,{alt:(0,H.__)("Media preview"),autoPlay:r,onLoad:I.current,src:h}),(0,jd.jsx)(jE,{...B,isDragging:x})]})}),(0,jd.jsx)(AE,{__nextHasNoMarginBottom:t,__next40pxDefaultSize:n,hasHelpText:!!i,point:{x:w,y:C},onChange:e=>{a?.(T(e))}})]})};var DE=n(21863),ME=n(70508),PE=n(92449),OE=n(47625);const LE=function({accept:e,children:t,multiple:n=!1,onChange:r,onClick:o,render:i,...s}){const a=(0,k.useRef)(null),l=()=>{a.current?.click()},c=i?i({openFileDialog:l}):(0,jd.jsx)(Xy.Ay,{onClick:l,...s,children:t});return(0,jd.jsxs)("div",{className:"components-form-file-upload",children:[c,(0,jd.jsx)("input",{type:"file",ref:a,multiple:n,style:{display:"none"},accept:e,onChange:r,onClick:o,"data-testid":"form-file-upload-input"})]})};var FE=n(5793);function zE(e){return(0,Hp.f)((t=>{const n="core/with-filters/"+e;let r;class o extends k.Component{constructor(n){super(n),void 0===r&&(r=(0,Tu.applyFilters)(e,t))}componentDidMount(){o.instances.push(this),1===o.instances.length&&((0,Tu.addAction)("hookRemoved",n,s),(0,Tu.addAction)("hookAdded",n,s))}componentWillUnmount(){o.instances=o.instances.filter((e=>e!==this)),0===o.instances.length&&((0,Tu.removeAction)("hookRemoved",n),(0,Tu.removeAction)("hookAdded",n))}render(){return(0,jd.jsx)(r,{...this.props})}}o.instances=[];const i=(0,FE.s)((()=>{r=(0,Tu.applyFilters)(e,t),o.instances.forEach((e=>{e.forceUpdate()}))}),16);function s(t){t===e&&i()}return o}),"withFilters")}var UE=n(38133),VE=n(34343),HE=n(21340),$E=n(91851);const WE=zE("editor.MediaUpload")((()=>null)),GE=function({fallback:e=null,children:t}){const n=(0,Ul.A)((e=>{const{getSettings:t}=e(dy);return!!t().mediaUpload}),[]);return n?t:e};var qE=n(83471),KE=n(57699),YE=n(78048),JE=n(35706),XE=n(97893),ZE=n(95702),QE=n(89395),eI=n(24070);const tI=function e({children:t,settingsOpen:n,setSettingsOpen:r}){const o=(0,Cx.A)(),i=o?k.Fragment:QA.N,s=o?"div":kx.P.div,a=`link-control-settings-drawer-${(0,F_.A)(e)}`;return(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsx)(Xy.Ay,{className:"block-editor-link-control__drawer-toggle","aria-expanded":n,onClick:()=>r(!n),icon:(0,H.isRTL)()?QE.A:eI.A,"aria-controls":a,children:(0,H._x)("Advanced","Additional link settings")}),(0,jd.jsx)(i,{children:n&&(0,jd.jsx)(s,{className:"block-editor-link-control__drawer",hidden:!n,id:a,initial:"collapsed",animate:"open",exit:"collapsed",variants:{open:{opacity:1,height:"auto"},collapsed:{opacity:0,height:0}},transition:{duration:.1},children:(0,jd.jsx)("div",{className:"block-editor-link-control__drawer-inner",children:t})})})]})};var nI=n(19206);const rI=(0,Hp.f)((e=>t=>(0,jd.jsx)(e,{...t,speak:Yb.speak,debouncedSpeak:(0,nI.A)(Yb.speak,500)})),"withSpokenMessages");var oI=(0,Hp.f)((e=>class extends k.Component{timeouts;constructor(e){super(e),this.timeouts=[],this.setTimeout=this.setTimeout.bind(this),this.clearTimeout=this.clearTimeout.bind(this)}componentWillUnmount(){this.timeouts.forEach(clearTimeout)}setTimeout(e,t){const n=setTimeout((()=>{e(),this.clearTimeout(n)}),t);return this.timeouts.push(n),n}clearTimeout(e){clearTimeout(e),this.timeouts=this.timeouts.filter((t=>t!==e))}render(){return(0,jd.jsx)(e,{...this.props,setTimeout:this.setTimeout,clearTimeout:this.clearTimeout})}}),"withSafeTimeout"),iI=oI,sI=n(86619),aI=n(25222),lI=n(13417);function cI(e){return"function"==typeof e}class uI extends k.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,k.createRef)(),this.inputRef=(0,k.createRef)(),this.updateSuggestions=(0,FE.s)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.suggestionsRequest=null,this.state={suggestions:[],showSuggestions:!1,suggestionsValue:null,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:r,__experimentalShowInitialSuggestions:o=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&this.suggestionNodes[n].scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}),e.value===r||this.props.disableSuggestions||(r?.length?this.updateSuggestions(r):o&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{__experimentalShowInitialSuggestions:e=!1,value:t}=this.props;return e&&!(t&&t.length)}updateSuggestions(e=""){const{__experimentalFetchLinkSuggestions:t,__experimentalHandleURLSuggestions:n}=this.props;if(!t)return;const r=!e?.length;if(e=e.trim(),!r&&(e.length<2||!n&&(0,lI.m)(e)))return this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null,void this.setState({suggestions:[],showSuggestions:!1,suggestionsValue:e,selectedSuggestion:null,loading:!1});this.setState({selectedSuggestion:null,loading:!0});const o=t(e,{isInitialSuggestions:r});o.then((t=>{this.suggestionsRequest===o&&(this.setState({suggestions:t,suggestionsValue:e,loading:!1,showSuggestions:!!t.length}),t.length?this.props.debouncedSpeak((0,H.sprintf)((0,H._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",t.length),t.length),"assertive"):this.props.debouncedSpeak((0,H.__)("No results."),"assertive"))})).catch((()=>{this.suggestionsRequest===o&&this.setState({loading:!1})})).finally((()=>{this.suggestionsRequest===o&&(this.suggestionsRequest=null)})),this.suggestionsRequest=o}onChange(e){this.props.onChange(e.target.value)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||e&&e.length||null!==this.suggestionsRequest||this.updateSuggestions(n)}onKeyDown(e){this.props.onKeyDown?.(e);const{showSuggestions:t,selectedSuggestion:n,suggestions:r,loading:o}=this.state;if(!t||!r.length||o){switch(e.keyCode){case VE.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case VE.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case VE.ENTER:this.props.onSubmit&&(e.preventDefault(),this.props.onSubmit(null,e))}return}const i=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case VE.UP:{e.preventDefault();const t=n?n-1:r.length-1;this.setState({selectedSuggestion:t});break}case VE.DOWN:{e.preventDefault();const t=null===n||n===r.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case VE.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(i),this.props.speak((0,H.__)("Link selected.")));break;case VE.ENTER:e.preventDefault(),null!==this.state.selectedSuggestion?(this.selectLink(i),this.props.onSubmit&&this.props.onSubmit(i,e)):this.props.onSubmit&&this.props.onSubmit(null,e)}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps({value:e,instanceId:t,disableSuggestions:n,__experimentalShowInitialSuggestions:r=!1},{showSuggestions:o}){let i=o;const s=e&&e.length;return r||s||(i=!1),!0===n&&(i=!1),{showSuggestions:i,suggestionsListboxId:`block-editor-url-input-suggestions-${t}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${t}`}}render(){return(0,jd.jsxs)(jd.Fragment,{children:[this.renderControl(),this.renderSuggestions()]})}renderControl(){const{__nextHasNoMarginBottom:e=!1,label:t=null,className:n,isFullWidth:r,instanceId:o,placeholder:i=(0,H.__)("Paste URL or type to search"),__experimentalRenderControl:s,value:a="",hideLabelFromVision:l=!1}=this.props,{loading:c,showSuggestions:u,selectedSuggestion:d,suggestionsListboxId:h,suggestionOptionIdPrefix:p}=this.state,f=`url-input-control-${o}`,m={id:f,label:t,className:(0,Hy.A)("block-editor-url-input",n,{"is-full-width":r}),hideLabelFromVision:l},g={id:f,value:a,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:i,onKeyDown:this.onKeyDown,role:"combobox","aria-label":t?void 0:(0,H.__)("URL"),"aria-expanded":u,"aria-autocomplete":"list","aria-owns":h,"aria-activedescendant":null!==d?`${p}-${d}`:void 0,ref:this.inputRef};return s?s(m,g,c):(e||(0,q.default)("Bottom margin styles for wp.blockEditor.URLInput",{since:"6.2",version:"6.5",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"}),(0,jd.jsxs)(H_.Ay,{__nextHasNoMarginBottom:e,...m,children:[(0,jd.jsx)("input",{...g}),c&&(0,jd.jsx)(qE.Ay,{})]}))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t}=this.props,{showSuggestions:n,suggestions:r,suggestionsValue:o,selectedSuggestion:i,suggestionsListboxId:s,suggestionOptionIdPrefix:a,loading:l}=this.state;if(!n||0===r.length)return null;const c={id:s,ref:this.autocompleteRef,role:"listbox"},u=(e,t)=>({role:"option",tabIndex:"-1",id:`${a}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===i||void 0});return cI(t)?t({suggestions:r,selectedSuggestion:i,suggestionsListProps:c,buildSuggestionItemProps:u,isLoading:l,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!o?.length,currentInputValue:o}):(0,jd.jsx)(qC.Ay,{placement:"bottom",focusOnMount:!1,children:(0,jd.jsx)("div",{...c,className:(0,Hy.A)("block-editor-url-input__suggestions",`${e}__suggestions`),children:r.map(((e,t)=>(0,k.createElement)(Xy.Ay,{...u(0,t),key:e.id,className:(0,Hy.A)("block-editor-url-input__suggestion",{"is-selected":t===i}),onClick:()=>this.handleOnClick(e)},e.title)))})})}}const dI=(0,D.A)(iI,rI,sI.A,(0,aI.A)(((e,t)=>{if(cI(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(dy);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(uI);var hI=n(87948);const pI=({searchTerm:e,onClick:t,itemProps:n,buttonText:r})=>{if(!e)return null;let o;return o=r?"function"==typeof r?r(e):r:(0,hI.A)((0,H.sprintf)((0,H.__)("Create: %s"),e),{mark:(0,jd.jsx)("mark",{})}),(0,jd.jsx)(w_.A,{...n,iconPosition:"left",icon:ZS.A,className:"block-editor-link-control__search-item",onClick:t,children:o})},fI=e=>{const{text:t="",highlight:n=""}=e,r=n.trim();if(!r)return(0,jd.jsx)(jd.Fragment,{children:t});const o=new RegExp(`(${(0,rk.Nt)(r)})`,"gi");return(0,hI.A)(t.replace(o,"$&"),{mark:(0,jd.jsx)("mark",{})})};var mI=n(97169),gI=n(693),bI=n(27692),vI=n(31486),yI=n(19212),_I=n(48329),xI=n(32637),wI=n(25913),kI=n(17424),CI=n(51737),SI=n(99502);const AI={post:mI.A,page:gI.A,post_tag:bI.A,category:vI.A,attachment:yI.A};function EI({isURL:e,suggestion:t}){let n=null;return e?n=_I.A:t.type in AI&&(n=AI[t.type],"page"===t.type&&(t.isFrontPage&&(n=xI.A),t.isBlogHome&&(n=wI.A))),n?(0,jd.jsx)(ak.A,{className:"block-editor-link-control__search-item-icon",icon:n}):null}function II(e){const t=e?.trim();return t?.length?e?.replace(/^\/?/,"/"):e}function jI(e){const t=e?.trim();return t?.length?e?.replace(/\/$/,""):e}function TI(e){return e.isFrontPage?"front page":e.isBlogHome?"blog home":"post_tag"===e.type?"tag":e.type}const BI=({itemProps:e,suggestion:t,searchTerm:n,onClick:r,isURL:o=!1,shouldShowType:i=!1})=>{const s=o?(0,H.__)("Press ENTER to add this link"):(a=t.url)?(0,Qp.h)(kI.S,CI.Y,(e=>null==e||e!=e?"":e),((e,...t)=>(...n)=>e(...n,...t))(SI.r,24),jI,II)(a):a;var a;return(0,jd.jsx)(w_.A,{...e,info:s,iconPosition:"left",icon:(0,jd.jsx)(EI,{suggestion:t,isURL:o}),onClick:r,shortcut:i&&TI(t),className:"block-editor-link-control__search-item",children:(0,jd.jsx)(fI,{text:(0,ac.A)(t.title),highlight:n})})},RI="__CREATE__",NI="link",DI="mailto",MI="internal",PI=[NI,DI,"tel",MI],OI=[{id:"opensInNewTab",title:(0,H.__)("Open in new tab")}];function LI({instanceId:e,withCreateSuggestion:t,currentInputValue:n,handleSuggestionClick:r,suggestionsListProps:o,buildSuggestionItemProps:i,suggestions:s,selectedSuggestion:a,isLoading:l,isInitialSuggestions:c,createSuggestionButtonText:u,suggestionsQuery:d}){const h=(0,Hy.A)("block-editor-link-control__search-results",{"is-loading":l}),p=1===s.length&&PI.includes(s[0].type),f=t&&!p&&!c,m=!d?.type,g=`block-editor-link-control-search-results-label-${e}`,b=c?(0,H.__)("Suggestions"):(0,H.sprintf)((0,H.__)('Search results for "%s"'),n),v=(0,jd.jsx)(WA.A,{id:g,children:b});return(0,jd.jsxs)("div",{className:"block-editor-link-control__search-results-wrapper",children:[v,(0,jd.jsx)("div",{...o,className:h,"aria-labelledby":g,children:(0,jd.jsx)(x_.A,{children:s.map(((e,t)=>f&&RI===e.type?(0,jd.jsx)(pI,{searchTerm:n,buttonText:u,onClick:()=>r(e),itemProps:i(e,t),isSelected:t===a},e.type):RI===e.type?null:(0,jd.jsx)(BI,{itemProps:i(e,t),suggestion:e,index:t,onClick:()=>{r(e)},isSelected:t===a,isURL:PI.includes(e.type),searchTerm:n,shouldShowType:m,isFrontPage:e?.isFrontPage,isBlogHome:e?.isBlogHome},`${e.id}-${e.type}`)))})})]})}var FI=n(40670),zI=n(98526),UI=n(12319),VI=n(76403);function HI(e){if(e.includes(" "))return!1;const t=(0,FI.J)(e),n=(0,UI.v)(t),r=function(e,t=6){const n=e.split(/[?#]/)[0];return new RegExp(`(?<=\\S)\\.(?:[a-zA-Z_]{2,${t}})(?:\\/|$)`).test(n)}(e),o=e?.startsWith("www."),i=e?.startsWith("#")&&(0,VI.R)(e);return n||o||i||r}const $I=()=>Promise.resolve([]),WI=e=>{let t=NI;const n=(0,FI.J)(e)||"";return n.includes("mailto")&&(t=DI),n.includes("tel")&&(t="tel"),e?.startsWith("#")&&(t=MI),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,zI.N)(e):e,type:t}])};const GI=()=>Promise.resolve([]),qI=()=>{},KI=(0,k.forwardRef)((({value:e,children:t,currentLink:n={},className:r=null,placeholder:o=null,withCreateSuggestion:i=!1,onCreateSuggestion:s=qI,onChange:a=qI,onSelect:l=qI,showSuggestions:c=!0,renderSuggestions:u=(e=>(0,jd.jsx)(LI,{...e})),fetchSuggestions:d=null,allowDirectEntry:h=!0,showInitialSuggestions:p=!1,suggestionsQuery:f={},withURLSuggestion:m=!0,createSuggestionButtonText:g,hideLabelFromVision:b=!1},v)=>{const y=function(e,t,n){const{fetchSearchSuggestions:r,pageOnFront:o,pageForPosts:i}=(0,Ul.A)((e=>{const{getSettings:t}=e(dy);return{pageOnFront:t().pageOnFront,pageForPosts:t().pageForPosts,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),s=t?WI:$I;return(0,k.useCallback)(((t,{isInitialSuggestions:a})=>HI(t)?s(t,{isInitialSuggestions:a}):(async(e,t,n,r,o,i)=>{const{isInitialSuggestions:s}=t,a=await n(e,t);return a.map((e=>Number(e.id)===o?(e.isFrontPage=!0,e):Number(e.id)===i?(e.isBlogHome=!0,e):e)),s||HI(e)||!r?a:a.concat({title:e,url:e,type:RI})})(t,{...e,isInitialSuggestions:a},r,n,o,i)),[s,r,o,i,e,n])}(f,h,i),_=c?d||y:GI,x=(0,F_.A)(KI),[w,C]=(0,k.useState)(),S=async e=>{let t=e;if(RI!==e.type){if(h||t&&Object.keys(t).length>=1){const{id:e,url:r,...o}=null!=n?n:{};l({...o,...t},t)}}else try{t=await s(e.title),t?.url&&l(t)}catch(e){}};return(0,jd.jsxs)("div",{className:"block-editor-link-control__search-input-container",children:[(0,jd.jsx)(dI,{disableSuggestions:n?.url===e,__nextHasNoMarginBottom:!0,label:(0,H.__)("Link"),hideLabelFromVision:b,className:r,value:e,onChange:(e,t)=>{a(e),C(t)},placeholder:null!=o?o:(0,H.__)("Search or type url"),__experimentalRenderSuggestions:c?e=>u({...e,instanceId:x,withCreateSuggestion:i,createSuggestionButtonText:g,suggestionsQuery:f,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),S(t)}}):null,__experimentalFetchLinkSuggestions:_,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:p,onSubmit:(t,n)=>{const r=t||w;r||e?.trim()?.length?S(r||{url:e}):n.preventDefault()},ref:v}),t]})})),YI=KI;var JI=n(79566),XI=n(93942);function ZI(e){const t=(0,k.useRef)(e);return(0,k.useLayoutEffect)((()=>{t.current=e}),[e]),t}function QI(e,t){const n=ZI(e),r=ZI(t);return(0,zC.A)((e=>{const t=new XI(e,{text:()=>"function"==typeof n.current?n.current():n.current||""});return t.on("success",(({clearSelection:e})=>{e(),r.current&&r.current()})),()=>{t.destroy()}}),[])}var ej=n(74314),tj=n(50446),nj=n(42622),rj=n(6497);const{Slot:oj,Fill:ij}=(0,Hl.QJ)("BlockEditorLinkControlViewer");function sj(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}const aj=function(e){const[t,n]=(0,k.useReducer)(sj,{richData:null,isFetching:!1}),{fetchRichUrlData:r}=(0,Ul.A)((e=>{const{getSettings:t}=e(dy);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,k.useEffect)((()=>{if(e?.length&&r&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,o=t.signal;return r(e,{signal:o}).then((e=>{n({type:"RESOLVED",richData:e})})).catch((()=>{o.aborted||n({type:"ERROR"})})),()=>{t.abort()}}}),[e]),t};function lj({value:e,onEditClick:t,hasRichPreviews:n=!1,hasUnlinkControl:r=!1,onRemove:o}){const i=(0,Ul.A)((e=>e(XE.M).get("core","showIconLabels")),[]),s=n?e?.url:null,{richData:a,isFetching:l}=aj(s),c=a&&Object.keys(a).length,u=e&&(0,SI.r)((0,kI.S)(e.url),24)||"",d=!e?.url?.length,h=!d&&(0,ac.A)(a?.title||e?.title||u);let p;p=a?.icon?(0,jd.jsx)("img",{src:a?.icon,alt:""}):d?(0,jd.jsx)(ak.A,{icon:ej.A,size:32}):(0,jd.jsx)(ak.A,{icon:_I.A});const{createNotice:f}=(0,Vl.A)(Jb.store),m=QI(e.url,(()=>{f("info",(0,H.__)("Link copied to clipboard."),{isDismissible:!0,type:"snackbar"})}));return(0,jd.jsx)("div",{"aria-label":(0,H.__)("Currently selected"),className:(0,Hy.A)("block-editor-link-control__search-item",{"is-current":!0,"is-rich":c,"is-fetching":!!l,"is-preview":!0,"is-error":d,"is-url-title":h===u}),children:(0,jd.jsxs)("div",{className:"block-editor-link-control__search-item-top",children:[(0,jd.jsxs)("span",{className:"block-editor-link-control__search-item-header",children:[(0,jd.jsx)("span",{className:(0,Hy.A)("block-editor-link-control__search-item-icon",{"is-image":a?.icon}),children:p}),(0,jd.jsx)("span",{className:"block-editor-link-control__search-item-details",children:d?(0,jd.jsx)("span",{className:"block-editor-link-control__search-item-error-notice",children:(0,H.__)("Link is empty")}):(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsx)(JI.A,{className:"block-editor-link-control__search-item-title",href:e.url,children:(0,jd.jsx)($A.A,{numberOfLines:1,children:h})}),e?.url&&h!==u&&(0,jd.jsx)("span",{className:"block-editor-link-control__search-item-info",children:(0,jd.jsx)($A.A,{numberOfLines:1,children:u})})]})})]}),(0,jd.jsx)(Xy.Ay,{icon:tj.A,label:(0,H.__)("Edit link"),onClick:t,size:"compact"}),r&&(0,jd.jsx)(Xy.Ay,{icon:nj.A,label:(0,H.__)("Remove link"),onClick:o,size:"compact"}),(0,jd.jsx)(Xy.Ay,{icon:rj.A,label:(0,H.sprintf)((0,H.__)("Copy link%s"),d||i?"":": "+e.url),ref:m,disabled:d,size:"compact"}),(0,jd.jsx)(oj,{fillProps:e})]})})}var cj=n(33973);const uj=()=>{},dj=({value:e,onChange:t=uj,settings:n})=>{if(!n||!n.length)return null;const r=n=>r=>{t({...e,[n.id]:r})},o=n.map((t=>(0,jd.jsx)(cj.A,{__nextHasNoMarginBottom:!0,className:"block-editor-link-control__setting",label:t.title,onChange:r(t),checked:!!e&&!!e[t.id],help:t?.help},t.id)));return(0,jd.jsxs)("fieldset",{className:"block-editor-link-control__settings",children:[(0,jd.jsx)(WA.A,{as:"legend",children:(0,H.__)("Currently selected link settings")}),o]})};var hj=n(7040),pj=n.n(hj);const fj=()=>{},mj="core/block-editor",gj="linkControlSettingsDrawer";function bj({searchInputPlaceholder:e,value:t,settings:n=OI,onChange:r=fj,onRemove:o,onCancel:i,noDirectEntry:s=!1,showSuggestions:a=!0,showInitialSuggestions:l,forceIsEditingLink:c,createSuggestion:u,withCreateSuggestion:d,inputValue:h="",suggestionsQuery:p={},noURLSuggestion:f=!1,createSuggestionButtonText:m,hasRichPreviews:g=!1,hasTextControl:b=!1,renderControlBottom:v=null}){void 0===d&&u&&(d=!0);const[y,_]=(0,k.useState)(!1),{advancedSettingsPreference:x}=(0,Ul.A)((e=>{var t;return{advancedSettingsPreference:null!==(t=e(XE.M).get(mj,gj))&&void 0!==t&&t}}),[]),{set:w}=(0,Vl.A)(XE.M),C=x||y,S=(0,k.useRef)(!0),A=(0,k.useRef)(),E=(0,k.useRef)(),I=(0,k.useRef)(!1),j=n.map((({id:e})=>e)),[T,B,R,N,D]=function(e){const[t,n]=(0,k.useState)(e||{}),[r,o]=(0,k.useState)(e);return pj()(e,r)||(o(e),n(e)),[t,n,e=>{n({...t,url:e})},e=>{n({...t,title:e})},e=>r=>{const o=Object.keys(r).reduce(((t,n)=>(e.includes(n)&&(t[n]=r[n]),t)),{});n({...t,...o})}]}(t),M=t&&!(0,JE.A)(T,t),[P,O]=(0,k.useState)(void 0!==c?c:!t||!t.url),{createPage:L,isCreatingPage:F,errorMessage:z}=function(e){const t=(0,k.useRef)(),[n,r]=(0,k.useState)(!1),[o,i]=(0,k.useState)(null);return(0,k.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){r(!0),i(null);try{return t.current=(e=>{let t=!1;const n=new Promise(((n,r)=>{e.then((e=>t?r({isCanceled:!0}):n(e)),(e=>r(t?{isCanceled:!0}:e)))}));return{promise:n,cancel(){t=!0}}})(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw i(e.message||(0,H.__)("An unknown error occurred during creation. Please try again.")),e}finally{r(!1)}},isCreatingPage:n,errorMessage:o}}(u);(0,k.useEffect)((()=>{void 0!==c&&O(c)}),[c]),(0,k.useEffect)((()=>{S.current||((ME.focus.focusable.find(A.current)[0]||A.current).focus(),I.current=!1)}),[P,F]),(0,k.useEffect)((()=>(S.current=!1,()=>{S.current=!0})),[]);const U=t?.url?.trim()?.length>0,V=()=>{I.current=!!A.current?.contains(A.current.ownerDocument.activeElement),O(!1)},$=()=>{M&&r({...t,...T,url:W}),V()},W=h||T?.url||"",G=!W?.trim()?.length,q=o&&t&&!P&&!F,K=P&&U,Y=U&&b,J=(P||!t)&&!F,X=!M||G,Z=!!n?.length&&P&&U;return(0,jd.jsxs)("div",{tabIndex:-1,ref:A,className:"block-editor-link-control",children:[F&&(0,jd.jsxs)("div",{className:"block-editor-link-control__loading",children:[(0,jd.jsx)(qE.Ay,{})," ",(0,H.__)("Creating"),"…"]}),J&&(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsxs)("div",{className:(0,Hy.A)({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":Y,"has-actions":K}),children:[Y&&(0,jd.jsx)(KE.A,{__nextHasNoMarginBottom:!0,ref:E,className:"block-editor-link-control__field block-editor-link-control__text-content",label:(0,H.__)("Text"),value:T?.title,onChange:N,onKeyDown:e=>{const{keyCode:t}=e;t!==VE.ENTER||G||(e.preventDefault(),$())},size:"__unstable-large"}),(0,jd.jsx)(YI,{currentLink:t,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:e,value:W,withCreateSuggestion:d,onCreateSuggestion:L,onChange:R,onSelect:e=>{const t=Object.keys(e).reduce(((t,n)=>(j.includes(n)||(t[n]=e[n]),t)),{});r({...T,...t,title:T?.title||e?.title}),V()},showInitialSuggestions:l,allowDirectEntry:!s,showSuggestions:a,suggestionsQuery:p,withURLSuggestion:!f,createSuggestionButtonText:m,hideLabelFromVision:!Y}),!K&&(0,jd.jsx)("div",{className:"block-editor-link-control__search-enter",children:(0,jd.jsx)(Xy.Ay,{onClick:X?fj:$,label:(0,H.__)("Submit"),icon:ZE.A,className:"block-editor-link-control__search-submit","aria-disabled":X})})]}),z&&(0,jd.jsx)(YE.A,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1,children:z})]}),t&&!P&&!F&&(0,jd.jsx)(lj,{value:t,onEditClick:()=>O(!0),hasRichPreviews:g,hasUnlinkControl:q,onRemove:()=>{o(),O(!0)}},t?.url),Z&&(0,jd.jsx)("div",{className:"block-editor-link-control__tools",children:!G&&(0,jd.jsx)(tI,{settingsOpen:C,setSettingsOpen:e=>{w&&w(mj,gj,e),_(e)},children:(0,jd.jsx)(dj,{value:T,settings:n,onChange:D(j)})})}),K&&(0,jd.jsxs)(eA.A,{justify:"right",className:"block-editor-link-control__search-actions",children:[(0,jd.jsx)(Xy.Ay,{variant:"tertiary",onClick:e=>{e.preventDefault(),e.stopPropagation(),B(t),U?V():o?.(),i?.()},children:(0,H.__)("Cancel")}),(0,jd.jsx)(Xy.Ay,{variant:"primary",onClick:X?fj:$,className:"block-editor-link-control__search-submit","aria-disabled":X,children:(0,H.__)("Save")})]}),!F&&v&&v()]})}bj.ViewerFill=ij,bj.DEFAULT_LINK_SETTINGS=OI;const vj=bj,yj=()=>{};let _j=0;const xj=(0,D.A)([(0,UE.A)((e=>{const{createNotice:t,removeNotice:n}=e(Jb.store);return{createNotice:t,removeNotice:n}})),zE("editor.MediaReplaceFlow")])((({mediaURL:e,mediaId:t,mediaIds:n,allowedTypes:r,accept:o,onError:i,onSelect:s,onSelectURL:a,onToggleFeaturedImage:l,useFeaturedImage:c,onFilesUpload:u=yj,name:d=(0,H.__)("Replace"),createNotice:h,removeNotice:p,children:f,multiple:m=!1,addToGallery:g,handleUpload:b=!0,popoverProps:v})=>{const y=(0,Ul.A)((e=>e(dy).getSettings().mediaUpload),[]),_=!!y,x=(0,k.useRef)(),w="block-editor/media-replace-flow/error-notice/"+ ++_j,C=e=>{const t=(0,ac.A)(e);i?i(t):setTimeout((()=>{h("error",t,{speak:!0,id:w,isDismissible:!0})}),1e3)},S=(e,t)=>{c&&l&&l(),t(),s(e),(0,Yb.speak)((0,H.__)("The media file has been replaced")),p(w)},A=e=>{e.keyCode===VE.DOWN&&(e.preventDefault(),e.target.click())},E=m&&!(!r||0===r.length)&&r.every((e=>"image"===e||e.startsWith("image/")));return(0,jd.jsx)(PE.A,{popoverProps:v,contentClassName:"block-editor-media-replace-flow__options",renderToggle:({isOpen:e,onToggle:t})=>(0,jd.jsx)(n_,{ref:x,"aria-expanded":e,"aria-haspopup":"true",onClick:t,onKeyDown:A,children:d}),renderContent:({onClose:i})=>(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsxs)(OE.Ay,{className:"block-editor-media-replace-flow__media-upload-menu",children:[(0,jd.jsxs)(GE,{children:[(0,jd.jsx)(WE,{gallery:E,addToGallery:g,multiple:m,value:m?n:t,onSelect:e=>S(e,i),allowedTypes:r,render:({open:e})=>(0,jd.jsx)(w_.A,{icon:HE.A,onClick:e,children:(0,H.__)("Open Media Library")})}),(0,jd.jsx)(LE,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!b)return t(),s(n);u(n),y({allowedTypes:r,filesList:n,onFileChange:([e])=>{S(e,t)},onError:C})})(e,i)},accept:o,multiple:!!m,render:({openFileDialog:e})=>(0,jd.jsx)(w_.A,{icon:YA.A,onClick:()=>{e()},children:(0,H.__)("Upload")})})]}),l&&(0,jd.jsx)(w_.A,{icon:$E.A,onClick:l,isPressed:c,children:(0,H.__)("Use featured image")}),f]}),a&&(0,jd.jsxs)("form",{className:(0,Hy.A)("block-editor-media-flow__url-input",{"has-siblings":_||l}),children:[(0,jd.jsx)("span",{className:"block-editor-media-replace-flow__image-url-label",children:(0,H.__)("Current media URL:")}),(0,jd.jsx)(vj,{value:{url:e},settings:[],showSuggestions:!1,onChange:({url:e})=>{a(e),x.current.focus()}})]})]})})}));function wj(e,t=[]){const n=t.find((t=>t.name===e));return n?.href?n?.href:e}const kj="image",Cj={backgroundImage:!0,backgroundSize:!1};function Sj(e){return"web"===Oh.A.OS&&e?.background?.backgroundImage}function Aj(e){return!!e?.background?.backgroundImage?.id||"string"==typeof e?.background?.backgroundImage||!!e?.background?.backgroundImage?.url}const Ej=e=>{if(!(!e||isNaN(e.x)&&isNaN(e.y)))return`${100*(isNaN(e.x)?.5:e.x)}% ${100*(isNaN(e.y)?.5:e.y)}%`},Ij=e=>{if(!e)return{x:void 0,y:void 0};let[t,n]=e.split(" ").map((e=>parseFloat(e)/100));return t=isNaN(t)?void 0:t,n=isNaN(n)?t:n,{x:t,y:n}};function jj({label:e,filename:t,url:n}){const r=e||(0,DE.e)(n)||(0,H.__)("Add background image");return(0,jd.jsx)(HA,{as:"span",children:(0,jd.jsxs)(eA.A,{justify:n?"flex-start":"center",as:"span",children:[n&&(0,jd.jsx)("span",{className:(0,Hy.A)("block-editor-global-styles-background-panel__inspector-image-indicator-wrapper",{"has-image":n}),"aria-hidden":!0,children:(0,jd.jsx)("span",{className:"block-editor-global-styles-background-panel__inspector-image-indicator",style:{backgroundImage:`url(${n})`}})}),(0,jd.jsxs)(B_.A,{as:"span",children:[(0,jd.jsx)($A.A,{numberOfLines:1,className:"block-editor-global-styles-background-panel__inspector-media-replace-title",children:r}),(0,jd.jsx)(WA.A,{as:"span",children:n?(0,H.sprintf)((0,H.__)("Background image: %s"),t||r):(0,H.__)("No background image selected")})]})]})})}function Tj({panelId:e,isShownByDefault:t,onChange:n,style:r,inheritedValue:o,themeFileURIs:i}){const s=(0,Ul.A)((e=>e(dy).getSettings().mediaUpload),[]),{id:a,title:l,url:c}=r?.background?.backgroundImage||{...o?.background?.backgroundImage},u=(0,k.useRef)(),{createErrorNotice:d}=(0,Vl.A)(Jb.store),h=e=>{d(e,{type:"snackbar"})},p=()=>n(Of(r,["background","backgroundImage"],void 0)),f=e=>{if(!e||!e.url)return void p();if(ec(e.url))return;if(e.media_type&&e.media_type!==kj||!e.media_type&&e.type&&e.type!==kj)return void h((0,H.__)("Only images can be used as a background image."));const t=r?.background?.backgroundSize,o=r?.background?.backgroundPosition;n(Of(r,["background"],{...r?.background,backgroundImage:{url:e.url,id:e.id,source:"file",title:e.title||void 0},backgroundPosition:o||"auto"!==t&&t?o:"50% 0"}))},m=(0,k.useCallback)((e=>({...e,style:{...e.style,background:void 0}})),[]),g=Aj(r),b=()=>{const[e]=ME.focus.tabbable.find(u.current);e?.focus(),e?.click()},v=!g&&Aj(o);return(0,jd.jsx)(KA,{className:"single-column",hasValue:()=>g,label:(0,H.__)("Background image"),onDeselect:p,isShownByDefault:t,resetAllFilter:m,panelId:e,children:(0,jd.jsxs)("div",{className:"block-editor-global-styles-background-panel__inspector-media-replace-container",ref:u,children:[(0,jd.jsxs)(xj,{mediaId:a,mediaURL:c,allowedTypes:[kj],accept:"image/*",onSelect:f,name:(0,jd.jsx)(jj,{label:l,filename:l,url:wj(c,i)}),variant:"secondary",children:[v&&(0,jd.jsx)(w_.A,{onClick:()=>{b(),n(Of(r,["background","backgroundImage"],"none"))},children:(0,H.__)("Remove")}),g&&(0,jd.jsx)(w_.A,{onClick:()=>{b(),p()},children:(0,H.__)("Reset ")})]}),(0,jd.jsx)(rE,{onFilesDrop:e=>{s({allowedTypes:[kj],filesList:e,onFileChange([e]){ec(e?.url)||f(e)},onError:h})},label:(0,H.__)("Drop to upload")})]})})}function Bj({panelId:e,isShownByDefault:t,onChange:n,style:r,inheritedValue:o,defaultValues:i,themeFileURIs:s}){const a=r?.background?.backgroundSize||o?.background?.backgroundSize,l=r?.background?.backgroundRepeat||o?.background?.backgroundRepeat,c=r?.background?.backgroundImage?.url||o?.background?.backgroundImage?.url,u=r?.background?.backgroundPosition||o?.background?.backgroundPosition,d=void 0!==a&&"cover"!==a&&"contain"!==a||""===a?"auto":a||i?.backgroundSize,h=!("no-repeat"===l||"cover"===d&&void 0===l),p=function(e){return void 0!==e?.background?.backgroundPosition||void 0!==e?.background?.backgroundSize}(r),f=(0,k.useCallback)((e=>({...e,style:{...e.style,background:{...e.style?.background,backgroundRepeat:void 0,backgroundSize:void 0}}})),[]),m=e=>{let t=l,o=u;"contain"===e&&(t="no-repeat",o=void 0),"cover"===e&&(t=void 0,o=void 0),"cover"!==d&&"contain"!==d||"auto"!==e||(t=void 0,r?.background?.backgroundImage?.id&&(o="50% 0")),e||"auto"!==d||(e="auto"),n(Of(r,["background"],{...r?.background,backgroundPosition:o,backgroundRepeat:t,backgroundSize:e}))};return(0,jd.jsxs)(oE.A,{as:KA,spacing:2,className:"single-column",hasValue:()=>p,label:(0,H.__)("Size"),onDeselect:()=>n(Of(r,["background"],{...r?.background,backgroundPosition:void 0,backgroundRepeat:void 0,backgroundSize:void 0})),isShownByDefault:t,resetAllFilter:f,panelId:e,children:[(0,jd.jsx)(NE,{__next40pxDefaultSize:!0,label:(0,H.__)("Position"),url:wj(c,s),value:Ij(u),onChange:e=>{n(Of(r,["background","backgroundPosition"],Ej(e)))}}),(0,jd.jsxs)(xx,{size:"__unstable-large",label:(0,H.__)("Size"),value:d,onChange:m,isBlock:!0,help:(g=a||i?.backgroundSize,"cover"===g||void 0===g?(0,H.__)("Image covers the space evenly."):"contain"===g?(0,H.__)("Image is contained without distortion."):(0,H.__)("Image has a fixed width.")),children:[(0,jd.jsx)(FC,{value:"cover",label:(0,H.__)("Cover")},"cover"),(0,jd.jsx)(FC,{value:"contain",label:(0,H.__)("Contain")},"contain"),(0,jd.jsx)(FC,{value:"auto",label:(0,H.__)("Tile")},"tile")]}),(0,jd.jsxs)(eA.A,{justify:"flex-start",spacing:2,as:"span",children:[void 0!==d&&"cover"!==d&&"contain"!==d?(0,jd.jsx)(sk,{"aria-label":(0,H.__)("Background image width"),onChange:m,value:a,size:"__unstable-large",__unstableInputWidth:"100px",min:0,placeholder:(0,H.__)("Auto")}):null,"cover"!==d&&(0,jd.jsx)(Vx.A,{label:(0,H.__)("Repeat"),checked:h,onChange:()=>n(Of(r,["background","backgroundRepeat"],!0===h?"no-repeat":"repeat"))})]})]});var g}function Rj({resetAllFilter:e,onChange:t,value:n,panelId:r,children:o,headerLabel:i}){return(0,jd.jsx)(oE.A,{as:xA,spacing:4,label:i,resetAll:()=>{const r=e(n);t(r)},panelId:r,dropdownMenuProps:Iy,children:o})}function Nj({as:e=Rj,value:t,onChange:n,inheritedValue:r=t,settings:o,panelId:i,defaultControls:s=Cj,defaultValues:a={},headerLabel:l=(0,H.__)("Background image"),themeFileURIs:c}){const u=(0,k.useCallback)((e=>({...e,background:{}})),[]),d=o?.background?.backgroundSize;return(0,jd.jsxs)(e,{resetAllFilter:u,value:t,onChange:n,panelId:i,headerLabel:l,children:[(0,jd.jsx)(Tj,{onChange:n,panelId:i,isShownByDefault:s.backgroundImage,style:t,inheritedValue:r,themeFileURIs:c}),d&&(0,jd.jsx)(Bj,{onChange:n,panelId:i,isShownByDefault:s.backgroundSize,style:t,inheritedValue:r,defaultValues:a,themeFileURIs:c})]})}const Dj="background",Mj={backgroundSize:"cover"};function Pj(e,t="any"){const n=Ec(e,Dj);return!!(!0===n||("any"===t?n?.backgroundImage||n?.backgroundSize||n?.backgroundRepeat:n?.[t]))}function Oj(e){return Aj(e)?"has-background":""}function Lj({children:e}){const t=(0,k.useCallback)((e=>({...e,style:{...e.style,background:void 0}})),[]);return(0,jd.jsx)(EA,{group:"background",resetAllFilter:t,children:e})}function Fj({clientId:e,name:t,setAttributes:n,settings:r}){const o=(0,Ul.A)((t=>t(dy).getBlockAttributes(e)?.style),[e]);if(!Sj(r)||!Pj(t,"backgroundImage"))return null;const i=Ec(t,[Dj,"__experimentalDefaultControls"]),s={...r,background:{...r.background,backgroundSize:r?.background?.backgroundSize&&Pj(t,"backgroundSize")}};return(0,jd.jsx)(Nj,{as:Lj,panelId:e,defaultControls:i,defaultValues:Mj,settings:s,onChange:e=>{n({style:$y(e)})},value:o})}const zj={useBlockProps:function({name:e,style:t}){if(!Pj(e)||!t?.background?.backgroundImage)return;const n=function(e){if(!e)return;const t=e?.backgroundImage;let n;return t?.url&&(e?.backgroundSize||(n={backgroundSize:"cover"}),"contain"!==e?.backgroundSize||e?.backgroundPosition||(n={backgroundPosition:"center"})),n}(t?.background);return n?{style:{...n}}:void 0},attributeKeys:["style"],hasSupport:Pj};(0,Tu.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.lock)&&void 0!==t?t:{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const Uj=/[\s#]/g,Vj={type:"string",source:"attribute",attribute:"id",selector:"*"},Hj={addSaveProps:function(e,t,n){return Ic(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e},edit:function({anchor:e,setAttributes:t}){if("default"!==ES())return null;const n="web"===Oh.A.OS;return(0,jd.jsx)(EA,{group:"advanced",children:(0,jd.jsx)(KE.A,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"html-anchor-control",label:(0,H.__)("HTML anchor"),help:(0,jd.jsxs)(jd.Fragment,{children:[(0,H.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor”. Then, you’ll be able to link directly to this section of your page."),n&&(0,jd.jsxs)(jd.Fragment,{children:[" ",(0,jd.jsx)(JI.A,{href:(0,H.__)("https://wordpress.org/documentation/article/page-jumps/"),children:(0,H.__)("Learn more about anchors")})]})]}),value:e||"",placeholder:n?null:(0,H.__)("Add an anchor"),onChange:e=>{e=e.replace(Uj,"-"),t({anchor:e})},autoCapitalize:"none",autoComplete:"off"})})},attributeKeys:["anchor"],hasSupport:e=>Ic(e,"anchor")};(0,Tu.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.anchor)&&void 0!==t?t:{})||Ic(e,"anchor")&&(e.attributes={...e.attributes,anchor:Vj}),e}));const $j={type:"string",source:"attribute",attribute:"aria-label",selector:"*"},Wj={addSaveProps:function(e,t,n){return Ic(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e},attributeKeys:["ariaLabel"],hasSupport:e=>Ic(e,"ariaLabel")};(0,Tu.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){return e?.attributes?.ariaLabel?.type||Ic(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:$j}),e}));const Gj={edit:function({className:e,setAttributes:t}){return"default"!==ES()?null:(0,jd.jsx)(EA,{group:"advanced",children:(0,jd.jsx)(KE.A,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,autoComplete:"off",label:(0,H.__)("Additional CSS class(es)"),value:e||"",onChange:e=>{t({className:""!==e?e:void 0})},help:(0,H.__)("Separate multiple classes with spaces.")})})},addSaveProps:function(e,t,n){return Ic(t,"customClassName",!0)&&n.className&&(e.className=(0,Hy.A)(e.className,n.className)),e},attributeKeys:["className"],hasSupport:e=>Ic(e,"customClassName",!0)};(0,Tu.addFilter)("blocks.registerBlockType","core/editor/custom-class-name/attribute",(function(e){return Ic(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,Tu.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,r){if(!Ic(e.name,"customClassName",!0))return e;if(1===r.length&&e.innerBlocks.length===t.length)return e;if(1===r.length&&t.length>1||r.length>1&&1===t.length)return e;if(t[n]){const r=t[n]?.attributes.className;if(r)return{...e,attributes:{...e.attributes,className:r}}}return e})),(0,Tu.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return Ic(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([Td(t.name),...e.className.split(" ")])].join(" ").trim():e.className=Td(t.name)),e}));const qj=/^([\d.\-+]*)\s*(fr|cm|mm|Q|in|pc|pt|px|em|ex|ch|rem|lh|vw|vh|vmin|vmax|%|cap|ic|rlh|vi|vb|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx|svw|lvw|dvw|svh|lvh|dvh|svi|lvi|dvi|svb|lvb|dvb|svmin|lvmin|dvmin|svmax|lvmax|dvmax)?$/,Kj=["top","right","bottom","left"],Yj=["color","style","width"],Jj=e=>!e||!Yj.some((t=>void 0!==e[t])),Xj=e=>!!e&&(Zj(e)?!Kj.every((t=>Jj(e[t]))):!Jj(e)),Zj=(e={})=>Object.keys(e).some((e=>-1!==Kj.indexOf(e))),Qj=e=>{if(!Zj(e))return!1;const t=Kj.map((t=>eT(e?.[t])));return!t.every((e=>e===t[0]))},eT=(e,t)=>{if(Jj(e))return t;const{color:n,style:r,width:o}=t||{},{color:i=n,style:s=r,width:a=o}=e;return[a,a&&"0"!==a||i?s||"solid":s,i].filter(Boolean).join(" ")},tT=e=>function(e){if(0===e.length)return;const t={};let n,r=0;return e.forEach((e=>{t[e]=void 0===t[e]?1:t[e]+1,t[e]>r&&(n=e,r=t[e])})),n}(e.map((e=>void 0===e?void 0:function(e){const t=e.trim().match(qj);if(!t)return[void 0,void 0];const[,n,r]=t;let o=parseFloat(n);return o=Number.isNaN(o)?void 0:o,[o,r]}(`${e}`)[1])).filter((e=>void 0!==e)));(0,oc.X$)([ic.A,sc.A]);const{kebabCase:nT}=kf(u_.j),rT=(e,t,n)=>{if(t){const n=e?.find((e=>e.slug===t));if(n)return n}return{color:n}},oT=(e,t)=>e?.find((e=>e.color===t));function iT(e,t){if(e&&t)return`has-${nT(t)}-${e}`}function sT(){const[e,t,n,r,o,i,s,a,l,c]=py("color.custom","color.palette.custom","color.palette.theme","color.palette.default","color.defaultPalette","color.customGradient","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients"),u={disableCustomColors:!e,disableCustomGradients:!i};return u.colors=(0,k.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,H._x)("Theme","Indicates this palette comes from the theme."),colors:n}),o&&r&&r.length&&e.push({name:(0,H._x)("Default","Indicates this palette comes from WordPress."),colors:r}),t&&t.length&&e.push({name:(0,H._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[t,n,r,o]),u.gradients=(0,k.useMemo)((()=>{const e=[];return a&&a.length&&e.push({name:(0,H._x)("Theme","Indicates this palette comes from the theme."),gradients:a}),c&&l&&l.length&&e.push({name:(0,H._x)("Default","Indicates this palette comes from WordPress."),gradients:l}),s&&s.length&&e.push({name:(0,H._x)("Custom","Indicates this palette is created by the user."),gradients:s}),e}),[s,a,l,c]),u.hasColorsOrGradients=!!u.colors.length||!!u.gradients.length,u}var aT=n(92982);const lT=(0,W_.css)("",""),cT={name:"bjn8wh",styles:"position:relative"},uT=e=>{const{color:t=G_.l.gray[200],style:n="solid",width:r=q_.A.borderWidth}=e||{};return`${t} ${r&&"0"!==r||t?n||"solid":n} ${r!==q_.A.borderWidth?`clamp(1px, ${r}, 10px)`:r}`},dT={name:"1nwbfnf",styles:"grid-column:span 2;margin:0 auto"};const hT=(0,U_.KZ)(((e,t)=>{const{className:n,isLinked:r,...o}=function(e){const{className:t,size:n="default",...r}=(0,z_.A)(e,"BorderBoxControlLinkedButton"),o=(0,V_.l)();return{...r,className:(0,k.useMemo)((()=>o((e=>(0,W_.css)("position:absolute;top:","__unstable-large"===e?"8px":"3px",";",(0,Gw.h)({right:0})()," line-height:0;",""))(n),t)),[t,o,n])}}(e),i=r?(0,H.__)("Unlink sides"):(0,H.__)("Link sides");return(0,jd.jsx)(Nx.Ay,{text:i,children:(0,jd.jsx)(hx.A,{className:n,children:(0,jd.jsx)(Xy.Ay,{...o,size:"small",icon:r?aT.A:nj.A,iconSize:24,"aria-label":i,ref:t})})})}),"BorderBoxControlLinkedButton");const pT=(0,U_.KZ)(((e,t)=>{const{value:n,...r}=function(e){const{className:t,value:n,size:r="default",...o}=(0,z_.A)(e,"BorderBoxControlVisualizer"),i=(0,V_.l)();return{...o,className:(0,k.useMemo)((()=>i(((e,t)=>(0,W_.css)("position:absolute;top:","__unstable-large"===t?"20px":"15px",";right:","__unstable-large"===t?"39px":"29px",";bottom:","__unstable-large"===t?"20px":"15px",";left:","__unstable-large"===t?"39px":"29px",";border-top:",uT(e?.top),";border-bottom:",uT(e?.bottom),";",(0,Gw.h)({borderLeft:uT(e?.left)})()," ",(0,Gw.h)({borderRight:uT(e?.right)})(),";",""))(n,r),t)),[i,t,n,r]),value:n}}(e);return(0,jd.jsx)(hx.A,{...r,ref:t})}),"BorderBoxControlVisualizer");var fT=n(63254),mT=n(83358),gT=n(32632),bT=n(72825);const vT=[{label:(0,H.__)("Solid"),icon:mT.A,value:"solid"},{label:(0,H.__)("Dashed"),icon:gT.A,value:"dashed"},{label:(0,H.__)("Dotted"),icon:bT.A,value:"dotted"}],yT=(0,U_.KZ)((function({onChange:e,...t},n){return(0,jd.jsx)(xx,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,ref:n,isDeselectable:!0,onChange:t=>{e?.(t)},...t,children:vT.map((e=>(0,jd.jsx)(Ux,{value:e.value,icon:e.icon,label:e.label},e.value)))})}),"BorderControlStylePicker"),_T=yT,xT=(0,k.forwardRef)((function(e,t){const{className:n,colorValue:r,...o}=e;return(0,jd.jsx)("span",{className:(0,Hy.A)("component-color-indicator",n),style:{background:r},ref:t,...o})}));var wT=n(64364),kT=n(71612),CT=n(22223);const ST=(0,$_.default)(qw.A,{target:"ez9hsf47"})("width:",(0,Yw.x)(24),";"),AT=(0,$_.default)(kT.A,{target:"ez9hsf46"})("margin-left:",(0,Yw.x)(-2),";width:5em;"),ET=(0,$_.default)(LC,{target:"ez9hsf45"})("flex:1;margin-right:",(0,Yw.x)(2),";"),IT=`\n.react-colorful__interactive {\n\twidth: calc( 100% - ${(0,Yw.x)(2)} );\n\tmargin-left: ${(0,Yw.x)(1)};\n}`,jT=(0,$_.default)("div",{target:"ez9hsf44"})("padding-top:",(0,Yw.x)(2),";padding-right:0;padding-left:0;padding-bottom:0;"),TT=(0,$_.default)(eA.A,{target:"ez9hsf43"})("padding-left:",(0,Yw.x)(4),";padding-right:",(0,Yw.x)(4),";"),BT=(0,$_.default)(T_.A,{target:"ez9hsf42"})("padding-top:",(0,Yw.x)(4),";padding-left:",(0,Yw.x)(4),";padding-right:",(0,Yw.x)(3),";padding-bottom:",(0,Yw.x)(5),";"),RT=(0,$_.default)("div",{target:"ez9hsf41"})(CT.r,";width:216px;.react-colorful{display:flex;flex-direction:column;align-items:center;width:216px;height:auto;}.react-colorful__saturation{width:100%;border-radius:0;height:216px;margin-bottom:",(0,Yw.x)(4),";border-bottom:none;}.react-colorful__hue,.react-colorful__alpha{width:184px;height:16px;border-radius:16px;margin-bottom:",(0,Yw.x)(2),";}.react-colorful__pointer{height:16px;width:16px;border:none;box-shadow:0 0 2px 0 rgba( 0, 0, 0, 0.25 );outline:2px solid transparent;}.react-colorful__pointer-fill{box-shadow:inset 0 0 0 ",q_.A.borderWidthFocus," #fff;}",IT,";"),NT=(0,$_.default)(Xy.Ay,{target:"ez9hsf40"})("&&&&&{min-width:",(0,Yw.x)(6),";padding:0;>svg{margin-right:0;}}");var DT=n(11551);const MT=e=>{const{color:t,colorType:n}=e,[r,o]=(0,k.useState)(null),i=(0,k.useRef)(),s=QI((()=>{switch(n){case"hsl":return t.toHslString();case"rgb":return t.toRgbString();default:return t.toHex()}}),(()=>{i.current&&clearTimeout(i.current),o(t.toHex()),i.current=setTimeout((()=>{o(null),i.current=void 0}),3e3)}));return(0,k.useEffect)((()=>()=>{i.current&&clearTimeout(i.current)}),[]),(0,jd.jsx)(Nx.Ay,{delay:0,hideOnClick:!1,text:r===t.toHex()?(0,H.__)("Copied!"):(0,H.__)("Copy"),children:(0,jd.jsx)(NT,{size:"small",ref:s,icon:DT.A,showTooltip:!1})})};var PT=n(98232),OT=n(43735);const LT=({min:e,max:t,label:n,abbreviation:r,onChange:o,value:i})=>(0,jd.jsxs)(eA.A,{spacing:4,children:[(0,jd.jsx)(ST,{min:e,max:t,label:n,hideLabelFromVision:!0,value:i,onChange:e=>{o(e?"string"!=typeof e?e:parseInt(e,10):0)},prefix:(0,jd.jsx)(OT.A,{as:PT.A,paddingLeft:(0,Yw.x)(4),color:G_.l.theme.accent,lineHeight:1,children:r}),spinControls:"none",size:"__unstable-large"}),(0,jd.jsx)(ET,{__nextHasNoMarginBottom:!0,label:n,hideLabelFromVision:!0,min:e,max:t,value:i,onChange:o,withInputField:!1})]}),FT=({color:e,onChange:t,enableAlpha:n})=>{const{r,g:o,b:i,a:s}=e.toRgb();return(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsx)(LT,{min:0,max:255,label:"Red",abbreviation:"R",value:r,onChange:e=>t((0,oc.Mj)({r:e,g:o,b:i,a:s}))}),(0,jd.jsx)(LT,{min:0,max:255,label:"Green",abbreviation:"G",value:o,onChange:e=>t((0,oc.Mj)({r,g:e,b:i,a:s}))}),(0,jd.jsx)(LT,{min:0,max:255,label:"Blue",abbreviation:"B",value:i,onChange:e=>t((0,oc.Mj)({r,g:o,b:e,a:s}))}),n&&(0,jd.jsx)(LT,{min:0,max:100,label:"Alpha",abbreviation:"A",value:Math.trunc(100*s),onChange:e=>t((0,oc.Mj)({r,g:o,b:i,a:e/100}))})]})},zT=({color:e,onChange:t,enableAlpha:n})=>{const r=(0,k.useMemo)((()=>e.toHsl()),[e]),[o,i]=(0,k.useState)({...r}),s=e.isEqual((0,oc.Mj)(o));(0,k.useEffect)((()=>{s||i(r)}),[r,s]);const a=s?o:r,l=n=>{const r=(0,oc.Mj)({...a,...n});e.isEqual(r)?i((e=>({...e,...n}))):t(r)};return(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsx)(LT,{min:0,max:359,label:"Hue",abbreviation:"H",value:a.h,onChange:e=>{l({h:e})}}),(0,jd.jsx)(LT,{min:0,max:100,label:"Saturation",abbreviation:"S",value:a.s,onChange:e=>{l({s:e})}}),(0,jd.jsx)(LT,{min:0,max:100,label:"Lightness",abbreviation:"L",value:a.l,onChange:e=>{l({l:e})}}),n&&(0,jd.jsx)(LT,{min:0,max:100,label:"Alpha",abbreviation:"A",value:Math.trunc(100*a.a),onChange:e=>{l({a:e/100})}})]})};var UT=n(8967);const VT=({color:e,onChange:t,enableAlpha:n})=>(0,jd.jsx)(UT.ey,{prefix:(0,jd.jsx)(OT.A,{as:PT.A,marginLeft:(0,Yw.x)(4),color:G_.l.theme.accent,lineHeight:1,children:"#"}),value:e.toHex().slice(1).toUpperCase(),onChange:e=>{if(!e)return;const n=e.startsWith("#")?e:"#"+e;t((0,oc.Mj)(n))},maxLength:n?9:7,label:(0,H.__)("Hex color"),hideLabelFromVision:!0,size:"__unstable-large",__unstableStateReducer:(e,t)=>{const n=t.payload?.event?.nativeEvent;if("insertFromPaste"!==n?.inputType)return{...e};const r=e.value?.startsWith("#")?e.value.slice(1).toUpperCase():e.value?.toUpperCase();return{...e,value:r}},__unstableInputWidth:"9em"}),HT=({colorType:e,color:t,onChange:n,enableAlpha:r})=>{const o={color:t,onChange:n,enableAlpha:r};switch(e){case"hsl":return(0,jd.jsx)(zT,{...o});case"rgb":return(0,jd.jsx)(FT,{...o});default:return(0,jd.jsx)(VT,{...o})}};function $T(){return($T=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function GT(e){var t=(0,k.useRef)(e),n=(0,k.useRef)((function(e){t.current&&t.current(e)}));return t.current=e,n.current}var qT=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e0:e.buttons>0)&&o.current?i(JT(o.current,e,a.current)):n(!1)},t=function(){return n(!1)};function n(n){var r=l.current,i=YT(o.current),s=n?i.addEventListener:i.removeEventListener;s(r?"touchmove":"mousemove",e),s(r?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,r=o.current;if(r&&(XT(t),!function(e,t){return t&&!KT(e)}(t,l.current)&&r)){if(KT(t)){l.current=!0;var s=t.changedTouches||[];s.length&&(a.current=s[0].identifier)}r.focus(),i(JT(r,t,a.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},n]}),[s,i]),u=c[0],d=c[1],h=c[2];return(0,k.useEffect)((function(){return h}),[h]),k.createElement("div",$T({},r,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:o,onKeyDown:d,tabIndex:0,role:"slider"}))})),QT=function(e){return e.filter(Boolean).join(" ")},eB=function(e){var t=e.color,n=e.left,r=e.top,o=void 0===r?.5:r,i=QT(["react-colorful__pointer",e.className]);return k.createElement("div",{className:i,style:{top:100*o+"%",left:100*n+"%"}},k.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},tB=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},nB=(Math.PI,function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:tB(e.h),s:tB(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:tB(o/2),a:tB(r,2)}}),rB=function(e){var t=nB(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},oB=function(e){var t=nB(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},iB=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),s=r*(1-n),a=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:tB(255*[r,a,s,s,l,r][c]),g:tB(255*[l,r,r,a,s,s][c]),b:tB(255*[s,s,l,r,r,a][c]),a:tB(o,2)}},sB=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?lB({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)}):{h:0,s:0,v:0,a:1}},aB=sB,lB=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),s=i-Math.min(t,n,r),a=s?i===t?(n-r)/s:i===n?2+(r-t)/s:4+(t-n)/s:0;return{h:tB(60*(a<0?a+6:a)),s:tB(i?s/i*100:0),v:tB(i/255*100),a:o}},cB=k.memo((function(e){var t=e.hue,n=e.onChange,r=QT(["react-colorful__hue",e.className]);return k.createElement("div",{className:r},k.createElement(ZT,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:qT(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":tB(t),"aria-valuemax":"360","aria-valuemin":"0"},k.createElement(eB,{className:"react-colorful__hue-pointer",left:t/360,color:rB({h:t,s:100,v:100,a:1})})))})),uB=k.memo((function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:rB({h:t.h,s:100,v:100,a:1})};return k.createElement("div",{className:"react-colorful__saturation",style:r},k.createElement(ZT,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:qT(t.s+100*e.left,0,100),v:qT(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+tB(t.s)+"%, Brightness "+tB(t.v)+"%"},k.createElement(eB,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:rB(t)})))})),dB=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")};function hB(e,t,n){var r=GT(n),o=(0,k.useState)((function(){return e.toHsva(t)})),i=o[0],s=o[1],a=(0,k.useRef)({color:t,hsva:i});(0,k.useEffect)((function(){if(!e.equal(t,a.current.color)){var n=e.toHsva(t);a.current={hsva:n,color:t},s(n)}}),[t,e]),(0,k.useEffect)((function(){var t;(function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0})(i,a.current.hsva)||e.equal(t=e.fromHsva(i),a.current.color)||(a.current={hsva:i,color:t},r(t))}),[i,e,r]);var l=(0,k.useCallback)((function(e){s((function(t){return Object.assign({},t,e)}))}),[]);return[i,l]}var pB="undefined"!=typeof window?k.useLayoutEffect:k.useEffect,fB=new Map,mB=function(e){pB((function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!fB.has(t)){var r=t.createElement("style");r.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',fB.set(t,r);var o=n.nc;o&&r.setAttribute("nonce",o),t.head.appendChild(r)}}),[])},gB=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,i=e.onChange,s=WT(e,["className","colorModel","color","onChange"]),a=(0,k.useRef)(null);mB(a);var l=hB(n,o,i),c=l[0],u=l[1],d=QT(["react-colorful",t]);return k.createElement("div",$T({},s,{ref:a,className:d}),k.createElement(uB,{hsva:c,onChange:u}),k.createElement(cB,{hue:c.h,onChange:u,className:"react-colorful__last-control"}))},bB=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+oB(Object.assign({},n,{a:0}))+", "+oB(Object.assign({},n,{a:1}))+")"},i=QT(["react-colorful__alpha",t]),s=tB(100*n.a);return k.createElement("div",{className:i},k.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),k.createElement(ZT,{onMove:function(e){r({a:e.left})},onKey:function(e){r({a:qT(n.a+e.left)})},"aria-label":"Alpha","aria-valuetext":s+"%","aria-valuenow":s,"aria-valuemin":"0","aria-valuemax":"100"},k.createElement(eB,{className:"react-colorful__alpha-pointer",left:n.a,color:oB(n)})))},vB=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,i=e.onChange,s=WT(e,["className","colorModel","color","onChange"]),a=(0,k.useRef)(null);mB(a);var l=hB(n,o,i),c=l[0],u=l[1],d=QT(["react-colorful",t]);return k.createElement("div",$T({},s,{ref:a,className:d}),k.createElement(uB,{hsva:c,onChange:u}),k.createElement(cB,{hue:c.h,onChange:u}),k.createElement(bB,{hsva:c,onChange:u,className:"react-colorful__last-control"}))},yB={defaultColor:"rgba(0, 0, 0, 1)",toHsva:sB,fromHsva:function(e){var t=iB(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:dB},_B=function(e){return k.createElement(vB,$T({},e,{colorModel:yB}))},xB={defaultColor:"rgb(0, 0, 0)",toHsva:aB,fromHsva:function(e){var t=iB(e);return"rgb("+t.r+", "+t.g+", "+t.b+")"},equal:dB},wB=function(e){return k.createElement(gB,$T({},e,{colorModel:xB}))};const kB=({color:e,enableAlpha:t,onChange:n})=>{const r=t?_B:wB,o=(0,k.useMemo)((()=>e.toRgbString()),[e]);return(0,jd.jsx)(r,{color:o,onChange:e=>{n((0,oc.Mj)(e))},onPointerDown:({currentTarget:e,pointerId:t})=>{e.setPointerCapture(t)},onPointerUp:({currentTarget:e,pointerId:t})=>{e.releasePointerCapture(t)}})};(0,oc.X$)([ic.A]);const CB=[{label:"RGB",value:"rgb"},{label:"HSL",value:"hsl"},{label:"Hex",value:"hex"}],SB={InputBase:{isBorderless:!0}},AB=(0,U_.KZ)(((e,t)=>{const{enableAlpha:n=!1,color:r,onChange:o,defaultValue:i="#fff",copyFormat:s,...a}=(0,z_.A)(e,"ColorPicker"),[l,c]=(0,vx.j)({onChange:o,value:r,defaultValue:i}),u=(0,k.useMemo)((()=>(0,oc.Mj)(l||"")),[l]),d=(0,nI.A)(c),h=(0,k.useCallback)((e=>{d(e.toHex())}),[d]),[p,f]=(0,k.useState)(s||"hex");return(0,jd.jsxs)(RT,{ref:t,...a,children:[(0,jd.jsx)(kB,{onChange:h,color:u,enableAlpha:n}),(0,jd.jsxs)(jT,{children:[(0,jd.jsxs)(TT,{justify:"space-between",children:[(0,jd.jsx)(wT.c7,{value:SB,children:(0,jd.jsx)(AT,{__nextHasNoMarginBottom:!0,options:CB,value:p,onChange:e=>f(e),label:(0,H.__)("Color format"),hideLabelFromVision:!0})}),(0,jd.jsx)(MT,{color:u,colorType:s||p})]}),(0,jd.jsx)(BT,{direction:"column",gap:2,children:(0,jd.jsx)(HT,{colorType:p,color:u,onChange:h,enableAlpha:n})})]})]})}),"ColorPicker");function EB(e){if(void 0!==e)return"string"==typeof e?e:e.hex?e.hex:void 0}const IB=(0,yh.A)((e=>{const t=(0,oc.Mj)(e),n=t.toHex(),r=t.toRgb(),o=t.toHsv(),i=t.toHsl();return{hex:n,rgb:r,hsv:o,hsl:i,source:"hex",oldHue:i.h}}));function jB(e){const{onChangeComplete:t}=e,n=(0,k.useCallback)((e=>{t(IB(e))}),[t]);return function(e){return void 0!==e.onChangeComplete||void 0!==e.disableAlpha||"string"==typeof e.color?.hex}(e)?{color:EB(e.color),enableAlpha:!e.disableAlpha,onChange:n}:{...e,color:e.color,enableAlpha:e.enableAlpha,onChange:e.onChange}}const TB=e=>(0,jd.jsx)(AB,{...jB(e)}),BB=(0,k.createContext)({});var RB=n(8748);const NB=(0,k.forwardRef)((function(e,t){const{isPressed:n,...r}=e;return(0,jd.jsx)(Xy.Ay,{...r,"aria-pressed":n,ref:t})})),DB=(0,k.forwardRef)((function(e,t){const{id:n,isSelected:r,compositeStore:o,...i}=e,s=o.useState("activeId");return r&&!s&&o.setActiveId(n),(0,jd.jsx)(RB.l,{render:(0,jd.jsx)(Xy.Ay,{...i,role:"option","aria-selected":!!r,ref:t}),store:o,id:n})}));function MB(e){const{actions:t,options:n,baseId:r,className:o,loop:i=!0,children:s,...a}=e,l=(0,Z_.q)({focusLoop:i,rtl:(0,H.isRTL)()}),c={baseId:r,compositeStore:l};return(0,jd.jsx)("div",{className:o,children:(0,jd.jsxs)(BB.Provider,{value:c,children:[(0,jd.jsx)(sx.e,{...a,id:r,store:l,role:"listbox",children:n}),s,t]})})}function PB(e){const{actions:t,options:n,children:r,baseId:o,...i}=e;return(0,jd.jsx)("div",{...i,id:o,children:(0,jd.jsxs)(BB.Provider,{value:{baseId:o},children:[n,r,t]})})}function OB(e){const{asButtons:t,actions:n,options:r,children:o,className:i,...s}=e,a=(0,F_.A)(OB,"components-circular-option-picker",s.id),l=t?PB:MB,c=n?(0,jd.jsx)("div",{className:"components-circular-option-picker__custom-clear-wrapper",children:n}):void 0,u=(0,jd.jsx)("div",{className:"components-circular-option-picker__swatches",children:r});return(0,jd.jsx)(l,{...s,baseId:a,className:(0,Hy.A)("components-circular-option-picker",i),actions:c,options:u,children:o})}OB.Option=function e({className:t,isSelected:n,selectedIconProps:r={},tooltipText:o,...i}){const{baseId:s,compositeStore:a}=(0,k.useContext)(BB),l={id:(0,F_.A)(e,s||"components-circular-option-picker__option"),className:"components-circular-option-picker__option",...i},c=a?(0,jd.jsx)(DB,{...l,compositeStore:a,isSelected:n}):(0,jd.jsx)(NB,{...l,isPressed:n});return(0,jd.jsxs)("div",{className:(0,Hy.A)(t,"components-circular-option-picker__option-wrapper"),children:[o?(0,jd.jsx)(Nx.Ay,{text:o,children:c}):c,n&&(0,jd.jsx)(ak.A,{icon:XS.A,...r})]})},OB.OptionGroup=function({className:e,options:t,...n}){const r="aria-label"in n||"aria-labelledby"in n?"group":void 0;return(0,jd.jsx)("div",{...n,role:r,className:(0,Hy.A)("components-circular-option-picker__option-group","components-circular-option-picker__swatches",e),children:t})},OB.ButtonAction=function({className:e,children:t,...n}){return(0,jd.jsx)(Xy.Ay,{className:(0,Hy.A)("components-circular-option-picker__clear",e),variant:"tertiary",...n,children:t})},OB.DropdownLinkAction=function({buttonProps:e,className:t,dropdownProps:n,linkText:r}){return(0,jd.jsx)(PE.A,{className:(0,Hy.A)("components-circular-option-picker__dropdown-link-action",t),renderToggle:({isOpen:t,onToggle:n})=>(0,jd.jsx)(Xy.Ay,{"aria-expanded":t,"aria-haspopup":"true",onClick:n,variant:"link",...e,children:r}),...n})};const LB=OB,FB=(0,$_.default)(tA.A,{target:"ev9wop70"})({name:"13lxv2o",styles:"text-transform:uppercase;line-height:24px;font-weight:500;&&&{font-size:11px;margin-bottom:0;}"}),zB=({paddingSize:e="small"})=>{if("none"===e)return;const t={small:(0,Yw.x)(2),medium:(0,Yw.x)(4)};return(0,W_.css)("padding:",t[e]||t.small,";","")},UB=(0,$_.default)("div",{target:"eovvns30"})("margin-left:",(0,Yw.x)(-2),";margin-right:",(0,Yw.x)(-2),";&:first-of-type{margin-top:",(0,Yw.x)(-2),";}&:last-of-type{margin-bottom:",(0,Yw.x)(-2),";}",zB,";"),VB=(0,U_.KZ)((function(e,t){const{paddingSize:n="small",...r}=(0,z_.A)(e,"DropdownContentWrapper");return(0,jd.jsx)(UB,{...r,paddingSize:n,ref:t})}),"DropdownContentWrapper");(0,oc.X$)([ic.A,sc.A]);const HB=e=>e.length>0&&e.every((e=>{return t=e,Array.isArray(t.colors)&&!("color"in t);var t}));function $B({className:e,clearColor:t,colors:n,onChange:r,value:o,...i}){const s=(0,k.useMemo)((()=>n.map((({color:e,name:n},i)=>{const s=(0,oc.Mj)(e),a=o===e;return(0,jd.jsx)(LB.Option,{isSelected:a,selectedIconProps:a?{fill:s.contrast()>s.contrast("#000")?"#fff":"#000"}:{},tooltipText:n||(0,H.sprintf)((0,H.__)("Color code: %s"),e),style:{backgroundColor:e,color:e},onClick:a?t:()=>r(e,i),"aria-label":n?(0,H.sprintf)((0,H.__)("Color: %s"),n):(0,H.sprintf)((0,H.__)("Color code: %s"),e)},`${e}-${i}`)}))),[n,o,r,t]);return(0,jd.jsx)(LB.OptionGroup,{className:e,options:s,...i})}function WB({className:e,clearColor:t,colors:n,onChange:r,value:o,headingLevel:i}){const s=(0,F_.A)(WB,"color-palette");return 0===n.length?null:(0,jd.jsx)(oE.A,{spacing:3,className:e,children:n.map((({name:e,colors:n},a)=>{const l=`${s}-${a}`;return(0,jd.jsxs)(oE.A,{spacing:2,children:[(0,jd.jsx)(FB,{id:l,level:i,children:e}),(0,jd.jsx)($B,{clearColor:t,colors:n,onChange:e=>r(e,a),value:o,"aria-labelledby":l})]},a)}))})}function GB({isRenderedInSidebar:e,popoverProps:t,...n}){const r=(0,k.useMemo)((()=>({shift:!0,resize:!1,...e?{placement:"left-start",offset:34}:{placement:"bottom",offset:8},...t})),[e,t]);return(0,jd.jsx)(PE.A,{contentClassName:"components-color-palette__custom-color-dropdown-content",popoverProps:r,...n})}(0,oc.X$)([ic.A,sc.A]);const qB=(0,k.forwardRef)((function(e,t){const{asButtons:n,loop:r,clearable:o=!0,colors:i=[],disableCustomColors:s=!1,enableAlpha:a=!1,onChange:l,value:c,__experimentalIsRenderedInSidebar:u=!1,headingLevel:d=2,"aria-label":h,"aria-labelledby":p,...f}=e,[m,g]=(0,k.useState)(c),b=(0,k.useCallback)((()=>l(void 0)),[l]),v=(0,k.useCallback)((e=>{g(((e,t)=>{if(!/^var\(/.test(null!=e?e:"")||null===t)return e;const{ownerDocument:n}=t,{defaultView:r}=n,o=r?.getComputedStyle(t).backgroundColor;return o?(0,oc.Mj)(o).toHex():e})(c,e))}),[c]),y=HB(i),_=(0,k.useMemo)((()=>((e,t=[],n=!1)=>{if(!e)return"";const r=/^var\(/.test(e),o=r?e:(0,oc.Mj)(e).toHex(),i=n?t:[{colors:t}];for(const{colors:e}of i)for(const{name:t,color:n}of e)if(o===(r?n:(0,oc.Mj)(n).toHex()))return t;return(0,H.__)("Custom")})(c,i,y)),[c,i,y]),x=c?.startsWith("#"),w=c?.replace(/^var\((.+)\)$/,"$1"),C=w?(0,H.sprintf)((0,H.__)('Custom color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),_,w):(0,H.__)("Custom color picker."),S={clearColor:b,onChange:l,value:c},A=!!o&&(0,jd.jsx)(LB.ButtonAction,{onClick:b,children:(0,H.__)("Clear")});let E;if(n)E={asButtons:!0};else{const e={asButtons:!1,loop:r};E=h?{...e,"aria-label":h}:p?{...e,"aria-labelledby":p}:{...e,"aria-label":(0,H.__)("Custom color picker.")}}return(0,jd.jsxs)(oE.A,{spacing:3,ref:t,...f,children:[!s&&(0,jd.jsx)(GB,{isRenderedInSidebar:u,renderContent:()=>(0,jd.jsx)(VB,{paddingSize:"none",children:(0,jd.jsx)(TB,{color:m,onChange:e=>l(e),enableAlpha:a})}),renderToggle:({isOpen:e,onToggle:t})=>(0,jd.jsxs)(oE.A,{className:"components-color-palette__custom-color-wrapper",spacing:0,children:[(0,jd.jsx)("button",{ref:v,className:"components-color-palette__custom-color-button","aria-expanded":e,"aria-haspopup":"true",onClick:t,"aria-label":C,style:{background:c},type:"button"}),(0,jd.jsxs)(oE.A,{className:"components-color-palette__custom-color-text-wrapper",spacing:.5,children:[(0,jd.jsx)($A.A,{className:"components-color-palette__custom-color-name",children:c?_:(0,H.__)("No color selected")}),(0,jd.jsx)($A.A,{className:(0,Hy.A)("components-color-palette__custom-color-value",{"components-color-palette__custom-color-value--is-hex":x}),children:w})]})]})}),(0,jd.jsx)(LB,{...E,actions:A,options:y?(0,jd.jsx)(WB,{...S,headingLevel:d,colors:i,value:c}):(0,jd.jsx)($B,{...S,colors:i,value:c})})]})})),KB=qB,YB={name:"f3vz0n",styles:"font-weight:500"},JB=(0,W_.css)("box-shadow:inset ",q_.A.controlBoxShadowFocus,";",""),XB=(0,W_.css)("border:0;padding:0;margin:0;",CT.r,";",""),ZB=(0,W_.css)(Jw,"{flex:0 0 auto;}",""),QB=(0,W_.css)("background:#fff;&&>button{aspect-ratio:1;padding:0;display:flex;align-items:center;justify-content:center;",(0,Gw.h)({borderRadius:"2px 0 0 2px"},{borderRadius:"0 2px 2px 0"})()," border:",q_.A.borderWidth," solid ",G_.l.ui.border,";&:focus,&:hover:not( :disabled ){",JB," border-color:",G_.l.ui.borderFocus,";z-index:1;position:relative;}}",""),eR=(0,W_.css)("width:",228,"px;>div:first-of-type>",nA.Gw,"{margin-bottom:0;",YB,";}&& ",nA.Gw,"+button:not( .has-text ){min-width:24px;padding:0;}",""),tR=(0,W_.css)("",""),nR=(0,W_.css)("",""),rR=(0,W_.css)("justify-content:center;width:100%;&&{border-top:",q_.A.borderWidth," solid ",G_.l.gray[400],";border-top-left-radius:0;border-top-right-radius:0;height:40px;}",""),oR=e=>e.replace(/^var\((.+)\)$/,"$1"),iR=(0,U_.KZ)(((e,t)=>{const{__experimentalIsRenderedInSidebar:n,border:r,colors:o,disableCustomColors:i,enableAlpha:s,enableStyle:a,indicatorClassName:l,indicatorWrapperClassName:c,isStyleSettable:u,onReset:d,onColorChange:h,onStyleChange:p,popoverContentClassName:f,popoverControlsClassName:m,resetButtonClassName:g,showDropdownHeader:b,size:v,__unstablePopoverProps:y,..._}=function(e){const{border:t,className:n,colors:r=[],enableAlpha:o=!1,enableStyle:i=!0,onChange:s,previousStyleSelection:a,size:l="default",__experimentalIsRenderedInSidebar:c=!1,...u}=(0,z_.A)(e,"BorderControlDropdown"),[d]=$w(t?.width),h=0===d,p=(0,V_.l)(),f=(0,k.useMemo)((()=>p(QB,n)),[n,p]),m=(0,k.useMemo)((()=>p(nR)),[p]),g=(0,k.useMemo)((()=>p(((e,t)=>{const{style:n}=e||{};return(0,W_.css)("border-radius:9999px;border:2px solid transparent;",n?(e=>{const{color:t,style:n}=e||{},r=n&&"none"!==n?G_.l.gray[300]:void 0;return(0,W_.css)("border-style:","none"===n?"solid":n,";border-color:",t||r,";","")})(e):void 0," width:","__unstable-large"===t?"24px":"22px",";height:","__unstable-large"===t?"24px":"22px",";padding:","__unstable-large"===t?"2px":"1px",";&>span{height:",(0,Yw.x)(4),";width:",(0,Yw.x)(4),";background:linear-gradient(\n\t\t\t\t-45deg,\n\t\t\t\ttransparent 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 52%,\n\t\t\t\ttransparent 52%\n\t\t\t);}","")})(t,l))),[t,p,l]),b=(0,k.useMemo)((()=>p(eR)),[p]),v=(0,k.useMemo)((()=>p(tR)),[p]),y=(0,k.useMemo)((()=>p(rR)),[p]);return{...u,border:t,className:f,colors:r,enableAlpha:o,enableStyle:i,indicatorClassName:m,indicatorWrapperClassName:g,onColorChange:e=>{s({color:e,style:"none"===t?.style?a:t?.style,width:h&&e?"1px":t?.width})},onStyleChange:e=>{const n=h&&e?"1px":t?.width;s({...t,style:e,width:n})},onReset:()=>{s({...t,color:void 0,style:void 0})},popoverContentClassName:v,popoverControlsClassName:b,resetButtonClassName:y,size:l,__experimentalIsRenderedInSidebar:c}}(e),{color:x,style:w}=r||{},C=((e,t)=>{if(e&&t){if(HB(t)){let n;return t.some((t=>t.colors.some((t=>t.color===e&&(n=t,!0))))),n}return t.find((t=>t.color===e))}})(x,o),S=((e,t,n,r)=>{if(r){if(t){const e=oR(t.color);return n?(0,H.sprintf)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s". The currently selected style is "%3$s".',t.name,e,n):(0,H.sprintf)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s".',t.name,e)}if(e){const t=oR(e);return n?(0,H.sprintf)('Border color and style picker. The currently selected color has a value of "%1$s". The currently selected style is "%2$s".',t,n):(0,H.sprintf)('Border color and style picker. The currently selected color has a value of "%1$s".',t)}return(0,H.__)("Border color and style picker.")}return t?(0,H.sprintf)('Border color picker. The currently selected color is called "%1$s" and has a value of "%2$s".',t.name,oR(t.color)):e?(0,H.sprintf)('Border color picker. The currently selected color has a value of "%1$s".',oR(e)):(0,H.__)("Border color picker.")})(x,C,w,a),A=x||w&&"none"!==w,E=n?"bottom left":void 0;return(0,jd.jsx)(PE.A,{renderToggle:({onToggle:e})=>(0,jd.jsx)(Xy.Ay,{onClick:e,variant:"tertiary","aria-label":S,tooltipPosition:E,label:(0,H.__)("Border color and style picker"),showTooltip:!0,__next40pxDefaultSize:"__unstable-large"===v,children:(0,jd.jsx)("span",{className:c,children:(0,jd.jsx)(xT,{className:l,colorValue:x})})}),renderContent:({onClose:e})=>(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsx)(VB,{paddingSize:"medium",children:(0,jd.jsxs)(oE.A,{className:m,spacing:6,children:[b?(0,jd.jsxs)(eA.A,{children:[(0,jd.jsx)(nA.Gw,{children:(0,H.__)("Border color")}),(0,jd.jsx)(Xy.Ay,{size:"small",label:(0,H.__)("Close border color"),icon:fT.A,onClick:e})]}):void 0,(0,jd.jsx)(KB,{className:f,value:x,onChange:h,colors:o,disableCustomColors:i,__experimentalIsRenderedInSidebar:n,clearable:!1,enableAlpha:s}),a&&u&&(0,jd.jsx)(_T,{label:(0,H.__)("Style"),value:w,onChange:p})]})}),A&&(0,jd.jsx)(VB,{paddingSize:"none",children:(0,jd.jsx)(Xy.Ay,{className:g,variant:"tertiary",onClick:()=>{d(),e()},children:(0,H.__)("Reset")})})]}),popoverProps:{...y},..._,ref:t})}),"BorderControlDropdown"),sR=iR,aR=e=>void 0!==e?.width&&""!==e.width||void 0!==e?.color;const lR=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,jd.jsx)(WA.A,{as:"legend",children:t}):(0,jd.jsx)(nA.Gw,{as:"legend",children:t}):null},cR=(0,U_.KZ)(((e,t)=>{const{__next40pxDefaultSize:n=!1,colors:r,disableCustomColors:o,disableUnits:i,enableAlpha:s,enableStyle:a,hideLabelFromVision:l,innerWrapperClassName:c,inputWidth:u,isStyleSettable:d,label:h,onBorderChange:p,onSliderChange:f,onWidthChange:m,placeholder:g,__unstablePopoverProps:b,previousStyleSelection:v,showDropdownHeader:y,size:_,sliderClassName:x,value:w,widthUnit:C,widthValue:S,withSlider:A,__experimentalIsRenderedInSidebar:E,...I}=function(e){const{className:t,colors:n=[],isCompact:r,onChange:o,enableAlpha:i=!0,enableStyle:s=!0,shouldSanitizeBorder:a=!0,size:l="default",value:c,width:u,__experimentalIsRenderedInSidebar:d=!1,__next40pxDefaultSize:h,...p}=(0,z_.A)(e,"BorderControl"),f="default"===l&&h?"__unstable-large":l,[m,g]=$w(c?.width),b=g||"px",v=0===m,[y,_]=(0,k.useState)(),[x,w]=(0,k.useState)(),C=!a||aR(c),S=(0,k.useCallback)((e=>{!a||aR(e)?o(e):o(void 0)}),[o,a]),A=(0,k.useCallback)((e=>{const t=""===e?void 0:e,[n]=$w(e),r=0===n,o={...c,width:t};r&&!v&&(_(c?.color),w(c?.style),o.color=void 0,o.style="none"),!r&&v&&(void 0===o.color&&(o.color=y),"none"===o.style&&(o.style=x)),S(o)}),[c,v,y,x,S]),E=(0,k.useCallback)((e=>{A(`${e}${b}`)}),[A,b]),I=(0,V_.l)(),j=(0,k.useMemo)((()=>I(XB,t)),[t,I]);let T=u;r&&(T="__unstable-large"===l?"116px":"90px");const B=(0,k.useMemo)((()=>{const e=!!T&&ZB,t=(e=>(0,W_.css)("height:","__unstable-large"===e?"40px":"30px",";",""))(f);return I((0,W_.css)(Jw,"{flex:1 1 40%;}&& ",ek,"{min-height:0;}",""),e,t)}),[T,I,f]),R=(0,k.useMemo)((()=>I((0,W_.css)("flex:1 1 60%;",(0,Gw.h)({marginRight:(0,Yw.x)(3)})(),";",""))),[I]);return{...p,className:j,colors:n,enableAlpha:i,enableStyle:s,innerWrapperClassName:B,inputWidth:T,isStyleSettable:C,onBorderChange:S,onSliderChange:E,onWidthChange:A,previousStyleSelection:x,sliderClassName:R,value:c,widthUnit:b,widthValue:m,size:f,__experimentalIsRenderedInSidebar:d,__next40pxDefaultSize:h}}(e);return(0,jd.jsxs)(hx.A,{as:"fieldset",...I,ref:t,children:[(0,jd.jsx)(lR,{label:h,hideLabelFromVision:l}),(0,jd.jsxs)(eA.A,{spacing:4,className:c,children:[(0,jd.jsx)(sk,{prefix:(0,jd.jsx)(sR,{border:w,colors:r,__unstablePopoverProps:b,disableCustomColors:o,enableAlpha:s,enableStyle:a,isStyleSettable:d,onChange:p,previousStyleSelection:v,showDropdownHeader:y,__experimentalIsRenderedInSidebar:E,size:_}),label:(0,H.__)("Border width"),hideLabelFromVision:!0,min:0,onChange:m,value:w?.width||"",placeholder:g,disableUnits:i,__unstableInputWidth:u,size:_}),A&&(0,jd.jsx)(LC,{__nextHasNoMarginBottom:!0,label:(0,H.__)("Border width"),hideLabelFromVision:!0,className:x,initialPosition:0,max:100,min:0,onChange:f,step:["px","%"].includes(C)?1:.1,value:S||void 0,withInputField:!1,__next40pxDefaultSize:n})]})]})}),"BorderControl"),uR=cR;const dR=(0,U_.KZ)(((e,t)=>{const{centeredClassName:n,colors:r,disableCustomColors:o,enableAlpha:i,enableStyle:s,onChange:a,popoverPlacement:l,popoverOffset:c,rightAlignedClassName:u,size:d="default",value:h,__experimentalIsRenderedInSidebar:p,...f}=function(e){const{className:t,colors:n=[],enableAlpha:r=!1,enableStyle:o=!0,size:i="default",__experimentalIsRenderedInSidebar:s=!1,...a}=(0,z_.A)(e,"BorderBoxControlSplitControls"),l=(0,V_.l)(),c=(0,k.useMemo)((()=>l((e=>(0,W_.css)("position:relative;flex:1;width:","__unstable-large"===e?void 0:"80%",";",""))(i),t)),[l,t,i]);return{...a,centeredClassName:(0,k.useMemo)((()=>l(dT,t)),[l,t]),className:c,colors:n,enableAlpha:r,enableStyle:o,rightAlignedClassName:(0,k.useMemo)((()=>l((0,W_.css)((0,Gw.h)({marginLeft:"auto"})(),";",""),t)),[l,t]),size:i,__experimentalIsRenderedInSidebar:s}}(e),[m,g]=(0,k.useState)(null),b=(0,k.useMemo)((()=>l?{placement:l,offset:c,anchor:m,shift:!0}:void 0),[l,c,m]),v={colors:r,disableCustomColors:o,enableAlpha:i,enableStyle:s,isCompact:!0,__experimentalIsRenderedInSidebar:p,size:d},y=(0,Qk.A)([g,t]);return(0,jd.jsxs)(yA,{...f,ref:y,gap:4,children:[(0,jd.jsx)(pT,{value:h,size:d}),(0,jd.jsx)(uR,{className:n,hideLabelFromVision:!0,label:(0,H.__)("Top border"),onChange:e=>a(e,"top"),__unstablePopoverProps:b,value:h?.top,...v}),(0,jd.jsx)(uR,{hideLabelFromVision:!0,label:(0,H.__)("Left border"),onChange:e=>a(e,"left"),__unstablePopoverProps:b,value:h?.left,...v}),(0,jd.jsx)(uR,{className:u,hideLabelFromVision:!0,label:(0,H.__)("Right border"),onChange:e=>a(e,"right"),__unstablePopoverProps:b,value:h?.right,...v}),(0,jd.jsx)(uR,{className:n,hideLabelFromVision:!0,label:(0,H.__)("Bottom border"),onChange:e=>a(e,"bottom"),__unstablePopoverProps:b,value:h?.bottom,...v})]})}),"BorderBoxControlSplitControls"),hR=dR;function pR(e){const{className:t,colors:n=[],onChange:r,enableAlpha:o=!1,enableStyle:i=!0,size:s="default",value:a,__experimentalIsRenderedInSidebar:l=!1,__next40pxDefaultSize:c,...u}=(0,z_.A)(e,"BorderBoxControl"),d="default"===s&&c?"__unstable-large":s,h=Qj(a),p=Zj(a),f=p?(e=>{if(!e)return;const t=[],n=[],r=[];Kj.forEach((o=>{t.push(e[o]?.color),n.push(e[o]?.style),r.push(e[o]?.width)}));const o=t.every((e=>e===t[0])),i=n.every((e=>e===n[0])),s=r.every((e=>e===r[0]));return{color:o?t[0]:void 0,style:i?n[0]:void 0,width:s?r[0]:tT(r)}})(a):a,m=p?a:(e=>{if(e&&!Jj(e))return{top:e,right:e,bottom:e,left:e}})(a),g=!isNaN(parseFloat(`${f?.width}`)),[b,v]=(0,k.useState)(!h),y=(0,V_.l)(),_=(0,k.useMemo)((()=>y(lT,t)),[y,t]),x=(0,k.useMemo)((()=>y((0,W_.css)("flex:1;",(0,Gw.h)({marginRight:"24px"})(),";",""))),[y]),w=(0,k.useMemo)((()=>y(cT)),[y]);return{...u,className:_,colors:n,disableUnits:h&&!g,enableAlpha:o,enableStyle:i,hasMixedBorders:h,isLinked:b,linkedControlClassName:x,onLinkedChange:e=>{if(!e)return r(void 0);if(!h||(t=e)&&Yj.every((e=>void 0!==t[e])))return r(Jj(e)?void 0:e);var t;const n=((e,t)=>{const n={};return e.color!==t.color&&(n.color=t.color),e.style!==t.style&&(n.style=t.style),e.width!==t.width&&(n.width=t.width),n})(f,e),o={top:{...a?.top,...n},right:{...a?.right,...n},bottom:{...a?.bottom,...n},left:{...a?.left,...n}};if(Qj(o))return r(o);const i=Jj(o.top)?void 0:o.top;r(i)},onSplitChange:(e,t)=>{const n={...m,[t]:e};Qj(n)?r(n):r(e)},toggleLinked:()=>v(!b),linkedValue:f,size:d,splitValue:m,wrapperClassName:w,__experimentalIsRenderedInSidebar:l}}const fR=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,jd.jsx)(WA.A,{as:"label",children:t}):(0,jd.jsx)(nA.Gw,{children:t}):null},mR=(0,U_.KZ)(((e,t)=>{const{className:n,colors:r,disableCustomColors:o,disableUnits:i,enableAlpha:s,enableStyle:a,hasMixedBorders:l,hideLabelFromVision:c,isLinked:u,label:d,linkedControlClassName:h,linkedValue:p,onLinkedChange:f,onSplitChange:m,popoverPlacement:g,popoverOffset:b,size:v,splitValue:y,toggleLinked:_,wrapperClassName:x,__experimentalIsRenderedInSidebar:w,...C}=pR(e),[S,A]=(0,k.useState)(null),E=(0,k.useMemo)((()=>g?{placement:g,offset:b,anchor:S,shift:!0}:void 0),[g,b,S]),I=(0,Qk.A)([A,t]);return(0,jd.jsxs)(hx.A,{className:n,...C,ref:I,children:[(0,jd.jsx)(fR,{label:d,hideLabelFromVision:c}),(0,jd.jsxs)(hx.A,{className:x,children:[u?(0,jd.jsx)(uR,{className:h,colors:r,disableUnits:i,disableCustomColors:o,enableAlpha:s,enableStyle:a,onChange:f,placeholder:l?(0,H.__)("Mixed"):void 0,__unstablePopoverProps:E,shouldSanitizeBorder:!1,value:p,withSlider:!0,width:"__unstable-large"===v?"116px":"110px",__experimentalIsRenderedInSidebar:w,size:v}):(0,jd.jsx)(hR,{colors:r,disableCustomColors:o,enableAlpha:s,enableStyle:a,onChange:m,popoverPlacement:g,popoverOffset:b,value:y,__experimentalIsRenderedInSidebar:w,size:v}),(0,jd.jsx)(hT,{onClick:_,isLinked:u,size:v})]})]})}),"BorderBoxControl"),gR=mR;function bR(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function vR(e={}){const{flat:t,...n}=e;return t||bR(Object.values(n).filter(Boolean))||"px"}function yR(e={}){if("string"==typeof e)return e;const t=Object.values(e).map((e=>$w(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),r=t.map((e=>e[1])),o=n.every((e=>e===n[0]))?n[0]:"",i=bR(r);return 0===o||o?`${o}${i}`:void 0}function _R(e={}){const t=yR(e);return"string"!=typeof e&&isNaN(parseFloat(t))}function xR(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function wR({onChange:e,selectedUnits:t,setSelectedUnits:n,values:r,...o}){let i=yR(r);void 0===i&&(i=vR(t));const s=xR(r)&&_R(r),a=s?(0,H.__)("Mixed"):null;return(0,jd.jsx)(sk,{...o,"aria-label":(0,H.__)("Border radius"),disableUnits:s,isOnly:!0,value:i,onChange:t=>{const n=!isNaN(parseFloat(t));e(n?t:void 0)},onUnitChange:e=>{n({topLeft:e,topRight:e,bottomLeft:e,bottomRight:e})},placeholder:a,size:"__unstable-large"})}const kR={topLeft:(0,H.__)("Top left"),topRight:(0,H.__)("Top right"),bottomLeft:(0,H.__)("Bottom left"),bottomRight:(0,H.__)("Bottom right")};function CR({onChange:e,selectedUnits:t,setSelectedUnits:n,values:r,...o}){const i=t=>n=>{if(!e)return;const r=isNaN(parseFloat(n))?void 0:n;e({...s,[t]:r})},s="string"!=typeof r?r:{topLeft:r,topRight:r,bottomLeft:r,bottomRight:r};return(0,jd.jsx)("div",{className:"components-border-radius-control__input-controls-wrapper",children:Object.entries(kR).map((([e,r])=>{const[a,l]=$w(s[e]),c=s[e]?l:t[e]||t.flat;return(0,jd.jsx)(Nx.Ay,{text:r,placement:"top",children:(0,jd.jsx)("div",{className:"components-border-radius-control__tooltip-wrapper",children:(0,jd.jsx)(sk,{...o,"aria-label":r,value:[a,c].join(""),onChange:i(e),onUnitChange:(u=e,e=>{const r={...t};r[u]=e,n(r)}),size:"__unstable-large"})})},e);var u}))})}function SR({isLinked:e,...t}){const n=e?(0,H.__)("Unlink radii"):(0,H.__)("Link radii");return(0,jd.jsx)(Nx.Ay,{text:n,children:(0,jd.jsx)(Xy.Ay,{...t,className:"component-border-radius-control__linked-button",size:"small",icon:e?aT.A:nj.A,iconSize:24,"aria-label":n})})}const AR={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},ER=0,IR={px:100,em:20,rem:20};function jR({onChange:e,values:t}){const[n,r]=(0,k.useState)(!xR(t)||!_R(t)),[o,i]=(0,k.useState)({flat:"string"==typeof t?$w(t)[1]:void 0,topLeft:$w(t?.topLeft)[1],topRight:$w(t?.topRight)[1],bottomLeft:$w(t?.bottomLeft)[1],bottomRight:$w(t?.bottomRight)[1]}),[s]=py("spacing.units"),a=Ww({availableUnits:s||["px","em","rem"]}),l=vR(o),c=a&&a.find((e=>e.value===l)),u=c?.step||1,[d]=$w(yR(t));return(0,jd.jsxs)("fieldset",{className:"components-border-radius-control",children:[(0,jd.jsx)(H_.Ay.VisualLabel,{as:"legend",children:(0,H.__)("Radius")}),(0,jd.jsxs)("div",{className:"components-border-radius-control__wrapper",children:[n?(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsx)(wR,{className:"components-border-radius-control__unit-control",values:t,min:ER,onChange:e,selectedUnits:o,setSelectedUnits:i,units:a}),(0,jd.jsx)(LC,{label:(0,H.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=d?d:"",min:ER,max:IR[l],initialPosition:0,withInputField:!1,onChange:t=>{e(void 0!==t?`${t}${l}`:void 0)},step:u,__nextHasNoMarginBottom:!0})]}):(0,jd.jsx)(CR,{min:ER,onChange:e,selectedUnits:o,setSelectedUnits:i,values:t||AR,units:a}),(0,jd.jsx)(SR,{onClick:()=>r(!n),isLinked:n})]})]})}var TR=n(77582);const BR=[],{CompositeItemV2:RR,CompositeV2:NR,useCompositeStoreV2:DR}=kf(u_.j);function MR({shadow:e,onShadowChange:t,settings:n}){const r=FR(n);return(0,jd.jsx)("div",{className:"block-editor-global-styles__shadow-popover-container",children:(0,jd.jsxs)(oE.A,{spacing:4,children:[(0,jd.jsx)(tA.A,{level:5,children:(0,H.__)("Drop shadow")}),(0,jd.jsx)(PR,{presets:r,activeShadow:e,onSelect:t}),(0,jd.jsx)("div",{className:"block-editor-global-styles__clear-shadow",children:(0,jd.jsx)(Xy.Ay,{variant:"tertiary",onClick:()=>t(void 0),children:(0,H.__)("Clear")})})]})})}function PR({presets:e,activeShadow:t,onSelect:n}){const r=DR();return e?(0,jd.jsx)(NR,{store:r,role:"listbox",className:"block-editor-global-styles__shadow__list","aria-label":(0,H.__)("Drop shadows"),children:e.map((({name:e,slug:r,shadow:o})=>(0,jd.jsx)(OR,{label:e,isActive:o===t,type:"unset"===r?"unset":"preset",onSelect:()=>n(o===t?void 0:o),shadow:o},r)))}):null}function OR({type:e,label:t,isActive:n,onSelect:r,shadow:o}){return(0,jd.jsx)(RR,{role:"option","aria-label":t,"aria-selected":n,className:(0,Hy.A)("block-editor-global-styles__shadow__item",{"is-active":n}),render:(0,jd.jsx)(Xy.Ay,{className:(0,Hy.A)("block-editor-global-styles__shadow-indicator",{unset:"unset"===e}),onClick:r,label:t,style:{boxShadow:o},showTooltip:!0,children:n&&(0,jd.jsx)(ak.A,{icon:XS.A})})})}function LR({shadow:e,onShadowChange:t,settings:n}){return(0,jd.jsx)(PE.A,{popoverProps:{placement:"left-start",offset:36,shift:!0},className:"block-editor-global-styles__shadow-dropdown",renderToggle:({onToggle:e,isOpen:t})=>{const n={onClick:e,className:(0,Hy.A)({"is-open":t}),"aria-expanded":t};return(0,jd.jsx)(Xy.Ay,{...n,children:(0,jd.jsxs)(eA.A,{justify:"flex-start",children:[(0,jd.jsx)(ak.A,{className:"block-editor-global-styles__toggle-icon",icon:TR.A,size:24}),(0,jd.jsx)(B_.A,{children:(0,H.__)("Drop shadow")})]})})},renderContent:()=>(0,jd.jsx)(VB,{paddingSize:"medium",children:(0,jd.jsx)(MR,{shadow:e,onShadowChange:t,settings:n})})})}function FR(e){return(0,k.useMemo)((()=>{var t;if(!e?.shadow)return BR;const n=e?.shadow?.defaultPresets,{default:r,theme:o,custom:i}=null!==(t=e?.shadow?.presets)&&void 0!==t?t:{},s={name:(0,H.__)("Unset"),slug:"unset",shadow:"none"},a=[...n&&r||BR,...o||BR,...i||BR];return a.length&&a.unshift(s),a}),[e])}function zR(e){return Object.values(UR(e)).some(Boolean)}function UR(e){return{hasBorderColor:VR(e),hasBorderRadius:HR(e),hasBorderStyle:$R(e),hasBorderWidth:WR(e),hasShadow:GR(e)}}function VR(e){return e?.border?.color}function HR(e){return e?.border?.radius}function $R(e){return e?.border?.style}function WR(e){return e?.border?.width}function GR(e){const t=FR(e);return!!e?.shadow&&t.length>0}function qR({resetAllFilter:e,onChange:t,value:n,panelId:r,children:o,label:i}){return(0,jd.jsx)(xA,{label:i,resetAll:()=>{const r=e(n);t(r)},panelId:r,dropdownMenuProps:Iy,children:o})}const KR={radius:!0,color:!0,width:!0,shadow:!0};function YR({as:e=qR,value:t,onChange:n,inheritedValue:r=t,settings:o,panelId:i,name:s,defaultControls:a=KR}){var l,c,u,d;const h=Uy(o),p=(0,k.useCallback)((e=>Ty({settings:o},"",e)),[o]),f=e=>{const t=h.flatMap((({colors:e})=>e)).find((({color:t})=>t===e));return t?"var:preset|color|"+t.slug:e},m=(0,k.useMemo)((()=>{if(Zj(r?.border)){const e={...r?.border};return["top","right","bottom","left"].forEach((t=>{e[t]={...e[t],color:p(e[t]?.color)}})),e}return{...r?.border,color:r?.border?.color?p(r?.border?.color):void 0}}),[r?.border,p]),g=e=>n({...t,border:e}),b=VR(o),v=$R(o),y=WR(o),_=HR(o),x=p(m?.radius),w=e=>g({...m,radius:e}),C=()=>{const e=t?.border?.radius;return"object"==typeof e?Object.entries(e).some(Boolean):!!e},S=GR(o),A=p(r?.shadow),E=null!==(l=o?.shadow?.presets)&&void 0!==l?l:{},I=null!==(c=null!==(u=null!==(d=E.custom)&&void 0!==d?d:E.theme)&&void 0!==u?u:E.default)&&void 0!==c?c:[],j=e=>{const r=I?.find((({shadow:t})=>t===e))?.slug;n(Of(t,["shadow"],r?`var:preset|shadow|${r}`:e||void 0))},T=(0,k.useCallback)((e=>({...e,border:void 0,shadow:void 0})),[]),B=a?.color||a?.width,R=b||v||y||_,N=sN({blockName:s,hasShadowControl:S,hasBorderControl:R});return(0,jd.jsxs)(e,{resetAllFilter:T,value:t,onChange:n,panelId:i,label:N,children:[(y||b)&&(0,jd.jsx)(KA,{hasValue:()=>Xj(t?.border),label:(0,H.__)("Border"),onDeselect:()=>(()=>{if(C())return g({radius:t?.border?.radius});g(void 0)})(),isShownByDefault:B,panelId:i,children:(0,jd.jsx)(gR,{colors:h,enableAlpha:!0,enableStyle:v,onChange:e=>{const t={...e};Zj(t)?["top","right","bottom","left"].forEach((e=>{t[e]&&(t[e]={...t[e],color:f(t[e]?.color)})})):t&&(t.color=f(t.color)),g({radius:m?.radius,...t})},popoverOffset:40,popoverPlacement:"left-start",value:m,__experimentalIsRenderedInSidebar:!0,size:"__unstable-large",hideLabelFromVision:!S,label:(0,H.__)("Border")})}),_&&(0,jd.jsx)(KA,{hasValue:C,label:(0,H.__)("Radius"),onDeselect:()=>w(void 0),isShownByDefault:a.radius,panelId:i,children:(0,jd.jsx)(jR,{values:x,onChange:e=>{w(e||void 0)}})}),S&&(0,jd.jsxs)(KA,{label:(0,H.__)("Shadow"),hasValue:()=>!!t?.shadow,onDeselect:()=>j(void 0),isShownByDefault:a.shadow,panelId:i,children:[R?(0,jd.jsx)(H_.Ay.VisualLabel,{as:"legend",children:(0,H.__)("Shadow")}):null,(0,jd.jsx)(HA,{isBordered:!0,isSeparated:!0,children:(0,jd.jsx)(LR,{shadow:A,onShadowChange:j,settings:o})})]})]})}const JR="__experimentalBorder",XR="shadow",ZR=(e,t,n)=>{let r;return e.some((e=>e.colors.some((e=>e[t]===n&&(r=e,!0))))),r},QR=({colors:e,namedColor:t,customColor:n})=>{if(t){const n=ZR(e,"slug",t);if(n)return n}if(!n)return{color:void 0};return ZR(e,"color",n)||{color:n}};function eN(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function tN(e){if(Zj(e?.border))return{style:e,borderColor:void 0};const t=e?.border?.color,n=t?.startsWith("var:preset|color|")?t.substring(17):void 0,r={...e};return r.border={...r.border,color:n?void 0:t},{style:$y(r),borderColor:n}}function nN(e){return Zj(e.style?.border)?e.style:{...e.style,border:{...e.style?.border,color:e.borderColor?"var:preset|color|"+e.borderColor:e.style?.border?.color}}}function rN({label:e,children:t,resetAllFilter:n}){const r=(0,k.useCallback)((e=>{const t=nN(e),r=n(t);return{...e,...tN(r)}}),[n]);return(0,jd.jsx)(EA,{group:"border",resetAllFilter:r,label:e,children:t})}function oN({clientId:e,name:t,setAttributes:n,settings:r}){const o=zR(r),{style:i,borderColor:s}=(0,Ul.A)((function(t){const{style:n,borderColor:r}=t(dy).getBlockAttributes(e)||{};return{style:n,borderColor:r}}),[e]),a=(0,k.useMemo)((()=>nN({style:i,borderColor:s})),[i,s]);if(!o)return null;const l={...Ec(t,[JR,"__experimentalDefaultControls"]),...Ec(t,[XR,"__experimentalDefaultControls"])};return(0,jd.jsx)(YR,{as:rN,panelId:e,settings:r,value:a,onChange:e=>{n(tN(e))},defaultControls:l})}function iN(e,t="any"){if("web"!==Oh.A.OS)return!1;const n=Ec(e,JR);return!0===n||("any"===t?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t])}function sN({blockName:e,hasBorderControl:t,hasShadowControl:n}={}){const r=UR(Yy(e));return t||n||!e||(t=r?.hasBorderColor||r?.hasBorderStyle||r?.hasBorderWidth||r?.hasBorderRadius,n=r?.hasShadow),t&&n?(0,H.__)("Border & Shadow"):n?(0,H.__)("Shadow"):(0,H.__)("Border")}function aN(e,t,n){if(!iN(t,"color")||Gy(t,JR,"color"))return e;const r=lN(n),o=(0,Hy.A)(e.className,r);return e.className=o||void 0,e}function lN(e){const{borderColor:t,style:n}=e,r=iT("border-color",t);return(0,Hy.A)({"has-border-color":t||n?.border?.color,[r]:!!r})}const cN={useBlockProps:function({name:e,borderColor:t,style:n}){const{colors:r}=sT();if(!iN(e,"color")||Gy(e,JR,"color"))return{};const{color:o}=QR({colors:r,namedColor:t}),{color:i}=QR({colors:r,namedColor:eN(n?.border?.top?.color)}),{color:s}=QR({colors:r,namedColor:eN(n?.border?.right?.color)}),{color:a}=QR({colors:r,namedColor:eN(n?.border?.bottom?.color)}),{color:l}=QR({colors:r,namedColor:eN(n?.border?.left?.color)});return aN({style:$y({borderTopColor:i||o,borderRightColor:s||o,borderBottomColor:a||o,borderLeftColor:l||o})||{}},e,{borderColor:t,style:n})},addSaveProps:aN,attributeKeys:["borderColor","style"],hasSupport:e=>iN(e,"color")};(0,Tu.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return iN(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e}));var uN=n(7652);const dN=(0,$_.default)("div",{target:"ebn2ljm1"})("&:not( :first-of-type ){",(({offsetAmount:e})=>(0,W_.css)({marginInlineStart:e},"","")),";}",(({zIndex:e})=>(0,W_.css)({zIndex:e},"","")),";");var hN={name:"rs0gp6",styles:"grid-row-start:1;grid-column-start:1"};const pN=(0,$_.default)("div",{target:"ebn2ljm0"})("display:inline-grid;grid-auto-flow:column;position:relative;&>",dN,"{position:relative;justify-self:start;",(({isLayered:e})=>e?hN:void 0),";}"),fN=(0,U_.KZ)((function(e,t){const{children:n,className:r,isLayered:o=!0,isReversed:i=!1,offset:s=0,...a}=(0,z_.A)(e,"ZStack"),l=(0,uN.a)(n),c=l.length-1,u=l.map(((e,t)=>{const n=i?c-t:t,r=o?s*t:s,a=(0,k.isValidElement)(e)?e.key:t;return(0,jd.jsx)(dN,{offsetAmount:r,zIndex:n,children:e},a)}));return(0,jd.jsx)(pN,{...a,className:r,isLayered:o,ref:t,children:u})}),"ZStack"),mN=fN;var gN=n(78874);const bN=(0,$_.default)("div",{target:"eln3bjz3"})("border-radius:50%;border:",q_.A.borderWidth," solid ",G_.l.ui.border,";box-sizing:border-box;cursor:grab;height:",32,"px;overflow:hidden;width:",32,"px;:active{cursor:grabbing;}"),vN=(0,$_.default)("div",{target:"eln3bjz2"})({name:"1r307gh",styles:"box-sizing:border-box;position:relative;width:100%;height:100%;:focus-visible{outline:none;}"}),yN=(0,$_.default)("div",{target:"eln3bjz1"})("background:",G_.l.theme.accent,";border-radius:50%;box-sizing:border-box;display:block;left:50%;top:4px;transform:translateX( -50% );position:absolute;width:",6,"px;height:",6,"px;"),_N=(0,$_.default)(PT.A,{target:"eln3bjz0"})("color:",G_.l.theme.accent,";margin-right:",(0,Yw.x)(3),";"),xN=function({value:e,onChange:t,...n}){const r=(0,k.useRef)(null),o=(0,k.useRef)(),i=(0,k.useRef)(),s=e=>{if(void 0!==e&&(e.preventDefault(),e.target?.focus(),void 0!==o.current&&void 0!==t)){const{x:n,y:r}=o.current;t(function(e,t,n,r){const o=r-t,i=n-e,s=Math.atan2(o,i),a=Math.round(s*(180/Math.PI))+90;return a<0?360+a:a}(n,r,e.clientX,e.clientY))}},{startDrag:a,isDragging:l}=sE({onDragStart:e=>{(()=>{if(null===r.current)return;const e=r.current.getBoundingClientRect();o.current={x:e.x+e.width/2,y:e.y+e.height/2}})(),s(e)},onDragMove:s,onDragEnd:s});return(0,k.useEffect)((()=>{l?(void 0===i.current&&(i.current=document.body.style.cursor),document.body.style.cursor="grabbing"):(document.body.style.cursor=i.current||"",i.current=void 0)}),[l]),(0,jd.jsx)(bN,{ref:r,onMouseDown:a,className:"components-angle-picker-control__angle-circle",...n,children:(0,jd.jsx)(vN,{style:e?{transform:`rotate(${e}deg)`}:void 0,className:"components-angle-picker-control__angle-circle-indicator-wrapper",tabIndex:-1,children:(0,jd.jsx)(yN,{className:"components-angle-picker-control__angle-circle-indicator"})})})},wN=(0,k.forwardRef)((function(e,t){const{className:n,label:r=(0,H.__)("Angle"),onChange:o,value:i,...s}=e,a=(0,Hy.A)("components-angle-picker-control",n),l=(0,jd.jsx)(_N,{children:"°"}),[c,u]=(0,H.isRTL)()?[l,null]:[null,l];return(0,jd.jsxs)(T_.A,{...s,ref:t,className:a,gap:2,children:[(0,jd.jsx)(gN.A,{children:(0,jd.jsx)(qw.A,{label:r,className:"components-angle-picker-control__input-field",max:360,min:0,onChange:e=>{if(void 0===o)return;const t=void 0!==e&&""!==e?parseInt(e,10):0;o(t)},size:"__unstable-large",step:"1",value:i,spinControls:"none",prefix:c,suffix:u})}),(0,jd.jsx)(OT.A,{marginBottom:"1",marginTop:"auto",children:(0,jd.jsx)(xN,{"aria-hidden":"true",value:i,onChange:o})})]})})),kN=wN,CN=10,SN=0,AN=CN;function EN(e){return Math.max(0,Math.min(100,e))}function IN(e,t,n){const r=e.slice();return r[t]=n,r}function jN(e,t,n){return function(e,t,n,r=SN){const o=e[t].position,i=Math.min(o,n),s=Math.max(o,n);return e.some((({position:e},o)=>o!==t&&(Math.abs(e-n)({placement:"bottom",offset:8,resize:!1})),[]),o=(0,Hy.A)("components-custom-gradient-picker__control-point-dropdown",t);return(0,jd.jsx)(GB,{isRenderedInSidebar:e,popoverProps:r,className:o,...n})}function DN({disableRemove:e,disableAlpha:t,gradientPickerDomRef:n,ignoreMarkerPosition:r,value:o,onChange:i,onStartControlPointChange:s,onStopControlPointChange:a,__experimentalIsRenderedInSidebar:l}){const c=(0,k.useRef)(),u=e=>{if(void 0===c.current||null===n.current)return;const t=BN(e.clientX,n.current),{initialPosition:r,index:s,significantMoveHappened:a}=c.current;!a&&Math.abs(r-t)>=5&&(c.current.significantMoveHappened=!0),i(jN(o,s,t))},d=()=>{window&&window.removeEventListener&&c.current&&c.current.listenersActivated&&(window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",d),a(),c.current.listenersActivated=!1)},h=(0,k.useRef)();return h.current=d,(0,k.useEffect)((()=>()=>{h.current?.()}),[]),(0,jd.jsx)(jd.Fragment,{children:o.map(((n,h)=>{const p=n?.position;return r!==p&&(0,jd.jsx)(NN,{isRenderedInSidebar:l,onClose:a,renderToggle:({isOpen:e,onToggle:t})=>(0,jd.jsx)(RN,{onClick:()=>{c.current&&c.current.significantMoveHappened||(e?a():s(),t())},onMouseDown:()=>{window&&window.addEventListener&&(c.current={initialPosition:p,index:h,significantMoveHappened:!1,listenersActivated:!0},s(),window.addEventListener("mousemove",u),window.addEventListener("mouseup",d))},onKeyDown:e=>{"ArrowLeft"===e.code?(e.stopPropagation(),i(jN(o,h,EN(n.position-AN)))):"ArrowRight"===e.code&&(e.stopPropagation(),i(jN(o,h,EN(n.position+AN))))},isOpen:e,position:n.position,color:n.color},h),renderContent:({onClose:r})=>(0,jd.jsxs)(VB,{paddingSize:"none",children:[(0,jd.jsx)(TB,{enableAlpha:!t,color:n.color,onChange:e=>{i(TN(o,h,(0,oc.Mj)(e).toRgbString()))}}),!e&&o.length>2&&(0,jd.jsx)(eA.A,{className:"components-custom-gradient-picker__remove-control-point-wrapper",alignment:"center",children:(0,jd.jsx)(Xy.Ay,{onClick:()=>{i(function(e,t){return e.filter(((e,n)=>n!==t))}(o,h)),r()},variant:"link",children:(0,H.__)("Remove Control Point")})})]}),style:{left:`${n.position}%`,transform:"translateX( -50% )"}},h)}))})}DN.InsertPoint=function({value:e,onChange:t,onOpenInserter:n,onCloseInserter:r,insertPosition:o,disableAlpha:i,__experimentalIsRenderedInSidebar:s}){const[a,l]=(0,k.useState)(!1);return(0,jd.jsx)(NN,{isRenderedInSidebar:s,className:"components-custom-gradient-picker__inserter",onClose:()=>{r()},renderToggle:({isOpen:e,onToggle:t})=>(0,jd.jsx)(Xy.Ay,{"aria-expanded":e,"aria-haspopup":"true",onClick:()=>{e?r():(l(!1),n()),t()},className:"components-custom-gradient-picker__insert-point-dropdown",icon:ZS.A}),renderContent:()=>(0,jd.jsx)(VB,{paddingSize:"none",children:(0,jd.jsx)(TB,{enableAlpha:!i,onChange:n=>{a?t(function(e,t,n){const r=e.findIndex((e=>e.position===t));return TN(e,r,n)}(e,o,(0,oc.Mj)(n).toRgbString())):(t(function(e,t,n){const r=e.findIndex((e=>e.position>t)),o={color:n,position:t},i=e.slice();return i.splice(r-1,0,o),i}(e,o,(0,oc.Mj)(n).toRgbString())),l(!0))}})}),style:null!==o?{left:`${o}%`,transform:"translateX( -50% )"}:void 0})};const MN=DN,PN=(e,t)=>{switch(t.type){case"MOVE_INSERTER":if("IDLE"===e.id||"MOVING_INSERTER"===e.id)return{id:"MOVING_INSERTER",insertPosition:t.insertPosition};break;case"STOP_INSERTER_MOVE":if("MOVING_INSERTER"===e.id)return{id:"IDLE"};break;case"OPEN_INSERTER":if("MOVING_INSERTER"===e.id)return{id:"INSERTING_CONTROL_POINT",insertPosition:e.insertPosition};break;case"CLOSE_INSERTER":if("INSERTING_CONTROL_POINT"===e.id)return{id:"IDLE"};break;case"START_CONTROL_CHANGE":if("IDLE"===e.id)return{id:"MOVING_CONTROL_POINT"};break;case"STOP_CONTROL_CHANGE":if("MOVING_CONTROL_POINT"===e.id)return{id:"IDLE"}}return e},ON={id:"IDLE"};function LN({background:e,hasGradient:t,value:n,onChange:r,disableInserter:o=!1,disableAlpha:i=!1,__experimentalIsRenderedInSidebar:s=!1}){const a=(0,k.useRef)(null),[l,c]=(0,k.useReducer)(PN,ON),u=e=>{if(!a.current)return;const t=BN(e.clientX,a.current);n.some((({position:e})=>Math.abs(t-e){c({type:"STOP_INSERTER_MOVE"})},children:[(0,jd.jsx)("div",{className:"components-custom-gradient-picker__gradient-bar-background",style:{background:e,opacity:t?1:.4}}),(0,jd.jsxs)("div",{ref:a,className:"components-custom-gradient-picker__markers-container",children:[!o&&(d||h)&&(0,jd.jsx)(MN.InsertPoint,{__experimentalIsRenderedInSidebar:s,disableAlpha:i,insertPosition:l.insertPosition,value:n,onChange:r,onOpenInserter:()=>{c({type:"OPEN_INSERTER"})},onCloseInserter:()=>{c({type:"CLOSE_INSERTER"})}}),(0,jd.jsx)(MN,{__experimentalIsRenderedInSidebar:s,disableAlpha:i,disableRemove:o,gradientPickerDomRef:a,ignoreMarkerPosition:h?l.insertPosition:void 0,value:n,onChange:r,onStartControlPointChange:()=>{c({type:"START_CONTROL_CHANGE"})},onStopControlPointChange:()=>{c({type:"STOP_CONTROL_CHANGE"})}})]})]})}var FN=n(37328);const zN="linear-gradient(135deg, rgba(6, 147, 227, 1) 0%, rgb(155, 81, 224) 100%)",UN={type:"angular",value:"90"},VN=[{value:"linear-gradient",label:(0,H.__)("Linear")},{value:"radial-gradient",label:(0,H.__)("Radial")}],HN={top:0,"top right":45,"right top":45,right:90,"right bottom":135,"bottom right":135,bottom:180,"bottom left":225,"left bottom":225,left:270,"top left":315,"left top":315};function $N({type:e,value:t,length:n}){return`${function({type:e,value:t}){return"literal"===e?t:"hex"===e?`#${t}`:`${e}(${t.join(",")})`}({type:e,value:t})} ${function(e){if(!e)return"";const{value:t,type:n}=e;return`${t}${n}`}(n)}`}function WN({type:e,orientation:t,colorStops:n}){const r=function(e){if(!Array.isArray(e)&&e&&"angular"===e.type)return`${e.value}deg`}(t);return`${e}(${[r,...n.sort(((e,t)=>{const n=e=>void 0===e?.length?.value?0:parseInt(e.length.value);return n(e)-n(t)})).map($N)].filter(Boolean).join(",")})`}function GN(e){return void 0===e.length||"%"!==e.length.type}function qN(e){switch(e.type){case"hex":return`#${e.value}`;case"literal":return e.value;case"rgb":case"rgba":return`${e.type}(${e.value.join(",")})`;default:return"transparent"}}(0,oc.X$)([ic.A]);const KN=(0,$_.default)(gN.A,{target:"e10bzpgi1"})({name:"1gvx10y",styles:"flex-grow:5"}),YN=(0,$_.default)(gN.A,{target:"e10bzpgi0"})({name:"1gvx10y",styles:"flex-grow:5"}),JN=({gradientAST:e,hasGradient:t,onChange:n})=>{var r;const o=null!==(r=e?.orientation?.value)&&void 0!==r?r:180;return(0,jd.jsx)(kN,{onChange:t=>{n(WN({...e,orientation:{type:"angular",value:`${t}`}}))},value:t?o:""})},XN=({gradientAST:e,hasGradient:t,onChange:n})=>{const{type:r}=e;return(0,jd.jsx)(kT.A,{__nextHasNoMarginBottom:!0,className:"components-custom-gradient-picker__type-picker",label:(0,H.__)("Type"),labelPosition:"top",onChange:t=>{"linear-gradient"===t&&n(WN({...e,orientation:e.orientation?void 0:UN,type:"linear-gradient"})),"radial-gradient"===t&&(()=>{const{orientation:t,...r}=e;n(WN({...r,type:"radial-gradient"}))})()},options:VN,size:"__unstable-large",value:t?r:void 0})},ZN=function({value:e,onChange:t,__experimentalIsRenderedInSidebar:n=!1}){const{gradientAST:r,hasGradient:o}=function(e){let t,n=!!e;const r=null!=e?e:zN;try{t=FN.parse(r)[0]}catch(e){console.warn("wp.components.CustomGradientPicker failed to parse the gradient with error",e),t=FN.parse(zN)[0],n=!1}if(Array.isArray(t.orientation)||"directional"!==t.orientation?.type||(t.orientation={type:"angular",value:HN[t.orientation.value].toString()}),t.colorStops.some(GN)){const{colorStops:e}=t,n=100/(e.length-1);e.forEach(((e,t)=>{e.length={value:""+n*t,type:"%"}}))}return{gradientAST:t,hasGradient:n}}(e),i=function(e){return WN({type:"linear-gradient",orientation:UN,colorStops:e.colorStops})}(r),s=r.colorStops.map((e=>({color:qN(e),position:parseInt(e.length.value)})));return(0,jd.jsxs)(oE.A,{spacing:4,className:"components-custom-gradient-picker",children:[(0,jd.jsx)(LN,{__experimentalIsRenderedInSidebar:n,background:i,hasGradient:o,value:s,onChange:e=>{t(WN(function(e,t){return{...e,colorStops:t.map((({position:e,color:t})=>{const{r:n,g:r,b:o,a:i}=(0,oc.Mj)(t).toRgb();return{length:{type:"%",value:e?.toString()},type:i<1?"rgba":"rgb",value:i<1?[`${n}`,`${r}`,`${o}`,`${i}`]:[`${n}`,`${r}`,`${o}`]}}))}}(r,e)))}}),(0,jd.jsxs)(T_.A,{gap:3,className:"components-custom-gradient-picker__ui-line",children:[(0,jd.jsx)(KN,{children:(0,jd.jsx)(XN,{gradientAST:r,hasGradient:o,onChange:t})}),(0,jd.jsx)(YN,{children:"linear-gradient"===r.type&&(0,jd.jsx)(JN,{gradientAST:r,hasGradient:o,onChange:t})})]})]})};function QN({className:e,clearGradient:t,gradients:n,onChange:r,value:o,...i}){const s=(0,k.useMemo)((()=>n.map((({gradient:e,name:n,slug:i},s)=>(0,jd.jsx)(LB.Option,{value:e,isSelected:o===e,tooltipText:n||(0,H.sprintf)((0,H.__)("Gradient code: %s"),e),style:{color:"rgba( 0,0,0,0 )",background:e},onClick:o===e?t:()=>r(e,s),"aria-label":n?(0,H.sprintf)((0,H.__)("Gradient: %s"),n):(0,H.sprintf)((0,H.__)("Gradient code: %s"),e)},i)))),[n,o,r,t]);return(0,jd.jsx)(LB.OptionGroup,{className:e,options:s,...i})}function eD({className:e,clearGradient:t,gradients:n,onChange:r,value:o,headingLevel:i}){const s=(0,F_.A)(eD);return(0,jd.jsx)(oE.A,{spacing:3,className:e,children:n.map((({name:e,gradients:n},a)=>{const l=`color-palette-${s}-${a}`;return(0,jd.jsxs)(oE.A,{spacing:2,children:[(0,jd.jsx)(FB,{level:i,id:l,children:e}),(0,jd.jsx)(QN,{clearGradient:t,gradients:n,onChange:e=>r(e,a),value:o,"aria-labelledby":l})]},a)}))})}function tD(e){const{asButtons:t,loop:n,actions:r,headingLevel:o,"aria-label":i,"aria-labelledby":s,...a}=e,l=(c=e.gradients).length>0&&c.every((e=>{return t=e,Array.isArray(t.gradients)&&!("gradient"in t);var t}))?(0,jd.jsx)(eD,{headingLevel:o,...a}):(0,jd.jsx)(QN,{...a});var c;let u;if(t)u={asButtons:!0};else{const e={asButtons:!1,loop:n};u=i?{...e,"aria-label":i}:s?{...e,"aria-labelledby":s}:{...e,"aria-label":(0,H.__)("Custom color picker.")}}return(0,jd.jsx)(LB,{...u,actions:r,options:l})}const nD=function({className:e,gradients:t=[],onChange:n,value:r,clearable:o=!0,disableCustomGradients:i=!1,__experimentalIsRenderedInSidebar:s,headingLevel:a=2,...l}){const c=(0,k.useCallback)((()=>n(void 0)),[n]);return(0,jd.jsxs)(oE.A,{spacing:t.length?4:0,children:[!i&&(0,jd.jsx)(ZN,{__experimentalIsRenderedInSidebar:s,value:r,onChange:n}),(t.length>0||o)&&(0,jd.jsx)(tD,{...l,className:e,clearGradient:c,gradients:t,onChange:n,value:r,actions:o&&!i&&(0,jd.jsx)(LB.ButtonAction,{onClick:c,children:(0,H.__)("Clear")}),headingLevel:a})]})},{Tabs:rD}=kf(u_.j),oD=["colors","disableCustomColors","gradients","disableCustomGradients"],iD={color:"color",gradient:"gradient"};function sD({colors:e,gradients:t,disableCustomColors:n,disableCustomGradients:r,__experimentalIsRenderedInSidebar:o,className:i,label:s,onColorChange:a,onGradientChange:l,colorValue:c,gradientValue:u,clearable:d,showTitle:h=!0,enableAlpha:p,headingLevel:f}){const m=a&&(e&&e.length>0||!n),g=l&&(t&&t.length>0||!r);if(!m&&!g)return null;const b={[iD.color]:(0,jd.jsx)(KB,{value:c,onChange:g?e=>{a(e),l()}:a,colors:e,disableCustomColors:n,__experimentalIsRenderedInSidebar:o,clearable:d,enableAlpha:p,headingLevel:f}),[iD.gradient]:(0,jd.jsx)(nD,{value:u,onChange:m?e=>{l(e),a()}:l,gradients:t,disableCustomGradients:r,__experimentalIsRenderedInSidebar:o,clearable:d,headingLevel:f})},v=e=>(0,jd.jsx)("div",{className:"block-editor-color-gradient-control__panel",children:b[e]});return(0,jd.jsx)(H_.Ay,{__nextHasNoMarginBottom:!0,className:(0,Hy.A)("block-editor-color-gradient-control",i),children:(0,jd.jsx)("fieldset",{className:"block-editor-color-gradient-control__fieldset",children:(0,jd.jsxs)(oE.A,{spacing:1,children:[h&&(0,jd.jsx)("legend",{children:(0,jd.jsx)("div",{className:"block-editor-color-gradient-control__color-indicator",children:(0,jd.jsx)(H_.Ay.VisualLabel,{children:s})})}),m&&g&&(0,jd.jsx)("div",{children:(0,jd.jsxs)(rD,{defaultTabId:u?iD.gradient:!!m&&iD.color,children:[(0,jd.jsxs)(rD.TabList,{children:[(0,jd.jsx)(rD.Tab,{tabId:iD.color,children:(0,H.__)("Color")}),(0,jd.jsx)(rD.Tab,{tabId:iD.gradient,children:(0,H.__)("Gradient")})]}),(0,jd.jsx)(rD.TabPanel,{tabId:iD.color,className:"block-editor-color-gradient-control__panel",focusable:!1,children:b.color}),(0,jd.jsx)(rD.TabPanel,{tabId:iD.gradient,className:"block-editor-color-gradient-control__panel",focusable:!1,children:b.gradient})]})}),!g&&v(iD.color),!m&&v(iD.gradient)]})})})}function aD(e){const[t,n,r,o]=py("color.palette","color.gradients","color.custom","color.customGradient");return(0,jd.jsx)(sD,{colors:t,gradients:n,disableCustomColors:!r,disableCustomGradients:!o,...e})}const lD=function(e){return oD.every((t=>e.hasOwnProperty(t)))?(0,jd.jsx)(sD,{...e}):(0,jd.jsx)(aD,{...e})};function cD(e){const t=uD(e),n=mD(e),r=dD(e),o=pD(e),i=fD(e),s=hD(e);return t||n||r||o||i||s}function uD(e){const t=Uy(e);return e?.color?.text&&(t?.length>0||e?.color?.custom)}function dD(e){const t=Uy(e);return e?.color?.link&&(t?.length>0||e?.color?.custom)}function hD(e){const t=Uy(e);return e?.color?.caption&&(t?.length>0||e?.color?.custom)}function pD(e){const t=Uy(e),n=Vy(e);return e?.color?.heading&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function fD(e){const t=Uy(e),n=Vy(e);return e?.color?.button&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function mD(e){const t=Uy(e),n=Vy(e);return e?.color?.background&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function gD({resetAllFilter:e,onChange:t,value:n,panelId:r,children:o}){return(0,jd.jsx)(xA,{label:(0,H.__)("Elements"),resetAll:()=>{const r=e(n);t(r)},panelId:r,hasInnerWrapper:!0,headingLevel:3,className:"color-block-support-panel",__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:Iy,children:(0,jd.jsx)("div",{className:"color-block-support-panel__inner-wrapper",children:o})})}const bD={text:!0,background:!0,link:!0,heading:!0,button:!0,caption:!0},vD={placement:"left-start",offset:36,shift:!0},{Tabs:yD}=kf(u_.j),_D=({indicators:e,label:t})=>(0,jd.jsxs)(eA.A,{justify:"flex-start",children:[(0,jd.jsx)(mN,{isLayered:!1,offset:-8,children:e.map(((e,t)=>(0,jd.jsx)(T_.A,{expanded:!1,children:(0,jd.jsx)(xT,{colorValue:e})},t)))}),(0,jd.jsx)(B_.A,{className:"block-editor-panel-color-gradient-settings__color-name",title:t,children:t})]});function xD({isGradient:e,inheritedValue:t,userValue:n,setValue:r,colorGradientControlSettings:o}){return(0,jd.jsx)(lD,{...o,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:e?void 0:t,gradientValue:e?t:void 0,onColorChange:e?void 0:r,onGradientChange:e?r:void 0,clearable:t===n,headingLevel:3})}function wD({label:e,hasValue:t,resetValue:n,isShownByDefault:r,indicators:o,tabs:i,colorGradientControlSettings:s,panelId:a}){var l;const c=i.find((e=>void 0!==e.userValue)),{key:u,...d}=null!==(l=i[0])&&void 0!==l?l:{};return(0,jd.jsx)(KA,{className:"block-editor-tools-panel-color-gradient-settings__item",hasValue:t,label:e,onDeselect:n,isShownByDefault:r,panelId:a,children:(0,jd.jsx)(PE.A,{popoverProps:vD,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:t,isOpen:n})=>{const r={onClick:t,className:(0,Hy.A)("block-editor-panel-color-gradient-settings__dropdown",{"is-open":n}),"aria-expanded":n,"aria-label":(0,H.sprintf)((0,H.__)("Color %s styles"),e)};return(0,jd.jsx)(Xy.Ay,{...r,children:(0,jd.jsx)(_D,{indicators:o,label:e})})},renderContent:()=>(0,jd.jsx)(VB,{paddingSize:"none",children:(0,jd.jsxs)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:[1===i.length&&(0,jd.jsx)(xD,{...d,colorGradientControlSettings:s},u),i.length>1&&(0,jd.jsxs)(yD,{defaultTabId:c?.key,children:[(0,jd.jsx)(yD.TabList,{children:i.map((e=>(0,jd.jsx)(yD.Tab,{tabId:e.key,children:e.label},e.key)))}),i.map((e=>{const{key:t,...n}=e;return(0,jd.jsx)(yD.TabPanel,{tabId:t,focusable:!1,children:(0,jd.jsx)(xD,{...n,colorGradientControlSettings:s},t)},t)}))]})]})})})})}function kD({as:e=gD,value:t,onChange:n,inheritedValue:r=t,settings:o,panelId:i,defaultControls:s=bD,children:a}){const l=Uy(o),c=Vy(o),u=o?.color?.custom,d=o?.color?.customGradient,h=l.length>0||u,p=c.length>0||d,f=e=>Ty({settings:o},"",e),m=e=>{const t=l.flatMap((({colors:e})=>e)).find((({color:t})=>t===e));return t?"var:preset|color|"+t.slug:e},g=e=>{const t=c.flatMap((({gradients:e})=>e)).find((({gradient:t})=>t===e));return t?"var:preset|gradient|"+t.slug:e},b=mD(o),v=f(r?.color?.background),y=f(t?.color?.background),_=f(r?.color?.gradient),x=f(t?.color?.gradient),w=dD(o),C=f(r?.elements?.link?.color?.text),S=f(t?.elements?.link?.color?.text),A=f(r?.elements?.link?.[":hover"]?.color?.text),E=f(t?.elements?.link?.[":hover"]?.color?.text),I=uD(o),j=f(r?.color?.text),T=f(t?.color?.text),B=e=>{let r=Of(t,["color","text"],m(e));j===C&&(r=Of(r,["elements","link","color","text"],m(e))),n(r)},R=[{name:"caption",label:(0,H.__)("Captions"),showPanel:hD(o)},{name:"button",label:(0,H.__)("Button"),showPanel:fD(o)},{name:"heading",label:(0,H.__)("Heading"),showPanel:pD(o)},{name:"h1",label:(0,H.__)("H1"),showPanel:pD(o)},{name:"h2",label:(0,H.__)("H2"),showPanel:pD(o)},{name:"h3",label:(0,H.__)("H3"),showPanel:pD(o)},{name:"h4",label:(0,H.__)("H4"),showPanel:pD(o)},{name:"h5",label:(0,H.__)("H5"),showPanel:pD(o)},{name:"h6",label:(0,H.__)("H6"),showPanel:pD(o)}],N=(0,k.useCallback)((e=>({...e,color:void 0,elements:{...e?.elements,link:{...e?.elements?.link,color:void 0,":hover":{color:void 0}},...R.reduce(((t,n)=>({...t,[n.name]:{...e?.elements?.[n.name],color:void 0}})),{})}})),[]),D=[I&&{key:"text",label:(0,H.__)("Text"),hasValue:()=>!!T,resetValue:()=>B(void 0),isShownByDefault:s.text,indicators:[j],tabs:[{key:"text",label:(0,H.__)("Text"),inheritedValue:j,setValue:B,userValue:T}]},b&&{key:"background",label:(0,H.__)("Background"),hasValue:()=>!!y||!!x,resetValue:()=>{const e=Of(t,["color","background"],void 0);e.color.gradient=void 0,n(e)},isShownByDefault:s.background,indicators:[null!=_?_:v],tabs:[h&&{key:"background",label:(0,H.__)("Color"),inheritedValue:v,setValue:e=>{const r=Of(t,["color","background"],m(e));r.color.gradient=void 0,n(r)},userValue:y},p&&{key:"gradient",label:(0,H.__)("Gradient"),inheritedValue:_,setValue:e=>{const r=Of(t,["color","gradient"],g(e));r.color.background=void 0,n(r)},userValue:x,isGradient:!0}].filter(Boolean)},w&&{key:"link",label:(0,H.__)("Link"),hasValue:()=>!!S||!!E,resetValue:()=>{let e=Of(t,["elements","link",":hover","color","text"],void 0);e=Of(e,["elements","link","color","text"],void 0),n(e)},isShownByDefault:s.link,indicators:[C,A],tabs:[{key:"link",label:(0,H.__)("Default"),inheritedValue:C,setValue:e=>{n(Of(t,["elements","link","color","text"],m(e)))},userValue:S},{key:"hover",label:(0,H.__)("Hover"),inheritedValue:A,setValue:e=>{n(Of(t,["elements","link",":hover","color","text"],m(e)))},userValue:E}]}].filter(Boolean);return R.forEach((({name:e,label:o,showPanel:i})=>{if(!i)return;const a=f(r?.elements?.[e]?.color?.background),l=f(r?.elements?.[e]?.color?.gradient),c=f(r?.elements?.[e]?.color?.text),u=f(t?.elements?.[e]?.color?.background),d=f(t?.elements?.[e]?.color?.gradient),b=f(t?.elements?.[e]?.color?.text),v="caption"!==e;D.push({key:e,label:o,hasValue:()=>!!(b||u||d),resetValue:()=>{const r=Of(t,["elements",e,"color","background"],void 0);r.elements[e].color.gradient=void 0,r.elements[e].color.text=void 0,n(r)},isShownByDefault:s[e],indicators:v?[c,null!=l?l:a]:[c],tabs:[h&&{key:"text",label:(0,H.__)("Text"),inheritedValue:c,setValue:r=>{n(Of(t,["elements",e,"color","text"],m(r)))},userValue:b},h&&v&&{key:"background",label:(0,H.__)("Background"),inheritedValue:a,setValue:r=>{const o=Of(t,["elements",e,"color","background"],m(r));o.elements[e].color.gradient=void 0,n(o)},userValue:u},p&&v&&{key:"gradient",label:(0,H.__)("Gradient"),inheritedValue:l,setValue:r=>{const o=Of(t,["elements",e,"color","gradient"],g(r));o.elements[e].color.background=void 0,n(o)},userValue:d,isGradient:!0}].filter(Boolean)})})),(0,jd.jsxs)(e,{resetAllFilter:N,value:t,onChange:n,panelId:i,children:[D.map((e=>{const{key:t,...n}=e;return(0,jd.jsx)(wD,{...n,colorGradientControlSettings:{colors:l,disableCustomColors:!u,gradients:c,disableCustomGradients:!d},panelId:i},t)})),a]})}(0,oc.X$)([ic.A,sc.A]);const CD=function({backgroundColor:e,fallbackBackgroundColor:t,fallbackTextColor:n,fallbackLinkColor:r,fontSize:o,isLargeText:i,textColor:s,linkColor:a,enableAlphaChecker:l=!1}){const c=e||t;if(!c)return null;const u=s||n,d=a||r;if(!u&&!d)return null;const h=[{color:u,description:(0,H.__)("text color")},{color:d,description:(0,H.__)("link color")}],p=(0,oc.Mj)(c),f=p.alpha()<1,m=p.brightness(),g={level:"AA",size:i||!1!==i&&o>=24?"large":"small"};let b="",v="";for(const e of h){if(!e.color)continue;const t=(0,oc.Mj)(e.color),n=t.isReadable(p,g),r=t.alpha()<1;if(!n){if(f||r)continue;b=m{if(!a.current)return;o(SD(a.current).color);const e=a.current?.querySelector("a");e&&e.innerText&&s(SD(e).color);let t=a.current,r=SD(t).backgroundColor;for(;"rgba(0, 0, 0, 0)"===r&&t.parentNode&&t.parentNode.nodeType===t.parentNode.ELEMENT_NODE;)t=t.parentNode,r=SD(t).backgroundColor;n(r)})),(0,jd.jsx)(CD,{backgroundColor:t,textColor:r,enableAlphaChecker:!0,linkColor:i})}const ED="color",ID=e=>{const t=Ec(e,ED);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},jD=e=>{if("web"!==Oh.A.OS)return!1;const t=Ec(e,ED);return null!==t&&"object"==typeof t&&!!t.link},TD=e=>{const t=Ec(e,ED);return null!==t&&"object"==typeof t&&!!t.gradients},BD=e=>{const t=Ec(e,ED);return t&&!1!==t.background},RD=e=>{const t=Ec(e,ED);return t&&!1!==t.text};function ND(e,t,n){if(!ID(t)||Gy(t,ED))return e;const r=TD(t),{backgroundColor:o,textColor:i,gradient:s,style:a}=n,l=e=>!Gy(t,ED,e),c=l("text")?iT("color",i):void 0,u=l("gradients")?function(e){if(e)return`has-${e}-gradient-background`}(s):void 0,d=l("background")?iT("background-color",o):void 0,h=l("background")||l("gradients"),p=o||a?.color?.background||r&&(s||a?.color?.gradient),f=(0,Hy.A)(e.className,c,u,{[d]:!(r&&a?.color?.gradient||!d),"has-text-color":l("text")&&(i||a?.color?.text),"has-background":h&&p,"has-link-color":l("link")&&a?.elements?.link?.color});return e.className=f||void 0,e}function DD(e){const t=e?.color?.text,n=t?.startsWith("var:preset|color|")?t.substring(17):void 0,r=e?.color?.background,o=r?.startsWith("var:preset|color|")?r.substring(17):void 0,i=e?.color?.gradient,s=i?.startsWith("var:preset|gradient|")?i.substring(20):void 0,a={...e};return a.color={...a.color,text:n?void 0:t,background:o?void 0:r,gradient:s?void 0:i},{style:$y(a),textColor:n,backgroundColor:o,gradient:s}}function MD(e){return{...e.style,color:{...e.style?.color,text:e.textColor?"var:preset|color|"+e.textColor:e.style?.color?.text,background:e.backgroundColor?"var:preset|color|"+e.backgroundColor:e.style?.color?.background,gradient:e.gradient?"var:preset|gradient|"+e.gradient:e.style?.color?.gradient}}}function PD({children:e,resetAllFilter:t}){const n=(0,k.useCallback)((e=>{const n=MD(e),r=t(n);return{...e,...DD(r)}}),[t]);return(0,jd.jsx)(EA,{group:"color",resetAllFilter:n,children:e})}function OD({clientId:e,name:t,setAttributes:n,settings:r}){const o=cD(r),{style:i,textColor:s,backgroundColor:a,gradient:l}=(0,Ul.A)((function(t){const{style:n,textColor:r,backgroundColor:o,gradient:i}=t(dy).getBlockAttributes(e)||{};return{style:n,textColor:r,backgroundColor:o,gradient:i}}),[e]),c=(0,k.useMemo)((()=>MD({style:i,textColor:s,backgroundColor:a,gradient:l})),[i,s,a,l]);if(!o)return null;const u=Ec(t,[ED,"__experimentalDefaultControls"]),d="web"===Oh.A.OS&&!c?.color?.gradient&&(r?.color?.text||r?.color?.link)&&!1!==Ec(t,[ED,"enableContrastChecker"]);return(0,jd.jsx)(kD,{as:PD,panelId:e,settings:r,value:c,onChange:e=>{n(DD(e))},defaultControls:u,enableContrastChecker:!1!==Ec(t,[ED,"enableContrastChecker"]),children:d&&(0,jd.jsx)(AD,{clientId:e})})}const LD={useBlockProps:function({name:e,backgroundColor:t,textColor:n,gradient:r,style:o}){const[i,s,a]=py("color.palette.custom","color.palette.theme","color.palette.default"),l=(0,k.useMemo)((()=>[...i||[],...s||[],...a||[]]),[i,s,a]);if(!ID(e)||Gy(e,ED))return{};const c={};n&&!Gy(e,ED,"text")&&(c.color=rT(l,n)?.color),t&&!Gy(e,ED,"background")&&(c.backgroundColor=rT(l,t)?.color);const u=ND({style:c},e,{textColor:n,backgroundColor:t,gradient:r,style:o}),d=t||o?.color?.background||r||o?.color?.gradient;return{...u,className:(0,Hy.A)(u.className,!d&&Oj(o))}},addSaveProps:ND,attributeKeys:["backgroundColor","textColor","gradient","style"],hasSupport:ID},FD={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,Tu.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return ID(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),TD(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,Tu.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,r){const o=e.name;return Wy({linkColor:jD(o),textColor:RD(o),backgroundColor:BD(o),gradient:TD(o)},FD,e,t,n,r)}));var zD=n(56875);function UD(e){const[t,...n]=e;if(!t)return null;const[,r]=$w(t.size),o=n.every((e=>{const[,t]=$w(e.size);return t===r}));return o?r:null}const VD=(0,$_.default)("fieldset",{target:"e8tqeku4"})({name:"1t1ytme",styles:"border:0;margin:0;padding:0"}),HD=(0,$_.default)(eA.A,{target:"e8tqeku3"})("height:",(0,Yw.x)(4),";"),$D=(0,$_.default)(Xy.Ay,{target:"e8tqeku2"})("margin-top:",(0,Yw.x)(-1),";"),WD=(0,$_.default)(H_.Ay.VisualLabel,{target:"e8tqeku1"})("display:flex;gap:",(0,Yw.x)(1),";justify-content:flex-start;margin-bottom:0;"),GD=(0,$_.default)("span",{target:"e8tqeku0"})("color:",G_.l.gray[700],";");var qD=n(76502);const KD={key:"default",name:(0,H.__)("Default"),value:void 0},YD={key:"custom",name:(0,H.__)("Custom")},JD=e=>{var t;const{__next40pxDefaultSize:n,fontSizes:r,value:o,disableCustomFontSizes:i,size:s,onChange:a,onSelectCustom:l}=e,c=!!UD(r),u=[KD,...r.map((e=>{let t;if(c){const[n]=$w(e.size);void 0!==n&&(t=String(n))}else(function(e){return/^[\d\.]+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i.test(String(e))})(e.size)&&(t=String(e.size));return{key:e.slug,name:e.name||e.slug,value:e.size,__experimentalHint:t}})),...i?[]:[YD]],d=o?null!==(t=u.find((e=>e.value===o)))&&void 0!==t?t:YD:KD;return(0,jd.jsx)(qD.A,{__next40pxDefaultSize:n,className:"components-font-size-picker__select",label:(0,H.__)("Font size"),hideLabelFromVision:!0,describedBy:(0,H.sprintf)((0,H.__)("Currently selected font size: %s"),d.name),options:u,value:d,__experimentalShowSelectedHint:!0,onChange:({selectedItem:e})=>{e===YD?l():a(e.value)},size:s})},XD=[(0,H.__)("S"),(0,H.__)("M"),(0,H.__)("L"),(0,H.__)("XL"),(0,H.__)("XXL")],ZD=[(0,H.__)("Small"),(0,H.__)("Medium"),(0,H.__)("Large"),(0,H.__)("Extra Large"),(0,H.__)("Extra Extra Large")],QD=e=>{const{fontSizes:t,value:n,__next40pxDefaultSize:r,size:o,onChange:i}=e;return(0,jd.jsx)(xx,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:r,label:(0,H.__)("Font size"),hideLabelFromVision:!0,value:n,onChange:i,isBlock:!0,size:o,children:t.map(((e,t)=>(0,jd.jsx)(FC,{value:e.size,label:XD[t],"aria-label":e.name||ZD[t],showTooltip:!0},e.slug)))})},eM=["px","em","rem","vw","vh"],tM=(0,k.forwardRef)(((e,t)=>{const{__next40pxDefaultSize:n=!1,fallbackFontSize:r,fontSizes:o=[],disableCustomFontSizes:i=!1,onChange:s,size:a="default",units:l=eM,value:c,withSlider:u=!1,withReset:d=!0}=e,h=Ww({availableUnits:l}),p=o.length>5,f=o.find((e=>e.size===c)),m=!!c&&!f,[g,b]=(0,k.useState)(!i&&m),v=(0,k.useMemo)((()=>{if(g)return(0,H.__)("Custom");if(!p)return f?f.name||ZD[o.indexOf(f)]:"";const e=UD(o);return e?`(${e})`:""}),[g,p,f,o]);if(0===o.length&&i)return null;const y="string"==typeof c||"string"==typeof o[0]?.size,[_,x]=$w(c,h),w=!!x&&["em","rem","vw","vh"].includes(x),C=void 0===c;return(0,jd.jsxs)(VD,{ref:t,className:"components-font-size-picker",children:[(0,jd.jsx)(WA.A,{as:"legend",children:(0,H.__)("Font size")}),(0,jd.jsx)(OT.A,{children:(0,jd.jsxs)(HD,{className:"components-font-size-picker__header",children:[(0,jd.jsxs)(WD,{"aria-label":`${(0,H.__)("Size")} ${v||""}`,children:[(0,H.__)("Size"),v&&(0,jd.jsx)(GD,{className:"components-font-size-picker__header__hint",children:v})]}),!i&&(0,jd.jsx)($D,{label:g?(0,H.__)("Use size preset"):(0,H.__)("Set custom size"),icon:zD.A,onClick:()=>{b(!g)},isPressed:g,size:"small"})]})}),(0,jd.jsxs)("div",{children:[!!o.length&&p&&!g&&(0,jd.jsx)(JD,{__next40pxDefaultSize:n,fontSizes:o,value:c,disableCustomFontSizes:i,size:a,onChange:e=>{void 0===e?s?.(void 0):s?.(y?e:Number(e),o.find((t=>t.size===e)))},onSelectCustom:()=>b(!0)}),!p&&!g&&(0,jd.jsx)(QD,{fontSizes:o,value:c,__next40pxDefaultSize:n,size:a,onChange:e=>{void 0===e?s?.(void 0):s?.(y?e:Number(e),o.find((t=>t.size===e)))}}),!i&&g&&(0,jd.jsxs)(T_.A,{className:"components-font-size-picker__custom-size-control",children:[(0,jd.jsx)(B_.A,{isBlock:!0,children:(0,jd.jsx)(sk,{__next40pxDefaultSize:n,label:(0,H.__)("Custom"),labelPosition:"top",hideLabelFromVision:!0,value:c,onChange:e=>{s?.(void 0===e?void 0:y?e:parseInt(e,10))},size:a,units:y?h:[],min:0})}),u&&(0,jd.jsx)(B_.A,{isBlock:!0,children:(0,jd.jsx)(OT.A,{marginX:2,marginBottom:0,children:(0,jd.jsx)(LC,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:n,className:"components-font-size-picker__custom-input",label:(0,H.__)("Custom Size"),hideLabelFromVision:!0,value:_,initialPosition:r,withInputField:!1,onChange:e=>{s?.(void 0===e?void 0:y?e+(null!=x?x:"px"):e)},min:0,max:w?10:100,step:w?.1:1})})}),d&&(0,jd.jsx)(B_.A,{children:(0,jd.jsx)(Xy.$n,{disabled:C,__experimentalIsFocusable:!0,onClick:()=>{s?.(void 0)},variant:"secondary",__next40pxDefaultSize:!0,size:"__unstable-large"===a||e.__next40pxDefaultSize?"default":"small",children:(0,H.__)("Reset")})})]})]})]})})),nM=tM;function rM({value:e="",onChange:t,fontFamilies:n,...r}){const[o]=py("typography.fontFamilies");if(n||(n=o),!n||0===n.length)return null;const i=[{value:"",label:(0,H.__)("Default")},...n.map((({fontFamily:e,name:t})=>({value:e,label:t||e})))];return(0,jd.jsx)(kT.A,{label:(0,H.__)("Font"),options:i,value:e,onChange:t,labelPosition:"top",...r})}const oM=[{name:(0,H._x)("Regular","font style"),value:"normal"},{name:(0,H._x)("Italic","font style"),value:"italic"}],iM=[{name:(0,H._x)("Thin","font weight"),value:"100"},{name:(0,H._x)("Extra Light","font weight"),value:"200"},{name:(0,H._x)("Light","font weight"),value:"300"},{name:(0,H._x)("Regular","font weight"),value:"400"},{name:(0,H._x)("Medium","font weight"),value:"500"},{name:(0,H._x)("Semi Bold","font weight"),value:"600"},{name:(0,H._x)("Bold","font weight"),value:"700"},{name:(0,H._x)("Extra Bold","font weight"),value:"800"},{name:(0,H._x)("Black","font weight"),value:"900"}],sM=(e,t)=>e?t?(0,H.__)("Appearance"):(0,H.__)("Font style"):(0,H.__)("Font weight");function aM(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:r=!0,value:{fontStyle:o,fontWeight:i},...s}=e,a=n||r,l=sM(n,r),c={key:"default",name:(0,H.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,k.useMemo)((()=>n&&r?(()=>{const e=[c];return oM.forEach((({name:t,value:n})=>{iM.forEach((({name:r,value:o})=>{const i="normal"===n?r:(0,H.sprintf)((0,H.__)("%1$s %2$s"),r,t);e.push({key:`${n}-${o}`,name:i,style:{fontStyle:n,fontWeight:o}})}))})),e})():n?(()=>{const e=[c];return oM.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:n,fontWeight:void 0}})})),e})():(()=>{const e=[c];return iM.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:void 0,fontWeight:n}})})),e})()),[e.options]),d=u.find((e=>e.style.fontStyle===o&&e.style.fontWeight===i))||u[0];return a&&(0,jd.jsx)(qD.G,{...s,className:"components-font-appearance-control",label:l,describedBy:d?n?r?(0,H.sprintf)((0,H.__)("Currently selected font appearance: %s"),d.name):(0,H.sprintf)((0,H.__)("Currently selected font style: %s"),d.name):(0,H.sprintf)((0,H.__)("Currently selected font weight: %s"),d.name):(0,H.__)("No selected font appearance"),options:u,value:d,onChange:({selectedItem:e})=>t(e.style)})}const lM=({value:e,onChange:t,__nextHasNoMarginBottom:n=!1,__unstableInputWidth:r="60px",...o})=>{const i=function(e){return void 0!==e&&""!==e}(e),s=(e,t)=>{if(i)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return 1.5;default:return e}},a=i?e:"";n||(0,q.default)("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const l=n?void 0:{marginBottom:24};return(0,jd.jsx)("div",{className:"block-editor-line-height-control",style:l,children:(0,jd.jsx)(qw.A,{...o,__unstableInputWidth:r,__unstableStateReducer:(e,t)=>{const n=["insertText","insertFromPaste"].includes(t.payload.event.nativeEvent?.inputType),r=s(e.value,n);return{...e,value:r}},onChange:(e,{event:n})=>{""!==e?"click"!==n.type?t(`${e}`):t(s(`${e}`,!1)):t()},label:(0,H.__)("Line height"),placeholder:1.5,step:.01,spinFactor:10,value:a,min:0,spinControls:"custom"})})};function cM({value:e,onChange:t,__unstableInputWidth:n="60px",...r}){const[o]=py("spacing.units"),i=Ww({availableUnits:o||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,jd.jsx)(sk,{...r,label:(0,H.__)("Letter spacing"),value:e,__unstableInputWidth:n,units:i,onChange:t})}var uM=n(1807),dM=n(48123),hM=n(19758),pM=n(63900);function fM({label:e,value:t,options:n,onChange:r,className:o}){return(0,jd.jsxs)("fieldset",{className:(0,Hy.A)("block-editor-segmented-text-control",o),children:[(0,jd.jsx)(H_.Ay.VisualLabel,{as:"legend",children:e}),(0,jd.jsx)("div",{className:"block-editor-segmented-text-control__buttons",children:n.map((e=>(0,jd.jsx)(Xy.Ay,{size:"compact",icon:e.icon,label:e.label,isPressed:e.value===t,onClick:()=>r(e.value)},e.value)))})]})}const mM=[{label:(0,H.__)("Align text left"),value:"left",icon:uM.A},{label:(0,H.__)("Align text center"),value:"center",icon:dM.A},{label:(0,H.__)("Align text right"),value:"right",icon:hM.A},{label:(0,H.__)("Justify text"),value:"justify",icon:pM.A}],gM=["left","center","right"];function bM({className:e,value:t,onChange:n,options:r=gM}){const o=(0,k.useMemo)((()=>mM.filter((e=>r.includes(e.value)))),[r]);return o.length?(0,jd.jsx)(fM,{label:(0,H.__)("Text alignment"),options:o,className:(0,Hy.A)("block-editor-text-alignment-control",e),value:t,onChange:e=>{n(e===t?void 0:e)}}):null}var vM=n(69267),yM=n(8732),_M=n(12941),xM=n(26868);const wM=[{label:(0,H.__)("None"),value:"none",icon:vM.A},{label:(0,H.__)("Uppercase"),value:"uppercase",icon:yM.A},{label:(0,H.__)("Lowercase"),value:"lowercase",icon:_M.A},{label:(0,H.__)("Capitalize"),value:"capitalize",icon:xM.A}];function kM({className:e,value:t,onChange:n}){return(0,jd.jsx)(fM,{label:(0,H.__)("Letter case"),options:wM,className:(0,Hy.A)("block-editor-text-transform-control",e),value:t,onChange:e=>{n(e===t?void 0:e)}})}var CM=n(73048),SM=n(11047);const AM=[{label:(0,H.__)("None"),value:"none",icon:vM.A},{label:(0,H.__)("Underline"),value:"underline",icon:CM.A},{label:(0,H.__)("Strikethrough"),value:"line-through",icon:SM.A}];function EM({value:e,onChange:t,className:n}){return(0,jd.jsx)(fM,{label:(0,H.__)("Decoration"),options:AM,className:(0,Hy.A)("block-editor-text-decoration-control",n),value:e,onChange:n=>{t(n===e?void 0:n)}})}var IM=n(33690),jM=n(12816);const TM=[{label:(0,H.__)("Horizontal"),value:"horizontal-tb",icon:IM.A},{label:(0,H.__)("Vertical"),value:(0,H.isRTL)()?"vertical-lr":"vertical-rl",icon:jM.A}];function BM({className:e,value:t,onChange:n}){return(0,jd.jsx)(fM,{label:(0,H.__)("Orientation"),options:TM,className:(0,Hy.A)("block-editor-writing-mode-control",e),value:t,onChange:e=>{n(e===t?void 0:e)}})}const RM=1,NM=6;function DM(e){const t=PM(e),n=OM(e),r=LM(e),o=FM(e),i=UM(e),s=zM(e),a=VM(e),l=HM(e),c=$M(e),u=MM(e);return t||n||r||o||i||s||u||a||l||c}function MM(e){return!1!==e?.typography?.defaultFontSizes&&e?.typography?.fontSizes?.default?.length||e?.typography?.fontSizes?.theme?.length||e?.typography?.fontSizes?.custom?.length||e?.typography?.customFontSize}function PM(e){return["default","theme","custom"].some((t=>e?.typography?.fontFamilies?.[t]?.length))}function OM(e){return e?.typography?.lineHeight}function LM(e){return e?.typography?.fontStyle||e?.typography?.fontWeight}function FM(e){return e?.typography?.letterSpacing}function zM(e){return e?.typography?.textTransform}function UM(e){return e?.typography?.textAlign}function VM(e){return e?.typography?.textDecoration}function HM(e){return e?.typography?.writingMode}function $M(e){return e?.typography?.textColumns}function WM({resetAllFilter:e,onChange:t,value:n,panelId:r,children:o}){return(0,jd.jsx)(xA,{label:(0,H.__)("Typography"),resetAll:()=>{const r=e(n);t(r)},panelId:r,dropdownMenuProps:Iy,children:o})}const GM={fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!0,textAlign:!0,textTransform:!0,textDecoration:!0,writingMode:!0,textColumns:!0};function qM({as:e=WM,value:t,onChange:n,inheritedValue:r=t,settings:o,panelId:i,defaultControls:s=GM}){const a=e=>Ty({settings:o},"",e),l=PM(o),c=o?.typography?.fontFamilies,u=(0,k.useMemo)((()=>["default","theme","custom"].flatMap((e=>{var t;return null!==(t=c?.[e])&&void 0!==t?t:[]}))),[c]),d=a(r?.typography?.fontFamily),h=e=>{const r=u?.find((({fontFamily:t})=>t===e))?.slug;n(Of(t,["typography","fontFamily"],r?`var:preset|font-family|${r}`:e||void 0))},p=MM(o),f=!o?.typography?.customFontSize,m=function(e){var t,n,r;const o=e?.typography?.fontSizes,i=!!e?.typography?.defaultFontSizes;return[...null!==(t=o?.custom)&&void 0!==t?t:[],...null!==(n=o?.theme)&&void 0!==n?n:[],...i&&null!==(r=o?.default)&&void 0!==r?r:[]]}(o),g=a(r?.typography?.fontSize),b=(e,r)=>{n(Of(t,["typography","fontSize"],(r?.slug?`var:preset|font-size|${r?.slug}`:e)||void 0))},v=LM(o),y=function(e){return e?.typography?.fontStyle?e?.typography?.fontWeight?(0,H.__)("Appearance"):(0,H.__)("Font style"):(0,H.__)("Font weight")}(o),_=o?.typography?.fontStyle,x=o?.typography?.fontWeight,w=a(r?.typography?.fontStyle),C=a(r?.typography?.fontWeight),S=({fontStyle:e,fontWeight:r})=>{n({...t,typography:{...t?.typography,fontStyle:e||void 0,fontWeight:r||void 0}})},A=OM(o),E=a(r?.typography?.lineHeight),I=e=>{n(Of(t,["typography","lineHeight"],e||void 0))},j=FM(o),T=a(r?.typography?.letterSpacing),B=e=>{n(Of(t,["typography","letterSpacing"],e||void 0))},R=$M(o),N=a(r?.typography?.textColumns),D=e=>{n(Of(t,["typography","textColumns"],e||void 0))},M=zM(o),P=a(r?.typography?.textTransform),O=e=>{n(Of(t,["typography","textTransform"],e||void 0))},L=VM(o),F=a(r?.typography?.textDecoration),z=e=>{n(Of(t,["typography","textDecoration"],e||void 0))},U=HM(o),V=a(r?.typography?.writingMode),$=e=>{n(Of(t,["typography","writingMode"],e||void 0))},W=UM(o),G=a(r?.typography?.textAlign),q=e=>{n(Of(t,["typography","textAlign"],e||void 0))},K=(0,k.useCallback)((e=>({...e,typography:{}})),[]);return(0,jd.jsxs)(e,{resetAllFilter:K,value:t,onChange:n,panelId:i,children:[l&&(0,jd.jsx)(KA,{label:(0,H.__)("Font"),hasValue:()=>!!t?.typography?.fontFamily,onDeselect:()=>h(void 0),isShownByDefault:s.fontFamily,panelId:i,children:(0,jd.jsx)(rM,{fontFamilies:u,value:d,onChange:h,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),p&&(0,jd.jsx)(KA,{label:(0,H.__)("Size"),hasValue:()=>!!t?.typography?.fontSize,onDeselect:()=>b(void 0),isShownByDefault:s.fontSize,panelId:i,children:(0,jd.jsx)(nM,{value:g,onChange:b,fontSizes:m,disableCustomFontSizes:f,withReset:!1,withSlider:!0,size:"__unstable-large"})}),v&&(0,jd.jsx)(KA,{className:"single-column",label:y,hasValue:()=>!!t?.typography?.fontStyle||!!t?.typography?.fontWeight,onDeselect:()=>{S({})},isShownByDefault:s.fontAppearance,panelId:i,children:(0,jd.jsx)(aM,{value:{fontStyle:w,fontWeight:C},onChange:S,hasFontStyles:_,hasFontWeights:x,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),A&&(0,jd.jsx)(KA,{className:"single-column",label:(0,H.__)("Line height"),hasValue:()=>void 0!==t?.typography?.lineHeight,onDeselect:()=>I(void 0),isShownByDefault:s.lineHeight,panelId:i,children:(0,jd.jsx)(lM,{__nextHasNoMarginBottom:!0,__unstableInputWidth:"auto",value:E,onChange:I,size:"__unstable-large"})}),j&&(0,jd.jsx)(KA,{className:"single-column",label:(0,H.__)("Letter spacing"),hasValue:()=>!!t?.typography?.letterSpacing,onDeselect:()=>B(void 0),isShownByDefault:s.letterSpacing,panelId:i,children:(0,jd.jsx)(cM,{value:T,onChange:B,size:"__unstable-large",__unstableInputWidth:"auto"})}),R&&(0,jd.jsx)(KA,{className:"single-column",label:(0,H.__)("Columns"),hasValue:()=>!!t?.typography?.textColumns,onDeselect:()=>D(void 0),isShownByDefault:s.textColumns,panelId:i,children:(0,jd.jsx)(qw.A,{label:(0,H.__)("Columns"),max:NM,min:RM,onChange:D,size:"__unstable-large",spinControls:"custom",value:N,initialPosition:1})}),L&&(0,jd.jsx)(KA,{className:"single-column",label:(0,H.__)("Decoration"),hasValue:()=>!!t?.typography?.textDecoration,onDeselect:()=>z(void 0),isShownByDefault:s.textDecoration,panelId:i,children:(0,jd.jsx)(EM,{value:F,onChange:z,size:"__unstable-large",__unstableInputWidth:"auto"})}),U&&(0,jd.jsx)(KA,{className:"single-column",label:(0,H.__)("Orientation"),hasValue:()=>!!t?.typography?.writingMode,onDeselect:()=>$(void 0),isShownByDefault:s.writingMode,panelId:i,children:(0,jd.jsx)(BM,{value:V,onChange:$,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),M&&(0,jd.jsx)(KA,{label:(0,H.__)("Letter case"),hasValue:()=>!!t?.typography?.textTransform,onDeselect:()=>O(void 0),isShownByDefault:s.textTransform,panelId:i,children:(0,jd.jsx)(kM,{value:P,onChange:O,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),W&&(0,jd.jsx)(KA,{label:(0,H.__)("Text alignment"),hasValue:()=>!!t?.typography?.textAlign,onDeselect:()=>q(void 0),isShownByDefault:s.textAlign,panelId:i,children:(0,jd.jsx)(bM,{value:G,onChange:q,size:"__unstable-large",__nextHasNoMarginBottom:!0})})]})}class KM{constructor(e=""){this.value=e,this._currentValue,this._valueAsArray}entries(...e){return this._valueAsArray.entries(...e)}forEach(...e){return this._valueAsArray.forEach(...e)}keys(...e){return this._valueAsArray.keys(...e)}values(...e){return this._valueAsArray.values(...e)}get value(){return this._currentValue}set value(e){e=String(e),this._valueAsArray=[...new Set(e.split(/\s+/g).filter(Boolean))],this._currentValue=this._valueAsArray.join(" ")}get length(){return this._valueAsArray.length}toString(){return this.value}*[Symbol.iterator](){return yield*this._valueAsArray}item(e){return this._valueAsArray[e]}contains(e){return-1!==this._valueAsArray.indexOf(e)}add(...e){this.value+=" "+e.join(" ")}remove(...e){this.value=this._valueAsArray.filter((t=>!e.includes(t))).join(" ")}toggle(e,t){return void 0===t&&(t=!this.contains(e)),t?this.add(e):this.remove(e),t}replace(e,t){return!!this.contains(e)&&(this.remove(e),this.add(t),!0)}supports(){return!0}}const YM="typography.__experimentalFontFamily",{kebabCase:JM}=kf(u_.j);function XM(e,t,n){if(!Ic(t,YM))return e;if(Gy(t,bP,"fontFamily"))return e;if(!n?.fontFamily)return e;const r=new KM(e.className);r.add(`has-${JM(n?.fontFamily)}-font-family`);const o=r.value;return e.className=o||void 0,e}const ZM={useBlockProps:function({name:e,fontFamily:t}){return XM({},e,{fontFamily:t})},addSaveProps:XM,attributeKeys:["fontFamily"],hasSupport:e=>Ic(e,YM)};(0,Tu.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return Ic(e,YM)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e}));const{kebabCase:QM}=kf(u_.j),eP=(e,t,n)=>{if(t){const n=e?.find((({slug:e})=>e===t));if(n)return n}return{size:n}};function tP(e){if(e)return`has-${QM(e)}-font-size`}const nP="typography.fontSize";function rP(e,t,n){if(!Ic(t,nP))return e;if(Gy(t,bP,"fontSize"))return e;const r=new KM(e.className);r.add(tP(n.fontSize));const o=r.value;return e.className=o||void 0,e}const oP={useBlockProps:function({name:e,fontSize:t,style:n}){const[r,o,i]=py("typography.fontSizes","typography.fluid","layout");if(!Ic(e,nP)||Gy(e,bP,"fontSize")||!t&&!n?.typography?.fontSize)return;let s;return n?.typography?.fontSize&&(s={style:{fontSize:wy({size:n.typography.fontSize},{typography:{fluid:o},layout:i})}}),t&&(s={style:{fontSize:eP(r,t,n?.typography?.fontSize).size}}),s?rP(s,e,{fontSize:t}):void 0},addSaveProps:rP,attributeKeys:["fontSize","style"],hasSupport:e=>Ic(e,nP)},iP={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,Tu.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return Ic(e,nP)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,Tu.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,r){return Wy({fontSize:Ic(e.name,nP)},iP,e,t,n,r)}));const sP=[{icon:uM.A,title:(0,H.__)("Align text left"),align:"left"},{icon:dM.A,title:(0,H.__)("Align text center"),align:"center"},{icon:hM.A,title:(0,H.__)("Align text right"),align:"right"}],aP={placement:"bottom-start"},lP=function({value:e,onChange:t,alignmentControls:n=sP,label:r=(0,H.__)("Align text"),describedBy:o=(0,H.__)("Change text alignment"),isCollapsed:i=!0,isToolbar:s}){function a(n){return()=>t(e===n?void 0:n)}const l=n.find((t=>t.align===e)),c=s?s_:__,u=s?{isCollapsed:i}:{toggleProps:{describedBy:o},popoverProps:aP};return(0,jd.jsx)(c,{icon:l?l.icon:(0,H.isRTL)()?hM.A:uM.A,label:r,controls:n.map((t=>{const{align:n}=t,r=e===n;return{...t,isActive:r,role:i?"menuitemradio":void 0,onClick:a(n)}})),...u})},cP=e=>(0,jd.jsx)(lP,{...e,isToolbar:!1}),uP="typography.textAlign",dP=[{icon:uM.A,title:(0,H.__)("Align text left"),align:"left"},{icon:dM.A,title:(0,H.__)("Align text center"),align:"center"},{icon:hM.A,title:(0,H.__)("Align text right"),align:"right"}],hP=["left","center","right"],pP=[];function fP(e){return Array.isArray(e)?hP.filter((t=>e.includes(t))):!0===e?hP:pP}const mP={edit:function({style:e,name:t,setAttributes:n}){const r=Yy(t),o=r?.typography?.textAlign,i=ES();if(!o||"default"!==i)return null;const s=fP(Ec(t,uP));if(!s.length)return null;const a=dP.filter((e=>s.includes(e.align)));return(0,jd.jsx)(y_,{group:"block",children:(0,jd.jsx)(cP,{value:e?.typography?.textAlign,onChange:t=>{const r={...e,typography:{...e?.typography,textAlign:t}};n({style:$y(r)})},alignmentControls:a})})},useBlockProps:function({name:e,style:t}){if(!t?.typography?.textAlign)return null;if(!fP(Ec(e,uP)).length)return null;if(Gy(e,bP,"textAlign"))return null;const n=t.typography.textAlign;return{className:(0,Hy.A)({[`has-text-align-${n}`]:n})}},addSaveProps:function(e,t,n){if(!n?.style?.typography?.textAlign)return e;const{textAlign:r}=n.style.typography;return fP(Ec(t,uP)).includes(r)&&!Gy(t,bP,"textAlign")&&(e.className=(0,Hy.A)(`has-text-align-${r}`,e.className)),e},attributeKeys:["style"],hasSupport:e=>Ic(e,uP,!1)};function gP(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.includes(e))))}const bP="typography",vP=["typography.lineHeight",nP,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",YM,uP,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalWritingMode","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing"];function yP(e){const t={...gP(e,["fontFamily"])},n=e?.typography?.fontSize,r=e?.typography?.fontFamily,o=n?.startsWith("var:preset|font-size|")?n.substring(21):void 0,i=r?.startsWith("var:preset|font-family|")?r.substring(23):void 0;return t.typography={...gP(t.typography,["fontFamily"]),fontSize:o?void 0:n},{style:$y(t),fontFamily:i,fontSize:o}}function _P(e){return{...e.style,typography:{...e.style?.typography,fontFamily:e.fontFamily?"var:preset|font-family|"+e.fontFamily:void 0,fontSize:e.fontSize?"var:preset|font-size|"+e.fontSize:e.style?.typography?.fontSize}}}function xP({children:e,resetAllFilter:t}){const n=(0,k.useCallback)((e=>{const n=_P(e),r=t(n);return{...e,...yP(r)}}),[t]);return(0,jd.jsx)(EA,{group:"typography",resetAllFilter:n,children:e})}function wP({clientId:e,name:t,setAttributes:n,settings:r}){const{style:o,fontFamily:i,fontSize:s}=(0,Ul.A)((function(t){const{style:n,fontFamily:r,fontSize:o}=t(dy).getBlockAttributes(e)||{};return{style:n,fontFamily:r,fontSize:o}}),[e]),a=DM(r),l=(0,k.useMemo)((()=>_P({style:o,fontFamily:i,fontSize:s})),[o,s,i]);if(!a)return null;const c=Ec(t,[bP,"__experimentalDefaultControls"]);return(0,jd.jsx)(qM,{as:xP,panelId:e,settings:r,value:l,onChange:e=>{n(yP(e))},defaultControls:c})}const kP=(0,$_.default)("span",{target:"e1j5nr4z8"})({name:"1w884gc",styles:"box-sizing:border-box;display:block;width:24px;height:24px;position:relative;padding:4px"}),CP=(0,$_.default)("span",{target:"e1j5nr4z7"})({name:"i6vjox",styles:"box-sizing:border-box;display:block;position:relative;width:100%;height:100%"}),SP=({isFocused:e})=>(0,W_.css)({backgroundColor:"currentColor",opacity:e?1:.3},"",""),AP=(0,$_.default)("span",{target:"e1j5nr4z6"})("box-sizing:border-box;display:block;pointer-events:none;position:absolute;",SP,";"),EP=(0,$_.default)(AP,{target:"e1j5nr4z5"})({name:"1k2w39q",styles:"bottom:3px;top:3px;width:2px"}),IP=(0,$_.default)(AP,{target:"e1j5nr4z4"})({name:"1q9b07k",styles:"height:2px;left:3px;right:3px"}),jP=(0,$_.default)(IP,{target:"e1j5nr4z3"})({name:"abcix4",styles:"top:0"}),TP=(0,$_.default)(EP,{target:"e1j5nr4z2"})({name:"1wf8jf",styles:"right:0"}),BP=(0,$_.default)(IP,{target:"e1j5nr4z1"})({name:"8tapst",styles:"bottom:0"}),RP=(0,$_.default)(EP,{target:"e1j5nr4z0"})({name:"1ode3cm",styles:"left:0"});function NP({size:e=24,side:t="all",sides:n,...r}){const o=e=>!(e=>n?.length&&!n.includes(e))(e)&&("all"===t||t===e),i=o("top")||o("vertical"),s=o("right")||o("horizontal"),a=o("bottom")||o("vertical"),l=o("left")||o("horizontal"),c=e/24;return(0,jd.jsx)(kP,{style:{transform:`scale(${c})`},...r,children:(0,jd.jsxs)(CP,{children:[(0,jd.jsx)(jP,{isFocused:i}),(0,jd.jsx)(TP,{isFocused:s}),(0,jd.jsx)(BP,{isFocused:a}),(0,jd.jsx)(RP,{isFocused:l})]})})}const DP=(0,$_.default)(sk,{target:"e1jovhle5"})({name:"1ejyr19",styles:"max-width:90px"}),MP=(0,$_.default)(eA.A,{target:"e1jovhle4"})({name:"1j1lmoi",styles:"grid-column:1/span 3"}),PP=(0,$_.default)(Xy.Ay,{target:"e1jovhle3"})({name:"tkya7b",styles:"grid-area:1/2;justify-self:end"}),OP=(0,$_.default)("div",{target:"e1jovhle2"})({name:"1dfa8al",styles:"grid-area:1/3;justify-self:end"}),LP=(0,$_.default)(NP,{target:"e1jovhle1"})({name:"ou8xsw",styles:"flex:0 0 auto"}),FP=(0,$_.default)(LC,{target:"e1jovhle0"})("width:100%;margin-inline-end:",(0,Yw.x)(2),";"),zP={px:{max:300,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:10,step:.1},rm:{max:10,step:.1},svw:{max:100,step:1},lvw:{max:100,step:1},dvw:{max:100,step:1},svh:{max:100,step:1},lvh:{max:100,step:1},dvh:{max:100,step:1},vi:{max:100,step:1},svi:{max:100,step:1},lvi:{max:100,step:1},dvi:{max:100,step:1},vb:{max:100,step:1},svb:{max:100,step:1},lvb:{max:100,step:1},dvb:{max:100,step:1},vmin:{max:100,step:1},svmin:{max:100,step:1},lvmin:{max:100,step:1},dvmin:{max:100,step:1},vmax:{max:100,step:1},svmax:{max:100,step:1},lvmax:{max:100,step:1},dvmax:{max:100,step:1}},UP={all:(0,H.__)("All sides"),top:(0,H.__)("Top side"),bottom:(0,H.__)("Bottom side"),left:(0,H.__)("Left side"),right:(0,H.__)("Right side"),mixed:(0,H.__)("Mixed"),vertical:(0,H.__)("Top and bottom sides"),horizontal:(0,H.__)("Left and right sides")},VP={top:void 0,right:void 0,bottom:void 0,left:void 0},HP=["top","right","bottom","left"];function $P(e){return e.sort(((t,n)=>e.filter((e=>e===t)).length-e.filter((e=>e===n)).length)).pop()}function WP(e={},t,n=HP){const r=function(e){const t=[];if(!e?.length)return HP;if(e.includes("vertical"))t.push("top","bottom");else if(e.includes("horizontal"))t.push("left","right");else{const n=HP.filter((t=>e.includes(t)));t.push(...n)}return t}(n).map((t=>$w(e[t]))),o=r.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),i=r.map((e=>e[1])),s=o.every((e=>e===o[0]))?o[0]:"";let a;var l;return a="number"==typeof s?$P(i):null!==(l=function(e){if(!e||"object"!=typeof e)return;return $P(Object.values(e).filter(Boolean))}(t))&&void 0!==l?l:$P(i),[s,a].join("")}function GP(e={},t,n=HP){const r=WP(e,t,n);return isNaN(parseFloat(r))}function qP(e){return void 0!==e&&Object.values(e).filter((e=>!!e&&/\d/.test(e))).length>0}function KP(e,t){let n="all";return e||(n=t?"vertical":"top"),n}function YP(e,t,n){const r={...e};return n?.length?n.forEach((e=>{"vertical"===e?(r.top=t,r.bottom=t):"horizontal"===e?(r.left=t,r.right=t):r[e]=t})):HP.forEach((e=>r[e]=t)),r}const JP=()=>{};function XP({__next40pxDefaultSize:e,onChange:t=JP,onFocus:n=JP,values:r,sides:o,selectedUnits:i,setSelectedUnits:s,...a}){var l,c;const u=(0,F_.A)(XP,"box-control-input-all"),d=WP(r,i,o),h=qP(r)&&GP(r,i,o),p=h?UP.mixed:void 0,[f,m]=$w(d),g=e=>{const n=void 0!==e&&!isNaN(parseFloat(e)),i=YP(r,n?e:void 0,o);t(i)};return(0,jd.jsxs)(eA.A,{children:[(0,jd.jsx)(DP,{...a,__next40pxDefaultSize:e,className:"component-box-control__unit-control",disableUnits:h,id:u,isPressEnterToChange:!0,value:d,onChange:g,onUnitChange:e=>{const t=YP(i,e,o);s(t)},onFocus:e=>{n(e,{side:"all"})},placeholder:p,label:UP.all,hideLabelFromVision:!0}),(0,jd.jsx)(FP,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:e,"aria-controls":u,label:UP.all,hideLabelFromVision:!0,onChange:e=>{g(void 0!==e?[e,m].join(""):void 0)},min:0,max:null!==(l=zP[null!=m?m:"px"]?.max)&&void 0!==l?l:10,step:null!==(c=zP[null!=m?m:"px"]?.step)&&void 0!==c?c:.1,value:null!=f?f:0,withInputField:!1})]})}const ZP=()=>{};function QP({__next40pxDefaultSize:e,onChange:t=ZP,onFocus:n=ZP,values:r,selectedUnits:o,setSelectedUnits:i,sides:s,...a}){const l=(0,F_.A)(QP,"box-control-input"),c=e=>t=>{n(t,{side:e})},u=(e,n,o)=>{const i={...r},s=void 0===n||isNaN(parseFloat(n))?void 0:n;if(i[e]=s,o?.event.altKey)switch(e){case"top":i.bottom=s;break;case"bottom":i.top=s;break;case"left":i.right=s;break;case"right":i.left=s}(e=>{t(e)})(i)},d=e=>t=>{const n={...o};n[e]=t,i(n)},h=s?.length?HP.filter((e=>s.includes(e))):HP;return(0,jd.jsx)(jd.Fragment,{children:h.map((t=>{var n,i;const[h,p]=$w(r[t]),f=r[t]?p:o[t],m=[l,t].join("-");return(0,jd.jsxs)(MP,{expanded:!0,children:[(0,jd.jsx)(LP,{side:t,sides:s}),(0,jd.jsx)(Nx.Ay,{placement:"top-end",text:UP[t],children:(0,jd.jsx)(DP,{...a,__next40pxDefaultSize:e,className:"component-box-control__unit-control",id:m,isPressEnterToChange:!0,value:[h,f].join(""),onChange:(e,n)=>u(t,e,n),onUnitChange:d(t),onFocus:c(t),label:UP[t],hideLabelFromVision:!0})}),(0,jd.jsx)(FP,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:e,"aria-controls":m,label:UP[t],hideLabelFromVision:!0,onChange:e=>{u(t,void 0!==e?[e,f].join(""):void 0)},min:0,max:null!==(n=zP[null!=f?f:"px"]?.max)&&void 0!==n?n:10,step:null!==(i=zP[null!=f?f:"px"]?.step)&&void 0!==i?i:.1,value:null!=h?h:0,withInputField:!1})]},`box-control-${t}`)}))})}const eO=["vertical","horizontal"];function tO({__next40pxDefaultSize:e,onChange:t,onFocus:n,values:r,selectedUnits:o,setSelectedUnits:i,sides:s,...a}){const l=(0,F_.A)(tO,"box-control-input"),c=e=>t=>{n&&n(t,{side:e})},u=(e,n)=>{if(!t)return;const o={...r},i=void 0===n||isNaN(parseFloat(n))?void 0:n;"vertical"===e&&(o.top=i,o.bottom=i),"horizontal"===e&&(o.left=i,o.right=i),t(o)},d=e=>t=>{const n={...o};"vertical"===e&&(n.top=t,n.bottom=t),"horizontal"===e&&(n.left=t,n.right=t),i(n)},h=s?.length?eO.filter((e=>s.includes(e))):eO;return(0,jd.jsx)(jd.Fragment,{children:h.map((t=>{var n,i;const[h,p]=$w("vertical"===t?r.top:r.left),f="vertical"===t?o.top:o.left,m=[l,t].join("-");return(0,jd.jsxs)(MP,{children:[(0,jd.jsx)(LP,{side:t,sides:s}),(0,jd.jsx)(Nx.Ay,{placement:"top-end",text:UP[t],children:(0,k.createElement)(DP,{...a,__next40pxDefaultSize:e,className:"component-box-control__unit-control",id:m,isPressEnterToChange:!0,value:[h,null!=f?f:p].join(""),onChange:e=>u(t,e),onUnitChange:d(t),onFocus:c(t),label:UP[t],hideLabelFromVision:!0,key:t})}),(0,jd.jsx)(FP,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:e,"aria-controls":m,label:UP[t],hideLabelFromVision:!0,onChange:e=>u(t,void 0!==e?[e,null!=f?f:p].join(""):void 0),min:0,max:null!==(n=zP[null!=f?f:"px"]?.max)&&void 0!==n?n:10,step:null!==(i=zP[null!=f?f:"px"]?.step)&&void 0!==i?i:.1,value:null!=h?h:0,withInputField:!1})]},t)}))})}function nO({isLinked:e,...t}){const n=e?(0,H.__)("Unlink sides"):(0,H.__)("Link sides");return(0,jd.jsx)(Nx.Ay,{text:n,children:(0,jd.jsx)(Xy.Ay,{...t,className:"component-box-control__linked-button",size:"small",icon:e?aT.A:nj.A,iconSize:24,"aria-label":n})})}const rO={min:0},oO=()=>{};const iO=function e({__next40pxDefaultSize:t=!1,id:n,inputProps:r=rO,onChange:o=oO,label:i=(0,H.__)("Box Control"),values:s,units:a,sides:l,splitOnAxis:c=!1,allowReset:u=!0,resetValues:d=VP,onMouseOver:h,onMouseOut:p}){const[f,m]=(0,nk.A)(s,{fallback:VP}),g=f||VP,b=qP(s),v=1===l?.length,[y,_]=(0,k.useState)(b),[x,w]=(0,k.useState)(!b||!GP(g)||v),[C,S]=(0,k.useState)(KP(x,c)),[A,E]=(0,k.useState)({top:$w(s?.top)[1],right:$w(s?.right)[1],bottom:$w(s?.bottom)[1],left:$w(s?.left)[1]}),I=function(t){const n=(0,F_.A)(e,"inspector-box-control");return t||n}(n),j=`${I}-heading`,T={...r,onChange:e=>{o(e),m(e),_(!0)},onFocus:(e,{side:t})=>{S(t)},isLinked:x,units:a,selectedUnits:A,setSelectedUnits:E,sides:l,values:g,onMouseOver:h,onMouseOut:p,__next40pxDefaultSize:t};return(0,jd.jsxs)(yA,{id:I,columns:3,templateColumns:"1fr min-content min-content",role:"group","aria-labelledby":j,children:[(0,jd.jsx)(H_.pu.VisualLabel,{id:j,children:i}),x&&(0,jd.jsxs)(MP,{children:[(0,jd.jsx)(LP,{side:C,sides:l}),(0,jd.jsx)(XP,{...T})]}),!v&&(0,jd.jsx)(OP,{children:(0,jd.jsx)(nO,{onClick:()=>{w(!x),S(KP(!x,c))},isLinked:x})}),!x&&c&&(0,jd.jsx)(tO,{...T}),!x&&!c&&(0,jd.jsx)(QP,{...T}),u&&(0,jd.jsx)(PP,{className:"component-box-control__reset-button",variant:"secondary",size:"small",onClick:()=>{o(d),m(d),E(d),_(!1)},disabled:!y,children:(0,H.__)("Reset")})]})},sO={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rm:{max:10,steps:.1},svw:{max:100,steps:1},lvw:{max:100,steps:1},dvw:{max:100,steps:1},svh:{max:100,steps:1},lvh:{max:100,steps:1},dvh:{max:100,steps:1},vi:{max:100,steps:1},svi:{max:100,steps:1},lvi:{max:100,steps:1},dvi:{max:100,steps:1},vb:{max:100,steps:1},svb:{max:100,steps:1},lvb:{max:100,steps:1},dvb:{max:100,steps:1},vmin:{max:100,steps:1},svmin:{max:100,steps:1},lvmin:{max:100,steps:1},dvmin:{max:100,steps:1},vmax:{max:100,steps:1},svmax:{max:100,steps:1},lvmax:{max:100,steps:1},dvmax:{max:100,steps:1}};function aO({icon:e,isMixed:t=!1,minimumCustomValue:n,onChange:r,onMouseOut:o,onMouseOver:i,showSideInLabel:s=!0,side:a,spacingSizes:l,type:c,value:u}){var d,h;u=aw(u,l);let p=l;const f=l.length<=ew,m=(0,Ul.A)((e=>{const t=e(dy).getSettings();return t?.disableCustomSpacingSizes})),[g,b]=(0,k.useState)(!m&&void 0!==u&&!sw(u)),[v,y]=(0,k.useState)(n),_=(0,mx.A)(u);u&&_!==u&&!sw(u)&&!0!==g&&b(!0);const[x]=py("spacing.units"),w=Ww({availableUnits:x||["px","em","rem"]});let C=null;f||g||void 0===u||!(!sw(u)||sw(u)&&t)?t||(C=g?function(e,t){if(!sw(e))return e;const n=cw(e),r=t.find((e=>String(e.slug)===n));return r?.size}(u,l):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":cw(e),r=t.findIndex((e=>String(e.slug)===n));return-1!==r?r:NaN}(u,l)):(p=[...l,{name:t?(0,H.__)("Mixed"):(0,H.sprintf)((0,H.__)("Custom (%s)"),u),slug:"custom",size:u}],C=p.length-1);const S=(0,k.useMemo)((()=>$w(C)),[C])[1]||w[0]?.value,A=parseFloat(C,10),E=(e,t)=>{const n=parseInt(e,10);if("selectList"===t){if(0===n)return;if(1===n)return"0"}else if(0===n)return"0";return`var:preset|spacing|${l[e]?.slug}`},I=t?(0,H.__)("Mixed"):null,j=p.map(((e,t)=>({key:t,name:e.name}))),T=l.map(((e,t)=>({value:t,label:void 0}))),B=tw.includes(a)&&s?ow[a]:"",R=s?c?.toLowerCase():c,N=(0,H.sprintf)((0,H.__)("%1$s %2$s"),B,R).trim();return(0,jd.jsxs)(eA.A,{className:"spacing-sizes-control__wrapper",children:[e&&(0,jd.jsx)(zx.A,{className:"spacing-sizes-control__icon",icon:e,size:24}),g&&(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsx)(sk,{onMouseOver:i,onMouseOut:o,onFocus:i,onBlur:o,onChange:e=>r((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:C,units:w,min:v,placeholder:I,disableUnits:t,label:N,hideLabelFromVision:!0,className:"spacing-sizes-control__custom-value-input",size:"__unstable-large",onDragStart:()=>{"-"===u?.charAt(0)&&y(0)},onDrag:()=>{"-"===u?.charAt(0)&&y(0)},onDragEnd:()=>{y(n)}}),(0,jd.jsx)(LC,{onMouseOver:i,onMouseOut:o,onFocus:i,onBlur:o,value:A,min:0,max:null!==(d=sO[S]?.max)&&void 0!==d?d:10,step:null!==(h=sO[S]?.steps)&&void 0!==h?h:.1,withInputField:!1,onChange:e=>{r([e,S].join(""))},className:"spacing-sizes-control__custom-value-range",__nextHasNoMarginBottom:!0})]}),f&&!g&&(0,jd.jsx)(LC,{onMouseOver:i,onMouseOut:o,className:"spacing-sizes-control__range-control",value:C,onChange:e=>r(E(e)),onMouseDown:e=>{e?.nativeEvent?.offsetX<35&&void 0===u&&r("0")},withInputField:!1,"aria-valuenow":C,"aria-valuetext":l[C]?.name,renderTooltipContent:e=>void 0===u?void 0:l[e]?.name,min:0,max:l.length-1,marks:T,label:N,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,onFocus:i,onBlur:o}),!f&&!g&&(0,jd.jsx)(qD.G,{className:"spacing-sizes-control__custom-select-control",value:j.find((e=>e.key===C))||"",onChange:e=>{r(E(e.selectedItem.key,"selectList"))},options:j,label:N,hideLabelFromVision:!0,size:"__unstable-large",onMouseOver:i,onMouseOut:o,onFocus:i,onBlur:o}),!m&&(0,jd.jsx)(Xy.Ay,{label:g?(0,H.__)("Use size preset"):(0,H.__)("Set custom size"),icon:zD.A,onClick:()=>{b(!g)},isPressed:g,size:"small",className:"spacing-sizes-control__custom-toggle",iconSize:24})]})}const lO=["vertical","horizontal"];function cO({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:r,sides:o,spacingSizes:i,type:s,values:a}){const l=e=>n=>{if(!t)return;const r={...Object.keys(a).reduce(((e,t)=>(e[t]=aw(a[t],i),e)),{})};"vertical"===e&&(r.top=n,r.bottom=n),"horizontal"===e&&(r.left=n,r.right=n),t(r)},c=o?.length?lO.filter((e=>uw(o,e))):lO;return(0,jd.jsx)(jd.Fragment,{children:c.map((t=>{const o="vertical"===t?a.top:a.left;return(0,jd.jsx)(aO,{icon:rw[t],label:ow[t],minimumCustomValue:e,onChange:l(t),onMouseOut:n,onMouseOver:r,side:t,spacingSizes:i,type:s,value:o,withInputField:!1},`spacing-sizes-control-${t}`)}))})}function uO({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:r,sides:o,spacingSizes:i,type:s,values:a}){const l=o?.length?tw.filter((e=>o.includes(e))):tw,c=e=>n=>{const r={...Object.keys(a).reduce(((e,t)=>(e[t]=aw(a[t],i),e)),{})};r[e]=n,t(r)};return(0,jd.jsx)(jd.Fragment,{children:l.map((t=>(0,jd.jsx)(aO,{icon:rw[t],label:ow[t],minimumCustomValue:e,onChange:c(t),onMouseOut:n,onMouseOver:r,side:t,spacingSizes:i,type:s,value:a[t],withInputField:!1},`spacing-sizes-control-${t}`)))})}function dO({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:r,showSideInLabel:o,side:i,spacingSizes:s,type:a,values:l}){return(0,jd.jsx)(aO,{label:ow[i],minimumCustomValue:e,onChange:(c=i,e=>{const n={...Object.keys(l).reduce(((e,t)=>(e[t]=aw(l[t],s),e)),{})};n[c]=e,t(n)}),onMouseOut:n,onMouseOver:r,showSideInLabel:o,side:i,spacingSizes:s,type:a,value:l[i],withInputField:!1});var c}const hO=(0,jd.jsx)(zx.A,{icon:XS.A,size:24});function pO({label:e,onChange:t,sides:n,value:r}){if(!n||!n.length)return;const o=function(e){if(!e||!e.length)return{};const t={},n=uw(e,"horizontal"),r=uw(e,"vertical");n&&r?t.axial={label:ow.axial,icon:rw.axial}:n?t.axial={label:ow.horizontal,icon:rw.horizontal}:r&&(t.axial={label:ow.vertical,icon:rw.vertical});let o=0;return tw.forEach((n=>{e.includes(n)&&(o+=1,t[n]={label:ow[n],icon:rw[n]})})),o>1&&(t.custom={label:ow.custom,icon:rw.custom}),t}(n),i=o[r].icon,{custom:s,...a}=o;return(0,jd.jsx)(o_.A,{icon:i,label:e,className:"spacing-sizes-control__dropdown",toggleProps:{size:"small"},children:({onClose:e})=>(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsx)(x_.A,{children:Object.entries(a).map((([n,{label:o,icon:i}])=>{const s=r===n;return(0,jd.jsx)(w_.A,{icon:i,iconPosition:"left",isSelected:s,role:"menuitemradio",onClick:()=>{t(n),e()},suffix:s?hO:void 0,children:o},n)}))}),!!s&&(0,jd.jsx)(x_.A,{children:(0,jd.jsx)(w_.A,{icon:s.icon,iconPosition:"left",isSelected:r===iw.custom,role:"menuitemradio",onClick:()=>{t(iw.custom),e()},suffix:r===iw.custom?hO:void 0,children:s.label})})]})})}const fO=[],mO=new Intl.Collator("und",{numeric:!0}).compare;function gO(){const[e,t,n,r]=py("spacing.spacingSizes.custom","spacing.spacingSizes.theme","spacing.spacingSizes.default","spacing.defaultSpacingSizes"),o=null!=e?e:fO,i=null!=t?t:fO,s=n&&!1!==r?n:fO;return(0,k.useMemo)((()=>{const e=[{name:(0,H.__)("None"),slug:"0",size:0},...o,...i,...s].sort(((e,t)=>mO(e.slug,t.slug)));return e.length>ew?[{name:(0,H.__)("Default"),slug:"default",size:void 0},...e]:e.map((({slug:e,size:t},n)=>({name:n,slug:e,size:t})))}),[o,i,s])}function bO({inputProps:e,label:t,minimumCustomValue:n=0,onChange:r,onMouseOut:o,onMouseOver:i,showSideInLabel:s=!0,sides:a=tw,useSelect:l,values:c}){const u=gO(),d=c||nw,h=1===a?.length,p=a?.includes("horizontal")&&a?.includes("vertical")&&2===a?.length,[f,m]=(0,k.useState)(function(e={},t){const{top:n,right:r,bottom:o,left:i}=e,s=[n,r,o,i].filter(Boolean),a=!(n!==o||i!==r||!n&&!i),l=!s.length&&function(e=[]){const t={top:0,right:0,bottom:0,left:0};return e.forEach((e=>t[e]+=1)),(t.top+t.bottom)%2==0&&(t.left+t.right)%2==0}(t);if(uw(t)&&(a||l))return iw.axial;if(1===s.length){let t;return Object.entries(e).some((([e,n])=>(t=e,void 0!==n))),t}return 1!==t?.length||s.length?iw.custom:t[0]}(d,a)),g={...e,minimumCustomValue:n,onChange:e=>{const t={...c,...e};r(t)},onMouseOut:o,onMouseOver:i,sides:a,spacingSizes:u,type:t,useSelect:l,values:d},b=tw.includes(f)&&s?ow[f]:"",v=(0,H.sprintf)((0,H.__)("%1$s %2$s"),t,b).trim(),y=(0,H.sprintf)((0,H._x)("%s options","Button label to reveal side configuration options"),t);return(0,jd.jsxs)("fieldset",{className:"spacing-sizes-control",children:[(0,jd.jsxs)(eA.A,{className:"spacing-sizes-control__header",children:[(0,jd.jsx)(H_.Ay.VisualLabel,{as:"legend",className:"spacing-sizes-control__label",children:v}),!h&&!p&&(0,jd.jsx)(pO,{label:y,onChange:m,sides:a,value:f})]}),(0,jd.jsx)(oE.A,{spacing:.5,children:f===iw.axial?(0,jd.jsx)(cO,{...g}):f===iw.custom?(0,jd.jsx)(uO,{...g}):(0,jd.jsx)(dO,{side:f,...g,showSideInLabel:s})})]})}const vO={px:{max:1e3,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:50,step:.1},rem:{max:50,step:.1},svw:{max:100,step:1},lvw:{max:100,step:1},dvw:{max:100,step:1},svh:{max:100,step:1},lvh:{max:100,step:1},dvh:{max:100,step:1},vi:{max:100,step:1},svi:{max:100,step:1},lvi:{max:100,step:1},dvi:{max:100,step:1},vb:{max:100,step:1},svb:{max:100,step:1},lvb:{max:100,step:1},dvb:{max:100,step:1},vmin:{max:100,step:1},svmin:{max:100,step:1},lvmin:{max:100,step:1},dvmin:{max:100,step:1},vmax:{max:100,step:1},svmax:{max:100,step:1},lvmax:{max:100,step:1},dvmax:{max:100,step:1}};function yO({label:e=(0,H.__)("Height"),onChange:t,value:n}){var r,o;const i=parseFloat(n),[s]=py("spacing.units"),a=Ww({availableUnits:s||["%","px","em","rem","vh","vw"]}),l=(0,k.useMemo)((()=>$w(n)),[n])[1]||a[0]?.value||"px";return(0,jd.jsxs)("fieldset",{className:"block-editor-height-control",children:[(0,jd.jsx)(H_.Ay.VisualLabel,{as:"legend",children:e}),(0,jd.jsxs)(T_.A,{children:[(0,jd.jsx)(B_.A,{isBlock:!0,children:(0,jd.jsx)(sk,{value:n,units:a,onChange:t,onUnitChange:e=>{const[r,o]=$w(n);["em","rem"].includes(e)&&"px"===o?t((r/16).toFixed(2)+e):["em","rem"].includes(o)&&"px"===e?t(Math.round(16*r)+e):["%","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax"].includes(e)&&r>100&&t(100+e)},min:0,size:"__unstable-large",label:e,hideLabelFromVision:!0})}),(0,jd.jsx)(B_.A,{isBlock:!0,children:(0,jd.jsx)(OT.A,{marginX:2,marginBottom:0,children:(0,jd.jsx)(LC,{value:i,min:0,max:null!==(r=vO[l]?.max)&&void 0!==r?r:100,step:null!==(o=vO[l]?.step)&&void 0!==o?o:.1,withInputField:!1,onChange:e=>{t([e,l].join(""))},__nextHasNoMarginBottom:!0,label:e,hideLabelFromVision:!0})})})]})]})}function _O(e,t){const{orientation:n="horizontal"}=t;return"fill"===e?(0,H.__)("Stretch to fill available space."):"fixed"===e&&"horizontal"===n?(0,H.__)("Specify a fixed width."):"fixed"===e?(0,H.__)("Specify a fixed height."):(0,H.__)("Fit contents.")}function xO({value:e={},onChange:t,parentLayout:n,isShownByDefault:r,panelId:o}){const{selfStretch:i,flexSize:s,columnStart:a,rowStart:l,columnSpan:c,rowSpan:u}=e,{type:d,default:{type:h="default"}={},orientation:p="horizontal"}=null!=n?n:{},f=d||h,m="horizontal"===p?(0,H.__)("Width"):(0,H.__)("Height");return(0,k.useEffect)((()=>{"fixed"!==i||s||t({...e,selfStretch:"fit"})}),[]),(0,jd.jsxs)(jd.Fragment,{children:["flex"===f&&(0,jd.jsxs)(oE.A,{as:KA,spacing:2,hasValue:()=>!!i,label:m,onDeselect:()=>{t({selfStretch:void 0,flexSize:void 0})},isShownByDefault:r,panelId:o,children:[(0,jd.jsxs)(xx,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:wO(n),value:i||"fit",help:_O(i,n),onChange:e=>{t({selfStretch:e,flexSize:"fixed"!==e?null:s})},isBlock:!0,children:[(0,jd.jsx)(FC,{value:"fit",label:(0,H.__)("Fit")},"fit"),(0,jd.jsx)(FC,{value:"fill",label:(0,H.__)("Fill")},"fill"),(0,jd.jsx)(FC,{value:"fixed",label:(0,H.__)("Fixed")},"fixed")]}),"fixed"===i&&(0,jd.jsx)(sk,{size:"__unstable-large",onChange:e=>{t({selfStretch:i,flexSize:e})},value:s})]}),"grid"===f&&(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsxs)(eA.A,{as:KA,hasValue:()=>!!c||!!u,label:(0,H.__)("Grid span"),onDeselect:()=>{t({columnSpan:void 0,rowSpan:void 0})},isShownByDefault:r,panelId:o,children:[(0,jd.jsx)(UT.Ay,{size:"__unstable-large",label:(0,H.__)("Column span"),type:"number",onChange:e=>{t({columnStart:a,rowStart:l,rowSpan:u,columnSpan:e})},value:c,min:1}),(0,jd.jsx)(UT.Ay,{size:"__unstable-large",label:(0,H.__)("Row span"),type:"number",onChange:e=>{t({columnStart:a,rowStart:l,columnSpan:c,rowSpan:e})},value:u,min:1})]}),window.__experimentalEnableGridInteractivity&&(0,jd.jsxs)(T_.A,{as:KA,hasValue:()=>!!a||!!l,label:(0,H.__)("Grid placement"),onDeselect:()=>{t({columnStart:void 0,rowStart:void 0})},isShownByDefault:!1,panelId:o,children:[(0,jd.jsx)(B_.A,{style:{width:"50%"},children:(0,jd.jsx)(UT.Ay,{size:"__unstable-large",label:(0,H.__)("Column"),type:"number",onChange:e=>{t({columnStart:e,rowStart:l,columnSpan:c,rowSpan:u})},value:a,min:1,max:n?.columnCount?n.columnCount-(null!=c?c:1)+1:void 0})}),(0,jd.jsx)(B_.A,{style:{width:"50%"},children:(0,jd.jsx)(UT.Ay,{size:"__unstable-large",label:(0,H.__)("Row"),type:"number",onChange:e=>{t({columnStart:a,rowStart:e,columnSpan:c,rowSpan:u})},value:l,min:1,max:n?.rowCount?n.rowCount-(null!=u?u:1)+1:void 0})})]})]})]})}function wO(e){const{orientation:t="horizontal"}=e;return"horizontal"===t?(0,H.__)("Width"):(0,H.__)("Height")}function kO({panelId:e,value:t,onChange:n=(()=>{}),options:r,defaultValue:o="auto",hasValue:i,isShownByDefault:s=!0}){const a=null!=t?t:"auto",[l,c,u]=py("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios"),d=c?.map((({name:e,ratio:t})=>({label:e,value:t}))),h=l?.map((({name:e,ratio:t})=>({label:e,value:t}))),p=[{label:(0,H._x)("Original","Aspect ratio option for dimensions control"),value:"auto"},...u?h:[],...d||[],{label:(0,H._x)("Custom","Aspect ratio option for dimensions control"),value:"custom",disabled:!0,hidden:!0}];return(0,jd.jsx)(KA,{hasValue:i||(()=>a!==o),label:(0,H.__)("Aspect ratio"),onDeselect:()=>n(void 0),isShownByDefault:s,panelId:e,children:(0,jd.jsx)(kT.A,{label:(0,H.__)("Aspect ratio"),value:a,options:null!=r?r:p,onChange:n,size:"__unstable-large",__nextHasNoMarginBottom:!0})})}const CO=["horizontal","vertical"];function SO(e){const t=AO(e),n=EO(e),r=IO(e),o=jO(e),i=TO(e),s=BO(e),a=RO(e),l=NO(e);return"web"===Oh.A.OS&&(t||n||r||o||i||s||a||l)}function AO(e){return e?.layout?.contentSize}function EO(e){return e?.layout?.wideSize}function IO(e){return e?.spacing?.padding}function jO(e){return e?.spacing?.margin}function TO(e){return e?.spacing?.blockGap}function BO(e){return e?.dimensions?.minHeight}function RO(e){return e?.dimensions?.aspectRatio}function NO(e){var t;const{type:n="default",default:{type:r="default"}={},allowSizingOnChildren:o=!1}=null!==(t=e?.parentLayout)&&void 0!==t?t:{},i=("flex"===r||"flex"===n||"grid"===r||"grid"===n)&&o;return!!e?.layout&&i}function DO(e,t){if(!t||!e)return e;const n={};return t.forEach((t=>{"vertical"===t&&(n.top=e.top,n.bottom=e.bottom),"horizontal"===t&&(n.left=e.left,n.right=e.right),n[t]=e?.[t]})),n}function MO(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function PO({resetAllFilter:e,onChange:t,value:n,panelId:r,children:o}){return(0,jd.jsx)(xA,{label:(0,H.__)("Dimensions"),resetAll:()=>{const r=e(n);t(r)},panelId:r,dropdownMenuProps:Iy,children:o})}const OO={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,minHeight:!0,aspectRatio:!0,childLayout:!0};function LO({as:e=PO,value:t,onChange:n,inheritedValue:r=t,settings:o,panelId:i,defaultControls:s=OO,onVisualize:a=(()=>{}),includeLayoutControls:l=!1}){var c,u,d,h,p,f,m,g;const{dimensions:b,spacing:v}=o,y=e=>e&&"object"==typeof e?Object.keys(e).reduce(((t,n)=>(t[n]=Ty({settings:{dimensions:b,spacing:v}},"",e[n]),t)),{}):Ty({settings:{dimensions:b,spacing:v}},"",e),_=function(e){const{defaultSpacingSizes:t,spacingSizes:n}=e?.spacing||{};return!1!==t&&n?.default?.length>0||n?.theme?.length>0||n?.custom?.length>0}(o),x=Ww({availableUnits:o?.spacing?.units||["%","px","em","rem","vw"]}),w=-1/0,[C,S]=(0,k.useState)(w),A=AO(o)&&l,E=y(r?.layout?.contentSize),I=e=>{n(Of(t,["layout","contentSize"],e||void 0))},j=EO(o)&&l,T=y(r?.layout?.wideSize),B=e=>{n(Of(t,["layout","wideSize"],e||void 0))},R=IO(o),N=MO(y(r?.spacing?.padding)),D=Array.isArray(o?.spacing?.padding)?o?.spacing?.padding:o?.spacing?.padding?.sides,M=D&&D.some((e=>CO.includes(e))),P=e=>{const r=DO(e,D);n(Of(t,["spacing","padding"],r))},O=()=>a("padding"),L=jO(o),F=MO(y(r?.spacing?.margin)),z=Array.isArray(o?.spacing?.margin)?o?.spacing?.margin:o?.spacing?.margin?.sides,U=z&&z.some((e=>CO.includes(e))),V=e=>{const r=DO(e,z);n(Of(t,["spacing","margin"],r))},$=()=>a("margin"),W=TO(o),G=y(r?.spacing?.blockGap),q=function(e){return e&&"string"==typeof e?{top:e}:e?{...e,right:e?.left,bottom:e?.top}:e}(G),K=Array.isArray(o?.spacing?.blockGap)?o?.spacing?.blockGap:o?.spacing?.blockGap?.sides,Y=K&&K.some((e=>CO.includes(e))),J=e=>{n(Of(t,["spacing","blockGap"],e))},X=e=>{e||J(null),!Y&&e?.hasOwnProperty("top")?J(e.top):J({top:e?.top,left:e?.left})},Z=BO(o),Q=y(r?.dimensions?.minHeight),ee=e=>{const r=Of(t,["dimensions","minHeight"],e);n(Of(r,["dimensions","aspectRatio"],void 0))},te=RO(o),ne=y(r?.dimensions?.aspectRatio),re=NO(o),oe=r?.layout,ie=(0,k.useCallback)((e=>({...e,layout:$y({...e?.layout,contentSize:void 0,wideSize:void 0,selfStretch:void 0,flexSize:void 0,columnStart:void 0,rowStart:void 0,columnSpan:void 0,rowSpan:void 0}),spacing:{...e?.spacing,padding:void 0,margin:void 0,blockGap:void 0},dimensions:{...e?.dimensions,minHeight:void 0,aspectRatio:void 0}})),[]),se=()=>a(!1),ae={min:C,onDragStart:()=>{S(0)},onDragEnd:()=>{S(w)}};return(0,jd.jsxs)(e,{resetAllFilter:ie,value:t,onChange:n,panelId:i,children:[(A||j)&&(0,jd.jsx)("span",{className:"span-columns",children:(0,H.__)("Set the width of the main content area.")}),A&&(0,jd.jsx)(KA,{className:"single-column",label:(0,H.__)("Content size"),hasValue:()=>!!t?.layout?.contentSize,onDeselect:()=>I(void 0),isShownByDefault:null!==(c=s.contentSize)&&void 0!==c?c:OO.contentSize,panelId:i,children:(0,jd.jsxs)(eA.A,{alignment:"flex-end",justify:"flex-start",children:[(0,jd.jsx)(sk,{label:(0,H.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:E||"",onChange:e=>{I(e)},units:x}),(0,jd.jsx)(hx.A,{children:(0,jd.jsx)(ak.A,{icon:lk.A})})]})}),j&&(0,jd.jsx)(KA,{className:"single-column",label:(0,H.__)("Wide size"),hasValue:()=>!!t?.layout?.wideSize,onDeselect:()=>B(void 0),isShownByDefault:null!==(u=s.wideSize)&&void 0!==u?u:OO.wideSize,panelId:i,children:(0,jd.jsxs)(eA.A,{alignment:"flex-end",justify:"flex-start",children:[(0,jd.jsx)(sk,{label:(0,H.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:T||"",onChange:e=>{B(e)},units:x}),(0,jd.jsx)(hx.A,{children:(0,jd.jsx)(ak.A,{icon:ck.A})})]})}),R&&(0,jd.jsxs)(KA,{hasValue:()=>!!t?.spacing?.padding&&Object.keys(t?.spacing?.padding).length,label:(0,H.__)("Padding"),onDeselect:()=>P(void 0),isShownByDefault:null!==(d=s.padding)&&void 0!==d?d:OO.padding,className:(0,Hy.A)({"tools-panel-item-spacing":_}),panelId:i,children:[!_&&(0,jd.jsx)(iO,{values:N,onChange:P,label:(0,H.__)("Padding"),sides:D,units:x,allowReset:!1,splitOnAxis:M,onMouseOver:O,onMouseOut:se}),_&&(0,jd.jsx)(bO,{values:N,onChange:P,label:(0,H.__)("Padding"),sides:D,units:x,allowReset:!1,onMouseOver:O,onMouseOut:se})]}),L&&(0,jd.jsxs)(KA,{hasValue:()=>!!t?.spacing?.margin&&Object.keys(t?.spacing?.margin).length,label:(0,H.__)("Margin"),onDeselect:()=>V(void 0),isShownByDefault:null!==(h=s.margin)&&void 0!==h?h:OO.margin,className:(0,Hy.A)({"tools-panel-item-spacing":_}),panelId:i,children:[!_&&(0,jd.jsx)(iO,{values:F,onChange:V,inputProps:ae,label:(0,H.__)("Margin"),sides:z,units:x,allowReset:!1,splitOnAxis:U,onMouseOver:$,onMouseOut:se}),_&&(0,jd.jsx)(bO,{values:F,onChange:V,minimumCustomValue:-1/0,label:(0,H.__)("Margin"),sides:z,units:x,allowReset:!1,onMouseOver:$,onMouseOut:se})]}),W&&(0,jd.jsxs)(KA,{hasValue:()=>!!t?.spacing?.blockGap,label:(0,H.__)("Block spacing"),onDeselect:()=>J(void 0),isShownByDefault:null!==(p=s.blockGap)&&void 0!==p?p:OO.blockGap,className:(0,Hy.A)({"tools-panel-item-spacing":_}),panelId:i,children:[!_&&(Y?(0,jd.jsx)(iO,{label:(0,H.__)("Block spacing"),min:0,onChange:X,units:x,sides:K,values:q,allowReset:!1,splitOnAxis:Y}):(0,jd.jsx)(sk,{label:(0,H.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:J,units:x,value:G})),_&&(0,jd.jsx)(bO,{label:(0,H.__)("Block spacing"),min:0,onChange:X,showSideInLabel:!1,sides:Y?K:["top"],values:q,allowReset:!1})]}),re&&(0,jd.jsx)(xO,{value:oe,onChange:e=>{n({...t,layout:{...e}})},parentLayout:o?.parentLayout,panelId:i,isShownByDefault:null!==(f=s.childLayout)&&void 0!==f?f:OO.childLayout}),Z&&(0,jd.jsx)(KA,{hasValue:()=>!!t?.dimensions?.minHeight,label:(0,H.__)("Minimum height"),onDeselect:()=>{ee(void 0)},isShownByDefault:null!==(m=s.minHeight)&&void 0!==m?m:OO.minHeight,panelId:i,children:(0,jd.jsx)(yO,{label:(0,H.__)("Minimum height"),value:Q,onChange:ee})}),te&&(0,jd.jsx)(kO,{hasValue:()=>!!t?.dimensions?.aspectRatio,value:ne,onChange:e=>{const r=Of(t,["dimensions","aspectRatio"],e);n(Of(r,["dimensions","minHeight"],void 0))},panelId:i,isShownByDefault:null!==(g=s.aspectRatio)&&void 0!==g?g:OO.aspectRatio})]})}function FO({clientId:e,value:t,computeStyle:n,forceShow:r}){const o=GC(e),[i,s]=(0,k.useReducer)((()=>n(o)));(0,k.useLayoutEffect)((()=>{o&&window.requestAnimationFrame((()=>window.requestAnimationFrame(s)))}),[o,t]);const a=(0,k.useRef)(t),[l,c]=(0,k.useState)(!1);return(0,k.useEffect)((()=>{if((0,M.default)(t,a.current)||r)return;c(!0),a.current=t;const e=setTimeout((()=>{c(!1)}),400);return()=>{c(!1),clearTimeout(e)}}),[t,r]),l||r?(0,jd.jsx)(QC,{clientId:e,__unstablePopoverSlot:"block-toolbar",children:(0,jd.jsx)("div",{className:"block-editor__spacing-visualizer",style:i})}):null}function zO(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function UO({clientId:e,value:t,forceShow:n}){return(0,jd.jsx)(FO,{clientId:e,value:t?.spacing?.margin,computeStyle:e=>{const t=zO(e,"margin-top"),n=zO(e,"margin-right"),r=zO(e,"margin-bottom"),o=zO(e,"margin-left");return{borderTopWidth:t,borderRightWidth:n,borderBottomWidth:r,borderLeftWidth:o,top:t?`-${t}`:0,right:n?`-${n}`:0,bottom:r?`-${r}`:0,left:o?`-${o}`:0}},forceShow:n})}function VO({clientId:e,value:t,forceShow:n}){return(0,jd.jsx)(FO,{clientId:e,value:t?.spacing?.padding,computeStyle:e=>({borderTopWidth:zO(e,"padding-top"),borderRightWidth:zO(e,"padding-right"),borderBottomWidth:zO(e,"padding-bottom"),borderLeftWidth:zO(e,"padding-left")}),forceShow:n})}const HO="dimensions",$O="spacing";function WO({children:e,resetAllFilter:t}){const n=(0,k.useCallback)((e=>{const n=e.style,r=t(n);return{...e,style:r}}),[t]);return(0,jd.jsx)(EA,{group:"dimensions",resetAllFilter:n,children:e})}function GO({clientId:e,name:t,setAttributes:n,settings:r}){const o=SO(r),i=(0,Ul.A)((t=>t(dy).getBlockAttributes(e)?.style),[e]),[s,a]=function(){const[e,t]=(0,k.useState)(!1),{hideBlockInterface:n,showBlockInterface:r}=kf((0,Vl.A)(dy));return(0,k.useEffect)((()=>{e?n():r()}),[e,r,n]),[e,t]}();if(!o)return null;const l={...Ec(t,[HO,"__experimentalDefaultControls"]),...Ec(t,[$O,"__experimentalDefaultControls"])};return(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsx)(LO,{as:WO,panelId:e,settings:r,value:i,onChange:e=>{n({style:$y(e)})},defaultControls:l,onVisualize:a}),!!r?.spacing?.padding&&(0,jd.jsx)(VO,{forceShow:"padding"===s,clientId:e,value:i}),!!r?.spacing?.margin&&(0,jd.jsx)(UO,{forceShow:"margin"===s,clientId:e,value:i})]})}function qO(e,t="any"){if("web"!==Oh.A.OS)return!1;const n=Ec(e,HO);return!(!0!==n&&("any"===t?!n?.aspectRatio&&!n?.minHeight:!n?.[t]))}const KO={useBlockProps:function({name:e,minHeight:t,style:n}){if(!qO(e,"aspectRatio")||Gy(e,HO,"aspectRatio"))return{};const r=(0,Hy.A)({"has-aspect-ratio":!!n?.dimensions?.aspectRatio}),o={};return n?.dimensions?.aspectRatio?o.minHeight="unset":(t||n?.dimensions?.minHeight)&&(o.aspectRatio="unset"),{className:r,style:o}},attributeKeys:["minHeight","style"],hasSupport:e=>qO(e,"aspectRatio")},YO=[...vP,JR,ED,HO,Dj,$O,XR],JO=e=>YO.some((t=>Ic(e,t)));function XO(e={}){const t={};return Xk(e).forEach((e=>{t[e.key]=e.value})),t}const ZO={[`${JR}.__experimentalSkipSerialization`]:["border"],[`${ED}.__experimentalSkipSerialization`]:[ED],[`${bP}.__experimentalSkipSerialization`]:[bP],[`${HO}.__experimentalSkipSerialization`]:[HO],[`${$O}.__experimentalSkipSerialization`]:[$O],[`${XR}.__experimentalSkipSerialization`]:[XR]},QO={...ZO,[`${HO}.aspectRatio`]:[`${HO}.aspectRatio`],[`${Dj}`]:[Dj]},eL={[`${HO}.aspectRatio`]:!0,[`${Dj}`]:!0},tL={gradients:"gradient"};function nL(e,t,n=!1){if(!e)return e;let r=e;return n||(r=JSON.parse(JSON.stringify(e))),Array.isArray(t)||(t=[t]),t.forEach((e=>{if(Array.isArray(e)||(e=e.split(".")),e.length>1){const[t,...n]=e;nL(r[t],[n],!0)}else 1===e.length&&delete r[e[0]]})),r}function rL(e,t,n,r=QO){if(!JO(t))return e;let{style:o}=n;return Object.entries(r).forEach((([e,n])=>{const r=eL[e]||Ec(t,e);!0===r&&(o=nL(o,n)),Array.isArray(r)&&r.forEach((e=>{const t=tL[e]||e;o=nL(o,[[...n,t]])}))})),e.style={...XO(o),...e.style},e}const oL={edit:function({clientId:e,name:t,setAttributes:n,__unstableParentLayout:r}){const o=Yy(t,r),i=ES(),s={clientId:e,name:t,setAttributes:n,settings:{...o,typography:{...o.typography,textAlign:!1}}};return"default"!==i?null:(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsx)(OD,{...s}),(0,jd.jsx)(Fj,{...s}),(0,jd.jsx)(wP,{...s}),(0,jd.jsx)(oN,{...s}),(0,jd.jsx)(GO,{...s})]})},hasSupport:JO,addSaveProps:rL,attributeKeys:["style"],useBlockProps:function e({name:t,style:n}){const r=`wp-elements-${(0,F_.A)(e)}`,o=`.editor-styles-wrapper .${r}`,i=n?.elements,s=(0,k.useMemo)((()=>{if(!i)return;const e=[];return iL.forEach((({elementType:n,pseudo:r,elements:s})=>{if(Gy(t,ED,n))return;const a=i?.[n];if(a){const t=By(o,dc[n]);e.push(Jk(a,{selector:t})),r&&r.forEach((t=>{a[t]&&e.push(Jk(a[t],{selector:By(o,`${dc[n]}${t}`)}))}))}s&&s.forEach((t=>{i[t]&&e.push(Jk(i[t],{selector:By(o,dc[t])}))}))})),e.length>0?e.join(""):void 0}),[o,i,t]);return Ky({css:s}),rL({className:r},t,{style:n},ZO)}},iL=[{elementType:"button"},{elementType:"link",pseudo:[":hover"]},{elementType:"heading",elements:["h1","h2","h3","h4","h5","h6"]}];(0,Tu.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return JO(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,Tu.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){return Ic(e,"__experimentalSettings",!1)?(e?.attributes?.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e}));var sL=n(10854);function aL(e=[],t="90deg"){const n=100/e.length,r=e.map(((e,t)=>`${e} ${t*n}%, ${e} ${(t+1)*n}%`)).join(", ");return`linear-gradient( ${t}, ${r} )`}(0,oc.X$)([ic.A]);const lL=function({values:e}){return e?(0,jd.jsx)(xT,{colorValue:aL(e,"135deg")}):(0,jd.jsx)(zx.A,{icon:sL.A})};function cL({label:e,value:t,colors:n,disableCustomColors:r,enableAlpha:o,onChange:i}){const[s,a]=(0,k.useState)(!1),l=(0,F_.A)(cL,"color-list-picker-option"),c=`${l}__label`,u=`${l}__content`;return(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsx)(Xy.Ay,{className:"components-color-list-picker__swatch-button",onClick:()=>a((e=>!e)),"aria-expanded":s,"aria-controls":u,children:(0,jd.jsxs)(eA.A,{justify:"flex-start",spacing:2,children:[t?(0,jd.jsx)(xT,{colorValue:t,className:"components-color-list-picker__swatch-color"}):(0,jd.jsx)(zx.A,{icon:sL.A}),(0,jd.jsx)("span",{id:c,children:e})]})}),(0,jd.jsx)("div",{role:"group",id:u,"aria-labelledby":c,"aria-hidden":!s,children:s&&(0,jd.jsx)(KB,{"aria-label":(0,H.__)("Color options"),className:"components-color-list-picker__color-picker",colors:n,value:t,clearable:!1,onChange:i,disableCustomColors:r,enableAlpha:o})})]})}const uL=function({colors:e,labels:t,value:n=[],disableCustomColors:r,enableAlpha:o,onChange:i}){return(0,jd.jsx)("div",{className:"components-color-list-picker",children:t.map(((t,s)=>(0,jd.jsx)(cL,{label:t,value:n[s],colors:e,disableCustomColors:r,enableAlpha:o,onChange:e=>{const t=n.slice();t[s]=e,i(t)}},s)))})},dL=["#333","#CCC"];function hL({value:e,onChange:t}){const n=!!e,r=n?e:dL,o=aL(r),i=(s=r).map(((e,t)=>({position:100*t/(s.length-1),color:e})));var s;return(0,jd.jsx)(LN,{disableInserter:!0,background:o,hasGradient:n,value:i,onChange:e=>{const n=function(e=[]){return e.map((({color:e})=>e))}(e);t(n)}})}const pL=function({asButtons:e,loop:t,clearable:n=!0,unsetable:r=!0,colorPalette:o,duotonePalette:i,disableCustomColors:s,disableCustomDuotone:a,value:l,onChange:c,"aria-label":u,"aria-labelledby":d,...h}){const[p,f]=(0,k.useMemo)((()=>{return!(e=o)||e.length<2?["#000","#fff"]:e.map((({color:e})=>({color:e,brightness:(0,oc.Mj)(e).brightness()}))).reduce((([e,t],n)=>[n.brightness<=e.brightness?n:e,n.brightness>=t.brightness?n:t]),[{brightness:1,color:""},{brightness:0,color:""}]).map((({color:e})=>e));var e}),[o]),m="unset"===l,g=(0,H.__)("Unset"),b=(0,jd.jsx)(LB.Option,{value:"unset",isSelected:m,tooltipText:g,"aria-label":g,className:"components-duotone-picker__color-indicator",onClick:()=>{c(m?void 0:"unset")}},"unset"),v=i.map((({colors:e,slug:t,name:n})=>{const r={background:aL(e,"135deg"),color:"transparent"},o=null!=n?n:(0,H.sprintf)((0,H.__)("Duotone code: %s"),t),i=n?(0,H.sprintf)((0,H.__)("Duotone: %s"),n):o,s=N()(e,l);return(0,jd.jsx)(LB.Option,{value:e,isSelected:s,"aria-label":i,tooltipText:o,style:r,onClick:()=>{c(s?void 0:e)}},t)}));let y;if(e)y={asButtons:!0};else{const e={asButtons:!1,loop:t};y=u?{...e,"aria-label":u}:d?{...e,"aria-labelledby":d}:{...e,"aria-label":(0,H.__)("Custom color picker.")}}const _=r?[b,...v]:v;return(0,jd.jsx)(LB,{...h,...y,options:_,actions:!!n&&(0,jd.jsx)(LB.ButtonAction,{onClick:()=>c(void 0),children:(0,H.__)("Clear")}),children:(0,jd.jsx)(OT.A,{paddingTop:0===_.length?0:4,children:(0,jd.jsxs)(oE.A,{spacing:3,children:[!s&&!a&&(0,jd.jsx)(hL,{value:m?void 0:l,onChange:c}),!a&&(0,jd.jsx)(uL,{labels:[(0,H.__)("Shadows"),(0,H.__)("Highlights")],colors:o,value:m?void 0:l,disableCustomColors:s,enableAlpha:!0,onChange:e=>{e[0]||(e[0]=p),e[1]||(e[1]=f);const t=e.length>=2?e:void 0;c(t)}})]})})})};var fL=n(96360);const mL=function e({id:t,colorPalette:n,duotonePalette:r,disableCustomColors:o,disableCustomDuotone:i,value:s,onChange:a}){let l;l="unset"===s?(0,jd.jsx)(xT,{className:"block-editor-duotone-control__unset-indicator"}):s?(0,jd.jsx)(lL,{values:s}):(0,jd.jsx)(ak.A,{icon:fL.A});const c=(0,H.__)("Apply duotone filter"),u=`${(0,F_.A)(e,"duotone-control",t)}__description`;return(0,jd.jsx)(PE.A,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,H.__)("Duotone")},renderToggle:({isOpen:e,onToggle:t})=>(0,jd.jsx)(n_,{showTooltip:!0,onClick:t,"aria-haspopup":"true","aria-expanded":e,onKeyDown:n=>{e||n.keyCode!==VE.DOWN||(n.preventDefault(),t())},label:c,icon:l}),renderContent:()=>(0,jd.jsxs)(x_.A,{label:(0,H.__)("Duotone"),children:[(0,jd.jsx)("p",{children:(0,H.__)("Create a two-tone color effect without losing your original image.")}),(0,jd.jsx)(pL,{"aria-label":c,"aria-describedby":u,colorPalette:n,duotonePalette:r,disableCustomColors:o,disableCustomDuotone:i,value:s,onChange:a})]})})};function gL(e){return`${e}{filter:none}`}function bL(e,t){return`${e}{filter:url(#${t})}`}function vL(e,t){const n=function(e=[]){const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=(0,oc.Mj)(e).toRgb();t.r.push(n.r/255),t.g.push(n.g/255),t.b.push(n.b/255),t.a.push(n.a)})),t}(t);return`\n\n\t\n\t\t\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\n\t\t\t\x3c!-- Use sRGB instead of linearRGB to be consistent with how CSS gradients work. --\x3e\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\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\n\t\t\n\t\n`}function yL(e,t="root",n={}){if(!t)return null;const{fallback:r=!1}=n,{name:o,selectors:i,supports:s}=e,a=i&&Object.keys(i).length>0,l=Array.isArray(t)?t.join("."):t;let c=null;if(c=a&&i.root?i?.root:s?.__experimentalSelector?s.__experimentalSelector:".wp-block-"+o.replace("core/","").replace("/","-"),"root"===l)return c;const u=Array.isArray(t)?t:t.split(".");if(1===u.length){const e=r?c:null;if(a)return Lf(i,`${l}.root`,null)||Lf(i,l,null)||e;const t=Lf(s,`${l}.__experimentalSelector`,null);return t?By(c,t):e}let d;return a&&(d=Lf(i,l,null)),d||(r?yL(e,u[0],n):null)}const _L=[];function xL(e,{presetSetting:t,defaultSetting:n}){const r=!e?.color?.[n],o=e?.color?.[t]?.custom||_L,i=e?.color?.[t]?.theme||_L,s=e?.color?.[t]?.default||_L;return(0,k.useMemo)((()=>[...o,...i,...r?_L:s]),[r,o,i,s])}function wL(e){return kL(e)}function kL(e){return e.color.customDuotone||e.color.defaultDuotone||e.color.duotone.length>0}function CL({resetAllFilter:e,onChange:t,value:n,panelId:r,children:o}){return(0,jd.jsx)(xA,{label:(0,H._x)("Filters","Name for applying graphical effects"),resetAll:()=>{const r=e(n);t(r)},panelId:r,dropdownMenuProps:Iy,children:o})}const SL={duotone:!0},AL={placement:"left-start",offset:36,shift:!0,className:"block-editor-duotone-control__popover",headerTitle:(0,H.__)("Duotone")},EL=({indicator:e,label:t})=>(0,jd.jsxs)(eA.A,{justify:"flex-start",children:[(0,jd.jsx)(mN,{isLayered:!1,offset:-8,children:(0,jd.jsx)(T_.A,{expanded:!1,children:"unset"!==e&&e?(0,jd.jsx)(lL,{values:e}):(0,jd.jsx)(xT,{className:"block-editor-duotone-control__unset-indicator"})})}),(0,jd.jsx)(B_.A,{title:t,children:t})]});function IL({as:e=CL,value:t,onChange:n,inheritedValue:r=t,settings:o,panelId:i,defaultControls:s=SL}){const a=kL(o),l=xL(o,{presetSetting:"duotone",defaultSetting:"defaultDuotone"}),c=xL(o,{presetSetting:"palette",defaultSetting:"defaultPalette"}),u=(d=r?.filter?.duotone,Ty({settings:o},"",d));var d;const h=e=>{const r=l.find((({colors:t})=>t===e)),o=r?`var:preset|duotone|${r.slug}`:e;n(Of(t,["filter","duotone"],o))},p=(0,k.useCallback)((e=>({...e,filter:{...e.filter,duotone:void 0}})),[]);return(0,jd.jsx)(e,{resetAllFilter:p,value:t,onChange:n,panelId:i,children:a&&(0,jd.jsx)(KA,{label:(0,H.__)("Duotone"),hasValue:()=>!!t?.filter?.duotone,onDeselect:()=>h(void 0),isShownByDefault:s.duotone,panelId:i,children:(0,jd.jsx)(PE.A,{popoverProps:AL,className:"block-editor-global-styles-filters-panel__dropdown",renderToggle:({onToggle:e,isOpen:t})=>{const n={onClick:e,className:(0,Hy.A)({"is-open":t}),"aria-expanded":t};return(0,jd.jsx)(HA,{isBordered:!0,isSeparated:!0,children:(0,jd.jsx)(Xy.Ay,{...n,children:(0,jd.jsx)(EL,{indicator:u,label:(0,H.__)("Duotone")})})})},renderContent:()=>(0,jd.jsx)(VB,{paddingSize:"small",children:(0,jd.jsxs)(x_.A,{label:(0,H.__)("Duotone"),children:[(0,jd.jsx)("p",{children:(0,H.__)("Create a two-tone color effect without losing your original image.")}),(0,jd.jsx)(pL,{colorPalette:c,duotonePalette:l,disableCustomColors:!0,disableCustomDuotone:!0,value:u,onChange:h})]})})})})})}const jL=[],TL=window?.navigator.userAgent&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&!window.navigator.userAgent.includes("Chromium");function BL({presetSetting:e,defaultSetting:t}){const[n,r,o,i]=py(t,`${e}.custom`,`${e}.theme`,`${e}.default`);return(0,k.useMemo)((()=>[...r||jL,...o||jL,...n&&i||jL]),[n,r,o,i])}function RL(e,t){if(!e)return;const n=t?.find((({slug:t})=>e===`var:preset|duotone|${t}`));return n?n.colors:void 0}(0,oc.X$)([ic.A]);const NL={shareWithChildBlocks:!0,edit:function({style:e,setAttributes:t,name:n}){const r=e?.color?.duotone,o=Yy(n),i=ES(),s=BL({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=BL({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),[l,c]=py("color.custom","color.customDuotone"),u=!l,d=!c||0===a?.length&&u;if(0===s?.length&&d)return null;if("default"!==i)return null;const h=Array.isArray(r)?r:RL(r,s);return(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsx)(EA,{group:"filter",children:(0,jd.jsx)(IL,{value:{filter:{duotone:h}},onChange:n=>{const r={...e,color:{...n?.filter}};t({style:r})},settings:o})}),(0,jd.jsx)(y_,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,jd.jsx)(mL,{duotonePalette:s,colorPalette:a,disableCustomDuotone:d,disableCustomColors:u,value:h,onChange:n=>{const r=function(e,t){if(!e||!Array.isArray(e))return;const n=t?.find((t=>t?.colors?.every(((t,n)=>t===e[n]))));return n?`var:preset|duotone|${n.slug}`:void 0}(n,s),o={...e,color:{...e?.color,duotone:null!=r?r:n}};t({style:o})},settings:o})})]})},useBlockProps:function e({name:t,style:n}){const r=(0,F_.A)(e),o=(0,k.useMemo)((()=>{const e=Sc(t);if(e){if(!Ec(e,"filter.duotone",!1))return null;const t=Ec(e,"color.__experimentalDuotone",!1);if(t){const n=yL(e);return"string"==typeof t?By(n,t):n}return yL(e,"filter.duotone",{fallback:!0})}}),[t]),i=n?.color?.duotone,s=`wp-duotone-${r}`,a=o&&i;return function({clientId:e,id:t,selector:n,attribute:r}){const o=BL({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),i=Array.isArray(r),s=i?void 0:RL(r,o),a="string"==typeof r&&s;let l=null;a?l=s:("string"==typeof r&&!a||i)&&(l=r);const c=n.split(",").map((e=>`.${t}${e.trim()}`)).join(", "),u=Array.isArray(l)||"unset"===l;Ky(u?{css:"unset"!==l?bL(c,t):gL(c),__unstableType:"presets"}:void 0),Ky(u?{assets:"unset"!==l?vL(t,l):"",__unstableType:"svgs"}:void 0);const d=GC(e);(0,k.useEffect)((()=>{if(u&&d&&TL){const e=d.style.display;d.style.display="inline-block",d.offsetHeight,d.style.display=e}}),[u,d])}({clientId:r,id:s,selector:o,attribute:i}),{className:a?s:""}},attributeKeys:["style"],hasSupport:e=>Ic(e,"filter.duotone")};function DL(e){return(0,Ul.A)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:r}=t(dy),{getBlockType:o,getActiveBlockVariation:i}=t(ed),s=n(e),a=o(s);if(!a)return null;const l=r(e),c=i(s,l),u=jc(a)||Tc(a),d=(u?Oc(a,l):void 0)||a.title,h=function(e){const t=e?.style?.position?.type;return"sticky"===t?(0,H.__)("Sticky"):"fixed"===t?(0,H.__)("Fixed"):null}(l),p={isSynced:u,title:d,icon:a.icon,description:a.description,anchor:l?.anchor,positionLabel:h,positionType:l?.style?.position?.type,name:l?.metadata?.name};return c?{isSynced:u,title:c.title||a.title,icon:c.icon||a.icon,description:c.description||a.description,anchor:l?.anchor,positionLabel:h,positionType:l?.style?.position?.type,name:l?.metadata?.name}:p}),[e])}(0,Tu.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return Ic(e,"filter.duotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e}));const{CustomSelectControl:ML}=kf(u_.j),PL="position",OL="block-editor-hooks__position-selection__select-control__option",LL={key:"default",value:"",name:(0,H.__)("Default"),className:OL},FL={key:"sticky",value:"sticky",name:(0,H._x)("Sticky","Name for the value of the CSS position property"),className:OL,__experimentalHint:(0,H.__)("The block will stick to the top of the window instead of scrolling.")},zL={key:"fixed",value:"fixed",name:(0,H._x)("Fixed","Name for the value of the CSS position property"),className:OL,__experimentalHint:(0,H.__)("The block will not move when the page is scrolled.")},UL=["top","right","bottom","left"],VL=["sticky","fixed"];function HL(e){const t=e?.style?.position?.type;return"sticky"===t||"fixed"===t}function $L({name:e}={}){const[t,n]=py("position.fixed","position.sticky"),r=!t&&!n;return!Ec(e,PL)||r}function WL({style:e={},clientId:t,name:n,setAttributes:r}){const o=function(e){const t=Ec(e,PL);return!(!0!==t&&!t?.fixed)}(n),i=function(e){const t=Ec(e,PL);return!(!0!==t&&!t?.sticky)}(n),s=e?.position?.type,{firstParentClientId:a}=(0,Ul.A)((e=>{const{getBlockParents:n}=e(dy),r=n(t);return{firstParentClientId:r[r.length-1]}}),[t]),l=DL(a),c=i&&s===FL.value&&l?(0,H.sprintf)((0,H.__)("The block will stick to the scrollable area of the parent %s block."),l.title):null,u=(0,k.useMemo)((()=>{const e=[LL];return(i||s===FL.value)&&e.push(FL),(o||s===zL.value)&&e.push(zL),e}),[o,i,s]),d=s&&u.find((e=>e.value===s))||LL;return Oh.A.select({web:u.length>1?(0,jd.jsx)(EA,{group:"position",children:(0,jd.jsx)(H_.Ay,{className:"block-editor-hooks__position-selection",__nextHasNoMarginBottom:!0,help:c,children:(0,jd.jsx)(ML,{__next40pxDefaultSize:!0,className:"block-editor-hooks__position-selection__select-control",label:(0,H.__)("Position"),hideLabelFromVision:!0,describedBy:(0,H.sprintf)((0,H.__)("Currently selected position: %s"),d.name),options:u,value:d,__experimentalShowSelectedHint:!0,onChange:({selectedItem:t})=>{(t=>{const n={...e,position:{...e?.position,type:t,top:"sticky"===t||"fixed"===t?"0px":void 0}};r({style:$y(n)})})(t.value)},size:"__unstable-large"})})}):null,native:null})}const GL={edit:function(e){return $L(e)?null:(0,jd.jsx)(WL,{...e})},useBlockProps:function e({name:t,style:n}){const r=Ic(t,PL),o=$L({name:t}),i=r&&!o,s=(0,F_.A)(e);let a;i&&(a=function({selector:e,style:t}){let n="";const{type:r}=t?.position||{};return VL.includes(r)?(n+=`${e} {`,n+=`position: ${r};`,UL.forEach((e=>{void 0!==t?.position?.[e]&&(n+=`${e}: ${t.position[e]};`)})),"sticky"!==r&&"fixed"!==r||(n+="z-index: 10"),n+="}",n):n}({selector:`.wp-container-${s}.wp-container-${s}`,style:n})||"");const l=(0,Hy.A)({[`wp-container-${s}`]:i&&!!a,[`is-position-${n?.position?.type}`]:i&&!!a&&!!n?.position?.type});return Ky({css:a}),{className:l}},attributeKeys:["style"],hasSupport:e=>Ic(e,PL)},qL={__experimentalBorder:"border",color:"color",spacing:"spacing",typography:"typography"},{kebabCase:KL}=kf(u_.j);function YL(e){return e?.startsWith?.("var:")?`var(--wp--${e.slice(4).split("|").join("--")})`:e}function JL(e={},t,n){let r=[];return Object.keys(e).forEach((o=>{const i=t+KL(o.replace("/","-")),s=e[o];if(s instanceof Object){const e=i+n;r=[...r,...JL(s,e,n)]}else r.push(`${i}: ${s}`)})),r}const XL=(e,t)=>{const n={};return Object.entries(e).forEach((([e,r])=>{if("root"===e||!t?.[e])return;const o="string"==typeof r;if(o||Object.entries(r).forEach((([r,o])=>{if("root"===r||!t?.[e][r])return;const i=ZL({[e]:{[r]:t[e][r]}});n[o]=[...n[o]||[],...i],delete t[e][r]})),o||r.root){const i=o?r:r.root,s=ZL({[e]:t[e]});n[i]=[...n[i]||[],...s],delete t[e]}})),n};function ZL(e={},t="",n,r={},o=!1){const i=Cy===t,s=Object.entries(uc).reduce(((t,[r,{value:o,properties:s,useEngine:a,rootOnly:l}])=>{if(l&&!i)return t;const c=o;if("elements"===c[0]||a)return t;const u=Lf(e,c);if("--wp--style--root--padding"===r&&("string"==typeof u||!n))return t;if(s&&"string"!=typeof u)Object.entries(s).forEach((e=>{const[n,r]=e;if(!Lf(u,[r],!1))return;const o=n.startsWith("--")?n:KL(n);t.push(`${o}: ${YL(Lf(u,[r]))}`)}));else if(Lf(e,c,!1)){const n=r.startsWith("--")?r:KL(r);t.push(`${n}: ${YL(Lf(e,c))}`)}return t}),[]);return Xk(e).forEach((e=>{if(i&&(n||o)&&e.key.startsWith("padding"))return;const t=e.key.startsWith("--")?e.key:KL(e.key);let a=e.value;if("string"!=typeof a&&a?.ref){const e=a.ref.split(".");if(a=YL(Lf(r,e)),!a||a?.ref)return}"font-size"===t&&(a=wy({size:a},r?.settings)),"aspect-ratio"===t&&s.push("min-height: unset"),s.push(`${t}: ${a}`)})),s}function QL({layoutDefinitions:e=Hx,style:t,selector:n,hasBlockGapSupport:r,hasFallbackGapSupport:o,fallbackGapValue:i}){let s="",a=r?dw(t?.spacing?.blockGap):"";if(o&&(n===Cy?a=a||"0.5em":!r&&i&&(a=i)),a&&e&&(Object.values(e).forEach((({className:e,name:t,spacingStyles:o})=>{(r||"flex"===t||"grid"===t)&&o?.length&&o.forEach((t=>{const o=[];if(t.rules&&Object.entries(t.rules).forEach((([e,t])=>{o.push(`${e}: ${t||a}`)})),o.length){let i="";i=r?n===Cy?`.${e}${t?.selector||""}`:`${n}-${e}${t?.selector||""}`:n===Cy?`:where(.${e}${t?.selector||""})`:`:where(${n}.${e}${t?.selector||""})`,s+=`${i} { ${o.join("; ")}; }`}}))})),n===Cy&&r&&(s+=`${Sy} { --wp--style--block-gap: ${a}; }`)),n===Cy&&e){const t=["block","flex","grid"];Object.values(e).forEach((({className:e,displayMode:r,baseStyles:o})=>{r&&t.includes(r)&&(s+=`${n} .${e} { display:${r}; }`),o?.length&&o.forEach((t=>{const n=[];t.rules&&Object.entries(t.rules).forEach((([e,t])=>{n.push(`${e}: ${t}`)})),n.length&&(s+=`.${e}${t?.selector||""} { ${n.join("; ")}; }`)}))}))}return s}const eF=["border","color","dimensions","spacing","typography","filter","outline","shadow","background"];function tF(e){if(!e)return{};const t=Object.entries(e).filter((([e])=>eF.includes(e))).map((([e,t])=>[e,JSON.parse(JSON.stringify(t))]));return Object.fromEntries(t)}const nF=(e,t)=>{var n;const r=[];if(!e?.settings)return r;const o=e=>{let t={};return Ay.forEach((({path:n})=>{const r=Lf(e,n,!1);!1!==r&&(t=Of(t,n,r))})),t},i=o(e.settings),s=e.settings?.custom;return(Object.keys(i).length>0||s)&&r.push({presets:i,custom:s,selector:Sy}),Object.entries(null!==(n=e.settings?.blocks)&&void 0!==n?n:{}).forEach((([e,n])=>{const i=o(n),s=n.custom;(Object.keys(i).length>0||s)&&r.push({presets:i,custom:s,selector:t[e]?.selector})})),r},rF=(e,t)=>{const n=nF(e,t);let r="";return n.forEach((({presets:t,custom:n,selector:o})=>{const i=function(e={},t){return Ay.reduce(((n,{path:r,valueKey:o,valueFunc:i,cssVarInfix:s})=>{const a=Lf(e,r,[]);return["default","theme","custom"].forEach((e=>{a[e]&&a[e].forEach((e=>{o&&!i?n.push(`--wp--preset--${s}--${KL(e.slug)}: ${e[o]}`):i&&"function"==typeof i&&n.push(`--wp--preset--${s}--${KL(e.slug)}: ${i(e,t)}`)}))})),n}),[])}(t,e?.settings),s=JL(n,"--wp--custom--","--");s.length>0&&i.push(...s),i.length>0&&(r+=`${o}{${i.join(";")};}`)})),r},oF=(e,t,n,r,o=!1,i=!1,s=void 0)=>{const a={blockGap:!0,blockStyles:!0,layoutStyles:!0,marginReset:!0,presets:!0,rootPadding:!0,...s},l=((e,t)=>{var n;const r=[];if(!e?.styles)return r;const o=tF(e.styles);return o&&r.push({styles:o,selector:Cy}),Object.entries(dc).forEach((([t,n])=>{e.styles?.elements?.[t]&&r.push({styles:e.styles?.elements?.[t],selector:n})})),Object.entries(null!==(n=e.styles?.blocks)&&void 0!==n?n:{}).forEach((([e,n])=>{var o;const i=tF(n);if(n?.variations){const o={};Object.entries(n.variations).forEach((([n,i])=>{var s,a;o[n]=tF(i);const l=t[e].styleVariationSelectors?.[n];Object.entries(null!==(s=i?.elements)&&void 0!==s?s:{}).forEach((([e,t])=>{t&&dc[e]&&r.push({styles:t,selector:By(l,dc[e])})})),Object.entries(null!==(a=i?.blocks)&&void 0!==a?a:{}).forEach((([e,n])=>{var o;const i=By(l,t[e].selector),s=By(l,t[e].duotoneSelector),a=function(e,t){if(!e||!t)return;const n={};return Object.entries(t).forEach((([t,r])=>{"string"==typeof r&&(n[t]=By(e,r)),"object"==typeof r&&(n[t]={},Object.entries(r).forEach((([r,o])=>{n[t][r]=By(e,o)})))})),n}(l,t[e].featureSelectors);r.push({selector:i,duotoneSelector:s,featureSelectors:a,fallbackGapValue:t[e].fallbackGapValue,hasLayoutSupport:t[e].hasLayoutSupport,styles:tF(n)}),Object.entries(null!==(o=n.elements)&&void 0!==o?o:{}).forEach((([e,t])=>{t&&dc[e]&&r.push({styles:t,selector:By(i,dc[e])})}))}))})),i.variations=o}t?.[e]?.selector&&r.push({duotoneSelector:t[e].duotoneSelector,fallbackGapValue:t[e].fallbackGapValue,hasLayoutSupport:t[e].hasLayoutSupport,selector:t[e].selector,styles:i,featureSelectors:t[e].featureSelectors,styleVariationSelectors:t[e].styleVariationSelectors}),Object.entries(null!==(o=n?.elements)&&void 0!==o?o:{}).forEach((([n,o])=>{o&&t?.[e]&&dc[n]&&r.push({styles:o,selector:t[e]?.selector.split(",").map((e=>dc[n].split(",").map((t=>e+" "+t)))).join(",")})}))})),r})(e,t),c=nF(e,t),u=e?.settings?.useRootPaddingAwareAlignments,{contentSize:d,wideSize:h}=e?.settings?.layout||{},p=a.marginReset||a.rootPadding||a.layoutStyles;let f="";if(a.presets&&(d||h)&&(f+=`${Sy} {`,f=d?f+` --wp--style--global--content-size: ${d};`:f,f=h?f+` --wp--style--global--wide-size: ${h};`:f,f+="}"),p&&(f+=":where(body) {margin: 0;",a.rootPadding&&u&&(f+="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(.has-global-padding:not(.wp-block-block, .alignfull, .alignwide)) { padding-right: 0; padding-left: 0; }\n\t\t\t\t.has-global-padding :where(.has-global-padding:not(.wp-block-block, .alignfull, .alignwide)) > .alignfull { margin-left: 0; margin-right: 0;\n\t\t\t\t"),f+="}"),a.blockStyles&&l.forEach((({selector:t,duotoneSelector:s,styles:a,fallbackGapValue:l,hasLayoutSupport:c,featureSelectors:d,styleVariationSelectors:h})=>{if(d){const e=XL(d,a);Object.entries(e).forEach((([e,t])=>{if(t.length){const n=t.join(";");f+=`:root :where(${e}){${n};}`}}))}if(s){const e={};a?.filter&&(e.filter=a.filter,delete a.filter);const t=ZL(e);t.length&&(f+=`${s}{${t.join(";")};}`)}o||Cy!==t&&!c||(f+=QL({style:a,selector:t,hasBlockGapSupport:n,hasFallbackGapSupport:r,fallbackGapValue:l}));const p=ZL(a,t,u,e,i);p?.length&&(f+=`:root :where(${t}){${p.join(";")};}`),h&&Object.entries(h).forEach((([t,n])=>{const r=a?.variations?.[t];if(r){if(d){const e=XL(d,r);Object.entries(e).forEach((([e,t])=>{if(t.length){const r=function(e,t){const n=e.split(","),r=[];return n.forEach((e=>{r.push(`${t.trim()}${e.trim()}`)})),r.join(", ")}(e,n),o=t.join(";");f+=`:root :where(${r}){${o};}`}}))}const t=ZL(r,n,u,e);t.length&&(f+=`:root :where(${n}){${t.join(";")};}`)}}));const m=Object.entries(a).filter((([e])=>e.startsWith(":")));m?.length&&m.forEach((([e,n])=>{const r=ZL(n);if(!r?.length)return;const o=`${t.split(",").map((t=>t+e)).join(",")}{${r.join(";")};}`;f+=o}))})),a.layoutStyles&&(f+=".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",f+=".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",f+=".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }"),a.blockGap&&n){const t=dw(e?.styles?.spacing?.blockGap)||"0.5em";f+=`:root :where(.wp-site-blocks) > * { margin-block-start: ${t}; margin-block-end: 0; }`,f+=":root :where(.wp-site-blocks) > :first-child { margin-block-start: 0; }",f+=":root :where(.wp-site-blocks) > :last-child { margin-block-end: 0; }"}return a.presets&&c.forEach((({selector:e,presets:t})=>{Cy!==e&&Sy!==e||(e="");const n=function(e="*",t={}){return Ay.reduce(((n,{path:r,cssVarInfix:o,classes:i})=>{if(!i)return n;const s=Lf(t,r,[]);return["default","theme","custom"].forEach((t=>{s[t]&&s[t].forEach((({slug:t})=>{i.forEach((({classSuffix:r,propertyName:i})=>{const s=`.has-${KL(t)}-${r}`,a=e.split(",").map((e=>`${e}${s}`)).join(","),l=`var(--wp--preset--${o}--${KL(t)})`;n+=`${a}{${i}: ${l} !important;}`}))}))})),n}),"")}(e,t);n.length>0&&(f+=n)})),f};const iF=(e,t,n)=>{const r={};return e.forEach((e=>{const o=e.name,i=yL(e);let s=yL(e,"filter.duotone");if(!s){const t=yL(e),n=Ec(e,"color.__experimentalDuotone",!1);s=n&&By(t,n)}const a=!!e?.supports?.layout||!!e?.supports?.__experimentalLayout,l=e?.supports?.spacing?.blockGap?.__experimentalDefault,c=t(o),u={};c?.forEach((e=>{const t=n?`-${n}`:"",r=`${e.name}${t}`,o=function(e,t){const n=`.is-style-${e}`;if(!t)return n;const r=/((?::\([^)]+\))?\s*)([^\s:]+)/,o=(e,t,r)=>t+r+n;return t.split(",").map((e=>e.replace(r,o))).join(",")}(r,i);u[r]=o}));const d=((e,t)=>{if(e?.selectors&&Object.keys(e.selectors).length>0)return e.selectors;const n={root:t};return Object.entries(qL).forEach((([t,r])=>{const o=yL(e,t);o&&(n[r]=o)})),n})(e,i);r[o]={duotoneSelector:s,fallbackGapValue:l,featureSelectors:Object.keys(d).length?d:void 0,hasLayoutSupport:a,name:o,selector:i,styleVariationSelectors:c?.length?u:void 0}})),r};function sF(e,t){let n="";return e.split("&").forEach((e=>{if(e.includes("{")){const r=e.replace("}","").split("{");if(2!==r.length)return;const[o,i]=r,s=o.startsWith(" ")?By(t,o):function(e,t){return e.includes(",")?e.split(",").map((e=>e+t)).join(","):e+t}(t,o);n+=`:root :where(${s}){${i.trim()}}`}else n+=`:root :where(${t}){${e.trim()}}`})),n}function aF(e={},t){const[n]=Oy("spacing.blockGap");var r,o;r=e,o=e?._links?.["wp:theme-file"],e=r?.styles&&o?(o.forEach((({name:e,href:t,target:n})=>{Lf(r,n)===e&&(r=function(e,t,n){const r=(t=t.split(".")).pop();let o=e;for(const e of t)o=o[e];return o[r]=n,e}(r,n,t))})),r):r;const i=null!==n,s=!i,a=(0,Ul.A)((e=>{const{getSettings:t}=e(dy);return!!t().disableLayoutStyles})),{getBlockStyles:l}=(0,Ul.A)(ed);return(0,k.useMemo)((()=>{var n;if(!e?.styles||!e?.settings)return[];const r=(p=e,p.styles?.blocks?.["core/separator"]&&p.styles?.blocks?.["core/separator"].color?.background&&!p.styles?.blocks?.["core/separator"].color?.text&&!p.styles?.blocks?.["core/separator"].border?.color?{...p,styles:{...p.styles,blocks:{...p.styles.blocks,"core/separator":{...p.styles.blocks["core/separator"],color:{...p.styles.blocks["core/separator"].color,text:p.styles?.blocks["core/separator"].color.background}}}}}:p),o=iF(Ac(),l),c=rF(r,o),u=oF(r,o,i,s,a,t),d=function(e,t){return nF(e,t).flatMap((({presets:e})=>function(e={}){return Ay.filter((e=>"duotone"===e.path.at(-1))).flatMap((t=>{const n=Lf(e,t.path,{});return["default","theme"].filter((e=>n[e])).flatMap((e=>n[e].map((e=>vL(`wp-duotone-${e.slug}`,e.colors))))).join("")}))}(e)))}(r,o),h=[{css:c,isGlobalStyles:!0},{css:u,isGlobalStyles:!0},{css:null!==(n=r.styles.css)&&void 0!==n?n:"",isGlobalStyles:!0},{assets:d,__unstableType:"svg",isGlobalStyles:!0}];var p;return Ac().forEach((e=>{if(r.styles.blocks[e.name]?.css){const t=o[e.name].selector;h.push({css:sF(r.styles.blocks[e.name]?.css,t),isGlobalStyles:!0})}})),[h,r.settings]}),[i,s,e,a,t,l])}function lF(e=!1){const{merged:t}=(0,k.useContext)(Ny);return aF(t,e)}const cF={hasSupport:()=>!0,attributeKeys:["className"],useBlockProps:function({name:e,className:t,clientId:n}){const{getBlockStyles:r}=(0,Ul.A)(ed),o=function(e,t=[]){const n=e?.match(/\bis-style-(?!default)(\S+)\b/g);if(!n)return null;for(const e of n){const n=e.substring(9);if(t.some((e=>e.name===n)))return n}return null}(t,r(e)),i=`is-style-${o}-${n}`,{settings:s,styles:a}=function(e,t,n){const{merged:r}=(0,k.useContext)(Ny),{globalSettings:o,globalStyles:i}=(0,Ul.A)((e=>{const t=e(dy).getSettings();return{globalSettings:t.__experimentalFeatures,globalStyles:t[yf]}}),[]);return(0,k.useMemo)((()=>{var s,a;const l=null!==(s=r?.styles)&&void 0!==s?s:i,c=l?.blocks?.[e]?.variations?.[t];return{settings:null!==(a=r?.settings)&&void 0!==a?a:o,styles:{blocks:{[e]:{variations:{[`${t}-${n}`]:c}}}}}}),[r,o,i,t,n,e])}(e,o,n),l=(0,k.useMemo)((()=>{if(!o)return;const e={settings:s,styles:a},t=iF(Ac(),r,n);return oF(e,t,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1})}),[o,s,a,r,n]);return Ky({id:`variation-${n}`,css:l,__unstableType:"variation",clientId:n}),o?{className:i}:{}}};var uF=n(99252),dF=n(48194);const hF="layout",{kebabCase:pF}=kf(u_.j);function fF(e){return Ic(e,"layout")||Ic(e,"__experimentalLayout")}function mF(e={},t=""){const{layout:n}=e,{default:r}=Ec(t,hF)||{},o=n?.inherit||n?.contentSize||n?.wideSize?{...n,type:"constrained"}:n||r||{},i=[];if(Hx[o?.type||"default"]?.className){const e=Hx[o?.type||"default"]?.className,n=t.split("/"),r=`wp-block-${"core"===n[0]?n.pop():n.join("-")}-${e}`;i.push(e,r)}return(0,Ul.A)((e=>(o?.inherit||o?.contentSize||"constrained"===o?.type)&&e(dy).getSettings().__experimentalFeatures?.useRootPaddingAwareAlignments),[o?.contentSize,o?.inherit,o?.type])&&i.push("has-global-padding"),o?.orientation&&i.push(`is-${pF(o.orientation)}`),o?.justifyContent&&i.push(`is-content-justification-${pF(o.justifyContent)}`),o?.flexWrap&&"nowrap"===o.flexWrap&&i.push("is-nowrap"),i}const gF={shareWithChildBlocks:!0,edit:function({layout:e,setAttributes:t,name:n,clientId:r}){const o=Yy(n),{layout:i}=o,{themeSupportsLayout:s}=(0,Ul.A)((e=>{const{getSettings:t}=e(dy);return{themeSupportsLayout:t().supportsLayout}}),[]);if("default"!==ES())return null;const a=Ec(n,hF,{}),l={...i,...a},{allowSwitching:c,allowEditing:u=!0,allowInheriting:d=!0,default:h}=l;if(!u)return null;const p={...a,...e},{type:f,default:{type:m="default"}={}}=p,g=f||m,b=!(!d||g&&"default"!==g&&"constrained"!==g&&!p.inherit),v=e||h||{},{inherit:y=!1,contentSize:_=null}=v;if(("default"===g||"constrained"===g)&&!s)return null;const x=dS(g),w=dS("constrained"),k=!v.type&&(_||y),C=!!y||!!_,S=e=>t({layout:e});return(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsx)(EA,{children:(0,jd.jsxs)(uF.Ay,{title:(0,H.__)("Layout"),children:[b&&(0,jd.jsx)(jd.Fragment,{children:(0,jd.jsx)(Vx.A,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__toggle-control",label:(0,H.__)("Inner blocks use content width"),checked:"constrained"===x?.name||C,onChange:()=>t({layout:{type:"constrained"===x?.name||C?"default":"constrained"}}),help:"constrained"===x?.name||C?(0,H.__)("Nested blocks use content width with options for full and wide widths."):(0,H.__)("Nested blocks will fill the width of this container. Toggle to constrain.")})}),!y&&c&&(0,jd.jsx)(bF,{type:g,onChange:e=>t({layout:{type:e}})}),x&&"default"!==x.name&&(0,jd.jsx)(x.inspectorControls,{layout:v,onChange:S,layoutBlockSupport:l,name:n,clientId:r}),w&&k&&(0,jd.jsx)(w.inspectorControls,{layout:v,onChange:S,layoutBlockSupport:l,name:n,clientId:r})]})}),!y&&x&&(0,jd.jsx)(x.toolBarControls,{layout:v,onChange:S,layoutBlockSupport:a,name:n,clientId:r})]})},attributeKeys:["layout"],hasSupport:e=>fF(e)};function bF({type:e,onChange:t}){return(0,jd.jsx)(dF.A,{children:uS.map((({name:n,label:r})=>(0,jd.jsx)(Xy.Ay,{isPressed:e===n,onClick:()=>t(n),children:r},n)))})}function vF({block:e,props:t,blockGapSupport:n,layoutClasses:r}){const{name:o,attributes:i}=t,s=(0,F_.A)(e),{layout:a}=i,{default:l}=Ec(o,hF)||{},c=a?.inherit||a?.contentSize||a?.wideSize?{...a,type:"constrained"}:a||l||{},u=`wp-container-${pF(o)}-is-layout-`,d=`.${u}${s}`,h=null!==n,p=dS(c?.type||"default"),f=p?.getLayoutStyle?.({blockName:o,selector:d,layout:c,style:i?.style,hasBlockGapSupport:h}),m=(0,Hy.A)({[`${u}${s}`]:!!f},r);return Ky({css:f}),(0,jd.jsx)(e,{...t,__unstableLayoutClassNames:m})}const yF=(0,Hp.f)((e=>t=>{const{clientId:n,name:r,attributes:o}=t,i=fF(r),s=mF(o,r),a=(0,Ul.A)((e=>{if(!i)return;const{getSettings:t,getBlockSettings:r}=kf(e(dy)),{disableLayoutStyles:o}=t();if(o)return;const[s]=r(n,"spacing.blockGap");return{blockGapSupport:s}}),[i,n]);return a?(0,jd.jsx)(vF,{block:e,props:t,layoutClasses:s,...a}):(0,jd.jsx)(e,{...t,__unstableLayoutClassNames:i?s:void 0})}),"withLayoutStyles");(0,Tu.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.layout)&&void 0!==t?t:{})||fF(e)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,Tu.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",yF);var _F=n(54652),xF=n(24094);const wF=()=>{},kF="bottom",CF="corner";const SF=(0,$_.default)("div",{target:"e1wq7y4k3"})({name:"1cd7zoc",styles:"bottom:0;box-sizing:border-box;left:0;pointer-events:none;position:absolute;right:0;top:0"}),AF=(0,$_.default)("div",{target:"e1wq7y4k2"})({name:"ajymcs",styles:"align-items:center;box-sizing:border-box;display:inline-flex;justify-content:center;opacity:0;pointer-events:none;transition:opacity 120ms linear"}),EF=(0,$_.default)("div",{target:"e1wq7y4k1"})("background:",G_.l.theme.foreground,";border-radius:2px;box-sizing:border-box;font-family:",(0,IA.g)("default.fontFamily"),";font-size:12px;color:",G_.l.theme.foregroundInverted,";padding:4px 8px;position:relative;"),IF=(0,$_.default)(PT.A,{target:"e1wq7y4k0"})("&&&{color:",G_.l.theme.foregroundInverted,";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}"),jF=(0,k.forwardRef)((function({label:e,position:t=CF,zIndex:n=1e3,...r},o){const i=!!e,s=t===CF;if(!i)return null;let a={opacity:i?1:void 0,zIndex:n},l={};return t===kF&&(a={...a,position:"absolute",bottom:-10,left:"50%",transform:"translate(-50%, 0)"},l={transform:"translate(0, 100%)"}),s&&(a={...a,position:"absolute",top:4,right:(0,H.isRTL)()?void 0:4,left:(0,H.isRTL)()?4:void 0}),(0,jd.jsx)(AF,{"aria-hidden":"true",className:"components-resizable-tooltip__tooltip-wrapper",ref:o,style:a,...r,children:(0,jd.jsx)(EF,{className:"components-resizable-tooltip__tooltip",style:l,children:(0,jd.jsx)(IF,{as:"span",children:e})})})})),TF=jF,BF=()=>{},RF=(0,k.forwardRef)((function({axis:e,className:t,fadeTimeout:n=180,isVisible:r=!0,labelRef:o,onResize:i=BF,position:s=kF,showPx:a=!0,zIndex:l=1e3,...c},u){const{label:d,resizeListener:h}=function({axis:e,fadeTimeout:t=180,onResize:n=wF,position:r=kF,showPx:o=!1}){const[i,s]=(0,xF.A)(),a=!!e,[l,c]=(0,k.useState)(!1),[u,d]=(0,k.useState)(!1),{width:h,height:p}=s,f=(0,k.useRef)(p),m=(0,k.useRef)(h),g=(0,k.useRef)(),b=(0,k.useCallback)((()=>{g.current&&window.clearTimeout(g.current),g.current=window.setTimeout((()=>{a||(c(!1),d(!1))}),t)}),[t,a]);(0,k.useEffect)((()=>{if(null===h&&null===p)return;const e=h!==m.current,t=p!==f.current;if(e||t){if(h&&!m.current&&p&&!f.current)return m.current=h,void(f.current=p);e&&(c(!0),m.current=h),t&&(d(!0),f.current=p),n({width:h,height:p}),b()}}),[h,p,n,b]);const v=function({axis:e,height:t,moveX:n=!1,moveY:r=!1,position:o=kF,showPx:i=!1,width:s}){if(!n&&!r)return;if(o===CF)return`${s} x ${t}`;const a=i?" px":"";if(e){if("x"===e&&n)return`${s}${a}`;if("y"===e&&r)return`${t}${a}`}return n&&r?`${s} x ${t}`:n?`${s}${a}`:r?`${t}${a}`:void 0}({axis:e,height:p,moveX:l,moveY:u,position:r,showPx:o,width:h});return{label:v,resizeListener:i}}({axis:e,fadeTimeout:n,onResize:i,showPx:a,position:s});if(!r)return null;const p=(0,Hy.A)("components-resize-tooltip",t);return(0,jd.jsxs)(SF,{"aria-hidden":"true",className:p,ref:u,...c,children:[h,(0,jd.jsx)(TF,{"aria-hidden":c["aria-hidden"],label:d,position:s,ref:o,zIndex:l})]})})),NF=RF,DF="components-resizable-box__handle",MF="components-resizable-box__side-handle",PF="components-resizable-box__corner-handle",OF={top:(0,Hy.A)(DF,MF,"components-resizable-box__handle-top"),right:(0,Hy.A)(DF,MF,"components-resizable-box__handle-right"),bottom:(0,Hy.A)(DF,MF,"components-resizable-box__handle-bottom"),left:(0,Hy.A)(DF,MF,"components-resizable-box__handle-left"),topLeft:(0,Hy.A)(DF,PF,"components-resizable-box__handle-top","components-resizable-box__handle-left"),topRight:(0,Hy.A)(DF,PF,"components-resizable-box__handle-top","components-resizable-box__handle-right"),bottomRight:(0,Hy.A)(DF,PF,"components-resizable-box__handle-bottom","components-resizable-box__handle-right"),bottomLeft:(0,Hy.A)(DF,PF,"components-resizable-box__handle-bottom","components-resizable-box__handle-left")},LF={width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0},FF={top:LF,right:LF,bottom:LF,left:LF,topLeft:LF,topRight:LF,bottomRight:LF,bottomLeft:LF},zF=(0,k.forwardRef)((function({className:e,children:t,showHandle:n=!0,__experimentalShowTooltip:r=!1,__experimentalTooltipProps:o={},...i},s){return(0,jd.jsxs)(_F.Resizable,{className:(0,Hy.A)("components-resizable-box__container",n&&"has-show-handle",e),handleClasses:OF,handleStyles:FF,ref:s,...i,children:[t,r&&(0,jd.jsx)(NF,{...o})]})})),UF=zF;function VF({clientId:e,bounds:t,onChange:n}){const r=GC(e),o=r?.parentElement;return r&&o?(0,jd.jsx)(HF,{clientId:e,bounds:t,blockElement:r,rootBlockElement:o,onChange:n}):null}function HF({clientId:e,bounds:t,blockElement:n,rootBlockElement:r,onChange:o}){const[i,s]=(0,k.useState)(null),[a,l]=(0,k.useState)({top:!1,bottom:!1,left:!1,right:!1});(0,k.useEffect)((()=>{const e=new window.ResizeObserver((()=>{const e=n.getBoundingClientRect(),t=r.getBoundingClientRect();l({top:e.top>t.top,bottom:e.bottomt.left,right:e.righte.disconnect()}),[n,r]);const c={right:"flex-start",left:"flex-end"},u={top:"flex-end",bottom:"flex-start"},d={display:"flex",justifyContent:"center",alignItems:"center",...c[i]&&{justifyContent:c[i]},...u[i]&&{alignItems:u[i]}};return(0,jd.jsx)(QC,{className:"block-editor-grid-item-resizer",clientId:e,__unstablePopoverSlot:"block-toolbar",additionalStyles:d,children:(0,jd.jsx)(UF,{className:"block-editor-grid-item-resizer__box",size:{width:"100%",height:"100%"},enable:{bottom:a.bottom,bottomLeft:!1,bottomRight:!1,left:a.left,right:a.right,top:a.top,topLeft:!1,topRight:!1},bounds:t,boundsByDirection:!0,onResizeStart:(e,t)=>{s(t),n.ownerDocument.addEventListener("mouseup",(()=>{e.target.dispatchEvent(new Event("mouseup",{bubbles:!0}))}),{once:!0})},onResizeStop:(e,t,i)=>{const s=parseFloat(eS(r,"column-gap")),a=parseFloat(eS(r,"row-gap")),l=$F(eS(r,"grid-template-columns"),s),c=$F(eS(r,"grid-template-rows"),a),u=new window.DOMRect(n.offsetLeft+i.offsetLeft,n.offsetTop+i.offsetTop,i.offsetWidth,i.offsetHeight),d=WF(l,u.left)+1,h=WF(c,u.top)+1,p=WF(l,u.right,"end")+1,f=WF(c,u.bottom,"end")+1;o({columnSpan:p-d+1,rowSpan:f-h+1})}})})}function $F(e,t){const n=[];for(const r of e.split(" ")){const e=n[n.length-1],o=e?e.end+t:0,i=o+parseFloat(r);n.push({start:o,end:i})}return n}function WF(e,t,n="start"){return e.reduce(((r,o,i)=>Math.abs(o[n]-t)!e(dy).getSettings().disableLayoutStyles)),o=null!==(n=t?.layout)&&void 0!==n?n:{},{selfStretch:i,flexSize:s,columnStart:a,rowStart:l,columnSpan:c,rowSpan:u}=o,d=mS()||{},{columnCount:h,minimumColumnWidth:p}=d,f=(0,F_.A)(e),m=`.wp-container-content-${f}`;let g="";if(r){if("fixed"===i&&s?g=`${m} {\n\t\t\t\tflex-basis: ${s};\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`:"fill"===i?g=`${m} {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`:a&&c?g=`${m} {\n\t\t\t\tgrid-column: ${a} / span ${c};\n\t\t\t}`:a?g=`${m} {\n\t\t\t\tgrid-column: ${a};\n\t\t\t}`:c&&(g=`${m} {\n\t\t\t\tgrid-column: span ${c};\n\t\t\t}`),(c||a)&&(p||!h)){const e=c?parseInt(c):null,t=a?parseInt(a):null,n=Math.max(e,t);let r=parseFloat(p);isNaN(r)&&(r=12);let o=p?.replace(r,"");["px","rem","em"].includes(o)||(o="rem"),g+=`@container (max-width: ${n*r+(n-1)*("px"===o?24:1.5)}${o}) {\n\t\t\t\t${m} {\n\t\t\t\t\tgrid-column: ${c?"1/-1":"auto"};\n\t\t\t\t}\n\t\t\t}`}l&&u?g+=`${m} {\n\t\t\t\tgrid-row: ${l} / span ${u};\n\t\t\t}`:l?g+=`${m} {\n\t\t\t\tgrid-row: ${l};\n\t\t\t}`:u&&(g+=`${m} {\n\t\t\t\tgrid-row: span ${u};\n\t\t\t}`)}if(Ky({css:g}),g)return{className:`wp-container-content-${f}`}},edit:function({clientId:e,style:t,setAttributes:n}){const{type:r="default",allowSizingOnChildren:o=!1}=mS()||{},i=(0,Ul.A)((t=>t(dy).getBlockRootClientId(e)),[e]),[s,a]=(0,k.useState)();return"grid"!==r?null:(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsx)(tS,{clientId:i,contentRef:a}),o&&(0,jd.jsx)(VF,{clientId:e,bounds:s,onChange:({columnSpan:e,rowSpan:r})=>{n({style:{...t,layout:{...t?.layout,columnSpan:e,rowSpan:r}}})}})]})},attributeKeys:["style"],hasSupport:()=>!0};function qF(e){return(0,Ul.A)((t=>{const{getBlocksByClientId:n,getSelectedBlockClientIds:r,isUngroupable:o,isGroupable:i}=t(dy),{getGroupingBlockName:s,getBlockType:a}=t(ed),l=e?.length?e:r(),c=n(l),[u]=c,d=1===l.length&&o(l[0]);return{clientIds:l,isGroupable:i(l),isUngroupable:d,blocksSelection:c,groupingBlockName:s(),onUngroup:d&&a(u.name)?.transforms?.ungroup}}),[e])}function KF({clientIds:e,isGroupable:t,isUngroupable:n,onUngroup:r,blocksSelection:o,groupingBlockName:i,onClose:s=(()=>{})}){const{getSelectedBlockClientIds:a}=(0,Ul.A)(dy),{replaceBlocks:l}=(0,Vl.A)(dy);if(!t&&!n)return null;const c=a();return(0,jd.jsxs)(jd.Fragment,{children:[t&&(0,jd.jsx)(w_.A,{shortcut:c.length>1?VE.displayShortcut.primary("g"):void 0,onClick:()=>{(()=>{const t=dd(o,i);t&&l(e,t)})(),s()},children:(0,H._x)("Group","verb")}),n&&(0,jd.jsx)(w_.A,{onClick:()=>{(()=>{let t=o[0].innerBlocks;t.length&&(r&&(t=r(o[0].attributes,o[0].innerBlocks)),l(e,t))})(),s()},children:(0,H._x)("Ungroup","Ungrouping blocks from within a grouping block back into individual blocks within the Editor ")})]})}function YF(e){return(0,Ul.A)((t=>{const{canEditBlock:n,canMoveBlock:r,canRemoveBlock:o,canLockBlockType:i,getBlockName:s,getBlockRootClientId:a,getTemplateLock:l}=t(dy),c=a(e),u=n(e),d=r(e,c),h=o(e,c);return{canEdit:u,canMove:d,canRemove:h,canLock:i(s(e)),isContentLocked:"contentOnly"===l(e),isLocked:!u||!d||!h}}),[e])}var JF=n(23690),XF=n(51994),ZF=n(98968),QF=n(54441);const ez=["core/block","core/navigation"];function tz(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function nz({clientId:e,onClose:t}){const[n,r]=(0,k.useState)({move:!1,remove:!1}),{canEdit:o,canMove:i,canRemove:s}=YF(e),{allowsEditLocking:a,templateLock:l,hasTemplateLock:c}=(0,Ul.A)((t=>{const{getBlockName:n,getBlockAttributes:r}=t(dy),o=n(e),i=Sc(o);return{allowsEditLocking:ez.includes(o),templateLock:r(e)?.templateLock,hasTemplateLock:!!i?.attributes?.templateLock}}),[e]),[u,d]=(0,k.useState)(!!l),{updateBlockAttributes:h}=(0,Vl.A)(dy),p=DL(e),f=(0,F_.A)(nz,"block-editor-block-lock-modal__options-title");(0,k.useEffect)((()=>{r({move:!i,remove:!s,...a?{edit:!o}:{}})}),[o,i,s,a]);const m=Object.values(n).every(Boolean),g=Object.values(n).some(Boolean)&&!m;return(0,jd.jsxs)(ZF.A,{title:(0,H.sprintf)((0,H.__)("Lock %s"),p.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:t,children:[(0,jd.jsx)("p",{children:(0,H.__)("Choose specific attributes to restrict or lock all available options.")}),(0,jd.jsxs)("form",{onSubmit:r=>{r.preventDefault(),h([e],{lock:n,templateLock:u?tz(n):void 0}),t()},children:[(0,jd.jsxs)("div",{role:"group","aria-labelledby":f,className:"block-editor-block-lock-modal__options",children:[(0,jd.jsx)(cj.A,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__options-title",label:(0,jd.jsx)("span",{id:f,children:(0,H.__)("Lock all")}),checked:m,indeterminate:g,onChange:e=>r({move:e,remove:e,...a?{edit:e}:{}})}),(0,jd.jsxs)("ul",{className:"block-editor-block-lock-modal__checklist",children:[a&&(0,jd.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,jd.jsx)(cj.A,{__nextHasNoMarginBottom:!0,label:(0,H.__)("Restrict editing"),checked:!!n.edit,onChange:e=>r((t=>({...t,edit:e})))}),(0,jd.jsx)(zx.A,{className:"block-editor-block-lock-modal__lock-icon",icon:n.edit?QF.A:JF.A})]}),(0,jd.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,jd.jsx)(cj.A,{__nextHasNoMarginBottom:!0,label:(0,H.__)("Disable movement"),checked:n.move,onChange:e=>r((t=>({...t,move:e})))}),(0,jd.jsx)(zx.A,{className:"block-editor-block-lock-modal__lock-icon",icon:n.move?QF.A:JF.A})]}),(0,jd.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,jd.jsx)(cj.A,{__nextHasNoMarginBottom:!0,label:(0,H.__)("Prevent removal"),checked:n.remove,onChange:e=>r((t=>({...t,remove:e})))}),(0,jd.jsx)(zx.A,{className:"block-editor-block-lock-modal__lock-icon",icon:n.remove?QF.A:JF.A})]})]}),c&&(0,jd.jsx)(Vx.A,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__template-lock",label:(0,H.__)("Apply to all blocks inside"),checked:u,disabled:n.move&&!n.remove,onChange:()=>d(!u)})]}),(0,jd.jsxs)(T_.A,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,jd.jsx)(B_.A,{children:(0,jd.jsx)(Xy.Ay,{variant:"tertiary",onClick:t,children:(0,H.__)("Cancel")})}),(0,jd.jsx)(B_.A,{children:(0,jd.jsx)(Xy.Ay,{variant:"primary",type:"submit",children:(0,H.__)("Apply")})})]})]})]})}function rz({clientId:e}){const{canLock:t,isLocked:n}=YF(e),[r,o]=(0,k.useReducer)((e=>!e),!1);if(!t)return null;const i=n?(0,H.__)("Unlock"):(0,H.__)("Lock");return(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsx)(w_.A,{icon:n?JF.A:XF.A,onClick:o,"aria-expanded":r,"aria-haspopup":"dialog",children:i}),r&&(0,jd.jsx)(nz,{clientId:e,onClose:o})]})}const oz=()=>{},iz=(0,D.A)([(0,aI.A)(((e,{clientId:t})=>{const{getBlock:n,getBlockMode:r,getSettings:o}=e(dy),i=n(t),s=o().codeEditingEnabled;return{mode:r(t),blockType:i?Sc(i.name):null,isCodeEditingEnabled:s}})),(0,UE.A)(((e,{onToggle:t=oz,clientId:n})=>({onToggleMode(){e(dy).toggleBlockMode(n),t()}})))])((function({blockType:e,mode:t,onToggleMode:n,small:r=!1,isCodeEditingEnabled:o=!0}){if(!e||!Ic(e,"html",!0)||!o)return null;const i="visual"===t?(0,H.__)("Edit as HTML"):(0,H.__)("Edit visually");return(0,jd.jsx)(w_.A,{onClick:n,children:!r&&i})}));function sz(e){return 0===e?.trim()?.length}function az({blockName:e,originalBlockName:t,onClose:n,onSave:r,hasOverridesWarning:o}){const[i,s]=(0,k.useState)(e),a=(0,k.useId)(),l=i!==e,c=i===t,u=sz(i),d=l||c;return(0,jd.jsx)(ZF.A,{title:(0,H.__)("Rename"),onRequestClose:n,overlayClassName:"block-editor-block-rename-modal",focusOnMount:"firstContentElement",aria:{describedby:a},size:"small",children:(0,jd.jsxs)("form",{onSubmit:e=>{e.preventDefault(),d&&(()=>{const e=c||u?(0,H.sprintf)((0,H.__)('Block name reset to: "%s".'),i):(0,H.sprintf)((0,H.__)('Block name changed to: "%s".'),i);(0,Yb.speak)(e,"assertive"),r(i),n()})()},children:[(0,jd.jsx)("p",{id:a,children:(0,H.__)("Enter a custom name for this block.")}),(0,jd.jsxs)(oE.A,{spacing:"3",children:[(0,jd.jsx)(KE.A,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:i,label:(0,H.__)("Block name"),hideLabelFromVision:!0,help:o?(0,H.__)("This block allows overrides. Changing the name can cause problems with content entered into instances of this pattern."):void 0,placeholder:t,onChange:s,onFocus:e=>e.target.select()}),(0,jd.jsxs)(eA.A,{justify:"right",children:[(0,jd.jsx)(Xy.Ay,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:n,children:(0,H.__)("Cancel")}),(0,jd.jsx)(Xy.Ay,{__next40pxDefaultSize:!0,"aria-disabled":!d,variant:"primary",type:"submit",children:(0,H.__)("Save")})]})]})]})})}function lz({clientId:e}){const[t,n]=(0,k.useState)(!1),{metadata:r}=(0,Ul.A)((t=>{const{getBlockAttributes:n}=t(dy),r=n(e)?.metadata;return{metadata:r}}),[e]),{updateBlockAttributes:o}=(0,Vl.A)(dy),i=r?.name,s=!!i&&!!r?.bindings&&Object.values(r.bindings).some((e=>"core/pattern-overrides"===e.source)),a=DL(e);return(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsx)(w_.A,{onClick:()=>{n(!0)},"aria-expanded":t,"aria-haspopup":"dialog",children:(0,H.__)("Rename")}),t&&(0,jd.jsx)(az,{blockName:i||"",originalBlockName:a?.title,hasOverridesWarning:s,onClose:()=>n(!1),onSave:t=>{(t===a?.title||sz(t))&&(t=void 0),function(t){o([e],{metadata:{...r,name:t}})}(t)}})]})}const{Fill:cz,Slot:uz}=(0,Hl.QJ)("BlockSettingsMenuControls");function dz({...e}){return(0,jd.jsx)(a_.A,{document,children:(0,jd.jsx)(cz,{...e})})}dz.Slot=({fillProps:e,clientIds:t=null})=>{const{selectedBlocks:n,selectedClientIds:r,isContentOnly:o}=(0,Ul.A)((e=>{const{getBlockNamesByClientId:n,getSelectedBlockClientIds:r,getBlockEditingMode:o}=e(dy),i=null!==t?t:r();return{selectedBlocks:n(i),selectedClientIds:i,isContentOnly:"contentOnly"===o(i[0])}}),[t]),{canLock:i}=YF(r[0]),{canRename:s}=function(e){return{canRename:Ec(e,"renaming",!0)}}(n[0]),a=1===r.length&&i&&!o,l=1===r.length&&s&&!o,c=qF(r),{isGroupable:u,isUngroupable:d}=c,h=u||d;return(0,jd.jsx)(uz,{fillProps:{...e,selectedBlocks:n,selectedClientIds:r},children:t=>!t?.length>0&&!h&&!a?null:(0,jd.jsxs)(x_.A,{children:[h&&(0,jd.jsx)(KF,{...c,onClose:e?.onClose}),a&&(0,jd.jsx)(rz,{clientId:r[0]}),l&&(0,jd.jsx)(lz,{clientId:r[0]}),t,e?.canMove&&!e?.onlyBlock&&!o&&(0,jd.jsx)(w_.A,{onClick:(0,Qp.h)(e?.onClose,e?.onMoveTo),children:(0,H.__)("Move to")}),1===e?.count&&!o&&(0,jd.jsx)(iz,{clientId:e?.firstBlockClientId,onToggle:e?.onClose})]})})};const hz=dz,pz={edit:function({clientId:e,isSelected:t}){const{templateLock:n,isLockedByParent:r,isEditingAsBlocks:o}=(0,Ul.A)((t=>{const{getContentLockingParent:n,getTemplateLock:r,getTemporarilyEditingAsBlocks:o}=kf(t(dy));return{templateLock:r(e),isLockedByParent:!!n(e),isEditingAsBlocks:o()===e}}),[e]),{stopEditingAsBlocks:i,modifyContentLockBlock:s}=kf((0,Vl.A)(dy)),a=!r&&"contentOnly"===n,l=(0,k.useCallback)((()=>{i(e)}),[e,i]);if(!a&&!o)return null;const c=o&&!a,u=!o&&a&&t;return(0,jd.jsxs)(jd.Fragment,{children:[c&&(0,jd.jsx)(jd.Fragment,{children:(0,jd.jsx)(y_,{group:"other",children:(0,jd.jsx)(n_,{onClick:l,children:(0,H.__)("Done")})})}),u&&(0,jd.jsx)(hz,{children:({selectedClientIds:t,onClose:n})=>1===t.length&&t[0]===e&&(0,jd.jsx)(w_.A,{onClick:()=>{s(e),n()},children:(0,H.__)("Modify")})})]})},hasSupport:()=>!0},fz="metadata";(0,Tu.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",(function(e){return e?.attributes?.[fz]?.type||(e.attributes={...e.attributes,[fz]:{type:"object"}}),e}));var mz=n(3445);const gz=(0,k.memo)((function({icon:e,showColors:t=!1,className:n,context:r}){"block-default"===e?.src&&(e={src:mz.A});const o=(0,jd.jsx)(zx.A,{icon:e&&e.src?e.src:e,context:r}),i=t?{backgroundColor:e&&e.background,color:e&&e.foreground}:{};return(0,jd.jsx)("span",{style:i,className:(0,Hy.A)("block-editor-block-icon",n,{"has-colors":t}),children:o})})),bz={},vz={edit:function({name:e,clientId:t,metadata:{ignoredHookedBlocks:n=[]}={}}){const r=(0,Ul.A)((e=>e(ed).getBlockTypes()),[]),o=(0,k.useMemo)((()=>r?.filter((({name:t,blockHooks:r})=>r&&e in r||n.includes(t)))),[r,e,n]),{blockIndex:i,rootClientId:s,innerBlocksLength:a}=(0,Ul.A)((e=>{const{getBlocks:n,getBlockIndex:r,getBlockRootClientId:o}=e(dy);return{blockIndex:r(t),innerBlocksLength:n(t)?.length,rootClientId:o(t)}}),[t]),l=(0,Ul.A)((n=>{const{getBlocks:r,getGlobalBlockCount:i}=n(dy),a=o.reduce(((n,o)=>{if(0===i(o.name))return n;const a=o?.blockHooks?.[e];let l;switch(a){case"before":case"after":l=r(s);break;case"first_child":case"last_child":l=r(t);break;case void 0:l=[...r(s),...r(t)]}const c=l?.find((e=>e.name===o.name));return c?{...n,[o.name]:c.clientId}:n}),{});return Object.values(a).length>0?a:bz}),[o,e,t,s]),{insertBlock:c,removeBlock:u}=(0,Vl.A)(dy);if(!o.length)return null;const d=o.reduce(((e,t)=>{const[n]=t.name.split("/");return e[n]||(e[n]=[]),e[n].push(t),e}),{});return(0,jd.jsx)(EA,{children:(0,jd.jsxs)(uF.Ay,{className:"block-editor-hooks__block-hooks",title:(0,H.__)("Plugins"),initialOpen:!0,children:[(0,jd.jsx)("p",{className:"block-editor-hooks__block-hooks-helptext",children:(0,H.__)("Manage the inclusion of blocks added automatically by plugins.")}),Object.keys(d).map((n=>(0,jd.jsxs)(k.Fragment,{children:[(0,jd.jsx)("h3",{children:n}),d[n].map((n=>{const r=n.name in l;return(0,jd.jsx)(Vx.A,{checked:r,label:(0,jd.jsxs)(eA.A,{justify:"flex-start",children:[(0,jd.jsx)(gz,{icon:n.icon}),(0,jd.jsx)("span",{children:n.title})]}),onChange:()=>{if(r)u(l[n.name],!1);else{const r=n.blockHooks[e];((e,n)=>{switch(n){case"before":case"after":c(e,"after"===n?i+1:i,s,!1);break;case"first_child":case"last_child":c(e,"first_child"===n?0:a,t,!1);break;case void 0:c(e,i+1,s,!1)}})(td(n.name),r)}}},n.title)}))]},n)))]})})},attributeKeys:["metadata"],hasSupport:()=>!0},yz=(0,U_.KZ)((function(e,t){const{role:n,wrapperClassName:r,...o}=function(e){const{as:t,className:n,onClick:r,role:o="listitem",size:i,...s}=(0,z_.A)(e,"Item"),{spacedAround:a,size:l}=VA(),c=i||l,u=t||(void 0!==r?"button":"div"),d=(0,V_.l)(),h=(0,k.useMemo)((()=>d(("button"===u||"a"===u)&&(e=>(0,W_.css)("font-size:",(0,IA.g)("default.fontSize"),";font-family:inherit;appearance:none;border:1px solid transparent;cursor:pointer;background:none;text-align:start;text-decoration:","a"===e?"none":void 0,";svg,path{fill:currentColor;}&:hover{color:",G_.l.theme.accent,";}&:focus{box-shadow:none;outline:none;}&:focus-visible{box-shadow:0 0 0 var( --wp-admin-border-width-focus ) ",G_.l.theme.accent,";outline:2px solid transparent;outline-offset:0;}",""))(u),zA[c]||zA.medium,TA,a&&DA,n)),[u,n,d,c,a]),p=d(jA);return{as:u,className:h,onClick:r,wrapperClassName:p,role:o,...s}}(e);return(0,jd.jsx)("div",{role:n,className:r,children:(0,jd.jsx)(hx.A,{...o,ref:t})})}),"Item"),_z={"core/paragraph":["content"],"core/heading":["content"],"core/image":["id","url","title","alt"],"core/button":["url","text","linkTarget","rel"]};function xz(e){return e in _z}function wz(e,t){return xz(e)&&_z[e].includes(t)}const kz=(0,Hp.f)((e=>t=>{const n=(0,Vp.A)(),r=(0,Ul.A)((e=>kf(e(ed)).getAllBlockBindingsSources())),{name:o,clientId:i,context:s}=t,a=(0,k.useMemo)((()=>function(e,t){if("core/pattern-overrides"===t?.__default?.source){const n=_z[e],r={};for(const e of n){const n=t[e]?t[e]:{source:"core/pattern-overrides"};r[e]=n}return r}return t}(o,t.attributes.metadata?.bindings)),[t.attributes.metadata?.bindings,o]),l=(0,Ul.A)((()=>{if(!a)return;const e={};for(const[t,l]of Object.entries(a)){const a=r[l.source];if(!a?.getValue||!wz(o,t))continue;const c={registry:n,context:s,clientId:i,attributeName:t,args:l.args};e[t]=a.getValue(c),void 0===e[t]&&(e[t]="url"===t?null:a.getPlaceholder?.(c))}return e}),[a,o,i,s,n,r]),{setAttributes:c}=t,u=(0,k.useCallback)((e=>{n.batch((()=>{if(!a)return void c(e);const t={...e},l=new Map;for(const[e,n]of Object.entries(t)){if(!a[e]||!wz(o,e))continue;const i=a[e],s=r[i?.source];(s?.setValue||s?.setValues)&&(l.set(s,{...l.get(s),[e]:n}),delete t[e])}if(l.size)for(const[e,t]of l)if(e.setValues)e.setValues({registry:n,context:s,clientId:i,attributes:t});else for(const[r,o]of Object.entries(t)){const t=a[r];e.setValue({registry:n,context:s,clientId:i,attributeName:r,args:t.args,value:o})}Object.keys(t).length&&c(t)}))}),[n,a,o,i,s,c,r]);return(0,jd.jsx)(jd.Fragment,{children:(0,jd.jsx)(e,{...t,attributes:{...t.attributes,...l},setAttributes:u})})}),"withBlockBindingSupport");(0,Tu.addFilter)("blocks.registerBlockType","core/editor/custom-sources-backwards-compatibility/shim-attribute-source",(function(e,t){return xz(t)?{...e,edit:kz(e.edit)}:e}));const Cz={edit:({name:e,metadata:t})=>{const{bindings:n}=t||{},{sources:r}=(0,Ul.A)((e=>({sources:kf(e(ed)).getAllBlockBindingsSources()})),[]);if(!n)return null;const o={...n};return Object.keys(o).forEach((t=>{wz(e,t)&&"core/pattern-overrides"!==o[t].source||delete o[t]})),0===Object.keys(o).length?null:(0,jd.jsx)(EA,{children:(0,jd.jsx)(uF.Ay,{title:(0,H.__)("Bindings"),className:"components-panel__block-bindings-panel",children:(0,jd.jsx)(HA,{isBordered:!0,isSeparated:!0,size:"large",children:Object.keys(o).map((e=>(0,jd.jsx)(yz,{children:(0,jd.jsxs)(eA.A,{children:[(0,jd.jsx)("span",{children:e}),(0,jd.jsx)("span",{className:"components-item__block-bindings-source",children:r[o[e].source]?r[o[e].source].label:o[e].source})]})},e)))})})})},attributeKeys:["metadata"],hasSupport:()=>!0};function Sz(e){const t=e.style?.border||{};return{className:lN(e)||void 0,style:XO({border:t})}}function Az(e){const{colors:t}=sT(),n=Sz(e),{borderColor:r}=e;if(r){const e=QR({colors:t,namedColor:r});n.style.borderColor=e.color}return n}function Ez(e){return{style:XO({shadow:e.style?.shadow||""})}}(0,Tu.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||Ic(e,"renaming",!0)&&(e.__experimentalLabel=(e,{context:t})=>{const{metadata:n}=e;if("list-view"===t&&n?.name)return n.name}),e}));const{kebabCase:Iz}=kf(u_.j);var jz;!function(e){e=e.map((e=>({...e,Edit:(0,k.memo)(e.edit)})));const t=(0,Hp.f)((t=>n=>{const r=Zp();return[...e.map(((e,t)=>{const{Edit:o,hasSupport:i,attributeKeys:s=[],shareWithChildBlocks:a}=e;if(!(r[$p]||r[Wp]&&a)||!i(n.name))return null;const l={};for(const e of s)n.attributes[e]&&(l[e]=n.attributes[e]);return(0,jd.jsx)(o,{name:n.name,isSelected:n.isSelected,clientId:n.clientId,setAttributes:n.setAttributes,__unstableParentLayout:n.__unstableParentLayout,...l},t)})),(0,jd.jsx)(t,{...n},"edit")]}),"withBlockEditHooks");(0,Tu.addFilter)("editor.BlockEdit","core/editor/hooks",t)}([Cz,BS,mP,Hj,Gj,oL,NL,GL,gF,pz,vz,GF].filter(Boolean)),function(e){const t=(0,Hp.f)((t=>n=>{const[r,o]=(0,k.useState)(Array(e.length).fill(void 0));return[...e.map(((e,t)=>{const{hasSupport:r,attributeKeys:i=[],useBlockProps:s}=e,a={};for(const e of i)n.attributes[e]&&(a[e]=n.attributes[e]);return Object.keys(a).length&&r(n.name)?(0,jd.jsx)(Jy,{index:t,useBlockProps:s,setAllWrapperProps:o,name:n.name,clientId:n.clientId,...a},t):null})),(0,jd.jsx)(t,{...n,wrapperProps:r.filter(Boolean).reduce(((e,t)=>({...e,...t,className:(0,Hy.A)(e.className,t.className),style:{...e.style,...t.style}})),n.wrapperProps||{})},"edit")]}),"withBlockListBlockHooks");(0,Tu.addFilter)("editor.BlockListBlock","core/editor/hooks",t)}([BS,mP,zj,oL,LD,KO,NL,ZM,oP,cN,GL,cF,GF]),jz=[BS,mP,Hj,Wj,Gj,cN,LD,oL,ZM,oP],(0,Tu.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",(function(e,t,n){return jz.reduce(((e,r)=>{const{hasSupport:o,attributeKeys:i=[],addSaveProps:s}=r,a={};for(const e of i)n[e]&&(a[e]=n[e]);return Object.keys(a).length&&o(t)?s(e,t,a):e}),e)}),0),(0,Tu.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",(e=>(e.hasOwnProperty("className")&&!e.className&&delete e.className,e)));var Tz=n(28998),Bz=n(9899),Rz=n(8686),Nz=n(18861),Dz=n(78008),Mz=n(12367),Pz=n(50114);const Oz={0:Tz.A,1:Bz.A,2:Rz.A,3:Nz.A,4:Dz.A,5:Mz.A,6:Pz.A};function Lz({level:e}){return Oz[e]?(0,jd.jsx)(zx.A,{icon:Oz[e]}):null}const Fz=[1,2,3,4,5,6],zz={className:"block-library-heading-level-dropdown"};function Uz({options:e=Fz,value:t,onChange:n}){return(0,jd.jsx)(__,{popoverProps:zz,icon:(0,jd.jsx)(Lz,{level:t}),label:(0,H.__)("Change level"),controls:e.map((e=>{const r=e===t;return{icon:(0,jd.jsx)(Lz,{level:e}),title:0===e?(0,H.__)("Paragraph"):(0,H.sprintf)((0,H.__)("Heading %d"),e),isActive:r,onClick(){n(e)},role:"menuitemradio"}}))})}const Vz=(0,jd.jsx)(hw.t4,{className:"components-placeholder__illustration",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60",preserveAspectRatio:"none",children:(0,jd.jsx)(hw.wA,{vectorEffect:"non-scaling-stroke",d:"M60 60 0 0"})}),Hz=function(e){const{icon:t,children:n,label:r,instructions:o,className:i,notices:s,preview:a,isColumnLayout:l,withIllustration:c,...u}=e,[d,{width:h}]=(0,xF.A)();let p;"number"==typeof h&&(p={"is-large":h>=480,"is-medium":h>=160&&h<480,"is-small":h<160});const f=(0,Hy.A)("components-placeholder",i,p,c?"has-illustration":null),m=(0,Hy.A)("components-placeholder__fieldset",{"is-column-layout":l});return(0,k.useEffect)((()=>{o&&(0,Yb.speak)(o)}),[o]),(0,jd.jsxs)("div",{...u,className:f,children:[c?Vz:null,d,s,a&&(0,jd.jsx)("div",{className:"components-placeholder__preview",children:a}),(0,jd.jsxs)("div",{className:"components-placeholder__label",children:[(0,jd.jsx)(zx.A,{icon:t}),r]}),!!o&&(0,jd.jsx)("div",{className:"components-placeholder__instructions",children:o}),(0,jd.jsx)("div",{className:m,children:n})]})};var $z=n(82432);const Wz=function({icon:e=$z.A,label:t=(0,H.__)("Choose variation"),instructions:n=(0,H.__)("Select a variation to start with:"),variations:r,onSelect:o,allowSkip:i}){const s=(0,Hy.A)("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,jd.jsxs)(Hz,{icon:e,label:t,instructions:n,className:s,children:[(0,jd.jsx)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,H.__)("Block variations"),children:r.map((e=>(0,jd.jsxs)("li",{children:[(0,jd.jsx)(Xy.Ay,{__next40pxDefaultSize:!0,variant:"tertiary",icon:e.icon&&e.icon.src?e.icon.src:e.icon,iconSize:48,onClick:()=>o(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,jd.jsx)("span",{className:"block-editor-block-variation-picker__variation-label",children:e.title})]},e.name)))}),i&&(0,jd.jsx)("div",{className:"block-editor-block-variation-picker__skip",children:(0,jd.jsx)(Xy.Ay,{variant:"link",onClick:()=>o(),children:(0,H.__)("Skip")})})]})},Gz=(0,Hp.f)((e=>t=>{const[n,r]=py("color.palette","color.custom"),{colors:o=n,disableCustomColors:i=!r}=t,s=o&&o.length>0||!i;return(0,jd.jsx)(e,{...t,colors:o,disableCustomColors:i,hasColorsToChoose:s})}),"withColorContext")(KB);var qz=n(48768);const Kz=100,Yz=300,Jz={placement:"bottom-start"},Xz=(0,k.createContext)({}),Zz=()=>(0,k.useContext)(Xz);function Qz({id:e,url:t,naturalWidth:n,naturalHeight:r,onFinishEditing:o,onSaveImage:i,children:s}){const a=function({url:e,naturalWidth:t,naturalHeight:n}){const[r,o]=(0,k.useState)(),[i,s]=(0,k.useState)(),[a,l]=(0,k.useState)({x:0,y:0}),[c,u]=(0,k.useState)(100),[d,h]=(0,k.useState)(0),p=t/n,[f,m]=(0,k.useState)(p),g=(0,k.useCallback)((()=>{const t=(d+90)%360;let n=p;if(d%180==90&&(n=1/p),0===t)return o(),h(t),m(p),void l((e=>({x:-e.y*n,y:e.x*n})));const r=new window.Image;r.src=e,r.onload=function(e){const r=document.createElement("canvas");let i=0,s=0;t%180?(r.width=e.target.height,r.height=e.target.width):(r.width=e.target.width,r.height=e.target.height),90!==t&&180!==t||(i=r.width),270!==t&&180!==t||(s=r.height);const a=r.getContext("2d");a.translate(i,s),a.rotate(t*Math.PI/180),a.drawImage(e.target,0,0),r.toBlob((e=>{o(URL.createObjectURL(e)),h(t),m(r.width/r.height),l((e=>({x:-e.y*n,y:e.x*n})))}))};const i=(0,Tu.applyFilters)("media.crossOrigin",void 0,e);"string"==typeof i&&(r.crossOrigin=i)}),[d,p,e]);return(0,k.useMemo)((()=>({editedUrl:r,setEditedUrl:o,crop:i,setCrop:s,position:a,setPosition:l,zoom:c,setZoom:u,rotation:d,setRotation:h,rotateClockwise:g,aspect:f,setAspect:m,defaultAspect:p})),[r,i,a,c,d,g,f,p])}({url:t,naturalWidth:n,naturalHeight:r}),l=function({crop:e,rotation:t,url:n,id:r,onSaveImage:o,onFinishEditing:i}){const{createErrorNotice:s}=(0,Vl.A)(Jb.store),[a,l]=(0,k.useState)(!1),c=(0,k.useCallback)((()=>{l(!1),i()}),[i]),u=(0,k.useCallback)((()=>{l(!0);const a=[];t>0&&a.push({type:"rotate",args:{angle:t}}),(e.width<99.9||e.height<99.9)&&a.push({type:"crop",args:{left:e.x,top:e.y,width:e.width,height:e.height}}),(0,S.default)({path:`/wp/v2/media/${r}/edit`,method:"POST",data:{src:n,modifiers:a}}).then((e=>{o({id:e.id,url:e.source_url})})).catch((e=>{s((0,H.sprintf)((0,H.__)("Could not edit image. %s"),(0,ac.A)(e.message)),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{l(!1),i()}))}),[e,t,r,n,o,s,i]);return(0,k.useMemo)((()=>({isInProgress:a,apply:u,cancel:c})),[a,u,c])}({id:e,url:t,onSaveImage:i,onFinishEditing:o,...a}),c=(0,k.useMemo)((()=>({...a,...l})),[a,l]);return(0,jd.jsx)(Xz.Provider,{value:c,children:s})}function eU({aspectRatios:e,isDisabled:t,label:n,onClick:r,value:o}){return(0,jd.jsx)(x_.A,{label:n,children:e.map((({name:e,slug:n,ratio:i})=>(0,jd.jsx)(w_.A,{disabled:t,onClick:()=>{r(i)},role:"menuitemradio",isSelected:i===o,icon:i===o?XS.A:void 0,children:e},n)))})}function tU(e){const[t,n,...r]=e.split("/").map(Number);return t<=0||n<=0||Number.isNaN(t)||Number.isNaN(n)||r.length?NaN:n?t/n:t}function nU({ratio:e,...t}){return{ratio:tU(e),...t}}function rU({toggleProps:e}){const{isInProgress:t,aspect:n,setAspect:r,defaultAspect:o}=Zz(),[i,s,a]=py("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios");return(0,jd.jsx)(o_.A,{icon:qz.A,label:(0,H.__)("Aspect Ratio"),popoverProps:Jz,toggleProps:e,className:"wp-block-image__aspect-ratio",children:({onClose:e})=>(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsx)(eU,{isDisabled:t,onClick:t=>{r(t),e()},value:n,aspectRatios:[{slug:"original",name:(0,H.__)("Original"),aspect:o},...a?i.map(nU).filter((({ratio:e})=>1===e)):[]]}),s?.length>0&&(0,jd.jsx)(eU,{label:(0,H.__)("Theme"),isDisabled:t,onClick:t=>{r(t),e()},value:n,aspectRatios:s}),a&&(0,jd.jsx)(eU,{label:(0,H.__)("Landscape"),isDisabled:t,onClick:t=>{r(t),e()},value:n,aspectRatios:i.map(nU).filter((({ratio:e})=>e>1))}),a&&(0,jd.jsx)(eU,{label:(0,H.__)("Portrait"),isDisabled:t,onClick:t=>{r(t),e()},value:n,aspectRatios:i.map(nU).filter((({ratio:e})=>e<1))})]})})}var oU=n(7728),iU=n(75187),sU=n.n(iU);function aU(e,t,n,r,o){void 0===o&&(o=0);var i=fU(t.width,t.height,o),s=i.width,a=i.height;return{x:lU(e.x,s,n.width,r),y:lU(e.y,a,n.height,r)}}function lU(e,t,n,r){var o=t*r/2-n/2;return mU(e,-o,o)}function cU(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function uU(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function dU(e,t){return Math.min(e,Math.max(0,t))}function hU(e,t){return t}function pU(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function fU(e,t,n){var r=n*Math.PI/180;return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}function mU(e,t,n){return Math.min(Math.max(e,t),n)}function gU(){for(var e=[],t=0;t0})).join(" ").trim()}var bU=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=k.createRef(),n.videoRef=k.createRef(),n.containerPosition={x:0,y:0},n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc="undefined"!=typeof document?document:null,n.currentWindow="undefined"!=typeof window?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},n.initResizeObserver=function(){if(void 0!==window.ResizeObserver&&n.containerRef){var e=!0;n.resizeObserver=new window.ResizeObserver((function(t){e?e=!1:n.computeSizes()})),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd),n.currentDoc.removeEventListener("scroll",n.onScroll))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var e=n.computeSizes();e&&(n.emitCropData(),n.setInitialCrop(e)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(e){if(n.props.initialCroppedAreaPercentages){var t=function(e,t,n,r,o,i){var s=fU(t.width,t.height,n),a=mU(r.width/s.width*(100/e.width),o,i);return{crop:{x:a*s.width/2-r.width/2-s.width*a*(e.x/100),y:a*s.height/2-r.height/2-s.height*a*(e.y/100)},zoom:a}}(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom),r=t.crop,o=t.zoom;n.props.onCropChange(r),n.props.onZoomChange&&n.props.onZoomChange(o)}else if(n.props.initialCroppedAreaPixels){var i=function(e,t,n,r,o,i){void 0===n&&(n=0);var s=fU(t.naturalWidth,t.naturalHeight,n),a=mU(function(e,t,n){var r=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return n.height>n.width?n.height/(e.height*r):n.width/(e.width*r)}(e,t,r),o,i),l=r.height>r.width?r.height/e.height:r.width/e.width;return{crop:{x:((s.width-e.width)/2-e.x)*l,y:((s.height-e.height)/2-e.y)*l},zoom:a}}(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom);r=i.crop,o=i.zoom,n.props.onCropChange(r),n.props.onZoomChange&&n.props.onZoomChange(o)}},n.computeSizes=function(){var e,t,r,o,i,s,a=n.imageRef.current||n.videoRef.current;if(a&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.saveContainerPosition();var l=n.containerRect.width/n.containerRect.height,c=(null===(e=n.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef.current)||void 0===t?void 0:t.videoWidth)||0,u=(null===(r=n.imageRef.current)||void 0===r?void 0:r.naturalHeight)||(null===(o=n.videoRef.current)||void 0===o?void 0:o.videoHeight)||0,d=c/u,h=void 0;if(a.offsetWidthd?{width:n.containerRect.height*d,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/d};break;case"horizontal-cover":h={width:n.containerRect.width,height:n.containerRect.width/d};break;case"vertical-cover":h={width:n.containerRect.height*d,height:n.containerRect.height}}else h={width:a.offsetWidth,height:a.offsetHeight};n.mediaSize=(0,oU.Cl)((0,oU.Cl)({},h),{naturalWidth:c,naturalHeight:u}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var p=n.props.cropSize?n.props.cropSize:function(e,t,n,r,o,i){void 0===i&&(i=0);var s=fU(e,t,i),a=s.width,l=s.height,c=Math.min(a,n),u=Math.min(l,r);return c>u*o?{width:u*o,height:u}:{width:c,height:c/o}}(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(null===(i=n.state.cropSize)||void 0===i?void 0:i.height)===p.height&&(null===(s=n.state.cropSize)||void 0===s?void 0:s.width)===p.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(p),n.setState({cropSize:p},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(p),p}},n.saveContainerPosition=function(){if(n.containerRef){var e=n.containerRef.getBoundingClientRect();n.containerPosition={x:e.left,y:e.top}}},n.onMouseDown=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.saveContainerPosition(),n.onDragStart(t.getMousePoint(e)))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onScroll=function(e){n.currentDoc&&(e.preventDefault(),n.saveContainerPosition())},n.onTouchStart=function(e){n.currentDoc&&(n.isTouching=!0,n.props.onTouchRequest&&!n.props.onTouchRequest(e)||(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),n.saveContainerPosition(),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onGestureStart=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureMove=function(e){if(e.preventDefault(),!n.isTouching){var r=t.getMousePoint(e),o=n.gestureZoomStart-1+e.scale;if(n.setNewZoom(o,r,{shouldUpdatePosition:!0}),n.props.onRotationChange){var i=n.gestureRotationStart+e.rotation;n.props.onRotationChange(i)}}},n.onGestureEnd=function(e){n.cleanEvents()},n.onDragStart=function(e){var t,r,o=e.x,i=e.y;n.dragStartPosition={x:o,y:i},n.dragStartCrop=(0,oU.Cl)({},n.props.crop),null===(r=(t=n.props).onInteractionStart)||void 0===r||r.call(t)},n.onDrag=function(e){var t=e.x,r=e.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==r){var e=t-n.dragStartPosition.x,o=r-n.dragStartPosition.y,i={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+o},s=n.props.restrictPosition?aU(i,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):i;n.props.onCropChange(s)}})))},n.onDragStopped=function(){var e,t;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){if(n.currentWindow&&(!n.props.onWheelRequest||n.props.onWheelRequest(e))){e.preventDefault();var r=t.getMousePoint(e),o=sU()(e).pixelY,i=n.props.zoom-o*n.props.zoomSpeed/200;n.setNewZoom(i,r,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)}},n.getPointOnContainer=function(e,t){var r=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(r-t.x),y:n.containerRect.height/2-(o-t.y)}},n.getPointOnMedia=function(e){var t=e.x,r=e.y,o=n.props,i=o.crop,s=o.zoom;return{x:(t+i.x)/s,y:(r+i.y)/s}},n.setNewZoom=function(e,t,r){var o=(void 0===r?{}:r).shouldUpdatePosition,i=void 0===o||o;if(n.state.cropSize&&n.props.onZoomChange){var s=mU(e,n.props.minZoom,n.props.maxZoom);if(i){var a=n.getPointOnContainer(t,n.containerPosition),l=n.getPointOnMedia(a),c={x:l.x*s-a.x,y:l.y*s-a.y},u=n.props.restrictPosition?aU(c,n.mediaSize,n.state.cropSize,s,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(s)}},n.getCropData=function(){return n.state.cropSize?function(e,t,n,r,o,i,s){void 0===i&&(i=0),void 0===s&&(s=!0);var a=s?dU:hU,l=fU(t.width,t.height,i),c=fU(t.naturalWidth,t.naturalHeight,i),u={x:a(100,((l.width-n.width/o)/2-e.x/o)/l.width*100),y:a(100,((l.height-n.height/o)/2-e.y/o)/l.height*100),width:a(100,n.width/l.width*100/o),height:a(100,n.height/l.height*100/o)},d=Math.round(a(c.width,u.width*c.width/100)),h=Math.round(a(c.height,u.height*c.height/100)),p=c.width>=c.height*r?{width:Math.round(h*r),height:h}:{width:d,height:Math.round(d/r)};return{croppedAreaPercentages:u,croppedAreaPixels:(0,oU.Cl)((0,oU.Cl)({},p),{x:Math.round(a(c.width-p.width,u.x*c.width/100)),y:Math.round(a(c.height-p.height,u.y*c.height/100))})}}(n.props.restrictPosition?aU(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition):null},n.emitCropData=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,r),n.props.onCropAreaChange&&n.props.onCropAreaChange(t,r)}},n.emitCropAreaChange=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(t,r)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?aU(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return(0,oU.C6)(t,e),t.prototype.componentDidMount=function(){this.currentDoc&&this.currentWindow&&(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),void 0===window.ResizeObserver&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef))},t.prototype.componentWillUnmount=function(){var e,t;this.currentDoc&&this.currentWindow&&(void 0===window.ResizeObserver&&this.currentWindow.removeEventListener("resize",this.computeSizes),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&(null===(t=this.styleRef.parentNode)||void 0===t||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(e){var t,n,r,o,i,s,a,l,c;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect||e.objectFit!==this.props.objectFit?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(n=this.props.cropSize)||void 0===n?void 0:n.height)||(null===(r=e.cropSize)||void 0===r?void 0:r.width)!==(null===(o=this.props.cropSize)||void 0===o?void 0:o.width)?this.computeSizes():(null===(i=e.crop)||void 0===i?void 0:i.x)===(null===(s=this.props.crop)||void 0===s?void 0:s.x)&&(null===(a=e.crop)||void 0===a?void 0:a.y)===(null===(l=this.props.crop)||void 0===l?void 0:l.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(c=this.videoRef.current)||void 0===c||c.load());var u=this.getObjectFit();u!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:u},this.computeSizes)},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.getObjectFit=function(){var e,t,n,r;if("cover"===this.props.objectFit){if((this.imageRef.current||this.videoRef.current)&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var o=this.containerRect.width/this.containerRect.height;return((null===(e=this.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=this.videoRef.current)||void 0===t?void 0:t.videoWidth)||0)/((null===(n=this.imageRef.current)||void 0===n?void 0:n.naturalHeight)||(null===(r=this.videoRef.current)||void 0===r?void 0:r.videoHeight)||0){d(e)},onCropComplete:e=>{h(e)},onZoomChange:e=>{p(100*e)}}),s&&(0,jd.jsx)(qE.Ay,{})]});return(0,jd.jsxs)(jd.Fragment,{children:[m,v]})}var yU=n(86662);function _U(){const{isInProgress:e,zoom:t,setZoom:n}=Zz();return(0,jd.jsx)(PE.A,{contentClassName:"wp-block-image__zoom",popoverProps:Jz,renderToggle:({isOpen:t,onToggle:n})=>(0,jd.jsx)(n_,{icon:yU.A,label:(0,H.__)("Zoom"),onClick:n,"aria-expanded":t,disabled:e}),renderContent:()=>(0,jd.jsx)(LC,{__nextHasNoMarginBottom:!0,label:(0,H.__)("Zoom"),min:Kz,max:Yz,value:Math.round(t),onChange:n})})}var xU=n(65754);function wU(){const{isInProgress:e,rotateClockwise:t}=Zz();return(0,jd.jsx)(n_,{icon:xU.A,label:(0,H.__)("Rotate"),onClick:t,disabled:e})}function kU(){const{isInProgress:e,apply:t,cancel:n}=Zz();return(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsx)(n_,{onClick:t,disabled:e,children:(0,H.__)("Apply")}),(0,jd.jsx)(n_,{onClick:n,children:(0,H.__)("Cancel")})]})}function CU({id:e,url:t,width:n,height:r,naturalHeight:o,naturalWidth:i,onSaveImage:s,onFinishEditing:a,borderProps:l}){return(0,jd.jsxs)(Qz,{id:e,url:t,naturalWidth:i,naturalHeight:o,onSaveImage:s,onFinishEditing:a,children:[(0,jd.jsx)(vU,{borderProps:l,url:t,width:n,height:r,naturalHeight:o,naturalWidth:i}),(0,jd.jsxs)(y_,{children:[(0,jd.jsxs)(s_,{children:[(0,jd.jsx)(_U,{}),(0,jd.jsx)(Zy.A,{children:e=>(0,jd.jsx)(rU,{toggleProps:e})}),(0,jd.jsx)(wU,{})]}),(0,jd.jsx)(s_,{children:(0,jd.jsx)(kU,{})})]})]})}var SU=n(39116);function AU(e=""){const[t,n]=(0,k.useState)(e),[r,o]=(0,k.useState)(e),i=(0,nI.A)(o,250);return(0,k.useEffect)((()=>{i(t)}),[t,i]),[t,n,r]}var EU=n(62145);const IU=function(e){const{children:t}=e;return(0,jd.jsxs)("div",{className:"components-tip",children:[(0,jd.jsx)(ak.A,{icon:EU.A}),(0,jd.jsx)("p",{children:t})]})},jU=[(0,hI.A)((0,H.__)("While writing, you can press / to quickly insert new blocks."),{kbd:(0,jd.jsx)("kbd",{})}),(0,hI.A)((0,H.__)("Indent a list by pressing space at the beginning of a line."),{kbd:(0,jd.jsx)("kbd",{})}),(0,hI.A)((0,H.__)("Outdent a list by pressing backspace at the beginning of a line."),{kbd:(0,jd.jsx)("kbd",{})}),(0,H.__)("Drag files into the editor to automatically insert media blocks."),(0,H.__)("Change a block's type by pressing the block icon on the toolbar.")],TU=function(){const[e]=(0,k.useState)(Math.floor(Math.random()*jU.length));return(0,jd.jsx)(IU,{children:jU[e]})};var BU=n(59820),RU=n(30221);const NU=function({title:e,icon:t,description:n,blockType:r,className:o}){r&&((0,q.default)("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:e,icon:t,description:n}=r));const{parentNavBlockClientId:i}=(0,Ul.A)((e=>{const{getSelectedBlockClientId:t,getBlockParentsByBlockName:n}=e(dy);return{parentNavBlockClientId:n(t(),"core/navigation",!0)[0]}}),[]),{selectBlock:s}=(0,Vl.A)(dy);return(0,jd.jsxs)("div",{className:(0,Hy.A)("block-editor-block-card",o),children:[i&&(0,jd.jsx)(Xy.Ay,{onClick:()=>s(i),label:(0,H.__)("Go to parent Navigation block"),style:{minWidth:24,padding:0},icon:(0,H.isRTL)()?BU.A:RU.A,size:"small"}),(0,jd.jsx)(gz,{icon:t,showColors:!0}),(0,jd.jsxs)(oE.A,{spacing:1,children:[(0,jd.jsx)("h2",{className:"block-editor-block-card__title",children:e}),n&&(0,jd.jsx)(PT.A,{className:"block-editor-block-card__description",children:n})]})]})};var DU=n(76949),MU=n(47225);const PU=(0,Hp.f)((e=>({useSubRegistry:t=!0,...n})=>{const r=(0,Vp.A)(),[o]=(0,k.useState)((()=>new WeakMap)),i=function(e,t,n){if(!n)return t;let r=e.get(t);return r||(r=(0,DU.I)({},t),r.registerStore(Cf,uy),e.set(t,r)),r}(o,r,t);return i===r?(0,jd.jsx)(e,{registry:r,...n}):(0,jd.jsx)(MU.Ay,{value:i,children:(0,jd.jsx)(e,{registry:i,...n})})}),"withRegistryProvider"),OU=()=>{};function LU({clientId:e=null,value:t,selection:n,onChange:r=OU,onInput:o=OU}){const i=(0,Vp.A)(),{resetBlocks:s,resetSelection:a,replaceInnerBlocks:l,setHasControlledInnerBlocks:c,__unstableMarkNextChangeAsNotPersistent:u}=i.dispatch(dy),{getBlockName:d,getBlocks:h,getSelectionStart:p,getSelectionEnd:f}=i.select(dy),m=(0,Ul.A)((t=>!e||t(dy).areInnerBlocksControlled(e)),[e]),g=(0,k.useRef)({incoming:null,outgoing:[]}),b=(0,k.useRef)(!1),v=()=>{t&&(u(),e?i.batch((()=>{c(e,!0);const n=t.map((e=>od(e)));b.current&&(g.current.incoming=n),u(),l(e,n)})):(b.current&&(g.current.incoming=t),s(t)))},y=(0,k.useRef)(o),_=(0,k.useRef)(r);(0,k.useEffect)((()=>{y.current=o,_.current=r}),[o,r]),(0,k.useEffect)((()=>{g.current.outgoing.includes(t)?g.current.outgoing[g.current.outgoing.length-1]===t&&(g.current.outgoing=[]):h(e)!==t&&(g.current.outgoing=[],v(),n&&a(n.selectionStart,n.selectionEnd,n.initialPosition))}),[t,e]);const x=(0,k.useRef)(!1);(0,k.useEffect)((()=>{x.current?m||(g.current.outgoing=[],v()):x.current=!0}),[m]),(0,k.useEffect)((()=>{const{getSelectedBlocksInitialCaretPosition:t,isLastBlockChangePersistent:n,__unstableIsLastBlockChangeIgnored:r,areInnerBlocksControlled:o}=i.select(dy);let s=h(e),a=n(),l=!1;b.current=!0;const c=i.subscribe((()=>{if(null!==e&&null===d(e))return;if(e&&!o(e))return;const i=n(),c=h(e),u=c!==s;if(s=c,u&&(g.current.incoming||r()))return g.current.incoming=null,void(a=i);if(u||l&&!u&&i&&!a){a=i,g.current.outgoing.push(s);const e=a?_.current:y.current,n=jb.has(s);n&&jb.delete(s),e(s,{selection:{selectionStart:p(),selectionEnd:f(),initialPosition:t()},undoIgnore:n})}l=u}),dy);return()=>{b.current=!1,c()}}),[i,e]),(0,k.useEffect)((()=>()=>{u(),e?(c(e,!1),u(),l(e,[])):s([])}),[])}var FU=n(99671);function zU(){return null}zU.Register=function(){const{registerShortcut:e}=(0,Vl.A)(FU.M_);return(0,k.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,H.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,H.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,H.__)("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:(0,H.__)("Insert a new block after the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"y"}}),e({name:"core/block-editor/delete-multi-selection",category:"block",description:(0,H.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,H.__)("Select all text when typing. Press again to select all blocks."),keyCombination:{modifier:"primary",character:"a"}}),e({name:"core/block-editor/unselect",category:"selection",description:(0,H.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/multi-text-selection",category:"selection",description:(0,H.__)("Select text across multiple blocks."),keyCombination:{modifier:"shift",character:"arrow"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,H.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,H.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,H.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}}),e({name:"core/block-editor/collapse-list-view",category:"list-view",description:(0,H.__)("Collapse all other items."),keyCombination:{modifier:"alt",character:"l"}}),e({name:"core/block-editor/group",category:"block",description:(0,H.__)("Create a group block from the selected multiple blocks."),keyCombination:{modifier:"primary",character:"g"}})}),[e]),null};const UU=zU,VU=PU((e=>{const{children:t,settings:n,stripExperimentalSettings:r=!1}=e,{__experimentalUpdateSettings:o}=kf((0,Vl.A)(dy));return(0,k.useEffect)((()=>{o({...n,__internalIsInitialized:!0},{stripExperimentalSettings:r,reset:!0})}),[n,r,o]),LU(e),(0,jd.jsxs)(Hl.Kq,{passthrough:!0,children:[!n?.__unstableIsPreviewMode&&(0,jd.jsx)(UU.Register,{}),(0,jd.jsx)(HC,{children:t})]})})),HU=e=>(0,jd.jsx)(VU,{...e,stripExperimentalSettings:!0,children:e.children}),$U={name:"u2jump",styles:"position:relative;pointer-events:none;&::after{content:'';position:absolute;top:0;right:0;bottom:0;left:0;}*{pointer-events:none;}"},WU=(0,k.createContext)(!1),{Consumer:GU,Provider:qU}=WU;function KU({className:e,children:t,isDisabled:n=!0,...r}){const o=(0,V_.l)();return(0,jd.jsx)(qU,{value:n,children:(0,jd.jsx)("div",{inert:n?"true":void 0,className:n?o($U,e,"components-disabled"):void 0,...r,children:t})})}KU.Context=WU,KU.Consumer=GU;const YU=KU;var JU=n(25720),XU=n(2549),ZU=n(73247);const QU=(0,k.createContext)({});function eV({value:e,children:t}){const n=(0,k.useContext)(QU),r=(0,k.useMemo)((()=>({...n,...e})),[n,e]);return(0,jd.jsx)(QU.Provider,{value:r,children:t})}const tV=QU,nV={},rV=zE("editor.BlockEdit")((e=>{const{name:t}=e,n=Sc(t);if(!n)return null;const r=n.edit||n.save;return(0,jd.jsx)(r,{...e})})),oV=e=>{const{attributes:t={},name:n}=e,r=Sc(n),o=(0,k.useContext)(tV),i=(0,k.useMemo)((()=>r&&r.usesContext?Object.fromEntries(Object.entries(o).filter((([e])=>r.usesContext.includes(e)))):nV),[r,o]);if(!r)return null;if(r.apiVersion>1)return(0,jd.jsx)(rV,{...e,context:i});const s=Ic(r,"className",!0)?Td(n):null,a=(0,Hy.A)(s,t.className,e.className);return(0,jd.jsx)(rV,{...e,context:i,className:a})},iV=function({className:e,actions:t,children:n,secondaryActions:r}){return(0,jd.jsx)("div",{style:{display:"contents",all:"initial"},children:(0,jd.jsx)("div",{className:(0,Hy.A)(e,"block-editor-warning"),children:(0,jd.jsxs)("div",{className:"block-editor-warning__contents",children:[(0,jd.jsx)("p",{className:"block-editor-warning__message",children:n}),(k.Children.count(t)>0||r)&&(0,jd.jsxs)("div",{className:"block-editor-warning__actions",children:[k.Children.count(t)>0&&k.Children.map(t,((e,t)=>(0,jd.jsx)("span",{className:"block-editor-warning__action",children:e},t))),r&&(0,jd.jsx)(o_.A,{className:"block-editor-warning__secondary",icon:QS.A,label:(0,H.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0,children:()=>(0,jd.jsx)(x_.A,{children:r.map(((e,t)=>(0,jd.jsx)(w_.A,{onClick:e.onClick,children:e.title},t)))})})]})]})})})};function sV({originalBlockClientId:e,name:t,onReplace:n}){const{selectBlock:r}=(0,Vl.A)(dy),o=Sc(t);return(0,jd.jsxs)(iV,{actions:[(0,jd.jsx)(Xy.Ay,{variant:"secondary",onClick:()=>r(e),children:(0,H.__)("Find original")},"find-original"),(0,jd.jsx)(Xy.Ay,{variant:"secondary",onClick:()=>n([]),children:(0,H.__)("Remove")},"remove")],children:[(0,jd.jsxs)("strong",{children:[o?.title,": "]}),(0,H.__)("This block can only be used once.")]})}const aV=(0,k.createContext)({});function lV({mayDisplayControls:e,mayDisplayParentControls:t,blockEditingMode:n,isPreviewMode:r,...o}){const{name:i,isSelected:s,clientId:a,attributes:l={},__unstableLayoutClassNames:c}=o,{layout:u=null,metadata:d={}}=l,{bindings:h}=d,p=Ic(i,"layout",!1)||Ic(i,"__experimentalLayout",!1),{originalBlockClientId:f}=(0,k.useContext)(aV);return(0,jd.jsxs)(Xp,{value:(0,k.useMemo)((()=>({name:i,isSelected:s,clientId:a,layout:p?u:null,__unstableLayoutClassNames:c,[$p]:e,[Wp]:t,[Gp]:n,[qp]:h,[Kp]:r})),[i,s,a,p,u,c,e,t,n,h,r]),children:[(0,jd.jsx)(oV,{...o}),f&&(0,jd.jsx)(sV,{originalBlockClientId:f,name:i,onReplace:o.onReplace})]})}var cV=n(56900);function uV({title:e,rawContent:t,renderedContent:n,action:r,actionText:o,className:i}){return(0,jd.jsxs)("div",{className:i,children:[(0,jd.jsxs)("div",{className:"block-editor-block-compare__content",children:[(0,jd.jsx)("h2",{className:"block-editor-block-compare__heading",children:e}),(0,jd.jsx)("div",{className:"block-editor-block-compare__html",children:t}),(0,jd.jsx)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor",children:(0,jd.jsx)(Ad.A,{children:(0,ZU.A)(n)})})]}),(0,jd.jsx)("div",{className:"block-editor-block-compare__action",children:(0,jd.jsx)(Xy.Ay,{variant:"secondary",tabIndex:"0",onClick:r,children:o})})]})}const dV=function({block:e,onKeep:t,onConvert:n,convertor:r,convertButtonText:o}){const i=function(e){const t=(Array.isArray(e)?e:[e]).map((e=>Pd(e.name,e.attributes,e.innerBlocks)));return t.join("")}(r(e)),s=(a=e.originalContent,l=i,(0,cV.JJ)(a,l).map(((e,t)=>{const n=(0,Hy.A)({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,jd.jsx)("span",{className:n,children:e.value},t)})));var a,l;return(0,jd.jsxs)("div",{className:"block-editor-block-compare__wrapper",children:[(0,jd.jsx)(uV,{title:(0,H.__)("Current"),className:"block-editor-block-compare__current",action:t,actionText:(0,H.__)("Convert to HTML"),rawContent:e.originalContent,renderedContent:e.originalContent}),(0,jd.jsx)(uV,{title:(0,H.__)("After Conversion"),className:"block-editor-block-compare__converted",action:n,actionText:o,rawContent:s,renderedContent:i})]})},hV=e=>dp({HTML:e.originalContent});function pV({clientId:e}){const{block:t,canInsertHTMLBlock:n,canInsertClassicBlock:r}=(0,Ul.A)((t=>{const{canInsertBlockType:n,getBlock:r,getBlockRootClientId:o}=t(dy),i=o(e);return{block:r(e),canInsertHTMLBlock:n("core/html",i),canInsertClassicBlock:n("core/freeform",i)}}),[e]),{replaceBlock:o}=(0,Vl.A)(dy),[i,s]=(0,k.useState)(!1),a=(0,k.useCallback)((()=>s(!1)),[]),l=(0,k.useMemo)((()=>({toClassic(){const e=td("core/freeform",{content:t.originalContent});return o(t.clientId,e)},toHTML(){const e=td("core/html",{content:t.originalContent});return o(t.clientId,e)},toBlocks(){const e=hV(t);return o(t.clientId,e)},toRecoveredBlock(){const e=td(t.name,t.attributes,t.innerBlocks);return o(t.clientId,e)}})),[t,o]),c=(0,k.useMemo)((()=>[{title:(0,H._x)("Resolve","imperative verb"),onClick:()=>s(!0)},n&&{title:(0,H.__)("Convert to HTML"),onClick:l.toHTML},r&&{title:(0,H.__)("Convert to Classic Block"),onClick:l.toClassic}].filter(Boolean)),[n,r,l]);return(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsx)(iV,{actions:[(0,jd.jsx)(Xy.Ay,{onClick:l.toRecoveredBlock,variant:"primary",children:(0,H.__)("Attempt Block Recovery")},"recover")],secondaryActions:c,children:(0,H.__)("This block contains unexpected or invalid content.")}),i&&(0,jd.jsx)(ZF.A,{title:(0,H.__)("Resolve Block"),onRequestClose:a,className:"block-editor-block-compare",children:(0,jd.jsx)(dV,{block:t,onKeep:l.toHTML,onConvert:l.toBlocks,convertor:hV,convertButtonText:(0,H.__)("Convert to Blocks")})})]})}const fV=(0,jd.jsx)(iV,{className:"block-editor-block-list__block-crash-warning",children:(0,H.__)("This block has encountered an error and cannot be previewed.")}),mV=()=>fV;class gV extends k.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}const bV=gV;var vV=n(28716);const yV=function({clientId:e}){const[t,n]=(0,k.useState)(""),r=(0,Ul.A)((t=>t(dy).getBlock(e)),[e]),{updateBlock:o}=(0,Vl.A)(dy);return(0,k.useEffect)((()=>{n(Od(r))}),[r]),(0,jd.jsx)(vV.A,{className:"block-editor-block-list__block-html-textarea",value:t,onBlur:()=>{const i=Sc(r.name);if(!i)return;const s=jh(i,t,r.attributes),a=t||Pd(i,s),[l]=t?fh({...r,attributes:s,originalContent:a}):[!0];o(e,{attributes:s,originalContent:a,isValid:l}),t||n(a)},onChange:e=>n(e.target.value)})};function _V({isDisabled:e=!1}={}){return(0,zC.A)((t=>{if(e)return;const n=t?.ownerDocument?.defaultView;if(!n)return;const r=[],o=()=>{t.childNodes.forEach((e=>{e instanceof n.HTMLElement&&(e.getAttribute("inert")||(e.setAttribute("inert","true"),r.push((()=>{e.removeAttribute("inert")}))))}))},i=(0,FE.s)(o,0,{leading:!0});o();const s=new window.MutationObserver(i);return s.observe(t,{childList:!0}),()=>{s&&s.disconnect(),i.cancel(),r.forEach((e=>e()))}}),[e])}var xV=OV(),wV=e=>NV(e,xV),kV=OV();wV.write=e=>NV(e,kV);var CV=OV();wV.onStart=e=>NV(e,CV);var SV=OV();wV.onFrame=e=>NV(e,SV);var AV=OV();wV.onFinish=e=>NV(e,AV);var EV=[];wV.setTimeout=(e,t)=>{let n=wV.now()+t,r=()=>{let e=EV.findIndex((e=>e.cancel==r));~e&&EV.splice(e,1),BV-=~e?1:0},o={time:n,handler:e,cancel:r};return EV.splice(IV(n),0,o),BV+=1,DV(),o};var IV=e=>~(~EV.findIndex((t=>t.time>e))||~EV.length);wV.cancel=e=>{CV.delete(e),SV.delete(e),AV.delete(e),xV.delete(e),kV.delete(e)},wV.sync=e=>{RV=!0,wV.batchedUpdates(e),RV=!1},wV.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...e){t=e,wV.onStart(n)}return r.handler=e,r.cancel=()=>{CV.delete(n),t=null},r};var jV=typeof window<"u"?window.requestAnimationFrame:()=>{};wV.use=e=>jV=e,wV.now=typeof performance<"u"?()=>performance.now():Date.now,wV.batchedUpdates=e=>e(),wV.catch=console.error,wV.frameLoop="always",wV.advance=()=>{"demand"!==wV.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):PV()};var TV=-1,BV=0,RV=!1;function NV(e,t){RV?(t.delete(e),e(0)):(t.add(e),DV())}function DV(){TV<0&&(TV=0,"demand"!==wV.frameLoop&&jV(MV))}function MV(){~TV&&(jV(MV),wV.batchedUpdates(PV))}function PV(){let e=TV;TV=wV.now();let t=IV(TV);t&&(LV(EV.splice(0,t),(e=>e.handler())),BV-=t),BV?(CV.flush(),xV.flush(e?Math.min(64,TV-e):16.667),SV.flush(),kV.flush(),AV.flush()):TV=-1}function OV(){let e=new Set,t=e;return{add(n){BV+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(BV-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,BV-=t.size,LV(t,(t=>t(n)&&e.add(t))),BV+=e.size,t=e)}}}function LV(e,t){e.forEach((e=>{try{t(e)}catch(e){wV.catch(e)}}))}var FV=Object.defineProperty,zV={};function UV(){}((e,t)=>{for(var n in t)FV(e,n,{get:t[n],enumerable:!0})})(zV,{assign:()=>tH,colors:()=>ZV,createStringInterpolator:()=>KV,skipAnimation:()=>QV,to:()=>YV,willAdvance:()=>eH});var VV={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function HV(e,t){if(VV.arr(e)){if(!VV.arr(t)||e.length!==t.length)return!1;for(let n=0;ne.forEach(t);function WV(e,t,n){if(VV.arr(e))for(let r=0;rVV.und(e)?[]:VV.arr(e)?e:[e];function qV(e,t){if(e.size){let n=Array.from(e);e.clear(),$V(n,t)}}var KV,YV,JV=(e,...t)=>qV(e,(e=>e(...t))),XV=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),ZV=null,QV=!1,eH=UV,tH=e=>{e.to&&(YV=e.to),e.now&&(wV.now=e.now),void 0!==e.colors&&(ZV=e.colors),null!=e.skipAnimation&&(QV=e.skipAnimation),e.createStringInterpolator&&(KV=e.createStringInterpolator),e.requestAnimationFrame&&wV.use(e.requestAnimationFrame),e.batchedUpdates&&(wV.batchedUpdates=e.batchedUpdates),e.willAdvance&&(eH=e.willAdvance),e.frameLoop&&(wV.frameLoop=e.frameLoop)},nH=new Set,rH=[],oH=[],iH=0,sH={get idle(){return!nH.size&&!rH.length},start(e){iH>e.priority?(nH.add(e),wV.onStart(aH)):(lH(e),wV(uH))},advance:uH,sort(e){if(iH)wV.onFrame((()=>sH.sort(e)));else{let t=rH.indexOf(e);~t&&(rH.splice(t,1),cH(e))}},clear(){rH=[],nH.clear()}};function aH(){nH.forEach(lH),nH.clear(),wV(uH)}function lH(e){rH.includes(e)||cH(e)}function cH(e){rH.splice(function(e,t){let n=e.findIndex(t);return n<0?e.length:n}(rH,(t=>t.priority>e.priority)),0,e)}function uH(e){let t=oH;for(let n=0;n0}var dH="[-+]?\\d*\\.?\\d+",hH=dH+"%";function pH(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var fH=new RegExp("rgb"+pH(dH,dH,dH)),mH=new RegExp("rgba"+pH(dH,dH,dH,dH)),gH=new RegExp("hsl"+pH(dH,hH,hH)),bH=new RegExp("hsla"+pH(dH,hH,hH,dH)),vH=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,yH=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,_H=/^#([0-9a-fA-F]{6})$/,xH=/^#([0-9a-fA-F]{8})$/;function wH(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function kH(e,t,n){let r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=wH(o,r,e+1/3),s=wH(o,r,e),a=wH(o,r,e-1/3);return Math.round(255*i)<<24|Math.round(255*s)<<16|Math.round(255*a)<<8}function CH(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function SH(e){return(parseFloat(e)%360+360)%360/360}function AH(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function EH(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function IH(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=_H.exec(e))?parseInt(t[1]+"ff",16)>>>0:ZV&&void 0!==ZV[e]?ZV[e]:(t=fH.exec(e))?(CH(t[1])<<24|CH(t[2])<<16|CH(t[3])<<8|255)>>>0:(t=mH.exec(e))?(CH(t[1])<<24|CH(t[2])<<16|CH(t[3])<<8|AH(t[4]))>>>0:(t=vH.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=xH.exec(e))?parseInt(t[1],16)>>>0:(t=yH.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=gH.exec(e))?(255|kH(SH(t[1]),EH(t[2]),EH(t[3])))>>>0:(t=bH.exec(e))?(kH(SH(t[1]),EH(t[2]),EH(t[3]))|AH(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}var jH=(e,t,n)=>{if(VV.fun(e))return e;if(VV.arr(e))return jH({range:e,output:t,extrapolate:n});if(VV.str(e.output[0]))return KV(e);let r=e,o=r.output,i=r.range||[0,1],s=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",l=r.easing||(e=>e);return e=>{let t=function(e,t){for(var n=1;n=e);++n);return n-1}(e,i);return function(e,t,n,r,o,i,s,a,l){let c=l?l(e):e;if(cn){if("identity"===a)return c;"clamp"===a&&(c=n)}return r===o?r:t===n?e<=t?r:o:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=i(c),r===-1/0?c=-c:o===1/0?c+=r:c=c*(o-r)+r,c)}(e,i[t],i[t+1],o[t],o[t+1],l,s,a,r.map)}},TH=1.70158,BH=2.5949095,RH=2.70158,NH=2*Math.PI/3,DH=2*Math.PI/4.5,MH=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,PH={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>0===e?0:Math.pow(2,10*e-10),easeOutExpo:e=>1===e?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>RH*e*e*e-TH*e*e,easeOutBack:e=>1+RH*Math.pow(e-1,3)+TH*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(7.189819*e-BH)/2:(Math.pow(2*e-2,2)*((BH+1)*(2*e-2)+BH)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*NH),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*NH)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*DH)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*DH)/2+1,easeInBounce:e=>1-MH(1-e),easeOutBounce:MH,easeInOutBounce:e=>e<.5?(1-MH(1-2*e))/2:(1+MH(2*e-1))/2,steps:(e,t="end")=>n=>{let r=(n="end"===t?Math.min(n,.999):Math.max(n,.001))*e;return((e,t,n)=>Math.min(Math.max(n,0),1))(0,0,("end"===t?Math.floor(r):Math.ceil(r))/e)}},OH=Symbol.for("FluidValue.get"),LH=Symbol.for("FluidValue.observers"),FH=e=>Boolean(e&&e[OH]),zH=e=>e&&e[OH]?e[OH]():e,UH=e=>e[LH]||null;function VH(e,t){let n=e[LH];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}var HH=class{[OH];[LH];constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");$H(this,e)}},$H=(e,t)=>KH(e,OH,t);function WH(e,t){if(e[OH]){let n=e[LH];n||KH(e,LH,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function GH(e,t){let n=e[LH];if(n&&n.has(t)){let r=n.size-1;r?n.delete(t):e[LH]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var qH,KH=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),YH=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,JH=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,XH=new RegExp(`(${YH.source})(%|[a-z]+)`,"i"),ZH=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,QH=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,e$=e=>{let[t,n]=t$(e);if(!t||XV())return e;let r=window.getComputedStyle(document.documentElement).getPropertyValue(t);return r?r.trim():n&&n.startsWith("--")?window.getComputedStyle(document.documentElement).getPropertyValue(n)||e:n&&QH.test(n)?e$(n):n||e},t$=e=>{let t=QH.exec(e);if(!t)return[,];let[,n,r]=t;return[n,r]},n$=(e,t,n,r,o)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${o})`,r$=e=>{qH||(qH=ZV?new RegExp(`(${Object.keys(ZV).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map((e=>zH(e).replace(QH,e$).replace(JH,IH).replace(qH,IH))),n=t.map((e=>e.match(YH).map(Number))),r=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>jH({...e,output:t})));return e=>{let n=!XH.test(t[0])&&t.find((e=>XH.test(e)))?.replace(YH,""),o=0;return t[0].replace(YH,(()=>`${r[o++](e)}${n||""}`)).replace(ZH,n$)}},o$="react-spring: ",i$=e=>{let t=e,n=!1;if("function"!=typeof t)throw new TypeError(`${o$}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},s$=i$(console.warn);function a$(e){return VV.str(e)&&("#"==e[0]||/\d/.test(e)||!XV()&&QH.test(e)||e in(ZV||{}))}i$(console.warn),new WeakMap,new Set,new WeakMap,new WeakMap,new WeakMap;var l$=XV()?k.useEffect:k.useLayoutEffect;var c$=[],u$=Symbol.for("Animated:node"),d$=e=>e&&e[u$],h$=(e,t)=>((e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}))(e,u$,t),p$=e=>e&&e[u$]&&e[u$].getPayload(),f$=class{payload;constructor(){h$(this,this)}getPayload(){return this.payload||[]}},m$=class extends f${constructor(e){super(),this._value=e,VV.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(e){return new m$(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return VV.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){let{done:e}=this;this.done=!1,VV.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},g$=class extends m${_string=null;_toString;constructor(e){super(0),this._toString=jH({output:[e,e]})}static create(e){return new g$(e)}getValue(){return this._string??(this._string=this._toString(this._value))}setValue(e){if(VV.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=jH({output:[this.getValue(),e]})),this._value=0,super.reset()}},b$={dependencies:null},v$=class extends f${constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return WV(this.source,((n,r)=>{var o;(o=n)&&o[u$]===o?t[r]=n.getValue(e):FH(n)?t[r]=zH(n):e||(t[r]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&$V(this.payload,(e=>e.reset()))}_makePayload(e){if(e){let t=new Set;return WV(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){b$.dependencies&&FH(e)&&b$.dependencies.add(e);let t=p$(e);t&&$V(t,(e=>this.add(e)))}},y$=class extends v${constructor(e){super(e)}static create(e){return new y$(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){let t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(_$)),!0)}};function _$(e){return(a$(e)?g$:m$).create(e)}function x$(e){let t=d$(e);return t?t.constructor:VV.arr(e)?y$:a$(e)?g$:m$}var w$=(e,t)=>{let n=!VV.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,k.forwardRef)(((r,o)=>{let i=(0,k.useRef)(null),s=n&&(0,k.useCallback)((e=>{i.current=function(e,t){return e&&(VV.fun(e)?e(t):e.current=t),t}(o,e)}),[o]),[a,l]=function(e,t){let n=new Set;return b$.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new v$(e),b$.dependencies=null,[e,n]}(r,t),c=function(){let e=(0,k.useState)()[1],t=(()=>{let e=(0,k.useRef)(!1);return l$((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}(),u=()=>{let e=i.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,a.getValue(!0)))&&c()},d=new k$(u,l),h=(0,k.useRef)();l$((()=>(h.current=d,$V(l,(e=>WH(e,d))),()=>{h.current&&($V(h.current.deps,(e=>GH(e,h.current))),wV.cancel(h.current.update))}))),(0,k.useEffect)(u,[]),(0,k.useEffect)((()=>()=>{let e=h.current;$V(e.deps,(t=>GH(t,e)))}),c$);let p=t.getComponentProps(a.getValue());return k.createElement(e,{...p,ref:s})}))},k$=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&wV.write(this.update)}},C$=Symbol.for("AnimatedComponent"),S$=e=>VV.str(e)?e:e&&VV.str(e.displayName)?e.displayName:VV.fun(e)&&e.name||null;function A$(e,...t){return VV.fun(e)?e(...t):e}var E$=(e,t)=>!0===e||!!(t&&e&&(VV.fun(e)?e(t):GV(e).includes(t))),I$=(e,t)=>VV.obj(e)?t&&e[t]:e,j$=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,T$=e=>e,B$=(e,t=T$)=>{let n=R$;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));let r={};for(let o of n){let n=t(e[o],o);VV.und(n)||(r[o]=n)}return r},R$=["config","onProps","onStart","onChange","onPause","onResume","onRest"],N$={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function D$(e){let t=function(e){let t={},n=0;if(WV(e,((e,r)=>{N$[r]||(t[r]=e,n++)})),n)return t}(e);if(t){let n={to:t};return WV(e,((e,r)=>r in t||(n[r]=e))),n}return{...e}}function M$(e){return e=zH(e),VV.arr(e)?e.map(M$):a$(e)?zV.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function P$(e){return VV.fun(e)||VV.arr(e)&&VV.obj(e[0])}var O$={tension:170,friction:26,mass:1,damping:1,easing:PH.linear,clamp:!1},L$=class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,O$)}};function F$(e,t){if(VV.und(t.decay)){let n=!VV.und(t.tension)||!VV.und(t.friction);(n||!VV.und(t.frequency)||!VV.und(t.damping)||!VV.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}var z$=[],U$=class{changed=!1;values=z$;toValues=null;fromValues=z$;to;from;config=new L$;immediate=!1};function V$(e,{key:t,props:n,defaultProps:r,state:o,actions:i}){return new Promise(((s,a)=>{let l,c,u=E$(n.cancel??r?.cancel,t);if(u)p();else{VV.und(n.pause)||(o.paused=E$(n.pause,t));let e=r?.pause;!0!==e&&(e=o.paused||E$(e,t)),l=A$(n.delay||0,t),e?(o.resumeQueue.add(h),i.pause()):(i.resume(),h())}function d(){o.resumeQueue.add(h),o.timeouts.delete(c),c.cancel(),l=c.time-wV.now()}function h(){l>0&&!zV.skipAnimation?(o.delayed=!0,c=wV.setTimeout(p,l),o.pauseQueue.add(d),o.timeouts.add(c)):p()}function p(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(d),o.timeouts.delete(c),e<=(o.cancelId||0)&&(u=!0);try{i.start({...n,callId:e,cancel:u},s)}catch(e){a(e)}}}))}var H$=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?G$(e.get()):t.every((e=>e.noop))?$$(e.get()):W$(e.get(),t.every((e=>e.finished))),$$=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),W$=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),G$=e=>({value:e,cancelled:!0,finished:!1});function q$(e,t,n,r){let{callId:o,parentId:i,onRest:s}=t,{asyncTo:a,promise:l}=n;return i||e!==a||t.reset?n.promise=(async()=>{n.asyncId=o,n.asyncTo=e;let c,u,d,h=B$(t,((e,t)=>"onRest"===t?void 0:e)),p=new Promise(((e,t)=>(c=e,u=t))),f=e=>{let t=o<=(n.cancelId||0)&&G$(r)||o!==n.asyncId&&W$(r,!1);if(t)throw e.result=t,u(e),e},m=(e,t)=>{let i=new Y$,s=new J$;return(async()=>{if(zV.skipAnimation)throw K$(n),s.result=W$(r,!1),u(s),s;f(i);let a=VV.obj(e)?{...e}:{...t,to:e};a.parentId=o,WV(h,((e,t)=>{VV.und(a[t])&&(a[t]=e)}));let l=await r.start(a);return f(i),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),l})()};if(zV.skipAnimation)return K$(n),W$(r,!1);try{let t;t=VV.arr(e)?(async e=>{for(let t of e)await m(t)})(e):Promise.resolve(e(m,r.stop.bind(r))),await Promise.all([t.then(c),p]),d=W$(r.get(),!0,!1)}catch(e){if(e instanceof Y$)d=e.result;else{if(!(e instanceof J$))throw e;d=e.result}}finally{o==n.asyncId&&(n.asyncId=i,n.asyncTo=i?a:void 0,n.promise=i?l:void 0)}return VV.fun(s)&&wV.batchedUpdates((()=>{s(d,r,r.item)})),d})():l}function K$(e,t){qV(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var Y$=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},J$=class extends Error{result;constructor(){super("SkipAnimationSignal")}},X$=e=>e instanceof Q$,Z$=1,Q$=class extends HH{id=Z$++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=d$(this);return e&&e.getValue()}to(...e){return zV.to(this,e)}interpolate(...e){return s$(`${o$}The "interpolate" function is deprecated in v9 (use "to" instead)`),zV.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){VH(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||sH.sort(this),VH(this,{type:"priority",parent:this,priority:e})}},eW=Symbol.for("SpringPhase"),tW=e=>(1&e[eW])>0,nW=e=>(2&e[eW])>0,rW=e=>(4&e[eW])>0,oW=(e,t)=>t?e[eW]|=3:e[eW]&=-3,iW=(e,t)=>t?e[eW]|=4:e[eW]&=-5,sW=class extends Q${key;animation=new U$;queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,t){if(super(),!VV.und(e)||!VV.und(t)){let n=VV.obj(e)?{...e}:{...t,from:e};VV.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(nW(this)||this._state.asyncTo)||rW(this)}get goal(){return zH(this.animation.to)}get velocity(){let e=d$(this);return e instanceof m$?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return tW(this)}get isAnimating(){return nW(this)}get isPaused(){return rW(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1,r=this.animation,{config:o,toValues:i}=r,s=p$(r.to);!s&&FH(r.to)&&(i=GV(zH(r.to))),r.values.forEach(((a,l)=>{if(a.done)return;let c=a.constructor==g$?1:s?s[l].lastPosition:i[l],u=r.immediate,d=c;if(!u){if(d=a.lastPosition,o.tension<=0)return void(a.done=!0);let t,n=a.elapsedTime+=e,i=r.fromValues[l],s=null!=a.v0?a.v0:a.v0=VV.arr(o.velocity)?o.velocity[l]:o.velocity,h=o.precision||(i==c?.005:Math.min(1,.001*Math.abs(c-i)));if(VV.und(o.duration))if(o.decay){let e=!0===o.decay?.998:o.decay,r=Math.exp(-(1-e)*n);d=i+s/(1-e)*(1-r),u=Math.abs(a.lastPosition-d)<=h,t=s*r}else{t=null==a.lastVelocity?s:a.lastVelocity;let n,r=o.restVelocity||h/10,l=o.clamp?0:o.bounce,p=!VV.und(l),f=i==c?a.v0>0:ir,n||(u=Math.abs(c-d)<=h,!u));++e)p&&(m=d==c||d>c==f,m&&(t=-t*l,d=c)),t+=(1e-6*-o.tension*(d-c)+.001*-o.friction*t)/o.mass*g,d+=t*g}else{let r=1;o.duration>0&&(this._memoizedDuration!==o.duration&&(this._memoizedDuration=o.duration,a.durationProgress>0&&(a.elapsedTime=o.duration*a.durationProgress,n=a.elapsedTime+=e)),r=(o.progress||0)+n/this._memoizedDuration,r=r>1?1:r<0?0:r,a.durationProgress=r),d=i+o.easing(r)*(c-i),t=(d-a.lastPosition)/e,u=1==r}a.lastVelocity=t,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}s&&!s[l].done&&(u=!1),u?a.done=!0:t=!1,a.setValue(d,o.round)&&(n=!0)}));let a=d$(this),l=a.getValue();if(t){let e=zH(r.to);l===e&&!n||o.decay?n&&o.decay&&this._onChange(l):(a.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(l)}set(e){return wV.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(nW(this)){let{to:e,config:t}=this.animation;wV.batchedUpdates((()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()}))}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return VV.und(e)?(n=this.queue||[],this.queue=[]):n=[VV.obj(e)?e:{...t,to:e}],Promise.all(n.map((e=>this._update(e)))).then((e=>H$(this,e)))}stop(e){let{to:t}=this.animation;return this._focus(this.get()),K$(this._state,e&&this._lastCallId),wV.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){let t=this.key||"",{to:n,from:r}=e;n=VV.obj(n)?n[t]:n,(null==n||P$(n))&&(n=void 0),r=VV.obj(r)?r[t]:r,null==r&&(r=void 0);let o={to:n,from:r};return tW(this)||(e.reverse&&([n,r]=[r,n]),r=zH(r),VV.und(r)?d$(this)||this._set(n):this._set(r)),o}_update({...e},t){let{key:n,defaultProps:r}=this;e.default&&Object.assign(r,B$(e,((e,t)=>/^on/.test(t)?I$(e,n):e))),hW(this,e,"onProps"),pW(this,"onProps",e,this);let o=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let i=this._state;return V$(++this._lastCallId,{key:n,props:e,defaultProps:r,state:i,actions:{pause:()=>{rW(this)||(iW(this,!0),JV(i.pauseQueue),pW(this,"onPause",W$(this,aW(this,this.animation.to)),this))},resume:()=>{rW(this)&&(iW(this,!1),nW(this)&&this._resume(),JV(i.resumeQueue),pW(this,"onResume",W$(this,aW(this,this.animation.to)),this))},start:this._merge.bind(this,o)}}).then((n=>{if(e.loop&&n.finished&&(!t||!n.noop)){let t=lW(e);if(t)return this._update(t,!0)}return n}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(G$(this));let r=!VV.und(e.to),o=!VV.und(e.from);if(r||o){if(!(t.callId>this._lastToId))return n(G$(this));this._lastToId=t.callId}let{key:i,defaultProps:s,animation:a}=this,{to:l,from:c}=a,{to:u=l,from:d=c}=e;o&&!r&&(!t.default||VV.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);let h=!HV(d,c);h&&(a.from=d),d=zH(d);let p=!HV(u,l);p&&this._focus(u);let f=P$(t.to),{config:m}=a,{decay:g,velocity:b}=m;(r||o)&&(m.velocity=0),t.config&&!f&&function(e,t,n){n&&(F$(n={...n},t),t={...n,...t}),F$(e,t),Object.assign(e,t);for(let t in O$)null==e[t]&&(e[t]=O$[t]);let{mass:r,frequency:o,damping:i}=e;VV.und(o)||(o<.01&&(o=.01),i<0&&(i=0),e.tension=Math.pow(2*Math.PI/o,2)*r,e.friction=4*Math.PI*i*r/o)}(m,A$(t.config,i),t.config!==s.config?A$(s.config,i):void 0);let v=d$(this);if(!v||VV.und(u))return n(W$(this,!0));let y=VV.und(t.reset)?o&&!t.default:!VV.und(d)&&E$(t.reset,i),_=y?d:this.get(),x=M$(u),w=VV.num(x)||VV.arr(x)||a$(x),k=!f&&(!w||E$(s.immediate||t.immediate,i));if(p){let e=x$(u);if(e!==v.constructor){if(!k)throw Error(`Cannot animate between ${v.constructor.name} and ${e.name}, as the "to" prop suggests`);v=this._set(x)}}let C=v.constructor,S=FH(u),A=!1;if(!S){let e=y||!tW(this)&&h;(p||e)&&(A=HV(M$(_),x),S=!A),(!HV(a.immediate,k)&&!k||!HV(m.decay,g)||!HV(m.velocity,b))&&(S=!0)}if(A&&nW(this)&&(a.changed&&!y?S=!0:S||this._stop(l)),!f&&((S||FH(l))&&(a.values=v.getPayload(),a.toValues=FH(u)?null:C==g$?[1]:GV(x)),a.immediate!=k&&(a.immediate=k,!k&&!y&&this._set(l)),S)){let{onRest:e}=a;$V(dW,(e=>hW(this,t,e)));let r=W$(this,aW(this,l));JV(this._pendingCalls,r),this._pendingCalls.add(n),a.changed&&wV.batchedUpdates((()=>{a.changed=!y,e?.(r,this),y?A$(s.onRest,r):a.onStart?.(r,this)}))}y&&this._set(_),f?n(q$(t.to,t,this._state,this)):S?this._start():nW(this)&&!p?this._pendingCalls.add(n):n($$(_))}_focus(e){let t=this.animation;e!==t.to&&(UH(this)&&this._detach(),t.to=e,UH(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;FH(t)&&(WH(t,this),X$(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;FH(e)&&GH(e,this)}_set(e,t=!0){let n=zH(e);if(!VV.und(n)){let e=d$(this);if(!e||!HV(n,e.getValue())){let r=x$(n);e&&e.constructor==r?e.setValue(n):h$(this,r.create(n)),e&&wV.batchedUpdates((()=>{this._onChange(n,t)}))}}return d$(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,pW(this,"onStart",W$(this,aW(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),A$(this.animation.onChange,e,this)),A$(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){let e=this.animation;d$(this).reset(zH(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),nW(this)||(oW(this,!0),rW(this)||this._resume())}_resume(){zV.skipAnimation?this.finish():sH.start(this)}_stop(e,t){if(nW(this)){oW(this,!1);let n=this.animation;$V(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),VH(this,{type:"idle",parent:this});let r=t?G$(this.get()):W$(this.get(),aW(this,e??n.to));JV(this._pendingCalls,r),n.changed&&(n.changed=!1,pW(this,"onRest",r,this))}}};function aW(e,t){let n=M$(t);return HV(M$(e.get()),n)}function lW(e,t=e.loop,n=e.to){let r=A$(t);if(r){let o=!0!==r&&D$(r),i=(o||e).reverse,s=!o||o.reset;return cW({...e,loop:t,default:!1,pause:void 0,to:!i||P$(n)?n:void 0,from:s?e.from:void 0,reset:s,...o})}}function cW(e){let{to:t,from:n}=e=D$(e),r=new Set;return VV.obj(t)&&uW(t,r),VV.obj(n)&&uW(n,r),e.keys=r.size?Array.from(r):null,e}function uW(e,t){WV(e,((e,n)=>null!=e&&t.add(n)))}var dW=["onStart","onRest","onChange","onPause","onResume"];function hW(e,t,n){e.animation[n]=t[n]!==j$(t,n)?I$(t[n],e.key):void 0}function pW(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var fW=["onStart","onChange","onRest"],mW=1,gW=class{id=mW++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,t){this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(let t in e){let n=e[t];VV.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(cW(e)),this}start(e){let{queue:t}=this;return e?t=GV(e).map(cW):this.queue=[],this._flush?this._flush(this,t):(vW(this,t),function(e,t){return Promise.all(t.map((t=>bW(e,t)))).then((t=>H$(e,t)))}(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let n=this.springs;$V(GV(t),(t=>n[t].stop(!!e)))}else K$(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(VV.und(e))this.start({pause:!0});else{let t=this.springs;$V(GV(e),(e=>t[e].pause()))}return this}resume(e){if(VV.und(e))this.start({pause:!1});else{let t=this.springs;$V(GV(e),(e=>t[e].resume()))}return this}each(e){WV(this.springs,e)}_onFrame(){let{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,o=this._changed.size>0;(r&&!this._started||o&&!this._started)&&(this._started=!0,qV(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));let i=!r&&this._started,s=o||i&&n.size?this.get():null;o&&t.size&&qV(t,(([e,t])=>{t.value=s,e(t,this,this._item)})),i&&(this._started=!1,qV(n,(([e,t])=>{t.value=s,e(t,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}wV.onFrame(this._onFrame)}};async function bW(e,t,n){let{keys:r,to:o,from:i,loop:s,onRest:a,onResolve:l}=t,c=VV.obj(t.default)&&t.default;s&&(t.loop=!1),!1===o&&(t.to=null),!1===i&&(t.from=null);let u=VV.arr(o)||VV.fun(o)?o:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):$V(fW,(n=>{let r=t[n];if(VV.fun(r)){let o=e._events[n];t[n]=({finished:e,cancelled:t})=>{let n=o.get(r);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):o.set(r,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));let d=e._state;t.pause===!d.paused?(d.paused=t.pause,JV(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);let h=(r||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),p=!0===t.cancel||!0===j$(t,"cancel");(u||p&&d.asyncId)&&h.push(V$(++e._lastAsyncId,{props:t,state:d,actions:{pause:UV,resume:UV,start(t,n){p?(K$(d,e._lastAsyncId),n(G$(e))):(t.onRest=a,n(q$(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));let f=H$(e,await Promise.all(h));if(s&&f.finished&&(!n||!f.noop)){let n=lW(t,s,o);if(n)return vW(e,[n]),bW(e,n,!0)}return l&&wV.batchedUpdates((()=>l(f,e,e.item))),f}function vW(e,t){$V(t,(t=>{!function(e,t,n){t.keys&&$V(t.keys,(r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)}))}(e.springs,t,(t=>function(e,t){let n=new sW;return n.key=e,t&&WH(n,t),n}(t,e)))}))}var yW=({children:e,...t})=>{let n=(0,k.useContext)(_W),r=t.pause||!!n.pause,o=t.immediate||!!n.immediate;t=function(e,t){let[n]=(0,k.useState)((()=>({inputs:t,result:e()}))),r=(0,k.useRef)(),o=r.current,i=o;return i?Boolean(t&&i.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n{r.current=i,o==n&&(n.inputs=n.result=void 0)}),[i]),i.result}((()=>({pause:r,immediate:o})),[r,o]);let{Provider:i}=_W;return k.createElement(i,{value:t},e)},_W=function(e,t){return Object.assign(e,k.createContext({})),e.Provider._context=e,e.Consumer._context=e,e}(yW);yW.Provider=_W.Provider,yW.Consumer=_W.Consumer;var xW=class extends Q${constructor(e,t){super(),this.source=e,this.calc=jH(...t);let n=this._get(),r=x$(n);h$(this,r.create(n))}key;idle=!0;calc;_active=new Set;advance(e){let t=this._get();HV(t,this.get())||(d$(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&kW(this._active)&&CW(this)}_get(){let e=VV.arr(this.source)?this.source.map(zH):GV(zH(this.source));return this.calc(...e)}_start(){this.idle&&!kW(this._active)&&(this.idle=!1,$V(p$(this),(e=>{e.done=!1})),zV.skipAnimation?(wV.batchedUpdates((()=>this.advance())),CW(this)):sH.start(this))}_attach(){let e=1;$V(GV(this.source),(t=>{FH(t)&&WH(t,this),X$(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){$V(GV(this.source),(e=>{FH(e)&&GH(e,this)})),this._active.clear(),CW(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=GV(this.source).reduce(((e,t)=>Math.max(e,(X$(t)?t.priority:0)+1)),0))}};function wW(e){return!1!==e.idle}function kW(e){return!e.size||Array.from(e).every(wW)}function CW(e){e.idle||(e.idle=!0,$V(p$(e),(e=>{e.done=!0})),VH(e,{type:"idle",parent:e}))}zV.assign({createStringInterpolator:r$,to:(e,t)=>new xW(e,t)}),sH.advance;var SW=n(44059),AW=/^--/;function EW(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||AW.test(e)||jW.hasOwnProperty(e)&&jW[e]?(""+t).trim():t+"px"}var IW={},jW={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},TW=["Webkit","Ms","Moz","O"];jW=Object.keys(jW).reduce(((e,t)=>(TW.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),jW);var BW=/^(matrix|translate|scale|rotate|skew)/,RW=/^(translate)/,NW=/^(rotate|skew)/,DW=(e,t)=>VV.num(e)&&0!==e?e+t:e,MW=(e,t)=>VV.arr(e)?e.every((e=>MW(e,t))):VV.num(e)?e===t:parseFloat(e)===t,PW=class extends v${constructor({x:e,y:t,z:n,...r}){let o=[],i=[];(e||t||n)&&(o.push([e||0,t||0,n||0]),i.push((e=>[`translate3d(${e.map((e=>DW(e,"px"))).join(",")})`,MW(e,0)]))),WV(r,((e,t)=>{if("transform"===t)o.push([e||""]),i.push((e=>[e,""===e]));else if(BW.test(t)){if(delete r[t],VV.und(e))return;let n=RW.test(t)?"px":NW.test(t)?"deg":"";o.push(GV(e)),i.push("rotate3d"===t?([e,t,r,o])=>[`rotate3d(${e},${t},${r},${DW(o,n)})`,MW(o,0)]:e=>[`${t}(${e.map((e=>DW(e,n))).join(",")})`,MW(e,t.startsWith("scale")?1:0)])}})),o.length&&(r.transform=new OW(o,i)),super(r)}},OW=class extends HH{constructor(e,t){super(),this.inputs=e,this.transforms=t}_value=null;get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return $V(this.inputs,((n,r)=>{let o=zH(n[0]),[i,s]=this.transforms[r](VV.arr(o)?o:n.map(zH));e+=" "+i,t=t&&s})),t?"none":e}observerAdded(e){1==e&&$V(this.inputs,(e=>$V(e,(e=>FH(e)&&WH(e,this)))))}observerRemoved(e){0==e&&$V(this.inputs,(e=>$V(e,(e=>FH(e)&&GH(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),VH(this,e)}};zV.assign({batchedUpdates:SW.unstable_batchedUpdates,createStringInterpolator:r$,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}});var LW=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new v$(e)),getComponentProps:r=(e=>e)}={})=>{let o={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},i=e=>{let t=S$(e)||"Anonymous";return(e=VV.str(e)?i[e]||(i[e]=w$(e,o)):e[C$]||(e[C$]=w$(e,o))).displayName=`Animated(${t})`,e};return WV(e,((t,n)=>{VV.arr(e)&&(n=S$(t)),i[n]=i(t)})),{animated:i}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;let n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,{style:r,children:o,scrollTop:i,scrollLeft:s,viewBox:a,...l}=t,c=Object.values(l),u=Object.keys(l).map((t=>n||e.hasAttribute(t)?t:IW[t]||(IW[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==o&&(e.textContent=o);for(let t in r)if(r.hasOwnProperty(t)){let n=EW(t,r[t]);AW.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==i&&(e.scrollTop=i),void 0!==s&&(e.scrollLeft=s),void 0!==a&&e.setAttribute("viewBox",a)},createAnimatedStyle:e=>new PW(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),FW=LW.animated,zW=n(17116);function UW(e){return{top:e.offsetTop,left:e.offsetLeft}}const VW=function({triggerAnimationOnChange:e,clientId:t}){const n=(0,k.useRef)(),{isTyping:r,getGlobalBlockCount:o,isBlockSelected:i,isFirstMultiSelectedBlock:s,isBlockMultiSelected:a,isAncestorMultiSelected:l}=(0,Ul.A)(dy),{previous:c,prevRect:u}=(0,k.useMemo)((()=>({previous:n.current&&UW(n.current),prevRect:n.current&&n.current.getBoundingClientRect()})),[e]);return(0,k.useLayoutEffect)((()=>{if(!c||!n.current)return;const e=(0,zW.A)(n.current),d=i(t),h=d||s(t);function p(){if(h&&u){const t=n.current.getBoundingClientRect().top-u.top;t&&(e.scrollTop+=t)}}if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||r()||o()>200)return void p();const f=d||a(t)||l(t)?"1":"",m=new gW({x:0,y:0,config:{mass:5,tension:2e3,friction:200},onChange({value:e}){if(!n.current)return;let{x:t,y:r}=e;t=Math.round(t),r=Math.round(r);const o=0===t&&0===r;n.current.style.transformOrigin="center center",n.current.style.transform=o?null:`translate3d(${t}px,${r}px,0)`,n.current.style.zIndex=f,p()}});n.current.style.transform=void 0;const g=UW(n.current),b=Math.round(c.left-g.left),v=Math.round(c.top-g.top);return m.start({x:0,y:0,from:{x:b,y:v}}),()=>{m.stop(),m.set({x:0,y:0})}}),[c,u,t,r,o,i,s,a,l]),n};var HW=n(30815),$W=n(57110),WW=n(67430);const GW=".block-editor-block-list__block",qW=".block-list-appender",KW=".block-editor-button-block-appender";function YW(e,t){return e.closest(GW)===t.closest(GW)}function JW(e,t){return t.closest([GW,qW,KW].join(","))===e}function XW(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(GW);return t?t.id.slice(6):void 0}function ZW({clientId:e,initialPosition:t}){const n=(0,k.useRef)(),{isBlockSelected:r,isMultiSelecting:o,__unstableGetEditorMode:i}=(0,Ul.A)(dy);return(0,k.useEffect)((()=>{if(!r(e)||o()||"zoom-out"===i())return;if(null==t)return;if(!n.current)return;const{ownerDocument:s}=n.current;if(JW(n.current,s.activeElement))return;const a=ME.focus.tabbable.find(n.current).filter((e=>(0,HW.A)(e))),l=-1===t,c=a[l?a.length-1:0]||n.current;if(JW(n.current,c)){if(!n.current.getAttribute("contenteditable")){const e=ME.focus.tabbable.findNext(n.current);if(e&&JW(n.current,e)&&(0,$W.A)(e))return void e.focus()}(0,WW.A)(c,l)}else n.current.focus()}),[t,e]),n}function QW(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function eG(e){const{isBlockSelected:t}=(0,Ul.A)(dy),{selectBlock:n,selectionChange:r}=(0,Vl.A)(dy);return(0,zC.A)((o=>{function i(i){o.parentElement.closest('[contenteditable="true"]')||(t(e)?i.target.isContentEditable||r(e):JW(o,i.target)&&n(e))}return o.addEventListener("focusin",i),()=>{o.removeEventListener("focusin",i)}}),[t,n])}function tG({clientId:e,isSelected:t}){const{getBlockRootClientId:n,getBlockIndex:r}=(0,Ul.A)(dy),{insertAfterBlock:o,removeBlock:i}=(0,Vl.A)(dy);return(0,zC.A)((n=>{if(t)return n.addEventListener("keydown",r),n.addEventListener("dragstart",s),()=>{n.removeEventListener("keydown",r),n.removeEventListener("dragstart",s)};function r(t){const{keyCode:r,target:s}=t;r!==VE.ENTER&&r!==VE.BACKSPACE&&r!==VE.DELETE||s!==n||(0,HW.A)(s)||(t.preventDefault(),r===VE.ENTER?o(e):i(e))}function s(e){e.preventDefault()}}),[e,t,n,r,o,i])}function nG(e){const{isNavigationMode:t,isBlockSelected:n}=(0,Ul.A)(dy),{setNavigationMode:r,selectBlock:o}=(0,Vl.A)(dy);return(0,zC.A)((i=>{function s(i){t()&&!i.defaultPrevented&&(i.preventDefault(),n(e)?r(!1):o(e))}return i.addEventListener("mousedown",s),()=>{i.removeEventListener("mousedown",s)}}),[e,t,n,r])}function rG(){const e=(0,k.useContext)(jG);return(0,zC.A)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function oG({isSelected:e}){const t=(0,Cx.A)();return(0,zC.A)((n=>{if(e){const{ownerDocument:e}=n,{defaultView:r}=e;if(!r.IntersectionObserver)return;const o=new r.IntersectionObserver((e=>{e[0].isIntersecting||n.scrollIntoView({behavior:t?"instant":"smooth"}),o.disconnect()}));return o.observe(n),()=>{o.disconnect()}}}),[e])}function iG({clientId:e="",isEnabled:t=!0}={}){const{getEnabledClientIdsTree:n}=kf((0,Ul.A)(dy));return(0,zC.A)((r=>{if(!t)return;const o=t=>{(t.target===r||t.target.classList.contains("is-root-container"))&&(t.defaultPrevented||(t.preventDefault(),n(e).forEach((({clientId:e})=>{const t=r.querySelector(`[data-block="${e}"]`);t&&(t.classList.remove("has-editable-outline"),t.offsetWidth,t.classList.add("has-editable-outline"))}))))};return r.addEventListener("click",o),()=>r.removeEventListener("click",o)}),[t])}function sG(e={},{__unstableIsHtml:t}={}){const{clientId:n,className:r,wrapperProps:o={},isAligned:i,index:s,mode:a,name:l,blockApiVersion:c,blockTitle:u,isSelected:d,isSubtreeDisabled:h,hasOverlay:p,initialPosition:f,blockEditingMode:m,isHighlighted:g,isMultiSelected:b,isPartiallySelected:v,isReusable:y,isDragging:_,hasChildSelected:x,isBlockMovingMode:w,canInsertMovingBlock:C,isEditingDisabled:S,hasEditableOutline:A,isTemporarilyEditingAsBlocks:E,defaultClassName:I,templateLock:j}=(0,k.useContext)(aV),T=(0,H.sprintf)((0,H.__)("Block: %s"),u),B="html"!==a||t?"":"-visual",R=(0,Qk.A)([e.ref,ZW({clientId:n,initialPosition:f}),$C(n),eG(n),tG({clientId:n,isSelected:d}),nG(n),(0,zC.A)((e=>(e.addEventListener("mouseout",QW),e.addEventListener("mouseover",QW),()=>{e.removeEventListener("mouseout",QW),e.removeEventListener("mouseover",QW),e.classList.remove("is-hovered")})),[]),rG(),VW({triggerAnimationOnChange:s,clientId:n}),_V({isDisabled:!p}),iG({clientId:n,isEnabled:"core/block"===l||"contentOnly"===j}),oG({isSelected:d})]),N=Zp(),D=N[qp]&&xz(l)?{"--wp-admin-theme-color":"var(--wp-block-synced-color)","--wp-admin-theme-color--rgb":"var(--wp-block-synced-color--rgb)"}:{};c<2&&n===N.clientId&&!0===globalThis.SCRIPT_DEBUG&&(0,f_.default)(`Block type "${l}" must support API version 2 or higher to work correctly with "useBlockProps" method.`);let M=!1;return"-"!==o?.style?.marginTop?.charAt(0)&&"-"!==o?.style?.marginBottom?.charAt(0)&&"-"!==o?.style?.marginLeft?.charAt(0)&&"-"!==o?.style?.marginRight?.charAt(0)||(M=!0),{tabIndex:"disabled"===m?-1:0,...o,...e,ref:R,id:`block-${n}${B}`,role:"document","aria-label":T,"data-block":n,"data-type":l,"data-title":u,inert:h?"true":void 0,className:(0,Hy.A)("block-editor-block-list__block",{"wp-block":!i,"has-block-overlay":p,"is-selected":d,"is-highlighted":g,"is-multi-selected":b,"is-partially-selected":v,"is-reusable":y,"is-dragging":_,"has-child-selected":x,"is-block-moving-mode":w,"can-insert-moving-block":C,"is-editing-disabled":S,"has-editable-outline":A,"has-negative-margin":M,"is-content-locked-temporarily-editing-as-blocks":E},r,e.className,o.className,I),style:{...o.style,...e.style,...D}}}function aG({children:e,isHtml:t,...n}){return(0,jd.jsx)("div",{...sG(n,{__unstableIsHtml:t}),children:e})}function lG({block:{__unstableBlockSource:e},mode:t,isLocked:n,canRemove:r,clientId:o,isSelected:i,isSelectionEnabled:s,className:a,__unstableLayoutClassNames:l,name:c,isValid:u,attributes:d,wrapperProps:h,setAttributes:p,onReplace:f,onInsertBlocksAfter:m,onMerge:g,toggleSelection:b}){var v;const{mayDisplayControls:y,mayDisplayParentControls:_,themeSupportsLayout:x,...w}=(0,k.useContext)(aV),{removeBlock:C}=(0,Vl.A)(dy),S=(0,k.useCallback)((()=>C(o)),[o,C]),A=mS()||{};let E=(0,jd.jsx)(lV,{name:c,isSelected:i,attributes:d,setAttributes:p,insertBlocksAfter:n?void 0:m,onReplace:r?f:void 0,onRemove:r?S:void 0,mergeBlocks:r?g:void 0,clientId:o,isSelectionEnabled:s,toggleSelection:b,__unstableLayoutClassNames:l,__unstableParentLayout:Object.keys(A).length?A:void 0,mayDisplayControls:y,mayDisplayParentControls:_,blockEditingMode:w.blockEditingMode,isPreviewMode:w.isPreviewMode});const I=Sc(c);I?.getEditWrapperProps&&(h=function(e,t){const n={...e,...t};return e?.hasOwnProperty("className")&&t?.hasOwnProperty("className")&&(n.className=(0,Hy.A)(e.className,t.className)),e?.hasOwnProperty("style")&&t?.hasOwnProperty("style")&&(n.style={...e.style,...t.style}),n}(h,I.getEditWrapperProps(d)));const j=h&&!!h["data-align"]&&!x,T=a?.includes("is-position-sticky");let B;if(j&&(E=(0,jd.jsx)("div",{className:(0,Hy.A)("wp-block",T&&a),"data-align":h["data-align"],children:E})),u)B="html"===t?(0,jd.jsxs)(jd.Fragment,{children:[(0,jd.jsx)("div",{style:{display:"none"},children:E}),(0,jd.jsx)(aG,{isHtml:!0,children:(0,jd.jsx)(yV,{clientId:o})})]}):I?.apiVersion>1?E:(0,jd.jsx)(aG,{children:E});else{const t=e?Id(e):Pd(I,d);B=(0,jd.jsxs)(aG,{className:"has-warning",children:[(0,jd.jsx)(pV,{clientId:o}),(0,jd.jsx)(Ad.A,{children:(0,ZU.A)(t)})]})}const{"data-align":R,...N}=null!==(v=h)&&void 0!==v?v:{},D={...N,className:(0,Hy.A)(N.className,R&&x&&`align${R}`,!(R&&T)&&a)};return(0,jd.jsx)(aV.Provider,{value:{wrapperProps:D,isAligned:j,...w},children:(0,jd.jsx)(bV,{fallback:(0,jd.jsx)(aG,{className:"has-warning",children:(0,jd.jsx)(mV,{})}),children:B})})}sG.save=Dd;const cG=(0,UE.A)(((e,t,n)=>{const{updateBlockAttributes:r,insertBlocks:o,mergeBlocks:i,replaceBlocks:s,toggleSelection:a,__unstableMarkLastChangeAsPersistent:l,moveBlocksToPosition:c,removeBlock:u,selectBlock:d}=e(dy);return{setAttributes(e){const{getMultiSelectedBlockClientIds:o}=n.select(dy),i=o(),{clientId:s}=t,a=i.length?i:[s];r(a,e)},onInsertBlocks(e,n){const{rootClientId:r}=t;o(e,n,r)},onInsertBlocksAfter(e){const{clientId:r,rootClientId:i}=t,{getBlockIndex:s}=n.select(dy),a=s(r);o(e,a+1,i)},onMerge(e){const{clientId:r,rootClientId:a}=t,{getPreviousBlockClientId:l,getNextBlockClientId:h,getBlock:p,getBlockAttributes:f,getBlockName:m,getBlockOrder:g,getBlockIndex:b,getBlockRootClientId:v,canInsertBlockType:y}=n.select(dy);function _(){const e=p(r),t=Cc();if(m(r)!==t){const n=dd(e,t);n&&n.length&&s(r,n)}else if(Dc(e)){const e=h(r);e&&n.batch((()=>{u(r),d(e)}))}}function x(e,t=!0){const r=v(e),i=g(e),[s]=i;1===i.length&&Nc(p(s))?u(e):n.batch((()=>{if(y(m(s),r))c([s],e,r,b(e));else{const n=dd(p(s),Cc());n&&n.length&&n.every((e=>y(e.name,r)))?(o(n,b(e),r,t),u(s,!1)):_()}!g(e).length&&Nc(p(e))&&u(e,!1)}))}if(e){if(a){const e=h(a);if(e){if(m(a)!==m(e))return void i(a,e);{const t=f(a),r=f(e);if(Object.keys(t).every((e=>t[e]===r[e])))return void n.batch((()=>{c(g(e),e,a),u(e,!1)}))}}}const e=h(r);if(!e)return;g(e).length?x(e,!1):i(r,e)}else{const e=l(r);if(e)i(e,r);else if(a){const e=l(a);if(e&&m(a)===m(e)){const t=f(a),r=f(e);if(Object.keys(t).every((e=>t[e]===r[e])))return void n.batch((()=>{c(g(a),a,e),u(a,!1)}))}x(a)}else _()}},onReplace(e,n,r){e.length&&!Dc(e[e.length-1])&&l();const o=1===e?.length&&Array.isArray(e[0])?e[0]:e;s([t.clientId],o,n,r)},toggleSelection(e){a(e)}}}));lG=(0,D.A)(cG,zE("editor.BlockListBlock"))(lG);const uG=(0,k.memo)((function(e){const{clientId:t,rootClientId:n}=e,r=(0,Ul.A)((e=>{const{isBlockSelected:r,getBlockMode:o,isSelectionEnabled:i,getTemplateLock:s,getBlockWithoutAttributes:a,getBlockAttributes:l,canRemoveBlock:c,canMoveBlock:u,getSettings:d,getTemporarilyEditingAsBlocks:h,getBlockEditingMode:p,getBlockName:f,isFirstMultiSelectedBlock:m,getMultiSelectedBlockClientIds:g,hasSelectedInnerBlock:b,getBlocksByName:v,getBlockIndex:y,isBlockMultiSelected:_,isBlockSubtreeDisabled:x,isBlockHighlighted:w,__unstableIsFullySelected:k,__unstableSelectionHasUnmergeableBlock:C,isBlockBeingDragged:S,isDragging:A,hasBlockMovingClientId:E,canInsertBlockType:I,__unstableHasActiveBlockOverlayActive:j,__unstableGetEditorMode:T,getSelectedBlocksInitialCaretPosition:B}=kf(e(dy)),R=a(t);if(!R)return;const{hasBlockSupport:N,getActiveBlockVariation:D}=e(ed),M=l(t),{name:P,isValid:O}=R,L=Sc(P),{supportsLayout:F,__unstableIsPreviewMode:z}=d(),U=L?.apiVersion>1,V={isPreviewMode:z,blockWithoutAttributes:R,name:P,attributes:M,isValid:O,themeSupportsLayout:F,index:y(t),isReusable:jc(L),className:U?M.className:void 0,defaultClassName:U?Td(P):void 0,blockTitle:L?.title};if(z)return V;const H=r(t),$=c(t,n),W=u(t,n),G=D(P,M),q=_(t),K=b(t,!0),Y=E(),J=p(t),X=Ic(P,"multiple",!0)?[]:v(P),Z=X.length&&X[0]!==t;return{...V,mode:o(t),isSelectionEnabled:i(),isLocked:!!s(n),templateLock:s(t),canRemove:$,canMove:W,isSelected:H,isTemporarilyEditingAsBlocks:h()===t,blockEditingMode:J,mayDisplayControls:H||m(t)&&g().every((e=>f(e)===P)),mayDisplayParentControls:N(f(t),"__experimentalExposeControlsToChildren",!1)&&b(t),blockApiVersion:L?.apiVersion||1,blockTitle:G?.title||L?.title,isSubtreeDisabled:"disabled"===J&&x(t),hasOverlay:j(t)&&!A(),initialPosition:!H||"edit"!==T()&&"zoom-out"!==T()?void 0:B(),isHighlighted:w(t),isMultiSelected:q,isPartiallySelected:q&&!k()&&!C(),isDragging:S(t),hasChildSelected:K,isBlockMovingMode:!!Y,canInsertMovingBlock:Y&&I(f(Y),n),isEditingDisabled:"disabled"===J,hasEditableOutline:"disabled"!==J&&"disabled"===p(n),originalBlockClientId:!!Z&&X[0]}}),[t,n]),{isPreviewMode:o,mode:i="visual",isSelectionEnabled:s=!1,isLocked:a=!1,canRemove:l=!1,canMove:c=!1,blockWithoutAttributes:u,name:d,attributes:h,isValid:p,isSelected:f=!1,themeSupportsLayout:m,isTemporarilyEditingAsBlocks:g,blockEditingMode:b,mayDisplayControls:v,mayDisplayParentControls:y,index:_,blockApiVersion:x,blockTitle:w,isSubtreeDisabled:C,hasOverlay:S,initialPosition:A,isHighlighted:E,isMultiSelected:I,isPartiallySelected:j,isReusable:T,isDragging:B,hasChildSelected:R,isBlockMovingMode:N,canInsertMovingBlock:D,templateLock:M,isEditingDisabled:P,hasEditableOutline:O,className:L,defaultClassName:F,originalBlockClientId:z}=r,U=(0,k.useMemo)((()=>({...u,attributes:h})),[u,h]);if(!r)return null;const V={isPreviewMode:o,clientId:t,className:L,index:_,mode:i,name:d,blockApiVersion:x,blockTitle:w,isSelected:f,isSubtreeDisabled:C,hasOverlay:S,initialPosition:A,blockEditingMode:b,isHighlighted:E,isMultiSelected:I,isPartiallySelected:j,isReusable:T,isDragging:B,hasChildSelected:R,isBlockMovingMode:N,canInsertMovingBlock:D,templateLock:M,isEditingDisabled:P,hasEditableOutline:O,isTemporarilyEditingAsBlocks:g,defaultClassName:F,mayDisplayControls:v,mayDisplayParentControls:y,originalBlockClientId:z,themeSupportsLayout:m};return(0,jd.jsx)(aV.Provider,{value:V,children:(0,jd.jsx)(lG,{...e,mode:i,isSelectionEnabled:s,isLocked:a,canRemove:l,canMove:c,block:U,name:d,attributes:h,isValid:p,isSelected:f})})})),dG="\ufeff";function hG({rootClientId:e}){const{showPrompt:t,isLocked:n,placeholder:r}=(0,Ul.A)((t=>{const{getBlockCount:n,getSettings:r,getTemplateLock:o}=t(dy),i=!n(e),{bodyPlaceholder:s}=r();return{showPrompt:i,isLocked:!!o(e),placeholder:s}}),[e]),{insertDefaultBlock:o,startTyping:i}=(0,Vl.A)(dy);if(n)return null;const s=(0,Qa.decodeEntities)(r)||(0,H.__)("Type / to choose a block"),a=()=>{o(void 0,e),i()};return(0,jd.jsxs)("div",{"data-root-client-id":e||"",className:(0,Hy.A)("block-editor-default-block-appender",{"has-visible-prompt":t}),children:[(0,jd.jsx)("p",{tabIndex:"0",role:"button","aria-label":(0,H.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{VE.ENTER!==e.keyCode&&VE.SPACE!==e.keyCode||a()},onClick:()=>a(),onFocus:()=>{t&&a()},children:t?s:dG}),(0,jd.jsx)(sJ,{rootClientId:e,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0})]})}function pG({rootClientId:e}){return(0,Ul.A)((t=>t(dy).canInsertBlockType(Cc(),e)))?(0,jd.jsx)(hG,{rootClientId:e}):(0,jd.jsx)(cJ,{rootClientId:e,className:"block-list-appender__toggle"})}function fG({rootClientId:e,CustomAppender:t,className:n,tagName:r="div"}){const o=(0,Ul.A)((t=>{const{getBlockInsertionPoint:n,isBlockInsertionPointVisible:r,getBlockCount:o}=t(dy),i=n();return r()&&e===i?.rootClientId&&0===o(e)}),[e]);return(0,jd.jsx)(r,{tabIndex:-1,className:(0,Hy.A)("block-list-appender wp-block",n,{"is-drag-over":o}),contentEditable:!1,"data-block":!0,children:t?(0,jd.jsx)(t,{}):(0,jd.jsx)(pG,{rootClientId:e})})}const mG=Number.MAX_SAFE_INTEGER;(0,k.createContext)();const gG=function({previousClientId:e,nextClientId:t,children:n,__unstablePopoverSlot:r,__unstableContentRef:o,operation:i="insert",nearestSide:s="right",...a}){const[l,c]=(0,k.useReducer)((e=>(e+1)%mG),0),{orientation:u,rootClientId:d,isVisible:h}=(0,Ul.A)((n=>{const{getBlockListSettings:r,getBlockRootClientId:o,isBlockVisible:i}=n(dy),s=o(null!=e?e:t);return{orientation:r(s)?.orientation||"vertical",rootClientId:s,isVisible:i(e)&&i(t)}}),[e,t]),p=GC(e),f=GC(t),m="vertical"===u,g=(0,k.useMemo)((()=>{if(!(l<0||!p&&!f)&&h)return{contextElement:"group"===i?f||p:p||f,getBoundingClientRect(){const e=p?p.getBoundingClientRect():null,t=f?f.getBoundingClientRect():null;let n=0,r=0,o=0,a=0;if("group"===i){const i=t||e;r=i.top,o=0,a=i.bottom-i.top,n="left"===s?i.left-2:i.right-2}else m?(r=e?e.bottom:t.top,o=e?e.width:t.width,a=t&&e?t.top-e.bottom:0,n=e?e.left:t.left):(r=e?e.top:t.top,a=e?e.height:t.height,(0,H.isRTL)()?(n=t?t.right:e.left,o=e&&t?e.left-t.right:0):(n=e?e.right:t.left,o=e&&t?t.left-e.right:0));return new window.DOMRect(n,r,o,a)}}}),[p,f,l,m,h,i,s]),b=KC(o);return(0,k.useLayoutEffect)((()=>{if(!p)return;const e=new window.MutationObserver(c);return e.observe(p,{attributes:!0}),()=>{e.disconnect()}}),[p]),(0,k.useLayoutEffect)((()=>{if(!f)return;const e=new window.MutationObserver(c);return e.observe(f,{attributes:!0}),()=>{e.disconnect()}}),[f]),(0,k.useLayoutEffect)((()=>{if(p)return p.ownerDocument.defaultView.addEventListener("resize",c),()=>{p.ownerDocument.defaultView?.removeEventListener("resize",c)}}),[p]),(p||f)&&h?(0,jd.jsx)(qC.Ay,{ref:b,animate:!1,anchor:g,focusOnMount:!1,__unstableSlotName:r,inline:!r,...a,className:(0,Hy.A)("block-editor-block-popover","block-editor-block-popover__inbetween",a.className),resize:!1,flip:!1,placement:"overlay",variant:"unstyled",children:(0,jd.jsx)("div",{className:"block-editor-block-popover__inbetween-container",children:n})},t+"--"+d):null},bG={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}},vG=function({__unstablePopoverSlot:e,__unstableContentRef:t}){const{clientId:n}=(0,Ul.A)((e=>{const{getBlockOrder:t,getBlockInsertionPoint:n}=e(dy),r=n(),o=t(r.rootClientId);return o.length?{clientId:o[r.index]}:{}}),[]),r=(0,Cx.A)();return(0,jd.jsx)(QC,{clientId:n,__unstablePopoverSlot:e,__unstableContentRef:t,className:"block-editor-block-popover__drop-zone",children:(0,jd.jsx)(kx.P.div,{"data-testid":"block-popover-drop-zone",initial:r?bG.show:bG.hide,animate:bG.show,exit:r?bG.show:bG.exit,className:"block-editor-block-popover__drop-zone-foreground"})})},yG=(0,k.createContext)();function _G({__unstablePopoverSlot:e,__unstableContentRef:t,operation:n="insert",nearestSide:r="right"}){const{selectBlock:o,hideInsertionPoint:i}=(0,Vl.A)(dy),s=(0,k.useContext)(yG),a=(0,k.useRef)(),{orientation:l,previousClientId:c,nextClientId:u,rootClientId:d,isInserterShown:h,isDistractionFree:p,isNavigationMode:f}=(0,Ul.A)((e=>{const{getBlockOrder:t,getBlockListSettings:n,getBlockInsertionPoint:r,isBlockBeingDragged:o,getPreviousBlockClientId:i,getNextBlockClientId:s,getSettings:a,isNavigationMode:l}=e(dy),c=r(),u=t(c.rootClientId);if(!u.length)return{};let d=u[c.index-1],h=u[c.index];for(;o(d);)d=i(d);for(;o(h);)h=s(h);const p=a();return{previousClientId:d,nextClientId:h,orientation:n(c.rootClientId)?.orientation||"vertical",rootClientId:c.rootClientId,isNavigationMode:l(),isDistractionFree:p.isDistractionFree,isInserterShown:c?.__unstableWithInserter}}),[]),{getBlockEditingMode:m}=(0,Ul.A)(dy),g=(0,Cx.A)(),b={start:{opacity:0,scale:0},rest:{opacity:1,scale:1,transition:{delay:h?.5:0,type:"tween"}},hover:{opacity:1,scale:1,transition:{delay:.5,type:"tween"}}},v={start:{scale:g?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(p&&!f)return null;const y="horizontal"===l||"group"===n?"is-horizontal":"is-vertical",_=(0,Hy.A)("block-editor-block-list__insertion-point",y);return(0,jd.jsx)(gG,{previousClientId:c,nextClientId:u,__unstablePopoverSlot:e,__unstableContentRef:t,operation:n,nearestSide:r,children:(0,jd.jsxs)(kx.P.div,{layout:!g,initial:g?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:a,tabIndex:-1,onClick:function(e){e.target===a.current&&u&&"disabled"!==m(u)&&o(u,-1)},onFocus:function(e){e.target!==a.current&&(s.current=!0)},className:(0,Hy.A)(_,{"is-with-inserter":h}),onHoverEnd:function(e){e.target!==a.current||s.current||i()},children:[(0,jd.jsx)(kx.P.div,{variants:b,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),h&&(0,jd.jsx)(kx.P.div,{variants:v,className:(0,Hy.A)("block-editor-block-list__insertion-point-inserter"),children:(0,jd.jsx)(sJ,{position:"bottom center",clientId:u,rootClientId:d,__experimentalIsQuick:!0,onToggle:e=>{s.current=e},onSelectOrClose:()=>{s.current=!1}})})]})})}function xG(e){const{insertionPoint:t,isVisible:n,isBlockListEmpty:r}=(0,Ul.A)((e=>{const{getBlockInsertionPoint:t,isBlockInsertionPointVisible:n,getBlockCount:r}=e(dy),o=t();return{insertionPoint:o,isVisible:n(),isBlockListEmpty:0===r(o?.rootClientId)}}),[]);return!n||r?null:"replace"===t.operation?(0,jd.jsx)(vG,{...e},`${t.rootClientId}-${t.index}`):(0,jd.jsx)(_G,{operation:t.operation,nearestSide:t.nearestSide,...e})}function wG(){const e=(0,k.useContext)(yG),t=(0,Ul.A)((e=>e(dy).getSettings().isDistractionFree||"zoom-out"===e(dy).__unstableGetEditorMode()),[]),{getBlockListSettings:n,getBlockIndex:r,isMultiSelecting:o,getSelectedBlockClientIds:i,getTemplateLock:s,__unstableIsWithinBlockOverlay:a,getBlockEditingMode:l,getBlockName:c}=(0,Ul.A)(dy),{showInsertionPoint:u,hideInsertionPoint:d}=(0,Vl.A)(dy);return(0,zC.A)((h=>{if(!t)return h.addEventListener("mousemove",p),()=>{h.removeEventListener("mousemove",p)};function p(t){if(e.current)return;if(t.target.nodeType===t.target.TEXT_NODE)return;if(o())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void d();let h;if(t.target.classList.contains("is-root-container")||(h=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")),s(h)||"disabled"===l(h)||"core/block"===c(h))return;const p=n(h)?.orientation||"vertical",f=t.clientY,m=t.clientX;let g=Array.from(t.target.children).find((e=>{const t=e.getBoundingClientRect();return e.classList.contains("wp-block")&&"vertical"===p&&t.top>f||e.classList.contains("wp-block")&&"horizontal"===p&&((0,H.isRTL)()?t.rightm)}));if(!g)return void d();if(!g.id&&(g=g.firstElementChild,!g))return void d();const b=g.id.slice(6);if(!b||a(b))return;if(i().includes(b))return;const v=g.getBoundingClientRect();if("horizontal"===p&&(t.clientY>v.bottom||t.clientYv.right||t.clientX{if(o)return e.addEventListener("mousedown",i),()=>{e.removeEventListener("mousedown",i)};function i(o){(t()||n())&&o.target===e&&r()}}),[t,n,r,o])}function CG(e){return(0,jd.jsx)("div",{ref:kG(),...e})}const SG=new Set([VE.UP,VE.RIGHT,VE.DOWN,VE.LEFT,VE.ENTER,VE.BACKSPACE]);function AG(){const e=(0,Ul.A)((e=>e(dy).isTyping()),[]),{stopTyping:t}=(0,Vl.A)(dy);return(0,zC.A)((n=>{if(!e)return;const{ownerDocument:r}=n;let o,i;function s(e){const{clientX:n,clientY:r}=e;o&&i&&(o!==n||i!==r)&&t(),o=n,i=r}return r.addEventListener("mousemove",s),()=>{r.removeEventListener("mousemove",s)}}),[e,t])}function EG(){const{isTyping:e}=(0,Ul.A)((e=>{const{isTyping:t}=e(dy);return{isTyping:t()}}),[]),{startTyping:t,stopTyping:n}=(0,Vl.A)(dy),r=AG(),o=(0,zC.A)((r=>{const{ownerDocument:o}=r,{defaultView:i}=o,s=i.getSelection();if(e){let l;function c(e){const{target:t}=e;l=i.setTimeout((()=>{(0,HW.A)(t)||n()}))}function u(e){const{keyCode:t}=e;t!==VE.ESCAPE&&t!==VE.TAB||n()}function d(){s.isCollapsed||n()}return r.addEventListener("focus",c),r.addEventListener("keydown",u),o.addEventListener("selectionchange",d),()=>{i.clearTimeout(l),r.removeEventListener("focus",c),r.removeEventListener("keydown",u),o.removeEventListener("selectionchange",d)}}function a(e){const{type:n,target:o}=e;(0,HW.A)(o)&&r.contains(o)&&("keydown"!==n||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&SG.has(t)}(e))&&t()}return r.addEventListener("keypress",a),r.addEventListener("keydown",a),()=>{r.removeEventListener("keypress",a),r.removeEventListener("keydown",a)}}),[e,t,n]);return(0,Qk.A)([r,o])}const IG=function({children:e}){return(0,jd.jsx)("div",{ref:EG(),children:e})},jG=(0,k.createContext)(),TG=new WeakMap;function BG({className:e,...t}){const n=(0,XU.A)("medium"),{isOutlineMode:r,isFocusMode:o,editorMode:i,temporarilyEditingAsBlocks:s}=(0,Ul.A)((e=>{const{getSettings:t,__unstableGetEditorMode:n,getTemporarilyEditingAsBlocks:r,isTyping:o}=kf(e(dy)),{outlineMode:i,focusMode:s}=t();return{isOutlineMode:i&&!o(),isFocusMode:s,editorMode:n(),temporarilyEditingAsBlocks:r()}}),[]),a=(0,Vp.A)(),{setBlockVisibility:l}=(0,Vl.A)(dy),c=(0,nI.A)((0,k.useCallback)((()=>{const e={};TG.get(a).forEach((([t,n])=>{e[t]=n})),l(e)}),[a]),300,{trailing:!0}),u=(0,k.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{TG.get(a)||TG.set(a,[]);for(const t of e){const e=t.target.getAttribute("data-block");TG.get(a).push([e,t.isIntersecting])}c()}))}),[]),d=jJ({ref:(0,Qk.A)([kG(),wG(),EG()]),className:(0,Hy.A)("is-root-container",e,{"is-outline-mode":r,"is-focus-mode":o&&n,"is-navigate-mode":"navigation"===i})},t);return(0,jd.jsxs)(jG.Provider,{value:u,children:[(0,jd.jsx)("div",{...d}),!!s&&(0,jd.jsx)(RG,{clientId:s})]})}function RG({clientId:e}){const{stopEditingAsBlocks:t}=kf((0,Vl.A)(dy)),n=(0,Ul.A)((t=>{const{isBlockSelected:n,hasSelectedInnerBlock:r}=t(dy);return n(e)||r(e,!0)}),[e]);return(0,k.useEffect)((()=>{n||t(e)}),[n,e,t]),null}function NG(e){return(0,jd.jsx)(Xp,{value:Yp,children:(0,jd.jsx)(BG,{...e})})}const DG=[],MG=new Set;function PG({placeholder:e,rootClientId:t,renderAppender:n,__experimentalAppenderTagName:r,layout:o=hS}){const i=!1!==n,s=!!n,{order:a,selectedBlocks:l,visibleBlocks:c,shouldRenderAppender:u}=(0,Ul.A)((e=>{const{getSettings:n,getBlockOrder:r,getSelectedBlockClientId:o,getSelectedBlockClientIds:a,__unstableGetVisibleBlocks:l,getTemplateLock:c,getBlockEditingMode:u,__unstableGetEditorMode:d}=e(dy),h=r(t);if(n().__unstableIsPreviewMode)return{order:h,selectedBlocks:DG,visibleBlocks:MG};const p=o();return{order:h,selectedBlocks:a(),visibleBlocks:l(),shouldRenderAppender:i&&"zoom-out"!==d()&&(s?!c(t)&&"disabled"!==u(t):t===p||!t&&!p&&!h.length)}}),[t,i,s]);return(0,jd.jsxs)(fS,{value:o,children:[a.map((e=>(0,jd.jsx)(JU.Ay,{value:!c.has(e)&&!l.includes(e),children:(0,jd.jsx)(uG,{rootClientId:t,clientId:e})},e))),a.length<1&&e,u&&(0,jd.jsx)(fG,{tagName:r,rootClientId:t,CustomAppender:n})]})}function OG(e){return(0,jd.jsx)(JU.Ay,{value:!1,children:(0,jd.jsx)(PG,{...e})})}function LG(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:r,getSelectedBlockClientId:o,getSelectedBlocksInitialCaretPosition:i,__unstableIsFullySelected:s}=e(dy);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:r(),selectedBlockClientId:o(),initialPosition:i(),isFullSelection:s()}}function FG(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:r,selectedBlockClientId:o,isFullSelection:i}=(0,Ul.A)(LG,[]);return(0,zC.A)((o=>{const{ownerDocument:s}=o,{defaultView:a}=s;if(null==e)return;if(!r||t)return;const{length:l}=n;l<2||i&&(o.contentEditable=!0,o.focus(),a.getSelection().removeAllRanges())}),[r,t,n,o,e,i])}var zG=n(13149),UG=n(24855),VG=n(91512),HG=n(30967),$G=n(53932);function WG(e,t,n,r){let o,i=ME.focus.focusable.find(n);return t&&i.reverse(),i=i.slice(i.indexOf(e)+1),r&&(o=e.getBoundingClientRect()),i.find((function(e){if(!(e.closest("[inert]")||1===e.children.length&&YW(e,e.firstElementChild)&&"true"===e.firstElementChild.getAttribute("contenteditable"))){if(!ME.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(r){const t=e.getBoundingClientRect();if(t.left>=o.right||t.right<=o.left)return!1}return!0}}))}function GG(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:r,__unstableIsFullySelected:o}=(0,Ul.A)(dy),{selectBlock:i}=(0,Vl.A)(dy);return(0,zC.A)((s=>{let a;function l(){a=null}function c(l){if(l.defaultPrevented)return;const{keyCode:c,target:u,shiftKey:d,ctrlKey:h,altKey:p,metaKey:f}=l,m=c===VE.UP,g=c===VE.DOWN,b=c===VE.LEFT,v=c===VE.RIGHT,y=m||b,_=b||v,x=m||g,w=_||x,k=d||h||p||f,C=x?zG.A:UG.A,{ownerDocument:S}=s,{defaultView:A}=S;if(!w)return;if(r()){if(d)return;if(!o())return;return l.preventDefault(),void(y?i(e()):i(t(),-1))}if(!function(e,t,n){const r=t===VE.UP||t===VE.DOWN,{tagName:o}=e,i=e.getAttribute("type");return r&&!n?"INPUT"!==o||!["date","datetime-local","month","number","range","time","week"].includes(i):"INPUT"===o?["button","checkbox","number","color","file","image","radio","reset","submit"].includes(i):"TEXTAREA"!==o}(u,c,k))return;x?a||(a=(0,VG.A)(A)):a=null;const E=(0,HG.A)(u)?!y:y,{keepCaretInsideBlock:I}=n();if(d)(function(e,t){const n=WG(e,t,s);return n&&XW(n)})(u,y)&&C(u,y)&&(s.contentEditable=!0,s.focus());else if(!x||!(0,zG.A)(u,y)||p&&!(0,UG.A)(u,E)||I){if(_&&A.getSelection().isCollapsed&&(0,UG.A)(u,E)&&!I){const e=WG(u,E,s);(0,WW.A)(e,y),l.preventDefault()}}else{const e=WG(u,y,s,!0);e&&((0,$G.A)(e,p?!y:y,p?void 0:a),l.preventDefault())}}return s.addEventListener("mousedown",l),s.addEventListener("keydown",c),()=>{s.removeEventListener("mousedown",l),s.removeEventListener("keydown",c)}}),[])}var qG=n(82569);function KG(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,Ul.A)(dy),{multiSelect:r,selectBlock:o}=(0,Vl.A)(dy),i=(0,FU.ZK)();return(0,zC.A)((s=>{function a(a){if(!i("core/block-editor/select-all",a))return;const l=t();if(l.length<2&&!(0,qG.A)(a.target))return;a.preventDefault();const[c]=l,u=n(c),d=e(u);l.length!==d.length?r(d[0],d[d.length-1]):u&&(s.ownerDocument.defaultView.getSelection().removeAllRanges(),o(u))}return s.addEventListener("keydown",a),()=>{s.removeEventListener("keydown",a)}}),[])}function YG(e,t){e.contentEditable=t,t&&e.focus()}function JG(){const{startMultiSelect:e,stopMultiSelect:t}=(0,Vl.A)(dy),{isSelectionEnabled:n,hasSelectedBlock:r,isDraggingBlocks:o,isMultiSelecting:i}=(0,Ul.A)(dy);return(0,zC.A)((s=>{const{ownerDocument:a}=s,{defaultView:l}=a;let c,u;function d(){t(),l.removeEventListener("mouseup",d),u=l.requestAnimationFrame((()=>{if(!r())return;YG(s,!1);const e=l.getSelection();if(e.rangeCount){const t=e.getRangeAt(0),{commonAncestorContainer:n}=t,r=t.cloneRange();c.contains(n)&&(c.focus(),e.removeAllRanges(),e.addRange(r))}}))}function h({buttons:t,target:r,relatedTarget:a}){r.contains(a)||o()||1===t&&(i()||s!==r&&"true"===r.getAttribute("contenteditable")&&n()&&(c=r,e(),l.addEventListener("mouseup",d),YG(s,!0)))}return s.addEventListener("mouseout",h),()=>{s.removeEventListener("mouseout",h),l.removeEventListener("mouseup",d),l.cancelAnimationFrame(u)}}),[e,t,n,r])}function XG(e,t){e.contentEditable!==String(t)&&(e.contentEditable=t,t&&e.focus())}function ZG(e){const t=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;return t?.closest("[data-wp-block-attribute-key]")}function QG(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,Vl.A)(dy),{getBlockParents:r,getBlockSelectionStart:o,isMultiSelecting:i}=(0,Ul.A)(dy);return(0,zC.A)((s=>{const{ownerDocument:a}=s,{defaultView:l}=a;function c(a){const c=l.getSelection();if(!c.rangeCount)return;const u=function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(c),d=function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE||n===t.childNodes.length?t:t.childNodes[n]}(c);if(!s.contains(u)||!s.contains(d))return;const h=a.shiftKey&&"mouseup"===a.type;if(c.isCollapsed&&!h){if("true"===s.contentEditable&&!i()){XG(s,!1);let e=u.nodeType===u.ELEMENT_NODE?u:u.parentElement;e=e?.closest("[contenteditable]"),e?.focus()}return}let p=XW(u),f=XW(d);if(h){const e=o(),t=XW(a.target),n=t!==f;(p===f&&c.isCollapsed||!f||n)&&(f=t),p!==e&&(p=e)}if(void 0!==p||void 0!==f)if(p===f)i()?e(p,p):t(p);else{const t=[...r(p),p],o=[...r(f),f],i=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,o);if(t[i]!==p||o[i]!==f)return void e(t[i],o[i]);const s=ZG(u),a=ZG(d);if(s&&a){var m,g;const e=c.getRangeAt(0),t=(0,$.create)({element:s,range:e,__unstableIsEditableTree:!0}),r=(0,$.create)({element:a,range:e,__unstableIsEditableTree:!0}),o=null!==(m=t.start)&&void 0!==m?m:t.end,i=null!==(g=r.start)&&void 0!==g?g:r.end;n({start:{clientId:p,attributeKey:s.dataset.wpBlockAttributeKey,offset:o},end:{clientId:f,attributeKey:a.dataset.wpBlockAttributeKey,offset:i}})}else e(p,f)}else XG(s,!1)}return a.addEventListener("selectionchange",c),l.addEventListener("mouseup",c),()=>{a.removeEventListener("selectionchange",c),l.removeEventListener("mouseup",c)}}),[e,t,n,r])}function eq(){const{selectBlock:e}=(0,Vl.A)(dy),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:r}=(0,Ul.A)(dy);return(0,zC.A)((o=>{function i(i){if(!t()||0!==i.button)return;const s=n(),a=XW(i.target);i.shiftKey?s!==a&&(o.contentEditable=!0,o.focus()):r()&&e(a)}return o.addEventListener("mousedown",i),()=>{o.removeEventListener("mousedown",i)}}),[e,t,n,r])}function tq(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,getSelectedBlockClientId:n,__unstableIsSelectionMergeable:r,hasMultiSelection:o,getBlockName:i,canInsertBlockType:s,getBlockRootClientId:a,getSelectionStart:l,getSelectionEnd:c,getBlockAttributes:u}=(0,Ul.A)(dy),{replaceBlocks:d,__unstableSplitSelection:h,removeBlocks:p,__unstableDeleteSelection:f,__unstableExpandSelection:m,__unstableMarkAutomaticChange:g}=(0,Vl.A)(dy);return(0,zC.A)((b=>{function v(e){"true"===b.contentEditable&&e.preventDefault()}function y(v){if(!v.defaultPrevented)if(o())v.keyCode===VE.ENTER?(b.contentEditable=!1,v.preventDefault(),e()?d(t(),td(Cc())):h()):v.keyCode===VE.BACKSPACE||v.keyCode===VE.DELETE?(b.contentEditable=!1,v.preventDefault(),e()?p(t()):r()?f(v.keyCode===VE.DELETE):m()):1!==v.key.length||v.metaKey||v.ctrlKey||(b.contentEditable=!1,r()?f(v.keyCode===VE.DELETE):(v.preventDefault(),b.ownerDocument.defaultView.getSelection().removeAllRanges()));else if(v.keyCode===VE.ENTER){if(v.shiftKey||e())return;const t=n(),r=i(t),o=l(),p=c();if(o.attributeKey===p.attributeKey){const e=u(t)[o.attributeKey],n=ld(cd("from").filter((({type:e})=>"enter"===e)),(t=>t.regExp.test(e)));if(n)return d(t,n.transform({content:e})),void g()}if(!Ic(r,"splitting",!1)&&!v.__deprecatedOnSplit)return;s(r,a(t))&&(h(),v.preventDefault())}}function _(e){o()&&(b.contentEditable=!1,r()?f():(e.preventDefault(),b.ownerDocument.defaultView.getSelection().removeAllRanges()))}return b.addEventListener("beforeinput",v),b.addEventListener("keydown",y),b.addEventListener("compositionstart",_),()=>{b.removeEventListener("beforeinput",v),b.removeEventListener("keydown",y),b.removeEventListener("compositionstart",_)}}),[])}var nq=n(55647),rq=n(46771);function oq(){const{getBlockName:e}=(0,Ul.A)(dy),{getBlockType:t}=(0,Ul.A)(ed),{createSuccessNotice:n}=(0,Vl.A)(Jb.store);return(0,k.useCallback)(((r,o)=>{let i="";if(1===o.length){const n=o[0],s=t(e(n))?.title;i="copy"===r?(0,H.sprintf)((0,H.__)('Copied "%s" to clipboard.'),s):(0,H.sprintf)((0,H.__)('Moved "%s" to clipboard.'),s)}else i="copy"===r?(0,H.sprintf)((0,H._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",o.length),o.length):(0,H.sprintf)((0,H._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",o.length),o.length);n(i,{type:"snackbar"})}),[])}function iq({clipboardData:e}){let t="",n="";try{t=e.getData("text/plain"),n=e.getData("text/html")}catch(t){try{n=e.getData("Text")}catch(e){return}}n=function(e){const t=e.indexOf("\x3c!--StartFragment--\x3e");if(!(t>-1))return e;const n=(e=e.substring(t+20)).indexOf("\x3c!--EndFragment--\x3e");return n>-1&&(e=e.substring(0,n)),e}(n),n=function(e){return e.startsWith("")?e.slice(22):e}(n);const r=(0,JA.$)(e);return r.length&&!function(e,t){if(t&&1===e?.length&&0===e[0].type.indexOf("image/")){const e=/<\s*img\b/gi;if(1!==t.match(e)?.length)return!0;const n=/<\s*img\b[^>]*\bsrc="file:\/\//i;if(t.match(n))return!0}return!1}(r,n)?{files:r}:{html:n,plainText:t,files:[]}}const sq=Symbol("requiresWrapperOnCopy");function aq(e,t,n){let r=t;const[o]=t;if(o&&n.select(ed).getBlockType(o.name)[sq]){const{getBlockRootClientId:e,getBlockName:t,getBlockAttributes:i}=n.select(dy),s=e(o.clientId),a=t(s);a&&(r=td(a,i(s),r))}const i=Fd(r);e.clipboardData.setData("text/plain",function(e){e=e.replace(/
/g,"\n");return(0,ac.A)(e).trim().replace(/\n\n+/g,"\n\n")}(i)),e.clipboardData.setData("text/html",i)}function lq(){const e=(0,Vp.A)(),{getBlocksByClientId:t,getSelectedBlockClientIds:n,hasMultiSelection:r,getSettings:o,getBlockName:i,__unstableIsFullySelected:s,__unstableIsSelectionCollapsed:a,__unstableIsSelectionMergeable:l,__unstableGetSelectedBlocksWithPartialSelection:c,canInsertBlockType:u,getBlockRootClientId:d}=(0,Ul.A)(dy),{flashBlock:h,removeBlocks:p,replaceBlocks:f,__unstableDeleteSelection:m,__unstableExpandSelection:g,__unstableSplitSelection:b}=(0,Vl.A)(dy),v=oq();return(0,zC.A)((y=>{function _(_){if(_.defaultPrevented)return;const x=n();if(0===x.length)return;if(!r()){const{target:e}=_,{ownerDocument:t}=e;if("copy"===_.type||"cut"===_.type?(0,nq.A)(t):(0,rq.A)(t)&&!t.activeElement.isContentEditable)return}const{activeElement:w}=_.target.ownerDocument;if(!y.contains(w))return;const k=l(),C=a()||s(),S=!C&&!k;if("copy"===_.type||"cut"===_.type)if(_.preventDefault(),1===x.length&&h(x[0]),S)g();else{let n;if(v(_.type,x),C)n=t(x);else{const[e,r]=c();n=[e,...t(x.slice(1,x.length-1)),r]}aq(_,n,e)}if("cut"===_.type)C&&!S?p(x):(_.target.ownerDocument.activeElement.contentEditable=!1,m());else if("paste"===_.type){const{__experimentalCanUserUseUnfilteredHTML:e}=o();if("true"===_.clipboardData.getData("rich-text"))return;const{plainText:t,html:n,files:a}=iq(_),l=s();let c=[];if(a.length){const e=cd("from");c=a.reduce(((t,n)=>{const r=ld(e,(e=>"files"===e.type&&e.isMatch([n])));return r&&t.push(r.transform([n])),t}),[]).flat()}else c=Mp({HTML:n,plainText:t,mode:l?"BLOCKS":"AUTO",canUserUseUnfilteredHTML:e});if("string"==typeof c)return;if(l)return f(x,c,c.length-1,-1),void _.preventDefault();if(!r()&&!Ic(i(x[0]),"splitting",!1)&&!_.__deprecatedOnSplit)return;const[h]=x,p=d(h);if(!c.every((e=>u(e.name,p))))return;b(c),_.preventDefault()}}return y.ownerDocument.addEventListener("copy",_),y.ownerDocument.addEventListener("cut",_),y.ownerDocument.addEventListener("paste",_),()=>{y.ownerDocument.removeEventListener("copy",_),y.ownerDocument.removeEventListener("cut",_),y.ownerDocument.removeEventListener("paste",_)}}),[])}function cq(){const[e,t,n]=function(){const e=(0,k.useRef)(),t=(0,k.useRef)(),n=(0,k.useRef)(),{hasMultiSelection:r,getSelectedBlockClientId:o,getBlockCount:i}=(0,Ul.A)(dy),{setNavigationMode:s,setLastFocus:a}=kf((0,Vl.A)(dy)),l=(0,Ul.A)((e=>e(dy).isNavigationMode()),[]),{getLastFocus:c}=kf((0,Ul.A)(dy)),u=l?void 0:"0",d=(0,k.useRef)();function h(t){if(d.current)d.current=null;else if(r())e.current.focus();else if(o())c()?.current?c().current.focus():e.current.querySelector(`[data-block="${o()}"]`).focus();else{s(!0);const n=e.current.ownerDocument===t.target.ownerDocument?e.current:e.current.ownerDocument.defaultView.frameElement,r=t.target.compareDocumentPosition(n)&t.target.DOCUMENT_POSITION_FOLLOWING,o=ME.focus.tabbable.find(e.current);o.length&&(r?o[0]:o[o.length-1]).focus()}}const p=(0,jd.jsx)("div",{ref:t,tabIndex:u,onFocus:h}),f=(0,jd.jsx)("div",{ref:n,tabIndex:u,onFocus:h}),m=(0,zC.A)((l=>{function u(e){if(e.defaultPrevented)return;if(e.keyCode===VE.ESCAPE&&!r())return e.preventDefault(),void s(!0);if(e.keyCode!==VE.TAB)return;const i=e.shiftKey,a=i?"findPrevious":"findNext";if(!r()&&!o())return void(e.target===l&&s(!0));const c=ME.focus.tabbable[a](e.target),u=e.target.closest("[data-block]"),h=u&&c&&(YW(u,c)||JW(u,c));if((0,$W.A)(c)&&h)return;const p=i?t:n;d.current=!0,p.current.focus({preventScroll:!0})}function h(e){a({...c(),current:e.target});const{ownerDocument:t}=l;e.relatedTarget||t.activeElement!==t.body||0!==i()||l.focus()}function p(r){if(r.keyCode!==VE.TAB)return;if("region"===r.target?.getAttribute("role"))return;if(e.current===r.target)return;const o=r.shiftKey?"findPrevious":"findNext",i=ME.focus.tabbable[o](r.target);i!==t.current&&i!==n.current||(r.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:f}=l,{defaultView:m}=f;return m.addEventListener("keydown",p),l.addEventListener("keydown",u),l.addEventListener("focusout",h),()=>{m.removeEventListener("keydown",p),l.removeEventListener("keydown",u),l.removeEventListener("focusout",h)}}),[]);return[p,(0,Qk.A)([e,m]),f]}(),r=(0,Ul.A)((e=>e(dy).hasMultiSelection()),[]);return[e,(0,Qk.A)([t,lq(),tq(),JG(),QG(),eq(),FG(),KG(),GG(),(0,zC.A)((e=>{if(e.tabIndex=0,r)return e.classList.add("has-multi-selection"),e.setAttribute("aria-label",(0,H.__)("Multiple selected blocks")),()=>{e.classList.remove("has-multi-selection"),e.removeAttribute("aria-label")}}),[r])]),n]}const uq=(0,k.forwardRef)((function({children:e,...t},n){const[r,o,i]=cq();return(0,jd.jsxs)(jd.Fragment,{children:[r,(0,jd.jsx)("div",{...t,ref:(0,Qk.A)([o,n]),className:(0,Hy.A)(t.className,"block-editor-writing-flow"),children:e}),i]})}));let dq=null;function hq(e,t,n){const r={};for(const t in e)r[t]=e[t];if(e instanceof n.contentDocument.defaultView.MouseEvent){const e=n.getBoundingClientRect();r.clientX+=e.left,r.clientY+=e.top}const o=new t(e.type,r);r.defaultPrevented&&o.preventDefault(),!n.dispatchEvent(o)&&e.preventDefault()}function pq(e){return(0,zC.A)((()=>{const{defaultView:t}=e;if(!t)return;const{frameElement:n}=t,r=e.documentElement,o=["dragover","mousemove"],i={};for(const e of o)i[e]=e=>{const t=Object.getPrototypeOf(e).constructor.name;hq(e,window[t],n)},r.addEventListener(e,i[e]);return()=>{for(const e of o)r.removeEventListener(e,i[e])}}))}function fq({contentRef:e,children:t,tabIndex:n=0,scale:r=1,frameSize:o=0,readonly:i,forwardedRef:s,title:a=(0,H.__)("Editor canvas"),...l}){const{resolvedAssets:c,isPreviewMode:u}=(0,Ul.A)((e=>{const{getSettings:t}=e(dy),n=t();return{resolvedAssets:n.__unstableResolvedAssets,isPreviewMode:n.__unstableIsPreviewMode}}),[]),{styles:d="",scripts:h=""}=c,[p,f]=(0,k.useState)(),m=(0,k.useRef)(),[g,b]=(0,k.useState)([]),v=kG(),[y,_,x]=cq(),[w,{height:C}]=(0,xF.A)(),[S,{width:A}]=(0,xF.A)(),E=(0,zC.A)((e=>{let t;function n(e){e.preventDefault()}function r(){const{contentDocument:r,ownerDocument:o}=e,{documentElement:i}=r;t=r,i.classList.add("block-editor-iframe__html"),v(i),b(Array.from(o.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),r.dir=o.dir;for(const e of dq||(dq=Array.from(document.styleSheets).reduce(((e,t)=>{try{t.cssRules}catch(t){return e}const{ownerNode:n,cssRules:r}=t;if(null===n)return e;if(!r)return e;if("wp-reset-editor-styles-css"===n.id)return e;if(!n.id)return e;if(function e(t){return Array.from(t).find((({selectorText:t,conditionText:n,cssRules:r})=>n?e(r):t&&(t.includes(".editor-styles-wrapper")||t.includes(".wp-block"))))}(r)){const t="STYLE"===n.tagName;if(t){const t=n.id.replace("-inline-css","-css"),r=document.getElementById(t);r&&e.push(r.cloneNode(!0))}if(e.push(n.cloneNode(!0)),!t){const t=n.id.replace("-css","-inline-css"),r=document.getElementById(t);r&&e.push(r.cloneNode(!0))}}return e}),[]),dq))r.getElementById(e.id)||(r.head.appendChild(e.cloneNode(!0)),u||console.warn(`${e.id} was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,e));t.addEventListener("dragover",n,!1),t.addEventListener("drop",n,!1)}return e._load=()=>{f(e.contentDocument)},e.addEventListener("load",r),()=>{delete e._load,e.removeEventListener("load",r),t?.removeEventListener("dragover",n),t?.removeEventListener("drop",n)}}),[]),[I,j]=(0,k.useState)(),T=(0,zC.A)((e=>{const t=e.ownerDocument.defaultView;j(t.innerHeight);const n=()=>{j(t.innerHeight)};return t.addEventListener("resize",n),()=>{t.removeEventListener("resize",n)}}),[]),[B,R]=(0,k.useState)(),N=(0,zC.A)((e=>{const t=e.ownerDocument.defaultView;R(t.innerWidth);const n=()=>{R(t.innerWidth)};return t.addEventListener("resize",n),()=>{t.removeEventListener("resize",n)}}),[]),D=1!==r;(0,k.useEffect)((()=>{D||(m.current=A)}),[A,D]);const M=_V({isDisabled:!i}),P=(0,Qk.A)([pq(p),e,v,_,M,D?T:null]),O=`\n\n\t\n\t\t\n\t\t