/*! 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,i="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=i,e&&e.exports&&(e.exports=i)}(window)},48198(e,t){var n,i;n=function(e,t){"use strict";var n,i,r="function"==typeof Map?new Map:(n=[],i=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return i[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),i.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),i.splice(t,1))}}),o=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){o=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function s(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,i=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]}),r.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",r.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 i=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),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,i.forEach(function(e){e.node.scrollTop=e.scrollTop}),r&&(document.documentElement.scrollTop=r)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(rde,getFormatTypeForBareElement:()=>he,getFormatTypeForClassName:()=>pe,getFormatTypes:()=>ue});var r={};n.r(r),n.d(r,{addFormatTypes:()=>fe,removeFormatTypes:()=>me});var o={};n.r(o),n.d(o,{getAllBlockBindingsSources:()=>ti,getBlockBindingsSource:()=>ni,getBlockBindingsSourceFieldsList:()=>ii,getBootstrappedBlockType:()=>Qn,getSupportedStyles:()=>Zn,getUnprocessedBlockTypes:()=>ei,hasContentRoleAttribute:()=>ri});var s={};n.r(s),n.d(s,{__experimentalHasContentRoleAttribute:()=>Si,getActiveBlockVariation:()=>ui,getBlockStyles:()=>li,getBlockSupport:()=>vi,getBlockType:()=>ai,getBlockTypes:()=>si,getBlockVariations:()=>ci,getCategories:()=>hi,getChildBlockNames:()=>yi,getCollections:()=>pi,getDefaultBlockName:()=>fi,getDefaultBlockVariation:()=>di,getFreeformFallbackBlockName:()=>mi,getGroupingBlockName:()=>bi,getUnregisteredFallbackBlockName:()=>gi,hasBlockSupport:()=>_i,hasChildBlocks:()=>wi,hasChildBlocksWithInserterSupport:()=>Ci,isMatchingSearchTerm:()=>ki});var a={};n.r(a),n.d(a,{__experimentalReapplyBlockFilters:()=>Oi,addBlockCollection:()=>Gi,addBlockStyles:()=>Mi,addBlockTypes:()=>Ni,addBlockVariations:()=>Di,reapplyBlockTypeFilters:()=>Ri,removeBlockCollection:()=>qi,removeBlockStyles:()=>Pi,removeBlockTypes:()=>Li,removeBlockVariations:()=>Fi,setCategories:()=>Hi,setDefaultBlockName:()=>zi,setFreeformFallbackBlockName:()=>Vi,setGroupingBlockName:()=>$i,setUnregisteredFallbackBlockName:()=>Ui,updateCategory:()=>Wi});var l={};n.r(l),n.d(l,{addBlockBindingsSource:()=>Ji,addBootstrappedBlockType:()=>Ki,addUnprocessedBlockType:()=>Yi,removeBlockBindingsSource:()=>Xi});var c={};n.r(c),n.d(c,{getAllPatterns:()=>Up,getBlockRemovalRules:()=>Mp,getBlockSettings:()=>Sp,getBlockStyles:()=>ef,getBlockWithoutAttributes:()=>jp,getClosestAllowedInsertionPoint:()=>of,getClosestAllowedInsertionPointForPattern:()=>sf,getContentLockingParent:()=>Kp,getEditedContentOnlySection:()=>Zp,getEnabledBlockParents:()=>Op,getEnabledClientIdsTree:()=>Rp,getExpandedBlock:()=>qp,getInserterMediaCategories:()=>Fp,getInsertionPoint:()=>af,getLastFocus:()=>Wp,getLastInsertedBlocksClientIds:()=>Ep,getListViewExpandRevision:()=>_f,getParentSectionBlock:()=>Jp,getPatternBySlug:()=>Vp,getRegisteredInserterMediaCategories:()=>Dp,getRemovalPromptData:()=>Lp,getRequestedInspectorTab:()=>kf,getReusableBlocks:()=>Hp,getSectionRootClientId:()=>tf,getStyleOverrides:()=>Pp,getViewportModalClientIds:()=>xf,getZoomLevel:()=>rf,hasAllowedPatterns:()=>zp,hasBlockSpotlight:()=>pf,isBlockHiddenAnywhere:()=>lf,isBlockHiddenAtViewport:()=>df,isBlockHiddenEverywhere:()=>cf,isBlockInterfaceHidden:()=>Ip,isBlockParentHiddenAtViewport:()=>hf,isBlockParentHiddenEverywhere:()=>uf,isBlockSubtreeDisabled:()=>Tp,isContainerInsertableToInContentOnlyMode:()=>Bp,isDragging:()=>Gp,isEditLockedBlock:()=>ff,isListViewContentPanelOpen:()=>yf,isListViewPanelOpened:()=>vf,isLockedBlock:()=>bf,isMoveLockedBlock:()=>mf,isRemoveLockedBlock:()=>gf,isSectionBlock:()=>Xp,isWithinEditedContentOnlySection:()=>Qp,isZoomOut:()=>nf});var u={};n.r(u),n.d(u,{__experimentalGetActiveBlockIdByBlockNames:()=>Kg,__experimentalGetAllowedBlocks:()=>Ag,__experimentalGetAllowedPatterns:()=>Rg,__experimentalGetBlockListSettingsForBlocks:()=>zg,__experimentalGetDirectInsertBlock:()=>Eg,__experimentalGetGlobalBlocksByName:()=>om,__experimentalGetLastBlockAttributeChanges:()=>$g,__experimentalGetParsedPattern:()=>jg,__experimentalGetPatternTransformItems:()=>Mg,__experimentalGetPatternsByBlockTypes:()=>Lg,__experimentalGetReusableBlockTitle:()=>Vg,__unstableGetBlockWithoutInnerBlocks:()=>Xf,__unstableGetClientIdWithClientIdsTree:()=>Qf,__unstableGetClientIdsTree:()=>em,__unstableGetContentLockingParent:()=>rb,__unstableGetSelectedBlocksWithPartialSelection:()=>zm,__unstableGetTemporarilyEditingAsBlocks:()=>ob,__unstableGetVisibleBlocks:()=>Zg,__unstableHasActiveBlockOverlayActive:()=>Qg,__unstableIsFullySelected:()=>Mm,__unstableIsLastBlockChangeIgnored:()=>Ug,__unstableIsSelectionCollapsed:()=>Pm,__unstableIsSelectionMergeable:()=>Fm,__unstableIsWithinBlockOverlay:()=>eb,__unstableSelectionHasUnmergeableBlock:()=>Dm,areInnerBlocksControlled:()=>qg,canEditBlock:()=>gg,canInsertBlockType:()=>ug,canInsertBlocks:()=>dg,canLockBlockType:()=>bg,canMoveBlock:()=>fg,canMoveBlocks:()=>mg,canRemoveBlock:()=>hg,canRemoveBlocks:()=>pg,didAutomaticChange:()=>Wg,getAdjacentBlockClientId:()=>km,getAllowedBlocks:()=>Sg,getBlock:()=>Jf,getBlockAttributes:()=>Yf,getBlockCount:()=>lm,getBlockEditingMode:()=>tb,getBlockHierarchyRootClientId:()=>_m,getBlockIndex:()=>Um,getBlockInsertionPoint:()=>ig,getBlockListSettings:()=>Pg,getBlockMode:()=>Jm,getBlockName:()=>qf,getBlockNamesByClientId:()=>am,getBlockOrder:()=>Vm,getBlockParents:()=>ym,getBlockParentsByBlockName:()=>vm,getBlockRootClientId:()=>bm,getBlockSelectionEnd:()=>hm,getBlockSelectionStart:()=>dm,getBlockTransformItems:()=>wg,getBlocks:()=>Zf,getBlocksByClientId:()=>sm,getBlocksByName:()=>rm,getClientIdsOfDescendants:()=>tm,getClientIdsWithDescendants:()=>nm,getDirectInsertBlock:()=>Ig,getDraggedBlockClientIds:()=>Qm,getFirstMultiSelectedBlockClientId:()=>jm,getGlobalBlockCount:()=>im,getHoveredBlockClientId:()=>Xg,getInserterItems:()=>kg,getLastMultiSelectedBlockClientId:()=>Tm,getLowestCommonAncestorWithSelectedBlock:()=>xm,getMultiSelectedBlockClientIds:()=>Im,getMultiSelectedBlocks:()=>Em,getMultiSelectedBlocksEndClientId:()=>Lm,getMultiSelectedBlocksStartClientId:()=>Om,getNextBlockClientId:()=>Cm,getPatternsByBlockTypes:()=>Og,getPreviousBlockClientId:()=>wm,getSelectedBlock:()=>gm,getSelectedBlockClientId:()=>mm,getSelectedBlockClientIds:()=>Am,getSelectedBlockCount:()=>pm,getSelectedBlocksInitialCaretPosition:()=>Sm,getSelectionEnd:()=>um,getSelectionStart:()=>cm,getSettings:()=>Dg,getTemplate:()=>sg,getTemplateLock:()=>ag,hasBlockMovingClientId:()=>Hg,hasDraggedInnerBlock:()=>Wm,hasInserterItems:()=>Cg,hasMultiSelection:()=>qm,hasSelectedBlock:()=>fm,hasSelectedInnerBlock:()=>Hm,isAncestorBeingDragged:()=>tg,isAncestorMultiSelected:()=>Rm,isBlockBeingDragged:()=>eg,isBlockHighlighted:()=>Gg,isBlockInsertionPointVisible:()=>rg,isBlockMultiSelected:()=>Nm,isBlockSelected:()=>$m,isBlockValid:()=>Kf,isBlockVisible:()=>Jg,isBlockWithinSelection:()=>Gm,isCaretWithinFormattedText:()=>ng,isDraggingBlocks:()=>Zm,isFirstMultiSelectedBlock:()=>Bm,isGroupable:()=>ib,isLastBlockChangePersistent:()=>Fg,isMultiSelecting:()=>Km,isSelectionEnabled:()=>Ym,isTyping:()=>Xm,isUngroupable:()=>nb,isValidTemplate:()=>og,wasBlockJustInserted:()=>Yg});var d={};n.r(d),n.d(d,{__experimentalUpdateSettings:()=>ab,clearBlockRemovalPrompt:()=>pb,clearRequestedInspectorTab:()=>Nb,closeListViewContentPanel:()=>Eb,deleteStyleOverride:()=>gb,editContentOnlySection:()=>kb,ensureDefaultBlock:()=>db,expandBlock:()=>_b,hideBlockInterface:()=>lb,hideViewportModal:()=>Tb,openListViewContentPanel:()=>Ib,privateRemoveBlocks:()=>ub,requestInspectorTab:()=>Bb,resetZoomLevel:()=>Sb,setBlockRemovalRules:()=>fb,setInsertionPoint:()=>xb,setLastFocus:()=>bb,setStyleOverride:()=>mb,setZoomLevel:()=>Cb,showBlockInterface:()=>cb,showViewportModal:()=>jb,startDragging:()=>yb,stopDragging:()=>vb,stopEditingContentOnlySection:()=>wb,toggleBlockSpotlight:()=>Ab});var h={};n.r(h),n.d(h,{__unstableDeleteSelection:()=>py,__unstableExpandSelection:()=>my,__unstableIncrementListViewExpandRevision:()=>Xy,__unstableMarkAutomaticChange:()=>Oy,__unstableMarkLastChangeAsPersistent:()=>Ny,__unstableMarkNextChangeAsNotPersistent:()=>Ry,__unstableSaveReusableBlock:()=>By,__unstableSetAllListViewPanelsOpen:()=>Yy,__unstableSetEditorMode:()=>Ly,__unstableSetOpenListViewPanel:()=>Ky,__unstableSetTemporarilyEditingAsBlocks:()=>Hy,__unstableSplitSelection:()=>fy,__unstableToggleListViewPanel:()=>Jy,clearSelectedBlock:()=>Zb,duplicateBlocks:()=>Py,enterFormattedText:()=>Sy,exitFormattedText:()=>Ay,flashBlock:()=>Vy,hideInsertionPoint:()=>uy,hoverBlock:()=>Gb,insertAfterBlock:()=>Fy,insertBeforeBlock:()=>Dy,insertBlock:()=>ay,insertBlocks:()=>ly,insertDefaultBlock:()=>Ey,mergeBlocks:()=>gy,moveBlockToPosition:()=>sy,moveBlocksDown:()=>iy,moveBlocksToPosition:()=>oy,moveBlocksUp:()=>ry,multiSelect:()=>Xb,receiveBlocks:()=>Ub,registerInserterMediaCategory:()=>Wy,removeBlock:()=>yy,removeBlocks:()=>by,replaceBlock:()=>ty,replaceBlocks:()=>ey,replaceInnerBlocks:()=>vy,resetBlocks:()=>Fb,resetSelection:()=>Vb,selectBlock:()=>Wb,selectNextBlock:()=>Kb,selectPreviousBlock:()=>qb,selectionChange:()=>Iy,setBlockEditingMode:()=>Gy,setBlockMovingClientId:()=>My,setBlockVisibility:()=>$y,setHasControlledInnerBlocks:()=>Uy,setTemplateValidity:()=>dy,showInsertionPoint:()=>cy,startDraggingBlocks:()=>wy,startMultiSelect:()=>Yb,startTyping:()=>xy,stopDraggingBlocks:()=>Cy,stopMultiSelect:()=>Jb,stopTyping:()=>ky,synchronizeTemplate:()=>hy,toggleBlockHighlight:()=>zy,toggleBlockMode:()=>_y,toggleSelection:()=>Qb,unsetBlockEditingMode:()=>qy,updateBlock:()=>Hb,updateBlockAttributes:()=>$b,updateBlockListSettings:()=>jy,updateSettings:()=>Ty,validateBlocksToTemplate:()=>zb});var p={};n.r(p),n.d(p,{getItems:()=>Kz,getSettings:()=>Zz,isUploading:()=>Yz,isUploadingById:()=>Xz,isUploadingByUrl:()=>Jz});var f={};n.r(f),n.d(f,{getActiveImageProcessingCount:()=>lV,getActiveUploadCount:()=>sV,getAllItems:()=>Qz,getBlobUrls:()=>oV,getFailedItems:()=>uV,getItem:()=>eV,getItemProgress:()=>hV,getPausedUploadForPost:()=>iV,getPendingImageProcessing:()=>cV,getPendingUploads:()=>aV,hasPendingItemsByParentId:()=>dV,isBatchUploaded:()=>tV,isPaused:()=>rV,isUploadingToPost:()=>nV});var m={};n.r(m),n.d(m,{addItems:()=>SV,cancelItem:()=>AV,retryItem:()=>IV});var g={};n.r(g),n.d(g,{addItem:()=>TV,addSideloadItem:()=>BV,finalizeItem:()=>YV,finishOperation:()=>DV,generateThumbnails:()=>KV,getTranscodeImageOperation:()=>VV,pauseItem:()=>LV,pauseQueue:()=>RV,prepareItem:()=>UV,processItem:()=>NV,removeItem:()=>PV,resizeCropItem:()=>WV,resumeItemByPostId:()=>MV,resumeQueue:()=>OV,revokeBlobUrls:()=>JV,rotateItem:()=>GV,sideloadItem:()=>HV,transcodeImageItem:()=>qV,updateItemProgress:()=>XV,updateSettings:()=>ZV,uploadItem:()=>$V});var b={};n.r(b),n.d(b,{AdvancedPanel:()=>qF,BackgroundPanel:()=>ZE,BorderPanel:()=>lO,ColorPanel:()=>WE,DimensionsPanel:()=>ZP,FiltersPanel:()=>sF,ImageSettingsPanel:()=>E4,StateControl:()=>j4,TypographyPanel:()=>QL,useHasBackgroundPanel:()=>KE,useHasBorderPanel:()=>QR,useHasBorderPanelControls:()=>eO,useHasColorPanel:()=>BE,useHasDimensionsPanel:()=>PP,useHasFiltersPanel:()=>QD,useHasImageSettingsPanel:()=>I4,useHasTypographyPanel:()=>FL,useSettingsForBlockElement:()=>nv});var y={};n.r(y),n.d(y,{close:()=>H4,open:()=>$4,registerCommand:()=>F4,registerCommandLoader:()=>V4,unregisterCommand:()=>z4,unregisterCommandLoader:()=>U4});var v={};n.r(v),n.d(v,{getCommandLoaders:()=>G4,getCommands:()=>W4,getContext:()=>K4,isOpen:()=>q4});var _={};n.r(_),n.d(_,{setContext:()=>Y4,setLoaderLoading:()=>J4});var x={};n.r(x),n.d(x,{isLoading:()=>X4});var k={};n.r(k),n.d(k,{getBlockPatternsForPostType:()=>M6,getEditorAssets:()=>W6,getEditorSettings:()=>H6,getEntityRecordPermissions:()=>D6,getEntityRecordsPermissions:()=>P6,getHomePage:()=>V6,getNavigationFallbackId:()=>L6,getPostsPageId:()=>U6,getRegisteredPostMeta:()=>F6,getTemplateId:()=>$6,getUndoManager:()=>O6,getViewConfig:()=>q6,isCollaborationSupported:()=>G6});var w={};n.r(w),n.d(w,{__experimentalGetCurrentGlobalStylesId:()=>B9,__experimentalGetCurrentThemeBaseGlobalStyles:()=>V9,__experimentalGetCurrentThemeGlobalStylesVariations:()=>U9,__experimentalGetDirtyEntityRecords:()=>m9,__experimentalGetEntitiesBeingSaved:()=>g9,__experimentalGetEntityRecordNoResolver:()=>c9,canUser:()=>L9,canUserEditEntityRecord:()=>M9,getAuthors:()=>e9,getAutosave:()=>D9,getAutosaves:()=>P9,getBlockPatternCategories:()=>H9,getBlockPatterns:()=>$9,getCurrentTheme:()=>T9,getCurrentThemeGlobalStylesRevisions:()=>G9,getCurrentUser:()=>t9,getDefaultTemplateId:()=>q9,getEditedEntityRecord:()=>_9,getEmbedPreview:()=>R9,getEntitiesByKind:()=>i9,getEntitiesConfig:()=>r9,getEntity:()=>o9,getEntityConfig:()=>s9,getEntityRecord:()=>a9,getEntityRecordEdits:()=>b9,getEntityRecordNonTransientEdits:()=>y9,getEntityRecords:()=>h9,getEntityRecordsTotalItems:()=>p9,getEntityRecordsTotalPages:()=>f9,getLastEntityDeleteError:()=>S9,getLastEntitySaveError:()=>C9,getRawEntityRecord:()=>u9,getRedoEdit:()=>I9,getReferenceByDistinctEdits:()=>z9,getRevision:()=>J9,getRevisions:()=>K9,getSyncConnectionStatus:()=>X9,getThemeSupports:()=>N9,getUndoEdit:()=>A9,getUserPatternCategories:()=>W9,getUserQueryResults:()=>n9,hasEditsForEntityRecord:()=>v9,hasEntityRecord:()=>l9,hasEntityRecords:()=>d9,hasFetchedAutosaves:()=>F9,hasRedo:()=>j9,hasRevision:()=>Y9,hasUndo:()=>E9,isAutosavingEntityRecord:()=>x9,isDeletingEntityRecord:()=>w9,isPreviewEmbedFallback:()=>O9,isRequestingEmbedPreview:()=>Q6,isSavingEntityRecord:()=>k9});var C={};n.r(C),n.d(C,{__experimentalBatch:()=>w7,__experimentalReceiveCurrentGlobalStylesId:()=>u7,__experimentalReceiveThemeBaseGlobalStyles:()=>d7,__experimentalReceiveThemeGlobalStyleVariations:()=>h7,__experimentalSaveSpecifiedEntityEdits:()=>S7,__unstableCreateUndoLevel:()=>x7,addEntities:()=>a7,clearEntityRecordEdits:()=>y7,deleteEntityRecord:()=>g7,editEntityRecord:()=>b7,receiveAutosaves:()=>j7,receiveCurrentTheme:()=>c7,receiveCurrentUser:()=>s7,receiveDefaultTemplateId:()=>B7,receiveEmbedPreview:()=>m7,receiveEntityRecords:()=>l7,receiveNavigationFallbackId:()=>T7,receiveRevisions:()=>N7,receiveThemeGlobalStyleRevisions:()=>f7,receiveThemeSupports:()=>p7,receiveUploadPermissions:()=>A7,receiveUserPermission:()=>I7,receiveUserPermissions:()=>E7,receiveUserQuery:()=>o7,redo:()=>_7,saveEditedEntityRecord:()=>C7,saveEntityRecord:()=>k7,setSyncConnectionStatus:()=>R7,undo:()=>v7});var S={};n.r(S),n.d(S,{editMediaEntity:()=>L7,receiveEditorAssets:()=>P7,receiveEditorSettings:()=>M7,receiveRegisteredPostMeta:()=>O7,receiveViewConfig:()=>F7,setCollaborationSupported:()=>D7});var A={};n.r(A),n.d(A,{__experimentalGetCurrentGlobalStylesId:()=>ree,__experimentalGetCurrentThemeBaseGlobalStyles:()=>oee,__experimentalGetCurrentThemeGlobalStylesVariations:()=>see,canUser:()=>eee,canUserEditEntityRecord:()=>tee,getAuthors:()=>$7,getAutosave:()=>iee,getAutosaves:()=>nee,getBlockPatternCategories:()=>cee,getBlockPatterns:()=>lee,getCurrentTheme:()=>X7,getCurrentThemeGlobalStylesRevisions:()=>aee,getCurrentUser:()=>H7,getDefaultTemplateId:()=>hee,getEditedEntityRecord:()=>q7,getEditorAssets:()=>yee,getEditorSettings:()=>bee,getEmbedPreview:()=>Q7,getEntitiesConfig:()=>gee,getEntityRecord:()=>W7,getEntityRecords:()=>K7,getEntityRecordsTotalItems:()=>Y7,getEntityRecordsTotalPages:()=>J7,getNavigationFallbackId:()=>dee,getRawEntityRecord:()=>G7,getRegisteredPostMeta:()=>mee,getRevision:()=>fee,getRevisions:()=>pee,getThemeSupports:()=>Z7,getUserPatternCategories:()=>uee,getViewConfig:()=>vee});var I={};n.r(I),n.d(I,{applyStylesToAllTextInputs:()=>Mte,blocksChangedInBlockEditor:()=>Lte,changeActiveSidebar:()=>wte,changeFormBlocks:()=>ste,changeFormName:()=>ate,changeFormSettings:()=>vte,changeFormStyles:()=>dte,changePreviewSettings:()=>Cte,createCustomField:()=>Rte,createCustomFieldDone:()=>gte,createCustomFieldFailed:()=>yte,createCustomFieldStarted:()=>bte,customFieldEdited:()=>hte,deleteCustomField:()=>Ote,deleteCustomFieldDone:()=>cte,deleteCustomFieldFailed:()=>ute,deleteCustomFieldStarted:()=>lte,hidePreview:()=>Ite,historyRedo:()=>Dte,historyUndo:()=>Pte,removeNotice:()=>Ete,saveCustomField:()=>Nte,saveCustomFieldDone:()=>pte,saveCustomFieldFailed:()=>mte,saveCustomFieldStarted:()=>fte,saveForm:()=>Bte,saveFormDone:()=>_te,saveFormFailed:()=>kte,saveFormStarted:()=>xte,showPlacementSettings:()=>Ste,showPreview:()=>Ate,switchDefaultSidebarTab:()=>jte,toggleForm:()=>rte,toggleFullscreen:()=>ote,toggleInserter:()=>nte,toggleListView:()=>ite,toggleSidebar:()=>tte,toggleSidebarPanel:()=>Tte,tutorialDismissed:()=>Fte});var E={};n.r(E),n.d(E,{selectCategory:()=>RCe,selectTemplate:()=>NCe});var j={};n.r(j),n.d(j,{CALL_API:()=>Qte.p,TRACK_EVENT:()=>OCe.s});var T=n(7378),B=n(79124),N=n(80502),R=n(13722),O=n(27901),L=n(3698),M=n.n(L),P=n(89074),D=n(95924),F=n(91221),z=n(22840),V=n(43595);function U(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}var $=(e,t)=>{const n=e?.findIndex(({id:e})=>"string"==typeof e?e===t.id:(0,V.hw)(e,t.id)),i=[...e];return-1!==n?i[n]={id:t.id,changes:U(i[n].changes,t.changes)}:i.push(t),i};var H=e=>t=>(n,i)=>void 0===n||e(i)?t(n,i):n,W=e=>t=>(n,i)=>t(n,e(i));function G(e,t){if(!e)return t;let n=!1;const i={};for(const r in t)F(e[r],t[r])?i[r]=e[r]:(n=!0,i[r]=t[r]);if(!n)return e;for(const t in e)i.hasOwnProperty(t)||(i[t]=e[t]);return i}var q=e=>t=>(n={},i)=>{const r=i[e];if(void 0===r)return n;const o=t(n[r],i);return o===n[r]?n:{...n,[r]:o}},K=n(56636),Y=n(84467);function J(e){return function(e){return e.charAt(0).toUpperCase()+e.substr(1)}(e.toLowerCase())}var X=n(85998);function Z(e,t){return 0===t?e.toLowerCase():(0,X.l3)(e,t)}function Q(e,t){return void 0===t&&(t={}),(0,X.fL)(e,(0,K.Cl)({transform:Z},t))}var ee=n(69139),te=n(38245),ne=n(99940),ie=n(99532),re=n(18994);function oe(e){(0,re.e)(e.parentNode,"node.parentNode"),e.parentNode.removeChild(e)}function se(e){const{body:t}=document.implementation.createHTMLDocument("");t.innerHTML=e;const n=t.getElementsByTagName("*");let i=n.length;for(;i--;){const e=n[i];if("SCRIPT"===e.tagName)oe(e);else{let t=e.attributes.length;for(;t--;){const{name:n}=e.attributes[t];n.startsWith("on")&&e.removeAttribute(n)}}}return t.innerHTML}function ae(e){e=se(e);const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body.textContent||""}var le=(0,D.combineReducers)({formatTypes:function(e={},t){switch(t.type){case"ADD_FORMAT_TYPES":return{...e,...t.formatTypes.reduce((e,t)=>({...e,[t.name]:t}),{})};case"REMOVE_FORMAT_TYPES":return Object.fromEntries(Object.entries(e).filter(([e])=>!t.names.includes(e)))}return e}}),ce=n(74661),ue=(0,ce.A)(e=>Object.values(e.formatTypes),e=>[e.formatTypes]);function de(e,t){return e.formatTypes[t]}function he(e,t){const n=ue(e);return n.find(({className:e,tagName:n})=>null===e&&t===n)||n.find(({className:e,tagName:t})=>null===e&&"*"===t)}function pe(e,t){return ue(e).find(({className:e})=>null!==e&&` ${t} `.indexOf(` ${e} `)>=0)}function fe(e){return{type:"ADD_FORMAT_TYPES",formatTypes:Array.isArray(e)?e:[e]}}function me(e){return{type:"REMOVE_FORMAT_TYPES",names:Array.isArray(e)?e:[e]}}var ge=(0,P.A)("core/rich-text",{reducer:le,selectors:i,actions:r});function be(e,t){if(e===t)return!0;if(!e||!t)return!1;if(e.type!==t.type)return!1;const n=e.attributes,i=t.attributes;if(n===i)return!0;if(!n||!i)return!1;const r=Object.keys(n),o=Object.keys(i);if(r.length!==o.length)return!1;const s=r.length;for(let e=0;e{const i=t[n-1];if(i){const r=e.slice();r.forEach((e,t)=>{const n=i[t];be(e,n)&&(r[t]=n)}),t[n]=r}}),{...e,formats:t}}function ve(e,t,n){return(e=e.slice())[t]=n,e}function _e(e,t,n=e.start,i=e.end){const{formats:r,activeFormats:o}=e,s=r.slice();if(n===i){const e=s[n]?.find(({type:e})=>e===t.type);if(e){const r=s[n].indexOf(e);for(;s[n]&&s[n][r]===e;)s[n]=ve(s[n],r,t),n--;for(i++;s[i]&&s[i][r]===e;)s[i]=ve(s[i],r,t),i++}}else{let e=1/0;for(let r=n;re!==t.type);const n=s[r].length;ne!==t.type)||[],t]})}(0,D.register)(ge);var xe=n(45003);function ke({implementation:e},t){return ke.body||(ke.body=e.createHTMLDocument("").body),ke.body.innerHTML=t,ke.body}var we="",Ce=n(35635);function Se(e,t=[]){const{formats:n,start:i,end:r,activeFormats:o}=e;if(void 0===i)return t;if(i===r){if(o)return o;const e=n[i-1]||t,r=n[i]||t;return e.lengthbe(t,e))||a.splice(n,1)}if(0===a.length)return t}return a||t}function Ae(e){return(0,xe.L)(ge).getFormatType(e)}function Ie(e,t){if(t)return e;const n={};for(const t in e){let i=t;t.startsWith("data-disable-rich-text-")&&(i=t.slice(23)),n[i]=e[t]}return n}function Ee({type:e,tagName:t,attributes:n,unregisteredAttributes:i,object:r,boundaryClass:o,isEditableTree:s}){const a=Ae(e);let l={};if(o&&s&&(l["data-rich-text-format-boundary"]="true"),!a)return n&&(l={...n,...l}),{type:e,attributes:Ie(l,s),object:r};l={...i,...l};for(const e in n){const t=!!a.attributes&&a.attributes[e];t?l[t]=n[e]:l[e]=n[e]}return a.className&&(l.class?l.class=`${a.className} ${l.class}`:l.class=a.className),{type:t||a.tagName,object:a.object,attributes:Ie(l,s)}}function je(e,t,n){do{if(e[n]!==t[n])return!1}while(n--);return!0}function Te({value:e,preserveWhiteSpace:t,createEmpty:n,append:i,getLastChild:r,getParent:o,isText:s,getText:a,remove:l,appendText:c,onStartIndex:u,onEndIndex:d,isEditableTree:h,placeholder:p}){const{formats:f,replacements:m,text:g,start:b,end:y}=e,v=f.length+1,_=n(),x=Se(e),k=x[x.length-1];let w,C;i(_,"");for(let e=0;e{if(S&&w&&je(x,w,t))return void(S=r(S));const{type:n,tagName:c,attributes:u,unregisteredAttributes:d}=e,p=h&&e===k,f=o(S),m=i(f,Ee({type:n,tagName:c,attributes:u,unregisteredAttributes:d,boundaryClass:p,isEditableTree:h}));s(S)&&0===a(S).length&&l(S),S=i(m,"")}),0===e&&(u&&0===b&&u(_,S),d&&0===y&&d(_,S)),n===we){const t=m[e];if(!t)continue;const{type:n,attributes:r,innerHTML:s}=t,a=Ae(n);if(h&&"#comment"===n)S=i(o(S),{type:"span",attributes:{contenteditable:"false","data-rich-text-comment":r["data-rich-text-comment"]}}),i(i(S,{type:"span"}),r["data-rich-text-comment"].trim());else if(h||"script"!==n)if(!1===a?.contentEditable){if(s||h){if(S=o(S),h){const t={contenteditable:"false","data-rich-text-bogus":!0};b===e&&y===e+1&&(t["data-rich-text-format-boundary"]=!0),S=i(S,{type:"span",attributes:t}),h&&e+1===g.length&&i(o(S),"\ufeff")}S=i(S,Ee({...t,isEditableTree:h})),s&&i(S,{html:s})}}else S=i(o(S),Ee({...t,object:!0,isEditableTree:h}));else S=i(o(S),Ee({type:"script",isEditableTree:h})),i(S,{html:decodeURIComponent(r["data-rich-text-script"])});S=i(o(S),"")}else t||"\n"!==n?s(S)?c(S,n):S=i(o(S),n):(S=i(o(S),{type:"br",attributes:h?{"data-rich-text-line-break":"true"}:void 0,object:!0}),S=i(o(S),""));u&&b===e+1&&u(_,S),d&&y===e+1&&d(_,S),v&&e===g.length&&(i(o(S),"\ufeff"),p&&0===g.length&&i(o(S),{type:"span",attributes:{"data-rich-text-placeholder":p,style:"pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;"}})),w=x,C=n}return _}function Be({value:e,preserveWhiteSpace:t}){return ze(Te({value:e,preserveWhiteSpace:t,createEmpty:Ne,append:Oe,getLastChild:Re,getParent:Me,isText:Pe,getText:De,remove:Fe,appendText:Le}).children)}function Ne(){return{}}function Re({children:e}){return e&&e[e.length-1]}function Oe(e,t){return"string"==typeof t&&(t={text:t}),t.parent=e,e.children=e.children||[],e.children.push(t),t}function Le(e,t){e.text+=t}function Me({parent:e}){return e}function Pe({text:e}){return"string"==typeof e}function De({text:e}){return e}function Fe(e){const t=e.parent.children.indexOf(e);return-1!==t&&e.parent.children.splice(t,1),e}function ze(e=[]){return e.map(e=>void 0!==e.html?e.html:void 0===e.text?function({type:e,attributes:t,object:n,children:i}){if("#comment"===e)return`\x3c!--${t["data-rich-text-comment"]}--\x3e`;let r="";for(const e in t)(0,Ce.i8)(e)&&(r+=` ${e}="${(0,Ce.Gj)(t[e])}"`);return n?`<${e}${r}>`:`<${e}${r}>${ze(i)}`}(e):(0,Ce.jG)(e.text)).join("")}function Ve({text:e}){return e.replace(we,"")}function Ue(){return{formats:[],replacements:[],text:""}}function $e({tagName:e,attributes:t}){let n;if(t&&t.class&&(n=(0,xe.L)(ge).getFormatTypeForClassName(t.class),n&&(t.class=` ${t.class} `.replace(` ${n.className} `," ").trim(),t.class||delete t.class)),n||(n=(0,xe.L)(ge).getFormatTypeForBareElement(e)),!n)return t?{type:e,attributes:t}:{type:e};if(n.__experimentalCreatePrepareEditableTree&&!n.__experimentalCreateOnChangeEditableValue)return null;if(!t)return{formatType:n,type:n.name,tagName:e};const i={},r={},o={...t};for(const e in n.attributes){const t=n.attributes[e];i[e]=o[t],delete o[t],void 0===i[e]&&delete i[e]}for(const e in o)r[e]=t[e];return!1===n.contentEditable&&delete r.contenteditable,{formatType:n,type:n.name,tagName:e,attributes:i,unregisteredAttributes:r}}var He=class e{#e;static empty(){return new e}static fromPlainText(t){return new e(We({text:t}))}static fromHTMLString(t){return new e(We({html:t}))}static fromHTMLElement(t,n={}){const{preserveWhiteSpace:i=!1}=n,r=i?t:Ke(t),o=new e(We({element:r}));return Object.defineProperty(o,"originalHTML",{value:t.innerHTML}),o}constructor(e={formats:[],replacements:[],text:""}){this.#e=e}toPlainText(){return Ve(this.#e)}toHTMLString({preserveWhiteSpace:e}={}){return this.originalHTML||Be({value:this.#e,preserveWhiteSpace:e})}valueOf(){return this.toHTMLString()}toString(){return this.toHTMLString()}toJSON(){return this.toHTMLString()}get length(){return this.text.length}get formats(){return this.#e.formats}get replacements(){return this.#e.replacements}get text(){return this.#e.text}};for(const e of Object.getOwnPropertyNames(String.prototype))He.prototype.hasOwnProperty(e)||Object.defineProperty(He.prototype,e,{value(...t){return this.toHTMLString()[e](...t)}});function We({element:e,text:t,html:n,range:i,__unstableIsEditableTree:r}={}){return n instanceof He?{text:n.text,formats:n.formats,replacements:n.replacements}:"string"==typeof t&&t.length>0?{formats:Array(t.length),replacements:Array(t.length),text:t}:("string"==typeof n&&n.length>0&&(e=ke(document,n)),"object"!=typeof e?{formats:[],replacements:[],text:""}:Je({element:e,range:i,isEditableTree:r}))}function Ge(e,t,n,i){if(!n)return;const{parentNode:r}=t,{startContainer:o,startOffset:s,endContainer:a,endOffset:l}=n,c=e.text.length;void 0!==i.start?e.start=c+i.start:t===o&&t.nodeType===t.TEXT_NODE?e.start=c+s:r===o&&t===o.childNodes[s]?e.start=c:r===o&&t===o.childNodes[s-1]?e.start=c+i.text.length:t===o&&(e.start=c),void 0!==i.end?e.end=c+i.end:t===a&&t.nodeType===t.TEXT_NODE?e.end=c+l:r===a&&t===a.childNodes[l-1]?e.end=c+i.text.length:r===a&&t===a.childNodes[l]?e.end=c:t===a&&(e.end=c+l)}function qe(e,t,n){if(!t)return;const{startContainer:i,endContainer:r}=t;let{startOffset:o,endOffset:s}=t;return e===i&&(o=n(e.nodeValue.slice(0,o)).length),e===r&&(s=n(e.nodeValue.slice(0,s)).length),{startContainer:i,startOffset:o,endContainer:r,endOffset:s}}function Ke(e,t=!0,n=!1,i=!1){const r=e.cloneNode(!0);return r.normalize(),Array.from(r.childNodes).forEach((e,r,o)=>{if(e.nodeType===e.TEXT_NODE){let s=e.nodeValue;/[\n\t\r\f]/.test(s)&&(s=s.replace(/[\n\t\r\f]+/g," ")),-1!==s.indexOf(" ")&&(s=s.replace(/ {2,}/g," ")),0===r&&s.startsWith(" ")&&(t||n)&&(s=s.slice(1)),r===o.length-1&&s.endsWith(" ")&&(t||i)&&(s=s.slice(0,-1)),e.nodeValue=s}else if(e.nodeType===e.ELEMENT_NODE){const{previousSibling:r,nextSibling:o}=e,s=r?.textContent.endsWith(" "),a=o?.textContent.startsWith(" ");e.replaceWith(Ke(e,!1,r?s:t||n,o?a:t||i))}}),r}function Ye(e){return e.replace(new RegExp(`[\ufeff${we}\r]`,"gu"),"")}function Je({element:e,range:t,isEditableTree:n}){const i={formats:[],replacements:[],text:""};if(!e)return i;if(!e.hasChildNodes())return Ge(i,e,t,{formats:[],replacements:[],text:""}),i;const r=e.childNodes.length;for(let o=0;oe===t)}function et({start:e,end:t}){if(void 0!==e&&void 0!==t)return e===t}function tt({text:e}){return 0===e.length}var nt=n(73201);function it(e,t){if("string"==typeof(t={name:e,...t}).name)if(/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(t.name))if((0,xe.L)(ge).getFormatType(t.name))window.console.error('Format "'+t.name+'" is already registered.');else if("string"==typeof t.tagName&&""!==t.tagName)if("string"==typeof t.className&&""!==t.className||null===t.className)if(/^[_a-zA-Z]+[a-zA-Z0-9_-]*$/.test(t.className)){if(null===t.className){const e=(0,xe.L)(ge).getFormatTypeForBareElement(t.tagName);if(e&&"core/unknown"!==e.name)return void window.console.error(`Format "${e.name}" is already registered to handle bare tag name "${t.tagName}".`)}else{const e=(0,xe.L)(ge).getFormatTypeForClassName(t.className);if(e)return void window.console.error(`Format "${e.name}" is already registered to handle class name "${t.className}".`)}if("title"in t&&""!==t.title)if("keywords"in t&&t.keywords.length>3)window.console.error('The format "'+t.name+'" can have a maximum of 3 keywords.');else{if("string"==typeof t.title)return(0,nt.J)(ge).addFormatTypes(t),t;window.console.error("Format titles must be strings.")}else window.console.error('The format "'+t.name+'" must have a title.')}else window.console.error("A class name must begin with a letter, followed by any number of hyphens, underscores, letters, or numbers.");else window.console.error("Format class names must be a string, or null to handle bare elements.");else window.console.error("Format tag names must be a string.");else window.console.error("Format names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-format");else window.console.error("Format names must be strings.")}function rt(e,t,n=e.start,i=e.end){const{formats:r,activeFormats:o}=e,s=r.slice();if(n===i){const e=s[n]?.find(({type:e})=>e===t);if(e){for(;s[n]?.find(t=>t===e);)ot(s,n,t),n--;for(i++;s[i]?.find(t=>t===e);)ot(s,i,t),i++}}else for(let e=n;ee!==t)||[]})}function ot(e,t,n){const i=e[t].filter(({type:e})=>e!==n);i.length?e[t]=i:delete e[t]}function st(e,t,n=e.start,i=e.end){const{formats:r,replacements:o,text:s}=e;"string"==typeof t&&(t=We({text:t}));const a=n+t.text.length;return ye({formats:r.slice(0,n).concat(t.formats,r.slice(i)),replacements:o.slice(0,n).concat(t.replacements,o.slice(i)),text:s.slice(0,n)+t.text+s.slice(i),start:a,end:a})}function at(e,t,n){return st(e,We(),t,n)}function lt(e,t,n,i){return st(e,{formats:[,],replacements:[t],text:we},n,i)}function ct(e,t=e.start,n=e.end){const{formats:i,replacements:r,text:o}=e;return void 0===t||void 0===n?{...e}:{formats:i.slice(t,n),replacements:r.slice(t,n),text:o.slice(t,n)}}function ut({formats:e,replacements:t,text:n,start:i,end:r},o){if("string"!=typeof o)return function({formats:e,replacements:t,text:n,start:i,end:r},o=i,s=r){if(void 0===i||void 0===r)return;return[{formats:e.slice(0,o),replacements:t.slice(0,o),text:n.slice(0,o)},{formats:e.slice(s),replacements:t.slice(s),text:n.slice(s),start:0,end:0}]}(...arguments);let s=0;return n.split(o).map(n=>{const a=s,l={formats:e.slice(a,a+n.length),replacements:t.slice(a,a+n.length),text:n};return s+=o.length+n.length,void 0!==i&&void 0!==r&&(i>=a&&ia&&(l.start=0),r>=a&&rs&&(l.end=n.length)),l})}var dt=n(25958);function ht(e,t){return Qe(e,t.type)?(t.title&&(0,dt.L)((0,ee.sprintf)((0,ee.__)("%s removed."),t.title),"assertive"),rt(e,t.type)):(t.title&&(0,dt.L)((0,ee.sprintf)((0,ee.__)("%s applied."),t.title),"assertive"),_e(e,t))}var pt=n(57470),{lock:ft,unlock:mt}=(0,pt.yf)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/rich-text"),gt=n(26184),bt=n(70228),yt=n(32389);function vt(e,t){return e===t||e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset}var _t="http://www.w3.org/1998/Math/MathML";function xt(e,t,n){const i=e.parentNode;let r=0;for(;e=e.previousSibling;)r++;return n=[r,...n],i!==t&&(n=xt(i,t,n)),n}function kt(e,t){for(t=[...t];e&&t.length>1;)e=e.childNodes[t.shift()];return{node:e,offset:t[0]}}function wt(e,t){if(void 0!==t.html)return e.innerHTML+=t.html;"string"==typeof t&&(t=e.ownerDocument.createTextNode(t));const{type:n,attributes:i}=t;if(n)if("#comment"===n)t=e.ownerDocument.createComment(i["data-rich-text-comment"]);else{const r=e.namespaceURI;t="math"===n?e.ownerDocument.createElementNS(_t,n):r===_t?"MTEXT"===e.tagName?e.ownerDocument.createElement(n):e.ownerDocument.createElementNS(_t,n):e.ownerDocument.createElement(n);for(const e in i)t.setAttribute(e,i[e])}return e.appendChild(t)}function Ct(e,t){e.appendData(t)}function St({lastChild:e}){return e}function At({parentNode:e}){return e}function It(e){return e.nodeType===e.TEXT_NODE}function Et({nodeValue:e}){return e}function jt(e){return e.parentNode.removeChild(e)}function Tt({value:e,current:t,prepareEditableTree:n,__unstableDomOnly:i,placeholder:r}){const{body:o,selection:s}=function({value:e,prepareEditableTree:t,isEditableTree:n=!0,placeholder:i,doc:r=document}){let o=[],s=[];t&&(e={...e,formats:t(e)});const a=Te({value:e,createEmpty:()=>ke(r,""),append:wt,getLastChild:St,getParent:At,isText:It,getText:Et,remove:jt,appendText:Ct,onStartIndex(e,t){o=xt(t,e,[t.nodeValue.length])},onEndIndex(e,t){s=xt(t,e,[t.nodeValue.length])},isEditableTree:n,placeholder:i});return{body:a,selection:{startPath:o,endPath:s}}}({value:e,prepareEditableTree:n,placeholder:r,doc:t.ownerDocument});Bt(o,t),void 0===e.start||i||function({startPath:e,endPath:t},n){const{node:i,offset:r}=kt(n,e),{node:o,offset:s}=kt(n,t),{ownerDocument:a}=n,{defaultView:l}=a,c=l.getSelection(),u=a.createRange();u.setStart(i,r),u.setEnd(o,s);const{activeElement:d}=a;if(c.rangeCount>0){if(vt(u,c.getRangeAt(0)))return;c.removeAllRanges()}c.addRange(u),d!==a.activeElement&&d instanceof l.HTMLElement&&d.focus()}(s,t)}function Bt(e,t){let n,i=0;for(;n=e.firstChild;){const r=t.childNodes[i];if(r)if(r.isEqualNode(n))e.removeChild(n);else if(r.nodeName!==n.nodeName||r.nodeType===r.TEXT_NODE&&r.data!==n.data)t.replaceChild(n,r);else{const t=r.attributes,i=n.attributes;if(t){let e=t.length;for(;e--;){const{name:i}=t[e];n.getAttribute(i)||r.removeAttribute(i)}}if(i)for(let e=0;e{if(!(n&&n.length||o))return;const e="*[data-rich-text-format-boundary]",i=t.current.querySelector(e);if(!i)return;const{ownerDocument:r}=i,{defaultView:s}=r,a=s.getComputedStyle(i),l=`.rich-text:focus ${e} {background-color: ${(0,te.Mj)(a.color).alpha(.2).toRgbString()}}`,c="rich-text-boundary-style";let u=r.getElementById(c);u||(u=r.createElement("style"),u.id=c,r.head.appendChild(u)),u.innerHTML!==l&&(u.innerHTML=l)},[n,o]),t}var Rt=n(6851),Ot=[],Lt=new Set(["insertParagraph","insertOrderedList","insertUnorderedList","insertHorizontalRule","insertLink"]),Mt=[],Pt="data-rich-text-placeholder",Dt=[e=>t=>{function n(n){const{record:i}=e.current,{ownerDocument:r}=t;if(et(i.current)||!t.contains(r.activeElement))return;const o=ct(i.current),s=Ve(o),a=Be({value:o});n.clipboardData.setData("text/plain",s),n.clipboardData.setData("text/html",a),n.clipboardData.setData("rich-text","true"),n.preventDefault(),"cut"===n.type&&r.execCommand("delete")}const{defaultView:i}=t.ownerDocument;return i.addEventListener("copy",n),i.addEventListener("cut",n),()=>{i.removeEventListener("copy",n),i.removeEventListener("cut",n)}},()=>e=>{function t(t){const{target:n}=t;if(n===e||n.textContent&&n.isContentEditable)return;const{ownerDocument:i}=n,{defaultView:r}=i,o=r.getSelection();if(o.containsNode(n))return;const s=i.createRange(),a=n.isContentEditable?n:n.closest("[contenteditable]");s.selectNode(a),o.removeAllRanges(),o.addRange(s),t.preventDefault()}function n(n){n.relatedTarget&&!e.contains(n.relatedTarget)&&"A"===n.relatedTarget.tagName&&t(n)}return e.addEventListener("click",t),e.addEventListener("focusin",n),()=>{e.removeEventListener("click",t),e.removeEventListener("focusin",n)}},e=>t=>{function n(n){const{keyCode:i,shiftKey:r,altKey:o,metaKey:s,ctrlKey:a}=n;if(r||o||s||a||i!==Rt.M3&&i!==Rt.NS)return;const{record:l,applyRecord:c,forceRender:u}=e.current,{text:d,formats:h,start:p,end:f,activeFormats:m=[]}=l.current,g=et(l.current),{ownerDocument:b}=t,{defaultView:y}=b,{direction:v}=y.getComputedStyle(t),_="rtl"===v?Rt.NS:Rt.M3,x=n.keyCode===_;if(g&&0===m.length){if(0===p&&x)return;if(f===d.length&&!x)return}if(!g)return;const k=h[p-1]||Ot,w=h[p]||Ot,C=x?k:w,S=m.every((e,t)=>e===C[t]);let A=m.length;if(S?A{t.removeEventListener("keydown",n)}},e=>t=>{function n(t){const{keyCode:n}=t,{createRecord:i,handleChange:r}=e.current;if(t.defaultPrevented)return;if(n!==Rt.SJ&&n!==Rt.G_)return;const o=i(),{start:s,end:a,text:l}=o;0===s&&0!==a&&a===l.length&&(r(at(o)),t.preventDefault())}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{const{ownerDocument:n}=t,{defaultView:i}=n;let r=!1;function o(t){if(r)return;let n;t&&(n=t.inputType);const{record:i,applyRecord:o,createRecord:s,handleChange:a}=e.current;if(n&&(0===n.indexOf("format")||Lt.has(n)))return void o(i.current);const l=s(),{start:c,activeFormats:u=[]}=i.current,d=!et(i.current)&&l.start<=c,h=function({value:e,start:t,end:n,formats:i}){const r=Math.min(t,n),o=Math.max(t,n),s=e.formats[r-1]||[],a=e.formats[o]||[];for(e.activeFormats=i.map((e,t)=>{if(s[t]){if(be(e,s[t]))return s[t]}else if(a[t]&&be(e,a[t]))return a[t];return e});--n>=t;)e.activeFormats.length>0?e.formats[n]=e.activeFormats:delete e.formats[n];return e}({value:l,start:c,end:l.start,formats:d?[]:u});a(h)}function s(){const{record:a,applyRecord:l,createRecord:c,onSelectionChange:u}=e.current;if("true"!==t.contentEditable)return;if(n.activeElement!==t)return void n.removeEventListener("selectionchange",s);if(r)return;const{start:d,end:h,text:p}=c(),f=a.current;if(p!==f.text)return void o();if(d===f.start&&h===f.end)return void(0===f.text.length&&0===d&&function(e){const t=e.getSelection(),{anchorNode:n,anchorOffset:i}=t;if(n.nodeType!==n.ELEMENT_NODE)return;const r=n.childNodes[i];r&&r.nodeType===r.ELEMENT_NODE&&r.hasAttribute(Pt)&&t.collapseToStart()}(i));const m={...f,start:d,end:h,activeFormats:f._newActiveFormats,_newActiveFormats:void 0},g=Se(m,Mt);m.activeFormats=g,a.current=m,l(m,{domOnly:!0}),u(d,h)}function a(){r=!0,n.removeEventListener("selectionchange",s),t.querySelector(`[${Pt}]`)?.remove()}function l(){r=!1,o({inputType:"insertText"}),n.addEventListener("selectionchange",s)}function c(){const{record:i,isSelected:r,onSelectionChange:o,applyRecord:a}=e.current;if(!t.parentElement.closest('[contenteditable="true"]')){if(r)a(i.current,{domOnly:!0});else{const e=void 0;i.current={...i.current,start:e,end:e,activeFormats:Mt}}o(i.current.start,i.current.end),window.queueMicrotask(s),n.addEventListener("selectionchange",s)}}return t.addEventListener("input",o),t.addEventListener("compositionstart",a),t.addEventListener("compositionend",l),t.addEventListener("focus",c),()=>{t.removeEventListener("input",o),t.removeEventListener("compositionstart",a),t.removeEventListener("compositionend",l),t.removeEventListener("focus",c)}},()=>e=>{const{ownerDocument:t}=e,{defaultView:n}=t,i=n?.getSelection();let r;function o(){return i.rangeCount?i.getRangeAt(0):null}function s(e){const n="keydown"===e.type?"keyup":"pointerup";function i(){t.removeEventListener(n,s),t.removeEventListener("selectionchange",i),t.removeEventListener("input",i)}function s(){i(),vt(r,o())||t.dispatchEvent(new Event("selectionchange"))}t.addEventListener(n,s),t.addEventListener("selectionchange",i),t.addEventListener("input",i),r=o()}return e.addEventListener("pointerdown",s),e.addEventListener("keydown",s),()=>{e.removeEventListener("pointerdown",s),e.removeEventListener("keydown",s)}},function(){return e=>{const{ownerDocument:t}=e,{defaultView:n}=t;let i=null;function r(t){t.defaultPrevented||t.target!==e&&t.target.contains(e)&&(i=e.getAttribute("contenteditable"),e.setAttribute("contenteditable","false"),n.getSelection().removeAllRanges())}function o(){null!==i&&(e.setAttribute("contenteditable",i),i=null)}return n.addEventListener("pointerdown",r),n.addEventListener("pointerup",o),()=>{n.removeEventListener("pointerdown",r),n.removeEventListener("pointerup",o)}}}];function Ft(e){const t=(0,T.useRef)(e);(0,T.useInsertionEffect)(()=>{t.current=e});const n=(0,T.useMemo)(()=>Dt.map(e=>e(t)),[t]);return(0,bt.A)(e=>{const t=n.map(t=>t(e));return()=>{t.forEach(e=>e())}},[n])}var zt=n(51751),Vt=n(59717);function Ut(e){return e(ge).getFormatTypes()}var $t=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function Ht(e,t){return e[t]?e[t]:Object.keys(e).filter(e=>e.startsWith(t+".")).reduce((n,i)=>(n[i.slice(t.length+1)]=e[i],n),{})}function Wt({value:e="",selectionStart:t,selectionEnd:n,placeholder:i,onSelectionChange:r,preserveWhiteSpace:o,onChange:s,__unstableDisableFormats:a,__unstableIsSelected:l,__unstableDependencies:c=[],__unstableAfterParse:u,__unstableBeforeSerialize:d,__unstableAddInvisibleFormats:h}){const p=(0,yt.A)(),[,f]=(0,T.useReducer)(()=>({})),m=(0,T.useRef)();function g(e,{domOnly:t}={}){Tt({value:e,current:m.current,prepareEditableTree:h,__unstableDomOnly:t,placeholder:i})}const b=(0,T.useRef)(e),y=(0,T.useRef)();function v(){const i=y.current?.activeFormats;b.current=e,y.current=e,e instanceof He||(y.current=e?He.fromHTMLString(e,{preserveWhiteSpace:o}):He.empty()),y.current={text:y.current.text,formats:y.current.formats,replacements:y.current.replacements,activeFormats:i},a&&(y.current.formats=Array(e.length),y.current.replacements=Array(e.length)),u&&(y.current.formats=u(y.current)),y.current.start=t,y.current.end=n}const _=(0,T.useRef)(!1);function x(t){if(y.current=t,g(t),a)b.current=t.text;else{const n=d?d(t):t.formats;t={...t,formats:n},b.current="string"==typeof e?Be({value:t,preserveWhiteSpace:o}):new He(t)}const{start:n,end:i,formats:l,text:c}=y.current;p.batch(()=>{r(n,i),s(b.current,{__unstableFormats:l,__unstableText:c})}),f()}function k(){const t=b.current;v();const n=t&&"string"==typeof t&&"string"==typeof e&&t.length!==e.length,i=m.current?.contains(m.current.ownerDocument.activeElement),r=n&&!i;g(y.current,{domOnly:r})}y.current?t===y.current.start&&n===y.current.end||(_.current=l,y.current={...y.current,start:t,end:n,activeFormats:void 0}):(_.current=l,v());const w=(0,T.useRef)(!1);(0,T.useLayoutEffect)(()=>{w.current&&e!==b.current&&(k(),f())},[e]),(0,T.useLayoutEffect)(()=>{_.current&&(m.current.ownerDocument.activeElement!==m.current&&m.current.focus(),g(y.current),_.current=!1)},[_.current]);const C=(0,gt.A)([m,(0,T.useCallback)(e=>{e&&(e.style.whiteSpace=e.style.whiteSpace||"pre-wrap")},[]),Nt({record:y}),Ft({record:y,handleChange:x,applyRecord:g,createRecord:function(){const{ownerDocument:{defaultView:e}}=m.current,t=e.getSelection(),n=t.rangeCount>0?t.getRangeAt(0):null;return We({element:m.current,range:n,__unstableIsEditableTree:!0})},isSelected:l,onSelectionChange:r,forceRender:f}),(0,bt.A)(()=>{k(),w.current=!0},[i,...c])]);return{value:y.current,getValue:()=>y.current,onChange:x,ref:C}}var Gt={};ft(Gt,{useRichText:function({allowedFormats:e,withoutInteractiveFormatting:t,onChange:n,__unstableDependencies:i=[],__unstableFormatTypeHandlerContext:r,...o}){const{formatTypes:s,prepareHandlers:a,valueHandlers:l,changeHandlers:c,dependencies:u}=function({allowedFormats:e,withoutInteractiveFormatting:t,__unstableFormatTypeHandlerContext:n}){const i=(0,zt.A)(Ut,[]),r=(0,T.useMemo)(()=>i.filter(({name:n,interactive:i,tagName:r})=>!(e&&!e.includes(n)||t&&(i||$t.has(r)))),[i,e,t]),o=(0,zt.A)(e=>r.reduce((t,i)=>{return i.__experimentalGetPropsForEditableTreePreparation&&n?{...t,...(r=i.__experimentalGetPropsForEditableTreePreparation(e,n),o=i.name,"object"!=typeof r?{[o]:r}:Object.fromEntries(Object.entries(r).map(([e,t])=>[`${o}.${e}`,t])))}:t;var r,o},{}),[r,n]),s=(0,Vt.A)(),a=[],l=[],c=[],u=[];for(const e in o)u.push(o[e]);return r.forEach(e=>{if(e.__experimentalCreatePrepareEditableTree&&n){const t=e.__experimentalCreatePrepareEditableTree(Ht(o,e.name),n);e.__experimentalCreateOnChangeEditableValue?l.push(t):a.push(t)}if(e.__experimentalCreateOnChangeEditableValue&&n){let t={};e.__experimentalGetPropsForEditableTreeChangeHandler&&(t=e.__experimentalGetPropsForEditableTreeChangeHandler(s,n));const i=Ht(o,e.name);c.push(e.__experimentalCreateOnChangeEditableValue({..."object"==typeof i?i:{},...t},n))}}),{formatTypes:r,prepareHandlers:a,valueHandlers:l,changeHandlers:c,dependencies:u}}({allowedFormats:e,withoutInteractiveFormatting:t,__unstableFormatTypeHandlerContext:r});return{...Wt({...o,onChange(e,{__unstableFormats:t,__unstableText:i}){n(e,{__unstableFormats:t,__unstableText:i}),Object.values(c).forEach(e=>{e(t,i)})},__unstableDependencies:[...u,...i],__unstableAfterParse:function(e){return l.reduce((t,n)=>n(t,e.text),e.formats)},__unstableBeforeSerialize:function(e){return s.forEach(t=>{t.__experimentalCreatePrepareEditableTree&&(e=rt(e,t.name,0,e.text.length))}),e.formats},__unstableAddInvisibleFormats:function(e){return a.reduce((t,n)=>n(t,e.text),e.formats)}}),formatTypes:s}}});var qt=n(29648);function Kt(e){if(!e.collapsed){const t=Array.from(e.getClientRects());if(1===t.length)return t[0];const n=t.filter(({width:e})=>e>1);if(0===n.length)return e.getBoundingClientRect();if(1===n.length)return n[0];let{top:i,bottom:r,left:o,right:s}=n[0];for(const{top:e,bottom:t,left:a,right:l}of n)er&&(r=t),as&&(s=l);return new window.DOMRect(o,i,s-o,r-i)}const{startContainer:t}=e,{ownerDocument:n}=t;if("BR"===t.nodeName){const{parentNode:i}=t;(0,re.e)(i,"parentNode");const r=Array.from(i.childNodes).indexOf(t);(0,re.e)(n,"ownerDocument"),(e=n.createRange()).setStart(i,r),e.setEnd(i,r)}const i=e.getClientRects();if(i.length>1)return null;let r=i[0];if(!r||0===r.height){(0,re.e)(n,"ownerDocument");const t=n.createTextNode("​");(e=e.cloneRange()).insertNode(t),r=e.getClientRects()[0],(0,re.e)(t.parentNode,"padNode.parentNode"),t.parentNode.removeChild(t)}return r}function Yt(e,t){return{contextElement:t,getBoundingClientRect:()=>t.contains(e.startContainer)?Kt(e)??e.getBoundingClientRect():t.getBoundingClientRect()}}function Jt(e,t,n){if(!e)return;const{ownerDocument:i}=e,{defaultView:r}=i,o=r?.getSelection();if(!o)return;if(!o.rangeCount)return;const s=o.getRangeAt(0);return s&&s.startContainer?t||n?function(e,t,n,i){let r=e.startContainer;if(r.nodeType===r.TEXT_NODE&&r instanceof window.Text&&e.startOffset===r.length&&r.nextSibling)for(r=r.nextSibling;r.firstChild;)r=r.firstChild;if(r.nodeType!==r.ELEMENT_NODE){if(!r.parentElement)return;r=r.parentElement}if(r===t)return;if(!t.contains(r))return;const o=n+(i?"."+i:"");if(!o)return;if(!(r instanceof window.HTMLElement))return;let s=r;for(;s&&s!==t;){if(s.matches(o))return s;s=s.parentElement}}(s,e,t,n)??Yt(s,e):Yt(s,e):void 0}var Xt={tagName:"",className:""};function Zt({editableContentElement:e,settings:t}){const{tagName:n,className:i}=t??Xt,r=!!(t&&"isActive"in t&&t.isActive),[o,s]=(0,T.useState)(()=>Jt(e,n,i??"")),a=(0,qt.A)(r);return(0,T.useLayoutEffect)(()=>{if(!e)return;function t(){s(Jt(e,n,i??""))}function o(){c.addEventListener("selectionchange",t)}function l(){c.removeEventListener("selectionchange",t)}const{ownerDocument:c}=e;return(e===c.activeElement||!a&&r||a&&!r)&&(s(Jt(e,n,i??"")),o()),e.addEventListener("focusin",o),e.addEventListener("focusout",l),()=>{l(),e.removeEventListener("focusin",o),e.removeEventListener("focusout",l)}},[e,n,i,r,a]),o}var Qt=n(99843),en="block-default",tn=["attributes","supports","save","migrate","isEligible","apiVersion"],nn={"--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},backgroundGradient:{value:["background","gradient"],support:["background","gradient"],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},height:{value:["dimensions","height"],support:["dimensions","height"],useEngine:!0},width:{value:["dimensions","width"],support:["dimensions","width"],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},textIndent:{value:["typography","textIndent"],support:["typography","textIndent"],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}},rn={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",select:"select",textInput:"textarea, input:where([type=email],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=url])"},on={"color.duotone":!0,"color.gradients":!0,"color.palette":!0,"dimensions.aspectRatios":!0,"typography.fontSizes":!0,"spacing.spacingSizes":!0},sn=n(52008);const an=JSON.parse('{"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"]}]}');var{lock:ln,unlock:cn}=(0,pt.yf)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/blocks");function un(e){return null!==e&&"object"==typeof e}function dn({textdomain:e,...t}){const n=["apiVersion","title","category","parent","ancestor","icon","description","keywords","attributes","providesContext","usesContext","selectors","supports","styles","example","variations","blockHooks","allowedBlocks"],i=Object.fromEntries(Object.entries(t).filter(([e])=>n.includes(e)));return e&&Object.keys(an).forEach(t=>{i[t]&&(i[t]=pn(an[t],i[t],e))}),i}function hn(e,t){const n=un(e)?e.name:e;if("string"!=typeof n)return void(0,sn.A)("Block names must be strings.");if(!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(n))return void(0,sn.A)("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,xe.L)(Zi).getBlockType(n))return void(0,sn.A)('Block "'+n+'" is already registered.');const{addBootstrappedBlockType:i,addUnprocessedBlockType:r}=cn((0,nt.J)(Zi));return un(e)&&i(n,dn(e)),r(n,t),(0,xe.L)(Zi).getBlockType(n)}function pn(e,t,n){return"string"==typeof e&&"string"==typeof t?(0,ee._x)(t,e,n):Array.isArray(e)&&e.length&&Array.isArray(t)?t.map(t=>pn(e[0],t,n)):un(e)&&Object.entries(e).length&&un(t)?Object.keys(t).reduce((i,r)=>e[r]?(i[r]=pn(e[r],t[r],n),i):(i[r]=t[r],i),{}):t}function fn(){return(0,xe.L)(Zi).getFreeformFallbackBlockName()}function mn(){return(0,xe.L)(Zi).getUnregisteredFallbackBlockName()}function gn(){return(0,xe.L)(Zi).getDefaultBlockName()}function bn(e){return(0,xe.L)(Zi)?.getBlockType(e)}function yn(){return(0,xe.L)(Zi).getBlockTypes()}function vn(e,t,n){return(0,xe.L)(Zi).getBlockSupport(e,t,n)}function _n(e,t,n){return(0,xe.L)(Zi).hasBlockSupport(e,t,n)}function xn(e){return"core/block"===e?.name}function kn(e){return"core/template-part"===e?.name}var wn=(e,t)=>(0,xe.L)(Zi).getBlockVariations(e,t);function Cn(e){return cn((0,xe.L)(Zi)).getBlockBindingsSource(e)}(0,te.X$)([ne.A,ie.A]);var Sn=["#191e23","#f8f9f9"];function An(e,t){const n=bn(e.name)?.attributes??{},i=t?Object.entries(n).filter(([n,i])=>"content"===t&&"metadata"===n?Object.keys(e.attributes[n]?.bindings??{}).length>0:i.role===t||i.__experimentalRole===t):[];return(i.length?i:Object.entries(n)).every(([t,n])=>{const i=e.attributes[t];return n.hasOwnProperty("default")?i===n.default:"rich-text"===n.type?!i?.length:void 0===i})}function In(e,t){return e.name===gn()&&An(e,t)}function En(e){return!!e&&("string"==typeof e||(0,T.isValidElement)(e)||"function"==typeof e||e instanceof T.Component)}function jn(e){return"string"==typeof e?bn(e):e}function Tn(e,t,n="visual"){const{__experimentalLabel:i,title:r}=e,o=i&&i(t,{context:n});return o?o.toPlainText?o.toPlainText():ae(o):r}function Bn(e){return void 0!==e.default?e.default:"rich-text"===e.type?new He:void 0}function Nn(e){return void 0!==bn(e)}function Rn(e,t){const n=bn(e);if(void 0===n)throw new Error(`Block type '${e}' is not registered.`);return Object.entries(n.attributes).reduce((e,[n,i])=>{const r=t[n];if(void 0!==r)"rich-text"===i.type?r instanceof He?e[n]=r:"string"==typeof r&&(e[n]=He.fromHTMLString(r)):"string"===i.type&&r instanceof He?e[n]=r.toHTMLString():e[n]=r;else{const t=Bn(i);void 0!==t&&(e[n]=t)}return-1!==["node","children"].indexOf(i.source??"")&&("string"==typeof e[n]?e[n]=[e[n]]:Array.isArray(e[n])||(e[n]=[])),e},{})}function On(e,t){const n=Array.isArray(t)?t:[t];return Object.fromEntries(Object.entries(e).filter(([e])=>!n.includes(e)))}var Ln=[{slug:"text",title:(0,ee.__)("Text")},{slug:"media",title:(0,ee.__)("Media")},{slug:"design",title:(0,ee.__)("Design")},{slug:"widgets",title:(0,ee.__)("Widgets")},{slug:"theme",title:(0,ee.__)("Theme")},{slug:"embed",title:(0,ee.__)("Embeds")},{slug:"reusable",title:(0,ee.__)("Reusable blocks")}];function Mn(e){return e.reduce((e,t)=>({...e,[t.name]:t}),{})}function Pn(e){return e.reduce((e,t)=>(e.some(e=>e.name===t.name)||e.push(t),e),[])}function Dn(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}}var Fn=Dn("SET_DEFAULT_BLOCK_NAME"),zn=Dn("SET_FREEFORM_FALLBACK_BLOCK_NAME"),Vn=Dn("SET_UNREGISTERED_FALLBACK_BLOCK_NAME"),Un=Dn("SET_GROUPING_BLOCK_NAME");function $n(e=[],t=[]){const n=Array.from(new Set(e.concat(t)));return n.length>0?n:void 0}var Hn=(0,D.combineReducers)({bootstrappedBlockTypes:function(e={},t){switch(t.type){case"ADD_BOOTSTRAPPED_BLOCK_TYPE":const{name:n,blockType:i}=t;if(e[n])return e;const r=Object.fromEntries(Object.entries(i).filter(([,e])=>null!=e).map(([e,t])=>[Q(e),t]));return r.name=n,{...e,[n]:r};case"REMOVE_BLOCK_TYPES":return On(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 On(e,t.names)}return e},blockTypes:function(e={},t){switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Mn(t.blockTypes)};case"REMOVE_BLOCK_TYPES":return On(e,t.names)}return e},blockStyles:function(e={},t){switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(Mn(t.blockTypes)).map(([t,n])=>[t,Pn([...(n.styles??[]).map(e=>({...e,source:"block"})),...(e[n.name]??[]).filter(({source:e})=>"block"!==e)])]))};case"ADD_BLOCK_STYLES":const n={};return t.blockNames.forEach(i=>{n[i]=Pn([...e[i]??[],...t.styles])}),{...e,...n};case"REMOVE_BLOCK_STYLES":return{...e,[t.blockName]:(e[t.blockName]??[]).filter(e=>-1===t.styleNames.indexOf(e.name))}}return e},blockVariations:function(e={},t){switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(Mn(t.blockTypes)).map(([t,n])=>[t,Pn([...(n.variations??[]).map(e=>({...e,source:"block"})),...(e[n.name]??[]).filter(({source:e})=>"block"!==e)])]))};case"ADD_BLOCK_VARIATIONS":return{...e,[t.blockName]:Pn([...e[t.blockName]??[],...t.variations])};case"REMOVE_BLOCK_VARIATIONS":return{...e,[t.blockName]:(e[t.blockName]??[]).filter(e=>-1===t.variationNames.indexOf(e.name))}}return e},defaultBlockName:Fn,freeformFallbackBlockName:zn,unregisteredFallbackBlockName:Vn,groupingBlockName:Un,categories:function(e=Ln,t){switch(t.type){case"SET_CATEGORIES":const n=new Map;return(t.categories||[]).forEach(e=>{n.set(e.slug,e)}),[...n.values()];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 On(e,t.namespace)}return e},blockBindingsSources:function(e={},t){switch(t.type){case"ADD_BLOCK_BINDINGS_SOURCE":return{...e,[t.name]:{label:t.label||e[t.name]?.label,usesContext:$n(e[t.name]?.usesContext,t.usesContext),getValues:t.getValues,setValues:t.setValues,canUserEditValue:t.setValues&&t.canUserEditValue,getFieldsList:t.getFieldsList}};case"REMOVE_BLOCK_BINDINGS_SOURCE":return On(e,t.name)}return e}}),Wn=n(38986),Gn=(e,t,n)=>{const i=Array.isArray(t)?t:t.split(".");let r=e;return i.forEach(e=>{r=r?.[e]}),r??n};function qn(e){return"object"==typeof e&&null!==e&&e.constructor===Object}function Kn(e,t){return qn(e)&&qn(t)?Object.entries(t).every(([t,n])=>Kn(e?.[t],n)):e===t}var Yn=n(82639),Jn=["background","backgroundColor","color","linkColor","captionColor","buttonColor","headingColor","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","padding","contentSize","wideSize","blockGap","textAlign","textDecoration","textIndent","textTransform","letterSpacing"];function Xn(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||"textIndent"===e&&!t||"textColumns"===e&&!t))}var Zn=(0,ce.A)((e,t,n)=>{if(!t)return Xn(Jn,t,n);const i=ai(e,t);if(!i)return[];const r=[],o=i?.supports;o?.spacing?.blockGap&&r.push("blockGap"),o?.shadow&&r.push("shadow");const s=nn;return Object.keys(s).forEach(e=>{s[e].support&&(s[e].requiresOptOut&&o&&s[e].support[0]in o&&!1!==Gn(o,s[e].support)||o&&Gn(o,s[e].support,!1))&&r.push(e)}),Xn(r,t,n)},(e,t)=>[e.blockTypes[t]]);function Qn(e,t){return e.bootstrappedBlockTypes[t]}function ei(e){return e.unprocessedBlockTypes}function ti(e){return e.blockBindingsSources}function ni(e,t){return e.blockBindingsSources[t]}var ii=(0,Yn.N)(e=>(0,ce.A)((t,n,i)=>{if(!n.getFieldsList)return[];const r={};if(n?.usesContext?.length)for(const e of n.usesContext)r[e]=i[e];return n.getFieldsList({select:e,context:r})},(e,t,n)=>[t.getFieldsList,t.usesContext,n])),ri=(e,t)=>{const n=ai(e,t);return!!n&&Object.values(n.attributes).some(({role:e,__experimentalRole:n})=>"content"===e||"content"===n&&((0,Qt.A)("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${t} block.`}),!0))},oi=(e,t)=>"string"==typeof t?ai(e,t):t,si=(0,ce.A)(e=>Object.values(e.blockTypes),e=>[e.blockTypes]);function ai(e,t){return e.blockTypes[t]}function li(e,t){return e.blockStyles[t]}var ci=(0,ce.A)((e,t,n)=>{const i=e.blockVariations[t];return i&&n?i.filter(e=>(e.scope||["block","inserter"]).includes(n)):i},(e,t)=>[e.blockVariations[t]]);function ui(e,t,n,i){const r=ci(e,t,i);if(!r)return r;const o=ai(e,t),s=Object.keys(o?.attributes||{});let a,l=0;for(const e of r)if(Array.isArray(e.isActive)){const t=e.isActive.filter(e=>{const t=e.split(".")[0];return s.includes(t)}),i=t.length;if(0===i)continue;t.every(t=>{const i=Gn(e.attributes,t);if(void 0===i)return!1;let r=Gn(n,t);return r instanceof He&&(r=r.toHTMLString()),Kn(r,i)})&&i>l&&(a=e,l=i)}else if(e.isActive?.(n,e.attributes))return a||e;return!a&&["block","transform"].includes(i)&&(a=r.find(e=>e?.isDefault&&!Object.hasOwn(e,"isActive"))),a}function di(e,t,n){const i=ci(e,t,n);return[...i||[]].reverse().find(({isDefault:e})=>!!e)||i?.[0]}function hi(e){return e.categories}function pi(e){return e.collections}function fi(e){return e.defaultBlockName}function mi(e){return e.freeformFallbackBlockName}function gi(e){return e.unregisteredFallbackBlockName}function bi(e){return e.groupingBlockName}var yi=(0,ce.A)((e,t)=>si(e).filter(e=>e.parent?.includes(t)).map(({name:e})=>e),e=>[e.blockTypes]),vi=(e,t,n,i)=>{const r=oi(e,t);return r?.supports?Gn(r.supports,n,i):i};function _i(e,t,n,i){return!!vi(e,t,n,i)}function xi(e){return Wn(e??"").toLowerCase().trim()}function ki(e,t,n=""){const i=oi(e,t),r=xi(n),o=e=>xi(e).includes(r);return o(i?.title)||i?.keywords?.some(o)||o(i?.category)||"string"==typeof i?.description&&o(i.description)}var wi=(e,t)=>yi(e,t).length>0,Ci=(e,t)=>yi(e,t).some(t=>_i(e,t,"inserter",!0)),Si=(...e)=>((0,Qt.A)("__experimentalHasContentRoleAttribute",{since:"6.7",version:"6.8",hint:"This is a private selector."}),ri(...e)),Ai=n(94260),Ii=n(74448),Ei=n(47523),ji={common:"text",formatting:"text",layout:"design"};function Ti(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}var Bi=(e,t)=>({select:n})=>{const i=n.getBootstrappedBlockType(e),r={apiVersion:1,name:e,icon:en,keywords:[],attributes:{},providesContext:{},usesContext:[],selectors:{},supports:{},styles:[],blockHooks:{},save:()=>null,...i,...t,variations:Ti(Array.isArray(i?.variations)?i.variations:[],Array.isArray(t?.variations)?t.variations:[])};r.attributes&&"object"==typeof r.attributes||((0,sn.A)('The block "'+e+'" is registering attributes as `null` or `undefined`. Use an empty object (`attributes: {}`) or exclude the `attributes` key.'),r.attributes={});const o=(0,Ei.W5)("blocks.registerBlockType",r,e,null);if(o.apiVersion<=2&&(0,Qt.A)("Block with API version 2 or lower",{since:"6.9",hint:`The block "${e}" is registered with API version ${o.apiVersion}. This means that the post editor may work as a non-iframe editor. Since all editors are planned to work as iframes in the future, set the \`apiVersion\` field to 3 and test the block inside the iframe editor.`,link:"https://developer.wordpress.org/block-editor/reference-guides/block-api/block-api-versions/block-migration-for-iframe-editor-compatibility/"}),o.description&&"string"!=typeof o.description&&(0,Qt.A)("Declaring non-string block descriptions",{since:"6.2"}),o.deprecated&&(o.deprecated=o.deprecated.map(e=>Object.fromEntries(Object.entries((0,Ei.W5)("blocks.registerBlockType",{...On(r,tn),...e},r.name,e)).filter(([e])=>tn.includes(e))))),(0,Ai.Q)(o))if("function"==typeof o.save)if(!("edit"in o)||(0,Ii.isValidElementType)(o.edit))if(ji.hasOwnProperty(o.category)&&(o.category=ji[o.category]),"category"in o&&!n.getCategories().some(({slug:e})=>e===o.category)&&((0,sn.A)('The block "'+e+'" is registered with an invalid category "'+o.category+'".'),delete o.category),"title"in o&&""!==o.title)if("string"==typeof o.title)if(o.icon=function(e){const t=e||en;if(En(t))return{src:t};const n=t;if("background"in n){const e=(0,te.Mj)(n.background),t=t=>e.contrast(t),i=Math.max(...Sn.map(t));return{...n,foreground:n.foreground?n.foreground:Sn.find(e=>t(e)===i),shadowColor:e.alpha(.3).toRgbString()}}return n}(o.icon),En(o.icon.src))if(("string"==typeof o?.parent||o?.parent instanceof String)&&(o.parent=[o.parent],(0,sn.A)("Parent must be undefined or an array of strings (block types), but it is a string.")),Array.isArray(o?.parent)||void 0===o?.parent){if(1!==o?.parent?.length||e!==o.parent[0])return o;(0,sn.A)('Block "'+e+'" cannot be a parent of itself. Please remove the block name from the parent list.')}else(0,sn.A)("Parent must be undefined or an array of block types, but it is "+o.parent);else(0,sn.A)("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(0,sn.A)("Block titles must be strings.");else(0,sn.A)('The block "'+e+'" must have a title.');else(0,sn.A)('The "edit" property must be a valid component.');else(0,sn.A)('The "save" property must be a valid function.');else(0,sn.A)("Block settings must be a valid object.")};function Ni(e){return{type:"ADD_BLOCK_TYPES",blockTypes:Array.isArray(e)?e:[e]}}function Ri(){return({dispatch:e,select:t})=>{const n=[];for(const[i,r]of Object.entries(t.getUnprocessedBlockTypes())){const t=e(Bi(i,r));t&&n.push(t)}n.length&&e.addBlockTypes(n)}}function Oi(){return(0,Qt.A)('wp.data.dispatch( "core/blocks" ).__experimentalReapplyBlockFilters',{since:"6.4",alternative:"reapplyBlockFilters"}),Ri()}function Li(e){return{type:"REMOVE_BLOCK_TYPES",names:Array.isArray(e)?e:[e]}}function Mi(e,t){return{type:"ADD_BLOCK_STYLES",styles:Array.isArray(t)?t:[t],blockNames:Array.isArray(e)?e:[e]}}function Pi(e,t){return{type:"REMOVE_BLOCK_STYLES",styleNames:Array.isArray(t)?t:[t],blockName:e}}function Di(e,t){return{type:"ADD_BLOCK_VARIATIONS",variations:Array.isArray(t)?t:[t],blockName:e}}function Fi(e,t){return{type:"REMOVE_BLOCK_VARIATIONS",variationNames:Array.isArray(t)?t:[t],blockName:e}}function zi(e){return{type:"SET_DEFAULT_BLOCK_NAME",name:e}}function Vi(e){return{type:"SET_FREEFORM_FALLBACK_BLOCK_NAME",name:e}}function Ui(e){return{type:"SET_UNREGISTERED_FALLBACK_BLOCK_NAME",name:e}}function $i(e){return{type:"SET_GROUPING_BLOCK_NAME",name:e}}function Hi(e){return{type:"SET_CATEGORIES",categories:e}}function Wi(e,t){return{type:"UPDATE_CATEGORY",slug:e,category:t}}function Gi(e,t,n){return{type:"ADD_BLOCK_COLLECTION",namespace:e,title:t,icon:n}}function qi(e){return{type:"REMOVE_BLOCK_COLLECTION",namespace:e}}function Ki(e,t){return{type:"ADD_BOOTSTRAPPED_BLOCK_TYPE",name:e,blockType:t}}function Yi(e,t){return({dispatch:n})=>{n({type:"ADD_UNPROCESSED_BLOCK_TYPE",name:e,blockType:t});const i=n(Bi(e,t));i&&n.addBlockTypes(i)}}function Ji(e){return{type:"ADD_BLOCK_BINDINGS_SOURCE",name:e.name,label:e.label,usesContext:e.usesContext,getValues:e.getValues,setValues:e.setValues,canUserEditValue:e.canUserEditValue,getFieldsList:e.getFieldsList}}function Xi(e){return{type:"REMOVE_BLOCK_BINDINGS_SOURCE",name:e}}var Zi=(0,P.A)("core/blocks",{reducer:Hn,selectors:s,actions:a});(0,D.register)(Zi),cn(Zi).registerPrivateSelectors(o),cn(Zi).registerPrivateActions(l);var Qi=n(37844);function er(e,t={},n=[]){if(!Nn(e))return er("core/missing",{originalName:e,originalContent:"",originalUndelimitedContent:""});const i=Rn(e,t);return{clientId:(0,Qi.A)(),name:e,isValid:!0,attributes:i,innerBlocks:n}}function tr(e=[]){return e.map(e=>{const t=Array.isArray(e)?e:[e.name,e.attributes,e.innerBlocks],[n,i,r=[]]=t;return er(n,i,tr(r))})}function nr(e,t={},n){const{name:i}=e;if(!Nn(i))return er("core/missing",{originalName:i,originalContent:"",originalUndelimitedContent:""});const r=(0,Qi.A)(),o=Rn(i,{...e.attributes,...t});return{...e,clientId:r,attributes:o,innerBlocks:n||e.innerBlocks.map(e=>nr(e))}}function ir(e,t={},n){const i=(0,Qi.A)();return{...e,clientId:i,attributes:{...e.attributes,...t},innerBlocks:n||e.innerBlocks.map(e=>ir(e))}}var rr=(e,t,n)=>{if(!n.length)return!1;const i=n.length>1,r=n[0].name;if(!or(e)&&i&&!e.isMultiBlock)return!1;if(!or(e)&&!n.every(e=>e.name===r))return!1;if("block"!==e.type)return!1;const o=n[0];return!("from"===t&&-1===e.blocks.indexOf(o.name)&&!or(e)||!i&&"from"===t&&sr(o.name)&&sr(e.blockName)||!cr(e,n))},or=e=>!!e&&"block"===e.type&&Array.isArray(e.blocks)&&e.blocks.includes("*"),sr=e=>e===(0,xe.L)(Zi).getGroupingBlockName();function ar(e,t){const n=(0,Ei.FF)();for(let i=0;ie||r,r.priority)}return n.applyFilters("transform",null)}function lr(e,t){if(void 0===t)return yn().map(({name:t})=>lr(e,t)).flat();const n=jn(t),{name:i,transforms:r}=n||{};if(!r||!Array.isArray(r[e]))return[];const o=r.supportedMobileTransforms&&Array.isArray(r.supportedMobileTransforms),s=o?r[e].filter(e=>"raw"===e.type||"prefix"===e.type||!(!e.blocks||!e.blocks.length)&&(!!or(e)||e.blocks.every(e=>r.supportedMobileTransforms.includes(e)))):r[e];return s.map(e=>({...e,blockName:i,usingMobileTransformations:o}))}function cr(e,t){if("function"!=typeof e.isMatch)return!0;const n=t[0],i=e.isMultiBlock?t.map(e=>e.attributes):n.attributes,r=e.isMultiBlock?t:n;return e.isMatch(i,r)}function ur(e,t){const n=Array.isArray(e)?e:[e],i=n.length>1,r=n[0],o=r.name,s=lr("from",t),a=ar(lr("to",o),e=>"block"===e.type&&(or(e)||-1!==e.blocks.indexOf(t))&&(!i||!!e.isMultiBlock)&&cr(e,n))||ar(s,e=>"block"===e.type&&(or(e)||-1!==e.blocks.indexOf(o))&&(!i||!!e.isMultiBlock)&&cr(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(r):a.transform(r.attributes,r.innerBlocks),null===l||"object"!=typeof l?null:(l=Array.isArray(l)?l:[l],l.some(e=>!bn(e.name))?null:l.some(e=>e.name===t)?l.map((t,n,i)=>(0,Ei.W5)("blocks.switchToBlockType.transformedBlock",t,e,n,i)):null)}var dr,hr,pr,fr,mr=(e,t)=>er(e,t.attributes,(t.innerBlocks??[]).map(e=>mr(e.name,e))),gr=/)[^])*)\5|[^]*?)}\s+)?(\/)?-->/g;function br(e,t,n,i,r){return{blockName:e,attrs:t,innerBlocks:n,innerHTML:i,innerContent:r}}function yr(e){return br(null,{},[],e,[e])}var vr=e=>{dr=e,hr=0,pr=[],fr=[],gr.lastIndex=0;do{}while(_r());return pr};function _r(){const e=fr.length,t=function(){const e=gr.exec(dr);if(null===e)return["no-more-tokens","",null,0,0];const t=e.index,[n,i,r,o,s,,a]=e,l=n.length,c=!!i,u=!!a,d=(r||"core/")+o,h=!!s?function(e){try{return JSON.parse(e)}catch{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,i,r,o,s]=t,a=o>hr?hr:null;switch(n){case"no-more-tokens":if(0===e)return xr(),!1;if(1===e)return wr(),!1;for(;0)[^\\-]*)*(?:--\x3e)?|!\\[CDATA\\[[^\\]]*(?:](?!]>)[^\\]]*)*?(?:]]>)?)|[^>]*>?))");var Sr=n(21035),Ar=n(79923);function Ir(e,t={}){const{isCommentDelimited:n=!0}=t,{blockName:i,attrs:r={},innerBlocks:o=[],innerContent:s=[]}=e;let a=0;const l=s.map(e=>null!==e?e:Ir(o[a++],t)).join("\n").replace(/\n+/g,"\n").trim();return n?Pr(i??void 0,r,l):l}var Er=n(86106);function jr(e){const t="wp-block-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,Ei.W5)("blocks.getBlockDefaultClassName",t,e)}function Tr(e){const t="editor-block-list-item-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,Ei.W5)("blocks.getBlockMenuDefaultClassName",t,e)}var Br={},Nr={};function Rr(e={}){const{blockType:t,attributes:n}=Br;return Rr.skipFilters?e:(0,Ei.W5)("blocks.getSaveContent.extraProps",{...e},t,n)}function Or(e,t,n=[]){const i=jn(e);if(!i?.save)return null;let r=i.save;if(r.prototype instanceof T.Component){const e=new r({attributes:t});r=e.render.bind(e)}Br.blockType=i,Br.attributes=t,Nr.innerBlocks=n;let o=r({attributes:t,innerBlocks:n});if(null!==o&&"object"==typeof o&&(0,Ei.FC)("blocks.getSaveContent.extraProps")&&!((i.apiVersion??0)>1)){const e=(0,Ei.W5)("blocks.getSaveContent.extraProps",{...o.props},i,t);(0,V.hw)(e,o.props)||(o=(0,T.cloneElement)(o,e))}return(0,Ei.W5)("blocks.getSaveElement",o,i,t)}function Lr(e,t,n){const i=jn(e);return i?(0,Ar.Ay)(Or(i,t,n)):""}function Mr(e){let t=e.originalContent??"";if(e.isValid||e.innerBlocks.length)try{t=Lr(e.name,e.attributes,e.innerBlocks)}catch{}return t}function Pr(e,t,n){const i=t&&Object.entries(t).length?function(e){return JSON.stringify(e).replaceAll("\\\\","\\u005c").replaceAll("--","\\u002d\\u002d").replaceAll("<","\\u003c").replaceAll(">","\\u003e").replaceAll("&","\\u0026").replaceAll('\\"',"\\u0022")}(t)+" ":"",r=e?.startsWith("core/")?e.slice(5):e;return n?`\x3c!-- wp:${r} ${i}--\x3e\n`+n+`\n\x3c!-- /wp:${r} --\x3e`:`\x3c!-- wp:${r} ${i}/--\x3e`}var Dr=(()=>{const e=new WeakMap;return t=>{const n=e.get(t);if(void 0!==n)return n;let i=t;1===i.length&&In(i[0])&&(i=[]);let r=Fr(i);return 1===i.length&&i[0].name===fn()&&"core/freeform"===i[0].name&&(r=function(e){const t="blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure",n=t+"|div|p",i=t+"|pre",r=[];let o=!1,s=!1;return e?(-1===e.indexOf("]*>[\s\S]*?<\/\1>/g,e=>(r.push(e),""))),-1!==e.indexOf("]*>[\s\S]+?<\/pre>/g,e=>(e=(e=e.replace(/
(\r\n|\n)?/g,"")).replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,"")).replace(/\r?\n/g,""))),-1!==e.indexOf("[caption")&&(s=!0,e=e.replace(/\[caption[\s\S]+?\[\/caption\]/g,e=>e.replace(/]*)>/g,"").replace(/[\r\n\t]+/,""))),e=(e=(e=(e=(e=(e=(e=(e=e.replace(new RegExp("\\s*\\s*","g"),"\n")).replace(new RegExp("\\s*<((?:"+n+")(?: [^>]*)?)>","g"),"\n<$1>")).replace(/(

]+>[\s\S]*?)<\/p>/g,"$1")).replace(/]*)?>\s*

/gi,"\n\n")).replace(/\s*

/gi,"")).replace(/\s*<\/p>\s*/gi,"\n\n")).replace(/\n[\s\u00a0]+\n/g,"\n\n")).replace(/(\s*)
\s*/gi,(e,t)=>t&&-1!==t.indexOf("\n")?"\n\n":"\n"),-1!==(e=(e=(e=(e=(e=(e=(e=e.replace(/\s*

\s*/g,"
\n")).replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,"\n\n[caption$1[/caption]\n\n")).replace(/caption\]\n\n+\[caption/g,"caption]\n\n[caption")).replace(new RegExp("\\s*<((?:"+i+")(?: [^>]*)?)\\s*>","g"),"\n<$1>")).replace(new RegExp("\\s*\\s*","g"),"\n")).replace(/<((li|dt|dd)[^>]*)>/g," \t<$1>")).indexOf("/g,"\n")),-1!==e.indexOf("]*)?>\s*/g,"\n\n\n\n")),-1!==e.indexOf("/g,e=>e.replace(/[\r\n]+/g,""))),e=(e=(e=(e=e.replace(/<\/p#>/g,"

\n")).replace(/\s*(

]+>[\s\S]*?<\/p>)/g,"\n$1")).replace(/^\s+/,"")).replace(/[\s\u00a0]+$/,""),o&&(e=e.replace(//g,"\n")),s&&(e=e.replace(/]*)>/g,"")),r.length&&(e=e.replace(//g,()=>r.shift())),e):""}(r)),e.set(t,r),r}})();function Fr(e,t){return(Array.isArray(e)?e:[e]).map(e=>function(e,{isInnerBlocks:t=!1}={}){if(!e.isValid&&e.__unstableBlockSource)return Ir(e.__unstableBlockSource);const n=e.name,i=Mr(e);if(n===mn()||!t&&n===fn())return i;const r=bn(n);if(!r)return i;const o=function(e,t){return Object.entries(e.attributes??{}).reduce((n,[i,r])=>{const o=t[i];return void 0===o||void 0!==r.source||"local"===r.role?n:"local"===r.__experimentalRole?((0,Qt.A)("__experimentalRole attribute",{since:"6.7",version:"6.8",alternative:"role attribute",hint:`Check the block.json of the ${e?.name} block.`}),n):("default"in r&&JSON.stringify(r.default)===JSON.stringify(o)||(n[i]=o),n)},{})}(r,e.attributes);return Pr(n,o,i)}(e,t)).join("\n\n")}var zr=/[\t\n\f ]/,Vr=/[A-Za-z]/,Ur=/\r\n?/g;function $r(e){return zr.test(e)}function Hr(e){return Vr.test(e)}var Wr=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||Hr(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(){$r(this.consume())&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var e=this.consume();$r(e)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(e.toLowerCase()))},doctypeName:function(){var e=this.consume();$r(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(!$r(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(),i="SYSTEM"===t.toUpperCase();(n||i)&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume()),n?this.transitionTo("afterDoctypePublicKeyword"):i&&this.transitionTo("afterDoctypeSystemKeyword")}},afterDoctypePublicKeyword:function(){var e=this.peek();$r(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();$r(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();$r(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();$r(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();$r(e)?this.transitionTo("beforeAttributeName"):"/"===e?this.transitionTo("selfClosingStartTag"):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(e)},endTagName:function(){var e=this.consume();$r(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();$r(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();$r(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();$r(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();$r(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();$r(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();$r(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||Hr(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(Ur,"\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}(),Gr=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 Wr(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:()=>[]}}var Yr=/[\t\n\r\v\f ]+/g,Jr=/^[\t\n\r\v\f ]*$/,Xr=/^url\s*\(['"\s]*(.*?)['"\s]*\)$/,Zr=["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"],Qr=[...Zr,"autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"],eo=[e=>e,function(e){return oo(e).join(" ")}],to=/^[\da-z]+$/i,no=/^#\d+$/,io=/^#x[\da-f]+$/i,ro=class{parse(e){if(t=e,to.test(t)||no.test(t)||io.test(t))return(0,qr.S)("&"+e+";");var t}};function oo(e){return e.trim().split(Yr)}function so(e){return(e.attributes??[]).filter(e=>{const[t,n]=e;return n||0===t.indexOf("data-")||Qr.includes(t)})}function ao(e,t,n=Kr()){let i=e.chars,r=t.chars;for(let e=0;e{const[t,...n]=e.split(":"),i=n.join(":");return[t.trim(),co(i.trim())]});return Object.fromEntries(t)}var ho={class:(e,t)=>{const[n,i]=[e,t].map(oo),r=n.filter(e=>!i.includes(e)),o=i.filter(e=>!n.includes(e));return 0===r.length&&0===o.length},style:(e,t)=>F(...[e,t].map(uo)),...Object.fromEntries(Zr.map(e=>[e,()=>!0]))},po={StartTag:(e,t,n=Kr())=>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=Kr()){if(e.length!==t.length)return n.warning("Expected attributes %o, instead saw %o.",t,e),!1;const i={};for(let e=0;ee}}(),i=jn(t);let r;try{r=Lr(i,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 o=function(e,t,n=Kr()){if(e===t)return!0;const[i,r]=[e,t].map(e=>function(e,t=Kr()){try{return new Gr(new ro).tokenize(e)}catch{t.warning("Malformed HTML detected: %s",e)}return null}(e,n));if(!i||!r)return!1;let o,s;for(;o=fo(i);){if(s=fo(r),!s)return n.warning("Expected end of content, instead saw %o.",o),!1;if(o.type!==s.type)return n.warning("Expected token of type `%s` (%o), instead saw `%s` (%o).",s.type,s,o.type,o),!1;const e=po[o.type];if(e&&!e(o,s,n))return!1;mo(o,r[0])?fo(r):mo(s,i[0])&&fo(i)}return!(s=fo(r))||(n.warning("Expected %o, instead saw end of content.",s),!1)}(e.originalContent,r,n);return o||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",i.name,i,r,e.originalContent),[o,n.getItems()]}function bo(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),i={speaker:"speaker-deck",polldaddy:"crowdsignal"};n.providerNameSlug=t in i?i[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 t=n.className??"";t.includes("wp-block-comments-query-loop")||(n.className=["wp-block-comments-query-loop",t].join(" "))}"core/post-comments"===e&&(e="core/comments",n.legacy=!0);const i=t.layout;"grid"===i?.type&&"string"==typeof i?.columnCount&&(n.layout={...n.layout,columnCount:parseInt(i.columnCount,10)});const r=t.style,o=r?.layout;if("string"==typeof o?.columnSpan){const e=parseInt(o.columnSpan,10);n.style={...n.style,layout:{...n.style?.layout,columnSpan:isNaN(e)?void 0:e}}}if("string"==typeof o?.rowSpan){const e=parseInt(o.rowSpan,10);n.style={...n.style,layout:{...n.style?.layout,rowSpan:isNaN(e)?void 0:e}}}return[e,n]}var yo=function(){var e;return function(){return e||(e=document.implementation.createHTMLDocument("")),e}}();function vo(e,t){if(t){if("string"==typeof e){var n=yo();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,i){var r=t[i];return n[i]=vo(e,r),n},{})}}function _o(e,t){var n,i;return 1===arguments.length?(n=e,i=void 0):(n=t,i=e),function(e){var t=e;if(i&&(t=e.querySelector(i)),t)return function(e,t){for(var n,i=t.split(".");n=i.shift();){if(!(n in e))return;e=e[n]}return e}(t,n)}}var xo=n(53981);function ko(e){const t={};for(let n=0;n{let n=t;return e&&(n=t.querySelector(e)),n?Co(n.childNodes):[]}}var Ao={concat:function(...e){(0,Qt.A)("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 He;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])}(o,t.type)&&function(e,t){return!Array.isArray(t)||t.includes(e)}(o,t.enum)||(o=void 0),void 0===o&&(o=Bn(t)),o}var Eo=(0,xo.A)(e=>{switch(e.source){case"attribute":{let t=function(e,t){var n,i;return 1===arguments.length?(n=e,i=void 0):(n=t,i=e),function(e){var t=_o(i,"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 i=n;if(e&&(i=n.querySelector(e)),!i)return"";if(t){let e="";const n=i.children.length;for(let r=0;rn=>{const i=e?n.querySelector(e):n;return i?He.fromHTMLElement(i,{preserveWhiteSpace:t}):He.empty()})(e.selector,e.__unstablePreserveWhiteSpace);case"children":return So(e.selector);case"node":return function(e){return(0,Qt.A)("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 wo(n)}catch{return null}}}(e.selector);case"query":const t=Object.fromEntries(Object.entries(e.query).map(([e,t])=>[e,Eo(t)]));return function(e,t){return function(n){var i=n.querySelectorAll(e);return[].map.call(i,function(e){return vo(e,t)})}}(e.selector,t);case"tag":{const t=_o(e.selector,"nodeName");return e=>t(e)?.toLowerCase()}default:return void console.error(`Unknown source type "${e.source}"`)}});function jo(e){return vo(e,e=>e)}function To(e,t){return Eo(t)(jo(e))}function Bo(e,t,n={}){const i=jo(t),r=jn(e),o=Object.fromEntries(Object.entries(r?.attributes??{}).map(([e,r])=>[e,Io(e,r,i,n,t)]));return(0,Ei.W5)("blocks.getBlockAttributes",o,r,t,n)}var No={type:"string",source:"attribute",selector:"[data-custom-class-name] > *",attribute:"class"};function Ro(e){const t=To(`

${e}
`,No);return t?t.trim().split(/\s+/):[]}function Oo(e,t,n,i,r,o){if(!_n(t,i,!1))return e;const s={...e},a=function(e,t,n){return To(`
${e}
`,n)}(n,r,o);return a&&(s[i]=a),s}var Lo={type:"string",source:"attribute",selector:"[data-aria-label] > *",attribute:"aria-label"},Mo={type:"string",source:"attribute",selector:"[data-anchor] > *",attribute:"id"};function Po(e,t){const{attributes:n,originalContent:i}=e;let r=n;return r=function(e,t,n){if(!_n(t,"customClassName",!0))return e;const i={...e},{className:r,...o}=i,s=Lr(t,o),a=Ro(s),l=Ro(n).filter(e=>!a.includes(e));return l.length?i.className=l.join(" "):s&&delete i.className,i}(n,t,i??""),r=Oo(r,t,i??"","ariaLabel","data-aria-label",Lo),r=Oo(r,t,i??"","anchor","data-anchor",Mo),{...e,attributes:r}}function Do(){return!1}function Fo(e,t){const n=fn(),i=e.blockName||fn(),r=e.attrs||{},o=e.innerBlocks||[];let s=e.innerHTML.trim();return i!==n||"core/freeform"!==i||t?.__unstableSkipAutop||(s=function(e,t=!0){const n=[];if(""===e.trim())return"";if(-1!==(e+="\n").indexOf(""),i=t.pop();e="";for(let i=0;i";n.push([s,r.substr(o)+""]),e+=r.substr(0,o)+s}e+=i}const i="(?: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,i=e;for(;n=i.match(Cr);){const e=n.index;t.push(i.slice(0,e)),t.push(n[0]),i=i.slice(e+n[0].length)}return i.length&&t.push(i),t}(e);let i=!1;const r=Object.keys(t);for(let e=1;e\s*/g,"\n\n")).replace(new RegExp("(<"+i+"[\\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 r=(e=e.replace(/\n\n+/g,"\n\n")).split(/\n\s*\n/).filter(Boolean);return e="",r.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,i]=t;e=e.replace(n,()=>i)}),-1!==e.indexOf("\x3c!-- wpnl --\x3e")&&(e=e.replace(/\s?\s?/g,"\n")),e}(s).trim()),{...e,blockName:i,attrs:r,innerHTML:s,innerBlocks:o}}function zo(e,t){let n=Fo(e,t);n=function(e){const[t,n]=bo(e.blockName,e.attrs??{});return{...e,blockName:t,attrs:n}}(n);let i=bn(n.blockName);i||(n=function(e){const t=mn()||fn(),n=Ir(e,{isCommentDelimited:!1}),i=Ir(e,{isCommentDelimited:!0});return{blockName:t,attrs:{originalName:e.blockName,originalContent:i,originalUndelimitedContent:n},innerHTML:e.blockName?i:e.innerHTML,innerBlocks:e.innerBlocks,innerContent:e.innerContent}}(n),i=bn(n.blockName));const r=n.blockName===fn()||n.blockName===mn();if(!i||!n.innerHTML&&r)return;const o=n.innerBlocks.map(e=>zo(e,t)).filter(e=>!!e),s=er(n.blockName,Bo(i,n.innerHTML,n.attrs),o);s.originalContent=n.innerHTML;const a=function(e,t){const[n]=go(e,t);if(n)return{...e,isValid:n,validationIssues:[]};const i=Po(e,t),[r,o]=go(i,t);return{...i,isValid:r,validationIssues:o}}(s,i),{validationIssues:l}=a,c=function(e,t,n){const i=t.attrs??{},{deprecated:r}=n;if(!r||!r.length)return e;for(let o=0;oe(...t)):(console.groupCollapsed("Updated Block: %s",i.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",i.name,i,Lr(i,c.attributes),c.originalContent),console.groupEnd()),c}function Vo(e,t){return vr(e).reduce((e,n)=>{const i=zo(n,t);return i&&e.push(i),e},[])}var Uo=n(67338);function $o(){return lr("from").filter(({type:e})=>"raw"===e).map(e=>e.isMatch?e:{...e,isMatch:t=>e.selector&&t.matches(e.selector)})}function Ho(e,t){const n=document.implementation.createHTMLDocument("");return n.body.innerHTML=e,Array.from(n.body.children).flatMap(e=>{const n=ar($o(),t=>t.isMatch(e));if(!n)return Uo.A.isNative?Vo(`\x3c!-- wp:html --\x3e${e.outerHTML}\x3c!-- /wp:html --\x3e`):er("core/html",Bo("core/html",e.outerHTML));const{transform:i,blockName:r}=n;if(i){const n=i(e,t);return e.hasAttribute("class")&&(n.attributes.className=e.getAttribute("class")),n}return er(r,Bo(r,e.outerHTML))})}function Wo(e){switch(e.nodeType){case e.TEXT_NODE:return/^[ \f\n\r\t\v\u00a0]*$/.test(e.nodeValue||"");case e.ELEMENT_NODE:return!e.hasAttributes()&&(!e.hasChildNodes()||Array.from(e.childNodes).every(Wo));default:return!0}}var Go={strong:{},em:{},s:{},del:{},ins:{},a:{attributes:["href","target","rel","id"]},code:{},abbr:{attributes:["title"]},sub:{},sup:{},br:{},small:{},q:{attributes:["cite"]},dfn:{attributes:["title"]},data:{attributes:["value"]},time:{attributes:["datetime"]},var:{},samp:{},kbd:{},i:{},b:{},u:{},mark:{},ruby:{},rt:{},rp:{},bdi:{attributes:["dir"]},bdo:{attributes:["dir"]},wbr:{},"#text":{}},qo=["#text","br"];Object.keys(Go).filter(e=>!qo.includes(e)).forEach(e=>{const{[e]:t,...n}=Go;Go[e].children=n});var Ko={...Go,audio:{attributes:["src","preload","autoplay","mediagroup","loop","muted"]},canvas:{attributes:["width","height"]},embed:{attributes:["src","type","width","height"]},img:{attributes:["alt","src","srcset","usemap","ismap","width","height"]},object:{attributes:["data","type","name","usemap","form","width","height"]},video:{attributes:["src","poster","preload","playsinline","autoplay","mediagroup","loop","muted","controls","width","height"]},math:{attributes:["display","xmlns"],children:"*"}};function Yo(e){if("paste"!==e)return Ko;const{u:t,abbr:n,data:i,time:r,wbr:o,bdi:s,bdo:a,...l}={...Ko,ins:{children:Ko.ins.children},del:{children:Ko.del.children}};return l}function Jo(e){const t=e.nodeName.toLowerCase();return Yo().hasOwnProperty(t)||"span"===t}function Xo(e){const t=e.nodeName.toLowerCase();return Go.hasOwnProperty(t)||"span"===t}function Zo(e,t={}){const n=document.implementation.createHTMLDocument(""),i=document.implementation.createHTMLDocument(""),r=n.body,o=i.body;for(r.innerHTML=e;r.firstChild;){const e=r.firstChild;e.nodeType===e.TEXT_NODE?Wo(e)?r.removeChild(e):(o.lastChild&&"P"===o.lastChild.nodeName||o.appendChild(i.createElement("P")),o.lastChild.appendChild(e)):e.nodeType===e.ELEMENT_NODE?"BR"===e.nodeName?(e.nextSibling&&"BR"===e.nextSibling.nodeName&&(o.appendChild(i.createElement("P")),r.removeChild(e.nextSibling)),o.lastChild&&"P"===o.lastChild.nodeName&&o.lastChild.hasChildNodes()?o.lastChild.appendChild(e):r.removeChild(e)):"P"===e.nodeName?Wo(e)&&!t.raw?r.removeChild(e):o.appendChild(e):Jo(e)?(o.lastChild&&"P"===o.lastChild.nodeName||o.appendChild(i.createElement("P")),o.lastChild.appendChild(e)):o.appendChild(e):r.removeChild(e)}return o.innerHTML}function Qo(e,t){(0,re.e)(t.parentNode,"referenceNode.parentNode"),t.parentNode.insertBefore(e,t.nextSibling)}function es(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 i=e,r=!1;for(;i=i.nextSibling;)if(i.nodeType===i.COMMENT_NODE&&"noteaser"===i.nodeValue){r=!0,oe(i);break}return function(e,t,n){const i=n.createElement("wp-block");return i.dataset.block="core/more",e&&(i.dataset.customText=e),t&&(i.dataset.noTeaser=""),i}(n,r,t)}(e,t);if(e.parentNode&&"P"===e.parentNode.nodeName){const i=Array.from(e.parentNode.childNodes),r=i.indexOf(e),o=e.parentNode.parentNode||t.body,s=(e,n)=>(e||(e=t.createElement("p")),e.appendChild(n),e);[i.slice(0,r).reduce(s,null),n,i.slice(r+1).reduce(s,null)].forEach(t=>t&&o.insertBefore(t,e.parentNode)),oe(e.parentNode)}else i=e,r=n,(0,re.e)(i.parentNode,"processedNode.parentNode"),Qo(r,i.parentNode),oe(i);var i,r}function ts(e){const t=e.parentNode;for((0,re.e)(t,"node.parentNode");e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}function ns(e){return"OL"===e.nodeName||"UL"===e.nodeName}function is(e){if(!ns(e))return;const t=e,n=t.previousElementSibling;if(n&&n.nodeName===e.nodeName&&1===t.children.length){for(;t.firstChild;)n.appendChild(t.firstChild);t.parentNode.removeChild(t)}const i=e.parentNode;if(i&&"LI"===i.nodeName&&1===i.children.length&&!/\S/.test((r=i,Array.from(r.childNodes).map(({nodeValue:e=""})=>e).join("")))){const e=i,n=e.previousElementSibling,r=e.parentNode;n&&(n.appendChild(t),r.removeChild(e))}var r;if(i&&ns(i)){const n=t.previousElementSibling;n?n.appendChild(e):ts(e)}}function rs(e={}){return t=>{if("BLOCKQUOTE"!==t.nodeName)return;const n=t;n.innerHTML=Zo(n.innerHTML,e)}}function os(e,t=e){const n=e.ownerDocument.createElement("figure");t.parentNode.insertBefore(n,t),n.appendChild(e)}function ss(e,t,n){if(!n||!function(e,t){const n=e.nodeName.toLowerCase();return"figcaption"!==n&&!Xo(e)&&n in(t?.figure?.children??{})}(e,n))return;let i=e;const r=e.parentNode;(function(e,t){return e.nodeName.toLowerCase()in(t?.figure?.children?.a?.children??{})})(e,n)&&"A"===r.nodeName&&1===r.childNodes.length&&(i=e.parentNode);const o=i.closest("p,div");if(o){const t=e;t.classList?(t.classList.contains("alignright")||t.classList.contains("alignleft")||t.classList.contains("aligncenter")||!o.textContent.trim())&&os(i,o):os(i,o)}else os(i)}function as(e,t,n=0){const i=us(e);i.lastIndex=n;const r=i.exec(t);if(!r)return;if("["===r[1]&&"]"===r[7])return as(e,t,i.lastIndex);const o={index:r.index,content:r[0],shortcode:hs(r)};return r[1]&&(o.content=o.content.slice(1),o.index++),r[7]&&(o.content=o.content.slice(0,-1)),o}function ls(e,t,n){return t.replace(us(e),(...e)=>{const t=e[0],i=e[1],r=e[7];if("["===i&&"]"===r)return t;const o=n(hs(e));return o||""===o?i+o+r:t})}function cs(e){return new ps(e).string()}function us(e){return new RegExp("\\[(\\[?)("+e+")(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)","g")}var ds=(0,xo.A)(e=>{const t={},n=[],i=/([\w-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w-]+)\s*=\s*'([^']*)'(?:\s|$)|([\w-]+)\s*=\s*([^\s'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|'([^']*)'(?:\s|$)|(\S+)(?:\s|$)/g;let r;for(e=e.replace(/[\u00a0\u200b]/g," ");r=i.exec(e);)r[1]?t[r[1].toLowerCase()]=r[2]:r[3]?t[r[3].toLowerCase()]=r[4]:r[5]?t[r[5].toLowerCase()]=r[6]:r[7]?n.push(r[7]):r[8]?n.push(r[8]):r[9]&&n.push(r[9]);return{named:t,numeric:n}});function hs(e){let t;return t=e[4]?"self-closing":e[6]?"closed":"single",new ps({tag:e[2],attrs:e[3],type:t,content:e[5]})}var ps=class{tag;type;content;attrs;static next=as;static replace=ls;static string=cs;static regexp=us;static attrs=ds;static fromMatch=hs;constructor(e){const{tag:t,attrs:n,type:i,content:r}=e;this.tag=t,this.type=i,this.content=r,this.attrs={named:{},numeric:[]},n&&("string"==typeof n?this.attrs=ds(n):"named"in n&&"numeric"in n&&void 0!==n.named&&void 0!==n.numeric?this.attrs=n:Object.entries(n).forEach(([e,t])=>{void 0!==t&&this.set(e,String(t))}))}get(e){return"number"==typeof e?this.attrs.numeric[e]:this.attrs.named[e]}set(e,t){return"number"==typeof e?this.attrs.numeric[e]=t:this.attrs.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+"]")}},fs=e=>Array.isArray(e)?e:[e],ms=/(\n|

|)\s*$/,gs=/^\s*(\n|<\/p>|)/,bs=function e(t,n=0,i=[]){const r=ar(lr("from"),e=>{const n=e;return-1===i.indexOf(n.blockName)&&"shortcode"===n.type&&fs(n.tag).some(e=>us(e).test(t))});if(!r)return[t];const o=fs(r.tag).find(e=>us(e).test(t));let s;const a=n;if(s=as(o,t,n)){n=s.index+s.content.length;const o=t.substr(0,s.index),l=t.substr(n);if(!(s.shortcode.content?.includes("<")||ms.test(o)&&gs.test(l)))return e(t,n);if(r.isMatch&&!r.isMatch(s.shortcode.attrs))return e(t,a,[...i,r.blockName]);let c=[];if("function"==typeof r.transform)c=[].concat(r.transform(s.shortcode.attrs,s)),c=c.map(e=>(e.originalContent=s.shortcode.content,Po(e,bn(e.name))));else{const e=Object.fromEntries(Object.entries(r.attributes).filter(([,e])=>e.shortcode).map(([e,t])=>[e,t.shortcode(s.shortcode.attrs,s)])),n=bn(r.blockName);if(!n)return[t];const i={...n,attributes:r.attributes};let o=er(r.blockName,Bo(i,s.shortcode.content,e));o.originalContent=s.shortcode.content,o=Po(o,i),c=[o]}return[...e(o.replace(ms,"")),...c,...e(l.replace(gs,""))]}return[t]};function ys(e){return function(e,t){const n={phrasingContentSchema:Yo(t),isPaste:"paste"===t},i=e.map(({isMatch:e,blockName:t,schema:i})=>{const r=_n(t,"anchor");return i="function"==typeof i?i(n):i,r||e?i?Object.fromEntries(Object.entries(i).map(([t,n])=>{let i=n.attributes||[];return r&&(i=[...i,"id"]),[t,{...n,attributes:i,isMatch:e||void 0}]})):{}:i});function r(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 o(e,t){for(const n in t)e[n]=e[n]?r(e[n],t[n],n):{...t[n]};return e}return i.reduce(function(e,t){for(const n in t)e[n]=e[n]?o(e[n],t[n]):{...t[n]};return e},{})}($o(),e)}function vs(e,t,n,i){Array.from(e).forEach(e=>{vs(e.childNodes,t,n,i),t.forEach(t=>{n.contains(e)&&t(e,n,i)})})}function _s(e,t=[],n){const i=document.implementation.createHTMLDocument("");return i.body.innerHTML=e,vs(i.body.childNodes,t,i,n),i.body.innerHTML}function xs(e,t){const n=e[`${t}Sibling`];if(n&&Jo(n))return n;const{parentNode:i}=e;return i&&Jo(i)?xs(i,t):void 0}function ks({HTML:e=""}){if(-1!==e.indexOf("\x3c!-- wp:")){const t=Vo(e);if(1!==t.length||"core/freeform"!==t[0].name)return t}const t=bs(e),n=ys();return t.map(e=>"string"!=typeof e?e:Ho(e=Zo(e=_s(e,[is,es,ss,rs({raw:!0})],n),{raw:!0}),ks)).flat().filter(Boolean)}var ws=()=>{};function Cs(e,t,n,i){Array.from(e).forEach(e=>{const r=e.nodeName.toLowerCase();if(!n.hasOwnProperty(r)||n[r].isMatch&&!n[r].isMatch?.(e))Cs(e.childNodes,t,n,i),i&&!Jo(e)&&e.nextElementSibling&&Qo(t.createElement("br"),e),ts(e);else if(function(e){return!!e&&e.nodeType===e.ELEMENT_NODE}(e)){const{attributes:o=[],classes:s=[],children:a,require:l=[],allowEmpty:c}=n[r];if(a&&!c&&Wo(e))return void oe(e);if(e.hasAttributes()&&(Array.from(e.attributes).forEach(({name:t})=>{"class"===t||o.includes(t)||e.removeAttribute(t)}),e.classList&&e.classList.length)){const t=s.map(e=>"*"===e?()=>!0:"string"==typeof e?t=>t===e:e instanceof RegExp?t=>e.test(t):ws);Array.from(e.classList).forEach(n=>{t.some(e=>e(n))||e.classList.remove(n)}),e.classList.length||e.removeAttribute("class")}if(e.hasChildNodes()){if("*"===a)return;if(a)l.length&&!e.querySelector(l.join(","))?(Cs(e.childNodes,t,n,i),ts(e)):e.parentNode&&"BODY"===e.parentNode.nodeName&&Jo(e)?(Cs(e.childNodes,t,n,i),Array.from(e.childNodes).some(e=>!Jo(e))&&ts(e)):Cs(e.childNodes,t,a,i);else for(;e.firstChild;)oe(e.firstChild)}}})}function Ss(e,t,n){const i=document.implementation.createHTMLDocument("");return i.body.innerHTML=e,Cs(i.body.childNodes,i,t,n),i.body.innerHTML}function As(e){e.nodeType===e.COMMENT_NODE&&oe(e)}function Is(e,t){return e.every(e=>function(e,t){if(Xo(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)&&Is(Array.from(e.children),t))}function Es(e){return"BR"===e.nodeName&&!!e.previousSibling&&"BR"===e.previousSibling.nodeName}function js(e,t){(0,re.e)(t.parentNode,"referenceNode.parentNode"),t.parentNode.insertBefore(e,t),e.appendChild(t)}function Ts(e,t){const n=e.ownerDocument.createElement(t);for(;e.firstChild;)n.appendChild(e.firstChild);return(0,re.e)(e.parentNode,"node.parentNode"),e.parentNode.replaceChild(n,e),n}function Bs(e,t){if("SPAN"===e.nodeName&&e.style){const{fontWeight:n,fontStyle:i,textDecorationLine:r,textDecoration:o,verticalAlign:s}=e.style,a=e;"bold"!==n&&"700"!==n||js(t.createElement("strong"),a),"italic"===i&&js(t.createElement("em"),a),("line-through"===r||o.includes("line-through"))&&js(t.createElement("s"),a),"super"===s?js(t.createElement("sup"),a):"sub"===s&&js(t.createElement("sub"),a)}else if("B"===e.nodeName)Ts(e,"strong");else if("I"===e.nodeName)Ts(e,"em");else if("A"===e.nodeName){const t=e;t.target&&"_blank"===t.target.toLowerCase()?t.rel="noreferrer noopener":(t.removeAttribute("target"),t.removeAttribute("rel")),t.name&&!t.id&&(t.id=t.name),t.id&&!t.ownerDocument.querySelector(`[href="#${t.id}"]`)&&t.removeAttribute("id")}}function Ns(e){"SCRIPT"!==e.nodeName&&"NOSCRIPT"!==e.nodeName&&"TEMPLATE"!==e.nodeName&&"STYLE"!==e.nodeName||e.parentNode.removeChild(e)}function Rs(e){if(e.nodeType!==e.ELEMENT_NODE)return;const t=e,n=t.getAttribute("style");n&&n.includes("mso-list")&&"ignore"===n.split(";").reduce((e,t)=>{const[n,i]=t.split(":");return n&&i&&(e[n.trim().toLowerCase()]=i.trim().toLowerCase()),e},{})["mso-list"]&&t.remove()}function Os(e){return"OL"===e.nodeName||"UL"===e.nodeName}function Ls(e,t){if("P"!==e.nodeName)return;const n=e,i=n.getAttribute("style");if(!i||!i.includes("mso-list"))return;const r=n.previousElementSibling;if(!r||!Os(r)){const e=n.textContent.trim().slice(0,1),i=/[1iIaA]/.test(e),r=t.createElement(i?"ol":"ul");i&&r.setAttribute("type",e),n.parentNode.insertBefore(r,n)}const o=n.previousElementSibling,s=o.nodeName,a=t.createElement("li");let l=o;a.innerHTML=_s(n.innerHTML,[Rs]);const c=/mso-list\s*:[^;]+level([0-9]+)/i.exec(i);let u=c&&parseInt(c[1],10)-1||0;for(;u--;)l=l.lastChild||l,Os(l)&&(l=l.lastChild||l);Os(l)||(l=l.appendChild(t.createElement(s))),l.appendChild(a),n.parentNode.removeChild(n)}var Ms={};function Ps(e){const t=window.URL.createObjectURL(e);return Ms[t]=e,t}function Ds(e){Ms[e]&&window.URL.revokeObjectURL(e),delete Ms[e]}function Fs(e){return!(!e||!e.indexOf)&&0===e.indexOf("blob:")}function zs(e){if("IMG"!==e.nodeName)return;const t=e;if(0===t.src.indexOf("file:")&&(t.src=""),0===t.src.indexOf("data:")){const[e,n]=t.src.split(","),[i]=e.slice(5).split(";");if(!n||!i)return void(t.src="");let r;try{r=atob(n)}catch{return void(t.src="")}const o=new Uint8Array(r.length);for(let e=0;e=1&&e<=6){const n=`H${e}`,i=t.ownerDocument.createElement(n);for(Array.from(t.attributes).forEach(e=>{"role"!==e.name&&"aria-level"!==e.name&&i.setAttribute(e.name,e.value)});t.firstChild;)i.appendChild(t.firstChild);t.parentNode.replaceChild(i,t)}}}var Js=(...e)=>window?.console?.log?.(...e);function Xs(e){return e=_s(e,[Ns,Hs,Rs,Bs,As]),e=_s(e=Ss(e,Yo("paste"),!0),[Ws,Gs]),Js("Processed inline HTML:\n\n",e),e}function Zs({HTML:e="",plainText:t="",mode:n="AUTO",tagName:i}){if(Js("Received HTML (pasteHandler):\n\n",e),Js("Received plain text (pasteHandler):\n\n",t),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:")){const e=Vo(n);if(1!==e.length||"core/freeform"!==e[0].name)return e}}e=_s(e=e.normalize(),[Ks]);const r=t&&(!e||function(e){if(!/<(?!br[ />])/i.test(e))return!0;const t=document.implementation.createHTMLDocument("");if(t.body.innerHTML=e,1!==t.body.children.length)return!1;const n=t.body.children.item(0),i=n.getElementsByTagName("*");for(let e=0;ee.includes("^")&&!e.startsWith("^"),e=>["=","+","-","/","*"].some(t=>e.includes(t)),e=>/\\[a-zA-Z]+/g.test(e)].filter(t=>t(e)).length>=2}(t))return[er("core/math",{latex:t})];var o;r&&(e=t,/^\s+$/.test(t)||(o=e,e=Us.makeHtml(function(e){return e.replace(/((?:^|\n)```)([^\n`]+)(```(?:$|\n))/,(e,t,n,i)=>`${t}\n${n}\n${i}`)}(function(e){return e.replace(/(^|\n)•( +)/g,"$1*$2")}(o)))));const s=bs(e),a=s.length>1;if(r&&!a&&"AUTO"===n&&-1===t.indexOf("\n")&&0!==t.indexOf("

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

")&&(n="INLINE"),"INLINE"===n)return Xs(e);if("AUTO"===n&&!a&&function(e,t){const n=document.implementation.createHTMLDocument("");n.body.innerHTML=e;const i=Array.from(n.body.children);return!i.some(Es)&&Is(i,t)}(e,i))return Xs(e);const l=Yo("paste"),c=ys("paste"),u=s.map(e=>{if("string"!=typeof e)return e;const t=[Hs,Ls,Ns,is,zs,Bs,es,As,$s,ss,rs(),Vs,Ys],n={...c,...l};return e=_s(e,t,c),e=_s(e=Zo(e=Ss(e,n,!1)),[Ws,Gs,qs],c),Js("Processed HTML piece:\n\n",e),Ho(e,Zs)}).flat().filter(Boolean);if("AUTO"===n&&1===u.length&&_n(u[0].name,"__unstablePasteTextInline",!1)){const e=/^[\n]+|[\n]+$/g,n=t.replace(e,"");if(""!==n&&-1===n.indexOf("\n"))return Ss(Mr(u[0]),l,!1).replace(e,"")}return u}function Qs(e=[],t=[]){return e.length===t.length&&t.every(([t,,n],i)=>{const r=e[i];return t===r.name&&Qs(r.innerBlocks,n)})}function ea(e,t){return t?Object.fromEntries(Object.entries(t).map(([t,n])=>[t,ta(e[t],n)])):{}}function ta(e,t){return n=e,"html"===n?.source&&Array.isArray(t)?(0,Ar.Ay)(t):(e=>"query"===e?.source)(e)&&t?t.map(t=>ea(e.query,t)):t;var n}function na(e=[],t){return t?t.map(([t,n,i],r)=>{const o=e[r];if(o&&o.name===t){const e=na(o.innerBlocks,i);return{...o,innerBlocks:e}}const s=bn(t),a=ea(s?.attributes??{},n),[l,c]=bo(t,a);return er(l,c,na([],i))}):e}var ia={};ln(ia,{isContentBlock:function(e){const t=bn(e),n=t?.attributes,i=t?.supports?.contentRole;return!!i||!!n&&!!Object.keys(n)?.some(e=>{const t=n[e];return"content"===t?.role||"content"===t?.__experimentalRole})},fieldsKey:Symbol("fields"),formKey:Symbol("form"),parseRawBlock:zo});const ra=()=>new Map,oa=e=>{const t=ra();return e.forEach((e,n)=>{t.set(n,e)}),t},sa=(e,t,n)=>{let i=e.get(t);return void 0===i&&e.set(t,i=n()),i},aa=()=>new Set,la=e=>e[e.length-1],ca=(e,t)=>{for(let n=0;n{this.off(e,n),t(...i)};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 ua((this._observers.get(e)||ra()).values()).forEach(e=>e(...t))}destroy(){this._observers=ra()}}class pa{constructor(){this._observers=ra()}on(e,t){sa(this._observers,e,aa).add(t)}once(e,t){const n=(...i)=>{this.off(e,n),t(...i)};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 ua((this._observers.get(e)||ra()).values()).forEach(e=>e(...t))}destroy(){this._observers=ra()}}const fa=Math.floor,ma=(Math.ceil,Math.abs),ga=(Math.imul,Math.round,Math.log10,Math.log2,Math.log,Math.sqrt,(e,t)=>ee>t?e:t,ya=(Number.isNaN,Math.pow,Math.sign,e=>0!==e?e<0:1/e<0),va=64,_a=128,xa=127,ka=Number.MAX_SAFE_INTEGER,wa=(Number.MIN_SAFE_INTEGER,Number.isInteger||(e=>"number"==typeof e&&isFinite(e)&&fa(e)===e));Number.isNaN,Number.parseInt;const Ca=String.fromCharCode,Sa=(String.fromCodePoint,Ca(65535),/^\s*/g),Aa=/([A-Z])/g,Ia=(e,t)=>(e=>e.replace(Sa,""))(e.replace(Aa,e=>`${t}${(e=>e.toLowerCase())(e)}`)),Ea="undefined"!=typeof TextEncoder?new TextEncoder:null,ja=Ea?e=>Ea.encode(e):e=>{const t=unescape(encodeURIComponent(e)),n=t.length,i=new Uint8Array(n);for(let e=0;enew Ba,Ra=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},La=Oa,Ma=(e,t)=>{for(;t>xa;)Oa(e,_a|xa&t),t=fa(t/128);Oa(e,xa&t)},Pa=(e,t)=>{const n=ya(t);for(n&&(t=-t),Oa(e,(t>63?_a:0)|(n?va:0)|63&t),t=fa(t/64);t>0;)Oa(e,(t>xa?_a:0)|xa&t),t=fa(t/128)},Da=new Uint8Array(3e4),Fa=Da.length/3,za=Ea&&Ea.encodeInto?(e,t)=>{if(t.length{const n=unescape(encodeURIComponent(t)),i=n.length;Ma(e,i);for(let t=0;t{const n=e.cbuf.length,i=e.cpos,r=ga(n-i,t.length),o=t.length-r;e.cbuf.set(t.subarray(0,r),i),e.cpos+=r,o>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(ba(2*n,o)),e.cbuf.set(t.subarray(r)),e.cpos=o)},Ua=(e,t)=>{Ma(e,t.byteLength),Va(e,t)},$a=(e,t)=>{((e,t)=>{const n=e.cbuf.length;n-e.cpos{switch(typeof t){case"string":Oa(e,119),za(e,t);break;case"number":wa(t)&&ma(t)<=2147483647?(Oa(e,125),Pa(e,t)):(n=t,Ha.setFloat32(0,n),Ha.getFloat32(0)===n?(Oa(e,124),((e,t)=>{$a(e,4).setFloat32(0,t,!1)})(e,t)):(Oa(e,123),((e,t)=>{$a(e,8).setFloat64(0,t,!1)})(e,t)));break;case"bigint":Oa(e,122),((e,t)=>{$a(e,8).setBigInt64(0,t,!1)})(e,t);break;case"object":if(null===t)Oa(e,126);else if(da(t)){Oa(e,117),Ma(e,t.length);for(let n=0;n0&&Ma(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const qa=e=>{e.count>0&&(Pa(e.encoder,1===e.count?e.s:-e.s),e.count>1&&Ma(e.encoder,e.count-2))};class Ka{constructor(){this.encoder=new Ba,this.s=0,this.count=0}write(e){this.s===e?this.count++:(qa(this),this.count=1,this.s=e)}toUint8Array(){return qa(this),Ra(this.encoder)}}const Ya=e=>{if(e.count>0){const t=2*e.diff+(1===e.count?0:1);Pa(e.encoder,t),e.count>1&&Ma(e.encoder,e.count-2)}};class Ja{constructor(){this.encoder=new Ba,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(Ya(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return Ya(this),Ra(this.encoder)}}class Xa{constructor(){this.sarr=[],this.s="",this.lensE=new Ka}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 Ba;return this.sarr.push(this.s),this.s="",za(e,this.sarr.join("")),Va(e,this.lensE.toUint8Array()),Ra(e)}}const Za=e=>new Error(e),Qa=()=>{throw Za("Method unimplemented")},el=()=>{throw Za("Unexpected case")},tl=Za("Unexpected end of array"),nl=Za("Integer out of Range");class il{constructor(e){this.arr=e,this.pos=0}}const rl=e=>new il(e),ol=e=>((e,t)=>{const n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n})(e,al(e)),sl=e=>e.arr[e.pos++],al=e=>{let t=0,n=1;const i=e.arr.length;for(;e.poska)throw nl}throw tl},ll=e=>{let t=e.arr[e.pos++],n=63&t,i=64;const r=(t&va)>0?-1:1;if(0===(t&_a))return r*n;const o=e.arr.length;for(;e.poska)throw nl}throw tl},cl=Ta?e=>Ta.decode(ol(e)):e=>{let t=al(e);if(0===t)return"";{let n=String.fromCodePoint(sl(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(sl(e));else for(;t>0;){const i=t<1e4?t:1e4,r=e.arr.subarray(e.pos,e.pos+i);e.pos+=i,n+=String.fromCodePoint.apply(null,r),t-=i}return decodeURIComponent(escape(n))}},ul=(e,t)=>{const n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},dl=[e=>{},e=>null,ll,e=>ul(e,4).getFloat32(0,!1),e=>ul(e,8).getFloat64(0,!1),e=>ul(e,8).getBigInt64(0,!1),e=>!1,e=>!0,cl,e=>{const t=al(e),n={};for(let i=0;i{const t=al(e),n=[];for(let i=0;idl[127-sl(e)](e);class pl extends il{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=al(this)+1:this.count=-1),this.count--,this.s;var e}}class fl extends il{constructor(e){super(e),this.s=0,this.count=0}read(){if(0===this.count){this.s=ll(this);const e=ya(this.s);this.count=1,e&&(this.s=-this.s,this.count=al(this)+2)}return this.count--,this.s}}class ml extends il{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(0===this.count){const e=ll(this),t=1&e;this.diff=fa(e/2),this.count=1,t&&(this.count=al(this)+2)}return this.s+=this.diff,this.count--,this.s}}class gl{constructor(e){this.decoder=new fl(e),this.str=cl(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 bl=crypto.getRandomValues.bind(crypto);Math.random;const yl=()=>bl(new Uint32Array(1))[0],vl=[1e7]+-1e3+-4e3+-8e3+-1e11,_l=()=>vl.replace(/[018]/g,e=>(e^yl()&15>>e/4).toString(16)),xl=e=>new Promise(e),kl=(Promise.all.bind(Promise),e=>void 0===e?null:e);let wl=new class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}},Cl=!0;try{"undefined"!=typeof localStorage&&localStorage&&(wl=localStorage,Cl=!1)}catch(e){}const Sl=wl,Al=Object.assign,Il=Object.keys,El=e=>Il(e).length,jl=e=>Il(e).length,Tl=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Bl=Object.freeze,Nl=e=>{for(const t in e){const n=e[t];"object"!=typeof n&&"function"!=typeof n||Nl(e[t])}return Bl(e)},Rl=(e,t,n=0)=>{try{for(;ne,Ll=(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===Dl)if(Ml){Dl=ra();const e=process.argv;let t=null;for(let n=0;n{if(0!==e.length){const[t,n]=e.split("=");Dl.set(`--${Ia(t,"-")}`,n),Dl.set(`-${Ia(t,"-")}`,n)}})):Dl=ra();return Dl})().has(e),Vl=e=>kl(Ml?process.env[e.toUpperCase().replaceAll("-","_")]:Sl.getItem(e)),Ul=e=>zl("--"+e)||null!==Vl(e);var $l;Ul("production");const Hl=Ml&&($l=process.env.FORCE_COLOR,["true","1","2"].includes($l))||!zl("--no-colors")&&!Ul("no-color")&&(!Ml||process.stdout.isTTY)&&(!Ml||zl("--color")||null!==Vl("COLORTERM")||(Vl("TERM")||"").includes("color")),Wl=e=>new Uint8Array(e),Gl=Pl?e=>{let t="";for(let n=0;nBuffer.from(e.buffer,e.byteOffset,e.byteLength).toString("base64"),ql=Pl?e=>{const t=atob(e),n=Wl(t.length);for(let e=0;e{const t=Buffer.from(e,"base64");return n=t.buffer,i=t.byteOffset,r=t.byteLength,new Uint8Array(n,i,r);var n,i,r};class Kl{constructor(e,t){this.left=e,this.right=t}}const Yl=(e,t)=>new Kl(e,t),Jl="undefined"!=typeof document?document:{},Xl=("undefined"!=typeof DOMParser&&new DOMParser,e=>((e,t)=>{const n=[];for(const[i,r]of e)n.push(t(r,i));return n})(e,(e,t)=>`${t}:${e};`).join("")),Zl=(Jl.ELEMENT_NODE,Jl.TEXT_NODE,Jl.CDATA_SECTION_NODE,Jl.COMMENT_NODE,Jl.DOCUMENT_NODE,Jl.DOCUMENT_TYPE_NODE,Jl.DOCUMENT_FRAGMENT_NODE,Symbol),Ql=Date.now,ec=Zl(),tc=Zl(),nc=Zl(),ic=Zl(),rc=Zl(),oc=Zl(),sc=Zl(),ac=Zl(),lc=Zl();Ql();const cc={[ec]:Yl("font-weight","bold"),[tc]:Yl("font-weight","normal"),[nc]:Yl("color","blue"),[rc]:Yl("color","green"),[ic]:Yl("color","grey"),[oc]:Yl("color","red"),[sc]:Yl("color","purple"),[ac]:Yl("color","orange"),[lc]:Yl("color","black")},uc=Hl?e=>{1===e.length&&e[0]?.constructor===Function&&(e=e[0]());const t=[],n=[],i=ra();let r=[],o=0;for(;o0||e.length>0?(t.push("%c"+r),n.push(e)):t.push(r)}}}for(o>0&&(r=n,r.unshift(t.join("")));o{1===e.length&&e[0]?.constructor===Function&&(e=e[0]());const t=[],n=[];let i=0;for(;i0&&n.push(t.join(""));i{console.warn(...uc(e)),e.unshift(ac),hc.forEach(t=>t.print(e))},hc=aa(),pc=e=>({[Symbol.iterator](){return this},next:e}),fc=(e,t)=>pc(()=>{const{done:n,value:i}=e.next();return{done:n,value:n?void 0:t(i)}});class mc{constructor(e,t){this.clock=e,this.len=t}}class gc{constructor(){this.clients=new Map}}const bc=(e,t,n)=>t.clients.forEach((t,i)=>{const r=e.doc.store.clients.get(i);if(null!=r){const i=r[r.length-1],o=i.id.clock+i.length;for(let i=0,s=t[i];i{const n=e.clients.get(t.client);return void 0!==n&&null!==((e,t)=>{let n=0,i=e.length-1;for(;n<=i;){const r=fa((n+i)/2),o=e[r],s=o.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=r.clock?i.len=ba(i.len,r.clock+r.len-i.clock):(n{const t=new gc;for(let n=0;n{if(!t.clients.has(r)){const o=i.slice();for(let t=n+1;t{sa(e.clients,t,()=>[]).push(new mc(n,i))},kc=()=>new gc,wc=(e,t)=>{Ma(e.restEncoder,t.clients.size),ua(t.clients.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{e.resetDsCurVal(),Ma(e.restEncoder,t);const i=n.length;Ma(e.restEncoder,i);for(let t=0;t{const t=new gc,n=al(e.restDecoder);for(let i=0;i0){const r=sa(t.clients,n,()=>[]);for(let t=0;t{const i=new gc,r=al(e.restDecoder);for(let o=0;o0){const e=new Lc;return Ma(e.restEncoder,0),wc(e,i),e.toUint8Array()}return null},Ac=yl;class Ic extends ha{constructor({guid:e=_l(),collectionid:t=null,gc:n=!0,gcFilter:i=()=>!0,meta:r=null,autoLoad:o=!1,shouldLoad:s=!0}={}){super(),this.gc=n,this.gcFilter=i,this.clientID=Ac(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new lu,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=s,this.autoLoad=o,this.meta=r,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=xl(e=>{this.on("load",()=>{this.isLoaded=!0,e(this)})});const a=()=>xl(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])}),this.whenSynced=a()}load(){const e=this._item;null===e||this.shouldLoad||wu(e.parent.doc,e=>{e.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(ua(this.subdocs).map(e=>e.guid))}transact(e,t=null){return wu(this,e,t)}get(e,t=Ku){const n=sa(this.share,e,()=>{const e=new t;return e._integrate(this,null),e}),i=n.constructor;if(t!==Ku&&i!==t){if(i===Ku){const i=new t;i._map=n._map,n._map.forEach(e=>{for(;null!==e;e=e.left)e.parent=i}),i._start=n._start;for(let e=i._start;null!==e;e=e.right)e.parent=i;return i._length=n._length,this.share.set(e,i),i._integrate(this,null),i}throw new Error(`Type with the name ${e} has already been defined with a different constructor`)}return n}getArray(e=""){return this.get(e,hd)}getText(e=""){return this.get(e,Td)}getMap(e=""){return this.get(e,fd)}getXmlElement(e=""){return this.get(e,Rd)}getXmlFragment(e=""){return this.get(e,Nd)}toJSON(){const e={};return this.share.forEach((t,n)=>{e[n]=t.toJSON()}),e}destroy(){this.isDestroyed=!0,ua(this.subdocs).forEach(e=>e.destroy());const e=this._item;if(null!==e){this._item=null;const t=e.content;t.doc=new Ic({guid:this.guid,...t.opts,shouldLoad:!1}),t.doc._item=e,wu(e.parent.doc,n=>{const i=t.doc;e.deleted||n.subdocsAdded.add(i),n.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class Ec{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return al(this.restDecoder)}readDsLen(){return al(this.restDecoder)}}class jc extends Ec{readLeftID(){return Kc(al(this.restDecoder),al(this.restDecoder))}readRightID(){return Kc(al(this.restDecoder),al(this.restDecoder))}readClient(){return al(this.restDecoder)}readInfo(){return sl(this.restDecoder)}readString(){return cl(this.restDecoder)}readParentInfo(){return 1===al(this.restDecoder)}readTypeRef(){return al(this.restDecoder)}readLen(){return al(this.restDecoder)}readAny(){return hl(this.restDecoder)}readBuf(){return(e=>{const t=Wl(e.byteLength);return t.set(e),t})(ol(this.restDecoder))}readJSON(){return JSON.parse(cl(this.restDecoder))}readKey(){return cl(this.restDecoder)}}class Tc{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=al(this.restDecoder),this.dsCurrVal}readDsLen(){const e=al(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class Bc extends Tc{constructor(e){super(e),this.keys=[],al(e),this.keyClockDecoder=new ml(ol(e)),this.clientDecoder=new fl(ol(e)),this.leftClockDecoder=new ml(ol(e)),this.rightClockDecoder=new ml(ol(e)),this.infoDecoder=new pl(ol(e),sl),this.stringDecoder=new gl(ol(e)),this.parentInfoDecoder=new pl(ol(e),sl),this.typeRefDecoder=new fl(ol(e)),this.lenDecoder=new fl(ol(e))}readLeftID(){return new Gc(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new Gc(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 hl(this.restDecoder)}readBuf(){return ol(this.restDecoder)}readJSON(){return hl(this.restDecoder)}readKey(){const e=this.keyClockDecoder.read();if(e{const i=new Map;n.forEach((e,n)=>{uu(t,n)>e&&i.set(n,e)}),cu(t).forEach((e,t)=>{n.has(t)||i.set(t,0)}),Ma(e.restEncoder,i.size),ua(i.entries()).sort((e,t)=>t[0]-e[0]).forEach(([n,i])=>{((e,t,n,i)=>{i=ba(i,t[0].id.clock);const r=hu(t,i);Ma(e.restEncoder,t.length-r),e.writeClient(n),Ma(e.restEncoder,i);const o=t[r];o.write(e,i-o.id.clock);for(let n=r+1;n{const r=rl(t);((e,t,n,i=new Bc(e))=>{wu(t,e=>{e.local=!1;let t=!1;const n=e.doc,r=n.store,o=((e,t)=>{const n=ra(),i=al(e.restDecoder);for(let r=0;r{const i=[];let r=ua(n.keys()).sort((e,t)=>e-t);if(0===r.length)return null;const o=()=>{if(0===r.length)return null;let e=n.get(r[r.length-1]);for(;e.refs.length===e.i;){if(r.pop(),!(r.length>0))return null;e=n.get(r[r.length-1])}return e};let s=o();if(null===s)return null;const a=new lu,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 i){const t=e.id.client,i=n.get(t);i?(i.i--,a.clients.set(t,i.refs.slice(i.i)),n.delete(t),i.i=0,i.refs=[]):a.clients.set(t,[e]),r=r.filter(e=>e!==t)}i.length=0};for(;;){if(u.constructor!==hh){const r=sa(d,u.id.client,()=>uu(t,u.id.client))-u.id.clock;if(r<0)i.push(u),c(u.id.client,u.id.clock-1),h();else{const o=u.getMissing(e,t);if(null!==o){i.push(u);const e=n.get(o)||{refs:[],i:0};if(e.refs.length!==e.i){u=e.refs[e.i++];continue}c(o,uu(t,o)),h()}else(0===r||r0)u=i.pop();else if(null!==s&&s.i0){const e=new Lc;return Mc(e,a,new Map),Ma(e.restEncoder,0),{missing:l,update:e.toUint8Array()}}return null})(e,r,o),a=r.pendingStructs;if(a){for(const[e,n]of a.missing)if(nt)&&a.missing.set(e,t)}a.update=Nu([a.update,s.update])}}else r.pendingStructs=s;const l=Sc(i,e,r);if(r.pendingDs){const t=new Bc(rl(r.pendingDs));al(t.restDecoder);const n=Sc(t,e,r);r.pendingDs=l&&n?Nu([l,n]):l||n}else r.pendingDs=l;if(t){const t=r.pendingStructs.update;r.pendingStructs=null,Pc(e.doc,t)}},n,!1)})(r,e,n,new i(r))},Dc=(e,t=new Uint8Array([0]),n=new Lc)=>{((e,t,n=new Map)=>{Mc(e,t.store,n),wc(e,(e=>{const t=kc();return e.clients.forEach((e,n)=>{const i=[];for(let t=0;t0&&t.clients.set(n,i)}),t})(t.store))})(n,e,Fc(t));const i=[n.toUint8Array()];if(e.store.pendingDs&&i.push(e.store.pendingDs),e.store.pendingStructs&&i.push(Ru(e.store.pendingStructs.update,t)),i.length>1){if(n.constructor===Rc)return Tu(i.map((e,t)=>0===t?e:Pu(e)));if(n.constructor===Lc)return Nu(i)}return i[0]},Fc=e=>(e=>{const t=new Map,n=al(e.restDecoder);for(let i=0;i(Ma(e.restEncoder,t.size),ua(t.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{Ma(e.restEncoder,t),Ma(e.restEncoder,n)}),e);class Vc{constructor(){this.l=[]}}const Uc=()=>new Vc,$c=(e,t)=>e.l.push(t),Hc=(e,t)=>{const n=e.l,i=n.length;e.l=n.filter(e=>t!==e),i===e.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},Wc=(e,t,n)=>Rl(e.l,[t,n]);class Gc{constructor(e,t){this.client=e,this.clock=t}}const qc=(e,t)=>e===t||null!==e&&null!==t&&e.client===t.client&&e.clock===t.clock,Kc=(e,t)=>new Gc(e,t),Yc=e=>{for(const[t,n]of e.doc.share.entries())if(n===e)return t;throw el()},Jc=(e,t)=>{for(;null!==t;){if(t.parent===e)return!0;t=t.parent._item}return!1};class Xc{constructor(e,t,n,i=0){this.type=e,this.tname=t,this.item=n,this.assoc=i}}class Zc{constructor(e,t,n=0){this.type=e,this.index=t,this.assoc=n}}const Qc=(e,t,n)=>{let i=null,r=null;return null===e._item?r=Yc(e):i=Kc(e._item.id.client,e._item.id.clock),new Xc(i,r,t,n)},eu=(e,t,n=0)=>{let i=e._start;if(n<0){if(0===t)return Qc(e,null,n);t--}for(;null!==i;){if(!i.deleted&&i.countable){if(i.length>t)return Qc(e,Kc(i.id.client,i.id.clock+t),n);t-=i.length}if(null===i.right&&n<0)return Qc(e,i.lastId,n);i=i.right}return Qc(e,null,n)},tu=(e,t,n=!0)=>{const i=t.store,r=e.item,o=e.type,s=e.tname,a=e.assoc;let l=null,c=0;if(null!==r){if(uu(i,r.client)<=r.clock)return null;const e=n?rh(i,r):((e,t)=>{const n=pu(e,t);return{item:n,diff:t.clock-n.id.clock}})(i,r),t=e.item;if(!(t instanceof ch))return null;if(l=t.parent,null===l._item||!l._item.deleted){c=t.deleted||!t.countable?0:e.diff+(a>=0?0:1);let n=t.left;for(;null!==n;)!n.deleted&&n.countable&&(c+=n.length),n=n.left}}else{if(null!==s)l=t.get(s);else{if(null===o)throw el();{if(uu(i,o.client)<=o.clock)return null;const{item:e}=n?rh(i,o):{item:pu(i,o)};if(!(e instanceof ch&&e.content instanceof ih))return null;l=e.content.type}}c=a>=0?l._length:0}return((e,t,n=0)=>new Zc(e,t,n))(l,c,e.assoc)},nu=(e,t)=>e===t||null!==e&&null!==t&&e.tname===t.tname&&qc(e.item,t.item)&&qc(e.type,t.type)&&e.assoc===t.assoc;class iu{constructor(e,t){this.ds=e,this.sv=t}}const ru=(su=kc(),au=new Map,new iu(su,au),(e,t)=>void 0===t?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!yc(t.ds,e.id)),ou=(e,t)=>{const n=sa(e.meta,ou,aa),i=e.doc.store;n.has(t)||(t.sv.forEach((t,n)=>{t{}),n.add(t))};var su,au;class lu{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const cu=e=>{const t=new Map;return e.clients.forEach((e,n)=>{const i=e[e.length-1];t.set(n,i.id.clock+i.length)}),t},uu=(e,t)=>{const n=e.clients.get(t);if(void 0===n)return 0;const i=n[n.length-1];return i.id.clock+i.length},du=(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 el()}n.push(t)},hu=(e,t)=>{let n=0,i=e.length-1,r=e[i],o=r.id.clock;if(o===t)return i;let s=fa(t/(o+r.length-1)*i);for(;n<=i;){if(r=e[s],o=r.id.clock,o<=t){if(t{const n=e.clients.get(t.client);return n[hu(n,t.clock)]},fu=(e,t,n)=>{const i=hu(t,n),r=t[i];return r.id.clock{const n=e.doc.store.clients.get(t.client);return n[fu(e,n,t.clock)]},gu=(e,t,n)=>{const i=t.clients.get(n.client),r=hu(i,n.clock),o=i[r];return n.clock!==o.id.clock+o.length-1&&o.constructor!==Dd&&i.splice(r+1,0,sh(e,o,n.clock-o.id.clock+1)),o},bu=(e,t,n,i,r)=>{if(0===i)return;const o=n+i;let s,a=fu(e,t,n);do{s=t[a++],o!(0===t.deleteSet.clients.size&&!((e,t)=>{for(const[n,i]of e)if(t(i,n))return!0;return!1})(t.afterState,(e,n)=>t.beforeState.get(n)!==e)||(vc(t.deleteSet),((e,t)=>{Mc(e,t.doc.store,t.beforeState)})(e,t),wc(e,t.deleteSet),0)),_u=(e,t,n)=>{const i=t._item;(null===i||i.id.clock<(e.beforeState.get(i.id.client)||0)&&!i.deleted)&&sa(e.changed,t,aa).add(n)},xu=(e,t)=>{let n=e[t],i=e[t-1],r=t;for(;r>0&&i.deleted===n.deleted&&i.constructor===n.constructor&&i.mergeWith(n);n=i,i=e[--r-1])n instanceof ch&&null!==n.parentSub&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,i);const o=t-r;return o&&e.splice(t+1-o,o),o},ku=(e,t)=>{if(te.push(()=>{null!==i._item&&i._item.deleted||i._callObserver(n,t)})),e.push(()=>{n.changedParentTypes.forEach((t,i)=>{i._dEH.l.length>0&&(null===i._item||!i._item.deleted)&&((t=t.filter(e=>null===e.target._item||!e.target._item.deleted)).forEach(e=>{e.currentTarget=i,e._path=null}),t.sort((e,t)=>e.path.length-t.path.length),e.push(()=>{Wc(i._dEH,t,n)}))}),e.push(()=>i.emit("afterTransaction",[n,i])),e.push(()=>{n._needFormattingCleanup&&Id(n)})}),Rl(e,[])}finally{i.gc&&((e,t,n)=>{for(const[i,r]of e.clients.entries()){const e=t.clients.get(i);for(let i=r.length-1;i>=0;i--){const o=r[i],s=o.clock+o.len;for(let i=hu(e,o.clock),r=e[i];i{e.clients.forEach((e,n)=>{const i=t.clients.get(n);for(let t=e.length-1;t>=0;t--){const n=e[t];for(let e=ga(i.length-1,1+hu(i,n.clock+n.len-1)),t=i[e];e>0&&t.id.clock>=n.clock;t=i[e])e-=1+xu(i,e)}})})(o,r),n.afterState.forEach((e,t)=>{const i=n.beforeState.get(t)||0;if(i!==e){const e=r.clients.get(t),n=ba(hu(e,i),1);for(let t=e.length-1;t>=n;)t-=1+xu(e,t)}});for(let e=s.length-1;e>=0;e--){const{client:t,clock:n}=s[e].id,i=r.clients.get(t),o=hu(i,n);o+11||o>0&&xu(i,o)}if(n.local||n.afterState.get(i.clientID)===n.beforeState.get(i.clientID)||(((...e)=>{console.log(...uc(e)),hc.forEach(t=>t.print(e))})(ac,ec,"[yjs] ",tc,oc,"Changed the client-id because another client seems to be using it."),i.clientID=Ac()),i.emit("afterTransactionCleanup",[n,i]),i._observers.has("update")){const e=new Rc;vu(e,n)&&i.emit("update",[e.toUint8Array(),n.origin,i,n])}if(i._observers.has("updateV2")){const e=new Lc;vu(e,n)&&i.emit("updateV2",[e.toUint8Array(),n.origin,i,n])}const{subdocsAdded:a,subdocsLoaded:l,subdocsRemoved:c}=n;(a.size>0||c.size>0||l.size>0)&&(a.forEach(e=>{e.clientID=i.clientID,null==e.collectionid&&(e.collectionid=i.collectionid),i.subdocs.add(e)}),c.forEach(e=>i.subdocs.delete(e)),i.emit("subdocs",[{loaded:l,added:a,removed:c},i,n]),c.forEach(e=>e.destroy())),e.length<=t+1?(i._transactionCleanups=[],i.emit("afterAllTransactions",[i,e])):ku(e,t+1)}}},wu=(e,t,n=null,i=!0)=>{const r=e._transactionCleanups;let o=!1,s=null;null===e._transaction&&(o=!0,e._transaction=new yu(e,n,i),r.push(e._transaction),1===r.length&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{s=t(e._transaction)}finally{if(o){const t=e._transaction===r[0];e._transaction=null,t&&ku(r,0)}}return s};class Cu{constructor(e,t){this.insertions=t,this.deletions=e,this.meta=new Map}}const Su=(e,t,n)=>{bc(e,n.deletions,n=>{n instanceof ch&&t.scope.some(t=>t===e.doc||Jc(t,n))&&oh(n,!1)})},Au=(e,t,n)=>{let i=null;const r=e.doc,o=e.scope;wu(r,n=>{for(;t.length>0&&null===e.currStackItem;){const i=r.store,s=t.pop(),a=new Set,l=[];let c=!1;bc(n,s.insertions,e=>{if(e instanceof ch){if(null!==e.redone){let{item:t,diff:r}=rh(i,e.id);r>0&&(t=mu(n,Kc(t.id.client,t.id.clock+r))),e=t}!e.deleted&&o.some(t=>t===n.doc||Jc(t,e))&&l.push(e)}}),bc(n,s.deletions,e=>{e instanceof ch&&o.some(t=>t===n.doc||Jc(t,e))&&!yc(s.insertions,e.id)&&a.add(e)}),a.forEach(t=>{c=null!==lh(n,t,a,s.insertions,e.ignoreRemoteMapChanges,e)||c});for(let t=l.length-1;t>=0;t--){const i=l[t];e.deleteFilter(i)&&(i.delete(n),c=!0)}e.currStackItem=c?s:null}n.changed.forEach((e,t)=>{e.has(null)&&t._searchMarker&&(t._searchMarker.length=0)}),i=n},e);const s=e.currStackItem;if(null!=s){const t=i.changedParentTypes;e.emit("stack-item-popped",[{stackItem:s,type:n,changedParentTypes:t,origin:e},e]),e.currStackItem=null}return s};class Iu extends ha{constructor(e,{captureTimeout:t=500,captureTransaction:n=e=>!0,deleteFilter:i=()=>!0,trackedOrigins:r=new Set([null]),ignoreRemoteMapChanges:o=!1,doc:s=(da(e)?e[0].doc:e instanceof Ic?e:e.doc)}={}){super(),this.scope=[],this.doc=s,this.addToScope(e),this.deleteFilter=i,r.add(this),this.trackedOrigins=r,this.captureTransaction=n,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=o,this.captureTimeout=t,this.afterTransactionHandler=e=>{if(!(this.captureTransaction(e)&&this.scope.some(t=>e.changedParentTypes.has(t)||t===this.doc)&&(this.trackedOrigins.has(e.origin)||e.origin&&this.trackedOrigins.has(e.origin.constructor))))return;const t=this.undoing,n=this.redoing,i=t?this.redoStack:this.undoStack;t?this.stopCapturing():n||this.clear(!1,!0);const r=new gc;e.afterState.forEach((t,n)=>{const i=e.beforeState.get(n)||0,o=t-i;o>0&&xc(r,n,i,o)});const o=Ql();let s=!1;if(this.lastChange>0&&o-this.lastChange0&&!t&&!n){const t=i[i.length-1];t.deletions=_c([t.deletions,e.deleteSet]),t.insertions=_c([t.insertions,r])}else i.push(new Cu(e.deleteSet,r)),s=!0;t||n||(this.lastChange=o),bc(e,e.deleteSet,t=>{t instanceof ch&&this.scope.some(n=>n===e.doc||Jc(n,t))&&oh(t,!0)});const a=[{stackItem:i[i.length-1],origin:e.origin,type:t?"redo":"undo",changedParentTypes:e.changedParentTypes},this];s?this.emit("stack-item-added",a):this.emit("stack-item-updated",a)},this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",()=>{this.destroy()})}addToScope(e){const t=new Set(this.scope);(e=da(e)?e:[e]).forEach(e=>{t.has(e)||(t.add(e),(e instanceof Ku?e.doc!==this.doc:e!==this.doc)&&dc("[yjs#509] Not same Y.Doc"),this.scope.push(e))})}addTrackedOrigin(e){this.trackedOrigins.add(e)}removeTrackedOrigin(e){this.trackedOrigins.delete(e)}clear(e=!0,t=!0){(e&&this.canUndo()||t&&this.canRedo())&&this.doc.transact(n=>{e&&(this.undoStack.forEach(e=>Su(n,this,e)),this.undoStack=[]),t&&(this.redoStack.forEach(e=>Su(n,this,e)),this.redoStack=[]),this.emit("stack-cleared",[{undoStackCleared:e,redoStackCleared:t}])})}stopCapturing(){this.lastChange=0}undo(){let e;this.undoing=!0;try{e=Au(this,this.undoStack,"undo")}finally{this.undoing=!1}return e}redo(){let e;this.redoing=!0;try{e=Au(this,this.redoStack,"redo")}finally{this.redoing=!1}return e}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off("afterTransaction",this.afterTransactionHandler),super.destroy()}}class Eu{constructor(e,t){this.gen=function*(e){const t=al(e.restDecoder);for(let n=0;nNu(e,jc,Rc),Bu=(e,t)=>{if(e.constructor===Dd){const{client:n,clock:i}=e.id;return new Dd(Kc(n,i+t),e.length-t)}if(e.constructor===hh){const{client:n,clock:i}=e.id;return new hh(Kc(n,i+t),e.length-t)}{const n=e,{client:i,clock:r}=n.id;return new ch(Kc(i,r+t),null,Kc(i,r+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},Nu=(e,t=Bc,n=Lc)=>{if(1===e.length)return e[0];const i=e.map(e=>new t(rl(e)));let r=i.map(e=>new Eu(e,!0)),o=null;const s=new n,a=new ju(s);for(;r=r.filter(e=>null!==e.curr),r.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===hh?1:-1:n}return t.curr.id.client-e.curr.id.client}),0!==r.length;){const e=r[0],t=e.curr.id.client;if(null!==o){let n=e.curr,i=!1;for(;null!==n&&n.id.clock+n.length<=o.struct.id.clock+o.struct.length&&n.id.client>=o.struct.id.client;)n=e.next(),i=!0;if(null===n||n.id.client!==t||i&&n.id.clock>o.struct.id.clock+o.struct.length)continue;if(t!==o.struct.id.client)Lu(a,o.struct,o.offset),o={struct:n,offset:0},e.next();else if(o.struct.id.clock+o.struct.length0&&(o.struct.constructor===hh?o.struct.length-=t:n=Bu(n,t)),o.struct.mergeWith(n)||(Lu(a,o.struct,o.offset),o={struct:n,offset:0},e.next())}}else o={struct:e.curr,offset:0},e.next();for(let n=e.curr;null!==n&&n.id.client===t&&n.id.clock===o.struct.id.clock+o.struct.length&&n.constructor!==hh;n=e.next())Lu(a,o.struct,o.offset),o={struct:n,offset:0}}null!==o&&(Lu(a,o.struct,o.offset),o=null),Mu(a);const l=i.map(e=>Cc(e)),c=_c(l);return wc(s,c),s.toUint8Array()},Ru=(e,t,n=Bc,i=Lc)=>{const r=Fc(t),o=new i,s=new ju(o),a=new n(rl(e)),l=new Eu(a,!1);for(;l.curr;){const e=l.curr,t=e.id.client,n=r.get(t)||0;if(l.curr.constructor!==hh)if(e.id.clock+e.length>n)for(Lu(s,e,ba(n-e.id.clock,0)),l.next();l.curr&&l.curr.id.client===t;)Lu(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()}Mu(s);const c=Cc(a);return wc(o,c),o.toUint8Array()},Ou=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:Ra(e.encoder.restEncoder)}),e.encoder.restEncoder=Na(),e.written=0)},Lu=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&Ou(e),0===e.written&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),Ma(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},Mu=e=>{Ou(e);const t=e.encoder.restEncoder;Ma(t,e.clientStructs.length);for(let n=0;n((e,t,n,i)=>{const r=new n(rl(e)),o=new Eu(r,!1),s=new i,a=new ju(s);for(let e=o.curr;null!==e;e=o.next())Lu(a,t(e),0);Mu(a);const l=Cc(r);return wc(s,l),s.toUint8Array()})(e,Ol,Bc,Rc),Du="You must not compute changes after the event-handler fired.";class Fu{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=zu(this.currentTarget,this.target))}deletes(e){return yc(this.transaction.deleteSet,e.id)}get keys(){if(null===this._keys){if(0===this.transaction.doc._transactionCleanups.length)throw Za(Du);const e=new Map,t=this.target;this.transaction.changed.get(t).forEach(n=>{if(null!==n){const i=t._map.get(n);let r,o;if(this.adds(i)){let e=i.left;for(;null!==e&&this.adds(e);)e=e.left;if(this.deletes(i)){if(null===e||!this.deletes(e))return;r="delete",o=la(e.content.getContent())}else null!==e&&this.deletes(e)?(r="update",o=la(e.content.getContent())):(r="add",o=void 0)}else{if(!this.deletes(i))return;r="delete",o=la(i.content.getContent())}e.set(n,{action:r,oldValue:o})}}),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 Za(Du);const t=this.target,n=aa(),i=aa(),r=[];if(e={added:n,deleted:i,delta:r,keys:this.keys},this.transaction.changed.get(t).has(null)){let e=null;const o=()=>{e&&r.push(e)};for(let r=t._start;null!==r;r=r.right)r.deleted?this.deletes(r)&&!this.adds(r)&&(null!==e&&void 0!==e.delete||(o(),e={delete:0}),e.delete+=r.length,i.add(r)):this.adds(r)?(null!==e&&void 0!==e.insert||(o(),e={insert:[]}),e.insert=e.insert.concat(r.content.getContent()),n.add(r)):(null!==e&&void 0!==e.retain||(o(),e={retain:0}),e.retain+=r.length);null!==e&&void 0===e.retain&&o()}this._changes=e}return e}}const zu=(e,t)=>{const n=[];for(;null!==t._item&&t!==e;){if(null!==t._item.parentSub)n.unshift(t._item.parentSub);else{let e=0,i=t._item.parent._start;for(;i!==t._item&&null!==i;)!i.deleted&&i.countable&&(e+=i.length),i=i.right;n.unshift(e)}t=t._item.parent}return n},Vu=()=>{dc("Invalid access: Add Yjs type to a document before reading data.")};let Uu=0;class $u{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=Uu++}}const Hu=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=Uu++},Wu=(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)=>ma(t-e.index){e.timestamp=Uu++})(n));null!==i.right&&rt;)i=i.left,!i.deleted&&i.countable&&(r-=i.length);for(;null!==i.left&&i.left.id.client===i.id.client&&i.left.id.clock+i.left.length===i.id.clock;)i=i.left,!i.deleted&&i.countable&&(r-=i.length);return null!==n&&ma(n.index-r){if(e.length>=80){const i=e.reduce((e,t)=>e.timestamp{for(let i=e.length-1;i>=0;i--){const r=e[i];if(n>0){let t=r.p;for(t.marker=!1;t&&(t.deleted||!t.countable);)t=t.left,t&&!t.deleted&&t.countable&&(r.index-=t.length);if(null===t||!0===t.marker){e.splice(i,1);continue}r.p=t,t.marker=!0}(t0&&t===r.index)&&(r.index=ba(t,r.index+n))}},qu=(e,t,n)=>{const i=e,r=t.changedParentTypes;for(;sa(r,e,()=>[]).push(n),null!==e._item;)e=e._item.parent;Wc(i._eH,n,t)};class Ku{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=Uc(),this._dEH=Uc(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw Qa()}clone(){throw Qa()}_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){$c(this._eH,e)}observeDeep(e){$c(this._dEH,e)}unobserve(e){Hc(this._eH,e)}unobserveDeep(e){Hc(this._dEH,e)}toJSON(){}}const Yu=(e,t,n)=>{e.doc??Vu(),t<0&&(t=e._length+t),n<0&&(n=e._length+n);let i=n-t;const r=[];let o=e._start;for(;null!==o&&i>0;){if(o.countable&&!o.deleted){const e=o.content.getContent();if(e.length<=t)t-=e.length;else{for(let n=t;n0;n++)r.push(e[n]),i--;t=0}}o=o.right}return r},Ju=e=>{e.doc??Vu();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,i=e._start;for(e.doc??Vu();null!==i;){if(i.countable&&!i.deleted){const r=i.content.getContent();for(let i=0;i{const n=[];return Xu(e,(i,r)=>{n.push(t(i,r,e))}),n},Qu=e=>{let t=e._start,n=null,i=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(),i=0,t=t.right}const e=n[i++];return n.length<=i&&(n=null),{done:!1,value:e}}}},ed=(e,t)=>{e.doc??Vu();const n=Wu(e,t);let i=e._start;for(null!==n&&(i=n.p,t-=n.index);null!==i;i=i.right)if(!i.deleted&&i.countable){if(t{let r=n;const o=e.doc,s=o.clientID,a=o.store,l=null===n?t._start:n.right;let c=[];const u=()=>{c.length>0&&(r=new ch(Kc(s,uu(a,s)),r,r&&r.lastId,l,l&&l.id,t,null,new qd(c)),r.integrate(e,0),c=[])};i.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:r=new ch(Kc(s,uu(a,s)),r,r&&r.lastId,l,l&&l.id,t,null,new Fd(new Uint8Array(n))),r.integrate(e,0);break;case Ic:r=new ch(Kc(s,uu(a,s)),r,r&&r.lastId,l,l&&l.id,t,null,new Ud(n)),r.integrate(e,0);break;default:if(!(n instanceof Ku))throw new Error("Unexpected content type in insert operation");r=new ch(Kc(s,uu(a,s)),r,r&&r.lastId,l,l&&l.id,t,null,new ih(n)),r.integrate(e,0)}}}),u()},nd=()=>Za("Length exceeded!"),id=(e,t,n,i)=>{if(n>t._length)throw nd();if(0===n)return t._searchMarker&&Gu(t._searchMarker,n,i.length),td(e,t,null,i);const r=n,o=Wu(t,n);let s=t._start;for(null!==o&&(s=o.p,0===(n-=o.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===i)return;const r=n,o=i,s=Wu(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||(i0)throw nd();t._searchMarker&&Gu(t._searchMarker,r,-o+i)},od=(e,t,n)=>{const i=t._map.get(n);void 0!==i&&i.delete(e)},sd=(e,t,n,i)=>{const r=t._map.get(n)||null,o=e.doc,s=o.clientID;let a;if(null==i)a=new qd([i]);else switch(i.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:a=new qd([i]);break;case Uint8Array:a=new Fd(i);break;case Ic:a=new Ud(i);break;default:if(!(i instanceof Ku))throw new Error("Unexpected content type");a=new ih(i)}new ch(Kc(s,uu(o.store,s)),r,r&&r.lastId,null,null,t,n,a).integrate(e,0)},ad=(e,t)=>{e.doc??Vu();const n=e._map.get(t);return void 0===n||n.deleted?void 0:n.content.getContent()[n.length-1]},ld=e=>{const t={};return e.doc??Vu(),e._map.forEach((e,n)=>{e.deleted||(t[n]=e.content.getContent()[e.length-1])}),t},cd=(e,t)=>{e.doc??Vu();const n=e._map.get(t);return void 0!==n&&!n.deleted},ud=e=>(e.doc??Vu(),((e,t)=>pc(()=>{let n;do{n=e.next()}while(!n.done&&!t(n.value));return n}))(e._map.entries(),e=>!e[1].deleted));class dd extends Fu{}class hd extends Ku{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const t=new hd;return t.push(e),t}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new hd}clone(){const e=new hd;return e.insert(0,this.toArray().map(e=>e instanceof Ku?e.clone():e)),e}get length(){return this.doc??Vu(),this._length}_callObserver(e,t){super._callObserver(e,t),qu(this,e,new dd(this,e))}insert(e,t){null!==this.doc?wu(this.doc,n=>{id(n,this,e,t)}):this._prelimContent.splice(e,0,...t)}push(e){null!==this.doc?wu(this.doc,t=>{((e,t,n)=>{let i=(t._searchMarker||[]).reduce((e,t)=>t.index>e.index?t:e,{index:0,p:t._start}).p;if(i)for(;i.right;)i=i.right;td(e,t,i,n)})(t,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,t=1){null!==this.doc?wu(this.doc,n=>{rd(n,this,e,t)}):this._prelimContent.splice(e,t)}get(e){return ed(this,e)}toArray(){return Ju(this)}slice(e=0,t=this.length){return Yu(this,e,t)}toJSON(){return this.map(e=>e instanceof Ku?e.toJSON():e)}map(e){return Zu(this,e)}forEach(e){Xu(this,e)}[Symbol.iterator](){return Qu(this)}_write(e){e.writeTypeRef(Jd)}}class pd extends Fu{constructor(e,t,n){super(e,t),this.keysChanged=n}}class fd extends Ku{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 fd}clone(){const e=new fd;return this.forEach((t,n)=>{e.set(n,t instanceof Ku?t.clone():t)}),e}_callObserver(e,t){qu(this,e,new pd(this,e,t))}toJSON(){this.doc??Vu();const e={};return this._map.forEach((t,n)=>{if(!t.deleted){const i=t.content.getContent()[t.length-1];e[n]=i instanceof Ku?i.toJSON():i}}),e}get size(){return[...ud(this)].length}keys(){return fc(ud(this),e=>e[0])}values(){return fc(ud(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return fc(ud(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??Vu(),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?wu(this.doc,t=>{od(t,this,e)}):this._prelimContent.delete(e)}set(e,t){return null!==this.doc?wu(this.doc,n=>{sd(n,this,e,t)}):this._prelimContent.set(e,t),t}get(e){return ad(this,e)}has(e){return cd(this,e)}clear(){null!==this.doc?wu(this.doc,e=>{this.forEach(function(t,n,i){od(e,i,n)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(Xd)}}const md=(e,t)=>e===t||"object"==typeof e&&"object"==typeof t&&e&&t&&((e,t)=>e===t||jl(e)===jl(t)&&((e,t)=>{for(const n in e)if(!t(e[n],n))return!1;return!0})(e,(e,n)=>(void 0!==e||Tl(t,n))&&t[n]===e))(e,t);class gd{constructor(e,t,n,i){this.left=e,this.right=t,this.index=n,this.currentAttributes=i}forward(){null===this.right&&el(),this.right.content.constructor===Hd?this.right.deleted||_d(this.currentAttributes,this.right.content):this.right.deleted||(this.index+=this.right.length),this.left=this.right,this.right=this.right.right}}const bd=(e,t,n)=>{for(;null!==t.right&&n>0;)t.right.content.constructor===Hd?t.right.deleted||_d(t.currentAttributes,t.right.content):t.right.deleted||(n{const r=new Map,o=i?Wu(t,n):null;if(o){const t=new gd(o.p.left,o.p,o.index,r);return bd(e,t,n-o.index)}{const i=new gd(null,t._start,0,r);return bd(e,i,n)}},vd=(e,t,n,i)=>{for(;null!==n.right&&(!0===n.right.deleted||n.right.content.constructor===Hd&&md(i.get(n.right.content.key),n.right.content.value));)n.right.deleted||i.delete(n.right.content.key),n.forward();const r=e.doc,o=r.clientID;i.forEach((i,s)=>{const a=n.left,l=n.right,c=new ch(Kc(o,uu(r.store,o)),a,a&&a.lastId,l,l&&l.id,t,null,new Hd(s,i));c.integrate(e,0),n.right=c,n.forward()})},_d=(e,t)=>{const{key:n,value:i}=t;null===i?e.delete(n):e.set(n,i)},xd=(e,t)=>{for(;null!==e.right&&(e.right.deleted||e.right.content.constructor===Hd&&md(t[e.right.content.key]??null,e.right.content.value));)e.forward()},kd=(e,t,n,i)=>{const r=e.doc,o=r.clientID,s=new Map;for(const a in i){const l=i[a],c=n.currentAttributes.get(a)??null;if(!md(c,l)){s.set(a,c);const{left:i,right:u}=n;n.right=new ch(Kc(o,uu(r.store,o)),i,i&&i.lastId,u,u&&u.id,t,null,new Hd(a,l)),n.right.integrate(e,0),n.forward()}}return s},wd=(e,t,n,i,r)=>{n.currentAttributes.forEach((e,t)=>{void 0===r[t]&&(r[t]=null)});const o=e.doc,s=o.clientID;xd(n,r);const a=kd(e,t,n,r),l=i.constructor===String?new Kd(i):i instanceof Ku?new ih(i):new $d(i);let{left:c,right:u,index:d}=n;t._searchMarker&&Gu(t._searchMarker,n.index,l.getLength()),u=new ch(Kc(s,uu(o.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(),vd(e,t,n,a)},Cd=(e,t,n,i,r)=>{const o=e.doc,s=o.clientID;xd(n,r);const a=kd(e,t,n,r);e:for(;null!==n.right&&(i>0||a.size>0&&(n.right.deleted||n.right.content.constructor===Hd));){if(!n.right.deleted)switch(n.right.content.constructor){case Hd:{const{key:t,value:o}=n.right.content,s=r[t];if(void 0!==s){if(md(s,o))a.delete(t);else{if(0===i)break e;a.set(t,o)}n.right.delete(e)}else n.currentAttributes.set(t,o);break}default:i0){let r="";for(;i>0;i--)r+="\n";n.right=new ch(Kc(s,uu(o.store,s)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new Kd(r)),n.right.integrate(e,0),n.forward()}vd(e,t,n,a)},Sd=(e,t,n,i,r)=>{let o=t;const s=ra();for(;o&&(!o.countable||o.deleted);){if(!o.deleted&&o.content.constructor===Hd){const e=o.content;s.set(e.key,e)}o=o.right}let a=0,l=!1;for(;t!==o;){if(n===t&&(l=!0),!t.deleted){const n=t.content;switch(n.constructor){case Hd:{const{key:o,value:c}=n,u=i.get(o)??null;s.get(o)===n&&u!==c||(t.delete(e),a++,l||(r.get(o)??null)!==c||u===c||(null===u?r.delete(o):r.set(o,u))),l||t.deleted||_d(r,n);break}}}t=t.right}return a},Ad=e=>{let t=0;return wu(e.doc,n=>{let i=e._start,r=e._start,o=ra();const s=oa(o);for(;r;)!1===r.deleted&&(r.content.constructor===Hd?_d(s,r.content):(t+=Sd(n,i,r,o,s),o=oa(s),i=r)),r=r.right}),t},Id=e=>{const t=new Set,n=e.doc;for(const[i,r]of e.afterState.entries()){const o=e.beforeState.get(i)||0;r!==o&&bu(e,n.store.clients.get(i),o,r,e=>{e.deleted||e.content.constructor!==Hd||e.constructor===Dd||t.add(e.parent)})}wu(n,n=>{bc(e,e.deleteSet,e=>{if(e instanceof Dd||!e.parent._hasFormatting||t.has(e.parent))return;const i=e.parent;e.content.constructor===Hd?t.add(i):((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===Hd){const i=t.content.key;n.has(i)?t.delete(e):n.add(i)}t=t.left}})(n,e)});for(const e of t)Ad(e)})},Ed=(e,t,n)=>{const i=n,r=oa(t.currentAttributes),o=t.right;for(;n>0&&null!==t.right;){if(!1===t.right.deleted)switch(t.right.content.constructor){case ih:case $d:case Kd: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=[];wu(e,e=>{const n=new Map,i=new Map;let r=this.target._start,o=null;const s={};let a="",l=0,c=0;const u=()=>{if(null!==o){let e=null;switch(o){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=Al({},s))),l=0}e&&t.push(e),o=null}};for(;null!==r;){switch(r.content.constructor){case ih:case $d:this.adds(r)?this.deletes(r)||(u(),o="insert",a=r.content.getContent()[0],u()):this.deletes(r)?("delete"!==o&&(u(),o="delete"),c+=1):r.deleted||("retain"!==o&&(u(),o="retain"),l+=1);break;case Kd:this.adds(r)?this.deletes(r)||("insert"!==o&&(u(),o="insert"),a+=r.content.str):this.deletes(r)?("delete"!==o&&(u(),o="delete"),c+=r.length):r.deleted||("retain"!==o&&(u(),o="retain"),l+=r.length);break;case Hd:{const{key:t,value:a}=r.content;if(this.adds(r)){if(!this.deletes(r)){const l=n.get(t)??null;md(l,a)?null!==a&&r.delete(e):("retain"===o&&u(),md(a,i.get(t)??null)?delete s[t]:s[t]=a)}}else if(this.deletes(r)){i.set(t,a);const e=n.get(t)??null;md(e,a)||("retain"===o&&u(),s[t]=e)}else if(!r.deleted){i.set(t,a);const n=s[t];void 0!==n&&(md(n,a)?null!==n&&r.delete(e):("retain"===o&&u(),null===a?delete s[t]:s[t]=a))}r.deleted||("insert"===o&&u(),_d(n,r.content));break}}r=r.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 Td extends Ku{constructor(e){super(),this._pending=void 0!==e?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??Vu(),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 Td}clone(){const e=new Td;return e.applyDelta(this.toDelta()),e}_callObserver(e,t){super._callObserver(e,t);const n=new jd(this,e,t);qu(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??Vu();let e="",t=this._start;for(;null!==t;)!t.deleted&&t.countable&&t.content.constructor===Kd&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){null!==this.doc?wu(this.doc,n=>{const i=new gd(null,this._start,0,new Map);for(let r=0;r0)&&wd(n,this,i,s,o.attributes||{})}else void 0!==o.retain?Cd(n,this,i,o.retain,o.attributes||{}):void 0!==o.delete&&Ed(n,i,o.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,t,n){this.doc??Vu();const i=[],r=new Map,o=this.doc;let s="",a=this._start;function l(){if(s.length>0){const e={};let t=!1;r.forEach((n,i)=>{t=!0,e[i]=n});const n={insert:s};t&&(n.attributes=e),i.push(n),s=""}}const c=()=>{for(;null!==a;){if(ru(a,e)||void 0!==t&&ru(a,t))switch(a.content.constructor){case Kd:{const i=r.get("ychange");void 0===e||ru(a,e)?void 0===t||ru(a,t)?void 0!==i&&(l(),r.delete("ychange")):void 0!==i&&i.user===a.id.client&&"added"===i.type||(l(),r.set("ychange",n?n("added",a.id):{type:"added"})):void 0!==i&&i.user===a.id.client&&"removed"===i.type||(l(),r.set("ychange",n?n("removed",a.id):{type:"removed"})),s+=a.content.str;break}case ih:case $d:{l();const e={insert:a.content.getContent()[0]};if(r.size>0){const t={};e.attributes=t,r.forEach((e,n)=>{t[n]=e})}i.push(e);break}case Hd:ru(a,e)&&(l(),_d(r,a.content))}a=a.right}l()};return e||t?wu(o,n=>{e&&ou(n,e),t&&ou(n,t),c()},"cleanup"):c(),i}insert(e,t,n){if(t.length<=0)return;const i=this.doc;null!==i?wu(i,i=>{const r=yd(i,this,e,!n);n||(n={},r.currentAttributes.forEach((e,t)=>{n[t]=e})),wd(i,this,r,t,n)}):this._pending.push(()=>this.insert(e,t,n))}insertEmbed(e,t,n){const i=this.doc;null!==i?wu(i,i=>{const r=yd(i,this,e,!n);wd(i,this,r,t,n||{})}):this._pending.push(()=>this.insertEmbed(e,t,n||{}))}delete(e,t){if(0===t)return;const n=this.doc;null!==n?wu(n,n=>{Ed(n,yd(n,this,e,!0),t)}):this._pending.push(()=>this.delete(e,t))}format(e,t,n){if(0===t)return;const i=this.doc;null!==i?wu(i,i=>{const r=yd(i,this,e,!1);null!==r.right&&Cd(i,this,r,t,n)}):this._pending.push(()=>this.format(e,t,n))}removeAttribute(e){null!==this.doc?wu(this.doc,t=>{od(t,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,t){null!==this.doc?wu(this.doc,n=>{sd(n,this,e,t)}):this._pending.push(()=>this.setAttribute(e,t))}getAttribute(e){return ad(this,e)}getAttributes(){return ld(this)}_write(e){e.writeTypeRef(Zd)}}class Bd{constructor(e,t=()=>!0){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??Vu()}[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!==Rd&&t.constructor!==Nd||null===t._start)for(;null!==e;){const t=e.next;if(null!==t){e=t;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 Nd extends Ku{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 Nd}clone(){const e=new Nd;return e.insert(0,this.toArray().map(e=>e instanceof Ku?e.clone():e)),e}get length(){return this.doc??Vu(),null===this._prelimContent?this._length:this._prelimContent.length}createTreeWalker(e){return new Bd(this,e)}querySelector(e){e=e.toUpperCase();const t=new Bd(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e).next();return t.done?null:t.value}querySelectorAll(e){return e=e.toUpperCase(),ua(new Bd(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e))}_callObserver(e,t){qu(this,e,new Od(this,t,e))}toString(){return Zu(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,t={},n){const i=e.createDocumentFragment();return void 0!==n&&n._createAssociation(i,this),Xu(this,r=>{i.insertBefore(r.toDOM(e,t,n),null)}),i}insert(e,t){null!==this.doc?wu(this.doc,n=>{id(n,this,e,t)}):this._prelimContent.splice(e,0,...t)}insertAfter(e,t){if(null!==this.doc)wu(this.doc,n=>{const i=e&&e instanceof Ku?e._item:e;td(n,this,i,t)});else{const n=this._prelimContent,i=null===e?0:n.findIndex(t=>t===e)+1;if(0===i&&null!==e)throw Za("Reference item not found");n.splice(i,0,...t)}}delete(e,t=1){null!==this.doc?wu(this.doc,n=>{rd(n,this,e,t)}):this._prelimContent.splice(e,t)}toArray(){return Ju(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return ed(this,e)}slice(e=0,t=this.length){return Yu(this,e,t)}forEach(e){Xu(this,e)}_write(e){e.writeTypeRef(eh)}}class Rd extends Nd{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 Rd(this.nodeName)}clone(){const e=new Rd(this.nodeName);return((e,t)=>{for(const n in e)t(e[n],n)})(this.getAttributes(),(t,n)=>{e.setAttribute(n,t)}),e.insert(0,this.toArray().map(e=>e instanceof Ku?e.clone():e)),e}toString(){const e=this.getAttributes(),t=[],n=[];for(const t in e)n.push(t);n.sort();const i=n.length;for(let r=0;r0?" "+t.join(" "):""}>${super.toString()}`}removeAttribute(e){null!==this.doc?wu(this.doc,t=>{od(t,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,t){null!==this.doc?wu(this.doc,n=>{sd(n,this,e,t)}):this._prelimAttrs.set(e,t)}getAttribute(e){return ad(this,e)}hasAttribute(e){return cd(this,e)}getAttributes(e){return e?((e,t)=>{const n={};return this._map.forEach((e,i)=>{let r=e;for(;null!==r&&(!t.sv.has(r.id.client)||r.id.clock>=(t.sv.get(r.id.client)||0));)r=r.left;null!==r&&ru(r,t)&&(n[i]=r.content.getContent()[r.length-1])}),n})(0,e):ld(this)}toDOM(e=document,t={},n){const i=e.createElement(this.nodeName),r=this.getAttributes();for(const e in r){const t=r[e];"string"==typeof t&&i.setAttribute(e,t)}return Xu(this,r=>{i.appendChild(r.toDOM(e,t,n))}),void 0!==n&&n._createAssociation(i,this),i}_write(e){e.writeTypeRef(Qd),e.writeKey(this.nodeName)}}class Od extends Fu{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 Ld extends fd{constructor(e){super(),this.hookName=e}_copy(){return new Ld(this.hookName)}clone(){const e=new Ld(this.hookName);return this.forEach((t,n)=>{e.set(n,t)}),e}toDOM(e=document,t={},n){const i=t[this.hookName];let r;return r=void 0!==i?i.createDom(this):document.createElement(this.hookName),r.setAttribute("data-yjs-hook",this.hookName),void 0!==n&&n._createAssociation(r,this),r}_write(e){e.writeTypeRef(th),e.writeKey(this.hookName)}}class Md extends Td{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 Md}clone(){const e=new Md;return e.applyDelta(this.toDelta()),e}toDOM(e=document,t,n){const i=e.createTextNode(this.toString());return void 0!==n&&n._createAssociation(i,this),i}toString(){return this.toDelta().map(e=>{const t=[];for(const n in e.attributes){const i=[];for(const t in e.attributes[n])i.push({key:t,value:e.attributes[n][t]});i.sort((e,t)=>e.keye.nodeName=0;e--)n+=``;return n}).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(nh)}}class Pd{constructor(e,t){this.id=e,this.length=t}get deleted(){throw Qa()}mergeWith(e){return!1}write(e,t,n){throw Qa()}integrate(e,t){throw Qa()}}class Dd extends Pd{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),du(e.doc.store,this)}write(e,t){e.writeInfo(0),e.writeLen(this.length-t)}getMissing(e,t){return null}}class Fd{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Fd(this.content)}splice(e){throw Qa()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}}class zd{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new zd(this.len)}splice(e){const t=new zd(this.len-e);return this.len=e,t}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){xc(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 Vd=(e,t)=>new Ic({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1});class Ud{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 Ud(Vd(this.doc.guid,this.opts))}splice(e){throw Qa()}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 $d{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new $d(this.embed)}splice(e){throw Qa()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}}class Hd{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new Hd(this.key,this.value)}splice(e){throw Qa()}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 Wd{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Wd(this.arr)}splice(e){const t=new Wd(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 i=t;i=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 Yd=[e=>new hd,e=>new fd,e=>new Td,e=>new Rd(e.readKey()),e=>new Nd,e=>new Ld(e.readKey()),e=>new Md],Jd=0,Xd=1,Zd=2,Qd=3,eh=4,th=5,nh=6;class ih{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new ih(this.type._copy())}splice(e){throw Qa()}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 rh=(e,t)=>{let n,i=t,r=0;do{r>0&&(i=Kc(i.client,i.clock+r)),n=pu(e,i),r=i.clock-n.id.clock,i=n.redone}while(null!==i&&n instanceof ch);return{item:n,diff:r}},oh=(e,t)=>{for(;null!==e&&e.keep!==t;)e.keep=t,e=e.parent._item},sh=(e,t,n)=>{const{client:i,clock:r}=t.id,o=new ch(Kc(i,r+n),t,Kc(i,r+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&o.markDeleted(),t.keep&&(o.keep=!0),null!==t.redone&&(o.redone=Kc(t.redone.client,t.redone.clock+n)),t.right=o,null!==o.right&&(o.right.left=o),e._mergeStructs.push(o),null!==o.parentSub&&null===o.right&&o.parent._map.set(o.parentSub,o),t.length=n,o},ah=(e,t)=>((e,t)=>{for(let n=0;nyc(e.deletions,t)),lh=(e,t,n,i,r,o)=>{const s=e.doc,a=s.store,l=s.clientID,c=t.redone;if(null!==c)return mu(e,c);let u,d=t.parent._item,h=null;if(null!==d&&!0===d.deleted){if(null===d.redone&&(!n.has(d)||null===lh(e,d,n,i,r,o)))return null;for(;null!==d.redone;)d=mu(e,d.redone)}const p=null===d?t.parent:d.content.type;if(null===t.parentSub){for(h=t.left,u=t;null!==h;){let t=h;for(;null!==t&&t.parent._item!==d;)t=null===t.redone?null:mu(e,t.redone);if(null!==t&&t.parent._item===d){h=t;break}h=h.left}for(;null!==u;){let t=u;for(;null!==t&&t.parent._item!==d;)t=null===t.redone?null:mu(e,t.redone);if(null!==t&&t.parent._item===d){u=t;break}u=u.right}}else if(u=null,t.right&&!r){for(h=t;null!==h&&null!==h.right&&(h.right.redone||yc(i,h.right.id)||ah(o.undoStack,h.right.id)||ah(o.redoStack,h.right.id));)for(h=h.right;h.redone;)h=mu(e,h.redone);if(h&&null!==h.right)return null}else h=p._map.get(t.parentSub)||null;const f=uu(a,l),m=Kc(l,f),g=new ch(m,h,h&&h.lastId,u,u&&u.id,p,t.parentSub,t.content.copy());return t.redone=m,oh(g,!0),g.integrate(e,0),g};class ch extends Pd{constructor(e,t,n,i,r,o,s,a){super(e,a.getLength()),this.origin=n,this.left=t,this.right=i,this.rightOrigin=r,this.parent=o,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>=uu(t,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=uu(t,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===Gc&&this.id.client!==this.parent.client&&this.parent.clock>=uu(t,this.parent.client))return this.parent.client;if(this.origin&&(this.left=gu(e,t,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=mu(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===Dd||this.right&&this.right.constructor===Dd)this.parent=null;else if(this.parent){if(this.parent.constructor===Gc){const e=pu(t,this.parent);e.constructor===Dd?this.parent=null:this.parent=e.content.type}}else this.left&&this.left.constructor===ch?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===ch&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=gu(e,e.doc.store,Kc(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 i=new Set,r=new Set;for(;null!==t&&t!==this.right;){if(r.add(t),i.add(t),qc(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(),xc(e.deleteSet,this.id.client,this.id.clock,this.length),_u(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw el();this.content.gc(e),t?((e,t,n)=>{const i=e.clients.get(t.id.client);i[hu(i,t.id.clock)]=n})(e,this,new Dd(this.id,this.length)):this.content=new zd(this.length)}write(e,t){const n=t>0?Kc(this.id.client,this.id.clock+t-1):this.origin,i=this.rightOrigin,r=this.parentSub,o=31&this.content.getRef()|(null===n?0:_a)|(null===i?0:va)|(null===r?0:32);if(e.writeInfo(o),null!==n&&e.writeLeftID(n),null!==i&&e.writeRightID(i),null===n&&null===i){const t=this.parent;if(void 0!==t._item){const n=t._item;if(null===n){const n=Yc(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===Gc?(e.writeParentInfo(!1),e.writeLeftID(t)):el();null!==r&&e.writeString(r)}this.content.write(e,t)}}const uh=(e,t)=>dh[31&t](e),dh=[()=>{el()},e=>new zd(e.readLen()),e=>{const t=e.readLen(),n=[];for(let i=0;inew Fd(e.readBuf()),e=>new Kd(e.readString()),e=>new $d(e.readJSON()),e=>new Hd(e.readKey(),e.readJSON()),e=>new ih(Yd[e.readTypeRef()](e)),e=>{const t=e.readLen(),n=[];for(let i=0;inew Ud(Vd(e.readString(),e.readAny())),()=>{el()}];class hh extends Pd{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){el()}write(e,t){e.writeInfo(10),Ma(e.restEncoder,this.length-t)}getMissing(e,t){return null}}const ph="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:{},fh="__ $YJS$ __";!0===ph[fh]&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438"),ph[fh]=!0;var mh=n(23372),gh=n(52983),bh=Symbol("mayDisplayControls"),yh=Symbol("mayDisplayParentControls"),vh=Symbol("mayDisplayPatternEditingControls"),_h=Symbol("blockEditingMode"),xh=Symbol("blockBindings"),kh=Symbol("isPreviewMode"),wh=Symbol("isInListViewBlockSupportTree"),Ch={name:"",isSelected:!1},Sh=(0,T.createContext)(Ch);Sh.displayName="BlockEditContext";var{Provider:Ah}=Sh;function Ih(){return(0,T.useContext)(Sh)}var Eh=n(45020),jh={insertUsage:{}},Th={alignWide:!1,supportsLayout:!0,colors:[{name:(0,ee.__)("Black"),slug:"black",color:"#000000"},{name:(0,ee.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,ee.__)("White"),slug:"white",color:"#ffffff"},{name:(0,ee.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,ee.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,ee.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,ee.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,ee.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,ee.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,ee.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,ee.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,ee.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,ee._x)("Small","font size name"),size:13,slug:"small"},{name:(0,ee._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,ee._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,ee._x)("Large","font size name"),size:36,slug:"large"},{name:(0,ee._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,ee.__)("Thumbnail")},{slug:"medium",name:(0,ee.__)("Medium")},{slug:"large",name:(0,ee.__)("Large")},{slug:"full",name:(0,ee.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,canEditCSS:!1,enableOpenverseMediaCategory:!0,clearBlockSelection:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],isPreviewMode:!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,ee.__)("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,ee.__)("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,ee.__)("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,ee.__)("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,ee.__)("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,ee.__)("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,ee.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,ee.__)("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,ee.__)("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,ee.__)("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,ee.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,ee.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function Bh(e,t,n){return[...e.slice(0,n),...Array.isArray(t)?t:[t],...e.slice(n)]}function Nh(e,t,n,i=1){const r=[...e];return r.splice(t,i),Bh(r,e.slice(t,t+i),n)}var Rh=Symbol("globalStylesDataKey"),Oh=Symbol("globalStylesLinks"),Lh=Symbol("selectBlockPatternsKey"),Mh=Symbol("reusableBlocksSelect"),Ph=Symbol("sectionRootClientIdKey"),Dh=Symbol("mediaEditKey"),Fh=Symbol("getMediaSelect"),zh=Symbol("isIsolatedEditor"),Vh=Symbol("deviceTypeKey"),Uh=Symbol("isNavigationOverlayContext"),$h=Symbol("isNavigationPostEditor"),Hh=Symbol("mediaUploadOnSuccess"),{lock:Wh,unlock:Gh}=(0,pt.yf)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/block-editor"),{isContentBlock:qh}=Gh(ia),Kh=e=>e;function Yh(e,t=""){const n=new Map,i=[];return n.set(t,i),e.forEach(e=>{const{clientId:t,innerBlocks:r}=e;i.push(t),Yh(r,t).forEach((e,t)=>{n.set(t,e)})}),n}function Jh(e,t=""){const n=[],i=[[t,e]];for(;i.length;){const[e,t]=i.shift();t.forEach(({innerBlocks:t,...r})=>{n.push([r.clientId,e]),t?.length&&i.push([r.clientId,t])})}return n}function Xh(e,t=Kh){const n=[],i=[...e];for(;i.length;){const{innerBlocks:e,...r}=i.shift();i.push(...e),n.push([r.clientId,t(r)])}return n}function Zh(e){const t={},n=[...e];for(;n.length;){const{innerBlocks:e,...i}=n.shift();n.push(...e),t[i.clientId]=!0}return t}function Qh(e){return Xh(e,e=>{const{attributes:t,...n}=e;return n})}function ep(e){return Xh(e,e=>e.attributes)}function tp(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&F(e.clientIds,t.clientIds)&&function(e,t){return F(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function np(e,t){const n=e.tree,i=[...t],r=[...t];for(;i.length;){const e=i.shift();i.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n.set(e.clientId,{});for(const t of r)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 ip(e,t,n=!1){const i=e.tree,r=new Set([]),o=new Set;for(const i of t){let t=n?i:e.parents.get(i);do{if(e.controlledInnerBlocks.has(t)){o.add(t);break}r.add(t),t=e.parents.get(t)}while(void 0!==t)}for(const e of r)i.set(e,{...i.get(e)});for(const t of r)i.get(t).innerBlocks=(e.order.get(t)||[]).map(e=>i.get(e));for(const t of o)i.set("controlled||"+t,{innerBlocks:(e.order.get(t)||[]).map(e=>i.get(e))})}var rp=(0,Eh.h)(D.combineReducers,e=>(t={},n)=>{const i=e(t,n);if(i===t)return t;switch(i.tree=t.tree?t.tree:new Map,n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":i.tree=new Map(i.tree),np(i,n.blocks),ip(i,n.rootClientId?[n.rootClientId]:[""],!0);break;case"UPDATE_BLOCK":i.tree=new Map(i.tree),i.tree.set(n.clientId,{...i.tree.get(n.clientId),...i.byClientId.get(n.clientId),attributes:i.attributes.get(n.clientId)}),ip(i,[n.clientId],!1);break;case"SYNC_DERIVED_BLOCK_ATTRIBUTES":case"UPDATE_BLOCK_ATTRIBUTES":i.tree=new Map(i.tree),n.clientIds.forEach(e=>{i.tree.set(e,{...i.tree.get(e),attributes:i.attributes.get(e)})}),ip(i,n.clientIds,!1);break;case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=Zh(n.blocks);i.tree=new Map(i.tree),n.replacedClientIds.forEach(t=>{i.tree.delete(t),e[t]||i.tree.delete("controlled||"+t)}),np(i,n.blocks),ip(i,n.blocks.map(e=>e.clientId),!1);const r=[];for(const e of n.clientIds){const n=t.parents.get(e);void 0===n||""!==n&&!i.byClientId.get(n)||r.push(n)}ip(i,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds){const n=t.parents.get(r);void 0===n||""!==n&&!i.byClientId.get(n)||e.push(n)}i.tree=new Map(i.tree),n.removedClientIds.forEach(e=>{i.tree.delete(e),i.tree.delete("controlled||"+e)}),ip(i,e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId?e.push(n.fromRootClientId):e.push(""),n.toRootClientId&&e.push(n.toRootClientId),i.tree=new Map(i.tree),ip(i,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];i.tree=new Map(i.tree),ip(i,e,!0);break}}return i},e=>(t,n)=>{const i=e=>{let i=e;for(let r=0;r(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const i={};if(t.controlledInnerBlocks.size){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks.has(r.clientId)&&(i[r.clientId]=!0)}}let r=t;t.order.get(n.rootClientId)&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:i,clientIds:t.order.get(n.rootClientId)}));let o=r;if(n.blocks.length){o=e(o,{...n,type:"INSERT_BLOCKS",index:0});const r=new Map(o.order);Object.keys(i).forEach(e=>{t.order.get(e)&&r.set(e,t.order.get(e))}),o.order=r,o.tree=new Map(o.tree),Object.keys(i).forEach(e=>{const n=`controlled||${e}`;t.tree.has(n)&&o.tree.set(n,t.tree.get(n))})}return o},e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const i=e(void 0,{type:"INSERT_BLOCKS",rootClientId:"",blocks:n.blocks}),r=t?.controlledInnerBlocks??new Set;if(t?.order)for(const e of r){if(!i.byClientId.has(e))continue;i.controlledInnerBlocks.add(e);const n=t.order.get(e);if(!n?.length)continue;i.order.set(e,n);const r=(e,n)=>{const o=t.byClientId.get(e);if(!o)return;i.byClientId.set(e,o),i.attributes.set(e,t.attributes.get(e)),i.parents.set(e,n);const s=t.order.get(e)||[];i.order.set(e,s),s.forEach(t=>r(t,e))};n.forEach(t=>r(t,e))}for(const e of i.controlledInnerBlocks){const n=i.order.get(e);if(!n?.length)continue;const r=n.map(e=>t.tree.get(e)),o=i.tree.get(e);o&&(o.innerBlocks=r),i.tree.set("controlled||"+e,{innerBlocks:r});const s=e=>{const n=t.tree.get(e);n&&(i.tree.set(e,n),(i.order.get(e)||[]).forEach(s))};n.forEach(s)}const o=t?.blockEditingModes??new Map;for(const[e,t]of o)i.tree.has(e)&&i.blockEditingModes.set(e,t);return i}return e(t,n)},function(e){let t,n,i=!1;return(r,o)=>{let s,a=e(r,o);if("SET_EXPLICIT_PERSISTENT"===o.type&&(n=o.isPersistentChange,s=r.isPersistentChange??!0),void 0!==n)return s=n,s===a.isPersistentChange?a:{...a,isPersistentChange:s};const l="MARK_LAST_CHANGE_AS_PERSISTENT"===o.type||i;return r!==a||l?(a={...a,isPersistentChange:l?!i:!tp(o,t)},t=o,i="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===o.type,a):(i="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===o.type,s=r?.isPersistentChange??!0,r.isPersistentChange===s?r:{...a,isPersistentChange:s})}},function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,i)=>{const r=e(n,i);return r!==n&&(r.isIgnoredChange=t.has(i.type)),r}},e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const i=t.order.get(n.clientId);if(i?.length){const i=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(i,n)}return e(t,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 Qh(t.blocks).forEach(([e,t])=>{n.set(e,t)}),n}case"UPDATE_BLOCK":{if(!e.has(t.clientId))return e;const{attributes:n,...i}=t.updates;if(0===Object.values(i).length)return e;const r=new Map(e);return r.set(t.clientId,{...e.get(t.clientId),...i}),r}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach(e=>{n.delete(e)}),Qh(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 ep(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 n=!1;const i=new Map(e);for(const r of t.clientIds){const o=Object.entries(t.options?.uniqueByBlock?t.attributes[r]:t.attributes??{});if(0===o.length)continue;let s=!1;const a=e.get(r),l={};o.forEach(([e,t])=>{a[e]!==t&&(s=!0,l[e]=t)}),n=n||s,s&&i.set(r,{...a,...l})}return n?i: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)}),ep(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":{const n=Yh(t.blocks),i=new Map(e);return n.forEach((e,t)=>{""!==t&&i.set(t,e)}),i.set("",(e.get("")??[]).concat(n[""])),i}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,i=e.get(n)||[],r=Yh(t.blocks,n),{index:o=i.length}=t,s=new Map(e);return r.forEach((e,t)=>{s.set(t,e)}),s.set(n,Bh(i,r.get(n),o)),s}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:i="",clientIds:r}=t,{index:o=e.get(i).length}=t;if(n===i){const t=e.get(i).indexOf(r[0]);if(-1===t)return e;const n=new Map(e);return n.set(i,Nh(e.get(i),t,o,r.length)),n}const s=new Map(e);return s.set(n,e.get(n)?.filter(e=>!r.includes(e))??[]),s.set(i,Bh(e.get(i),r,o)),s}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:i=""}=t,r=n[0],o=e.get(i);if(!o.length||r===o[0])return e;const s=o.indexOf(r),a=new Map(e);return a.set(i,Nh(o,s,s-1,n.length)),a}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:i=""}=t,r=n[0],o=n[n.length-1],s=e.get(i);if(!s.length||o===s[s.length-1])return e;const a=s.indexOf(r),l=new Map(e);return l.set(i,Nh(s,a,a+1,n.length)),l}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const i=Yh(t.blocks),r=new Map(e);return t.replacedClientIds.forEach(e=>{r.delete(e)}),i.forEach((e,t)=>{""!==t&&r.set(t,e)}),r.forEach((e,t)=>{const o=Object.values(e).reduce((e,t)=>t===n[0]?[...e,...i.get("")]:(-1===n.indexOf(t)&&e.push(t),e),[]);r.set(t,o)}),r}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach(e=>{n.delete(e)}),n.forEach((e,i)=>{const r=e?.filter(e=>!t.removedClientIds.includes(e))??[];r.length!==e.length&&n.set(i,r)}),n}}return e},parents(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{const n=new Map(e);return Jh(t.blocks).forEach(([e,t])=>{n.set(e,t)}),n}case"INSERT_BLOCKS":{const n=new Map(e);return Jh(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)}),Jh(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=new Set,{type:t,clientId:n,hasControlledInnerBlocks:i}){if("SET_HAS_CONTROLLED_INNER_BLOCKS"===t){if(i)return e.has(n)?e:new Set(e).add(n);if(!e.has(n))return e;const t=new Set(e);return t.delete(n),t}return e},blockEditingModes(e=new Map,t){switch(t.type){case"SET_BLOCK_EDITING_MODE":return e.get(t.clientId)===t.mode?e:new Map(e).set(t.clientId,t.mode);case"UNSET_BLOCK_EDITING_MODE":{if(!e.has(t.clientId))return e;const n=new Map(e);return n.delete(t.clientId),n}}return e}});function op(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}var sp=(0,D.combineReducers)({blocks:rp,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:i}=t;return{selectionStart:n,selectionEnd:i};case"MULTI_SELECT":const{start:r,end:o}=t;return r===e.selectionStart?.clientId&&o===e.selectionEnd?.clientId?e:{selectionStart:{clientId:r},selectionEnd:{clientId:o}};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=op(e.selectionStart,t),i=op(e.selectionEnd,t);return n===e.selectionStart&&i===e.selectionEnd?e:{selectionStart:n,selectionEnd:i}},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=new Map,t)=>{switch(t.type){case"REPLACE_BLOCKS":{const n=new Set,i=[...t.blocks];for(;i.length;){const e=i.shift();n.add(e.clientId),i.push(...e.innerBlocks)}const r=new Map(e);for(const e of t.clientIds)n.has(e)||r.delete(e);return r}case"REMOVE_BLOCKS":{const n=new Map(e);for(const e of t.clientIds)n.delete(e);return n}case"UPDATE_BLOCK_LIST_SETTINGS":{const n=("string"==typeof t.clientId?[[t.clientId,t.settings]]:Object.entries(t.clientId)).filter(([t,n])=>n?!F(e.get(t),n):e.has(t));if(!n.length)return e;const i=new Map(e);for(const[e,t]of n)t?i.set(e,t):i.delete(e);return i}}return e},insertionPoint:function(e=null,t){switch(t.type){case"SET_INSERTION_POINT":return t.value;case"SELECT_BLOCK":return null}return e},insertionCue:function(e=null,t){switch(t.type){case"SHOW_INSERTION_POINT":{const{rootClientId:n,index:i,__unstableWithInserter:r,operation:o,nearestSide:s}=t,a={rootClientId:n,index:i,__unstableWithInserter:r,operation:o,nearestSide:s};return F(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=Th,t){if("UPDATE_SETTINGS"===t.type){const n=t.reset?{...Th,...t.settings}:{...e,...t.settings};return Object.defineProperty(n,"__unstableIsPreviewMode",{get(){return(0,Qt.A)("__unstableIsPreviewMode",{since:"6.8",alternative:"isPreviewMode"}),this.isPreviewMode}}),n}return e},preferences:function(e=jh,t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":{const n=t.blocks.reduce((e,n)=>{const{attributes:i,name:r}=n;let o=r;const s=(0,xe.L)(Zi).getActiveBlockVariation(r,i);return s?.name&&(o+="/"+s.name),"core/block"===r&&(o+="/"+i.ref),{...e,[o]:{time:t.time,count:e[o]?e[o].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.options?.uniqueByBlock?t.attributes[n]:t.attributes}),{})}return e},lastFocus:function(e=!1,t){return"LAST_FOCUS"===t.type?t.lastFocus: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:i}=t;return i?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),i=t.meta?.source;return{clientIds:n,source:i};case"RESET_BLOCKS":return{}}return e},editedContentOnlySection:function(e,t){if("EDIT_CONTENT_ONLY_SECTION"===t.type)return t.clientId;if(!e)return e;switch(t.type){case"REMOVE_BLOCKS":case"REPLACE_BLOCKS":if(t.clientIds.includes(e))return;break;case"RESET_BLOCKS":if(!Zh(t.blocks)[e])return}return e},blockVisibility:function(e={},t){return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e},viewportModalClientIds:function(e=null,t){switch(t.type){case"SHOW_VIEWPORT_MODAL":return t.clientIds;case"HIDE_VIEWPORT_MODAL":return null}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:i}=t;return{clientIds:e,selectPrevious:n,message:i};case"CLEAR_BLOCK_REMOVAL_PROMPT":return!1}return e},blockRemovalRules:function(e=!1,t){return"SET_BLOCK_REMOVAL_RULES"===t.type?t.rules:e},registeredInserterMediaCategories:function(e=[],t){return"REGISTER_INSERTER_MEDIA_CATEGORY"===t.type?[...e,t.category]:e},zoomLevel:function(e=100,t){switch(t.type){case"SET_ZOOM_LEVEL":return t.zoom;case"RESET_ZOOM_LEVEL":return 100}return e},hasBlockSpotlight:function(e,t){switch(t.type){case"TOGGLE_BLOCK_SPOTLIGHT":const{clientId:n,hasBlockSpotlight:i}=t;return i?n:e===n?null:e;case"SELECT_BLOCK":return t.clientId!==e?null:e;case"SELECTION_CHANGE":return t.start?.clientId!==e||t.end?.clientId!==e?null:e;case"CLEAR_SELECTED_BLOCK":return null}return e},openedListViewPanels:function(e={allOpen:!1,panels:{}},t){switch(t.type){case"SET_OPEN_LIST_VIEW_PANEL":return{allOpen:!1,panels:t.clientId?{[t.clientId]:!0}:{}};case"SET_ALL_LIST_VIEW_PANELS_OPEN":return{allOpen:!0,panels:{}};case"TOGGLE_LIST_VIEW_PANEL":return{allOpen:!1,panels:{...e.panels,[t.clientId]:t.isOpen}};case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":{if(!t.clientIds||0===t.clientIds.length)return e;const n={...e.panels};let i=!1;return t.clientIds.forEach(e=>{e in n&&(delete n[e],i=!0)}),i?{...e,panels:n}:e}}return e},listViewExpandRevision:function(e=0,t){return"INCREMENT_LIST_VIEW_EXPAND_REVISION"===t.type?e+1:e},listViewContentPanelOpen:function(e=!1,t){switch(t.type){case"OPEN_LIST_VIEW_CONTENT_PANEL":return!0;case"CLOSE_LIST_VIEW_CONTENT_PANEL":case"CLEAR_SELECTED_BLOCK":return!1}return e},requestedInspectorTab:function(e=null,t){switch(t.type){case"REQUEST_INSPECTOR_TAB":return{tabName:t.tabName,options:t.options};case"CLEAR_REQUESTED_INSPECTOR_TAB":return null}return e}});function ap(e,t){if(""===t){const n=e.blocks.tree.get(t);if(!n)return;return{clientId:"",...n}}if(!e.blocks.controlledInnerBlocks.has(t))return e.blocks.tree.get(t);const n=e.blocks.tree.get(`controlled||${t}`);return{...e.blocks.tree.get(t),innerBlocks:n?.innerBlocks}}function lp(e,t,n){const i=ap(e,t);if(i&&(n(i),i?.innerBlocks?.length))for(const t of i?.innerBlocks)lp(e,t.clientId,n)}function cp(e,t,n){if(!n.length)return;let i=e.blocks.parents.get(t);for(;void 0!==i;){if(n.includes(i))return i;i=e.blocks.parents.get(i)}}function up(e,t=""){const n=e?.zoomLevel<100||"auto-scaled"===e?.zoomLevel,i=new Map,r=e.settings?.[Ph],o=e.blocks.order.get(r),s=Array.from(e.blocks.blockEditingModes).some(([,e])=>"disabled"===e),a=[],l=[];e.blocks.controlledInnerBlocks.forEach(t=>{const n=e.blocks.byClientId?.get(t);"core/template-part"===n?.name&&a.push(t),"core/block"===n?.name&&l.push(t)});const c=Array.from(e.blockListSettings).flatMap(([e,t])=>"contentOnly"===t?.templateLock?[e]:[]),u=e.settings?.[zh],d=e.settings?.disableContentOnlyForUnsyncedPatterns,h=u||d?[]:Array.from(e.blocks.attributes.keys()).filter(t=>e.blocks.attributes.get(t)?.metadata?.patternName),p=e.settings?.disableContentOnlyForTemplateParts,f=[...c,...h,...u||p?[]:a];return lp(e,t,t=>{const{clientId:a,name:c}=t,u=!!e.editedContentOnlySection;let d=!1;if(!u||(d=a===e.editedContentOnlySection||!!cp(e,a,[e.editedContentOnlySection]),d)){if(!e.blocks.blockEditingModes.has(a)){if(s){let t,n=e.blocks.parents.get(a);for(;void 0!==n&&(e.blocks.blockEditingModes.has(n)&&(t=e.blocks.blockEditingModes.get(n)),!t);)n=e.blocks.parents.get(n);if("disabled"===t)return void i.set(a,"disabled")}if(n)return a===r||o?.length&&o.includes(a)?void i.set(a,"contentOnly"):void i.set(a,"disabled");if(l.length){if(l.includes(a))return cp(e,a,l)?void i.set(a,"disabled"):void 0;const n=cp(e,a,l);if(n)return cp(e,n,l)?void i.set(a,"disabled"):function(e){return e?.attributes?.metadata?.bindings&&Object.keys(e?.attributes?.metadata?.bindings).length}(t)?void i.set(a,"contentOnly"):void i.set(a,"disabled")}u&&d?i.set(a,"default"):f.length&&cp(e,a,f)&&(qh(c)?i.set(a,"contentOnly"):i.set(a,"disabled"))}}else i.set(a,"disabled")}),i}function dp({prevState:e,nextState:t,addedBlocks:n,removedClientIds:i}){const r=e.derivedBlockEditingModes;let o;return i?.forEach(t=>{lp(e,t,e=>{r.has(e.clientId)&&(o||(o=new Map(r)),o.delete(e.clientId))})}),n?.forEach(e=>{const n=up(t,e.clientId);n.size&&(o=o?new Map([...o?.size?o:[],...n]):new Map([...r?.size?r:[],...n]))}),o}var hp=(0,Eh.h)(function(e){return(t,n)=>{const i=e(t,n);if("SET_EDITOR_MODE"!==n.type&&i===t)return t;switch(n.type){case"REMOVE_BLOCKS":{const e=dp({prevState:t,nextState:i,removedClientIds:n.clientIds});if(e)return{...i,derivedBlockEditingModes:e??t.derivedBlockEditingModes};break}case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=dp({prevState:t,nextState:i,addedBlocks:n.blocks});if(e)return{...i,derivedBlockEditingModes:e??t.derivedBlockEditingModes};break}case"UPDATE_BLOCK_ATTRIBUTES":{const e=i.settings?.disableContentOnlyForUnsyncedPatterns;if(e)break;const r=[],o=[];for(const e of n?.clientIds){const s=n.options?.uniqueByBlock?n.attributes[e]:n.attributes;if(!s)break;s.metadata?.patternName&&!t.blocks.attributes.get(e)?.metadata?.patternName?r.push(i.blocks.tree.get(e)):s.metadata&&!s.metadata?.patternName&&t.blocks.attributes.get(e)?.metadata?.patternName&&o.push(e)}if(!r?.length&&!o?.length)break;const s=dp({prevState:t,nextState:i,addedBlocks:r,removedClientIds:o});if(s)return{...i,derivedBlockEditingModes:s??t.derivedBlockEditingModes};break}case"UPDATE_BLOCK_LIST_SETTINGS":{const e=[],r=[],o="string"==typeof n.clientId?{[n.clientId]:n.settings}:n.clientId;for(const n in o){const o="contentOnly"!==t.blockListSettings.get(n)?.templateLock&&"contentOnly"===i.blockListSettings.get(n)?.templateLock,s="contentOnly"===t.blockListSettings.get(n)?.templateLock&&"contentOnly"!==i.blockListSettings.get(n)?.templateLock;o?e.push(i.blocks.tree.get(n)):s&&r.push(n)}if(!e.length&&!r.length)break;const s=dp({prevState:t,nextState:i,addedBlocks:e,removedClientIds:r});if(s)return{...i,derivedBlockEditingModes:s??t.derivedBlockEditingModes};break}case"SET_BLOCK_EDITING_MODE":case"UNSET_BLOCK_EDITING_MODE":case"SET_HAS_CONTROLLED_INNER_BLOCKS":{const e=ap(i,n.clientId);if(!e)break;const r=dp({prevState:t,nextState:i,removedClientIds:[n.clientId],addedBlocks:[e]});if(r)return{...i,derivedBlockEditingModes:r??t.derivedBlockEditingModes};break}case"REPLACE_BLOCKS":{const e=dp({prevState:t,nextState:i,addedBlocks:n.blocks,removedClientIds:n.clientIds});if(e)return{...i,derivedBlockEditingModes:e??t.derivedBlockEditingModes};break}case"REPLACE_INNER_BLOCKS":{const e=t.blocks.order.get(n.rootClientId),r=dp({prevState:t,nextState:i,addedBlocks:n.blocks,removedClientIds:e});if(r)return{...i,derivedBlockEditingModes:r??t.derivedBlockEditingModes};break}case"MOVE_BLOCKS_TO_POSITION":{const e=n.clientIds.map(e=>i.blocks.byClientId.get(e)),r=dp({prevState:t,nextState:i,addedBlocks:e,removedClientIds:n.clientIds});if(r)return{...i,derivedBlockEditingModes:r??t.derivedBlockEditingModes};break}case"UPDATE_SETTINGS":if(t?.settings?.[Ph]!==i?.settings?.[Ph]||!!t?.settings?.disableContentOnlyForUnsyncedPatterns!=!!i?.settings?.disableContentOnlyForUnsyncedPatterns||!!t?.settings?.[zh]!=!!i?.settings?.[zh]||!!t?.settings?.disableContentOnlyForTemplateParts!=!!i?.settings?.disableContentOnlyForTemplateParts)return{...i,derivedBlockEditingModes:up(i)};break;case"RESET_BLOCKS":case"EDIT_CONTENT_ONLY_SECTION":case"SET_EDITOR_MODE":case"RESET_ZOOM_LEVEL":case"SET_ZOOM_LEVEL":return{...i,derivedBlockEditingModes:up(i)}}return i.derivedBlockEditingModes=t?.derivedBlockEditingModes??new Map,i}},function(e){return(t,n)=>{const i=e(t,n);return t?(i.automaticChangeStatus=t.automaticChangeStatus,"MARK_AUTOMATIC_CHANGE"===n.type?{...i,automaticChangeStatus:"pending"}:"MARK_AUTOMATIC_CHANGE_FINAL"===n.type&&"pending"===t.automaticChangeStatus?{...i,automaticChangeStatus:"final"}:i.blocks===t.blocks&&i.selection===t.selection||"final"!==i.automaticChangeStatus&&i.selection!==t.selection?i:{...i,automaticChangeStatus:void 0}):i}})(sp),pp=n(65853),fp="core/block-editor",mp=n(56671),gp=n(32461),bp=n(80619),yp={desktop:{label:(0,ee.__)("Desktop"),icon:mp.A,key:"desktop"},tablet:{label:(0,ee.__)("Tablet"),icon:gp.A,key:"tablet"},mobile:{label:(0,ee.__)("Mobile"),icon:bp.A,key:"mobile"}},vp=Object.entries(yp);function _p(e,t,n){t=Array.isArray(t)?[...t]:[t],e=Array.isArray(e)?[...e]:{...e};const i=t.pop();let r=e;for(const e of t){const t=r[e];r=r[e]=Array.isArray(t)?[...t]:{...t}}return r[i]=n,e}var xp=(e,t,n)=>{const i=Array.isArray(t)?t:t.split(".");let r=e;return i.forEach(e=>{r=r?.[e]}),r??n},kp=["color","border","dimensions","typography","spacing"],wp={"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},Cp={"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"};function Sp(e,t,...n){const i=qf(e,t),r=[];if(t){let n=t;do{_n(qf(e,n),"__experimentalSettings",!1)&&r.push(n)}while(n=e.blocks.parents.get(n))}return n.map(n=>{if(kp.includes(n))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let o=(0,Ei.W5)("blockEditor.useSetting.before",void 0,n,t,i);if(void 0!==o)return o;const s=(e=>Cp[e]||e)(n);for(const t of r){const n=Yf(e,t);if(o=xp(n.settings?.blocks?.[i],s)??xp(n.settings,s),void 0!==o)break}const a=Dg(e);if(void 0===o&&i&&(o=xp(a.__experimentalFeatures?.blocks?.[i],s)),void 0===o&&(o=xp(a.__experimentalFeatures,s)),void 0!==o)return on[s]?o.custom??o.theme??o.default:o;const l=wp[s]?.(a);return void 0!==l?l:"typography.dropCap"===s||void 0})}var{isContentBlock:Ap}=Gh(ia);function Ip(e){return e.isBlockInterfaceHidden}function Ep(e){return e?.lastBlockInserted?.clientIds}function jp(e,t){return e.blocks.byClientId.get(t)}var Tp=(e,t)=>{const n=t=>"disabled"===tb(e,t)&&Vm(e,t).every(n);return Vm(e,t).every(n)};function Bp(e,t,n){const i=Ap(t),r=qf(e,n),o=Ap(r);return tf(e)===n||o&&i}function Np(e,t){const n=Vm(e,t),i=[];for(const t of n){const n=Np(e,t);"disabled"!==tb(e,t)?i.push({clientId:t,innerBlocks:n}):i.push(...n)}return i}var Rp=(0,Yn.N)(()=>(0,ce.A)(Np,e=>[e.blocks.order,e.derivedBlockEditingModes,e.blocks.blockEditingModes])),Op=(0,ce.A)((e,t,n=!1)=>ym(e,t,n).filter(t=>"disabled"!==tb(e,t)),e=>[e.blocks.parents,e.blocks.blockEditingModes,e.settings.templateLock,e.blockListSettings]);function Lp(e){return e.removalPromptData}function Mp(e){return e.blockRemovalRules}var Pp=(0,ce.A)(e=>{const t=nm(e).reduce((e,t,n)=>(e[t]=n,e),{});return[...e.styleOverrides].sort((e,n)=>{const[,{clientId:i}]=e,[,{clientId:r}]=n;return(t[i]??-1)-(t[r]??-1)})},e=>[e.blocks.order,e.styleOverrides]);function Dp(e){return e.registeredInserterMediaCategories}var Fp=(0,ce.A)(e=>{const{settings:{inserterMediaCategories:t,allowedMimeTypes:n,enableOpenverseMediaCategory:i},registeredInserterMediaCategories:r}=e;if(!t&&!r.length||!n)return;const o=t?.map(({name:e})=>e)||[];return[...t||[],...(r||[]).filter(({name:e})=>!o.includes(e))].filter(e=>!(!i&&"openverse"===e.name)&&Object.values(n).some(t=>t.startsWith(`${e.mediaType}/`)))},e=>[e.settings.inserterMediaCategories,e.settings.allowedMimeTypes,e.settings.enableOpenverseMediaCategory,e.registeredInserterMediaCategories]),zp=(0,Yn.N)(e=>(0,ce.A)((t,n=null)=>{const{getAllPatterns:i}=Gh(e(fp)),r=i(),{allowedBlockTypes:o}=Dg(t);return r.some(e=>{const{inserter:i=!0}=e;if(!i)return!1;const r=Pf(e);return Ff(r,o)&&r.every(({name:e})=>ug(t,e,n))})},(t,n)=>[...zf(e)(t),...Vf(e)(t,n)])),Vp=(0,Yn.N)(e=>(0,ce.A)((t,n)=>{if(n?.startsWith("core/block/")){const i=parseInt(n.slice(11),10),r=Gh(e(fp)).getReusableBlocks().find(({id:e})=>e===i);return r?Lf(r,t.settings.__experimentalUserPatternCategories):null}return[...t.settings.__experimentalBlockPatterns??[],...t.settings[Lh]?.(e)??[]].find(({name:e})=>e===n)},(t,n)=>n?.startsWith("core/block/")?[Gh(e(fp)).getReusableBlocks(),t.settings.__experimentalReusableBlocks]:[t.settings.__experimentalBlockPatterns,t.settings[Lh]?.(e)])),Up=(0,Yn.N)(e=>(0,ce.A)(t=>[...Gh(e(fp)).getReusableBlocks().map(e=>Lf(e,t.settings.__experimentalUserPatternCategories)),...t.settings.__experimentalBlockPatterns??[],...t.settings[Lh]?.(e)??[]].filter((e,t,n)=>t===n.findIndex(t=>e.name===t.name)),zf(e))),$p=[],Hp=(0,Yn.N)(e=>t=>{const n=t.settings[Mh];return(n?n(e):t.settings.__experimentalReusableBlocks)??$p});function Wp(e){return e.lastFocus}function Gp(e){return e.isDragging}function qp(e){return e.expandedBlock}var Kp=(e,t)=>{let n,i=t;for(;!n&&(i=e.blocks.parents.get(i));)"contentOnly"===ag(e,i)&&(n=i);return n};function Yp(e,t){const n=qf(e,t);if("core/block"===n)return!0;const i=Yf(e,t),r="core/template-part"===n,o=e.settings?.[zh],s=e.settings?.disableContentOnlyForUnsyncedPatterns,a=e.settings?.disableContentOnlyForTemplateParts;if((!s&&i?.metadata?.patternName||r&&!a)&&!o)return!0;const l="contentOnly"===ag(e,t),c="contentOnly"===ag(e,bm(e,t));return!(!l||c)}var Jp=(e,t)=>{if(Qp(e,t))return;let n,i=t;for(;i=e.blocks.parents.get(i);)Yp(e,i)&&(n=i);return n};function Xp(e,t){return!Qp(e,t)&&!Jp(e,t)&&Yp(e,t)}function Zp(e){return e.editedContentOnlySection}function Qp(e,t){if(!e.editedContentOnlySection)return!1;if(e.editedContentOnlySection===t)return!0;let n=t;for(;n=e.blocks.parents.get(n);)if(e.editedContentOnlySection===n)return!0;return!1}var ef=(0,ce.A)((e,t)=>t.reduce((t,n)=>(t[n]=e.blocks.attributes.get(n)?.style,t),{}),(e,t)=>[...t.map(t=>e.blocks.attributes.get(t)?.style)]);function tf(e){return e.settings?.[Ph]}function nf(e){return"auto-scaled"===e.zoomLevel||e.zoomLevel<100}function rf(e){return e.zoomLevel}function of(e,t,n=""){const i=Array.isArray(t)?t:[t],r=t=>i.every(n=>ug(e,n,t));if(!n){if(r(n))return n;const t=tf(e);return t&&r(t)?t:null}let o=n;for(;null!==o&&!r(o);)o=bm(e,o);return o}function sf(e,t,n){const{allowedBlockTypes:i}=Dg(e);return Ff(Pf(t),i)?of(e,Pf(t).map(({blockName:e})=>e),n):null}function af(e){return e.insertionPoint}var lf=(e,t)=>{if(!_n(qf(e,t),"visibility",!0))return!1;const n=e.blocks.attributes.get(t),i=n?.metadata?.blockVisibility;return!1===i||"object"==typeof i?.viewport&&null!==i?.viewport&&Object.values(yp).some(e=>!1===i?.viewport?.[e.key])},cf=(e,t)=>{if(!_n(qf(e,t),"visibility",!0))return!1;const n=e.blocks.attributes.get(t),i=n?.metadata?.blockVisibility;return!1===i},uf=(e,t)=>ym(e,t).some(t=>cf(e,t)),df=(e,t,n)=>{if(cf(e,t))return!0;const i=e.blocks.attributes.get(t),r=i?.metadata?.blockVisibility?.viewport;return"object"==typeof r&&null!==r&&"string"==typeof n&&!1===r?.[n.toLowerCase()]},hf=(e,t,n)=>ym(e,t).some(t=>df(e,t,n));function pf(e){return!!e.hasBlockSpotlight||!!e.editedContentOnlySection}function ff(e,t){const n=Yf(e,t);return!!n?.lock?.edit}function mf(e,t){const n=Yf(e,t);return void 0!==n?.lock?.move?!!n?.lock?.move:"all"===ag(e,bm(e,t))}function gf(e,t){const n=Yf(e,t);if(void 0!==n?.lock?.remove)return!!n?.lock?.remove;const i=ag(e,bm(e,t));return"all"===i||"insert"===i}function bf(e,t){return ff(e,t)||mf(e,t)||gf(e,t)}function yf(e){return e.listViewContentPanelOpen}function vf(e,t){return!!e.openedListViewPanels?.allOpen||!0===e.openedListViewPanels?.panels?.[t]}function _f(e){return e.listViewExpandRevision||0}function xf(e){return e.viewportModalClientIds}function kf(e){return e.requestedInspectorTab}var wf="user",Cf="theme",Sf="directory",Af="fully",If="unsynced",Ef={name:"allPatterns",label:(0,ee._x)("All","patterns")},jf={name:"myPatterns",label:(0,ee.__)("My patterns")},Tf={name:"core/starter-content",label:(0,ee.__)("Starter content")};function Bf(e,t,n){const i=e.name.startsWith("core/block"),r="core"===e.source||e.source?.startsWith("pattern-directory");return!(t!==Cf||!i&&!r)||!(t!==Sf||!i&&r)||t===wf&&e.type!==wf||n===Af&&""!==e.syncStatus||!(n!==If||"unsynced"===e.syncStatus||!i)}var Nf=Symbol("isFiltered"),Rf=new WeakMap,Of=new WeakMap;function Lf(e,t=[]){return{name:`core/block/${e.id}`,id:e.id,type:wf,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}}function Mf(e){let t=Rf.get(e);return t||(t=function(e){const t=Vo(e.content,{__unstableSkipMigrationLogs:!0});return 1===t.length&&(t[0].attributes={...t[0].attributes,metadata:{...t[0].attributes.metadata||{},categories:e.categories,patternName:e.name,name:t[0].attributes.metadata?.name||e.title}}),{...e,blocks:t}}(e),Rf.set(e,t)),t}function Pf(e){let t=Of.get(e);return t||(t=vr(e.content),t=t.filter(e=>null!==e.blockName),Of.set(e,t)),t}var Df=(e,t,n=null)=>"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n,Ff=(e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){const e=n.shift();if(!Df(t,e.name||e.blockName,!0))return!1;e.innerBlocks?.forEach(e=>{n.push(e)})}return!0},zf=e=>t=>[t.settings.__experimentalBlockPatterns,t.settings.__experimentalUserPatternCategories,t.settings.__experimentalReusableBlocks,t.settings[Lh]?.(e),t.blockPatterns,Gh(e(fp)).getReusableBlocks()],Vf=()=>(e,t)=>[e.blockListSettings.get(t),e.blocks.byClientId.get(t),e.blocks.order.get(t||""),e.settings.allowedBlockTypes,e.settings.templateLock,tb(e,t),tf(e),Xp(e,t),Jp(e,t)];function Uf(e,t,n="asc"){return e.concat().sort(((e,t,n)=>(i,r)=>{let o,s;if("function"==typeof e?(o=e(i),s=e(r)):(o=i[e],s=r[e]),o>s)return"asc"===n?1:-1;if(s>o)return"asc"===n?-1:1;const a=t.findIndex(e=>e===i),l=t.findIndex(e=>e===r);return a>l?1:l>a?-1:0})(t,e,n))}var{isContentBlock:$f}=Gh(ia),Hf=[],Wf=new Set,Gf={[Nf]:!0};function qf(e,t){const n=e.blocks.byClientId.get(t),i="core/social-link";if("web"!==Uo.A.OS&&n?.name===i){const n=e.blocks.attributes.get(t),{service:r}=n??{};return r?`${i}-${r}`:i}return n?n.name:null}function Kf(e,t){const n=e.blocks.byClientId.get(t);return!!n&&n.isValid}function Yf(e,t){return e.blocks.byClientId.get(t)?e.blocks.attributes.get(t):null}function Jf(e,t){return e.blocks.byClientId.has(t)?e.blocks.tree.get(t):null}var Xf=(0,ce.A)((e,t)=>{const n=e.blocks.byClientId.get(t);return n?{...n,attributes:Yf(e,t)}:null},(e,t)=>[e.blocks.byClientId.get(t),e.blocks.attributes.get(t)]);function Zf(e,t){const n=t&&qg(e,t)?"controlled||"+t:t||"";return e.blocks.tree.get(n)?.innerBlocks||Hf}var Qf=(0,ce.A)((e,t)=>((0,Qt.A)("wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree",{since:"6.3",version:"6.5"}),{clientId:t,innerBlocks:em(e,t)}),e=>[e.blocks.order]),em=(0,ce.A)((e,t="")=>((0,Qt.A)("wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree",{since:"6.3",version:"6.5"}),Vm(e,t).map(t=>Qf(e,t))),e=>[e.blocks.order]),tm=(0,ce.A)((e,t)=>{t=Array.isArray(t)?[...t]:[t];const n=[];for(const i of t){const t=e.blocks.order.get(i);t&&n.push(...t)}let i=0;for(;i[e.blocks.order]),nm=e=>tm(e,""),im=(0,ce.A)((e,t)=>{const n=nm(e);if(!t)return n.length;let i=0;for(const r of n)e.blocks.byClientId.get(r).name===t&&i++;return i},e=>[e.blocks.order,e.blocks.byClientId]),rm=(0,ce.A)((e,t)=>{if(!t)return Hf;const n=Array.isArray(t)?t:[t],i=nm(e).filter(t=>{const i=e.blocks.byClientId.get(t);return n.includes(i.name)});return i.length>0?i:Hf},e=>[e.blocks.order,e.blocks.byClientId]);function om(e,t){return(0,Qt.A)("wp.data.select( 'core/block-editor' ).__experimentalGetGlobalBlocksByName",{since:"6.5",alternative:"wp.data.select( 'core/block-editor' ).getBlocksByName"}),rm(e,t)}var sm=(0,ce.A)((e,t)=>(Array.isArray(t)?t:[t]).map(t=>Jf(e,t)),(e,t)=>(Array.isArray(t)?t:[t]).map(t=>e.blocks.tree.get(t))),am=(0,ce.A)((e,t)=>sm(e,t).filter(Boolean).map(e=>e.name),(e,t)=>sm(e,t));function lm(e,t){return Vm(e,t).length}function cm(e){return e.selection.selectionStart}function um(e){return e.selection.selectionEnd}function dm(e){return e.selection.selectionStart.clientId}function hm(e){return e.selection.selectionEnd.clientId}function pm(e){return Im(e).length||(e.selection.selectionStart.clientId?1:0)}function fm(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function mm(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:i}=t;return i&&i===n.clientId?i:null}function gm(e){const t=mm(e);return t?Jf(e,t):null}function bm(e,t){return e.blocks.parents.get(t)??null}var ym=(0,ce.A)((e,t,n=!1)=>{const i=[];let r=t;for(;r=e.blocks.parents.get(r);)i.push(r);return i.length?n?i:i.reverse():Hf},e=>[e.blocks.parents]),vm=(0,ce.A)((e,t,n,i=!1)=>{const r=ym(e,t,i),o=Array.isArray(n)?e=>n.includes(e):e=>n===e;return r.filter(t=>o(qf(e,t)))},e=>[e.blocks.parents]);function _m(e,t){let n,i=t;do{n=i,i=e.blocks.parents.get(i)}while(i);return n}function xm(e,t){const n=mm(e),i=[...ym(e,t),t],r=[...ym(e,n),n];let o;const s=Math.min(i.length,r.length);for(let e=0;e{const{selectionStart:t,selectionEnd:n}=e.selection;if(!t.clientId||!n.clientId)return Hf;if(t.clientId===n.clientId)return[t.clientId];const i=bm(e,t.clientId);if(null===i)return Hf;const r=Vm(e,i),o=r.indexOf(t.clientId),s=r.indexOf(n.clientId);return o>s?r.slice(s,o+1):r.slice(o,s+1)},e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]);function Im(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?Hf:Am(e)}var Em=(0,ce.A)(e=>{const t=Im(e);return t.length?t.map(t=>Jf(e,t)):Hf},e=>[...Am.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]);function jm(e){return Im(e)[0]||null}function Tm(e){const t=Im(e);return t[t.length-1]||null}function Bm(e,t){return jm(e)===t}function Nm(e,t){return-1!==Im(e).indexOf(t)}var Rm=(0,ce.A)((e,t)=>{let n=t,i=!1;for(;n&&!i;)n=bm(e,n),i=Nm(e,n);return i},e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]);function Om(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Lm(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Mm(e){const t=cm(e),n=um(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Pm(e){const t=cm(e),n=um(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Dm(e){return Am(e).some(t=>!bn(qf(e,t)).merge)}function Fm(e,t){const n=cm(e),i=um(e);if(n.clientId===i.clientId)return!1;if(!n.attributeKey||!i.attributeKey||void 0===n.offset||void 0===i.offset)return!1;const r=bm(e,n.clientId);if(r!==bm(e,i.clientId))return!1;const o=Vm(e,r);let s,a;o.indexOf(n.clientId)>o.indexOf(i.clientId)?(s=i,a=n):(s=n,a=i);const l=t?a.clientId:s.clientId,c=t?s.clientId:a.clientId,u=qf(e,l);if(!bn(u).merge)return!1;const d=Jf(e,c);if(d.name===u)return!0;const h=ur(d,u);return h&&h.length}var zm=e=>{const t=cm(e),n=um(e);if(t.clientId===n.clientId)return Hf;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return Hf;const i=bm(e,t.clientId);if(i!==bm(e,n.clientId))return Hf;const r=Vm(e,i),o=r.indexOf(t.clientId),s=r.indexOf(n.clientId),[a,l]=o>s?[n,t]:[t,n],c=Jf(e,a.clientId),u=Jf(e,l.clientId),d=c.attributes[a.attributeKey],h=u.attributes[l.attributeKey];let p=We({html:d}),f=We({html:h});return p=at(p,0,a.offset),f=at(f,l.offset,f.text.length),[{...c,attributes:{...c.attributes,[a.attributeKey]:Be({value:p})}},{...u,attributes:{...u.attributes,[l.attributeKey]:Be({value:f})}}]};function Vm(e,t){return e.blocks.order.get(t||"")||Hf}function Um(e,t){return Vm(e,bm(e,t)).indexOf(t)}function $m(e,t){const{selectionStart:n,selectionEnd:i}=e.selection;return n.clientId===i.clientId&&n.clientId===t}function Hm(e,t,n=!1){const i=Am(e);return!!i.length&&(n?i.some(n=>ym(e,n,!0).includes(t)):i.some(n=>bm(e,n)===t))}function Wm(e,t,n=!1){return Vm(e,t).some(t=>eg(e,t)||n&&Wm(e,t,n))}function Gm(e,t){if(!t)return!1;const n=Im(e),i=n.indexOf(t);return i>-1&&ieg(e,t))}function ng(){return(0,Qt.A)('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}var ig=(0,ce.A)(e=>{let t,n;const{insertionCue:i,selection:{selectionEnd:r}}=e;if(null!==i)return i;const{clientId:o}=r;return o?(t=bm(e,o)||void 0,n=Um(e,r.clientId)+1):n=Vm(e).length,{rootClientId:t,index:n}},e=>[e.insertionCue,e.selection.selectionEnd.clientId,e.blocks.parents,e.blocks.order]);function rg(e){return null!==e.insertionCue}function og(e){return e.template.isValid}function sg(e){return e.settings.template}function ag(e,t){if(!t)return e.settings.templateLock??!1;const n=Pg(e,t)?.templateLock;return("contentOnly"!==n||e.editedContentOnlySection!==t)&&(n??!1)}var lg=(e,t,n=null)=>{let i,r;if(t&&"object"==typeof t?(i=t,r=t.name):(i=bn(t),r=t),!i)return!1;const{allowedBlockTypes:o}=Dg(e);if(!Df(o,r,!0))return!1;const s=(Array.isArray(i.parent)?i.parent:[]).concat(Array.isArray(i.ancestor)?i.ancestor:[]);if(s.length>0){if(s.includes("core/post-content"))return!0;let t=n,i=!1;do{if(s.includes(qf(e,t))){i=!0;break}t=e.blocks.parents.get(t)}while(t);return i}return!0},cg=(e,t,n=null)=>{if(e.settings.isPreviewMode)return!1;if(!lg(e,t,n))return!1;let i;t&&"object"==typeof t?(i=t,t=i.name):i=bn(t);const r=ag(e,n);if(r&&"contentOnly"!==r)return!1;const o=tb(e,n??""),s=!!Xp(e,n),a=s?n:Jp(e,n),l=!!a;if("disabled"===o&&(!l||t!==gn()))return!1;const c=Pg(e,n);if(n&&void 0===c)return!1;const u=$f(t);if(l&&!u)return!1;if(l&&"core/block"===qf(e,a))return!1;if(l&&(s||"contentOnly"===o||"disabled"===o)&&!Bp(e,t,n)){const i=gn();if(t!==i)return!1;if(!Vm(e,n).some(t=>qf(e,t)===i))return!1}const d=qf(e,n),h=bn(d),p=h?.allowedBlocks;let f=Df(p,t);if(!1!==f){const e=c?.allowedBlocks,n=Df(e,t);null!==n&&(f=n)}const m=i.parent,g=Df(m,d);let b=!0;const y=i.ancestor;y&&(b=[n,...ym(e,n)].some(t=>Df(y,qf(e,t))));const v=b&&(null===f&&null===g||!0===f||!0===g);return v?(0,Ei.W5)("blockEditor.__unstableCanInsertBlockType",v,i,n,{getBlock:Jf.bind(null,e),getBlockParentsByBlockName:vm.bind(null,e)}):v},ug=(0,Yn.N)(e=>(0,ce.A)(cg,(t,n,i)=>Vf(e)(t,i)));function dg(e,t,n=null){return t.every(t=>ug(e,qf(e,t),n))}function hg(e,t){if(e.settings.isPreviewMode)return!1;const n=Yf(e,t);if(null===n)return!0;if(void 0!==n.lock?.remove)return!n.lock.remove;const i=bm(e,t),r=ag(e,i);if(r&&"contentOnly"!==r)return!1;const o=!!Xp(e,i),s=o?i:Jp(e,i),a=!!s,l=$f(qf(e,t));if(a&&!l)return!1;if(a&&"core/block"===qf(e,s))return!1;const c=tb(e,i),u=qf(e,t),d=gn();if(a&&(o||u===d||"contentOnly"===c)&&!Bp(e,qf(e,t),i)){if(u===d){const t=Vm(e,i).filter(t=>qf(e,t)===d);return t.length>1}return!1}return"disabled"!==c}function pg(e,t){return t.every(t=>hg(e,t))}function fg(e,t){if(e.settings.isPreviewMode)return!1;const n=Yf(e,t);if(null===n)return!0;if(void 0!==n.lock?.move)return!n.lock.move;const i=bm(e,t);if("all"===ag(e,i))return!1;const r=!!Jp(e,t),o=$f(qf(e,t));if(r&&!o)return!1;const s=!!Xp(e,i),a=tb(e,i);return!(r&&(s||"contentOnly"===a)&&!Bp(e,qf(e,t),i))&&"disabled"!==tb(e,i)}function mg(e,t){return t.every(t=>fg(e,t))}function gg(e,t){if(e.settings.isPreviewMode)return!1;const n=Yf(e,t);if(null===n)return!0;const{lock:i}=n;return!i?.edit}function bg(e,t){return!e.settings.isPreviewMode&&!!_n(t,"lock",!0)&&!!e.settings?.canLockBlocks}function yg(e,t){return e.preferences.insertUsage?.[t]??null}var vg=(e,t,n)=>!!_n(t,"inserter",!0)&&cg(e,t.name,n),_g=(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}},xg=(e,{buildScope:t="inserter"})=>n=>{const i=n.name;let r=!1;_n(n.name,"multiple",!0)||(r=sm(e,nm(e)).some(({name:e})=>e===n.name));const{time:o,count:s=0}=yg(e,i)||{},a={id:i,name:n.name,title:n.title,icon:n.icon,isDisabled:r,frecency:_g(o,s)};if("transform"===t)return a;const l=[...wn(n.name,"inserter"),...wn(n.name,"block").filter(e=>"core/heading"===n.name&&["h1","h2","h3","h4","h5","h6"].includes(e.name)).map(e=>({...e,isSearchOnly:!0}))];return{...a,initialAttributes:{},description:n.description,category:n.category,keywords:n.keywords,parent:n.parent,ancestor:n.ancestor,variations:l,example:n.example,utility:1}},kg=(0,Yn.N)(e=>(0,ce.A)((t,n=null,i=Gf)=>{const r=cg(t,"core/block",n)?Gh(e(fp)).getReusableBlocks().map(e=>{const n=e.wp_pattern_sync_status?pp.A:{src:pp.A,foreground:"var(--wp-block-synced-color)"},i=Lf(e),{time:r,count:o=0}=yg(t,i.name)||{},s=_g(r,o);return{id:i.name,name:"core/block",initialAttributes:{ref:e.id},title:i.title,icon:n,category:"reusable",keywords:["reusable"],isDisabled:!1,utility:1,frecency:s,content:i.content,get blocks(){return Mf(i).blocks},syncStatus:i.syncStatus}}):[],o=xg(t,{buildScope:"inserter"});let s=yn().filter(e=>_n(e,"inserter",!0)).map(o);if(!1!==i[Nf])s=s.filter(e=>vg(t,e,n));else{const{getClosestAllowedInsertionPoint:i}=Gh(e(fp));s=s.filter(e=>lg(t,e,n)&&null!==i(e.name,n)).map(e=>({...e,isAllowedInCurrentRoot:vg(t,e,n)}))}const a=s.reduce((e,n)=>{const{variations:i=[]}=n;if(i.some(({isDefault:e})=>e)||e.push(n),i.length){const r=((e,t)=>n=>{const i=`${t.id}/${n.name}`,{time:r,count:o=0}=yg(e,i)||{};return{...t,id:i,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:_g(r,o),isSearchOnly:n.isSearchOnly}})(t,n);e.push(...i.map(r))}return e},[]),{core:l,noncore:c}=a.reduce((e,t)=>{const{core:n,noncore:i}=e;return(t.name.startsWith("core/")?n:i).push(t),e},{core:[],noncore:[]});return[...l,...c,...r]},(t,n)=>[yn(),Gh(e(fp)).getReusableBlocks(),t.blocks.order,t.preferences.insertUsage,...Vf(e)(t,n)])),wg=(0,Yn.N)(e=>(0,ce.A)((e,t,n=null)=>{const i=Array.isArray(t)?t:[t],r=xg(e,{buildScope:"transform"}),o=yn().filter(t=>vg(e,t,n)).map(r),s=Object.fromEntries(Object.entries(o).map(([,e])=>[e.name,e]));return Uf(function(e){if(!e.length)return[];const t=(e=>e.length?yn().filter(t=>!!ar(lr("from",t.name),t=>rr(t,"from",e))):[])(e),n=(e=>{if(!e.length)return[];const t=bn(e[0].name);return(t?lr("to",t.name):[]).filter(t=>t&&rr(t,"to",e)).map(e=>e.blocks).flat().filter(e=>!!e).map(bn).filter(e=>!!e)})(e);return[...new Set([...t,...n])]}(i).reduce((e,t)=>(s[t?.name]&&e.push(s[t.name]),e),[]),e=>s[e.name].frecency,"desc")},(t,n,i)=>[yn(),t.preferences.insertUsage,...Vf(e)(t,i)])),Cg=(e,t=null)=>!!yn().some(n=>vg(e,n,t))||cg(e,"core/block",t),Sg=(0,Yn.N)(e=>(0,ce.A)((e,t=null)=>{if(!t)return;const n=yn().filter(n=>vg(e,n,t));return cg(e,"core/block",t)&&n.push("core/block"),n},(t,n)=>[yn(),...Vf(e)(t,n)])),Ag=(0,ce.A)((e,t=null)=>((0,Qt.A)('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',{alternative:'wp.data.select( "core/block-editor" ).getAllowedBlocks',since:"6.2",version:"6.4"}),Sg(e,t)),(e,t)=>Sg.getDependants(e,t));function Ig(e,t=null){if(!t)return;const{defaultBlock:n,directInsert:i}=e.blockListSettings.get(t)??{};return n&&i?n:void 0}function Eg(e,t=null){return(0,Qt.A)('wp.data.select( "core/block-editor" ).__experimentalGetDirectInsertBlock',{alternative:'wp.data.select( "core/block-editor" ).getDirectInsertBlock',since:"6.3",version:"6.4"}),Ig(e,t)}var jg=(0,Yn.N)(e=>(t,n)=>{const i=Gh(e(fp)).getPatternBySlug(n);return i?Mf(i):null}),Tg=e=>(t,n)=>[...zf(e)(t),...Vf(e)(t,n)],Bg=new WeakMap;function Ng(e){let t=Bg.get(e);return t||(t={...e,get blocks(){return Mf(e).blocks}},Bg.set(e,t)),t}var Rg=(0,Yn.N)(e=>(0,ce.A)((t,n=null,i=Gf)=>{const{getAllPatterns:r}=Gh(e(fp)),o=r(),{allowedBlockTypes:s}=Dg(t);return o.filter(({inserter:e=!0})=>!!e).map(Ng).filter(e=>Ff(Pf(e),s)).filter(e=>Pf(e).every(({blockName:e})=>!1!==i[Nf]?ug(t,e,n):lg(t,e,n)))},Tg(e))),Og=(0,Yn.N)(e=>(0,ce.A)((t,n,i=null)=>{if(!n)return Hf;const r=e(fp).__experimentalGetAllowedPatterns(i),o=Array.isArray(n)?n:[n],s=r.filter(e=>e?.blockTypes?.some?.(e=>o.includes(e)));return 0===s.length?Hf:s},(t,n,i)=>Tg(e)(t,i))),Lg=(0,Yn.N)(e=>((0,Qt.A)('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',{alternative:'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',since:"6.2",version:"6.4"}),e(fp).getPatternsByBlockTypes)),Mg=(0,Yn.N)(e=>(0,ce.A)((t,n,i=null)=>{if(!n)return Hf;if(n.some(({clientId:e,innerBlocks:n})=>n.length||qg(t,e)))return Hf;const r=Array.from(new Set(n.map(({name:e})=>e)));return e(fp).getPatternsByBlockTypes(r,i)},(t,n,i)=>Tg(e)(t,i)));function Pg(e,t){return e.blockListSettings.get(t)}function Dg(e){return e.settings}function Fg(e){return e.blocks.isPersistentChange}var zg=(0,ce.A)((e,t=[])=>{const n={};for(const i of t){const t=Pg(e,i);t&&(n[i]=t)}return n},e=>[e.blockListSettings]),Vg=(0,Yn.N)(e=>(0,ce.A)((t,n)=>{(0,Qt.A)("wp.data.select( 'core/block-editor' ).__experimentalGetReusableBlockTitle",{since:"6.6",version:"6.8"});const i=Gh(e(fp)).getReusableBlocks().find(e=>e.id===n);return i?i.title?.raw:null},()=>[Gh(e(fp)).getReusableBlocks()]));function Ug(e){return e.blocks.isIgnoredChange}function $g(e){return e.lastBlockAttributesChange}function Hg(){return(0,Qt.A)('wp.data.select( "core/block-editor" ).hasBlockMovingClientId',{since:"6.7",hint:"Block moving mode feature has been removed"}),!1}function Wg(e){return!!e.automaticChangeStatus}function Gg(e,t){return e.highlightedBlock===t}function qg(e,t){return e.blocks.controlledInnerBlocks.has(t)}var Kg=(0,ce.A)((e,t)=>{if(!t.length)return null;const n=mm(e);if(t.includes(qf(e,n)))return n;const i=Im(e),r=vm(e,n||i[0],t);return r?r[r.length-1]:null},(e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]);function Yg(e,t,n){const{lastBlockInserted:i}=e;return i.clientIds?.includes(t)&&i.source===n}function Jg(e,t){return e.blockVisibility?.[t]??!0}function Xg(){(0,Qt.A)("wp.data.select( 'core/block-editor' ).getHoveredBlockClientId",{since:"6.9",version:"7.1"})}var Zg=(0,ce.A)(e=>{const t=new Set(Object.keys(e.blockVisibility).filter(t=>e.blockVisibility[t]));return 0===t.size?Wf:t},e=>[e.blockVisibility]);function Qg(e,t){if("default"!==tb(e,t))return!1;if(!gg(e,t))return!0;if(nf(e)){const n=tf(e);if(n){const i=Vm(e,n);if(i?.includes(t))return!0}else if(t&&!bm(e,t))return!0}return!_n(qf(e,t),"__experimentalDisableBlockOverlay",!1)&&qg(e,t)&&!$m(e,t)&&!Hm(e,t,!0)}function eb(e,t){let n=e.blocks.parents.get(t);for(;n;){if(Qg(e,n))return!0;n=e.blocks.parents.get(n)}return!1}function tb(e,t=""){return null===t&&(t=""),e.derivedBlockEditingModes?.has(t)?e.derivedBlockEditingModes.get(t):e.blocks.blockEditingModes.has(t)?e.blocks.blockEditingModes.get(t):"default"}var nb=(0,Yn.N)(e=>(t,n="")=>{const i=n||mm(t);if(!i)return!1;if(Xp(t,i))return!1;const{getGroupingBlockName:r}=e(Zi),o=Jf(t,i),s=r();return o&&(o.name===s||bn(o.name)?.transforms?.ungroup)&&!!o.innerBlocks.length&&hg(t,i)}),ib=(0,Yn.N)(e=>(t,n=Hf)=>{const{getGroupingBlockName:i}=e(Zi),r=i(),o=n?.length?n:Am(t),s=o?.length?bm(t,o[0]):void 0;return ug(t,r,s)&&o.length&&pg(t,o)}),rb=(e,t)=>((0,Qt.A)("wp.data.select( 'core/block-editor' ).__unstableGetContentLockingParent",{since:"6.1",version:"6.7"}),Kp(e,t));function ob(e){return(0,Qt.A)("wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingAsBlocks",{since:"6.1",version:"6.7"}),Zp(e)}var sb=["inserterMediaCategories","blockInspectorAnimation","mediaSideload"];function ab(e,{stripExperimentalSettings:t=!1,reset:n=!1}={}){let i=e;Object.hasOwn(i,"__unstableIsPreviewMode")&&((0,Qt.A)("__unstableIsPreviewMode argument in wp.data.dispatch('core/block-editor').updateSettings",{since:"6.8",alternative:"isPreviewMode"}),i={...i},i.isPreviewMode=i.__unstableIsPreviewMode,delete i.__unstableIsPreviewMode);let r=i;if(t&&"web"===Uo.A.OS){r={};for(const e in i)sb.includes(e)||(r[e]=i[e])}return{type:"UPDATE_SETTINGS",settings:r,reset:n}}function lb(){return{type:"HIDE_BLOCK_INTERFACE"}}function cb(){return{type:"SHOW_BLOCK_INTERFACE"}}var ub=(e,t=!0,n=!1)=>({select:i,dispatch:r,registry:o})=>{if(!e||!e.length)return;var s;if(s=e,e=Array.isArray(s)?s:[s],!i.canRemoveBlocks(e))return;const a=!n&&i.getBlockRemovalRules();if(a){let n=function(e){const t=[],n=[...e];for(;n.length;){const{innerBlocks:e,...i}=n.shift();n.push(...e),t.push(i)}return t};const o=n(e.map(i.getBlock));let s;for(const n of a)if(s=n.callback(o),s)return void r(hb(e,t,s))}t&&r.selectPreviousBlock(e[0],t),o.batch(()=>{r({type:"REMOVE_BLOCKS",clientIds:e}),r(db())})},db=()=>({select:e,dispatch:t})=>{if(e.getBlockCount()>0)return;const{__unstableHasCustomAppender:n}=e.getSettings();n||t.insertDefaultBlock()};function hb(e,t,n){return{type:"DISPLAY_BLOCK_REMOVAL_PROMPT",clientIds:e,selectPrevious:t,message:n}}function pb(){return{type:"CLEAR_BLOCK_REMOVAL_PROMPT"}}function fb(e=!1){return{type:"SET_BLOCK_REMOVAL_RULES",rules:e}}function mb(e,t){return{type:"SET_STYLE_OVERRIDE",id:e,style:t}}function gb(e){return{type:"DELETE_STYLE_OVERRIDE",id:e}}function bb(e=null){return{type:"LAST_FOCUS",lastFocus:e}}function yb(){return{type:"START_DRAGGING"}}function vb(){return{type:"STOP_DRAGGING"}}function _b(e){return{type:"SET_BLOCK_EXPANDED_IN_LIST_VIEW",clientId:e}}function xb(e){return{type:"SET_INSERTION_POINT",value:e}}function kb(e){return{type:"EDIT_CONTENT_ONLY_SECTION",clientId:e}}function wb(){return{type:"EDIT_CONTENT_ONLY_SECTION"}}var Cb=(e=100)=>({select:t,dispatch:n})=>{if(100!==e){const e=t.getBlockSelectionStart(),i=t.getSectionRootClientId();if(e){let r;if(i){const n=t.getBlockOrder(i);r=n?.includes(e)?e:t.getBlockParents(e).find(e=>n.includes(e))}else r=t.getBlockHierarchyRootClientId(e);r?n.selectBlock(r):n.clearSelectedBlock(),(0,dt.L)((0,ee.__)("You are currently in zoom-out mode."))}}n({type:"SET_ZOOM_LEVEL",zoom:e})};function Sb(){return{type:"RESET_ZOOM_LEVEL"}}function Ab(e,t){return{type:"TOGGLE_BLOCK_SPOTLIGHT",clientId:e,hasBlockSpotlight:t}}function Ib(){return{type:"OPEN_LIST_VIEW_CONTENT_PANEL"}}function Eb(){return{type:"CLOSE_LIST_VIEW_CONTENT_PANEL"}}function jb(e){return{type:"SHOW_VIEWPORT_MODAL",clientIds:e}}function Tb(){return{type:"HIDE_VIEWPORT_MODAL"}}function Bb(e,t={}){return{type:"REQUEST_INSPECTOR_TAB",tabName:e,options:t}}function Nb(){return{type:"CLEAR_REQUESTED_INSPECTOR_TAB"}}var Rb=n(62623),Ob=n(8878),Lb="†";function Mb(e){if(e)return Object.keys(e).find(t=>{const n=e[t];return("string"==typeof n||n instanceof He)&&-1!==n.toString().indexOf(Lb)})}function Pb(e){for(const[t,n]of Object.entries(e.attributes))if("rich-text"===n.source||"html"===n.source)return t}var Db=e=>Array.isArray(e)?e:[e],Fb=e=>({dispatch:t})=>{t({type:"RESET_BLOCKS",blocks:e}),t(zb(e))},zb=e=>({select:t,dispatch:n})=>{const i=t.getTemplate(),r=t.getTemplateLock(),o=!i||"all"!==r||Qs(e,i);if(o!==t.isValidTemplate())return n.setTemplateValidity(o),o};function Vb(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Ub(e){return(0,Qt.A)('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function $b(e,t,n={uniqueByBlock:!1}){return"boolean"==typeof n&&(n={uniqueByBlock:n}),{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:Db(e),attributes:t,options:n}}function Hb(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Wb(e,t=0){return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}function Gb(){return(0,Qt.A)('wp.data.dispatch( "core/block-editor" ).hoverBlock',{since:"6.9",version:"7.1"}),{type:"DO_NOTHING"}}var qb=(e,t=!1)=>({select:n,dispatch:i})=>{const r=n.getPreviousBlockClientId(e);if(r)i.selectBlock(r,-1);else if(t){const t=n.getBlockRootClientId(e);if(t)i.selectBlock(t,-1);else{const t=n.getNextBlockClientId(e);t&&i.selectBlock(t,0)}}},Kb=e=>({select:t,dispatch:n})=>{const i=t.getNextBlockClientId(e);i&&n.selectBlock(i)};function Yb(){return{type:"START_MULTI_SELECT"}}function Jb(){return{type:"STOP_MULTI_SELECT"}}var Xb=(e,t,n=0)=>({select:i,dispatch:r})=>{if(i.getBlockRootClientId(e)!==i.getBlockRootClientId(t))return;r({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const o=i.getSelectedBlockCount();(0,dt.L)((0,ee.sprintf)((0,ee._n)("%s block selected.","%s blocks selected.",o),o),"assertive")};function Zb(){return{type:"CLEAR_SELECTED_BLOCK"}}function Qb(e=!0){return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}var ey=(e,t,n,i=0,r)=>({select:o,dispatch:s,registry:a})=>{e=Db(e),t=Db(t);const l=o.getBlockRootClientId(e[0]);for(let e=0;e{s({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:i,meta:r}),s.ensureDefaultBlock()})};function ty(e,t){return ey(e,t)}var ny=e=>(t,n)=>({select:i,dispatch:r})=>{i.canMoveBlocks(t)&&r({type:e,clientIds:Db(t),rootClientId:n})},iy=ny("MOVE_BLOCKS_DOWN"),ry=ny("MOVE_BLOCKS_UP"),oy=(e,t="",n="",i)=>({select:r,dispatch:o})=>{if(r.canMoveBlocks(e)){if(t!==n){if(!r.canRemoveBlocks(e))return;if(!r.canInsertBlocks(e,n))return}o({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:i})}};function sy(e,t="",n="",i){return oy([e],t,n,i)}function ay(e,t,n,i,r,o){return ly([e],t,n,i,r,o)}var ly=(e,t,n,i=!0,r=0,o)=>({select:s,dispatch:a})=>{null!==r&&"object"==typeof r&&(o=r,r=0,(0,Qt.A)("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=Db(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:i,initialPosition:i?r:null,meta:o})};function cy(e,t,n={}){const{__unstableWithInserter:i,operation:r,nearestSide:o}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:i,operation:r,nearestSide:o}}var uy=()=>({select:e,dispatch:t})=>{e.isBlockInsertionPointVisible()&&t({type:"HIDE_INSERTION_POINT"})};function dy(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}var hy=()=>({select:e,dispatch:t})=>{t({type:"SYNCHRONIZE_TEMPLATE"});const n=na(e.getBlocks(),e.getTemplate());t.resetBlocks(n)},py=e=>({registry:t,select:n,dispatch:i})=>{const r=n.getSelectionStart(),o=n.getSelectionEnd();if(r.clientId===o.clientId)return;if(!r.attributeKey||!o.attributeKey||void 0===r.offset||void 0===o.offset)return!1;const s=n.getBlockRootClientId(r.clientId);if(s!==n.getBlockRootClientId(o.clientId))return;const a=n.getBlockOrder(s);let l,c;a.indexOf(r.clientId)>a.indexOf(o.clientId)?(l=o,c=r):(l=r,c=o);const u=e?c:l,d=n.getBlock(u.clientId),h=bn(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],y=g.attributes[f.attributeKey];let v=We({html:b}),_=We({html:y});v=at(v,p.offset,v.text.length),_=st(_,Lb,0,f.offset);const x=ir(m,{[p.attributeKey]:Be({value:v})}),k=ir(g,{[f.attributeKey]:Be({value:_})}),w=e?x:k,C=m.name===g.name?[w]:ur(w,h.name);if(!C||!C.length)return;let S;if(e){const e=C.pop();S=h.merge(e.attributes,k.attributes)}else{const e=C.shift();S=h.merge(x.attributes,e.attributes)}const A=Mb(S),I=We({html:S[A]}),E=I.text.indexOf(Lb),j=Be({value:at(I,E,E+1)});S[A]=j;const T=n.getSelectedBlockClientIds(),B=[...e?C:[],{...d,attributes:{...d.attributes,...S}},...e?[]:C];t.batch(()=>{i.selectionChange(d.clientId,A,E,E),i.replaceBlocks(T,B,0,n.getSelectedBlocksInitialCaretPosition())})},fy=(e=[])=>({registry:t,select:n,dispatch:i})=>{const r=n.getSelectionStart(),o=n.getSelectionEnd(),s=n.getBlockRootClientId(r.clientId),a=n.getBlockRootClientId(o.clientId);if(s!==a)return;const l=n.getBlockOrder(s);let c,u;l.indexOf(r.clientId)>l.indexOf(o.clientId)?(c=o,u=r):(c=r,u=o);const d=c,h=u,p=n.getBlock(d.clientId),f=n.getBlock(h.clientId),m=bn(p.name),g=bn(f.name),b="string"==typeof d.attributeKey?d.attributeKey:Pb(m),y="string"==typeof h.attributeKey?h.attributeKey:Pb(g),v=n.getBlockAttributes(d.clientId),_=v?.metadata?.bindings;if(_?.[b]){if(e.length){const{createWarningNotice:e}=t.dispatch(Rb.store);return void e((0,ee.__)("Blocks can't be inserted into other blocks with bindings"),{type:"snackbar"})}return void i.insertAfterBlock(d.clientId)}if(!b||!y||void 0===r.offset||void 0===o.offset)return;if(d.clientId===h.clientId&&b===y&&d.offset===h.offset)if(e.length){if(In(p,"content"))return void i.replaceBlocks([d.clientId],e,e.length-1,-1)}else if(!n.getBlockOrder(d.clientId).length){let e=function(){const e=gn();return n.canInsertBlockType(e,s)?er(e):er(n.getBlockName(d.clientId))};const t=v[b].length;if(0===d.offset&&t)return void i.insertBlocks([e()],n.getBlockIndex(d.clientId),s,!1);if(d.offset===t)return void i.insertBlocks([e()],n.getBlockIndex(d.clientId)+1,s)}const x=p.attributes[b],k=f.attributes[y];let w=We({html:x}),C=We({html:k});w=at(w,d.offset,w.text.length),C=at(C,0,h.offset);let S={...p,innerBlocks:p.clientId===f.clientId?[]:p.innerBlocks,attributes:{...p.attributes,[b]:Be({value:w})}},A={...f,clientId:p.clientId===f.clientId?er(f.name).clientId:f.clientId,attributes:{...f.attributes,[y]:Be({value:C})}};const I=gn();if(p.clientId===f.clientId&&I&&A.name!==I&&n.canInsertBlockType(I,s)){const e=ur(A,I);1===e?.length&&(A=e[0])}if(!e.length)return void i.replaceBlocks(n.getSelectedBlockClientIds(),[S,A]);let E;const j=[],T=[...e],B=T.shift(),N=bn(S.name),R=N.merge&&B.name===N.name?[B]:ur(B,N.name);if(R?.length){const e=R.shift();S={...S,attributes:{...S.attributes,...N.merge(S.attributes,e.attributes)}},j.push(S),E={clientId:S.clientId,attributeKey:b,offset:We({html:S.attributes[b]}).text.length},T.unshift(...R)}else An(S)||j.push(S),j.push(B);const O=T.pop(),L=bn(A.name);if(T.length&&j.push(...T),O){const e=L.merge&&L.name===O.name?[O]:ur(O,L.name);if(e?.length){const t=e.pop();j.push({...A,attributes:{...A.attributes,...L.merge(t.attributes,A.attributes)}}),j.push(...e),E={clientId:A.clientId,attributeKey:y,offset:We({html:t.attributes[y]}).text.length}}else j.push(O),An(A)||j.push(A)}else An(A)||j.push(A);t.batch(()=>{i.replaceBlocks(n.getSelectedBlockClientIds(),j,j.length-1,0),E&&i.selectionChange(E.clientId,E.attributeKey,E.offset,E.offset)})},my=()=>({select:e,dispatch:t})=>{const n=e.getSelectionStart(),i=e.getSelectionEnd();t.selectionChange({start:{clientId:n.clientId},end:{clientId:i.clientId}})},gy=(e,t)=>({registry:n,select:i,dispatch:r})=>{const o=e,s=t,a=i.getBlock(o),l=bn(a.name);if(!l||"disabled"===i.getBlockEditingMode(o)||"disabled"===i.getBlockEditingMode(s))return;const c=i.getBlock(s);if(!l.merge&&vn(a.name,"__experimentalOnMerge")){const e=ur(c,l.name);if(1!==e?.length)return void r.selectBlock(a.clientId);const[t]=e;return t.innerBlocks.length<1?void r.selectBlock(a.clientId):void n.batch(()=>{r.insertBlocks(t.innerBlocks,void 0,o),r.removeBlock(s),r.selectBlock(t.innerBlocks[0].clientId);const e=i.getNextBlockClientId(o);if(e&&i.getBlockName(o)===i.getBlockName(e)){const t=i.getBlockAttributes(o),n=i.getBlockAttributes(e);Object.keys(t).every(e=>t[e]===n[e])&&(r.moveBlocksToPosition(i.getBlockOrder(e),e,o),r.removeBlock(e,!1))}})}if(In(a))return void r.removeBlock(o,i.isBlockSelected(o));if(In(c))return void r.removeBlock(s,i.isBlockSelected(s));if(!l.merge)return void(An(c,"content")?r.removeBlock(s,i.isBlockSelected(s)):r.selectBlock(a.clientId));const u=bn(c.name),{clientId:d,attributeKey:h,offset:p}=i.getSelectionStart(),f=(d===o?l:u).attributes[h],m=(d===o||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=ir(a),b=ir(c);if(m){const e=d===o?g:b,t=st(We({html:e.attributes[h]}),Lb,p,p);e.attributes[h]=Be({value:t})}const y=a.name===c.name?[b]:ur(b,a.name);if(!y||!y.length)return;const v=l.merge(g.attributes,y[0].attributes);if(m){const e=Mb(v),t=We({html:v[e]}),n=t.text.indexOf(Lb),i=Be({value:at(t,n,n+1)});v[e]=i,r.selectionChange(a.clientId,e,n,n)}r.replaceBlocks([a.clientId,c.clientId],[{...a,attributes:{...a.attributes,...v}},...y.slice(1)],0)},by=(e,t=!0)=>ub(e,t);function yy(e,t){return by([e],t)}function vy(e,t,n=!1,i=0){return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?i:null,time:Date.now()}}function _y(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function xy(){return{type:"START_TYPING"}}function ky(){return{type:"STOP_TYPING"}}function wy(e=[]){return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Cy(){return{type:"STOP_DRAGGING_BLOCKS"}}function Sy(){return(0,Qt.A)('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Ay(){return(0,Qt.A)('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Iy(e,t,n,i){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:i}:{type:"SELECTION_CHANGE",...e}}var Ey=(e,t,n)=>({dispatch:i})=>{const r=gn();if(!r)return;const o=er(r,e);return i.insertBlock(o,n,t)};function jy(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function Ty(e){return ab(e,{stripExperimentalSettings:!0})}function By(){return(0,Qt.A)('wp.data.dispatch( "core/block-editor" ).__unstableSaveReusableBlock',{since:"7.1"}),{type:"DO_NOTHING"}}function Ny(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Ry(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}var Oy=()=>({dispatch:e})=>{e({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:t=e=>setTimeout(e,100)}=window;t(()=>{e({type:"MARK_AUTOMATIC_CHANGE_FINAL"})})},Ly=e=>({registry:t})=>{t.dispatch(Ob.M).set("core","editorTool",e),"navigation"===e?(0,dt.L)((0,ee.__)("You are currently in Write mode.")):"edit"===e&&(0,dt.L)((0,ee.__)("You are currently in Design mode."))};function My(){return(0,Qt.A)('wp.data.dispatch( "core/block-editor" ).setBlockMovingClientId',{since:"6.7",hint:"Block moving mode feature has been removed"}),{type:"DO_NOTHING"}}var Py=(e,t=!0)=>({select:n,dispatch:i})=>{if(!e||!e.length)return;const r=n.getBlocksByClientId(e);if(r.some(e=>!e))return;if(r.map(e=>e.name).some(e=>!_n(e,"multiple",!0)))return;const o=n.getBlockRootClientId(e[0]),s=Db(e),a=n.getBlockIndex(s[s.length-1]),l=r.map(e=>nr(e));return i.insertBlocks(l,a+1,o,t),l.length>1&&t&&i.multiSelect(l[0].clientId,l[l.length-1].clientId),l.map(e=>e.clientId)},Dy=e=>({select:t,dispatch:n})=>{if(!e)return;const i=t.getBlockRootClientId(e),r=t.getBlockIndex(e),o=i?t.getDirectInsertBlock(i):null;if(!o)return n.insertDefaultBlock({},i,r);const s={};if(o.attributesToCopy){const n=t.getBlockAttributes(e);o.attributesToCopy.forEach(e=>{n[e]&&(s[e]=n[e])})}const a=er(o.name,{...o.attributes,...s});return n.insertBlock(a,r,i)},Fy=e=>({select:t,dispatch:n})=>{if(!e)return;const i=t.getBlockRootClientId(e),r=t.getBlockIndex(e),o=i?t.getDirectInsertBlock(i):null;if(!o)return n.insertDefaultBlock({},i,r+1);const s={};if(o.attributesToCopy){const n=t.getBlockAttributes(e);o.attributesToCopy.forEach(e=>{n[e]&&(s[e]=n[e])})}const a=er(o.name,{...o.attributes,...s});return n.insertBlock(a,r+1,i)};function zy(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}var Vy=(e,t=150)=>async({dispatch:n})=>{n(zy(e,!0)),await new Promise(e=>setTimeout(e,t)),n(zy(e,!1))};function Uy(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function $y(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function Hy(e){return(0,Qt.A)("wp.data.dispatch( 'core/block-editor' ).__unstableSetTemporarilyEditingAsBlocks",{since:"7.0"}),kb(e)}var Wy=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 i=t.getRegisteredInserterMediaCategories();i.some(({name:t})=>t===e.name)?console.error(`A category is already registered with the same name: "${e.name}".`):i.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 Gy(e="",t){return{type:"SET_BLOCK_EDITING_MODE",clientId:e,mode:t}}function qy(e=""){return{type:"UNSET_BLOCK_EDITING_MODE",clientId:e}}function Ky(e){return{type:"SET_OPEN_LIST_VIEW_PANEL",clientId:e}}function Yy(){return{type:"SET_ALL_LIST_VIEW_PANELS_OPEN"}}function Jy(e,t){return{type:"TOGGLE_LIST_VIEW_PANEL",clientId:e,isOpen:t}}function Xy(){return{type:"INCREMENT_LIST_VIEW_EXPAND_REVISION"}}var Zy={reducer:hp,selectors:u,actions:h},Qy=(0,P.A)(fp,{...Zy,persist:["preferences"]}),ev=(0,D.registerStore)(fp,{...Zy,persist:["preferences"]});function tv(...e){const{clientId:t=null}=Ih();return(0,zt.A)(n=>Gh(n(Qy)).getBlockSettings(t,...e),[t,...e])}function nv(e,t,n){const{supportedStyles:i,supports:r}=(0,zt.A)(e=>({supportedStyles:Gh(e(Zi)).getSupportedStyles(t,n),supports:e(Zi).getBlockType(t)?.supports}),[t,n]);return(0,T.useMemo)(()=>{const t={...e};return i.includes("fontSize")||(t.typography={...t.typography,fontSizes:{},customFontSize:!1,defaultFontSizes:!1}),i.includes("fontFamily")||(t.typography={...t.typography,fontFamilies:{}}),t.color={...t.color,text:t.color?.text&&i.includes("color"),background:t.color?.background&&(i.includes("background")||i.includes("backgroundColor")),button:t.color?.button&&i.includes("buttonColor"),heading:t.color?.heading&&i.includes("headingColor"),link:t.color?.link&&i.includes("linkColor"),caption:t.color?.caption&&i.includes("captionColor")},i.includes("background")||i.includes("backgroundGradient")||(t.color.gradients=[],t.color.customGradient=!1),i.includes("filter")||(t.color.defaultDuotone=!1,t.color.customDuotone=!1),["lineHeight","fontStyle","fontWeight","letterSpacing","textAlign","textTransform","textDecoration","textIndent","writingMode"].forEach(e=>{i.includes(e)||(t.typography={...t.typography,[e]:!1})}),i.includes("textIndent")&&(t.typography={...t.typography,textIndent:t.typography?.textIndent??"subsequent"}),i.includes("columnCount")||(t.typography={...t.typography,textColumns:!1}),["contentSize","wideSize"].forEach(e=>{i.includes(e)||(t.layout={...t.layout,[e]:!1})}),["padding","margin","blockGap"].forEach(e=>{i.includes(e)||(t.spacing={...t.spacing,[e]:!1});const n=Array.isArray(r?.spacing?.[e])?r?.spacing?.[e]:r?.spacing?.[e]?.sides;n?.length&&t.spacing?.[e]&&(t.spacing={...t.spacing,[e]:{...t.spacing?.[e],sides:n}})}),["aspectRatio","height","minHeight","width"].forEach(e=>{i.includes(e)||(t.dimensions={...t.dimensions,[e]:!1})}),["radius","color","style","width"].forEach(e=>{i.includes("border"+e.charAt(0).toUpperCase()+e.slice(1))||(t.border={...t.border,[e]:!1})}),[["backgroundImage","backgroundImage"],["backgroundSize","backgroundSize"],["backgroundGradient","gradient"]].forEach(([e,n])=>{i.includes(e)||(t.background={...t.background,[n]:!1})}),t.shadow=!!i.includes("shadow")&&t.shadow,t},[e,i,r])}function iv(e){const t=e?.color?.palette?.custom,n=e?.color?.palette?.theme,i=e?.color?.palette?.default,r=e?.color?.defaultPalette;return(0,T.useMemo)(()=>{const e=[];return n&&n.length&&e.push({name:(0,ee._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&i&&i.length&&e.push({name:(0,ee._x)("Default","Indicates this palette comes from WordPress."),colors:i}),t&&t.length&&e.push({name:(0,ee._x)("Custom","Indicates this palette is created by the user."),colors:t}),e},[t,n,i,r])}function rv(e){const t=e?.color?.gradients?.custom,n=e?.color?.gradients?.theme,i=e?.color?.gradients?.default,r=e?.color?.defaultGradients;return(0,T.useMemo)(()=>{const e=[];return n&&n.length&&e.push({name:(0,ee._x)("Theme","Indicates this palette comes from the theme."),gradients:n}),r&&i&&i.length&&e.push({name:(0,ee._x)("Default","Indicates this palette comes from WordPress."),gradients:i}),t&&t.length&&e.push({name:(0,ee._x)("Custom","Indicates this palette is created by the user."),gradients:t}),e},[t,n,i,r])}Gh(ev).registerPrivateActions(d),Gh(ev).registerPrivateSelectors(c),Gh(Qy).registerPrivateActions(d),Gh(Qy).registerPrivateSelectors(c);var ov=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.entries(e).map(([e,t])=>[e,ov(t)]).filter(([,e])=>void 0!==e);return t.length?Object.fromEntries(t):void 0};function sv(e,t,n,i,r,o){if(Object.values(e??{}).every(e=>!e))return n;if(1===o.length&&n.innerBlocks.length===i.length)return n;let s=i[0]?.attributes;if(o.length>1&&i.length>1){if(!i[r])return n;s=i[r]?.attributes}let a=n;return Object.entries(e).forEach(([e,n])=>{n&&t[e].forEach(e=>{const t=xp(s,e);t&&(a={...a,attributes:_p(a.attributes,e,t)})})}),a}function av(e,t,n){const i=vn(e,t),r=i?.__experimentalSkipSerialization;return Array.isArray(r)?r.includes(n):r}var lv=new WeakMap;function cv({id:e,css:t}){return uv({id:e,css:t})}function uv({id:e,css:t,assets:n,__unstableType:i,variation:r,clientId:o}={}){const{setStyleOverride:s,deleteStyleOverride:a}=Gh((0,Vt.A)(Qy)),l=(0,yt.A)(),c=(0,T.useId)();(0,T.useEffect)(()=>{if(!t&&!n)return;const u=e||c,d={id:e,css:t,assets:n,__unstableType:i,variation:r,clientId:o};return lv.get(l)||lv.set(l,[]),lv.get(l).push([u,d]),window.queueMicrotask(()=>{lv.get(l)?.length&&l.batch(()=>{lv.get(l).forEach(e=>{s(...e)}),lv.set(l,[])})}),()=>{const e=lv.get(l)?.find(([e])=>e===u);e?lv.set(l,lv.get(l).filter(([e])=>e!==u)):a(u)}},[e,t,o,n,i,c,s,a,l,r])}function dv(e,t){const[n,i,r,o,s,a,l,c,u,d,h,p,f,m,g,b,y,v,_,x,k,w,C,S,A,I,E,j,B,N,R,O,L,M,P,D,F,z,V,U,$,H,W,G,q,K,Y,J,X,Z,Q,ee,te,ne,ie,re,oe,se,ae,le,ce,ue]=tv("background.backgroundImage","background.backgroundSize","background.gradient","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.textIndent","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.height","dimensions.minHeight","dimensions.width","dimensions.dimensionSizes","layout","border.color","border.radius","border.style","border.width","border.radiusSizes","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 nv((0,T.useMemo)(()=>({background:{backgroundImage:n,backgroundSize:i,gradient:r},color:{palette:{custom:W,theme:q,default:K},gradients:{custom:ee,theme:te,default:ne},duotone:{custom:X,theme:Z,default:Q},defaultGradients:ie,defaultPalette:Y,defaultDuotone:J,custom:H,customGradient:re,customDuotone:G,background:oe,link:se,heading:le,button:ce,text:ae},typography:{fontFamilies:{custom:o,default:s,theme:a},fontSizes:{custom:c,default:u,theme:d},customFontSize:h,defaultFontSizes:l,fontStyle:p,fontWeight:f,lineHeight:m,textAlign:g,textColumns:b,textDecoration:y,textIndent:v,textTransform:x,letterSpacing:k,writingMode:_},spacing:{spacingSizes:{custom:E,default:j,theme:B},customSpacingSize:I,defaultSpacingSizes:A,padding:w,margin:C,blockGap:S,units:N},border:{color:F,radius:z,style:V,width:U,radiusSizes:$},dimensions:{aspectRatio:R,height:O,minHeight:L,width:M,dimensionSizes:P},layout:D,parentLayout:t,shadow:ue}),[n,i,r,o,s,a,l,c,u,d,h,p,f,m,g,b,y,v,x,k,_,w,C,S,A,I,E,j,B,N,R,O,L,M,P,D,t,F,z,V,U,$,H,W,G,q,K,Y,J,X,Z,Q,ee,te,ne,ie,re,oe,se,ae,le,ce,ue]),e)}var hv=(0,T.memo)(function({index:e,useBlockProps:t,setAllWrapperProps:n,...i}){const r=t(i),o=t=>n(n=>{const i=[...n];return i[e]=t,i});return(0,T.useEffect)(()=>(o(r),()=>{o(void 0)})),null});function pv(e){e.hasAttribute("crossorigin")||e.setAttribute("crossorigin","anonymous")}if((0,Ei.U2)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",function(e){const{apiVersion:t=1}=e;return t<2&&_n(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}),window.crossOriginIsolated){let e=function(){document.body?t.observe(document.body,{childList:!0,attributes:!0,subtree:!0}):"loading"===document.readyState&&document.addEventListener("DOMContentLoaded",()=>{document.body&&t.observe(document.body,{childList:!0,attributes:!0,subtree:!0})})};const t=new window.MutationObserver(e=>{e.forEach(e=>{[e.addedNodes,e.target].forEach(e=>{(e instanceof window.NodeList?e:[e]).forEach(e=>{const t=e;t.querySelectorAll&&(t.querySelectorAll("source,script,video,link").forEach(e=>{pv(e)}),["SOURCE","SCRIPT","VIDEO","LINK"].includes(t.nodeName)&&pv(t))})})})});e()}var fv=n(69611),mv=n(60728),gv=n(7020),bv=({children:e,className:t})=>(0,Er.jsx)("div",{className:t,children:e}),yv=(0,T.forwardRef)(function(e,t){const{children:n,className:i,containerClassName:r,extraProps:o,isActive:s,title:a,...l}=function({isDisabled:e,...t}){return{disabled:e,...t}}(e);return(0,T.useContext)(gv.A)?(0,Er.jsx)(mv.A,{className:(0,mh.A)("components-toolbar-button",i),...o,...l,ref:t,children:e=>(0,Er.jsx)(fv.Ay,{size:"compact",label:a,isPressed:s,...e,children:n})}):(0,Er.jsx)(bv,{className:r,children:(0,Er.jsx)(fv.Ay,{ref:t,icon:l.icon,size:"compact",label:a,shortcut:l.shortcut,"data-subscript":l.subscript,onClick:e=>{e.stopPropagation(),l.onClick&&l.onClick(e)},className:(0,mh.A)("components-toolbar__control",i),isPressed:s,accessibleWhenDisabled:!0,"data-toolbar-item":!0,...o,...l,children:n})})});yv.displayName="ToolbarButton";var vv=yv,_v=({className:e,children:t,...n})=>(0,Er.jsx)("div",{className:e,...n,children:t}),xv=n(90194),kv=function({controls:e=[],toggleProps:t,...n}){const i=t=>(0,Er.jsx)(xv.A,{controls:e,toggleProps:{...t,"data-toolbar-item":!0},...n});return(0,T.useContext)(gv.A)?(0,Er.jsx)(mv.A,{...t,children:i}):i(t)},wv=function({controls:e=[],children:t,className:n,isCollapsed:i,title:r,...o}){const s=(0,T.useContext)(gv.A);if(!(e&&e.length||t))return null;const a=(0,mh.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],i?(0,Er.jsx)(kv,{label:r,controls:l,className:a,children:t,...o}):(0,Er.jsxs)(_v,{className:a,...o,children:[l?.flatMap((e,t)=>e.map((e,n)=>(0,Er.jsx)(vv,{containerClassName:t>0&&0===n?"has-left-divider":void 0,...e},[t,n].join()))),t]})},Cv=n(97800),Sv=n(91923),Av={default:(0,Sv.QJ)("BlockControls"),block:(0,Sv.QJ)("BlockControlsBlock"),inline:(0,Sv.QJ)("BlockFormatControls"),other:(0,Sv.QJ)("BlockControlsOther"),parent:(0,Sv.QJ)("BlockControlsParent")};function Iv({group:e="default",controls:t,children:n,__experimentalShareWithChildBlocks:i=!1}){const r=function(e,t){const n=Ih();return n[bh]?Av[e]?.Fill:n[yh]&&t?Av.parent.Fill:null}(e,i);if(!r)return null;const o=(0,Er.jsxs)(Er.Fragment,{children:["default"===e&&(0,Er.jsx)(wv,{controls:t}),n]});return(0,Er.jsx)(Cv.A,{document,children:(0,Er.jsx)(r,{children:e=>{const{forwardedContext:t=[]}=e;return t.reduce((e,[t,n])=>(0,Er.jsx)(t,{...n,children:e}),o)}})})}var Ev=n(50744),jv=n(18204);function Tv(e){return e?.length}function Bv(e){const t=function(e,t,n){const i=(0,T.useMemo)(()=>n=>e.subscribe(t,n),[e,t]),r=()=>n(e.get(t));return(0,T.useSyncExternalStore)(i,r,r)}((0,T.useContext)(jv.A).fills,e,Tv);return(0,T.useMemo)(()=>void 0!==t?Array.from({length:t}):void 0,[t])}var{ComponentsContext:Nv}=Gh(Ev.j);function Rv({group:e="default",...t}){const n=(0,T.useContext)(gv.A),i=(0,T.useContext)(Nv),r=(0,T.useMemo)(()=>({forwardedContext:[[gv.A.Provider,{value:n}],[Nv.Provider,{value:i}]]}),[n,i]),o=Av[e],s=Bv(o.name);if(!o)return(0,sn.A)(`Unknown BlockControls group "${e}" provided.`),null;if(!s?.length)return null;const{Slot:a}=o,l=(0,Er.jsx)(a,{...t,bubblesVirtually:!0,fillProps:r});return"default"===e?l:(0,Er.jsx)(wv,{children:l})}var Ov=Iv;Ov.Slot=Rv;var Lv=e=>(0,Er.jsx)(Iv,{group:"inline",...e});Lv.Slot=function(e){return(0,Er.jsx)(Rv,{group:"inline",...e})};var Mv=Ov,Pv=(0,T.forwardRef)(function(e,t){return(0,T.useContext)(gv.A)?(0,Er.jsx)(mv.A,{ref:t,...e.toggleProps,children:t=>(0,Er.jsx)(xv.A,{...e,popoverProps:{...e.popoverProps},toggleProps:t})}):(0,Er.jsx)(xv.A,{...e})});Pv.displayName="ToolbarDropdownMenu";var Dv=Pv,Fv=n(81692),zv=n(95776),Vv=n(67471),Uv=n(11447),$v=n(11866),Hv=n(65541),Wv=n(31311),Gv=n(75013),qv=n(47853),Kv=n(37059),Yv=n(64929),Jv=n(80577),Xv=n(82557),Zv=n(46683),Qv={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 e_(e,t=""){return e.split(",").map(e=>`${e}${t?` ${t}`:""}`).join(",")}function t_(e,t=Qv,n,i){let r="";return t?.[n]?.spacingStyles?.length&&i&&t[n].spacingStyles.forEach(t=>{r+=`${e_(e,t.selector.trim())} { `,r+=Object.entries(t.rules).map(([e,t])=>`${e}: ${t||i}`).join("; "),r+="; }"}),r}function n_(e){const{contentSize:t,wideSize:n,type:i="default"}=e,r={},o=/^(?!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 o.test(t)&&"constrained"===i&&(r.none=(0,ee.sprintf)((0,ee.__)("Max %s wide"),t)),o.test(n)&&(r.wide=(0,ee.sprintf)((0,ee.__)("Max %s wide"),n)),r}var i_=n(3713),r_=n(35656),o_=n(27346),s_=n(16645),a_=n(87090),l_=n(28473),c_=n(28199),u_=["top","bottom","left","right"],d_={top:void 0,right:void 0,bottom:void 0,left:void 0},h_={custom:i_.A,axial:i_.A,horizontal:r_.A,vertical:o_.A,top:s_.A,right:a_.A,bottom:l_.A,left:c_.A},p_={default:(0,ee.__)("Spacing control"),top:(0,ee.__)("Top"),bottom:(0,ee.__)("Bottom"),left:(0,ee.__)("Left"),right:(0,ee.__)("Right"),mixed:(0,ee.__)("Mixed"),vertical:(0,ee.__)("Vertical"),horizontal:(0,ee.__)("Horizontal"),axial:(0,ee.__)("Horizontal & vertical"),custom:(0,ee.__)("Custom")},f_="axial",m_="custom";function g_(e,t){if(!e||function(e){return!!e?.includes&&("0"===e||e.includes("var:preset|spacing|"))}(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 b_(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function y_(e,t){if(!e||!e.length)return!1;const n=e.includes("horizontal")||e.includes("left")&&e.includes("right"),i=e.includes("vertical")||e.includes("top")&&e.includes("bottom");return"horizontal"===t?n:"vertical"===t?i:n||i}function v_(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 i=b_(n?.top)||t,r=b_(n?.left)||t;return i===r?i:`${i} ${r}`}var __=n(27837),x_=n(86350),k_=n(4353),w_=n(21670),C_=n(73636),S_={top:{icon:__.A,title:(0,ee._x)("Align top","Block vertical alignment setting")},center:{icon:x_.A,title:(0,ee._x)("Align middle","Block vertical alignment setting")},bottom:{icon:k_.A,title:(0,ee._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:w_.A,title:(0,ee._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:C_.A,title:(0,ee._x)("Space between","Block vertical alignment setting")}},A_=["top","center","bottom"],I_=function({value:e,onChange:t,controls:n=A_,isCollapsed:i=!0,isToolbar:r}){const o=S_[e],s=S_.top,a=r?wv:Dv,l=r?{isCollapsed:i}:{};return(0,Er.jsx)(a,{icon:o?o.icon:s.icon,label:(0,ee._x)("Change vertical alignment","Block vertical alignment setting label"),controls:n.map(n=>{return{...S_[n],isActive:e===n,role:i?"menuitemradio":void 0,onClick:(r=n,()=>t(e===r?void 0:r))};var r}),...l})},E_=e=>(0,Er.jsx)(I_,{...e,isToolbar:!1}),j_=e=>(0,Er.jsx)(I_,{...e,isToolbar:!0}),T_={left:Vv.A,center:Uv.A,right:$v.A,"space-between":Hv.A,stretch:Wv.A},B_=function({allowedControls:e=["left","center","right","space-between"],isCollapsed:t=!0,onChange:n,value:i,popoverProps:r,isToolbar:o}){const s=e=>{n(e===i?void 0:e)},a=i?T_[i]:T_.left,l=[{name:"left",icon:Vv.A,title:(0,ee.__)("Justify items left"),isActive:"left"===i,onClick:()=>s("left")},{name:"center",icon:Uv.A,title:(0,ee.__)("Justify items center"),isActive:"center"===i,onClick:()=>s("center")},{name:"right",icon:$v.A,title:(0,ee.__)("Justify items right"),isActive:"right"===i,onClick:()=>s("right")},{name:"space-between",icon:Hv.A,title:(0,ee.__)("Space between items"),isActive:"space-between"===i,onClick:()=>s("space-between")},{name:"stretch",icon:Wv.A,title:(0,ee.__)("Stretch items"),isActive:"stretch"===i,onClick:()=>s("stretch")}],c=o?wv:Dv,u=o?{isCollapsed:t}:{};return(0,Er.jsx)(c,{icon:a,popoverProps:r,label:(0,ee.__)("Change items justification"),controls:l.filter(t=>e.includes(t.name)),...u})},N_=e=>(0,Er.jsx)(B_,{...e,isToolbar:!1}),R_={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},O_={left:"flex-start",right:"flex-end",center:"center",stretch:"stretch"},L_={top:"flex-start",center:"center",bottom:"flex-end",stretch:"stretch","space-between":"space-between"},M_=["wrap","nowrap"],P_={name:"flex",label:(0,ee.__)("Flex"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowOrientation:i=!0,allowJustification:r=!0,allowWrap:o=!0}=n;return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsxs)(Kv.A,{children:[r&&(0,Er.jsx)(Yv.A,{children:(0,Er.jsx)(z_,{layout:e,onChange:t})}),i&&(0,Er.jsx)(Yv.A,{children:(0,Er.jsx)(U_,{layout:e,onChange:t})})]}),o&&(0,Er.jsx)(V_,{layout:e,onChange:t})]})},toolBarControls:function({layout:e={},onChange:t,layoutBlockSupport:n}){const{allowVerticalAlignment:i=!0,allowJustification:r=!0}=n;return r||i?(0,Er.jsxs)(Mv,{group:"block",__experimentalShareWithChildBlocks:!0,children:[r&&(0,Er.jsx)(z_,{layout:e,onChange:t,isToolbar:!0}),i&&(0,Er.jsx)(D_,{layout:e,onChange:t})]}):null},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:i,hasBlockGapSupport:r,globalBlockGapValue:o,layoutDefinitions:s=Qv}){const{orientation:a="horizontal"}=t;let l="0.5em";if(o){const e=v_(o,"0.5em").split(" ");l=e.length>1?e[1]:e[0]}const c=n?.spacing?.blockGap&&!av(i,"spacing","blockGap")?v_(n?.spacing?.blockGap,l):void 0,u=R_[t.justifyContent],d=M_.includes(t.flexWrap)?t.flexWrap:"wrap",h=L_[t.verticalAlignment],p=O_[t.justifyContent]||O_.left;let f="";const m=[];return d&&"wrap"!==d&&m.push(`flex-wrap: ${d}`),"horizontal"===a?(h&&m.push(`align-items: ${h}`),u&&m.push(`justify-content: ${u}`)):(h&&m.push(`justify-content: ${h}`),m.push("flex-direction: column"),m.push(`align-items: ${p}`)),m.length&&(f=`${e_(e)} {\n\t\t\t\t${m.join("; ")};\n\t\t\t}`),r&&c&&(f+=t_(e,s,"flex",c)),f},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function D_({layout:e,onChange:t}){const{orientation:n="horizontal"}=e,i="horizontal"===n?"center":"top",{verticalAlignment:r=i}=e;return(0,Er.jsx)(E_,{onChange:n=>{t({...e,verticalAlignment:n})},value:r,controls:"horizontal"===n?["top","center","bottom","stretch"]:["top","center","bottom","space-between"]})}var F_={placement:"bottom-start"};function z_({layout:e,onChange:t,isToolbar:n=!1}){const{justifyContent:i="left",orientation:r="horizontal"}=e,o=n=>{t({...e,justifyContent:n})},s=["left","center","right"];if("horizontal"===r?s.push("space-between"):s.push("stretch"),n)return(0,Er.jsx)(N_,{allowedControls:s,value:i,onChange:o,popoverProps:F_});const a=[{value:"left",icon:Vv.A,label:(0,ee.__)("Justify items left")},{value:"center",icon:Uv.A,label:(0,ee.__)("Justify items center")},{value:"right",icon:$v.A,label:(0,ee.__)("Justify items right")}];return"horizontal"===r?a.push({value:"space-between",icon:Hv.A,label:(0,ee.__)("Space between items")}):a.push({value:"stretch",icon:Wv.A,label:(0,ee.__)("Stretch items")}),(0,Er.jsx)(Jv.A,{__next40pxDefaultSize:!0,label:(0,ee.__)("Justification"),value:i,onChange:o,className:"block-editor-hooks__flex-layout-justification-controls",children:a.map(({value:e,icon:t,label:n})=>(0,Er.jsx)(Xv.A,{value:e,icon:t,label:n},e))})}function V_({layout:e,onChange:t}){const{flexWrap:n="wrap"}=e;return(0,Er.jsx)(Zv.A,{label:(0,ee.__)("Allow to wrap to multiple lines"),onChange:n=>{t({...e,flexWrap:n?"wrap":"nowrap"})},checked:"wrap"===n})}function U_({layout:e,onChange:t}){const{orientation:n="horizontal",verticalAlignment:i,justifyContent:r}=e;return(0,Er.jsxs)(Jv.A,{__next40pxDefaultSize:!0,className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,ee.__)("Orientation"),value:n,onChange:n=>{let o=i,s=r;return"horizontal"===n?("space-between"===i&&(o="center"),"stretch"===r&&(s="left")):("stretch"===i&&(o="top"),"space-between"===r&&(s="left")),t({...e,orientation:n,verticalAlignment:o,justifyContent:s})},children:[(0,Er.jsx)(Xv.A,{icon:Gv.A,value:"horizontal",label:(0,ee.__)("Horizontal")}),(0,Er.jsx)(Xv.A,{icon:qv.A,value:"vertical",label:(0,ee.__)("Vertical")})]})}var $_={name:"default",label:(0,ee.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,style:t,blockName:n,hasBlockGapSupport:i,layoutDefinitions:r=Qv}){const o=v_(t?.spacing?.blockGap);let s="";av(n,"spacing","blockGap")||(o?.top?s=v_(o?.top):"string"==typeof o&&(s=v_(o)));let a="";return i&&s&&(a+=t_(e,r,"default",s)),a},getOrientation:()=>"vertical",getAlignments(e,t){const n=n_(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 i=[{name:"left"},{name:"center"},{name:"right"}];if(!t){const{contentSize:t,wideSize:r}=e;t&&i.unshift({name:"full"}),r&&i.unshift({name:"wide",info:n.wide})}return i.unshift({name:"none",info:n.none}),i}},H_="web"===Uo.A.OS,W_={px:{value:"px",label:H_?"px":(0,ee.__)("Pixels (px)"),a11yLabel:(0,ee.__)("Pixels (px)"),step:1},"%":{value:"%",label:H_?"%":(0,ee.__)("Percentage (%)"),a11yLabel:(0,ee.__)("Percent (%)"),step:.1},em:{value:"em",label:H_?"em":(0,ee.__)("Relative to parent font size (em)"),a11yLabel:(0,ee._x)("ems","Relative to parent font size (em)"),step:.01},rem:{value:"rem",label:H_?"rem":(0,ee.__)("Relative to root font size (rem)"),a11yLabel:(0,ee._x)("rems","Relative to root font size (rem)"),step:.01},vw:{value:"vw",label:H_?"vw":(0,ee.__)("Viewport width (vw)"),a11yLabel:(0,ee.__)("Viewport width (vw)"),step:.1},vh:{value:"vh",label:H_?"vh":(0,ee.__)("Viewport height (vh)"),a11yLabel:(0,ee.__)("Viewport height (vh)"),step:.1},vmin:{value:"vmin",label:H_?"vmin":(0,ee.__)("Viewport smallest dimension (vmin)"),a11yLabel:(0,ee.__)("Viewport smallest dimension (vmin)"),step:.1},vmax:{value:"vmax",label:H_?"vmax":(0,ee.__)("Viewport largest dimension (vmax)"),a11yLabel:(0,ee.__)("Viewport largest dimension (vmax)"),step:.1},ch:{value:"ch",label:H_?"ch":(0,ee.__)("Width of the zero (0) character (ch)"),a11yLabel:(0,ee.__)("Width of the zero (0) character (ch)"),step:.01},ex:{value:"ex",label:H_?"ex":(0,ee.__)("x-height of the font (ex)"),a11yLabel:(0,ee.__)("x-height of the font (ex)"),step:.01},cm:{value:"cm",label:H_?"cm":(0,ee.__)("Centimeters (cm)"),a11yLabel:(0,ee.__)("Centimeters (cm)"),step:.001},mm:{value:"mm",label:H_?"mm":(0,ee.__)("Millimeters (mm)"),a11yLabel:(0,ee.__)("Millimeters (mm)"),step:.1},in:{value:"in",label:H_?"in":(0,ee.__)("Inches (in)"),a11yLabel:(0,ee.__)("Inches (in)"),step:.001},pc:{value:"pc",label:H_?"pc":(0,ee.__)("Picas (pc)"),a11yLabel:(0,ee.__)("Picas (pc)"),step:1},pt:{value:"pt",label:H_?"pt":(0,ee.__)("Points (pt)"),a11yLabel:(0,ee.__)("Points (pt)"),step:1},svw:{value:"svw",label:H_?"svw":(0,ee.__)("Small viewport width (svw)"),a11yLabel:(0,ee.__)("Small viewport width (svw)"),step:.1},svh:{value:"svh",label:H_?"svh":(0,ee.__)("Small viewport height (svh)"),a11yLabel:(0,ee.__)("Small viewport height (svh)"),step:.1},svi:{value:"svi",label:H_?"svi":(0,ee.__)("Viewport smallest size in the inline direction (svi)"),a11yLabel:(0,ee.__)("Small viewport width or height (svi)"),step:.1},svb:{value:"svb",label:H_?"svb":(0,ee.__)("Viewport smallest size in the block direction (svb)"),a11yLabel:(0,ee.__)("Small viewport width or height (svb)"),step:.1},svmin:{value:"svmin",label:H_?"svmin":(0,ee.__)("Small viewport smallest dimension (svmin)"),a11yLabel:(0,ee.__)("Small viewport smallest dimension (svmin)"),step:.1},lvw:{value:"lvw",label:H_?"lvw":(0,ee.__)("Large viewport width (lvw)"),a11yLabel:(0,ee.__)("Large viewport width (lvw)"),step:.1},lvh:{value:"lvh",label:H_?"lvh":(0,ee.__)("Large viewport height (lvh)"),a11yLabel:(0,ee.__)("Large viewport height (lvh)"),step:.1},lvi:{value:"lvi",label:H_?"lvi":(0,ee.__)("Large viewport width or height (lvi)"),a11yLabel:(0,ee.__)("Large viewport width or height (lvi)"),step:.1},lvb:{value:"lvb",label:H_?"lvb":(0,ee.__)("Large viewport width or height (lvb)"),a11yLabel:(0,ee.__)("Large viewport width or height (lvb)"),step:.1},lvmin:{value:"lvmin",label:H_?"lvmin":(0,ee.__)("Large viewport smallest dimension (lvmin)"),a11yLabel:(0,ee.__)("Large viewport smallest dimension (lvmin)"),step:.1},dvw:{value:"dvw",label:H_?"dvw":(0,ee.__)("Dynamic viewport width (dvw)"),a11yLabel:(0,ee.__)("Dynamic viewport width (dvw)"),step:.1},dvh:{value:"dvh",label:H_?"dvh":(0,ee.__)("Dynamic viewport height (dvh)"),a11yLabel:(0,ee.__)("Dynamic viewport height (dvh)"),step:.1},dvi:{value:"dvi",label:H_?"dvi":(0,ee.__)("Dynamic viewport width or height (dvi)"),a11yLabel:(0,ee.__)("Dynamic viewport width or height (dvi)"),step:.1},dvb:{value:"dvb",label:H_?"dvb":(0,ee.__)("Dynamic viewport width or height (dvb)"),a11yLabel:(0,ee.__)("Dynamic viewport width or height (dvb)"),step:.1},dvmin:{value:"dvmin",label:H_?"dvmin":(0,ee.__)("Dynamic viewport smallest dimension (dvmin)"),a11yLabel:(0,ee.__)("Dynamic viewport smallest dimension (dvmin)"),step:.1},dvmax:{value:"dvmax",label:H_?"dvmax":(0,ee.__)("Dynamic viewport largest dimension (dvmax)"),a11yLabel:(0,ee.__)("Dynamic viewport largest dimension (dvmax)"),step:.1},svmax:{value:"svmax",label:H_?"svmax":(0,ee.__)("Small viewport largest dimension (svmax)"),a11yLabel:(0,ee.__)("Small viewport largest dimension (svmax)"),step:.1},lvmax:{value:"lvmax",label:H_?"lvmax":(0,ee.__)("Large viewport largest dimension (lvmax)"),a11yLabel:(0,ee.__)("Large viewport largest dimension (lvmax)"),step:.1}},G_=Object.values(W_),q_=[W_.px,W_["%"],W_.em,W_.rem,W_.vw,W_.vh],K_=W_.px;function Y_(e,t,n){return X_(t?`${e??""}${t}`:e,n)}function J_(e){return Array.isArray(e)&&!!e.length}function X_(e,t=G_){let n,i;if(void 0!==e||null===e){n=`${e}`.trim();const t=parseFloat(n);i=isFinite(t)?t:void 0}const r=n?.match(/[\d.\-\+]*\s*(.*)/),o=r?.[1]?.toLowerCase();let s;if(J_(t)){const e=t.find(e=>e.value===o);s=e?.value}else s=K_.value;return[i,s]}var Z_=({units:e=G_,availableUnits:t=[],defaultValues:n})=>{const i=function(e=[],t){return Array.isArray(t)?t.filter(t=>e.includes(t.value)):[]}(t,e);return n?i.map(e=>{const[t]=n[e.value]?X_(n[e.value]):[];return{...e,default:t}}):i},Q_=n(54312),ex=n(41910),tx=n(17892),nx=n(84899),ix=n(59482),rx=n(82913),ox=n(87280),sx=n(85125),ax=n(3350),lx=(0,ex.A)(ox.A,{target:"e1bagdl32"})("&&&{input{display:block;width:100%;}",sx.Hr,"{transition:box-shadow 0.1s linear;}}"),cx=({selectSize:e})=>({small:(0,tx.AH)("box-sizing:border-box;padding:2px 1px;width:20px;font-size:8px;line-height:1;letter-spacing:-0.5px;text-transform:uppercase;text-align-last:center;&:not( :disabled ){color:",nx.l.gray[800],";}",""),default:(0,tx.AH)("box-sizing:border-box;min-width:24px;max-width:48px;height:24px;margin-inline-end:",(0,ax.x)(2),";padding:",(0,ax.x)(1),";font-size:13px;line-height:1;text-align-last:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;field-sizing:content;&:not( :disabled ){color:",nx.l.theme.accent,";}","")}[e]),ux=(0,ex.A)("div",{target:"e1bagdl31"})("&&&{pointer-events:none;",cx,";color:",nx.l.gray[900],";}"),dx=({selectSize:e="default"})=>({small:(0,tx.AH)("height:100%;border:1px solid transparent;transition:box-shadow 0.1s linear,border 0.1s linear;",(0,ix.h)({borderTopLeftRadius:0,borderBottomLeftRadius:0})()," &:not(:disabled):hover{background-color:",nx.l.gray[100],";}&:focus{border:1px solid ",nx.l.ui.borderFocus,";box-shadow:inset 0 0 0 ",rx.A.borderWidth+" "+nx.l.ui.borderFocus,";outline-offset:0;outline:2px solid transparent;z-index:1;}",""),default:(0,tx.AH)("display:flex;justify-content:center;align-items:center;&:where( :not( :disabled ) ):hover{box-shadow:0 0 0 ",rx.A.borderWidth+" "+nx.l.ui.borderFocus,";outline:",rx.A.borderWidth," solid transparent;}&:focus{box-shadow:0 0 0 ",rx.A.borderWidthFocus+" "+nx.l.ui.borderFocus,";outline:",rx.A.borderWidthFocus," solid transparent;}","")}[e]),hx=(0,ex.A)("select",{target:"e1bagdl30"})("&&&{appearance:none;background:transparent;border-radius:",rx.A.radiusXSmall,";border:none;display:block;outline:none;margin:0;min-height:auto;font-family:inherit;",cx,";",dx,";&:not( :disabled ){cursor:pointer;}}"),px=(0,T.forwardRef)(function({className:e,isUnitSelectTabbable:t=!0,onChange:n,size:i="default",unit:r="px",units:o=q_,...s},a){if(!J_(o)||1===o?.length)return(0,Er.jsx)(ux,{className:"components-unit-control__unit-label",selectSize:i,children:r});const l=(0,mh.A)("components-unit-control__select",e);return(0,Er.jsx)(hx,{ref:a,className:l,onChange:e=>{const{value:t}=e.target,i=o.find(e=>e.value===t);n?.(t,{event:e,data:i})},selectSize:i,tabIndex:t?void 0:-1,value:r,...s,children:o.map(e=>(0,Er.jsx)("option",{value:e.value,children:e.label},e.value))})}),fx=n(70623),mx=n(70362),gx=n(92916),bx=n(21351),yx=(0,T.forwardRef)(function(e,t){const{__unstableStateReducer:n,autoComplete:i="off",children:r,className:o,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=q_,value:b,onFocus:y,__shouldNotWarnDeprecated36pxSize:v,..._}=(0,gx.R)(e);(0,bx.M)({componentName:"UnitControl",__next40pxDefaultSize:_.__next40pxDefaultSize,size:f,__shouldNotWarnDeprecated36pxSize:v}),"unit"in e&&(0,Qt.A)("UnitControl unit prop",{since:"5.6",hint:"The unit should be provided within the `value` prop.",version:"6.2"});const x=b??void 0,[k,w]=(0,T.useMemo)(()=>{const e=function(e,t,n=G_){const i=Array.isArray(n)?[...n]:[],[,r]=Y_(e,t,G_);return r&&!i.some(e=>e.value===r)&&W_[r]&&i.unshift(W_[r]),i}(x,m,g),[{value:t=""}={},...n]=e,i=n.reduce((e,{value:t})=>{const n=(0,mx.Nt)(t?.substring(0,1)||"");return e.includes(n)?e:`${e}|${n}`},(0,mx.Nt)(t.substring(0,1)));return[e,new RegExp(`^(?:${i})$`,"i")]},[x,m,g]),[C,S]=Y_(x,m,k),[A,I]=(0,fx.A)(1===k.length?k[0].value:m,{initial:S,fallback:""});(0,T.useEffect)(()=>{void 0!==S&&I(S)},[S,I]);const E=(0,mh.A)("components-unit-control","components-unit-control-wrapper",o);let j;!a&&u&&k.length&&(j=e=>{_.onKeyDown?.(e),e.metaKey||e.ctrlKey||!w.test(e.key)||B.current?.focus()});const B=(0,T.useRef)(null),N=a?null:(0,Er.jsx)(px,{ref:B,"aria-label":(0,ee.__)("Select unit"),disabled:s,isUnitSelectTabbable:u,onChange:(e,t)=>{const{data:n}=t;let i=`${C??""}${e}`;c&&void 0!==n?.default&&(i=`${n.default}${e}`),h?.(i,t),p?.(e,t),I(e)},size:["small","compact"].includes(f)||"default"===f&&!_.__next40pxDefaultSize?"small":"default",unit:A,units:k,onFocus:y,onBlur:e.onBlur});let R=_.step;if(!R&&k){const e=k.find(e=>e.value===A);R=e?.step??1}return(0,Er.jsx)(lx,{..._,__shouldNotWarnDeprecated36pxSize:!0,autoComplete:i,className:E,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,i){const[r,o]=X_(e,t),s=r??n;let a=o||i;return!a&&J_(t)&&(a=t[0].value),[s,a]}(e,k,C,A).join("");h?.(n,t)},ref:t,size:f,suffix:N,type:l?"text":"number",value:C??"",step:R,onFocus:y,__unstableStateReducer:n})});yx.displayName="UnitControl";var vx=yx,_x=n(17522),xx=n(75847),kx=n(97395),wx=n(10720),Cx=n(88472),Sx=(e,t)=>{let n=e;return t.forEach(e=>{n=n?.[e]}),n};function Ax(e,t,n,i){const r=Sx(e,n);return r?[{selector:t?.selector,key:i,value:Ex(r)}]:[]}function Ix(e,t,n,i,r=["top","right","bottom","left"]){const o=Sx(e,n);if(!o)return[];const s=[];if("string"==typeof o)s.push({selector:t?.selector,key:i.default,value:Ex(o)});else{const e=r.reduce((e,n)=>{const r=Ex(Sx(o,[n]));return r&&e.push({selector:t?.selector,key:i?.individual.replace("%s",jx(n)),value:r}),e},[]);s.push(...e)}return s}function Ex(e){return"string"==typeof e&&e.startsWith("var:")?`var(--wp--${e.slice(4).split("|").map(e=>(0,Cx.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("--")})`:e}function jx(e){const[t,...n]=e;return t.toUpperCase()+n.join("")}function Tx(e){return(t,n)=>Ax(t,n,e,function(e){const[t,...n]=e;return t.toLowerCase()+n.map(jx).join("")}(e))}function Bx(e){return(t,n)=>["color","style","width"].flatMap(i=>Tx(["border",e,i])(t,n))}var Nx={name:"radius",generate:(e,t)=>Ix(e,t,["border","radius"],{default:"borderRadius",individual:"border%sRadius"},["topLeft","topRight","bottomLeft","bottomRight"])},Rx={name:"background",generate:(e,t)=>Ax(e,t,["color","background"],"backgroundColor")},Ox={name:"gradient",generate:(e,t)=>Ax(e,t,["color","gradient"],"background")},Lx={name:"text",generate:(e,t)=>Ax(e,t,["color","text"],"color")},Mx={name:"height",generate:(e,t)=>Ax(e,t,["dimensions","height"],"height")},Px={name:"minHeight",generate:(e,t)=>Ax(e,t,["dimensions","minHeight"],"minHeight")},Dx={name:"aspectRatio",generate:(e,t)=>Ax(e,t,["dimensions","aspectRatio"],"aspectRatio")},Fx={name:"width",generate:(e,t)=>Ax(e,t,["dimensions","width"],"width")},zx={name:"backgroundImage",generate:(e,t)=>{const n=e?.background?.backgroundImage,i=Ex(e?.background?.gradient)||"";if(!n&&!i)return[];const r=[i,"object"==typeof n&&n?.url?`url( '${encodeURI(function(e){try{return decodeURI(e)}catch{return e}}(n.url))}' )`:Ex(n)].filter(Boolean).join(", ");return r?[{selector:t.selector,key:"backgroundImage",value:r}]:[]}},Vx={name:"backgroundPosition",generate:(e,t)=>Ax(e,t,["background","backgroundPosition"],"backgroundPosition")},Ux={name:"backgroundRepeat",generate:(e,t)=>Ax(e,t,["background","backgroundRepeat"],"backgroundRepeat")},$x={name:"backgroundSize",generate:(e,t)=>Ax(e,t,["background","backgroundSize"],"backgroundSize")},Hx={name:"backgroundAttachment",generate:(e,t)=>Ax(e,t,["background","backgroundAttachment"],"backgroundAttachment")},Wx={name:"shadow",generate:(e,t)=>Ax(e,t,["shadow"],"boxShadow")},Gx={name:"color",generate:(e,t,n=["outline","color"],i="outlineColor")=>Ax(e,t,n,i)},qx={name:"offset",generate:(e,t,n=["outline","offset"],i="outlineOffset")=>Ax(e,t,n,i)},Kx={name:"style",generate:(e,t,n=["outline","style"],i="outlineStyle")=>Ax(e,t,n,i)},Yx={name:"width",generate:(e,t,n=["outline","width"],i="outlineWidth")=>Ax(e,t,n,i)},Jx={name:"padding",generate:(e,t)=>Ix(e,t,["spacing","padding"],{default:"padding",individual:"padding%s"})},Xx={name:"margin",generate:(e,t)=>Ix(e,t,["spacing","margin"],{default:"margin",individual:"margin%s"})},Zx={name:"fontSize",generate:(e,t)=>Ax(e,t,["typography","fontSize"],"fontSize")},Qx={name:"fontStyle",generate:(e,t)=>Ax(e,t,["typography","fontStyle"],"fontStyle")},ek={name:"fontWeight",generate:(e,t)=>Ax(e,t,["typography","fontWeight"],"fontWeight")},tk={name:"fontFamily",generate:(e,t)=>Ax(e,t,["typography","fontFamily"],"fontFamily")},nk={name:"letterSpacing",generate:(e,t)=>Ax(e,t,["typography","letterSpacing"],"letterSpacing")},ik={name:"lineHeight",generate:(e,t)=>Ax(e,t,["typography","lineHeight"],"lineHeight")},rk={name:"textColumns",generate:(e,t)=>Ax(e,t,["typography","textColumns"],"columnCount")},ok={name:"textDecoration",generate:(e,t)=>Ax(e,t,["typography","textDecoration"],"textDecoration")},sk={name:"textIndent",generate:(e,t)=>Ax(e,t,["typography","textIndent"],"textIndent")},ak={name:"textTransform",generate:(e,t)=>Ax(e,t,["typography","textTransform"],"textTransform")},lk={name:"writingMode",generate:(e,t)=>Ax(e,t,["typography","writingMode"],"writingMode")},ck=[{name:"color",generate:Tx(["border","color"])},{name:"style",generate:Tx(["border","style"])},{name:"width",generate:Tx(["border","width"])},Nx,{name:"borderTop",generate:Bx("top")},{name:"borderRight",generate:Bx("right")},{name:"borderBottom",generate:Bx("bottom")},{name:"borderLeft",generate:Bx("left")},Lx,Ox,Rx,Mx,Px,Dx,Fx,Gx,Kx,qx,Yx,Xx,Jx,tk,Zx,Qx,ek,nk,ik,rk,ok,sk,ak,lk,Wx,zx,Vx,Ux,$x,Hx];function uk(e,t={}){const n=dk(e,t);if(!t?.selector){const e=[];return n.forEach(t=>{e.push(`${(0,Cx.c)(t.key)}: ${t.value};`)}),e.join(" ")}const i=n.reduce((e,t)=>{const{selector:n}=t;return n?(e[n]||(e[n]=[]),e[n].push(t),e):e},{});return Object.keys(i).reduce((e,t)=>(e.push(`${t} { ${i[t].map(e=>`${(0,Cx.c)(e.key)}: ${e.value};`).join(" ")} }`),e),[]).join("\n")}function dk(e,t={}){const n=[];return ck.forEach(i=>{"function"==typeof i.generate&&n.push(...i.generate(e,t))}),n}var hk={name:"constrained",label:(0,ee.__)("Constrained"),inspectorControls:function({layout:e,onChange:t,layoutBlockSupport:n={}}){const{wideSize:i,contentSize:r,justifyContent:o="center"}=e,{allowJustification:s=!0,allowCustomContentAndWideSize:a=!0}=n,l=[{value:"left",icon:Vv.A,label:(0,ee.__)("Justify items left")},{value:"center",icon:Uv.A,label:(0,ee.__)("Justify items center")},{value:"right",icon:$v.A,label:(0,ee.__)("Justify items right")}],[c]=tv("spacing.units"),u=Z_({availableUnits:c||["%","px","em","rem","vw"]});return(0,Er.jsxs)(Q_.A,{spacing:4,className:"block-editor-hooks__layout-constrained",children:[a&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(vx,{__next40pxDefaultSize:!0,label:(0,ee.__)("Content width"),labelPosition:"top",value:r||i||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,contentSize:""!==n?n:void 0})},units:u,prefix:(0,Er.jsx)(_x.A,{variant:"icon",children:(0,Er.jsx)(xx.A,{icon:kx.A})})}),(0,Er.jsx)(vx,{__next40pxDefaultSize:!0,label:(0,ee.__)("Wide width"),labelPosition:"top",value:i||r||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,wideSize:""!==n?n:void 0})},units:u,prefix:(0,Er.jsx)(_x.A,{variant:"icon",children:(0,Er.jsx)(xx.A,{icon:wx.A})})}),(0,Er.jsx)("p",{className:"block-editor-hooks__layout-constrained-helptext",children:(0,ee.__)("Customize the width for all elements that are assigned to the center or wide columns.")})]}),s&&(0,Er.jsx)(Jv.A,{__next40pxDefaultSize:!0,label:(0,ee.__)("Justification"),value:o,onChange:n=>{t({...e,justifyContent:n})},children:l.map(({value:e,icon:t,label:n})=>(0,Er.jsx)(Xv.A,{value:e,icon:t,label:n},e))})]})},toolBarControls:function({layout:e={},onChange:t,layoutBlockSupport:n}){const{allowJustification:i=!0}=n;return i?(0,Er.jsx)(Mv,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,Er.jsx)(fk,{layout:e,onChange:t})}):null},getLayoutStyle:function({selector:e,layout:t={},style:n,blockName:i,hasBlockGapSupport:r,layoutDefinitions:o=Qv}){const{contentSize:s,wideSize:a,justifyContent:l}=t,c=v_(n?.spacing?.blockGap);let u="";av(i,"spacing","blockGap")||(c?.top?u=v_(c?.top):"string"==typeof c&&(u=v_(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${e_(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${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${e_(e,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${a??s};\n\t\t\t\t\t}\n\t\t\t\t\t${e_(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+=`${e_(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${d}; }`:"right"===l&&(p+=`${e_(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${h}; }`),n?.spacing?.padding&&dk(n).forEach(t=>{if("paddingRight"===t.key){const n="0"===t.value?"0px":t.value;p+=`\n\t\t\t\t\t${e_(e,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${n} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`}else if("paddingLeft"===t.key){const n="0"===t.value?"0px":t.value;p+=`\n\t\t\t\t\t${e_(e,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${n} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`}}),r&&u&&(p+=t_(e,o,"constrained",u)),p},getOrientation:()=>"vertical",getAlignments(e){const t=n_(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:i}=e,r=[{name:"left"},{name:"center"},{name:"right"}];return n&&r.unshift({name:"full"}),i&&r.unshift({name:"wide",info:t.wide}),r.unshift({name:"none",info:t.none}),r}},pk={placement:"bottom-start"};function fk({layout:e,onChange:t}){const{justifyContent:n="center"}=e;return(0,Er.jsx)(N_,{allowedControls:["left","center","right"],value:n,onChange:n=>{t({...e,justifyContent:n})},popoverProps:pk})}var mk=n(95104),gk=n(36223),bk=n(89137),yk={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},vk=[{value:"px",label:"px",default:0},{value:"rem",label:"rem",default:0},{value:"em",label:"em",default:0}],_k={name:"grid",label:(0,ee.__)("Grid"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowSizingOnChildren:i=!1}=n,r=!e?.isManualPlacement||window.__experimentalEnableGridInteractivity;return(0,Er.jsxs)(Er.Fragment,{children:[window.__experimentalEnableGridInteractivity&&(0,Er.jsx)(wk,{layout:e,onChange:t}),(0,Er.jsxs)(Q_.A,{spacing:4,children:[(0,Er.jsx)(kk,{layout:e,onChange:t,allowSizingOnChildren:i}),r&&(0,Er.jsx)(xk,{layout:e,onChange:t})]})]})},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:i,hasBlockGapSupport:r,globalBlockGapValue:o,layoutDefinitions:s=Qv}){const{minimumColumnWidth:a=null,columnCount:l=null,rowCount:c=null}=t;let u="1.2rem";if(o){const e=v_(o,"0.5em").split(" ");u=e.length>1?e[1]:e[0]}const d=n?.spacing?.blockGap&&!av(i,"spacing","blockGap")?v_(n?.spacing?.blockGap,u):void 0;let h="";const p=[];if(a&&l>0){let e=d||u;"0"!==e&&0!==e||(e="0px");const t=`max(min( ${a}, 100%), ( 100% - (${e}*${l-1}) ) / ${l})`;p.push(`grid-template-columns: repeat(auto-fill, minmax(${t}, 1fr))`,"container-type: inline-size"),c&&p.push(`grid-template-rows: repeat(${c}, minmax(1rem, auto))`)}else l?(p.push(`grid-template-columns: repeat(${l}, minmax(0, 1fr))`),c&&p.push(`grid-template-rows: repeat(${c}, minmax(1rem, auto))`)):p.push(`grid-template-columns: repeat(auto-fill, minmax(min(${a||"12rem"}, 100%), 1fr))`,"container-type: inline-size");return p.length&&(h=`${e_(e)} { ${p.join("; ")}; }`),r&&d&&(h+=t_(e,s,"grid",d)),h},getOrientation:()=>"horizontal",getAlignments:()=>[]};function xk({layout:e,onChange:t}){const{minimumColumnWidth:n,columnCount:i,isManualPlacement:r}=e,o=n||(r||i?null:"12rem"),[s,a="rem"]=X_(o);return(0,Er.jsxs)("fieldset",{className:"block-editor-hooks__grid-layout-minimum-width-control",children:[(0,Er.jsx)(mk.Ay.VisualLabel,{as:"legend",children:(0,ee.__)("Min. column width")}),(0,Er.jsxs)(Kv.A,{gap:4,children:[(0,Er.jsx)(Yv.A,{isBlock:!0,children:(0,Er.jsx)(vx,{size:"__unstable-large",onChange:n=>{t({...e,minimumColumnWidth:""===n?void 0:n})},onUnitChange:n=>{let i;["em","rem"].includes(n)&&"px"===a?i=(s/16).toFixed(2)+n:["em","rem"].includes(a)&&"px"===n&&(i=Math.round(16*s)+n),t({...e,minimumColumnWidth:i})},value:o,units:vk,min:0,label:(0,ee.__)("Minimum column width"),hideLabelFromVision:!0})}),(0,Er.jsx)(Yv.A,{isBlock:!0,children:(0,Er.jsx)(gk.A,{__next40pxDefaultSize:!0,onChange:n=>{t({...e,minimumColumnWidth:[n,a].join("")})},value:s||0,min:0,max:yk[a]||600,withInputField:!1,label:(0,ee.__)("Minimum column width"),hideLabelFromVision:!0})})]}),(0,Er.jsx)("p",{className:"components-base-control__help",children:(0,ee.__)("Columns will wrap to fewer per row when they can no longer maintain the minimum width.")})]})}function kk({layout:e,onChange:t,allowSizingOnChildren:n}){const i=void 0,{columnCount:r=i,rowCount:o,isManualPlacement:s}=e;return(0,Er.jsx)(Er.Fragment,{children:(0,Er.jsxs)("fieldset",{className:"block-editor-hooks__grid-layout-columns-and-rows-controls",children:[!s&&(0,Er.jsx)(mk.Ay.VisualLabel,{as:"legend",children:(0,ee.__)("Max. columns")}),(0,Er.jsxs)(Kv.A,{gap:4,children:[(0,Er.jsx)(Yv.A,{isBlock:!0,children:(0,Er.jsx)(ox.A,{size:"__unstable-large",onChange:n=>{const i=""===n||"0"===n?s?1:void 0:parseInt(n,10);t({...e,columnCount:i})},value:r,min:1,label:(0,ee.__)("Columns"),hideLabelFromVision:!s})}),(0,Er.jsx)(Yv.A,{isBlock:!0,children:n&&s?(0,Er.jsx)(ox.A,{size:"__unstable-large",onChange:n=>{const i=""===n||"0"===n?1:parseInt(n,10);t({...e,rowCount:i})},value:o,min:1,label:(0,ee.__)("Rows")}):(0,Er.jsx)(gk.A,{__next40pxDefaultSize:!0,value:r??1,onChange:n=>t({...e,columnCount:""===n||"0"===n?1:n}),min:1,max:16,withInputField:!1,label:(0,ee.__)("Columns"),hideLabelFromVision:!0})})]})]})})}function wk({layout:e,onChange:t}){const{columnCount:n,rowCount:i,minimumColumnWidth:r,isManualPlacement:o}=e,[s,a]=(0,T.useState)(n||3),[l,c]=(0,T.useState)(i),[u,d]=(0,T.useState)(r||"12rem"),h=o?"manual":"auto",p="manual"===h?(0,ee.__)("Grid items can be manually placed in any position on the grid."):(0,ee.__)("Grid items are placed automatically depending on their order.");return(0,Er.jsxs)(Jv.A,{__next40pxDefaultSize:!0,label:(0,ee.__)("Grid item position"),value:h,onChange:o=>{"manual"===o?d(r||"12rem"):(a(n||3),c(i)),t({...e,columnCount:s,rowCount:"manual"===o?l:void 0,isManualPlacement:"manual"===o||void 0,minimumColumnWidth:"auto"===o?u:null})},isBlock:!0,help:p,children:[(0,Er.jsx)(bk.A,{value:"auto",label:(0,ee.__)("Auto")},"auto"),(0,Er.jsx)(bk.A,{value:"manual",label:(0,ee.__)("Manual")},"manual")]})}var Ck=[$_,P_,hk,_k];function Sk(e="default"){return Ck.find(t=>t.name===e)}var Ak={type:"default"},Ik=(0,T.createContext)(Ak);Ik.displayName="BlockLayoutContext";var Ek=Ik.Provider;function jk(){return(0,T.useContext)(Ik)}var Tk=[],Bk=["none","left","center","right","wide","full"],Nk=["wide","full"];function Rk(e=Bk){e.includes("none")||(e=["none",...e]);const t=1===e.length&&"none"===e[0],[n,i,r]=(0,zt.A)(e=>{if(t)return[!1,!1,!1];const n=e(Qy).getSettings();return[n.alignWide??!1,n.supportsLayout,n.__unstableIsBlockBasedTheme]},[t]),o=jk();if(t)return Tk;const s=Sk(o?.type);if(i){const t=s.getAlignments(o,r).filter(t=>e.includes(t.name));return 1===t.length&&"none"===t[0].name?Tk:t}if("default"!==s.name&&"constrained"!==s.name)return Tk;const a=e.filter(e=>o.alignments?o.alignments.includes(e):!(!n&&Nk.includes(e))&&Bk.includes(e)).map(e=>({name:e}));return 1===a.length&&"none"===a[0].name?Tk:a}var Ok=n(22230),Lk=n(61218),Mk=n(281),Pk=n(88057),Dk={none:{icon:kx.A,title:(0,ee._x)("None","Alignment option")},left:{icon:Ok.A,title:(0,ee.__)("Align left")},center:{icon:Lk.A,title:(0,ee.__)("Align center")},right:{icon:Mk.A,title:(0,ee.__)("Align right")},wide:{icon:wx.A,title:(0,ee.__)("Wide width")},full:{icon:Pk.A,title:(0,ee.__)("Full width")}},Fk=function({value:e,onChange:t,controls:n,isToolbar:i,isCollapsed:r=!0}){const o=Rk(n);if(!o.length)return null;function s(n){t([e,"none"].includes(n)?void 0:n)}const a=Dk[e],l=Dk.none,c=i?wv:Dv,u={icon:a?a.icon:l.icon,label:(0,ee.__)("Align")},d=i?{isCollapsed:r,controls:o.map(({name:t})=>({...Dk[t],isActive:e===t||!e&&"none"===t,role:r?"menuitemradio":void 0,onClick:()=>s(t)}))}:{toggleProps:{description:(0,ee.__)("Change alignment")},children:({onClose:t})=>(0,Er.jsx)(Er.Fragment,{children:(0,Er.jsx)(Fv.A,{className:"block-editor-block-alignment-control__menu-group",children:o.map(({name:n,info:i})=>{const{icon:r,title:o}=Dk[n],a=n===e||!e&&"none"===n;return(0,Er.jsx)(zv.A,{icon:r,iconPosition:"left",className:(0,mh.A)("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{s(n),t()},role:"menuitemradio",info:i,children:o},n)})})})};return(0,Er.jsx)(c,{...u,...d})},zk=e=>(0,Er.jsx)(Fk,{...e,isToolbar:!1});function Vk(e){const t=Ih(),{clientId:n=""}=t,{setBlockEditingMode:i,unsetBlockEditingMode:r}=(0,Vt.A)(Qy),o=(0,zt.A)(e=>n?null:e(Qy).getBlockEditingMode(),[n]);return(0,T.useEffect)(()=>(e&&i(n,e),()=>{e&&r(n)}),[n,e,i,r]),n?t[_h]:o}var Uk=["left","center","right","wide","full"],$k=["wide","full"];function Hk(e,t=!0,n=!0){let i;return i=Array.isArray(e)?Uk.filter(t=>e.includes(t)):!0===e?[...Uk]:[],!n||!0===e&&!t?i.filter(e=>!$k.includes(e)):i}var Wk={shareWithChildBlocks:!0,edit:function({name:e,align:t,setAttributes:n}){const i=Rk(Hk(vn(e,"align"),_n(e,"alignWide",!0))).map(({name:e})=>e),r=Vk();return i.length&&"default"===r?(0,Er.jsx)(Mv,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,Er.jsx)(zk,{value:t,onChange:t=>{if(!t){const n=bn(e),i=n?.attributes?.align?.default;i&&(t="")}n({align:t})},controls:i})}):null},useBlockProps:function({name:e,align:t}){return Rk(Hk(vn(e,"align"),_n(e,"alignWide",!0))).some(e=>e.name===t)?{"data-align":t}:{}},addSaveProps:function(e,t,n){const{align:i}=n;return Hk(vn(t,"align"),_n(t,"alignWide",!0)).includes(i)&&(e.className=(0,mh.A)(`align${i}`,e.className)),e},attributeKeys:["align"],hasSupport:e=>_n(e,"align",!1)};(0,Ei.U2)("blocks.registerBlockType","core/editor/align/addAttribute",function(e){return"type"in(e.attributes?.align??{})||_n(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...Uk,""]}}),e});var Gk=()=>{},qk=(0,T.createContext)({menuItems:{default:{},optional:{}},hasMenuItems:!1,isResetting:!1,shouldRenderPlaceholderItems:!1,registerPanelItem:Gk,deregisterPanelItem:Gk,flagItemCustomization:Gk,registerResetAllFilter:Gk,deregisterResetAllFilter:Gk,areAllOptionalControlsHidden:!0});qk.displayName="ToolsPanelContext";var Kk=()=>(0,T.useContext)(qk),Yk=(0,Sv.QJ)("InspectorControls"),Jk=(0,Sv.QJ)("InspectorAdvancedControls"),Xk=(0,Sv.QJ)("InspectorControlsBindings"),Zk=(0,Sv.QJ)("InspectorControlsBackground"),Qk=(0,Sv.QJ)("InspectorControlsBorder"),ew=(0,Sv.QJ)("InspectorControlsColor"),tw=(0,Sv.QJ)("InspectorControlsFilter"),nw=(0,Sv.QJ)("InspectorControlsDimensions"),iw=(0,Sv.QJ)("InspectorControlsPosition"),rw=(0,Sv.QJ)("InspectorControlsTypography"),ow=(0,Sv.QJ)("InspectorControlsListView"),sw=(0,Sv.QJ)("InspectorControlsStyles"),aw=(0,Sv.QJ)("InspectorControlsEffects"),lw={default:Yk,advanced:Jk,background:Zk,bindings:Xk,border:Qk,color:ew,content:(0,Sv.QJ)("InspectorControlsContent"),dimensions:nw,effects:aw,filter:tw,list:ow,position:iw,settings:Yk,styles:sw,typography:rw},cw=(0,Sv.QJ)(Symbol("PrivateInspectorControlsAllowedBlocks")),uw=n(81975),dw=n(28029),hw=Symbol("ListViewContentPopover"),{Fill:pw,Slot:fw}=(0,Sv.QJ)(hw);function mw({listViewRef:e}){const{popoverProps:t}=(0,dw.A)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:35,resize:!1}},n=Bv(hw),i=Boolean(n&&n.length),{selectedClientId:r,isOpen:o}=(0,zt.A)(e=>{const{getSelectedBlockClientId:t}=e(Qy),n=Gh(e(Qy));return{selectedClientId:t(),isOpen:n.isListViewContentPanelOpen()}},[]),[s,a]=(0,T.useState)(null);(0,T.useLayoutEffect)(()=>{if(!r||!e?.current)return void a(null);const t=e.current.querySelector(`[data-block="${r}"]`);a(t)},[r,e]);const{closeListViewContentPanel:l}=Gh((0,Vt.A)(Qy));return o&&i&&s?(0,Er.jsx)(uw.Ay,{...t??{},className:"block-editor-inspector-list-view-content-popover",anchor:s,onClose:l,children:(0,Er.jsx)("div",{style:{width:"280px"},children:(0,Er.jsx)(fw,{})})}):null}var gw=["content","list"],bw=["default","settings","advanced"];function yw({children:e,group:t="default",__experimentalGroup:n,resetAllFilter:i}){n&&((0,Qt.A)("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=n);const r=Ih(),o=lw[t]?.Fill;if(!o)return(0,sn.A)(`Unknown InspectorControls group "${t}" provided.`),null;if(r[vh]){const e="core/template-part"===r.name,n=bw.includes(t),i=gw.includes(t);if(!(e&&n||i))return null}return r[vh]||r[bh]?"content"===t&&r[wh]&&r[vh]?r[bh]?(0,Er.jsx)(Cv.A,{document,children:(0,Er.jsx)(pw,{children:e})}):null:(0,Er.jsx)(Cv.A,{document,children:(0,Er.jsx)(o,{children:t=>(0,Er.jsx)(_w,{fillProps:t,children:e,resetAllFilter:i})})}):null}function vw({resetAllFilter:e,children:t}){const{registerResetAllFilter:n,deregisterResetAllFilter:i}=(0,T.useContext)(qk);return(0,T.useEffect)(()=>{if(e&&n&&i)return n(e),()=>{i(e)}},[e,n,i]),t}function _w({children:e,resetAllFilter:t,fillProps:n}){const{forwardedContext:i=[]}=n,r=(0,Er.jsx)(vw,{resetAllFilter:t,children:e});return i.reduce((e,[t,n])=>(0,Er.jsx)(t,{...n,children:e}),r)}var xw=n(13387),kw=n(83641),ww=n(39173),Cw=n(83733),Sw=n(33133),Aw=n(27373),Iw={columns:e=>(0,tx.AH)("grid-template-columns:",`repeat( ${e}, minmax(0, 1fr) )`,";",""),spacing:(0,tx.AH)("column-gap:",(0,ax.x)(4),";row-gap:",(0,ax.x)(4),";",""),item:{fullWidth:{name:"18iuzk9",styles:"grid-column:1/-1"}}},Ew={name:"huufmu",styles:">div:not( :first-of-type ){display:none;}"},jw=(0,tx.AH)(Iw.item.fullWidth," gap:",(0,ax.x)(2),";.components-dropdown-menu{margin:",(0,ax.x)(-1)," 0;line-height:0;}&&&& .components-dropdown-menu__toggle{padding:0;min-width:",(0,ax.x)(6),";}",""),Tw=(0,tx.AH)("font-size:inherit;font-weight:",rx.A.fontWeightMedium,";line-height:normal;&&{margin:0;}",""),Bw=(0,tx.AH)(Iw.item.fullWidth,"&>div,&>fieldset{padding-bottom:0;margin-bottom:0;max-width:100%;}&& ",Aw.mO,"{margin-bottom:0;",Aw.mh,":last-child{margin-bottom:0;}}",Aw.te,"{margin-bottom:0;}",""),Nw={name:"eivff4",styles:"display:none"},Rw={name:"16gsvie",styles:"min-width:200px"},Ow=(0,ex.A)("span",{target:"ews648u0"})("color:",nx.l.theme.accentDarker10,";font-size:11px;font-weight:",rx.A.fontWeightMedium,";line-height:1.4;",(0,ix.h)({marginLeft:(0,ax.x)(3)})," text-transform:uppercase;"),Lw=(0,tx.AH)("color:",nx.l.gray[900],";&&[aria-disabled='true']{color:",nx.l.gray[700],";opacity:1;&:hover{color:",nx.l.gray[700],";}",Ow,"{opacity:0.3;}}",""),Mw=n(82604),Pw=n(93451),Dw=n(96410),Fw=({itemClassName:e,items:t,toggleItem:n})=>{if(!t.length)return null;const i=(0,Er.jsx)(Ow,{"aria-hidden":!0,children:(0,ee.__)("Reset")});return(0,Er.jsx)(Er.Fragment,{children:t.map(([t,r])=>r?(0,Er.jsx)(zv.A,{className:e,role:"menuitem",label:(0,ee.sprintf)((0,ee.__)("Reset %s"),t),onClick:()=>{n(t),(0,dt.L)((0,ee.sprintf)((0,ee.__)("%s reset to default"),t),"assertive")},suffix:i,children:t},t):(0,Er.jsx)(zv.A,{icon:xw.A,className:e,role:"menuitemcheckbox",isSelected:!0,"aria-disabled":!0,children:t},t))})},zw=({items:e,toggleItem:t})=>e.length?(0,Er.jsx)(Er.Fragment,{children:e.map(([e,n])=>{const i=n?(0,ee.sprintf)((0,ee.__)("Hide and reset %s"),e):(0,ee.sprintf)((0,ee._x)("Show %s","input control"),e);return(0,Er.jsx)(zv.A,{icon:n?xw.A:null,isSelected:n,label:i,onClick:()=>{n?(0,dt.L)((0,ee.sprintf)((0,ee.__)("%s hidden and reset to default"),e),"assertive"):(0,dt.L)((0,ee.sprintf)((0,ee.__)("%s is now visible"),e),"assertive"),t(e)},role:"menuitemcheckbox",children:e},e)})}):null,Vw=(0,Dw.KZ)((e,t)=>{const{areAllOptionalControlsHidden:n,defaultControlsItemClassName:i,dropdownMenuClassName:r,hasMenuItems:o,headingClassName:s,headingLevel:a=2,label:l,menuItems:c,resetAll:u,toggleItem:d,dropdownMenuProps:h,...p}=function(e){const{className:t,headingLevel:n=2,...i}=(0,Mw.A)(e,"ToolsPanelHeader"),r=(0,Pw.l)(),o=(0,T.useMemo)(()=>r(jw,t),[t,r]),s=(0,T.useMemo)(()=>r(Rw),[r]),a=(0,T.useMemo)(()=>r(Tw),[r]),l=(0,T.useMemo)(()=>r(Lw),[r]),{menuItems:c,hasMenuItems:u,areAllOptionalControlsHidden:d}=Kk();return{...i,areAllOptionalControlsHidden:d,defaultControlsItemClassName:l,dropdownMenuClassName:s,hasMenuItems:u,headingClassName:a,headingLevel:n,menuItems:c,className:o}}(e);if(!l)return null;const f=Object.entries(c?.default||{}),m=Object.entries(c?.optional||{}),g=n?kw.A:ww.A,b=(0,ee.sprintf)((0,ee._x)("%s options","Button label to reveal tool panel options"),l),y=n?(0,ee.__)("All options are currently hidden"):void 0,v=[...f,...m].some(([,e])=>e);return(0,Er.jsxs)(Cw.A,{...p,ref:t,children:[(0,Er.jsx)(Sw.A,{level:a,className:s,children:l}),o&&(0,Er.jsx)(xv.A,{...h,icon:g,label:b,menuProps:{className:r},toggleProps:{size:"small",description:y},children:()=>(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsxs)(Fv.A,{label:l,children:[(0,Er.jsx)(Fw,{items:f,toggleItem:d,itemClassName:i}),(0,Er.jsx)(zw,{items:m,toggleItem:d})]}),(0,Er.jsx)(Fv.A,{children:(0,Er.jsx)(zv.A,{"aria-disabled":!v,variant:"tertiary",onClick:()=>{v&&(u(),(0,dt.L)((0,ee.__)("All options reset"),"assertive"))},children:(0,ee.__)("Reset all")})})]})})]})},"ToolsPanelHeader");function Uw(){return{panelItems:[],menuItemOrder:[],menuItems:{default:{},optional:{}}}}var $w=({panelItems:e,shouldReset:t,currentMenuItems:n,menuItemOrder:i})=>{const r={default:{},optional:{}},o={default:{},optional:{}};return e.forEach(({hasValue:e,isShownByDefault:i,label:o})=>{const s=i?"default":"optional",a=n?.[s]?.[o],l=a||e();r[s][o]=!t&&l}),i.forEach(e=>{r.default.hasOwnProperty(e)&&(o.default[e]=r.default[e]),r.optional.hasOwnProperty(e)&&(o.optional[e]=r.optional[e])}),Object.keys(r.default).forEach(e=>{o.default.hasOwnProperty(e)||(o.default[e]=r.default[e])}),Object.keys(r.optional).forEach(e=>{o.optional.hasOwnProperty(e)||(o.optional[e]=r.optional[e])}),o};function Hw(e,t){const n=function(e,t){switch(t.type){case"REGISTER_PANEL":{const n=[...e],i=n.findIndex(e=>e.label===t.item.label);return-1!==i&&n.splice(i,1),n.push(t.item),n}case"UNREGISTER_PANEL":{const n=e.findIndex(e=>e.label===t.label);if(-1!==n){const t=[...e];return t.splice(n,1),t}return e}default:return e}}(e.panelItems,t),i=function(e,t){return"REGISTER_PANEL"===t.type?e.includes(t.item.label)?e:[...e,t.item.label]:e}(e.menuItemOrder,t),r=function(e,t){switch(t.type){case"REGISTER_PANEL":case"UNREGISTER_PANEL":return $w({currentMenuItems:e.menuItems,panelItems:e.panelItems,menuItemOrder:e.menuItemOrder,shouldReset:!1});case"RESET_ALL":return $w({panelItems:e.panelItems,menuItemOrder:e.menuItemOrder,shouldReset:!0});case"UPDATE_VALUE":{const n=e.menuItems[t.group][t.label];return t.value===n?e.menuItems:{...e.menuItems,[t.group]:{...e.menuItems[t.group],[t.label]:t.value}}}case"TOGGLE_VALUE":{const n=e.panelItems.find(e=>e.label===t.label);if(!n)return e.menuItems;const i=n.isShownByDefault?"default":"optional";return{...e.menuItems,[i]:{...e.menuItems[i],[t.label]:!e.menuItems[i][t.label]}}}default:return e.menuItems}}({panelItems:n,menuItemOrder:i,menuItems:e.menuItems},t);return{panelItems:n,menuItemOrder:i,menuItems:r}}function Ww(e,t){switch(t.type){case"REGISTER":return[...e,t.filter];case"UNREGISTER":return e.filter(e=>e!==t.filter);default:return e}}var Gw=e=>0===Object.keys(e).length;var qw=n(72181),Kw={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"}},Yw=n(79624);var Jw=(0,Dw.KZ)(function(e,t){const n=function(e){const{align:t,alignment:n,className:i,columnGap:r,columns:o=2,gap:s=3,isInline:a=!1,justify:l,rowGap:c,rows:u,templateColumns:d,templateRows:h,...p}=(0,Mw.A)(e,"Grid"),f=Array.isArray(o)?o:[o],m=(0,Yw.t)(f),g=Array.isArray(u)?u:[u],b=(0,Yw.t)(g),y=d||!!o&&`repeat( ${m}, 1fr )`,v=h||!!u&&`repeat( ${b}, 1fr )`,_=(0,Pw.l)();return{...p,className:(0,T.useMemo)(()=>{const e=function(e){return e?Kw[e]:{}}(n),o=(0,tx.AH)({alignItems:t,display:a?"inline-grid":"grid",gap:`calc( ${rx.A.gridBase} * ${s} )`,gridTemplateColumns:y||void 0,gridTemplateRows:v||void 0,gridRowGap:c,gridColumnGap:r,justifyContent:l,verticalAlign:a?"middle":void 0,...e},"","");return _(o,i)},[t,n,i,r,_,s,y,v,a,l,c])}}(e);return(0,Er.jsx)(qw.A,{...n,ref:t})},"Grid"),Xw=(0,Dw.KZ)((e,t)=>{const{children:n,label:i,panelContext:r,resetAllItems:o,toggleItem:s,headingLevel:a,dropdownMenuProps:l,...c}=function(e){const{className:t,headingLevel:n=2,resetAll:i,panelId:r,hasInnerWrapper:o=!1,shouldRenderPlaceholderItems:s=!1,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:l,...c}=(0,Mw.A)(e,"ToolsPanel"),u=(0,T.useRef)(!1),d=u.current;(0,T.useEffect)(()=>{d&&(u.current=!1)},[d]);const[{panelItems:h,menuItems:p},f]=(0,T.useReducer)(Hw,void 0,Uw),[m,g]=(0,T.useReducer)(Ww,[]),b=(0,T.useCallback)(e=>{f({type:"REGISTER_PANEL",item:e})},[]),y=(0,T.useCallback)(e=>{f({type:"UNREGISTER_PANEL",label:e})},[]),v=(0,T.useCallback)(e=>{g({type:"REGISTER",filter:e})},[]),_=(0,T.useCallback)(e=>{g({type:"UNREGISTER",filter:e})},[]),x=(0,T.useCallback)((e,t,n="default")=>{f({type:"UPDATE_VALUE",group:n,label:t,value:e})},[]),k=(0,T.useMemo)(()=>Gw(p.default)&&!Gw(p.optional)&&Object.values(p.optional).every(e=>!e),[p]),w=(0,Pw.l)(),C=(0,T.useMemo)(()=>{const e=o&&(0,tx.AH)(">div:not( :first-of-type ){display:grid;",Iw.columns(2)," ",Iw.spacing," ",Iw.item.fullWidth,";}",""),n=k&&Ew;return w((0,tx.AH)(Iw.columns(2)," ",Iw.spacing," border-top:",rx.A.borderWidth," solid ",nx.l.gray[300],";margin-top:-1px;padding:",(0,ax.x)(4),";",""),e,n,t)},[k,t,w,o]),S=(0,T.useCallback)(e=>{f({type:"TOGGLE_VALUE",label:e})},[]),A=(0,T.useCallback)(()=>{"function"==typeof i&&(u.current=!0,i(m)),f({type:"RESET_ALL"})},[m,i]),I=e=>{const t=p.optional||{},n=e.find(e=>e.isShownByDefault||t[e.label]);return n?.label},E=I(h),j=I([...h].reverse()),B=h.length>0;return{...c,headingLevel:n,panelContext:(0,T.useMemo)(()=>({areAllOptionalControlsHidden:k,deregisterPanelItem:y,deregisterResetAllFilter:_,firstDisplayedItem:E,flagItemCustomization:x,hasMenuItems:B,isResetting:u.current,lastDisplayedItem:j,menuItems:p,panelId:r,registerPanelItem:b,registerResetAllFilter:v,shouldRenderPlaceholderItems:s,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:l}),[k,y,_,E,x,j,p,r,B,v,b,s,a,l]),resetAllItems:A,toggleItem:S,className:C}}(e);return(0,Er.jsx)(Jw,{...c,columns:2,ref:t,children:(0,Er.jsxs)(qk.Provider,{value:r,children:[(0,Er.jsx)(Vw,{label:i,resetAll:o,toggleItem:s,headingLevel:a,dropdownMenuProps:l}),n]})})},"ToolsPanel");function Zw(){return(0,dw.A)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}}}function Qw(e,t){if(!e||!t)return t;const n=e.split(","),i=t.split(","),r=[];return n.forEach(e=>{i.forEach(t=>{r.push(`${e.trim()} ${t.trim()}`)})}),r.join(", ")}function eC({children:e,group:t,label:n}){const{updateBlockAttributes:i}=(0,Vt.A)(Qy),{getBlockAttributes:r,getMultiSelectedBlockClientIds:o,getSelectedBlockClientId:s,hasMultiSelection:a}=(0,zt.A)(Qy),l=Zw(),c=s(),u=(0,T.useCallback)((e=[])=>{const t={},n=a()?o():[c];n.forEach(n=>{const{style:i}=r(n);let o={style:i};e.forEach(e=>{o={...o,...e(o)}}),o={...o,style:ov(o.style)},t[n]=o}),i(n,t,!0)},[r,o,a,c,i]);return(0,Er.jsx)(Xw,{className:`${t}-block-support-panel`,label:n,resetAll:u,panelId:c,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:l,children:e},c)}function tC({Slot:e,fillProps:t,...n}){const i=(0,T.useContext)(qk),r=(0,T.useMemo)(()=>({...t??{},forwardedContext:[...t?.forwardedContext??[],[qk.Provider,{value:i}]]}),[i,t]);return(0,Er.jsx)(e,{...n,fillProps:r,bubblesVirtually:!0})}var nC=(0,T.forwardRef)(function({__experimentalGroup:e,group:t="default",label:n,fillProps:i,...r},o){e&&((0,Qt.A)("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=e);const s=lw[t],a=Bv(s?.name);if(!s)return(0,sn.A)(`Unknown InspectorControls group "${t}" provided.`),null;if(!a?.length)return null;const{Slot:l}=s;return n?(0,Er.jsx)(eC,{group:t,label:n,children:(0,Er.jsx)(tC,{...r,fillProps:i,Slot:l})}):(0,Er.jsx)(l,{...r,ref:o,fillProps:i,bubblesVirtually:!0})}),iC=yw;iC.Slot=nC;var rC=e=>(0,Er.jsx)(yw,{...e,group:"advanced"});rC.Slot=function(e){return(0,Er.jsx)(nC,{...e,group:"advanced"})},rC.slotName="InspectorAdvancedControls";var oC=iC,sC=()=>{},aC=(0,Dw.KZ)((e,t)=>{const{children:n,isShown:i,shouldRenderPlaceholder:r,...o}=function(e){const{className:t,hasValue:n,isShownByDefault:i=!1,label:r,panelId:o,resetAllFilter:s=sC,onDeselect:a,onSelect:l,...c}=(0,Mw.A)(e,"ToolsPanelItem"),{panelId:u,menuItems:d,registerResetAllFilter:h,deregisterResetAllFilter:p,registerPanelItem:f,deregisterPanelItem:m,flagItemCustomization:g,isResetting:b,shouldRenderPlaceholderItems:y,firstDisplayedItem:v,lastDisplayedItem:_,__experimentalFirstVisibleItemClass:x,__experimentalLastVisibleItemClass:k}=Kk(),w=(0,T.useCallback)(n,[o]),C=(0,T.useCallback)(s,[o]),S=(0,qt.A)(u),A=u===o||null===u;(0,T.useLayoutEffect)(()=>(A&&null!==S&&f({hasValue:w,isShownByDefault:i,label:r,panelId:o}),()=>{(null===S&&u||u===o)&&m(r)}),[u,A,i,r,w,o,S,f,m]),(0,T.useEffect)(()=>(A&&h(C),()=>{A&&p(C)}),[h,p,C,A]);const I=i?"default":"optional",E=d?.[I]?.[r],j=(0,qt.A)(E),B=void 0!==d?.[I]?.[r],N=n();(0,T.useEffect)(()=>{(i||N)&&g(N,r,I)},[N,I,r,g,i]),(0,T.useEffect)(()=>{B&&!b&&A&&(!E||N||j||l?.(),!E&&N&&j&&a?.())},[A,E,B,b,N,j,l,a]);const R=i?void 0!==d?.[I]?.[r]:E,O=(0,Pw.l)(),L=(0,T.useMemo)(()=>{const e=y&&!R;return O(Bw,e&&Nw,!e&&t,v===r&&x,_===r&&k)},[R,y,t,O,v,_,x,k,r]);return{...c,isShown:R,shouldRenderPlaceholder:y,className:L}}(e);return i?(0,Er.jsx)(qw.A,{...o,ref:t,children:n}):r?(0,Er.jsx)(qw.A,{...o,ref:t}):null},"ToolsPanelItem");function lC(e,t={}){if("string"!=typeof e&&"number"!=typeof e)return null;isFinite(e)&&(e=`${e}px`);const{coerceTo:n,rootSizeValue:i,acceptableUnits:r}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},o=r?.join("|"),s=new RegExp(`^(\\d*\\.?\\d+)(${o}){1,1}$`),a=e.toString().match(s);if(!a||a.length<3)return null;let[,l,c]=a,u=parseFloat(l);return"px"!==n||"em"!==c&&"rem"!==c||(u*=i,c=n),"px"!==c||"em"!==n&&"rem"!==n||(u/=i,c=n),"em"!==n&&"rem"!==n||"em"!==c&&"rem"!==c||(c=n),c?{value:cC(u,3),unit:c}:null}function cC(e,t=3){const n=Math.pow(10,t);return Math.round(e*n)/n}function uC(e){const t=e?.fluid;return!0===t||t&&"object"==typeof t&&Object.keys(t).length>0}function dC(e,t){const{size:n}=e;if(!n||"0"===n||!1===e?.fluid)return n;if(!uC(t?.typography)&&!uC(e))return n;const i=function(e){const t=e?.typography??{},n=e?.layout,i=lC(n?.wideSize)?n?.wideSize:null;return uC(t)&&i?{fluid:{maxViewportWidth:i,..."object"==typeof t.fluid?t.fluid:{}}}:{fluid:t?.fluid}}(t)?.fluid??{},r=function({minimumFontSize:e,maximumFontSize:t,fontSize:n,minimumViewportWidth:i="320px",maximumViewportWidth:r="1600px",scaleFactor:o=1,minimumFontSizeLimit:s}){if(s=lC(s)?s:"14px",n){const i=lC(n);if(!i?.unit||!i?.value)return null;const r=lC(s,{coerceTo:i.unit});if(r?.value&&!e&&!t&&i?.value<=r?.value)return null;if(t||(t=`${i.value}${i.unit}`),!e){const t="px"===i.unit?i.value:16*i.value,n=Math.min(Math.max(1-.075*Math.log2(t),.25),.75),o=cC(i.value*n,3);e=r?.value&&o{const i=Array.isArray(t)?t:t.split(".");let r=e;return i.forEach(e=>{r=r?.[e]}),r??n},pC="body",fC=":root",mC=[{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)=>dC(e,t),valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]},{path:["spacing","spacingSizes"],valueKey:"size",cssVarInfix:"spacing",valueFunc:({size:e})=>e,classes:[]},{path:["border","radiusSizes"],valueKey:"size",cssVarInfix:"border-radius",classes:[]},{path:["dimensions","dimensionSizes"],valueKey:"size",cssVarInfix:"dimension",classes:[]}];function gC(e,t){if(!e||!t)return t;const n=e.split(","),i=t.split(","),r=[];return n.forEach(e=>{i.forEach(t=>{r.push(`${e.trim()} ${t.trim()}`)})}),r.join(", ")}function bC(e,t){if(!e||!t)return e;const n=function(e,t){if(!e||!t)return e;if("object"==typeof e&&"ref"in e&&e?.ref){const n=Ex(hC(t,e.ref));if("object"==typeof n&&null!==n&&"ref"in n&&n?.ref)return;return void 0===n?e:n}return e}(e,t);return"object"==typeof n&&null!==n&&"url"in n&&n?.url&&(n.url=function(e,t){if(!e||!t||!Array.isArray(t))return e;const n=t.find(t=>t?.name===e);return n?.href?n?.href:e}(n.url,t?._links?.["wp:theme-file"])),n}function yC(e,t,n=[],i="slug",r){const o=[t?hC(e,["blocks",t,...n]):void 0,hC(e,n)].filter(Boolean);for(const s of o)if(s){const o=["custom","theme","default"];for(const a of o){const o=s[a];if(o){const s=o.find(e=>e[i]===r);if(s)return"slug"===i||yC(e,t,n,"slug",s.slug)[i]===s[i]?s:void 0}}}}function vC(e,t,n){if(!n||"string"!=typeof n){if("object"!=typeof n||null===n||!("ref"in n)||"string"!=typeof n.ref)return n;{const t=hC(e,n.ref);if(!t||"object"==typeof t&&"ref"in t)return t;n=t}}let i;if(n.startsWith("var:"))i=n.slice(4).split("|");else{if(!n.startsWith("var(--wp--")||!n.endsWith(")"))return n;i=n.slice(10,-1).split("--")}const[r,...o]=i;return"preset"===r?function(e,t,n,[i,r]=[]){const o=mC.find(e=>e.cssVarInfix===i);if(!o||!e.settings)return n;const s=yC(e.settings,t,o.path,"slug",r);if(s){const{valueKey:n}=o;return vC(e,t,s[n])}return n}(e,t,n,o):"custom"===r?function(e,t,n,i=[]){const r=(t?hC(e?.settings??{},["blocks",t,"custom",...i]):void 0)??hC(e?.settings??{},["custom",...i]);return r?vC(e,t,r):n}(e,t,n,o):n}var _C=n(1452),xC=n(44208),kC=n(39632),wC=n(5296),CC=n(51620),SC=n(25638),AC=n(13121),IC=n(87452),EC=(0,Er.jsx)(AC.t4,{className:"components-placeholder__illustration",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60",preserveAspectRatio:"none",children:(0,Er.jsx)(AC.wA,{vectorEffect:"non-scaling-stroke",d:"M60 60 0 0"})}),jC=function(e){const{icon:t,children:n,label:i,instructions:r,className:o,notices:s,preview:a,isColumnLayout:l,withIllustration:c,...u}=e,[d,{width:h}]=(0,SC.A)();let p;"number"==typeof h&&(p={"is-large":h>=480,"is-medium":h>=160&&h<480,"is-small":h<160});const f=(0,mh.A)("components-placeholder",o,p,c?"has-illustration":null),m=(0,mh.A)("components-placeholder__fieldset",{"is-column-layout":l});return(0,T.useEffect)(()=>{r&&(0,dt.L)(r)},[r]),(0,Er.jsxs)("div",{...u,className:f,children:[c?EC:null,d,s,a&&(0,Er.jsx)("div",{className:"components-placeholder__preview",children:a}),(0,Er.jsxs)("div",{className:"components-placeholder__label",children:[(0,Er.jsx)(IC.A,{icon:t}),i]}),!!r&&(0,Er.jsx)("div",{className:"components-placeholder__instructions",children:r}),(0,Er.jsx)("div",{className:m,children:n})]})},TC=n(58270),BC=n(7962);function NC(e){const t=Array.from(e.files);return Array.from(e.items).forEach(e=>{const n=e.getAsFile();n&&!t.find(({name:e,type:t,size:i})=>e===n.name&&t===n.type&&i===n.size)&&t.push(n)}),t}var RC=n(14735);function OC({dropZoneElement:e,isDisabled:t,onDrop:n,onDragStart:i,onDragEnter:r,onDragLeave:o,onDragEnd:s,onDragOver:a}){const l=(0,RC.A)(n),c=(0,RC.A)(i),u=(0,RC.A)(r),d=(0,RC.A)(o),h=(0,RC.A)(s),p=(0,RC.A)(a);return(0,bt.A)(f=>{if(t)return;const m=e??f;let g=!1;const{ownerDocument:b}=m;function y(e){g||(g=!0,b.addEventListener("dragend",w),b.addEventListener("mousemove",w),i&&c(e))}function v(e){e.preventDefault(),m.contains(e.relatedTarget)||r&&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)||o&&d(e)}function k(e){e.defaultPrevented||(e.preventDefault(),e.dataTransfer&&e.dataTransfer.files.length,n&&l(e),w(e))}function w(e){g&&(g=!1,b.removeEventListener("dragend",w),b.removeEventListener("mousemove",w),s&&h(e))}return m.setAttribute("data-is-drop-zone","true"),m.addEventListener("drop",k),m.addEventListener("dragenter",v),m.addEventListener("dragover",_),m.addEventListener("dragleave",x),b.addEventListener("dragenter",y),()=>{m.removeAttribute("data-is-drop-zone"),m.removeEventListener("drop",k),m.removeEventListener("dragenter",v),m.removeEventListener("dragover",_),m.removeEventListener("dragleave",x),b.removeEventListener("dragend",w),b.removeEventListener("mousemove",w),b.removeEventListener("dragenter",y)}},[t,e])}var LC=function({className:e,icon:t=BC.A,label:n,onFilesDrop:i,onHTMLDrop:r,onDrop:o,isEligible:s=()=>!0,...a}){const[l,c]=(0,T.useState)(),[u,d]=(0,T.useState)(),[h,p]=(0,T.useState)(),f=OC({onDrop(e){if(!e.dataTransfer)return;const t=NC(e.dataTransfer),n=e.dataTransfer.getData("text/html");n&&r?r(n):t.length&&i?i(t):o&&o(e)},onDragStart(e){c(!0),e.dataTransfer&&(e.dataTransfer.types.includes("text/html")?p(!!r):e.dataTransfer.types.includes("Files")||NC(e.dataTransfer).length>0?p(!!i):p(!!o&&s(e.dataTransfer)))},onDragEnd(){d(!1),c(!1),p(void 0)},onDragEnter(){d(!0)},onDragLeave(){d(!1)}}),m=(0,mh.A)("components-drop-zone",e,{"is-active":h,"is-dragging-over-document":l,"is-dragging-over-element":u});return(0,Er.jsx)("div",{...a,ref:f,className:m,children:(0,Er.jsx)("div",{className:"components-drop-zone__content",children:(0,Er.jsxs)("div",{className:"components-drop-zone__content-inner",children:[(0,Er.jsx)(xx.A,{icon:t,className:"components-drop-zone__content-icon"}),(0,Er.jsx)("span",{className:"components-drop-zone__content-text",children:n||(0,ee.__)("Drop files to upload")})]})})})},MC=n(73047);function PC({onDragStart:e,onDragMove:t,onDragEnd:n}){const[i,r]=(0,T.useState)(!1),o=(0,T.useRef)({onDragStart:e,onDragMove:t,onDragEnd:n});(0,MC.A)(()=>{o.current.onDragStart=e,o.current.onDragMove=t,o.current.onDragEnd=n},[e,t,n]);const s=(0,T.useCallback)(e=>o.current.onDragMove&&o.current.onDragMove(e),[]),a=(0,T.useCallback)(e=>{o.current.onDragEnd&&o.current.onDragEnd(e),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a),r(!1)},[]),l=(0,T.useCallback)(e=>{o.current.onDragStart&&o.current.onDragStart(e),document.addEventListener("mousemove",s),document.addEventListener("mouseup",a),r(!0)},[]);return(0,T.useEffect)(()=>()=>{i&&(document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a))},[i]),{startDrag:l,endDrag:a,isDragging:i}}var DC=n(36629),FC=n(24626),zC={width:200,height:170},VC=["avi","mpg","mpeg","mov","mp4","m4v","ogg","ogv","webm","wmv"];function UC(e){return Math.round(100*e)}var $C=(0,ex.A)(qw.A,{target:"eeew7dm9"})("border:0;padding:0;margin:0;font-family:",(0,DC.g)("default.fontFamily"),";font-size:",(0,DC.g)("default.fontSize"),";",FC.r,";"),HC=(0,ex.A)("div",{target:"eeew7dm8"})({name:"jqnsxy",styles:"background-color:transparent;display:flex;text-align:center;width:100%"}),WC=(0,ex.A)("div",{target:"eeew7dm7"})("align-items:center;border-radius:",rx.A.radiusSmall,";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:100%;}"),GC=(0,ex.A)("div",{target:"eeew7dm6"})("background:",nx.l.gray[100],";border-radius:inherit;box-sizing:border-box;height:",zC.height,"px;max-width:280px;min-width:",zC.width,"px;width:100%;"),qC=(0,ex.A)(vx,{target:"eeew7dm5"})({name:"1d3w5wq",styles:"width:100%"}),KC={name:"1mn7kwb",styles:"padding-bottom:1em"},YC=({hasHelpText:e=!1})=>e?KC:void 0,JC=(0,ex.A)(Kv.A,{target:"eeew7dm4"})("max-width:320px;padding-top:1em;",YC,";"),XC=(0,ex.A)("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,";"),ZC=(0,ex.A)("div",{target:"eeew7dm2"})({name:"1yzbo24",styles:"background:rgba( 255, 255, 255, 0.4 );backdrop-filter:blur( 16px ) saturate( 180% );position:absolute;transform:translateZ( 0 )"}),QC=(0,ex.A)(ZC,{target:"eeew7dm1"})({name:"1sw8ur",styles:"height:1px;left:1px;right:1px"}),eS=(0,ex.A)(ZC,{target:"eeew7dm0"})({name:"188vg4t",styles:"width:1px;top:1px;bottom:1px"}),tS=()=>{};function nS({hasHelpText:e,onChange:t=tS,point:n={x:.5,y:.5}}){const i=UC(n.x),r=UC(n.y),o=(e,i)=>{if(void 0===e)return;const r=parseInt(e,10);isNaN(r)||t({...n,[i]:r/100})};return(0,Er.jsxs)(JC,{className:"focal-point-picker__controls",hasHelpText:e,gap:4,children:[(0,Er.jsx)(iS,{label:(0,ee.__)("Left"),"aria-label":(0,ee.__)("Focal point left position"),value:[i,"%"].join(""),onChange:e=>o(e,"x"),dragDirection:"e"}),(0,Er.jsx)(iS,{label:(0,ee.__)("Top"),"aria-label":(0,ee.__)("Focal point top position"),value:[r,"%"].join(""),onChange:e=>o(e,"y"),dragDirection:"s"})]})}function iS(e){return(0,Er.jsx)(qC,{__next40pxDefaultSize:!0,className:"focal-point-picker__controls-position-unit-control",labelPosition:"top",max:100,min:0,units:[{value:"%",label:"%"}],...e})}var rS=(0,ex.A)("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:",rx.A.radiusRound,";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 oS({left:e="50%",top:t="50%",...n}){const i={left:e,top:t};return(0,Er.jsx)(rS,{...n,className:"components-focal-point-picker__icon_container",style:i})}function sS({bounds:e,...t}){return(0,Er.jsxs)(XC,{...t,className:"components-focal-point-picker__grid",style:{width:e.width,height:e.height},children:[(0,Er.jsx)(QC,{style:{top:"33%"}}),(0,Er.jsx)(QC,{style:{top:"66%"}}),(0,Er.jsx)(eS,{style:{left:"33%"}}),(0,Er.jsx)(eS,{style:{left:"66%"}})]})}function aS({alt:e,autoPlay:t,src:n,onLoad:i,mediaRef:r,muted:o=!0,...s}){return n?function(e=""){return!!e&&(e.startsWith("data:video/")||VC.includes(function(e=""){const t=e.split(".");return t[t.length-1]}(e)))}(n)?(0,Er.jsx)("video",{...s,autoPlay:t,className:"components-focal-point-picker__media components-focal-point-picker__media--video",loop:!0,muted:o,onLoadedData:i,ref:r,src:n}):(0,Er.jsx)("img",{...s,alt:e,className:"components-focal-point-picker__media components-focal-point-picker__media--image",onLoad:i,ref:r,src:n}):(0,Er.jsx)(GC,{className:"components-focal-point-picker__media components-focal-point-picker__media--placeholder",ref:r,...s})}var lS=n(28316),cS=function({__nextHasNoMarginBottom:e,autoPlay:t=!0,className:n,help:i,hideLabelFromVision:r,label:o,onChange:s,onDrag:a,onDragEnd:l,onDragStart:c,resolvePoint:u,url:d,value:h={x:.5,y:.5},...p}){const[f,m]=(0,T.useState)(h),[g,b]=(0,T.useState)(!1),{startDrag:y,endDrag:v,isDragging:_}=PC({onDragStart:e=>{w.current?.focus();const t=I(e);t&&(c?.(t,e),m(t))},onDragMove:e=>{e.preventDefault();const t=I(e);t&&(a?.(t,e),m(t))},onDragEnd:()=>{l?.(),s?.(f)}}),{x,y:k}=_?f:h,w=(0,T.useRef)(null),[C,S]=(0,T.useState)(zC),A=(0,T.useRef)(()=>{if(!w.current)return;const{clientWidth:e,clientHeight:t}=w.current;S(e>0&&t>0?{width:e,height:t}:{...zC})});(0,T.useEffect)(()=>{const e=A.current;if(!w.current)return;const{defaultView:t}=w.current.ownerDocument;return t?.addEventListener("resize",e),()=>t?.removeEventListener("resize",e)},[]),(0,MC.A)(()=>{A.current()},[]);const I=({clientX:e,clientY:t,shiftKey:n})=>{if(!w.current)return;const{top:i,left:r}=w.current.getBoundingClientRect();let o=(e-r)/C.width,s=(t-i)/C.height;return n&&(o=.1*Math.round(o/.1),s=.1*Math.round(s/.1)),E({x:o,y:s})},E=e=>{const t=u?.(e)??e;t.x=Math.max(0,Math.min(t.x,1)),t.y=Math.max(0,Math.min(t.y,1));const n=e=>Math.round(100*e)/100;return{x:n(t.x),y:n(t.y)}},j={left:void 0!==x?x*C.width:.5*C.width,top:void 0!==k?k*C.height:.5*C.height},B=(0,mh.A)("components-focal-point-picker-control",n),N=r?kC.A:Aw.Gw;return(0,lS.A)(()=>{b(!0);const e=window.setTimeout(()=>{b(!1)},600);return()=>window.clearTimeout(e)},[x,k]),(0,Er.jsxs)($C,{...p,as:"fieldset",className:B,children:[!!o&&(0,Er.jsx)(N,{as:"legend",children:o}),(0,Er.jsx)(HC,{className:"components-focal-point-picker-wrapper",children:(0,Er.jsxs)(WC,{className:"components-focal-point-picker",onKeyDown:e=>{const{code:t,shiftKey:n}=e;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t))return;e.preventDefault();const i={x,y:k},r=n?.1:.01,o="ArrowUp"===t||"ArrowLeft"===t?-1*r:r,a="ArrowUp"===t||"ArrowDown"===t?"y":"x";i[a]=i[a]+o,s?.(E(i))},onMouseDown:y,onBlur:()=>{_&&v()},ref:w,role:"button",tabIndex:-1,children:[(0,Er.jsx)(sS,{bounds:C,showOverlay:g}),(0,Er.jsx)(aS,{alt:(0,ee.__)("Media preview"),autoPlay:t,onLoad:A.current,src:d}),(0,Er.jsx)(oS,{...j,isDragging:_})]})}),(0,Er.jsx)(nS,{hasHelpText:!!i,point:{x,y:k},onChange:e=>{s?.(E(e))}}),!!i&&(0,Er.jsx)(Aw.te,{children:i})]})},uS=n(26678),dS=n(14401),hS=n(10488),pS=n(32455),fS=function({accept:e,children:t,multiple:n=!1,onChange:i,onClick:r,render:o,...s}){const a=(0,T.useRef)(null),l=()=>{a.current?.click()};o||(0,bx.M)({componentName:"FormFileUpload",__next40pxDefaultSize:s.__next40pxDefaultSize,size:s.size});const c=o?o({openFileDialog:l}):(0,Er.jsx)(fv.Ay,{onClick:l,...s,children:t}),u=e?.includes("audio/*")?`${e}, audio/mp3, audio/x-m4a, audio/x-m4b, audio/x-m4p, audio/x-wav, audio/webm`:e;return(0,Er.jsxs)("div",{className:"components-form-file-upload",children:[c,(0,Er.jsx)("input",{type:"file",ref:a,multiple:n,style:{display:"none"},accept:u,onChange:i,onClick:r,"data-testid":"form-file-upload-input"})]})},mS=n(90025);function gS(e){return(0,gh.f)(t=>{const n="core/with-filters/"+e;let i;class r extends T.Component{constructor(n){super(n),void 0===i&&(i=(0,Ei.W5)(e,t))}componentDidMount(){r.instances.push(this),1===r.instances.length&&((0,Ei.ip)("hookRemoved",n,s),(0,Ei.ip)("hookAdded",n,s))}componentWillUnmount(){r.instances=r.instances.filter(e=>e!==this),0===r.instances.length&&((0,Ei.V5)("hookRemoved",n),(0,Ei.V5)("hookAdded",n))}render(){return(0,Er.jsx)(i,{...this.props})}}r.instances=[];const o=(0,mS.s)(()=>{i=(0,Ei.W5)(e,t),r.instances.forEach(e=>{e.forceUpdate()})},16);function s(t){t===e&&o()}return r},"withFilters")}var bS=n(75390),yS=n(6575),vS=n(39662),_S=gS("editor.MediaUpload")(()=>null),xS=function({fallback:e=null,children:t}){const n=(0,zt.A)(e=>{const{getSettings:t}=e(Qy);return!!t().mediaUpload},[]);return n?t:e},kS=n(19718),wS=n(14755),CS=n(93697),SS=n(72738),AS=n(64764),IS=n(52573),ES=n(35861),jS=n(68665),TS=n(18603),BS=n(95408),NS=n(320),RS=n(50006),OS=n(44645),LS=n(94750),MS=function e({children:t,settingsOpen:n,setSettingsOpen:i}){const r=(0,LS.A)(),o=r?T.Fragment:BS.N,s=r?"div":NS.P.div,a=`link-control-settings-drawer-${(0,SS.A)(e)}`;return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,className:"block-editor-link-control__drawer-toggle","aria-expanded":n,onClick:()=>i(!n),icon:(0,ee.isRTL)()?RS.A:OS.A,"aria-controls":a,children:(0,ee._x)("Advanced","Additional link settings")}),(0,Er.jsx)(o,{children:n&&(0,Er.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,Er.jsx)("div",{className:"block-editor-link-control__drawer-inner",children:t})})})]})},PS=n(9936),DS=n(48538),FS=(0,gh.f)(e=>class extends T.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,Er.jsx)(e,{...this.props,setTimeout:this.setTimeout,clearTimeout:this.clearTimeout})}},"withSafeTimeout"),zS=FS,VS=n(11011),US=n(42134),{ValidatedInputControl:$S}=Gh(Ev.j);function HS(e){return"function"==typeof e}var WS=class extends T.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,T.createRef)(),this.inputRef=e.inputRef||(0,T.createRef)(),this.hasRenderedValidation={current:!1},this.updateSuggestions=(0,mS.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:i,__experimentalShowInitialSuggestions:r=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&this.suggestionNodes[n].scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}),e.value===i||this.props.disableSuggestions||(i?.length?this.updateSuggestions(i):r&&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 i=!e?.length;if(e=e.trim(),!i&&(e.length<2||!n&&(0,TS.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 r=t(e,{isInitialSuggestions:i});r.then(t=>{this.suggestionsRequest===r&&(this.setState({suggestions:t,suggestionsValue:e,loading:!1,showSuggestions:!!t.length}),t.length?this.props.debouncedSpeak((0,ee.sprintf)((0,ee._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,ee.__)("No results."),"assertive"))}).catch(()=>{this.suggestionsRequest===r&&this.setState({loading:!1})}).finally(()=>{this.suggestionsRequest===r&&(this.suggestionsRequest=null)}),this.suggestionsRequest=r}onChange(e){this.props.onChange(e)}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:i,loading:r}=this.state;if(!t||!i.length||r){switch(e.keyCode){case Rt.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case Rt.PX:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case Rt.Fm:this.props.onSubmit&&(e.preventDefault(),this.props.onSubmit(null,e))}return}const o=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case Rt.UP:{e.preventDefault();const t=n?n-1:i.length-1;this.setState({selectedSuggestion:t});break}case Rt.PX:{e.preventDefault();const t=null===n||n===i.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case Rt.wn:null!==this.state.selectedSuggestion&&(this.selectLink(o),this.props.speak((0,ee.__)("Link selected.")));break;case Rt.Fm:e.preventDefault(),null!==this.state.selectedSuggestion?(this.selectLink(o),this.props.onSubmit&&this.props.onSubmit(o,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:i=!1},{showSuggestions:r}){let o=r;const s=e&&e.length;return i||s||(o=!1),!0===n&&(o=!1),{showSuggestions:o,suggestionsListboxId:`block-editor-url-input-suggestions-${t}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${t}`}}render(){return(0,Er.jsxs)(Er.Fragment,{children:[this.renderControl(),this.renderSuggestions()]})}renderControl(){const{label:e=null,className:t,isFullWidth:n,instanceId:i,placeholder:r=(0,ee.__)("Paste URL or type to search"),__experimentalRenderControl:o,value:s="",hideLabelFromVision:a=!1,help:l=null,disabled:c=!1,customValidity:u,markWhenOptional:d}=this.props,{loading:h,showSuggestions:p,selectedSuggestion:f,suggestionsListboxId:m,suggestionOptionIdPrefix:g}=this.state,b=`url-input-control-${i}`,y={id:b,label:e,className:(0,mh.A)("block-editor-url-input",t,{"is-full-width":n}),hideLabelFromVision:a},v={id:b,value:s,required:this.props.required??!0,type:"text",name:b,autoComplete:"off",onChange:c?()=>{}:this.onChange,onFocus:c?()=>{}:this.onFocus,placeholder:r,onKeyDown:c?()=>{}:this.onKeyDown,role:"combobox","aria-label":e?void 0:(0,ee.__)("URL"),"aria-expanded":p,"aria-autocomplete":"list","aria-owns":m,"aria-activedescendant":null!==f?`${g}-${f}`:void 0,ref:this.inputRef,disabled:c,suffix:this.props.suffix,help:l},_={customValidity:u,...void 0!==d&&{markWhenOptional:d}};if(o)return o(y,v,h);void 0!==u&&(this.hasRenderedValidation.current=!0);const x=this.hasRenderedValidation.current?$S:PS.Ay;return(0,Er.jsxs)(mk.Ay,{...y,children:[(0,Er.jsx)(x,{...v,...this.hasRenderedValidation.current?_:{},__next40pxDefaultSize:!0}),h&&(0,Er.jsx)(TC.Ay,{})]})}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t}=this.props,{showSuggestions:n,suggestions:i,suggestionsValue:r,selectedSuggestion:o,suggestionsListboxId:s,suggestionOptionIdPrefix:a,loading:l}=this.state;if(!n||0===i.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===o||void 0});return HS(t)?t({suggestions:i,selectedSuggestion:o,suggestionsListProps:c,buildSuggestionItemProps:u,isLoading:l,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!r?.length,currentInputValue:r}):(0,Er.jsx)(uw.Ay,{placement:"bottom",focusOnMount:!1,children:(0,Er.jsx)("div",{...c,className:(0,mh.A)("block-editor-url-input__suggestions",{[`${e}__suggestions`]:e}),children:i.map((e,t)=>(0,T.createElement)(fv.Ay,{__next40pxDefaultSize:!0,...u(0,t),key:e.id,className:(0,mh.A)("block-editor-url-input__suggestion",{"is-selected":t===o}),onClick:()=>this.handleOnClick(e)},e.title))})})}},GS=(0,z.A)(zS,DS.A,VS.A,(0,US.A)((e,t)=>{if(HS(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(Qy);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}}))(WS),qS=n(27314),KS=({searchTerm:e,onClick:t,itemProps:n,buttonText:i})=>{if(!e)return null;let r;return r=i?"function"==typeof i?i(e):i:(0,qS.A)((0,ee.sprintf)((0,ee.__)("Create: %s"),e),{mark:(0,Er.jsx)("mark",{})}),(0,Er.jsx)(zv.A,{...n,iconPosition:"left",icon:kw.A,className:"block-editor-link-control__search-item",onClick:t,children:r})},YS=e=>{const{text:t="",highlight:n=""}=e,i=n.trim();if(!i)return(0,Er.jsx)(Er.Fragment,{children:t});const r=new RegExp(`(${(0,mx.Nt)(i)})`,"gi");return(0,qS.A)(t.replace(r,"$&"),{mark:(0,Er.jsx)("mark",{})})};YS.displayName="TextHighlight";var JS=YS,XS=n(89120),ZS=n(83364),QS=n(51615),eA=n(94333),tA=n(6943),nA=n(16376),iA=n(14220),rA=n(83368),oA=n(24698),sA=n(13683),aA=n(75414),lA={post:{icon:XS.A,label:(0,ee.__)("Post")},page:{icon:ZS.A,label:(0,ee.__)("Page")},post_tag:{icon:QS.A,label:(0,ee.__)("Tag")},category:{icon:eA.A,label:(0,ee.__)("Category")},attachment:{icon:tA.A,label:(0,ee.__)("Attachment")}};function cA({isURL:e,suggestion:t}){let n=null;return e?n=nA.A:t.type in lA&&(n=lA[t.type].icon,"page"===t.type&&(t.isFrontPage&&(n=iA.A),t.isBlogHome&&(n=rA.A))),n?(0,Er.jsx)(xx.A,{className:"block-editor-link-control__search-item-icon",icon:n}):null}function uA(e){const t=e?.trim();return t?.length?e?.replace(/^\/?/,"/"):e}function dA(e){const t=e?.trim();return t?.length?e?.replace(/\/$/,""):e}function hA(e){return e.isFrontPage?(0,ee.__)("Front page"):e.isBlogHome?(0,ee.__)("Blog home"):e.type in lA?lA[e.type].label:e.type}var pA=({itemProps:e,suggestion:t,searchTerm:n,onClick:i,isURL:r=!1,shouldShowType:o=!1})=>{const s=r?(0,ee.__)("Press ENTER to add this link"):(a=t.url)?(0,Eh.h)(oA.S,sA.Y,e=>null==e||e!=e?"":e,((e,...t)=>(...n)=>e(...n,...t))(aA.r,24),dA,uA)(a):a;var a;return(0,Er.jsx)(zv.A,{...e,info:s,iconPosition:"left",icon:(0,Er.jsx)(cA,{suggestion:t,isURL:r}),onClick:i,shortcut:o&&hA(t),className:"block-editor-link-control__search-item",children:(0,Er.jsx)(JS,{text:ae(t.title),highlight:n})})},fA="__CREATE__",mA="link",gA="mailto",bA="internal",yA=[mA,gA,"tel",bA],vA=[{id:"opensInNewTab",title:(0,ee.__)("Open in new tab")}];var _A=function({withCreateSuggestion:e,currentInputValue:t,handleSuggestionClick:n,suggestionsListProps:i,buildSuggestionItemProps:r,suggestions:o,selectedSuggestion:s,isLoading:a,isInitialSuggestions:l,createSuggestionButtonText:c,suggestionsQuery:u}){const d=(0,mh.A)("block-editor-link-control__search-results",{"is-loading":a}),h=1===o.length&&yA.includes(o[0].type),p=e&&!h&&!l,f=!u?.type,m=l?(0,ee.__)("Suggestions"):(0,ee.sprintf)((0,ee.__)('Search results for "%s"'),t);return(0,Er.jsx)("div",{className:"block-editor-link-control__search-results-wrapper",children:(0,Er.jsx)("div",{...i,className:d,"aria-label":m,children:(0,Er.jsx)(Fv.A,{children:o.map((e,i)=>p&&fA===e.type?(0,Er.jsx)(KS,{searchTerm:t,buttonText:c,onClick:()=>n(e),itemProps:r(e,i),isSelected:i===s},e.type):fA===e.type?null:(0,Er.jsx)(pA,{itemProps:r(e,i),suggestion:e,index:i,onClick:()=>{n(e)},isSelected:i===s,isURL:yA.includes(e.type),searchTerm:t,shouldShowType:f,isFrontPage:e?.isFrontPage,isBlogHome:e?.isBlogHome},`${e.id}-${e.type}`))})})})},xA=n(13219),kA=n(45834),wA=n(49959);function CA(e){return e?.startsWith("#")&&(0,xA.R)(e)}function SA(e){return e?.startsWith("/")||e?.startsWith("./")||e?.startsWith("../")}function AA(e){if(e.includes(" "))return!1;const t=(0,kA.J)(e),n=(0,wA.v)(t),i=function(e,t=6){const n=e.split(/[?#]/)[0];return new RegExp(`(?<=\\S)\\.(?:[a-zA-Z_]{2,${t}})(?:\\/|$)`).test(n)}(e),r=e?.startsWith("www.");return n||r||CA(e)||i||SA(e)}function IA(e){const t=e?.trim();if(!t)return{url:t,type:mA};let n=mA;const i=(0,kA.J)(t)||"";return i.includes("mailto")?n=gA:i.includes("tel")?n="tel":t?.startsWith("#")&&(n=bA),CA(t)||SA(t)||t.startsWith("?")||i?{url:t,type:n}:{url:(0,jS.i)(t),type:n}}var EA=()=>Promise.resolve([]),jA=e=>{const{url:t,type:n}=IA(e);return Promise.resolve([{id:e,title:e,url:t,type:n}])};var TA=()=>Promise.resolve([]),BA=()=>{},NA=(0,T.forwardRef)(({value:e,children:t,currentLink:n={},className:i=null,placeholder:r=null,withCreateSuggestion:o=!1,onCreateSuggestion:s=BA,onChange:a=BA,onSelect:l=BA,showSuggestions:c=!0,renderSuggestions:u=e=>(0,Er.jsx)(_A,{...e}),fetchSuggestions:d=null,allowDirectEntry:h=!0,showInitialSuggestions:p=!1,suggestionsQuery:f={},withURLSuggestion:m=!0,createSuggestionButtonText:g,hideLabelFromVision:b=!1,suffix:y,isEntity:v=!1,customValidity:_},x)=>{const k=function(e,t,n){const{fetchSearchSuggestions:i,pageOnFront:r,pageForPosts:o}=(0,zt.A)(e=>{const{getSettings:t}=e(Qy);return{pageOnFront:t().pageOnFront,pageForPosts:t().pageForPosts,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}},[]),s=t?jA:EA;return(0,T.useCallback)((t,{isInitialSuggestions:a})=>AA(t)?s(t,{isInitialSuggestions:a}):(async(e,t,n,i,r,o)=>{const{isInitialSuggestions:s}=t,a=await n(e,t);return a.map(e=>Number(e.id)===r?(e.isFrontPage=!0,e):Number(e.id)===o?(e.isBlogHome=!0,e):e),s||AA(e)||!i?a:a.concat({title:e,url:e,type:fA})})(t,{...e,isInitialSuggestions:a},i,n,r,o),[s,i,r,o,e,n])}(f,h,o),w=c?d||k:TA,[C,S]=(0,T.useState)(),A=async e=>{let t=e;if(fA!==e.type){if(h||t&&Object.keys(t).length>=1){const{id:e,url:i,kind:r,type:o,...s}=n??{};l({...s,...t},t)}}else try{t=await s(e.title),t?.url&&l(t)}catch{}},I=r??(0,ee.__)("Search or type URL"),E=b&&""!==r?I:(0,ee.__)("Link");return(0,Er.jsxs)("div",{className:"block-editor-link-control__search-input-container",children:[(0,Er.jsx)(GS,{disableSuggestions:n?.url===e,label:E,hideLabelFromVision:b,className:i,value:e,onChange:(e,t)=>{a(e),S(t)},placeholder:I,__experimentalRenderSuggestions:c?e=>u({...e,withCreateSuggestion:o,createSuggestionButtonText:g,suggestionsQuery:f,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),A(t)}}):null,__experimentalFetchLinkSuggestions:w,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:p,customValidity:_,required:!1,onSubmit:(t,n)=>{const i=t||C;i||e?.trim()?.length?A(i||{url:e}):n.preventDefault()},inputRef:x,suffix:y,disabled:v}),t]})}),RA=NA,OA=n(17741),LA=n(50065),MA=n(60713),PA=n(19730),DA=n(63344),{Slot:FA,Fill:zA}=(0,Sv.QJ)("BlockEditorLinkControlViewer");function VA(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}`)}}var UA=function(e){const[t,n]=(0,T.useReducer)(VA,{richData:null,isFetching:!1}),{fetchRichUrlData:i}=(0,zt.A)(e=>{const{getSettings:t}=e(Qy);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}},[]);return(0,T.useEffect)(()=>{if(e?.length&&i&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,r=t.signal;return i(e,{signal:r}).then(e=>{n({type:"RESOLVED",richData:e})}).catch(()=>{r.aborted||n({type:"ERROR"})}),()=>{t.abort()}}},[e]),t},{Badge:$A}=Gh(Ev.j);function HA({value:e,onEditClick:t,hasRichPreviews:n=!1,hasUnlinkControl:i=!1,onRemove:r}){const o=(0,zt.A)(e=>e(Ob.M).get("core","showIconLabels"),[]),s=n?e?.url:null,{richData:a,isFetching:l}=UA(s),c=a&&Object.keys(a).length,u=e&&(0,aA.r)((0,oA.S)(e.url),24)||"",d=!e?.url?.length,h=!d&&ae(e?.entityTitle||a?.title||e?.title||u);let p;p=a?.icon?(0,Er.jsx)("img",{src:a?.icon,alt:""}):d?(0,Er.jsx)(xx.A,{icon:MA.A,size:32}):(0,Er.jsx)(xx.A,{icon:nA.A});const{createNotice:f}=(0,Vt.A)(Rb.store),m=(0,LA.Ay)(e.url,()=>{f("info",(0,ee.__)("Link copied to clipboard."),{isDismissible:!0,type:"snackbar"})});return(0,Er.jsx)(Kv.A,{role:"group","aria-label":(0,ee.__)("Manage link"),className:(0,mh.A)("block-editor-link-control__preview",{"is-current":!0,"is-rich":c,"is-fetching":!!l,"is-preview":!0,"is-error":d,"is-url-title":h===u}),children:(0,Er.jsxs)(Kv.A,{gap:0,align:"flex-start",children:[(0,Er.jsxs)(Kv.A,{className:"block-editor-link-control__link-information",role:"figure","aria-label":(0,ee.__)("Link information"),justify:"start",align:"flex-start",children:[e?.image?(0,Er.jsx)(Kv.A,{className:"block-editor-link-control__preview-image",justify:"center",children:(0,Er.jsx)("img",{src:e?.image,alt:""})}):(0,Er.jsx)(Kv.A,{className:(0,mh.A)("block-editor-link-control__preview-icon",{"is-image":a?.icon}),justify:"center",children:p}),(0,Er.jsx)(Kv.A,{className:"block-editor-link-control__preview-details",direction:"column",gap:2,children:d?(0,Er.jsx)("span",{className:"block-editor-link-control__preview-error-notice",children:(0,ee.__)("Link is empty")}):(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(OA.A,{className:"block-editor-link-control__preview-title",href:e.url,children:(0,Er.jsx)(xC.A,{numberOfLines:1,children:h})}),(0,Er.jsx)("span",{className:"block-editor-link-control__preview-info",children:(0,Er.jsx)(xC.A,{numberOfLines:1,children:u})}),e?.badges?.length>0&&(0,Er.jsx)(Cw.A,{className:"block-editor-link-control__preview-badges",alignment:"left",gap:1,children:e.badges.map((e,t)=>(0,Er.jsx)($A,{intent:e.intent,children:e.label},`${e.label}|${e.intent}|${t}`))})]})})]}),(0,Er.jsx)(fv.Ay,{icon:PA.A,label:(0,ee.__)("Edit link"),onClick:t,size:"compact",showTooltip:!o}),i&&(0,Er.jsx)(fv.Ay,{icon:IS.A,label:(0,ee.__)("Remove link"),onClick:r,size:"compact",showTooltip:!o}),(0,Er.jsx)(fv.Ay,{icon:DA.A,label:(0,ee.__)("Copy link"),ref:m,accessibleWhenDisabled:!0,disabled:d,size:"compact",showTooltip:!o}),(0,Er.jsx)(FA,{fillProps:e})]})})}var WA=n(15172),GA=()=>{},qA=({value:e,onChange:t=GA,settings:n})=>{if(!n||!n.length)return null;const i=n=>i=>{t({...e,[n.id]:i})},r=n.map(n=>{if("render"in n){if("function"==typeof n.render){const i=n.render(n,e,t);return(0,Er.jsx)("div",{className:"block-editor-link-control__setting",children:i},n.id)}return null}return(0,Er.jsx)(WA.A,{className:"block-editor-link-control__setting",label:n.title,onChange:i(n),checked:!!e&&!!e[n.id],help:n?.help},n.id)}).filter(Boolean);return(0,Er.jsxs)("fieldset",{className:"block-editor-link-control__settings",children:[(0,Er.jsx)(kC.A,{as:"legend",children:(0,ee.__)("Currently selected link settings")}),r]})},KA=n(7040),YA=()=>{},JA="core/block-editor",XA="linkControlSettingsDrawer";function ZA({searchInputPlaceholder:e,value:t,settings:n=vA,onChange:i=YA,onInputChange:r,onRemove:o,onCancel:s,noDirectEntry:a=!1,showSuggestions:l=!0,showInitialSuggestions:c,forceIsEditingLink:u,createSuggestion:d,withCreateSuggestion:h,inputValue:p="",suggestionsQuery:f={},noURLSuggestion:m=!1,createSuggestionButtonText:g,hasRichPreviews:b=!1,hasTextControl:y=!1,renderControlBottom:v=null,handleEntities:_=!1}){void 0===h&&d&&(h=!0);const[x,k]=(0,T.useState)(!1),[w,C]=(0,T.useState)(void 0),{advancedSettingsPreference:S}=(0,zt.A)(e=>({advancedSettingsPreference:e(Ob.M).get(JA,XA)??!1}),[]),{set:A}=(0,Vt.A)(Ob.M),I=S||x,E=(0,T.useRef)(!0),j=(0,T.useRef)(),B=(0,T.useRef)(),N=(0,T.useRef)(),R=(0,T.useRef)(),O=n.map(({id:e})=>e),[L,M,P,D,F]=function(e){const[t,n]=(0,T.useState)(e||{}),[i,r]=(0,T.useState)(e);return KA(e,i)||(r(e),n(e)),[t,n,e=>{n({...t,url:e})},e=>{n({...t,title:e})},e=>i=>{const r=Object.keys(i).reduce((t,n)=>(e.includes(n)&&(t[n]=i[n]),t),{});n({...t,...r})}]}(t),z=_&&!!L?.id,V=(0,SS.A)(ZA,"link-control"),U=z?`${V}__help`:null,$=t&&!(0,AS.A)(L,t),[H,W]=(0,T.useState)(void 0!==u?u:!t||!t.url),{createPage:G,isCreatingPage:q,errorMessage:K}=function(e){const t=(0,T.useRef)(),[n,i]=(0,T.useState)(!1),[r,o]=(0,T.useState)(null);return(0,T.useEffect)(()=>()=>{t.current&&t.current.cancel()},[]),{createPage:async function(n){i(!0),o(null);try{return t.current=(e=>{let t=!1;return{promise:new Promise((n,i)=>{e.then(e=>t?i({isCanceled:!0}):n(e),e=>i(t?{isCanceled:!0}:e))}),cancel(){t=!0}}})(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw o(e.message||(0,ee.__)("An unknown error occurred during creation. Please try again.")),e}finally{i(!1)}},isCreatingPage:n,errorMessage:r}}(d);(0,T.useEffect)(()=>{void 0!==u&&W(u)},[u]),(0,T.useEffect)(()=>{E.current||(hS.XC.focusable.find(j.current)[0]||j.current).focus()},[H,q]),(0,T.useEffect)(()=>(E.current=!1,()=>{E.current=!0}),[]);const Y=(0,T.useRef)();(0,T.useEffect)(()=>{void 0!==Y.current?Y.current!==p&&(console.warn("LinkControl: The inputValue prop is uncontrolled and only sets the initial value. onInputChange is an observer for the input value. Changes to inputValue from the parent will not update the search input."),Y.current=p):Y.current=p},[p]),(0,T.useEffect)(()=>{if("invalid"===w?.type){const e=N.current;e&&"function"==typeof e.reportValidity&&e.reportValidity()}},[w]);const J=t?.url?.trim()?.length>0,X=()=>{W(!1)},Z=e=>{const t={type:"invalid",message:(0,ee.__)("Please enter a valid URL.")},n={type:"valid"},i=e?.trim();if(!i?.length||!AA(i))return t;if(CA(i)||SA(i))return n;const r=(0,jS.i)(i);return(0,TS.m)(r)?n:t},Q=()=>{(()=>{if(re)return!1;const e=ie.trim();if(L&&L.id&&L.type&&!yA.includes(L.type)&&t?.url===e)return C(void 0),!0;const n=Z(ie);return"invalid"===n.type?(C(n),!1):(C(void 0),!0)})()&&($&&i({...t,...L,url:IA(ie).url}),X(),C(void 0))},[te,ne]=(0,T.useState)(!1);(0,T.useEffect)(()=>{te&&(N.current?.focus(),ne(!1))},[te]);const ie=void 0!==L?.url?L.url:p||"",re=!ie?.trim()?.length;(0,T.useEffect)(()=>{C(void 0)},[ie]);const oe=o&&t&&!H&&!q,se=H&&J,ae=J&&y,le=(H||!t)&&!q,ce=re||!!w||t&&!$,ue=!!n?.length&&H&&J,de=(0,T.useMemo)(()=>"taxonomy"===t?.kind&&!t?.url&&R.current?{...t,url:R.current}:t,[t]);return(0,Er.jsxs)("div",{tabIndex:-1,ref:j,className:"block-editor-link-control",children:[q&&(0,Er.jsxs)("div",{className:"block-editor-link-control__loading",children:[(0,Er.jsx)(TC.Ay,{})," ",(0,ee.__)("Creating"),"…"]}),le&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsxs)("div",{className:(0,mh.A)({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":ae,"has-actions":se}),children:[ae&&(0,Er.jsx)(kS.A,{ref:B,className:"block-editor-link-control__field block-editor-link-control__text-content",label:(0,ee.__)("Text"),value:L?.title,onChange:D,onKeyDown:e=>{const{keyCode:t}=e;t!==Rt.Fm||re||(e.preventDefault(),Q())},__next40pxDefaultSize:!0}),(0,Er.jsx)(RA,{ref:N,currentLink:t,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:e,value:ie,withCreateSuggestion:h,onCreateSuggestion:G,onChange:e=>{P(e),r?.(e)},onSelect:e=>{if(!(e&&e.id&&e.type)||yA.includes(e.type)){const t=e?.url||ie,n=Z(t);if("invalid"===n.type)return void C(n);const{url:i}=IA(t);e={...e,url:i}}"taxonomy"===e?.kind&&e?.url&&(R.current=e.url);const t=Object.keys(e).reduce((t,n)=>(O.includes(n)||(t[n]=e[n]),t),{});i({...L,...t,title:L?.title||e?.title}),C(void 0),X()},showInitialSuggestions:c,allowDirectEntry:!a,showSuggestions:l,suggestionsQuery:f,withURLSuggestion:!m,createSuggestionButtonText:g,hideLabelFromVision:!ae,isEntity:z,customValidity:w,suffix:(0,Er.jsx)(QA,{isEntity:z,showActions:se,isDisabled:ce,onUnlink:()=>{const{id:e,kind:t,type:n,...i}=L;M({...i,id:void 0,kind:void 0,type:void 0,url:void 0}),ne(!0)},onSubmit:Q,helpTextId:U})}),z&&U&&(0,Er.jsx)("p",{id:U,className:"block-editor-link-control__help",children:(0,ee.sprintf)((0,ee.__)("Synced with the selected %s."),L?.type||"item")})]}),K&&(0,Er.jsx)(wS.A,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1,children:K})]}),t&&!H&&!q&&(0,Er.jsx)(HA,{value:de,onEditClick:()=>W(!0),hasRichPreviews:b,hasUnlinkControl:oe,onRemove:()=>{o(),W(!0)}},de?.url),ue&&(0,Er.jsx)("div",{className:"block-editor-link-control__tools",children:!re&&(0,Er.jsx)(MS,{settingsOpen:I,setSettingsOpen:e=>{A&&A(JA,XA,e),k(e)},children:(0,Er.jsx)(qA,{value:L,settings:n,onChange:F(O)})})}),se&&(0,Er.jsxs)(Cw.A,{justify:"right",className:"block-editor-link-control__search-actions",children:[(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:e=>{e.preventDefault(),e.stopPropagation(),M(t),C(void 0),J?X():o?.(),s?.()},children:(0,ee.__)("Cancel")}),(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,variant:"primary",onClick:ce?YA:Q,className:"block-editor-link-control__search-submit","aria-disabled":ce,children:(0,ee.__)("Apply")})]}),!q&&v&&v()]})}function QA({isEntity:e,showActions:t,isDisabled:n,onUnlink:i,onSubmit:r,helpTextId:o}){return e?(0,Er.jsx)(fv.Ay,{icon:IS.A,onClick:i,"aria-describedby":o,showTooltip:!0,label:(0,ee.__)("Unsync and edit"),__next40pxDefaultSize:!0}):t?void 0:(0,Er.jsx)(CS.A,{variant:"control",children:(0,Er.jsx)(fv.Ay,{onClick:n?YA:r,label:(0,ee.__)("Submit"),icon:ES.A,className:"block-editor-link-control__search-submit","aria-disabled":n,size:"small"})})}ZA.ViewerFill=zA,ZA.DEFAULT_LINK_SETTINGS=vA;var eI=e=>((0,Qt.A)("wp.blockEditor.__experimentalLinkControl",{since:"6.8",alternative:"wp.blockEditor.LinkControl"}),(0,Er.jsx)(ZA,{...e}));eI.ViewerFill=ZA.ViewerFill,eI.DEFAULT_LINK_SETTINGS=ZA.DEFAULT_LINK_SETTINGS;var tI=ZA;function nI(e,t,n){if(n)return n;if(!t||"object"!=typeof t||0===Object.keys(t).length)return e&&e.length>0?e.map(e=>`${e}/*`).join(","):void 0;if(!e||0===e.length)return;const i=[];for(const[,n]of Object.entries(t))e.some(e=>e.includes("/")?n===e:n.startsWith(`${e}/`))&&i.push(n);return i.length>0?i.join(","):e.map(e=>`${e}/*`).join(",")}var iI=()=>{},rI=0,oI=(0,z.A)([(0,bS.A)(e=>{const{createNotice:t,removeNotice:n}=e(Rb.store);return{createNotice:t,removeNotice:n}}),gS("editor.MediaReplaceFlow")])(({mediaURL:e,mediaId:t,mediaIds:n,allowedTypes:i,accept:r,onError:o,onSelect:s,onSelectURL:a,onReset:l,onToggleFeaturedImage:c,useFeaturedImage:u,onFilesUpload:d=iI,name:h=(0,ee.__)("Replace"),createNotice:p,removeNotice:f,children:m,multiple:g=!1,addToGallery:b,handleUpload:y=!0,variant:v,popoverProps:_,renderToggle:x,className:k})=>{const{mediaUpload:w,allowedMimeTypes:C}=(0,zt.A)(e=>{const{getSettings:t}=e(Qy),n=t();return{mediaUpload:n.mediaUpload,allowedMimeTypes:n.allowedMimeTypes}},[]),S="block-editor/media-replace-flow/error-notice/"+ ++rI,A=(0,T.useMemo)(()=>nI(i,C,r),[i,C,r]),I=e=>{const t=ae(e);o?o(t):setTimeout(()=>{p("error",t,{speak:!0,id:S,isDismissible:!0})},1e3)},E=(e,t)=>{u&&c&&c(),t(),s(e),(0,dt.L)((0,ee.__)("The media file has been replaced")),f(S)},j=e=>{e.keyCode===Rt.PX&&(e.preventDefault(),e.target.click())},B=g&&!(!i||0===i.length)&&i.every(e=>"image"===e||e.startsWith("image/")),N={..._,variant:v};return(0,Er.jsx)(wC.A,{popoverProps:N,className:k,contentClassName:(0,mh.A)("block-editor-media-replace-flow__options",v&&`is-variant-${v}`),renderToggle:({isOpen:e,onToggle:t})=>x?x({"aria-expanded":e,"aria-haspopup":"true",onClick:t,onKeyDown:j,children:h}):(0,Er.jsx)(vv,{"aria-expanded":e,"aria-haspopup":"true",onClick:t,onKeyDown:j,children:h}),renderContent:({onClose:r})=>(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsxs)(pS.Ay,{className:"block-editor-media-replace-flow__media-upload-menu",children:[(0,Er.jsxs)(xS,{children:[(0,Er.jsx)(_S,{gallery:B,addToGallery:b,multiple:g,value:g?n:t,onSelect:e=>E(e,r),allowedTypes:i,render:({open:e})=>(0,Er.jsx)(zv.A,{icon:yS.A,onClick:e,children:(0,ee.__)("Open Media Library")})}),(0,Er.jsx)(fS,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!y)return t(),s(n);d(n),w({allowedTypes:i,filesList:n,onFileChange:([e])=>{E(e,t)},onError:I})})(e,r)},accept:A,multiple:!!g,render:({openFileDialog:e})=>(0,Er.jsx)(zv.A,{icon:BC.A,onClick:()=>{e()},children:(0,ee._x)("Upload","verb")})})]}),c&&(0,Er.jsx)(zv.A,{icon:vS.A,onClick:c,isPressed:u,children:(0,ee.__)("Use featured image")}),"function"==typeof m?m({onClose:r}):m,e&&l&&(0,Er.jsx)(zv.A,{onClick:()=>{l(),r()},children:(0,ee.__)("Reset")})]}),a&&(0,Er.jsxs)("form",{className:"block-editor-media-flow__url-input",children:[(0,Er.jsx)("span",{className:"block-editor-media-replace-flow__image-url-label",children:(0,ee.__)("Current media URL:")}),(0,Er.jsx)(tI,{value:{url:e},settings:[],showSuggestions:!1,onChange:({url:e})=>{a(e)},searchInputPlaceholder:(0,ee.__)("Paste or type URL")})]})]})})}),sI="image",aI={placement:"left-start",offset:36,shift:!0,className:"block-editor-global-styles-background-panel__popover"},lI=()=>{},cI=e=>{window.requestAnimationFrame(()=>{const[t]=hS.XC.tabbable.find(e?.current);t&&t.focus()})};function uI(e){return"cover"===e||void 0===e?(0,ee.__)("Image covers the space evenly."):"contain"===e?(0,ee.__)("Image is contained without distortion."):(0,ee.__)("Image has a fixed width.")}var dI=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 hI({as:e="span",imgUrl:t,toggleProps:n={},filename:i,label:r,onToggleCallback:o=lI}){const{isOpen:s,...a}=n;(0,T.useEffect)(()=>{void 0!==s&&o(s)},[s,o]);const l=()=>(0,Er.jsxs)(Cw.A,{className:"block-editor-global-styles-background-panel__inspector-preview-inner",children:[(0,Er.jsx)("span",{className:"block-editor-global-styles-background-panel__inspector-image-indicator",style:{backgroundImage:t?`url(${t})`:void 0}}),(0,Er.jsxs)(_C.A,{children:[(0,Er.jsx)(xC.A,{numberOfLines:1,className:"block-editor-global-styles-background-panel__inspector-media-replace-title",children:r}),(0,Er.jsx)(kC.A,{as:"span",children:t?(0,ee.sprintf)((0,ee.__)("Background image: %s"),i||r):(0,ee.__)("No background image selected")})]})]});return"button"===e?(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,...a,children:l()}):l()}function pI({label:e,filename:t,url:n,children:i,onToggle:r=lI,hasImageValue:o,onReset:s,containerRef:a}){if(!o)return;const l=e||(0,dS.e)(n)||(0,ee.__)("Image");return(0,Er.jsx)(wC.A,{popoverProps:aI,renderToggle:({onToggle:e,isOpen:i})=>{const o={onClick:e,className:"block-editor-global-styles-background-panel__dropdown-toggle","aria-expanded":i,"aria-label":(0,ee.__)("Background size, position and repeat options."),isOpen:i};return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(hI,{imgUrl:n,filename:t,label:l,toggleProps:o,as:"button",onToggleCallback:r}),s&&(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,label:(0,ee.__)("Reset"),className:"block-editor-global-styles-background-panel__reset",size:"small",icon:uS.A,onClick:()=>{s(),i&&e(),cI(a)}})]})},renderContent:()=>(0,Er.jsx)(CC.A,{className:"block-editor-global-styles-background-panel__dropdown-content-wrapper",paddingSize:"medium",children:i})})}function fI(){return(0,Er.jsx)(jC,{className:"block-editor-global-styles-background-panel__loading",children:(0,Er.jsx)(TC.Ay,{})})}function mI({onChange:e,style:t,inheritedValue:n,onRemoveImage:i=lI,onResetImage:r=lI,displayInPanel:o,defaultValues:s,containerRef:a}){const[l,c]=(0,T.useState)(!1),{getSettings:u}=(0,zt.A)(Qy),{id:d,title:h,url:p}=t?.background?.backgroundImage||{...n?.background?.backgroundImage},{createErrorNotice:f}=(0,Vt.A)(Rb.store),m=e=>{f(e,{type:"snackbar"}),c(!1)},g=n=>{if(!n||!n.url)return e(_p(t,["background","backgroundImage"],void 0)),void c(!1);if(Fs(n.url))return void c(!0);if(n.media_type&&n.media_type!==sI||!n.media_type&&n.type&&n.type!==sI)return void m((0,ee.__)("Only images can be used as a background image."));const i=t?.background?.backgroundSize||s?.backgroundSize,r=t?.background?.backgroundPosition;e(_p(t,["background"],{...t?.background,backgroundImage:{url:n.url,id:n.id,source:"file",title:n.title||void 0},backgroundPosition:r||"auto"!==i&&i?r:"50% 0",backgroundSize:i})),c(!1),cI(a)},b=!YE(t)&&YE(n),y=h||(0,dS.e)(p)||(0,ee.__)("Image");return(0,Er.jsxs)("div",{className:"block-editor-global-styles-background-panel__image-tools-panel-item",children:[l&&(0,Er.jsx)(fI,{}),(0,Er.jsx)(oI,{mediaId:d,mediaURL:p,allowedTypes:[sI],accept:"image/*",onSelect:g,popoverProps:{className:(0,mh.A)({"block-editor-global-styles-background-panel__media-replace-popover":o})},name:(0,Er.jsx)(hI,{imgUrl:p,filename:h,label:y}),renderToggle:e=>(0,Er.jsx)(fv.Ay,{...e,__next40pxDefaultSize:!0}),onError:m,onReset:()=>{cI(a),r()},children:b&&(0,Er.jsx)(zv.A,{onClick:()=>{cI(a),e(_p(t,["background"],{backgroundImage:"none"})),i()},children:(0,ee.__)("Remove")})}),(0,Er.jsx)(LC,{onFilesDrop:e=>{u().mediaUpload({allowedTypes:[sI],filesList:e,onFileChange([e]){g(e)},onError:m,multiple:!1})},label:(0,ee.__)("Drop to upload")})]})}function gI({onChange:e,style:t,inheritedValue:n,defaultValues:i}){const r=t?.background?.backgroundSize||n?.background?.backgroundSize,o=t?.background?.backgroundRepeat||n?.background?.backgroundRepeat,s=t?.background?.backgroundImage?.url||n?.background?.backgroundImage?.url,a=t?.background?.backgroundImage?.id,l=t?.background?.backgroundPosition||n?.background?.backgroundPosition,c=t?.background?.backgroundAttachment||n?.background?.backgroundAttachment;let u=!r&&a?i?.backgroundSize:r||"auto";u=["cover","contain","auto"].includes(u)?u:"auto";const d=!("no-repeat"===o||"cover"===u&&void 0===o),h=n=>{let i=o,r=l;"contain"===n&&(i="no-repeat",r=void 0),"cover"===n&&(i=void 0,r=void 0),"cover"!==u&&"contain"!==u||"auto"!==n||(i=void 0,t?.background?.backgroundImage?.id&&(r="50% 0")),n||"auto"!==u||(n="auto"),e(_p(t,["background"],{...t?.background,backgroundPosition:r,backgroundRepeat:i,backgroundSize:n}))},p=!l&&a&&"contain"===r?i?.backgroundPosition:l;return(0,Er.jsxs)(Q_.A,{spacing:3,className:"single-column",children:[(0,Er.jsx)(cS,{label:(0,ee.__)("Focal point"),url:s,value:dI(p),onChange:n=>{e(_p(t,["background","backgroundPosition"],(e=>{if(!(!e||isNaN(e.x)&&isNaN(e.y)))return`${100*(isNaN(e.x)?.5:e.x)}% ${100*(isNaN(e.y)?.5:e.y)}%`})(n)))}}),(0,Er.jsx)(Zv.A,{label:(0,ee.__)("Fixed background"),checked:"fixed"===c,onChange:()=>e(_p(t,["background","backgroundAttachment"],"fixed"===c?"scroll":"fixed"))}),(0,Er.jsxs)(Jv.A,{size:"__unstable-large",label:(0,ee.__)("Size"),value:u,onChange:h,isBlock:!0,help:uI(r||i?.backgroundSize),children:[(0,Er.jsx)(bk.A,{value:"cover",label:(0,ee._x)("Cover","Size option for background image control")},"cover"),(0,Er.jsx)(bk.A,{value:"contain",label:(0,ee._x)("Contain","Size option for background image control")},"contain"),(0,Er.jsx)(bk.A,{value:"auto",label:(0,ee._x)("Tile","Size option for background image control")},"tile")]}),(0,Er.jsxs)(Cw.A,{justify:"flex-start",spacing:2,as:"span",children:[(0,Er.jsx)(vx,{"aria-label":(0,ee.__)("Background image width"),onChange:h,value:r,size:"__unstable-large",__unstableInputWidth:"100px",min:0,placeholder:(0,ee.__)("Auto"),disabled:"auto"!==u||void 0===u}),(0,Er.jsx)(Zv.A,{label:(0,ee.__)("Repeat"),checked:d,onChange:()=>e(_p(t,["background","backgroundRepeat"],!0===d?"no-repeat":"repeat")),disabled:"cover"===u})]})]})}function bI({value:e,onChange:t,inheritedValue:n=e,settings:i,defaultValues:r={}}){const{globalStyles:o,_links:s}=(0,zt.A)(e=>{const{getSettings:t}=e(Qy),n=t();return{globalStyles:n[Rh],_links:n[Oh]}},[]),a=(0,T.useMemo)(()=>{const e={background:{}};return n?.background?(Object.entries(n?.background).forEach(([t,n])=>{e.background[t]=bC(n,{styles:o,_links:s})}),e):n},[o,s,n]),l=()=>t(_p(e,["background"],{})),{title:c,url:u}=e?.background?.backgroundImage||{...a?.background?.backgroundImage},d=YE(e)||YE(a),h=d&&"none"!==(e?.background?.backgroundImage||n?.background?.backgroundImage)&&(i?.background?.backgroundSize||i?.background?.backgroundPosition||i?.background?.backgroundRepeat),[p,f]=(0,T.useState)(!1),m=(0,T.useRef)();return(0,Er.jsx)("div",{ref:m,className:(0,mh.A)("block-editor-global-styles-background-panel__inspector-media-replace-container",{"is-open":p}),children:h?(0,Er.jsx)(pI,{label:c,filename:c,url:u,onToggle:f,hasImageValue:d,onReset:l,containerRef:m,children:(0,Er.jsxs)(Q_.A,{spacing:3,className:"single-column",children:[(0,Er.jsx)(mI,{onChange:t,style:e,inheritedValue:a,displayInPanel:!0,onResetImage:()=>{f(!1),l()},onRemoveImage:()=>f(!1),defaultValues:r,containerRef:m}),(0,Er.jsx)(gI,{onChange:t,style:e,defaultValues:r,inheritedValue:a})]})}):(0,Er.jsx)(mI,{onChange:t,style:e,inheritedValue:a,defaultValues:r,onResetImage:()=>{f(!1),l()},onRemoveImage:()=>f(!1),containerRef:m})})}var yI=n(90679),vI=(0,ex.A)("div",{target:"ebn2ljm1"})("&:not( :first-of-type ){",({offsetAmount:e})=>(0,tx.AH)({marginInlineStart:e},"",""),";}",({zIndex:e})=>(0,tx.AH)({zIndex:e},"",""),";"),_I={name:"rs0gp6",styles:"grid-row-start:1;grid-column-start:1"},xI=(0,ex.A)("div",{target:"ebn2ljm0"})("display:inline-grid;grid-auto-flow:column;position:relative;&>",vI,"{position:relative;justify-self:start;",({isLayered:e})=>e?_I:void 0,";}"),kI=(0,Dw.KZ)(function(e,t){const{children:n,className:i,isLayered:r=!0,isReversed:o=!1,offset:s=0,...a}=(0,Mw.A)(e,"ZStack"),l=(0,yI.a)(n),c=l.length-1,u=l.map((e,t)=>{const n=o?c-t:t,i=r?s*t:s,a=(0,T.isValidElement)(e)?e.key:t;return(0,Er.jsx)(vI,{offsetAmount:i,zIndex:n,children:e},a)});return(0,Er.jsx)(xI,{...a,className:i,isLayered:r,ref:t,children:u})},"ZStack"),wI=kI,CI=n(34942),SI=n(85386),AI=(0,T.createContext)({});AI.displayName="CircularOptionPickerContext";var II=n(11056),EI=(0,T.forwardRef)(function(e,t){const{isPressed:n,label:i,...r}=e;return(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,...r,"aria-pressed":n,ref:t,label:i})}),jI=(0,T.forwardRef)(function(e,t){const{id:n,isSelected:i,label:r,...o}=e,{setActiveId:s,activeId:a}=(0,T.useContext)(AI);return(0,T.useEffect)(()=>{i&&!a&&window.setTimeout(()=>s?.(n),0)},[i,s,a,n]),(0,Er.jsx)(II.e.Item,{render:(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,...o,role:"option","aria-selected":!!i,ref:t,label:r}),id:n})});function TI(e){const{actions:t,options:n,baseId:i,className:r,loop:o=!0,children:s,...a}=e,[l,c]=(0,T.useState)(void 0),u=(0,T.useMemo)(()=>({baseId:i,activeId:l,setActiveId:c}),[i,l,c]);return(0,Er.jsx)("div",{className:r,children:(0,Er.jsxs)(AI.Provider,{value:u,children:[(0,Er.jsx)(II.e,{...a,id:i,focusLoop:o,rtl:(0,ee.isRTL)(),role:"listbox",activeId:l,setActiveId:c,children:n}),s,t]})})}function BI(e){const{actions:t,options:n,children:i,baseId:r,...o}=e,s=(0,T.useMemo)(()=>({baseId:r}),[r]);return(0,Er.jsx)("div",{...o,role:"group",id:r,children:(0,Er.jsxs)(AI.Provider,{value:s,children:[n,i,t]})})}function NI(e){const{asButtons:t,actions:n,options:i,children:r,className:o,...s}=e,a=(0,SS.A)(NI,"components-circular-option-picker",s.id),l=t?BI:TI,c=n?(0,Er.jsx)("div",{className:"components-circular-option-picker__custom-clear-wrapper",children:n}):void 0,u=(0,Er.jsx)("div",{className:"components-circular-option-picker__swatches",children:i});return(0,Er.jsx)(l,{...s,baseId:a,className:(0,mh.A)("components-circular-option-picker",o),actions:c,options:u,children:r})}NI.Option=function e({className:t,isSelected:n,selectedIconProps:i={},tooltipText:r,...o}){const{baseId:s,setActiveId:a}=(0,T.useContext)(AI),l={id:(0,SS.A)(e,s||"components-circular-option-picker__option"),className:"components-circular-option-picker__option",...o},c=void 0!==a?(0,Er.jsx)(jI,{...l,label:r,isSelected:n}):(0,Er.jsx)(EI,{...l,label:r,isPressed:n});return(0,Er.jsxs)("div",{className:(0,mh.A)(t,"components-circular-option-picker__option-wrapper"),children:[c,n&&(0,Er.jsx)(xx.A,{icon:xw.A,...i})]})},NI.OptionGroup=function({className:e,options:t,...n}){const i="aria-label"in n||"aria-labelledby"in n?"group":void 0;return(0,Er.jsx)("div",{...n,role:i,className:(0,mh.A)("components-circular-option-picker__option-group","components-circular-option-picker__swatches",e),children:t})},NI.ButtonAction=function({className:e,children:t,...n}){return(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,className:(0,mh.A)("components-circular-option-picker__clear",e),variant:"tertiary",...n,children:t})},NI.DropdownLinkAction=function({buttonProps:e,className:t,dropdownProps:n,linkText:i}){return(0,Er.jsx)(wC.A,{className:(0,mh.A)("components-circular-option-picker__dropdown-link-action",t),renderToggle:({isOpen:t,onToggle:n})=>(0,Er.jsx)(fv.Ay,{"aria-expanded":t,"aria-haspopup":"true",onClick:n,variant:"link",...e,children:i}),...n})},NI.displayName="CircularOptionPicker";var RI=NI;function OI(e,t,n,i){return{metaProps:e?{asButtons:!0}:{asButtons:!1,loop:t},labelProps:{"aria-labelledby":i,"aria-label":i?void 0:n||(0,ee.__)("Custom color picker")}}}var LI=(0,ex.A)(Sw.A,{target:"ev9wop70"})("text-transform:uppercase;line-height:24px;font-weight:",rx.A.fontWeightMedium,";&&&{font-size:11px;margin-bottom:0;}");(0,te.X$)([ne.A,ie.A]);var MI=e=>{const t=/var\(/.test(e??""),n=/color-mix\(/.test(e??"");return!t&&!n},PI=e=>e.length>0&&e.every(e=>{return t=e,Array.isArray(t.colors)&&!("color"in t);var t});function DI({className:e,clearColor:t,colors:n,onChange:i,value:r,...o}){const s=(0,T.useMemo)(()=>n.map(({color:e,name:n},o)=>{const s=(0,te.Mj)(e),a=r===e;return(0,Er.jsx)(RI.Option,{isSelected:a,selectedIconProps:a?{fill:s.contrast()>s.contrast("#000")?"#fff":"#000"}:{},tooltipText:n||(0,ee.sprintf)((0,ee.__)("Color code: %s"),e),style:{backgroundColor:e,color:e},onClick:a?t:()=>i(e,o)},`${e}-${o}`)}),[n,r,i,t]);return(0,Er.jsx)(RI.OptionGroup,{className:e,options:s,...o})}function FI({className:e,clearColor:t,colors:n,onChange:i,value:r,headingLevel:o}){const s=(0,SS.A)(FI,"color-palette");return 0===n.length?null:(0,Er.jsx)(Q_.A,{spacing:3,className:e,children:n.map(({name:e,colors:n},a)=>{const l=`${s}-${a}`;return(0,Er.jsxs)(Q_.A,{spacing:2,children:[(0,Er.jsx)(LI,{id:l,level:o,children:e}),(0,Er.jsx)(DI,{clearColor:t,colors:n,onChange:e=>i(e,a),value:r,"aria-labelledby":l})]},a)})})}function zI({isRenderedInSidebar:e,popoverProps:t,...n}){const i=(0,T.useMemo)(()=>({shift:!0,resize:!1,...e?{placement:"left-start",offset:34}:{placement:"bottom",offset:8},...t}),[e,t]);return(0,Er.jsx)(wC.A,{contentClassName:"components-color-palette__custom-color-dropdown-content",popoverProps:i,...n})}(0,te.X$)([ne.A,ie.A]);var VI=(0,T.forwardRef)(function(e,t){const{asButtons:n,loop:i,clearable:r=!0,colors:o=[],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,T.useState)(c),b=(0,T.useCallback)(()=>l(void 0),[l]),y=(0,T.useCallback)(e=>{g(((e,t)=>{if(!e||!t||MI(e))return e;const{ownerDocument:n}=t,{defaultView:i}=n,r=i?.getComputedStyle(t).backgroundColor;return r?(0,te.Mj)(r).toHex():e})(c,e))},[c]),v=PI(o),_=(0,T.useMemo)(()=>((e,t=[],n=!1)=>{if(!e)return"";const i=!!e&&MI(e),r=i?(0,te.Mj)(e).toHex():e,o=n?t:[{colors:t}];for(const{colors:e}of o)for(const{name:t,color:n}of e)if(r===(i?(0,te.Mj)(n).toHex():n))return t;return(0,ee.__)("Custom")})(c,o,v),[c,o,v]),x=c?.startsWith("#"),k=c?.replace(/^var\((.+)\)$/,"$1"),w=k?(0,ee.sprintf)((0,ee.__)('Custom color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),_,k):(0,ee.__)("Custom color picker"),C={clearColor:b,onChange:l,value:c},S=!!r&&(0,Er.jsx)(RI.ButtonAction,{onClick:b,accessibleWhenDisabled:!0,disabled:!c,children:(0,ee.__)("Clear")}),{metaProps:A,labelProps:I}=OI(n,i,h,p);return(0,Er.jsxs)(Q_.A,{spacing:3,ref:t,...f,children:[!s&&(0,Er.jsx)(zI,{isRenderedInSidebar:u,renderContent:()=>(0,Er.jsx)(CC.A,{paddingSize:"none",children:(0,Er.jsx)(SI.V,{color:m,onChange:e=>l(e),enableAlpha:a})}),renderToggle:({isOpen:e,onToggle:t})=>(0,Er.jsxs)(Q_.A,{className:"components-color-palette__custom-color-wrapper",spacing:0,children:[(0,Er.jsx)("button",{ref:y,className:"components-color-palette__custom-color-button","aria-expanded":e,"aria-haspopup":"true",onClick:t,"aria-label":w,style:{background:c},type:"button"}),(0,Er.jsxs)(Q_.A,{className:"components-color-palette__custom-color-text-wrapper",spacing:.5,children:[(0,Er.jsx)(xC.A,{className:"components-color-palette__custom-color-name",children:c?_:(0,ee.__)("No color selected")}),(0,Er.jsx)(xC.A,{className:(0,mh.A)("components-color-palette__custom-color-value",{"components-color-palette__custom-color-value--is-hex":x}),children:k})]})]})}),(o.length>0||S)&&(0,Er.jsx)(RI,{...A,...I,actions:S,options:v?(0,Er.jsx)(FI,{...C,headingLevel:d,colors:o,value:c}):(0,Er.jsx)(DI,{...C,colors:o,value:c})})]})});VI.displayName="ColorPalette";var UI=VI,$I=n(13911);if("undefined"!=typeof document&&!document.head.querySelector("style[data-wp-hash='e91ec3f005']")){const e=document.createElement("style");e.setAttribute("data-wp-hash","e91ec3f005"),e.appendChild(document.createTextNode("._8f57b8d483c51fbe__circle-root{border:1px solid var(--wp-components-color-gray-600,#949494);border-radius:50%;box-sizing:border-box;cursor:grab;height:32px;overflow:hidden;width:32px}._8f57b8d483c51fbe__circle-root:active{cursor:grabbing}.b1bae984ac10fcc3__circle-indicator-wrapper{box-sizing:border-box;height:100%;position:relative;width:100%}.b1bae984ac10fcc3__circle-indicator-wrapper:focus-visible{outline:none}._6d2fe0a2cbb31bf0__circle-indicator{background:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));border-radius:50%;box-sizing:border-box;display:block;height:6px;left:50%;position:absolute;top:4px;transform:translateX(-50%);width:6px}")),document.head.appendChild(e)}var HI=function({value:e,onChange:t,className:n,...i}){const r=(0,T.useRef)(null),o=(0,T.useRef)(void 0),s=(0,T.useRef)(void 0),a=e=>{if(void 0!==e&&(e.preventDefault(),e.target?.focus(),void 0!==o.current&&void 0!==t)){const{x:n,y:i}=o.current;t(function(e,t,n,i){const r=i-t,o=n-e,s=Math.atan2(r,o),a=Math.round(s*(180/Math.PI))+90;return a<0?360+a:a}(n,i,e.clientX,e.clientY))}},{startDrag:l,isDragging:c}=PC({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}})(),a(e)},onDragMove:a,onDragEnd:a});return(0,T.useEffect)(()=>{c?(void 0===s.current&&(s.current=document.body.style.cursor),document.body.style.cursor="grabbing"):(document.body.style.cursor=s.current||"",s.current=void 0)},[c]),(0,Er.jsx)("div",{ref:r,onMouseDown:l,className:(0,mh.A)("components-angle-picker-control__angle-circle","_8f57b8d483c51fbe__circle-root",n),...i,children:(0,Er.jsx)("div",{style:e?{transform:`rotate(${e}deg)`}:void 0,className:(0,mh.A)("components-angle-picker-control__angle-circle-indicator-wrapper","b1bae984ac10fcc3__circle-indicator-wrapper"),tabIndex:-1,children:(0,Er.jsx)("div",{className:(0,mh.A)("components-angle-picker-control__angle-circle-indicator","_6d2fe0a2cbb31bf0__circle-indicator")})})})},WI=(0,T.forwardRef)(function(e,t){const{className:n,label:i=(0,ee.__)("Angle"),onChange:r,value:o,...s}=e,a=(0,mh.A)("components-angle-picker-control",n),l=(0,ee.isRTL)()?{prefix:(0,Er.jsx)(_x.A,{children:"°"})}:{suffix:(0,Er.jsx)(CS.A,{children:"°"})};return(0,Er.jsxs)(Kv.A,{...s,ref:t,className:a,gap:2,children:[(0,Er.jsx)(_C.A,{children:(0,Er.jsx)(ox.A,{__next40pxDefaultSize:!0,label:i,className:"components-angle-picker-control__input-field",max:360,min:0,onChange:e=>{if(void 0===r)return;const t=void 0!==e&&""!==e?parseInt(e,10):0;r(t)},step:"1",value:o,spinControls:"none",...l})}),(0,Er.jsx)($I.A,{marginBottom:"1",marginTop:"auto",children:(0,Er.jsx)(HI,{"aria-hidden":"true",value:o,onChange:r})})]})});WI.displayName="AnglePickerControl";var GI=WI;function qI(e){return Math.max(0,Math.min(100,e))}function KI(e,t,n){const i=e.slice();return i[t]=n,i}function YI(e,t,n){return function(e,t,n,i=0){const r=e[t].position,o=Math.min(r,n),s=Math.max(r,n);return e.some(({position:e},r)=>r!==t&&(Math.abs(e-n)({placement:"bottom",offset:8,resize:!1}),[]),r=(0,mh.A)("components-custom-gradient-picker__control-point-dropdown",t);return(0,Er.jsx)(zI,{isRenderedInSidebar:e,popoverProps:i,className:r,...n})}function eE({disableRemove:e,disableAlpha:t,gradientPickerDomRef:n,ignoreMarkerPosition:i,value:r,onChange:o,onStartControlPointChange:s,onStopControlPointChange:a,__experimentalIsRenderedInSidebar:l}){const c=(0,T.useRef)(void 0),u=e=>{if(void 0===c.current||null===n.current)return;const t=XI(e.clientX,n.current),{initialPosition:i,index:s,significantMoveHappened:a}=c.current;!a&&Math.abs(i-t)>=5&&(c.current.significantMoveHappened=!0),o(YI(r,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,T.useRef)(void 0);return h.current=d,(0,T.useEffect)(()=>()=>{h.current?.()},[]),(0,Er.jsx)(Er.Fragment,{children:r.map((n,h)=>{const p=n?.position;return i!==p&&(0,Er.jsx)(QI,{isRenderedInSidebar:l,onClose:a,renderToggle:({isOpen:e,onToggle:t})=>(0,Er.jsx)(ZI,{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(),o(YI(r,h,qI(n.position-10)))):"ArrowRight"===e.code&&(e.stopPropagation(),o(YI(r,h,qI(n.position+10))))},isOpen:e,position:n.position,color:n.color},h),renderContent:({onClose:i})=>(0,Er.jsxs)(CC.A,{paddingSize:"none",children:[(0,Er.jsx)(SI.V,{enableAlpha:!t,color:n.color,onChange:e=>{o(JI(r,h,(0,te.Mj)(e).toRgbString()))}}),!e&&r.length>2&&(0,Er.jsx)(Cw.A,{className:"components-custom-gradient-picker__remove-control-point-wrapper",alignment:"center",children:(0,Er.jsx)(fv.Ay,{onClick:()=>{o(function(e,t){return e.filter((e,n)=>n!==t)}(r,h)),i()},variant:"link",children:(0,ee.__)("Remove Control Point")})})]}),style:{left:`${n.position}%`,transform:"translateX( -50% )"}},h)})})}eE.InsertPoint=function({value:e,onChange:t,onOpenInserter:n,onCloseInserter:i,insertPosition:r,disableAlpha:o,__experimentalIsRenderedInSidebar:s}){const[a,l]=(0,T.useState)(!1);return(0,Er.jsx)(QI,{isRenderedInSidebar:s,className:"components-custom-gradient-picker__inserter",onClose:()=>{i()},renderToggle:({isOpen:e,onToggle:t})=>(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,"aria-expanded":e,"aria-haspopup":"true",onClick:()=>{e?i():(l(!1),n()),t()},className:"components-custom-gradient-picker__insert-point-dropdown",icon:kw.A}),renderContent:()=>(0,Er.jsx)(CC.A,{paddingSize:"none",children:(0,Er.jsx)(SI.V,{enableAlpha:!o,onChange:n=>{a?t(function(e,t,n){const i=e.findIndex(e=>e.position===t);return JI(e,i,n)}(e,r,(0,te.Mj)(n).toRgbString())):(t(function(e,t,n){const i=e.findIndex(e=>e.position>t),r={color:n,position:t},o=e.slice();return o.splice(i-1,0,r),o}(e,r,(0,te.Mj)(n).toRgbString())),l(!0))}})}),style:null!==r?{left:`${r}%`,transform:"translateX( -50% )"}:void 0})};var tE=eE,nE=(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},iE={id:"IDLE"};function rE({background:e,hasGradient:t,value:n,onChange:i,disableInserter:r=!1,disableAlpha:o=!1,__experimentalIsRenderedInSidebar:s=!1}){const a=(0,T.useRef)(null),[l,c]=(0,T.useReducer)(nE,iE),u=e=>{if(!a.current)return;const t=XI(e.clientX,a.current);n.some(({position:e})=>Math.abs(t-e)<10)?"MOVING_INSERTER"===l.id&&c({type:"STOP_INSERTER_MOVE"}):c({type:"MOVE_INSERTER",insertPosition:t})},d="MOVING_INSERTER"===l.id,h="INSERTING_CONTROL_POINT"===l.id;return(0,Er.jsxs)("div",{className:(0,mh.A)("components-custom-gradient-picker__gradient-bar",{"has-gradient":t}),onMouseEnter:u,onMouseMove:u,onMouseLeave:()=>{c({type:"STOP_INSERTER_MOVE"})},children:[(0,Er.jsx)("div",{className:"components-custom-gradient-picker__gradient-bar-background",style:{background:e,opacity:t?1:.4}}),(0,Er.jsxs)("div",{ref:a,className:"components-custom-gradient-picker__markers-container",children:[!r&&(d||h)&&(0,Er.jsx)(tE.InsertPoint,{__experimentalIsRenderedInSidebar:s,disableAlpha:o,insertPosition:l.insertPosition,value:n,onChange:i,onOpenInserter:()=>{c({type:"OPEN_INSERTER"})},onCloseInserter:()=>{c({type:"CLOSE_INSERTER"})}}),(0,Er.jsx)(tE,{__experimentalIsRenderedInSidebar:s,disableAlpha:o,disableRemove:r,gradientPickerDomRef:a,ignoreMarkerPosition:h?l.insertPosition:void 0,value:n,onChange:i,onStartControlPointChange:()=>{c({type:"START_CONTROL_CHANGE"})},onStopControlPointChange:()=>{c({type:"STOP_CONTROL_CHANGE"})}})]})]})}var oE=n(58319),sE=n(88863),aE="linear-gradient(135deg, rgba(6, 147, 227, 1) 0%, rgb(155, 81, 224) 100%)",lE={type:"angular",value:"90"},cE=[{value:"linear-gradient",label:(0,ee.__)("Linear")},{value:"radial-gradient",label:(0,ee.__)("Radial")}],uE={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 dE({type:e,value:t,length:n}){return`${function({type:e,value:t}){if("literal"===e)return t;if("hex"===e)return`#${t}`;if("var"===e)return`var(${t})`;if("hsl"===e){const[e,n,i]=t;return`hsl(${e},${n}%,${i}%)`}if("hsla"===e){const[e,n,i,r]=t;return`hsla(${e},${n}%,${i}%,${r})`}return`${e}(${t.join(",")})`}({type:e,value:t})} ${function(e){if(!e)return"";const{value:t,type:n}=e;return"calc"===n?`calc(${t})`:`${t}${n}`}(n)}`}function hE({type:e,orientation:t,colorStops:n}){const i=function(e){if(!Array.isArray(e)&&e&&"angular"===e.type)return`${e.value}deg`}(t);return`${e}(${[i,...n.sort((e,t)=>{const n=e=>void 0===e?.length?.value?0:parseInt(e.length.value);return n(e)-n(t)}).map(dE)].filter(Boolean).join(",")})`}function pE(e){return void 0===e.length||"%"!==e.length.type}function fE(e){switch(e.type){case"hex":return`#${e.value}`;case"literal":return e.value;case"var":return`${e.type}(${e.value})`;case"rgb":case"rgba":return`${e.type}(${e.value.join(",")})`;case"hsl":{const[t,n,i]=e.value;return`hsl(${t},${n}%,${i}%)`}case"hsla":{const[t,n,i,r]=e.value;return`hsla(${t},${n}%,${i}%,${r})`}default:return"transparent"}}(0,te.X$)([ne.A]);var mE=(0,ex.A)(_C.A,{target:"e10bzpgi1"})({name:"1gvx10y",styles:"flex-grow:5"}),gE=(0,ex.A)(_C.A,{target:"e10bzpgi0"})({name:"1gvx10y",styles:"flex-grow:5"}),bE=({gradientAST:e,hasGradient:t,onChange:n})=>{const i=e?.orientation?.value??180;return(0,Er.jsx)(GI,{onChange:t=>{n(hE({...e,orientation:{type:"angular",value:`${t}`}}))},value:t?i:""})},yE=({gradientAST:e,hasGradient:t,onChange:n})=>{const{type:i}=e,r=(0,T.useRef)(Number(lE.value));return"linear-gradient"===i&&e.orientation&&(r.current=Number(e.orientation.value)),(0,Er.jsx)(oE.A,{className:"components-custom-gradient-picker__type-picker",label:(0,ee.__)("Type"),labelPosition:"top",onChange:t=>{"linear-gradient"===t&&n(hE({...e,orientation:{type:"angular",value:`${r.current}`},type:"linear-gradient"})),"radial-gradient"===t&&(()=>{const{orientation:t,...i}=e;n(hE({...i,type:"radial-gradient"}))})()},options:cE,size:"__unstable-large",value:t?i:void 0})},vE=function({value:e,onChange:t,enableAlpha:n=!0,__experimentalIsRenderedInSidebar:i=!1}){const{gradientAST:r,hasGradient:o}=function(e){let t,n=!!e;const i=e??aE;try{t=sE.parse(i)[0]}catch(e){console.warn("wp.components.CustomGradientPicker failed to parse the gradient with error",e),t=sE.parse(aE)[0],n=!1}if(Array.isArray(t.orientation)||"directional"!==t.orientation?.type||(t.orientation={type:"angular",value:uE[t.orientation.value].toString()}),t.colorStops.some(pE)){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),s=function(e){return hE({type:"linear-gradient",orientation:lE,colorStops:e.colorStops})}(r),a=r.colorStops.map(e=>({color:fE(e),position:parseInt(e.length.value)}));return(0,Er.jsxs)(Q_.A,{spacing:4,className:"components-custom-gradient-picker",children:[(0,Er.jsx)(rE,{__experimentalIsRenderedInSidebar:i,disableAlpha:!n,background:s,hasGradient:o,value:a,onChange:e=>{t(hE(function(e,t){return{...e,colorStops:t.map(({position:e,color:t})=>{const{r:n,g:i,b:r,a:o}=(0,te.Mj)(t).toRgb();return{length:{type:"%",value:e?.toString()},type:o<1?"rgba":"rgb",value:o<1?[`${n}`,`${i}`,`${r}`,`${o}`]:[`${n}`,`${i}`,`${r}`]}})}}(r,e)))}}),(0,Er.jsxs)(Kv.A,{gap:3,className:"components-custom-gradient-picker__ui-line",children:[(0,Er.jsx)(mE,{children:(0,Er.jsx)(yE,{gradientAST:r,hasGradient:o,onChange:t})}),(0,Er.jsx)(gE,{children:"linear-gradient"===r.type&&(0,Er.jsx)(bE,{gradientAST:r,hasGradient:o,onChange:t})})]})]})};function _E({className:e,clearGradient:t,gradients:n,onChange:i,value:r,...o}){const s=(0,T.useMemo)(()=>n.map(({gradient:e,name:n,slug:o},s)=>(0,Er.jsx)(RI.Option,{value:e,isSelected:r===e,tooltipText:n||(0,ee.sprintf)((0,ee.__)("Gradient code: %s"),e),style:{color:"rgba( 0,0,0,0 )",background:e},onClick:r===e?t:()=>i(e,s),"aria-label":n?(0,ee.sprintf)((0,ee.__)("Gradient: %s"),n):(0,ee.sprintf)((0,ee.__)("Gradient code: %s"),e)},o)),[n,r,i,t]);return(0,Er.jsx)(RI.OptionGroup,{className:e,options:s,...o})}function xE({className:e,clearGradient:t,gradients:n,onChange:i,value:r,headingLevel:o}){const s=(0,SS.A)(xE);return(0,Er.jsx)(Q_.A,{spacing:3,className:e,children:n.map(({name:e,gradients:n},a)=>{const l=`color-palette-${s}-${a}`;return(0,Er.jsxs)(Q_.A,{spacing:2,children:[(0,Er.jsx)(LI,{level:o,id:l,children:e}),(0,Er.jsx)(_E,{clearGradient:t,gradients:n,onChange:e=>i(e,a),value:r,"aria-labelledby":l})]},a)})})}function kE(e){const{asButtons:t,loop:n,actions:i,headingLevel:r,"aria-label":o,"aria-labelledby":s,...a}=e,l=(d=e.gradients).length>0&&d.every(e=>{return t=e,Array.isArray(t.gradients)&&!("gradient"in t);var t})?(0,Er.jsx)(xE,{headingLevel:r,...a}):(0,Er.jsx)(_E,{...a}),{metaProps:c,labelProps:u}=OI(t,n,o,s);var d;return(0,Er.jsx)(RI,{...c,...u,actions:i,options:l})}var wE=function({className:e,gradients:t=[],onChange:n,value:i,clearable:r=!0,enableAlpha:o=!0,disableCustomGradients:s=!1,__experimentalIsRenderedInSidebar:a,headingLevel:l=2,...c}){const u=(0,T.useCallback)(()=>n(void 0),[n]);return(0,Er.jsxs)(Q_.A,{spacing:t.length?4:0,children:[!s&&(0,Er.jsx)(vE,{__experimentalIsRenderedInSidebar:a,enableAlpha:o,value:i,onChange:n}),(t.length>0||r)&&(0,Er.jsx)(kE,{...c,className:e,clearGradient:u,gradients:t,onChange:n,value:i,actions:r&&!s&&(0,Er.jsx)(RI.ButtonAction,{onClick:u,accessibleWhenDisabled:!0,disabled:!i,children:(0,ee.__)("Clear")}),headingLevel:l})]})},{Tabs:CE}=Gh(Ev.j),SE=["colors","disableCustomColors","gradients","disableCustomGradients"],AE="color",IE="gradient";function EE({colors:e,gradients:t,disableCustomColors:n,disableCustomGradients:i,__experimentalIsRenderedInSidebar:r,className:o,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||!i);if(!m&&!g)return null;const b={[AE]:(0,Er.jsx)(UI,{value:c,onChange:g?e=>{a(e),l()}:a,colors:e,disableCustomColors:n,__experimentalIsRenderedInSidebar:r,clearable:d,enableAlpha:p,headingLevel:f}),[IE]:(0,Er.jsx)(wE,{value:u,onChange:m?e=>{l(e),a()}:l,gradients:t,disableCustomGradients:i,__experimentalIsRenderedInSidebar:r,clearable:d,headingLevel:f})},y=e=>(0,Er.jsx)("div",{className:"block-editor-color-gradient-control__panel",children:b[e]});return(0,Er.jsx)(mk.Ay,{className:(0,mh.A)("block-editor-color-gradient-control",o),children:(0,Er.jsx)("fieldset",{className:"block-editor-color-gradient-control__fieldset",children:(0,Er.jsxs)(Q_.A,{spacing:1,children:[h&&(0,Er.jsx)("legend",{children:(0,Er.jsx)("div",{className:"block-editor-color-gradient-control__color-indicator",children:(0,Er.jsx)(mk.Ay.VisualLabel,{children:s})})}),m&&g&&(0,Er.jsx)("div",{children:(0,Er.jsxs)(CE,{defaultTabId:u?IE:!!m&&AE,children:[(0,Er.jsxs)(CE.TabList,{children:[(0,Er.jsx)(CE.Tab,{tabId:AE,children:(0,ee.__)("Color")}),(0,Er.jsx)(CE.Tab,{tabId:IE,children:(0,ee.__)("Gradient")})]}),(0,Er.jsx)(CE.TabPanel,{tabId:AE,className:"block-editor-color-gradient-control__panel",focusable:!1,children:b.color}),(0,Er.jsx)(CE.TabPanel,{tabId:IE,className:"block-editor-color-gradient-control__panel",focusable:!1,children:b.gradient})]})}),!g&&y(AE),!m&&y(IE)]})})})}function jE(e){const[t,n,i,r]=tv("color.palette","color.gradients","color.custom","color.customGradient");return(0,Er.jsx)(EE,{colors:t,gradients:n,disableCustomColors:!i,disableCustomGradients:!r,...e})}var TE=function(e){return SE.every(t=>e.hasOwnProperty(t))?(0,Er.jsx)(EE,{...e}):(0,Er.jsx)(jE,{...e})};function BE(e){const t=NE(e),n=PE(e),i=RE(e),r=LE(e),o=ME(e),s=OE(e);return t||n||i||r||o||s}function NE(e){const t=iv(e);return e?.color?.text&&(t?.length>0||e?.color?.custom)}function RE(e){const t=iv(e);return e?.color?.link&&(t?.length>0||e?.color?.custom)}function OE(e){const t=iv(e);return e?.color?.caption&&(t?.length>0||e?.color?.custom)}function LE(e){const t=iv(e),n=rv(e);return e?.color?.heading&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function ME(e){const t=iv(e),n=rv(e);return e?.color?.button&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function PE(e){const t=iv(e),n=rv(e);return e?.color?.background&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function DE({resetAllFilter:e,onChange:t,value:n,panelId:i,children:r,label:o}){const s=Zw();return(0,Er.jsx)(Xw,{label:o||(0,ee.__)("Elements"),resetAll:()=>{const i=e(n);t(i)},panelId:i,hasInnerWrapper:!0,headingLevel:3,className:"color-block-support-panel",__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:s,children:(0,Er.jsx)("div",{className:"color-block-support-panel__inner-wrapper",children:r})})}var FE={text:!0,background:!0,link:!0,heading:!0,button:!0,caption:!0},zE={placement:"left-start",offset:36,shift:!0},{Tabs:VE}=Gh(Ev.j),UE=({indicators:e,label:t})=>(0,Er.jsxs)(Cw.A,{justify:"flex-start",children:[(0,Er.jsx)(wI,{isLayered:!1,offset:-8,children:e.map((e,t)=>(0,Er.jsx)(Kv.A,{expanded:!1,children:(0,Er.jsx)(CI.A,{colorValue:e})},t))}),(0,Er.jsx)(Yv.A,{className:"block-editor-panel-color-gradient-settings__color-name",children:t})]});function $E({isGradient:e,inheritedValue:t,userValue:n,setValue:i,colorGradientControlSettings:r}){return(0,Er.jsx)(TE,{...r,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:e?void 0:t,gradientValue:e?t:void 0,onColorChange:e?void 0:i,onGradientChange:e?i:void 0,clearable:t===n,headingLevel:3})}function HE({label:e,hasValue:t,resetValue:n,isShownByDefault:i,indicators:r,tabs:o,colorGradientControlSettings:s,panelId:a,className:l="block-editor-tools-panel-color-gradient-settings__item"}){const c=o.find(e=>void 0!==e.userValue),{key:u,...d}=o[0]??{},h=(0,T.useRef)(void 0);return(0,Er.jsx)(aC,{className:l,hasValue:t,label:e,onDeselect:n,isShownByDefault:i,panelId:a,children:(0,Er.jsx)(wC.A,{popoverProps:zE,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:i,isOpen:o})=>{const s={onClick:i,className:(0,mh.A)("block-editor-panel-color-gradient-settings__dropdown",{"is-open":o}),"aria-expanded":o,ref:h};return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(fv.Ay,{...s,__next40pxDefaultSize:!0,children:(0,Er.jsx)(UE,{indicators:r,label:e})}),t()&&(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,label:(0,ee.__)("Reset"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:uS.A,onClick:()=>{n(),o&&i(),h.current?.focus()}})]})},renderContent:()=>(0,Er.jsx)(CC.A,{paddingSize:"none",children:(0,Er.jsxs)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:[1===o.length&&(0,Er.jsx)($E,{...d,colorGradientControlSettings:s},u),o.length>1&&(0,Er.jsxs)(VE,{defaultTabId:c?.key,children:[(0,Er.jsx)(VE.TabList,{children:o.map(e=>(0,Er.jsx)(VE.Tab,{tabId:e.key,children:e.label},e.key))}),o.map(e=>{const{key:t,...n}=e;return(0,Er.jsx)(VE.TabPanel,{tabId:t,focusable:!1,children:(0,Er.jsx)($E,{...n,colorGradientControlSettings:s},t)},t)})]})]})})})})}function WE({as:e=DE,value:t,onChange:n,inheritedValue:i=t,settings:r,panelId:o,defaultControls:s=FE,label:a,children:l}){const c=iv(r),u=rv(r),d=r?.color?.custom,h=r?.color?.customGradient,p=c.length>0||d,f=u.length>0||h,m=!!r?.background?.gradient,g=f&&!m,b=e=>vC({settings:r},"",e),y=e=>{const t=c.flatMap(({colors:e})=>e).find(({color:t})=>t===e);return t?"var:preset|color|"+t.slug:e},v=e=>{const t=u.flatMap(({gradients:e})=>e).find(({gradient:t})=>t===e);return t?"var:preset|gradient|"+t.slug:e},_=PE(r),x=b(i?.color?.background),k=b(t?.color?.background),w=b(i?.color?.gradient),C=b(t?.color?.gradient),S=RE(r),A=b(i?.elements?.link?.color?.text),I=b(t?.elements?.link?.color?.text),E=b(i?.elements?.link?.[":hover"]?.color?.text),j=b(t?.elements?.link?.[":hover"]?.color?.text),B=NE(r),N=b(i?.color?.text),R=b(t?.color?.text),O=e=>{let i=_p(t,["color","text"],y(e));N===A&&(i=_p(i,["elements","link","color","text"],y(e))),n(i)},L=[{name:"caption",label:(0,ee.__)("Captions"),showPanel:OE(r)},{name:"button",label:(0,ee.__)("Button"),showPanel:ME(r)},{name:"heading",label:(0,ee.__)("Heading"),showPanel:LE(r)},{name:"h1",label:(0,ee.__)("H1"),showPanel:LE(r)},{name:"h2",label:(0,ee.__)("H2"),showPanel:LE(r)},{name:"h3",label:(0,ee.__)("H3"),showPanel:LE(r)},{name:"h4",label:(0,ee.__)("H4"),showPanel:LE(r)},{name:"h5",label:(0,ee.__)("H5"),showPanel:LE(r)},{name:"h6",label:(0,ee.__)("H6"),showPanel:LE(r)}],M=(0,T.useCallback)(e=>({...e,color:void 0,elements:{...e?.elements,link:{...e?.elements?.link,color:void 0,":hover":{color:void 0}},...L.reduce((t,n)=>({...t,[n.name]:{...e?.elements?.[n.name],color:void 0}}),{})}}),[L]),P=[B&&{key:"text",label:(0,ee.__)("Text"),hasValue:()=>!!R,resetValue:()=>O(void 0),isShownByDefault:s.text,indicators:[N],tabs:[{key:"text",label:(0,ee.__)("Text"),inheritedValue:N,setValue:O,userValue:R}]},_&&{key:"background",label:(0,ee.__)("Background"),hasValue:()=>!!k||!m&&!!C,resetValue:()=>{const e=_p(t,["color","background"],void 0);m||(e.color.gradient=void 0),n(e)},isShownByDefault:s.background,indicators:[(g?w:void 0)??x],tabs:[p&&{key:"background",label:(0,ee.__)("Color"),inheritedValue:x,setValue:e=>{const i=_p(t,["color","background"],y(e));m||(i.color.gradient=void 0),n(i)},userValue:k},g&&{key:"gradient",label:(0,ee.__)("Gradient"),inheritedValue:w,setValue:e=>{const i=_p(t,["color","gradient"],v(e));i.color.background=void 0,n(i)},userValue:C,isGradient:!0}].filter(Boolean)},S&&{key:"link",label:(0,ee.__)("Link"),hasValue:()=>!!I||!!j,resetValue:()=>{let e=_p(t,["elements","link",":hover","color","text"],void 0);e=_p(e,["elements","link","color","text"],void 0),n(e)},isShownByDefault:s.link,indicators:[A,E],tabs:[{key:"link",label:(0,ee.__)("Default"),inheritedValue:A,setValue:e=>{n(_p(t,["elements","link","color","text"],y(e)))},userValue:I},{key:"hover",label:(0,ee.__)("Hover"),inheritedValue:E,setValue:e=>{n(_p(t,["elements","link",":hover","color","text"],y(e)))},userValue:j}]}].filter(Boolean);return L.forEach(({name:e,label:r,showPanel:o})=>{if(!o)return;const a=b(i?.elements?.[e]?.color?.background),l=b(i?.elements?.[e]?.color?.gradient),c=b(i?.elements?.[e]?.color?.text),u=b(t?.elements?.[e]?.color?.background),d=b(t?.elements?.[e]?.color?.gradient),h=b(t?.elements?.[e]?.color?.text),m="caption"!==e;P.push({key:e,label:r,hasValue:()=>!!(h||u||d),resetValue:()=>{const i=_p(t,["elements",e,"color","background"],void 0);i.elements[e].color.gradient=void 0,i.elements[e].color.text=void 0,n(i)},isShownByDefault:s[e],indicators:m?[c,l??a]:[c],tabs:[p&&{key:"text",label:(0,ee.__)("Text"),inheritedValue:c,setValue:i=>{n(_p(t,["elements",e,"color","text"],y(i)))},userValue:h},p&&m&&{key:"background",label:(0,ee.__)("Background"),inheritedValue:a,setValue:i=>{const r=_p(t,["elements",e,"color","background"],y(i));r.elements[e].color.gradient=void 0,n(r)},userValue:u},f&&m&&{key:"gradient",label:(0,ee.__)("Gradient"),inheritedValue:l,setValue:i=>{const r=_p(t,["elements",e,"color","gradient"],v(i));r.elements[e].color.background=void 0,n(r)},userValue:d,isGradient:!0}].filter(Boolean)})}),(0,Er.jsxs)(e,{resetAllFilter:M,value:t,onChange:n,panelId:o,label:a,children:[P.map(e=>{const{key:t,...n}=e;return(0,Er.jsx)(HE,{...n,colorGradientControlSettings:{colors:c,disableCustomColors:!d,gradients:u,disableCustomGradients:!h},panelId:o},t)}),l]})}var GE={backgroundImage:!0,gradient:!0};function qE(e,t){return"web"===Uo.A.OS&&e?.background?.[t]}function KE(e){const{backgroundImage:t,gradient:n}=e?.background||{};return"web"===Uo.A.OS&&(t||n)}function YE(e){return!!e?.background?.backgroundImage?.id||"string"==typeof e?.background?.backgroundImage||!!e?.background?.backgroundImage?.url}function JE(e){return"string"==typeof e?.background?.gradient&&""!==e?.background?.gradient}function XE({resetAllFilter:e,onChange:t,value:n,panelId:i,children:r,headerLabel:o}){const s=Zw();return(0,Er.jsx)(Xw,{label:o,resetAll:()=>{const i=e(n);t(i)},panelId:i,hasInnerWrapper:!0,className:"background-block-support-panel",__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:s,children:(0,Er.jsx)("div",{className:"background-block-support-panel__inner-wrapper",children:r})})}function ZE({as:e=XE,value:t,onChange:n,inheritedValue:i,settings:r,panelId:o,defaultControls:s=GE,defaultValues:a={},headerLabel:l=(0,ee.__)("Background")}){const c=rv(r),u=r?.color?.customGradient,d=c.length>0||u,h=qE(r,"gradient"),p=d&&h,f=qE(r,"backgroundImage"),m=(0,T.useCallback)(e=>({...e,background:{},color:h?{...e?.color,gradient:void 0}:e?.color}),[h]);if(!p&&!f)return null;const g=e=>vC({settings:r},"",e),b=g(t?.background?.gradient??t?.color?.gradient),y=g(i?.background?.gradient??i?.color?.gradient);return(0,Er.jsxs)(e,{resetAllFilter:m,value:t,onChange:n,panelId:o,headerLabel:l,children:[f&&(0,Er.jsx)(aC,{className:"block-editor-background-panel__item",hasValue:()=>YE(t),label:(0,ee.__)("Image"),onDeselect:()=>n(_p(t,["background","backgroundImage"],void 0)),isShownByDefault:s.backgroundImage,panelId:o,children:(0,Er.jsx)(bI,{value:t,onChange:n,settings:r,inheritedValue:i,defaultControls:s,defaultValues:a})}),p&&(0,Er.jsx)(HE,{className:"block-editor-background-panel__item",label:(0,ee.__)("Gradient"),hasValue:()=>JE(t),resetValue:()=>{let e=_p(t,["background","gradient"],void 0);e=_p(e,["color","gradient"],void 0),n(e)},isShownByDefault:s.gradient,indicators:[b],tabs:[{key:"gradient",label:(0,ee.__)("Gradient"),inheritedValue:b??y,setValue:e=>{let i=_p(t,["background","gradient"],(e=>{const t=c.flatMap(({gradients:e})=>e).find(({gradient:t})=>t===e);return t?"var:preset|gradient|"+t.slug:e})(e));i=_p(i,["color","gradient"],void 0),n(i)},userValue:b,isGradient:!0}],colorGradientControlSettings:{gradients:c,disableCustomGradients:!u},panelId:o})]})}var QE="background",ej={backgroundSize:"cover",backgroundPosition:"50% 50%"};function tj(e,t="any"){const n=vn(e,QE);return!0===n||("any"===t?!!(n?.backgroundImage||n?.backgroundSize||n?.backgroundRepeat||n?.gradient):!!n?.[t])}function nj(e){if(!e||!e?.backgroundImage?.url)return;let t;return e?.backgroundSize||(t={backgroundSize:ej.backgroundSize}),"contain"!==e?.backgroundSize||e?.backgroundPosition||(t={backgroundPosition:ej.backgroundPosition}),t}function ij(e){return YE(e)||JE(e)?"has-background":""}function rj({children:e,backgroundGradientSupported:t=!1}){const n=(0,T.useCallback)(e=>{const n=e.className?.includes("has-background")?e.className.split(" ").filter(e=>"has-background"!==e).join(" ")||void 0:e.className;return{...e,className:n,style:ov({...e.style,background:void 0,color:t?{...e.style?.color,gradient:void 0}:e.style?.color})}},[t]);return(0,Er.jsx)(oC,{group:"background",resetAllFilter:n,children:e})}function oj({clientId:e,name:t,setAttributes:n,settings:i}){const{style:r,className:o,inheritedValue:s}=(0,zt.A)(n=>{const{getBlockAttributes:i,getSettings:r}=n(Qy),o=r(),s=i(e);return{style:s?.style,className:s?.className,inheritedValue:o[Rh]?.blocks?.[t]}},[e,t]),a=tj(t,"gradient"),l=(0,T.useCallback)(({children:e})=>(0,Er.jsx)(rj,{backgroundGradientSupported:a,children:e}),[a]);if(!KE(i)||!tj(t))return null;const c=a&&!r?.background?.gradient&&r?.color?.gradient?{...r,background:{...r?.background,gradient:r?.color?.gradient}}:r,u={...i,background:{...i.background,backgroundSize:i?.background?.backgroundSize&&tj(t,"backgroundSize")}},d=vn(t,[QE,"__experimentalDefaultControls"]);return(0,Er.jsx)(ZE,{inheritedValue:s,as:l,panelId:e,defaultValues:ej,settings:u,onChange:e=>{const t=a&&!!r?.color?.gradient,i={style:ov(a?{...e,color:{...e?.color,gradient:void 0}}:e)};t&&e?.background?.gradient?i.className=(0,mh.A)(o,"has-background"):!e?.background?.gradient&&o?.includes("has-background")&&(i.className=o.split(" ").filter(e=>"has-background"!==e).join(" ")||void 0),n(i)},defaultControls:d,value:c})}var sj={useBlockProps:function({name:e,style:t}){if(!tj(e)||!t?.background?.backgroundImage)return;const n=nj(t?.background);return n?{style:{...n}}:void 0},attributeKeys:["style"],hasSupport:tj};(0,Ei.U2)("blocks.registerBlockType","core/lock/addAttribute",function(e){return"type"in(e.attributes?.lock??{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e});var aj=n(77779),lj=n(93691),cj=n(87691),uj=n(67326),dj=n(36484),hj=(0,T.memo)(function({icon:e,showColors:t=!1,className:n,context:i}){"block-default"===e?.src&&(e={src:dj.A});const r=(0,Er.jsx)(IC.A,{icon:e&&e.src?e.src:e,context:i}),o=t?{backgroundColor:e&&e.background,color:e&&e.foreground}:{};return(0,Er.jsx)("span",{style:o,className:(0,mh.A)("block-editor-block-icon",n,{"has-colors":t}),children:r})}),pj=function({blockTypes:e,value:t,onItemChange:n}){return(0,Er.jsx)("ul",{className:"block-editor-block-manager__checklist",children:e.map(e=>(0,Er.jsxs)("li",{className:"block-editor-block-manager__checklist-item",children:[(0,Er.jsx)(WA.A,{label:e.title,checked:t.includes(e.name),onChange:(...t)=>n(e,...t)}),(0,Er.jsx)(hj,{icon:e.icon})]},e.name))})},fj=function e({title:t,blockTypes:n,selectedBlockTypes:i,onChange:r}){const o=(0,SS.A)(e),s=(0,T.useCallback)((e,t)=>{r(t?[...i,e]:i.filter(({name:t})=>t!==e.name))},[i,r]),a=(0,T.useCallback)(e=>{r(e?[...i,...n.filter(e=>!i.find(({name:t})=>t===e.name))]:i.filter(e=>!n.find(({name:t})=>t===e.name)))},[n,i,r]);if(!n.length)return null;const l=n.map(({name:e})=>e).filter(e=>(i??[]).some(t=>t.name===e)),c="block-editor-block-manager__category-title-"+o,u=l.length===n.length,d=!u&&l.length>0;return(0,Er.jsxs)("div",{role:"group","aria-labelledby":c,className:"block-editor-block-manager__category",children:[(0,Er.jsx)(WA.A,{checked:u,onChange:a,className:"block-editor-block-manager__category-title",indeterminate:d,label:(0,Er.jsx)("span",{id:c,children:t})}),(0,Er.jsx)(pj,{blockTypes:n,value:l,onItemChange:s})]})};function mj({blockTypes:e,selectedBlockTypes:t,onChange:n,showSelectAll:i=!0}){const r=(0,uj.A)(dt.L,500),[o,s]=(0,T.useState)(""),{categories:a,isMatchingSearchTerm:l}=(0,zt.A)(e=>({categories:e(Zi).getCategories(),isMatchingSearchTerm:e(Zi).isMatchingSearchTerm}),[]),c=e.filter(e=>!o||l(e,o)),u=t.length>0&&t.length!==e.length,d=e.length>0&&t.length===e.length;return(0,T.useEffect)(()=>{if(!o)return;const e=c.length,t=(0,ee.sprintf)((0,ee._n)("%d result found.","%d results found.",e),e);r(t)},[c?.length,o,r]),(0,Er.jsxs)(Q_.A,{className:"block-editor-block-manager__content",spacing:4,children:[(0,Er.jsx)(cj.A,{label:(0,ee.__)("Search for a block"),placeholder:(0,ee.__)("Search for a block"),value:o,onChange:e=>s(e),className:"block-editor-block-manager__search"}),i&&(0,Er.jsx)(WA.A,{className:"block-editor-block-manager__select-all",label:(0,ee.__)("Select all"),checked:d,onChange:()=>{n(d?[]:e)},indeterminate:u}),(0,Er.jsxs)("div",{tabIndex:"0",role:"region","aria-label":(0,ee.__)("Available block types"),className:"block-editor-block-manager__results",children:[0===c.length&&(0,Er.jsx)("p",{className:"block-editor-block-manager__no-results",children:(0,ee.__)("No blocks found.")}),a.map(e=>(0,Er.jsx)(fj,{title:e.title,blockTypes:c.filter(t=>t.category===e.slug),selectedBlockTypes:t,onChange:n},e.slug)),(0,Er.jsx)(fj,{title:(0,ee.__)("Uncategorized"),blockTypes:c.filter(({category:e})=>!e),selectedBlockTypes:t,onChange:n})]})]})}function gj({clientId:e,blockTypes:t,selectedBlockTypes:n,onClose:i}){const[r,o]=(0,T.useState)(n),{updateBlockAttributes:s}=(0,Vt.A)(Qy);return(0,Er.jsx)(aj.A,{title:(0,ee._x)("Manage allowed blocks","modal title"),onRequestClose:i,overlayClassName:"block-editor-block-allowed-blocks-modal",focusOnMount:"firstContentElement",size:"medium",children:(0,Er.jsxs)(Q_.A,{as:"form",onSubmit:n=>{n.preventDefault(),(()=>{const n=r.length===t.length,o=r.map(({name:e})=>e);s(e,{allowedBlocks:n?void 0:o}),i()})()},spacing:"4",children:[(0,Er.jsx)(lj.A,{children:(0,ee.__)("Select which blocks can be added inside this container.")}),(0,Er.jsx)(mj,{blockTypes:t,selectedBlockTypes:r,onChange:e=>{o(e)}}),(0,Er.jsxs)(Kv.A,{className:"block-editor-block-allowed-blocks-modal__actions",justify:"flex-end",expanded:!1,children:[(0,Er.jsx)(Yv.A,{children:(0,Er.jsx)(fv.Ay,{variant:"tertiary",onClick:i,__next40pxDefaultSize:!0,children:(0,ee.__)("Cancel")})}),(0,Er.jsx)(Yv.A,{children:(0,Er.jsx)(fv.Ay,{variant:"primary",type:"submit",__next40pxDefaultSize:!0,children:(0,ee.__)("Apply")})})]})]})})}function bj({clientId:e}){const[t,n]=(0,T.useState)(!1),{blockTypes:i,selectedBlockNames:r}=(0,zt.A)(t=>{const{getBlockAttributes:n}=t(Qy);return{blockTypes:t(Zi).getBlockTypes(),selectedBlockNames:n(e)?.allowedBlocks}},[e]),o=i.filter(e=>_n(e,"inserter",!0)&&(!e.parent||e.parent.includes("core/post-content")));if(!o)return null;const s=void 0===r?o:o.filter(e=>r.includes(e.name));return(0,Er.jsxs)("div",{className:"block-editor-block-allowed-blocks-control",children:[(0,Er.jsxs)(mk.Ay,{help:(0,ee.__)("Specify which blocks are allowed inside this container."),children:[(0,Er.jsx)(mk.Ay.VisualLabel,{children:(0,ee.__)("Allowed Blocks")}),(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{n(!0)},className:"block-editor-block-allowed-blocks-control__button",children:(0,ee.__)("Manage allowed blocks")})]}),t&&(0,Er.jsx)(gj,{clientId:e,blockTypes:o,selectedBlockTypes:s,onClose:()=>n(!1)})]})}var yj={edit:function({clientId:e}){return"contentOnly"===Vk()?null:(0,Er.jsx)(cw.Fill,{children:(0,Er.jsx)(bj,{clientId:e})})},attributeKeys:["allowedBlocks"],hasSupport:e=>_n(e,"allowedBlocks")};(0,Ei.U2)("blocks.registerBlockType","core/allowedBlocks/attribute",function(e){return e?.attributes?.allowedBlocks?.type||_n(e,"allowedBlocks")&&(e.attributes={...e.attributes,allowedBlocks:{type:"array"}}),e}),(0,Ei.U2)("blocks.switchToBlockType.transformedBlock","core/allowedBlocks/addTransforms",function(e,t,n,i){if(!_n(e.name,"allowedBlocks"))return e;if(1!==t.length&&1===i.length&&e.innerBlocks.length===t.length)return e;if(1===i.length&&t.length>1||i.length>1&&1===t.length)return e;if(i.length>1&&t.length>1&&i.length!==t.length)return e;if(e.attributes.allowedBlocks)return e;const r=t[n]?.attributes?.allowedBlocks;if(!r)return e;const o=bn(e.name),s=o?.allowedBlocks||[];if(!s.length)return{...e,attributes:{...e.attributes,allowedBlocks:r}};const a=r.filter(e=>s.includes(e));return{...e,attributes:{...e.attributes,allowedBlocks:a}}});var vj=/[\s#]/g,_j={addSaveProps:function(e,t,n){return _n(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e},edit:function({anchor:e,setAttributes:t}){if("default"!==Vk())return null;const n="web"===Uo.A.OS;return(0,Er.jsx)(oC,{group:"advanced",children:(0,Er.jsx)(kS.A,{__next40pxDefaultSize:!0,className:"html-anchor-control",label:(0,ee.__)("HTML anchor"),help:(0,Er.jsxs)(Er.Fragment,{children:[(0,ee.__)("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,Er.jsxs)(Er.Fragment,{children:[" ",(0,Er.jsx)(OA.A,{href:(0,ee.__)("https://wordpress.org/documentation/article/page-jumps/"),children:(0,ee.__)("Learn more about anchors")})]})]}),value:e||"",placeholder:n?null:(0,ee.__)("Add an anchor"),onChange:e=>{e=e.replace(vj,"-"),t({anchor:""!==e?e:void 0})},autoCapitalize:"none",autoComplete:"off"})})},attributeKeys:["anchor"],hasSupport:e=>_n(e,"anchor")};(0,Ei.U2)("blocks.registerBlockType","core/anchor/attribute",function(e){return"type"in(e.attributes?.anchor??{})||_n(e,"anchor")&&(e.attributes={...e.attributes,anchor:{type:"string"}}),e});var xj={addSaveProps:function(e,t,n){return _n(t,"ariaLabel")&&!av(t,"ariaLabel","ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e},attributeKeys:["ariaLabel"],hasSupport:e=>_n(e,"ariaLabel")};(0,Ei.U2)("blocks.registerBlockType","core/ariaLabel/attribute",function(e){return e?.attributes?.ariaLabel?.type||_n(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:{type:"string"}}),e});var kj=n(62391),wj=(0,T.createContext)({});function Cj({value:e,children:t}){const n=(0,T.useContext)(wj),i=(0,T.useMemo)(()=>({...n,...e}),[n,e]);return(0,Er.jsx)(wj.Provider,{value:i,children:t})}wj.displayName="BlockContext";var Sj=wj;function Aj({clientId:e,maximumLength:t,context:n}){const i=(0,zt.A)(t=>{if(!e)return null;const{getBlockName:i,getBlockAttributes:r}=t(Qy),{getBlockType:o,getActiveBlockVariation:s}=t(Zi),a=i(e),l=o(a);if(!l)return null;const c=r(e),u=Tn(l,c,n);if(u!==l.title)return u;const d=s(a,c);return d?.title||l.title},[e,n]);if(!i)return null;if(t&&t>0&&i.length>t){const e="...";return i.slice(0,t-e.length)+e}return i}function Ij(e){const t=e?.style?.position?.type;return"sticky"===t?(0,ee.__)("Sticky"):"fixed"===t?(0,ee.__)("Fixed"):null}function Ej(e){return(0,zt.A)(t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:i,__experimentalGetParsedPattern:r}=t(Qy),{getBlockType:o,getActiveBlockVariation:s}=t(Zi),a=n(e),l=o(a);if(!l)return null;const c=i(e),u=c?.metadata?.patternName;if(u){const e=r(u),t=Ij(c);return{isSynced:!1,title:(0,ee.__)("Pattern"),icon:pp.A,description:e?.description||(0,ee.__)("A block pattern."),anchor:c?.anchor,positionLabel:t,positionType:c?.style?.position?.type,name:e?.title||c?.metadata?.name}}const d=s(a,c),h=xn(l)||kn(l),p=(h?Tn(l,c):void 0)||l.title,f=Ij(c),m={isSynced:h,title:p,icon:l.icon,description:l.description,anchor:c?.anchor,positionLabel:f,positionType:c?.style?.position?.type,name:c?.metadata?.name};return d?{isSynced:h,title:d.title||l.title,icon:d.icon||l.icon,description:d.description||l.description,anchor:c?.anchor,positionLabel:f,positionType:c?.style?.position?.type,name:c?.metadata?.name}:m},[e])}function jj({isControl:e}={isControl:!1}){return(0,dw.A)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:e?35:259}}}function Tj({fields:e,visibleFields:t,onToggleField:n}){const{popoverProps:i}=jj();return e&&0!==e.length?(0,Er.jsx)(xv.A,{icon:ww.A,label:(0,ee.__)("Options"),popoverProps:i,toggleProps:{size:"small"},children:({onClose:i})=>(0,Er.jsx)(Fv.A,{label:(0,ee.__)("Show / Hide"),children:e.map(e=>{const r=t.includes(e.id);return(0,Er.jsx)(zv.A,{isSelected:r,onClick:()=>{n(e.id),i()},role:"menuitemcheckbox",icon:r?xw.A:null,children:e.label},e.id)})})}):null}var Bj=(0,T.createContext)({});Bj.displayName="PrivateBlockContext";var Nj=n(64132);function Rj(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function Oj({allowedFormats:e,disableFormats:t}){return t?Oj.EMPTY_ARRAY:e}Oj.EMPTY_ARRAY=[];var Lj=["`",'"',"'","“”","‘’"];function Mj(e){let t=e.length;for(;t--;){const n=Mb(e[t].attributes);if(n)return e[t].attributes[n]=e[t].attributes[n].toString().replace(Lb,""),[e[t].clientId,n,0,0];const i=Mj(e[t].innerBlocks);if(i)return i}return[]}function Pj({clipboardData:e}){let t="",n="";try{t=e.getData("text/plain"),n=e.getData("text/html")}catch{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 i=NC(e);return i.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}(i,n)?{files:i}:{html:n,plainText:t,files:[]}}var Dj=[e=>t=>{function n(n){const{inputType:i,data:r}=n,{value:o,onChange:s,registry:a}=e.current;if("insertText"!==i)return;if(et(o))return;const l=(0,Ei.W5)("blockEditor.wrapSelectionSettings",Lj).find(([e,t])=>e===r||t===r);if(!l)return;const[c,u=c]=l,d=o.start,h=o.end+c.length;let p=st(o,c,d,d);p=st(p,u,h,h);const{__unstableMarkLastChangeAsPersistent:f,__unstableMarkAutomaticChange:m}=a.dispatch(Qy);f(),s(p),m();const g={};for(const e in n)g[e]=n[e];g.data=u;const{ownerDocument:b}=t,{defaultView:y}=b,v=new y.InputEvent("input",g);window.queueMicrotask(()=>{n.target.dispatchEvent(v)}),n.preventDefault()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}},e=>t=>{function n(){const{getValue:t,onReplace:n,selectionChange:i,registry:r}=e.current;if(!n)return;const o=t(),{start:s,text:a}=o;if(" "!==a.slice(s-1,s))return;const l=a.slice(0,s).trim(),c=ar(lr("from").filter(({type:e})=>"prefix"===e),({prefix:e})=>l===e);if(!c)return;const u=Be({value:st(o,Lb,0,s)}),d=c.transform(u);return i(...Mj([d])),n([d]),r.dispatch(Qy).__unstableMarkAutomaticChange(),!0}function i(t){const{inputType:i,type:r}=t,{getValue:o,onChange:s,__unstableAllowPrefixTransformations:a,formatTypes:l,registry:c,onReplace:u}=e.current;if("insertText"!==i&&"compositionend"!==r)return;if(a&&n())return;const d=o(),h=ar(lr("from").filter(e=>"input"===e.type),e=>e.regExp.test(d.text));if(h)return u(h.transform()),void c.dispatch(Qy).__unstableMarkAutomaticChange();const p=l.reduce((e,{__unstableInputRule:t})=>(t&&(e=t(e)),e),function(e){const{start:t,text:n}=e;return t<18||"tales of gutenberg"!==n.slice(t-18,t).toLowerCase()?e:st(e," 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️")}(d)),{__unstableMarkLastChangeAsPersistent:f,__unstableMarkAutomaticChange:m}=c.dispatch(Qy);p!==d&&(f(),s({...p,activeFormats:d.activeFormats}),m())}return t.addEventListener("input",i),t.addEventListener("compositionend",i),()=>{t.removeEventListener("input",i),t.removeEventListener("compositionend",i)}},e=>t=>{function n(t){if("insertReplacementText"!==t.inputType)return;const{registry:n}=e.current;n.dispatch(Qy).__unstableMarkLastChangeAsPersistent()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}},()=>e=>{function t(e){(Rt.kx.primary(e,"z")||Rt.kx.primary(e,"y")||Rt.kx.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}},e=>t=>{const{keyboardShortcuts:n}=e.current;function i(e){for(const t of n.current)t(e)}return t.addEventListener("keydown",i),()=>{t.removeEventListener("keydown",i)}},e=>t=>{const{inputEvents:n}=e.current;function i(e){for(const t of n.current)t(e)}return t.addEventListener("input",i),()=>{t.removeEventListener("input",i)}},e=>t=>{function n(t){const{keyCode:n}=t;if(t.defaultPrevented)return;if(n!==Rt.G_&&n!==Rt._f)return;const{registry:i}=e.current,{didAutomaticChange:r,getSettings:o}=i.select(Qy),{__experimentalUndo:s}=o();s&&r()&&(t.preventDefault(),s())}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{function n(n){const{disableFormats:i,onChange:r,value:o,formatTypes:s,tagName:a,onReplace:l,__unstableEmbedURLOnPaste:c,preserveWhiteSpace:u,pastePlainText:d}=e.current;if(!t.contains(n.target))return;if(n.defaultPrevented)return;const{plainText:h,html:p}=Pj(n);if(n.preventDefault(),window.console.log("Received HTML (RichText):\n\n",p),window.console.log("Received plain text (RichText):\n\n",h),i)return void r(st(o,h));function f(e){const t=s.reduce((e,{__unstablePasteRule:t})=>(t&&e===o&&(e=t(o,{html:p,plainText:h})),e),o);if(t!==o)r(t);else{const t=We({html:e});!function(e,t){if(t?.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}(t,o.activeFormats),r(st(o,t))}}if("true"===n.clipboardData.getData("rich-text"))return void f(p);if(d)return void r(st(o,We({text:h})));let m="INLINE";const g=h.trim();c&&tt(o)&&(0,TS.m)(g)&&/^https?:/.test(g)&&(m="BLOCKS");const b=Zs({HTML:p,plainText:h,mode:m,tagName:a,preserveWhiteSpace:u});"string"==typeof b?f(b):b.length>0&&l&&tt(o)&&l(b,b.length-1,-1)}const{defaultView:i}=t.ownerDocument;return i.addEventListener("paste",n),()=>{i.removeEventListener("paste",n)}},e=>t=>{function n(t){const{keyCode:n}=t;if(t.defaultPrevented)return;const{value:i,onMerge:r,onRemove:o}=e.current;if(n===Rt.SJ||n===Rt.G_){const{start:e,end:s,text:a}=i,l=n===Rt.G_,c=i.activeFormats&&!!i.activeFormats.length;if(!et(i)||c||l&&0!==e||!l&&s!==a.length)return;r?r(!l):o&&tt(i)&&l&&o(!l),t.preventDefault()}}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{function n(t){if(t.keyCode!==Rt.Fm)return;const{onReplace:n,onSplit:i}=e.current;n&&i&&(t.__deprecatedOnSplit=!0)}function i(n){if(n.defaultPrevented)return;if(n.target!==t)return;if(n.keyCode!==Rt.Fm)return;const{value:i,onChange:r,disableLineBreaks:o,onSplitAtEnd:s,onSplitAtDoubleLineEnd:a,registry:l}=e.current;n.preventDefault();const{text:c,start:u,end:d}=i;n.shiftKey?o||r(st(i,"\n")):s&&u===d&&d===c.length?s():a&&u===d&&d===c.length&&"\n\n"===c.slice(-2)?l.batch(()=>{const e={...i};e.start=e.end-2,r(at(e)),a()}):o||r(st(i,"\n"))}const{defaultView:r}=t.ownerDocument;return r.addEventListener("keydown",i),t.addEventListener("keydown",n),()=>{r.removeEventListener("keydown",i),t.removeEventListener("keydown",n)}},e=>t=>{function n(){const{registry:n}=e.current;if(!n.select(Qy).isMultiSelecting())return;const i=t.parentElement.closest('[contenteditable="true"]');i&&i.focus()}return t.addEventListener("focus",n),()=>{t.removeEventListener("focus",n)}}];function Fj(e){const t=(0,T.useRef)(e);(0,T.useInsertionEffect)(()=>{t.current=e});const n=(0,T.useMemo)(()=>Dj.map(e=>e(t)),[t]);return(0,bt.A)(t=>{if(!e.isSelected)return;const i=n.map(e=>e(t));return()=>{i.forEach(e=>e())}},[n,e.isSelected])}var zj={},Vj=Symbol("usesContext");function Uj({onChange:e,onFocus:t,value:n,forwardedRef:i,settings:r,isVisible:o}){const{name:s,edit:a,[Vj]:l}=r,c=(0,T.useContext)(Sj),u=(0,T.useMemo)(()=>l?Object.fromEntries(Object.entries(c).filter(([e])=>l.includes(e))):zj,[l,c]);if(!a)return null;const d=Qe(n,s),h=void 0!==d,p=function({start:e,end:t,replacements:n,text:i}){if(e+1===t&&i[e]===we)return n[e]}(n),f=void 0!==p&&p.type===s;return(0,Er.jsx)(a,{isActive:h,isVisible:o,activeAttributes:h&&d.attributes||{},isObjectActive:f,activeObjectAttributes:f&&p.attributes||{},value:n,onChange:e,onFocus:t,contentRef:i,context:u},s)}function $j({formatTypes:e,...t}){return e.map(e=>(0,T.createElement)(Uj,{settings:e,...t,key:e.name}))}var Hj=n(55212),Wj=n(44059);function Gj({items:e,onSelect:t,selectedIndex:n,instanceId:i,listBoxId:r,className:o,Component:s="div"}){return(0,Er.jsx)(s,{id:r,role:"listbox",className:"components-autocomplete__results",children:e.map((e,r)=>(0,Er.jsx)(fv.Ay,{id:`components-autocomplete-item-${i}-${e.key}`,role:"option",__next40pxDefaultSize:!0,"aria-selected":r===n,accessibleWhenDisabled:!0,disabled:e.isDisabled,className:(0,mh.A)("components-autocomplete__result",o,{"is-selected":r===n}),variant:r===n?"primary":void 0,onClick:()=>t(e),children:e.label},e.key))})}function qj({autocompleter:e,filterValue:t,instanceId:n,listBoxId:i,className:r,selectedIndex:o,onChangeOptions:s,onSelect:a,reset:l,contentRef:c}){const u=e.useItems??function(e){return t=>{const[n,i]=(0,T.useState)([]);return(0,T.useLayoutEffect)(()=>{const{options:n,isDebounced:r}=e,o=(0,mS.s)(()=>{const r=Promise.resolve("function"==typeof n?n(t):n).then(n=>{if(r.canceled)return;const o=n.map((t,n)=>({key:`${e.name}-${n}`,value:t,label:e.getOptionLabel(t),keywords:e.getOptionKeywords?e.getOptionKeywords(t):[],isDisabled:!!e.isOptionDisabled&&e.isOptionDisabled(t)})),s=new RegExp("(?:\\b|\\s|^)"+(0,mx.Nt)(t),"i");i(function(e,t=[],n=10){const i=[];for(let r=0;re.test(Wn(t)));if(a&&(i.push(o),i.length===n))break}return i}(s,o))});return r},r?250:0),s=o();return()=>{o.cancel(),s&&(s.canceled=!0)}},[t]),[n]}}(e),[d]=u(t),h=Zt({editableContentElement:c.current}),[p,f]=(0,T.useState)(!1),m=(0,T.useRef)(null),g=(0,gt.A)([m,(0,bt.A)(e=>{c.current&&f(e.ownerDocument!==c.current.ownerDocument)},[c])]);var b,y;b=m,y=l,(0,T.useEffect)(()=>{const e=e=>{b.current&&!b.current.contains(e.target)&&y(e)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}},[y,b]);const v=(0,uj.A)(dt.L,500);return(0,T.useLayoutEffect)(()=>{var e;s(d),e=d,v&&(e.length?v(t?(0,ee.sprintf)((0,ee._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length):(0,ee.sprintf)((0,ee._n)("Initial %d result loaded. Type to filter all available results. Use up and down arrow keys to navigate.","Initial %d results loaded. Type to filter all available results. Use up and down arrow keys to navigate.",e.length),e.length),"assertive"):v((0,ee.__)("No results."),"assertive"))},[d]),0===d.length?null:(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(uw.Ay,{offset:8,focusOnMount:!1,placement:"top-start",className:"components-autocomplete__popover",anchor:h,ref:g,children:(0,Er.jsx)(Gj,{items:d,onSelect:a,selectedIndex:o,instanceId:n,listBoxId:i,className:r})}),c.current&&p&&(0,Wj.createPortal)((0,Er.jsx)(Gj,{items:d,onSelect:a,selectedIndex:o,instanceId:n,listBoxId:i,className:r,Component:kC.A}),c.current.ownerDocument.body)]})}var Kj=n(12387),Yj=e=>{if(null===e)return"";switch(typeof e){case"string":case"number":return e.toString();case"object":return e instanceof Array?e.map(Yj).join(""):"props"in e?Yj(e.props.children):"";default:return""}},Jj=Yj,Xj={},Zj={selectedIndex:0,filteredOptions:[],filterValue:"",autocompleter:null};function Qj(e,t){switch(t.type){case"RESET":return Zj;case"SELECT":return{...e,selectedIndex:t.index};case"OPTIONS":return{...e,filteredOptions:t.options,selectedIndex:t.options.length===e.filteredOptions.length?e.selectedIndex:0};case"MATCH":return{...e,autocompleter:t.completer,filterValue:t.query}}}function eT(e){const t=(0,T.useRef)(null),n=(0,T.useRef)(void 0),{record:i}=e,r=function(e){const t=(0,T.useRef)([]),n=t.current[t.current.length-1];return n&&function(e,t){return e.text===t.text&&e.start===t.start&&e.end===t.end}(e,n)||t.current.push(e),t.current.length>2&&t.current.shift(),t.current[0]}(i),{popover:o,listBoxId:s,activeId:a,onKeyDown:l}=function({record:e,onChange:t,onReplace:n,completers:i,contentRef:r}){const o=(0,SS.A)(Xj),[s,a]=(0,T.useReducer)(Qj,Zj),{selectedIndex:l,filteredOptions:c,filterValue:u,autocompleter:d}=s,h=(0,T.useRef)(!1);function p(i){const{getOptionCompletion:o}=d||{};if(!i.isDisabled){if(o){const r=null!==(s=o(i.value,u))&&"object"==typeof s&&"action"in s&&void 0!==s.action&&"value"in s&&void 0!==s.value?s:{action:"insert-at-caret",value:s};if("replace"===r.action)return void n([r.value]);"insert-at-caret"===r.action&&function(n){if(null===d)return;const i=e.start,r=i-d.triggerPrefix.length-u.length,o=We({html:(0,Ar.Ay)(n)});t(st(e,o,r,i))}(r.value)}var s;a({type:"RESET"}),r.current?.focus()}}const f=(0,T.useMemo)(()=>et(e)?Ve(ct(e,0)):"",[e]);(0,T.useEffect)(()=>{const t=function(e,t,n,i,r){if(!e)return null;let o=null,s=-1,a=-1,l=0;for(const n of t){const t=e.lastIndexOf(n.triggerPrefix);if(t<0)continue;const i=t+n.triggerPrefix.length;(i>a||i===a&&n.triggerPrefix.length>l)&&(o=n,s=t,a=i,l=n.triggerPrefix.length)}if(!o)return null;const{allowContext:c,triggerPrefix:u}=o,d=e.slice(s+u.length);if(d.length>50)return null;const h=0===n,p=d.split(/\s/),f=1===p.length,m=i&&p.length<=3;return!h||m||f?c&&!c(e.slice(0,s),r())||/^\s/.test(d)||/\s\s+$/.test(d)?null:{completer:o,filterValue:Wn(d)}:null}(f,i,c.length,h.current,function(){return f?Ve(ct(e,void 0,Ve(e).length)):""});if(!t)return void(d&&a({type:"RESET"}));const{completer:n,filterValue:r}=t;a({type:"MATCH",completer:n,query:r})},[f]);const{key:m=""}=c[l]||{},{className:g}=d||{},b=!!d&&c.length>0,y=b?`components-autocomplete-listbox-${o}`:void 0,v=b?`components-autocomplete-item-${o}-${m}`:null,_=void 0!==e.start,x=!!f&&_&&!!d;return{listBoxId:y,activeId:v,onKeyDown:(0,Kj.n)(function(e){if(h.current="Backspace"===e.key,d&&0!==c.length&&!e.defaultPrevented){switch(e.key){case"ArrowUp":case"ArrowDown":{const t="ArrowUp"===e.key?-1:1,n=(l+t+c.length)%c.length;a({type:"SELECT",index:n}),(0,Hj.H)()&&(0,dt.L)(Jj(c[n].label),"assertive");break}case"Escape":a({type:"RESET"}),e.preventDefault();break;case"Enter":p(c[l]);break;case"ArrowLeft":case"ArrowRight":return void a({type:"RESET"});default:return}e.preventDefault()}}),popover:x&&(0,Er.jsx)(qj,{autocompleter:d,className:g,filterValue:u,instanceId:o,listBoxId:y,selectedIndex:l,onChangeOptions:function(e){a({type:"OPTIONS",options:e})},onSelect:p,contentRef:r,reset:()=>a({type:"RESET"})},d.name+d.triggerPrefix)}}({...e,contentRef:t});n.current=l;const c=(0,gt.A)([t,(0,bt.A)(e=>{function t(e){n.current?.(e)}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}},[])]);return i.text!==r?.text?{ref:c,children:o,"aria-autocomplete":s?"list":void 0,"aria-owns":s,"aria-activedescendant":a}:{ref:c}}var tT=e=>e.name||"",nT=e=>e.title,iT=e=>e.description||"",rT=e=>e.keywords||[],oT=e=>e.category,sT=()=>null,aT=[/([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu,/([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu],lT=new RegExp("(\\p{C}|\\p{P}|\\p{S})+","giu"),cT=new Map,uT=new Map;function dT(e=""){if(cT.has(e))return cT.get(e);const t=(0,Y.W)(e,{splitRegexp:aT,stripRegexp:lT}).split(" ").filter(Boolean);return cT.set(e,t),t}function hT(e=""){if(uT.has(e))return uT.get(e);let t=Wn(e);return t=t.replace(/^\//,""),t=t.toLowerCase(),uT.set(e,t),t}var pT=(e="")=>dT(hT(e)),fT=(e,t,n,i)=>0===pT(i).length?e:mT(e,i,{getCategory:e=>t.find(({slug:t})=>t===e.category)?.title,getCollection:e=>n[e.name.split("/")[0]]?.title}),mT=(e=[],t="",n={})=>{if(0===pT(t).length)return e;const i=e.map(e=>[e,gT(e,t,n)]).filter(([,e])=>e>0);return i.sort(([,e],[,t])=>t-e),i.map(([e])=>e)};function gT(e,t,n={}){const{getName:i=tT,getTitle:r=nT,getDescription:o=iT,getKeywords:s=rT,getCategory:a=oT,getCollection:l=sT}=n,c=i(e),u=r(e),d=o(e),h=s(e),p=a(e),f=l(e),m=hT(t),g=hT(u);let b=0;if(m===g)b+=30;else if(g.startsWith(m))b+=20;else{const e=[c,u,d,...h,p,f].join(" ");0===(y=dT(m),v=e,y.filter(e=>!pT(v).some(t=>t.includes(e)))).length&&(b+=10)}var y,v;return 0!==b&&c.startsWith("core/")&&(b+=c!==e.id?1:2),b}var bT=(e,t,n)=>{const i=(0,T.useMemo)(()=>({[Nf]:!!n}),[n]),[r]=(0,zt.A)(t=>[t(Qy).getInserterItems(e,i)],[e,i]),{getClosestAllowedInsertionPoint:o}=Gh((0,zt.A)(Qy)),{createErrorNotice:s}=(0,Vt.A)(Rb.store),[a,l]=(0,zt.A)(e=>{const{getCategories:t,getCollections:n}=e(Zi);return[t(),n()]},[]),c=(0,T.useCallback)(({name:n,initialAttributes:i,innerBlocks:r,syncStatus:a,content:l},c)=>{const u=o(n,e);if(null===u){const e=bn(n)?.title??n;return void s((0,ee.sprintf)((0,ee.__)('Block "%s" can\'t be inserted.'),e),{type:"snackbar",id:"inserter-notice"})}const d="unsynced"===a?Vo(l,{__unstableSkipMigrationLogs:!0}):er(n,i,tr(r));t(d,void 0,c,u)},[o,e,t,s]);return[r,a,l,c]},yT=(e,t)=>t?(e.sort(({id:e},{id:n})=>{let i=t.indexOf(e),r=t.indexOf(n);return i<0&&(i=t.length),r<0&&(r=t.length),i-r}),e):e,vT=()=>{},_T={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockId:n,prioritizedBlocks:i}=(0,zt.A)(e=>{const{getSelectedBlockClientId:t,getBlock:n,getBlockListSettings:i,getBlockRootClientId:r}=e(Qy),{getActiveBlockVariation:o}=e(Zi),s=t(),{name:a,attributes:l}=n(s),c=o(a,l),u=r(s);return{selectedBlockId:c?`${a}/${c.name}`:a,rootClientId:u,prioritizedBlocks:i(u)?.prioritizedInserterBlocks}},[]),[r,o,s]=bT(t,vT,!0),a=(0,T.useMemo)(()=>(e.trim()?fT(r,o,s,e):yT(Uf(r,"frecency","desc"),i)).filter(e=>e.id!==n).slice(0,9),[e,n,r,o,s,i]),l=(0,T.useMemo)(()=>a.map(e=>{const{title:t,icon:n,isDisabled:i}=e;return{key:`block-${e.id}`,value:e,label:(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(hj,{icon:n,showColors:!0},"icon"),t]}),isDisabled:i}}),[a]);return[l]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:i,syncStatus:r,blocks:o}=e;return{action:"replace",value:"unsynced"===r?(o??[]).map(e=>ir(e)):er(t,n,tr(i))}}},xT=[];function kT({completers:e=xT}){const{name:t}=Ih();return(0,T.useMemo)(()=>{let n=[...e];return(t===gn()||vn(t,"__experimentalSlashInserter",!1))&&(n=[...n,_T]),(0,Ei.FC)("editor.Autocomplete.completers")&&(n===e&&(n=n.map(e=>({...e}))),n=(0,Ei.W5)("editor.Autocomplete.completers",n,t)),n},[e,t])}var wT=n(45919),CT={placement:"bottom-start"},ST=()=>(0,Er.jsxs)(Er.Fragment,{children:[["bold","italic","link","unknown"].map(e=>(0,Er.jsx)(Sv.DX,{name:`RichText.ToolbarControls.${e}`},e)),(0,Er.jsx)(Sv.DX,{name:"RichText.ToolbarControls",children:e=>{if(!e.length)return null;const t=e.map(([{props:e}])=>e).some(({isActive:e})=>e);return(0,Er.jsx)(mv.A,{children:n=>(0,Er.jsx)(xv.A,{icon:wT.A,label:(0,ee.__)("More"),toggleProps:{...n,className:(0,mh.A)(n.className,{"is-pressed":t}),description:(0,ee.__)("Displays more block tools")},controls:Uf(e.map(([{props:e}])=>e),"title"),popoverProps:CT})})}})]}),AT=n(81448),IT=n(62956),ET=n(81841),jT=n(95756);function TT(e={}){var t;const n=null==(t=e.store)?void 0:t.getState();return(0,ET.z)({...e,orientation:(0,jT.Jh)(e.orientation,null==n?void 0:n.orientation,"horizontal"),focusLoop:(0,jT.Jh)(e.focusLoop,null==n?void 0:n.focusLoop,!0)})}function BT(e={}){const[t,n]=(0,IT.Pj)(TT,e);return function(e,t,n){return(0,AT.YO)(e,t,n)}(t,n,e)}var NT=n(1485),RT=n(58224),OT=n(5270),LT=n(44151),MT=(0,OT.ab)(function({store:e,orientation:t,virtualFocus:n,focusLoop:i,rtl:r,...o}){const s=(0,NT.P$)(),a=BT({store:e=e||s,orientation:t,virtualFocus:n,focusLoop:i,rtl:r}),l=(0,IT.O$)(a,e=>"both"===e.orientation?void 0:e.orientation);return o=(0,LT.w7)(o,e=>(0,Er.jsx)(NT._N,{value:a,children:e}),[a]),o={role:"toolbar","aria-orientation":l,...o},(0,RT.T)({store:a,...o})}),PT=(0,OT.Rf)(function(e){const t=MT(e);return(0,OT.n)("div",t)}),DT=(0,T.forwardRef)(function({label:e,...t},n){const i=BT({focusLoop:!0,rtl:(0,ee.isRTL)()});return(0,Er.jsx)(gv.A.Provider,{value:i,children:(0,Er.jsx)(PT,{ref:n,"aria-label":e,store:i,...t})})});DT.displayName="ToolbarContainer";var FT=DT,zT=n(93279),VT=(0,T.forwardRef)(function({className:e,label:t,variant:n,...i},r){const o=void 0!==n,s=(0,T.useMemo)(()=>o?{}:{DropdownMenu:{variant:"toolbar"},Dropdown:{variant:"toolbar"},Menu:{variant:"toolbar"}},[o]);if(!t){(0,Qt.A)("Using Toolbar without label prop",{since:"5.6",alternative:"ToolbarGroup component",link:"https://developer.wordpress.org/block-editor/components/toolbar/"});const{title:t,...n}=i;return(0,Er.jsx)(wv,{isCollapsed:!1,...n,className:e})}const a=(0,mh.A)("components-accessible-toolbar",e,n&&`is-${n}`);return(0,Er.jsx)(zT.c7,{value:s,children:(0,Er.jsx)(FT,{className:a,label:t,ref:r,...i})})});VT.displayName="Toolbar";var UT=VT,$T=n(50793);function HT(e){return Array.from(e.querySelectorAll("[data-toolbar-item]:not([disabled])"))}function WT(e){return e.contains(e.ownerDocument.activeElement)}function GT({children:e,focusOnMount:t,focusEditorOnEscape:n=!1,shouldUseKeyboardFocusShortcut:i=!0,__experimentalInitialIndex:r,__experimentalOnIndexChange:o,orientation:s="horizontal",...a}){const l=(0,T.useRef)(),c=function(e){const[t,n]=(0,T.useState)(!0),i=(0,T.useCallback)(()=>{const t=!hS.XC.tabbable.find(e.current).some(e=>!("toolbarItem"in e.dataset));t||(0,Qt.A)("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)},[e]);return(0,T.useLayoutEffect)(()=>{const t=new window.MutationObserver(i);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()},[i,t,e]),t}(l);return function({toolbarRef:e,focusOnMount:t,isAccessibleToolbar:n,defaultIndex:i,onIndexChange:r,shouldUseKeyboardFocusShortcut:o,focusEditorOnEscape:s}){const[a]=(0,T.useState)(t),[l]=(0,T.useState)(i),c=(0,T.useCallback)(()=>{!function(e){const[t]=hS.XC.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)},[e]);(0,$T.wk)("core/block-editor/focus-toolbar",()=>{o&&c()}),(0,T.useEffect)(()=>{a&&c()},[n,a,c]),(0,T.useEffect)(()=>{const t=e.current;let n=0;return a||WT(t)||(n=window.requestAnimationFrame(()=>{const e=HT(t),n=l||0;e[n]&&WT(t)&&e[n].focus({preventScroll:!0})})),()=>{if(window.cancelAnimationFrame(n),!r||!t)return;const e=HT(t).findIndex(e=>0===e.tabIndex);r(e)}},[l,a,r,e]);const{getLastFocus:u}=Gh((0,zt.A)(Qy));(0,T.useEffect)(()=>{const t=e.current;if(s){const e=e=>{const t=u();e.keyCode===Rt._f&&t?.current&&(e.preventDefault(),t.current.focus())};return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}},[s,u,e])}({toolbarRef:l,focusOnMount:t,defaultIndex:r,onIndexChange:o,isAccessibleToolbar:c,shouldUseKeyboardFocusShortcut:i,focusEditorOnEscape:n}),c?(0,Er.jsx)(UT,{label:a["aria-label"],ref:l,orientation:s,...a,children:e}):(0,Er.jsx)(pS.Ay,{orientation:s,role:"toolbar",ref:l,...a,children:e})}function qT({popoverAnchor:e}){return(0,Er.jsx)(uw.Ay,{placement:"top",focusOnMount:!1,anchor:e,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar",children:(0,Er.jsx)(GT,{className:"block-editor-rich-text__inline-format-toolbar-group","aria-label":(0,ee.__)("Format tools"),children:(0,Er.jsx)(wv,{children:(0,Er.jsx)(ST,{})})})})}var KT=({inline:e,editableContentElement:t})=>e?(0,Er.jsx)(qT,{popoverAnchor:t}):(0,Er.jsx)(Mv,{group:"inline",children:(0,Er.jsx)(ST,{})});function YT(e,t){if(sB.isEmpty(e)){const e=Rj(t);return e?`<${e}>`:""}return Array.isArray(e)?((0,Qt.A)("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),Ao.toHTML(e)):"string"==typeof e?e:e.toHTMLString()}function JT({value:e,tagName:t,multiline:n,format:i,...r}){return e=(0,Er.jsx)(Sr.A,{children:YT(e,n)}),t?(0,Er.jsx)(t,{...r,children:e}):e}var XT=(0,T.forwardRef)(function({children:e,identifier:t,tagName:n="div",value:i="",onChange:r,multiline:o,...s},a){(0,Qt.A)("wp.blockEditor.RichText multiline prop",{since:"6.1",version:"6.3",alternative:"nested blocks (InnerBlocks)",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/nested-blocks-inner-blocks/"});const{clientId:l}=Ih(),{getSelectionStart:c,getSelectionEnd:u}=(0,zt.A)(Qy),{selectionChange:d}=(0,Vt.A)(Qy),h=Rj(o),p=`${i=i||`<${h}>`}<${h}>`.split(`<${h}>`);function f(e){r(`<${h}>${e.join(`<${h}>`)}`)}return p.shift(),p.pop(),(0,Er.jsx)(n,{ref:a,children:p.map((e,n)=>(0,Er.jsx)(iB,{identifier:`${t}-${n}`,tagName:h,value:e,onChange:e=>{const t=p.slice();t[n]=e,f(t)},isSelected:void 0,onKeyDown:i=>{if(i.keyCode!==Rt.Fm)return;i.preventDefault();const{offset:r}=c(),{offset:o}=u();if("number"!=typeof r||"number"!=typeof o)return;const s=We({html:e});s.start=r,s.end=o;const a=ut(s).map(e=>Be({value:e})),h=p.slice();h.splice(n,1,...a),f(h),d(l,`${t}-${n+1}`,0,0)},onMerge:e=>{const i=p.slice();let r=0;if(e){if(!i[n+1])return;i.splice(n,2,i[n]+i[n+1]),r=i[n].length-1}else{if(!i[n-1])return;i.splice(n-1,2,i[n-1]+i[n]),r=i[n-1].length-1}f(i),d(l,`${t}-${n-(e?0:1)}`,r,r)},...s},n))})}),{useRichText:ZT}=Gh(Gt),QT=(0,T.createContext)();QT.displayName="keyboardShortcutContext";var eB=(0,T.createContext)();eB.displayName="inputEventContext";var tB=Symbol("instanceId");function nB(e){const{__unstableMobileNoFocusOnMount:t,deleteEnter:n,placeholderTextColor:i,textAlign:r,selectionColor:o,tagsToEliminate:s,disableEditingMenu:a,fontSize:l,fontFamily:c,fontWeight:u,fontStyle:d,minWidth:h,maxWidth:p,disableSuggestions:f,disableAutocorrection:m,...g}=e;return g}function iB({children:e,tagName:t="div",value:n="",onChange:i,isSelected:r,multiline:o,inlineToolbar:s,wrapperClassName:a,autocompleters:l,onReplace:c,placeholder:u,allowedFormats:d,withoutInteractiveFormatting:h,onRemove:p,onMerge:f,onSplit:m,__unstableOnSplitAtEnd:g,__unstableOnSplitAtDoubleLineEnd:b,identifier:y,preserveWhiteSpace:v,__unstablePastePlainText:_,__unstableEmbedURLOnPaste:x,__unstableDisableFormats:k,disableLineBreaks:w,__unstableAllowPrefixTransformations:C,readOnly:S,...A},I){A=nB(A),m&&(0,Qt.A)("wp.blockEditor.RichText onSplit prop",{since:"6.4",alternative:'block.json support key: "splitting"'});const E=(0,SS.A)(iB),j=(0,T.useRef)(),[B,N]=(0,T.useState)(null),R=Ih(),{clientId:O,isSelected:L,name:M}=R,P=R[xh],D=(0,T.useContext)(Sj),z=(0,yt.A)(),{selectionStart:V,selectionEnd:U,isSelected:$}=(0,zt.A)(e=>{if(!L)return{isSelected:!1};const{getSelectionStart:t,getSelectionEnd:n}=e(Qy),i=t(),o=n();let s;return void 0===r?s=i.clientId===O&&o.clientId===O&&(y?i.attributeKey===y:i[tB]===E):r&&(s=i.clientId===O),{selectionStart:s?i.offset:void 0,selectionEnd:s?o.offset:void 0,isSelected:s}},[O,y,E,r,L]),{disableBoundBlock:H,bindingsPlaceholder:W,bindingsLabel:G}=(0,zt.A)(e=>{if(!P?.[y])return{};const{__experimentalBlockBindingsSupportedAttributes:t}=e(Qy).getSettings(),i=t?.[M];if(!i)return{};const r=P[y],o=Cn(r.source),s={};if(o?.usesContext?.length)for(const e of o.usesContext)s[e]=D[e];const a=!o?.canUserEditValue?.({select:e,context:s,args:r.args});if(n.length>0)return{disableBoundBlock:a,bindingsPlaceholder:null,bindingsLabel:null};const{getBlockAttributes:l}=e(Qy),c=l(O);let u=null;if(o?.getFieldsList){const t=o.getFieldsList({select:e,context:s});u=t?.find(e=>F(e.args,r?.args))?.label}const d=u??o?.label,h=a?d:(0,ee.sprintf)((0,ee.__)("Add %s"),d),p=a?r?.args?.key||o?.label:(0,ee.sprintf)((0,ee.__)("Empty %s; start writing to edit its value"),r?.args?.key||o?.label);return{disableBoundBlock:a,bindingsPlaceholder:c?.placeholder||h,bindingsLabel:p}},[P,y,M,n,O,D]),q=S||H||!!D?.["pattern/overrides"]&&!("core/pattern-overrides"===P?.__default?.source),{getSelectionStart:K,getSelectionEnd:Y,getBlockRootClientId:J}=(0,zt.A)(Qy),{selectionChange:X}=(0,Vt.A)(Qy),Z=Oj({allowedFormats:d,disableFormats:k}),Q=!Z||Z.length>0,te=(0,T.useCallback)((e,t)=>{const n={},i=void 0===e&&void 0===t,r={clientId:O,[y?"attributeKey":tB]:y||E};if("number"==typeof e||i){if(void 0===t&&J(O)!==J(Y().clientId))return;n.start={...r,offset:e}}if("number"==typeof t||i){if(void 0===e&&J(O)!==J(K().clientId))return;n.end={...r,offset:t}}X(n)},[O,J,Y,K,y,E,X]),{value:ne,getValue:ie,onChange:re,ref:oe,formatTypes:se}=ZT({value:n,onChange:i,selectionStart:V,selectionEnd:U,onSelectionChange:te,placeholder:W||u,__unstableIsSelected:$,__unstableDisableFormats:k,preserveWhiteSpace:v,__unstableDependencies:[t],allowedFormats:Z,withoutInteractiveFormatting:h,__unstableFormatTypeHandlerContext:(0,T.useMemo)(()=>({richTextIdentifier:y,blockClientId:O}),[y,O])}),ae=function(e){return eT({...e,completers:kT(e)})}({onReplace:c,completers:l,record:ne,onChange:re});!function({html:e,value:t}){const n=(0,T.useRef)(),i=!!t.activeFormats?.length,{__unstableMarkLastChangeAsPersistent:r}=(0,Vt.A)(Qy);(0,T.useLayoutEffect)(()=>{if(n.current){if(n.current!==t.text){const e=window.setTimeout(()=>{r()},1e3);return n.current=t.text,()=>{window.clearTimeout(e)}}r()}else n.current=t.text},[e,i])}({html:n,value:ne});const le=(0,T.useRef)(new Set),ce=(0,T.useRef)(new Set);function ue(){j.current?.focus()}const de=t;return(0,Er.jsxs)(Er.Fragment,{children:[$&&(0,Er.jsx)(QT.Provider,{value:le,children:(0,Er.jsx)(eB.Provider,{value:ce,children:(0,Er.jsxs)(uw.Ay.__unstableSlotNameProvider,{value:"__unstable-block-tools-after",children:[e&&e({value:ne,onChange:re,onFocus:ue}),(0,Er.jsx)($j,{value:ne,onChange:re,onFocus:ue,formatTypes:se,forwardedRef:j})]})})}),$&&Q&&(0,Er.jsx)(KT,{inline:s,editableContentElement:B}),(0,Er.jsx)(de,{role:"textbox","aria-multiline":!w,"aria-readonly":q,...A,draggable:void 0,"aria-label":G||A["aria-label"]||u,...ae,ref:(0,gt.A)([oe,I,ae.ref,A.ref,Fj({registry:z,getValue:ie,onChange:re,__unstableAllowPrefixTransformations:C,formatTypes:se,onReplace:c,selectionChange:X,isSelected:$,disableFormats:k,value:ne,tagName:t,onSplit:m,__unstableEmbedURLOnPaste:x,pastePlainText:_,onMerge:f,onRemove:p,disableLineBreaks:w,onSplitAtEnd:g,onSplitAtDoubleLineEnd:b,keyboardShortcuts:le,inputEvents:ce}),j,N]),contentEditable:!q,suppressContentEditableWarning:!0,className:(0,mh.A)("block-editor-rich-text__editable",A.className,"rich-text"),tabIndex:0!==A.tabIndex||q?A.tabIndex:null,"data-wp-block-attribute-key":y})]})}var rB=function(e){return(0,T.forwardRef)((t,n)=>{let i=t.value,r=t.onChange;Array.isArray(i)&&((0,Qt.A)("wp.blockEditor.RichText value prop as children type",{since:"6.1",version:"6.3",alternative:"value prop as string",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),i=Ao.toHTML(t.value),r=e=>t.onChange(Ao.fromDOM(ke(document,e).childNodes)));const o=t.multiline?XT:e;return(0,Er.jsx)(o,{...t,value:i,onChange:r,ref:n})})}((0,T.forwardRef)(iB));rB.Content=JT,rB.isEmpty=e=>!e||0===e.length;var oB=(0,T.forwardRef)((e,t)=>{if(Ih()[kh]){const{children:n,tagName:i="div",value:r,onChange:o,isSelected:s,multiline:a,inlineToolbar:l,wrapperClassName:c,autocompleters:u,onReplace:d,placeholder:h,allowedFormats:p,withoutInteractiveFormatting:f,onRemove:m,onMerge:g,onSplit:b,__unstableOnSplitAtEnd:y,__unstableOnSplitAtDoubleLineEnd:v,identifier:_,preserveWhiteSpace:x,__unstablePastePlainText:k,__unstableEmbedURLOnPaste:w,__unstableDisableFormats:C,disableLineBreaks:S,__unstableAllowPrefixTransformations:A,readOnly:I,...E}=nB(e);return(0,Er.jsx)(i,{ref:t,...E,dangerouslySetInnerHTML:{__html:YT(r,a)||"
"}})}return(0,Er.jsx)(rB,{ref:t,...e,readOnly:!1})});oB.Content=JT,oB.isEmpty=e=>!e||0===e.length;var sB=oB,{useRichText:aB}=Gh(Gt);function lB({data:e,field:t,hideLabelFromVision:n,onChange:i,config:r={}}){const o=(0,yt.A)(),s=t.getValue({item:e}),a=t.config||{},{clientId:l}=r,[c,u]=(0,T.useState)({start:void 0,end:void 0}),[d,h]=(0,T.useState)(!1),p=(0,T.useRef)(),f=(0,T.useRef)(new Set),m=(0,T.useRef)(new Set),g=Oj({allowedFormats:a?.allowedFormats,disableFormats:a?.disableFormats}),{value:b,getValue:y,onChange:v,ref:_,formatTypes:x}=aB({value:s,onChange(n){i(t.setValue({item:e,value:n}))},selectionStart:c.start,selectionEnd:c.end,onSelectionChange:(e,t)=>u({start:e,end:t}),__unstableIsSelected:d,preserveWhiteSpace:!!a?.preserveWhiteSpace,placeholder:a?.placeholder,__unstableDisableFormats:a?.disableFormats,allowedFormats:g,withoutInteractiveFormatting:a?.withoutInteractiveFormatting,__unstableFormatTypeHandlerContext:(0,T.useMemo)(()=>({richTextIdentifier:t.id,blockClientId:l}),[t.id,l])}),{baseControlProps:k,controlProps:w}=(0,Nj.Y)({hideLabelFromVision:n??t.hideLabelFromVision,label:t.label});return(0,Er.jsxs)(Er.Fragment,{children:[d&&(0,Er.jsx)(QT.Provider,{value:m,children:(0,Er.jsx)(eB.Provider,{value:f,children:(0,Er.jsx)("div",{children:(0,Er.jsx)($j,{value:b,onChange:v,onFocus:function(){p.current?.focus()},formatTypes:x,forwardedRef:p,isVisible:!1})})})}),(0,Er.jsx)(mk.Ay,{...k,children:(0,Er.jsx)("div",{className:"block-editor-content-only-controls__rich-text",role:"textbox","aria-multiline":!a?.disableLineBreaks,ref:(0,gt.A)([_,Fj({registry:o,getValue:y,onChange:v,formatTypes:x,selectionChange:u,isSelected:d,disableFormats:a?.disableFormats,value:b,tagName:"div",disableLineBreaks:a?.disableLineBreaks,keyboardShortcuts:m,inputEvents:f}),p]),onFocus:()=>h(!0),onBlur:()=>h(!1),contentEditable:!0,...w})})]})}var cB=n(74960),uB=n(83386),dB=n(23701);function hB({data:e,field:t,attachment:n,config:i}){const{allowedTypes:r=[],multiple:o=!1}=i||{};if(o)return"todo multiple";if("image"===n?.media_type||n?.poster)return(0,Er.jsx)("div",{className:"block-editor-content-only-controls__media-thumbnail",children:(0,Er.jsx)("img",{alt:"",width:20,height:20,src:"image"===n.media_type?n.source_url:n.poster})});if(1===r.length){const n=t.getValue({item:e}),i=n?.url;if("image"===r[0]&&i)return(0,Er.jsx)("div",{className:"block-editor-content-only-controls__media-thumbnail",children:(0,Er.jsx)("img",{alt:"",width:20,height:20,src:i})});let o;if(o="image"===r[0]?cB.A:"video"===r[0]?uB.A:"audio"===r[0]?dB.A:yS.A,o)return(0,Er.jsx)(IC.A,{icon:o,size:20})}return(0,Er.jsx)(IC.A,{icon:yS.A,size:20})}function pB({data:e,field:t,onChange:n,config:i={}}){const{popoverProps:r}=jj({isControl:!0}),o=t.getValue({item:e}),{allowedTypes:s=[],multiple:a=!1,useFeaturedImage:l=!1}=i,c=o?.id,u=o?.url,d=(0,zt.A)(e=>{if(!c)return;const t=e(Qy).getSettings()[Fh];return t?t(e,c):void 0},[c]);let h;if(1===s.length){const e=s[0];h="image"===e?(0,ee.__)("Image"):"video"===e?(0,ee.__)("Video"):"application"===e?(0,ee.__)("File"):(0,ee.__)("Media")}else h=(0,ee.__)("Media");const p=(0,T.useRef)();return(0,Er.jsx)(xS,{children:(0,Er.jsxs)("div",{ref:p,className:"block-editor-content-only-controls",children:[(0,Er.jsx)(oI,{className:"block-editor-content-only-controls__media-replace-flow",allowedTypes:s,mediaId:c,mediaURL:u,multiple:a,popoverProps:r,onReset:()=>{n(t.setValue({item:e,value:{}}))},...l&&{useFeaturedImage:!!o?.featuredImage,onToggleFeaturedImage:()=>{n(t.setValue({item:e,value:{featuredImage:!o?.featuredImage}}))}},onSelect:i=>{if(i.id&&i.url){const r={...i,mediaType:i.media_type};l&&(r.featuredImage=!1),n(t.setValue({item:e,value:r}))}},renderToggle:n=>(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,className:"block-editor-content-only-controls__media",...n,children:(0,Er.jsxs)(Jw,{rowGap:0,columnGap:8,templateColumns:"20px 1fr",className:"block-editor-content-only-controls__media-row",children:[u&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(hB,{attachment:d,field:t,data:e,config:i}),(0,Er.jsx)("span",{className:"block-editor-content-only-controls__media-title",children:d?.title?.raw&&""!==d?.title?.raw?d?.title?.raw:u})]}),!u&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)("span",{className:"block-editor-content-only-controls__media-placeholder",style:{width:"20px",height:"20px"}}),(0,Er.jsx)("span",{className:"block-editor-content-only-controls__media-title",children:h})]})]})})}),u&&(0,Er.jsx)(fv.Ay,{label:(0,ee.__)("Reset"),className:"block-editor-content-only-controls__media-reset",size:"small",icon:uS.A,onClick:()=>{n(t.setValue({item:e,value:{}})),(e=>{window.requestAnimationFrame(()=>{const[t]=hS.XC.tabbable.find(e?.current);t&&t.focus()})})(p)}})]})})}var fB=n(25557),mB=n(83938),gB="noreferrer noopener",bB="_blank",yB="nofollow";function vB({data:e,field:t,onChange:n}){const[i,r]=(0,T.useState)(!1),{popoverProps:o}=jj({isControl:!0}),s=t.getValue({item:e}),a=s?.url,l=s?.rel||"",c=s?.linkTarget,u=c===bB,d=l===yB,h=(0,T.useMemo)(()=>({url:a,opensInNewTab:u,nofollow:d}),[a,u,d]);return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,className:"block-editor-content-only-controls__link",onClick:()=>{r(!0)},children:(0,Er.jsxs)(Jw,{rowGap:0,columnGap:8,templateColumns:"24px 1fr",className:"block-editor-content-only-controls__link-row",children:[a&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(IC.A,{icon:fB.A,size:24}),(0,Er.jsx)("span",{className:"block-editor-content-only-controls__link-title",children:a})]}),!a&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(IC.A,{icon:fB.A,size:24,style:{opacity:.3}}),(0,Er.jsx)("span",{className:"block-editor-content-only-controls__link-title",children:(0,ee.__)("Link")})]})]})}),i&&(0,Er.jsx)(uw.Ay,{onClose:()=>{r(!1)},...o??{},children:(0,Er.jsx)(tI,{value:h,onChange:i=>{const r=function({rel:e="",url:t="",opensInNewTab:n,nofollow:i}){let r,o=e;if(n)r=bB,o=o?.includes(gB)?o:o+` ${gB}`;else{const e=new RegExp(`\\b${gB}\\s*`,"g");o=o?.replace(e,"").trim()}if(i)o=o?.includes(yB)?o:(o+` ${yB}`).trim();else{const e=new RegExp(`\\b${yB}\\s*`,"g");o=o?.replace(e,"").trim()}return{url:(0,mB.N)(t),linkTarget:r,rel:o||void 0}}({rel:l,...i});n(t.setValue({item:e,value:r}))},onRemove:()=>{n(t.setValue({item:e,value:{}}))}})})]})}var{fieldsKey:_B,formKey:xB}=Gh(ia);function kB(e,t={}){return function(n){return(0,Er.jsx)(e,{...n,config:t})}}function wB({clientId:e,blockType:t,setAttributes:n,isMultiBlock:i=!1}){const r=Aj({clientId:e,context:"list-view"}),o=Ej(e),s=t?.[_B],a=(0,T.useContext)(Sj),l=(0,zt.A)(t=>{const n=t(Qy).getBlockAttributes(e);if(!n?.metadata?.bindings)return n;const{getBlockBindingsSource:i}=Gh(t(Zi));return Object.entries(n.metadata.bindings).reduce((e,[n,r])=>{const o=i(r.source);if(!o)return e;const s=o.getValues({select:t,context:a,bindings:{[n]:r}});return{...e,...s}},n)},[a,e]),{selectBlock:c,toggleBlockHighlight:u}=(0,Vt.A)(Qy),d=(0,uj.A)(u,50),h=(0,T.useMemo)(()=>i?{...t?.[xB],fields:[t?.[xB]?.fields?.[0]]}:t?.[xB],[t,i]),[p,f]=(0,T.useState)(h),m=(0,T.useMemo)(()=>s?.length?s.map(t=>{const n={...t};return"string"==typeof t.Edit&&"rich-text"===t.Edit?n.Edit=kB(lB,{clientId:e}):"string"==typeof t.Edit&&"link"===t.Edit?n.Edit=kB(vB):"object"==typeof t.Edit&&"media"===t.Edit.control&&(n.Edit=kB(pB,{...t.Edit})),n}):[],[s,e]);return s?.length?(0,Er.jsxs)("div",{className:"block-editor-block-fields__container",onMouseEnter:i?()=>d(e,!0):void 0,onMouseLeave:()=>i?d(e,!1):void 0,onFocus:i?()=>{c(e,null)}:void 0,children:[(0,Er.jsx)("div",{className:"block-editor-block-fields__header",children:(0,Er.jsxs)(Cw.A,{spacing:1,children:[i&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(hj,{className:"block-editor-block-fields__header-icon",icon:o?.icon}),(0,Er.jsx)("h2",{className:"block-editor-block-fields__header-title",children:(0,Er.jsx)(xC.A,{numberOfLines:1,children:r})}),(0,Er.jsx)(Tj,{fields:m,visibleFields:p.fields,onToggleField:e=>{f(t=>t.fields?.includes(e)?{...t,fields:t.fields.filter(t=>t!==e)}:{...t,fields:[...t.fields||[],e]})}})]}),!i&&(0,Er.jsx)("h2",{className:"block-editor-block-fields__header-title",children:(0,ee.__)("Content")})]})}),(0,Er.jsx)(kj.A,{data:l,fields:m,form:p,onChange:n})]}):null}var CB={edit:function(e){const{blockType:t,isSelectionWithinCurrentSection:n}=(0,T.useContext)(Bj);return(0,Er.jsx)(yw,{group:"content",children:(0,Er.jsx)(wB,{...e,blockType:t,isMultiBlock:n})})},hasSupport:function(e){return!(!window?.__experimentalContentOnlyInspectorFields||!bn(e)?.[_B])},attributeKeys:[],supportsPatternEditing:!0},SB={edit:function({className:e,setAttributes:t}){return"default"!==Vk()?null:(0,Er.jsx)(oC,{group:"advanced",children:(0,Er.jsx)(kS.A,{__next40pxDefaultSize:!0,autoComplete:"off",label:(0,ee.__)("Additional CSS class(es)"),value:e||"",onChange:e=>{t({className:""!==e?e:void 0})},help:(0,ee.__)("Separate multiple classes with spaces.")})})},addSaveProps:function(e,t,n){return _n(t,"customClassName",!0)&&n.className&&(e.className=(0,mh.A)(e.className,n.className)),e},attributeKeys:["className"],hasSupport:e=>_n(e,"customClassName",!0)};(0,Ei.U2)("blocks.registerBlockType","core/editor/custom-class-name/attribute",function(e){return _n(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e}),(0,Ei.U2)("blocks.switchToBlockType.transformedBlock","core/customClassName/addTransforms",function(e,t,n,i){if(!_n(e.name,"customClassName",!0))return e;if(1===i.length&&e.innerBlocks.length===t.length)return e;if(1===i.length&&t.length>1||i.length>1&&1===t.length)return e;if(t[n]){const i=t[n]?.attributes.className;if(i&&void 0===e.attributes.className)return{...e,attributes:{...e.attributes,className:i}}}return e}),(0,Ei.U2)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",function(e,t){return _n(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([jr(t.name),...e.className.split(" ")])].join(" ").trim():e.className=jr(t.name)),e});var AB=/^([\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)?$/,IB=["top","right","bottom","left"],EB=["color","style","width"],jB=e=>!e||!EB.some(t=>void 0!==e[t]),TB=(e={})=>Object.keys(e).some(e=>-1!==IB.indexOf(e)),BB=e=>{if(!TB(e))return!1;const t=IB.map(t=>NB(e?.[t]));return!t.every(e=>e===t[0])},NB=(e,t)=>{if(jB(e))return t;const{color:n,style:i,width:r}=t||{},{color:o=n,style:s=i,width:a=r}=e;return[a,a&&"0"!==a||o?s||"solid":s,o].filter(Boolean).join(" ")},RB=e=>{const t=e.map(e=>void 0===e?void 0:function(e){const t=e.trim().match(AB);if(!t)return[void 0,void 0];const[,n,i]=t;let r=parseFloat(n);return r=Number.isNaN(r)?void 0:r,[r,i]}(`${e}`)[1]),n=t.filter(e=>void 0!==e);return function(e){if(0===e.length)return;const t={};let n,i=0;return e.forEach(e=>{t[e]=void 0===t[e]?1:t[e]+1,t[e]>i&&(n=e,i=t[e])}),n}(n)};(0,te.X$)([ne.A,ie.A]);var{kebabCase:OB}=Gh(Ev.j),LB=(e,t,n)=>{if(t){const n=e?.find(e=>e.slug===t);if(n)return n}return{color:n}};function MB(e,t){if(e&&t)return`has-${OB(t)}-${e}`}function PB(){const[e,t,n,i,r,o,s,a,l,c]=tv("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:!o};return u.colors=(0,T.useMemo)(()=>{const e=[];return n&&n.length&&e.push({name:(0,ee._x)("Theme","Indicates this palette comes from the theme."),slug:"theme",colors:n}),r&&i&&i.length&&e.push({name:(0,ee._x)("Default","Indicates this palette comes from WordPress."),slug:"default",colors:i}),t&&t.length&&e.push({name:(0,ee._x)("Custom","Indicates this palette is created by the user."),slug:"custom",colors:t}),e},[t,n,i,r]),u.gradients=(0,T.useMemo)(()=>{const e=[];return a&&a.length&&e.push({name:(0,ee._x)("Theme","Indicates this palette comes from the theme."),slug:"theme",gradients:a}),c&&l&&l.length&&e.push({name:(0,ee._x)("Default","Indicates this palette comes from WordPress."),slug:"default",gradients:l}),s&&s.length&&e.push({name:(0,ee._x)("Custom","Indicates this palette is created by the user."),slug:"custom",gradients:s}),e},[s,a,l,c]),u.hasColorsOrGradients=!!u.colors.length||!!u.gradients.length,u}var DB=(0,tx.AH)("",""),FB={name:"bjn8wh",styles:"position:relative"},zB=e=>{const{color:t=nx.l.gray[200],style:n="solid",width:i=rx.A.borderWidth}=e||{};return`${t} ${i&&"0"!==i||t?n||"solid":n} ${i!==rx.A.borderWidth?`clamp(1px, ${i}, 10px)`:i}`},VB={name:"1nwbfnf",styles:"grid-column:span 2;margin:0 auto"};var UB=(0,Dw.KZ)((e,t)=>{const{className:n,isLinked:i,...r}=function(e){const{className:t,size:n="default",...i}=(0,Mw.A)(e,"BorderBoxControlLinkedButton"),r=(0,Pw.l)();return{...i,className:(0,T.useMemo)(()=>r((e=>(0,tx.AH)("position:absolute;top:","__unstable-large"===e?"8px":"3px",";",(0,ix.h)({right:0})()," line-height:0;",""))(n),t),[t,r,n])}}(e),o=i?(0,ee.__)("Unlink sides"):(0,ee.__)("Link sides");return(0,Er.jsx)(fv.Ay,{...r,size:"small",icon:i?fB.A:IS.A,iconSize:24,label:o,ref:t,className:n})},"BorderBoxControlLinkedButton");var $B=(0,Dw.KZ)((e,t)=>{const{value:n,...i}=function(e){const{className:t,value:n,size:i="default",...r}=(0,Mw.A)(e,"BorderBoxControlVisualizer"),o=(0,Pw.l)();return{...r,className:(0,T.useMemo)(()=>o(((e,t)=>(0,tx.AH)("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:",zB(e?.top),";border-bottom:",zB(e?.bottom),";",(0,ix.h)({borderLeft:zB(e?.left)})()," ",(0,ix.h)({borderRight:zB(e?.right)})(),";",""))(n,i),t),[o,t,n,i]),value:n}}(e);return(0,Er.jsx)(qw.A,{...i,ref:t})},"BorderBoxControlVisualizer"),HB=n(20541),WB=n(40251),GB=n(90504),qB=[{label:(0,ee.__)("Solid"),icon:HB.A,value:"solid"},{label:(0,ee.__)("Dashed"),icon:WB.A,value:"dashed"},{label:(0,ee.__)("Dotted"),icon:GB.A,value:"dotted"}],KB=(0,Dw.KZ)(function({onChange:e,...t},n){return(0,Er.jsx)(Jv.A,{__next40pxDefaultSize:!0,ref:n,isDeselectable:!0,onChange:t=>{e?.(t)},...t,children:qB.map(e=>(0,Er.jsx)(Xv.A,{value:e.value,icon:e.icon,label:e.label},e.value))})},"BorderControlStylePicker"),YB=KB,JB=(0,tx.AH)("box-shadow:inset ",rx.A.controlBoxShadowFocus,";",""),XB=(0,tx.AH)("border:0;padding:0;margin:0;",FC.r,";",""),ZB=(0,tx.AH)(lx,"{flex:0 0 auto;}",""),QB=(0,tx.AH)("background:#fff;&&>button{aspect-ratio:1;padding:0;display:flex;align-items:center;justify-content:center;",(0,ix.h)({borderRadius:"2px 0 0 2px"},{borderRadius:"0 2px 2px 0"})()," border:",rx.A.borderWidth," solid ",nx.l.ui.border,";&:focus,&:hover:not( :disabled ){",JB," border-color:",nx.l.ui.borderFocus,";z-index:1;position:relative;}}",""),eN=(0,tx.AH)("width:",228,"px;>div:first-of-type>",Aw.Gw,"{margin-bottom:0;}&& ",Aw.Gw,"+button:not( .has-text ){min-width:24px;padding:0;}",""),tN=(0,tx.AH)("",""),nN=(0,tx.AH)("",""),iN={name:"1ghe26v",styles:"display:flex;justify-content:flex-end;margin-top:12px"},rN=e=>e.replace(/^var\((.+)\)$/,"$1"),oN=(0,Dw.KZ)((e,t)=>{const{__experimentalIsRenderedInSidebar:n,border:i,colors:r,disableCustomColors:o,enableAlpha:s,enableStyle:a,indicatorClassName:l,indicatorWrapperClassName:c,isStyleSettable:u,onReset:d,onColorChange:h,onStyleChange:p,popoverContentClassName:f,popoverControlsClassName:m,resetButtonWrapperClassName:g,size:b,__unstablePopoverProps:y,...v}=function(e){const{border:t,className:n,colors:i=[],enableAlpha:r=!1,enableStyle:o=!0,onChange:s,previousStyleSelection:a,size:l="default",__experimentalIsRenderedInSidebar:c=!1,...u}=(0,Mw.A)(e,"BorderControlDropdown"),[d]=X_(t?.width),h=0===d,p=(0,Pw.l)(),f=(0,T.useMemo)(()=>p(QB,n),[n,p]),m=(0,T.useMemo)(()=>p(nN),[p]),g=(0,T.useMemo)(()=>p(((e,t)=>{const{style:n}=e||{};return(0,tx.AH)("border-radius:",rx.A.radiusFull,";border:2px solid transparent;",n?(e=>{const{color:t,style:n}=e||{},i=n&&"none"!==n?nx.l.gray[300]:void 0;return(0,tx.AH)("border-style:","none"===n?"solid":n,";border-color:",t||i,";","")})(e):void 0," width:","__unstable-large"===t?"24px":"22px",";height:","__unstable-large"===t?"24px":"22px",";padding:","__unstable-large"===t?"2px":"1px",";&>span{height:",(0,ax.x)(4),";width:",(0,ax.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,T.useMemo)(()=>p(eN),[p]),y=(0,T.useMemo)(()=>p(tN),[p]),v=(0,T.useMemo)(()=>p(iN),[p]);return{...u,border:t,className:f,colors:i,enableAlpha:r,enableStyle:o,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:y,popoverControlsClassName:b,resetButtonWrapperClassName:v,size:l,__experimentalIsRenderedInSidebar:c}}(e),{color:_,style:x}=i||{},k=((e,t)=>{if(e&&t){if(PI(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)}})(_,r),w=((e,t,n,i)=>{if(i){if(t){const e=rN(t.color);return n?(0,ee.sprintf)((0,ee.__)('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,ee.sprintf)((0,ee.__)('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=rN(e);return n?(0,ee.sprintf)((0,ee.__)('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,ee.sprintf)((0,ee.__)('Border color and style picker. The currently selected color has a value of "%s".'),t)}return(0,ee.__)("Border color and style picker.")}return t?(0,ee.sprintf)((0,ee.__)('Border color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),t.name,rN(t.color)):e?(0,ee.sprintf)((0,ee.__)('Border color picker. The currently selected color has a value of "%s".'),rN(e)):(0,ee.__)("Border color picker.")})(_,k,x,a),C=_||x&&"none"!==x,S=n?"bottom left":void 0;return(0,Er.jsx)(wC.A,{renderToggle:({onToggle:e})=>(0,Er.jsx)(fv.Ay,{onClick:e,variant:"tertiary","aria-label":w,tooltipPosition:S,label:(0,ee.__)("Border color and style picker"),showTooltip:!0,__next40pxDefaultSize:"__unstable-large"===b,children:(0,Er.jsx)("span",{className:c,children:(0,Er.jsx)(CI.A,{className:l,colorValue:_})})}),renderContent:()=>(0,Er.jsx)(Er.Fragment,{children:(0,Er.jsxs)(CC.A,{paddingSize:"medium",children:[(0,Er.jsxs)(Q_.A,{className:m,spacing:6,children:[(0,Er.jsx)(UI,{className:f,value:_,onChange:h,colors:r,disableCustomColors:o,__experimentalIsRenderedInSidebar:n,clearable:!1,enableAlpha:s}),a&&u&&(0,Er.jsx)(YB,{label:(0,ee.__)("Style"),value:x,onChange:p})]}),(0,Er.jsx)("div",{className:g,children:(0,Er.jsx)(fv.Ay,{variant:"tertiary",onClick:()=>{d()},disabled:!C,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,ee.__)("Reset")})})]})}),popoverProps:{...y},...v,ref:t})},"BorderControlDropdown"),sN=oN,aN=e=>void 0!==e?.width&&""!==e.width||void 0!==e?.color;var lN=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,Er.jsx)(kC.A,{as:"legend",children:t}):(0,Er.jsx)(Aw.Gw,{as:"legend",children:t}):null},cN=(0,Dw.KZ)((e,t)=>{const{__next40pxDefaultSize:n=!1,colors:i,disableCustomColors:r,disableUnits:o,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:y,showDropdownHeader:v,size:_,sliderClassName:x,value:k,widthUnit:w,widthValue:C,withSlider:S,__experimentalIsRenderedInSidebar:A,...I}=function(e){const{className:t,colors:n=[],isCompact:i,onChange:r,enableAlpha:o=!0,enableStyle:s=!0,shouldSanitizeBorder:a=!0,size:l="default",value:c,width:u,__experimentalIsRenderedInSidebar:d=!1,__next40pxDefaultSize:h,__shouldNotWarnDeprecated36pxSize:p,...f}=(0,Mw.A)(e,"BorderControl");(0,bx.M)({componentName:"BorderControl",__next40pxDefaultSize:h,size:l,__shouldNotWarnDeprecated36pxSize:p});const m="default"===l&&h?"__unstable-large":l,[g,b]=X_(c?.width),y=b||"px",v=0===g,[_,x]=(0,T.useState)(),[k,w]=(0,T.useState)(),C=!a||aN(c),S=(0,T.useCallback)(e=>{!a||aN(e)?r(e):r(void 0)},[r,a]),A=(0,T.useCallback)(e=>{const t=""===e?void 0:e,[n]=X_(e),i=0===n,r={...c,width:t};i&&!v&&(x(c?.color),w(c?.style),r.color=void 0,r.style="none"),!i&&v&&(void 0===r.color&&(r.color=_),"none"===r.style&&(r.style=k)),S(r)},[c,v,_,k,S]),I=(0,T.useCallback)(e=>{A(`${e}${y}`)},[A,y]),E=(0,Pw.l)(),j=(0,T.useMemo)(()=>E(XB,t),[t,E]);let B=u;i&&(B="__unstable-large"===l?"116px":"90px");const N=(0,T.useMemo)(()=>{const e=!!B&&ZB,t=(e=>(0,tx.AH)("height:","__unstable-large"===e?"40px":"30px",";",""))(m);return E((0,tx.AH)(lx,"{flex:1 1 40%;}&& ",hx,"{min-height:0;}",""),e,t)},[B,E,m]),R=(0,T.useMemo)(()=>E((0,tx.AH)("flex:1 1 60%;",(0,ix.h)({marginRight:(0,ax.x)(3)})(),";","")),[E]);return{...f,className:j,colors:n,enableAlpha:o,enableStyle:s,innerWrapperClassName:N,inputWidth:B,isStyleSettable:C,onBorderChange:S,onSliderChange:I,onWidthChange:A,previousStyleSelection:k,sliderClassName:R,value:c,widthUnit:y,widthValue:g,size:m,__experimentalIsRenderedInSidebar:d,__next40pxDefaultSize:h}}(e);return(0,Er.jsxs)(qw.A,{as:"fieldset",...I,ref:t,children:[(0,Er.jsx)(lN,{label:h,hideLabelFromVision:l}),(0,Er.jsxs)(Cw.A,{spacing:4,className:c,children:[(0,Er.jsx)(vx,{__next40pxDefaultSize:n,__shouldNotWarnDeprecated36pxSize:!0,prefix:(0,Er.jsx)($I.A,{marginRight:1,marginBottom:0,children:(0,Er.jsx)(sN,{border:k,colors:i,__unstablePopoverProps:b,disableCustomColors:r,enableAlpha:s,enableStyle:a,isStyleSettable:d,onChange:p,previousStyleSelection:y,__experimentalIsRenderedInSidebar:A,size:_})}),label:(0,ee.__)("Border width"),hideLabelFromVision:!0,min:0,onChange:m,value:k?.width||"",placeholder:g,disableUnits:o,__unstableInputWidth:u,size:_}),S&&(0,Er.jsx)(gk.A,{label:(0,ee.__)("Border width"),hideLabelFromVision:!0,className:x,initialPosition:0,max:100,min:0,onChange:f,step:["px","%"].includes(w)?1:.1,value:C||void 0,withInputField:!1,__next40pxDefaultSize:n,__shouldNotWarnDeprecated36pxSize:!0})]})]})},"BorderControl"),uN=cN;var dN=(0,Dw.KZ)((e,t)=>{const{centeredClassName:n,colors:i,disableCustomColors:r,enableAlpha:o,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:i=!1,enableStyle:r=!0,size:o="default",__experimentalIsRenderedInSidebar:s=!1,...a}=(0,Mw.A)(e,"BorderBoxControlSplitControls"),l=(0,Pw.l)(),c=(0,T.useMemo)(()=>l((e=>(0,tx.AH)("position:relative;flex:1;width:","__unstable-large"===e?void 0:"80%",";",""))(o),t),[l,t,o]);return{...a,centeredClassName:(0,T.useMemo)(()=>l(VB,t),[l,t]),className:c,colors:n,enableAlpha:i,enableStyle:r,rightAlignedClassName:(0,T.useMemo)(()=>l((0,tx.AH)((0,ix.h)({marginLeft:"auto"})(),";",""),t),[l,t]),size:o,__experimentalIsRenderedInSidebar:s}}(e),[m,g]=(0,T.useState)(null),b=(0,T.useMemo)(()=>l?{placement:l,offset:c,anchor:m,shift:!0}:void 0,[l,c,m]),y={colors:i,disableCustomColors:r,enableAlpha:o,enableStyle:s,isCompact:!0,__experimentalIsRenderedInSidebar:p,size:d,__shouldNotWarnDeprecated36pxSize:!0},v=(0,gt.A)([g,t]);return(0,Er.jsxs)(Jw,{...f,ref:v,gap:3,children:[(0,Er.jsx)($B,{value:h,size:d}),(0,Er.jsx)(uN,{className:n,hideLabelFromVision:!0,label:(0,ee.__)("Top border"),onChange:e=>a(e,"top"),__unstablePopoverProps:b,value:h?.top,...y}),(0,Er.jsx)(uN,{hideLabelFromVision:!0,label:(0,ee.__)("Left border"),onChange:e=>a(e,"left"),__unstablePopoverProps:b,value:h?.left,...y}),(0,Er.jsx)(uN,{className:u,hideLabelFromVision:!0,label:(0,ee.__)("Right border"),onChange:e=>a(e,"right"),__unstablePopoverProps:b,value:h?.right,...y}),(0,Er.jsx)(uN,{className:n,hideLabelFromVision:!0,label:(0,ee.__)("Bottom border"),onChange:e=>a(e,"bottom"),__unstablePopoverProps:b,value:h?.bottom,...y})]})},"BorderBoxControlSplitControls"),hN=dN;function pN(e){const{className:t,colors:n=[],onChange:i,enableAlpha:r=!1,enableStyle:o=!0,size:s="default",value:a,__experimentalIsRenderedInSidebar:l=!1,__next40pxDefaultSize:c,...u}=(0,Mw.A)(e,"BorderBoxControl");(0,bx.M)({componentName:"BorderBoxControl",__next40pxDefaultSize:c,size:s});const d="default"===s&&c?"__unstable-large":s,h=BB(a),p=TB(a),f=p?(e=>{if(!e)return;const t=[],n=[],i=[];IB.forEach(r=>{t.push(e[r]?.color),n.push(e[r]?.style),i.push(e[r]?.width)});const r=t.every(e=>e===t[0]),o=n.every(e=>e===n[0]),s=i.every(e=>e===i[0]);return{color:r?t[0]:void 0,style:o?n[0]:void 0,width:s?i[0]:RB(i)}})(a):a,m=p?a:(e=>{if(e&&!jB(e))return{top:e,right:e,bottom:e,left:e}})(a),g=!isNaN(parseFloat(`${f?.width}`)),[b,y]=(0,T.useState)(!h),v=(0,Pw.l)(),_=(0,T.useMemo)(()=>v(DB,t),[v,t]),x=(0,T.useMemo)(()=>v((0,tx.AH)("flex:1;",(0,ix.h)({marginRight:"24px"})(),";","")),[v]),k=(0,T.useMemo)(()=>v(FB),[v]);return{...u,className:_,colors:n,disableUnits:h&&!g,enableAlpha:r,enableStyle:o,hasMixedBorders:h,isLinked:b,linkedControlClassName:x,onLinkedChange:e=>{if(!e)return i(void 0);if(!h||(t=e)&&EB.every(e=>void 0!==t[e]))return i(jB(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),r={top:{...a?.top,...n},right:{...a?.right,...n},bottom:{...a?.bottom,...n},left:{...a?.left,...n}};if(BB(r))return i(r);const o=jB(r.top)?void 0:r.top;i(o)},onSplitChange:(e,t)=>{const n={...m,[t]:e};BB(n)?i(n):i(e)},toggleLinked:()=>y(!b),linkedValue:f,size:d,splitValue:m,wrapperClassName:k,__experimentalIsRenderedInSidebar:l}}var fN=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,Er.jsx)(kC.A,{as:"label",children:t}):(0,Er.jsx)(Aw.Gw,{children:t}):null},mN=(0,Dw.KZ)((e,t)=>{const{className:n,colors:i,disableCustomColors:r,disableUnits:o,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:y,splitValue:v,toggleLinked:_,wrapperClassName:x,__experimentalIsRenderedInSidebar:k,...w}=pN(e),[C,S]=(0,T.useState)(null),A=(0,T.useMemo)(()=>g?{placement:g,offset:b,anchor:C,shift:!0}:void 0,[g,b,C]),I=(0,gt.A)([S,t]);return(0,Er.jsxs)(qw.A,{className:n,...w,ref:I,children:[(0,Er.jsx)(fN,{label:d,hideLabelFromVision:c}),(0,Er.jsxs)(qw.A,{className:x,children:[u?(0,Er.jsx)(uN,{className:h,colors:i,disableUnits:o,disableCustomColors:r,enableAlpha:s,enableStyle:a,onChange:f,placeholder:l?(0,ee.__)("Mixed"):void 0,__unstablePopoverProps:A,shouldSanitizeBorder:!1,value:p,withSlider:!0,width:"__unstable-large"===y?"116px":"110px",__experimentalIsRenderedInSidebar:k,__shouldNotWarnDeprecated36pxSize:!0,size:y}):(0,Er.jsx)(hN,{colors:i,disableCustomColors:r,enableAlpha:s,enableStyle:a,onChange:m,popoverPlacement:g,popoverOffset:b,value:v,__experimentalIsRenderedInSidebar:k,size:y}),(0,Er.jsx)(UB,{onClick:_,isLinked:u,size:y})]})]})},"BorderBoxControl"),gN=mN;function bN({isLinked:e,...t}){const n=e?(0,ee.__)("Unlink radii"):(0,ee.__)("Link radii");return(0,Er.jsx)(fv.Ay,{...t,className:"components-border-radius-control__linked-button",size:"small",icon:e?fB.A:IS.A,iconSize:24,label:n})}var yN=n(7305),vN=n(28560),_N=n(99307),xN=n(7736),kN=n(97360);function wN({combobox:e,...t}={}){const n=(0,kN.od)(t.store,(0,kN.cJ)(e,["value","items","renderedItems","baseElement","arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"]));(0,kN.UE)(t,n);const i=n.getState(),r=(0,ET.z)({...t,store:n,virtualFocus:(0,jT.Jh)(t.virtualFocus,i.virtualFocus,!0),includesBaseElement:(0,jT.Jh)(t.includesBaseElement,i.includesBaseElement,!1),activeId:(0,jT.Jh)(t.activeId,i.activeId,t.defaultActiveId,null),orientation:(0,jT.Jh)(t.orientation,i.orientation,"vertical")}),o=(0,_N.N)({...t,store:n,placement:(0,jT.Jh)(t.placement,i.placement,"bottom-start")}),s=new String(""),a={...r.getState(),...o.getState(),value:(0,jT.Jh)(t.value,i.value,t.defaultValue,s),setValueOnMove:(0,jT.Jh)(t.setValueOnMove,i.setValueOnMove,!1),labelElement:(0,jT.Jh)(i.labelElement,null),selectElement:(0,jT.Jh)(i.selectElement,null),listElement:(0,jT.Jh)(i.listElement,null)},l=(0,kN.y$)(a,r,o,n);return(0,kN.mj)(l,()=>(0,kN.OH)(l,["value","items"],e=>{if(e.value!==s)return;if(!e.items.length)return;const t=e.items.find(e=>!e.disabled&&null!=e.value);null!=(null==t?void 0:t.value)&&l.setState("value",t.value)})),(0,kN.mj)(l,()=>(0,kN.OH)(l,["mounted"],e=>{e.mounted||l.setState("activeId",a.activeId)})),(0,kN.mj)(l,()=>(0,kN.OH)(l,["mounted","items","value"],t=>{if(e)return;if(t.mounted)return;const n=(0,xN.$r)(t.value),i=n[n.length-1];if(null==i)return;const r=t.items.find(e=>!e.disabled&&e.value===i);r&&l.setState("activeId",r.id)})),(0,kN.mj)(l,()=>(0,kN.vA)(l,["setValueOnMove","moves"],e=>{const{mounted:t,value:n,activeId:i}=l.getState();if(!e.setValueOnMove&&t)return;if(Array.isArray(n))return;if(!e.moves)return;if(!i)return;const o=r.item(i);o&&!o.disabled&&null!=o.value&&l.setState("value",o.value)})),{...r,...o,...l,combobox:e,setValue:e=>l.setState("value",e),setLabelElement:e=>l.setState("labelElement",e),setSelectElement:e=>l.setState("selectElement",e),setListElement:e=>l.setState("listElement",e)}}var CN=n(86466),SN=(0,OT.ab)(function({store:e,...t}){const n=(0,CN.oZ)();e=e||n,(0,jT.V1)(e,!1);const i=(0,LT.Bi)(t.id),r=t.onClick,o=(0,LT._q)(t=>{null==r||r(t),t.defaultPrevented||queueMicrotask(()=>{const t=null==e?void 0:e.getState().selectElement;null==t||t.focus()})});return t={...t,id:i,ref:(0,LT.SV)(e.setLabelElement,t.ref),onClick:o,style:{cursor:"default",...t.style}},(0,jT.HR)(t)}),AN=(0,OT.ph)((0,OT.Rf)(function(e){const t=SN(e);return(0,OT.n)("div",t)})),IN=n(46826),EN={top:"4,10 8,6 12,10",right:"6,4 10,8 6,12",bottom:"4,6 8,10 12,6",left:"10,4 6,8 10,12"},jN=(0,OT.ab)(function({store:e,placement:t,...n}){const i=(0,IN.C_)();e=e||i,(0,jT.V1)(e,!1);const r=(0,IT.O$)(e,e=>t||e.placement).split("-")[0],o=EN[r];return n={children:(0,T.useMemo)(()=>(0,Er.jsx)("svg",{display:"block",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,viewBox:"0 0 16 16",height:"1em",width:"1em",children:(0,Er.jsx)("polyline",{points:o})}),[o]),"aria-hidden":!0,...n,style:{width:"1em",height:"1em",pointerEvents:"none",...n.style}},(0,jT.HR)(n)}),TN=((0,OT.Rf)(function(e){const t=jN(e);return(0,OT.n)("span",t)}),(0,OT.ab)(function({store:e,...t}){const n=(0,CN.hP)();return jN({store:e=e||n,...t})})),BN=(0,OT.Rf)(function(e){const t=TN(e);return(0,OT.n)("span",t)}),NN=n(28047),RN=n(84054),ON=n(82979),LN=n(81545);function MN(e,t){return()=>{const n=t();if(!n)return;let i=0,r=e.item(n);const o=r;for(;r&&null==r.value;){const n=t(++i);if(!n)return;if(r=e.item(n),r===o)break}return null==r?void 0:r.id}}var PN=(0,OT.ab)(function({store:e,name:t,form:n,required:i,showOnKeyDown:r=!0,moveOnKeyDown:o=!0,toggleOnPress:s=!0,toggleOnClick:a=s,...l}){const c=(0,CN.oZ)();e=e||c,(0,jT.V1)(e,!1);const u=l.onKeyDown,d=(0,LT.O4)(r),h=(0,LT.O4)(o),p=(0,IT.O$)(e,"placement").split("-")[0],f=(0,IT.O$)(e,"value"),m=Array.isArray(f),g=(0,LT._q)(t=>{var n;if(null==u||u(t),t.defaultPrevented)return;if(!e)return;const{orientation:i,items:r,activeId:o}=e.getState(),s="horizontal"!==i,a="vertical"!==i,l=!!(null==(n=r.find(e=>!e.disabled&&null!=e.value))?void 0:n.rowId),c={ArrowUp:(l||s)&&MN(e,e.up),ArrowRight:(l||a)&&MN(e,e.next),ArrowDown:(l||s)&&MN(e,e.down),ArrowLeft:(l||a)&&MN(e,e.previous)}[t.key];c&&h(t)&&(t.preventDefault(),e.move(c()));const f="top"===p||"bottom"===p;({ArrowDown:f,ArrowUp:f,ArrowLeft:"left"===p,ArrowRight:"right"===p})[t.key]&&d(t)&&(t.preventDefault(),e.move(o),(0,LN.nz)(t.currentTarget,"keyup",e.show))});l=(0,LT.w7)(l,t=>(0,Er.jsx)(CN.D1,{value:e,children:t}),[e]);const[b,y]=(0,T.useState)(!1),v=(0,T.useRef)(!1);(0,T.useEffect)(()=>{const e=v.current;v.current=!1,e||y(!1)},[f]);const _=(0,IT.O$)(e,e=>{var t;return null==(t=e.labelElement)?void 0:t.id}),x=l["aria-label"],k=l["aria-labelledby"]||_,w=(0,IT.O$)(e,e=>{if(t)return e.items}),C=(0,T.useMemo)(()=>[...new Set(null==w?void 0:w.map(e=>e.value).filter(e=>null!=e))],[w]);l=(0,LT.w7)(l,r=>t?(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsxs)("select",{style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},tabIndex:-1,"aria-hidden":!0,"aria-label":x,"aria-labelledby":null!=x?void 0:k,name:t,form:n,required:i,disabled:l.disabled,value:f,multiple:m,onFocus:()=>{var t;return null==(t=null==e?void 0:e.getState().selectElement)?void 0:t.focus()},onChange:t=>{var n;v.current=!0,y(!0),null==e||e.setValue(m?(n=t.target,Array.from(n.selectedOptions).map(e=>e.value)):t.target.value)},children:[(0,xN.$r)(f).map(e=>null==e||C.includes(e)?null:(0,Er.jsx)("option",{value:e,children:e},e)),C.map(e=>(0,Er.jsx)("option",{value:e,children:e},e))]}),r]}):r,[e,x,k,t,n,i,f,m,C,l.disabled]);const S=(0,Er.jsxs)(Er.Fragment,{children:[f,(0,Er.jsx)(BN,{})]}),A=(0,IT.O$)(e,"contentElement");return l={role:"combobox","aria-autocomplete":"none","aria-labelledby":null!=l["aria-label"]?void 0:_,"aria-haspopup":(0,ON.Tc)(A,"listbox"),"data-autofill":b||void 0,"data-name":t,children:S,...l,ref:(0,LT.SV)(e.setSelectElement,l.ref),onKeyDown:g},l=(0,RN.y)({store:e,toggleOnClick:a,...l}),l=(0,NN.g)({store:e,...l})}),DN=(0,OT.Rf)(function(e){const t=PN(e);return(0,OT.n)("button",t)}),FN=n(62632),zN=(0,T.createContext)(null),VN=(0,OT.ab)(function({store:e,resetOnEscape:t=!0,hideOnEnter:n=!0,focusOnMove:i=!0,composite:r,alwaysVisible:o,...s}){const a=(0,CN.hP)();e=e||a,(0,jT.V1)(e,!1);const l=(0,LT.Bi)(s.id),c=(0,IT.O$)(e,"value"),u=Array.isArray(c),[d,h]=(0,T.useState)(c),p=(0,IT.O$)(e,"mounted");(0,T.useEffect)(()=>{p||h(c)},[p,c]),t=t&&!u;const f=s.onKeyDown,m=(0,LT.O4)(t),g=(0,LT.O4)(n),b=(0,LT._q)(t=>{null==f||f(t),t.defaultPrevented||("Escape"===t.key&&m(t)&&(null==e||e.setValue(d))," "!==t.key&&"Enter"!==t.key||(0,LN.uh)(t)&&g(t)&&(t.preventDefault(),null==e||e.hide()))}),y=(0,T.useContext)(CN.Mz),v=(0,T.useState)(),[_,x]=y||v,k=(0,T.useMemo)(()=>[_,x],[_,x]),[w,C]=(0,T.useState)(null),S=(0,T.useContext)(zN);(0,T.useEffect)(()=>{if(S)return S(e),()=>S(null)},[S,e]),s=(0,LT.w7)(s,t=>(0,Er.jsx)(CN.D1,{value:e,children:(0,Er.jsx)(zN.Provider,{value:C,children:(0,Er.jsx)(CN.Mz.Provider,{value:k,children:t})})}),[e,k]);const A=!!e.combobox;r=null!=r?r:!A&&w!==e;const[I,E]=(0,LT.XB)(r?e.setListElement:null),j=(0,LT.Cy)(I,"role",s.role),B=(r||"listbox"===j||"menu"===j||"tree"===j||"grid"===j)&&u||void 0,N=(0,FN.dK)(p,s.hidden,o),R=N?{...s.style,display:"none"}:s.style;r&&(s={role:"listbox","aria-multiselectable":B,...s});const O=(0,IT.O$)(e,e=>{var t;return _||(null==(t=e.labelElement)?void 0:t.id)});return s={"aria-labelledby":null!=s["aria-label"]?void 0:O,hidden:N,...s,id:l,ref:(0,LT.SV)(E,s.ref),style:R,onKeyDown:b},s=(0,RT.T)({store:e,...s,composite:r}),(0,NN.g)({store:e,typeahead:!A,...s})}),UN=((0,OT.Rf)(function(e){const t=VN(e);return(0,OT.n)("div",t)}),n(16678)),$N=n(26645),HN=(0,OT.ab)(function({store:e,alwaysVisible:t,...n}){const i=(0,CN.oZ)();return n=VN({store:e=e||i,alwaysVisible:t,...n}),(0,UN.f)({store:e,alwaysVisible:t,...n})}),WN=(0,$N.AV)((0,OT.Rf)(function(e){const t=HN(e);return(0,OT.n)("div",t)}),CN.oZ),GN=n(21861),qN=n(81547),KN=(0,OT.ab)(function({store:e,value:t,getItem:n,hideOnClick:i,setValueOnClick:r=null!=t,preventScrollOnKeyDown:o=!0,focusOnHover:s=!0,...a}){var l;const c=(0,CN.L4)();e=e||c,(0,jT.V1)(e,!1);const u=(0,LT.Bi)(a.id),d=(0,jT.$f)(a),{listElement:h,multiSelectable:p,selected:f,autoFocus:m}=(0,IT.PX)(e,{listElement:"listElement",multiSelectable:e=>Array.isArray(e.value),selected:e=>function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)}(e.value,t),autoFocus:n=>null!=t&&null!=n.value&&(n.activeId===u||!(null==e?void 0:e.item(n.activeId)))&&(Array.isArray(n.value)?n.value[n.value.length-1]===t:n.value===t)}),g=(0,IT.O$)(null==e?void 0:e.combobox,"virtualFocus"),b=(0,T.useCallback)(e=>{const i={...e,value:d?void 0:t};return n?n(i):i},[d,t,n]);i=null!=i?i:null!=t&&!p;const y=a.onClick,v=(0,LT.O4)(r),_=(0,LT.O4)(i),x=(0,LT._q)(n=>{null==y||y(n),n.defaultPrevented||(0,LN.RN)(n)||(0,LN.$b)(n)||(v(n)&&null!=t&&(null==e||e.setValue(e=>Array.isArray(e)?e.includes(t)?e.filter(e=>e!==t):[...e,t]:t)),_(n)&&(null==e||e.hide()))}),k=null!=(l=(a=(0,LT.w7)(a,e=>(0,Er.jsx)(CN.uf.Provider,{value:null!=f&&f,children:e}),[f])).autoFocus)?l:m;a={role:(0,ON.cn)(h),"aria-selected":f,children:t,...a,id:u,autoFocus:!1!==g&&k,"data-autofocus":k||void 0,onClick:x},a=(0,qN.k)({store:e,getItem:b,preventScrollOnKeyDown:o,...a});const w=(0,LT.O4)(s);return(0,GN.T)({store:e,...a,focusOnHover:t=>!!w(t)&&e.getState().open})}),YN=(0,OT.ph)((0,OT.Rf)(function(e){const t=KN(e);return(0,OT.n)("div",t)})),JN=n(8963),XN=(0,OT.ab)(function({store:e,checked:t,...n}){const i=(0,T.useContext)(CN.uf);return t=null!=t?t:i,(0,JN.H)({...n,checked:t})}),ZN=(0,OT.Rf)(function(e){const t=XN(e);return(0,OT.n)("span",t)}),QN=n(37237),eR=n(40570),tR={compact:rx.A.controlPaddingXSmall,small:rx.A.controlPaddingXSmall,default:rx.A.controlPaddingX},nR=(0,ex.A)(DN,{shouldForwardProp:e=>"hasCustomRenderProp"!==e,target:"e1p3eej77"})(({size:e,hasCustomRenderProp:t})=>(0,tx.AH)("display:block;background-color:",nx.l.theme.background,";border:none;color:",nx.l.theme.foreground,";cursor:pointer;font-family:inherit;text-align:start;user-select:none;width:100%;&[data-focus-visible]{outline:none;}",((e,t)=>{const n={compact:{[t]:32,paddingInlineStart:tR.compact,paddingInlineEnd:tR.compact+QN.qO},default:{[t]:40,paddingInlineStart:tR.default,paddingInlineEnd:tR.default+QN.qO},small:{[t]:24,paddingInlineStart:tR.small,paddingInlineEnd:tR.small+QN.qO}};return n[e]||n.default})(e,t?"minHeight":"height")," ",!t&&aR," ",(0,sx.TA)({inputSize:e}),";",""),""),iR=(0,tx.i7)({"0%":{transform:`translateY(-${eR.r.SLIDE_DISTANCE})`},"100%":{transform:"translateY(0)"}}),rR=(0,tx.i7)({"0%":{opacity:0},"100%":{opacity:1}}),oR=(0,ex.A)(WN,{target:"e1p3eej76"})("display:flex;flex-direction:column;background-color:",nx.l.theme.background,";border-radius:",rx.A.radiusSmall,";border:1px solid ",nx.l.theme.foreground,";box-shadow:",rx.A.elevationMedium,";z-index:1000000;max-height:min( var( --popover-available-height, 400px ), 400px );overflow:auto;overscroll-behavior:contain;min-width:min-content;&[data-open]{@media not ( prefers-reduced-motion ){animation-name:",iR,",",rR,";animation-duration:",eR.r.SLIDE_DURATION,",",eR.r.FADE_DURATION,";animation-timing-function:",eR.r.SLIDE_EASING,",",eR.r.FADE_EASING,";will-change:transform,opacity;}}&[data-focus-visible]{outline:none;}"),sR=(0,ex.A)(YN,{target:"e1p3eej75"})(({size:e})=>(0,tx.AH)("cursor:default;display:flex;align-items:center;justify-content:space-between;font-size:",rx.A.fontSize,";line-height:28px;padding-block:",(0,ax.x)(2),";scroll-margin:",(0,ax.x)(1),";user-select:none;&[aria-disabled='true']{cursor:not-allowed;}&[data-active-item]{background-color:",nx.l.theme.gray[300],";}",(e=>{const t={compact:{paddingInlineStart:tR.compact,paddingInlineEnd:tR.compact-6},default:{paddingInlineStart:tR.default,paddingInlineEnd:tR.default-6},small:{paddingInlineStart:tR.small,paddingInlineEnd:tR.small-6}};return t[e]||t.default})(e),";",""),""),aR={name:"1h52dri",styles:"overflow:hidden;text-overflow:ellipsis;white-space:nowrap"},lR=(0,ex.A)("div",{target:"e1p3eej74"})(aR,";"),cR=(0,ex.A)("span",{target:"e1p3eej73"})("color:",nx.l.theme.gray[600],";margin-inline-start:",(0,ax.x)(2),";"),uR=(0,ex.A)("div",{target:"e1p3eej72"})("display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;flex:1;column-gap:",(0,ax.x)(4),";"),dR=(0,ex.A)("span",{target:"e1p3eej71"})("color:",nx.l.theme.gray[600],";text-align:initial;line-height:",rx.A.fontLineHeightBase,";padding-inline-end:",(0,ax.x)(1),";margin-block:",(0,ax.x)(1),";"),hR=(0,ex.A)(ZN,{target:"e1p3eej70"})("display:flex;align-items:center;margin-inline-start:",(0,ax.x)(2),";fill:currentColor;align-self:start;margin-block-start:2px;font-size:0;",uR,"~&,&:not(:empty){font-size:24px;}"),pR=n(17617),fR=n(3591),mR=(0,T.createContext)(void 0);function gR(e){return(Array.isArray(e)?0===e.length:null==e)?(0,ee.__)("Select an item"):Array.isArray(e)?1===e.length?e[0]:(0,ee.sprintf)((0,ee._n)("%d item selected","%d items selected",e.length),e.length):e}mR.displayName="CustomSelectContext";var bR=({renderSelectedValue:e,size:t="default",store:n,...i})=>{const{value:r}=IT.O$(n),o=(0,T.useMemo)(()=>e??gR,[e]);return(0,Er.jsx)(nR,{...i,size:t,hasCustomRenderProp:!!e,store:n,children:o(r)})},yR=function(e){const{children:t,hideLabelFromVision:n=!1,label:i,size:r,store:o,className:s,isLegacy:a=!1,...l}=e,c=(0,T.useCallback)(e=>{a&&e.stopPropagation()},[a]),u=(0,T.useMemo)(()=>({store:o,size:r}),[o,r]);return(0,Er.jsxs)("div",{className:s,children:[(0,Er.jsx)(AN,{store:o,render:n?(0,Er.jsx)(kC.A,{}):(0,Er.jsx)(mk.Ay.VisualLabel,{as:"div"}),children:i}),(0,Er.jsxs)(pR.A,{__next40pxDefaultSize:!0,size:r,suffix:(0,Er.jsx)(fR.A,{}),children:[(0,Er.jsx)(bR,{...l,size:r,store:o,showOnKeyDown:!a}),(0,Er.jsx)(oR,{gutter:12,store:o,sameWidth:!0,slide:!1,onKeyDown:c,flip:!a,children:(0,Er.jsx)(mR.Provider,{value:u,children:t})})]})]})};function vR({children:e,...t}){const n=(0,T.useContext)(mR);return(0,Er.jsxs)(sR,{store:n?.store,size:n?.size??"default",...t,children:[e??t.value,(0,Er.jsx)(hR,{children:(0,Er.jsx)(xx.A,{icon:xw.A})})]})}vR.displayName="CustomSelectControlV2.Item";var _R=vR;function xR({__experimentalHint:e,...t}){return{hint:e,...t}}function kR(e,t){return t||(0,ee.sprintf)((0,ee.__)("Currently selected: %s"),e)}var wR=function e(t){const{__next40pxDefaultSize:n=!1,__shouldNotWarnDeprecated36pxSize:i,describedBy:r,options:o,onChange:s,size:a="default",value:l,className:c,showSelectedHint:u=!1,...d}=function({__experimentalShowSelectedHint:e,...t}){return{showSelectedHint:e,...t}}(t);(0,bx.M)({componentName:"CustomSelectControl",__next40pxDefaultSize:n,size:a,__shouldNotWarnDeprecated36pxSize:i});const h=(0,SS.A)(e,"custom-select-control__description"),p=function(e={}){e=function(e){const t=(0,vN.PV)();return e={...e,combobox:void 0!==e.combobox?e.combobox:t},(0,AT.YC)(e)}(e);const[t,n]=(0,IT.Pj)(wN,e);return function(e,t,n){return(0,LT.w5)(t,[n.combobox]),(0,IT.Tz)(e,n,"value","setValue"),(0,IT.Tz)(e,n,"setValueOnMove"),Object.assign((0,yN.o)((0,AT.YO)(e,t,n),t,n),{combobox:n.combobox})}(t,n,e)}({async setValue(e){const t=o.find(t=>t.key===e);if(!s||!t)return;await Promise.resolve();const n=p.getState(),i={highlightedIndex:n.renderedItems.findIndex(t=>t.value===e),inputValue:"",isOpen:n.open,selectedItem:t,type:""};s(i)},value:l?.key,defaultValue:o[0]?.key}),f=o.map(xR).map(({name:e,key:t,hint:n,style:i,className:r})=>{const o=(0,Er.jsxs)(uR,{children:[(0,Er.jsx)("span",{children:e}),(0,Er.jsx)(dR,{className:"components-custom-select-control__item-hint",children:n})]});return(0,Er.jsx)(_R,{value:t,children:n?o:e,style:i,className:(0,mh.A)(r,"components-custom-select-control__item",{"has-hint":n})},t)}),m=IT.O$(p,"value"),g=o?.map(xR)?.find(({key:e})=>m===e)??o[0],b=n&&"default"===a||"__unstable-large"===a?"default":n||"default"!==a?a:"compact";return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(yR,{"aria-describedby":h,renderSelectedValue:()=>u&&g.hint?(0,Er.jsxs)(lR,{children:[g?.name,(0,Er.jsx)(cR,{className:"components-custom-select-control__hint",children:g?.hint})]}):g?.name,size:b,store:p,className:(0,mh.A)("components-custom-select-control",c),isLegacy:!0,...d,children:f}),(0,Er.jsx)(kC.A,{children:(0,Er.jsx)("span",{id:h,children:kR(g?.name,r)})})]})},CR=n(76974),SR={px:{max:300,steps:1},"%":{max:100,steps:1},vw:{max:100,steps:1},vh:{max:100,steps:1},em:{max:10,steps:.1},rem:{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}},AR=(e,t)=>!!e?.includes&&("0"===e||e.includes(`var:preset|${t}|`));function IR(e,t){if(!e)return;if("0"===e||"default"===e)return e;const n=e.match(new RegExp(`var:preset\\|${t}\\|(.+)`));return n?n[1]:void 0}function ER(e,t,n){if(!AR(e,n))return e;const i=0===parseFloat(e,10)?"0":IR(e,n),r=t.find(e=>String(e.slug)===i);return r?.size}var jR=n(43987);function TR({allowNegativeOnDrag:e,ariaLabel:t,allPlaceholder:n,minValue:i,parsedQuantity:r,computedUnit:o,units:s,isMixed:a,step:l,max:c,showTooltip:u,value:d,minimumCustomValue:h,onCustomValueChange:p,onCustomValueSliderChange:f,onUnitChange:m,onMouseOut:g,onMouseOver:b,setMinValue:y}){const v=(0,Er.jsx)(vx,{className:"preset-input-control__unit-control",disableUnits:a,hideLabelFromVision:!0,label:t,min:i,onChange:p,onUnitChange:m,onBlur:g,onFocus:b,onMouseOut:g,onMouseOver:b,size:"__unstable-large",units:s,value:[r,o].join(""),placeholder:n,onDragStart:()=>{e&&"-"===d?.charAt(0)&&y(0)},onDrag:()=>{e&&"-"===d?.charAt(0)&&y(0)},onDragEnd:()=>{e&&y(h)}}),_=u?(0,Er.jsx)(jR.Ay,{text:t,placement:"top",children:(0,Er.jsx)("div",{className:"preset-input-control__tooltip-wrapper",children:v})}):v;return(0,Er.jsxs)(Er.Fragment,{children:[_,(0,Er.jsx)(gk.A,{className:"preset-input-control__custom-value-range",hideLabelFromVision:!0,initialPosition:0,label:t,max:c,min:0,onBlur:g,onChange:f,onFocus:b,onMouseOut:g,onMouseOver:b,step:l,value:r,withInputField:!1,__next40pxDefaultSize:!0})]})}function BR({allowNegativeOnDrag:e=!1,ariaLabel:t,className:n,customValueSettings:i=SR,disableCustomValues:r,icon:o,isMixed:s,value:a,minimumCustomValue:l,onChange:c,onMouseOut:u,onMouseOver:d,onUnitChange:h,presets:p=[],presetType:f,selectedUnit:m,showTooltip:g,units:b}){const y=(0,T.useMemo)(()=>function(e,t,n){if(!e||AR(e,n)||"0"===e)return e;const i=t.find(t=>String(t.size)===String(e));return i?.slug?`var:preset|${n}|${i.slug}`:e}(a,p,f),[a,p,f]),v=n??"preset-input-control",_=p.slice(1,p.length-1).map((e,t)=>({value:t+1,label:void 0})),x=_.length>0,k=p.length<=8,w=s?(0,ee.__)("Mixed"):null,[C,S]=(0,T.useState)(l),[A,I]=(0,T.useState)(!r&&void 0!==y&&!AR(y,f));let E=null;const j=(0,qt.A)(y);(0,T.useEffect)(()=>{y&&j!==y&&!AR(y,f)&&!0!==A&&I(!0)},[y,j,f,A]);const B=!k&&!A&&void 0!==y&&(!AR(y,f)||AR(y,f)&&s);let N=p;B?(N=[...p,{name:s?(0,ee.__)("Mixed"):(0,ee.sprintf)((0,ee.__)("Custom (%s)"),y),slug:"custom",size:y}],E=N.length-1):s||(E=A?ER(y,p,f):function(e,t,n){if(void 0===e)return 0;const i=0===parseFloat(e,10)?"0":IR(e,n),r=t.findIndex(e=>String(e.slug)===i);return-1!==r?r:NaN}(y,p,f));const R=N.map((e,t)=>({key:t,name:e.name})),O=AR(y,f)?ER(y,p,f):y,[L,M]=X_(O),P=M||m||"px",D=b?.find(e=>e.value===P),F=D?.step??i[P]?.steps??.1,z=D?.max??i[P]?.max??10,V=(e,t)=>{const n=parseInt(e,10);if("selectList"===t){if(0===n&&"0"===p[0]?.slug)return"0";if(0===n)return}else if(0===n)return"0";return`var:preset|${f}|${p[e]?.slug}`};return(0,Er.jsxs)(Cw.A,{className:`preset-input-control__wrapper ${v}__wrapper`,children:[o&&(0,Er.jsx)(IC.A,{className:"preset-input-control__icon",icon:o,size:24}),(!x||A)&&(0,Er.jsx)(TR,{allowNegativeOnDrag:e,ariaLabel:t,allPlaceholder:w,minValue:C,parsedQuantity:L,computedUnit:P,units:b,isMixed:s,step:F,max:z,showTooltip:g,value:y,minimumCustomValue:l,onCustomValueChange:e=>{void 0!==e&&""!==e?isNaN(parseFloat(e))||c(e):c(void 0)},onCustomValueSliderChange:e=>{c([e,P].join(""))},onUnitChange:h,onMouseOut:u,onMouseOver:d,setMinValue:S}),x&&k&&!A&&(0,Er.jsx)(gk.A,{"aria-valuenow":E,"aria-valuetext":p[E]?.name,className:"preset-input-control__preset-range",hideLabelFromVision:!0,initialPosition:0,label:t,max:p.length-1,marks:_,min:0,onBlur:u,onChange:e=>c(V(e)),onFocus:d,onMouseDown:e=>{e?.nativeEvent?.offsetX<35&&void 0===y&&c("0")},onMouseOut:u,onMouseOver:d,renderTooltipContent:e=>void 0===y?void 0:p[e]?.name,step:1,value:E,withInputField:!1,__next40pxDefaultSize:!0}),x&&!k&&!A&&(0,Er.jsx)(wR,{className:"preset-input-control__custom-select-control",hideLabelFromVision:!0,label:t,onBlur:u,onChange:e=>{B&&e.selectedItem.key===R.length-1?I(!0):c(V(e.selectedItem.key,"selectList"))},onFocus:d,onMouseOut:u,onMouseOver:d,options:R,size:"__unstable-large",value:R.find(e=>e.key===E)||""}),x&&!r&&(0,Er.jsx)(fv.Ay,{className:"preset-input-control__custom-toggle",icon:CR.A,iconSize:24,isPressed:A,label:A?(0,ee.__)("Use preset"):(0,ee.__)("Set custom value"),onClick:()=>{I(!A)},size:"small"})]})}var NR=n(20216),RR=n(37994),OR=n(87941),LR=n(41300),MR=n(82007),PR=[],DR={all:(0,ee.__)("Border radius"),topLeft:(0,ee.__)("Top left"),topRight:(0,ee.__)("Top right"),bottomLeft:(0,ee.__)("Bottom left"),bottomRight:(0,ee.__)("Bottom right")},FR={all:NR.A,topLeft:RR.A,topRight:OR.A,bottomLeft:LR.A,bottomRight:MR.A};function zR(e,t){return"all"===t?function(e={}){if("string"==typeof e)return e;const t=Object.values(e).map(e=>{const t=X_(e);return"string"==typeof e&&void 0===t[0]?[e,""]:t}),n=t.map(e=>e[0]??""),i=t.map(e=>e[1]),r=n.every(e=>e===n[0])?n[0]:"",o=(s=i,[...s].sort((e,t)=>s.filter(e=>e===t).length-s.filter(t=>t===e).length).shift());var s;return 0===r||r?`${r}${o||""}`:void 0}(e):"string"==typeof e?e:e?.[t]}function VR(e,t){return"all"===t?e.flat:e[t]}function UR(e,t,n){return i=>{n("all"===e?{topLeft:i,topRight:i,bottomLeft:i,bottomRight:i}:{..."string"!=typeof t?t||{}:{topLeft:t,topRight:t,bottomLeft:t,bottomRight:t},[e]:i})}}function $R(e,t,n){return i=>{const r={...t};"all"===e?(r.flat=i,r.topLeft=i,r.topRight=i,r.bottomLeft=i,r.bottomRight=i):r[e]=i,n(r)}}function HR({onChange:e,values:t,presets:n}){const[i,r]=(0,T.useState)(!function(e){if(!e)return!1;if("string"==typeof e)return!0;const t=Object.values(e).filter(e=>!!e||0===e);return!!t.length}(t)||!function(e={}){if("string"==typeof e)return!1;if(!e||"object"!=typeof e)return!1;const t=Object.values(e);if(0===t.length)return!1;const n=t[0],i=t.every(e=>e===n);return!i}(t)),o=function(e){const t=e?.default??PR,n=e?.custom??PR,i=e?.theme??PR;return(0,T.useMemo)(()=>{const e=[{name:(0,ee.__)("None"),slug:"0",size:0},...n,...i,...t];return e.length>8?[{name:(0,ee.__)("Default"),slug:"default",size:void 0},...e]:e},[n,i,t])}(n),[s,a]=(0,T.useState)({flat:"string"==typeof t?X_(t)[1]:void 0,topLeft:X_(t?.topLeft)[1],topRight:X_(t?.topRight)[1],bottomLeft:X_(t?.bottomLeft)[1],bottomRight:X_(t?.bottomRight)[1]}),[l]=tv("spacing.units"),c=Z_({availableUnits:l||["px","em","rem"]});return(0,Er.jsxs)("fieldset",{className:"components-border-radius-control",children:[(0,Er.jsxs)(Cw.A,{className:"components-border-radius-control__header",children:[(0,Er.jsx)(mk.Ay.VisualLabel,{as:"legend",children:(0,ee.__)("Radius")}),(0,Er.jsx)(bN,{onClick:()=>r(!i),isLinked:i})]}),i?(0,Er.jsx)(BR,{ariaLabel:DR.all,className:"components-border-radius-control",icon:FR.all,minimumCustomValue:0,onChange:UR("all",t,e),onUnitChange:$R("all",s,a),presets:o,presetType:"border-radius",selectedUnit:VR(s,"all"),showTooltip:!0,units:c,value:zR(t,"all")}):(0,Er.jsx)(Q_.A,{children:["topLeft","topRight","bottomLeft","bottomRight"].map(n=>(0,Er.jsx)(BR,{ariaLabel:DR[n],className:"components-border-radius-control",icon:FR[n],minimumCustomValue:0,onChange:UR(n,t,e),onUnitChange:$R(n,s,a),presets:o,presetType:"border-radius",selectedUnit:VR(s,n),showTooltip:!0,units:c,value:zR(t,n)},n))})]})}var WR=n(71213),GR=[];function qR({shadow:e,onShadowChange:t,settings:n}){const i=ZR(n);return(0,Er.jsx)("div",{className:"block-editor-global-styles__shadow-popover-container",children:(0,Er.jsxs)(Q_.A,{spacing:4,children:[(0,Er.jsx)(Sw.A,{level:5,children:(0,ee.__)("Drop shadow")}),(0,Er.jsx)(KR,{presets:i,activeShadow:e,onSelect:t}),(0,Er.jsx)("div",{className:"block-editor-global-styles__clear-shadow",children:(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>t(void 0),disabled:!e,accessibleWhenDisabled:!0,children:(0,ee.__)("Clear")})})]})})}function KR({presets:e,activeShadow:t,onSelect:n}){return e?(0,Er.jsx)(II.e,{role:"listbox",className:"block-editor-global-styles__shadow__list","aria-label":(0,ee.__)("Drop shadows"),children:e.map(({name:e,slug:i,shadow:r})=>(0,Er.jsx)(YR,{label:e,isActive:r===t,type:"unset"===i?"unset":"preset",onSelect:()=>n(r===t?void 0:r),shadow:r},i))}):null}function YR({type:e,label:t,isActive:n,onSelect:i,shadow:r}){return(0,Er.jsx)(jR.Ay,{text:t,children:(0,Er.jsx)(II.e.Item,{role:"option","aria-label":t,"aria-selected":n,className:(0,mh.A)("block-editor-global-styles__shadow__item",{"is-active":n}),render:(0,Er.jsx)("button",{className:(0,mh.A)("block-editor-global-styles__shadow-indicator",{unset:"unset"===e}),onClick:i,style:{boxShadow:r},"aria-label":t,children:n&&(0,Er.jsx)(xx.A,{icon:xw.A})})})})}function JR({shadow:e,onShadowChange:t,settings:n}){return(0,Er.jsx)(wC.A,{popoverProps:{placement:"left-start",offset:36,shift:!0},className:"block-editor-global-styles__shadow-dropdown",renderToggle:XR(e,t),renderContent:()=>(0,Er.jsx)(CC.A,{paddingSize:"medium",children:(0,Er.jsx)(qR,{shadow:e,onShadowChange:t,settings:n})})})}function XR(e,t){return function({onToggle:n,isOpen:i}){const r=(0,T.useRef)(void 0),o={onClick:n,className:(0,mh.A)("block-editor-global-styles__shadow-dropdown-toggle",{"is-open":i}),"aria-expanded":i,ref:r},s={onClick:()=>{i&&n(),t(void 0),r.current?.focus()},className:(0,mh.A)("block-editor-global-styles__shadow-editor__remove-button",{"is-open":i}),label:(0,ee.__)("Remove")};return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,...o,children:(0,Er.jsxs)(Cw.A,{justify:"flex-start",children:[(0,Er.jsx)(xx.A,{className:"block-editor-global-styles__toggle-icon",icon:WR.A,size:24}),(0,Er.jsx)(Yv.A,{children:(0,ee.__)("Drop shadow")})]})}),!!e&&(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,size:"small",icon:uS.A,...s})]})}}function ZR(e){return(0,T.useMemo)(()=>{if(!e?.shadow)return GR;const t=e?.shadow?.defaultPresets,{default:n,theme:i,custom:r}=e?.shadow?.presets??{},o={name:(0,ee.__)("Unset"),slug:"unset",shadow:"none"},s=[...t&&n||GR,...i||GR,...r||GR];return s.length&&s.unshift(o),s},[e])}function QR(e){return Object.values(eO(e)).some(Boolean)}function eO(e){return{hasBorderColor:tO(e),hasBorderRadius:nO(e),hasBorderStyle:iO(e),hasBorderWidth:rO(e),hasShadow:oO(e)}}function tO(e){return e?.border?.color}function nO(e){return e?.border?.radius}function iO(e){return e?.border?.style}function rO(e){return e?.border?.width}function oO(e){const t=ZR(e);return!!e?.shadow&&t.length>0}function sO({resetAllFilter:e,onChange:t,value:n,panelId:i,children:r,label:o}){const s=Zw();return(0,Er.jsx)(Xw,{label:o,resetAll:()=>{const i=e(n);t(i)},panelId:i,dropdownMenuProps:s,children:r})}var aO={radius:!0,color:!0,width:!0,shadow:!0};function lO({as:e=sO,value:t,onChange:n,inheritedValue:i=t,settings:r,panelId:o,name:s,defaultControls:a=aO}){const l=iv(r),c=(0,T.useCallback)(e=>vC({settings:r},"",e),[r]),u=e=>{const t=l.flatMap(({colors:e})=>e).find(({color:t})=>t===e);return t?"var:preset|color|"+t.slug:e},d=(0,T.useMemo)(()=>{if(TB(i?.border)){const e={...i?.border};return["top","right","bottom","left"].forEach(t=>{e[t]={...e[t],color:c(e[t]?.color)}}),e}return{...i?.border,color:i?.border?.color?c(i?.border?.color):void 0}},[i?.border,c]),h=e=>n({...t,border:e}),p=tO(r),f=iO(r),m=rO(r),g=nO(r),b=(0,T.useMemo)(()=>"object"!=typeof i?.border?.radius?c(i?.border?.radius):{topLeft:c(i?.border?.radius?.topLeft),topRight:c(i?.border?.radius?.topRight),bottomLeft:c(i?.border?.radius?.bottomLeft),bottomRight:c(i?.border?.radius?.bottomRight)},[i?.border?.radius,c]),y=e=>h({...d,radius:e}),v=()=>{const e=t?.border?.radius;return"object"==typeof e?Object.entries(e).some(Boolean):!!e},_=oO(r),x=c(i?.shadow),k=r?.shadow?.presets??{},w=k.custom??k.theme??k.default??[],C=e=>{const i=w?.find(({shadow:t})=>t===e)?.slug;n(_p(t,["shadow"],i?`var:preset|shadow|${i}`:e||void 0))},S=(0,T.useCallback)(e=>({...e,border:void 0,shadow:void 0}),[]),A=a?.color||a?.width,I=p||f||m||g,E=vO({blockName:s,hasShadowControl:_,hasBorderControl:I});return(0,Er.jsxs)(e,{resetAllFilter:S,value:t,onChange:n,panelId:o,label:E,children:[(m||p)&&(0,Er.jsx)(aC,{hasValue:()=>(e=>!!e&&(TB(e)?!IB.every(t=>jB(e[t])):!jB(e)))(t?.border),label:(0,ee.__)("Border"),onDeselect:()=>(()=>{if(v())return h({radius:t?.border?.radius});h(void 0)})(),isShownByDefault:A,panelId:o,children:(0,Er.jsx)(gN,{colors:l,enableAlpha:!0,enableStyle:f,onChange:e=>{const t={...e};TB(t)?["top","right","bottom","left"].forEach(e=>{t[e]&&(t[e]={...t[e],color:u(t[e]?.color)})}):t&&(t.color=u(t.color)),h({radius:d?.radius,...t})},popoverOffset:40,popoverPlacement:"left-start",value:d,__experimentalIsRenderedInSidebar:!0,size:"__unstable-large",hideLabelFromVision:!_,label:(0,ee.__)("Border")})}),g&&(0,Er.jsx)(aC,{hasValue:v,label:(0,ee.__)("Radius"),onDeselect:()=>y(void 0),isShownByDefault:a.radius,panelId:o,children:(0,Er.jsx)(HR,{presets:r?.border?.radiusSizes,values:b,onChange:e=>{y(e||void 0)}})}),_&&(0,Er.jsxs)(aC,{label:(0,ee.__)("Shadow"),hasValue:()=>!!t?.shadow,onDeselect:()=>C(void 0),isShownByDefault:a.shadow,panelId:o,children:[I?(0,Er.jsx)(mk.Ay.VisualLabel,{as:"legend",children:(0,ee.__)("Shadow")}):null,(0,Er.jsx)(JR,{shadow:x,onShadowChange:C,settings:r})]})]})}var cO="__experimentalBorder",uO="shadow",dO=(e,t,n)=>{let i;return e.some(e=>e.colors.some(e=>e[t]===n&&(i=e,!0))),i},hO=({colors:e,namedColor:t,customColor:n})=>{if(t){const n=dO(e,"slug",t);if(n)return n}if(!n)return{color:void 0};return dO(e,"color",n)||{color:n}};function pO(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function fO(e){if(TB(e?.border))return{style:e,borderColor:void 0};const t=e?.border?.color,n=t?.startsWith("var:preset|color|")?t.substring(17):void 0,i={...e};return i.border={...i.border,color:n?void 0:t},{style:ov(i),borderColor:n}}function mO(e){return TB(e.style?.border)?e.style:{...e.style,border:{...e.style?.border,color:e.borderColor?"var:preset|color|"+e.borderColor:e.style?.border?.color}}}function gO({label:e,children:t,resetAllFilter:n}){const i=(0,T.useCallback)(e=>{const t=mO(e),i=n(t);return{...e,...fO(i)}},[n]);return(0,Er.jsx)(oC,{group:"border",resetAllFilter:i,label:e,children:t})}function bO({clientId:e,name:t,setAttributes:n,settings:i}){const r=QR(i),{style:o,borderColor:s}=(0,zt.A)(t=>{if(!r)return{};const{style:n,borderColor:i}=t(Qy).getBlockAttributes(e)||{};return{style:n,borderColor:i}},[e,r]),a=(0,T.useMemo)(()=>mO({style:o,borderColor:s}),[o,s]);if(!r)return null;const l={...vn(t,[cO,"__experimentalDefaultControls"]),...vn(t,[uO,"__experimentalDefaultControls"])};return(0,Er.jsx)(lO,{as:gO,panelId:e,settings:i,value:a,onChange:e=>{n(fO(e))},defaultControls:l})}function yO(e,t="any"){if("web"!==Uo.A.OS)return!1;const n=vn(e,cO);return!0===n||("any"===t?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t])}function vO({blockName:e,hasBorderControl:t,hasShadowControl:n}={}){const i=eO(dv(e));return t||n||!e||(t=i?.hasBorderColor||i?.hasBorderStyle||i?.hasBorderWidth||i?.hasBorderRadius,n=i?.hasShadow),t&&n?(0,ee.__)("Border & Shadow"):n?(0,ee.__)("Shadow"):(0,ee.__)("Border")}function _O(e,t,n){if(!yO(t,"color")||av(t,cO,"color"))return e;const i=xO(n),r=(0,mh.A)(e.className,i);return e.className=r||void 0,e}function xO(e){const{borderColor:t,style:n}=e,i=MB("border-color",t);return(0,mh.A)({"has-border-color":t||n?.border?.color,[i]:!!i})}var kO={useBlockProps:function({name:e,borderColor:t,style:n}){const{colors:i}=PB();if(!yO(e,"color")||av(e,cO,"color"))return{};const{color:r}=hO({colors:i,namedColor:t}),{color:o}=hO({colors:i,namedColor:pO(n?.border?.top?.color)}),{color:s}=hO({colors:i,namedColor:pO(n?.border?.right?.color)}),{color:a}=hO({colors:i,namedColor:pO(n?.border?.bottom?.color)}),{color:l}=hO({colors:i,namedColor:pO(n?.border?.left?.color)});return _O({style:ov({borderTopColor:o||r,borderRightColor:s||r,borderBottomColor:a||r,borderLeftColor:l||r})||{}},e,{borderColor:t,style:n})},addSaveProps:_O,attributeKeys:["borderColor","style"],hasSupport:e=>yO(e,"color")};function wO(e,t="root",n={}){if(!t)return null;const{fallback:i=!1}=n,{name:r,selectors:o,supports:s}=e,a=o&&Object.keys(o).length>0,l=Array.isArray(t)?t.join("."):t;let c=null;if(c=a&&o.root?o?.root:s?.__experimentalSelector?s.__experimentalSelector:".wp-block-"+r.replace("core/","").replace("/","-"),"root"===l)return c;const u=Array.isArray(t)?t:t.split(".");if(1===u.length){const e=i?c:null;if(a)return hC(o,`${l}.root`,null)||hC(o,l,null)||e;const t=s?hC(s,`${l}.__experimentalSelector`,null):void 0;return t?gC(c,t):e}let d;return a&&(d=hC(o,l,null)),d||(i?wO(e,u[0],n):null)}(0,Ei.U2)("blocks.registerBlockType","core/border/addAttributes",function(e){return yO(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e}),(0,te.X$)([ne.A,ie.A]);var CO=function({backgroundColor:e,fallbackBackgroundColor:t,fallbackTextColor:n,fallbackLinkColor:i,fontSize:r,isLargeText:o,textColor:s,linkColor:a,enableAlphaChecker:l=!1}){const c=e||t;if(!c)return null;const u=s||n,d=a||i;if(!u&&!d)return null;const h=[{color:u,description:(0,ee.__)("text color")},{color:d,description:(0,ee.__)("link color")}],p=(0,te.Mj)(c),f=p.alpha()<1,m=p.brightness(),g={level:"AA",size:o||!1!==o&&r>=24?"large":"small"};let b="",y="";for(const e of h){if(!e.color)continue;const t=(0,te.Mj)(e.color),n=t.isReadable(p,g),i=t.alpha()<1;if(!n){if(f||i)continue;b=m({refsMap:(0,SO.u)()}),[]);return(0,Er.jsx)(AO.Provider,{value:t,children:e})}function EO(e){const{refsMap:t}=(0,T.useContext)(AO);return(0,bt.A)(n=>(t.set(e,n),()=>t.delete(e)),[e])}function jO(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function TO(e,t){const{refsMap:n}=(0,T.useContext)(AO);(0,T.useLayoutEffect)(()=>{jO(t,n.get(e));const i=n.subscribe(e,()=>jO(t,n.get(e)));return()=>{i(),jO(t,null)}},[n,e,t])}function BO(e){const[t,n]=(0,T.useState)(null);return TO(e,n),t}function NO(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function RO(e,t){if(!e||!t)return{};const n=wO(t,"color.text",{fallback:!0}),i=wO(t,"color.background",{fallback:!0}),r=e.querySelector(n)||e,o=e.querySelector(i)||e,s=e.querySelector("a"),a=NO(r,"color"),l=s&&s.textContent?NO(s,"color"):void 0;let c=o,u=NO(c,"background-color");for(;"rgba(0, 0, 0, 0)"===u&&c.parentNode&&c.parentNode.nodeType===c.parentNode.ELEMENT_NODE;)c=c.parentNode,u=NO(c,"background-color");return{textColor:a,backgroundColor:u,linkColor:l}}function OO(e,t){return Object.keys(t).some(n=>e[n]!==t[n])?t:e}function LO({clientId:e,name:t}){const n=BO(e),[i,r]=(0,T.useReducer)(OO,{}),o=(0,zt.A)(e=>t?e(Zi).getBlockType(t):void 0,[t]);return(0,T.useLayoutEffect)(()=>{n&&o&&window.requestAnimationFrame(()=>window.requestAnimationFrame(()=>r(RO(n,o))))}),(0,T.useLayoutEffect)(()=>{if(!n||!o)return;const e=new window.MutationObserver(()=>{r(RO(n,o))});return e.observe(n,{attributes:!0,attributeFilter:["class","style"]}),()=>{e.disconnect()}},[n,o]),(0,Er.jsx)(CO,{backgroundColor:i.backgroundColor,textColor:i.textColor,linkColor:i.linkColor,enableAlphaChecker:!0})}AO.displayName="BlockRefsContext";var MO="color",PO=e=>{const t=vn(e,MO);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},DO=e=>{if("web"!==Uo.A.OS)return!1;const t=vn(e,MO);return null!==t&&"object"==typeof t&&!!t.link},FO=e=>{const t=vn(e,MO);return null!==t&&"object"==typeof t&&!!t.gradients},zO=e=>{const t=vn(e,MO);return t&&!1!==t.background},VO=e=>{const t=vn(e,MO);return t&&!1!==t.text};function UO(e,t,n){if(!PO(t)||av(t,MO))return e;const i=FO(t),{backgroundColor:r,textColor:o,gradient:s,style:a}=n,l=e=>!av(t,MO,e),c=l("text")?MB("color",o):void 0,u=l("gradients")?function(e){if(e)return`has-${e}-gradient-background`}(s):void 0,d=l("background")?MB("background-color",r):void 0,h=l("background")||l("gradients"),p=r||a?.color?.background||i&&(s||a?.color?.gradient),f=(0,mh.A)(e.className,c,u,{[d]:!(i&&a?.color?.gradient||!d),"has-text-color":l("text")&&(o||a?.color?.text),"has-background":h&&p,"has-link-color":l("link")&&a?.elements?.link?.color});return e.className=f||void 0,e}function $O(e){const t=e?.color?.text,n=t?.startsWith("var:preset|color|")?t.substring(17):void 0,i=e?.color?.background,r=i?.startsWith("var:preset|color|")?i.substring(17):void 0,o=e?.color?.gradient,s=o?.startsWith("var:preset|gradient|")?o.substring(20):void 0,a={...e};return a.color={...a.color,text:n?void 0:t,background:r?void 0:i,gradient:s?void 0:o},{style:ov(a),textColor:n,backgroundColor:r,gradient:s}}function HO(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 WO({children:e,resetAllFilter:t}){const n=(0,T.useCallback)(e=>{const n=HO(e),i=t(n);return{...e,...$O(i)}},[t]);return(0,Er.jsx)(oC,{group:"color",resetAllFilter:n,children:e})}function GO({clientId:e,name:t,setAttributes:n,settings:i,asWrapper:r,label:o,defaultControls:s}){const a=BE(i),{style:l,textColor:c,backgroundColor:u,gradient:d}=(0,zt.A)(t=>{if(!a)return{};const{style:n,textColor:i,backgroundColor:r,gradient:o}=t(Qy).getBlockAttributes(e)||{};return{style:n,textColor:i,backgroundColor:r,gradient:o}},[e,a]),h=(0,T.useMemo)(()=>HO({style:l,textColor:c,backgroundColor:u,gradient:d}),[l,c,u,d]);if(!a)return null;s=s||vn(t,[MO,"__experimentalDefaultControls"]);const p="web"===Uo.A.OS&&!h?.color?.gradient&&(i?.color?.text||i?.color?.link)&&!1!==vn(t,[MO,"enableContrastChecker"]),f=r||WO;return(0,Er.jsx)(WE,{as:f,panelId:e,settings:i,value:h,onChange:e=>{n($O(e))},defaultControls:s,label:o,enableContrastChecker:!1!==vn(t,[MO,"enableContrastChecker"]),children:p&&(0,Er.jsx)(LO,{clientId:e,name:t})})}var qO={useBlockProps:function({name:e,backgroundColor:t,textColor:n,gradient:i,style:r}){const[o,s,a]=tv("color.palette.custom","color.palette.theme","color.palette.default"),l=(0,T.useMemo)(()=>[...o||[],...s||[],...a||[]],[o,s,a]);if(!PO(e)||av(e,MO))return{};const c={};n&&!av(e,MO,"text")&&(c.color=LB(l,n)?.color),t&&!av(e,MO,"background")&&(c.backgroundColor=LB(l,t)?.color);const u=UO({style:c},e,{textColor:n,backgroundColor:t,gradient:i,style:r}),d=t||r?.color?.background||i||r?.color?.gradient;return{...u,className:(0,mh.A)(u.className,!d&&ij(r))}},addSaveProps:UO,attributeKeys:["backgroundColor","textColor","gradient","style"],hasSupport:PO},KO={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,Ei.U2)("blocks.registerBlockType","core/color/addAttribute",function(e){return PO(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),FO(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e}),(0,Ei.U2)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",function(e,t,n,i){const r=e.name;return sv({linkColor:DO(r),textColor:VO(r),backgroundColor:zO(r),gradient:FO(r)},KO,e,t,n,i)});var YO=(0,ex.A)("fieldset",{target:"e8tqeku4"})({name:"k2q51s",styles:"border:0;margin:0;padding:0;display:contents"}),JO=(0,ex.A)(Cw.A,{target:"e8tqeku3"})("height:",(0,ax.x)(4),";"),XO=(0,ex.A)(fv.Ay,{target:"e8tqeku2"})("margin-top:",(0,ax.x)(-1),";"),ZO=(0,ex.A)(mk.Ay.VisualLabel,{target:"e8tqeku1"})("display:flex;gap:",(0,ax.x)(1),";justify-content:flex-start;margin-bottom:0;"),QO=(0,ex.A)(wR,{target:"e8tqeku0"})({name:"anvx77",styles:".components-custom-select-control__item .components-custom-select-control__item-hint{width:100%;}"});var eL={key:"default",name:(0,ee.__)("Default"),value:void 0},tL=e=>{const{__next40pxDefaultSize:t,fontSizes:n,value:i,size:r,valueMode:o="literal",onChange:s}=e,a=[eL,...n.map(e=>{const t=function(e){return e.hint?e.hint: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)?String(e.size):void 0}(e);return{key:e.slug,name:e.name||e.slug,value:e.size,hint:t}})],l=(0,T.useMemo)(()=>{if(void 0===i)return eL;if("slug"===o){const e=a.find(e=>e.key===i);if(e)return e}return a.find(e=>e.value===i)??eL},[i,o,a]);return(0,Er.jsx)(QO,{__next40pxDefaultSize:t,__shouldNotWarnDeprecated36pxSize:!0,className:"components-font-size-picker__select",label:(0,ee.__)("Font size"),hideLabelFromVision:!0,describedBy:(0,ee.sprintf)((0,ee.__)("Currently selected font size: %s"),l.name),options:a,value:l,showSelectedHint:!0,onChange:({selectedItem:e})=>{const t="default"===e.key?void 0:n.find(t=>t.slug===e.key);s(e.value,t)},size:r})},nL=[(0,ee.__)("S"),(0,ee.__)("M"),(0,ee.__)("L"),(0,ee.__)("XL"),(0,ee.__)("XXL")],iL=[(0,ee.__)("Small"),(0,ee.__)("Medium"),(0,ee.__)("Large"),(0,ee.__)("Extra Large"),(0,ee.__)("Extra Extra Large")],rL=e=>{const{fontSizes:t,value:n,valueMode:i="literal",__next40pxDefaultSize:r,size:o,onChange:s}=e,a=(()=>{if(!n)return;if("slug"===i)return String(n);const e=t.filter(e=>e.size===n);if(e.length>1)return;const r=t.find(e=>e.size===n);return r?.slug})();return(0,Er.jsx)(Jv.A,{__next40pxDefaultSize:r,__shouldNotWarnDeprecated36pxSize:!0,label:(0,ee.__)("Font size"),hideLabelFromVision:!0,value:a,onChange:e=>{if(void 0===e)s(void 0);else{const n=t.find(t=>t.slug===String(e));n&&s(n.size,n)}},isBlock:!0,size:o,children:t.map((e,t)=>(0,Er.jsx)(bk.A,{value:e.slug,label:nL[t],"aria-label":e.name||iL[t],showTooltip:!0},e.slug))})},oL=["px","em","rem","vw","vh"],sL=(e,t)=>{const{__next40pxDefaultSize:n=!1,fallbackFontSize:i,fontSizes:r=[],disableCustomFontSizes:o=!1,onChange:s,size:a="default",units:l=oL,value:c,valueMode:u="literal",withSlider:d=!1,withReset:h=!0}=e,p=(0,SS.A)(sL,"font-size-picker-label"),f=Z_({availableUnits:l}),m=(()=>{if(c)return"slug"===u?r.find(e=>e.slug===c):r.find(e=>e.size===c)})(),g=!!c&&!m,[b,y]=(0,T.useState)(g),v="slug"===u?m?.size:c;let _;if(_=!o&&b?"custom":r.length>5?"select":"togglegroup",0===r.length&&o)return null;const x="string"==typeof v||"string"==typeof r[0]?.size,[k,w]=X_(v,f),C=!!w&&["em","rem","vw","vh"].includes(w),S=void 0===c;return(0,bx.M)({componentName:"FontSizePicker",__next40pxDefaultSize:n,size:a}),(0,Er.jsxs)(YO,{ref:t,className:"components-font-size-picker","aria-labelledby":p,children:[(0,Er.jsx)($I.A,{children:(0,Er.jsxs)(JO,{className:"components-font-size-picker__header",children:[(0,Er.jsx)(ZO,{id:p,children:(0,ee.__)("Font size")}),!o&&(0,Er.jsx)(XO,{label:"custom"===_?(0,ee.__)("Use size preset"):(0,ee.__)("Set custom size"),icon:CR.A,onClick:()=>y(!b),isPressed:"custom"===_,size:"small"})]})}),(0,Er.jsxs)("div",{children:["select"===_&&(0,Er.jsx)(tL,{__next40pxDefaultSize:n,fontSizes:r,value:c,valueMode:u,disableCustomFontSizes:o,size:a,onChange:(e,t)=>{s?.(void 0===e?void 0:x?e:Number(e),t)},onSelectCustom:()=>y(!0)}),"togglegroup"===_&&(0,Er.jsx)(rL,{fontSizes:r,value:c,valueMode:u,__next40pxDefaultSize:n,size:a,onChange:(e,t)=>{s?.(void 0===e?void 0:x?e:Number(e),t)}}),"custom"===_&&(0,Er.jsxs)(Kv.A,{className:"components-font-size-picker__custom-size-control",children:[(0,Er.jsx)(Yv.A,{isBlock:!0,children:(0,Er.jsx)(vx,{__next40pxDefaultSize:n,__shouldNotWarnDeprecated36pxSize:!0,label:(0,ee.__)("Font size"),labelPosition:"top",hideLabelFromVision:!0,value:x?`${k??""}${w??""}`:v,onChange:e=>{y(!0),s?.(void 0===e||""===e?void 0:x?e:parseInt(e,10))},size:a,units:x?f:[],min:0})}),d&&(0,Er.jsx)(Yv.A,{isBlock:!0,children:(0,Er.jsx)($I.A,{marginX:2,marginBottom:0,children:(0,Er.jsx)(gk.A,{__next40pxDefaultSize:n,__shouldNotWarnDeprecated36pxSize:!0,className:"components-font-size-picker__custom-input",label:(0,ee.__)("Font size"),hideLabelFromVision:!0,value:k,initialPosition:i,withInputField:!1,onChange:e=>{y(!0),s?.(void 0===e?void 0:x?e+(w??"px"):e)},min:0,max:C?10:100,step:C?.1:1})})}),h&&(0,Er.jsx)(Yv.A,{children:(0,Er.jsx)(fv.$n,{disabled:S,accessibleWhenDisabled:!0,onClick:()=>{s?.(void 0)},variant:"secondary",__next40pxDefaultSize:!0,size:"__unstable-large"===a||e.__next40pxDefaultSize?"default":"small",children:(0,ee.__)("Reset")})})]})]})]})},aL=(0,T.forwardRef)(sL);aL.displayName="FontSizePicker";var lL=aL;function cL({__next40pxDefaultSize:e=!1,value:t="",onChange:n,fontFamilies:i,className:r,...o}){const[s]=tv("typography.fontFamilies");if(i||(i=s),!i||0===i.length)return null;const a=[{key:"",name:(0,ee.__)("Default")},...i.map(({fontFamily:e,name:t})=>({key:e,name:t||e,style:{fontFamily:e}}))];e||void 0!==o.size&&"default"!==o.size||(0,Qt.A)("36px default size for wp.blockEditor.__experimentalFontFamilyControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."});const l=a.find(e=>e.key===t)??"";return(0,Er.jsx)(wR,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,label:(0,ee.__)("Font"),value:l,onChange:({selectedItem:e})=>n(e.key),options:a,className:(0,mh.A)("block-editor-font-family-control",r),...o})}function uL(e){if(!e)return{};if("object"==typeof e)return e;let t;switch(e){case"normal":case"400":t=(0,ee._x)("Regular","font weight");break;case"bold":case"700":t=(0,ee._x)("Bold","font weight");break;case"100":t=(0,ee._x)("Thin","font weight");break;case"200":t=(0,ee._x)("Extra Light","font weight");break;case"300":t=(0,ee._x)("Light","font weight");break;case"500":t=(0,ee._x)("Medium","font weight");break;case"600":t=(0,ee._x)("Semi Bold","font weight");break;case"800":t=(0,ee._x)("Extra Bold","font weight");break;case"900":t=(0,ee._x)("Black","font weight");break;case"1000":t=(0,ee._x)("Extra Black","font weight");break;default:t=e}return{name:t,value:e}}var dL=[{name:(0,ee._x)("Regular","font style"),value:"normal"},{name:(0,ee._x)("Italic","font style"),value:"italic"}],hL=[{name:(0,ee._x)("Thin","font weight"),value:"100"},{name:(0,ee._x)("Extra Light","font weight"),value:"200"},{name:(0,ee._x)("Light","font weight"),value:"300"},{name:(0,ee._x)("Regular","font weight"),value:"400"},{name:(0,ee._x)("Medium","font weight"),value:"500"},{name:(0,ee._x)("Semi Bold","font weight"),value:"600"},{name:(0,ee._x)("Bold","font weight"),value:"700"},{name:(0,ee._x)("Extra Bold","font weight"),value:"800"},{name:(0,ee._x)("Black","font weight"),value:"900"},{name:(0,ee._x)("Extra Black","font weight"),value:"1000"}];function pL(e){let t=[],n=[];const i=[],r=!e||0===e?.length;let o=!1;return e?.forEach(e=>{if("string"==typeof e.fontWeight&&/\s/.test(e.fontWeight.trim())){o=!0;let[t,i]=e.fontWeight.split(" ");t=parseInt(t.slice(0,1)),i="1000"===i?10:parseInt(i.slice(0,1));for(let e=t;e<=i;e++){const t=`${e.toString()}00`;n.some(e=>e.value===t)||n.push(uL(t))}}const i=uL("number"==typeof e.fontWeight?e.fontWeight.toString():e.fontWeight),r=function(e){if(!e)return{};if("object"==typeof e)return e;let t;switch(e){case"normal":t=(0,ee._x)("Regular","font style");break;case"italic":t=(0,ee._x)("Italic","font style");break;case"oblique":t=(0,ee._x)("Oblique","font style");break;default:t=e}return{name:t,value:e}}(e.fontStyle);r&&Object.keys(r).length&&(t.some(e=>e.value===r.value)||t.push(r)),i&&Object.keys(i).length&&(n.some(e=>e.value===i.value)||o||n.push(i))}),n.some(e=>e.value>="600")||n.push({name:(0,ee._x)("Bold","font weight"),value:"700"}),t.some(e=>"italic"===e.value)||t.push({name:(0,ee._x)("Italic","font style"),value:"italic"}),r&&(t=dL,n=hL),t=0===t.length?dL:t,n=0===n.length?hL:n,t.forEach(({name:e,value:t})=>{n.forEach(({name:n,value:r})=>{const o="normal"===t?n:(0,ee.sprintf)((0,ee._x)("%1$s %2$s","font"),n,e);i.push({key:`${t}-${r}`,name:o,style:{fontStyle:t,fontWeight:r}})})}),{fontStyles:t,fontWeights:n,combinedStyleAndWeightOptions:i,isSystemFont:r,isVariableFont:o}}function fL(e){const{__next40pxDefaultSize:t=!1,onChange:n,hasFontStyles:i=!0,hasFontWeights:r=!0,fontFamilyFaces:o,value:{fontStyle:s,fontWeight:a},...l}=e,c=i||r,u=((e,t)=>e?t?(0,ee.__)("Appearance"):(0,ee.__)("Font style"):(0,ee.__)("Font weight"))(i,r),d={key:"default",name:(0,ee.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},{fontStyles:h,fontWeights:p,combinedStyleAndWeightOptions:f}=pL(o),m=(0,T.useMemo)(()=>i&&r?(()=>{const e=[d];return f&&e.push(...f),e})():i?(()=>{const e=[d];return h.forEach(({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:n,fontWeight:void 0}})}),e})():(()=>{const e=[d];return p.forEach(({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:void 0,fontWeight:n}})}),e})(),[e.options,h,p,f]),g=m.find(e=>e.style.fontStyle===s&&e.style.fontWeight===a)||m[0];return t||void 0!==l.size&&"default"!==l.size||(0,Qt.A)("36px default size for wp.blockEditor.__experimentalFontAppearanceControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),c&&(0,Er.jsx)(wR,{...l,className:"components-font-appearance-control",__next40pxDefaultSize:t,__shouldNotWarnDeprecated36pxSize:!0,label:u,describedBy:g?i?r?(0,ee.sprintf)((0,ee.__)("Currently selected font appearance: %s"),g.name):(0,ee.sprintf)((0,ee.__)("Currently selected font style: %s"),g.name):(0,ee.sprintf)((0,ee.__)("Currently selected font weight: %s"),g.name):(0,ee.__)("No selected font appearance"),options:m,value:g,onChange:({selectedItem:e})=>n(e.style)})}var mL=({__next40pxDefaultSize:e=!1,value:t,onChange:n,__unstableInputWidth:i="60px",...r})=>{const o=function(e){return void 0!==e&&""!==e}(t),s=(e,t)=>{if(o)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=o?t:"";return e||void 0!==r.size&&"default"!==r.size||(0,Qt.A)("36px default size for wp.blockEditor.LineHeightControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),(0,Er.jsx)("div",{className:"block-editor-line-height-control",children:(0,Er.jsx)(ox.A,{...r,__shouldNotWarnDeprecated36pxSize:!0,__next40pxDefaultSize:e,__unstableInputWidth:i,__unstableStateReducer:(e,t)=>{const n=["insertText","insertFromPaste"].includes(t.payload.event.nativeEvent?.inputType),i=s(e.value,n);return{...e,value:i}},onChange:(e,{event:t})=>{""!==e?"click"!==t.type?n(`${e}`):n(s(`${e}`,!1)):n()},label:(0,ee.__)("Line height"),placeholder:1.5,step:.01,spinFactor:10,value:a,min:0,spinControls:"custom"})})};function gL({__next40pxDefaultSize:e=!1,value:t,onChange:n,__unstableInputWidth:i="60px",...r}){const[o]=tv("spacing.units"),s=Z_({availableUnits:o||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return e||void 0!==r.size&&"default"!==r.size||(0,Qt.A)("36px default size for wp.blockEditor.__experimentalLetterSpacingControl",{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."}),(0,Er.jsx)(vx,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,...r,label:(0,ee.__)("Letter spacing"),value:t,__unstableInputWidth:i,units:s,onChange:n})}var bL=n(3954),yL=n(65598),vL=n(66317),_L=n(67567),xL=[{label:(0,ee.__)("Align text left"),value:"left",icon:bL.A},{label:(0,ee.__)("Align text center"),value:"center",icon:yL.A},{label:(0,ee.__)("Align text right"),value:"right",icon:vL.A},{label:(0,ee.__)("Justify text"),value:"justify",icon:_L.A}],kL=["left","center","right"];function wL({className:e,value:t,onChange:n,options:i=kL}){const r=(0,T.useMemo)(()=>xL.filter(e=>i.includes(e.value)),[i]);return r.length?(0,Er.jsx)(Jv.A,{isDeselectable:!0,__next40pxDefaultSize:!0,label:(0,ee.__)("Text alignment"),className:(0,mh.A)("block-editor-text-alignment-control",e),value:t,onChange:e=>{n(e===t?void 0:e)},children:r.map(e=>(0,Er.jsx)(Xv.A,{value:e.value,icon:e.icon,label:e.label},e.value))}):null}var CL=n(92303),SL=n(18812),AL=n(60583),IL=[{label:(0,ee.__)("None"),value:"none",icon:uS.A},{label:(0,ee.__)("Uppercase"),value:"uppercase",icon:CL.A},{label:(0,ee.__)("Lowercase"),value:"lowercase",icon:SL.A},{label:(0,ee.__)("Capitalize"),value:"capitalize",icon:AL.A}];function EL({className:e,value:t,onChange:n}){return(0,Er.jsx)(Jv.A,{isDeselectable:!0,__next40pxDefaultSize:!0,label:(0,ee.__)("Letter case"),className:(0,mh.A)("block-editor-text-transform-control",e),value:t,onChange:e=>{n(e===t?void 0:e)},children:IL.map(e=>(0,Er.jsx)(Xv.A,{value:e.value,icon:e.icon,label:e.label},e.value))})}var jL=n(56603),TL=n(59850),BL=[{label:(0,ee.__)("None"),value:"none",icon:uS.A},{label:(0,ee.__)("Underline"),value:"underline",icon:jL.A},{label:(0,ee.__)("Strikethrough"),value:"line-through",icon:TL.A}];function NL({value:e,onChange:t,className:n}){return(0,Er.jsx)(Jv.A,{isDeselectable:!0,__next40pxDefaultSize:!0,label:(0,ee.__)("Decoration"),className:(0,mh.A)("block-editor-text-decoration-control",n),value:e,onChange:n=>{t(n===e?void 0:n)},children:BL.map(e=>(0,Er.jsx)(Xv.A,{value:e.value,icon:e.icon,label:e.label},e.value))})}function RL({__next40pxDefaultSize:e=!1,value:t,onChange:n,__unstableInputWidth:i="60px",withSlider:r=!1,hasBottomMargin:o=!1,help:s,...a}){const[l]=tv("spacing.units"),c=Z_({availableUnits:l||["px","em","rem","ch","%","vw","vh"],defaultValues:{px:16,em:2,rem:2,ch:2}}),[u,d]=X_(t,c),h=!!d&&["em","rem","%","ch","vw","vh"].includes(d);return r?(0,Er.jsxs)(qw.A,{style:o?{marginBottom:12}:void 0,children:[(0,Er.jsx)(mk.Ay.VisualLabel,{children:(0,ee.__)("Line indent")}),(0,Er.jsxs)(Kv.A,{children:[(0,Er.jsx)(Yv.A,{isBlock:!0,children:(0,Er.jsx)(vx,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,label:(0,ee.__)("Line indent"),labelPosition:"top",hideLabelFromVision:!0,value:t,onChange:n,size:a.size,units:c,__unstableInputWidth:i,min:0})}),r&&(0,Er.jsx)(Yv.A,{isBlock:!0,children:(0,Er.jsx)($I.A,{marginX:2,marginBottom:0,children:(0,Er.jsx)(gk.A,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,label:(0,ee.__)("Line indent"),hideLabelFromVision:!0,value:u,withInputField:!1,onChange:e=>{n?.(void 0===e?void 0:e+(d??"px"))},min:0,max:h?10:100,step:h?.1:1,initialPosition:0})})})]}),s&&(0,Er.jsx)("p",{className:"components-base-control__help",children:s})]}):(0,Er.jsx)(vx,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,...a,label:(0,ee.__)("Line indent"),value:t,__unstableInputWidth:i,units:c,onChange:n,help:s})}var OL=n(79897),LL=n(22931),ML=[{label:(0,ee.__)("Horizontal"),value:"horizontal-tb",icon:OL.A},{label:(0,ee.__)("Vertical"),value:(0,ee.isRTL)()?"vertical-lr":"vertical-rl",icon:LL.A}];function PL({className:e,value:t,onChange:n}){return(0,Er.jsx)(Jv.A,{isDeselectable:!0,__next40pxDefaultSize:!0,label:(0,ee.__)("Orientation"),className:(0,mh.A)("block-editor-writing-mode-control",e),value:t,onChange:e=>{n(e===t?void 0:e)},children:ML.map(e=>(0,Er.jsx)(Xv.A,{value:e.value,icon:e.icon,label:e.label},e.value))})}function DL(e,t){if(!(t="number"==typeof t?t.toString():t)||"string"!=typeof t)return"";if(!e||0===e.length)return t;const n=e?.reduce((e,{value:n})=>Math.abs(parseInt(n)-parseInt(t))e?.typography?.fontFamilies?.[t]?.length)}function UL(e){return e?.typography?.lineHeight}function $L(e){return e?.typography?.fontStyle||e?.typography?.fontWeight}function HL(e){return e?.typography?.letterSpacing}function WL(e){return e?.typography?.textTransform}function GL(e){return e?.typography?.textAlign}function qL(e){return e?.typography?.textDecoration}function KL(e){return e?.typography?.writingMode}function YL(e){return e?.typography?.textColumns}function JL(e){return e?.typography?.textIndent}function XL({resetAllFilter:e,onChange:t,value:n,panelId:i,children:r}){const o=Zw();return(0,Er.jsx)(Xw,{label:(0,ee.__)("Typography"),resetAll:()=>{const i=e(n);t(i)},panelId:i,dropdownMenuProps:o,children:r})}var ZL={fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!0,textAlign:!0,textTransform:!0,textDecoration:!0,textIndent:!0,writingMode:!0,textColumns:!0};function QL({as:e=XL,value:t,onChange:n,inheritedValue:i=t,settings:r,panelId:o,defaultControls:s=ZL,isGlobalStyles:a=!1}){const l=e=>vC({settings:r},"",e),c=VL(r),u=l(i?.typography?.fontFamily),{fontFamilies:d,fontFamilyFaces:h}=(0,T.useMemo)(()=>function(e,t){const n=e?.typography?.fontFamilies,i=["default","theme","custom"].flatMap(e=>n?.[e]??[]),r=i.find(e=>e.fontFamily===t)?.fontFace??[];return{fontFamilies:i,fontFamilyFaces:r}}(r,u),[r,u]),p=e=>{const i=d?.find(({fontFamily:t})=>t===e)?.slug;let r=_p(t,["typography","fontFamily"],i?`var:preset|font-family|${i}`:e||void 0);const o=d?.find(({fontFamily:t})=>t===e)?.fontFace??[],{fontStyles:s,fontWeights:a}=pL(o),l=s?.some(({value:e})=>e===C),c=a?.some(({value:e})=>e?.toString()===S?.toString());if(!l||!c){const{nearestFontStyle:e,nearestFontWeight:t}=function(e,t,n){let i=t,r=n;const{fontStyles:o,fontWeights:s,combinedStyleAndWeightOptions:a}=pL(e),l=o?.some(({value:e})=>e===t),c=s?.some(({value:e})=>e?.toString()===n?.toString());var u,d;return l||(i=t?(u=o,"string"==typeof(d=t)&&d&&["normal","italic","oblique"].includes(d)?!u||0===u.length||u.find(e=>e.value===d)?d:"oblique"!==d||u.find(e=>"oblique"===e.value)?"":"italic":""):a?.find(e=>e.style.fontWeight===DL(s,n))?.style?.fontStyle),c||(r=n?DL(s,n):a?.find(e=>e.style.fontStyle===(i||t))?.style?.fontWeight),{nearestFontStyle:i,nearestFontWeight:r}}(o,C,S);e||t?r={...r,typography:{...r?.typography,fontStyle:e||void 0,fontWeight:t||void 0}}:(C||S)&&(r={...r,typography:{...r?.typography,fontStyle:void 0,fontWeight:void 0}})}n(r)},f=zL(r),m=!r?.typography?.customFontSize,g=function(e){const t=e?.typography?.fontSizes,n=!!e?.typography?.defaultFontSizes;return[...t?.custom??[],...t?.theme??[],...n?t?.default??[]:[]]}(r),b=l(i?.typography?.fontSize),y=(()=>{const e=i?.typography?.fontSize;if(!e||"string"!=typeof e)return;if(e.startsWith("var:preset|font-size|"))return e.replace("var:preset|font-size|","");const t=e.match(/^var\(--wp--preset--font-size--([^)]+)\)$/);return t?t[1]:void 0})(),v=(e,i)=>{n(_p(t,["typography","fontSize"],(i?.slug?`var:preset|font-size|${i?.slug}`:e)||void 0))},_=$L(r),x=function(e){return e?.typography?.fontStyle?e?.typography?.fontWeight?(0,ee.__)("Appearance"):(0,ee.__)("Font style"):(0,ee.__)("Font weight")}(r),k=r?.typography?.fontStyle,w=r?.typography?.fontWeight,C=l(i?.typography?.fontStyle),S=l(i?.typography?.fontWeight),A=(0,T.useCallback)(({fontStyle:e,fontWeight:i})=>{e===C&&i===S||n({...t,typography:{...t?.typography,fontStyle:e||void 0,fontWeight:i||void 0}})},[C,S,n,t]),I=(0,T.useCallback)(()=>{A({})},[A]),E=UL(r),j=l(i?.typography?.lineHeight),B=e=>{n(_p(t,["typography","lineHeight"],e||void 0))},N=HL(r),R=l(i?.typography?.letterSpacing),O=e=>{n(_p(t,["typography","letterSpacing"],e||void 0))},L=JL(r),M=l(i?.typography?.textIndent),P="all"===(r?.typography?.textIndent??"subsequent"),D=P?(0,ee.__)("Indents the first line of all paragraphs."):(0,ee.__)("Indents the first line of each paragraph after the first one."),F=YL(r),z=l(i?.typography?.textColumns),V=e=>{n(_p(t,["typography","textColumns"],e||void 0))},U=WL(r),$=l(i?.typography?.textTransform),H=e=>{n(_p(t,["typography","textTransform"],e||void 0))},W=qL(r),G=l(i?.typography?.textDecoration),q=e=>{n(_p(t,["typography","textDecoration"],e||void 0))},K=KL(r),Y=l(i?.typography?.writingMode),J=e=>{n(_p(t,["typography","writingMode"],e||void 0))},X=GL(r),Z=l(i?.typography?.textAlign),Q=e=>{n(_p(t,["typography","textAlign"],e||void 0))},te=(0,T.useCallback)(e=>({...e,typography:{}}),[]);return(0,Er.jsxs)(e,{resetAllFilter:te,value:t,onChange:n,panelId:o,children:[c&&(0,Er.jsx)(aC,{label:(0,ee.__)("Font"),hasValue:()=>!!t?.typography?.fontFamily,onDeselect:()=>p(void 0),isShownByDefault:s.fontFamily,panelId:o,children:(0,Er.jsx)(cL,{fontFamilies:d,value:u,onChange:p,size:"__unstable-large"})}),f&&(0,Er.jsx)(aC,{label:(0,ee.__)("Size"),hasValue:()=>!!t?.typography?.fontSize,onDeselect:()=>v(void 0),isShownByDefault:s.fontSize,panelId:o,children:(0,Er.jsx)(lL,{value:y||b,valueMode:y?"slug":"literal",onChange:v,fontSizes:g,disableCustomFontSizes:m,withReset:!1,withSlider:!0,size:"__unstable-large"})}),_&&(0,Er.jsx)(aC,{label:x,hasValue:()=>!!t?.typography?.fontStyle||!!t?.typography?.fontWeight,onDeselect:I,isShownByDefault:s.fontAppearance,panelId:o,children:(0,Er.jsx)(fL,{value:{fontStyle:C,fontWeight:S},onChange:A,hasFontStyles:k,hasFontWeights:w,fontFamilyFaces:h,size:"__unstable-large"})}),E&&(0,Er.jsx)(aC,{className:"single-column",label:(0,ee.__)("Line height"),hasValue:()=>void 0!==t?.typography?.lineHeight,onDeselect:()=>B(void 0),isShownByDefault:s.lineHeight,panelId:o,children:(0,Er.jsx)(mL,{__unstableInputWidth:"auto",value:j,onChange:B,size:"__unstable-large"})}),N&&(0,Er.jsx)(aC,{className:"single-column",label:(0,ee.__)("Letter spacing"),hasValue:()=>!!t?.typography?.letterSpacing,onDeselect:()=>O(void 0),isShownByDefault:s.letterSpacing,panelId:o,children:(0,Er.jsx)(gL,{value:R,onChange:O,size:"__unstable-large",__unstableInputWidth:"auto"})}),L&&(0,Er.jsxs)(aC,{label:(0,ee.__)("Line indent"),hasValue:()=>!!t?.typography?.textIndent,onDeselect:()=>{n(_p(t,["typography","textIndent"],void 0))},isShownByDefault:s.textIndent,panelId:o,children:[(0,Er.jsx)(RL,{value:M,onChange:e=>{n(_p(t,["typography","textIndent"],e||void 0))},size:"__unstable-large",__unstableInputWidth:"auto",withSlider:!0,hasBottomMargin:a}),a&&(0,Er.jsx)(Zv.A,{label:(0,ee.__)("Indent all paragraphs"),checked:P,onChange:e=>{n({...t,settings:{typography:{textIndent:e?"all":"subsequent"}}})},help:D})]}),F&&(0,Er.jsx)(aC,{className:"single-column",label:(0,ee.__)("Columns"),hasValue:()=>!!t?.typography?.textColumns,onDeselect:()=>V(void 0),isShownByDefault:s.textColumns,panelId:o,children:(0,Er.jsx)(ox.A,{label:(0,ee.__)("Columns"),max:6,min:1,onChange:V,size:"__unstable-large",spinControls:"custom",value:z,initialPosition:1})}),W&&(0,Er.jsx)(aC,{className:"single-column",label:(0,ee.__)("Decoration"),hasValue:()=>!!t?.typography?.textDecoration,onDeselect:()=>q(void 0),isShownByDefault:s.textDecoration,panelId:o,children:(0,Er.jsx)(NL,{value:G,onChange:q,size:"__unstable-large",__unstableInputWidth:"auto"})}),K&&(0,Er.jsx)(aC,{className:"single-column",label:(0,ee.__)("Orientation"),hasValue:()=>!!t?.typography?.writingMode,onDeselect:()=>J(void 0),isShownByDefault:s.writingMode,panelId:o,children:(0,Er.jsx)(PL,{value:Y,onChange:J,size:"__unstable-large"})}),U&&(0,Er.jsx)(aC,{label:(0,ee.__)("Letter case"),hasValue:()=>!!t?.typography?.textTransform,onDeselect:()=>H(void 0),isShownByDefault:s.textTransform,panelId:o,children:(0,Er.jsx)(EL,{value:$,onChange:H,showNone:!0,isBlock:!0,size:"__unstable-large"})}),X&&(0,Er.jsxs)(aC,{label:(0,ee.__)("Text alignment"),hasValue:()=>!!t?.typography?.textAlign,onDeselect:()=>Q(void 0),isShownByDefault:s.textAlign,panelId:o,children:[(0,Er.jsx)(wL,{value:Z,onChange:Q,options:["left","center","right","justify"],size:"__unstable-large"}),"justify"===Z&&(0,Er.jsx)("div",{children:(0,Er.jsx)(wS.A,{status:"warning",isDismissible:!1,children:(0,ee.__)("Justified text can reduce readability. For better accessibility, use left-aligned text instead.")})})]})]})}var eM=class{_currentValue;_valueAsArray;constructor(e=""){this._currentValue="",this._valueAsArray=[],this.value=e}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(e){return!0}},tM="typography.__experimentalFontFamily",{kebabCase:nM}=Gh(Ev.j);function iM(e,t,n){if(!_n(t,tM))return e;if(av(t,TM,"fontFamily"))return e;if(!n?.fontFamily)return e;const i=new eM(e.className);i.add(`has-${nM(n?.fontFamily)}-font-family`);const r=i.value;return e.className=r||void 0,e}var rM={useBlockProps:function({name:e,fontFamily:t}){return iM({},e,{fontFamily:t})},addSaveProps:iM,attributeKeys:["fontFamily"],hasSupport:e=>_n(e,tM)};(0,Ei.U2)("blocks.registerBlockType","core/fontFamily/addAttribute",function(e){return _n(e,tM)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e});var{kebabCase:oM}=Gh(Ev.j),sM=(e,t,n)=>{if(t){const n=e?.find(({slug:e})=>e===t);if(n)return n}return{size:n}};function aM(e){if(e)return`has-${oM(e)}-font-size`}var lM="typography.fontSize";function cM(e,t,n){if(!_n(t,lM))return e;if(av(t,TM,"fontSize"))return e;const i=new eM(e.className);i.add(aM(n.fontSize));const r=i.value;return e.className=r||void 0,e}var uM={useBlockProps:function({name:e,fontSize:t,style:n}){const[i,r,o]=tv("typography.fontSizes","typography.fluid","layout");if(!_n(e,lM)||av(e,TM,"fontSize")||!t&&!n?.typography?.fontSize)return;let s;return n?.typography?.fontSize&&(s={style:{fontSize:dC({size:n.typography.fontSize},{typography:{fluid:r},layout:o})}}),t&&(s={style:{fontSize:sM(i,t,n?.typography?.fontSize).size}}),s?cM(s,e,{fontSize:t}):void 0},addSaveProps:cM,attributeKeys:["fontSize","style"],hasSupport:e=>_n(e,lM)},dM={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,Ei.U2)("blocks.registerBlockType","core/font/addAttribute",function(e){return _n(e,lM)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e}),(0,Ei.U2)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",function(e,t,n,i){return sv({fontSize:_n(e.name,lM)},dM,e,t,n,i)});var hM=[{icon:bL.A,title:(0,ee.__)("Align text left"),align:"left"},{icon:yL.A,title:(0,ee.__)("Align text center"),align:"center"},{icon:vL.A,title:(0,ee.__)("Align text right"),align:"right"}],pM={placement:"bottom-start"},fM=function({value:e,onChange:t,alignmentControls:n=hM,label:i=(0,ee.__)("Align text"),description:r=(0,ee.__)("Change text alignment"),isCollapsed:o=!0,isToolbar:s}){function a(n){return()=>t(e===n?void 0:n)}const l=n.find(t=>t.align===e),c=s?wv:Dv,u=s?{isCollapsed:o}:{toggleProps:{description:r},popoverProps:pM};return(0,Er.jsx)(c,{icon:l?l.icon:(0,ee.isRTL)()?vL.A:bL.A,label:i,controls:n.map(t=>{const{align:n}=t,i=e===n;return{...t,isActive:i,role:o?"menuitemradio":void 0,onClick:a(n)}}),...u})},mM=e=>(0,Er.jsx)(fM,{...e,isToolbar:!1}),gM="typography.textAlign",bM=[{icon:bL.A,title:(0,ee.__)("Align text left"),align:"left"},{icon:yL.A,title:(0,ee.__)("Align text center"),align:"center"},{icon:vL.A,title:(0,ee.__)("Align text right"),align:"right"}],yM=["left","center","right"],vM=[];function _M(e){return Array.isArray(e)?yM.filter(t=>e.includes(t)):!0===e?yM:vM}var xM={edit:function({style:e,name:t,setAttributes:n}){const i=dv(t),r=i?.typography?.textAlign,o=Vk();if(!r||"default"!==o)return null;const s=_M(vn(t,gM));if(!s.length)return null;const a=bM.filter(e=>s.includes(e.align));return(0,Er.jsx)(Mv,{group:"block",children:(0,Er.jsx)(mM,{value:e?.typography?.textAlign,onChange:t=>{const i={...e,typography:{...e?.typography,textAlign:t}};n({style:ov(i)})},alignmentControls:a})})},useBlockProps:function({name:e,style:t}){if(!t?.typography?.textAlign)return null;if(!_M(vn(e,gM)).length)return null;if(av(e,TM,"textAlign"))return null;const n=t.typography.textAlign;return{className:(0,mh.A)({[`has-text-align-${n}`]:n})}},addSaveProps:function(e,t,n){if(!n?.style?.typography?.textAlign)return e;const{textAlign:i}=n.style.typography;return _M(vn(t,gM)).includes(i)&&!av(t,TM,"textAlign")&&(e.className=(0,mh.A)(`has-text-align-${i}`,e.className)),e},attributeKeys:["style"],hasSupport:e=>_n(e,gM,!1)};function kM(){const e=(0,ee.__)("The text may be too small to read. Consider using a larger container or less text.");return(0,T.useEffect)(()=>{(0,dt.L)(e)},[e]),(0,Er.jsx)("div",{className:"block-editor-fit-text-size-warning",children:(0,Er.jsx)(wS.A,{spokenMessage:null,status:"warning",isDismissible:!1,children:e})})}var wM={},CM="typography.fitText";function SM({clientId:e,fitText:t=!1,setAttributes:n,name:i,fontSize:r,style:o}){return _n(i,CM)?(0,Er.jsx)(aC,{hasValue:()=>t,label:(0,ee.__)("Fit text"),onDeselect:()=>n({fitText:void 0}),resetAllFilter:()=>({fitText:void 0}),panelId:e,children:(0,Er.jsx)(Zv.A,{label:(0,ee.__)("Fit text"),checked:t,onChange:()=>{const e=!t||void 0,i={fitText:e};e&&(r&&(i.fontSize=void 0),o?.typography?.fontSize&&(i.style={...o,typography:{...o?.typography,fontSize:void 0}})),n(i)},help:t?(0,ee.__)("Text will resize to fit its container."):(0,ee.__)("The text will resize to fit its container, resetting other font size settings.")})}):null}function AM({fitText:e,name:t,clientId:n,isSelected:i}){const{fontSize:r}=function({fitText:e,name:t,clientId:n}){const[i,r]=(0,T.useState)(null),o=_n(t,CM),s=BO(n),{blockAttributes:a,parentId:l,blockMode:c}=(0,zt.A)(t=>{if(!n||!o||!e)return wM;const i=t(Qy).getBlockMode(n);return"html"===i?{blockMode:i}:{blockAttributes:t(Qy).getBlockAttributes(n),parentId:t(Qy).getBlockRootClientId(n),blockMode:i}},[n,o,e]),u=(0,T.useCallback)(()=>{if(!s||!o||!e)return;const t=`fit-text-${n}`;let i=s.ownerDocument.getElementById(t);i||(i=s.ownerDocument.createElement("style"),i.id=t,s.ownerDocument.head.appendChild(i));const a=`#block-${n}`,l=function(e,t){if(!e)return;t(0);const n=function(e,t){const n=e.scrollHeight>e.clientHeight;let i=0,r=2400,o=i;const s=window.getComputedStyle(e);let a=parseFloat(s.paddingLeft)||0,l=parseFloat(s.paddingRight)||0;const c=document.createRange();c.selectNodeContents(e);let u=e;const d=e.parentElement;if(d){const e=window.getComputedStyle(d);"flex"===e?.display&&(u=d,a+=parseFloat(e.paddingLeft)||0,l+=parseFloat(e.paddingRight)||0)}let h=u.clientHeight;for(;i<=r;){const s=Math.floor((i+r)/2);t(s);const d=c.getBoundingClientRect().width,p=e.scrollWidth<=u.clientWidth&&d<=u.clientWidth-a-l,f=n||e.scrollHeight<=u.clientHeight||e.scrollHeight<=h;u.clientHeight>h&&(h=u.clientHeight),p&&f?(o=s,i=s+1):r=s-1}return c.detach(),o}(e,t);return t(n),n}(s,e=>{i.textContent=0===e?"":`${a} { font-size: ${e}px !important; }`});r(l)},[s,n,o,e]);return(0,T.useEffect)(()=>{if(!(e&&s&&n&&o&&"html"!==c))return;const t=s,i=t.style.visibility;let r,a=null,l=null,d=null;return a=window.requestAnimationFrame(()=>{t.style.visibility="hidden",l=window.requestAnimationFrame(()=>{u(),d=setTimeout(()=>{t.style.visibility=i},10)})}),window.ResizeObserver&&t.parentElement&&(r=new window.ResizeObserver(u),r.observe(t.parentElement),r.observe(t)),()=>{null!==a&&window.cancelAnimationFrame(a),null!==l&&window.cancelAnimationFrame(l),null!==d&&clearTimeout(d),r&&r.disconnect();const e=`fit-text-${n}`,i=t.ownerDocument.getElementById(e);i&&i.remove()}},[e,n,l,u,s,o,c]),(0,T.useEffect)(()=>{if(e&&s&&o&&"html"!==c){const e=window.requestAnimationFrame(()=>{s&&u()});return()=>window.cancelAnimationFrame(e)}},[a,e,u,s,o,c]),{fontSize:i}}({fitText:e,name:t,clientId:n});return i&&r&&r<12?(0,Er.jsx)(oC,{group:"typography",children:(0,Er.jsx)(kM,{})}):null}(0,Ei.U2)("blocks.registerBlockType","core/fit-text/addAttribute",function(e){return _n(e,CM)?e.attributes?.fitText?e:{...e,attributes:{...e.attributes,fitText:{type:"boolean"}}}:e});var IM=(0,gh.f)(e=>function(t){const{name:n,attributes:i,clientId:r,isSelected:o,setAttributes:s}=t,{fitText:a}=i;return _n(n,CM)?(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(e,{...t}),(0,Er.jsx)(oC,{group:"typography",children:(0,Er.jsx)(SM,{clientId:r,fitText:a,setAttributes:s,name:n,fontSize:i.fontSize,style:i.style})}),a&&(0,Er.jsx)(AM,{fitText:a,name:n,clientId:r,isSelected:o})]}):(0,Er.jsx)(e,{...t})},"addFitTextControl");(0,Ei.U2)("editor.BlockEdit","core/fit-text/add-fit-text-control",IM);var EM={useBlockProps:function({name:e,fitText:t}){return t&&_n(e,CM)?{className:"has-fit-text"}:{}},addSaveProps:function(e,t,n){if(!_n(t,CM))return e;const{fitText:i}=n;if(!i)return e;const r=e.className?`${e.className} has-fit-text`:"has-fit-text";return{...e,className:r}},attributeKeys:["fitText","fontSize","style"],hasSupport:e=>_n(e,CM),edit:()=>null};function jM(e,t){return Object.fromEntries(Object.entries(e).filter(([e])=>!t.includes(e)))}var TM="typography",BM=["typography.lineHeight",lM,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",tM,gM,"typography.textColumns","typography.__experimentalTextDecoration","typography.textIndent","typography.__experimentalWritingMode","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing",CM];function NM(e){const t={...jM(e,["fontFamily"])},n=e?.typography?.fontSize,i=e?.typography?.fontFamily,r="string"==typeof n&&n?.startsWith("var:preset|font-size|")?n.substring(21):void 0,o=i?.startsWith("var:preset|font-family|")?i.substring(23):void 0;return t.typography={...jM(t.typography,["fontFamily"]),fontSize:r?void 0:n},{style:ov(t),fontFamily:o,fontSize:r}}function RM(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 OM({children:e,resetAllFilter:t}){const n=(0,T.useCallback)(e=>{const n=RM(e),i=t(n);return{...e,...NM(i)}},[t]);return(0,Er.jsx)(oC,{group:"typography",resetAllFilter:n,children:e})}function LM({clientId:e,name:t,setAttributes:n,settings:i}){const r=FL(i),{style:o,fontFamily:s,fontSize:a,fitText:l}=(0,zt.A)(t=>{if(!r)return{};const{style:n,fontFamily:i,fontSize:o,fitText:s}=t(Qy).getBlockAttributes(e)||{};return{style:n,fontFamily:i,fontSize:o,fitText:s}},[e,r]),c=(0,T.useMemo)(()=>RM({style:o,fontFamily:s,fontSize:a}),[o,a,s]);if(!r)return null;const u=vn(t,[TM,"__experimentalDefaultControls"]);return(0,Er.jsx)(QL,{as:OM,panelId:e,settings:i,value:c,onChange:e=>{const t=NM(e);(t.fontSize||t.style?.typography?.fontSize)&&l&&(t.fitText=void 0),n(t)},defaultControls:u})}var MM={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}},PM={all:(0,ee.__)("All sides"),top:(0,ee.__)("Top side"),bottom:(0,ee.__)("Bottom side"),left:(0,ee.__)("Left side"),right:(0,ee.__)("Right side"),vertical:(0,ee.__)("Top and bottom sides"),horizontal:(0,ee.__)("Left and right sides")},DM={top:void 0,right:void 0,bottom:void 0,left:void 0},FM=["top","right","bottom","left"];function zM(e={},t=FM){const n=UM(t);return n.some(t=>e[t]!==e[n[0]])}function VM(e){return e&&Object.values(e).filter(e=>!!e&&/\d/.test(e)).length>0}function UM(e){const t=[];if(!e?.length)return FM;if(e.includes("vertical"))t.push("top","bottom");else if(e.includes("horizontal"))t.push("left","right");else{const n=FM.filter(t=>e.includes(t));t.push(...n)}return t}function $M(e){const t=new Set(e?[]:FM);return e?.forEach(e=>{"vertical"===e?(t.add("top"),t.add("bottom")):"horizontal"===e?(t.add("right"),t.add("left")):t.add(e)}),t}function HM(e,t){return e.startsWith(`var:preset|${t}|`)}var WM=(0,ex.A)("span",{target:"e1j5nr4z8"})({name:"1w884gc",styles:"box-sizing:border-box;display:block;width:24px;height:24px;position:relative;padding:4px"}),GM=(0,ex.A)("span",{target:"e1j5nr4z7"})({name:"i6vjox",styles:"box-sizing:border-box;display:block;position:relative;width:100%;height:100%"}),qM=({isFocused:e})=>(0,tx.AH)({backgroundColor:"currentColor",opacity:e?1:.3},"",""),KM=(0,ex.A)("span",{target:"e1j5nr4z6"})("box-sizing:border-box;display:block;pointer-events:none;position:absolute;",qM,";"),YM=(0,ex.A)(KM,{target:"e1j5nr4z5"})({name:"1k2w39q",styles:"bottom:3px;top:3px;width:2px"}),JM=(0,ex.A)(KM,{target:"e1j5nr4z4"})({name:"1q9b07k",styles:"height:2px;left:3px;right:3px"}),XM=(0,ex.A)(JM,{target:"e1j5nr4z3"})({name:"abcix4",styles:"top:0"}),ZM=(0,ex.A)(YM,{target:"e1j5nr4z2"})({name:"1wf8jf",styles:"right:0"}),QM=(0,ex.A)(JM,{target:"e1j5nr4z1"})({name:"8tapst",styles:"bottom:0"}),eP=(0,ex.A)(YM,{target:"e1j5nr4z0"})({name:"1ode3cm",styles:"left:0"});function tP({size:e=24,side:t="all",sides:n,...i}){const r=e=>!(e=>n?.length&&!n.includes(e))(e)&&("all"===t||t===e),o=r("top")||r("vertical"),s=r("right")||r("horizontal"),a=r("bottom")||r("vertical"),l=r("left")||r("horizontal"),c=e/24;return(0,Er.jsx)(WM,{style:{transform:`scale(${c})`},...i,children:(0,Er.jsxs)(GM,{children:[(0,Er.jsx)(XM,{isFocused:o}),(0,Er.jsx)(ZM,{isFocused:s}),(0,Er.jsx)(QM,{isFocused:a}),(0,Er.jsx)(eP,{isFocused:l})]})})}var nP=(0,ex.A)(vx,{target:"e1jovhle5"})({name:"1ejyr19",styles:"max-width:90px"}),iP=(0,ex.A)(Cw.A,{target:"e1jovhle4"})({name:"1j1lmoi",styles:"grid-column:1/span 3"}),rP=(0,ex.A)(fv.Ay,{target:"e1jovhle3"})({name:"tkya7b",styles:"grid-area:1/2;justify-self:end"}),oP=(0,ex.A)("div",{target:"e1jovhle2"})({name:"1dfa8al",styles:"grid-area:1/3;justify-self:end"}),sP=(0,ex.A)(tP,{target:"e1jovhle1"})({name:"ou8xsw",styles:"flex:0 0 auto"}),aP=(0,ex.A)(gk.A,{target:"e1jovhle0"})("width:100%;margin-inline-end:",(0,ax.x)(2),";"),lP=()=>{};function cP(e,t,n){const i=$M(t);let r=[];switch(e){case"all":r=["top","bottom","left","right"];break;case"horizontal":r=["left","right"];break;case"vertical":r=["top","bottom"];break;default:r=[e]}if(n)switch(e){case"top":r.push("bottom");break;case"bottom":r.push("top");break;case"left":r.push("left");break;case"right":r.push("right")}return r.filter(e=>i.has(e))}function uP({__next40pxDefaultSize:e,onChange:t=lP,onFocus:n=lP,values:i,selectedUnits:r,setSelectedUnits:o,sides:s,side:a,min:l=0,presets:c,presetKey:u,...d}){const h=cP(a,s),p=e=>{t(e)},f=(e,t)=>{const n={...i},r=void 0===e||isNaN(parseFloat(e))?void 0:e;cP(a,s,!!t?.event.altKey).forEach(e=>{n[e]=r}),p(n)},m=function(e={},t=FM){const n=UM(t);if(n.every(t=>e[t]===e[n[0]]))return e[n[0]]}(i,h),g=VM(i),b=g&&h.length>1&&zM(i,h),[y,v]=X_(m),_=g?v:r[h[0]],x=[(0,SS.A)(uP,"box-control-input"),a].join("-"),k=h.length>1&&void 0===m&&h.some(e=>r[e]!==_),w=void 0===m&&_?_:m,C=b||k?(0,ee.__)("Mixed"):void 0,S=c&&c.length>0&&u,A=S&&void 0!==m&&!b&&HM(m,u),[I,E]=(0,T.useState)(!S||!A&&!b&&void 0!==m),j=A?function(e,t,n){if(!HM(e,t))return;const i=e.match(new RegExp(`^var:preset\\|${t}\\|(.+)$`));if(!i)return;const r=i[1],o=n.findIndex(e=>e.slug===r);return-1!==o?o:void 0}(m,u,c):void 0,B=S?[{value:0,label:"",tooltip:(0,ee.__)("None")},...c.map((e,t)=>({value:t+1,label:"",tooltip:e.name??e.slug}))]:[];return(0,Er.jsxs)(iP,{expanded:!0,children:[(0,Er.jsx)(sP,{side:a,sides:s}),I&&(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(jR.Ay,{placement:"top-end",text:PM[a],children:(0,Er.jsx)(nP,{...d,min:l,__shouldNotWarnDeprecated36pxSize:!0,__next40pxDefaultSize:e,className:"component-box-control__unit-control",id:x,isPressEnterToChange:!0,disableUnits:b||k,value:w,onChange:f,onUnitChange:e=>{const t={...r};h.forEach(n=>{t[n]=e}),o(t)},onFocus:e=>{n(e,{side:a})},label:PM[a],placeholder:C,hideLabelFromVision:!0})}),(0,Er.jsx)(aP,{__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,"aria-controls":x,label:PM[a],hideLabelFromVision:!0,onChange:e=>{f(void 0!==e?[e,_].join(""):void 0)},min:isFinite(l)?l:0,max:MM[_??"px"]?.max??10,step:MM[_??"px"]?.step??.1,value:y??0,withInputField:!1})]}),S&&!I&&(0,Er.jsx)(aP,{__next40pxDefaultSize:!0,className:"spacing-sizes-control__range-control",value:void 0!==j?j+1:0,onChange:e=>{const t=0===e||void 0===e?void 0:function(e,t,n){return`var:preset|${t}|${n[e].slug}`}(e-1,u,c);(e=>{const t={...i};h.forEach(n=>{t[n]=e}),p(t)})(t)},withInputField:!1,"aria-valuenow":void 0!==j?j+1:0,"aria-valuetext":B[void 0!==j?j+1:0].tooltip,renderTooltipContent:e=>B[e||0].tooltip,min:0,max:B.length-1,marks:B,label:PM[a],hideLabelFromVision:!0}),S&&(0,Er.jsx)(fv.Ay,{label:I?(0,ee.__)("Use size preset"):(0,ee.__)("Set custom size"),icon:CR.A,onClick:()=>{E(!I)},isPressed:I,size:"small",iconSize:24})]},`box-control-${a}`)}function dP({isLinked:e,...t}){const n=e?(0,ee.__)("Unlink sides"):(0,ee.__)("Link sides");return(0,Er.jsx)(fv.Ay,{...t,className:"component-box-control__linked-button",size:"small",icon:e?fB.A:IS.A,iconSize:24,label:n})}var hP={min:0},pP=()=>{};var fP=function e({__next40pxDefaultSize:t=!1,id:n,inputProps:i=hP,onChange:r=pP,label:o=(0,ee.__)("Box Control"),values:s,units:a,sides:l,splitOnAxis:c=!1,allowReset:u=!0,resetValues:d=DM,presets:h,presetKey:p,onMouseOver:f,onMouseOut:m}){const[g,b]=(0,fx.A)(s,{fallback:DM}),y=g||DM,v=VM(s),_=1===l?.length,[x,k]=(0,T.useState)(v),[w,C]=(0,T.useState)(!v||!zM(y)||_),[S,A]=(0,T.useState)({top:X_(s?.top)[1],right:X_(s?.right)[1],bottom:X_(s?.bottom)[1],left:X_(s?.left)[1]}),I=function(t){const n=(0,SS.A)(e,"inspector-box-control");return t||n}(n),E=`${I}-heading`,j={onMouseOver:f,onMouseOut:m,...i,onChange:e=>{r(e),b(e),k(!0)},isLinked:w,units:a,selectedUnits:S,setSelectedUnits:A,sides:l,values:y,__next40pxDefaultSize:t,presets:h,presetKey:p};(0,bx.M)({componentName:"BoxControl",__next40pxDefaultSize:t,size:void 0});const B=$M(l);if(h&&!p||!h&&p){const e=h?"presets":"presetKey",t=h?"presetKey":"presets";!0===globalThis.SCRIPT_DEBUG&&(0,sn.A)(`wp.components.BoxControl: the '${t}' prop is required when the '${e}' prop is defined.`)}return(0,Er.jsxs)(Jw,{id:I,columns:3,templateColumns:"1fr min-content min-content",role:"group","aria-labelledby":E,children:[(0,Er.jsx)(mk.pu.VisualLabel,{id:E,children:o}),w&&(0,Er.jsx)(iP,{children:(0,Er.jsx)(uP,{side:"all",...j})}),!_&&(0,Er.jsx)(oP,{children:(0,Er.jsx)(dP,{onClick:()=>{C(!w)},isLinked:w})}),!w&&c&&["vertical","horizontal"].map(e=>(0,Er.jsx)(uP,{side:e,...j},e)),!w&&!c&&Array.from(B).map(e=>(0,Er.jsx)(uP,{side:e,...j},e)),u&&(0,Er.jsx)(rP,{className:"component-box-control__reset-button",variant:"secondary",size:"small",onClick:()=>{r(d),b(d),A(d),k(!1)},disabled:!x,children:(0,ee.__)("Reset")})]})},mP=[],gP=new Intl.Collator("und",{numeric:!0}).compare;function bP(){const[e,t,n,i]=tv("spacing.spacingSizes.custom","spacing.spacingSizes.theme","spacing.spacingSizes.default","spacing.defaultSpacingSizes"),r=e??mP,o=t??mP,s=n&&!1!==i?n:mP;return(0,T.useMemo)(()=>{const e=[{name:(0,ee.__)("None"),slug:"0",size:0},...r,...o,...s];return e.every(({slug:e})=>/^[0-9]/.test(e))&&e.sort((e,t)=>gP(e.slug,t.slug)),e.length>8?[{name:(0,ee.__)("Default"),slug:"default",size:void 0},...e]:e},[r,o,s])}var yP={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 vP({icon:e,isMixed:t=!1,minimumCustomValue:n,onChange:i,onMouseOut:r,onMouseOver:o,showSideInLabel:s=!0,side:a,spacingSizes:l,type:c,value:u,...d}){const h=(0,zt.A)(e=>{const t=e(Qy).getSettings();return t?.disableCustomSpacingSizes}),[p]=tv("spacing.units"),f=Z_({availableUnits:p||["px","em","rem"]}),m=(0,T.useMemo)(()=>l?.map(e=>({name:e.name,slug:e.slug,size:e.size}))||[],[l]),g=(u_.includes(a)||["vertical","horizontal"].includes(a))&&s?p_[a]:"",b=s?c?.toLowerCase():c,y=(0,ee.sprintf)((0,ee._x)("%1$s %2$s","spacing"),g,b).trim(),v=f[0]?.value||"px";return(0,Er.jsx)(BR,{allowNegativeOnDrag:n<0,ariaLabel:y,className:"spacing-sizes-control",customValueSettings:yP,disableCustomValues:h,icon:e,isMixed:t,minimumCustomValue:n,onChange:i,onMouseOut:r,onMouseOver:o,presets:m,presetType:"spacing",selectedUnit:v,units:f,value:u,...d})}var _P=["vertical","horizontal"];function xP({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:i,sides:r,spacingSizes:o,type:s,values:a}){const l=e=>n=>{if(!t)return;const i={...Object.keys(a).reduce((e,t)=>(e[t]=g_(a[t],o),e),{})};"vertical"===e&&(i.top=n,i.bottom=n),"horizontal"===e&&(i.left=n,i.right=n),t(i)},c=r?.length?_P.filter(e=>y_(r,e)):_P;return(0,Er.jsx)(Er.Fragment,{children:c.map(t=>{const r="vertical"===t?a.top:a.left;return(0,Er.jsx)(vP,{icon:h_[t],label:p_[t],minimumCustomValue:e,onChange:l(t),onMouseOut:n,onMouseOver:i,side:t,spacingSizes:o,type:s,value:r,withInputField:!1},`spacing-sizes-control-${t}`)})})}function kP({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:i,sides:r,spacingSizes:o,type:s,values:a}){const l=r?.length?u_.filter(e=>r.includes(e)):u_,c=e=>n=>{const i={...Object.keys(a).reduce((e,t)=>(e[t]=g_(a[t],o),e),{})};i[e]=n,t(i)};return(0,Er.jsx)(Er.Fragment,{children:l.map(t=>(0,Er.jsx)(vP,{icon:h_[t],label:p_[t],minimumCustomValue:e,onChange:c(t),onMouseOut:n,onMouseOver:i,side:t,spacingSizes:o,type:s,value:a[t],withInputField:!1},`spacing-sizes-control-${t}`))})}function wP({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:i,showSideInLabel:r,side:o,spacingSizes:s,type:a,values:l}){return(0,Er.jsx)(vP,{label:p_[o],minimumCustomValue:e,onChange:(c=o,e=>{const n={...Object.keys(l).reduce((e,t)=>(e[t]=g_(l[t],s),e),{})};n[c]=e,t(n)}),onMouseOut:n,onMouseOver:i,showSideInLabel:r,side:o,spacingSizes:s,type:a,value:l[o],withInputField:!1});var c}function CP({isLinked:e,...t}){const n=e?(0,ee.__)("Unlink sides"):(0,ee.__)("Link sides");return(0,Er.jsx)(fv.Ay,{...t,size:"small",icon:e?fB.A:IS.A,iconSize:24,label:n})}function SP({inputProps:e,label:t,minimumCustomValue:n=0,onChange:i,onMouseOut:r,onMouseOver:o,showSideInLabel:s=!0,sides:a=u_,useSelect:l,values:c}){const u=bP(),d=c||d_,h=1===a?.length,p=a?.includes("horizontal")&&a?.includes("vertical")&&2===a?.length,[f,m]=(0,T.useState)(function(e={},t){const{top:n,right:i,bottom:r,left:o}=e,s=[n,i,r,o].filter(Boolean),a=!(n!==r||o!==i||!n&&!o),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),c=t?.includes("horizontal")&&t?.includes("vertical")&&2===t?.length;if(y_(t)&&(a||l))return f_;if(c&&1===s.length){let t;return Object.entries(e).some(([e,n])=>(t=e,void 0!==n)),t}return 1!==t?.length||s.length?m_:t[0]}(d,a)),g={...e,minimumCustomValue:n,onChange:e=>{const t={...c,...e};i(t)},onMouseOut:r,onMouseOver:o,sides:a,spacingSizes:u,type:t,useSelect:l,values:d},b=u_.includes(f)&&s?p_[f]:"",y=(0,ee.sprintf)((0,ee._x)("%1$s %2$s","spacing"),t,b).trim();return(0,Er.jsxs)("fieldset",{className:"spacing-sizes-control",children:[(0,Er.jsxs)(Cw.A,{className:"spacing-sizes-control__header",children:[(0,Er.jsx)(mk.Ay.VisualLabel,{as:"legend",className:"spacing-sizes-control__label",children:y}),!h&&!p&&(0,Er.jsx)(CP,{label:t,onClick:()=>{m(f===f_?m_:f_)},isLinked:f===f_})]}),(0,Er.jsx)(Q_.A,{spacing:.5,children:f===f_?(0,Er.jsx)(xP,{...g}):f===m_?(0,Er.jsx)(kP,{...g}):(0,Er.jsx)(wP,{side:f,...g,showSideInLabel:s})})]})}var AP=[],IP={...SR,px:{max:1e3,steps:1},em:{max:50,steps:.1},rem:{max:50,steps:.1}};function EP({label:e=(0,ee.__)("Dimension"),onChange:t,value:n,dimensionSizes:i}){const[r,o]=tv("dimensions.dimensionSizes","spacing.units"),s=i??r,a=Z_({availableUnits:o||["%","px","em","rem","vh","vw"]}),l=function(e){const t=e?.default??AP,n=e?.custom??AP,i=e?.theme??AP;return(0,T.useMemo)(()=>[{name:(0,ee.__)("None"),slug:"0",size:0},...n,...i,...t],[n,i,t])}(s),[c,u]=(0,T.useState)(()=>{const[,e]=X_(n);return e||a[0]?.value||"px"});return(0,Er.jsxs)("fieldset",{className:"block-editor-dimension-control",children:[(0,Er.jsx)(mk.Ay.VisualLabel,{as:"legend",children:e}),(0,Er.jsx)(BR,{ariaLabel:e,className:"block-editor-dimension-control",customValueSettings:IP,minimumCustomValue:0,onChange:t,onUnitChange:e=>{const[i,r]=X_(n);["em","rem"].includes(e)&&"px"===r?t((i/16).toFixed(2)+e):["em","rem"].includes(r)&&"px"===e?t(Math.round(16*i)+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)&&i>100&&t(100+e),u(e)},presets:l,presetType:"dimension",selectedUnit:c,showTooltip:!0,units:a,value:n})]})}function jP(e,t){const{getBlockOrder:n,getBlockAttributes:i}=(0,zt.A)(Qy);return(r,o)=>{const s=(o-1)*t+r-1;let a=0;for(const r of n(e)){const{columnStart:e,rowStart:n}=i(r).style?.layout??{};(n-1)*t+e-1{"fixed"!==o||s||t({...e,selfStretch:"fit"})},[]),(0,Er.jsxs)(Q_.A,{as:aC,spacing:2,hasValue:()=>!!o,label:l,onDeselect:()=>{t({selfStretch:void 0,flexSize:void 0})},isShownByDefault:i,panelId:r,children:[(0,Er.jsxs)(Jv.A,{size:"__unstable-large",label:RP(n),value:o||"fit",help:TP(o,n),onChange:e=>{t({selfStretch:e,flexSize:"fixed"!==e?null:s})},isBlock:!0,children:[(0,Er.jsx)(bk.A,{value:"fit",label:(0,ee._x)("Fit","Intrinsic block width in flex layout")},"fit"),(0,Er.jsx)(bk.A,{value:"fill",label:(0,ee._x)("Grow","Block with expanding width in flex layout")},"fill"),(0,Er.jsx)(bk.A,{value:"fixed",label:(0,ee._x)("Fixed","Block with fixed width in flex layout")},"fixed")]}),"fixed"===o&&(0,Er.jsx)(vx,{size:"__unstable-large",units:u,onChange:e=>{t({selfStretch:o,flexSize:e})},value:s,min:0,label:l,hideLabelFromVision:!0})]})}function RP(e){const{orientation:t="horizontal"}=e;return"horizontal"===t?(0,ee.__)("Width"):(0,ee.__)("Height")}function OP({childLayout:e,onChange:t,parentLayout:n,isShownByDefault:i,panelId:r}){const{columnStart:o,rowStart:s,columnSpan:a,rowSpan:l}=e,{columnCount:c,rowCount:u}=n??{},d=(0,zt.A)(e=>e(Qy).getBlockRootClientId(r)),{moveBlocksToPosition:h,__unstableMarkNextChangeAsNotPersistent:p}=(0,Vt.A)(Qy),f=jP(d,c||3),m=c?c-(o??1)+1:void 0,g=window.__experimentalEnableGridInteractivity&&u?u-(s??1)+1:void 0;return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsxs)(Kv.A,{as:aC,hasValue:()=>!!a||!!l,label:(0,ee.__)("Grid span"),onDeselect:()=>{t({columnSpan:void 0,rowSpan:void 0})},isShownByDefault:i,panelId:r,children:[(0,Er.jsx)(Yv.A,{style:{width:"50%"},children:(0,Er.jsx)(PS.Ay,{size:"__unstable-large",label:(0,ee.__)("Column span"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10),i=m?Math.min(n,m):n;t({columnStart:o,rowStart:s,rowSpan:l,columnSpan:i})},value:a??1,min:1,max:m})}),(0,Er.jsx)(Yv.A,{style:{width:"50%"},children:(0,Er.jsx)(PS.Ay,{size:"__unstable-large",label:(0,ee.__)("Row span"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10),i=g?Math.min(n,g):n;t({columnStart:o,rowStart:s,columnSpan:a,rowSpan:i})},value:l??1,min:1,max:g})})]}),window.__experimentalEnableGridInteractivity&&(0,Er.jsxs)(Kv.A,{as:aC,hasValue:()=>!!o||!!s,label:(0,ee.__)("Grid placement"),onDeselect:()=>{t({columnStart:void 0,rowStart:void 0})},isShownByDefault:!1,panelId:r,children:[(0,Er.jsx)(Yv.A,{style:{width:"50%"},children:(0,Er.jsx)(PS.Ay,{size:"__unstable-large",label:(0,ee.__)("Column"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10);t({columnStart:n,rowStart:s,columnSpan:a,rowSpan:l}),p(),h([r],d,d,f(n,s))},value:o??1,min:1,max:c?c-(a??1)+1:void 0})}),(0,Er.jsx)(Yv.A,{style:{width:"50%"},children:(0,Er.jsx)(PS.Ay,{size:"__unstable-large",label:(0,ee.__)("Row"),type:"number",onChange:e=>{const n=""===e?1:parseInt(e,10);t({columnStart:o,rowStart:n,columnSpan:a,rowSpan:l}),p(),h([r],d,d,f(o,n))},value:s??1,min:1,max:u?u-(l??1)+1:void 0})})]})]})}function LP({panelId:e,value:t,onChange:n=()=>{},options:i,defaultValue:r="auto",hasValue:o,isShownByDefault:s=!0}){const a=t??"auto",[l,c,u]=tv("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,ee._x)("Original","Aspect ratio option for dimensions control"),value:"auto"},...u?h:[],...d||[],{label:(0,ee._x)("Custom","Aspect ratio option for dimensions control"),value:"custom",disabled:!0,hidden:!0}];return(0,Er.jsx)(aC,{hasValue:o||(()=>a!==r),label:(0,ee.__)("Aspect ratio"),onDeselect:()=>n(void 0),isShownByDefault:s,panelId:e,children:(0,Er.jsx)(oE.A,{label:(0,ee.__)("Aspect ratio"),value:a,options:i??p,onChange:n,size:"__unstable-large"})})}var MP=["horizontal","vertical"];function PP(e){const t=DP(e),n=FP(e),i=zP(e),r=VP(e),o=UP(e),s=$P(e),a=HP(e),l=WP(e),c=GP(e),u=qP(e);return"web"===Uo.A.OS&&(t||n||i||r||o||s||a||l||c||u)}function DP(e){return e?.layout?.contentSize}function FP(e){return e?.layout?.wideSize}function zP(e){return e?.spacing?.padding}function VP(e){return e?.spacing?.margin}function UP(e){return e?.spacing?.blockGap}function $P(e){return e?.dimensions?.height}function HP(e){return e?.dimensions?.minHeight}function WP(e){return e?.dimensions?.width}function GP(e){return e?.dimensions?.aspectRatio}function qP(e){const{type:t="default",default:{type:n="default"}={},allowSizingOnChildren:i=!1}=e?.parentLayout??{},r=("flex"===n||"flex"===t||"grid"===n||"grid"===t)&&i;return!!e?.layout&&r}function KP(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 YP(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function JP({resetAllFilter:e,onChange:t,value:n,panelId:i,children:r}){const o=Zw();return(0,Er.jsx)(Xw,{label:(0,ee.__)("Dimensions"),resetAll:()=>{const i=e(n);t(i)},panelId:i,dropdownMenuProps:o,children:r})}var XP={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,height:!0,minHeight:!0,width:!0,aspectRatio:!0,childLayout:!0};function ZP({as:e=JP,value:t,onChange:n,inheritedValue:i=t,settings:r,panelId:o,defaultControls:s=XP,onVisualize:a=()=>{},includeLayoutControls:l=!1}){const{dimensions:c,spacing:u}=r,d=e=>e&&"object"==typeof e?Object.keys(e).reduce((t,n)=>(t[n]=vC({settings:{dimensions:c,spacing:u}},"",e[n]),t),{}):vC({settings:{dimensions:c,spacing:u}},"",e),h=function(e){const{defaultSpacingSizes:t,spacingSizes:n}=e?.spacing||{};return!1!==t&&n?.default?.length>0||n?.theme?.length>0||n?.custom?.length>0}(r),p=Z_({availableUnits:r?.spacing?.units||["%","px","em","rem","vw"]}),f=-1/0,[m,g]=(0,T.useState)(f),b=DP(r)&&l,y=d(i?.layout?.contentSize),v=e=>{n(_p(t,["layout","contentSize"],e||void 0))},_=FP(r)&&l,x=d(i?.layout?.wideSize),k=e=>{n(_p(t,["layout","wideSize"],e||void 0))},w=zP(r),C=YP(d(i?.spacing?.padding)),S=Array.isArray(r?.spacing?.padding)?r?.spacing?.padding:r?.spacing?.padding?.sides,A=S&&S.some(e=>MP.includes(e)),I=e=>{const i=KP(e,S);n(_p(t,["spacing","padding"],i))},E=()=>a("padding"),j=VP(r),B=YP(d(i?.spacing?.margin)),N=Array.isArray(r?.spacing?.margin)?r?.spacing?.margin:r?.spacing?.margin?.sides,R=N&&N.some(e=>MP.includes(e)),O=e=>{const i=KP(e,N);n(_p(t,["spacing","margin"],i))},L=()=>a("margin"),M=UP(r),P=Array.isArray(r?.spacing?.blockGap)?r?.spacing?.blockGap:r?.spacing?.blockGap?.sides,D=P&&P.some(e=>MP.includes(e)),F=d(i?.spacing?.blockGap),z=function(e,t){return e?"string"==typeof e?t?{top:e,right:e,bottom:e,left:e}:{top:e}:{...e,right:e?.left,bottom:e?.top}:e}(F,D),V=e=>{n(_p(t,["spacing","blockGap"],e))},U=e=>{e||V(null),!D&&e?.hasOwnProperty("top")?V(e.top):V({top:e?.top,left:e?.left})},$=HP(r),H=d(i?.dimensions?.minHeight),W=e=>{const i=_p(t,["dimensions","minHeight"],e);n(_p(i,["dimensions","aspectRatio"],void 0))},G=$P(r),q=d(i?.dimensions?.height),K=e=>{const i=_p(t,["dimensions","height"],e);n(_p(i,["dimensions","aspectRatio"],void 0))},Y=WP(r),J=d(i?.dimensions?.width),X=e=>{n(_p(t,["dimensions","width"],e))},Z=GP(r),Q=d(i?.dimensions?.aspectRatio),te=qP(r),ne=i?.layout,ie=(0,T.useCallback)(e=>({...e,layout:ov({...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,height:void 0,minHeight:void 0,aspectRatio:void 0,width:void 0}}),[]),re=()=>a(!1);return(0,Er.jsxs)(e,{resetAllFilter:ie,value:t,onChange:n,panelId:o,children:[(b||_)&&(0,Er.jsx)("span",{className:"span-columns",children:(0,ee.__)("Set the width of the main content area.")}),b&&(0,Er.jsx)(aC,{label:(0,ee.__)("Content width"),hasValue:()=>!!t?.layout?.contentSize,onDeselect:()=>v(void 0),isShownByDefault:s.contentSize??XP.contentSize,panelId:o,children:(0,Er.jsx)(vx,{__next40pxDefaultSize:!0,label:(0,ee.__)("Content width"),labelPosition:"top",value:y||"",onChange:e=>{v(e)},units:p,prefix:(0,Er.jsx)(_x.A,{variant:"icon",children:(0,Er.jsx)(xx.A,{icon:kx.A})})})}),_&&(0,Er.jsx)(aC,{label:(0,ee.__)("Wide width"),hasValue:()=>!!t?.layout?.wideSize,onDeselect:()=>k(void 0),isShownByDefault:s.wideSize??XP.wideSize,panelId:o,children:(0,Er.jsx)(vx,{__next40pxDefaultSize:!0,label:(0,ee.__)("Wide width"),labelPosition:"top",value:x||"",onChange:e=>{k(e)},units:p,prefix:(0,Er.jsx)(_x.A,{variant:"icon",children:(0,Er.jsx)(xx.A,{icon:wx.A})})})}),w&&(0,Er.jsxs)(aC,{hasValue:()=>!!t?.spacing?.padding&&Object.keys(t?.spacing?.padding).length,label:(0,ee.__)("Padding"),onDeselect:()=>I(void 0),isShownByDefault:s.padding??XP.padding,className:(0,mh.A)({"tools-panel-item-spacing":h}),panelId:o,children:[!h&&(0,Er.jsx)(fP,{__next40pxDefaultSize:!0,values:C,onChange:I,label:(0,ee.__)("Padding"),sides:S,units:p,allowReset:!1,splitOnAxis:A,inputProps:{onMouseOver:E,onMouseOut:re}}),h&&(0,Er.jsx)(SP,{values:C,onChange:I,label:(0,ee.__)("Padding"),sides:S,units:p,allowReset:!1,onMouseOver:E,onMouseOut:re})]}),j&&(0,Er.jsxs)(aC,{hasValue:()=>!!t?.spacing?.margin&&Object.keys(t?.spacing?.margin).length,label:(0,ee.__)("Margin"),onDeselect:()=>O(void 0),isShownByDefault:s.margin??XP.margin,className:(0,mh.A)({"tools-panel-item-spacing":h}),panelId:o,children:[!h&&(0,Er.jsx)(fP,{__next40pxDefaultSize:!0,values:B,onChange:O,inputProps:{min:m,onDragStart:()=>{g(0)},onDragEnd:()=>{g(f)},onMouseOver:L,onMouseOut:re},label:(0,ee.__)("Margin"),sides:N,units:p,allowReset:!1,splitOnAxis:R}),h&&(0,Er.jsx)(SP,{values:B,onChange:O,minimumCustomValue:-1/0,label:(0,ee.__)("Margin"),sides:N,units:p,allowReset:!1,onMouseOver:L,onMouseOut:re})]}),M&&(0,Er.jsxs)(aC,{hasValue:()=>!!t?.spacing?.blockGap,label:(0,ee.__)("Block spacing"),onDeselect:()=>V(void 0),isShownByDefault:s.blockGap??XP.blockGap,className:(0,mh.A)({"tools-panel-item-spacing":h,"single-column":!h&&!D}),panelId:o,children:[!h&&(D?(0,Er.jsx)(fP,{__next40pxDefaultSize:!0,label:(0,ee.__)("Block spacing"),min:0,onChange:U,units:p,sides:P,values:z,allowReset:!1,splitOnAxis:D}):(0,Er.jsx)(vx,{__next40pxDefaultSize:!0,label:(0,ee.__)("Block spacing"),min:0,onChange:V,units:p,value:F})),h&&(0,Er.jsx)(SP,{label:(0,ee.__)("Block spacing"),min:0,onChange:U,showSideInLabel:!1,sides:D?P:["top"],values:z,allowReset:!1})]}),te&&(0,Er.jsx)(BP,{value:ne,onChange:e=>{n({...t,layout:{...e}})},parentLayout:r?.parentLayout,panelId:o,isShownByDefault:s.childLayout??XP.childLayout}),$&&(0,Er.jsx)(aC,{hasValue:()=>!!t?.dimensions?.minHeight,label:(0,ee.__)("Minimum height"),onDeselect:()=>{W(void 0)},isShownByDefault:s.minHeight??XP.minHeight,panelId:o,children:(0,Er.jsx)(EP,{label:(0,ee.__)("Minimum height"),value:H,onChange:W,dimensionSizes:c?.dimensionSizes})}),G&&(0,Er.jsx)(aC,{hasValue:()=>!!t?.dimensions?.height,label:(0,ee.__)("Height"),onDeselect:()=>{K(void 0)},isShownByDefault:s.height??XP.height,panelId:o,children:(0,Er.jsx)(EP,{label:(0,ee.__)("Height"),value:q,onChange:K,dimensionSizes:c?.dimensionSizes})}),Y&&(0,Er.jsx)(aC,{hasValue:()=>!!t?.dimensions?.width,label:(0,ee.__)("Width"),onDeselect:()=>{X(void 0)},isShownByDefault:s.width??XP.width,panelId:o,children:(0,Er.jsx)(EP,{label:(0,ee.__)("Width"),value:J,onChange:X,dimensionSizes:c?.dimensionSizes})}),Z&&(0,Er.jsx)(LP,{hasValue:()=>!!t?.dimensions?.aspectRatio,value:Q,onChange:e=>{const i=_p(t,["dimensions","aspectRatio"],e);n(_p(i,["dimensions","minHeight"],void 0))},panelId:o,isShownByDefault:s.aspectRatio??XP.aspectRatio})]})}var QP=n(88502),eD=new WeakMap,tD=function(e){const t=(0,bt.A)(t=>{function n(n){const{deltaX:i,deltaY:r,target:o}=n,s=e.current;let a=eD.get(s);a||(a=(0,QP.A)(s),eD.set(s,a));const l=(0,QP.A)(o);t.contains(l)||a.scrollBy(i,r)}const i={passive:!0};return t.addEventListener("wheel",n,i),()=>{t.removeEventListener("wheel",n,i)}},[e]);return e?t:null},nD=".block-editor-block-list__block",iD=".block-list-appender",rD=".block-editor-button-block-appender";function oD(e,t){return t.closest([nD,iD,rD].join(","))===e}function sD(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(nD);return t?t.id.slice(6):void 0}function aD(e,t){const n=Math.min(e.left,t.left),i=Math.max(e.right,t.right),r=Math.max(e.bottom,t.bottom),o=Math.min(e.top,t.top);return new window.DOMRectReadOnly(n,o,i-n,r-o)}function lD(e){const t=e.ownerDocument.defaultView;if(!t)return!1;if(e.classList.contains("components-visually-hidden"))return!1;const n=e.getBoundingClientRect();if(0===n.width||0===n.height)return!1;if(e.checkVisibility)return e.checkVisibility?.({opacityProperty:!0,contentVisibilityAuto:!0,visibilityProperty:!0});const i=t.getComputedStyle(e);return"none"!==i.display&&"hidden"!==i.visibility&&"0"!==i.opacity}function cD(e){const t=window.getComputedStyle(e);return"auto"===t.overflowX||"scroll"===t.overflowX||"auto"===t.overflowY||"scroll"===t.overflowY}var uD=["core/navigation"];function dD(e){const t=e.ownerDocument.defaultView;if(!t)return new window.DOMRectReadOnly;let n=e.getBoundingClientRect();const i=e.getAttribute("data-type");if(i&&uD.includes(i)){const t=[e];let i;for(;i=t.pop();)if(!cD(i))for(const e of i.children)lD(e)&&(n=aD(n,e.getBoundingClientRect()),t.push(e))}const r=Math.max(n.left,0),o=Math.min(n.right,t.innerWidth);return n=new window.DOMRectReadOnly(r,n.top,o-r,n.height),n}var hD=Number.MAX_SAFE_INTEGER,pD=(0,T.forwardRef)(function({clientId:e,bottomClientId:t,children:n,__unstablePopoverSlot:i,__unstableContentRef:r,shift:o=!0,...s},a){const l=BO(e),c=BO(t??e),u=(0,gt.A)([a,tD(r)]),[d,h]=(0,T.useReducer)(e=>(e+1)%hD,0);(0,T.useLayoutEffect)(()=>{if(!l)return;const e=new window.MutationObserver(h);return e.observe(l,{attributes:!0}),()=>{e.disconnect()}},[l]);const p=(0,T.useMemo)(()=>{if(!(d<0||!l||t&&!c))return{getBoundingClientRect:()=>c?aD(dD(l),dD(c)):dD(l),contextElement:l}},[d,l,t,c]);return!l||t&&!c?null:(0,Er.jsx)(uw.Ay,{ref:u,animate:!1,focusOnMount:!1,anchor:p,__unstableSlotName:i,inline:!i,placement:"top-start",resize:!1,flip:!1,shift:o,...s,className:(0,mh.A)("block-editor-block-popover",s.className),variant:"unstyled",children:n})});function fD({selectedElement:e,additionalStyles:t={},children:n}){const[i,r]=(0,T.useState)(e.offsetWidth),[o,s]=(0,T.useState)(e.offsetHeight);(0,T.useEffect)(()=>{const t=new window.ResizeObserver(()=>{r(e.offsetWidth),s(e.offsetHeight)});return t.observe(e,{box:"border-box"}),()=>t.disconnect()},[e]);const a=(0,T.useMemo)(()=>({position:"absolute",width:i,height:o,...t}),[i,o,t]);return(0,Er.jsx)("div",{style:a,children:n})}(0,T.forwardRef)(({clientId:e,bottomClientId:t,children:n,...i},r)=>(0,Er.jsx)(pD,{...i,bottomClientId:t,clientId:e,__unstableContentRef:void 0,__unstablePopoverSlot:void 0,ref:r,children:n}));var mD=(0,T.forwardRef)(function({clientId:e,bottomClientId:t,children:n,shift:i=!1,additionalStyles:r,...o},s){t??=e;const a=BO(e);return(0,Er.jsx)(pD,{ref:s,clientId:e,bottomClientId:t,shift:i,...o,children:a&&e===t?(0,Er.jsx)(fD,{selectedElement:a,additionalStyles:r,children:n}):n})});function gD({clientId:e,value:t,computeStyle:n,forceShow:i}){const r=BO(e),[o,s]=(0,T.useReducer)(()=>n(r));(0,T.useEffect)(()=>{r&&i&&s()},[r,i]),(0,T.useEffect)(()=>{if(!r)return;const e=new window.MutationObserver(s);return e.observe(r,{attributes:!0,attributeFilter:["style","class"]}),()=>{e.disconnect()}},[r]);const a=(0,T.useRef)(t),[l,c]=(0,T.useState)(!1);return(0,T.useEffect)(()=>{if((0,V.hw)(t,a.current)||i)return;c(!0),a.current=t;const e=setTimeout(()=>{c(!1)},400);return()=>{c(!1),clearTimeout(e)}},[t,i]),l||i?(0,Er.jsx)(mD,{clientId:e,__unstablePopoverSlot:"block-toolbar",children:(0,Er.jsx)("div",{className:"block-editor__spacing-visualizer",style:o})}):null}function bD(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function yD({clientId:e,value:t,forceShow:n}){return(0,Er.jsx)(gD,{clientId:e,value:t?.spacing?.margin,computeStyle:e=>{const t=bD(e,"margin-top"),n=bD(e,"margin-right"),i=bD(e,"margin-bottom"),r=bD(e,"margin-left");return{borderTopWidth:t,borderRightWidth:n,borderBottomWidth:i,borderLeftWidth:r,top:t?`-${t}`:0,right:n?`-${n}`:0,bottom:i?`-${i}`:0,left:r?`-${r}`:0}},forceShow:n})}function vD({clientId:e,value:t,forceShow:n}){return(0,Er.jsx)(gD,{clientId:e,value:t?.spacing?.padding,computeStyle:e=>({borderTopWidth:bD(e,"padding-top"),borderRightWidth:bD(e,"padding-right"),borderBottomWidth:bD(e,"padding-bottom"),borderLeftWidth:bD(e,"padding-left")}),forceShow:n})}var _D="dimensions",xD="spacing";function kD({children:e,resetAllFilter:t}){const n=(0,T.useCallback)(e=>{const n=e.style,i=t(n);return{...e,style:i}},[t]);return(0,Er.jsx)(oC,{group:"dimensions",resetAllFilter:n,children:e})}function wD({clientId:e,name:t,setAttributes:n,settings:i}){const r=PP(i),o=(0,zt.A)(t=>{if(r)return t(Qy).getBlockAttributes(e)?.style},[e,r]),[s,a]=function(){const[e,t]=(0,T.useState)(!1),{hideBlockInterface:n,showBlockInterface:i}=Gh((0,Vt.A)(Qy));return(0,T.useEffect)(()=>{e?n():i()},[e,i,n]),[e,t]}();if(!r)return null;const l={...vn(t,[_D,"__experimentalDefaultControls"]),...vn(t,[xD,"__experimentalDefaultControls"])};return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(ZP,{as:kD,panelId:e,settings:i,value:o,onChange:e=>{n({style:ov(e)})},defaultControls:l,onVisualize:a}),!!i?.spacing?.padding&&"padding"===s&&(0,Er.jsx)(vD,{forceShow:"padding"===s,clientId:e,value:o}),!!i?.spacing?.margin&&"margin"===s&&(0,Er.jsx)(yD,{forceShow:"margin"===s,clientId:e,value:o})]})}function CD(e,t="any"){if("web"!==Uo.A.OS)return!1;const n=vn(e,_D);return!0===n||("any"===t?!!(n?.aspectRatio||n?.height||n?.minHeight||n?.width):!!n?.[t])}var SD={useBlockProps:function({name:e,height:t,minHeight:n,style:i}){if(!CD(e,"aspectRatio")||av(e,_D,"aspectRatio"))return{};const r=(0,mh.A)({"has-aspect-ratio":!!i?.dimensions?.aspectRatio}),o={};return i?.dimensions?.aspectRatio?(o.minHeight="unset",o.height="unset"):(n||i?.dimensions?.minHeight||t||i?.dimensions?.height)&&(o.aspectRatio="unset"),{className:r,style:o}},attributeKeys:["height","minHeight","width","style"],hasSupport:e=>CD(e)},AD=[...BM,cO,MO,_D,QE,xD,uO],ID=e=>AD.some(t=>_n(e,t));function ED(e={}){const t={};return dk(e).forEach(e=>{t[e.key]=e.value}),t}var jD={[`${cO}.__experimentalSkipSerialization`]:["border"],[`${MO}.__experimentalSkipSerialization`]:[MO],[`${TM}.__experimentalSkipSerialization`]:[TM],[`${_D}.__experimentalSkipSerialization`]:[_D],[`${xD}.__experimentalSkipSerialization`]:[xD],[`${uO}.__experimentalSkipSerialization`]:[uO]},TD={...jD,[`${_D}.aspectRatio`]:[`${_D}.aspectRatio`],[`${QE}`]:[QE]},BD={[`${_D}.aspectRatio`]:!0,[`${QE}`]:!0},ND={gradients:"gradient"};function RD(e,t,n=!1){if(!e)return e;let i=e;return n||(i=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;RD(i[t],[n],!0)}else 1===e.length&&delete i[e[0]]}),i}function OD(e,t,n,i=TD){if(!ID(t))return e;let{style:r}=n;return Object.entries(i).forEach(([e,n])=>{const i=BD[e]||vn(t,e);!0===i&&(r=RD(r,n)),Array.isArray(i)&&i.forEach(e=>{const t=ND[e]||e;r=RD(r,[[...n,t]])})}),e.style={...ED(r),...e.style},e}var LD={edit:function({clientId:e,name:t,setAttributes:n,__unstableParentLayout:i}){const r=dv(t,i),o=Vk(),s={clientId:e,name:t,setAttributes:n,settings:{...r,typography:{...r.typography,textAlign:!1}}};return"default"!==o?null:(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(GO,{...s}),(0,Er.jsx)(oj,{...s}),(0,Er.jsx)(LM,{...s}),(0,Er.jsx)(bO,{...s}),(0,Er.jsx)(wD,{...s})]})},hasSupport:ID,addSaveProps:OD,attributeKeys:["style"],useBlockProps:function({name:e,style:t}){const n=(0,SS.A)(PD,"wp-elements"),i=`.${n}`,r=t?.elements,o=(0,T.useMemo)(()=>function(e,t,n){if(!e)return;const i=[];return MD.forEach(({elementType:r,pseudo:o,elements:s})=>{if(av(t,MO,r))return;const a=e?.[r];if(a){const e=Qw(n,rn[r]);i.push(uk(a,{selector:e})),o&&o.forEach(e=>{a[e]&&i.push(uk(a[e],{selector:Qw(n,`${rn[r]}${e}`)}))})}s&&s.forEach(t=>{e[t]&&i.push(uk(e[t],{selector:Qw(n,rn[t])}))})}),i.length>0?i.join(""):void 0}(r,e,i),[i,r,e]);return cv({css:o}),OD({className:n},e,{style:t},jD)}},MD=[{elementType:"button"},{elementType:"link",pseudo:[":hover"]},{elementType:"heading",elements:["h1","h2","h3","h4","h5","h6"]}],PD={};(0,Ei.U2)("blocks.registerBlockType","core/style/addAttribute",function(e){return ID(e)||_n(e,"customCSS",!0)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e}),(0,Ei.U2)("blocks.registerBlockType","core/settings/addAttribute",function(e){return _n(e,"__experimentalSettings",!1)?(e?.attributes?.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e});var DD=n(709);function FD(e=[],t="90deg"){const n=100/e.length,i=e.map((e,t)=>`${e} ${t*n}%, ${e} ${(t+1)*n}%`).join(", ");return`linear-gradient( ${t}, ${i} )`}(0,te.X$)([ne.A]);var zD=function({values:e}){return e?(0,Er.jsx)(CI.A,{colorValue:FD(e,"135deg")}):(0,Er.jsx)(IC.A,{icon:DD.A})};function VD({label:e,value:t,colors:n,disableCustomColors:i,enableAlpha:r,onChange:o}){const[s,a]=(0,T.useState)(!1),l=(0,SS.A)(VD,"color-list-picker-option"),c=`${l}__label`,u=`${l}__content`;return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,className:"components-color-list-picker__swatch-button",id:c,onClick:()=>a(e=>!e),"aria-expanded":s,"aria-controls":u,icon:t?(0,Er.jsx)(CI.A,{colorValue:t,className:"components-color-list-picker__swatch-color"}):(0,Er.jsx)(IC.A,{icon:DD.A}),text:e}),(0,Er.jsx)("div",{role:"group",id:u,"aria-labelledby":c,"aria-hidden":!s,children:s&&(0,Er.jsx)(UI,{"aria-label":(0,ee.__)("Color options"),className:"components-color-list-picker__color-picker",colors:n,value:t,clearable:!1,onChange:o,disableCustomColors:i,enableAlpha:r})})]})}var UD=function({colors:e,labels:t,value:n=[],disableCustomColors:i,enableAlpha:r,onChange:o}){return(0,Er.jsx)("div",{className:"components-color-list-picker",children:t.map((t,s)=>(0,Er.jsx)(VD,{label:t,value:n[s],colors:e,disableCustomColors:i,enableAlpha:r,onChange:e=>{const t=n.slice();t[s]=e,o(t)}},s))})},$D=["#333","#CCC"];function HD({value:e,onChange:t}){const n=!!e,i=n?e:$D,r=FD(i),o=(s=i).map((e,t)=>({position:100*t/(s.length-1),color:e}));var s;return(0,Er.jsx)(rE,{disableInserter:!0,background:r,hasGradient:n,value:o,onChange:e=>{const n=function(e=[]){return e.map(({color:e})=>e)}(e);t(n)}})}var WD=function({asButtons:e,loop:t,clearable:n=!0,unsetable:i=!0,colorPalette:r,duotonePalette:o,disableCustomColors:s,disableCustomDuotone:a,value:l,onChange:c,"aria-label":u,"aria-labelledby":d,...h}){const[p,f]=(0,T.useMemo)(()=>{return!(e=r)||e.length<2?["#000","#fff"]:e.map(({color:e})=>({color:e,brightness:(0,te.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},[r]),m="unset"===l,g=(0,ee.__)("Unset"),b=(0,Er.jsx)(RI.Option,{value:"unset",isSelected:m,tooltipText:g,"aria-label":g,className:"components-duotone-picker__color-indicator",onClick:()=>{c(m?void 0:"unset")}},"unset"),y=o.map(({colors:e,slug:t,name:n})=>{const i={background:FD(e,"135deg"),color:"transparent"},r=n??(0,ee.sprintf)((0,ee.__)("Duotone code: %s"),t),o=n?(0,ee.sprintf)((0,ee.__)("Duotone: %s"),n):r,s=F(e,l);return(0,Er.jsx)(RI.Option,{value:e,isSelected:s,"aria-label":o,tooltipText:r,style:i,onClick:()=>{c(s?void 0:e)}},t)}),{metaProps:v,labelProps:_}=OI(e,t,u,d),x=i?[b,...y]:y;return(0,Er.jsx)(RI,{...h,...v,..._,options:x,actions:!!n&&(0,Er.jsx)(RI.ButtonAction,{onClick:()=>c(void 0),accessibleWhenDisabled:!0,disabled:!l,children:(0,ee.__)("Clear")}),children:(0,Er.jsx)($I.A,{paddingTop:0===x.length?0:4,children:(0,Er.jsxs)(Q_.A,{spacing:3,children:[!s&&!a&&(0,Er.jsx)(HD,{value:m?void 0:l,onChange:c}),!a&&(0,Er.jsx)(UD,{labels:[(0,ee.__)("Shadows"),(0,ee.__)("Highlights")],colors:r,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)}})]})})})},GD=n(7723),qD=function e({id:t,colorPalette:n,duotonePalette:i,disableCustomColors:r,disableCustomDuotone:o,value:s,onChange:a}){let l;l="unset"===s?(0,Er.jsx)(CI.A,{className:"block-editor-duotone-control__unset-indicator"}):s?(0,Er.jsx)(zD,{values:s}):(0,Er.jsx)(xx.A,{icon:GD.A});const c=(0,ee.__)("Apply duotone filter"),u=`${(0,SS.A)(e,"duotone-control",t)}__description`;return(0,Er.jsx)(wC.A,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,ee.__)("Duotone")},renderToggle:({isOpen:e,onToggle:t})=>(0,Er.jsx)(vv,{showTooltip:!0,onClick:t,"aria-haspopup":"true","aria-expanded":e,onKeyDown:n=>{e||n.keyCode!==Rt.PX||(n.preventDefault(),t())},label:c,icon:l}),renderContent:()=>(0,Er.jsxs)(Fv.A,{label:(0,ee.__)("Duotone"),children:[(0,Er.jsx)("p",{children:(0,ee.__)("Create a two-tone color effect without losing your original image.")}),(0,Er.jsx)(WD,{"aria-label":c,"aria-describedby":u,colorPalette:n,duotonePalette:i,disableCustomColors:r,disableCustomDuotone:o,value:s,onChange:a})]})})};function KD(e){return`${e}{filter:none}`}function YD(e,t){return`${e}{filter:url(#${t})}`}function JD(e,t){const n=function(e=[]){const t={r:[],g:[],b:[],a:[]};return e.forEach(e=>{const n=(0,te.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`}var XD=[];function ZD(e,{presetSetting:t,defaultSetting:n}){const i=!e?.color?.[n],r=e?.color?.[t]?.custom||XD,o=e?.color?.[t]?.theme||XD,s=e?.color?.[t]?.default||XD;return(0,T.useMemo)(()=>[...r,...o,...i?XD:s],[i,r,o,s])}function QD(e){return eF(e)}function eF(e){return e.color.customDuotone||e.color.defaultDuotone||e.color.duotone.length>0}function tF({resetAllFilter:e,onChange:t,value:n,panelId:i,children:r}){const o=Zw();return(0,Er.jsx)(Xw,{label:(0,ee._x)("Filters","Name for applying graphical effects"),resetAll:()=>{const i=e(n);t(i)},panelId:i,dropdownMenuProps:o,children:r})}var nF={duotone:!0},iF={placement:"left-start",offset:36,shift:!0,className:"block-editor-duotone-control__popover",headerTitle:(0,ee.__)("Duotone")},rF=({indicator:e,label:t})=>(0,Er.jsxs)(Cw.A,{justify:"flex-start",children:[(0,Er.jsx)(wI,{isLayered:!1,offset:-8,children:(0,Er.jsx)(Kv.A,{expanded:!1,children:"unset"!==e&&e?(0,Er.jsx)(zD,{values:e}):(0,Er.jsx)(CI.A,{className:"block-editor-duotone-control__unset-indicator"})})}),(0,Er.jsx)(Yv.A,{title:t,children:t})]}),oF=(e,t)=>function({onToggle:n,isOpen:i}){const r=(0,T.useRef)(void 0),o={onClick:n,className:(0,mh.A)("block-editor-global-styles-filters-panel__dropdown-toggle",{"is-open":i}),"aria-expanded":i,ref:r},s={onClick:()=>{i&&n(),t(),r.current?.focus()},className:"block-editor-panel-duotone-settings__reset",label:(0,ee.__)("Reset")};return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,...o,children:(0,Er.jsx)(rF,{indicator:e,label:(0,ee.__)("Duotone")})}),e&&(0,Er.jsx)(fv.Ay,{size:"small",icon:uS.A,...s})]})};function sF({as:e=tF,value:t,onChange:n,inheritedValue:i=t,settings:r,panelId:o,defaultControls:s=nF}){const a=eF(r),l=ZD(r,{presetSetting:"duotone",defaultSetting:"defaultDuotone"}),c=ZD(r,{presetSetting:"palette",defaultSetting:"defaultPalette"}),u=(d=i?.filter?.duotone,vC({settings:r},"",d));var d;const h=e=>{const i=l.find(({colors:t})=>t===e),r=i?`var:preset|duotone|${i.slug}`:e;n(_p(t,["filter","duotone"],r))},p=()=>h(void 0),f=(0,T.useCallback)(e=>({...e,filter:{...e.filter,duotone:void 0}}),[]);return(0,Er.jsx)(e,{resetAllFilter:f,value:t,onChange:n,panelId:o,children:a&&(0,Er.jsx)(aC,{label:(0,ee.__)("Duotone"),hasValue:()=>!!t?.filter?.duotone,onDeselect:p,isShownByDefault:s.duotone,panelId:o,children:(0,Er.jsx)(wC.A,{popoverProps:iF,className:"block-editor-global-styles-filters-panel__dropdown",renderToggle:oF(u,p),renderContent:()=>(0,Er.jsx)(CC.A,{paddingSize:"small",children:(0,Er.jsxs)(Fv.A,{label:(0,ee.__)("Duotone"),children:[(0,Er.jsx)("p",{children:(0,ee.__)("Create a two-tone color effect without losing your original image.")}),(0,Er.jsx)(WD,{colorPalette:c,duotonePalette:l,disableCustomColors:!0,disableCustomDuotone:!0,value:u,onChange:h})]})})})})})}var aF=[],lF=window?.navigator.userAgent&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&!window.navigator.userAgent.includes("Chromium");function cF({presetSetting:e,defaultSetting:t}){const[n,i,r,o]=tv(t,`${e}.custom`,`${e}.theme`,`${e}.default`);return(0,T.useMemo)(()=>[...i||aF,...r||aF,...n&&o||aF],[n,i,r,o])}function uF(e,t){if(!e)return;const n=t?.find(({slug:t})=>e===`var:preset|duotone|${t}`);return n?n.colors:void 0}(0,te.X$)([ne.A]);var dF={shareWithChildBlocks:!0,edit:function({style:e,setAttributes:t,name:n}){const i=e?.color?.duotone,r=dv(n),o=Vk(),s=cF({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=cF({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),[l,c]=tv("color.custom","color.customDuotone"),u=!l,d=!c||0===a?.length&&u;if(0===s?.length&&d)return null;if("default"!==o)return null;const h="unset"===i||Array.isArray(i)?i:uF(i,s);return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(oC,{group:"filter",children:(0,Er.jsx)(sF,{value:{filter:{duotone:h}},onChange:n=>{const i={...e,color:{...n?.filter}};t({style:ov(i)})},settings:r})}),(0,Er.jsx)(Mv,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,Er.jsx)(qD,{duotonePalette:s,colorPalette:a,disableCustomDuotone:d,disableCustomColors:u,value:h,onChange:n=>{const i=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),r={...e,color:{...e?.color,duotone:i??n}};t({style:ov(r)})},settings:r})})]})},useBlockProps:function({clientId:e,name:t,style:n}){const i=(0,SS.A)(hF),r=(0,T.useMemo)(()=>{const e=bn(t);if(e){if(!vn(e,"filter.duotone",!1))return null;const t=vn(e,"color.__experimentalDuotone",!1);if(t){const n=wO(e);return"string"==typeof t?Qw(n,t):n}return wO(e,"filter.duotone",{fallback:!0})}},[t]),o=n?.color?.duotone,s=`wp-duotone-${i}`,a=r&&o;return function({clientId:e,id:t,selector:n,attribute:i}){const r=cF({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),o=Array.isArray(i),s=o?void 0:uF(i,r),a="string"==typeof i&&s;let l=null;a?l=s:("string"==typeof i&&!a||o)&&(l=i);const c=n.split(",").map(e=>`.${t}${e.trim()}`).join(", "),u=Array.isArray(l)||"unset"===l;uv(u?{css:"unset"!==l?YD(c,t):KD(c),__unstableType:"presets"}:void 0),uv(u?{assets:"unset"!==l?JD(t,l):"",__unstableType:"svgs"}:void 0);const d=BO(e);(0,T.useEffect)(()=>{if(u&&d&&lF){const e=d.style.display;d.style.setProperty("display","inline-block"),d.offsetHeight,d.style.setProperty("display",e)}},[u,d,l])}({clientId:e,id:s,selector:r,attribute:o}),{className:a?s:""}},attributeKeys:["style"],hasSupport:e=>_n(e,"filter.duotone")};var hF={};function pF(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([0-9])([a-zA-Z])/g,"$1-$2").replace(/([a-zA-Z])([0-9])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function fF(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function mF(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 i=fF(n?.top)||t,r=fF(n?.left)||t;return i===r?i:`${i} ${r}`}(0,Ei.U2)("blocks.registerBlockType","core/editor/duotone/add-attributes",function(e){return _n(e,"filter.duotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e});function gF(e){if(!e||!e?.backgroundImage?.url)return;let t;return e?.backgroundSize||(t={backgroundSize:"cover"}),"contain"!==e?.backgroundSize||e?.backgroundPosition||(t={backgroundPosition:"50% 50%"}),t}var bF={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}}]}},yF={button:"wp-element-button",caption:"wp-element-caption"},vF={__experimentalBorder:"border",color:"color",dimensions:"dimensions",spacing:"spacing",typography:"typography"},_F=(e,t,n)=>{if("core/paragraph"!==n)return e;const i=t?.blocks?.["core/paragraph"];if("all"!==(i?.typography?.textIndent??t?.typography?.textIndent??"subsequent"))return e;const r=".wp-block-paragraph + .wp-block-paragraph";if(r in e){const t=e[r],n={...e};return delete n[r],n[".wp-block-paragraph"]=t,n}return e},xF=(e,t)=>{const n=".wp-block-button";if(!(n in e))return e;const i={...e};return i[n]=i[n].map(e=>{const n=e.match(/^width:\s*(.+)$/);if(!n)return e;const i=n[1];let r=null;i.endsWith("%")&&(r=parseFloat(i));if(null===r&&i.startsWith("var(--wp--preset--dimension--")&&i.endsWith(")")){const e=i.slice(29,-1),n={...t?.dimensions?.dimensionSizes??{},...t?.blocks?.["core/button"]?.dimensions?.dimensionSizes??{}};for(const t of Object.values(n))if(Array.isArray(t)){for(const n of t)if(n.slug===e&&"string"==typeof n.size&&n.size.endsWith("%")){r=parseFloat(n.size);break}if(null!==r)break}}return null===r||isNaN(r)?e:`width: calc(${r} * 1% - (var(--wp--style--block-gap, 0.5em) * (1 - ${r} / 100)))`}),i},kF=(e,t)=>{const n={};return Object.entries(e).forEach(([e,i])=>{if("root"===e||!t?.[e])return;const r="string"==typeof i;if(r||"object"!=typeof i||null===i||Object.entries(i).forEach(([i,r])=>{if("root"===i||!t?.[e][i])return;const o=wF({[e]:{[i]:t[e][i]}});n[r]=[...n[r]||[],...o],delete t[e][i]}),r||"object"==typeof i&&null!==i&&"root"in i){const o=r?i:i.root,s=wF({[e]:t[e]});n[o]=[...n[o]||[],...s],delete t[e]}}),n};function wF(e={},t="",n,i={},r=!1){const o=pC===t,s=Object.entries(nn).reduce((t,[i,{value:r,properties:s,useEngine:a,rootOnly:l}])=>{if(l&&!o)return t;const c=r;if("elements"===c[0]||a)return t;const u=hC(e,c);if("--wp--style--root--padding"===i&&("string"==typeof u||!n))return t;if(s&&"string"!=typeof u)Object.entries(s).forEach(e=>{const[n,i]=e;if(!hC(u,[i],!1))return;const r=n.startsWith("--")?n:pF(n);t.push(`${r}: ${Ex(hC(u,[i]))}`)});else if(hC(e,c,!1)){const n=i.startsWith("--")?i:pF(i);t.push(`${n}: ${Ex(hC(e,c))}`)}return t},[]);return e.background&&(e.background?.backgroundImage&&(e.background.backgroundImage=bC(e.background.backgroundImage,i)),!o&&e.background?.backgroundImage?.id&&(e={...e,background:{...e.background,...gF(e.background)}})),dk(e).forEach(e=>{if(o&&(n||r)&&e.key.startsWith("padding"))return;const t=e.key.startsWith("--")?e.key:pF(e.key);let a=bC(e.value,i);"font-size"===t&&(a=dC({name:"",slug:"",size:a},i?.settings)),"aspect-ratio"===t&&s.push("min-height: unset"),s.push(`${t}: ${a}`)}),s}function CF({layoutDefinitions:e=bF,style:t,selector:n,hasBlockGapSupport:i,hasFallbackGapSupport:r,fallbackGapValue:o}){let s="",a=i?mF(t?.spacing?.blockGap):"";if(r&&(n===pC?a=a||"0.5em":!i&&o&&(a=o)),a&&e&&(Object.values(e).forEach(({className:e,name:t,spacingStyles:r})=>{(i||"flex"===t||"grid"===t)&&r?.length&&r.forEach(t=>{const r=[];if(t.rules&&Object.entries(t.rules).forEach(([e,t])=>{r.push(`${e}: ${t||a}`)}),r.length){let o="";o=i?n===pC?`:root :where(.${e})${t?.selector||""}`:`:root :where(${n}-${e})${t?.selector||""}`:n===pC?`:where(.${e}${t?.selector||""})`:`:where(${n}.${e}${t?.selector||""})`,s+=`${o} { ${r.join("; ")}; }`}})}),n===pC&&i&&(s+=`${fC} { --wp--style--block-gap: ${a}; }`)),n===pC&&e){const t=["block","flex","grid"];Object.values(e).forEach(({className:e,displayMode:i,baseStyles:r})=>{i&&t.includes(i)&&(s+=`${n} .${e} { display:${i}; }`),r?.length&&r.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}var SF=["border","color","dimensions","spacing","typography","filter","outline","shadow","background"];function AF(e){if(!e)return{};const t=Object.entries(e).filter(([e])=>SF.includes(e)).map(([e,t])=>[e,JSON.parse(JSON.stringify(t))]);return Object.fromEntries(t)}var IF=(e,t,n,i,r=!1,o=!1,s={})=>{const a={blockGap:!0,blockStyles:!0,layoutStyles:!0,marginReset:!0,presets:!0,rootPadding:!0,variationStyles:!1,...s},l=((e,t)=>{const n=[];if(!e?.styles)return n;const i=AF(e.styles);return i&&n.push({styles:i,selector:pC,skipSelectorWrapper:!0}),Object.entries(rn).forEach(([t,i])=>{e.styles?.elements?.[t]&&n.push({styles:e.styles?.elements?.[t]??{},selector:i,skipSelectorWrapper:!yF[t]})}),Object.entries(e.styles?.blocks??{}).forEach(([e,i])=>{const r=AF(i),o=i,s=[];if(o?.variations){const n={};Object.entries(o.variations).forEach(([i,r])=>{const o=r;n[i]=AF(o),o?.css&&(n[i].css=o.css);const a="string"!=typeof t?t[e]?.styleVariationSelectors?.[i]:void 0;Object.entries(o?.elements??{}).forEach(([e,t])=>{t&&rn[e]&&s.push({styles:t,selector:gC(a,rn[e])})}),Object.entries(o?.blocks??{}).forEach(([e,n])=>{const i="string"!=typeof t?gC(a,t[e]?.selector):void 0,r="string"!=typeof t?gC(a,t[e]?.duotoneSelector):void 0,o="string"!=typeof t?function(e,t){if(!e||!t)return;const n={};return Object.entries(t).forEach(([t,i])=>{"string"==typeof i&&(n[t]=gC(e,i)),"object"==typeof i&&(n[t]={},Object.entries(i).forEach(([i,r])=>{n[t][i]=gC(e,r)}))}),n}(a,t[e]?.featureSelectors??{}):void 0,l=AF(n);n?.css&&(l.css=n.css),i&&"string"!=typeof t&&(s.push({selector:i,duotoneSelector:r,featureSelectors:o,fallbackGapValue:t[e]?.fallbackGapValue,hasLayoutSupport:t[e]?.hasLayoutSupport,styles:l}),Object.entries(n.elements??{}).forEach(([e,t])=>{t&&rn[e]&&s.push({styles:t,selector:gC(i,rn[e])})}))})}),r.variations=n}"string"!=typeof t&&t?.[e]?.selector&&n.push({duotoneSelector:t[e].duotoneSelector,fallbackGapValue:t[e].fallbackGapValue,hasLayoutSupport:t[e].hasLayoutSupport,selector:t[e].selector,styles:r,featureSelectors:t[e].featureSelectors,styleVariationSelectors:t[e].styleVariationSelectors,name:e}),Object.entries(o?.elements??{}).forEach(([i,r])=>{"string"!=typeof t&&r&&t?.[e]&&rn[i]&&n.push({styles:r,selector:t[e]?.selector.split(",").map(e=>rn[i].split(",").map(t=>e+" "+t)).join(",")})}),n.push(...s)}),n})(e,t),c=((e,t)=>{const n=[];if(!e?.settings)return n;const i=e=>{let t={};return mC.forEach(({path:n})=>{const i=hC(e,n,!1);!1!==i&&(t=function(e,t,n){t=Array.isArray(t)?[...t]:[t],e=Array.isArray(e)?[...e]:{...e};const i=t.pop();let r=e;for(const e of t){const t=r[e];r=r[e]=Array.isArray(t)?[...t]:{...t}}return r[i]=n,e}(t,n,i))}),t},r=i(e.settings),o=e.settings?.custom;return(Object.keys(r).length>0||o)&&n.push({presets:r,custom:o,selector:fC}),Object.entries(e.settings?.blocks??{}).forEach(([e,r])=>{const o=r.custom;if("string"==typeof t||!t[e])return;const s=i(r);(Object.keys(s).length>0||o)&&n.push({presets:s,custom:o,selector:t[e]?.selector,featureSelectors:t[e]?.featureSelectors})}),n})(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+=`${fC} {`,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(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) { padding-right: 0; padding-left: 0; }\n\t\t\t\t.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) > .alignfull { margin-left: 0; margin-right: 0;\n\t\t\t\t"),f+="}"),a.blockStyles&&l.forEach(({selector:t,duotoneSelector:s,styles:l,fallbackGapValue:c,hasLayoutSupport:d,featureSelectors:h,styleVariationSelectors:p,skipSelectorWrapper:m,name:g})=>{if(h){let t=kF(h,l);t=_F(t,e.settings,g),t=xF(t,e.settings),Object.entries(t).forEach(([e,t])=>{if(t.length){const n=t.join(";");f+=`:root :where(${e}){${n};}`}})}if(s){const e={};l?.filter&&(e.filter=l.filter,delete l.filter);const t=wF(e);t.length&&(f+=`${s}{${t.join(";")};}`)}r||pC!==t&&!d||(f+=CF({style:l,selector:t,hasBlockGapSupport:n,hasFallbackGapSupport:i,fallbackGapValue:c}));const b=wF(l,t,u,e,o);b?.length&&(f+=`${m?t:`:root :where(${t})`}{${b.join(";")};}`),l?.css&&(f+=jF(l.css,`:root :where(${t})`)),a.variationStyles&&p&&Object.entries(p).forEach(([n,r])=>{const o=l?.variations?.[n];if(o){if(h){let t=kF(h,o);t=_F(t,e.settings,g),t=xF(t,e.settings),Object.entries(t).forEach(([e,t])=>{if(t.length){const n=function(e,t){const n=e.split(","),i=[];return n.forEach(e=>{i.push(`${t.trim()}${e.trim()}`)}),i.join(", ")}(e,r),i=t.join(";");f+=`:root :where(${n}){${i};}`}})}const n=wF(o,r,u,e);n.length&&(f+=`:root :where(${r}){${n.join(";")};}`),o?.css&&(f+=jF(o.css,`:root :where(${r})`)),d&&o?.spacing?.blockGap&&(f+=CF({style:o,selector:r+t,hasBlockGapSupport:!0,hasFallbackGapSupport:i,fallbackGapValue:c}))}});const y=Object.entries(l).filter(([e])=>e.startsWith(":"));y?.length&&y.forEach(([e,n])=>{const i=wF(n);if(!i?.length)return;const r=`:root :where(${t.split(",").map(t=>t+e).join(",")}){${i.join(";")};}`;f+=r})}),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=mF(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})=>{pC!==e&&fC!==e||(e="");const n=function(e="*",t={}){return mC.reduce((n,{path:i,cssVarInfix:r,classes:o})=>{if(!o)return n;const s=hC(t,i,[]);return["default","theme","custom"].forEach(t=>{s[t]&&s[t].forEach(({slug:t})=>{o.forEach(({classSuffix:i,propertyName:o})=>{const s=`.has-${pF(t)}-${i}`,a=e.split(",").map(e=>`${e}${s}`).join(","),l=`var(--wp--preset--${r}--${pF(t)})`;n+=`${a}{${o}: ${l} !important;}`})})}),n},"")}(e,t);n.length>0&&(f+=n)}),f},EF=(e,t)=>{const{getBlockStyles:n}=(0,xe.L)(Zi),i={};return e.forEach(e=>{const r=e.name,o=wO(e);if(!o)return;let s=wO(e,"filter.duotone");if(!s){const t=wO(e),n=vn(e,"color.__experimentalDuotone",!1);"string"==typeof n&&t&&(s=gC(t,n))}const a=!!e?.supports?.layout||!!e?.supports?.__experimentalLayout,l=e?.supports?.spacing?.blockGap?.__experimentalDefault,c=n(r),u={};c?.forEach(e=>{const n=t?`-${t}`:"",i=`${e.name}${n}`,r=function(e,t){const n=`.is-style-${e}`;if(!t)return n;const i=/((?::\([^)]+\))?\s*)([^\s:]+)/,r=(e,t,i)=>t+i+n;return t.split(",").map(e=>e.replace(i,r)).join(",")}(i,o);u[i]=r});const d=((e,t)=>{if(e?.selectors&&Object.keys(e.selectors).length>0)return e.selectors;const n={root:t};return Object.entries(vF).forEach(([t,i])=>{const r=wO(e,t);r&&(n[i]=r)}),n})(e,o);i[r]={duotoneSelector:s??void 0,fallbackGapValue:l,featureSelectors:Object.keys(d).length?d:void 0,hasLayoutSupport:a,name:r,selector:o,styleVariationSelectors:c?.length?u:void 0}}),i};function jF(e,t){let n="";return e&&""!==e.trim()?(e.split("&").forEach(e=>{if(e&&""!==e.trim())if(e.includes("{")){const i=e.replace("}","").split("{");if(2!==i.length)return;const[r,o]=i,s=r.match(/([>+~\s]*::[a-zA-Z-]+)/),a=s?s[1]:"",l=s?r.replace(a,"").trim():r.trim();let c;c=""===l?t:r.startsWith(" ")?gC(t,l):function(e,t){return e.includes(",")?e.split(",").map(e=>e+t).join(","):e+t}(t,l),n+=`:root :where(${c})${a}{${o.trim()}}`}else n+=`:root :where(${t}){${e.trim()}}`}),n):n}var TF=n(75828);const BF={attribute:/\[\s*(?:(?\*|[-\w\P{ASCII}]*)\|)?(?[-\w\P{ASCII}]+)\s*(?:(?\W?=)\s*(?.+?)\s*(\s(?[iIsS]))?\s*)?\]/gu,id:/#(?[-\w\P{ASCII}]+)/gu,class:/\.(?[-\w\P{ASCII}]+)/gu,comma:/\s*,\s*/g,combinator:/\s*[\s>+~]\s*/g,"pseudo-element":/::(?[-\w\P{ASCII}]+)(?:\((?¶*)\))?/gu,"pseudo-class":/:(?[-\w\P{ASCII}]+)(?:\((?¶*)\))?/gu,universal:/(?:(?\*|[-\w\P{ASCII}]*)\|)?\*/gu,type:/(?:(?\*|[-\w\P{ASCII}]*)\|)?(?[-\w\P{ASCII}]+)/gu},NF=new Set(["combinator","comma"]),RF=(new Set(["not","is","where","has","matches","-moz-any","-webkit-any","nth-child","nth-last-child"]),e=>{switch(e){case"pseudo-element":case"pseudo-class":return new RegExp(BF[e].source.replace("(?¶*)","(?.*)"),"gu");default:return BF[e]}});function OF(e,t){let n=0,i="";for(;t(n.push({value:e,offset:t}),"".repeat(e.length))),e=e.replace(LF,(e,t,i,r)=>(n.push({value:e,offset:r}),`${t}${"".repeat(i.length)}${t}`));{let t,i=0;for(;(t=e.indexOf("(",i))>-1;){const r=OF(e,t);n.push({value:r,offset:t}),e=`${e.substring(0,t)}(${"¶".repeat(r.length-2)})${e.substring(t+r.length)}`,i=t+r.length}}const i=function(e,t=BF){if(!e)return[];const n=[e];for(const[e,i]of Object.entries(t))for(let t=0;te.content).join("");switch(e.type){case"list":return e.list.map(DF).join(",");case"relative":return e.combinator+DF(e.right);case"complex":return DF(e.left)+e.combinator+DF(e.right);case"compound":return e.list.map(DF).join("");default:return e.content}}var FF=n(81951),zF=n(19737),VF=n(96242),UF=n(14686),$F=new Map,HF=[{type:"type",content:"body"},{type:"type",content:"html"},{type:"pseudo-class",content:":root"},{type:"pseudo-class",content:":where(body)"},{type:"pseudo-class",content:":where(:root)"},{type:"pseudo-class",content:":where(html)"}];var WF=(e,t="",n)=>{let i=$F.get(t);return i||(i=new WeakMap,$F.set(t,i)),e.map(e=>{let r=i.get(e);return r||(r=function({css:e,ignoredSelectors:t=[],baseURL:n},i="",r){if(!i&&!n)return e;try{const o=[...t,...r?.ignoredSelectors??[],i];return new FF([i&&VF({prefix:i,transform:(e,t,n)=>o.some(e=>e instanceof RegExp?t.match(e):t.includes(e))?t:HF.some(e=>t.startsWith(e.content))?function(e,t){const n=PF(t),i=n.findLastIndex(({content:e,type:t})=>HF.some(n=>e===n.content&&t===n.type));let r=-1;for(let e=i+1;eo(null),children:r}),(0,Er.jsx)(TF.A,{label:(0,ee.__)("Additional CSS"),value:s,onChange:n=>function(n){t({...e,css:n}),GF(n)?r&&o(null):o((0,ee.__)("The custom CSS is invalid. Do not use <> markup."))}(n),onBlur:function(e){const t=e?.target?.value;if(!t||!GF(t))return;const[n]=WF([{css:t}],".for-validation-only");o(null===n?(0,ee.__)("There is an error with your CSS structure."):null)},className:"block-editor-global-styles-advanced-panel__custom-css-input",spellCheck:!1,help:i})]})}var KF={},YF={};function JF({blockName:e,setAttributes:t,style:n}){if("default"!==Vk())return null;const i=bn(e),r=(0,ee.sprintf)((0,ee.__)("Add your own CSS to customize the appearance of the %s block. You do not need to include a CSS selector, just add the property and value, e.g. color: red;."),i?.title);return(0,Er.jsx)(oC,{group:"advanced",children:(0,Er.jsx)(qF,{value:n,onChange:function(e){const n=e?.css?.trim()?e.css:void 0;t({style:ov({...e,css:n})})},inheritedValue:n,help:r})})}var XF={edit:function({clientId:e,name:t,setAttributes:n}){const{style:i,canEditCSS:r}=(0,zt.A)(t=>{const{getBlockAttributes:n,getSettings:i}=t(Qy);return{style:n(e)?.style||YF,canEditCSS:i().canEditCSS}},[e]);return r?(0,Er.jsx)(JF,{blockName:t,setAttributes:n,style:i}):null},useBlockProps:function({style:e}){const t=e?.css,n="string"==typeof t&&t.trim().length>0&&GF(t),i=(0,SS.A)(KF,"wp-custom-css"),r=`.${i}`;return cv({css:(0,T.useMemo)(()=>{if(n)return jF(t,r)},[t,r,n])}),n?{className:`has-custom-css ${i}`}:{}},addSaveProps:function(e,t,n){if(!_n(t,"customCSS",!0))return e;if(!n?.style?.css?.trim())return e;const i=e.className?`${e.className} has-custom-css`:"has-custom-css";return{...e,className:i}},attributeKeys:["style"],hasSupport:e=>_n(e,"customCSS",!0)},ZF="position",QF={key:"default",value:"",name:(0,ee.__)("Default")},ez={key:"sticky",value:"sticky",name:(0,ee._x)("Sticky","Name for the value of the CSS position property"),hint:(0,ee.__)("The block will stick to the top of the window instead of scrolling.")},tz={key:"fixed",value:"fixed",name:(0,ee._x)("Fixed","Name for the value of the CSS position property"),hint:(0,ee.__)("The block will not move when the page is scrolled.")},nz=["top","right","bottom","left"],iz=["sticky","fixed"];function rz(e){const t=e?.style?.position?.type;return"sticky"===t||"fixed"===t}function oz({name:e}={}){const[t,n]=tv("position.fixed","position.sticky"),i=!t&&!n;return!vn(e,ZF)||i}function sz({style:e={},clientId:t,name:n,setAttributes:i}){const r=function(e){const t=vn(e,ZF);return!(!0!==t&&!t?.fixed)}(n),o=function(e){const t=vn(e,ZF);return!(!0!==t&&!t?.sticky)}(n),s=e?.position?.type,{firstParentClientId:a}=(0,zt.A)(e=>{const{getBlockParents:n}=e(Qy),i=n(t);return{firstParentClientId:i[i.length-1]}},[t]),l=Ej(a),c=o&&s===ez.value&&l?(0,ee.sprintf)((0,ee.__)("The block will stick to the scrollable area of the parent %s block."),l.title):null,u=(0,T.useMemo)(()=>{const e=[QF];return(o||s===ez.value)&&e.push(ez),(r||s===tz.value)&&e.push(tz),e},[r,o,s]),d=s&&u.find(e=>e.value===s)||QF;return Uo.A.select({web:u.length>1?(0,Er.jsx)(oC,{group:"position",children:(0,Er.jsx)(mk.Ay,{help:c,children:(0,Er.jsx)(wR,{__next40pxDefaultSize:!0,label:(0,ee.__)("Position"),hideLabelFromVision:!0,describedBy:(0,ee.sprintf)((0,ee.__)("Currently selected position: %s"),d.name),options:u,value:d,onChange:({selectedItem:t})=>{(t=>{const n={...e,position:{...e?.position,type:t,top:"sticky"===t||"fixed"===t?"0px":void 0}};i({style:ov(n)})})(t.value)},size:"__unstable-large"})})}):null,native:null})}var az={edit:function(e){return oz(e)?null:(0,Er.jsx)(sz,{...e})},useBlockProps:function({name:e,style:t}){const n=_n(e,ZF),i=oz({name:e}),r=n&&!i,o=(0,SS.A)(lz);let s;r&&(s=function({selector:e,style:t}){let n="";const{type:i}=t?.position||{};return iz.includes(i)?(n+=`${e} {`,n+=`position: ${i};`,nz.forEach(e=>{void 0!==t?.position?.[e]&&(n+=`${e}: ${t.position[e]};`)}),"sticky"!==i&&"fixed"!==i||(n+="z-index: 10"),n+="}",n):n}({selector:`.wp-container-${o}.wp-container-${o}`,style:t})||"");const a=(0,mh.A)({[`wp-container-${o}`]:r&&!!s,[`is-position-${t?.position?.type}`]:r&&!!s&&!!t?.position?.type});return cv({css:s}),{className:a}},attributeKeys:["style"],hasSupport:e=>_n(e,ZF)},lz={},cz="is-style-";function uz(e){return e?e.split(/\s+/).reduce((e,t)=>{if(t.startsWith(cz)){const n=t.slice(9);"default"!==n&&e.push(n)}return e},[]):[]}function dz(e,t=[]){const n=uz(e);if(!n)return null;for(const e of n)if(t.some(t=>t.name===e))return e;return null}function hz({override:e}){uv(e)}function pz(e,t,n){if(!e?.styles?.blocks?.[t]?.variations?.[n])return;const i=t=>{Object.keys(t).forEach(n=>{const r=t[n];if("object"==typeof r&&null!==r)if(void 0!==r.ref)if("string"!=typeof r.ref||""===r.ref.trim())delete t[n];else{const i=xp(e,r.ref);i?t[n]=i:delete t[n]}else i(r),0===Object.keys(r).length&&delete t[n]})},r=JSON.parse(JSON.stringify(e.styles.blocks[t].variations[n]));return i(r),r}var fz={hasSupport:()=>!0,attributeKeys:["className"],isMatch:({className:e})=>uz(e).length>0,useBlockProps:function({name:e,className:t,clientId:n}){const{getBlockStyles:i}=(0,zt.A)(Zi),r=dz(t,i(e)),o=`${cz}${r}-${n}`,{settings:s,styles:a}=function(e,t,n){const{globalSettings:i,globalStyles:r}=(0,zt.A)(e=>{const t=e(Qy).getSettings();return{globalSettings:t.__experimentalFeatures,globalStyles:t[Rh]}},[]);return(0,T.useMemo)(()=>{const o=pz({settings:i,styles:r},e,t);return{settings:i,styles:{blocks:{[e]:{variations:{[`${t}-${n}`]:o}}}}}},[i,r,t,n,e])}(e,r,n),l=(0,T.useMemo)(()=>{if(!r)return;const e={settings:s,styles:a},t=EF(yn(),n);return IF(e,t,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1,variationStyles:!0})},[r,s,a,n]);return uv({id:`variation-${n}`,css:l,__unstableType:"variation",variation:r,clientId:n}),r?{className:o}:{}}},mz=n(24071),gz="layout",{kebabCase:bz}=Gh(Ev.j);function yz(e){return _n(e,"layout")||_n(e,"__experimentalLayout")}function vz(e={},t=""){const{layout:n}=e,{default:i}=vn(t,gz)||{},r=n?.inherit||n?.contentSize||n?.wideSize?{...n,type:"constrained"}:n||i||{},o=[];if(Qv[r?.type||"default"]?.className){const e=Qv[r?.type||"default"]?.className,n=t.split("/"),i=`wp-block-${"core"===n[0]?n.pop():n.join("-")}-${e}`;o.push(e,i)}return(0,zt.A)(e=>!(!r?.inherit&&!r?.contentSize&&"constrained"!==r?.type)&&e(Qy).getSettings().__experimentalFeatures?.useRootPaddingAwareAlignments,[r?.contentSize,r?.inherit,r?.type])&&o.push("has-global-padding"),r?.orientation&&o.push(`is-${bz(r.orientation)}`),r?.justifyContent&&o.push(`is-content-justification-${bz(r.justifyContent)}`),r?.flexWrap&&"nowrap"===r.flexWrap&&o.push("is-nowrap"),o}var _z={shareWithChildBlocks:!0,edit:function({layout:e,setAttributes:t,name:n,clientId:i}){const r=dv(n),{layout:o}=r,{themeSupportsLayout:s}=(0,zt.A)(e=>{const{getSettings:t}=e(Qy);return{themeSupportsLayout:t().supportsLayout}},[]);if("default"!==Vk())return null;const a=vn(n,gz,{}),l={...o,...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),y=e||h||{},{inherit:v=!1,contentSize:_=null}=y;if(("default"===g||"constrained"===g)&&!s)return null;const x=Sk(g),k=Sk("constrained"),w=!y.type&&(_||v),C=!!v||!!_,S=e=>t({layout:e});return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(oC,{children:(0,Er.jsxs)(mz.Ay,{title:(0,ee.__)("Layout"),children:[b&&(0,Er.jsx)(Er.Fragment,{children:(0,Er.jsx)(Zv.A,{label:(0,ee.__)("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,ee.__)("Nested blocks use content width with options for full and wide widths."):(0,ee.__)("Nested blocks will fill the width of this container.")})}),!v&&c&&(0,Er.jsx)(xz,{type:g,onChange:e=>t({layout:{type:e}})}),x&&"default"!==x.name&&(0,Er.jsx)(x.inspectorControls,{layout:y,onChange:S,layoutBlockSupport:l,name:n,clientId:i}),k&&w&&(0,Er.jsx)(k.inspectorControls,{layout:y,onChange:S,layoutBlockSupport:l,name:n,clientId:i})]})}),!v&&x&&(0,Er.jsx)(x.toolBarControls,{layout:y,onChange:S,layoutBlockSupport:a,name:n,clientId:i})]})},attributeKeys:["layout"],hasSupport:e=>yz(e)};function xz({type:e,onChange:t}){return(0,Er.jsx)(Jv.A,{__next40pxDefaultSize:!0,isBlock:!0,label:(0,ee.__)("Layout type"),hideLabelFromVision:!0,isAdaptiveWidth:!0,value:e,onChange:t,children:Ck.map(({name:e,label:t})=>(0,Er.jsx)(bk.A,{value:e,label:t},e))})}function kz({block:e,props:t,blockGapSupport:n,globalBlockGapValue:i,layoutClasses:r}){const{name:o,attributes:s}=t,a=(0,SS.A)(e),{layout:l}=s,{default:c}=vn(o,gz)||{},u=l?.inherit||l?.contentSize||l?.wideSize?{...l,type:"constrained"}:l||c||{},d=`wp-container-${bz(o)}-is-layout-`,h=`.${d}${a}`,p=null!==n,f=Sk(u?.type||"default"),m=f?.getLayoutStyle?.({blockName:o,selector:h,layout:u,style:s?.style,hasBlockGapSupport:p,globalBlockGapValue:i}),g=(0,mh.A)({[`${d}${a}`]:!!m},r);return cv({css:m}),(0,Er.jsx)(e,{...t,__unstableLayoutClassNames:g})}var wz=(0,gh.f)(e=>function(t){const{clientId:n,name:i,attributes:r}=t,o=yz(i),s=vz(r,i),a=(0,zt.A)(e=>{if(!o)return;const{getSettings:t,getBlockSettings:s}=Gh(e(Qy)),a=t(),{disableLayoutStyles:l}=a;if(l)return;const[c]=s(n,"spacing.blockGap"),u=a[Rh];let d;const h=r?.className;if(h?.includes("is-style-")){const{getBlockStyles:t}=e(Zi),n=dz(h,t(i));d=n?u?.blocks?.[i]?.variations?.[n]?.spacing?.blockGap:void 0}return{blockGapSupport:c,globalBlockGapValue:d??u?.blocks?.[i]?.spacing?.blockGap??u?.spacing?.blockGap}},[o,n,r?.className,i]);return a?(0,Er.jsx)(kz,{block:e,props:t,layoutClasses:s,...a}):(0,Er.jsx)(e,{...t,__unstableLayoutClassNames:o?s:void 0})},"withLayoutStyles");function Cz(e,t){return Array.from({length:t},(t,n)=>e+n)}(0,Ei.U2)("blocks.registerBlockType","core/layout/addAttribute",function(e){return"type"in(e.attributes?.layout??{})||yz(e)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e}),(0,Ei.U2)("editor.BlockListBlock","core/editor/layout/with-layout-styles",wz);var Sz=class{constructor({columnStart:e,rowStart:t,columnEnd:n,rowEnd:i,columnSpan:r,rowSpan:o}={}){this.columnStart=e??1,this.rowStart=t??1,this.columnEnd=void 0!==r?this.columnStart+r-1:n??this.columnStart,this.rowEnd=void 0!==o?this.rowStart+o-1:i??this.rowStart}get columnSpan(){return this.columnEnd-this.columnStart+1}get rowSpan(){return this.rowEnd-this.rowStart+1}contains(e,t){return e>=this.columnStart&&e<=this.columnEnd&&t>=this.rowStart&&t<=this.rowEnd}containsRect(e){return this.contains(e.columnStart,e.rowStart)&&this.contains(e.columnEnd,e.rowEnd)}intersectsRect(e){return this.columnStart<=e.columnEnd&&this.columnEnd>=e.columnStart&&this.rowStart<=e.rowEnd&&this.rowEnd>=e.rowStart}};function Az(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function Iz(e,t){const n=[];for(const i of e.split(" ")){const e=n[n.length-1],r=e?e.end+t:0,o=r+parseFloat(i);n.push({start:r,end:o})}return n}function Ez(e,t,n="start"){return e.reduce((i,r,o)=>Math.abs(r[n]-t)/ to quickly insert new blocks."),{kbd:(0,Er.jsx)("kbd",{})}),(0,qS.A)((0,ee.__)("Indent a list by pressing space at the beginning of a line."),{kbd:(0,Er.jsx)("kbd",{})}),(0,qS.A)((0,ee.__)("Outdent a list by pressing backspace at the beginning of a line."),{kbd:(0,Er.jsx)("kbd",{})}),(0,ee.__)("Drag files into the editor to automatically insert media blocks."),(0,ee.__)("Change a block's type by pressing the block icon on the toolbar.")],Oz=function(){const[e]=(0,T.useState)(Math.floor(Math.random()*Rz.length));return(0,Er.jsx)(Nz,{children:Rz[e]})},Lz=n(24671),Mz=n(56828),Pz=n(75914),{Badge:Dz}=Gh(Ev.j);function Fz({children:e,onClick:t}){return t?(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,className:"block-editor-block-card__parent-select-button",onClick:t,children:e}):e}var zz=function({title:e,icon:t,description:n,blockType:i,className:r,name:o,allowParentNavigation:s,parentClientId:a,isChild:l,children:c,clientId:u}){i&&((0,Qt.A)("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:e,icon:t,description:n}=i));const{parentBlockClientId:d,parentBlockName:h}=(0,zt.A)(e=>{if(a||l||!s)return{};const{getBlockParents:t,getBlockName:n}=e(Qy),i=t(u,!1).find(e=>{const t=n(e);return"core/navigation"===t||_n(t,"listView")});return{parentBlockClientId:i,parentBlockName:i?n(i):null}},[u,s,l,a]),{selectBlock:p}=(0,Vt.A)(Qy),f=a?"div":"h2";return(0,Er.jsx)("div",{className:(0,mh.A)("block-editor-block-card",{"is-parent":a,"is-child":l},r),children:(0,Er.jsxs)(Q_.A,{children:[(0,Er.jsxs)(Cw.A,{justify:"flex-start",spacing:0,children:[d&&(0,Er.jsx)(fv.Ay,{onClick:()=>p(d),label:h?(0,ee.sprintf)((0,ee.__)('Go to "%s" block'),bn(h)?.title):(0,ee.__)("Go to parent block"),style:{minWidth:24,padding:0},icon:(0,ee.isRTL)()?Lz.A:Mz.A,size:"small"}),l&&(0,Er.jsx)("span",{className:"block-editor-block-card__child-indicator-icon",children:(0,Er.jsx)(IC.A,{icon:(0,ee.isRTL)()?Pz.A:Gv.A})}),(0,Er.jsxs)(Fz,{onClick:a?()=>{p(a)}:void 0,children:[(0,Er.jsx)(hj,{icon:t,showColors:!0}),(0,Er.jsxs)(Q_.A,{spacing:1,children:[(0,Er.jsxs)(f,{className:"block-editor-block-card__title",children:[(0,Er.jsx)("span",{className:"block-editor-block-card__name",children:o?.length?o:e}),!a&&!l&&!!o?.length&&(0,Er.jsx)(Dz,{children:e})]}),c]})]})]}),!a&&!l&&n&&(0,Er.jsx)(lj.A,{className:"block-editor-block-card__description",children:n})]})})},Vz=(e=>(e.Unknown="REDUX_UNKNOWN",e.Add="ADD_ITEM",e.Prepare="PREPARE_ITEM",e.Cancel="CANCEL_ITEM",e.Remove="REMOVE_ITEM",e.RetryItem="RETRY_ITEM",e.PauseItem="PAUSE_ITEM",e.ResumeItem="RESUME_ITEM",e.PauseQueue="PAUSE_QUEUE",e.ResumeQueue="RESUME_QUEUE",e.OperationStart="OPERATION_START",e.OperationFinish="OPERATION_FINISH",e.AddOperations="ADD_OPERATIONS",e.CacheBlobUrl="CACHE_BLOB_URL",e.RevokeBlobUrls="REVOKE_BLOB_URLS",e.UpdateProgress="UPDATE_PROGRESS",e.UpdateSettings="UPDATE_SETTINGS",e))(Vz||{}),Uz=(e=>(e.Queued="QUEUED",e.Processing="PROCESSING",e.Paused="PAUSED",e.Uploaded="UPLOADED",e.Error="ERROR",e))(Uz||{}),$z=(e=>(e.Prepare="PREPARE",e.Upload="UPLOAD",e.ResizeCrop="RESIZE_CROP",e.Rotate="ROTATE",e.TranscodeImage="TRANSCODE_IMAGE",e.ThumbnailGeneration="THUMBNAIL_GENERATION",e.Finalize="FINALIZE",e))($z||{}),Hz="core/upload-media",Wz=["image/jpeg","image/png","image/gif","image/webp","image/avif"],Gz={queue:[],queueStatus:"active",blobUrls:{},settings:{mediaUpload:()=>{},maxConcurrentUploads:5,maxConcurrentImageProcessing:2}},qz=function(e=Gz,t={type:Vz.Unknown}){switch(t.type){case Vz.PauseQueue:return{...e,queueStatus:"paused"};case Vz.ResumeQueue:return{...e,queueStatus:"active"};case Vz.PauseItem:return{...e,queue:e.queue.map(e=>e.id===t.id?{...e,status:Uz.Paused}:e)};case Vz.ResumeItem:return{...e,queue:e.queue.map(e=>e.id===t.id?{...e,status:Uz.Processing}:e)};case Vz.Add:return{...e,queue:[...e.queue,t.item]};case Vz.Cancel:return{...e,queue:e.queue.map(e=>e.id===t.id?{...e,error:t.error}:e)};case Vz.RetryItem:return{...e,queue:e.queue.map(e=>e.id===t.id?{...e,status:Uz.Processing,error:void 0,retryCount:(e.retryCount??0)+1}:e)};case Vz.Remove:return{...e,queue:e.queue.filter(e=>e.id!==t.id)};case Vz.OperationStart:return{...e,queue:e.queue.map(e=>e.id===t.id?{...e,currentOperation:t.operation}:e)};case Vz.AddOperations:return{...e,queue:e.queue.map(e=>e.id!==t.id?e:{...e,operations:[...e.operations||[],...t.operations]})};case Vz.OperationFinish:return{...e,queue:e.queue.map(e=>{if(e.id!==t.id)return e;const n=e.operations?e.operations.slice(1):[],i=e.attachment||t.item.attachment?{...e.attachment,...t.item.attachment}:void 0;return{...e,currentOperation:void 0,operations:n,...t.item,attachment:i,additionalData:{...e.additionalData,...t.item.additionalData}}})};case Vz.CacheBlobUrl:{const n=e.blobUrls[t.id]||[];return{...e,blobUrls:{...e.blobUrls,[t.id]:[...n,t.blobUrl]}}}case Vz.RevokeBlobUrls:{const n={...e.blobUrls};return delete n[t.id],{...e,blobUrls:n}}case Vz.UpdateProgress:return{...e,queue:e.queue.map(e=>e.id===t.id?{...e,progress:t.progress}:e)};case Vz.UpdateSettings:return{...e,settings:{...e.settings,...t.settings}}}return e};function Kz(e){return e.queue}function Yz(e){return e.queue.length>=1}function Jz(e,t){return e.queue.some(e=>e.attachment?.url===t||e.sourceUrl===t)}function Xz(e,t){return e.queue.some(e=>e.attachment?.id===t||e.sourceAttachmentId===t)}function Zz(e){return e.settings}function Qz(e){return e.queue}function eV(e,t){return e.queue.find(e=>e.id===t)}function tV(e,t){return 0===e.queue.filter(e=>t===e.batchId).length}function nV(e,t){return e.queue.some(e=>e.currentOperation===$z.Upload&&e.additionalData.post===t)}function iV(e,t){return e.queue.find(e=>e.status===Uz.Paused&&e.additionalData.post===t)}function rV(e){return"paused"===e.queueStatus}function oV(e,t){return e.blobUrls[t]||[]}function sV(e){return e.queue.filter(e=>e.currentOperation===$z.Upload).length}function aV(e){return e.queue.filter(e=>(Array.isArray(e.operations?.[0])?e.operations[0][0]:e.operations?.[0])===$z.Upload&&e.currentOperation!==$z.Upload)}function lV(e){return e.queue.filter(e=>e.currentOperation===$z.ResizeCrop||e.currentOperation===$z.Rotate).length}function cV(e){return e.queue.filter(e=>{const t=Array.isArray(e.operations?.[0])?e.operations[0][0]:e.operations?.[0];return(t===$z.ResizeCrop||t===$z.Rotate)&&e.currentOperation!==$z.ResizeCrop&&e.currentOperation!==$z.Rotate})}function uV(e){return e.queue.filter(e=>void 0!==e.error)}function dV(e,t){return e.queue.some(e=>e.parentId===t)}function hV(e,t){const n=e.queue.find(e=>e.id===t);return n?.progress}var pV,fV,mV=class extends File{width=0;height=0;originalWidth=0;originalHeight=0;get wasResized(){return(this.originalWidth||0)>this.width||(this.originalHeight||0)>this.height}constructor(e,t,n,i,r){super([e],e.name,{type:e.type,lastModified:e.lastModified}),this.width=t,this.height=n,this.originalWidth=i,this.originalHeight=r}};function gV(e,t){return new File([e],t,{type:e.type,lastModified:e.lastModified})}function bV(e){return gV(e,e.name)}function yV(e){return e.includes(".")?e.split(".").slice(0,-1).join("."):e}function vV(){return pV||(pV=n.e(223).then(n.bind(n,30410)).then(e=>(fV=e,e))),pV}async function _V(e,t,n,i){if(i?.aborted)throw new Error("Operation aborted");if(1===n)return t;const{vipsRotateImage:r}=await vV(),{buffer:o,width:s,height:a}=await r(e,await t.arrayBuffer(),t.type,n),l=yV(t.name),c=t.name.replace(l,`${l}-rotated`);return new mV(new File([new Blob([o],{type:t.type})],c,{type:t.type}),s,a)}var xV=class extends Error{code;file;constructor({code:e,message:t,file:n,cause:i}){super(t,{cause:i}),Object.setPrototypeOf(this,new.target.prototype),this.code=e,this.file=n}};function kV(e,t){if(!t)return;const n=t.some(t=>t.includes("/")?t===e.type:e.type.startsWith(`${t}/`));if(e.type&&!n)throw new xV({code:"MIME_TYPE_NOT_SUPPORTED",message:(0,ee.sprintf)((0,ee.__)("%s: Sorry, this file type is not supported here."),e.name),file:e})}function wV(e,t){const n=(i=t)?Object.entries(i).flatMap(([e,t])=>{const[n]=t.split("/");return[t,...e.split("|").map(e=>`${n}/${e}`)]}):null;var i;if(!n)return;const r=n.includes(e.type);if(e.type&&!r)throw new xV({code:"MIME_TYPE_NOT_ALLOWED_FOR_USER",message:(0,ee.sprintf)((0,ee.__)("%s: Sorry, you are not allowed to upload this file type."),e.name),file:e})}function CV(e,t){if(e.size<=0)throw new xV({code:"EMPTY_FILE",message:(0,ee.sprintf)((0,ee.__)("%s: This file is empty."),e.name),file:e});if(t&&e.size>t)throw new xV({code:"SIZE_ABOVE_LIMIT",message:(0,ee.sprintf)((0,ee.__)("%s: This file exceeds the maximum upload size for this site."),e.name),file:e})}function SV({files:e,onChange:t,onSuccess:n,onError:i,onBatchSuccess:r,additionalData:o,allowedTypes:s}){return async({select:a,dispatch:l})=>{const c=(0,Qi.A)();for(const u of e){try{kV(u,s),wV(u,a.getSettings().allowedMimeTypes)}catch(e){i?.(e);continue}try{CV(u,a.getSettings().maxUploadFileSize)}catch(e){i?.(e);continue}l.addItem({file:u,batchId:c,onChange:t,onSuccess:n,onBatchSuccess:r,onError:i,additionalData:o})}}}function AV(e,t,n=!1){return async({select:i,dispatch:r})=>{const o=i.getItem(e);if(o){if(o.abortController?.abort(),await async function(e){return!!fV&&fV.vipsCancelOperations(e)}(e),!n){const{onError:e}=o;e?.(t??new Error("Upload cancelled")),!e&&t&&console.error("Upload cancelled",t)}r({type:Vz.Cancel,id:e,error:t}),r.removeItem(e),r.revokeBlobUrls(e),o.batchId&&i.isBatchUploaded(o.batchId)&&o.onBatchSuccess?.()}}}function IV(e){return async({select:t,dispatch:n})=>{const i=t.getItem(e);i&&i.error&&(n({type:Vz.RetryItem,id:e}),n.processItem(e))}}var EV=class extends File{constructor(e="stub-file"){super([],e)}},jV=.82;function TV({file:e,batchId:t,onChange:n,onSuccess:i,onBatchSuccess:r,onError:o,additionalData:s={},sourceUrl:a,sourceAttachmentId:l,abortController:c,operations:u}){return async({dispatch:d})=>{const h=(0,Qi.A)(),p=function(e){if(e instanceof File)return e;if("name"in e&&"string"==typeof e.name)return new File([e],e.name,{type:e.type,lastModified:e.lastModified});const t=e.type.split("/")[1],n="application/pdf"===e.type?"document":e.type.split("/")[0];return new File([e],`${n}.${t}`,{type:e.type})}(e);let f;p instanceof EV||(f=Ps(p),d({type:Vz.CacheBlobUrl,id:h,blobUrl:f})),d({type:Vz.Add,item:{id:h,batchId:t,status:Uz.Processing,sourceFile:bV(p),file:p,attachment:{url:f},additionalData:{convert_format:!1,generate_sub_sizes:!1,...s},onChange:n,onSuccess:i,onBatchSuccess:r,onError:o,sourceUrl:a,sourceAttachmentId:l,abortController:c||new AbortController,operations:Array.isArray(u)?u:[$z.Prepare]}}),d.processItem(h)}}function BV({file:e,onChange:t,additionalData:n,operations:i,batchId:r,parentId:o}){return({dispatch:s})=>{const a=(0,Qi.A)();s({type:Vz.Add,item:{id:a,batchId:r,status:Uz.Processing,sourceFile:bV(e),file:e,onChange:t,additionalData:{...n},parentId:o,operations:Array.isArray(i)?i:[$z.Prepare],abortController:new AbortController}}),s.processItem(a)}}function NV(e){return async({select:t,dispatch:n})=>{if(t.isPaused())return;const i=t.getItem(e);if(!i)return;const{attachment:r,onChange:o,onSuccess:s,onBatchSuccess:a,batchId:l,parentId:c}=i,u=Array.isArray(i.operations?.[0])?i.operations[0][0]:i.operations?.[0],d=Array.isArray(i.operations?.[0])?i.operations[0][1]:void 0;if(function(e,t,n){return!(t!==$z.Upload||!e.parentId||!e.additionalData.post)&&n.isUploadingToPost(e.additionalData.post)}(i,u,t))n({type:Vz.PauseItem,id:e});else{if(u===$z.Upload){const e=t.getSettings();if(t.getActiveUploadCount()>=e.maxConcurrentUploads)return}if(u===$z.ResizeCrop||u===$z.Rotate){const e=t.getSettings();if(t.getActiveImageProcessingCount()>=e.maxConcurrentImageProcessing)return}if(r&&o?.([r]),u){if(u!==$z.Finalize||!t.hasPendingItemsByParentId(e))switch(n({type:Vz.OperationStart,id:e,operation:u}),u){case $z.Prepare:n.prepareItem(i.id);break;case $z.ResizeCrop:n.resizeCropItem(i.id,d);break;case $z.Rotate:n.rotateItem(i.id,d);break;case $z.TranscodeImage:n.transcodeImageItem(i.id,d);break;case $z.Upload:i.parentId?n.sideloadItem(e):n.uploadItem(e);break;case $z.ThumbnailGeneration:n.generateThumbnails(e);break;case $z.Finalize:n.finalizeItem(e)}}else if((c||!c&&!t.hasPendingItemsByParentId(e))&&(r&&s?.([r]),n.removeItem(e),n.revokeBlobUrls(e),l&&t.isBatchUploaded(l)&&a?.()),c&&l&&t.isBatchUploaded(l)){const e=t.getItem(c);if(!e)return;if(e.operations&&e.operations.length>0)return void n.processItem(c);r&&e.onSuccess?.([r]),n.removeItem(c),n.revokeBlobUrls(c),e.batchId&&t.isBatchUploaded(e.batchId)&&e.onBatchSuccess?.()}}}}function RV(){return{type:Vz.PauseQueue}}function OV(){return async({select:e,dispatch:t})=>{t({type:Vz.ResumeQueue});for(const n of e.getAllItems())t.processItem(n.id)}}function LV(e){return async({dispatch:t})=>{t({type:Vz.PauseItem,id:e})}}function MV(e){return async({select:t,dispatch:n})=>{const i=t.getPausedUploadForPost(e);i&&(n({type:Vz.ResumeItem,id:i.id}),n.processItem(i.id))}}function PV(e){return async({select:t,dispatch:n})=>{t.getItem(e)&&(n({type:Vz.Remove,id:e}),0===t.getAllItems().length&&fV&&fV.terminateVipsWorker())}}function DV(e,t){return async({select:n,dispatch:i})=>{const r=n.getItem(e),o=r?.currentOperation;if(i({type:Vz.OperationFinish,id:e,item:t}),i.processItem(e),o===$z.Upload){const e=n.getPendingUploads();for(const t of e)i.processItem(t.id)}if(o===$z.ResizeCrop||o===$z.Rotate){const e=n.getPendingImageProcessing();for(const t of e)i.processItem(t.id)}}}var FV=["jpeg","webp","avif","png","gif"];function zV(e,t){switch(e){case"image/jpeg":return t.jpegInterlaced??!1;case"image/png":return t.pngInterlaced??!1;case"image/gif":return t.gifInterlaced??!1;default:return!1}}async function VV(e,t,n){if("image/png"===e.type&&"image/jpeg"===t){const t=Ps(e);try{if(await async function(e){const{vipsHasTransparency:t}=await vV(),n=await fetch(e);if(!n.ok)throw new Error(`Failed to fetch image: ${n.status}`);return t(await n.arrayBuffer())}(t))return null}catch{return null}finally{Ds(t)}}const i=t.split("/")[1];return r=i,FV.includes(r)?[$z.TranscodeImage,{outputFormat:i,outputQuality:jV,interlaced:zV(t,n)}]:null;var r}function UV(e){return async({select:t,dispatch:n})=>{const i=t.getItem(e);if(!i)return;const{file:r}=i,o=[],s=t.getSettings(),a=r.type.startsWith("image/"),l=Wz.includes(r.type);if(a&&l){const{imageOutputFormats:e}=s,t=e?.[r.type];if(t&&t!==r.type){const e=await VV(r,t,s);e&&o.push(e)}o.push($z.Upload,$z.ThumbnailGeneration,$z.Finalize)}else o.push($z.Upload);n({type:Vz.AddOperations,id:e,operations:o});const c=l&&a?{}:{additionalData:{...i.additionalData,generate_sub_sizes:!0,convert_format:!0}};n.finishOperation(e,c)}}function $V(e){return async({select:t,dispatch:n})=>{const i=t.getItem(e);i&&t.getSettings().mediaUpload({filesList:[i.file],additionalData:i.additionalData,signal:i.abortController?.signal,onFileChange:([t])=>{t&&!Fs(t.url)&&n.finishOperation(e,{attachment:t})},onSuccess:([t])=>{n.finishOperation(e,{attachment:t})},onError:t=>{n.cancelItem(e,t)}})}}function HV(e){return async({select:t,dispatch:n})=>{const i=t.getItem(e);if(!i)return;const{post:r,...o}=i.additionalData,s=t.getSettings().mediaSideload;s?s({file:i.file,attachmentId:r,additionalData:o,signal:i.abortController?.signal,onFileChange:([t])=>{n.finishOperation(e,{attachment:t}),n.resumeItemByPostId(r)},onError:t=>{n.cancelItem(e,t),n.resumeItemByPostId(r)}}):n.finishOperation(e,{})}}function WV(e,t){return async({select:n,dispatch:i})=>{const r=n.getItem(e);if(!r)return;if(!t?.resize)return void i.finishOperation(e,{file:r.file});const o=Boolean(r.parentId),s=Boolean(t.isThresholdResize);try{const n=await async function(e,t,n,i,r,o,s){if(o?.aborted)throw new Error("Operation aborted");const{vipsResizeImage:a}=await vV(),{buffer:l,width:c,height:u,originalWidth:d,originalHeight:h}=await a(e,await t.arrayBuffer(),t.type,n,!1,void 0);let p=t.name;if(d>c||h>u){const e=yV(t.name);s?p=t.name.replace(e,`${e}-scaled`):r&&(p=t.name.replace(e,`${e}-${c}x${u}`))}return new mV(new File([new Blob([l],{type:t.type})],p,{type:t.type}),c,u,d,h)}(r.id,r.file,t.resize,0,o,r.abortController?.signal,s),a=Ps(n);i({type:Vz.CacheBlobUrl,id:e,blobUrl:a}),i.finishOperation(e,{file:n,attachment:{url:a}})}catch(t){i.cancelItem(e,new xV({code:"IMAGE_TRANSCODING_ERROR",message:"File could not be uploaded",file:r.file,cause:t instanceof Error?t:void 0}))}}}function GV(e,t){return async({select:n,dispatch:i})=>{const r=n.getItem(e);if(r)if(t?.orientation&&1!==t.orientation)try{const n=await _V(r.id,r.file,t.orientation,r.abortController?.signal),o=Ps(n);i({type:Vz.CacheBlobUrl,id:e,blobUrl:o}),i.finishOperation(e,{file:n,attachment:{url:o}})}catch(t){i.cancelItem(e,new xV({code:"IMAGE_ROTATION_ERROR",message:"Image could not be rotated",file:r.file,cause:t instanceof Error?t:void 0}))}else i.finishOperation(e,{file:r.file})}}function qV(e,t){return async({select:n,dispatch:i})=>{const r=n.getItem(e);if(!r)return;if(!t?.outputFormat)return void i.finishOperation(e,{file:r.file});const o=`image/${t.outputFormat}`,s=t.outputQuality??jV,a=t.interlaced??!1;try{const t=await async function(e,t,n,i,r){const{vipsConvertImageFormat:o}=await vV(),s=await o(e,await t.arrayBuffer(),t.type,n,i,r),a=n.split("/")[1],l=`${yV(t.name)}.${a}`;return new File([new Blob([s])],l,{type:n})}(r.id,r.file,o,s,a),n=Ps(t);i({type:Vz.CacheBlobUrl,id:e,blobUrl:n}),i.finishOperation(e,{file:t,attachment:{url:n}})}catch(t){i.cancelItem(e,new xV({code:"MEDIA_TRANSCODING_ERROR",message:"Image could not be transcoded to the target format",file:r.file,cause:t instanceof Error?t:void 0}))}}}function KV(e){return async({select:t,dispatch:n})=>{const i=t.getItem(e);if(!i)return;if(!i.attachment)return void n.finishOperation(e,{});const r=i.attachment;if(r.exif_orientation&&1!==r.exif_orientation&&!i.file.name.includes("-scaled")&&r.id)try{const e=await _V(i.id,i.sourceFile,r.exif_orientation,i.abortController?.signal);n.addSideloadItem({file:e,batchId:(0,Qi.A)(),parentId:i.id,additionalData:{post:r.id,image_size:"original",convert_format:!1},operations:[$z.Upload]})}catch{console.warn("Failed to rotate image, continuing with thumbnails")}if(!i.parentId&&r.missing_image_sizes&&r.missing_image_sizes.length>0){const e=t.getSettings(),o=e.allImageSizes||{},s=r.missing_image_sizes,a=r.filename?gV(i.sourceFile,r.filename):i.sourceFile,l=(0,Qi.A)(),{imageOutputFormats:c}=e,u=i.sourceFile.type,d=c?.[u];let h=null;d&&d!==u&&(h=await VV(i.sourceFile,d,e));const p=h?`image/${h[1].outputFormat}`:u,f=h?h[1].outputQuality??jV:jV,m=[];for(const e of s){const t=o[e];t?m.push({name:e,resize:t,quality:f}):console.warn(`Image size "${e}" not found in configuration`)}const{bigImageSizeThreshold:g}=e;let b=!1;if(g&&r.id){const e=await createImageBitmap(i.sourceFile);b=e.width>g||e.height>g,e.close(),b&&m.push({name:"scaled",resize:{width:g,height:g},quality:f,scaledSuffix:!0})}let y=null;if(m.length>0)try{y=await async function(e,t,n,i,r=!1){const{vipsBatchResizeImage:o}=await vV(),s=i.map(e=>({resize:{...e.resize},quality:e.quality})),a=await o(e,await t.arrayBuffer(),t.type,n,s,r),l=n.split("/")[1],c=yV(t.name);return a.map((e,t)=>{const r=i[t],{width:o,height:s,originalWidth:a,originalHeight:u}=e;let d=`${c}.${l}`;return(a>o||u>s)&&(d=r.scaledSuffix?`${c}-scaled.${l}`:`${c}-${o}x${s}.${l}`),{name:r.name,file:new mV(new File([new Blob([e.buffer],{type:n})],d,{type:n}),o,s,a,u)}})}(i.id,a,p,m,!1)}catch{console.warn("Batch resize failed, falling back to per-thumbnail processing")}if(y)for(const e of y)n.addSideloadItem({file:e.file,onChange:([e])=>{Fs(e.url)||i.onChange?.([e])},batchId:l,parentId:i.id,additionalData:{post:r.id,image_size:e.name,convert_format:!1},operations:[$z.Upload]});else{for(const e of s){const t=o[e];if(!t)continue;const s=[[$z.ResizeCrop,{resize:t}]];h&&s.push(h),s.push($z.Upload),n.addSideloadItem({file:a,onChange:([e])=>{Fs(e.url)||i.onChange?.([e])},batchId:l,parentId:i.id,additionalData:{post:r.id,image_size:e,convert_format:!1},operations:s})}if(b&&g&&r.id){const e=[[$z.ResizeCrop,{resize:{width:g,height:g},isThresholdResize:!0}]];h&&e.push(h),e.push($z.Upload),n.addSideloadItem({file:a,onChange:([e])=>{Fs(e.url)||i.onChange?.([e])},batchId:l,parentId:i.id,additionalData:{post:r.id,image_size:"scaled",convert_format:!1},operations:e})}}}n.finishOperation(e,{})}}function YV(e){return async({select:t,dispatch:n})=>{const i=t.getItem(e);if(!i)return;const r=i.attachment,{mediaFinalize:o}=t.getSettings();if(r?.id&&o)try{await o(r.id)}catch(e){console.warn("Media finalization failed:",e)}n.finishOperation(e,{})}}function JV(e){return async({select:t,dispatch:n})=>{const i=t.getBlobUrls(e);for(const e of i)Ds(e);n({type:Vz.RevokeBlobUrls,id:e})}}function XV(e,t){return async({dispatch:n})=>{n({type:Vz.UpdateProgress,id:e,progress:t})}}function ZV(e){return{type:Vz.UpdateSettings,settings:e}}var{lock:QV,unlock:eU}=(0,pt.yf)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/upload-media"),tU={reducer:qz,selectors:p,actions:m},nU=(0,P.A)(Hz,{reducer:qz,selectors:p,actions:m});(0,xe.L)(nU)||(0,D.register)(nU),eU(nU).registerPrivateActions(g),eU(nU).registerPrivateSelectors(f);var iU=n(77339),rU=n(10887),oU=(0,gh.f)(e=>({useSubRegistry:t=!0,...n})=>{const i=(0,yt.A)(),[r]=(0,T.useState)(()=>new WeakMap),o=function(e,t,n){if(!n)return t;let i=e.get(t);return i||(i=(0,iU.I)({},t),i.registerStore(Hz,tU),e.set(t,i)),i}(r,i,t);return o===i?(0,Er.jsx)(e,{registry:i,...n}):(0,Er.jsx)(rU.Ay,{value:o,children:(0,Er.jsx)(e,{registry:o,...n})})},"withRegistryProvider")(e=>{const{children:t,settings:n}=e,{updateSettings:i}=eU((0,Vt.A)(nU));return(0,T.useEffect)(()=>{i(n)},[n,i]),(0,Er.jsx)(Er.Fragment,{children:t})}),sU=oU,aU=null;var lU=(0,gh.f)(e=>function({useSubRegistry:t=!0,...n}){const i=(0,yt.A)(),[r]=(0,T.useState)(()=>new WeakMap),o=function(e,t,n){if(!n)return t;let i=e.get(t);return i||(i=(0,iU.I)({},t),i.registerStore(fp,Zy),e.set(t,i)),i}(r,i,t);return o===i?(0,Er.jsx)(e,{registry:i,...n}):(0,Er.jsx)(rU.Ay,{value:o,children:(0,Er.jsx)(e,{registry:o,...n})})},"withRegistryProvider"),cU=(0,T.createContext)({getSelection:()=>{},onChangeSelection:()=>{}}),uU=()=>{};function dU(e,t){const n=ir(e);return t.externalToInternal.set(e.clientId,n.clientId),t.internalToExternal.set(n.clientId,e.clientId),e.innerBlocks?.length&&(n.innerBlocks=e.innerBlocks.map(e=>dU(e,t))),n}function hU(e,t){return e.map(e=>{const n=t.internalToExternal.get(e.clientId);return{...e,clientId:n??e.clientId,innerBlocks:hU(e.innerBlocks,t)}})}function pU(e,t){const{selectionStart:n,selectionEnd:i,initialPosition:r}=e,o=e=>{if(!e?.clientId)return e;const n=t.internalToExternal.get(e.clientId);return{...e,clientId:n??e.clientId}};return{selectionStart:o(n),selectionEnd:o(i),initialPosition:r}}function fU({clientId:e=null,value:t,onChange:n=uU,onInput:i=uU}){const r=(0,yt.A)(),{getSelection:o,onChangeSelection:s}=(0,T.useContext)(cU),{resetBlocks:a,resetSelection:l,replaceInnerBlocks:c,setHasControlledInnerBlocks:u,__unstableMarkNextChangeAsNotPersistent:d}=r.dispatch(Qy),{getBlockName:h,getBlocks:p,getSelectionStart:f,getSelectionEnd:m}=r.select(Qy),g=(0,T.useRef)({incoming:null,outgoing:[]}),b=(0,T.useRef)(!1),y=(0,T.useRef)({externalToInternal:new Map,internalToExternal:new Map}),v=(0,T.useRef)(null),_=(0,T.useRef)(!1),x=()=>{t&&(e?r.batch(()=>{y.current.externalToInternal.clear(),y.current.internalToExternal.clear();const n=t.map(e=>dU(e,y.current));u(e,!0),b.current&&(g.current.incoming=n),d(),c(e,n),v.current=null}):(b.current&&(g.current.incoming=t),d(),a(t)))},k=(0,T.useRef)(i),w=(0,T.useRef)(n);(0,T.useEffect)(()=>{k.current=i,w.current=n},[i,n]),(0,T.useEffect)(()=>{const n=g.current.outgoing.includes(t),i=p(e)===t;n?g.current.outgoing[g.current.outgoing.length-1]===t&&(g.current.outgoing=[]):i||(g.current.outgoing=[],x(),(()=>{const t=o();if(!t?.selectionStart?.clientId||t===v.current)return;const n=t.selectionStart.clientId;if(e?y.current.externalToInternal.has(n):h(n)){v.current=t;const n=t=>t?.clientId&&e?{...t,clientId:y.current.externalToInternal.get(t.clientId)??t.clientId}:t;_.current=!0,l(n(t.selectionStart),n(t.selectionEnd),t.initialPosition),_.current=!1}})())},[t,e]),(0,T.useEffect)(()=>{const{getSelectedBlocksInitialCaretPosition:t,isLastBlockChangePersistent:n,__unstableIsLastBlockChangeIgnored:i,areInnerBlocksControlled:o,getBlockParents:a}=r.select(Qy);let l=p(e),c=n(),u=!1,d=f(),v=m();b.current=!0;const x=r.subscribe(()=>{if(null!==e&&null===h(e))return;const b=n(),x=p(e),C=x!==l;if(l=x,C&&(g.current.incoming||i()))return g.current.incoming=null,void(c=b);const S=C||u&&!C&&b&&!c,A=f(),I=m(),E=A!==d||I!==v;E&&(d=A,v=I),(S||E)&&r.batch(()=>{if(S){c=b;const n=e?hU(l,y.current):l,i={selectionStart:A,selectionEnd:I,initialPosition:t()},r=e?pU(i,y.current):i;g.current.outgoing.push(n),(c?w.current:k.current)(n,{selection:r})}if(E&&!S&&A?.clientId&&!_.current&&(e?y.current.internalToExternal.has(A.clientId):!a(A.clientId).some(e=>o(e)))){const n={selectionStart:A,selectionEnd:I,initialPosition:t()};s(e?pU(n,y.current):n)}}),u=C},Qy);return()=>{b.current=!1,x()}},[r,e]),(0,T.useEffect)(()=>()=>{d(),e?(u(e,!1),d(),c(e,[])):a([])},[])}function mU(){return null}mU.Register=function(){const{registerShortcut:e}=(0,Vt.A)($T.M_);return(0,T.useEffect)(()=>{e({name:"core/block-editor/copy",category:"block",description:(0,ee.__)("Copy the selected block(s)."),keyCombination:{modifier:"primary",character:"c"}}),e({name:"core/block-editor/cut",category:"block",description:(0,ee.__)("Cut the selected block(s)."),keyCombination:{modifier:"primary",character:"x"}}),e({name:"core/block-editor/paste",category:"block",description:(0,ee.__)("Paste the selected block(s)."),keyCombination:{modifier:"primary",character:"v"}}),e({name:"core/block-editor/duplicate",category:"block",description:(0,ee.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,ee.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/paste-styles",category:"block",description:(0,ee.__)("Paste the copied style to the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"v"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,ee.__)("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,ee.__)("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,ee.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/stop-editing-as-blocks",category:"block",description:(0,ee.__)("Finish editing a design."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/select-all",category:"selection",description:(0,ee.__)("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,ee.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/multi-text-selection",category:"selection",description:(0,ee.__)("Select text across multiple blocks."),keyCombination:{modifier:"shift",character:"arrow"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,ee.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,ee.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,ee.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}}),e({name:"core/block-editor/collapse-list-view",category:"list-view",description:(0,ee.__)("Collapse all other items."),keyCombination:{modifier:"alt",character:"l"}}),e({name:"core/block-editor/group",category:"block",description:(0,ee.__)("Create a group block from the selected multiple blocks."),keyCombination:{modifier:"primary",character:"g"}}),e({name:"core/block-editor/toggle-block-visibility",category:"block",description:(0,ee.__)("Show or hide the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"h"}}),e({name:"core/block-editor/rename",category:"block",description:(0,ee.__)("Rename the selected block."),keyCombination:{modifier:"primaryAlt",character:"r"}})},[e]),null};var gU=mU,bU=()=>{},yU=!1,vU=null;function _U(e,t,{allowedTypes:n,additionalData:i={},filesList:r,onError:o=bU,onFileChange:s,onSuccess:a,onBatchSuccess:l}){e.dispatch(nU).addItems({files:Array.from(r),onChange:s,onSuccess:e=>{t?.[Hh]?.(e),a?.(e)},onBatchSuccess:l,onError:e=>o("string"==typeof e?e:e?.message??""),additionalData:i,allowedTypes:n})}function xU(e){return fU(e),null}var kU=lU(e=>{const{settings:t,registry:n,stripExperimentalSettings:i=!1}=e,r=function(e={}){return(0,T.useMemo)(()=>({mediaUpload:e.mediaUpload,mediaSideload:e.mediaSideload,mediaFinalize:e.mediaFinalize,maxUploadFileSize:e.maxUploadFileSize,allowedMimeTypes:e.allowedMimeTypes,allImageSizes:e.allImageSizes,bigImageSizeThreshold:e.bigImageSizeThreshold}),[e])}(t),o=function(){if(null!==vU)return vU;if(!window.__clientSideMediaProcessing)return vU=!1,!1;const e=function(){if(null!==aU)return aU;if("undefined"==typeof WebAssembly)return aU={supported:!1,reason:"WebAssembly is not supported in this browser."};if("undefined"==typeof SharedArrayBuffer)return aU={supported:!1,reason:"SharedArrayBuffer is not available. This may be due to missing cross-origin isolation headers."};if("undefined"==typeof Worker)return aU={supported:!1,reason:"Web Workers are not supported in this browser."};if("undefined"!=typeof navigator&&"deviceMemory"in navigator&&navigator.deviceMemory<=2)return aU={supported:!1,reason:"Device has insufficient memory for client-side media processing."};if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency<2)return aU={supported:!1,reason:"Device has insufficient CPU cores for client-side media processing."};if("undefined"!=typeof navigator){const e=navigator.connection;if(e){if(e.saveData)return aU={supported:!1,reason:"Data saver mode is enabled."};if("slow-2g"===e.effectiveType||"2g"===e.effectiveType)return aU={supported:!1,reason:"Network connection is too slow for client-side media processing."}}}if("undefined"!=typeof window)try{const e=new Blob([""],{type:"application/javascript"}),t=URL.createObjectURL(e);try{new Worker(t).terminate()}finally{URL.revokeObjectURL(t)}}catch{return aU={supported:!1,reason:"The site's Content Security Policy (CSP) does not allow blob: workers. The worker-src directive must include blob: to enable client-side media processing."}}return aU={supported:!0}}();return e&&e.supported?(vU=!0,!0):(yU||(console.info(`Client-side media processing unavailable: ${e.reason}. Using server-side processing.`),yU=!0),vU=!1,!1)}(),s=!!t?.mediaUpload?.__isMediaUploadInterceptor,a=(0,T.useMemo)(()=>{if(o&&t?.mediaUpload&&!s){const e=_U.bind(null,n,t);return e.__isMediaUploadInterceptor=!0,{...t,mediaUpload:e}}return t},[t,n,o,s]),{__experimentalUpdateSettings:l}=Gh((0,Vt.A)(Qy));(0,T.useEffect)(()=>{l({...a,__internalIsInitialized:!0},{stripExperimentalSettings:i,reset:!0})},[a,i,l]);const c=(0,T.useRef)(e.selection);c.current=e.selection;const u=(0,T.useRef)(e.onChangeSelection??bU);u.current=e.onChangeSelection??bU;const d=(0,T.useMemo)(()=>({getSelection:()=>c.current,onChangeSelection:(...e)=>u.current(...e)}),[]),h=(0,Er.jsxs)(Sv.Kq,{passthrough:!0,children:[!a?.isPreviewMode&&(0,Er.jsx)(gU.Register,{}),(0,Er.jsx)(IO,{children:e.children})]}),p=(0,Er.jsxs)(cU.Provider,{value:d,children:[(0,Er.jsx)(xU,{clientId:e.clientId,value:e.value,onChange:e.onChange,onInput:e.onInput}),h]});return o&&!s?(0,Er.jsx)(sU,{settings:r,useSubRegistry:!1,children:p}):p}),wU=e=>(0,Er.jsx)(kU,{...e,stripExperimentalSettings:!0,children:e.children}),CU={name:"u2jump",styles:"position:relative;pointer-events:none;&::after{content:'';position:absolute;top:0;right:0;bottom:0;left:0;}*{pointer-events:none;}"},SU=(0,T.createContext)(!1);SU.displayName="DisabledContext";var AU=SU,{Consumer:IU,Provider:EU}=AU;function jU({className:e,children:t,isDisabled:n=!0,...i}){const r=(0,Pw.l)();return(0,Er.jsx)(EU,{value:n,children:(0,Er.jsx)("div",{inert:n?"true":void 0,className:n?r(CU,e,"components-disabled"):void 0,...i,children:t})})}jU.Context=AU,jU.Consumer=IU;var TU=jU,BU=n(13920),NU="core/pattern-overrides";function RU(e){return e?.__default?.source===NU}function OU(e,t){if(RU(e)){const n={};for(const i of t){const t=e[i]?e[i]:{source:NU};n[i]=t}return n}return e}var LU={},MU=gS("editor.BlockEdit")(e=>{const{name:t}=e,n=bn(t);if(!n)return null;const i=n.edit||n.save;return(0,Er.jsx)(i,{...e})}),PU=e=>{const{name:t,clientId:n,attributes:i,setAttributes:r}=e,o=(0,yt.A)(),s=bn(t),a=(0,T.useContext)(Sj),l=(0,zt.A)(e=>Gh(e(Zi)).getAllBlockBindingsSources(),[]),{bindableAttributes:c}=(0,T.useContext)(Bj),{blockBindings:u,context:d,hasPatternOverrides:h}=(0,T.useMemo)(()=>{const e=s?.usesContext?Object.fromEntries(Object.entries(a).filter(([e])=>s.usesContext.includes(e))):LU;return i?.metadata?.bindings&&Object.values(i?.metadata?.bindings||{}).forEach(t=>{l[t?.source]?.usesContext?.forEach(t=>{e[t]=a[t]})}),{blockBindings:OU(i?.metadata?.bindings,c),context:e,hasPatternOverrides:RU(i?.metadata?.bindings)}},[s?.usesContext,a,i?.metadata?.bindings,c,l]),p=(0,zt.A)(e=>{if(!u)return i;const t={},r=new Map;for(const[e,t]of Object.entries(u)){const{source:n,args:i}=t,o=l[n];o&&c?.includes(e)&&r.set(o,{...r.get(o),[e]:{args:i}})}if(r.size)for(const[i,o]of r){let r={};i.getValues?r=i.getValues({select:e,context:d,clientId:n,bindings:o}):Object.keys(o).forEach(e=>{r[e]=i.label});for(const[e,n]of Object.entries(r))"url"!==e||n&&AA(n)?t[e]=n:t[e]=null}return{...i,...t}},[i,c,u,n,d,l]),f=(0,T.useCallback)(e=>{u?o.batch(()=>{const t={...e},i=new Map;for(const[e,n]of Object.entries(t)){if(!u[e]||!c?.includes(e))continue;const r=u[e],o=l[r?.source];o?.setValues&&(i.set(o,{...i.get(o),[e]:{args:r.args,newValue:n}}),delete t[e])}if(i.size)for(const[e,t]of i)e.setValues({select:o.select,dispatch:o.dispatch,context:d,clientId:n,bindings:t});const s=!!d["pattern/overrides"];h&&s||!Object.keys(t).length||(h&&delete t.href,r(t))}):r(e)},[c,u,n,d,h,r,l,o]);if(!s)return null;if(s.apiVersion>1)return(0,Er.jsx)(MU,{...e,attributes:p,context:d,setAttributes:f});const m=_n(s,"className",!0)?jr(t):null,g=(0,mh.A)(m,i?.className,e.className);return(0,Er.jsx)(MU,{...e,attributes:p,className:g,context:d,setAttributes:f})},DU=function({className:e,actions:t,children:n,secondaryActions:i}){return(0,Er.jsx)("div",{style:{display:"contents",all:"initial"},children:(0,Er.jsx)("div",{className:(0,mh.A)(e,"block-editor-warning"),children:(0,Er.jsxs)("div",{className:"block-editor-warning__contents",children:[(0,Er.jsx)("p",{className:"block-editor-warning__message",children:n}),(t?.length>0||i)&&(0,Er.jsxs)("div",{className:"block-editor-warning__actions",children:[t?.length>0&&t.map((e,t)=>(0,Er.jsx)("span",{className:"block-editor-warning__action",children:e},t)),i&&(0,Er.jsx)(xv.A,{className:"block-editor-warning__secondary",icon:ww.A,label:(0,ee.__)("More options"),popoverProps:{placement:"bottom-end",className:"block-editor-warning__dropdown"},noIcons:!0,children:()=>(0,Er.jsx)(Fv.A,{children:i.map((e,t)=>(0,Er.jsx)(zv.A,{onClick:e.onClick,children:e.title},t))})})]})]})})})};function FU({originalBlockClientId:e,name:t,onReplace:n}){const{selectBlock:i}=(0,Vt.A)(Qy),r=bn(t);return(0,Er.jsxs)(DU,{actions:[(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>i(e),children:(0,ee.__)("Find original")},"find-original"),(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>n([]),children:(0,ee.__)("Remove")},"remove")],children:[(0,Er.jsxs)("strong",{children:[r?.title,": "]}),(0,ee.__)("This block can only be used once.")]})}function zU({mayDisplayControls:e,mayDisplayParentControls:t,mayDisplayPatternEditingControls:n,blockEditingMode:i,isPreviewMode:r,...o}){const{name:s,isSelected:a,clientId:l,attributes:c={},__unstableLayoutClassNames:u}=o,{layout:d=null,metadata:h={}}=c,{bindings:p}=h,f=_n(s,"layout",!1)||_n(s,"__experimentalLayout",!1),m=!!Ih()[wh]||_n(s,"listView")||"core/navigation"===s,{originalBlockClientId:g}=(0,T.useContext)(Bj);return(0,Er.jsxs)(Ah,{value:(0,T.useMemo)(()=>({name:s,isSelected:a,clientId:l,layout:f?d:null,__unstableLayoutClassNames:u,[bh]:e,[yh]:t,[vh]:n&&"disabled"!==i,[_h]:i,[xh]:p,[kh]:r,[wh]:m}),[s,a,l,f,d,u,e,t,n,i,p,r,m]),children:[(0,Er.jsx)(PU,{...o}),g&&(0,Er.jsx)(FU,{originalBlockClientId:g,name:s,onReplace:o.onReplace})]})}var VU=n(87786);function UU({title:e,rawContent:t,renderedContent:n,action:i,actionText:r,className:o}){return(0,Er.jsxs)("div",{className:o,children:[(0,Er.jsxs)("div",{className:"block-editor-block-compare__content",children:[(0,Er.jsx)("h2",{className:"block-editor-block-compare__heading",children:e}),(0,Er.jsx)("div",{className:"block-editor-block-compare__html",children:t}),(0,Er.jsx)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor",children:(0,Er.jsx)(Sr.A,{children:se(n)})})]}),(0,Er.jsx)("div",{className:"block-editor-block-compare__action",children:(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,variant:"secondary",tabIndex:"0",onClick:i,children:r})})]})}var $U=function({block:e,onKeep:t,onConvert:n,convertor:i,convertButtonText:r}){const o=(s=i(e),(Array.isArray(s)?s:[s]).map(e=>Lr(e.name,e.attributes,e.innerBlocks)).join(""));var s;const a=(l=e.originalContent,c=o,(0,VU.JJ)(l,c).map((e,t)=>{const n=(0,mh.A)({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,Er.jsx)("span",{className:n,children:e.value},t)}));var l,c;return(0,Er.jsxs)("div",{className:"block-editor-block-compare__wrapper",children:[(0,Er.jsx)(UU,{title:(0,ee.__)("Current"),className:"block-editor-block-compare__current",action:t,actionText:(0,ee.__)("Convert to HTML"),rawContent:e.originalContent,renderedContent:e.originalContent}),(0,Er.jsx)(UU,{title:(0,ee.__)("After Conversion"),className:"block-editor-block-compare__converted",action:n,actionText:r,rawContent:a,renderedContent:o})]})},HU=e=>ks({HTML:e.originalContent});function WU({clientId:e}){const{block:t,canInsertHTMLBlock:n,canInsertClassicBlock:i}=(0,zt.A)(t=>{const{canInsertBlockType:n,getBlock:i,getBlockRootClientId:r}=t(Qy),o=r(e);return{block:i(e),canInsertHTMLBlock:n("core/html",o),canInsertClassicBlock:n("core/freeform",o)}},[e]),{replaceBlock:r}=(0,Vt.A)(Qy),[o,s]=(0,T.useState)(!1),a=(0,T.useCallback)(()=>s(!1),[]),l=(0,T.useMemo)(()=>({toClassic(){const e=er("core/freeform",{content:t.originalContent});return r(t.clientId,e)},toHTML(){const e=er("core/html",{content:t.originalContent});return r(t.clientId,e)},toBlocks(){const e=HU(t);return r(t.clientId,e)},toRecoveredBlock(){const e=er(t.name,t.attributes,t.innerBlocks);return r(t.clientId,e)}}),[t,r]),c=(0,T.useMemo)(()=>[{title:(0,ee._x)("Resolve","imperative verb"),onClick:()=>s(!0)},n&&{title:(0,ee.__)("Convert to HTML"),onClick:l.toHTML},i&&{title:(0,ee.__)("Convert to Classic Block"),onClick:l.toClassic}].filter(Boolean),[n,i,l]);return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(DU,{actions:[(0,Er.jsx)(fv.Ay,{__next40pxDefaultSize:!0,onClick:l.toRecoveredBlock,variant:"primary",children:(0,ee.__)("Attempt recovery")},"recover")],secondaryActions:c,children:(0,ee.__)("Block contains unexpected or invalid content.")}),o&&(0,Er.jsx)(aj.A,{title:(0,ee.__)("Resolve Block"),onRequestClose:a,className:"block-editor-block-compare",children:(0,Er.jsx)($U,{block:t,onKeep:l.toHTML,onConvert:l.toBlocks,convertor:HU,convertButtonText:(0,ee.__)("Convert to Blocks")})})]})}var GU=(0,Er.jsx)(DU,{className:"block-editor-block-list__block-crash-warning",children:(0,ee.__)("This block has encountered an error and cannot be previewed.")});function qU(){return GU}var KU=class extends T.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}},YU=KU,JU=n(90552),XU=function({clientId:e}){const[t,n]=(0,T.useState)(""),i=(0,zt.A)(t=>t(Qy).getBlock(e),[e]),{updateBlock:r}=(0,Vt.A)(Qy),o=(0,T.useMemo)(()=>i?Mr(i):"",[i]);return(0,T.useEffect)(()=>{n(o)},[o]),(0,Er.jsx)(JU,{className:"block-editor-block-list__block-html-textarea",value:t,onBlur:()=>{const o=bn(i.name);if(!o)return;const s=Bo(o,t,i.attributes),a=t||Lr(o,s),[l]=t?go({...i,attributes:s,originalContent:a}):[!0];r(e,{attributes:s,originalContent:a,isValid:l}),t||n(a)},onChange:e=>n(e.target.value)})};function ZU({isDisabled:e=!1}={}){return(0,bt.A)(t=>{if(e)return;const n=t?.ownerDocument?.defaultView;if(!n)return;const i=[],r=()=>{t.childNodes.forEach(e=>{e instanceof n.HTMLElement&&(e.getAttribute("inert")||(e.setAttribute("inert","true"),i.push(()=>{e.removeAttribute("inert")})))})},o=(0,mS.s)(r,0,{leading:!0});r();const s=new window.MutationObserver(o);return s.observe(t,{childList:!0}),()=>{s&&s.disconnect(),o.cancel(),i.forEach(e=>e())}},[e])}var QU=m$(),e$=e=>d$(e,QU),t$=m$();e$.write=e=>d$(e,t$);var n$=m$();e$.onStart=e=>d$(e,n$);var i$=m$();e$.onFrame=e=>d$(e,i$);var r$=m$();e$.onFinish=e=>d$(e,r$);var o$=[];e$.setTimeout=(e,t)=>{let n=e$.now()+t,i=()=>{let e=o$.findIndex(e=>e.cancel==i);~e&&o$.splice(e,1),c$-=~e?1:0},r={time:n,handler:e,cancel:i};return o$.splice(s$(n),0,r),c$+=1,h$(),r};var s$=e=>~(~o$.findIndex(t=>t.time>e)||~o$.length);e$.cancel=e=>{n$.delete(e),i$.delete(e),r$.delete(e),QU.delete(e),t$.delete(e)},e$.sync=e=>{u$=!0,e$.batchedUpdates(e),u$=!1},e$.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function i(...e){t=e,e$.onStart(n)}return i.handler=e,i.cancel=()=>{n$.delete(n),t=null},i};var a$=typeof window<"u"?window.requestAnimationFrame:()=>{};e$.use=e=>a$=e,e$.now=typeof performance<"u"?()=>performance.now():Date.now,e$.batchedUpdates=e=>e(),e$.catch=console.error,e$.frameLoop="always",e$.advance=()=>{"demand"!==e$.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):f$()};var l$=-1,c$=0,u$=!1;function d$(e,t){u$?(t.delete(e),e(0)):(t.add(e),h$())}function h$(){l$<0&&(l$=0,"demand"!==e$.frameLoop&&a$(p$))}function p$(){~l$&&(a$(p$),e$.batchedUpdates(f$))}function f$(){let e=l$;l$=e$.now();let t=s$(l$);t&&(g$(o$.splice(0,t),e=>e.handler()),c$-=t),c$?(n$.flush(),QU.flush(e?Math.min(64,l$-e):16.667),i$.flush(),t$.flush(),r$.flush()):l$=-1}function m$(){let e=new Set,t=e;return{add(n){c$+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(c$-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,c$-=t.size,g$(t,t=>t(n)&&e.add(t)),c$+=e.size,t=e)}}}function g$(e,t){e.forEach(e=>{try{t(e)}catch(e){e$.catch(e)}})}var b$=Object.defineProperty,y$={};function v$(){}((e,t)=>{for(var n in t)b$(e,n,{get:t[n],enumerable:!0})})(y$,{assign:()=>R$,colors:()=>T$,createStringInterpolator:()=>A$,skipAnimation:()=>B$,to:()=>I$,willAdvance:()=>N$});var _$={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 x$(e,t){if(_$.arr(e)){if(!_$.arr(t)||e.length!==t.length)return!1;for(let n=0;ne.forEach(t);function w$(e,t,n){if(_$.arr(e))for(let i=0;i_$.und(e)?[]:_$.arr(e)?e:[e];function S$(e,t){if(e.size){let n=Array.from(e);e.clear(),k$(n,t)}}var A$,I$,E$=(e,...t)=>S$(e,e=>e(...t)),j$=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),T$=null,B$=!1,N$=v$,R$=e=>{e.to&&(I$=e.to),e.now&&(e$.now=e.now),void 0!==e.colors&&(T$=e.colors),null!=e.skipAnimation&&(B$=e.skipAnimation),e.createStringInterpolator&&(A$=e.createStringInterpolator),e.requestAnimationFrame&&e$.use(e.requestAnimationFrame),e.batchedUpdates&&(e$.batchedUpdates=e.batchedUpdates),e.willAdvance&&(N$=e.willAdvance),e.frameLoop&&(e$.frameLoop=e.frameLoop)},O$=new Set,L$=[],M$=[],P$=0,D$={get idle(){return!O$.size&&!L$.length},start(e){P$>e.priority?(O$.add(e),e$.onStart(F$)):(z$(e),e$(U$))},advance:U$,sort(e){if(P$)e$.onFrame(()=>D$.sort(e));else{let t=L$.indexOf(e);~t&&(L$.splice(t,1),V$(e))}},clear(){L$=[],O$.clear()}};function F$(){O$.forEach(z$),O$.clear(),e$(U$)}function z$(e){L$.includes(e)||V$(e)}function V$(e){L$.splice(function(e,t){let n=e.findIndex(t);return n<0?e.length:n}(L$,t=>t.priority>e.priority),0,e)}function U$(e){let t=M$;for(let n=0;n0}var $$="[-+]?\\d*\\.?\\d+",H$=$$+"%";function W$(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var G$=new RegExp("rgb"+W$($$,$$,$$)),q$=new RegExp("rgba"+W$($$,$$,$$,$$)),K$=new RegExp("hsl"+W$($$,H$,H$)),Y$=new RegExp("hsla"+W$($$,H$,H$,$$)),J$=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,X$=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Z$=/^#([0-9a-fA-F]{6})$/,Q$=/^#([0-9a-fA-F]{8})$/;function eH(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 tH(e,t,n){let i=n<.5?n*(1+t):n+t-n*t,r=2*n-i,o=eH(r,i,e+1/3),s=eH(r,i,e),a=eH(r,i,e-1/3);return Math.round(255*o)<<24|Math.round(255*s)<<16|Math.round(255*a)<<8}function nH(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function iH(e){return(parseFloat(e)%360+360)%360/360}function rH(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function oH(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function sH(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Z$.exec(e))?parseInt(t[1]+"ff",16)>>>0:T$&&void 0!==T$[e]?T$[e]:(t=G$.exec(e))?(nH(t[1])<<24|nH(t[2])<<16|nH(t[3])<<8|255)>>>0:(t=q$.exec(e))?(nH(t[1])<<24|nH(t[2])<<16|nH(t[3])<<8|rH(t[4]))>>>0:(t=J$.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Q$.exec(e))?parseInt(t[1],16)>>>0:(t=X$.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=K$.exec(e))?(255|tH(iH(t[1]),oH(t[2]),oH(t[3])))>>>0:(t=Y$.exec(e))?(tH(iH(t[1]),oH(t[2]),oH(t[3]))|rH(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 aH=(e,t,n)=>{if(_$.fun(e))return e;if(_$.arr(e))return aH({range:e,output:t,extrapolate:n});if(_$.str(e.output[0]))return A$(e);let i=e,r=i.output,o=i.range||[0,1],s=i.extrapolateLeft||i.extrapolate||"extend",a=i.extrapolateRight||i.extrapolate||"extend",l=i.easing||(e=>e);return e=>{let t=function(e,t){for(var n=1;n=e);++n);return n-1}(e,o);return function(e,t,n,i,r,o,s,a,l){let c=l?l(e):e;if(cn){if("identity"===a)return c;"clamp"===a&&(c=n)}return i===r?i:t===n?e<=t?i:r:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=o(c),i===-1/0?c=-c:r===1/0?c+=i:c=c*(r-i)+i,c)}(e,o[t],o[t+1],r[t],r[t+1],l,s,a,i.map)}},lH=1.70158,cH=1.525*lH,uH=lH+1,dH=2*Math.PI/3,hH=2*Math.PI/4.5,pH=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,fH={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=>uH*e*e*e-lH*e*e,easeOutBack:e=>1+uH*Math.pow(e-1,3)+lH*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(2*(cH+1)*e-cH)/2:(Math.pow(2*e-2,2)*((cH+1)*(2*e-2)+cH)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*dH),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*dH)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*hH)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*hH)/2+1,easeInBounce:e=>1-pH(1-e),easeOutBounce:pH,easeInOutBounce:e=>e<.5?(1-pH(1-2*e))/2:(1+pH(2*e-1))/2,steps:(e,t="end")=>n=>{let i=(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(i):Math.ceil(i))/e)}},mH=Symbol.for("FluidValue.get"),gH=Symbol.for("FluidValue.observers"),bH=e=>Boolean(e&&e[mH]),yH=e=>e&&e[mH]?e[mH]():e,vH=e=>e[gH]||null;function _H(e,t){let n=e[gH];n&&n.forEach(e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)})}var xH=class{[mH];[gH];constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");kH(this,e)}},kH=(e,t)=>AH(e,mH,t);function wH(e,t){if(e[mH]){let n=e[gH];n||AH(e,gH,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function CH(e,t){let n=e[gH];if(n&&n.has(t)){let i=n.size-1;i?n.delete(t):e[gH]=null,e.observerRemoved&&e.observerRemoved(i,t)}}var SH,AH=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),IH=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,EH=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,jH=new RegExp(`(${IH.source})(%|[a-z]+)`,"i"),TH=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,BH=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,NH=e=>{let[t,n]=RH(e);if(!t||j$())return e;let i=window.getComputedStyle(document.documentElement).getPropertyValue(t);return i?i.trim():n&&n.startsWith("--")?window.getComputedStyle(document.documentElement).getPropertyValue(n)||e:n&&BH.test(n)?NH(n):n||e},RH=e=>{let t=BH.exec(e);if(!t)return[,];let[,n,i]=t;return[n,i]},OH=(e,t,n,i,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(i)}, ${r})`,LH=e=>{SH||(SH=T$?new RegExp(`(${Object.keys(T$).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map(e=>yH(e).replace(BH,NH).replace(EH,sH).replace(SH,sH)),n=t.map(e=>e.match(IH).map(Number)),i=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=>aH({...e,output:t}));return e=>{let n=!jH.test(t[0])&&t.find(e=>jH.test(e))?.replace(IH,""),r=0;return t[0].replace(IH,()=>`${i[r++](e)}${n||""}`).replace(TH,OH)}},MH="react-spring: ",PH=e=>{let t=e,n=!1;if("function"!=typeof t)throw new TypeError(`${MH}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},DH=PH(console.warn);function FH(e){return _$.str(e)&&("#"==e[0]||/\d/.test(e)||!j$()&&BH.test(e)||e in(T$||{}))}PH(console.warn),new WeakMap,new Set,new WeakMap,new WeakMap,new WeakMap;var zH=j$()?T.useEffect:T.useLayoutEffect;var VH=[],UH=Symbol.for("Animated:node"),$H=e=>e&&e[UH],HH=(e,t)=>((e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}))(e,UH,t),WH=e=>e&&e[UH]&&e[UH].getPayload(),GH=class{payload;constructor(){HH(this,this)}getPayload(){return this.payload||[]}},qH=class extends GH{constructor(e){super(),this._value=e,_$.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(e){return new qH(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return _$.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,_$.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},KH=class extends qH{_string=null;_toString;constructor(e){super(0),this._toString=aH({output:[e,e]})}static create(e){return new KH(e)}getValue(){return this._string??(this._string=this._toString(this._value))}setValue(e){if(_$.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=aH({output:[this.getValue(),e]})),this._value=0,super.reset()}},YH={dependencies:null},JH=class extends GH{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return w$(this.source,(n,i)=>{var r;(r=n)&&r[UH]===r?t[i]=n.getValue(e):bH(n)?t[i]=yH(n):e||(t[i]=n)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&k$(this.payload,e=>e.reset())}_makePayload(e){if(e){let t=new Set;return w$(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){YH.dependencies&&bH(e)&&YH.dependencies.add(e);let t=WH(e);t&&k$(t,e=>this.add(e))}},XH=class extends JH{constructor(e){super(e)}static create(e){return new XH(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(ZH)),!0)}};function ZH(e){return(FH(e)?KH:qH).create(e)}function QH(e){let t=$H(e);return t?t.constructor:_$.arr(e)?XH:FH(e)?KH:qH}var eW=(e,t)=>{let n=!_$.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,T.forwardRef)((i,r)=>{let o=(0,T.useRef)(null),s=n&&(0,T.useCallback)(e=>{o.current=function(e,t){return e&&(_$.fun(e)?e(t):e.current=t),t}(r,e)},[r]),[a,l]=function(e,t){let n=new Set;return YH.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new JH(e),YH.dependencies=null,[e,n]}(i,t),c=function(){let e=(0,T.useState)()[1],t=(()=>{let e=(0,T.useRef)(!1);return zH(()=>(e.current=!0,()=>{e.current=!1}),[]),e})();return()=>{t.current&&e(Math.random())}}(),u=()=>{let e=o.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,a.getValue(!0)))&&c()},d=new tW(u,l),h=(0,T.useRef)();zH(()=>(h.current=d,k$(l,e=>wH(e,d)),()=>{h.current&&(k$(h.current.deps,e=>CH(e,h.current)),e$.cancel(h.current.update))})),(0,T.useEffect)(u,[]),(0,T.useEffect)(()=>()=>{let e=h.current;k$(e.deps,t=>CH(t,e))},VH);let p=t.getComponentProps(a.getValue());return T.createElement(e,{...p,ref:s})})},tW=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&e$.write(this.update)}},nW=Symbol.for("AnimatedComponent"),iW=e=>_$.str(e)?e:e&&_$.str(e.displayName)?e.displayName:_$.fun(e)&&e.name||null;function rW(e,...t){return _$.fun(e)?e(...t):e}var oW=(e,t)=>!0===e||!!(t&&e&&(_$.fun(e)?e(t):C$(e).includes(t))),sW=(e,t)=>_$.obj(e)?t&&e[t]:e,aW=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,lW=e=>e,cW=(e,t=lW)=>{let n=uW;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));let i={};for(let r of n){let n=t(e[r],r);_$.und(n)||(i[r]=n)}return i},uW=["config","onProps","onStart","onChange","onPause","onResume","onRest"],dW={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 hW(e){let t=function(e){let t={},n=0;if(w$(e,(e,i)=>{dW[i]||(t[i]=e,n++)}),n)return t}(e);if(t){let n={to:t};return w$(e,(e,i)=>i in t||(n[i]=e)),n}return{...e}}function pW(e){return e=yH(e),_$.arr(e)?e.map(pW):FH(e)?y$.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function fW(e){return _$.fun(e)||_$.arr(e)&&_$.obj(e[0])}var mW={tension:170,friction:26,mass:1,damping:1,easing:fH.linear,clamp:!1},gW=class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,mW)}};function bW(e,t){if(_$.und(t.decay)){let n=!_$.und(t.tension)||!_$.und(t.friction);(n||!_$.und(t.frequency)||!_$.und(t.damping)||!_$.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}var yW=[],vW=class{changed=!1;values=yW;toValues=null;fromValues=yW;to;from;config=new gW;immediate=!1};function _W(e,{key:t,props:n,defaultProps:i,state:r,actions:o}){return new Promise((s,a)=>{let l,c,u=oW(n.cancel??i?.cancel,t);if(u)p();else{_$.und(n.pause)||(r.paused=oW(n.pause,t));let e=i?.pause;!0!==e&&(e=r.paused||oW(e,t)),l=rW(n.delay||0,t),e?(r.resumeQueue.add(h),o.pause()):(o.resume(),h())}function d(){r.resumeQueue.add(h),r.timeouts.delete(c),c.cancel(),l=c.time-e$.now()}function h(){l>0&&!y$.skipAnimation?(r.delayed=!0,c=e$.setTimeout(p,l),r.pauseQueue.add(d),r.timeouts.add(c)):p()}function p(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(d),r.timeouts.delete(c),e<=(r.cancelId||0)&&(u=!0);try{o.start({...n,callId:e,cancel:u},s)}catch(e){a(e)}}})}var xW=(e,t)=>1==t.length?t[0]:t.some(e=>e.cancelled)?CW(e.get()):t.every(e=>e.noop)?kW(e.get()):wW(e.get(),t.every(e=>e.finished)),kW=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),wW=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),CW=e=>({value:e,cancelled:!0,finished:!1});function SW(e,t,n,i){let{callId:r,parentId:o,onRest:s}=t,{asyncTo:a,promise:l}=n;return o||e!==a||t.reset?n.promise=(async()=>{n.asyncId=r,n.asyncTo=e;let c,u,d,h=cW(t,(e,t)=>"onRest"===t?void 0:e),p=new Promise((e,t)=>(c=e,u=t)),f=e=>{let t=r<=(n.cancelId||0)&&CW(i)||r!==n.asyncId&&wW(i,!1);if(t)throw e.result=t,u(e),e},m=(e,t)=>{let o=new IW,s=new EW;return(async()=>{if(y$.skipAnimation)throw AW(n),s.result=wW(i,!1),u(s),s;f(o);let a=_$.obj(e)?{...e}:{...t,to:e};a.parentId=r,w$(h,(e,t)=>{_$.und(a[t])&&(a[t]=e)});let l=await i.start(a);return f(o),n.paused&&await new Promise(e=>{n.resumeQueue.add(e)}),l})()};if(y$.skipAnimation)return AW(n),wW(i,!1);try{let t;t=_$.arr(e)?(async e=>{for(let t of e)await m(t)})(e):Promise.resolve(e(m,i.stop.bind(i))),await Promise.all([t.then(c),p]),d=wW(i.get(),!0,!1)}catch(e){if(e instanceof IW)d=e.result;else{if(!(e instanceof EW))throw e;d=e.result}}finally{r==n.asyncId&&(n.asyncId=o,n.asyncTo=o?a:void 0,n.promise=o?l:void 0)}return _$.fun(s)&&e$.batchedUpdates(()=>{s(d,i,i.item)}),d})():l}function AW(e,t){S$(e.timeouts,e=>e.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var IW=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.")}},EW=class extends Error{result;constructor(){super("SkipAnimationSignal")}},jW=e=>e instanceof BW,TW=1,BW=class extends xH{id=TW++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=$H(this);return e&&e.getValue()}to(...e){return y$.to(this,e)}interpolate(...e){return DH(`${MH}The "interpolate" function is deprecated in v9 (use "to" instead)`),y$.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){_H(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||D$.sort(this),_H(this,{type:"priority",parent:this,priority:e})}},NW=Symbol.for("SpringPhase"),RW=e=>(1&e[NW])>0,OW=e=>(2&e[NW])>0,LW=e=>(4&e[NW])>0,MW=(e,t)=>t?e[NW]|=3:e[NW]&=-3,PW=(e,t)=>t?e[NW]|=4:e[NW]&=-5,DW=class extends BW{key;animation=new vW;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(),!_$.und(e)||!_$.und(t)){let n=_$.obj(e)?{...e}:{...t,from:e};_$.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(OW(this)||this._state.asyncTo)||LW(this)}get goal(){return yH(this.animation.to)}get velocity(){let e=$H(this);return e instanceof qH?e.lastVelocity||0:e.getPayload().map(e=>e.lastVelocity||0)}get hasAnimated(){return RW(this)}get isAnimating(){return OW(this)}get isPaused(){return LW(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1,i=this.animation,{config:r,toValues:o}=i,s=WH(i.to);!s&&bH(i.to)&&(o=C$(yH(i.to))),i.values.forEach((a,l)=>{if(a.done)return;let c=a.constructor==KH?1:s?s[l].lastPosition:o[l],u=i.immediate,d=c;if(!u){if(d=a.lastPosition,r.tension<=0)return void(a.done=!0);let t,n=a.elapsedTime+=e,o=i.fromValues[l],s=null!=a.v0?a.v0:a.v0=_$.arr(r.velocity)?r.velocity[l]:r.velocity,h=r.precision||(o==c?.005:Math.min(1,.001*Math.abs(c-o)));if(_$.und(r.duration))if(r.decay){let e=!0===r.decay?.998:r.decay,i=Math.exp(-(1-e)*n);d=o+s/(1-e)*(1-i),u=Math.abs(a.lastPosition-d)<=h,t=s*i}else{t=null==a.lastVelocity?s:a.lastVelocity;let n,i=r.restVelocity||h/10,l=r.clamp?0:r.bounce,p=!_$.und(l),f=o==c?a.v0>0:oi,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*-r.tension*(d-c)+.001*-r.friction*t)/r.mass*g,d+=t*g}else{let i=1;r.duration>0&&(this._memoizedDuration!==r.duration&&(this._memoizedDuration=r.duration,a.durationProgress>0&&(a.elapsedTime=r.duration*a.durationProgress,n=a.elapsedTime+=e)),i=(r.progress||0)+n/this._memoizedDuration,i=i>1?1:i<0?0:i,a.durationProgress=i),d=o+r.easing(i)*(c-o),t=(d-a.lastPosition)/e,u=1==i}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,r.round)&&(n=!0)});let a=$H(this),l=a.getValue();if(t){let e=yH(i.to);l===e&&!n||r.decay?n&&r.decay&&this._onChange(l):(a.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(l)}set(e){return e$.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(OW(this)){let{to:e,config:t}=this.animation;e$.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 _$.und(e)?(n=this.queue||[],this.queue=[]):n=[_$.obj(e)?e:{...t,to:e}],Promise.all(n.map(e=>this._update(e))).then(e=>xW(this,e))}stop(e){let{to:t}=this.animation;return this._focus(this.get()),AW(this._state,e&&this._lastCallId),e$.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:i}=e;n=_$.obj(n)?n[t]:n,(null==n||fW(n))&&(n=void 0),i=_$.obj(i)?i[t]:i,null==i&&(i=void 0);let r={to:n,from:i};return RW(this)||(e.reverse&&([n,i]=[i,n]),i=yH(i),_$.und(i)?$H(this)||this._set(n):this._set(i)),r}_update({...e},t){let{key:n,defaultProps:i}=this;e.default&&Object.assign(i,cW(e,(e,t)=>/^on/.test(t)?sW(e,n):e)),HW(this,e,"onProps"),WW(this,"onProps",e,this);let r=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 o=this._state;return _W(++this._lastCallId,{key:n,props:e,defaultProps:i,state:o,actions:{pause:()=>{LW(this)||(PW(this,!0),E$(o.pauseQueue),WW(this,"onPause",wW(this,FW(this,this.animation.to)),this))},resume:()=>{LW(this)&&(PW(this,!1),OW(this)&&this._resume(),E$(o.resumeQueue),WW(this,"onResume",wW(this,FW(this,this.animation.to)),this))},start:this._merge.bind(this,r)}}).then(n=>{if(e.loop&&n.finished&&(!t||!n.noop)){let t=zW(e);if(t)return this._update(t,!0)}return n})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(CW(this));let i=!_$.und(e.to),r=!_$.und(e.from);if(i||r){if(!(t.callId>this._lastToId))return n(CW(this));this._lastToId=t.callId}let{key:o,defaultProps:s,animation:a}=this,{to:l,from:c}=a,{to:u=l,from:d=c}=e;r&&!i&&(!t.default||_$.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);let h=!x$(d,c);h&&(a.from=d),d=yH(d);let p=!x$(u,l);p&&this._focus(u);let f=fW(t.to),{config:m}=a,{decay:g,velocity:b}=m;(i||r)&&(m.velocity=0),t.config&&!f&&function(e,t,n){n&&(bW(n={...n},t),t={...n,...t}),bW(e,t),Object.assign(e,t);for(let t in mW)null==e[t]&&(e[t]=mW[t]);let{mass:i,frequency:r,damping:o}=e;_$.und(r)||(r<.01&&(r=.01),o<0&&(o=0),e.tension=Math.pow(2*Math.PI/r,2)*i,e.friction=4*Math.PI*o*i/r)}(m,rW(t.config,o),t.config!==s.config?rW(s.config,o):void 0);let y=$H(this);if(!y||_$.und(u))return n(wW(this,!0));let v=_$.und(t.reset)?r&&!t.default:!_$.und(d)&&oW(t.reset,o),_=v?d:this.get(),x=pW(u),k=_$.num(x)||_$.arr(x)||FH(x),w=!f&&(!k||oW(s.immediate||t.immediate,o));if(p){let e=QH(u);if(e!==y.constructor){if(!w)throw Error(`Cannot animate between ${y.constructor.name} and ${e.name}, as the "to" prop suggests`);y=this._set(x)}}let C=y.constructor,S=bH(u),A=!1;if(!S){let e=v||!RW(this)&&h;(p||e)&&(A=x$(pW(_),x),S=!A),(!x$(a.immediate,w)&&!w||!x$(m.decay,g)||!x$(m.velocity,b))&&(S=!0)}if(A&&OW(this)&&(a.changed&&!v?S=!0:S||this._stop(l)),!f&&((S||bH(l))&&(a.values=y.getPayload(),a.toValues=bH(u)?null:C==KH?[1]:C$(x)),a.immediate!=w&&(a.immediate=w,!w&&!v&&this._set(l)),S)){let{onRest:e}=a;k$($W,e=>HW(this,t,e));let i=wW(this,FW(this,l));E$(this._pendingCalls,i),this._pendingCalls.add(n),a.changed&&e$.batchedUpdates(()=>{a.changed=!v,e?.(i,this),v?rW(s.onRest,i):a.onStart?.(i,this)})}v&&this._set(_),f?n(SW(t.to,t,this._state,this)):S?this._start():OW(this)&&!p?this._pendingCalls.add(n):n(kW(_))}_focus(e){let t=this.animation;e!==t.to&&(vH(this)&&this._detach(),t.to=e,vH(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;bH(t)&&(wH(t,this),jW(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;bH(e)&&CH(e,this)}_set(e,t=!0){let n=yH(e);if(!_$.und(n)){let e=$H(this);if(!e||!x$(n,e.getValue())){let i=QH(n);e&&e.constructor==i?e.setValue(n):HH(this,i.create(n)),e&&e$.batchedUpdates(()=>{this._onChange(n,t)})}}return $H(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,WW(this,"onStart",wW(this,FW(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),rW(this.animation.onChange,e,this)),rW(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){let e=this.animation;$H(this).reset(yH(e.to)),e.immediate||(e.fromValues=e.values.map(e=>e.lastPosition)),OW(this)||(MW(this,!0),LW(this)||this._resume())}_resume(){y$.skipAnimation?this.finish():D$.start(this)}_stop(e,t){if(OW(this)){MW(this,!1);let n=this.animation;k$(n.values,e=>{e.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),_H(this,{type:"idle",parent:this});let i=t?CW(this.get()):wW(this.get(),FW(this,e??n.to));E$(this._pendingCalls,i),n.changed&&(n.changed=!1,WW(this,"onRest",i,this))}}};function FW(e,t){let n=pW(t);return x$(pW(e.get()),n)}function zW(e,t=e.loop,n=e.to){let i=rW(t);if(i){let r=!0!==i&&hW(i),o=(r||e).reverse,s=!r||r.reset;return VW({...e,loop:t,default:!1,pause:void 0,to:!o||fW(n)?n:void 0,from:s?e.from:void 0,reset:s,...r})}}function VW(e){let{to:t,from:n}=e=hW(e),i=new Set;return _$.obj(t)&&UW(t,i),_$.obj(n)&&UW(n,i),e.keys=i.size?Array.from(i):null,e}function UW(e,t){w$(e,(e,n)=>null!=e&&t.add(n))}var $W=["onStart","onRest","onChange","onPause","onResume"];function HW(e,t,n){e.animation[n]=t[n]!==aW(t,n)?sW(t[n],e.key):void 0}function WW(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var GW=["onStart","onChange","onRest"],qW=1,KW=class{id=qW++;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];_$.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(VW(e)),this}start(e){let{queue:t}=this;return e?t=C$(e).map(VW):this.queue=[],this._flush?this._flush(this,t):(JW(this,t),function(e,t){return Promise.all(t.map(t=>YW(e,t))).then(t=>xW(e,t))}(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let n=this.springs;k$(C$(t),t=>n[t].stop(!!e))}else AW(this._state,this._lastAsyncId),this.each(t=>t.stop(!!e));return this}pause(e){if(_$.und(e))this.start({pause:!0});else{let t=this.springs;k$(C$(e),e=>t[e].pause())}return this}resume(e){if(_$.und(e))this.start({pause:!1});else{let t=this.springs;k$(C$(e),e=>t[e].resume())}return this}each(e){w$(this.springs,e)}_onFrame(){let{onStart:e,onChange:t,onRest:n}=this._events,i=this._active.size>0,r=this._changed.size>0;(i&&!this._started||r&&!this._started)&&(this._started=!0,S$(e,([e,t])=>{t.value=this.get(),e(t,this,this._item)}));let o=!i&&this._started,s=r||o&&n.size?this.get():null;r&&t.size&&S$(t,([e,t])=>{t.value=s,e(t,this,this._item)}),o&&(this._started=!1,S$(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)}e$.onFrame(this._onFrame)}};async function YW(e,t,n){let{keys:i,to:r,from:o,loop:s,onRest:a,onResolve:l}=t,c=_$.obj(t.default)&&t.default;s&&(t.loop=!1),!1===r&&(t.to=null),!1===o&&(t.from=null);let u=_$.arr(r)||_$.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):k$(GW,n=>{let i=t[n];if(_$.fun(i)){let r=e._events[n];t[n]=({finished:e,cancelled:t})=>{let n=r.get(i);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):r.set(i,{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,E$(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);let h=(i||Object.keys(e.springs)).map(n=>e.springs[n].start(t)),p=!0===t.cancel||!0===aW(t,"cancel");(u||p&&d.asyncId)&&h.push(_W(++e._lastAsyncId,{props:t,state:d,actions:{pause:v$,resume:v$,start(t,n){p?(AW(d,e._lastAsyncId),n(CW(e))):(t.onRest=a,n(SW(u,t,d,e)))}}})),d.paused&&await new Promise(e=>{d.resumeQueue.add(e)});let f=xW(e,await Promise.all(h));if(s&&f.finished&&(!n||!f.noop)){let n=zW(t,s,r);if(n)return JW(e,[n]),YW(e,n,!0)}return l&&e$.batchedUpdates(()=>l(f,e,e.item)),f}function JW(e,t){k$(t,t=>{!function(e,t,n){t.keys&&k$(t.keys,i=>{(e[i]||(e[i]=n(i)))._prepareNode(t)})}(e.springs,t,t=>function(e,t){let n=new DW;return n.key=e,t&&wH(n,t),n}(t,e))})}var XW=({children:e,...t})=>{let n=(0,T.useContext)(ZW),i=t.pause||!!n.pause,r=t.immediate||!!n.immediate;t=function(e,t){let[n]=(0,T.useState)(()=>({inputs:t,result:e()})),i=(0,T.useRef)(),r=i.current,o=r;return o?Boolean(t&&o.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n{i.current=o,r==n&&(n.inputs=n.result=void 0)},[o]),o.result}(()=>({pause:i,immediate:r}),[i,r]);let{Provider:o}=ZW;return T.createElement(o,{value:t},e)},ZW=function(e){return Object.assign(e,T.createContext({})),e.Provider._context=e,e.Consumer._context=e,e}(XW);XW.Provider=ZW.Provider,XW.Consumer=ZW.Consumer;var QW=class extends BW{constructor(e,t){super(),this.source=e,this.calc=aH(...t);let n=this._get(),i=QH(n);HH(this,i.create(n))}key;idle=!0;calc;_active=new Set;advance(e){let t=this._get();x$(t,this.get())||($H(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&tG(this._active)&&nG(this)}_get(){let e=_$.arr(this.source)?this.source.map(yH):C$(yH(this.source));return this.calc(...e)}_start(){this.idle&&!tG(this._active)&&(this.idle=!1,k$(WH(this),e=>{e.done=!1}),y$.skipAnimation?(e$.batchedUpdates(()=>this.advance()),nG(this)):D$.start(this))}_attach(){let e=1;k$(C$(this.source),t=>{bH(t)&&wH(t,this),jW(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){k$(C$(this.source),e=>{bH(e)&&CH(e,this)}),this._active.clear(),nG(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=C$(this.source).reduce((e,t)=>Math.max(e,(jW(t)?t.priority:0)+1),0))}};function eG(e){return!1!==e.idle}function tG(e){return!e.size||Array.from(e).every(eG)}function nG(e){e.idle||(e.idle=!0,k$(WH(e),e=>{e.done=!0}),_H(e,{type:"idle",parent:e}))}y$.assign({createStringInterpolator:LH,to:(e,t)=>new QW(e,t)}),D$.advance;var iG=/^--/;function rG(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||iG.test(e)||sG.hasOwnProperty(e)&&sG[e]?(""+t).trim():t+"px"}var oG={},sG={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},aG=["Webkit","Ms","Moz","O"];sG=Object.keys(sG).reduce((e,t)=>(aG.forEach(n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t]),e),sG);var lG=/^(matrix|translate|scale|rotate|skew)/,cG=/^(translate)/,uG=/^(rotate|skew)/,dG=(e,t)=>_$.num(e)&&0!==e?e+t:e,hG=(e,t)=>_$.arr(e)?e.every(e=>hG(e,t)):_$.num(e)?e===t:parseFloat(e)===t,pG=class extends JH{constructor({x:e,y:t,z:n,...i}){let r=[],o=[];(e||t||n)&&(r.push([e||0,t||0,n||0]),o.push(e=>[`translate3d(${e.map(e=>dG(e,"px")).join(",")})`,hG(e,0)])),w$(i,(e,t)=>{if("transform"===t)r.push([e||""]),o.push(e=>[e,""===e]);else if(lG.test(t)){if(delete i[t],_$.und(e))return;let n=cG.test(t)?"px":uG.test(t)?"deg":"";r.push(C$(e)),o.push("rotate3d"===t?([e,t,i,r])=>[`rotate3d(${e},${t},${i},${dG(r,n)})`,hG(r,0)]:e=>[`${t}(${e.map(e=>dG(e,n)).join(",")})`,hG(e,t.startsWith("scale")?1:0)])}}),r.length&&(i.transform=new fG(r,o)),super(i)}},fG=class extends xH{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 k$(this.inputs,(n,i)=>{let r=yH(n[0]),[o,s]=this.transforms[i](_$.arr(r)?r:n.map(yH));e+=" "+o,t=t&&s}),t?"none":e}observerAdded(e){1==e&&k$(this.inputs,e=>k$(e,e=>bH(e)&&wH(e,this)))}observerRemoved(e){0==e&&k$(this.inputs,e=>k$(e,e=>bH(e)&&CH(e,this)))}eventObserved(e){"change"==e.type&&(this._value=null),_H(this,e)}};y$.assign({batchedUpdates:Wj.unstable_batchedUpdates,createStringInterpolator:LH,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 mG=((e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:n=e=>new JH(e),getComponentProps:i=e=>e}={})=>{let r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:i},o=e=>{let t=iW(e)||"Anonymous";return(e=_$.str(e)?o[e]||(o[e]=eW(e,r)):e[nW]||(e[nW]=eW(e,r))).displayName=`Animated(${t})`,e};return w$(e,(t,n)=>{_$.arr(e)&&(n=iW(t)),o[n]=o(t)}),{animated:o}})(["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:i,children:r,scrollTop:o,scrollLeft:s,viewBox:a,...l}=t,c=Object.values(l),u=Object.keys(l).map(t=>n||e.hasAttribute(t)?t:oG[t]||(oG[t]=t.replace(/([A-Z])/g,e=>"-"+e.toLowerCase())));void 0!==r&&(e.textContent=r);for(let t in i)if(i.hasOwnProperty(t)){let n=rG(t,i[t]);iG.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach((t,n)=>{e.setAttribute(t,c[n])}),void 0!==o&&(e.scrollTop=o),void 0!==s&&(e.scrollLeft=s),void 0!==a&&e.setAttribute("viewBox",a)},createAnimatedStyle:e=>new pG(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),gG=mG.animated;function bG(e){return{top:e.offsetTop,left:e.offsetLeft}}var yG=function({triggerAnimationOnChange:e,clientId:t}){const n=(0,T.useRef)(),{isTyping:i,getGlobalBlockCount:r,isBlockSelected:o,isFirstMultiSelectedBlock:s,isBlockMultiSelected:a,isAncestorMultiSelected:l,isDraggingBlocks:c}=(0,zt.A)(Qy),{previous:u,prevRect:d}=(0,T.useMemo)(()=>({previous:n.current&&bG(n.current),prevRect:n.current&&n.current.getBoundingClientRect()}),[e]);return(0,T.useLayoutEffect)(()=>{if(!u||!n.current)return;const e=(0,QP.A)(n.current),h=o(t),p=h||s(t),f=c();function m(){if(!f&&p&&d){const t=n.current.getBoundingClientRect().top-d.top;t&&(e.scrollTop+=t)}}if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||i()||r()>200)return void m();const g=h||a(t)||l(t);if(g&&f)return;const b=g?"1":"",y=new KW({x:0,y:0,config:{mass:5,tension:2e3,friction:200},onChange({value:e}){if(!n.current)return;let{x:t,y:i}=e;t=Math.round(t),i=Math.round(i);const r=0===t&&0===i;n.current.style.transformOrigin="center center",n.current.style.transform=r?null:`translate3d(${t}px,${i}px,0)`,n.current.style.zIndex=b,m()}});n.current.style.transform=void 0;const v=bG(n.current),_=Math.round(u.left-v.left),x=Math.round(u.top-v.top);return y.start({x:0,y:0,from:{x:_,y:x}}),()=>{y.stop(),y.set({x:0,y:0})}},[u,d,t,i,r,o,s,a,l,c]),n};function vG(e){return"INPUT"===e?.nodeName}function _G(e){return vG(e)&&e.type&&!["button","checkbox","hidden","file","radio","image","range","reset","submit","number","email","time"].includes(e.type)||"TEXTAREA"===e.nodeName||"true"===e.contentEditable}function xG(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName}function kG(e){if(!e)return!1;const{tagName:t}=e;return xG(e)||"BUTTON"===t||"SELECT"===t}var wG=n(89534);function CG(e,t,n,i){const r=i.style.zIndex,o=i.style.position,s=i.style.borderRadius,{position:a="static"}=(0,wG.A)(i);"static"===a&&(i.style.position="relative"),i.style.zIndex="10000",i.style.borderRadius="0";const l=function(e,t,n){if(e.caretPositionFromPoint){const i=e.caretPositionFromPoint(t,n);if(!i)return null;const r=e.createRange();return r.setStart(i.offsetNode,i.offset),r.collapse(!0),r}return e.caretRangeFromPoint?e.caretRangeFromPoint(t,n):null}(e,t,n);return i.style.zIndex=r,i.style.position=o,i.style.borderRadius=s,l}function SG(e){return"rtl"===(0,wG.A)(e).direction}function AG(e,t,n){let i=n();return i&&i.startContainer&&e.contains(i.startContainer)||(e.scrollIntoView(t),i=n(),i&&i.startContainer&&e.contains(i.startContainer))?i:null}function IG(e,t,n){if(!e)return;if(e.focus(),xG(e)){if("number"!=typeof e.selectionStart)return;return void(t?(e.selectionStart=e.value.length,e.selectionEnd=e.value.length):(e.selectionStart=0,e.selectionEnd=0))}if(!e.isContentEditable)return;const i=AG(e,t,()=>function(e,t,n){const{ownerDocument:i}=e,r=SG(e)?!t:t,o=e.getBoundingClientRect();return void 0===n?n=t?o.right-1:o.left+1:n<=o.left?n=o.left+1:n>=o.right&&(n=o.right-1),CG(i,n,r?o.bottom-1:o.top+1,e)}(e,t,n));if(!i)return;const{ownerDocument:r}=e,{defaultView:o}=r;(0,re.e)(o,"defaultView");const s=o.getSelection();(0,re.e)(s,"selection"),s.removeAllRanges(),s.addRange(i)}function EG(e,t){return IG(e,t,void 0)}function jG({clientId:e,initialPosition:t}){const n=(0,T.useRef)(),{isBlockSelected:i,isMultiSelecting:r,isZoomOut:o}=Gh((0,zt.A)(Qy));return(0,T.useEffect)(()=>{if(!i(e)||r()||o())return;if(null==t)return;if(!n.current)return;const{ownerDocument:s}=n.current;if(oD(n.current,s.activeElement))return;const a=hS.XC.tabbable.find(n.current).filter(e=>_G(e)),l=-1===t,c=a[l?a.length-1:0]||n.current;if(oD(n.current,c)){if(!n.current.getAttribute("contenteditable")){const e=hS.XC.tabbable.findNext(n.current);if(e&&oD(n.current,e)&&kG(e))return void e.focus()}EG(c,l)}else n.current.focus()},[t,e]),n}function TG(e){e.defaultPrevented||(e.preventDefault(),e.currentTarget.classList.toggle("is-hovered","mouseover"===e.type))}function BG({isEnabled:e=!0}={}){return(0,bt.A)(t=>{if(e)return t.addEventListener("mouseout",TG),t.addEventListener("mouseover",TG),()=>{t.removeEventListener("mouseout",TG),t.removeEventListener("mouseover",TG),t.classList.remove("is-hovered")}},[e])}function NG(e){const{isBlockSelected:t}=(0,zt.A)(Qy),{selectBlock:n,selectionChange:i}=(0,Vt.A)(Qy);return(0,bt.A)(r=>{function o(o){r.parentElement.closest('[contenteditable="true"]')||(t(e)?o.target.isContentEditable||i(e):oD(r,o.target)&&n(e))}return r.addEventListener("focusin",o),()=>{r.removeEventListener("focusin",o)}},[t,n])}function RG(e){return!e||"transparent"===e||"rgba(0, 0, 0, 0)"===e}function OG({clientId:e,isSelected:t}){const{getBlockRootClientId:n,isZoomOut:i,hasMultiSelection:r,isSectionBlock:o,editedContentOnlySection:s,getBlock:a}=Gh((0,zt.A)(Qy)),{insertAfterBlock:l,removeBlock:c,resetZoomLevel:u,startDraggingBlocks:d,stopDraggingBlocks:h,editContentOnlySection:p}=Gh((0,Vt.A)(Qy));return(0,bt.A)(f=>{if(t)return f.addEventListener("keydown",m),f.addEventListener("dragstart",g),f.addEventListener("dblclick",b),()=>{f.removeEventListener("keydown",m),f.removeEventListener("dragstart",g),f.removeEventListener("dblclick",b)};function m(t){const{keyCode:n,target:r}=t;n!==Rt.Fm&&n!==Rt.G_&&n!==Rt.SJ||r!==f||_G(r)||(t.preventDefault(),n===Rt.Fm&&i()?u():n===Rt.Fm?l(e):c(e))}function g(t){if(f!==t.target||f.isContentEditable||f.ownerDocument.activeElement!==f||r())return void t.preventDefault();const i=JSON.stringify({type:"block",srcClientIds:[e],srcRootClientId:n(e)});t.dataTransfer.effectAllowed="move",t.dataTransfer.clearData(),t.dataTransfer.setData("wp-blocks",i);const{ownerDocument:o}=f,{defaultView:s}=o;s.getSelection().removeAllRanges();const a=o.createElement("div");a.style.width="1px",a.style.height="1px",a.style.position="fixed",a.style.visibility="hidden",o.body.appendChild(a),t.dataTransfer.setDragImage(a,0,0);const l=f.getBoundingClientRect(),c=f.id,u=f.cloneNode();u.style.display="none",f.id=null,f.after(u);let p=1;{let e=f;for(;e=e.parentElement;){const{scale:t}=s.getComputedStyle(e);if(t&&"none"!==t){p=parseFloat(t);break}}}const m=1/p,g={};for(const e of["transform","transformOrigin","transition","zIndex","position","top","left","pointerEvents","opacity","backgroundColor"])g[e]=f.style[e];const b=s.scrollY,y=s.scrollX,v=t.clientX,_=t.clientY;f.style.position="relative",f.style.top="0px",f.style.left="0px";const x=t.clientX-l.left,k=t.clientY-l.top,w=l.height>200?200/l.height:1;if(f.style.zIndex="1000",f.style.transformOrigin=`${x*m}px ${k*m}px`,f.style.transition="transform 0.2s ease-out",f.style.transform=`scale(${w})`,f.style.opacity="0.9",RG(s.getComputedStyle(f).backgroundColor)){let e="transparent",t=f;for(;t=t.parentElement;){const{backgroundColor:n}=s.getComputedStyle(t);if(!RG(n)){e=n;break}}f.style.backgroundColor=e}let C=!1,S=v,A=_;function I(e){e.clientX===S&&e.clientY===A||(S=e.clientX,A=e.clientY,E())}function E(){C||(C=!0,f.style.pointerEvents="none");const e=A-_,t=S-v,n=s.scrollY,i=s.scrollX,r=e+(n-b),o=t+(i-y);f.style.top=r*m+"px",f.style.left=o*m+"px"}function j(){o.removeEventListener("dragover",I),o.removeEventListener("dragend",j),o.removeEventListener("drop",j),o.removeEventListener("scroll",E);for(const[e,t]of Object.entries(g))f.style[e]=t;u.remove(),f.id=c,a.remove(),h(),document.body.classList.remove("is-dragging-components-draggable"),o.documentElement.classList.remove("is-dragging")}o.addEventListener("dragover",I),o.addEventListener("dragend",j),o.addEventListener("drop",j),o.addEventListener("scroll",E),d([e]),document.body.classList.add("is-dragging-components-draggable"),o.documentElement.classList.add("is-dragging")}function b(t){const n=o(e),i=a(e),r=xn(i),l=kn(i);!n||s===e||r||l||(t.preventDefault(),p(e))}},[e,t,n,a,xn,kn,l,c,i,u,r,d,h,o,s,p])}function LG(){const e=(0,T.useContext)(Bq);return(0,bt.A)(t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}},[e])}function MG({isSelected:e}){const t=(0,LS.A)();return(0,bt.A)(n=>{if(e){const{ownerDocument:e}=n,{defaultView:i}=e;if(!i.IntersectionObserver)return;const r=new i.IntersectionObserver(e=>{e[0].isIntersecting||n.scrollIntoView({behavior:t?"instant":"smooth"}),r.disconnect()});return r.observe(n),()=>{r.disconnect()}}},[e])}function PG({clientId:e="",isEnabled:t=!0}={}){const{getEnabledClientIdsTree:n}=Gh((0,zt.A)(Qy));return(0,bt.A)(i=>{if(!t)return;const r=t=>{(t.target===i||t.target.classList.contains("is-root-container"))&&(t.defaultPrevented||(t.preventDefault(),n(e).forEach(({clientId:e})=>{const t=i.querySelector(`[data-block="${e}"]`);t&&(t.classList.remove("has-editable-outline"),t.offsetWidth,t.classList.add("has-editable-outline"))})))};return i.addEventListener("click",r),()=>i.removeEventListener("click",r)},[t])}var DG=new Map;function FG(e){const t=e.getAttribute("data-draggable");t&&(e.removeAttribute("data-draggable"),"true"!==t||e.getAttribute("draggable")||e.setAttribute("draggable","true"))}function zG(e){const{target:t}=e,{ownerDocument:n,isContentEditable:i,tagName:r}=t,o=["INPUT","TEXTAREA"].includes(r),s=DG.get(n);if(i||o)for(const e of s)"true"===e.getAttribute("draggable")&&e.contains(t)&&(e.removeAttribute("draggable"),e.setAttribute("data-draggable","true"));else for(const e of s)FG(e)}function VG(e={}){const{blockVisibility:t,deviceType:n=yp.desktop.key,view:i=window}=e,r=(0,dw.A)("mobile",">=",i),o=(0,dw.A)("medium",">=",i);let s;return s=n===yp.mobile.key?yp.mobile.key:n===yp.tablet.key?yp.tablet.key:r?r&&!o?yp.tablet.key:yp.desktop.key:yp.mobile.key,{isBlockCurrentlyHidden:!1===t||!1===t?.viewport?.[s],currentViewport:s}}function UG(e={},{__unstableIsHtml:t}={}){const{clientId:n,className:i,wrapperProps:r={},isAligned:o,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:y,isReusable:v,isDragging:_,hasChildSelected:x,isEditingDisabled:k,hasEditableOutline:w,isEditingContentOnlySection:C,defaultClassName:S,isSectionBlock:A,isWithinSectionBlock:I,canMove:E,blockVisibility:j,deviceType:B}=(0,T.useContext)(Bj),N=(0,bt.A)(e=>{if(e){const{ownerDocument:t}=e,{defaultView:n}=t;N.current=n}},[]),R=(0,ee.sprintf)((0,ee.__)("Block: %s"),u),O="html"!==a||t?"":"-visual",L=(0,bt.A)(e=>(function(e,t){let n=DG.get(e);n||(n=new Set,DG.set(e,n),e.addEventListener("pointerdown",zG)),n.add(t)}(e.ownerDocument,e),()=>{!function(e,t){const n=DG.get(e);n&&(n.delete(t),FG(t),0===n.size&&(DG.delete(e),e.removeEventListener("pointerdown",zG)))}(e.ownerDocument,e)}),[]),M=!I,P=(0,gt.A)([e.ref,N,jG({clientId:n,initialPosition:f}),EO(n),NG(n),OG({clientId:n,isSelected:d}),BG({isEnabled:M}),LG(),yG({triggerAnimationOnChange:s,clientId:n}),ZU({isDisabled:!p}),PG({clientId:n,isEnabled:A}),MG({isSelected:d}),E?L:void 0]),D=Ih(),F=D[xh]?{"--wp-admin-theme-color":"var(--wp-block-synced-color)","--wp-admin-theme-color--rgb":"var(--wp-block-synced-color--rgb)"}:{},{isBlockCurrentlyHidden:z}=VG({blockVisibility:j,deviceType:B,view:N.current});c<2&&n===D.clientId&&(0,sn.A)(`Block type "${l}" must support API version 2 or higher to work correctly with "useBlockProps" method.`);let V=!1;return"-"!==r?.style?.marginTop?.charAt(0)&&"-"!==r?.style?.marginBottom?.charAt(0)&&"-"!==r?.style?.marginLeft?.charAt(0)&&"-"!==r?.style?.marginRight?.charAt(0)||(V=!0),{tabIndex:"disabled"===m?-1:0,draggable:!(!E||x)||void 0,...r,...e,ref:P,id:`block-${n}${O}`,role:"document","aria-label":R,"data-block":n,"data-type":l,"data-title":u,inert:h?"true":void 0,className:(0,mh.A)("block-editor-block-list__block",{"wp-block":!o,"has-block-overlay":p,"is-selected":d,"is-highlighted":g,"is-multi-selected":b,"is-partially-selected":y,"is-reusable":v,"is-dragging":_,"has-child-selected":x,"is-editing-disabled":k,"has-editable-outline":w,"has-negative-margin":V,"is-editing-content-only-section":C,"is-block-hidden":z},i,e.className,r.className,S),style:{...r.style,...e.style,...F}}}function $G({children:e,isHtml:t,...n}){return(0,Er.jsx)("div",{...UG(n,{__unstableIsHtml:t}),children:e})}function HG({block:{__unstableBlockSource:e},mode:t,isLocked:n,canRemove:i,clientId:r,isSelected:o,isSelectionEnabled:s,className:a,__unstableLayoutClassNames:l,name:c,isValid:u,attributes:d,wrapperProps:h,setAttributes:p,onReplace:f,onRemove:m,onInsertBlocksAfter:g,onMerge:b,toggleSelection:y}){const{mayDisplayControls:v,mayDisplayParentControls:_,isSelectionWithinCurrentSection:x,themeSupportsLayout:k,...w}=(0,T.useContext)(Bj),C=jk()||{};let S=(0,Er.jsx)(zU,{name:c,isSelected:o,attributes:d,setAttributes:p,insertBlocksAfter:n?void 0:g,onReplace:i?f:void 0,onRemove:i?m:void 0,mergeBlocks:i?b:void 0,clientId:r,isSelectionEnabled:s,toggleSelection:y,__unstableLayoutClassNames:l,__unstableParentLayout:Object.keys(C).length?C:void 0,mayDisplayControls:v,mayDisplayParentControls:_,mayDisplayPatternEditingControls:x,blockEditingMode:w.blockEditingMode,isPreviewMode:w.isPreviewMode});const A=bn(c);A?.getEditWrapperProps&&(h=function(e,t){const n={...e,...t};return e?.hasOwnProperty("className")&&t?.hasOwnProperty("className")&&(n.className=(0,mh.A)(e.className,t.className)),e?.hasOwnProperty("style")&&t?.hasOwnProperty("style")&&(n.style={...e.style,...t.style}),n}(h,A.getEditWrapperProps(d)));const I=h&&!!h["data-align"]&&!k,E=a?.includes("is-position-sticky");let j;if(I&&(S=(0,Er.jsx)("div",{className:(0,mh.A)("wp-block",E&&a),"data-align":h["data-align"],children:S})),u)j="html"===t?(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)("div",{style:{display:"none"},children:S}),(0,Er.jsx)($G,{isHtml:!0,children:(0,Er.jsx)(XU,{clientId:r})})]}):A?.apiVersion>1?S:(0,Er.jsx)($G,{children:S});else{const t=e?Ir(e):Lr(A,d);j=(0,Er.jsxs)($G,{className:"has-warning",children:[(0,Er.jsx)(WU,{clientId:r}),(0,Er.jsx)(Sr.A,{children:se(t)})]})}const{"data-align":B,...N}=h??{},R={...N,className:(0,mh.A)(N.className,B&&k&&`align${B}`,!(B&&E)&&a)};return(0,Er.jsx)(Bj.Provider,{value:{wrapperProps:R,isAligned:I,isSelectionWithinCurrentSection:x,...w},children:(0,Er.jsx)(YU,{fallback:(0,Er.jsx)($G,{className:"has-warning",children:(0,Er.jsx)(qU,{})}),children:j})})}UG.save=Rr;var WG=(0,bS.A)((e,t,n)=>{const{updateBlockAttributes:i,insertBlocks:r,mergeBlocks:o,replaceBlocks:s,toggleSelection:a,__unstableMarkLastChangeAsPersistent:l,moveBlocksToPosition:c,removeBlock:u,selectBlock:d}=e(Qy);return{setAttributes(e){const{getMultiSelectedBlockClientIds:r}=n.select(Qy),o=r(),{clientId:s,attributes:a}=t,l=o.length?o:[s],c="function"==typeof e?e(a):e;i(l,c)},onInsertBlocks(e,n){const{rootClientId:i}=t;r(e,n,i)},onInsertBlocksAfter(e){const{clientId:i,rootClientId:o}=t,{getBlockIndex:s}=n.select(Qy),a=s(i);r(e,a+1,o)},onMerge(e){const{clientId:i,rootClientId:a}=t,{getPreviousBlockClientId:l,getNextBlockClientId:h,getBlock:p,getBlockAttributes:f,getBlockName:m,getBlockOrder:g,getBlockIndex:b,getBlockRootClientId:y,canInsertBlockType:v}=n.select(Qy);function _(){const e=p(i),t=gn(),r=bn(t);if(m(i)!==t){const n=ur(e,t);n&&n.length&&s(i,n)}else if(In(e)){const e=h(i);e&&n.batch(()=>{u(i),d(e)})}else if(r.merge){const n=r.merge({},e.attributes);s([i],[er(t,n)])}}function x(e,t=!0){const i="text"===bn(m(e)).category,o=y(e),s=g(e),[a]=s;1===s.length&&An(p(a))?u(e):i?n.batch(()=>{if(v(m(a),o))c([a],e,o,b(e));else{const n=ur(p(a),gn());n&&n.length&&n.every(e=>v(e.name,o))?(r(n,b(e),o,t),u(a,!1)):_()}!g(e).length&&An(p(e))&&u(e,!1)}):_()}if(e){if(a){const e=h(a);if(e){if(m(a)!==m(e))return void o(a,e);{const t=f(a),i=f(e);if(Object.keys(t).every(e=>t[e]===i[e]))return void n.batch(()=>{c(g(e),e,a),u(e,!1)})}}}const e=h(i);if(!e)return;g(e).length?x(e,!1):o(i,e)}else{const e=l(i);if(e)o(e,i);else if(a){const e=l(a);if(e&&m(a)===m(e)){const t=f(a),i=f(e);if(Object.keys(t).every(e=>t[e]===i[e]))return void n.batch(()=>{c(g(a),a,e),u(a,!1)})}x(a)}else _()}},onReplace(e,n,i){e.length&&!In(e[e.length-1])&&l();const r=1===e?.length&&Array.isArray(e[0])?e[0]:e;s([t.clientId],r,n,i)},onRemove(){u(t.clientId)},toggleSelection(e){a(e)}}});HG=(0,z.A)(WG,gS("editor.BlockListBlock"))(HG);var GG=(0,T.memo)(function(e){const{clientId:t,rootClientId:n}=e,i=(0,zt.A)(e=>{const{isBlockSelected:i,getBlockMode:r,isSelectionEnabled:o,getTemplateLock:s,isSectionBlock:a,getParentSectionBlock:l,getBlockWithoutAttributes:c,getBlockAttributes:u,canRemoveBlock:d,canMoveBlock:h,getSettings:p,getEditedContentOnlySection:f,getBlockEditingMode:m,getBlockName:g,isFirstMultiSelectedBlock:b,getMultiSelectedBlockClientIds:y,hasSelectedInnerBlock:v,getBlocksByName:_,getBlockIndex:x,isBlockMultiSelected:k,isBlockSubtreeDisabled:w,isBlockHighlighted:C,__unstableIsFullySelected:S,__unstableSelectionHasUnmergeableBlock:A,isBlockBeingDragged:I,isDragging:E,__unstableHasActiveBlockOverlayActive:j,getSelectedBlocksInitialCaretPosition:T}=Gh(e(Qy)),B=c(t);if(!B)return;const{hasBlockSupport:N,getActiveBlockVariation:R}=e(Zi),O=u(t),{name:L,isValid:M}=B,P=bn(L),D=p(),{supportsLayout:F,isPreviewMode:z,__experimentalBlockBindingsSupportedAttributes:V}=D,U=V?.[L],$=O?.metadata?.blockVisibility,H=D?.[Vh]?.toLowerCase()||"desktop",W=P?.apiVersion>1,G=k(t),q=m(t),K={isPreviewMode:z,blockWithoutAttributes:B,name:L,attributes:O,isValid:M,themeSupportsLayout:F,index:x(t),isReusable:xn(P),className:W?O.className:void 0,defaultClassName:W?jr(L):void 0,blockTitle:P?.title,bindableAttributes:U,blockVisibility:$,deviceType:H,isMultiSelected:G,blockEditingMode:q,isEditingDisabled:"disabled"===q};if(z)return K;const Y=i(t),J=d(t),X=h(t),Z=R(L,O),Q=!0,ee=v(t,Q),te=a(t)?t:l(t),ne=_n(L,"multiple",!0)?[]:_(L),ie=ne.length&&ne[0]!==t;return{...K,mode:r(t),isSelectionEnabled:o(),isLocked:!!s(n),isSectionBlock:a(t),isWithinSectionBlock:!!te,isSelectionWithinCurrentSection:i(te)||v(te,Q),blockType:P,canRemove:J,canMove:X,isSelected:Y,isEditingContentOnlySection:f()===t,blockEditingMode:q,mayDisplayControls:Y||b(t)&&y().every(e=>g(e)===L),mayDisplayParentControls:N(g(t),"__experimentalExposeControlsToChildren",!1)&&v(t),blockApiVersion:P?.apiVersion||1,blockTitle:Z?.title||P?.title,isSubtreeDisabled:"disabled"===q&&w(t),hasOverlay:j(t)&&!E(),initialPosition:Y?T():void 0,isHighlighted:C(t),isMultiSelected:G,isPartiallySelected:G&&!S()&&!A(),isDragging:I(t),hasChildSelected:ee,isEditingDisabled:"disabled"===q,hasEditableOutline:"disabled"!==q&&"disabled"===m(n),originalBlockClientId:!!ie&&ne[0],blockVisibility:$,deviceType:H}},[t,n]),r=(0,bt.A)(e=>{if(e){const{ownerDocument:t}=e,{defaultView:n}=t;r.current=n}},[]),{isBlockCurrentlyHidden:o}=VG({blockVisibility:i?.blockVisibility,deviceType:i?.deviceType,view:r.current}),s=(0,T.useMemo)(()=>({...i?.blockWithoutAttributes,attributes:i?.attributes}),[i?.blockWithoutAttributes,i?.attributes]);if(!i)return null;const{isPreviewMode:a,mode:l="visual",isSelectionEnabled:c=!1,isLocked:u=!1,canRemove:d=!1,canMove:h=!1,name:p,attributes:f,isValid:m,isSelected:g=!1,themeSupportsLayout:b,isEditingContentOnlySection:y,blockEditingMode:v,mayDisplayControls:_,mayDisplayParentControls:x,index:k,blockApiVersion:w,blockType:C,blockTitle:S,isSubtreeDisabled:A,hasOverlay:I,initialPosition:E,isHighlighted:j,isMultiSelected:B,isPartiallySelected:N,isReusable:R,isDragging:O,hasChildSelected:L,isSectionBlock:M,isWithinSectionBlock:P,isSelectionWithinCurrentSection:D,isEditingDisabled:F,hasEditableOutline:z,className:V,defaultClassName:U,originalBlockClientId:$,bindableAttributes:H,blockVisibility:W,deviceType:G}=i,q={isPreviewMode:a,clientId:t,className:V,index:k,mode:l,name:p,blockApiVersion:w,blockType:C,blockTitle:S,isSelected:g,isSubtreeDisabled:A,hasOverlay:I,initialPosition:E,blockEditingMode:v,isHighlighted:j,isMultiSelected:B,isPartiallySelected:N,isReusable:R,isDragging:O,hasChildSelected:L,isSectionBlock:M,isWithinSectionBlock:P,isSelectionWithinCurrentSection:D,isEditingDisabled:F,hasEditableOutline:z,isEditingContentOnlySection:y,defaultClassName:U,mayDisplayControls:_,mayDisplayParentControls:x,originalBlockClientId:$,themeSupportsLayout:b,canMove:h,isBlockCurrentlyHidden:o,bindableAttributes:H,blockVisibility:W,deviceType:G};return!o||g||B||L?(0,Er.jsx)(Bj.Provider,{value:q,children:(0,Er.jsx)(HG,{...e,mode:l,isSelectionEnabled:c,isLocked:u,canRemove:d,canMove:h,block:s,name:p,attributes:f,isValid:m,isSelected:g})}):null});function qG({rootClientId:e}){const{showPrompt:t,isLocked:n,placeholder:i,isManualGrid:r}=(0,zt.A)(t=>{const{getBlockCount:n,getSettings:i,getTemplateLock:r,getBlockAttributes:o}=t(Qy),s=!n(e),{bodyPlaceholder:a}=i();return{showPrompt:s,isLocked:!!r(e),placeholder:a,isManualGrid:o(e)?.layout?.isManualPlacement}},[e]),{insertDefaultBlock:o,startTyping:s}=(0,Vt.A)(Qy);if(n||r)return null;const a=(0,qr.S)(i)||(0,ee.__)("Type / to choose a block"),l=()=>{o(void 0,e),s()};return(0,Er.jsxs)("div",{"data-root-client-id":e||"",className:(0,mh.A)("block-editor-default-block-appender",{"has-visible-prompt":t}),children:[(0,Er.jsx)("p",{tabIndex:"0",role:"button","aria-label":(0,ee.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{Rt.Fm!==e.keyCode&&Rt.t6!==e.keyCode||l()},onClick:()=>l(),onFocus:()=>{t&&l()},children:t?a:"\ufeff"}),(0,Er.jsx)(PJ,{rootClientId:e,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0})]})}function KG({rootClientId:e}){return(0,zt.A)(t=>t(Qy).canInsertBlockType(gn(),e))?(0,Er.jsx)(qG,{rootClientId:e}):(0,Er.jsx)(FJ,{rootClientId:e,className:"block-list-appender__toggle"})}function YG({rootClientId:e,CustomAppender:t,className:n,tagName:i="div"}){const r=(0,zt.A)(t=>{const{getBlockInsertionPoint:n,isBlockInsertionPointVisible:i,getBlockCount:r}=t(Qy),o=n();return i()&&e===o?.rootClientId&&0===r(e)},[e]);return(0,Er.jsx)(i,{tabIndex:-1,className:(0,mh.A)("block-list-appender wp-block",n,{"is-drag-over":r}),contentEditable:!1,"data-block":!0,children:t?(0,Er.jsx)(t,{}):(0,Er.jsx)(KG,{rootClientId:e})})}var JG=Number.MAX_SAFE_INTEGER,XG=function({previousClientId:e,nextClientId:t,children:n,__unstablePopoverSlot:i,__unstableContentRef:r,operation:o="insert",nearestSide:s="right",...a}){const[l,c]=(0,T.useReducer)(e=>(e+1)%JG,0),{orientation:u,rootClientId:d,isVisible:h}=(0,zt.A)(n=>{const{getBlockListSettings:i,getBlockRootClientId:r,isBlockVisible:o}=n(Qy),s=r(e??t);return{orientation:i(s)?.orientation||"vertical",rootClientId:s,isVisible:o(e)&&o(t)}},[e,t]),p=BO(e),f=BO(t),m="vertical"===u,g=(0,T.useMemo)(()=>{if(!(l<0||!p&&!f)&&h)return{contextElement:"group"===o?f||p:p||f,getBoundingClientRect(){const e=p?p.getBoundingClientRect():null,t=f?f.getBoundingClientRect():null;let n=0,i=0,r=0,a=0;if("group"===o){const o=t||e;i=o.top,r=0,a=o.bottom-o.top,n="left"===s?o.left-2:o.right-2}else m?(i=e?e.bottom:t.top,r=e?e.width:t.width,a=t&&e?t.top-e.bottom:0,n=e?e.left:t.left):(i=e?e.top:t.top,a=e?e.height:t.height,(0,ee.isRTL)()?(n=t?t.right:e.left,r=e&&t?e.left-t.right:0):(n=e?e.right:t.left,r=e&&t?t.left-e.right:0),r=Math.max(r,0));return new window.DOMRect(n,i,r,a)}}},[p,f,l,m,h,o,s]),b=tD(r);return(0,T.useLayoutEffect)(()=>{if(!p)return;const e=new window.MutationObserver(c);return e.observe(p,{attributes:!0}),()=>{e.disconnect()}},[p]),(0,T.useLayoutEffect)(()=>{if(!f)return;const e=new window.MutationObserver(c);return e.observe(f,{attributes:!0}),()=>{e.disconnect()}},[f]),(0,T.useLayoutEffect)(()=>{if(p)return p.ownerDocument.defaultView.addEventListener("resize",c),()=>{p.ownerDocument.defaultView?.removeEventListener("resize",c)}},[p]),(p||f)&&h?(0,Er.jsx)(uw.Ay,{ref:b,animate:!1,anchor:g,focusOnMount:!1,__unstableSlotName:i,inline:!i,...a,className:(0,mh.A)("block-editor-block-popover","block-editor-block-popover__inbetween",a.className),resize:!1,flip:!1,placement:"overlay",variant:"unstyled",children:(0,Er.jsx)("div",{className:"block-editor-block-popover__inbetween-container",children:n})},t+"--"+d):null},ZG={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}},QG=function({__unstablePopoverSlot:e,__unstableContentRef:t}){const{clientId:n}=(0,zt.A)(e=>{const{getBlockOrder:t,getBlockInsertionPoint:n}=e(Qy),i=n(),r=t(i.rootClientId);return r.length?{clientId:r[i.index]}:{}},[]),i=(0,LS.A)();return(0,Er.jsx)(mD,{clientId:n,__unstablePopoverSlot:e,__unstableContentRef:t,className:"block-editor-block-popover__drop-zone",children:(0,Er.jsx)(NS.P.div,{"data-testid":"block-popover-drop-zone",initial:i?ZG.show:ZG.hide,animate:ZG.show,exit:i?ZG.show:ZG.exit,className:"block-editor-block-popover__drop-zone-foreground"})})},eq=(0,T.createContext)();function tq({__unstablePopoverSlot:e,__unstableContentRef:t,operation:n="insert",nearestSide:i="right"}){const{selectBlock:r,hideInsertionPoint:o}=(0,Vt.A)(Qy),s=(0,T.useContext)(eq),a=(0,T.useRef)(),{orientation:l,previousClientId:c,nextClientId:u,rootClientId:d,isInserterShown:h,isDistractionFree:p,isZoomOutMode:f}=(0,zt.A)(e=>{const{getBlockOrder:t,getBlockListSettings:n,getBlockInsertionPoint:i,isBlockBeingDragged:r,getPreviousBlockClientId:o,getNextBlockClientId:s,getSettings:a,isZoomOut:l}=Gh(e(Qy)),c=i(),u=t(c.rootClientId);if(!u.length)return{};let d=u[c.index-1],h=u[c.index];for(;r(d);)d=o(d);for(;r(h);)h=s(h);const p=a();return{previousClientId:d,nextClientId:h,orientation:n(c.rootClientId)?.orientation||"vertical",rootClientId:c.rootClientId,isDistractionFree:p.isDistractionFree,isInserterShown:c?.__unstableWithInserter,isZoomOutMode:l()}},[]),{getBlockEditingMode:m}=(0,zt.A)(Qy),g=(0,LS.A)(),b=(0,T.useCallback)(e=>{!e&&s.current&&(s.current=!1)},[s]),y={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)return null;if(f&&"insert"!==n)return null;const _="horizontal"===l||"group"===n?"is-horizontal":"is-vertical",x=(0,mh.A)("block-editor-block-list__insertion-point",_);return(0,Er.jsx)(XG,{previousClientId:c,nextClientId:u,__unstablePopoverSlot:e,__unstableContentRef:t,operation:n,nearestSide:i,children:(0,Er.jsxs)(NS.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)&&r(u,-1)},onFocus:function(e){e.target!==a.current&&(s.current=!0)},className:(0,mh.A)(x,{"is-with-inserter":h}),onHoverEnd:function(e){e.target!==a.current||s.current||o()},children:[(0,Er.jsx)(NS.P.div,{variants:y,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),h&&(0,Er.jsx)(NS.P.div,{variants:v,className:(0,mh.A)("block-editor-block-list__insertion-point-inserter"),children:(0,Er.jsx)(PJ,{ref:b,position:"bottom center",clientId:u,rootClientId:d,__experimentalIsQuick:!0,onToggle:e=>{s.current=e},onSelectOrClose:()=>{s.current=!1}})})]})})}function nq(e){const{insertionPoint:t,isVisible:n,isBlockListEmpty:i}=(0,zt.A)(e=>{const{getBlockInsertionPoint:t,isBlockInsertionPointVisible:n,getBlockCount:i}=e(Qy),r=t();return{insertionPoint:r,isVisible:n(),isBlockListEmpty:0===i(r?.rootClientId)}},[]);return!n||i?null:"replace"===t.operation?(0,Er.jsx)(QG,{...e},`${t.rootClientId}-${t.index}`):(0,Er.jsx)(tq,{operation:t.operation,nearestSide:t.nearestSide,...e})}function iq(){const e=(0,T.useContext)(eq),t=(0,zt.A)(e=>{const t=e(Qy).getSettings();return t.isDistractionFree||t.isPreviewMode||Gh(e(Qy)).isZoomOut()},[]),{getBlockListSettings:n,getBlockIndex:i,isMultiSelecting:r,getSelectedBlockClientIds:o,getSettings:s,getTemplateLock:a,__unstableIsWithinBlockOverlay:l,getBlockEditingMode:c,getBlockName:u,getBlockAttributes:d,getParentSectionBlock:h}=Gh((0,zt.A)(Qy)),{showInsertionPoint:p,hideInsertionPoint:f}=(0,Vt.A)(Qy);return(0,bt.A)(m=>{if(!t)return m.addEventListener("mousemove",g),()=>{m.removeEventListener("mousemove",g)};function g(t){if(void 0===e||e.current)return;if(t.target.nodeType===t.target.TEXT_NODE)return;if(r())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void f();let m;if(t.target.classList.contains("is-root-container")||(m=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")),a(m)||"disabled"===c(m)||"core/block"===u(m)||m&&d(m).layout?.isManualPlacement)return;const g=n(m),b=g?.orientation||"vertical",y=!!g?.__experimentalCaptureToolbars,v=t.clientY,_=t.clientX;let x=Array.from(t.target.children).find(e=>{const t=e.getBoundingClientRect();return e.classList.contains("wp-block")&&"vertical"===b&&t.top>v||e.classList.contains("wp-block")&&"horizontal"===b&&((0,ee.isRTL)()?t.right<_:t.left>_)});if(!x)return void f();if(!x.id&&(x=x.firstElementChild,!x))return void f();const k=x.id.slice(6);if(!k||l(k)||h(k))return;if(o().includes(k)&&"vertical"===b&&!y&&!s().hasFixedToolbar)return;const w=x.getBoundingClientRect();if("horizontal"===b&&(t.clientY>w.bottom||t.clientYw.right||t.clientX{if(r)return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)};function o(r){(t()||n())&&r.target===e&&i()}},[t,n,i,r])}function oq(e){return(0,Er.jsx)("div",{ref:rq(),...e})}eq.displayName="InsertionPointOpenRefContext";var sq=new WeakMap;function aq(){let e;return t=>(void 0!==e&&(0,V.hw)(e,t)||(e=t),e)}function lq(e){const[t]=(0,T.useState)(aq);return t(e)}var cq=n(49724),uq=n(95576);function dq(e,t,n){const i=(0,cq.MA)(()=>(0,uq.n)(e,t??0,n),[e,t,n]);return(0,T.useEffect)(()=>()=>i.cancel(),[i]),i}function hq(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch{return t}return t}function pq(e,t,n={}){const{operation:i="insert",nearestSide:r="right"}=n,{canInsertBlockType:o,getBlockIndex:s,getClientIdsOfDescendants:a,getBlockOrder:l,getBlocksByClientId:c,getSettings:u,getBlock:d}=(0,zt.A)(Qy),{getGroupingBlockName:h}=(0,zt.A)(Zi),{insertBlocks:p,moveBlocksToPosition:f,updateBlockAttributes:m,clearSelectedBlock:g,replaceBlocks:b,removeBlocks:y}=(0,Vt.A)(Qy),v=(0,yt.A)(),_=(0,T.useCallback)((n,s=!0,a=0,c=[])=>{Array.isArray(n)||(n=[n]);const u=l(e)[t];if("replace"===i)b(u,n,void 0,a);else if("group"===i){const t=d(u);"left"===r?n.push(t):n.unshift(t);const i=n.map(e=>er(e.name,e.attributes,e.innerBlocks)),s=n.every(e=>"core/image"===e.name),l=o("core/gallery",e),p=er(s&&l?"core/gallery":h(),{layout:{type:"flex",flexWrap:s&&l?null:"nowrap"}},i);b([u,...c],p,void 0,a)}else p(n,t,e,s,a)},[l,e,t,i,b,d,r,o,h,p]),x=(0,T.useCallback)((n,r,o)=>{if("replace"===i){const i=c(n),r=l(e)[t];v.batch(()=>{y(n,!1),b(r,i,void 0,0)})}else f(n,r,e,o)},[i,l,c,f,v,y,b,t,e]),k=function(e,t,n,i,r,o,s,a,l){return c=>{const{srcRootClientId:u,srcClientIds:d,type:h,blocks:p}=hq(c);if("inserter"===h){s();const e=p.map(e=>ir(e));o(e,!0,null)}if("block"===h){const s=n(d[0]);if(u===e&&s===t)return;if(d.includes(e)||i(d).some(t=>t===e))return;if("group"===a){const e=d.map(e=>l(e));return void o(e,!0,null,d)}const c=u===e,h=d.length;r(d,u,c&&s{if(!t().mediaUpload)return;const s=ar(lr("from"),t=>"files"===t.type&&i(t.blockName,e)&&t.isMatch(o));if(s){const e=s.transform(o,n);r(e)}}}(e,u,m,o,_),C=function(e){return t=>{const n=Zs({HTML:t,mode:"BLOCKS"});n.length&&e(n)}}(_);return e=>{const t=NC(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?C(n):t.length?w(t):k(e)}}function fq(e,t,n=["top","bottom","left","right"]){let i,r;return n.forEach(n=>{const o=function(e,t,n){const i="top"===n||"bottom"===n,{x:r,y:o}=e,s=i?r:o,a=i?o:r,l=i?t.left:t.top,c=i?t.right:t.bottom,u=t[n];let d;return d=s>=l&&s<=c?s:s=e.x&&t.top<=e.y&&t.bottom>=e.y}function gq(e,t,n,i){let r=!0;if(t){const e=t?.map(({name:e})=>e);r=n.every(t=>e?.includes(t))}const o=n.map(t=>e(t)).every(e=>{const[t]=e?.parent||[];return!t||t===i});return r&&o}function bq(e,t){const{defaultView:n}=t;return!!(n&&e instanceof n.HTMLElement&&e.closest("[data-is-insertion-point]"))}var yq={};function vq({children:e,clientId:t}){const n=function(e){return(0,zt.A)(t=>{const n=t(Qy).getBlock(e);if(!n)return;const i=t(Zi).getBlockType(n.name);return i&&0!==Object.keys(i.providesContext).length?Object.fromEntries(Object.entries(i.providesContext).map(([e,t])=>[e,n.attributes[t]])):void 0},[e])}(t);return(0,Er.jsx)(Cj,{value:n,children:e})}var _q=(0,T.memo)(zq);function xq(e){const{clientId:t,allowedBlocks:n,prioritizedInserterBlocks:i,defaultBlock:r,directInsert:o,__experimentalDefaultBlock:s,__experimentalDirectInsert:a,template:l,templateLock:c,wrapperRef:u,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:h,__experimentalAppenderTagName:p,renderAppender:f,orientation:m,placeholder:g,layout:b,name:y,blockType:v,parentLock:_,defaultLayout:x}=e;!function(e,t,n,i,r,o,s,a,l,c,u,d){const h=(0,yt.A)(),p=lq(n),f=lq(i),m=void 0===l||"contentOnly"===t?t:l;(0,T.useLayoutEffect)(()=>{const t={allowedBlocks:p,prioritizedInserterBlocks:f,templateLock:m};if(void 0!==c&&(t.__experimentalCaptureToolbars=c),void 0!==u)t.orientation=u;else{const e=Sk(d?.type);t.orientation=e.getOrientation(d)}void 0!==s&&((0,Qt.A)("__experimentalDefaultBlock",{alternative:"defaultBlock",since:"6.3",version:"6.4"}),t.defaultBlock=s),void 0!==r&&(t.defaultBlock=r),void 0!==a&&((0,Qt.A)("__experimentalDirectInsert",{alternative:"directInsert",since:"6.3",version:"6.4"}),t.directInsert=a),void 0!==o&&(t.directInsert=o),void 0!==t.directInsert&&"boolean"!=typeof t.directInsert&&(0,Qt.A)("Using `Function` as a `directInsert` argument",{alternative:"`boolean` values",since:"6.5"}),sq.get(h)||sq.set(h,{}),sq.get(h)[e]=t,window.queueMicrotask(()=>{const e=sq.get(h);if(Object.keys(e).length){const{updateBlockListSettings:t}=h.dispatch(Qy);t(e),sq.set(h,{})}})},[e,p,f,m,r,o,s,a,c,u,d,h])}(t,_,n,i,r,o,s,a,c,h,m,b),function(e,t,n,i){const r=(0,yt.A)(),o=(0,T.useRef)(null);(0,T.useLayoutEffect)(()=>{let s=!1;const{getBlocks:a,getSelectedBlocksInitialCaretPosition:l,isBlockSelected:c}=r.select(Qy),{replaceInnerBlocks:u,__unstableMarkNextChangeAsNotPersistent:d}=r.dispatch(Qy);return window.queueMicrotask(()=>{if(s)return;const r=a(e),h=0===r.length||"all"===n||"contentOnly"===n,p=!F(t,o.current);if(!h||!p)return;o.current=t;const f=na(r,t);F(f,r)||(d(),u(e,f,0===r.length&&i&&0!==f.length&&c(e),l()))}),()=>{s=!0}},[t,n,e,r,i])}(t,l,c,d);const k=vn(y,"layout")||vn(y,"__experimentalLayout")||yq,{allowSizingOnChildren:w=!1}=k,C=b||k,S=(0,T.useMemo)(()=>({...x,...C,...w&&{allowSizingOnChildren:!0}}),[x,C,w]),A=(0,Er.jsx)(_q,{rootClientId:t,renderAppender:f,__experimentalAppenderTagName:p,layout:S,wrapperRef:u,placeholder:g});return v?.providesContext&&0!==Object.keys(v.providesContext).length?(0,Er.jsx)(vq,{clientId:t,children:A}):A}function kq(e){return fU(e),(0,Er.jsx)(xq,{...e})}var wq=(0,T.forwardRef)((e,t)=>{const n=Cq({ref:t},e);return(0,Er.jsx)("div",{className:"block-editor-inner-blocks",children:(0,Er.jsx)("div",{...n})})});function Cq(e={},t={}){const{__unstableDisableLayoutClassNames:n,__unstableDisableDropZone:i,dropZoneElement:r}=t,{clientId:o,layout:s=null,__unstableLayoutClassNames:a=""}=Ih(),l=(0,zt.A)(e=>{const{getBlockName:t,isZoomOut:n,getTemplateLock:i,getBlockRootClientId:r,getBlockEditingMode:s,getBlockSettings:a,getSectionRootClientId:l}=Gh(e(Qy));if(!o){const e=l();return{isDropZoneDisabled:n()&&""!==e}}const{hasBlockSupport:c,getBlockType:u}=e(Zi),d=t(o),h=s(o),p=r(o),[f]=a(o,"layout");let m="disabled"===h;if(n()){const e=l();m=o!==e}return{__experimentalCaptureToolbars:c(d,"__experimentalExposeControlsToChildren",!1),name:d,blockType:u(d),parentLock:i(p),parentClientId:p,isDropZoneDisabled:m,defaultLayout:f}},[o]),{__experimentalCaptureToolbars:c,name:u,blockType:d,parentLock:h,parentClientId:p,isDropZoneDisabled:f,defaultLayout:m}=l,g=function({dropZoneElement:e,rootClientId:t="",parentClientId:n="",isDisabled:i=!1}={}){const r=(0,yt.A)(),[o,s]=(0,T.useState)({index:null,operation:"insert"}),{getBlockType:a,getBlockVariations:l,getGroupingBlockName:c}=(0,zt.A)(Zi),{canInsertBlockType:u,getBlockListSettings:d,getBlocks:h,getBlockIndex:p,getDraggedBlockClientIds:f,getBlockNamesByClientId:m,getAllowedBlocks:g,isDragging:b,isGroupable:y,isZoomOut:v,getSectionRootClientId:_,getBlockParents:x}=Gh((0,zt.A)(Qy)),{showInsertionPoint:k,hideInsertionPoint:w,startDragging:C,stopDragging:S}=Gh((0,Vt.A)(Qy)),A=pq("before"===o.operation||"after"===o.operation?n:t,o.index,{operation:o.operation,nearestSide:o.nearestSide}),I=dq((0,T.useCallback)((i,o)=>{b()||C();const w=f(),S=[t,...x(t,!0)];if(w.some(e=>S.includes(e)))return;const A=g(t),I=m([t])[0],E=m(w);if(!gq(a,A,E,I))return;const j=_();if(v()&&j!==t)return;const T=h(t).filter(e=>!(_n(e.name,"visibility",!0)&&!1===e.attributes?.metadata?.blockVisibility));if(0===T.length)return void r.batch(()=>{s({index:0,operation:"insert"}),k(t,0,{operation:"insert"})});const B=T.map(e=>{const t=e.clientId;return{isUnmodifiedDefaultBlock:In(e),getBoundingClientRect:()=>{const e=o.getElementById(`block-${t}`);return e?e.getBoundingClientRect():null},blockIndex:p(t),blockOrientation:d(t)?.orientation}}),N=function(e,t,n="vertical",i={}){const r="horizontal"===n?["left","right"]:["top","bottom"];let o=0,s="before",a=1/0,l=null,c="right";const{dropZoneElement:u,parentBlockOrientation:d,rootBlockIndex:h=0}=i;if(u&&"horizontal"!==d){const e=u.getBoundingClientRect(),[n,i]=fq(t,e,["top","bottom"]);if(e.height>120&&n<30){if("top"===i)return[h,"before"];if("bottom"===i)return[h+1,"after"]}}const p=(0,ee.isRTL)();if(u&&"horizontal"===d){const e=u.getBoundingClientRect(),[n,i]=fq(t,e,["left","right"]);if(e.width>120&&n<30){if(p&&"right"===i||!p&&"left"===i)return[h,"before"];if(p&&"left"===i||!p&&"right"===i)return[h+1,"after"]}}e.forEach(({isUnmodifiedDefaultBlock:e,getBoundingClientRect:i,blockIndex:u,blockOrientation:d})=>{const h=i();if(!h)return;let[f,m]=fq(t,h,r);const[g,b]=fq(t,h,["left","right"]),y=mq(t,h);e&&y?f=0:"vertical"===n&&"horizontal"!==d&&(y&&g<30||!y&&function(e,t){return t.top<=e.y&&t.bottom>=e.y}(t,h))&&(l=u,c=b),f"core/image"===e),i=u("core/gallery",t),r=y([e.clientId,f()]),o=l(c(),"block"),s=o&&o.find(({name:e})=>"group-row"===e);if(n&&!i&&(!r||!s))return;if(!(n||r&&s))return}r.batch(()=>{s({index:R,operation:O,nearestSide:L});const e=["before","after"].includes(O)?n:t;k(e,R,{operation:O,nearestSide:L})})}},[b,g,t,m,f,a,_,v,h,d,e,n,p,r,C,k,u,y,l,c]),200);return OC({dropZoneElement:e,isDisabled:i,onDrop:A,onDragOver(e){I(e,e.currentTarget.ownerDocument)},onDragLeave(e){const{ownerDocument:t}=e.currentTarget;bq(e.relatedTarget,t)||bq(e.target,t)||(I.cancel(),w())},onDragEnd(){I.cancel(),S(),w()}})}({dropZoneElement:r,rootClientId:o,parentClientId:p}),b=(0,gt.A)([e.ref,i||f||s?.isManualPlacement&&window.__experimentalEnableGridInteractivity?null:g]),y={__experimentalCaptureToolbars:c,layout:s,name:u,blockType:d,parentLock:h,defaultLayout:m,...t},v=y.value&&y.onChange?kq:xq;return{...e,ref:b,className:(0,mh.A)(e.className,"block-editor-block-list__layout",n?"":a),children:o?(0,Er.jsx)(v,{...y,clientId:o}):(0,Er.jsx)(zq,{...t})}}Cq.save=function(e={}){const{innerBlocks:t}=Nr;if(!Array.isArray(t))return{...e,children:t};const n=Fr(t,{isInnerBlocks:!0}),i=(0,Er.jsx)(Sr.A,{children:n});return{...e,children:i}},wq.DefaultBlockAppender=function(){const{clientId:e}=Ih();return(0,Er.jsx)(qG,{rootClientId:e})},wq.ButtonBlockAppender=function({showSeparator:e,isFloating:t,onAddBlock:n,isToggle:i}){const{clientId:r}=Ih();return(0,Er.jsx)(FJ,{className:(0,mh.A)({"block-list-appender__toggle":i}),rootClientId:r,showSeparator:e,isFloating:t,onAddBlock:n})},wq.Content=()=>Cq.save().children;var Sq=wq,Aq=new Set([Rt.UP,Rt.NS,Rt.PX,Rt.M3,Rt.Fm,Rt.G_]);function Iq(){const e=(0,zt.A)(e=>e(Qy).isTyping(),[]),{stopTyping:t}=(0,Vt.A)(Qy);return(0,bt.A)(n=>{if(!e)return;const{ownerDocument:i}=n;let r,o;function s(e){const{clientX:n,clientY:i}=e;r&&o&&(r!==n||o!==i)&&t(),r=n,o=i}return i.addEventListener("mousemove",s),()=>{i.removeEventListener("mousemove",s)}},[e,t])}function Eq(){const e=(0,zt.A)(e=>e(Qy).isTyping(),[]),{startTyping:t,stopTyping:n}=(0,Vt.A)(Qy),i=Iq(),r=(0,bt.A)(i=>{if(e){let e,t=function(t){const{target:r}=t;e=i.ownerDocument.defaultView.setTimeout(()=>{_G(r)||n()})},r=function(e){const{keyCode:t}=e;t!==Rt._f&&t!==Rt.wn||n()},o=function(){i.ownerDocument.defaultView.getSelection().isCollapsed||n()};return i.addEventListener("focus",t),i.addEventListener("keydown",r),i.ownerDocument.addEventListener("selectionchange",o),()=>{i.ownerDocument.defaultView.clearTimeout(e),i.removeEventListener("focus",t),i.removeEventListener("keydown",r),i.ownerDocument.removeEventListener("selectionchange",o)}}function r(e){const{type:n,target:r}=e;_G(r)&&i.contains(r)&&("keydown"!==n||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&Aq.has(t)}(e))&&t()}return i.addEventListener("keypress",r),i.addEventListener("keydown",r),()=>{i.removeEventListener("keypress",r),i.removeEventListener("keydown",r)}},[e,t,n]);return(0,gt.A)([i,r])}var jq=function({children:e}){return(0,Er.jsx)("div",{ref:Eq(),children:e})};function Tq({clientId:e,rootClientId:t="",position:n="top"}){const[i,r]=(0,T.useState)(!1),{sectionRootClientId:o,sectionClientIds:s,insertionPoint:a,blockInsertionPointVisible:l,blockInsertionPoint:c,blocksBeingDragged:u}=(0,zt.A)(e=>{const{getInsertionPoint:t,getBlockOrder:n,getSectionRootClientId:i,isBlockInsertionPointVisible:r,getBlockInsertionPoint:o,getDraggedBlockClientIds:s}=Gh(e(Qy)),a=i();return{sectionRootClientId:a,sectionClientIds:n(a),insertionPoint:t(),blockInsertionPoint:o(),blockInsertionPointVisible:r(),blocksBeingDragged:s()}},[]),d=(0,LS.A)();if(!e)return;let h=!1;if(t!==o||!s||!s.includes(e))return null;const p=0===a?.index&&e===s[a.index],f=a&&a.hasOwnProperty("index")&&e===s[a.index-1];"top"===n&&(h=p||l&&0===c.index&&e===s[c.index]),"bottom"===n&&(h=f||l&&e===s[c.index-1]);const m=u[0],g=u.includes(e),b=s.indexOf(m),y=b>0?s[b-1]:null;return(g||y===e)&&(h=!1),(0,Er.jsx)(BS.N,{children:h&&(0,Er.jsx)(NS.P.div,{initial:{height:0},animate:{height:"calc(1 * var(--wp-block-editor-iframe-zoom-out-frame-size) / var(--wp-block-editor-iframe-zoom-out-scale)"},exit:{height:0},transition:{type:"tween",duration:d?0:.2,ease:[.6,0,.4,1]},className:(0,mh.A)("block-editor-block-list__zoom-out-separator",{"is-dragged-over":i}),"data-is-insertion-point":"true",onDragOver:()=>r(!0),onDragLeave:()=>r(!1),children:(0,Er.jsx)(NS.P.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{delay:-.125}},transition:{ease:"linear",duration:.1,delay:.125},children:(0,ee.__)("Drop pattern.")})})})}var Bq=(0,T.createContext)();Bq.displayName="IntersectionObserverContext";var Nq=new WeakMap,Rq={trailing:!0};function Oq({className:e,...t}){const{isOutlineMode:n,isFocusMode:i,isPreviewMode:r,editedContentOnlySection:o}=(0,zt.A)(e=>{const{getSettings:t,isTyping:n,hasBlockSpotlight:i,getEditedContentOnlySection:r}=Gh(e(Qy)),{outlineMode:o,focusMode:s,isPreviewMode:a}=t();return{isOutlineMode:o&&!n(),isFocusMode:s||i(),isPreviewMode:a,editedContentOnlySection:r()}},[]),s=(0,yt.A)(),{setBlockVisibility:a}=(0,Vt.A)(Qy),l=(0,uj.A)((0,T.useCallback)(()=>{const e={};Nq.get(s).forEach(([t,n])=>{e[t]=n}),a(e)},[s]),300,Rq),c=(0,T.useMemo)(()=>{const{IntersectionObserver:e}=window;if(e)return new e(e=>{Nq.get(s)||Nq.set(s,[]);for(const t of e){const e=t.target.getAttribute("data-block");Nq.get(s).push([e,t.isIntersecting])}l()})},[]),u=Cq({ref:(0,gt.A)([rq(),iq(),Eq()]),className:(0,mh.A)("is-root-container",e,{"is-outline-mode":n,"is-focus-mode":i,"is-preview-mode":r})},t);return(0,Er.jsxs)(Bq.Provider,{value:c,children:[(0,Er.jsx)("div",{...u}),!!o&&(0,Er.jsx)(Lq,{clientId:o})]})}function Lq({clientId:e}){const{stopEditingContentOnlySection:t}=Gh((0,Vt.A)(Qy)),n=(0,zt.A)(t=>{const{isBlockSelected:n,hasSelectedInnerBlock:i,getBlockSelectionStart:r}=t(Qy);return!r()||n(e)||i(e,!0)},[e]);return(0,T.useEffect)(()=>{n||t()},[n,t]),null}function Mq(e){return(0,Er.jsx)(Ah,{value:Ch,children:(0,Er.jsx)(Oq,{...e})})}var Pq=[],Dq=new Set;function Fq({placeholder:e,rootClientId:t,renderAppender:n,__experimentalAppenderTagName:i,layout:r=Ak}){const o=!1!==n,s=!!n,{order:a,isZoomOut:l,selectedBlocks:c,visibleBlocks:u,shouldRenderAppender:d}=(0,zt.A)(e=>{const{getSettings:n,getBlockOrder:i,getSelectedBlockClientIds:r,__unstableGetVisibleBlocks:a,getTemplateLock:l,getBlockEditingMode:c,isSectionBlock:u,isContainerInsertableToInContentOnlyMode:d,getBlockName:h,isZoomOut:p,canInsertBlockType:f}=Gh(e(Qy)),m=i(t);if(n().isPreviewMode)return{order:m,selectedBlocks:Pq,visibleBlocks:Dq};const g=r(),b=g[0],y=!(t||b||m.length&&f(gn(),t)),v=!(!t||!b||t!==b),_=l(t);return{order:m,selectedBlocks:g,visibleBlocks:a(),isZoomOut:p(),shouldRenderAppender:(!u(t)||d(h(b),t))&&"disabled"!==c(t)&&(!_||"contentOnly"===_)&&o&&!p()&&(s||v||y)}},[t,o,s]);return(0,Er.jsxs)(Ek,{value:r,children:[a.map(e=>(0,Er.jsxs)(BU.Ay,{value:!u.has(e)&&!c.includes(e),children:[l&&(0,Er.jsx)(Tq,{clientId:e,rootClientId:t,position:"top"}),(0,Er.jsx)(GG,{rootClientId:t,clientId:e}),l&&(0,Er.jsx)(Tq,{clientId:e,rootClientId:t,position:"bottom"})]},e)),a.length<1&&e,d&&(0,Er.jsx)(YG,{tagName:i,rootClientId:t,CustomAppender:n})]})}function zq(e){return(0,Er.jsx)(BU.Ay,{value:!1,children:(0,Er.jsx)(Fq,{...e})})}function Vq(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:i,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:o,__unstableIsFullySelected:s}=e(Qy);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:i(),selectedBlockClientId:r(),initialPosition:o(),isFullSelection:s()}}function Uq(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:i,selectedBlockClientId:r,isFullSelection:o}=(0,zt.A)(Vq,[]);return(0,bt.A)(r=>{const{ownerDocument:s}=r,{defaultView:a}=s;if(null==e)return;if(!i||t)return;const{length:l}=n;l<2||o&&(r.contentEditable=!0,r.focus(),a.getSelection().removeAllRanges())},[i,t,n,r,e,o])}function $q(e){const{anchorNode:t,focusNode:n,anchorOffset:i,focusOffset:r}=e;(0,re.e)(t,"anchorNode"),(0,re.e)(n,"focusNode");const o=t.compareDocumentPosition(n);return!(o&t.DOCUMENT_POSITION_PRECEDING)&&(!!(o&t.DOCUMENT_POSITION_FOLLOWING)||0!==o||i<=r)}function Hq(e,t,n=!1){if(xG(e)&&"number"==typeof e.selectionStart)return e.selectionStart===e.selectionEnd&&(t?0===e.selectionStart:e.value.length===e.selectionStart);if(!e.isContentEditable)return!0;const{ownerDocument:i}=e,{defaultView:r}=i;(0,re.e)(r,"defaultView");const o=r.getSelection();if(!o||!o.rangeCount)return!1;const s=o.getRangeAt(0),a=s.cloneRange(),l=$q(o),c=o.isCollapsed;c||a.collapse(!l);const u=Kt(a),d=Kt(s);if(!u||!d)return!1;const h=function(e){const t=Array.from(e.getClientRects());if(!t.length)return;const n=Math.min(...t.map(({top:e})=>e));return Math.max(...t.map(({bottom:e})=>e))-n}(s);if(!c&&h&&h>u.height&&l===t)return!1;const p=SG(e)?!t:t,f=e.getBoundingClientRect(),m=p?f.left+1:f.right-1,g=t?f.top+1:f.bottom-1,b=AG(e,t,()=>CG(i,m,g,e));if(!b)return!1;const y=Kt(b);if(!y)return!1;const v=t?"top":"bottom",_=p?"left":"right",x=y[v]-d[v],k=y[_]-u[_],w=Math.abs(x)<=1,C=Math.abs(k)<=1;return n?w:w&&C}function Wq(e,t){return Hq(e,t,!0)}function Gq(e,t){return Hq(e,t)}function qq(e,t,n,i){let r,o=hS.XC.focusable.find(n);return t&&o.reverse(),o=o.slice(o.indexOf(e)+1),i&&(r=e.getBoundingClientRect()),o.find(function(e){if(sD(e)&&0!==hS.XC.focusable.find(e).filter(e=>!kG(e)).length)return!1;if(!hS.XC.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(i){const t=e.getBoundingClientRect();if(t.left>=r.right||t.right<=r.left)return!1}return!0})}function Kq(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:i,__unstableIsFullySelected:r}=(0,zt.A)(Qy),{selectBlock:o}=(0,Vt.A)(Qy);return(0,bt.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===Rt.UP,g=c===Rt.PX,b=c===Rt.M3,y=c===Rt.NS,v=m||b,_=b||y,x=m||g,k=_||x,w=d||h||p||f,C=x?Wq:Gq,{ownerDocument:S}=s,{defaultView:A}=S;if(!k)return;if(n().isPreviewMode)return;if(i()){if(d)return;if(!r())return;return l.preventDefault(),void(v?o(e()):o(t(),-1))}if(!function(e,t,n){const i=t===Rt.UP||t===Rt.PX,{tagName:r}=e,o=e.getAttribute("type");return i&&!n?"INPUT"!==r||!["date","datetime-local","month","number","range","time","week"].includes(o):"INPUT"===r?["button","checkbox","number","color","file","image","radio","reset","submit"].includes(o):"TEXTAREA"!==r}(u,c,w))return;x?a||(a=function(e){const t=e.getSelection();(0,re.e)(t,"selection");const n=t.rangeCount?t.getRangeAt(0):null;return n?Kt(n):null}(A)):a=null;const I=SG(u)?!v:v,{keepCaretInsideBlock:E}=n();if(d)(function(e,t){const n=qq(e,t,s);return n&&sD(n)})(u,v)&&C(u,v)&&(s.contentEditable=!0,s.focus());else if(!x||!Wq(u,v)||p&&!Gq(u,I)||E)_&&A.getSelection().isCollapsed&&Gq(u,I)&&!E&&(EG(qq(u,I,s),v),l.preventDefault());else{const e=qq(u,v,s,!0);e&&(function(e,t,n){IG(e,t,n?.left)}(e,p?!v:v,p?void 0:a),l.preventDefault())}}return s.addEventListener("mousedown",l),s.addEventListener("keydown",c),()=>{s.removeEventListener("mousedown",l),s.removeEventListener("keydown",c)}},[])}function Yq(){const e=(0,zt.A)(e=>e(Qy).getSettings().isPreviewMode,[]);return(0,bt.A)(t=>{if(e)return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)};function n(e){const{keyCode:n,shiftKey:i,target:r}=e,o=n===Rt.wn,s=n===Rt.UP,a=n===Rt.PX,l=n===Rt.M3,c=n===Rt.NS;if(!o&&!(s||a||l||c))return;const u=o?i:s||l,d=Array.from(t.querySelectorAll("[data-block]"));if(!d.length)return;const h=r.closest("[data-block]"),p=h?d.indexOf(h):-1;if(-1===p)return;if(o){if(u&&0===p)return;if(!u&&p===d.length-1)return}let f;f=u?p<=0?d.length-1:p-1:-1===p||p>=d.length-1?0:p+1,e.preventDefault(),d[f].focus()}},[e])}function Jq(e,t,n){let i=t;do{if(e===i)return!0;for(i=i[n];i&&i.nodeType===i.TEXT_NODE&&""===i.nodeValue;)i=i["lastChild"===n?"previousSibling":"nextSibling"]}while(i);return!1}function Xq(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,zt.A)(Qy),{multiSelect:i,selectBlock:r}=(0,Vt.A)(Qy),o=(0,$T.ZK)();return(0,bt.A)(s=>{function a(a){if(!o("core/block-editor/select-all",a))return;const l=t();if(l.length<2&&!function(e){if(xG(e))return 0===e.selectionStart&&e.value.length===e.selectionEnd;if(!e.isContentEditable)return!0;const t=e.textContent||"";if(""===t||"\ufeff"===t)return!0;const{ownerDocument:n}=e,{defaultView:i}=n;(0,re.e)(i,"defaultView");const r=i.getSelection();(0,re.e)(r,"selection");const o=r.rangeCount?r.getRangeAt(0):null;if(!o)return!0;const{startContainer:s,endContainer:a,startOffset:l,endOffset:c}=o;if(s===e&&a===e&&0===l&&c===e.childNodes.length)return!0;const u=e.lastChild;(0,re.e)(u,"lastChild");const d=a.nodeType===a.TEXT_NODE?a.data.length:a.childNodes.length;return Jq(s,e,"firstChild")&&Jq(a,e,"lastChild")&&0===l&&c===d}(a.target))return;a.preventDefault();const{ownerDocument:c}=a.target,[u]=l,d=sD(c.activeElement);if(d&&d!==u&&!oD(c.getElementById("block-"+u),c.activeElement))return void r(d);const h=n(u),p=e(h);l.length!==p.length?i(p[0],p[p.length-1]):h&&(s.ownerDocument.defaultView.getSelection().removeAllRanges(),r(h))}return s.addEventListener("keydown",a),()=>{s.removeEventListener("keydown",a)}},[])}function Zq(e,t){e.contentEditable=t,t&&e.focus()}function Qq(){const{startMultiSelect:e,stopMultiSelect:t}=(0,Vt.A)(Qy),{getSettings:n,isSelectionEnabled:i,hasSelectedBlock:r,isDraggingBlocks:o,isMultiSelecting:s}=(0,zt.A)(Qy);return(0,bt.A)(a=>{const{ownerDocument:l}=a,{defaultView:c}=l;let u,d,h;function p(){t(),c.removeEventListener("mouseup",p),d=c.requestAnimationFrame(()=>{if(!r())return;Zq(a,!1);const e=c.getSelection();if(e.rangeCount){const t=e.getRangeAt(0),{commonAncestorContainer:n}=t,i=t.cloneRange();u.contains(n)&&(u.focus(),e.removeAllRanges(),e.addRange(i))}})}function f({buttons:t,target:r,relatedTarget:l}){r.contains(h)&&(r.contains(l)||o()||1===t&&(s()||a!==r&&("true"===r.getAttribute("contenteditable")||n().isPreviewMode)&&i()&&(u=r,e(),c.addEventListener("mouseup",p),Zq(a,!0))))}return a.addEventListener("mouseout",f),a.addEventListener("mousedown",function({target:e}){h=e}),()=>{a.removeEventListener("mouseout",f),c.removeEventListener("mouseup",p),c.cancelAnimationFrame(d)}},[e,t,i,r])}function eK(e,t){e.contentEditable!==String(t)&&(e.contentEditable=t,t&&e.focus())}function tK(e){const t=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;return t?.closest("[data-wp-block-attribute-key]")}function nK(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,Vt.A)(Qy),{getBlockParents:i,getBlockSelectionStart:r,isMultiSelecting:o}=(0,zt.A)(Qy);return(0,bt.A)(s=>{const{ownerDocument:a}=s,{defaultView:l}=a;function c(c){const u=l.getSelection();if(!u.rangeCount)return;const d=function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(u),h=function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE||n===t.childNodes.length?t:0===n&&$q(e)?t.previousSibling??t.parentElement:t.childNodes[n]}(u);if(!s.contains(d)||!s.contains(h))return;const p=c.shiftKey&&"mouseup"===c.type;if(u.isCollapsed&&!p){if("true"===s.contentEditable&&!o()){eK(s,!1);let e=d.nodeType===d.ELEMENT_NODE?d:d.parentElement;e=e?.closest("[contenteditable]"),e?.focus()}return}let f=sD(d),m=sD(h);if(p){const e=r(),t=sD(c.target),n=t!==m;(f===m&&u.isCollapsed||!m||n)&&(m=t),f!==e&&(f=e)}if(void 0!==f||void 0!==m){if("mouseup"===c.type&&!c.shiftKey&&!o()&&f===m){const e=sD(c.target);if(e&&e!==f)return void u.removeAllRanges()}if(f===m)if(o())e(f,f);else{const e=!u.isCollapsed&&(tK(d)||tK(h));if(e&&a.activeElement!==e){const t=We({element:e,range:u.getRangeAt(0),__unstableIsEditableTree:!0});n({start:{clientId:f,attributeKey:e.dataset.wpBlockAttributeKey,offset:t.start??0},end:{clientId:f,attributeKey:e.dataset.wpBlockAttributeKey,offset:t.end}})}else t(f)}else{const t=[...i(f),f],r=[...i(m),m],o=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,r);if(t[o]!==f||r[o]!==m)return void e(t[o],r[o]);const s=tK(d),a=tK(h);if(s&&a){const e=u.getRangeAt(0),t=We({element:s,range:e,__unstableIsEditableTree:!0}),i=We({element:a,range:e,__unstableIsEditableTree:!0}),r=t.start??t.end,o=i.start??i.end;n({start:{clientId:f,attributeKey:s.dataset.wpBlockAttributeKey,offset:r},end:{clientId:m,attributeKey:a.dataset.wpBlockAttributeKey,offset:o}})}else e(f,m)}}else eK(s,!1)}return a.addEventListener("selectionchange",c),l.addEventListener("mouseup",c),()=>{a.removeEventListener("selectionchange",c),l.removeEventListener("mouseup",c)}},[e,t,n,i])}function iK(){const{selectBlock:e}=(0,Vt.A)(Qy),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:i}=(0,zt.A)(Qy);return(0,bt.A)(r=>{function o(o){if(!t()||0!==o.button)return;const s=n(),a=sD(o.target);o.shiftKey?s&&s!==a&&(r.contentEditable=!0,r.focus()):i()&&e(a)}return r.addEventListener("mousedown",o),()=>{r.removeEventListener("mousedown",o)}},[e,t,n,i])}function rK(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,getSelectedBlockClientId:n,__unstableIsSelectionMergeable:i,hasMultiSelection:r,getBlockName:o,canInsertBlockType:s,getBlockRootClientId:a,getSelectionStart:l,getSelectionEnd:c,getBlockAttributes:u}=(0,zt.A)(Qy),{replaceBlocks:d,__unstableSplitSelection:h,removeBlocks:p,__unstableDeleteSelection:f,__unstableExpandSelection:m,__unstableMarkAutomaticChange:g}=(0,Vt.A)(Qy);return(0,bt.A)(b=>{function y(e){"true"===b.contentEditable&&e.preventDefault()}function v(y){if(!y.defaultPrevented)if(r())y.keyCode===Rt.Fm?(b.contentEditable=!1,y.preventDefault(),e()?d(t(),er(gn())):h()):y.keyCode===Rt.G_||y.keyCode===Rt.SJ?(b.contentEditable=!1,y.preventDefault(),e()?p(t()):i()?f(y.keyCode===Rt.SJ):m()):1!==y.key.length||y.metaKey||y.ctrlKey||(b.contentEditable=!1,i()?f(y.keyCode===Rt.SJ):(y.preventDefault(),b.ownerDocument.defaultView.getSelection().removeAllRanges()));else if(y.keyCode===Rt.Fm){if(y.shiftKey||e())return;const t=n(),i=o(t),r=l(),p=c();if(r.attributeKey===p.attributeKey){const e=u(t)[r.attributeKey],n=ar(lr("from").filter(({type:e})=>"enter"===e),t=>t.regExp.test(e));if(n)return d(t,n.transform({content:e})),void g()}if(!_n(i,"splitting",!1)&&!y.__deprecatedOnSplit)return;(s(gn(),a(t))||s(i,a(t)))&&(h(),y.preventDefault())}}function _(e){r()&&(b.contentEditable=!1,i()?f():(e.preventDefault(),b.ownerDocument.defaultView.getSelection().removeAllRanges()))}return b.addEventListener("beforeinput",y),b.addEventListener("keydown",v),b.addEventListener("compositionstart",_),()=>{b.removeEventListener("beforeinput",y),b.removeEventListener("keydown",v),b.removeEventListener("compositionstart",_)}},[])}function oK(e){(0,re.e)(e.defaultView,"doc.defaultView");const t=e.defaultView.getSelection();(0,re.e)(t,"selection");const n=t.rangeCount?t.getRangeAt(0):null;return!!n&&!n.collapsed}function sK(){const{getBlockName:e}=(0,zt.A)(Qy),{getBlockType:t}=(0,zt.A)(Zi),{createSuccessNotice:n}=(0,Vt.A)(Rb.store);return(0,T.useCallback)((i,r)=>{let o="";if("copyStyles"===i)o=(0,ee.__)("Styles copied to clipboard.");else if(1===r.length){const n=r[0],s=t(e(n))?.title;o="copy"===i?(0,ee.sprintf)((0,ee.__)('Copied "%s" to clipboard.'),s):(0,ee.sprintf)((0,ee.__)('Moved "%s" to clipboard.'),s)}else o="copy"===i?(0,ee.sprintf)((0,ee._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,ee.sprintf)((0,ee._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(o,{type:"snackbar"})},[n,e,t])}var aK=Symbol("requiresWrapperOnCopy");function lK(e,t,n){let i=t;const[r]=t;if(r&&n.select(Zi).getBlockType(r.name)[aK]){const{getBlockRootClientId:e,getBlockName:t,getBlockAttributes:o}=n.select(Qy),s=e(r.clientId),a=t(s);a&&(i=er(a,o(s),i))}const o=Fr(i);e.clipboardData.setData("text/plain",ae(o.replace(/
/g,"\n")).trim().replace(/\n\n+/g,"\n\n")),e.clipboardData.setData("text/html",o)}function cK(){const e=(0,yt.A)(),{getBlocksByClientId:t,getSelectedBlockClientIds:n,hasMultiSelection:i,getSettings:r,getBlockName:o,__unstableIsFullySelected:s,__unstableIsSelectionCollapsed:a,__unstableIsSelectionMergeable:l,__unstableGetSelectedBlocksWithPartialSelection:c,canInsertBlockType:u,getBlockRootClientId:d}=(0,zt.A)(Qy),{flashBlock:h,removeBlocks:p,replaceBlocks:f,__unstableDeleteSelection:m,__unstableExpandSelection:g,__unstableSplitSelection:b}=(0,Vt.A)(Qy),y=sK();return(0,bt.A)(v=>{function _(_){if(_.defaultPrevented)return;const x=n();if(0===x.length)return;if(!i()){const{target:e}=_,{ownerDocument:t}=e,n="copy"===_.type||"cut"===_.type?function(e){return oK(e)||!!e.activeElement&&function(e){if(!vG(e)&&!_G(e))return!1;try{const{selectionStart:t,selectionEnd:n}=e;return null===t||t!==n}catch{return!0}}(e.activeElement)}(t):function(e){return!!e.activeElement&&(vG(e.activeElement)||_G(e.activeElement)||oK(e))}(t)&&!t.activeElement.isContentEditable;if(n)return}const{activeElement:k}=_.target.ownerDocument;if(!v.contains(k))return;const w=l(),C=a()||s(),S=!C&&!w;if("copy"===_.type||"cut"===_.type)if(_.preventDefault(),1===x.length&&h(x[0]),S)g();else{let n;if(y(_.type,x),C)n=t(x);else{const[e,i]=c();n=[e,...t(x.slice(1,x.length-1)),i]}lK(_,n,e)}if("cut"===_.type)C&&!S?p(x):(_.target.ownerDocument.activeElement.contentEditable=!1,m());else if("paste"===_.type){const{__experimentalCanUserUseUnfilteredHTML:e,mediaUpload:t}=r();if("true"===_.clipboardData.getData("rich-text"))return;const{plainText:n,html:a,files:l}=Pj(_),c=s();let h=[];if(l.length){if(!t)return void _.preventDefault();const e=lr("from");h=l.reduce((t,n)=>{const i=ar(e,e=>"files"===e.type&&e.isMatch([n]));return i&&t.push(i.transform([n])),t},[]).flat()}else h=Zs({HTML:a,plainText:n,mode:c?"BLOCKS":"AUTO",canUserUseUnfilteredHTML:e});if("string"==typeof h)return;if(c)return f(x,h,h.length-1,-1),void _.preventDefault();if(!i()&&!_n(o(x[0]),"splitting",!1)&&!_.__deprecatedOnSplit)return;const[p]=x,m=d(p),g=[];for(const e of h)if(u(e.name,m))g.push(e);else{const t=o(m),n=e.name!==t?ur(e,t):[e];if(!n)return;for(const e of n)for(const t of e.innerBlocks)g.push(t)}b(g),_.preventDefault()}}return v.ownerDocument.addEventListener("copy",_),v.ownerDocument.addEventListener("cut",_),v.ownerDocument.addEventListener("paste",_),()=>{v.ownerDocument.removeEventListener("copy",_),v.ownerDocument.removeEventListener("cut",_),v.ownerDocument.removeEventListener("paste",_)}},[])}function uK(){const[e,t,n]=function(){const e=(0,T.useRef)(),t=(0,T.useRef)(),n=(0,T.useRef)(),{hasMultiSelection:i,getSelectedBlockClientId:r,getBlockCount:o,getBlockOrder:s,getLastFocus:a,getSectionRootClientId:l,isZoomOut:c}=Gh((0,zt.A)(Qy)),{setLastFocus:u}=Gh((0,Vt.A)(Qy)),d=(0,T.useRef)();function h(t){const n=e.current.ownerDocument===t.target.ownerDocument?e.current:e.current.ownerDocument.defaultView.frameElement;if(d.current)d.current=null;else if(i())e.current.focus();else if(r())a()?.current?a().current.focus():e.current.querySelector(`[data-block="${r()}"]`).focus();else if(c()){const t=l(),i=s(t);i.length?e.current.querySelector(`[data-block="${i[0]}"]`).focus():t?e.current.querySelector(`[data-block="${t}"]`).focus():n.focus()}else{const i=t.target.compareDocumentPosition(n)&t.target.DOCUMENT_POSITION_FOLLOWING,r=hS.XC.tabbable.find(e.current);r.length&&(i?r[0]:r[r.length-1]).focus()}}const p=(0,Er.jsx)("div",{ref:t,tabIndex:"0",onFocus:h}),f=(0,Er.jsx)("div",{ref:n,tabIndex:"0",onFocus:h}),m=(0,bt.A)(i=>{function r(e){if(e.defaultPrevented)return;if(e.keyCode!==Rt.wn)return;if(!n.current||!t.current)return;const{target:i,shiftKey:r}=e,o=r?"findPrevious":"findNext",s=hS.XC.tabbable[o](i),a=i.closest("[data-block]"),l=a&&s&&(function(e,t){return e.closest(nD)===t.closest(nD)}(a,s)||oD(a,s));if(kG(s)&&l)return;const c=r?t:n;d.current=!0,c.current.focus({preventScroll:!0})}function s(e){u({...a(),current:e.target});const{ownerDocument:t}=i;!e.relatedTarget&&e.target.hasAttribute("data-block")&&t.activeElement===t.body&&0===o()&&i.focus()}function l(i){if(i.keyCode!==Rt.wn)return;if("region"===i.target?.getAttribute("role"))return;if(e.current===i.target)return;const r=i.shiftKey?"findPrevious":"findNext",o=hS.XC.tabbable[r](i.target);o!==t.current&&o!==n.current||(i.preventDefault(),o.focus({preventScroll:!0}))}const{ownerDocument:c}=i,{defaultView:h}=c;return h.addEventListener("keydown",l),i.addEventListener("keydown",r),i.addEventListener("focusout",s),()=>{h.removeEventListener("keydown",l),i.removeEventListener("keydown",r),i.removeEventListener("focusout",s)}},[]);return[p,(0,gt.A)([e,m]),f]}(),i=(0,zt.A)(e=>e(Qy).hasMultiSelection(),[]);return[e,(0,gt.A)([t,cK(),rK(),Qq(),nK(),iK(),Uq(),Xq(),Kq(),Yq(),(0,bt.A)(e=>(e.tabIndex=0,e.dataset.hasMultiSelection=i,i?(e.setAttribute("aria-label",(0,ee.__)("Multiple selected blocks")),()=>{delete e.dataset.hasMultiSelection,e.removeAttribute("aria-label")}):()=>{delete e.dataset.hasMultiSelection}),[i])]),n]}var dK=(0,T.forwardRef)(function({children:e,...t},n){const[i,r,o]=uK();return(0,Er.jsxs)(Er.Fragment,{children:[i,(0,Er.jsx)("div",{...t,ref:(0,gt.A)([r,n]),className:(0,mh.A)(t.className,"block-editor-writing-flow"),children:e}),o]})}),hK=null;function pK({frameSize:e,containerWidth:t,maxContainerWidth:n,scaleContainerWidth:i}){return(Math.min(t,n)-2*e)/i}function fK(e,t,n){const i={};for(const t in e)i[t]=e[t];if(e instanceof n.contentDocument.defaultView.MouseEvent){const e=n.getBoundingClientRect();i.clientX+=e.left,i.clientY+=e.top}const r=new t(e.type,i);i.defaultPrevented&&r.preventDefault(),!n.dispatchEvent(r)&&e.preventDefault()}function mK(e){return(0,bt.A)(()=>{const{defaultView:t}=e;if(!t)return;const{frameElement:n}=t,i=e.documentElement,r=["dragover","mousemove"],o={};for(const e of r)o[e]=e=>{const t=Object.getPrototypeOf(e).constructor.name;fK(e,window[t],n)},i.addEventListener(e,o[e]);return()=>{for(const e of r)i.removeEventListener(e,o[e])}})}var gK=new WeakMap,bK=globalThis.FinalizationRegistry?new globalThis.FinalizationRegistry(e=>URL.revokeObjectURL(e)):void 0;function yK({contentRef:e,children:t,tabIndex:n=0,scale:i=1,frameSize:r=0,readonly:o,forwardedRef:s,title:a=(0,ee.__)("Editor canvas"),...l}){const{resolvedAssets:c,isPreviewMode:u}=(0,zt.A)(e=>{const t=e(Qy).getSettings();return{resolvedAssets:t.__unstableResolvedAssets,isPreviewMode:t.isPreviewMode}},[]),[d,h]=(0,T.useState)(),[p,f]=(0,T.useState)([]),[m,g,b]=uK(),y=(0,bt.A)(e=>{let t;function n(e){e.preventDefault()}function i(e){"A"===e.target.tagName&&e.target.getAttribute("href")?.startsWith("#")&&(e.preventDefault(),t.defaultView.location.hash=e.target.getAttribute("href").slice(1))}const{ownerDocument:r}=e;function o(){const{contentDocument:o}=e,{documentElement:s}=o;t=o,h(o),s.classList.add("block-editor-iframe__html"),o.dir=r.dir;for(const e of hK||(hK=Array.from(document.styleSheets).reduce((e,t)=>{try{t.cssRules}catch{return e}const{ownerNode:n,cssRules:i}=t;if(null===n)return e;if(!i)return e;if(n.id.startsWith("wp-"))return e;if(!n.id)return e;if(function e(t){return Array.from(t).find(({selectorText:t,conditionText:n,cssRules:i})=>n?e(i):t&&(t.includes(".editor-styles-wrapper")||t.includes(".wp-block")))}(i)){const t="STYLE"===n.tagName;if(t){const t=n.id.replace("-inline-css","-css"),i=document.getElementById(t);i&&e.push(i.cloneNode(!0))}if(e.push(n.cloneNode(!0)),!t){const t=n.id.replace("-css","-inline-css"),i=document.getElementById(t);i&&e.push(i.cloneNode(!0))}}return e},[])))o.getElementById(e.id)||(o.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),t.addEventListener("click",i)}return f(Array.from(r.body.classList).filter(e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e)),e.addEventListener("load",o),()=>{h(void 0),e.removeEventListener("load",o),t?.removeEventListener("dragover",n),t?.removeEventListener("drop",n),t?.removeEventListener("click",i)}},[]),{contentResizeListener:v,containerResizeListener:_,isZoomedOut:x,scaleContainerWidth:k}=function({frameSize:e,iframeDocument:t,maxContainerWidth:n=750,scale:i}){const[r,{height:o}]=(0,SC.A)(),[s,{width:a,height:l}]=(0,SC.A)(),c=(0,T.useRef)(0),u=1!==i,d=(0,LS.A)(),h="auto-scaled"===i,p=(0,T.useRef)(!1),f=(0,T.useRef)(null);(0,T.useEffect)(()=>{u||(c.current=a)},[a,u]);const m=Math.max(c.current,a),g=h?pK({frameSize:e,containerWidth:a,maxContainerWidth:n,scaleContainerWidth:m}):i,b=(0,T.useRef)({scaleValue:g,frameSize:e,containerHeight:0,scrollTop:0,scrollHeight:0}),y=(0,T.useRef)({scaleValue:g,frameSize:e,containerHeight:0,scrollTop:0,scrollHeight:0}),v=(0,T.useCallback)(()=>{const{scrollTop:e}=b.current,{scrollTop:n}=y.current;return t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scroll-top",`${e}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scroll-top-next",`${n}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-overflow-behavior",b.current.scrollHeight===b.current.containerHeight?"auto":"scroll"),t.documentElement.classList.add("zoom-out-animation"),t.documentElement.animate(function(e,t){const{scaleValue:n,frameSize:i,scrollTop:r}=e,{scaleValue:o,frameSize:s,scrollTop:a}=t;return[{translate:"0 0",scale:n,paddingTop:i/n+"px",paddingBottom:i/n+"px"},{translate:`0 ${r-a}px`,scale:o,paddingTop:s/o+"px",paddingBottom:s/o+"px"}]}(b.current,y.current),{easing:"cubic-bezier(0.46, 0.03, 0.52, 0.96)",duration:400})},[t]),_=(0,T.useCallback)(()=>{p.current=!1,f.current=null,t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale",y.current.scaleValue),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-frame-size",`${y.current.frameSize}px`),t.documentElement.classList.remove("zoom-out-animation"),t.documentElement.scrollTop=y.current.scrollTop,t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-scroll-top"),t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-scroll-top-next"),t.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-overflow-behavior"),b.current=y.current},[t]),x=(0,T.useRef)(!1);return(0,T.useEffect)(()=>{const e=t&&x.current!==u;if(x.current=u,e&&(p.current=!0,u))return t.documentElement.classList.add("is-zoomed-out"),()=>{t.documentElement.classList.remove("is-zoomed-out")}},[t,u]),(0,T.useEffect)(()=>{if(t&&(h&&1!==b.current.scaleValue&&(b.current.scaleValue=pK({frameSize:b.current.frameSize,containerWidth:a,maxContainerWidth:n,scaleContainerWidth:a})),g<1&&(p.current||(t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale",g),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-frame-size",`${e}px`)),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-content-height",`${o}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-inner-height",`${l}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-container-width",`${a}px`),t.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale-container-width",`${m}px`)),p.current))if(p.current=!1,f.current){f.current.reverse();const e=b.current,t=y.current;b.current=t,y.current=e}else b.current.scrollTop=t.documentElement.scrollTop,b.current.scrollHeight=t.documentElement.scrollHeight,b.current.containerHeight=l,y.current={scaleValue:g,frameSize:e,containerHeight:t.documentElement.clientHeight},y.current.scrollHeight=function(e,t){const{scaleValue:n,scrollHeight:i}=e,{frameSize:r,scaleValue:o}=t;return i*(o/n)+2*r}(b.current,y.current),y.current.scrollTop=function(e,t){const{containerHeight:n,frameSize:i,scaleValue:r,scrollTop:o}=e,{containerHeight:s,frameSize:a,scaleValue:l,scrollHeight:c}=t;let u=o;u=(u+n/2-i)/r-n/2,u=(u+s/2)*l+a-s/2,u=o<=i?0:u;const d=c-s;return Math.round(Math.min(Math.max(0,u),Math.max(0,d)))}(b.current,y.current),f.current=v(),d?_():f.current.onfinish=_},[v,_,d,h,g,e,t,o,a,l,n,m]),{isZoomedOut:u,scaleContainerWidth:m,contentResizeListener:r,containerResizeListener:s}}({scale:i,frameSize:parseInt(r),iframeDocument:d}),w=ZU({isDisabled:!o}),C=(0,gt.A)([mK(d),e,g,w]),S=(0,bt.A)(e=>e.ownerDocument.defaultView?(C(e),()=>C(null)):()=>{},[C]),A=function(e){let t=gK.get(e);if(t)return t;const n=`\n\n\t\n\t\t\n\t\t\n\t\t\n\t\t${e.styles??""}\n\t\t${e.scripts??""}\n\t\n\t\n\t\t