[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.119.19.219: ~ $
/*! For license information please see form_editor.js.LICENSE.txt */
(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[747],{43575:(e,t,n)=>{e=n.nmd(e),function(t){"use strict";var n,r="function"==typeof(n=t.atob)?n:"function"==typeof Buffer?function(e){return new Buffer(e,"base64").toString("binary")}:"object"==typeof t.base64js?function(e){var n=t.base64js.b64ToByteArray(e);return Array.prototype.map.call(n,(function(e){return String.fromCharCode(e)})).join("")}:function(){throw new Error("You're probably in an old browser or an iOS webworker. It might help to include beatgammit's base64-js.")};t.atob=r,e&&e.exports&&(e.exports=r)}(window)},48198:function(e,t){var n,r;n=function(e,t){"use strict";var n,r,o="function"==typeof Map?new Map:(n=[],r=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return r[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),r.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),r.splice(t,1))}}),i=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){i=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function s(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!o.has(e)){var t=null,n=null,r=null,s=function(){e.clientWidth!==n&&d()},a=function(t){window.removeEventListener("resize",s,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",a,!1),e.removeEventListener("autosize:update",d,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),o.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",a,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",d,!1),window.addEventListener("resize",s,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",o.set(e,{destroy:a,update:d}),"vertical"===(l=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===l.resize&&(e.style.resize="horizontal"),t="content-box"===l.boxSizing?-(parseFloat(l.paddingTop)+parseFloat(l.paddingBottom)):parseFloat(l.borderTopWidth)+parseFloat(l.borderBottomWidth),isNaN(t)&&(t=0),d()}var l;function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(){if(0!==e.scrollHeight){var r=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),o=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,r.forEach((function(e){e.node.scrollTop=e.scrollTop})),o&&(document.documentElement.scrollTop=o)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),o="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(o<t?"hidden"===n.overflowY&&(c("scroll"),u(),o="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),u(),o="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),r!==o){r=o;var s=i("autosize:resized");try{e.dispatchEvent(s)}catch(e){}}}}function a(e){var t=o.get(e);t&&t.destroy()}function l(e){var t=o.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return s(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],l),e}),t.default=c,e.exports=t.default},void 0===(r=n.apply(t,[e,t]))||(e.exports=r)},66115:(e,t,n)=>{"use strict";var r={};n.r(r),n.d(r,{__experimentalBatch:()=>fs,__experimentalReceiveCurrentGlobalStylesId:()=>ns,__experimentalReceiveThemeBaseGlobalStyles:()=>rs,__experimentalReceiveThemeGlobalStyleVariations:()=>os,__experimentalSaveSpecifiedEntityEdits:()=>gs,__unstableCreateUndoLevel:()=>hs,addEntities:()=>Qi,deleteEntityRecord:()=>ls,editEntityRecord:()=>cs,receiveAutosaves:()=>vs,receiveCurrentTheme:()=>ts,receiveCurrentUser:()=>Zi,receiveDefaultTemplateId:()=>xs,receiveEmbedPreview:()=>as,receiveEntityRecords:()=>es,receiveNavigationFallbackId:()=>_s,receiveRevisions:()=>ws,receiveThemeGlobalStyleRevisions:()=>ss,receiveThemeSupports:()=>is,receiveUploadPermissions:()=>bs,receiveUserPermission:()=>ys,receiveUserQuery:()=>Xi,redo:()=>ds,saveEditedEntityRecord:()=>ms,saveEntityRecord:()=>ps,undo:()=>us});var o={};n.r(o),n.d(o,{__experimentalGetCurrentGlobalStylesId:()=>ja,__experimentalGetCurrentThemeBaseGlobalStyles:()=>za,__experimentalGetCurrentThemeGlobalStylesVariations:()=>Ua,__experimentalGetDirtyEntityRecords:()=>pa,__experimentalGetEntitiesBeingSaved:()=>fa,__experimentalGetEntityRecordNoResolver:()=>aa,__experimentalGetTemplateForLink:()=>Fa,canUser:()=>Na,canUserEditEntityRecord:()=>Da,getAuthors:()=>Qs,getAutosave:()=>Pa,getAutosaves:()=>Ma,getBlockPatternCategories:()=>Ha,getBlockPatterns:()=>Va,getCurrentTheme:()=>Ia,getCurrentThemeGlobalStylesRevisions:()=>Wa,getCurrentUser:()=>ea,getDefaultTemplateId:()=>Ga,getEditedEntityRecord:()=>ya,getEmbedPreview:()=>Ba,getEntitiesByKind:()=>na,getEntitiesConfig:()=>ra,getEntity:()=>oa,getEntityConfig:()=>ia,getEntityRecord:()=>sa,getEntityRecordEdits:()=>ma,getEntityRecordNonTransientEdits:()=>ga,getEntityRecords:()=>ua,getEntityRecordsTotalItems:()=>da,getEntityRecordsTotalPages:()=>ha,getLastEntityDeleteError:()=>ka,getLastEntitySaveError:()=>wa,getRawEntityRecord:()=>la,getRedoEdit:()=>Sa,getReferenceByDistinctEdits:()=>La,getRevision:()=>Ka,getRevisions:()=>qa,getThemeSupports:()=>Ta,getUndoEdit:()=>Ca,getUserPatternCategories:()=>$a,getUserQueryResults:()=>ta,hasEditsForEntityRecord:()=>ba,hasEntityRecords:()=>ca,hasFetchedAutosaves:()=>Oa,hasRedo:()=>Ea,hasUndo:()=>Aa,isAutosavingEntityRecord:()=>va,isDeletingEntityRecord:()=>xa,isPreviewEmbedFallback:()=>Ra,isRequestingEmbedPreview:()=>Zs,isSavingEntityRecord:()=>_a});var i={};n.r(i),n.d(i,{getBlockPatternsForPostType:()=>Xa,getNavigationFallbackId:()=>Ja,getUndoManager:()=>Ya});var s={};n.r(s),n.d(s,{__experimentalGetCurrentGlobalStylesId:()=>ml,__experimentalGetCurrentThemeBaseGlobalStyles:()=>gl,__experimentalGetCurrentThemeGlobalStylesVariations:()=>bl,__experimentalGetTemplateForLink:()=>fl,canUser:()=>ul,canUserEditEntityRecord:()=>dl,getAuthors:()=>tl,getAutosave:()=>pl,getAutosaves:()=>hl,getBlockPatternCategories:()=>_l,getBlockPatterns:()=>vl,getCurrentTheme:()=>al,getCurrentThemeGlobalStylesRevisions:()=>yl,getCurrentUser:()=>nl,getDefaultTemplateId:()=>kl,getEditedEntityRecord:()=>il,getEmbedPreview:()=>cl,getEntityRecord:()=>rl,getEntityRecords:()=>sl,getNavigationFallbackId:()=>wl,getRawEntityRecord:()=>ol,getRevision:()=>Sl,getRevisions:()=>Cl,getThemeSupports:()=>ll,getUserPatternCategories:()=>xl});var a={};n.r(a),n.d(a,{__experimentalHasContentRoleAttribute:()=>_u,getActiveBlockVariation:()=>iu,getBlockStyles:()=>ru,getBlockSupport:()=>fu,getBlockType:()=>nu,getBlockTypes:()=>tu,getBlockVariations:()=>ou,getCategories:()=>au,getChildBlockNames:()=>pu,getCollections:()=>lu,getDefaultBlockName:()=>cu,getDefaultBlockVariation:()=>su,getFreeformFallbackBlockName:()=>uu,getGroupingBlockName:()=>hu,getUnregisteredFallbackBlockName:()=>du,hasBlockSupport:()=>mu,hasChildBlocks:()=>yu,hasChildBlocksWithInserterSupport:()=>vu,isMatchingSearchTerm:()=>bu});var l={};n.r(l),n.d(l,{getAllBlockBindingsSources:()=>Au,getBlockBindingsSource:()=>Eu,getBootstrappedBlockType:()=>Cu,getSupportedStyles:()=>ku,getUnprocessedBlockTypes:()=>Su});var c={};n.r(c),n.d(c,{__experimentalReapplyBlockFilters:()=>Ou,addBlockCollection:()=>Yu,addBlockStyles:()=>Fu,addBlockTypes:()=>Mu,addBlockVariations:()=>Uu,reapplyBlockTypeFilters:()=>Pu,removeBlockCollection:()=>Ju,removeBlockStyles:()=>zu,removeBlockTypes:()=>Lu,removeBlockVariations:()=>Vu,setCategories:()=>qu,setDefaultBlockName:()=>Hu,setFreeformFallbackBlockName:()=>$u,setGroupingBlockName:()=>Gu,setUnregisteredFallbackBlockName:()=>Wu,updateCategory:()=>Ku});var u={};n.r(u),n.d(u,{addBootstrappedBlockType:()=>Xu,addUnprocessedBlockType:()=>Zu,registerBlockBindingsSource:()=>Qu});var d={};n.r(d),n.d(d,{getAllPatterns:()=>sm,getBlockRemovalRules:()=>Zf,getBlockSettings:()=>$f,getBlockWithoutAttributes:()=>qf,getContentLockingParent:()=>pm,getEnabledBlockParents:()=>Jf,getEnabledClientIdsTree:()=>Yf,getExpandedBlock:()=>hm,getInserterMediaCategories:()=>nm,getLastFocus:()=>um,getLastInsertedBlocksClientIds:()=>Gf,getOpenedBlockSettingsMenu:()=>Qf,getPatternBySlug:()=>im,getRegisteredInserterMediaCategories:()=>tm,getRemovalPromptData:()=>Xf,getReusableBlocks:()=>cm,getStyleOverrides:()=>em,getTemporarilyEditingAsBlocks:()=>fm,getTemporarilyEditingFocusModeToRevert:()=>mm,hasAllowedPatterns:()=>rm,isBlockInterfaceHidden:()=>Wf,isBlockSubtreeDisabled:()=>Kf,isDragging:()=>dm,isResolvingPatterns:()=>am});var h={};n.r(h),n.d(h,{__experimentalGetActiveBlockIdByBlockNames:()=>yb,__experimentalGetAllowedBlocks:()=>Jg,__experimentalGetAllowedPatterns:()=>tb,__experimentalGetBlockListSettingsForBlocks:()=>lb,__experimentalGetDirectInsertBlock:()=>Zg,__experimentalGetGlobalBlocksByName:()=>Tm,__experimentalGetLastBlockAttributeChanges:()=>db,__experimentalGetParsedPattern:()=>Qg,__experimentalGetPatternTransformItems:()=>ob,__experimentalGetPatternsByBlockTypes:()=>rb,__experimentalGetReusableBlockTitle:()=>cb,__unstableGetBlockWithoutInnerBlocks:()=>wm,__unstableGetClientIdWithClientIdsTree:()=>Cm,__unstableGetClientIdsTree:()=>Sm,__unstableGetContentLockingParent:()=>Eb,__unstableGetEditorMode:()=>pb,__unstableGetSelectedBlocksWithPartialSelection:()=>dg,__unstableGetTemporarilyEditingAsBlocks:()=>Ib,__unstableGetTemporarilyEditingFocusModeToRevert:()=>jb,__unstableGetVisibleBlocks:()=>xb,__unstableHasActiveBlockOverlayActive:()=>wb,__unstableIsFullySelected:()=>ag,__unstableIsLastBlockChangeIgnored:()=>ub,__unstableIsSelectionCollapsed:()=>lg,__unstableIsSelectionMergeable:()=>ug,__unstableIsWithinBlockOverlay:()=>kb,__unstableSelectionHasUnmergeableBlock:()=>cg,areInnerBlocksControlled:()=>bb,canEditBlock:()=>zg,canInsertBlockType:()=>Dg,canInsertBlocks:()=>Mg,canLockBlockType:()=>Ug,canMoveBlock:()=>Lg,canMoveBlocks:()=>Fg,canRemoveBlock:()=>Pg,canRemoveBlocks:()=>Og,didAutomaticChange:()=>mb,getAdjacentBlockClientId:()=>qm,getAllowedBlocks:()=>Yg,getBlock:()=>xm,getBlockAttributes:()=>_m,getBlockCount:()=>Nm,getBlockEditingMode:()=>Cb,getBlockHierarchyRootClientId:()=>Wm,getBlockIndex:()=>pg,getBlockInsertionPoint:()=>Ig,getBlockListSettings:()=>ib,getBlockMode:()=>xg,getBlockName:()=>ym,getBlockNamesByClientId:()=>Rm,getBlockOrder:()=>hg,getBlockParents:()=>Hm,getBlockParentsByBlockName:()=>$m,getBlockRootClientId:()=>Vm,getBlockSelectionEnd:()=>Om,getBlockSelectionStart:()=>Pm,getBlockTransformItems:()=>qg,getBlocks:()=>km,getBlocksByClientId:()=>Bm,getBlocksByName:()=>jm,getClientIdsOfDescendants:()=>Am,getClientIdsWithDescendants:()=>Em,getDirectInsertBlock:()=>Xg,getDraggedBlockClientIds:()=>Cg,getFirstMultiSelectedBlockClientId:()=>eg,getGlobalBlockCount:()=>Im,getInserterItems:()=>Gg,getLastMultiSelectedBlockClientId:()=>tg,getLowestCommonAncestorWithSelectedBlock:()=>Gm,getMultiSelectedBlockClientIds:()=>Zm,getMultiSelectedBlocks:()=>Qm,getMultiSelectedBlocksEndClientId:()=>sg,getMultiSelectedBlocksStartClientId:()=>ig,getNextBlockClientId:()=>Ym,getPatternsByBlockTypes:()=>nb,getPreviousBlockClientId:()=>Km,getSelectedBlock:()=>Um,getSelectedBlockClientId:()=>zm,getSelectedBlockClientIds:()=>Xm,getSelectedBlockCount:()=>Lm,getSelectedBlocksInitialCaretPosition:()=>Jm,getSelectionEnd:()=>Mm,getSelectionStart:()=>Dm,getSettings:()=>sb,getTemplate:()=>Bg,getTemplateLock:()=>Rg,hasBlockMovingClientId:()=>fb,hasDraggedInnerBlock:()=>gg,hasInserterItems:()=>Kg,hasMultiSelection:()=>yg,hasSelectedBlock:()=>Fm,hasSelectedInnerBlock:()=>mg,isAncestorBeingDragged:()=>Ag,isAncestorMultiSelected:()=>og,isBlockBeingDragged:()=>Sg,isBlockHighlighted:()=>gb,isBlockInsertionPointVisible:()=>jg,isBlockMultiSelected:()=>rg,isBlockSelected:()=>fg,isBlockValid:()=>vm,isBlockVisible:()=>_b,isBlockWithinSelection:()=>bg,isCaretWithinFormattedText:()=>Eg,isDraggingBlocks:()=>kg,isFirstMultiSelectedBlock:()=>ng,isGroupable:()=>Ab,isLastBlockChangePersistent:()=>ab,isMultiSelecting:()=>vg,isNavigationMode:()=>hb,isSelectionEnabled:()=>_g,isTyping:()=>wg,isUngroupable:()=>Sb,isValidTemplate:()=>Tg,wasBlockJustInserted:()=>vb});var p={};n.r(p),n.d(p,{__experimentalUpdateSettings:()=>Rb,clearBlockRemovalPrompt:()=>Lb,deleteStyleOverride:()=>Vb,ensureDefaultBlock:()=>Pb,expandBlock:()=>Kb,hideBlockInterface:()=>Nb,modifyContentLockBlock:()=>Yb,privateRemoveBlocks:()=>Mb,setBlockRemovalRules:()=>Fb,setLastFocus:()=>$b,setOpenedBlockSettingsMenu:()=>zb,setStyleOverride:()=>Ub,showBlockInterface:()=>Db,startDragging:()=>Gb,stopDragging:()=>qb,stopEditingAsBlocks:()=>Wb,syncDerivedUpdates:()=>Hb});var f={};n.r(f),n.d(f,{__unstableDeleteSelection:()=>jy,__unstableExpandSelection:()=>By,__unstableMarkAutomaticChange:()=>Jy,__unstableMarkLastChangeAsPersistent:()=>Ky,__unstableMarkNextChangeAsNotPersistent:()=>Yy,__unstableSaveReusableBlock:()=>qy,__unstableSetEditorMode:()=>Zy,__unstableSetTemporarilyEditingAsBlocks:()=>av,__unstableSplitSelection:()=>Ty,clearSelectedBlock:()=>fy,duplicateBlocks:()=>ev,enterFormattedText:()=>Uy,exitFormattedText:()=>Vy,flashBlock:()=>ov,hideInsertionPoint:()=>Ay,insertAfterBlock:()=>nv,insertBeforeBlock:()=>tv,insertBlock:()=>ky,insertBlocks:()=>Cy,insertDefaultBlock:()=>$y,mergeBlocks:()=>Ry,moveBlockToPosition:()=>wy,moveBlocksDown:()=>vy,moveBlocksToPosition:()=>xy,moveBlocksUp:()=>_y,multiSelect:()=>py,receiveBlocks:()=>iy,registerInserterMediaCategory:()=>lv,removeBlock:()=>Dy,removeBlocks:()=>Ny,replaceBlock:()=>by,replaceBlocks:()=>gy,replaceInnerBlocks:()=>My,resetBlocks:()=>ny,resetSelection:()=>oy,selectBlock:()=>ly,selectNextBlock:()=>uy,selectPreviousBlock:()=>cy,selectionChange:()=>Hy,setBlockEditingMode:()=>cv,setBlockMovingClientId:()=>Qy,setBlockVisibility:()=>sv,setHasControlledInnerBlocks:()=>iv,setNavigationMode:()=>Xy,setTemplateValidity:()=>Ey,showInsertionPoint:()=>Sy,startDraggingBlocks:()=>Fy,startMultiSelect:()=>dy,startTyping:()=>Oy,stopDraggingBlocks:()=>zy,stopMultiSelect:()=>hy,stopTyping:()=>Ly,synchronizeTemplate:()=>Iy,toggleBlockHighlight:()=>rv,toggleBlockMode:()=>Py,toggleSelection:()=>my,unsetBlockEditingMode:()=>uv,updateBlock:()=>ay,updateBlockAttributes:()=>sy,updateBlockListSettings:()=>Wy,updateSettings:()=>Gy,validateBlocksToTemplate:()=>ry});var m={};n.r(m),n.d(m,{Rp:()=>Bx,y0:()=>Ax,ou:()=>Nx,uG:()=>Ix,eh:()=>Ex});var g={};n.r(g),n.d(g,{AdvancedPanel:()=>E1,BackgroundPanel:()=>jj,BorderPanel:()=>GR,ColorPanel:()=>_D,DimensionsPanel:()=>MO,FiltersPanel:()=>SL,GlobalStylesContext:()=>Dv,ImageSettingsPanel:()=>S1,TypographyPanel:()=>$M,areGlobalStyleConfigsEqual:()=>Nv,getBlockCSSSelector:()=>gL,getBlockSelectors:()=>nF,getGlobalStylesChanges:()=>M1,getLayoutStyles:()=>JL,toStyles:()=>tF,useGlobalSetting:()=>Lv,useGlobalStyle:()=>Fv,useGlobalStyleLinks:()=>zv,useGlobalStylesOutput:()=>iF,useGlobalStylesOutputWithConfig:()=>oF,useGlobalStylesReset:()=>Ov,useHasBackgroundPanel:()=>xj,useHasBorderPanel:()=>OR,useHasBorderPanelControls:()=>LR,useHasColorPanel:()=>sD,useHasDimensionsPanel:()=>wO,useHasFiltersPanel:()=>vL,useHasImageSettingsPanel:()=>C1,useHasTypographyPanel:()=>BM,useSettingsForBlockElement:()=>Uv});var b={};n.r(b),n.d(b,{close:()=>X1,open:()=>J1,registerCommand:()=>G1,registerCommandLoader:()=>K1,unregisterCommand:()=>q1,unregisterCommandLoader:()=>Y1});var y={};n.r(y),n.d(y,{getCommandLoaders:()=>Q1,getCommands:()=>Z1,getContext:()=>t2,isOpen:()=>e2});var v={};n.r(v),n.d(v,{setContext:()=>n2});var _={};n.r(_),n.d(_,{applyStylesToAllTextInputs:()=>g5,blocksChangedInBlockEditor:()=>m5,changeActiveSidebar:()=>r5,changeFormBlocks:()=>z2,changeFormName:()=>U2,changeFormSettings:()=>Q2,changeFormStyles:()=>W2,changePreviewSettings:()=>o5,createCustomField:()=>p5,createCustomFieldDone:()=>J2,createCustomFieldFailed:()=>Z2,createCustomFieldStarted:()=>X2,customFieldEdited:()=>G2,deleteCustomField:()=>f5,deleteCustomFieldDone:()=>H2,deleteCustomFieldFailed:()=>$2,deleteCustomFieldStarted:()=>V2,hidePreview:()=>a5,historyRedo:()=>y5,historyUndo:()=>b5,removeNotice:()=>l5,saveCustomField:()=>h5,saveCustomFieldDone:()=>q2,saveCustomFieldFailed:()=>Y2,saveCustomFieldStarted:()=>K2,saveForm:()=>d5,saveFormDone:()=>e5,saveFormFailed:()=>n5,saveFormStarted:()=>t5,showPlacementSettings:()=>i5,showPreview:()=>s5,switchDefaultSidebarTab:()=>c5,toggleForm:()=>L2,toggleFullscreen:()=>F2,toggleInserter:()=>P2,toggleListView:()=>O2,toggleSidebar:()=>M2,toggleSidebarPanel:()=>u5,tutorialDismissed:()=>v5});var x={};n.r(x),n.d(x,{getFormatType:()=>O_e,getFormatTypeForBareElement:()=>L_e,getFormatTypeForClassName:()=>F_e,getFormatTypes:()=>P_e});var w={};n.r(w),n.d(w,{addFormatTypes:()=>z_e,removeFormatTypes:()=>U_e});var k={};n.r(k),n.d(k,{selectCategory:()=>ixe,selectTemplate:()=>oxe});var C={};n.r(C),n.d(C,{CALL_API:()=>R5.p,TRACK_EVENT:()=>sxe.s});var S=n(7378),A=n(79124),E=n(6997),I=n(50661),j=n(71328),T=n(3698),B=n.n(T),R=n(58013),N=n(31528),D=n(91221),M=n.n(D),P=n(69186),O=n(91646);const L=e=>t=>(n,r)=>void 0===n||e(r)?t(n,r):n,F=e=>t=>(n,r)=>t(n,e(r)),z=e=>t=>(n={},r)=>{const o=r[e];if(void 0===o)return n;const i=t(n[o],r);return i===n[o]?n:{...n,[o]:i}};var U=n(61203),V=n(85998),H=n(67268),$=n(17331),W=n(37844),G=n(82321),q=n(67195);function K(e,t,n){if(!e||"object"!=typeof e)return e;const r=Array.isArray(t)?t:t.split(".");return r.reduce(((e,t,o)=>(void 0===e[t]&&(Number.isInteger(r[o+1])?e[t]=[]:e[t]={}),o===r.length-1&&(e[t]=n),e[t])),e),e}function Y(e,t,n){if(!e||"object"!=typeof e||"string"!=typeof t&&!Array.isArray(t))return e;const r=Array.isArray(t)?t:t.split(".");let o=e;return r.forEach((e=>{o=o?.[e]})),void 0!==o?o:n}function J(e,t,n){return{type:"RECEIVE_ITEMS",items:Array.isArray(e)?e:[e],persistedEdits:t,meta:n}}let X=null;async function Z(e){if(null===X){const e=await(0,E.default)({path:"/batch/v1",method:"OPTIONS"});X=e.endpoints[0].args.requests.maxItems}const t=[];for(const n of function(e,t){const n=[...e],r=[];for(;n.length;)r.push(n.splice(0,t));return r}(e,X)){const e=await(0,E.default)({path:"/batch/v1",method:"POST",data:{validation:"require-all-validate",requests:n.map((e=>({path:e.path,body:e.data,method:e.method,headers:e.headers})))}});let r;r=e.failed?e.responses.map((e=>({error:e?.body}))):e.responses.map((e=>{const t={};return e.status>=200&&e.status<300?t.output=e.body:t.error=e.body,t})),t.push(...r)}return t}function Q(e=Z){let t=0,n=[];const r=new ee;return{add(e){const o=++t;r.add(o);const i=e=>new Promise(((t,i)=>{n.push({input:e,resolve:t,reject:i}),r.delete(o)}));return"function"==typeof e?Promise.resolve(e(i)).finally((()=>{r.delete(o)})):i(e)},async run(){let t;r.size&&await new Promise((e=>{const t=r.subscribe((()=>{r.size||(t(),e(void 0))}))}));try{if(t=await e(n.map((({input:e})=>e))),t.length!==n.length)throw new Error("run: Array returned by processor must be same size as input array.")}catch(e){for(const{reject:t}of n)t(e);throw e}let o=!0;return t.forEach(((e,t)=>{const r=n[t];var i;e?.error?(r?.reject(e.error),o=!1):r?.resolve(null!==(i=e?.output)&&void 0!==i?i:e)})),n=[],o}}}class ee{constructor(...e){this.set=new Set(...e),this.subscribers=new Set}get size(){return this.set.size}add(e){return this.set.add(e),this.subscribers.forEach((e=>e())),this}delete(e){const t=this.set.delete(e);return this.subscribers.forEach((e=>e())),t}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}}const te="core",ne=()=>new Map,re=e=>{const t=ne();return e.forEach(((e,n)=>{t.set(n,e)})),t},oe=(e,t,n)=>{let r=e.get(t);return void 0===r&&e.set(t,r=n()),r},ie=()=>new Set,se=e=>e[e.length-1],ae=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},le=Array.from,ce=Array.isArray;class ue{constructor(){this._observers=ne()}on(e,t){oe(this._observers,e,ie).add(t)}once(e,t){const n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){const n=this._observers.get(e);void 0!==n&&(n.delete(t),0===n.size&&this._observers.delete(e))}emit(e,t){return le((this._observers.get(e)||ne()).values()).forEach((e=>e(...t)))}destroy(){this._observers=ne()}}const de=Math.floor,he=(Math.ceil,Math.abs),pe=(Math.imul,Math.round,Math.log10),fe=(Math.log2,Math.log,Math.sqrt,(e,t)=>e<t?e:t),me=(e,t)=>e>t?e:t,ge=(Number.isNaN,Math.pow,Math.sign,e=>0!==e?e<0:1/e<0),be=64,ye=128,ve=127,_e=Number.MAX_SAFE_INTEGER,xe=(Number.MIN_SAFE_INTEGER,Number.isInteger||(e=>"number"==typeof e&&isFinite(e)&&de(e)===e)),we=(Number.isNaN,Number.parseInt,String.fromCharCode),ke=(String.fromCodePoint,we(65535),/^\s*/g),Ce=/([A-Z])/g,Se=(e,t)=>(e=>e.replace(ke,""))(e.replace(Ce,(e=>`${t}${(e=>e.toLowerCase())(e)}`))),Ae="undefined"!=typeof TextEncoder?new TextEncoder:null,Ee=Ae?e=>Ae.encode(e):e=>{const t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r};let Ie="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Ie&&1===Ie.decode(new Uint8Array).length&&(Ie=null);class je{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const Te=()=>new je,Be=e=>{const t=new Uint8Array((e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t})(e));let n=0;for(let r=0;r<e.bufs.length;r++){const o=e.bufs[r];t.set(o,n),n+=o.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},Re=(e,t)=>{const n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(2*n),e.cpos=0),e.cbuf[e.cpos++]=t},Ne=Re,De=(e,t)=>{for(;t>ve;)Re(e,ye|ve&t),t=de(t/128);Re(e,ve&t)},Me=(e,t)=>{const n=ge(t);for(n&&(t=-t),Re(e,(t>63?ye:0)|(n?be:0)|63&t),t=de(t/64);t>0;)Re(e,(t>ve?ye:0)|ve&t),t=de(t/128)},Pe=new Uint8Array(3e4),Oe=Pe.length/3,Le=Ae&&Ae.encodeInto?(e,t)=>{if(t.length<Oe){const n=Ae.encodeInto(t,Pe).written||0;De(e,n);for(let t=0;t<n;t++)Re(e,Pe[t])}else ze(e,Ee(t))}:(e,t)=>{const n=unescape(encodeURIComponent(t)),r=n.length;De(e,r);for(let t=0;t<r;t++)Re(e,n.codePointAt(t))},Fe=(e,t)=>{const n=e.cbuf.length,r=e.cpos,o=fe(n-r,t.length),i=t.length-o;e.cbuf.set(t.subarray(0,o),r),e.cpos+=o,i>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(me(2*n,i)),e.cbuf.set(t.subarray(o)),e.cpos=i)},ze=(e,t)=>{De(e,t.byteLength),Fe(e,t)},Ue=(e,t)=>{((e,t)=>{const n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(2*me(n,t)),e.cpos=0)})(e,t);const n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},Ve=new DataView(new ArrayBuffer(4)),He=(e,t)=>{switch(typeof t){case"string":Re(e,119),Le(e,t);break;case"number":xe(t)&&he(t)<=2147483647?(Re(e,125),Me(e,t)):(n=t,Ve.setFloat32(0,n),Ve.getFloat32(0)===n?(Re(e,124),((e,t)=>{Ue(e,4).setFloat32(0,t,!1)})(e,t)):(Re(e,123),((e,t)=>{Ue(e,8).setFloat64(0,t,!1)})(e,t)));break;case"bigint":Re(e,122),((e,t)=>{Ue(e,8).setBigInt64(0,t,!1)})(e,t);break;case"object":if(null===t)Re(e,126);else if(ce(t)){Re(e,117),De(e,t.length);for(let n=0;n<t.length;n++)He(e,t[n])}else if(t instanceof Uint8Array)Re(e,116),ze(e,t);else{Re(e,118);const n=Object.keys(t);De(e,n.length);for(let r=0;r<n.length;r++){const o=n[r];Le(e,o),He(e,t[o])}}break;case"boolean":Re(e,t?120:121);break;default:Re(e,127)}var n};class $e extends je{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&De(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const We=e=>{e.count>0&&(Me(e.encoder,1===e.count?e.s:-e.s),e.count>1&&De(e.encoder,e.count-2))};class Ge{constructor(){this.encoder=new je,this.s=0,this.count=0}write(e){this.s===e?this.count++:(We(this),this.count=1,this.s=e)}toUint8Array(){return We(this),Be(this.encoder)}}const qe=e=>{if(e.count>0){const t=2*e.diff+(1===e.count?0:1);Me(e.encoder,t),e.count>1&&De(e.encoder,e.count-2)}};class Ke{constructor(){this.encoder=new je,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(qe(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return qe(this),Be(this.encoder)}}class Ye{constructor(){this.sarr=[],this.s="",this.lensE=new Ge}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new je;return this.sarr.push(this.s),this.s="",Le(e,this.sarr.join("")),Fe(e,this.lensE.toUint8Array()),Be(e)}}const Je=e=>new Error(e),Xe=()=>{throw Je("Method unimplemented")},Ze=()=>{throw Je("Unexpected case")},Qe=Je("Unexpected end of array"),et=Je("Integer out of Range");class tt{constructor(e){this.arr=e,this.pos=0}}const nt=e=>new tt(e),rt=e=>((e,t)=>{const n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n})(e,it(e)),ot=e=>e.arr[e.pos++],it=e=>{let t=0,n=1;const r=e.arr.length;for(;e.pos<r;){const r=e.arr[e.pos++];if(t+=(r&ve)*n,n*=128,r<ye)return t;if(t>_e)throw et}throw Qe},st=e=>{let t=e.arr[e.pos++],n=63&t,r=64;const o=(t&be)>0?-1:1;if(!(t&ye))return o*n;const i=e.arr.length;for(;e.pos<i;){if(t=e.arr[e.pos++],n+=(t&ve)*r,r*=128,t<ye)return o*n;if(n>_e)throw et}throw Qe},at=Ie?e=>Ie.decode(rt(e)):e=>{let t=it(e);if(0===t)return"";{let n=String.fromCodePoint(ot(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(ot(e));else for(;t>0;){const r=t<1e4?t:1e4,o=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,o),t-=r}return decodeURIComponent(escape(n))}},lt=(e,t)=>{const n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},ct=[e=>{},e=>null,st,e=>lt(e,4).getFloat32(0,!1),e=>lt(e,8).getFloat64(0,!1),e=>lt(e,8).getBigInt64(0,!1),e=>!1,e=>!0,at,e=>{const t=it(e),n={};for(let r=0;r<t;r++)n[at(e)]=ut(e);return n},e=>{const t=it(e),n=[];for(let r=0;r<t;r++)n.push(ut(e));return n},rt],ut=e=>ct[127-ot(e)](e);class dt extends tt{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){return 0===this.count&&(this.s=this.reader(this),(e=this).pos!==e.arr.length?this.count=it(this)+1:this.count=-1),this.count--,this.s;var e}}class ht extends tt{constructor(e){super(e),this.s=0,this.count=0}read(){if(0===this.count){this.s=st(this);const e=ge(this.s);this.count=1,e&&(this.s=-this.s,this.count=it(this)+2)}return this.count--,this.s}}class pt extends tt{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(0===this.count){const e=st(this),t=1&e;this.diff=de(e/2),this.count=1,t&&(this.count=it(this)+2)}return this.s+=this.diff,this.count--,this.s}}class ft{constructor(e){this.decoder=new ht(e),this.str=at(this.decoder),this.spos=0}read(){const e=this.spos+this.decoder.read(),t=this.str.slice(this.spos,e);return this.spos=e,t}}crypto.subtle;const mt=crypto.getRandomValues.bind(crypto),gt=Math.random,bt=()=>mt(new Uint32Array(1))[0],yt=[1e7]+-1e3+-4e3+-8e3+-1e11,vt=()=>yt.replace(/[018]/g,(e=>(e^bt()&15>>e/4).toString(16))),_t=e=>new Promise(e),xt=(Promise.all.bind(Promise),e=>Promise.resolve(e));let wt=new class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}},kt=!0;try{"undefined"!=typeof localStorage&&localStorage&&(wt=localStorage,kt=!1)}catch(e){}const Ct=wt,St=Object.assign,At=Object.keys,Et=e=>At(e).length,It=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),jt=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&jt(e,t,n+1)}},Tt=()=>{},Bt=e=>e,Rt=(e,t)=>{if(null==e||null==t)return((e,t)=>e===t)(e,t);if(e.constructor!==t.constructor)return!1;if(e===t)return!0;switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;break;case Set:if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;break;case Map:if(e.size!==t.size)return!1;for(const n of e.keys())if(!t.has(n)||!Rt(e.get(n),t.get(n)))return!1;break;case Object:if(Et(e)!==Et(t))return!1;for(const n in e)if(!It(e,n)||!Rt(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Rt(e[n],t[n]))return!1;break;default:return!1}return!0},Nt="undefined"!=typeof process&&process.release&&/node|io\.js/.test(process.release.name)&&"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),Dt="undefined"!=typeof window&&"undefined"!=typeof document&&!Nt;let Mt;"undefined"!=typeof navigator&&/Mac/.test(navigator.platform);const Pt=[],Ot=e=>(()=>{if(void 0===Mt)if(Nt){Mt=ne();const e=process.argv;let t=null;for(let n=0;n<e.length;n++){const r=e[n];"-"===r[0]?(null!==t&&Mt.set(t,""),t=r):null!==t?(Mt.set(t,r),t=null):Pt.push(r)}null!==t&&Mt.set(t,"")}else"object"==typeof location?(Mt=ne(),(location.search||"?").slice(1).split("&").forEach((e=>{if(0!==e.length){const[t,n]=e.split("=");Mt.set(`--${Se(t,"-")}`,n),Mt.set(`-${Se(t,"-")}`,n)}}))):Mt=ne();return Mt})().has(e),Lt=e=>(e=>void 0===e?null:e)(Nt?process.env[e.toUpperCase()]:Ct.getItem(e));Ot("--"+"production")||Lt("production");const Ft=Nt&&($t=process.env.FORCE_COLOR,["true","1","2"].includes($t)),zt=!Ot("no-colors")&&(!Nt||process.stdout.isTTY||Ft)&&(!Nt||Ot("color")||Ft||null!==Lt("COLORTERM")||(Lt("TERM")||"").includes("color")),Ut=e=>new Uint8Array(e),Vt=Dt?e=>{let t="";for(let n=0;n<e.byteLength;n++)t+=we(e[n]);return btoa(t)}:e=>Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("base64"),Ht=Dt?e=>{const t=atob(e),n=Ut(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}:e=>{const t=Buffer.from(e,"base64");return n=t.buffer,r=t.byteOffset,o=t.byteLength,new Uint8Array(n,r,o);var n,r,o};var $t;class Wt{constructor(e,t){this.left=e,this.right=t}}const Gt=(e,t)=>new Wt(e,t),qt="undefined"!=typeof document?document:{},Kt=("undefined"!=typeof DOMParser&&new DOMParser,e=>((e,t)=>{const n=[];for(const[r,o]of e)n.push(t(o,r));return n})(e,((e,t)=>`${t}:${e};`)).join("")),Yt=(qt.ELEMENT_NODE,qt.TEXT_NODE,qt.CDATA_SECTION_NODE,qt.COMMENT_NODE,qt.DOCUMENT_NODE,qt.DOCUMENT_TYPE_NODE,qt.DOCUMENT_FRAGMENT_NODE,Symbol),Jt=Date.now,Xt=Yt(),Zt=Yt(),Qt=Yt(),en=Yt(),tn=Yt(),nn=Yt(),rn=Yt(),on=Yt(),sn=Yt(),an=[tn,rn,on,Qt];let ln=0,cn=Jt();const un={[Xt]:Gt("font-weight","bold"),[Zt]:Gt("font-weight","normal"),[Qt]:Gt("color","blue"),[tn]:Gt("color","green"),[en]:Gt("color","grey"),[nn]:Gt("color","red"),[rn]:Gt("color","purple"),[on]:Gt("color","orange"),[sn]:Gt("color","black")},dn=zt?e=>{const t=[],n=[],r=ne();let o=[],i=0;for(;i<e.length;i++){const o=e[i],s=un[o];if(void 0!==s)r.set(s.left,s.right);else{if(o.constructor!==String&&o.constructor!==Number)break;{const e=Kt(r);i>0||e.length>0?(t.push("%c"+o),n.push(e)):t.push(o)}}}for(i>0&&(o=n,o.unshift(t.join("")));i<e.length;i++){const t=e[i];t instanceof Symbol||o.push(t)}return o}:e=>{const t=[],n=[];let r=0;for(;r<e.length;r++){const o=e[r];o.constructor===String||o.constructor===Number?t.push(o):o.constructor===Object&&n.push(JSON.stringify(o))}return n},hn=(...e)=>{console.log(...dn(e)),pn.forEach((t=>t.print(e)))},pn=ie(),fn=e=>({[Symbol.iterator](){return this},next:e}),mn=(e,t)=>fn((()=>{const{done:n,value:r}=e.next();return{done:n,value:n?void 0:t(r)}}));class gn{constructor(e,t){this.clock=e,this.len=t}}class bn{constructor(){this.clients=new Map}}const yn=(e,t,n)=>t.clients.forEach(((t,r)=>{const o=e.doc.store.clients.get(r);for(let r=0;r<t.length;r++){const i=t[r];dr(e,o,i.clock,i.len,n)}})),vn=(e,t)=>{const n=e.clients.get(t.client);return void 0!==n&&null!==((e,t)=>{let n=0,r=e.length-1;for(;n<=r;){const o=de((n+r)/2),i=e[o],s=i.clock;if(s<=t){if(t<s+i.len)return o;n=o+1}else r=o-1}return null})(n,t.clock)},_n=e=>{e.clients.forEach((e=>{let t,n;for(e.sort(((e,t)=>e.clock-t.clock)),t=1,n=1;t<e.length;t++){const r=e[n-1],o=e[t];r.clock+r.len>=o.clock?r.len=me(r.len,o.clock+o.len-r.clock):(n<t&&(e[n]=o),n++)}e.length=n}))},xn=(e,t,n,r)=>{oe(e.clients,t,(()=>[])).push(new gn(n,r))},wn=()=>new bn,kn=(e,t)=>{De(e.restEncoder,t.clients.size),le(t.clients.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([t,n])=>{e.resetDsCurVal(),De(e.restEncoder,t);const r=n.length;De(e.restEncoder,r);for(let t=0;t<r;t++){const r=n[t];e.writeDsClock(r.clock),e.writeDsLen(r.len)}}))},Cn=e=>{const t=new bn,n=it(e.restDecoder);for(let r=0;r<n;r++){e.resetDsCurVal();const n=it(e.restDecoder),r=it(e.restDecoder);if(r>0){const o=oe(t.clients,n,(()=>[]));for(let t=0;t<r;t++)o.push(new gn(e.readDsClock(),e.readDsLen()))}}return t},Sn=(e,t,n)=>{const r=new bn,o=it(e.restDecoder);for(let i=0;i<o;i++){e.resetDsCurVal();const o=it(e.restDecoder),i=it(e.restDecoder),s=n.clients.get(o)||[],a=or(n,o);for(let n=0;n<i;n++){const n=e.readDsClock(),i=n+e.readDsLen();if(n<a){a<i&&xn(r,o,a,i-a);let e=sr(s,n),l=s[e];for(!l.deleted&&l.id.clock<n&&(s.splice(e+1,0,qo(t,l,n-l.id.clock)),e++);e<s.length&&(l=s[e++],l.id.clock<i);)l.deleted||(i<l.id.clock+l.length&&s.splice(e,0,qo(t,l,i-l.id.clock)),l.delete(t))}else xn(r,o,n,i-n)}}if(r.clients.size>0){const e=new Mn;return De(e.restEncoder,0),kn(e,r),e.toUint8Array()}return null},An=bt;class En extends ue{constructor({guid:e=vt(),collectionid:t=null,gc:n=!0,gcFilter:r=(()=>!0),meta:o=null,autoLoad:i=!1,shouldLoad:s=!0}={}){super(),this.gc=n,this.gcFilter=r,this.clientID=An(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new nr,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=s,this.autoLoad=i,this.meta=o,this.isLoaded=!1,this.isSynced=!1,this.whenLoaded=_t((e=>{this.on("load",(()=>{this.isLoaded=!0,e(this)}))}));const a=()=>_t((e=>{const t=n=>{void 0!==n&&!0!==n||(this.off("sync",t),e())};this.on("sync",t)}));this.on("sync",(e=>{!1===e&&this.isSynced&&(this.whenSynced=a()),this.isSynced=void 0===e||!0===e,this.isSynced&&!this.isLoaded&&this.emit("load",[])})),this.whenSynced=a()}load(){const e=this._item;null===e||this.shouldLoad||br(e.parent.doc,(e=>{e.subdocsLoaded.add(this)}),null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(le(this.subdocs).map((e=>e.guid)))}transact(e,t=null){return br(this,e,t)}get(e,t=Or){const n=oe(this.share,e,(()=>{const e=new t;return e._integrate(this,null),e})),r=n.constructor;if(t!==Or&&r!==t){if(r===Or){const r=new t;r._map=n._map,n._map.forEach((e=>{for(;null!==e;e=e.left)e.parent=r})),r._start=n._start;for(let e=r._start;null!==e;e=e.right)e.parent=r;return r._length=n._length,this.share.set(e,r),r._integrate(this,null),r}throw new Error(`Type with the name ${e} has already been defined with a different constructor`)}return n}getArray(e=""){return this.get(e,to)}getText(e=""){return this.get(e,_o)}getMap(e=""){return this.get(e,ro)}getXmlElement(e=""){return this.get(e,ko)}getXmlFragment(e=""){return this.get(e,wo)}toJSON(){const e={};return this.share.forEach(((t,n)=>{e[n]=t.toJSON()})),e}destroy(){le(this.subdocs).forEach((e=>e.destroy()));const e=this._item;if(null!==e){this._item=null;const t=e.content;t.doc=new En({guid:this.guid,...t.opts,shouldLoad:!1}),t.doc._item=e,br(e.parent.doc,(n=>{const r=t.doc;e.deleted||n.subdocsAdded.add(r),n.subdocsRemoved.add(this)}),null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}on(e,t){super.on(e,t)}off(e,t){super.off(e,t)}}class In{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return it(this.restDecoder)}readDsLen(){return it(this.restDecoder)}}class jn extends In{readLeftID(){return Jn(it(this.restDecoder),it(this.restDecoder))}readRightID(){return Jn(it(this.restDecoder),it(this.restDecoder))}readClient(){return it(this.restDecoder)}readInfo(){return ot(this.restDecoder)}readString(){return at(this.restDecoder)}readParentInfo(){return 1===it(this.restDecoder)}readTypeRef(){return it(this.restDecoder)}readLen(){return it(this.restDecoder)}readAny(){return ut(this.restDecoder)}readBuf(){return(e=>{const t=Ut(e.byteLength);return t.set(e),t})(rt(this.restDecoder))}readJSON(){return JSON.parse(at(this.restDecoder))}readKey(){return at(this.restDecoder)}}class Tn{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=it(this.restDecoder),this.dsCurrVal}readDsLen(){const e=it(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class Bn extends Tn{constructor(e){super(e),this.keys=[],it(e),this.keyClockDecoder=new pt(rt(e)),this.clientDecoder=new ht(rt(e)),this.leftClockDecoder=new pt(rt(e)),this.rightClockDecoder=new pt(rt(e)),this.infoDecoder=new dt(rt(e),ot),this.stringDecoder=new ft(rt(e)),this.parentInfoDecoder=new dt(rt(e),ot),this.typeRefDecoder=new ht(rt(e)),this.lenDecoder=new ht(rt(e))}readLeftID(){return new Kn(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new Kn(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return 1===this.parentInfoDecoder.read()}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return ut(this.restDecoder)}readBuf(){return rt(this.restDecoder)}readJSON(){return ut(this.restDecoder)}readKey(){const e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{const e=this.stringDecoder.read();return this.keys.push(e),e}}}class Rn{constructor(){this.restEncoder=Te()}toUint8Array(){return Be(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){De(this.restEncoder,e)}writeDsLen(e){De(this.restEncoder,e)}}class Nn extends Rn{writeLeftID(e){De(this.restEncoder,e.client),De(this.restEncoder,e.clock)}writeRightID(e){De(this.restEncoder,e.client),De(this.restEncoder,e.clock)}writeClient(e){De(this.restEncoder,e)}writeInfo(e){Ne(this.restEncoder,e)}writeString(e){Le(this.restEncoder,e)}writeParentInfo(e){De(this.restEncoder,e?1:0)}writeTypeRef(e){De(this.restEncoder,e)}writeLen(e){De(this.restEncoder,e)}writeAny(e){He(this.restEncoder,e)}writeBuf(e){ze(this.restEncoder,e)}writeJSON(e){Le(this.restEncoder,JSON.stringify(e))}writeKey(e){Le(this.restEncoder,e)}}class Dn{constructor(){this.restEncoder=Te(),this.dsCurrVal=0}toUint8Array(){return Be(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const t=e-this.dsCurrVal;this.dsCurrVal=e,De(this.restEncoder,t)}writeDsLen(e){0===e&&Ze(),De(this.restEncoder,e-1),this.dsCurrVal+=e}}class Mn extends Dn{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Ke,this.clientEncoder=new Ge,this.leftClockEncoder=new Ke,this.rightClockEncoder=new Ke,this.infoEncoder=new $e(Ne),this.stringEncoder=new Ye,this.parentInfoEncoder=new $e(Ne),this.typeRefEncoder=new Ge,this.lenEncoder=new Ge}toUint8Array(){const e=Te();return De(e,0),ze(e,this.keyClockEncoder.toUint8Array()),ze(e,this.clientEncoder.toUint8Array()),ze(e,this.leftClockEncoder.toUint8Array()),ze(e,this.rightClockEncoder.toUint8Array()),ze(e,Be(this.infoEncoder)),ze(e,this.stringEncoder.toUint8Array()),ze(e,Be(this.parentInfoEncoder)),ze(e,this.typeRefEncoder.toUint8Array()),ze(e,this.lenEncoder.toUint8Array()),Fe(e,Be(this.restEncoder)),Be(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){He(this.restEncoder,e)}writeBuf(e){ze(this.restEncoder,e)}writeJSON(e){He(this.restEncoder,e)}writeKey(e){const t=this.keyMap.get(e);void 0===t?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(t)}}const Pn=(e,t,n)=>{const r=new Map;n.forEach(((e,n)=>{or(t,n)>e&&r.set(n,e)})),rr(t).forEach(((e,t)=>{n.has(t)||r.set(t,0)})),De(e.restEncoder,r.size),le(r.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([n,r])=>{((e,t,n,r)=>{r=me(r,t[0].id.clock);const o=sr(t,r);De(e.restEncoder,t.length-o),e.writeClient(n),De(e.restEncoder,r);const i=t[o];i.write(e,r-i.id.clock);for(let n=o+1;n<t.length;n++)t[n].write(e,0)})(e,t.clients.get(n),n,r)}))},On=(e,t,n,r=Bn)=>{const o=nt(t);((e,t,n,r=new Bn(e))=>{br(t,(e=>{e.local=!1;let t=!1;const n=e.doc,o=n.store,i=((e,t)=>{const n=ne(),r=it(e.restDecoder);for(let o=0;o<r;o++){const r=it(e.restDecoder),o=new Array(r),i=e.readClient();let s=it(e.restDecoder);n.set(i,{i:0,refs:o});for(let n=0;n<r;n++){const r=e.readInfo();switch(31&r){case 0:{const t=e.readLen();o[n]=new Io(Jn(i,s),t),s+=t;break}case 10:{const t=it(e.restDecoder);o[n]=new Xo(Jn(i,s),t),s+=t;break}default:{const a=!(192&r),l=new Ko(Jn(i,s),null,(r&ye)===ye?e.readLeftID():null,null,(r&be)===be?e.readRightID():null,a?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,!a||32&~r?null:e.readString(),Yo(e,r));o[n]=l,s+=l.length}}}}return n})(r,n),s=((e,t,n)=>{const r=[];let o=le(n.keys()).sort(((e,t)=>e-t));if(0===o.length)return null;const i=()=>{if(0===o.length)return null;let e=n.get(o[o.length-1]);for(;e.refs.length===e.i;){if(o.pop(),!(o.length>0))return null;e=n.get(o[o.length-1])}return e};let s=i();if(null===s)return null;const a=new nr,l=new Map,c=(e,t)=>{const n=l.get(e);(null==n||n>t)&&l.set(e,t)};let u=s.refs[s.i++];const d=new Map,h=()=>{for(const e of r){const t=e.id.client,r=n.get(t);r?(r.i--,a.clients.set(t,r.refs.slice(r.i)),n.delete(t),r.i=0,r.refs=[]):a.clients.set(t,[e]),o=o.filter((e=>e!==t))}r.length=0};for(;;){if(u.constructor!==Xo){const o=oe(d,u.id.client,(()=>or(t,u.id.client)))-u.id.clock;if(o<0)r.push(u),c(u.id.client,u.id.clock-1),h();else{const i=u.getMissing(e,t);if(null!==i){r.push(u);const e=n.get(i)||{refs:[],i:0};if(e.refs.length!==e.i){u=e.refs[e.i++];continue}c(i,or(t,i)),h()}else(0===o||o<u.length)&&(u.integrate(e,o),d.set(u.id.client,u.id.clock+u.length))}}if(r.length>0)u=r.pop();else if(null!==s&&s.i<s.refs.length)u=s.refs[s.i++];else{if(s=i(),null===s)break;u=s.refs[s.i++]}}if(a.clients.size>0){const e=new Mn;return Pn(e,a,new Map),De(e.restEncoder,0),{missing:l,update:e.toUint8Array()}}return null})(e,o,i),a=o.pendingStructs;if(a){for(const[e,n]of a.missing)if(n<or(o,e)){t=!0;break}if(s){for(const[e,t]of s.missing){const n=a.missing.get(e);(null==n||n>t)&&a.missing.set(e,t)}a.update=wr([a.update,s.update])}}else o.pendingStructs=s;const l=Sn(r,e,o);if(o.pendingDs){const t=new Bn(nt(o.pendingDs));it(t.restDecoder);const n=Sn(t,e,o);o.pendingDs=l&&n?wr([l,n]):l||n}else o.pendingDs=l;if(t){const t=o.pendingStructs.update;o.pendingStructs=null,On(e.doc,t)}}),n,!1)})(o,e,n,new r(o))},Ln=(e,t,n)=>On(e,t,n,jn),Fn=(e,t=new Uint8Array([0]),n=new Mn)=>{((e,t,n=new Map)=>{Pn(e,t.store,n),kn(e,(e=>{const t=wn();return e.clients.forEach(((e,n)=>{const r=[];for(let t=0;t<e.length;t++){const n=e[t];if(n.deleted){const o=n.id.clock;let i=n.length;if(t+1<e.length)for(let n=e[t+1];t+1<e.length&&n.deleted;n=e[1+ ++t])i+=n.length;r.push(new gn(o,i))}}r.length>0&&t.clients.set(n,r)})),t})(t.store))})(n,e,Un(t));const r=[n.toUint8Array()];if(e.store.pendingDs&&r.push(e.store.pendingDs),e.store.pendingStructs&&r.push(kr(e.store.pendingStructs.update,t)),r.length>1){if(n.constructor===Nn)return _r(r.map(((e,t)=>0===t?e:Er(e))));if(n.constructor===Mn)return wr(r)}return r[0]},zn=(e,t)=>Fn(e,t,new Nn),Un=e=>(e=>{const t=new Map,n=it(e.restDecoder);for(let r=0;r<n;r++){const n=it(e.restDecoder),r=it(e.restDecoder);t.set(n,r)}return t})(new In(nt(e))),Vn=(e,t)=>(De(e.restEncoder,t.size),le(t.entries()).sort(((e,t)=>t[0]-e[0])).forEach((([t,n])=>{De(e.restEncoder,t),De(e.restEncoder,n)})),e);class Hn{constructor(){this.l=[]}}const $n=()=>new Hn,Wn=(e,t)=>e.l.push(t),Gn=(e,t)=>{const n=e.l,r=n.length;e.l=n.filter((e=>t!==e)),r===e.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},qn=(e,t,n)=>jt(e.l,[t,n]);class Kn{constructor(e,t){this.client=e,this.clock=t}}const Yn=(e,t)=>e===t||null!==e&&null!==t&&e.client===t.client&&e.clock===t.clock,Jn=(e,t)=>new Kn(e,t);class Xn{constructor(e,t){this.ds=e,this.sv=t}}const Zn=(er=wn(),tr=new Map,new Xn(er,tr),(e,t)=>void 0===t?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!vn(t.ds,e.id)),Qn=(e,t)=>{const n=oe(e.meta,Qn,ie),r=e.doc.store;n.has(t)||(t.sv.forEach(((t,n)=>{t<or(r,n)&&cr(e,Jn(n,t))})),yn(e,t.ds,(e=>{})),n.add(t))};var er,tr;class nr{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const rr=e=>{const t=new Map;return e.clients.forEach(((e,n)=>{const r=e[e.length-1];t.set(n,r.id.clock+r.length)})),t},or=(e,t)=>{const n=e.clients.get(t);if(void 0===n)return 0;const r=n[n.length-1];return r.id.clock+r.length},ir=(e,t)=>{let n=e.clients.get(t.id.client);if(void 0===n)n=[],e.clients.set(t.id.client,n);else{const e=n[n.length-1];if(e.id.clock+e.length!==t.id.clock)throw Ze()}n.push(t)},sr=(e,t)=>{let n=0,r=e.length-1,o=e[r],i=o.id.clock;if(i===t)return r;let s=de(t/(i+o.length-1)*r);for(;n<=r;){if(o=e[s],i=o.id.clock,i<=t){if(t<i+o.length)return s;n=s+1}else r=s-1;s=de((n+r)/2)}throw Ze()},ar=(e,t)=>{const n=e.clients.get(t.client);return n[sr(n,t.clock)]},lr=(e,t,n)=>{const r=sr(t,n),o=t[r];return o.id.clock<n&&o instanceof Ko?(t.splice(r+1,0,qo(e,o,n-o.id.clock)),r+1):r},cr=(e,t)=>{const n=e.doc.store.clients.get(t.client);return n[lr(e,n,t.clock)]},ur=(e,t,n)=>{const r=t.clients.get(n.client),o=sr(r,n.clock),i=r[o];return n.clock!==i.id.clock+i.length-1&&i.constructor!==Io&&r.splice(o+1,0,qo(e,i,n.clock-i.id.clock+1)),i},dr=(e,t,n,r,o)=>{if(0===r)return;const i=n+r;let s,a=lr(e,t,n);do{s=t[a++],i<s.id.clock+s.length&&lr(e,t,i),o(s)}while(a<t.length&&t[a].id.clock<i)};class hr{constructor(e,t,n){this.doc=e,this.deleteSet=new bn,this.beforeState=rr(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=t,this.meta=new Map,this.local=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const pr=(e,t)=>!(0===t.deleteSet.clients.size&&!((e,t)=>{for(const[n,r]of e)if(t(r,n))return!0;return!1})(t.afterState,((e,n)=>t.beforeState.get(n)!==e))||(_n(t.deleteSet),((e,t)=>{Pn(e,t.doc.store,t.beforeState)})(e,t),kn(e,t.deleteSet),0)),fr=(e,t,n)=>{const r=t._item;(null===r||r.id.clock<(e.beforeState.get(r.id.client)||0)&&!r.deleted)&&oe(e.changed,t,ie).add(n)},mr=(e,t)=>{let n=e[t],r=e[t-1],o=t;for(;o>0&&r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n);n=r,r=e[--o-1])n instanceof Ko&&null!==n.parentSub&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);const i=t-o;return i&&e.splice(t+1-i,i),i},gr=(e,t)=>{if(t<e.length){const n=e[t],r=n.doc,o=r.store,i=n.deleteSet,s=n._mergeStructs;try{_n(i),n.afterState=rr(n.doc.store),r.emit("beforeObserverCalls",[n,r]);const e=[];n.changed.forEach(((t,r)=>e.push((()=>{null!==r._item&&r._item.deleted||r._callObserver(n,t)})))),e.push((()=>{n.changedParentTypes.forEach(((e,t)=>{t._dEH.l.length>0&&(null===t._item||!t._item.deleted)&&((e=e.filter((e=>null===e.target._item||!e.target._item.deleted))).forEach((e=>{e.currentTarget=t,e._path=null})),e.sort(((e,t)=>e.path.length-t.path.length)),qn(t._dEH,e,n))}))})),e.push((()=>r.emit("afterTransaction",[n,r]))),jt(e,[]),n._needFormattingCleanup&&bo(n)}finally{r.gc&&((e,t,n)=>{for(const[r,o]of e.clients.entries()){const e=t.clients.get(r);for(let r=o.length-1;r>=0;r--){const i=o[r],s=i.clock+i.len;for(let r=sr(e,i.clock),o=e[r];r<e.length&&o.id.clock<s;o=e[++r]){const o=e[r];if(i.clock+i.len<=o.id.clock)break;o instanceof Ko&&o.deleted&&!o.keep&&n(o)&&o.gc(t,!1)}}}})(i,o,r.gcFilter),((e,t)=>{e.clients.forEach(((e,n)=>{const r=t.clients.get(n);for(let t=e.length-1;t>=0;t--){const n=e[t];for(let e=fe(r.length-1,1+sr(r,n.clock+n.len-1)),t=r[e];e>0&&t.id.clock>=n.clock;t=r[e])e-=1+mr(r,e)}}))})(i,o),n.afterState.forEach(((e,t)=>{const r=n.beforeState.get(t)||0;if(r!==e){const e=o.clients.get(t),n=me(sr(e,r),1);for(let t=e.length-1;t>=n;)t-=1+mr(e,t)}}));for(let e=s.length-1;e>=0;e--){const{client:t,clock:n}=s[e].id,r=o.clients.get(t),i=sr(r,n);i+1<r.length&&mr(r,i+1)>1||i>0&&mr(r,i)}if(n.local||n.afterState.get(r.clientID)===n.beforeState.get(r.clientID)||(hn(on,Xt,"[yjs] ",Zt,nn,"Changed the client-id because another client seems to be using it."),r.clientID=An()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){const e=new Nn;pr(e,n)&&r.emit("update",[e.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){const e=new Mn;pr(e,n)&&r.emit("updateV2",[e.toUint8Array(),n.origin,r,n])}const{subdocsAdded:a,subdocsLoaded:l,subdocsRemoved:c}=n;(a.size>0||c.size>0||l.size>0)&&(a.forEach((e=>{e.clientID=r.clientID,null==e.collectionid&&(e.collectionid=r.collectionid),r.subdocs.add(e)})),c.forEach((e=>r.subdocs.delete(e))),r.emit("subdocs",[{loaded:l,added:a,removed:c},r,n]),c.forEach((e=>e.destroy()))),e.length<=t+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,e])):gr(e,t+1)}}},br=(e,t,n=null,r=!0)=>{const o=e._transactionCleanups;let i=!1,s=null;null===e._transaction&&(i=!0,e._transaction=new hr(e,n,r),o.push(e._transaction),1===o.length&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{s=t(e._transaction)}finally{if(i){const t=e._transaction===o[0];e._transaction=null,t&&gr(o,0)}}return s};class yr{constructor(e,t){this.gen=function*(e){const t=it(e.restDecoder);for(let n=0;n<t;n++){const t=it(e.restDecoder),n=e.readClient();let r=it(e.restDecoder);for(let o=0;o<t;o++){const t=e.readInfo();if(10===t){const t=it(e.restDecoder);yield new Xo(Jn(n,r),t),r+=t}else if(31&t){const o=!(192&t),i=new Ko(Jn(n,r),null,(t&ye)===ye?e.readLeftID():null,null,(t&be)===be?e.readRightID():null,o?e.readParentInfo()?e.readString():e.readLeftID():null,!o||32&~t?null:e.readString(),Yo(e,t));yield i,r+=i.length}else{const t=e.readLen();yield new Io(Jn(n,r),t),r+=t}}}}(e),this.curr=null,this.done=!1,this.filterSkips=t,this.next()}next(){do{this.curr=this.gen.next().value||null}while(this.filterSkips&&null!==this.curr&&this.curr.constructor===Xo);return this.curr}}class vr{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}}const _r=e=>wr(e,jn,Nn),xr=(e,t)=>{if(e.constructor===Io){const{client:n,clock:r}=e.id;return new Io(Jn(n,r+t),e.length-t)}if(e.constructor===Xo){const{client:n,clock:r}=e.id;return new Xo(Jn(n,r+t),e.length-t)}{const n=e,{client:r,clock:o}=n.id;return new Ko(Jn(r,o+t),null,Jn(r,o+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},wr=(e,t=Bn,n=Mn)=>{if(1===e.length)return e[0];const r=e.map((e=>new t(nt(e))));let o=r.map((e=>new yr(e,!0))),i=null;const s=new n,a=new vr(s);for(;o=o.filter((e=>null!==e.curr)),o.sort(((e,t)=>{if(e.curr.id.client===t.curr.id.client){const n=e.curr.id.clock-t.curr.id.clock;return 0===n?e.curr.constructor===t.curr.constructor?0:e.curr.constructor===Xo?1:-1:n}return t.curr.id.client-e.curr.id.client})),0!==o.length;){const e=o[0],t=e.curr.id.client;if(null!==i){let n=e.curr,r=!1;for(;null!==n&&n.id.clock+n.length<=i.struct.id.clock+i.struct.length&&n.id.client>=i.struct.id.client;)n=e.next(),r=!0;if(null===n||n.id.client!==t||r&&n.id.clock>i.struct.id.clock+i.struct.length)continue;if(t!==i.struct.id.client)Sr(a,i.struct,i.offset),i={struct:n,offset:0},e.next();else if(i.struct.id.clock+i.struct.length<n.id.clock)if(i.struct.constructor===Xo)i.struct.length=n.id.clock+n.length-i.struct.id.clock;else{Sr(a,i.struct,i.offset);const e=n.id.clock-i.struct.id.clock-i.struct.length;i={struct:new Xo(Jn(t,i.struct.id.clock+i.struct.length),e),offset:0}}else{const t=i.struct.id.clock+i.struct.length-n.id.clock;t>0&&(i.struct.constructor===Xo?i.struct.length-=t:n=xr(n,t)),i.struct.mergeWith(n)||(Sr(a,i.struct,i.offset),i={struct:n,offset:0},e.next())}}else i={struct:e.curr,offset:0},e.next();for(let n=e.curr;null!==n&&n.id.client===t&&n.id.clock===i.struct.id.clock+i.struct.length&&n.constructor!==Xo;n=e.next())Sr(a,i.struct,i.offset),i={struct:n,offset:0}}null!==i&&(Sr(a,i.struct,i.offset),i=null),Ar(a);const l=(e=>{const t=new bn;for(let n=0;n<e.length;n++)e[n].clients.forEach(((r,o)=>{if(!t.clients.has(o)){const i=r.slice();for(let t=n+1;t<e.length;t++)ae(i,e[t].clients.get(o)||[]);t.clients.set(o,i)}}));return _n(t),t})(r.map((e=>Cn(e))));return kn(s,l),s.toUint8Array()},kr=(e,t,n=Bn,r=Mn)=>{const o=Un(t),i=new r,s=new vr(i),a=new n(nt(e)),l=new yr(a,!1);for(;l.curr;){const e=l.curr,t=e.id.client,n=o.get(t)||0;if(l.curr.constructor!==Xo)if(e.id.clock+e.length>n)for(Sr(s,e,me(n-e.id.clock,0)),l.next();l.curr&&l.curr.id.client===t;)Sr(s,l.curr,0),l.next();else for(;l.curr&&l.curr.id.client===t&&l.curr.id.clock+l.curr.length<=n;)l.next();else l.next()}Ar(s);const c=Cn(a);return kn(i,c),i.toUint8Array()},Cr=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:Be(e.encoder.restEncoder)}),e.encoder.restEncoder=Te(),e.written=0)},Sr=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&Cr(e),0===e.written&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),De(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},Ar=e=>{Cr(e);const t=e.encoder.restEncoder;De(t,e.clientStructs.length);for(let n=0;n<e.clientStructs.length;n++){const r=e.clientStructs[n];De(t,r.written),Fe(t,r.restEncoder)}},Er=e=>((e,t,n,r)=>{const o=new n(nt(e)),i=new yr(o,!1),s=new r,a=new vr(s);for(let e=i.curr;null!==e;e=i.next())Sr(a,t(e),0);Ar(a);const l=Cn(o);return kn(s,l),s.toUint8Array()})(e,Bt,Bn,Nn),Ir="You must not compute changes after the event-handler fired.";class jr{constructor(e,t){this.target=e,this.currentTarget=e,this.transaction=t,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=Tr(this.currentTarget,this.target))}deletes(e){return vn(this.transaction.deleteSet,e.id)}get keys(){if(null===this._keys){if(0===this.transaction.doc._transactionCleanups.length)throw Je(Ir);const e=new Map,t=this.target;this.transaction.changed.get(t).forEach((n=>{if(null!==n){const r=t._map.get(n);let o,i;if(this.adds(r)){let e=r.left;for(;null!==e&&this.adds(e);)e=e.left;if(this.deletes(r)){if(null===e||!this.deletes(e))return;o="delete",i=se(e.content.getContent())}else null!==e&&this.deletes(e)?(o="update",i=se(e.content.getContent())):(o="add",i=void 0)}else{if(!this.deletes(r))return;o="delete",i=se(r.content.getContent())}e.set(n,{action:o,oldValue:i})}})),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(null===e){if(0===this.transaction.doc._transactionCleanups.length)throw Je(Ir);const t=this.target,n=ie(),r=ie(),o=[];if(e={added:n,deleted:r,delta:o,keys:this.keys},this.transaction.changed.get(t).has(null)){let e=null;const i=()=>{e&&o.push(e)};for(let o=t._start;null!==o;o=o.right)o.deleted?this.deletes(o)&&!this.adds(o)&&(null!==e&&void 0!==e.delete||(i(),e={delete:0}),e.delete+=o.length,r.add(o)):this.adds(o)?(null!==e&&void 0!==e.insert||(i(),e={insert:[]}),e.insert=e.insert.concat(o.content.getContent()),n.add(o)):(null!==e&&void 0!==e.retain||(i(),e={retain:0}),e.retain+=o.length);null!==e&&void 0===e.retain&&i()}this._changes=e}return e}}const Tr=(e,t)=>{const n=[];for(;null!==t._item&&t!==e;){if(null!==t._item.parentSub)n.unshift(t._item.parentSub);else{let e=0,r=t._item.parent._start;for(;r!==t._item&&null!==r;)r.deleted||e++,r=r.right;n.unshift(e)}t=t._item.parent}return n};let Br=0;class Rr{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=Br++}}const Nr=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=Br++},Dr=(e,t)=>{if(null===e._start||0===t||null===e._searchMarker)return null;const n=0===e._searchMarker.length?null:e._searchMarker.reduce(((e,n)=>he(t-e.index)<he(t-n.index)?e:n));let r=e._start,o=0;for(null!==n&&(r=n.p,o=n.index,(e=>{e.timestamp=Br++})(n));null!==r.right&&o<t;){if(!r.deleted&&r.countable){if(t<o+r.length)break;o+=r.length}r=r.right}for(;null!==r.left&&o>t;)r=r.left,!r.deleted&&r.countable&&(o-=r.length);for(;null!==r.left&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(o-=r.length);return null!==n&&he(n.index-o)<r.parent.length/80?(Nr(n,r,o),n):((e,t,n)=>{if(e.length>=80){const r=e.reduce(((e,t)=>e.timestamp<t.timestamp?e:t));return Nr(r,t,n),r}{const r=new Rr(t,n);return e.push(r),r}})(e._searchMarker,r,o)},Mr=(e,t,n)=>{for(let r=e.length-1;r>=0;r--){const o=e[r];if(n>0){let t=o.p;for(t.marker=!1;t&&(t.deleted||!t.countable);)t=t.left,t&&!t.deleted&&t.countable&&(o.index-=t.length);if(null===t||!0===t.marker){e.splice(r,1);continue}o.p=t,t.marker=!0}(t<o.index||n>0&&t===o.index)&&(o.index=me(t,o.index+n))}},Pr=(e,t,n)=>{const r=e,o=t.changedParentTypes;for(;oe(o,e,(()=>[])).push(n),null!==e._item;)e=e._item.parent;qn(r._eH,n,t)};class Or{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=$n(),this._dEH=$n(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw Xe()}clone(){throw Xe()}_write(e){}get _first(){let e=this._start;for(;null!==e&&e.deleted;)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){Wn(this._eH,e)}observeDeep(e){Wn(this._dEH,e)}unobserve(e){Gn(this._eH,e)}unobserveDeep(e){Gn(this._dEH,e)}toJSON(){}}const Lr=(e,t,n)=>{t<0&&(t=e._length+t),n<0&&(n=e._length+n);let r=n-t;const o=[];let i=e._start;for(;null!==i&&r>0;){if(i.countable&&!i.deleted){const e=i.content.getContent();if(e.length<=t)t-=e.length;else{for(let n=t;n<e.length&&r>0;n++)o.push(e[n]),r--;t=0}}i=i.right}return o},Fr=e=>{const t=[];let n=e._start;for(;null!==n;){if(n.countable&&!n.deleted){const e=n.content.getContent();for(let n=0;n<e.length;n++)t.push(e[n])}n=n.right}return t},zr=(e,t)=>{let n=0,r=e._start;for(;null!==r;){if(r.countable&&!r.deleted){const o=r.content.getContent();for(let r=0;r<o.length;r++)t(o[r],n++,e)}r=r.right}},Ur=(e,t)=>{const n=[];return zr(e,((r,o)=>{n.push(t(r,o,e))})),n},Vr=e=>{let t=e._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(null===n){for(;null!==t&&t.deleted;)t=t.right;if(null===t)return{done:!0,value:void 0};n=t.content.getContent(),r=0,t=t.right}const e=n[r++];return n.length<=r&&(n=null),{done:!1,value:e}}}},Hr=(e,t)=>{const n=Dr(e,t);let r=e._start;for(null!==n&&(r=n.p,t-=n.index);null!==r;r=r.right)if(!r.deleted&&r.countable){if(t<r.length)return r.content.getContent()[t];t-=r.length}},$r=(e,t,n,r)=>{let o=n;const i=e.doc,s=i.clientID,a=i.store,l=null===n?t._start:n.right;let c=[];const u=()=>{c.length>0&&(o=new Ko(Jn(s,or(a,s)),o,o&&o.lastId,l,l&&l.id,t,null,new Po(c)),o.integrate(e,0),c=[])};r.forEach((n=>{if(null===n)c.push(n);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:c.push(n);break;default:switch(u(),n.constructor){case Uint8Array:case ArrayBuffer:o=new Ko(Jn(s,or(a,s)),o,o&&o.lastId,l,l&&l.id,t,null,new jo(new Uint8Array(n))),o.integrate(e,0);break;case En:o=new Ko(Jn(s,or(a,s)),o,o&&o.lastId,l,l&&l.id,t,null,new Ro(n)),o.integrate(e,0);break;default:if(!(n instanceof Or))throw new Error("Unexpected content type in insert operation");o=new Ko(Jn(s,or(a,s)),o,o&&o.lastId,l,l&&l.id,t,null,new Go(n)),o.integrate(e,0)}}})),u()},Wr=()=>Je("Length exceeded!"),Gr=(e,t,n,r)=>{if(n>t._length)throw Wr();if(0===n)return t._searchMarker&&Mr(t._searchMarker,n,r.length),$r(e,t,null,r);const o=n,i=Dr(t,n);let s=t._start;for(null!==i&&(s=i.p,0==(n-=i.index)&&(s=s.prev,n+=s&&s.countable&&!s.deleted?s.length:0));null!==s;s=s.right)if(!s.deleted&&s.countable){if(n<=s.length){n<s.length&&cr(e,Jn(s.id.client,s.id.clock+n));break}n-=s.length}return t._searchMarker&&Mr(t._searchMarker,o,r.length),$r(e,t,s,r)},qr=(e,t,n,r)=>{if(0===r)return;const o=n,i=r,s=Dr(t,n);let a=t._start;for(null!==s&&(a=s.p,n-=s.index);null!==a&&n>0;a=a.right)!a.deleted&&a.countable&&(n<a.length&&cr(e,Jn(a.id.client,a.id.clock+n)),n-=a.length);for(;r>0&&null!==a;)a.deleted||(r<a.length&&cr(e,Jn(a.id.client,a.id.clock+r)),a.delete(e),r-=a.length),a=a.right;if(r>0)throw Wr();t._searchMarker&&Mr(t._searchMarker,o,-i+r)},Kr=(e,t,n)=>{const r=t._map.get(n);void 0!==r&&r.delete(e)},Yr=(e,t,n,r)=>{const o=t._map.get(n)||null,i=e.doc,s=i.clientID;let a;if(null==r)a=new Po([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:a=new Po([r]);break;case Uint8Array:a=new jo(r);break;case En:a=new Ro(r);break;default:if(!(r instanceof Or))throw new Error("Unexpected content type");a=new Go(r)}new Ko(Jn(s,or(i.store,s)),o,o&&o.lastId,null,null,t,n,a).integrate(e,0)},Jr=(e,t)=>{const n=e._map.get(t);return void 0===n||n.deleted?void 0:n.content.getContent()[n.length-1]},Xr=e=>{const t={};return e._map.forEach(((e,n)=>{e.deleted||(t[n]=e.content.getContent()[e.length-1])})),t},Zr=(e,t)=>{const n=e._map.get(t);return void 0!==n&&!n.deleted},Qr=e=>{return t=e.entries(),fn((()=>{let e;do{e=t.next()}while(!e.done&&e.value[1].deleted);return e}));var t};class eo extends jr{constructor(e,t){super(e,t),this._transaction=t}}class to extends Or{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const t=new to;return t.push(e),t}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new to}clone(){const e=new to;return e.insert(0,this.toArray().map((e=>e instanceof Or?e.clone():e))),e}get length(){return null===this._prelimContent?this._length:this._prelimContent.length}_callObserver(e,t){super._callObserver(e,t),Pr(this,e,new eo(this,e))}insert(e,t){null!==this.doc?br(this.doc,(n=>{Gr(n,this,e,t)})):this._prelimContent.splice(e,0,...t)}push(e){null!==this.doc?br(this.doc,(t=>{((e,t,n)=>{let r=(t._searchMarker||[]).reduce(((e,t)=>t.index>e.index?t:e),{index:0,p:t._start}).p;if(r)for(;r.right;)r=r.right;$r(e,t,r,n)})(t,this,e)})):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,t=1){null!==this.doc?br(this.doc,(n=>{qr(n,this,e,t)})):this._prelimContent.splice(e,t)}get(e){return Hr(this,e)}toArray(){return Fr(this)}slice(e=0,t=this.length){return Lr(this,e,t)}toJSON(){return this.map((e=>e instanceof Or?e.toJSON():e))}map(e){return Ur(this,e)}forEach(e){zr(this,e)}[Symbol.iterator](){return Vr(this)}_write(e){e.writeTypeRef(Fo)}}class no extends jr{constructor(e,t,n){super(e,t),this.keysChanged=n}}class ro extends Or{constructor(e){super(),this._prelimContent=null,this._prelimContent=void 0===e?new Map:new Map(e)}_integrate(e,t){super._integrate(e,t),this._prelimContent.forEach(((e,t)=>{this.set(t,e)})),this._prelimContent=null}_copy(){return new ro}clone(){const e=new ro;return this.forEach(((t,n)=>{e.set(n,t instanceof Or?t.clone():t)})),e}_callObserver(e,t){Pr(this,e,new no(this,e,t))}toJSON(){const e={};return this._map.forEach(((t,n)=>{if(!t.deleted){const r=t.content.getContent()[t.length-1];e[n]=r instanceof Or?r.toJSON():r}})),e}get size(){return[...Qr(this._map)].length}keys(){return mn(Qr(this._map),(e=>e[0]))}values(){return mn(Qr(this._map),(e=>e[1].content.getContent()[e[1].length-1]))}entries(){return mn(Qr(this._map),(e=>[e[0],e[1].content.getContent()[e[1].length-1]]))}forEach(e){this._map.forEach(((t,n)=>{t.deleted||e(t.content.getContent()[t.length-1],n,this)}))}[Symbol.iterator](){return this.entries()}delete(e){null!==this.doc?br(this.doc,(t=>{Kr(t,this,e)})):this._prelimContent.delete(e)}set(e,t){return null!==this.doc?br(this.doc,(n=>{Yr(n,this,e,t)})):this._prelimContent.set(e,t),t}get(e){return Jr(this,e)}has(e){return Zr(this,e)}clear(){null!==this.doc?br(this.doc,(e=>{this.forEach((function(t,n,r){Kr(e,r,n)}))})):this._prelimContent.clear()}_write(e){e.writeTypeRef(zo)}}const oo=(e,t)=>e===t||"object"==typeof e&&"object"==typeof t&&e&&t&&((e,t)=>e===t||Et(e)===Et(t)&&((e,t)=>{for(const n in e)if(!t(e[n],n))return!1;return!0})(e,((e,n)=>(void 0!==e||It(t,n))&&t[n]===e)))(e,t);class io{constructor(e,t,n,r){this.left=e,this.right=t,this.index=n,this.currentAttributes=r}forward(){null===this.right&&Ze(),this.right.content.constructor===Do?this.right.deleted||co(this.currentAttributes,this.right.content):this.right.deleted||(this.index+=this.right.length),this.left=this.right,this.right=this.right.right}}const so=(e,t,n)=>{for(;null!==t.right&&n>0;)t.right.content.constructor===Do?t.right.deleted||co(t.currentAttributes,t.right.content):t.right.deleted||(n<t.right.length&&cr(e,Jn(t.right.id.client,t.right.id.clock+n)),t.index+=t.right.length,n-=t.right.length),t.left=t.right,t.right=t.right.right;return t},ao=(e,t,n,r)=>{const o=new Map,i=r?Dr(t,n):null;if(i){const t=new io(i.p.left,i.p,i.index,o);return so(e,t,n-i.index)}{const r=new io(null,t._start,0,o);return so(e,r,n)}},lo=(e,t,n,r)=>{for(;null!==n.right&&(!0===n.right.deleted||n.right.content.constructor===Do&&oo(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();const o=e.doc,i=o.clientID;r.forEach(((r,s)=>{const a=n.left,l=n.right,c=new Ko(Jn(i,or(o.store,i)),a,a&&a.lastId,l,l&&l.id,t,null,new Do(s,r));c.integrate(e,0),n.right=c,n.forward()}))},co=(e,t)=>{const{key:n,value:r}=t;null===r?e.delete(n):e.set(n,r)},uo=(e,t)=>{for(;null!==e.right&&(e.right.deleted||e.right.content.constructor===Do&&oo(t[e.right.content.key]||null,e.right.content.value));)e.forward()},ho=(e,t,n,r)=>{const o=e.doc,i=o.clientID,s=new Map;for(const a in r){const l=r[a],c=n.currentAttributes.get(a)||null;if(!oo(c,l)){s.set(a,c);const{left:r,right:u}=n;n.right=new Ko(Jn(i,or(o.store,i)),r,r&&r.lastId,u,u&&u.id,t,null,new Do(a,l)),n.right.integrate(e,0),n.forward()}}return s},po=(e,t,n,r,o)=>{n.currentAttributes.forEach(((e,t)=>{void 0===o[t]&&(o[t]=null)}));const i=e.doc,s=i.clientID;uo(n,o);const a=ho(e,t,n,o),l=r.constructor===String?new Oo(r):r instanceof Or?new Go(r):new No(r);let{left:c,right:u,index:d}=n;t._searchMarker&&Mr(t._searchMarker,n.index,l.getLength()),u=new Ko(Jn(s,or(i.store,s)),c,c&&c.lastId,u,u&&u.id,t,null,l),u.integrate(e,0),n.right=u,n.index=d,n.forward(),lo(e,t,n,a)},fo=(e,t,n,r,o)=>{const i=e.doc,s=i.clientID;uo(n,o);const a=ho(e,t,n,o);e:for(;null!==n.right&&(r>0||a.size>0&&(n.right.deleted||n.right.content.constructor===Do));){if(!n.right.deleted)switch(n.right.content.constructor){case Do:{const{key:t,value:i}=n.right.content,s=o[t];if(void 0!==s){if(oo(s,i))a.delete(t);else{if(0===r)break e;a.set(t,i)}n.right.delete(e)}else n.currentAttributes.set(t,i);break}default:r<n.right.length&&cr(e,Jn(n.right.id.client,n.right.id.clock+r)),r-=n.right.length}n.forward()}if(r>0){let o="";for(;r>0;r--)o+="\n";n.right=new Ko(Jn(s,or(i.store,s)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new Oo(o)),n.right.integrate(e,0),n.forward()}lo(e,t,n,a)},mo=(e,t,n,r,o)=>{let i=t;const s=ne();for(;i&&(!i.countable||i.deleted);){if(!i.deleted&&i.content.constructor===Do){const e=i.content;s.set(e.key,e)}i=i.right}let a=0,l=!1;for(;t!==i;){if(n===t&&(l=!0),!t.deleted){const n=t.content;switch(n.constructor){case Do:{const{key:i,value:c}=n,u=r.get(i)||null;s.get(i)===n&&u!==c||(t.delete(e),a++,l||(o.get(i)||null)!==c||u===c||(null===u?o.delete(i):o.set(i,u))),l||t.deleted||co(o,n);break}}}t=t.right}return a},go=e=>{let t=0;return br(e.doc,(n=>{let r=e._start,o=e._start,i=ne();const s=re(i);for(;o;)!1===o.deleted&&(o.content.constructor===Do?co(s,o.content):(t+=mo(n,r,o,i,s),i=re(s),r=o)),o=o.right})),t},bo=e=>{const t=new Set,n=e.doc;for(const[r,o]of e.afterState.entries()){const i=e.beforeState.get(r)||0;o!==i&&dr(e,n.store.clients.get(r),i,o,(e=>{e.deleted||e.content.constructor!==Do||e.constructor===Io||t.add(e.parent)}))}br(n,(n=>{yn(e,e.deleteSet,(e=>{if(e instanceof Io||!e.parent._hasFormatting||t.has(e.parent))return;const r=e.parent;e.content.constructor===Do?t.add(r):((e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;const n=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===Do){const r=t.content.key;n.has(r)?t.delete(e):n.add(r)}t=t.left}})(n,e)}));for(const e of t)go(e)}))},yo=(e,t,n)=>{const r=n,o=re(t.currentAttributes),i=t.right;for(;n>0&&null!==t.right;){if(!1===t.right.deleted)switch(t.right.content.constructor){case Go:case No:case Oo:n<t.right.length&&cr(e,Jn(t.right.id.client,t.right.id.clock+n)),n-=t.right.length,t.right.delete(e)}t.forward()}i&&mo(e,i,t.right,o,t.currentAttributes);const s=(t.left||t.right).parent;return s._searchMarker&&Mr(s._searchMarker,t.index,-r+n),t};class vo extends jr{constructor(e,t,n){super(e,t),this.childListChanged=!1,this.keysChanged=new Set,n.forEach((e=>{null===e?this.childListChanged=!0:this.keysChanged.add(e)}))}get changes(){if(null===this._changes){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(null===this._delta){const e=this.target.doc,t=[];br(e,(e=>{const n=new Map,r=new Map;let o=this.target._start,i=null;const s={};let a="",l=0,c=0;const u=()=>{if(null!==i){let e=null;switch(i){case"delete":c>0&&(e={delete:c}),c=0;break;case"insert":("object"==typeof a||a.length>0)&&(e={insert:a},n.size>0&&(e.attributes={},n.forEach(((t,n)=>{null!==t&&(e.attributes[n]=t)})))),a="";break;case"retain":l>0&&(e={retain:l},(e=>{for(const t in e)return!1;return!0})(s)||(e.attributes=St({},s))),l=0}e&&t.push(e),i=null}};for(;null!==o;){switch(o.content.constructor){case Go:case No:this.adds(o)?this.deletes(o)||(u(),i="insert",a=o.content.getContent()[0],u()):this.deletes(o)?("delete"!==i&&(u(),i="delete"),c+=1):o.deleted||("retain"!==i&&(u(),i="retain"),l+=1);break;case Oo:this.adds(o)?this.deletes(o)||("insert"!==i&&(u(),i="insert"),a+=o.content.str):this.deletes(o)?("delete"!==i&&(u(),i="delete"),c+=o.length):o.deleted||("retain"!==i&&(u(),i="retain"),l+=o.length);break;case Do:{const{key:t,value:a}=o.content;if(this.adds(o)){if(!this.deletes(o)){const l=n.get(t)||null;oo(l,a)?null!==a&&o.delete(e):("retain"===i&&u(),oo(a,r.get(t)||null)?delete s[t]:s[t]=a)}}else if(this.deletes(o)){r.set(t,a);const e=n.get(t)||null;oo(e,a)||("retain"===i&&u(),s[t]=e)}else if(!o.deleted){r.set(t,a);const n=s[t];void 0!==n&&(oo(n,a)?null!==n&&o.delete(e):("retain"===i&&u(),null===a?delete s[t]:s[t]=a))}o.deleted||("insert"===i&&u(),co(n,o.content));break}}o=o.right}for(u();t.length>0;){const e=t[t.length-1];if(void 0===e.retain||void 0!==e.attributes)break;t.pop()}})),this._delta=t}return this._delta}}class _o extends Or{constructor(e){super(),this._pending=void 0!==e?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach((e=>e()))}catch(e){console.error(e)}this._pending=null}_copy(){return new _o}clone(){const e=new _o;return e.applyDelta(this.toDelta()),e}_callObserver(e,t){super._callObserver(e,t);const n=new vo(this,e,t);Pr(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){let e="",t=this._start;for(;null!==t;)!t.deleted&&t.countable&&t.content.constructor===Oo&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){null!==this.doc?br(this.doc,(n=>{const r=new io(null,this._start,0,new Map);for(let o=0;o<e.length;o++){const i=e[o];if(void 0!==i.insert){const s=t||"string"!=typeof i.insert||o!==e.length-1||null!==r.right||"\n"!==i.insert.slice(-1)?i.insert:i.insert.slice(0,-1);("string"!=typeof s||s.length>0)&&po(n,this,r,s,i.attributes||{})}else void 0!==i.retain?fo(n,this,r,i.retain,i.attributes||{}):void 0!==i.delete&&yo(n,r,i.delete)}})):this._pending.push((()=>this.applyDelta(e)))}toDelta(e,t,n){const r=[],o=new Map,i=this.doc;let s="",a=this._start;function l(){if(s.length>0){const e={};let t=!1;o.forEach(((n,r)=>{t=!0,e[r]=n}));const n={insert:s};t&&(n.attributes=e),r.push(n),s=""}}const c=()=>{for(;null!==a;){if(Zn(a,e)||void 0!==t&&Zn(a,t))switch(a.content.constructor){case Oo:{const r=o.get("ychange");void 0===e||Zn(a,e)?void 0===t||Zn(a,t)?void 0!==r&&(l(),o.delete("ychange")):void 0!==r&&r.user===a.id.client&&"added"===r.type||(l(),o.set("ychange",n?n("added",a.id):{type:"added"})):void 0!==r&&r.user===a.id.client&&"removed"===r.type||(l(),o.set("ychange",n?n("removed",a.id):{type:"removed"})),s+=a.content.str;break}case Go:case No:{l();const e={insert:a.content.getContent()[0]};if(o.size>0){const t={};e.attributes=t,o.forEach(((e,n)=>{t[n]=e}))}r.push(e);break}case Do:Zn(a,e)&&(l(),co(o,a.content))}a=a.right}l()};return e||t?br(i,(n=>{e&&Qn(n,e),t&&Qn(n,t),c()}),"cleanup"):c(),r}insert(e,t,n){if(t.length<=0)return;const r=this.doc;null!==r?br(r,(r=>{const o=ao(r,this,e,!n);n||(n={},o.currentAttributes.forEach(((e,t)=>{n[t]=e}))),po(r,this,o,t,n)})):this._pending.push((()=>this.insert(e,t,n)))}insertEmbed(e,t,n){const r=this.doc;null!==r?br(r,(r=>{const o=ao(r,this,e,!n);po(r,this,o,t,n||{})})):this._pending.push((()=>this.insertEmbed(e,t,n||{})))}delete(e,t){if(0===t)return;const n=this.doc;null!==n?br(n,(n=>{yo(n,ao(n,this,e,!0),t)})):this._pending.push((()=>this.delete(e,t)))}format(e,t,n){if(0===t)return;const r=this.doc;null!==r?br(r,(r=>{const o=ao(r,this,e,!1);null!==o.right&&fo(r,this,o,t,n)})):this._pending.push((()=>this.format(e,t,n)))}removeAttribute(e){null!==this.doc?br(this.doc,(t=>{Kr(t,this,e)})):this._pending.push((()=>this.removeAttribute(e)))}setAttribute(e,t){null!==this.doc?br(this.doc,(n=>{Yr(n,this,e,t)})):this._pending.push((()=>this.setAttribute(e,t)))}getAttribute(e){return Jr(this,e)}getAttributes(){return Xr(this)}_write(e){e.writeTypeRef(Uo)}}class xo{constructor(e,t=(()=>!0)){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(null!==e&&(!this._firstCall||e.deleted||!this._filter(t)))do{if(t=e.content.type,e.deleted||t.constructor!==ko&&t.constructor!==wo||null===t._start)for(;null!==e;){if(null!==e.right){e=e.right;break}e=e.parent===this._root?null:e.parent._item}else e=t._start}while(null!==e&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,null===e?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class wo extends Or{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new wo}clone(){const e=new wo;return e.insert(0,this.toArray().map((e=>e instanceof Or?e.clone():e))),e}get length(){return null===this._prelimContent?this._length:this._prelimContent.length}createTreeWalker(e){return new xo(this,e)}querySelector(e){e=e.toUpperCase();const t=new xo(this,(t=>t.nodeName&&t.nodeName.toUpperCase()===e)).next();return t.done?null:t.value}querySelectorAll(e){return e=e.toUpperCase(),le(new xo(this,(t=>t.nodeName&&t.nodeName.toUpperCase()===e)))}_callObserver(e,t){Pr(this,e,new Co(this,t,e))}toString(){return Ur(this,(e=>e.toString())).join("")}toJSON(){return this.toString()}toDOM(e=document,t={},n){const r=e.createDocumentFragment();return void 0!==n&&n._createAssociation(r,this),zr(this,(o=>{r.insertBefore(o.toDOM(e,t,n),null)})),r}insert(e,t){null!==this.doc?br(this.doc,(n=>{Gr(n,this,e,t)})):this._prelimContent.splice(e,0,...t)}insertAfter(e,t){if(null!==this.doc)br(this.doc,(n=>{const r=e&&e instanceof Or?e._item:e;$r(n,this,r,t)}));else{const n=this._prelimContent,r=null===e?0:n.findIndex((t=>t===e))+1;if(0===r&&null!==e)throw Je("Reference item not found");n.splice(r,0,...t)}}delete(e,t=1){null!==this.doc?br(this.doc,(n=>{qr(n,this,e,t)})):this._prelimContent.splice(e,t)}toArray(){return Fr(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return Hr(this,e)}slice(e=0,t=this.length){return Lr(this,e,t)}forEach(e){zr(this,e)}_write(e){e.writeTypeRef(Ho)}}class ko extends wo{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach(((e,t)=>{this.setAttribute(t,e)})),this._prelimAttrs=null}_copy(){return new ko(this.nodeName)}clone(){const e=new ko(this.nodeName);return((e,t)=>{for(const n in e)t(e[n],n)})(this.getAttributes(),((t,n)=>{"string"==typeof t&&e.setAttribute(n,t)})),e.insert(0,this.toArray().map((e=>e instanceof Or?e.clone():e))),e}toString(){const e=this.getAttributes(),t=[],n=[];for(const t in e)n.push(t);n.sort();const r=n.length;for(let o=0;o<r;o++){const r=n[o];t.push(r+'="'+e[r]+'"')}const o=this.nodeName.toLocaleLowerCase();return`<${o}${t.length>0?" "+t.join(" "):""}>${super.toString()}</${o}>`}removeAttribute(e){null!==this.doc?br(this.doc,(t=>{Kr(t,this,e)})):this._prelimAttrs.delete(e)}setAttribute(e,t){null!==this.doc?br(this.doc,(n=>{Yr(n,this,e,t)})):this._prelimAttrs.set(e,t)}getAttribute(e){return Jr(this,e)}hasAttribute(e){return Zr(this,e)}getAttributes(e){return e?((e,t)=>{const n={};return this._map.forEach(((e,r)=>{let o=e;for(;null!==o&&(!t.sv.has(o.id.client)||o.id.clock>=(t.sv.get(o.id.client)||0));)o=o.left;null!==o&&Zn(o,t)&&(n[r]=o.content.getContent()[o.length-1])})),n})(0,e):Xr(this)}toDOM(e=document,t={},n){const r=e.createElement(this.nodeName),o=this.getAttributes();for(const e in o){const t=o[e];"string"==typeof t&&r.setAttribute(e,t)}return zr(this,(o=>{r.appendChild(o.toDOM(e,t,n))})),void 0!==n&&n._createAssociation(r,this),r}_write(e){e.writeTypeRef(Vo),e.writeKey(this.nodeName)}}class Co extends jr{constructor(e,t,n){super(e,n),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach((e=>{null===e?this.childListChanged=!0:this.attributesChanged.add(e)}))}}class So extends ro{constructor(e){super(),this.hookName=e}_copy(){return new So(this.hookName)}clone(){const e=new So(this.hookName);return this.forEach(((t,n)=>{e.set(n,t)})),e}toDOM(e=document,t={},n){const r=t[this.hookName];let o;return o=void 0!==r?r.createDom(this):document.createElement(this.hookName),o.setAttribute("data-yjs-hook",this.hookName),void 0!==n&&n._createAssociation(o,this),o}_write(e){e.writeTypeRef($o),e.writeKey(this.hookName)}}class Ao extends _o{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new Ao}clone(){const e=new Ao;return e.applyDelta(this.toDelta()),e}toDOM(e=document,t,n){const r=e.createTextNode(this.toString());return void 0!==n&&n._createAssociation(r,this),r}toString(){return this.toDelta().map((e=>{const t=[];for(const n in e.attributes){const r=[];for(const t in e.attributes[n])r.push({key:t,value:e.attributes[n][t]});r.sort(((e,t)=>e.key<t.key?-1:1)),t.push({nodeName:n,attrs:r})}t.sort(((e,t)=>e.nodeName<t.nodeName?-1:1));let n="";for(let e=0;e<t.length;e++){const r=t[e];n+=`<${r.nodeName}`;for(let e=0;e<r.attrs.length;e++){const t=r.attrs[e];n+=` ${t.key}="${t.value}"`}n+=">"}n+=e.insert;for(let e=t.length-1;e>=0;e--)n+=`</${t[e].nodeName}>`;return n})).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(Wo)}}class Eo{constructor(e,t){this.id=e,this.length=t}get deleted(){throw Xe()}mergeWith(e){return!1}write(e,t,n){throw Xe()}integrate(e,t){throw Xe()}}class Io extends Eo{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),ir(e.doc.store,this)}write(e,t){e.writeInfo(0),e.writeLen(this.length-t)}getMissing(e,t){return null}}class jo{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new jo(this.content)}splice(e){throw Xe()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}}class To{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new To(this.len)}splice(e){const t=new To(this.len-e);return this.len=e,t}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){xn(e.deleteSet,t.id.client,t.id.clock,this.len),t.markDeleted()}delete(e){}gc(e){}write(e,t){e.writeLen(this.len-t)}getRef(){return 1}}const Bo=(e,t)=>new En({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1});class Ro{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),null!==e.meta&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new Ro(Bo(this.doc.guid,this.opts))}splice(e){throw Xe()}mergeWith(e){return!1}integrate(e,t){this.doc._item=t,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,t){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}class No{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new No(this.embed)}splice(e){throw Xe()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}}class Do{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new Do(this.key,this.value)}splice(e){throw Xe()}mergeWith(e){return!1}integrate(e,t){const n=t.parent;n._searchMarker=null,n._hasFormatting=!0}delete(e){}gc(e){}write(e,t){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}class Mo{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Mo(this.arr)}splice(e){const t=new Mo(this.arr.slice(e));return this.arr=this.arr.slice(0,e),t}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){const n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){const t=this.arr[r];e.writeString(void 0===t?"undefined":JSON.stringify(t))}}getRef(){return 2}}class Po{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Po(this.arr)}splice(e){const t=new Po(this.arr.slice(e));return this.arr=this.arr.slice(0,e),t}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){const n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){const t=this.arr[r];e.writeAny(t)}}getRef(){return 8}}class Oo{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new Oo(this.str)}splice(e){const t=new Oo(this.str.slice(e));this.str=this.str.slice(0,e);const n=this.str.charCodeAt(e-1);return n>=55296&&n<=56319&&(this.str=this.str.slice(0,e-1)+"�",t.str="�"+t.str.slice(1)),t}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(0===t?this.str:this.str.slice(t))}getRef(){return 4}}const Lo=[e=>new to,e=>new ro,e=>new _o,e=>new ko(e.readKey()),e=>new wo,e=>new So(e.readKey()),e=>new Ao],Fo=0,zo=1,Uo=2,Vo=3,Ho=4,$o=5,Wo=6;class Go{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new Go(this.type._copy())}splice(e){throw Xe()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;for(;null!==t;)t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e),t=t.right;this.type._map.forEach((t=>{t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e)})),e.changed.delete(this.type)}gc(e){let t=this.type._start;for(;null!==t;)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach((t=>{for(;null!==t;)t.gc(e,!0),t=t.left})),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}}const qo=(e,t,n)=>{const{client:r,clock:o}=t.id,i=new Ko(Jn(r,o+n),t,Jn(r,o+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&i.markDeleted(),t.keep&&(i.keep=!0),null!==t.redone&&(i.redone=Jn(t.redone.client,t.redone.clock+n)),t.right=i,null!==i.right&&(i.right.left=i),e._mergeStructs.push(i),null!==i.parentSub&&null===i.right&&i.parent._map.set(i.parentSub,i),t.length=n,i};class Ko extends Eo{constructor(e,t,n,r,o,i,s,a){super(e,a.getLength()),this.origin=n,this.left=t,this.right=r,this.rightOrigin=o,this.parent=i,this.parentSub=s,this.redone=null,this.content=a,this.info=this.content.isCountable()?2:0}set marker(e){(8&this.info)>0!==e&&(this.info^=8)}get marker(){return(8&this.info)>0}get keep(){return(1&this.info)>0}set keep(e){this.keep!==e&&(this.info^=1)}get countable(){return(2&this.info)>0}get deleted(){return(4&this.info)>0}set deleted(e){this.deleted!==e&&(this.info^=4)}markDeleted(){this.info|=4}getMissing(e,t){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=or(t,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=or(t,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===Kn&&this.id.client!==this.parent.client&&this.parent.clock>=or(t,this.parent.client))return this.parent.client;if(this.origin&&(this.left=ur(e,t,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=cr(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===Io||this.right&&this.right.constructor===Io)this.parent=null;else if(this.parent){if(this.parent.constructor===Kn){const e=ar(t,this.parent);e.constructor===Io?this.parent=null:this.parent=e.content.type}}else this.left&&this.left.constructor===Ko&&(this.parent=this.left.parent,this.parentSub=this.left.parentSub),this.right&&this.right.constructor===Ko&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=ur(e,e.doc.store,Jn(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||null!==this.right.left)||this.left&&this.left.right!==this.right){let t,n=this.left;if(null!==n)t=n.right;else if(null!==this.parentSub)for(t=this.parent._map.get(this.parentSub)||null;null!==t&&null!==t.left;)t=t.left;else t=this.parent._start;const r=new Set,o=new Set;for(;null!==t&&t!==this.right;){if(o.add(t),r.add(t),Yn(this.origin,t.origin)){if(t.id.client<this.id.client)n=t,r.clear();else if(Yn(this.rightOrigin,t.rightOrigin))break}else{if(null===t.origin||!o.has(ar(e.doc.store,t.origin)))break;r.has(ar(e.doc.store,t.origin))||(n=t,r.clear())}t=t.right}this.left=n}if(null!==this.left){const e=this.left.right;this.right=e,this.left.right=this}else{let e;if(null!==this.parentSub)for(e=this.parent._map.get(this.parentSub)||null;null!==e&&null!==e.left;)e=e.left;else e=this.parent._start,this.parent._start=this;this.right=e}null!==this.right?this.right.left=this:null!==this.parentSub&&(this.parent._map.set(this.parentSub,this),null!==this.left&&this.left.delete(e)),null===this.parentSub&&this.countable&&!this.deleted&&(this.parent._length+=this.length),ir(e.doc.store,this),this.content.integrate(e,this),fr(e,this.parent,this.parentSub),(null!==this.parent._item&&this.parent._item.deleted||null!==this.parentSub&&null!==this.right)&&this.delete(e)}else new Io(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;null!==e&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;null!==e&&e.deleted;)e=e.left;return e}get lastId(){return 1===this.length?this.id:Jn(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&Yn(e.origin,this.lastId)&&this.right===e&&Yn(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&null===this.redone&&null===e.redone&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){const t=this.parent._searchMarker;return t&&t.forEach((t=>{t.p===e&&(t.p=this,!this.deleted&&this.countable&&(t.index-=this.length))})),e.keep&&(this.keep=!0),this.right=e.right,null!==this.right&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const t=this.parent;this.countable&&null===this.parentSub&&(t._length-=this.length),this.markDeleted(),xn(e.deleteSet,this.id.client,this.id.clock,this.length),fr(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw Ze();this.content.gc(e),t?((e,t,n)=>{const r=e.clients.get(t.id.client);r[sr(r,t.id.clock)]=n})(e,this,new Io(this.id,this.length)):this.content=new To(this.length)}write(e,t){const n=t>0?Jn(this.id.client,this.id.clock+t-1):this.origin,r=this.rightOrigin,o=this.parentSub,i=31&this.content.getRef()|(null===n?0:ye)|(null===r?0:be)|(null===o?0:32);if(e.writeInfo(i),null!==n&&e.writeLeftID(n),null!==r&&e.writeRightID(r),null===n&&null===r){const t=this.parent;if(void 0!==t._item){const n=t._item;if(null===n){const n=(e=>{for(const[t,n]of e.doc.share.entries())if(n===e)return t;throw Ze()})(t);e.writeParentInfo(!0),e.writeString(n)}else e.writeParentInfo(!1),e.writeLeftID(n.id)}else t.constructor===String?(e.writeParentInfo(!0),e.writeString(t)):t.constructor===Kn?(e.writeParentInfo(!1),e.writeLeftID(t)):Ze();null!==o&&e.writeString(o)}this.content.write(e,t)}}const Yo=(e,t)=>Jo[31&t](e),Jo=[()=>{Ze()},e=>new To(e.readLen()),e=>{const t=e.readLen(),n=[];for(let r=0;r<t;r++){const t=e.readString();"undefined"===t?n.push(void 0):n.push(JSON.parse(t))}return new Mo(n)},e=>new jo(e.readBuf()),e=>new Oo(e.readString()),e=>new No(e.readJSON()),e=>new Do(e.readKey(),e.readJSON()),e=>new Go(Lo[e.readTypeRef()](e)),e=>{const t=e.readLen(),n=[];for(let r=0;r<t;r++)n.push(e.readAny());return new Po(n)},e=>new Ro(Bo(e.readString(),e.readAny())),()=>{Ze()}];class Xo extends Eo{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){Ze()}write(e,t){e.writeInfo(10),De(e.restEncoder,this.length-t)}getMissing(e,t){return null}}const Zo="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},Qo="__ $YJS$ __";!0===Zo[Qo]&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438"),Zo[Qo]=!0;const ei=(e,t)=>{const n={},r={},o={};return{register:function(e,t){n[e]=t},bootstrap:async function(i,s,a){const l=new En;o[i]=o[i]||{},o[i][s]=l;const c=()=>{const e=n[i].fromCRDTDoc(l);a(e)};l.on("update",c);const u=await e(s,i,l);t&&await t(s,i,l);const d=n[i].fetch;d&&d(s).then((e=>{l.transact((()=>{n[i].applyChangesToDoc(l,e)}))})),r[i]=r[i]||{},r[i][s]=()=>{u(),l.off("update",c)}},update:async function(e,t,r){const i=o[e][t];if(!i)throw"Error doc "+e+" "+t+" not found";i.transact((()=>{n[e].applyChangesToDoc(i,r)}))},discard:async function(e,t){r?.[e]?.[t]&&r[e][t]()}}},ti=e=>_t(((t,n)=>{e.onerror=e=>n(new Error(e.target.error)),e.onsuccess=e=>t(e.target.result)})),ni=(e,t,n="readwrite")=>{const r=e.transaction(t,n);return t.map((e=>ai(r,e)))},ri=(e,t)=>ti(e.count(t)),oi=(e,t)=>ti(e.delete(t)),ii=(e,t)=>ti(e.add(t)),si=(e,t,n,r="next")=>((e,t)=>_t(((n,r)=>{e.onerror=r,e.onsuccess=async e=>{const r=e.target.result;if(null===r||!1===await t(r))return n();r.continue()}})))(e.openKeyCursor(t,r),(e=>n(e.key))),ai=(e,t)=>e.objectStore(t),li="custom",ci="updates",ui=(e,t=(()=>{}),n=(()=>{}))=>{const[r]=ni(e.db,[ci]);return((e,t,n)=>ti(e.getAll(t,n)))(r,(o=e._dbref,IDBKeyRange.lowerBound(o,false))).then((o=>{e._destroyed||(t(r),br(e.doc,(()=>{o.forEach((t=>Ln(e.doc,t)))}),e,!1),n(r))})).then((()=>((e,t=null)=>((e,t,n)=>{let r=null;return si(e,t,(e=>(r=e,!1)),n).then((()=>r))})(e,t,"prev"))(r).then((t=>{e._dbref=t+1})))).then((()=>ri(r).then((t=>{e._dbsize=t})))).then((()=>r));var o};class di extends ue{constructor(e,t){super(),this.doc=t,this.name=e,this._dbref=0,this._dbsize=0,this._destroyed=!1,this.db=null,this.synced=!1,this._db=((e,t)=>_t(((t,n)=>{const r=indexedDB.open(e);r.onupgradeneeded=e=>((e,t)=>[["updates",{autoIncrement:!0}],["custom"]].forEach((t=>e.createObjectStore.apply(e,t))))(e.target.result),r.onerror=e=>n(Je(e.target.error)),r.onsuccess=e=>{const n=e.target.result;n.onversionchange=()=>{n.close()},t(n)}})))(e),this.whenSynced=_t((e=>this.on("synced",(()=>e(this))))),this._db.then((e=>{this.db=e,ui(this,(e=>ii(e,zn(t))),(()=>{if(this._destroyed)return this;this.synced=!0,this.emit("synced",[this])}))})),this._storeTimeout=1e3,this._storeTimeoutId=null,this._storeUpdate=(e,t)=>{if(this.db&&t!==this){const[t]=ni(this.db,[ci]);ii(t,e),++this._dbsize>=500&&(null!==this._storeTimeoutId&&clearTimeout(this._storeTimeoutId),this._storeTimeoutId=setTimeout((()=>{((e,t=!0)=>{ui(e).then((n=>{(t||e._dbsize>=500)&&ii(n,zn(e.doc)).then((()=>{return oi(n,(t=e._dbref,IDBKeyRange.upperBound(t,!0)));var t})).then((()=>ri(n).then((t=>{e._dbsize=t}))))}))})(this,!1),this._storeTimeoutId=null}),this._storeTimeout))}},t.on("update",this._storeUpdate),this.destroy=this.destroy.bind(this),t.on("destroy",this.destroy)}destroy(){return this._storeTimeoutId&&clearTimeout(this._storeTimeoutId),this.doc.off("update",this._storeUpdate),this.doc.off("destroy",this.destroy),this._destroyed=!0,this._db.then((e=>{e.close()}))}clearData(){return this.destroy().then((()=>{(e=>{ti(indexedDB.deleteDatabase(e))})(this.name)}))}get(e){return this._db.then((t=>{const[n]=ni(t,[li],"readonly");return((e,t)=>ti(e.get(t)))(n,e)}))}set(e,t){return this._db.then((n=>{const[r]=ni(n,[li]);return((e,t,n)=>ti(e.put(t,n)))(r,t,e)}))}del(e){return this._db.then((t=>{const[n]=ni(t,[li]);return oi(n,e)}))}}function hi(e,t,n){const r=new di(`${t}-${e}`,n);return new Promise((e=>{r.on("synced",(()=>{e((()=>r.destroy()))}))}))}const pi=e=>{if(e.shouldConnect&&null===e.ws){const t=new WebSocket(e.url),n=e.binaryType;let r=null;n&&(t.binaryType=n),e.ws=t,e.connecting=!0,e.connected=!1,t.onmessage=t=>{e.lastMessageReceived=Jt();const n=t.data,o="string"==typeof n?JSON.parse(n):n;o&&"pong"===o.type&&(clearTimeout(r),r=setTimeout(i,15e3)),e.emit("message",[o,e])};const o=t=>{null!==e.ws&&(e.ws=null,e.connecting=!1,e.connected?(e.connected=!1,e.emit("disconnect",[{type:"disconnect",error:t},e])):e.unsuccessfulReconnects++,setTimeout(pi,fe(1200*pe(e.unsuccessfulReconnects+1),2500),e)),clearTimeout(r)},i=()=>{e.ws===t&&e.send({type:"ping"})};t.onclose=()=>o(null),t.onerror=e=>o(e),t.onopen=()=>{e.lastMessageReceived=Jt(),e.connecting=!1,e.connected=!0,e.unsuccessfulReconnects=0,e.emit("connect",[{type:"connect"},e]),r=setTimeout(i,15e3)}}};class fi extends ue{constructor(e,{binaryType:t}={}){super(),this.url=e,this.ws=null,this.binaryType=t||null,this.connected=!1,this.connecting=!1,this.unsuccessfulReconnects=0,this.lastMessageReceived=0,this.shouldConnect=!0,this._checkInterval=setInterval((()=>{this.connected&&3e4<Jt()-this.lastMessageReceived&&this.ws.close()}),15e3),pi(this)}send(e){this.ws&&this.ws.send(JSON.stringify(e))}destroy(){clearInterval(this._checkInterval),this.disconnect(),super.destroy()}disconnect(){this.shouldConnect=!1,null!==this.ws&&this.ws.close()}connect(){this.shouldConnect=!0,this.connected||null!==this.ws||pi(this)}}const mi=new Map,gi="undefined"==typeof BroadcastChannel?class{constructor(e){var t;this.room=e,this.onmessage=null,this._onChange=t=>t.key===e&&null!==this.onmessage&&this.onmessage({data:Ht(t.newValue||"")}),t=this._onChange,kt||addEventListener("storage",t)}postMessage(e){Ct.setItem(this.room,Vt(new Uint8Array(e)))}close(){var e;e=this._onChange,kt||removeEventListener("storage",e)}}:BroadcastChannel,bi=e=>oe(mi,e,(()=>{const t=ie(),n=new gi(e);return n.onmessage=e=>t.forEach((t=>t(e.data,"broadcastchannel"))),{bc:n,subs:t}}));var yi=n(39239),vi=n.n(yi);const _i=(e,t)=>{De(e,0);const n=(e=>((e,t=new Dn)=>(e instanceof Map?Vn(t,e):((e,t)=>{Vn(e,rr(t.store))})(t,e),t.toUint8Array()))(e,new Rn))(t);ze(e,n)},xi=(e,t,n)=>{De(e,1),ze(e,zn(t,n))},wi=(e,t,n)=>{try{Ln(t,rt(e),n)}catch(e){console.error("Caught error while handling a Yjs update",e)}},ki=wi;class Ci extends ue{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval((()=>{const e=Jt();null!==this.getLocalState()&&15e3<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const t=[];this.meta.forEach(((n,r)=>{r!==this.clientID&&3e4<=e-n.lastUpdated&&this.states.has(r)&&t.push(r)})),t.length>0&&Si(this,t,"timeout")}),de(3e3)),e.on("destroy",(()=>{this.destroy()})),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){const t=this.clientID,n=this.meta.get(t),r=void 0===n?0:n.clock+1,o=this.states.get(t);null===e?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:r,lastUpdated:Jt()});const i=[],s=[],a=[],l=[];null===e?l.push(t):null==o?null!=e&&i.push(t):(s.push(t),Rt(o,e)||a.push(t)),(i.length>0||a.length>0||l.length>0)&&this.emit("change",[{added:i,updated:a,removed:l},"local"]),this.emit("update",[{added:i,updated:s,removed:l},"local"])}setLocalStateField(e,t){const n=this.getLocalState();null!==n&&this.setLocalState({...n,[e]:t})}getStates(){return this.states}}const Si=(e,t,n)=>{const r=[];for(let n=0;n<t.length;n++){const o=t[n];if(e.states.has(o)){if(e.states.delete(o),o===e.clientID){const t=e.meta.get(o);e.meta.set(o,{clock:t.clock+1,lastUpdated:Jt()})}r.push(o)}}r.length>0&&(e.emit("change",[{added:[],updated:[],removed:r},n]),e.emit("update",[{added:[],updated:[],removed:r},n]))},Ai=(e,t,n=e.states)=>{const r=t.length,o=Te();De(o,r);for(let i=0;i<r;i++){const r=t[i],s=n.get(r)||null,a=e.meta.get(r).clock;De(o,r),De(o,a),Le(o,JSON.stringify(s))}return Be(o)},Ei=(e,t)=>{if(!t)return xt(e);const n=crypto.getRandomValues(new Uint8Array(12));return crypto.subtle.encrypt({name:"AES-GCM",iv:n},t,e).then((e=>{const t=Te();return Le(t,"AES-GCM"),ze(t,n),ze(t,new Uint8Array(e)),Be(t)}))},Ii=(e,t)=>{if(!t)return xt(e);const n=nt(e);var r;"AES-GCM"!==at(n)&&(r=Je("Unknown encryption algorithm"),Promise.reject(r));const o=rt(n),i=rt(n);return crypto.subtle.decrypt({name:"AES-GCM",iv:o},t,i).then((e=>new Uint8Array(e)))},ji=(e,t)=>Ii(e,t).then((e=>ut(nt(new Uint8Array(e))))),Ti=((e,t)=>{const n=an[ln],r=Lt("log"),o=null!==r&&("*"===r||"true"===r||new RegExp(r,"gi").test(t));return ln=(ln+1)%an.length,t+=": ",o?(...r)=>{const o=Jt(),i=o-cn;cn=o,e(n,t,sn,...r.map((e=>"string"==typeof e||"symbol"==typeof e?e:JSON.stringify(e))),n," +"+i+"ms")}:Tt})(hn,"y-webrtc"),Bi=new Map,Ri=new Map,Ni=e=>{let t=!0;e.webrtcConns.forEach((e=>{e.synced||(t=!1)})),(!t&&e.synced||t&&!e.synced)&&(e.synced=t,e.provider.emit("synced",[{synced:t}]),Ti("synced ",Xt,e.name,Zt," with all peers"))},Di=(e,t,n)=>{const r=nt(t),o=Te(),i=it(r);if(void 0===e)return null;const s=e.awareness,a=e.doc;let l=!1;switch(i){case 0:{De(o,0);const t=((e,t,n,r)=>{const o=it(e);switch(o){case 0:((e,t,n)=>{xi(t,n,rt(e))})(e,t,n);break;case 1:wi(e,n,r);break;case 2:ki(e,n,r);break;default:throw new Error("Unknown message type")}return o})(r,o,a,e);1!==t||e.synced||n(),0===t&&(l=!0);break}case 3:De(o,1),ze(o,Ai(s,Array.from(s.getStates().keys()))),l=!0;break;case 1:((e,t,n)=>{const r=nt(t),o=Jt(),i=[],s=[],a=[],l=[],c=it(r);for(let t=0;t<c;t++){const t=it(r);let n=it(r);const c=JSON.parse(at(r)),u=e.meta.get(t),d=e.states.get(t),h=void 0===u?0:u.clock;(h<n||h===n&&null===c&&e.states.has(t))&&(null===c?t===e.clientID&&null!=e.getLocalState()?n++:e.states.delete(t):e.states.set(t,c),e.meta.set(t,{clock:n,lastUpdated:o}),void 0===u&&null!==c?i.push(t):void 0!==u&&null===c?l.push(t):null!==c&&(Rt(c,d)||a.push(t),s.push(t)))}(i.length>0||a.length>0||l.length>0)&&e.emit("change",[{added:i,updated:a,removed:l},n]),(i.length>0||s.length>0||l.length>0)&&e.emit("update",[{added:i,updated:s,removed:l},n])})(s,rt(r),e);break;case 4:{const t=1===ot(r),n=at(r);if(n!==e.peerId&&(e.bcConns.has(n)&&!t||!e.bcConns.has(n)&&t)){const r=[],o=[];t?(e.bcConns.add(n),o.push(n)):(e.bcConns.delete(n),r.push(n)),e.provider.emit("peers",[{added:o,removed:r,webrtcPeers:Array.from(e.webrtcConns.keys()),bcPeers:Array.from(e.bcConns)}]),zi(e)}break}default:return console.error("Unable to compute message"),o}return l?o:null},Mi=(e,t)=>{Ti("send message to ",Xt,e.remotePeerId,Zt,en," (",e.room.name,")",sn);try{e.peer.send(Be(t))}catch(e){}};class Pi{constructor(e,t,n,r){Ti("establishing connection to ",Xt,n),this.room=r,this.remotePeerId=n,this.glareToken=void 0,this.closed=!1,this.connected=!1,this.synced=!1,this.peer=new(vi())({initiator:t,...r.provider.peerOpts}),this.peer.on("signal",(t=>{void 0===this.glareToken&&(this.glareToken=Date.now()+Math.random()),Vi(e,r,{to:n,from:r.peerId,type:"signal",token:this.glareToken,signal:t})})),this.peer.on("connect",(()=>{Ti("connected to ",Xt,n),this.connected=!0;const e=r.provider.doc,t=r.awareness,o=Te();De(o,0),_i(o,e),Mi(this,o);const i=t.getStates();if(i.size>0){const e=Te();De(e,1),ze(e,Ai(t,Array.from(i.keys()))),Mi(this,e)}})),this.peer.on("close",(()=>{this.connected=!1,this.closed=!0,r.webrtcConns.has(this.remotePeerId)&&(r.webrtcConns.delete(this.remotePeerId),r.provider.emit("peers",[{removed:[this.remotePeerId],added:[],webrtcPeers:Array.from(r.webrtcConns.keys()),bcPeers:Array.from(r.bcConns)}])),Ni(r),this.peer.destroy(),Ti("closed connection to ",Xt,n),Fi(r)})),this.peer.on("error",(e=>{Ti("Error in connection to ",Xt,n,": ",e),Fi(r)})),this.peer.on("data",(e=>{const t=((e,t)=>{const n=e.room;return Ti("received message from ",Xt,e.remotePeerId,en," (",n.name,")",Zt,sn),Di(n,t,(()=>{e.synced=!0,Ti("synced ",Xt,n.name,Zt," with ",Xt,e.remotePeerId),Ni(n)}))})(this,e);null!==t&&Mi(this,t)}))}destroy(){this.peer.destroy()}}const Oi=(e,t)=>Ei(t,e.key).then((t=>e.mux((()=>((e,t,n=null)=>{const r=bi(e);r.bc.postMessage(t),r.subs.forEach((e=>e(t,n)))})(e.name,t))))),Li=(e,t)=>{e.bcconnected&&Oi(e,t),((e,t)=>{Ti("broadcast message in ",Xt,e.name,Zt),e.webrtcConns.forEach((e=>{try{e.peer.send(t)}catch(e){}}))})(e,t)},Fi=e=>{Bi.forEach((t=>{t.connected&&(t.send({type:"subscribe",topics:[e.name]}),e.webrtcConns.size<e.provider.maxConns&&Vi(t,e,{type:"announce",from:e.peerId}))}))},zi=e=>{if(e.provider.filterBcConns){const t=Te();De(t,4),Ne(t,1),Le(t,e.peerId),Oi(e,Be(t))}};class Ui{constructor(e,t,n,r){this.peerId=vt(),this.doc=e,this.awareness=t.awareness,this.provider=t,this.synced=!1,this.name=n,this.key=r,this.webrtcConns=new Map,this.bcConns=new Set,this.mux=(()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else void 0!==n&&n()}})(),this.bcconnected=!1,this._bcSubscriber=e=>Ii(new Uint8Array(e),r).then((e=>this.mux((()=>{const t=Di(this,e,(()=>{}));t&&Oi(this,Be(t))})))),this._docUpdateHandler=(e,t)=>{const n=Te();De(n,0),((e,t)=>{De(e,2),ze(e,t)})(n,e),Li(this,Be(n))},this._awarenessUpdateHandler=({added:e,updated:t,removed:n},r)=>{const o=e.concat(t).concat(n),i=Te();De(i,1),ze(i,Ai(this.awareness,o)),Li(this,Be(i))},this._beforeUnloadHandler=()=>{Si(this.awareness,[e.clientID],"window unload"),Ri.forEach((e=>{e.disconnect()}))},"undefined"!=typeof window?window.addEventListener("beforeunload",this._beforeUnloadHandler):"undefined"!=typeof process&&process.on("exit",this._beforeUnloadHandler)}connect(){var e,t;this.doc.on("update",this._docUpdateHandler),this.awareness.on("update",this._awarenessUpdateHandler),Fi(this),e=this.name,t=this._bcSubscriber,bi(e).subs.add(t),this.bcconnected=!0,zi(this);const n=Te();De(n,0),_i(n,this.doc),Oi(this,Be(n));const r=Te();De(r,0),xi(r,this.doc),Oi(this,Be(r));const o=Te();De(o,3),Oi(this,Be(o));const i=Te();De(i,1),ze(i,Ai(this.awareness,[this.doc.clientID])),Oi(this,Be(i))}disconnect(){Bi.forEach((e=>{e.connected&&e.send({type:"unsubscribe",topics:[this.name]})})),Si(this.awareness,[this.doc.clientID],"disconnect");const e=Te();De(e,4),Ne(e,0),Le(e,this.peerId),Oi(this,Be(e)),((e,t)=>{const n=bi(e);n.subs.delete(t)&&0===n.subs.size&&(n.bc.close(),mi.delete(e))})(this.name,this._bcSubscriber),this.bcconnected=!1,this.doc.off("update",this._docUpdateHandler),this.awareness.off("update",this._awarenessUpdateHandler),this.webrtcConns.forEach((e=>e.destroy()))}destroy(){this.disconnect(),"undefined"!=typeof window?window.removeEventListener("beforeunload",this._beforeUnloadHandler):"undefined"!=typeof process&&process.off("exit",this._beforeUnloadHandler)}}const Vi=(e,t,n)=>{t.key?((e,t)=>{const n=Te();return He(n,e),Ei(Be(n),t)})(n,t.key).then((n=>{e.send({type:"publish",topic:t.name,data:Vt(n)})})):e.send({type:"publish",topic:t.name,data:n})};class Hi extends fi{constructor(e){super(e),this.providers=new Set,this.on("connect",(()=>{Ti(`connected (${e})`);const t=Array.from(Ri.keys());this.send({type:"subscribe",topics:t}),Ri.forEach((e=>Vi(this,e,{type:"announce",from:e.peerId})))})),this.on("message",(e=>{if("publish"===e.type){const t=e.topic,n=Ri.get(t);if(null==n||"string"!=typeof t)return;const r=e=>{const t=n.webrtcConns,r=n.peerId;if(null==e||e.from===r||void 0!==e.to&&e.to!==r||n.bcConns.has(e.from))return;const o=t.has(e.from)?()=>{}:()=>n.provider.emit("peers",[{removed:[],added:[e.from],webrtcPeers:Array.from(n.webrtcConns.keys()),bcPeers:Array.from(n.bcConns)}]);switch(e.type){case"announce":t.size<n.provider.maxConns&&(oe(t,e.from,(()=>new Pi(this,!0,e.from,n))),o());break;case"signal":if("offer"===e.signal.type){const n=t.get(e.from);if(n){const t=e.token,r=n.glareToken;if(r&&r>t)return void Ti("offer rejected: ",e.from);n.glareToken=void 0}}"answer"===e.signal.type&&(Ti("offer answered by: ",e.from),t.get(e.from).glareToken=void 0),e.to===r&&(oe(t,e.from,(()=>new Pi(this,!1,e.from,n))).peer.signal(e.signal),o())}};n.key?"string"==typeof e.data&&ji(Ht(e.data),n.key).then(r):r(e.data)}})),this.on("disconnect",(()=>Ti(`disconnect (${e})`)))}}class $i extends ue{constructor(e,t,{signaling:n=["wss://y-webrtc-eu.fly.dev"],password:r=null,awareness:o=new Ci(t),maxConns:i=20+de(15*gt()),filterBcConns:s=!0,peerOpts:a={}}={}){super(),this.roomName=e,this.doc=t,this.filterBcConns=s,this.awareness=o,this.shouldConnect=!1,this.signalingUrls=n,this.signalingConns=[],this.maxConns=i,this.peerOpts=a,this.key=r?((e,t)=>{const n=Ee(e).buffer,r=Ee(t).buffer;return crypto.subtle.importKey("raw",n,"PBKDF2",!1,["deriveKey"]).then((e=>crypto.subtle.deriveKey({name:"PBKDF2",salt:r,iterations:1e5,hash:"SHA-256"},e,{name:"AES-GCM",length:256},!0,["encrypt","decrypt"])))})(r,e):xt(null),this.room=null,this.key.then((n=>{this.room=((e,t,n,r)=>{if(Ri.has(n))throw Je(`A Yjs Doc connected to room "${n}" already exists!`);const o=new Ui(e,t,n,r);return Ri.set(n,o),o})(t,this,e,n),this.shouldConnect?this.room.connect():this.room.disconnect()})),this.connect(),this.destroy=this.destroy.bind(this),t.on("destroy",this.destroy)}get connected(){return null!==this.room&&this.shouldConnect}connect(){this.shouldConnect=!0,this.signalingUrls.forEach((e=>{const t=oe(Bi,e,(()=>new Hi(e)));this.signalingConns.push(t),t.providers.add(this)})),this.room&&this.room.connect()}disconnect(){this.shouldConnect=!1,this.signalingConns.forEach((e=>{e.providers.delete(this),0===e.providers.size&&(e.destroy(),Bi.delete(e.url))})),this.room&&this.room.disconnect()}destroy(){this.doc.off("destroy",this.destroy),this.key.then((()=>{this.room.destroy(),Ri.delete(this.roomName)})),super.destroy()}}function Wi(e){if(e.shouldConnect&&null===e.ws){const t=Math.floor(1e5+9e5*Math.random()),n=e.url,r=new window.EventSource((0,G.F)(n,{subscriber_id:t,action:"gutenberg_signaling_server"}));let o=null;r.onmessage=t=>{e.lastMessageReceived=Date.now();const n=t.data;if(n){const e=JSON.parse(n);Array.isArray(e)&&e.forEach(i)}},e.ws=r,e.connecting=!0,e.connected=!1;const i=t=>{t&&"pong"===t.type&&(clearTimeout(o),o=setTimeout(a,Gi/2)),e.emit("message",[t,e])},s=t=>{null!==e.ws&&(e.ws.close(),e.ws=null,e.connecting=!1,e.connected?(e.connected=!1,e.emit("disconnect",[{type:"disconnect",error:t},e])):e.unsuccessfulReconnects++),clearTimeout(o)},a=()=>{e.ws&&e.ws.readyState===window.EventSource.OPEN&&e.send({type:"ping"})};e.ws&&(e.ws.onclose=()=>{s(null)},e.ws.send=function(e){window.fetch(n,{body:new URLSearchParams({subscriber_id:t.toString(),action:"gutenberg_signaling_server",message:e}),method:"POST"}).catch((()=>{Ti("Error sending to server with message: "+e)}))}),r.onerror=()=>{},r.onopen=()=>{e.connected||r.readyState===window.EventSource.OPEN&&(e.lastMessageReceived=Date.now(),e.connecting=!1,e.connected=!0,e.unsuccessfulReconnects=0,e.emit("connect",[{type:"connect"},e]),o=setTimeout(a,Gi/2))}}}const Gi=3e4;class qi extends ue{constructor(e){super(),this.url=e,this.ws=null,this.binaryType=null,this.connected=!1,this.connecting=!1,this.unsuccessfulReconnects=0,this.lastMessageReceived=0,this.shouldConnect=!0,this._checkInterval=setInterval((()=>{this.connected&&Gi<Date.now()-this.lastMessageReceived&&this.ws&&this.ws.close()}),Gi/2),Wi(this),this.providers=new Set,function(e,t){e.on("connect",(()=>{Ti(`connected (${t})`);const n=Array.from(Ri.keys());e.send({type:"subscribe",topics:n}),Ri.forEach((t=>Vi(e,t,{type:"announce",from:t.peerId})))})),e.on("message",(t=>{if("publish"===t.type){const n=t.topic,r=Ri.get(n);if(null===r||"string"!=typeof n||void 0===r)return;const o=t=>{const n=r.webrtcConns,o=r.peerId;if(null===t||t.from===o||void 0!==t.to&&t.to!==o||r.bcConns.has(t.from))return;const i=n.has(t.from)?()=>{}:()=>r.provider.emit("peers",[{removed:[],added:[t.from],webrtcPeers:Array.from(r.webrtcConns.keys()),bcPeers:Array.from(r.bcConns)}]);switch(t.type){case"announce":n.size<r.provider.maxConns&&(oe(n,t.from,(()=>new Pi(e,!0,t.from,r))),i());break;case"signal":if("offer"===t.signal.type){const e=n.get(t.from);if(e){const n=t.token,r=e.glareToken;if(r&&r>n)return void Ti("offer rejected: ",t.from);e.glareToken=void 0}}if("answer"===t.signal.type){Ti("offer answered by: ",t.from);const e=n.get(t.from);e&&(e.glareToken=void 0)}t.to===o&&(oe(n,t.from,(()=>new Pi(e,!1,t.from,r))).peer.signal(t.signal),i())}};r.key?"string"==typeof t.data&&ji(Ht(t.data),r.key).then(o):o(t.data)}})),e.on("disconnect",(()=>Ti(`disconnect (${t})`)))}(this,e)}send(e){this.ws&&this.ws.send(JSON.stringify(e))}destroy(){clearInterval(this._checkInterval),this.disconnect(),super.destroy()}disconnect(){this.shouldConnect=!1,null!==this.ws&&this.ws.close()}connect(){this.shouldConnect=!0,this.connected||null!==this.ws||Wi(this)}}class Ki extends $i{connect(){this.shouldConnect=!0,this.signalingUrls.forEach((e=>{const t=oe(Bi,e,e.startsWith("ws://")||e.startsWith("wss://")?()=>new Hi(e):()=>new qi(e));this.signalingConns.push(t),t.providers.add(this)})),this.room&&this.room.connect()}}let Yi;function Ji(){return Yi||(Yi=ei(hi,function({signaling:e,password:t}){return function(n,r,o){return new Ki(`${r}-${n}`,o,{signaling:e,password:t}),Promise.resolve((()=>!0))}}({signaling:[window?.wp?.ajax?.settings?.url],password:window?.__experimentalCollaborativeEditingSecret}))),Yi}function Xi(e,t){return{type:"RECEIVE_USER_QUERY",users:Array.isArray(t)?t:[t],queryID:e}}function Zi(e){return{type:"RECEIVE_CURRENT_USER",currentUser:e}}function Qi(e){return{type:"ADD_ENTITIES",entities:e}}function es(e,t,n,r,o=!1,i,s){let a;return"postType"===e&&(n=(Array.isArray(n)?n:[n]).map((e=>"auto-draft"===e.status?{...e,title:""}:e))),a=r?function(e,t={},n,r){return{...J(e,n,r),query:t}}(n,r,i,s):J(n,i,s),{...a,kind:e,name:t,invalidateCache:o}}function ts(e){return{type:"RECEIVE_CURRENT_THEME",currentTheme:e}}function ns(e){return{type:"RECEIVE_CURRENT_GLOBAL_STYLES_ID",id:e}}function rs(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLES",stylesheet:e,globalStyles:t}}function os(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS",stylesheet:e,variations:t}}function is(){return(0,q.default)("wp.data.dispatch( 'core' ).receiveThemeSupports",{since:"5.9"}),{type:"DO_NOTHING"}}function ss(e,t){return(0,q.default)("wp.data.dispatch( 'core' ).receiveThemeGlobalStyleRevisions()",{since:"6.5.0",alternative:"wp.data.dispatch( 'core' ).receiveRevisions"}),{type:"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS",currentId:e,revisions:t}}function as(e,t){return{type:"RECEIVE_EMBED_PREVIEW",url:e,preview:t}}const ls=(e,t,n,r,{__unstableFetch:o=E.default,throwOnError:i=!1}={})=>async({dispatch:s})=>{const a=(await s(Ns(e,t))).find((n=>n.kind===e&&n.name===t));let l,c=!1;if(!a||a?.__experimentalNoFetch)return;const u=await s.__unstableAcquireStoreLock(te,["entities","records",e,t,n],{exclusive:!0});try{s({type:"DELETE_ENTITY_RECORD_START",kind:e,name:t,recordId:n});let u=!1;try{let i=`${a.baseURL}/${n}`;r&&(i=(0,G.F)(i,r)),c=await o({path:i,method:"DELETE"}),await s(function(e,t,n,r=!1){return{type:"REMOVE_ITEMS",itemIds:Array.isArray(n)?n:[n],kind:e,name:t,invalidateCache:r}}(e,t,n,!0))}catch(e){u=!0,l=e}if(s({type:"DELETE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:n,error:l}),u&&i)throw l;return c}finally{s.__unstableReleaseStoreLock(u)}},cs=(e,t,n,r,o={})=>({select:i,dispatch:s})=>{const a=i.getEntityConfig(e,t);if(!a)throw new Error(`The entity being edited (${e}, ${t}) does not have a loaded config.`);const{mergedEdits:l={}}=a,c=i.getRawEntityRecord(e,t,n),u=i.getEditedEntityRecord(e,t,n),d={kind:e,name:t,recordId:n,edits:Object.keys(r).reduce(((e,t)=>{const n=c[t],o=u[t],i=l[t]?{...o,...r[t]}:r[t];return e[t]=M()(n,i)?void 0:i,e}),{})};if(window.__experimentalEnableSync&&a.syncConfig){if(globalThis.IS_GUTENBERG_PLUGIN){const e=a.getSyncObjectId(n);Ji().update(a.syncObjectType+"--edit",e,d.edits)}}else o.undoIgnore||i.getUndoManager().addRecord([{id:{kind:e,name:t,recordId:n},changes:Object.keys(r).reduce(((e,t)=>(e[t]={from:u[t],to:r[t]},e)),{})}],o.isCached),s({type:"EDIT_ENTITY_RECORD",...d})},us=()=>({select:e,dispatch:t})=>{const n=e.getUndoManager().undo();n&&t({type:"UNDO",record:n})},ds=()=>({select:e,dispatch:t})=>{const n=e.getUndoManager().redo();n&&t({type:"REDO",record:n})},hs=()=>({select:e})=>{e.getUndoManager().addRecord()},ps=(e,t,n,{isAutosave:r=!1,__unstableFetch:o=E.default,throwOnError:i=!1}={})=>async({select:s,resolveSelect:a,dispatch:l})=>{const c=(await l(Ns(e,t))).find((n=>n.kind===e&&n.name===t));if(!c||c?.__experimentalNoFetch)return;const u=c.key||ks,d=n[u],h=await l.__unstableAcquireStoreLock(te,["entities","records",e,t,d||(0,W.A)()],{exclusive:!0});try{for(const[r,o]of Object.entries(n))if("function"==typeof o){const i=o(s.getEditedEntityRecord(e,t,d));l.editEntityRecord(e,t,d,{[r]:i},{undoIgnore:!0}),n[r]=i}let u,h;l({type:"SAVE_ENTITY_RECORD_START",kind:e,name:t,recordId:d,isAutosave:r});let p=!1;try{const i=`${c.baseURL}${d?"/"+d:""}`,h=s.getRawEntityRecord(e,t,d);if(r){const r=s.getCurrentUser(),c=r?r.id:void 0,d=await a.getAutosave(h.type,h.id,c);let p={...h,...d,...n};if(p=Object.keys(p).reduce(((e,t)=>(["title","excerpt","content","meta"].includes(t)&&(e[t]=p[t]),e)),{status:"auto-draft"===p.status?"draft":void 0}),u=await o({path:`${i}/autosaves`,method:"POST",data:p}),h.id===u.id){let n={...h,...p,...u};n=Object.keys(n).reduce(((e,t)=>(["title","excerpt","content"].includes(t)?e[t]=n[t]:e[t]="status"===t?"auto-draft"===h.status&&"draft"===n.status?n.status:h.status:h[t],e)),{}),l.receiveEntityRecords(e,t,n,void 0,!0)}else l.receiveAutosaves(h.id,u)}else{let r=n;c.__unstablePrePersist&&(r={...r,...c.__unstablePrePersist(h,r)}),u=await o({path:i,method:d?"PUT":"POST",data:r}),l.receiveEntityRecords(e,t,u,void 0,!0,r)}}catch(e){p=!0,h=e}if(l({type:"SAVE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:d,error:h,isAutosave:r}),p&&i)throw h;return u}finally{l.__unstableReleaseStoreLock(h)}},fs=e=>async({dispatch:t})=>{const n=Q(),r={saveEntityRecord:(e,r,o,i)=>n.add((n=>t.saveEntityRecord(e,r,o,{...i,__unstableFetch:n}))),saveEditedEntityRecord:(e,r,o,i)=>n.add((n=>t.saveEditedEntityRecord(e,r,o,{...i,__unstableFetch:n}))),deleteEntityRecord:(e,r,o,i,s)=>n.add((n=>t.deleteEntityRecord(e,r,o,i,{...s,__unstableFetch:n})))},o=e.map((e=>e(r))),[,...i]=await Promise.all([n.run(),...o]);return i},ms=(e,t,n,r)=>async({select:o,dispatch:i})=>{if(!o.hasEditsForEntityRecord(e,t,n))return;const s=(await i(Ns(e,t))).find((n=>n.kind===e&&n.name===t));if(!s)return;const a=s.key||ks,l=o.getEntityRecordNonTransientEdits(e,t,n),c={[a]:n,...l};return await i.saveEntityRecord(e,t,c,r)},gs=(e,t,n,r,o)=>async({select:i,dispatch:s})=>{if(!i.hasEditsForEntityRecord(e,t,n))return;const a=i.getEntityRecordNonTransientEdits(e,t,n),l={};for(const e of r)K(l,e,Y(a,e));const c=(await s(Ns(e,t))).find((n=>n.kind===e&&n.name===t));return n&&(l[c?.key||ks]=n),await s.saveEntityRecord(e,t,l,o)};function bs(e){return(0,q.default)("wp.data.dispatch( 'core' ).receiveUploadPermissions",{since:"5.9",alternative:"receiveUserPermission"}),ys("create/media",e)}function ys(e,t){return{type:"RECEIVE_USER_PERMISSION",key:e,isAllowed:t}}function vs(e,t){return{type:"RECEIVE_AUTOSAVES",postId:e,autosaves:Array.isArray(t)?t:[t]}}function _s(e){return{type:"RECEIVE_NAVIGATION_FALLBACK_ID",fallbackId:e}}function xs(e,t){return{type:"RECEIVE_DEFAULT_TEMPLATE",query:e,templateId:t}}const ws=(e,t,n,r,o,i=!1,s)=>async({dispatch:a})=>{const l=(await a(Ns(e,t))).find((n=>n.kind===e&&n.name===t));a({type:"RECEIVE_ITEM_REVISIONS",key:l&&l?.revisionKey?l.revisionKey:ks,items:Array.isArray(r)?r:[r],recordKey:n,meta:s,query:o,kind:e,name:t,invalidateCache:i})},ks="id",Cs=["title","excerpt","content"],Ss=[{label:(0,H.__)("Base"),kind:"root",name:"__unstableBase",baseURL:"/",baseURLParams:{_fields:["description","gmt_offset","home","name","site_icon","site_icon_url","site_logo","timezone_string","url"].join(",")},plural:"__unstableBases",syncConfig:{fetch:async()=>(0,E.default)({path:"/"}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach((([e,t])=>{n.get(e)!==t&&n.set(e,t)}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/base",getSyncObjectId:()=>"index"},{label:(0,H.__)("Post Type"),name:"postType",kind:"root",key:"slug",baseURL:"/wp/v2/types",baseURLParams:{context:"edit"},plural:"postTypes",syncConfig:{fetch:async e=>(0,E.default)({path:`/wp/v2/types/${e}?context=edit`}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach((([e,t])=>{n.get(e)!==t&&n.set(e,t)}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/postType",getSyncObjectId:e=>e},{name:"media",kind:"root",baseURL:"/wp/v2/media",baseURLParams:{context:"edit"},plural:"mediaItems",label:(0,H.__)("Media"),rawAttributes:["caption","title","description"],supportsPagination:!0},{name:"taxonomy",kind:"root",key:"slug",baseURL:"/wp/v2/taxonomies",baseURLParams:{context:"edit"},plural:"taxonomies",label:(0,H.__)("Taxonomy")},{name:"sidebar",kind:"root",baseURL:"/wp/v2/sidebars",baseURLParams:{context:"edit"},plural:"sidebars",transientEdits:{blocks:!0},label:(0,H.__)("Widget areas")},{name:"widget",kind:"root",baseURL:"/wp/v2/widgets",baseURLParams:{context:"edit"},plural:"widgets",transientEdits:{blocks:!0},label:(0,H.__)("Widgets")},{name:"widgetType",kind:"root",baseURL:"/wp/v2/widget-types",baseURLParams:{context:"edit"},plural:"widgetTypes",label:(0,H.__)("Widget types")},{label:(0,H.__)("User"),name:"user",kind:"root",baseURL:"/wp/v2/users",baseURLParams:{context:"edit"},plural:"users"},{name:"comment",kind:"root",baseURL:"/wp/v2/comments",baseURLParams:{context:"edit"},plural:"comments",label:(0,H.__)("Comment")},{name:"menu",kind:"root",baseURL:"/wp/v2/menus",baseURLParams:{context:"edit"},plural:"menus",label:(0,H.__)("Menu")},{name:"menuItem",kind:"root",baseURL:"/wp/v2/menu-items",baseURLParams:{context:"edit"},plural:"menuItems",label:(0,H.__)("Menu Item"),rawAttributes:["title"]},{name:"menuLocation",kind:"root",baseURL:"/wp/v2/menu-locations",baseURLParams:{context:"edit"},plural:"menuLocations",label:(0,H.__)("Menu Location"),key:"name"},{label:(0,H.__)("Global Styles"),name:"globalStyles",kind:"root",baseURL:"/wp/v2/global-styles",baseURLParams:{context:"edit"},plural:"globalStylesVariations",getTitle:e=>e?.title?.rendered||e?.title,getRevisionsUrl:(e,t)=>`/wp/v2/global-styles/${e}/revisions${t?"/"+t:""}`,supportsPagination:!0},{label:(0,H.__)("Themes"),name:"theme",kind:"root",baseURL:"/wp/v2/themes",baseURLParams:{context:"edit"},plural:"themes",key:"stylesheet"},{label:(0,H.__)("Plugins"),name:"plugin",kind:"root",baseURL:"/wp/v2/plugins",baseURLParams:{context:"edit"},plural:"plugins",key:"plugin"},{label:(0,H.__)("Status"),name:"status",kind:"root",baseURL:"/wp/v2/statuses",baseURLParams:{context:"edit"},plural:"statuses",key:"slug"}],As=[{kind:"postType",loadEntities:async function(){const e=await(0,E.default)({path:"/wp/v2/types?context=view"});return Object.entries(null!=e?e:{}).map((([e,t])=>{var n;const r=["wp_template","wp_template_part"].includes(e),o=null!==(n=t?.rest_namespace)&&void 0!==n?n:"wp/v2";return{kind:"postType",baseURL:`/${o}/${t.rest_base}`,baseURLParams:{context:"edit"},name:e,label:t.name,transientEdits:{blocks:!0,selection:!0},mergedEdits:{meta:!0},rawAttributes:Cs,getTitle:e=>{var t;return e?.title?.rendered||e?.title||(r?(0,U.D)(null!==(t=e.slug)&&void 0!==t?t:""):String(e.id))},__unstablePrePersist:r?void 0:Es,__unstable_rest_base:t.rest_base,syncConfig:{fetch:async e=>(0,E.default)({path:`/${o}/${t.rest_base}/${e}?context=edit`}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach((([e,t])=>{"function"!=typeof t&&("blocks"===e&&(Is.has(t)||Is.set(t,Ts(t)),t=Is.get(t)),n.get(e)!==t&&n.set(e,t))}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"postType/"+t.name,getSyncObjectId:e=>e,supportsPagination:!0,getRevisionsUrl:(e,n)=>`/${o}/${t.rest_base}/${e}/revisions${n?"/"+n:""}`,revisionKey:r?"wp_id":ks}}))}},{kind:"taxonomy",loadEntities:async function(){const e=await(0,E.default)({path:"/wp/v2/taxonomies?context=view"});return Object.entries(null!=e?e:{}).map((([e,t])=>{var n;return{kind:"taxonomy",baseURL:`/${null!==(n=t?.rest_namespace)&&void 0!==n?n:"wp/v2"}/${t.rest_base}`,baseURLParams:{context:"edit"},name:e,label:t.name}}))}},{kind:"root",name:"site",plural:"sites",loadEntities:async function(){var e;const t={label:(0,H.__)("Site"),name:"site",kind:"root",baseURL:"/wp/v2/settings",syncConfig:{fetch:async()=>(0,E.default)({path:"/wp/v2/settings"}),applyChangesToDoc:(e,t)=>{const n=e.getMap("document");Object.entries(t).forEach((([e,t])=>{n.get(e)!==t&&n.set(e,t)}))},fromCRDTDoc:e=>e.getMap("document").toJSON()},syncObjectType:"root/site",getSyncObjectId:()=>"index",meta:{}},n=await(0,E.default)({path:t.baseURL,method:"OPTIONS"}),r={};return Object.entries(null!==(e=n?.schema?.properties)&&void 0!==e?e:{}).forEach((([e,t])=>{"object"==typeof t&&t.title&&(r[e]=t.title)})),[{...t,meta:{labels:r}}]}}],Es=(e,t)=>{const n={};return"auto-draft"===e?.status&&(t.status||n.status||(n.status="draft"),t.title&&"Auto Draft"!==t.title||n.title||e?.title&&"Auto Draft"!==e?.title||(n.title="")),n},Is=new WeakMap;function js(e){const t={...e};for(const[n,r]of Object.entries(e))r instanceof $.RichTextData&&(t[n]=r.valueOf());return t}function Ts(e){return e.map((e=>{const{innerBlocks:t,attributes:n,...r}=e;return{...r,attributes:js(n),innerBlocks:Ts(t)}}))}const Bs=(e,t,n="get")=>`${n}${"root"===e?"":(0,V.fL)(e)}${(0,V.fL)(t)}`;function Rs(e){e.forEach((({syncObjectType:e,syncConfig:t})=>{Ji().register(e,t);const n={...t};delete n.fetch,Ji().register(e+"--edit",n)}))}const Ns=(e,t)=>async({select:n,dispatch:r})=>{let o=n.getEntitiesConfig(e);const i=!!n.getEntityConfig(e,t);if(o?.length>0&&i)return window.__experimentalEnableSync&&globalThis.IS_GUTENBERG_PLUGIN&&Rs(o),o;const s=As.find((n=>t&&n.name?n.kind===e&&n.name===t:n.kind===e));return s?(o=await s.loadEntities(),window.__experimentalEnableSync&&globalThis.IS_GUTENBERG_PLUGIN&&Rs(o),r(Qi(o)),o):[]},Ds=function(e){return"string"==typeof e?e.split(","):Array.isArray(e)?e:null},Ms=function(e){const t=new WeakMap;return n=>{let r;return t.has(n)?r=t.get(n):(r=e(n),null!==n&&"object"==typeof n&&t.set(n,r)),r}}((function(e){const t={stableKey:"",page:1,perPage:10,fields:null,include:null,context:"default"},n=Object.keys(e).sort();for(let i=0;i<n.length;i++){const s=n[i];let a=e[s];switch(s){case"page":t[s]=Number(a);break;case"per_page":t.perPage=Number(a);break;case"context":t.context=a;break;default:var r,o;"_fields"===s&&(t.fields=null!==(r=Ds(a))&&void 0!==r?r:[],a=t.fields.join()),"include"===s&&("number"==typeof a&&(a=a.toString()),t.include=(null!==(o=Ds(a))&&void 0!==o?o:[]).map(Number),a=t.include.join()),t.stableKey+=(t.stableKey?"&":"")+(0,G.F)("",{[s]:a}).slice(1)}}return t}));function Ps(e){const{query:t}=e;return t?Ms(t).context:"default"}function Os(e,t,n,r){var o;if(1===n&&-1===r)return t;const i=(n-1)*r,s=Math.max(null!==(o=e?.length)&&void 0!==o?o:0,i+t.length),a=new Array(s);for(let n=0;n<s;n++){const o=n>=i&&n<i+r;a[n]=o?t[n-i]:e?.[n]}return a}function Ls(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.some((t=>Number.isInteger(t)?t===+e:t===e)))))}const Fs=(0,P.A)([L((e=>"query"in e)),F((e=>e.query?{...e,...Ms(e.query)}:e)),z("context"),z("stableKey")])(((e={},t)=>{const{type:n,page:r,perPage:o,key:i=ks}=t;return"RECEIVE_ITEMS"!==n?e:{itemIds:Os(e?.itemIds||[],t.items.map((e=>e[i])),r,o),meta:t.meta}})),zs=(0,N.combineReducers)({items:function(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const n=Ps(t),r=t.key||ks;return{...e,[n]:{...e[n],...t.items.reduce(((t,o)=>{const i=o[r];return t[i]=function(e,t){if(!e)return t;let n=!1;const r={};for(const o in t)M()(e[o],t[o])?r[o]=e[o]:(n=!0,r[o]=t[o]);if(!n)return e;for(const t in e)r.hasOwnProperty(t)||(r[t]=e[t]);return r}(e?.[n]?.[i],o),t}),{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map((([e,n])=>[e,Ls(n,t.itemIds)])))}return e},itemIsComplete:function(e={},t){switch(t.type){case"RECEIVE_ITEMS":{const n=Ps(t),{query:r,key:o=ks}=t,i=r?Ms(r):{},s=!r||!Array.isArray(i.fields);return{...e,[n]:{...e[n],...t.items.reduce(((t,r)=>{const i=r[o];return t[i]=e?.[n]?.[i]||s,t}),{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map((([e,n])=>[e,Ls(n,t.itemIds)])))}return e},queries:(e={},t)=>{switch(t.type){case"RECEIVE_ITEMS":return Fs(e,t);case"REMOVE_ITEMS":const n=t.itemIds.reduce(((e,t)=>(e[t]=!0,e)),{});return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,Object.fromEntries(Object.entries(t).map((([e,t])=>[e,{...t,itemIds:t.itemIds.filter((e=>!n[e]))}])))])));default:return e}}}),Us=e=>(t,n)=>{if("UNDO"===n.type||"REDO"===n.type){const{record:r}=n;let o=t;return r.forEach((({id:{kind:t,name:r,recordId:i},changes:s})=>{o=e(o,{type:"EDIT_ENTITY_RECORD",kind:t,name:r,recordId:i,edits:Object.entries(s).reduce(((e,[t,r])=>(e[t]="UNDO"===n.type?r.from:r.to,e)),{})})})),o}return e(t,n)};function Vs(e){return(0,P.A)([Us,L((t=>t.name&&t.kind&&t.name===e.name&&t.kind===e.kind)),F((t=>({key:e.key||ks,...t})))])((0,N.combineReducers)({queriedData:zs,edits:(e={},t)=>{var n;switch(t.type){case"RECEIVE_ITEMS":if("default"!==(null!==(n=t?.query?.context)&&void 0!==n?n:"default"))return e;const r={...e};for(const e of t.items){const n=e[t.key],o=r[n];if(!o)continue;const i=Object.keys(o).reduce(((n,r)=>{var i;return M()(o[r],null!==(i=e[r]?.raw)&&void 0!==i?i:e[r])||t.persistedEdits&&M()(o[r],t.persistedEdits[r])||(n[r]=o[r]),n}),{});Object.keys(i).length?r[n]=i:delete r[n]}return r;case"EDIT_ENTITY_RECORD":const o={...e[t.recordId],...t.edits};return Object.keys(o).forEach((e=>{void 0===o[e]&&delete o[e]})),{...e,[t.recordId]:o}}return e},saving:(e={},t)=>{switch(t.type){case"SAVE_ENTITY_RECORD_START":case"SAVE_ENTITY_RECORD_FINISH":return{...e,[t.recordId]:{pending:"SAVE_ENTITY_RECORD_START"===t.type,error:t.error,isAutosave:t.isAutosave}}}return e},deleting:(e={},t)=>{switch(t.type){case"DELETE_ENTITY_RECORD_START":case"DELETE_ENTITY_RECORD_FINISH":return{...e,[t.recordId]:{pending:"DELETE_ENTITY_RECORD_START"===t.type,error:t.error}}}return e},revisions:(e={},t)=>{if("RECEIVE_ITEM_REVISIONS"===t.type){const n=t.recordKey;delete t.recordKey;const r=zs(e[n],{...t,type:"RECEIVE_ITEMS"});return{...e,[n]:r}}return"REMOVE_ITEMS"===t.type?Object.fromEntries(Object.entries(e).filter((([e])=>!t.itemIds.some((t=>Number.isInteger(t)?t===+e:t===e))))):e}}))}const Hs=(0,N.combineReducers)({terms:function(e={},t){return"RECEIVE_TERMS"===t.type?{...e,[t.taxonomy]:t.terms}:e},users:function(e={byId:{},queries:{}},t){return"RECEIVE_USER_QUERY"===t.type?{byId:{...e.byId,...t.users.reduce(((e,t)=>({...e,[t.id]:t})),{})},queries:{...e.queries,[t.queryID]:t.users.map((e=>e.id))}}:e},currentTheme:function(e=void 0,t){return"RECEIVE_CURRENT_THEME"===t.type?t.currentTheme.stylesheet:e},currentGlobalStylesId:function(e=void 0,t){return"RECEIVE_CURRENT_GLOBAL_STYLES_ID"===t.type?t.id:e},currentUser:function(e={},t){return"RECEIVE_CURRENT_USER"===t.type?t.currentUser:e},themeGlobalStyleVariations:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS"===t.type?{...e,[t.stylesheet]:t.variations}:e},themeBaseGlobalStyles:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLES"===t.type?{...e,[t.stylesheet]:t.globalStyles}:e},themeGlobalStyleRevisions:function(e={},t){return"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS"===t.type?{...e,[t.currentId]:t.revisions}:e},taxonomies:function(e=[],t){return"RECEIVE_TAXONOMIES"===t.type?t.taxonomies:e},entities:(e={},t)=>{const n=function(e=Ss,t){return"ADD_ENTITIES"===t.type?[...e,...t.entities]:e}(e.config,t);let r=e.reducer;if(!r||n!==e.config){const e=n.reduce(((e,t)=>{const{kind:n}=t;return e[n]||(e[n]=[]),e[n].push(t),e}),{});r=(0,N.combineReducers)(Object.entries(e).reduce(((e,[t,n])=>{const r=(0,N.combineReducers)(n.reduce(((e,t)=>({...e,[t.name]:Vs(t)})),{}));return e[t]=r,e}),{}))}const o=r(e.records,t);return o===e.records&&n===e.config&&r===e.reducer?e:{reducer:r,records:o,config:n}},editsReference:function(e={},t){switch(t.type){case"EDIT_ENTITY_RECORD":case"UNDO":case"REDO":return{}}return e},undoManager:function(e=(0,O.u)()){return e},embedPreviews:function(e={},t){if("RECEIVE_EMBED_PREVIEW"===t.type){const{url:n,preview:r}=t;return{...e,[n]:r}}return e},userPermissions:function(e={},t){return"RECEIVE_USER_PERMISSION"===t.type?{...e,[t.key]:t.isAllowed}:e},autosaves:function(e={},t){if("RECEIVE_AUTOSAVES"===t.type){const{postId:n,autosaves:r}=t;return{...e,[n]:r}}return e},blockPatterns:function(e=[],t){return"RECEIVE_BLOCK_PATTERNS"===t.type?t.patterns:e},blockPatternCategories:function(e=[],t){return"RECEIVE_BLOCK_PATTERN_CATEGORIES"===t.type?t.categories:e},userPatternCategories:function(e=[],t){return"RECEIVE_USER_PATTERN_CATEGORIES"===t.type?t.patternCategories:e},navigationFallbackId:function(e=null,t){return"RECEIVE_NAVIGATION_FALLBACK_ID"===t.type?t.fallbackId:e},defaultTemplates:function(e={},t){return"RECEIVE_DEFAULT_TEMPLATE"===t.type?{...e,[JSON.stringify(t.query)]:t.templateId}:e}});var $s=n(4075),Ws=n(74661),Gs=n(34236),qs=n.n(Gs);const Ks=new WeakMap,Ys=(0,Ws.A)(((e,t={})=>{let n=Ks.get(e);if(n){const e=n.get(t);if(void 0!==e)return e}else n=new(qs()),Ks.set(e,n);const r=function(e,t){const{stableKey:n,page:r,perPage:o,include:i,fields:s,context:a}=Ms(t);let l;if(e.queries?.[a]?.[n]&&(l=e.queries[a][n].itemIds),!l)return null;const c=-1===o?0:(r-1)*o,u=-1===o?l.length:Math.min(c+o,l.length),d=[];for(let t=c;t<u;t++){const n=l[t];if(Array.isArray(i)&&!i.includes(n))continue;if(void 0===n)continue;if(!e.items[a]?.hasOwnProperty(n))return null;const r=e.items[a][n];let o;if(Array.isArray(s)){o={};for(let e=0;e<s.length;e++){const t=s[e].split(".");let n=r;t.forEach((e=>{n=n?.[e]})),K(o,t,n)}}else{if(!e.itemIsComplete[a]?.[n])return null;o=r}d.push(o)}return d}(e,t);return n.set(t,r),r}));function Js(e,t={}){var n;const{stableKey:r,context:o}=Ms(t);return null!==(n=e.queries?.[o]?.[r]?.meta?.totalItems)&&void 0!==n?n:null}const Xs={},Zs=(0,$s.N)((e=>(t,n)=>e(te).isResolving("getEmbedPreview",[n])));function Qs(e,t){(0,q.default)("select( 'core' ).getAuthors()",{since:"5.9",alternative:"select( 'core' ).getUsers({ who: 'authors' })"});const n=(0,G.F)("/wp/v2/users/?who=authors&per_page=100",t);return ta(e,n)}function ea(e){return e.currentUser}const ta=(0,Ws.A)(((e,t)=>{var n;return(null!==(n=e.users.queries[t])&&void 0!==n?n:[]).map((t=>e.users.byId[t]))}),((e,t)=>[e.users.queries[t],e.users.byId]));function na(e,t){return(0,q.default)("wp.data.select( 'core' ).getEntitiesByKind()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntitiesConfig()"}),ra(e,t)}const ra=(0,Ws.A)(((e,t)=>e.entities.config.filter((e=>e.kind===t))),((e,t)=>e.entities.config));function oa(e,t,n){return(0,q.default)("wp.data.select( 'core' ).getEntity()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntityConfig()"}),ia(e,t,n)}function ia(e,t,n){return e.entities.config?.find((e=>e.kind===t&&e.name===n))}const sa=(0,Ws.A)(((e,t,n,r,o)=>{var i;const s=e.entities.records?.[t]?.[n]?.queriedData;if(!s)return;const a=null!==(i=o?.context)&&void 0!==i?i:"default";if(void 0===o){if(!s.itemIsComplete[a]?.[r])return;return s.items[a][r]}const l=s.items[a]?.[r];if(l&&o._fields){var c;const e={},t=null!==(c=Ds(o._fields))&&void 0!==c?c:[];for(let n=0;n<t.length;n++){const r=t[n].split(".");let o=l;r.forEach((e=>{o=o?.[e]})),K(e,r,o)}return e}return l}),((e,t,n,r,o)=>{var i;const s=null!==(i=o?.context)&&void 0!==i?i:"default";return[e.entities.records?.[t]?.[n]?.queriedData?.items[s]?.[r],e.entities.records?.[t]?.[n]?.queriedData?.itemIsComplete[s]?.[r]]}));function aa(e,t,n,r){return sa(e,t,n,r)}sa.__unstableNormalizeArgs=e=>{const t=[...e],n=t?.[2];return t[2]=function(e){return/^\s*\d+\s*$/.test(e)}(n)?Number(n):n,t};const la=(0,Ws.A)(((e,t,n,r)=>{const o=sa(e,t,n,r);return o&&Object.keys(o).reduce(((r,i)=>{var s;return!function(e,t){return(e.rawAttributes||[]).includes(t)}(ia(e,t,n),i)?r[i]=o[i]:r[i]=null!==(s=o[i]?.raw)&&void 0!==s?s:o[i],r}),{})}),((e,t,n,r,o)=>{var i;const s=null!==(i=o?.context)&&void 0!==i?i:"default";return[e.entities.config,e.entities.records?.[t]?.[n]?.queriedData?.items[s]?.[r],e.entities.records?.[t]?.[n]?.queriedData?.itemIsComplete[s]?.[r]]}));function ca(e,t,n,r){return Array.isArray(ua(e,t,n,r))}const ua=(e,t,n,r)=>{const o=e.entities.records?.[t]?.[n]?.queriedData;return o?Ys(o,r):null},da=(e,t,n,r)=>{const o=e.entities.records?.[t]?.[n]?.queriedData;return o?Js(o,r):null},ha=(e,t,n,r)=>{const o=e.entities.records?.[t]?.[n]?.queriedData;if(!o)return null;if(-1===r.per_page)return 1;const i=Js(o,r);return i?r.per_page?Math.ceil(i/r.per_page):function(e,t={}){var n;const{stableKey:r,context:o}=Ms(t);return null!==(n=e.queries?.[o]?.[r]?.meta?.totalPages)&&void 0!==n?n:null}(o,r):i},pa=(0,Ws.A)((e=>{const{entities:{records:t}}=e,n=[];return Object.keys(t).forEach((r=>{Object.keys(t[r]).forEach((o=>{const i=Object.keys(t[r][o].edits).filter((t=>sa(e,r,o,t)&&ba(e,r,o,t)));if(i.length){const t=ia(e,r,o);i.forEach((i=>{const s=ya(e,r,o,i);n.push({key:s?s[t.key||ks]:void 0,title:t?.getTitle?.(s)||"",name:o,kind:r})}))}}))})),n}),(e=>[e.entities.records])),fa=(0,Ws.A)((e=>{const{entities:{records:t}}=e,n=[];return Object.keys(t).forEach((r=>{Object.keys(t[r]).forEach((o=>{const i=Object.keys(t[r][o].saving).filter((t=>_a(e,r,o,t)));if(i.length){const t=ia(e,r,o);i.forEach((i=>{const s=ya(e,r,o,i);n.push({key:s?s[t.key||ks]:void 0,title:t?.getTitle?.(s)||"",name:o,kind:r})}))}}))})),n}),(e=>[e.entities.records]));function ma(e,t,n,r){return e.entities.records?.[t]?.[n]?.edits?.[r]}const ga=(0,Ws.A)(((e,t,n,r)=>{const{transientEdits:o}=ia(e,t,n)||{},i=ma(e,t,n,r)||{};return o?Object.keys(i).reduce(((e,t)=>(o[t]||(e[t]=i[t]),e)),{}):i}),((e,t,n,r)=>[e.entities.config,e.entities.records?.[t]?.[n]?.edits?.[r]]));function ba(e,t,n,r){return _a(e,t,n,r)||Object.keys(ga(e,t,n,r)).length>0}const ya=(0,Ws.A)(((e,t,n,r)=>{const o=la(e,t,n,r),i=ma(e,t,n,r);return!(!o&&!i)&&{...o,...i}}),((e,t,n,r,o)=>{var i;const s=null!==(i=o?.context)&&void 0!==i?i:"default";return[e.entities.config,e.entities.records?.[t]?.[n]?.queriedData.items[s]?.[r],e.entities.records?.[t]?.[n]?.queriedData.itemIsComplete[s]?.[r],e.entities.records?.[t]?.[n]?.edits?.[r]]}));function va(e,t,n,r){var o;const{pending:i,isAutosave:s}=null!==(o=e.entities.records?.[t]?.[n]?.saving?.[r])&&void 0!==o?o:{};return Boolean(i&&s)}function _a(e,t,n,r){var o;return null!==(o=e.entities.records?.[t]?.[n]?.saving?.[r]?.pending)&&void 0!==o&&o}function xa(e,t,n,r){var o;return null!==(o=e.entities.records?.[t]?.[n]?.deleting?.[r]?.pending)&&void 0!==o&&o}function wa(e,t,n,r){return e.entities.records?.[t]?.[n]?.saving?.[r]?.error}function ka(e,t,n,r){return e.entities.records?.[t]?.[n]?.deleting?.[r]?.error}function Ca(e){(0,q.default)("select( 'core' ).getUndoEdit()",{since:"6.3"})}function Sa(e){(0,q.default)("select( 'core' ).getRedoEdit()",{since:"6.3"})}function Aa(e){return e.undoManager.hasUndo()}function Ea(e){return e.undoManager.hasRedo()}function Ia(e){return e.currentTheme?sa(e,"root","theme",e.currentTheme):null}function ja(e){return e.currentGlobalStylesId}function Ta(e){var t;return null!==(t=Ia(e)?.theme_supports)&&void 0!==t?t:Xs}function Ba(e,t){return e.embedPreviews[t]}function Ra(e,t){const n=e.embedPreviews[t],r='<a href="'+t+'">'+t+"</a>";return!!n&&n.html===r}function Na(e,t,n,r){const o=[t,n,r].filter(Boolean).join("/");return e.userPermissions[o]}function Da(e,t,n,r){const o=ia(e,t,n);return!!o&&Na(e,"update",o.__unstable_rest_base,r)}function Ma(e,t,n){return e.autosaves[n]}function Pa(e,t,n,r){if(void 0===r)return;const o=e.autosaves[n];return o?.find((e=>e.author===r))}const Oa=(0,$s.N)((e=>(t,n,r)=>e(te).hasFinishedResolution("getAutosaves",[n,r])));function La(e){return e.editsReference}function Fa(e,t){const n=ua(e,"postType","wp_template",{"find-template":t});return n?.length?ya(e,"postType","wp_template",n[0].id):null}function za(e){const t=Ia(e);return t?e.themeBaseGlobalStyles[t.stylesheet]:null}function Ua(e){const t=Ia(e);return t?e.themeGlobalStyleVariations[t.stylesheet]:null}function Va(e){return e.blockPatterns}function Ha(e){return e.blockPatternCategories}function $a(e){return e.userPatternCategories}function Wa(e){(0,q.default)("select( 'core' ).getCurrentThemeGlobalStylesRevisions()",{since:"6.5.0",alternative:"select( 'core' ).getRevisions( 'root', 'globalStyles', ${ recordKey } )"});const t=ja(e);return t?e.themeGlobalStyleRevisions[t]:null}function Ga(e,t){return e.defaultTemplates[JSON.stringify(t)]}const qa=(e,t,n,r,o)=>{const i=e.entities.records?.[t]?.[n]?.revisions?.[r];return i?Ys(i,o):null},Ka=(0,Ws.A)(((e,t,n,r,o,i)=>{var s;const a=e.entities.records?.[t]?.[n]?.revisions?.[r];if(!a)return;const l=null!==(s=i?.context)&&void 0!==s?s:"default";if(void 0===i){if(!a.itemIsComplete[l]?.[o])return;return a.items[l][o]}const c=a.items[l]?.[o];if(c&&i._fields){var u;const e={},t=null!==(u=Ds(i._fields))&&void 0!==u?u:[];for(let n=0;n<t.length;n++){const r=t[n].split(".");let o=c;r.forEach((e=>{o=o?.[e]})),K(e,r,o)}return e}return c}),((e,t,n,r,o,i)=>{var s;const a=null!==(s=i?.context)&&void 0!==s?s:"default";return[e.entities.records?.[t]?.[n]?.revisions?.[r]?.items?.[a]?.[o],e.entities.records?.[t]?.[n]?.revisions?.[r]?.itemIsComplete?.[a]?.[o]]}));function Ya(e){return e.undoManager}function Ja(e){return e.navigationFallbackId}const Xa=(0,$s.N)((e=>(0,Ws.A)(((t,n)=>e(te).getBlockPatterns().filter((({postTypes:e})=>!e||Array.isArray(e)&&e.includes(n)))),(()=>[e(te).getBlockPatterns()]))));var Za=n(10313),Qa=n(11785);const el=e=>(...t)=>async({resolveSelect:n})=>{await n[e](...t)},tl=e=>async({dispatch:t})=>{const n=(0,G.F)("/wp/v2/users/?who=authors&per_page=100",e),r=await(0,E.default)({path:n});t.receiveUserQuery(n,r)},nl=()=>async({dispatch:e})=>{const t=await(0,E.default)({path:"/wp/v2/users/me"});e.receiveCurrentUser(t)},rl=(e,t,n="",r)=>async({select:o,dispatch:i})=>{const s=(await i(Ns(e,t))).find((n=>n.name===t&&n.kind===e));if(!s||s?.__experimentalNoFetch)return;const a=await i.__unstableAcquireStoreLock(te,["entities","records",e,t,n],{exclusive:!1});try{if(window.__experimentalEnableSync&&s.syncConfig&&!r){if(globalThis.IS_GUTENBERG_PLUGIN){const o=s.getSyncObjectId(n);await Ji().bootstrap(s.syncObjectType,o,(n=>{i.receiveEntityRecords(e,t,n,r)})),await Ji().bootstrap(s.syncObjectType+"--edit",o,(r=>{i({type:"EDIT_ENTITY_RECORD",kind:e,name:t,recordId:n,edits:r,meta:{undo:void 0}})}))}}else{void 0!==r&&r._fields&&(r={...r,_fields:[...new Set([...Ds(r._fields)||[],s.key||ks])].join()});const a=(0,G.F)(s.baseURL+(n?"/"+n:""),{...s.baseURLParams,...r});if(void 0!==r&&(r={...r,include:[n]},o.hasEntityRecords(e,t,r)))return;const l=await(0,E.default)({path:a});i.receiveEntityRecords(e,t,l,r)}}finally{i.__unstableReleaseStoreLock(a)}},ol=el("getEntityRecord"),il=el("getEntityRecord"),sl=(e,t,n={})=>async({dispatch:r,registry:o})=>{const i=(await r(Ns(e,t))).find((n=>n.name===t&&n.kind===e));if(!i||i?.__experimentalNoFetch)return;const s=await r.__unstableAcquireStoreLock(te,["entities","records",e,t],{exclusive:!1});try{n._fields&&(n={...n,_fields:[...new Set([...Ds(n._fields)||[],i.key||ks])].join()});const a=(0,G.F)(i.baseURL,{...i.baseURLParams,...n});let l,c;if(i.supportsPagination&&-1!==n.per_page){const e=await(0,E.default)({path:a,parse:!1});l=Object.values(await e.json()),c={totalItems:parseInt(e.headers.get("X-WP-Total")),totalPages:parseInt(e.headers.get("X-WP-TotalPages"))}}else l=Object.values(await(0,E.default)({path:a}));n._fields&&(l=l.map((e=>(n._fields.split(",").forEach((t=>{e.hasOwnProperty(t)||(e[t]=void 0)})),e)))),o.batch((()=>{if(r.receiveEntityRecords(e,t,l,n,!1,void 0,c),!n?._fields&&!n.context){const n=i.key||ks,o=l.filter((e=>e[n])).map((r=>[e,t,r[n]]));r({type:"START_RESOLUTIONS",selectorName:"getEntityRecord",args:o}),r({type:"FINISH_RESOLUTIONS",selectorName:"getEntityRecord",args:o})}r.__unstableReleaseStoreLock(s)}))}catch(e){r.__unstableReleaseStoreLock(s)}};sl.shouldInvalidate=(e,t,n)=>("RECEIVE_ITEMS"===e.type||"REMOVE_ITEMS"===e.type)&&e.invalidateCache&&t===e.kind&&n===e.name;const al=()=>async({dispatch:e,resolveSelect:t})=>{const n=await t.getEntityRecords("root","theme",{status:"active"});e.receiveCurrentTheme(n[0])},ll=el("getCurrentTheme"),cl=e=>async({dispatch:t})=>{try{const n=await(0,E.default)({path:(0,G.F)("/oembed/1.0/proxy",{url:e})});t.receiveEmbedPreview(e,n)}catch(n){t.receiveEmbedPreview(e,!1)}},ul=(e,t,n)=>async({dispatch:r,registry:o})=>{const{hasStartedResolution:i}=o.select(te),s=n?`${t}/${n}`:t,a=["create","read","update","delete"];if(!a.includes(e))throw new Error(`'${e}' is not a valid action.`);for(const r of a)if(r!==e&&i("canUser",[r,t,n]))return;let l;try{l=await(0,E.default)({path:`/wp/v2/${s}`,method:"OPTIONS",parse:!1})}catch(e){return}const c=l.headers?.get("allow"),u=c?.allow||c||"",d={},h={create:"POST",read:"GET",update:"PUT",delete:"DELETE"};for(const[e,t]of Object.entries(h))d[e]=u.includes(t);for(const e of a)r.receiveUserPermission(`${e}/${s}`,d[e])},dl=(e,t,n)=>async({dispatch:r})=>{const o=(await r(Ns(e,t))).find((n=>n.name===t&&n.kind===e));if(!o)return;const i=o.__unstable_rest_base;await r(ul("update",i,n))},hl=(e,t)=>async({dispatch:n,resolveSelect:r})=>{const{rest_base:o,rest_namespace:i="wp/v2"}=await r.getPostType(e),s=await(0,E.default)({path:`/${i}/${o}/${t}/autosaves?context=edit`});s&&s.length&&n.receiveAutosaves(t,s)},pl=(e,t)=>async({resolveSelect:n})=>{await n.getAutosaves(e,t)},fl=e=>async({dispatch:t,resolveSelect:n})=>{let r;try{r=await(0,E.default)({url:(0,G.F)(e,{"_wp-find-template":!0})}).then((({data:e})=>e))}catch(e){}if(!r)return;const o=await n.getEntityRecord("postType","wp_template",r.id);o&&t.receiveEntityRecords("postType","wp_template",[o],{"find-template":e})};fl.shouldInvalidate=e=>("RECEIVE_ITEMS"===e.type||"REMOVE_ITEMS"===e.type)&&e.invalidateCache&&"postType"===e.kind&&"wp_template"===e.name;const ml=()=>async({dispatch:e,resolveSelect:t})=>{const n=await t.getEntityRecords("root","theme",{status:"active"}),r=n?.[0]?._links?.["wp:user-global-styles"]?.[0]?.href;if(r){const t=await(0,E.default)({url:r});e.__experimentalReceiveCurrentGlobalStylesId(t.id)}},gl=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.getCurrentTheme(),r=await(0,E.default)({path:`/wp/v2/global-styles/themes/${n.stylesheet}`});t.__experimentalReceiveThemeBaseGlobalStyles(n.stylesheet,r)},bl=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.getCurrentTheme(),r=await(0,E.default)({path:`/wp/v2/global-styles/themes/${n.stylesheet}/variations`});t.__experimentalReceiveThemeGlobalStyleVariations(n.stylesheet,r)},yl=()=>async({resolveSelect:e,dispatch:t})=>{const n=await e.__experimentalGetCurrentGlobalStylesId(),r=n?await e.getEntityRecord("root","globalStyles",n):void 0,o=r?._links?.["version-history"]?.[0]?.href;if(o){const e=await(0,E.default)({url:o}),r=e?.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[(0,Za.xQ)(e),t])))));t.receiveThemeGlobalStyleRevisions(n,r)}};yl.shouldInvalidate=e=>"SAVE_ENTITY_RECORD_FINISH"===e.type&&"root"===e.kind&&!e.error&&"globalStyles"===e.name;const vl=()=>async({dispatch:e})=>{e({type:"RECEIVE_BLOCK_PATTERNS",patterns:await async function(){const e=await(0,E.default)({path:"/wp/v2/block-patterns/patterns"});return e?e.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[(0,Za.xQ)(e),t]))))):[]}()})},_l=()=>async({dispatch:e})=>{e({type:"RECEIVE_BLOCK_PATTERN_CATEGORIES",categories:await(0,E.default)({path:"/wp/v2/block-patterns/categories"})})},xl=()=>async({dispatch:e,resolveSelect:t})=>{const n=await t.getEntityRecords("taxonomy","wp_pattern_category",{per_page:-1,_fields:"id,name,description,slug",context:"view"});e({type:"RECEIVE_USER_PATTERN_CATEGORIES",patternCategories:n?.map((e=>({...e,label:(0,Qa.decodeEntities)(e.name),name:e.slug})))||[]})},wl=()=>async({dispatch:e,select:t})=>{const n=await(0,E.default)({path:(0,G.F)("/wp-block-editor/v1/navigation-fallback",{_embed:!0})}),r=n?._embedded?.self;if(e.receiveNavigationFallbackId(n?.id),r){const o=!t.getEntityRecord("postType","wp_navigation",n.id);e.receiveEntityRecords("postType","wp_navigation",r,void 0,o),e.finishResolution("getEntityRecord",["postType","wp_navigation",n.id])}},kl=e=>async({dispatch:t})=>{const n=await(0,E.default)({path:(0,G.F)("/wp/v2/templates/lookup",e)});n?.id&&t.receiveDefaultTemplateId(e,n.id)},Cl=(e,t,n,r={})=>async({dispatch:o})=>{const i=(await o(Ns(e,t))).find((n=>n.name===t&&n.kind===e));if(!i||i?.__experimentalNoFetch)return;r._fields&&(r={...r,_fields:[...new Set([...Ds(r._fields)||[],i.revisionKey||ks])].join()});const s=(0,G.F)(i.getRevisionsUrl(n),r);let a,l;const c={},u=i.supportsPagination&&-1!==r.per_page;try{l=await(0,E.default)({path:s,parse:!u})}catch(e){return}if(l&&(u?(a=Object.values(await l.json()),c.totalItems=parseInt(l.headers.get("X-WP-Total"))):a=Object.values(l),r._fields&&(a=a.map((e=>(r._fields.split(",").forEach((t=>{e.hasOwnProperty(t)||(e[t]=void 0)})),e)))),o.receiveRevisions(e,t,n,a,r,!1,c),!r?._fields&&!r.context)){const r=i.key||ks,s=a.filter((e=>e[r])).map((o=>[e,t,n,o[r]]));o({type:"START_RESOLUTIONS",selectorName:"getRevision",args:s}),o({type:"FINISH_RESOLUTIONS",selectorName:"getRevision",args:s})}};Cl.shouldInvalidate=(e,t,n,r)=>"SAVE_ENTITY_RECORD_FINISH"===e.type&&n===e.name&&t===e.kind&&!e.error&&r===e.recordId;const Sl=(e,t,n,r,o)=>async({dispatch:i})=>{const s=(await i(Ns(e,t))).find((n=>n.name===t&&n.kind===e));if(!s||s?.__experimentalNoFetch)return;void 0!==o&&o._fields&&(o={...o,_fields:[...new Set([...Ds(o._fields)||[],s.revisionKey||ks])].join()});const a=(0,G.F)(s.getRevisionsUrl(n,r),o);let l;try{l=await(0,E.default)({path:a})}catch(e){return}l&&i.receiveRevisions(e,t,n,l,o)};function Al(e,t){const n={...e};let r=n;for(const e of t)r.children={...r.children,[e]:{locks:[],children:{},...r.children[e]}},r=r.children[e];return n}function El(e,t){let n=e;for(const e of t){const t=n.children[e];if(!t)return null;n=t}return n}function Il({exclusive:e},t){return!(!e||!t.length)||!(e||!t.filter((e=>e.exclusive)).length)}const jl={requests:[],tree:{locks:[],children:{}}};function Tl(e=jl,t){switch(t.type){case"ENQUEUE_LOCK_REQUEST":{const{request:n}=t;return{...e,requests:[n,...e.requests]}}case"GRANT_LOCK_REQUEST":{const{lock:n,request:r}=t,{store:o,path:i}=r,s=[o,...i],a=Al(e.tree,s),l=El(a,s);return l.locks=[...l.locks,n],{...e,requests:e.requests.filter((e=>e!==r)),tree:a}}case"RELEASE_LOCK":{const{lock:n}=t,r=[n.store,...n.path],o=Al(e.tree,r),i=El(o,r);return i.locks=i.locks.filter((e=>e!==n)),{...e,tree:o}}}return e}function Bl(e,t,n,{exclusive:r}){const o=[t,...n],i=e.tree;for(const e of function*(e,t){let n=e;yield n;for(const e of t){const t=n.children[e];if(!t)break;yield t,n=t}}(i,o))if(Il({exclusive:r},e.locks))return!1;const s=El(i,o);if(!s)return!0;for(const e of function*(e){const t=Object.values(e.children);for(;t.length;){const e=t.pop();yield e,t.push(...Object.values(e.children))}}(s))if(Il({exclusive:r},e.locks))return!1;return!0}function Rl(){let e=Tl(void 0,{type:"@@INIT"});function t(){for(const t of function(e){return e.requests}(e)){const{store:n,path:r,exclusive:o,notifyAcquired:i}=t;if(Bl(e,n,r,{exclusive:o})){const s={store:n,path:r,exclusive:o};e=Tl(e,{type:"GRANT_LOCK_REQUEST",lock:s,request:t}),i(s)}}}return{acquire:function(n,r,o){return new Promise((i=>{e=Tl(e,{type:"ENQUEUE_LOCK_REQUEST",request:{store:n,path:r,exclusive:o,notifyAcquired:i}}),t()}))},release:function(n){e=Tl(e,{type:"RELEASE_LOCK",lock:n}),t()}}}var Nl=n(87520);const{lock:Dl,unlock:Ml}=(0,Nl.yf)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/core-data"),Pl=[...Ss,...As.filter((e=>!!e.name))],Ol=Pl.reduce(((e,t)=>{const{kind:n,name:r,plural:o}=t;return e[Bs(n,r)]=(e,t,o)=>sa(e,n,r,t,o),o&&(e[Bs(n,o,"get")]=(e,t)=>ua(e,n,r,t)),e}),{}),Ll=Pl.reduce(((e,t)=>{const{kind:n,name:r,plural:o}=t;if(e[Bs(n,r)]=(e,t)=>rl(n,r,e,t),o){const t=Bs(n,o,"get");e[t]=(...e)=>sl(n,r,...e),e[t].shouldInvalidate=e=>sl.shouldInvalidate(e,n,r)}return e}),{}),Fl=Pl.reduce(((e,t)=>{const{kind:n,name:r}=t;return e[Bs(n,r,"save")]=(e,t)=>ps(n,r,e,t),e[Bs(n,r,"delete")]=(e,t,o)=>ls(n,r,e,t,o),e}),{}),zl=(0,R.A)(te,{reducer:Hs,actions:{...r,...Fl,...function(){const e=Rl();return{__unstableAcquireStoreLock:function(t,n,{exclusive:r}){return()=>e.acquire(t,n,r)},__unstableReleaseStoreLock:function(t){return()=>e.release(t)}}}()},selectors:{...o,...Ol},resolvers:{...s,...Ll}});Ml(zl).registerPrivateSelectors(i),(0,N.register)(zl);var Ul=n(77906),Vl=n(14687),Hl=n(16221);const $l=[],Wl=()=>{const{wp:e}=window;return e.media.view.MediaFrame.Select.extend({featuredImageToolbar(t){this.createSelectToolbar(t,{text:e.media.view.l10n.setFeaturedImage,state:this.options.state})},editState(){const t=this.state("featured-image").get("selection"),n=new e.media.view.EditImage({model:t.single(),controller:this}).render();this.content.set(n),n.loadEditor()},createStates:function(){this.on("toolbar:create:featured-image",this.featuredImageToolbar,this),this.on("content:render:edit-image",this.editState,this),this.states.add([new e.media.controller.FeaturedImage,new e.media.controller.EditImage({model:this.options.editImage})])}})},Gl=()=>{const{wp:e}=window;return e.media.view.MediaFrame.Post.extend({galleryToolbar(){const t=this.state().get("editing");this.toolbar.set(new e.media.view.Toolbar({controller:this,items:{insert:{style:"primary",text:t?e.media.view.l10n.updateGallery:e.media.view.l10n.insertGallery,priority:80,requires:{library:!0},click(){const e=this.controller,t=e.state();e.close(),t.trigger("update",t.get("library")),e.setState(e.options.state),e.reset()}}}}))},editState(){const t=this.state("gallery").get("selection"),n=new e.media.view.EditImage({model:t.single(),controller:this}).render();this.content.set(n),n.loadEditor()},createStates:function(){this.on("toolbar:create:main-gallery",this.galleryToolbar,this),this.on("content:render:edit-image",this.editState,this),this.states.add([new e.media.controller.Library({id:"gallery",title:e.media.view.l10n.createGalleryTitle,priority:40,toolbar:"main-gallery",filterable:"uploaded",multiple:"add",editable:!1,library:e.media.query({type:"image",...this.options.library})}),new e.media.controller.EditImage({model:this.options.editImage}),new e.media.controller.GalleryEdit({library:this.options.selection,editing:this.options.editing,menu:"gallery",displaySettings:!1,multiple:!0}),new e.media.controller.GalleryAdd])}})},ql=e=>["sizes","mime","type","subtype","id","url","alt","link","caption"].reduce(((t,n)=>(e?.hasOwnProperty(n)&&(t[n]=e[n]),t)),{}),Kl=e=>{const{wp:t}=window;return t.media.query({order:"ASC",orderby:"post__in",post__in:e,posts_per_page:-1,query:!0,type:"image"})};class Yl extends S.Component{constructor(){super(...arguments),this.openModal=this.openModal.bind(this),this.onOpen=this.onOpen.bind(this),this.onSelect=this.onSelect.bind(this),this.onUpdate=this.onUpdate.bind(this),this.onClose=this.onClose.bind(this)}initializeListeners(){this.frame.on("select",this.onSelect),this.frame.on("update",this.onUpdate),this.frame.on("open",this.onOpen),this.frame.on("close",this.onClose)}buildAndSetGalleryFrame(){const{addToGallery:e=!1,allowedTypes:t,multiple:n=!1,value:r=$l}=this.props;if(r===this.lastGalleryValue)return;const{wp:o}=window;let i;this.lastGalleryValue=r,this.frame&&this.frame.remove(),i=e?"gallery-library":r&&r.length?"gallery-edit":"gallery",this.GalleryDetailsMediaFrame||(this.GalleryDetailsMediaFrame=Gl());const s=Kl(r),a=new o.media.model.Selection(s.models,{props:s.props.toJSON(),multiple:n});this.frame=new this.GalleryDetailsMediaFrame({mimeType:t,state:i,multiple:n,selection:a,editing:!(!r||!r.length)}),o.media.frame=this.frame,this.initializeListeners()}buildAndSetFeatureImageFrame(){const{wp:e}=window,{value:t,multiple:n,allowedTypes:r}=this.props,o=Wl(),i=Kl(t),s=new e.media.model.Selection(i.models,{props:i.props.toJSON()});this.frame=new o({mimeType:r,state:"featured-image",multiple:n,selection:s,editing:t}),e.media.frame=this.frame,e.media.view.settings.post={...e.media.view.settings.post,featuredImageId:t||-1}}componentWillUnmount(){this.frame?.remove()}onUpdate(e){const{onSelect:t,multiple:n=!1}=this.props,r=this.frame.state(),o=e||r.get("selection");o&&o.models.length&&t(n?o.models.map((e=>ql(e.toJSON()))):ql(o.models[0].toJSON()))}onSelect(){const{onSelect:e,multiple:t=!1}=this.props,n=this.frame.state().get("selection").toJSON();e(t?n:n[0])}onOpen(){const{wp:e}=window,{value:t}=this.props;if(this.updateCollection(),this.props.mode&&this.frame.content.mode(this.props.mode),!(Array.isArray(t)?t?.length:t))return;const n=this.props.gallery,r=this.frame.state().get("selection"),o=Array.isArray(t)?t:[t];n||o.forEach((t=>{r.add(e.media.attachment(t))}));const i=Kl(o);i.more().done((function(){n&&i?.models?.length&&r.add(i.models)}))}onClose(){const{onClose:e}=this.props;e&&e()}updateCollection(){const e=this.frame.content.get();if(e&&e.collection){const t=e.collection;t.toArray().forEach((e=>e.trigger("destroy",e))),t.mirroring._hasMore=!0,t.more()}}openModal(){const{allowedTypes:e,gallery:t=!1,unstableFeaturedImageFlow:n=!1,modalClass:r,multiple:o=!1,title:i=(0,H.__)("Select or Upload Media")}=this.props,{wp:s}=window;if(t)this.buildAndSetGalleryFrame();else{const t={title:i,multiple:o};e&&(t.library={type:e}),this.frame=s.media(t)}r&&this.frame.$el.addClass(r),n&&this.buildAndSetFeatureImageFrame(),this.initializeListeners(),this.frame.open()}render(){return this.props.render({open:this.openModal})}}const Jl=Yl,Xl={};function Zl(e){const t=window.URL.createObjectURL(e);return Xl[t]=e,t}function Ql(e){Xl[e]&&window.URL.revokeObjectURL(e),delete Xl[e]}function ec(e){return!(!e||!e.indexOf)&&0===e.indexOf("blob:")}const tc=()=>{};async function nc({allowedTypes:e,additionalData:t={},filesList:n,maxUploadFileSize:r,onError:o=tc,onFileChange:i,wpAllowedMimeTypes:s=null}){const a=[...n],l=[],c=(e,t)=>{Ql(l[e]?.url),l[e]=t,i(l.filter(Boolean))},u=t=>!e||e.some((e=>e.includes("/")?e===t:t.startsWith(`${e}/`))),d=(h=s)?Object.entries(h).map((([e,t])=>{const[n]=t.split("/");return[t,...e.split("|").map((e=>`${n}/${e}`))]})).flat():h;var h;const p=[];for(const e of a)d&&e.type&&(f=e.type,!d.includes(f))?o({code:"MIME_TYPE_NOT_ALLOWED_FOR_USER",message:(0,H.sprintf)((0,H.__)("%s: Sorry, you are not allowed to upload this file type."),e.name),file:e}):!e.type||u(e.type)?r&&e.size>r?o({code:"SIZE_ABOVE_LIMIT",message:(0,H.sprintf)((0,H.__)("%s: This file exceeds the maximum upload size for this site."),e.name),file:e}):e.size<=0?o({code:"EMPTY_FILE",message:(0,H.sprintf)((0,H.__)("%s: This file is empty."),e.name),file:e}):(p.push(e),l.push({url:Zl(e)}),i(l)):o({code:"MIME_TYPE_NOT_SUPPORTED",message:(0,H.sprintf)((0,H.__)("%s: Sorry, this file type is not supported here."),e.name),file:e});var f;for(let e=0;e<p.length;++e){const n=p[e];try{var m;const r=await rc(n,t),{alt_text:o,source_url:i,...s}=r;c(e,{...s,alt:r.alt_text,caption:null!==(m=r.caption?.raw)&&void 0!==m?m:"",title:r.title.raw,url:r.source_url})}catch(t){let r;c(e,null),r=t.message?t.message:(0,H.sprintf)((0,H.__)("Error while uploading file %s to the media library."),n.name),o({code:"GENERAL",message:r,file:n})}}}function rc(e,t){const n=new window.FormData;return n.append("file",e,e.name||e.type.replace("/",".")),t&&Object.entries(t).forEach((([e,t])=>n.append(e,t))),(0,E.default)({path:"/wp/v2/media",body:n,method:"POST"})}var oc=n(38245),ic=n(99940),sc=n(99532),ac=n(71848);const lc="block-default",cc=["attributes","supports","save","migrate","isEligible","apiVersion"],uc={"--wp--style--color--link":{value:["color","link"],support:["color","link"]},aspectRatio:{value:["dimensions","aspectRatio"],support:["dimensions","aspectRatio"],useEngine:!0},background:{value:["color","gradient"],support:["color","gradients"],useEngine:!0},backgroundColor:{value:["color","background"],support:["color","background"],requiresOptOut:!0,useEngine:!0},backgroundImage:{value:["background","backgroundImage"],support:["background","backgroundImage"],useEngine:!0},backgroundRepeat:{value:["background","backgroundRepeat"],support:["background","backgroundRepeat"],useEngine:!0},backgroundSize:{value:["background","backgroundSize"],support:["background","backgroundSize"],useEngine:!0},backgroundPosition:{value:["background","backgroundPosition"],support:["background","backgroundPosition"],useEngine:!0},borderColor:{value:["border","color"],support:["__experimentalBorder","color"],useEngine:!0},borderRadius:{value:["border","radius"],support:["__experimentalBorder","radius"],properties:{borderTopLeftRadius:"topLeft",borderTopRightRadius:"topRight",borderBottomLeftRadius:"bottomLeft",borderBottomRightRadius:"bottomRight"},useEngine:!0},borderStyle:{value:["border","style"],support:["__experimentalBorder","style"],useEngine:!0},borderWidth:{value:["border","width"],support:["__experimentalBorder","width"],useEngine:!0},borderTopColor:{value:["border","top","color"],support:["__experimentalBorder","color"],useEngine:!0},borderTopStyle:{value:["border","top","style"],support:["__experimentalBorder","style"],useEngine:!0},borderTopWidth:{value:["border","top","width"],support:["__experimentalBorder","width"],useEngine:!0},borderRightColor:{value:["border","right","color"],support:["__experimentalBorder","color"],useEngine:!0},borderRightStyle:{value:["border","right","style"],support:["__experimentalBorder","style"],useEngine:!0},borderRightWidth:{value:["border","right","width"],support:["__experimentalBorder","width"],useEngine:!0},borderBottomColor:{value:["border","bottom","color"],support:["__experimentalBorder","color"],useEngine:!0},borderBottomStyle:{value:["border","bottom","style"],support:["__experimentalBorder","style"],useEngine:!0},borderBottomWidth:{value:["border","bottom","width"],support:["__experimentalBorder","width"],useEngine:!0},borderLeftColor:{value:["border","left","color"],support:["__experimentalBorder","color"],useEngine:!0},borderLeftStyle:{value:["border","left","style"],support:["__experimentalBorder","style"],useEngine:!0},borderLeftWidth:{value:["border","left","width"],support:["__experimentalBorder","width"],useEngine:!0},color:{value:["color","text"],support:["color","text"],requiresOptOut:!0,useEngine:!0},columnCount:{value:["typography","textColumns"],support:["typography","textColumns"],useEngine:!0},filter:{value:["filter","duotone"],support:["filter","duotone"]},linkColor:{value:["elements","link","color","text"],support:["color","link"]},captionColor:{value:["elements","caption","color","text"],support:["color","caption"]},buttonColor:{value:["elements","button","color","text"],support:["color","button"]},buttonBackgroundColor:{value:["elements","button","color","background"],support:["color","button"]},headingColor:{value:["elements","heading","color","text"],support:["color","heading"]},headingBackgroundColor:{value:["elements","heading","color","background"],support:["color","heading"]},fontFamily:{value:["typography","fontFamily"],support:["typography","__experimentalFontFamily"],useEngine:!0},fontSize:{value:["typography","fontSize"],support:["typography","fontSize"],useEngine:!0},fontStyle:{value:["typography","fontStyle"],support:["typography","__experimentalFontStyle"],useEngine:!0},fontWeight:{value:["typography","fontWeight"],support:["typography","__experimentalFontWeight"],useEngine:!0},lineHeight:{value:["typography","lineHeight"],support:["typography","lineHeight"],useEngine:!0},margin:{value:["spacing","margin"],support:["spacing","margin"],properties:{marginTop:"top",marginRight:"right",marginBottom:"bottom",marginLeft:"left"},useEngine:!0},minHeight:{value:["dimensions","minHeight"],support:["dimensions","minHeight"],useEngine:!0},padding:{value:["spacing","padding"],support:["spacing","padding"],properties:{paddingTop:"top",paddingRight:"right",paddingBottom:"bottom",paddingLeft:"left"},useEngine:!0},textAlign:{value:["typography","textAlign"],support:["typography","textAlign"],useEngine:!1},textDecoration:{value:["typography","textDecoration"],support:["typography","__experimentalTextDecoration"],useEngine:!0},textTransform:{value:["typography","textTransform"],support:["typography","__experimentalTextTransform"],useEngine:!0},letterSpacing:{value:["typography","letterSpacing"],support:["typography","__experimentalLetterSpacing"],useEngine:!0},writingMode:{value:["typography","writingMode"],support:["typography","__experimentalWritingMode"],useEngine:!0},"--wp--style--root--padding":{value:["spacing","padding"],support:["spacing","padding"],properties:{"--wp--style--root--padding-top":"top","--wp--style--root--padding-right":"right","--wp--style--root--padding-bottom":"bottom","--wp--style--root--padding-left":"left"},rootOnly:!0}},dc={link:"a:where(:not(.wp-element-button))",heading:"h1, h2, h3, h4, h5, h6",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",button:".wp-element-button, .wp-block-button__link",caption:".wp-element-caption, .wp-block-audio figcaption, .wp-block-embed figcaption, .wp-block-gallery figcaption, .wp-block-image figcaption, .wp-block-table figcaption, .wp-block-video figcaption",cite:"cite"},hc={"color.duotone":!0,"color.gradients":!0,"color.palette":!0,"dimensions.aspectRatios":!0,"typography.fontSizes":!0,"spacing.spacingSizes":!0};var pc=n(8301),fc=n(75379);const{lock:mc,unlock:gc}=(0,Nl.yf)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/blocks"),bc={title:"block title",description:"block description",keywords:["block keyword"],styles:[{label:"block style label"}],variations:[{title:"block variation title",description:"block variation description",keywords:["block variation keyword"]}]};function yc(e){return null!==e&&"object"==typeof e}function vc({textdomain:e,...t}){const n=["apiVersion","title","category","parent","ancestor","icon","description","keywords","attributes","providesContext","usesContext","selectors","supports","styles","example","variations","blockHooks","allowedBlocks"],r=Object.fromEntries(Object.entries(t).filter((([e])=>n.includes(e))));return e&&Object.keys(bc).forEach((t=>{r[t]&&(r[t]=xc(bc[t],r[t],e))})),r}function _c(e,t){const n=yc(e)?e.name:e;if("string"!=typeof n)return void console.error("Block names must be strings.");if(!/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(n))return void console.error("Block names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-block");if((0,pc.L)(ed).getBlockType(n))return void console.error('Block "'+n+'" is already registered.');const{addBootstrappedBlockType:r,addUnprocessedBlockType:o}=gc((0,fc.J)(ed));return yc(e)&&r(n,vc(e)),o(n,t),(0,pc.L)(ed).getBlockType(n)}function xc(e,t,n){return"string"==typeof e&&"string"==typeof t?(0,H._x)(t,e,n):Array.isArray(e)&&e.length&&Array.isArray(t)?t.map((t=>xc(e[0],t,n))):yc(e)&&Object.entries(e).length&&yc(t)?Object.keys(t).reduce(((r,o)=>e[o]?(r[o]=xc(e[o],t[o],n),r):(r[o]=t[o],r)),{}):t}function wc(){return(0,pc.L)(ed).getFreeformFallbackBlockName()}function kc(){return(0,pc.L)(ed).getUnregisteredFallbackBlockName()}function Cc(){return(0,pc.L)(ed).getDefaultBlockName()}function Sc(e){return(0,pc.L)(ed)?.getBlockType(e)}function Ac(){return(0,pc.L)(ed).getBlockTypes()}function Ec(e,t,n){return(0,pc.L)(ed).getBlockSupport(e,t,n)}function Ic(e,t,n){return(0,pc.L)(ed).hasBlockSupport(e,t,n)}function jc(e){return"core/block"===e?.name}function Tc(e){return"core/template-part"===e?.name}const Bc=(e,t)=>(0,pc.L)(ed).getBlockVariations(e,t);(0,oc.X$)([ic.A,sc.A]);const Rc=["#191e23","#f8f9f9"];function Nc(e){var t;return Object.entries(null!==(t=Sc(e.name)?.attributes)&&void 0!==t?t:{}).every((([t,n])=>{const r=e.attributes[t];return n.hasOwnProperty("default")?r===n.default:"rich-text"===n.type?!r?.length:void 0===r}))}function Dc(e){return e.name===Cc()&&Nc(e)}function Mc(e){return!!e&&("string"==typeof e||(0,S.isValidElement)(e)||"function"==typeof e||e instanceof S.Component)}function Pc(e){return"string"==typeof e?Sc(e):e}function Oc(e,t,n="visual"){const{__experimentalLabel:r,title:o}=e,i=r&&r(t,{context:n});return i?i.toPlainText?i.toPlainText():(0,ac.A)(i):o}function Lc(e,t,n,r="vertical"){const o=e?.title,i=e?Oc(e,t,"accessibility"):"",s=void 0!==n,a=i&&i!==o;return s&&"vertical"===r?a?(0,H.sprintf)((0,H.__)("%1$s Block. Row %2$d. %3$s"),o,n,i):(0,H.sprintf)((0,H.__)("%1$s Block. Row %2$d"),o,n):s&&"horizontal"===r?a?(0,H.sprintf)((0,H.__)("%1$s Block. Column %2$d. %3$s"),o,n,i):(0,H.sprintf)((0,H.__)("%1$s Block. Column %2$d"),o,n):a?(0,H.sprintf)((0,H.__)("%1$s Block. %2$s"),o,i):(0,H.sprintf)((0,H.__)("%s Block"),o)}function Fc(e){return void 0!==e.default?e.default:"rich-text"===e.type?new $.RichTextData:void 0}function zc(e,t){const n=Sc(e);if(void 0===n)throw new Error(`Block type '${e}' is not registered.`);return Object.entries(n.attributes).reduce(((e,[n,r])=>{const o=t[n];if(void 0!==o)"rich-text"===r.type?o instanceof $.RichTextData?e[n]=o:"string"==typeof o&&(e[n]=$.RichTextData.fromHTMLString(o)):"string"===r.type&&o instanceof $.RichTextData?e[n]=o.toHTMLString():e[n]=o;else{const t=Fc(r);void 0!==t&&(e[n]=t)}return-1!==["node","children"].indexOf(r.source)&&("string"==typeof e[n]?e[n]=[e[n]]:Array.isArray(e[n])||(e[n]=[])),e}),{})}function Uc(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.includes(e))))}const Vc=[{slug:"text",title:(0,H.__)("Text")},{slug:"media",title:(0,H.__)("Media")},{slug:"design",title:(0,H.__)("Design")},{slug:"widgets",title:(0,H.__)("Widgets")},{slug:"theme",title:(0,H.__)("Theme")},{slug:"embed",title:(0,H.__)("Embeds")},{slug:"reusable",title:(0,H.__)("Reusable blocks")}];function Hc(e){return e.reduce(((e,t)=>({...e,[t.name]:t})),{})}function $c(e){return e.reduce(((e,t)=>(e.some((e=>e.name===t.name))||e.push(t),e)),[])}function Wc(e){return(t=null,n)=>{switch(n.type){case"REMOVE_BLOCK_TYPES":return-1!==n.names.indexOf(t)?null:t;case e:return n.name||null}return t}}const Gc=Wc("SET_DEFAULT_BLOCK_NAME"),qc=Wc("SET_FREEFORM_FALLBACK_BLOCK_NAME"),Kc=Wc("SET_UNREGISTERED_FALLBACK_BLOCK_NAME"),Yc=Wc("SET_GROUPING_BLOCK_NAME"),Jc=(0,N.combineReducers)({bootstrappedBlockTypes:function(e={},t){switch(t.type){case"ADD_BOOTSTRAPPED_BLOCK_TYPE":const{name:n,blockType:r}=t,o=e[n];let i;return o?(void 0===o.blockHooks&&r.blockHooks&&(i={...o,...i,blockHooks:r.blockHooks}),void 0===o.allowedBlocks&&r.allowedBlocks&&(i={...o,...i,allowedBlocks:r.allowedBlocks})):(i=Object.fromEntries(Object.entries(r).filter((([,e])=>null!=e)).map((([e,t])=>[(0,Za.xQ)(e),t]))),i.name=n),i?{...e,[n]:i}:e;case"REMOVE_BLOCK_TYPES":return Uc(e,t.names)}return e},unprocessedBlockTypes:function(e={},t){switch(t.type){case"ADD_UNPROCESSED_BLOCK_TYPE":return{...e,[t.name]:t.blockType};case"REMOVE_BLOCK_TYPES":return Uc(e,t.names)}return e},blockTypes:function(e={},t){switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Hc(t.blockTypes)};case"REMOVE_BLOCK_TYPES":return Uc(e,t.names)}return e},blockStyles:function(e={},t){var n;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(Hc(t.blockTypes)).map((([t,n])=>{var r,o;return[t,$c([...(null!==(r=n.styles)&&void 0!==r?r:[]).map((e=>({...e,source:"block"}))),...(null!==(o=e[n.name])&&void 0!==o?o:[]).filter((({source:e})=>"block"!==e))])]})))};case"ADD_BLOCK_STYLES":const r={};return t.blockNames.forEach((n=>{var o;r[n]=$c([...null!==(o=e[n])&&void 0!==o?o:[],...t.styles])})),{...e,...r};case"REMOVE_BLOCK_STYLES":return{...e,[t.blockName]:(null!==(n=e[t.blockName])&&void 0!==n?n:[]).filter((e=>-1===t.styleNames.indexOf(e.name)))}}return e},blockVariations:function(e={},t){var n,r;switch(t.type){case"ADD_BLOCK_TYPES":return{...e,...Object.fromEntries(Object.entries(Hc(t.blockTypes)).map((([t,n])=>{var r,o;return[t,$c([...(null!==(r=n.variations)&&void 0!==r?r:[]).map((e=>({...e,source:"block"}))),...(null!==(o=e[n.name])&&void 0!==o?o:[]).filter((({source:e})=>"block"!==e))])]})))};case"ADD_BLOCK_VARIATIONS":return{...e,[t.blockName]:$c([...null!==(n=e[t.blockName])&&void 0!==n?n:[],...t.variations])};case"REMOVE_BLOCK_VARIATIONS":return{...e,[t.blockName]:(null!==(r=e[t.blockName])&&void 0!==r?r:[]).filter((e=>-1===t.variationNames.indexOf(e.name)))}}return e},defaultBlockName:Gc,freeformFallbackBlockName:qc,unregisteredFallbackBlockName:Kc,groupingBlockName:Yc,categories:function(e=Vc,t){switch(t.type){case"SET_CATEGORIES":return t.categories||[];case"UPDATE_CATEGORY":if(!t.category||!Object.keys(t.category).length)return e;if(e.find((({slug:e})=>e===t.slug)))return e.map((e=>e.slug===t.slug?{...e,...t.category}:e))}return e},collections:function(e={},t){switch(t.type){case"ADD_BLOCK_COLLECTION":return{...e,[t.namespace]:{title:t.title,icon:t.icon}};case"REMOVE_BLOCK_COLLECTION":return Uc(e,t.namespace)}return e},blockBindingsSources:function(e={},t){return"REGISTER_BLOCK_BINDINGS_SOURCE"===t.type?{...e,[t.sourceName]:{label:t.sourceLabel,getValue:t.getValue,setValue:t.setValue,setValues:t.setValues,getPlaceholder:t.getPlaceholder,canUserEditValue:t.canUserEditValue||(()=>!1)}}:e}});var Xc=n(38986),Zc=n.n(Xc);const Qc=(e,t,n)=>{var r;const o=Array.isArray(t)?t:t.split(".");let i=e;return o.forEach((e=>{i=i?.[e]})),null!==(r=i)&&void 0!==r?r:n},eu=(e,t)=>"string"==typeof t?nu(e,t):t,tu=(0,Ws.A)((e=>Object.values(e.blockTypes)),(e=>[e.blockTypes]));function nu(e,t){return e.blockTypes[t]}function ru(e,t){return e.blockStyles[t]}const ou=(0,Ws.A)(((e,t,n)=>{const r=e.blockVariations[t];return r&&n?r.filter((e=>(e.scope||["block","inserter"]).includes(n))):r}),((e,t)=>[e.blockVariations[t]]));function iu(e,t,n,r){const o=ou(e,t,r);if(!o)return o;const i=nu(e,t),s=Object.keys(i?.attributes||{});let a,l=0;for(const e of o)if(Array.isArray(e.isActive)){const t=e.isActive.filter((e=>{const t=e.split(".")[0];return s.includes(t)})),r=t.length;if(0===r)continue;t.every((t=>{const r=Qc(n,t);return void 0!==r&&r===Qc(e.attributes,t)}))&&r>l&&(a=e,l=r)}else if(e.isActive?.(n,e.attributes))return a||e;return a}function su(e,t,n){const r=ou(e,t,n);return[...r].reverse().find((({isDefault:e})=>!!e))||r[0]}function au(e){return e.categories}function lu(e){return e.collections}function cu(e){return e.defaultBlockName}function uu(e){return e.freeformFallbackBlockName}function du(e){return e.unregisteredFallbackBlockName}function hu(e){return e.groupingBlockName}const pu=(0,Ws.A)(((e,t)=>tu(e).filter((e=>e.parent?.includes(t))).map((({name:e})=>e))),(e=>[e.blockTypes])),fu=(e,t,n,r)=>{const o=eu(e,t);return o?.supports?Qc(o.supports,n,r):r};function mu(e,t,n,r){return!!fu(e,t,n,r)}function gu(e){return Zc()(null!=e?e:"").toLowerCase().trim()}function bu(e,t,n=""){const r=eu(e,t),o=gu(n),i=e=>gu(e).includes(o);return i(r.title)||r.keywords?.some(i)||i(r.category)||"string"==typeof r.description&&i(r.description)}const yu=(e,t)=>pu(e,t).length>0,vu=(e,t)=>pu(e,t).some((t=>mu(e,t,"inserter",!0))),_u=(0,Ws.A)(((e,t)=>{const n=nu(e,t);return!!n&&Object.entries(n.attributes).some((([,{__experimentalRole:e}])=>"content"===e))}),((e,t)=>[e.blockTypes[t]?.attributes])),xu=["background","backgroundColor","color","linkColor","captionColor","buttonColor","headingColor","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","padding","contentSize","wideSize","blockGap","textDecoration","textTransform","letterSpacing"];function wu(e,t,n){return e.filter((e=>!("fontSize"===e&&"heading"===n||"textDecoration"===e&&!t&&"link"!==n||"textTransform"===e&&!t&&!["heading","h1","h2","h3","h4","h5","h6"].includes(n)&&"button"!==n&&"caption"!==n&&"text"!==n||"letterSpacing"===e&&!t&&!["heading","h1","h2","h3","h4","h5","h6"].includes(n)&&"button"!==n&&"caption"!==n&&"text"!==n||"textColumns"===e&&!t)))}const ku=(0,Ws.A)(((e,t,n)=>{if(!t)return wu(xu,t,n);const r=nu(e,t);if(!r)return[];const o=[];return r?.supports?.spacing?.blockGap&&o.push("blockGap"),r?.supports?.shadow&&o.push("shadow"),Object.keys(uc).forEach((e=>{uc[e].support&&(uc[e].requiresOptOut&&uc[e].support[0]in r.supports&&!1!==Qc(r.supports,uc[e].support)||Qc(r.supports,uc[e].support,!1))&&o.push(e)})),wu(o,t,n)}),((e,t)=>[e.blockTypes[t]]));function Cu(e,t){return e.bootstrappedBlockTypes[t]}function Su(e){return e.unprocessedBlockTypes}function Au(e){return e.blockBindingsSources}function Eu(e,t){return e.blockBindingsSources[t]}var Iu=n(94260),ju=n(74448),Tu=n(9067);const Bu=(...e)=>window?.console?.error?.(...e),Ru={common:"text",formatting:"text",layout:"design"};function Nu(e=[],t=[]){const n=[...e];return t.forEach((e=>{const t=n.findIndex((t=>t.name===e.name));-1!==t?n[t]={...n[t],...e}:n.push(e)})),n}const Du=(e,t)=>({select:n})=>{const r=n.getBootstrappedBlockType(e),o={name:e,icon:lc,keywords:[],attributes:{},providesContext:{},usesContext:[],selectors:{},supports:{},styles:[],blockHooks:{},save:()=>null,...r,...t,variations:Nu(r?.variations,t?.variations)},i=(0,Tu.applyFilters)("blocks.registerBlockType",o,e,null);if(i.description&&"string"!=typeof i.description&&(0,q.default)("Declaring non-string block descriptions",{since:"6.2"}),i.deprecated&&(i.deprecated=i.deprecated.map((e=>Object.fromEntries(Object.entries((0,Tu.applyFilters)("blocks.registerBlockType",{...Uc(o,cc),...e},o.name,e)).filter((([e])=>cc.includes(e))))))),(0,Iu.Q)(i))if("function"==typeof i.save)if(!("edit"in i)||(0,ju.isValidElementType)(i.edit))if(Ru.hasOwnProperty(i.category)&&(i.category=Ru[i.category]),"category"in i&&!n.getCategories().some((({slug:e})=>e===i.category))&&(((...e)=>{window?.console?.warn?.(...e)})('The block "'+e+'" is registered with an invalid category "'+i.category+'".'),delete i.category),"title"in i&&""!==i.title)if("string"==typeof i.title){if(i.icon=function(e){if(Mc(e=e||lc))return{src:e};if("background"in e){const t=(0,oc.Mj)(e.background),n=e=>t.contrast(e),r=Math.max(...Rc.map(n));return{...e,foreground:e.foreground?e.foreground:Rc.find((e=>n(e)===r)),shadowColor:t.alpha(.3).toRgbString()}}return e}(i.icon),Mc(i.icon.src))return i;Bu("The icon passed is invalid. The icon should be a string, an element, a function, or an object following the specifications documented in https://developer.wordpress.org/block-editor/developers/block-api/block-registration/#icon-optional")}else Bu("Block titles must be strings.");else Bu('The block "'+e+'" must have a title.');else Bu('The "edit" property must be a valid component.');else Bu('The "save" property must be a valid function.');else Bu("Block settings must be a valid object.")};function Mu(e){return{type:"ADD_BLOCK_TYPES",blockTypes:Array.isArray(e)?e:[e]}}function Pu(){return({dispatch:e,select:t})=>{const n=[];for(const[r,o]of Object.entries(t.getUnprocessedBlockTypes())){const t=e(Du(r,o));t&&n.push(t)}n.length&&e.addBlockTypes(n)}}function Ou(){return(0,q.default)('wp.data.dispatch( "core/blocks" ).__experimentalReapplyBlockFilters',{since:"6.4",alternative:"reapplyBlockFilters"}),Pu()}function Lu(e){return{type:"REMOVE_BLOCK_TYPES",names:Array.isArray(e)?e:[e]}}function Fu(e,t){return{type:"ADD_BLOCK_STYLES",styles:Array.isArray(t)?t:[t],blockNames:Array.isArray(e)?e:[e]}}function zu(e,t){return{type:"REMOVE_BLOCK_STYLES",styleNames:Array.isArray(t)?t:[t],blockName:e}}function Uu(e,t){return{type:"ADD_BLOCK_VARIATIONS",variations:Array.isArray(t)?t:[t],blockName:e}}function Vu(e,t){return{type:"REMOVE_BLOCK_VARIATIONS",variationNames:Array.isArray(t)?t:[t],blockName:e}}function Hu(e){return{type:"SET_DEFAULT_BLOCK_NAME",name:e}}function $u(e){return{type:"SET_FREEFORM_FALLBACK_BLOCK_NAME",name:e}}function Wu(e){return{type:"SET_UNREGISTERED_FALLBACK_BLOCK_NAME",name:e}}function Gu(e){return{type:"SET_GROUPING_BLOCK_NAME",name:e}}function qu(e){return{type:"SET_CATEGORIES",categories:e}}function Ku(e,t){return{type:"UPDATE_CATEGORY",slug:e,category:t}}function Yu(e,t,n){return{type:"ADD_BLOCK_COLLECTION",namespace:e,title:t,icon:n}}function Ju(e){return{type:"REMOVE_BLOCK_COLLECTION",namespace:e}}function Xu(e,t){return{type:"ADD_BOOTSTRAPPED_BLOCK_TYPE",name:e,blockType:t}}function Zu(e,t){return({dispatch:n})=>{n({type:"ADD_UNPROCESSED_BLOCK_TYPE",name:e,blockType:t});const r=n(Du(e,t));r&&n.addBlockTypes(r)}}function Qu(e){return{type:"REGISTER_BLOCK_BINDINGS_SOURCE",sourceName:e.name,sourceLabel:e.label,getValue:e.getValue,setValue:e.setValue,setValues:e.setValues,getPlaceholder:e.getPlaceholder,canUserEditValue:e.canUserEditValue}}const ed=(0,R.A)("core/blocks",{reducer:Jc,selectors:a,actions:c});function td(e,t={},n=[]){const r=zc(e,t);return{clientId:(0,W.A)(),name:e,isValid:!0,attributes:r,innerBlocks:n}}function nd(e=[]){return e.map((e=>{const t=Array.isArray(e)?e:[e.name,e.attributes,e.innerBlocks],[n,r,o=[]]=t;return td(n,r,nd(o))}))}function rd(e,t={},n){const r=(0,W.A)(),o=zc(e.name,{...e.attributes,...t});return{...e,clientId:r,attributes:o,innerBlocks:n||e.innerBlocks.map((e=>rd(e)))}}function od(e,t={},n){const r=(0,W.A)();return{...e,clientId:r,attributes:{...e.attributes,...t},innerBlocks:n||e.innerBlocks.map((e=>od(e)))}}(0,N.register)(ed),gc(ed).registerPrivateSelectors(l),gc(ed).registerPrivateActions(u);const id=(e,t,n)=>{if(!n.length)return!1;const r=n.length>1,o=n[0].name;if(!sd(e)&&r&&!e.isMultiBlock)return!1;if(!sd(e)&&!n.every((e=>e.name===o)))return!1;if("block"!==e.type)return!1;const i=n[0];return!("from"===t&&-1===e.blocks.indexOf(i.name)&&!sd(e)||!r&&"from"===t&&ad(i.name)&&ad(e.blockName)||!ud(e,n))},sd=e=>e&&"block"===e.type&&Array.isArray(e.blocks)&&e.blocks.includes("*"),ad=e=>e===(0,pc.L)(ed).getGroupingBlockName();function ld(e,t){const n=(0,Tu.createHooks)();for(let r=0;r<e.length;r++){const o=e[r];t(o)&&n.addFilter("transform","transform/"+r.toString(),(e=>e||o),o.priority)}return n.applyFilters("transform",null)}function cd(e,t){if(void 0===t)return Ac().map((({name:t})=>cd(e,t))).flat();const n=Pc(t),{name:r,transforms:o}=n||{};if(!o||!Array.isArray(o[e]))return[];const i=o.supportedMobileTransforms&&Array.isArray(o.supportedMobileTransforms),s=i?o[e].filter((e=>"raw"===e.type||!(!e.blocks||!e.blocks.length)&&(!!sd(e)||e.blocks.every((e=>o.supportedMobileTransforms.includes(e)))))):o[e];return s.map((e=>({...e,blockName:r,usingMobileTransformations:i})))}function ud(e,t){if("function"!=typeof e.isMatch)return!0;const n=t[0],r=e.isMultiBlock?t.map((e=>e.attributes)):n.attributes,o=e.isMultiBlock?t:n;return e.isMatch(r,o)}function dd(e,t){const n=Array.isArray(e)?e:[e],r=n.length>1,o=n[0],i=o.name,s=cd("from",t),a=ld(cd("to",i),(e=>"block"===e.type&&(sd(e)||-1!==e.blocks.indexOf(t))&&(!r||e.isMultiBlock)&&ud(e,n)))||ld(s,(e=>"block"===e.type&&(sd(e)||-1!==e.blocks.indexOf(i))&&(!r||e.isMultiBlock)&&ud(e,n)));if(!a)return null;let l;return l=a.isMultiBlock?"__experimentalConvert"in a?a.__experimentalConvert(n):a.transform(n.map((e=>e.attributes)),n.map((e=>e.innerBlocks))):"__experimentalConvert"in a?a.__experimentalConvert(o):a.transform(o.attributes,o.innerBlocks),null===l||"object"!=typeof l?null:(l=Array.isArray(l)?l:[l],l.some((e=>!Sc(e.name)))?null:l.some((e=>e.name===t))?l.map(((t,n,r)=>(0,Tu.applyFilters)("blocks.switchToBlockType.transformedBlock",t,e,n,r))):null)}const hd=(e,t)=>{try{var n;return td(e,t.attributes,(null!==(n=t.innerBlocks)&&void 0!==n?n:[]).map((e=>hd(e.name,e))))}catch{return td("core/missing",{originalName:e,originalContent:"",originalUndelimitedContent:""})}};let pd,fd,md,gd;const bd=/<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/g;function yd(e,t,n,r,o){return{blockName:e,attrs:t,innerBlocks:n,innerHTML:r,innerContent:o}}function vd(e){return yd(null,{},[],e,[e])}const _d=e=>{pd=e,fd=0,md=[],gd=[],bd.lastIndex=0;do{}while(xd());return md};function xd(){const e=gd.length,t=function(){const e=bd.exec(pd);if(null===e)return["no-more-tokens","",null,0,0];const t=e.index,[n,r,o,i,s,,a]=e,l=n.length,c=!!r,u=!!a,d=(o||"core/")+i,h=!!s?function(e){try{return JSON.parse(e)}catch(e){return null}}(s):{};return u?["void-block",d,h,t,l]:c?["block-closer",d,null,t,l]:["block-opener",d,h,t,l]}(),[n,r,o,i,s]=t,a=i>fd?fd:null;switch(n){case"no-more-tokens":if(0===e)return wd(),!1;if(1===e)return Cd(),!1;for(;0<gd.length;)Cd();return!1;case"void-block":return 0===e?(null!==a&&md.push(vd(pd.substr(a,i-a))),md.push(yd(r,o,[],"",[])),fd=i+s,!0):(kd(yd(r,o,[],"",[]),i,s),fd=i+s,!0);case"block-opener":return gd.push(function(e,t,n,r,o){return{block:e,tokenStart:t,tokenLength:n,prevOffset:r||t+n,leadingHtmlStart:o}}(yd(r,o,[],"",[]),i,s,i+s,a)),fd=i+s,!0;case"block-closer":if(0===e)return wd(),!1;if(1===e)return Cd(i),fd=i+s,!0;const t=gd.pop(),n=pd.substr(t.prevOffset,i-t.prevOffset);return t.block.innerHTML+=n,t.block.innerContent.push(n),t.prevOffset=i+s,kd(t.block,t.tokenStart,t.tokenLength,i+s),fd=i+s,!0;default:return wd(),!1}}function wd(e){const t=e||pd.length-fd;0!==t&&md.push(vd(pd.substr(fd,t)))}function kd(e,t,n,r){const o=gd[gd.length-1];o.block.innerBlocks.push(e);const i=pd.substr(o.prevOffset,t-o.prevOffset);i&&(o.block.innerHTML+=i,o.block.innerContent.push(i)),o.block.innerContent.push(null),o.prevOffset=r||t+n}function Cd(e){const{block:t,leadingHtmlStart:n,prevOffset:r,tokenStart:o}=gd.pop(),i=e?pd.substr(r,e-r):pd.substr(r);i&&(t.innerHTML+=i,t.innerContent.push(i)),null!==n&&md.push(vd(pd.substr(n,o-n))),md.push(t)}const Sd=new RegExp("(<((?=!--|!\\[CDATA\\[)((?=!-)!(?:-(?!->)[^\\-]*)*(?:--\x3e)?|!\\[CDATA\\[[^\\]]*(?:](?!]>)[^\\]]*)*?(?:]]>)?)|[^>]*>?))");var Ad=n(19799),Ed=n(49069),Id=n(42891);function jd(e,t={}){const{isCommentDelimited:n=!0}=t,{blockName:r,attrs:o={},innerBlocks:i=[],innerContent:s=[]}=e;let a=0;const l=s.map((e=>null!==e?e:jd(i[a++],t))).join("\n").replace(/\n+/g,"\n").trim();return n?Fd(r,o,l):l}var Td=n(86106);function Bd(e){const t="wp-block-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,Tu.applyFilters)("blocks.getBlockDefaultClassName",t,e)}function Rd(e){const t="editor-block-list-item-"+e.replace(/\//,"-").replace(/^core-/,"");return(0,Tu.applyFilters)("blocks.getBlockMenuDefaultClassName",t,e)}const Nd={},Dd={};function Md(e={}){const{blockType:t,attributes:n}=Nd;return Md.skipFilters?e:(0,Tu.applyFilters)("blocks.getSaveContent.extraProps",{...e},t,n)}function Pd(e,t,n=[]){const r=Pc(e);if(!r?.save)return null;let{save:o}=r;if(o.prototype instanceof S.Component){const e=new o({attributes:t});o=e.render.bind(e)}Nd.blockType=r,Nd.attributes=t,Dd.innerBlocks=n;let i=o({attributes:t,innerBlocks:n});if(null!==i&&"object"==typeof i&&(0,Tu.hasFilter)("blocks.getSaveContent.extraProps")&&!(r.apiVersion>1)){const e=(0,Tu.applyFilters)("blocks.getSaveContent.extraProps",{...i.props},r,t);(0,Id.default)(e,i.props)||(i=(0,S.cloneElement)(i,e))}return(0,Tu.applyFilters)("blocks.getSaveElement",i,r,t)}function Od(e,t,n){const r=Pc(e);return(0,Ed.Ay)(Pd(r,t,n))}function Ld(e){let t=e.originalContent;if(e.isValid||e.innerBlocks.length)try{t=Od(e.name,e.attributes,e.innerBlocks)}catch(e){}return t}function Fd(e,t,n){const r=t&&Object.entries(t).length?function(e){return JSON.stringify(e).replace(/--/g,"\\u002d\\u002d").replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\\"/g,"\\u0022")}(t)+" ":"",o=e?.startsWith("core/")?e.slice(5):e;return n?`\x3c!-- wp:${o} ${r}--\x3e\n`+n+`\n\x3c!-- /wp:${o} --\x3e`:`\x3c!-- wp:${o} ${r}/--\x3e`}function zd(e,t){return(Array.isArray(e)?e:[e]).map((e=>function(e,{isInnerBlocks:t=!1}={}){if(!e.isValid&&e.__unstableBlockSource)return jd(e.__unstableBlockSource);const n=e.name,r=Ld(e);if(n===kc()||!t&&n===wc())return r;const o=Sc(n);if(!o)return r;const i=function(e,t){var n;return Object.entries(null!==(n=e.attributes)&&void 0!==n?n:{}).reduce(((e,[n,r])=>{const o=t[n];return void 0===o||void 0!==r.source||"default"in r&&JSON.stringify(r.default)===JSON.stringify(o)||(e[n]=o),e}),{})}(o,e.attributes);return Fd(n,i,r)}(e,t))).join("\n\n")}var Ud=/[\t\n\f ]/,Vd=/[A-Za-z]/,Hd=/\r\n?/g;function $d(e){return Ud.test(e)}function Wd(e){return Vd.test(e)}var Gd=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||Wd(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(){$d(this.consume())&&this.transitionTo("beforeDoctypeName")},beforeDoctypeName:function(){var e=this.consume();$d(e)||(this.transitionTo("doctypeName"),this.delegate.appendToDoctypeName&&this.delegate.appendToDoctypeName(e.toLowerCase()))},doctypeName:function(){var e=this.consume();$d(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(!$d(e))if(">"===e)this.delegate.endDoctype&&this.delegate.endDoctype(),this.transitionTo("beforeData");else{var t=e.toUpperCase()+this.input.substring(this.index,this.index+5).toUpperCase(),n="PUBLIC"===t.toUpperCase(),r="SYSTEM"===t.toUpperCase();(n||r)&&(this.consume(),this.consume(),this.consume(),this.consume(),this.consume(),this.consume()),n?this.transitionTo("afterDoctypePublicKeyword"):r&&this.transitionTo("afterDoctypeSystemKeyword")}},afterDoctypePublicKeyword:function(){var e=this.peek();$d(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();$d(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();$d(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();$d(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();$d(e)?this.transitionTo("beforeAttributeName"):"/"===e?this.transitionTo("selfClosingStartTag"):">"===e?(this.delegate.finishTag(),this.transitionTo("beforeData")):this.appendToTagName(e)},endTagName:function(){var e=this.consume();$d(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();$d(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();$d(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();$d(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();$d(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();$d(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();$d(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||Wd(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(Hd,"\n")}(e);this.index<this.input.length;){var t=this.states[this.state];if(void 0===t)throw new Error("unhandled state "+this.state);t.call(this)}},e.prototype.tokenizeEOF=function(){this.flushData()},e.prototype.flushData=function(){"data"===this.state&&(this.delegate.finishData(),this.transitionTo("beforeData"))},e.prototype.peek=function(){return this.input.charAt(this.index)},e.prototype.consume=function(){var e=this.peek();return this.index++,"\n"===e?(this.line++,this.column=0):this.column++,e},e.prototype.consumeCharRef=function(){var e=this.input.indexOf(";",this.index);if(-1!==e){var t=this.input.slice(this.index,e),n=this.entityParser.parse(t);if(n){for(var r=t.length;r;)this.consume(),r--;return this.consume(),n}}},e.prototype.markTagStart=function(){this.delegate.tagOpen()},e.prototype.appendToTagName=function(e){this.tagNameBuffer+=e,this.delegate.appendToTagName(e)},e.prototype.isIgnoredEndTag=function(){var e=this.tagNameBuffer;return"title"===e&&"</title>"!==this.input.substring(this.index,this.index+8)||"style"===e&&"</style>"!==this.input.substring(this.index,this.index+8)||"script"===e&&"<\/script>"!==this.input.substring(this.index,this.index+9)},e}(),qd=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 Gd(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;t<arguments.length;t++)if(e.type===arguments[t])return e;throw new Error("token type was unexpectedly "+e.type)},e.prototype.push=function(e){this.token=e,this.tokens.push(e)},e.prototype.currentAttribute=function(){return this._currentAttribute},e.prototype.addLocInfo=function(){this.options.loc&&(this.current().loc={start:{line:this.startLine,column:this.startColumn},end:{line:this.tokenizer.line,column:this.tokenizer.column}}),this.startLine=this.tokenizer.line,this.startColumn=this.tokenizer.column},e.prototype.beginDoctype=function(){this.push({type:"Doctype",name:""})},e.prototype.appendToDoctypeName=function(e){this.current("Doctype").name+=e},e.prototype.appendToDoctypePublicIdentifier=function(e){var t=this.current("Doctype");void 0===t.publicIdentifier?t.publicIdentifier=e:t.publicIdentifier+=e},e.prototype.appendToDoctypeSystemIdentifier=function(e){var t=this.current("Doctype");void 0===t.systemIdentifier?t.systemIdentifier=e:t.systemIdentifier+=e},e.prototype.endDoctype=function(){this.addLocInfo()},e.prototype.beginData=function(){this.push({type:"Chars",chars:""})},e.prototype.appendToData=function(e){this.current("Chars").chars+=e},e.prototype.finishData=function(){this.addLocInfo()},e.prototype.beginComment=function(){this.push({type:"Comment",chars:""})},e.prototype.appendToCommentData=function(e){this.current("Comment").chars+=e},e.prototype.finishComment=function(){this.addLocInfo()},e.prototype.tagOpen=function(){},e.prototype.beginStartTag=function(){this.push({type:"StartTag",tagName:"",attributes:[],selfClosing:!1})},e.prototype.beginEndTag=function(){this.push({type:"EndTag",tagName:""})},e.prototype.finishTag=function(){this.addLocInfo()},e.prototype.markTagAsSelfClosing=function(){this.current("StartTag").selfClosing=!0},e.prototype.appendToTagName=function(e){this.current("StartTag","EndTag").tagName+=e},e.prototype.beginAttribute=function(){this._currentAttribute=["","",!1]},e.prototype.appendToAttributeName=function(e){this.currentAttribute()[0]+=e},e.prototype.beginAttributeValue=function(e){this.currentAttribute()[2]=e},e.prototype.appendToAttributeValue=function(e){this.currentAttribute()[1]+=e},e.prototype.finishAttributeValue=function(){this.current("StartTag").attributes.push(this._currentAttribute)},e.prototype.reportSyntaxError=function(e){this.current().syntaxError=e},e}();function Kd(){function e(e){return(t,...n)=>e("Block validation: "+t,...n)}return{error:e(console.error),warning:e(console.warn),getItems:()=>[]}}const Yd=/[\t\n\r\v\f ]+/g,Jd=/^[\t\n\r\v\f ]*$/,Xd=/^url\s*\(['"\s]*(.*?)['"\s]*\)$/,Zd=["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"],Qd=[...Zd,"autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"],eh=[e=>e,function(e){return ih(e).join(" ")}],th=/^[\da-z]+$/i,nh=/^#\d+$/,rh=/^#x[\da-f]+$/i;class oh{parse(e){if(t=e,th.test(t)||nh.test(t)||rh.test(t))return(0,Qa.decodeEntities)("&"+e+";");var t}}function ih(e){return e.trim().split(Yd)}function sh(e){return e.attributes.filter((e=>{const[t,n]=e;return n||0===t.indexOf("data-")||Qd.includes(t)}))}function ah(e,t,n=Kd()){let r=e.chars,o=t.chars;for(let e=0;e<eh.length;e++){const t=eh[e];if(r=t(r),o=t(o),r===o)return!0}return n.warning("Expected text `%s`, saw `%s`.",t.chars,e.chars),!1}function lh(e){return 0===parseFloat(e)?"0":0===e.indexOf(".")?"0"+e:e}function ch(e){return ih(e).map(lh).join(" ").replace(Xd,"url($1)")}function uh(e){const t=e.replace(/;?\s*$/,"").split(";").map((e=>{const[t,...n]=e.split(":"),r=n.join(":");return[t.trim(),ch(r.trim())]}));return Object.fromEntries(t)}const dh={class:(e,t)=>{const[n,r]=[e,t].map(ih),o=n.filter((e=>!r.includes(e))),i=r.filter((e=>!n.includes(e)));return 0===o.length&&0===i.length},style:(e,t)=>M()(...[e,t].map(uh)),...Object.fromEntries(Zd.map((e=>[e,()=>!0])))},hh={StartTag:(e,t,n=Kd())=>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=Kd()){if(e.length!==t.length)return n.warning("Expected attributes %o, instead saw %o.",t,e),!1;const r={};for(let e=0;e<t.length;e++)r[t[e][0].toLowerCase()]=t[e][1];for(let t=0;t<e.length;t++){const[o,i]=e[t],s=o.toLowerCase();if(!r.hasOwnProperty(s))return n.warning("Encountered unexpected attribute `%s`.",o),!1;const a=r[s],l=dh[s];if(l){if(!l(i,a))return n.warning("Expected attribute `%s` of value `%s`, saw `%s`.",o,a,i),!1}else if(i!==a)return n.warning("Expected attribute `%s` of value `%s`, saw `%s`.",o,a,i),!1}return!0}(...[e,t].map(sh),n),Chars:ah,Comment:ah};function ph(e){let t;for(;t=e.shift();){if("Chars"!==t.type)return t;if(!Jd.test(t.chars))return t}}function fh(e,t){return!!e.selfClosing&&!(!t||t.tagName!==e.tagName||"EndTag"!==t.type)}function mh(e,t=e.name){if(e.name===wc()||e.name===kc())return[!0,[]];const n=function(){const e=[],t=Kd();return{error(...n){e.push({log:t.error,args:n})},warning(...n){e.push({log:t.warning,args:n})},getItems:()=>e}}(),r=Pc(t);let o;try{o=Od(r,e.attributes)}catch(e){return n.error("Block validation failed because an error occurred while generating block content:\n\n%s",e.toString()),[!1,n.getItems()]}const i=function(e,t,n=Kd()){if(e===t)return!0;const[r,o]=[e,t].map((e=>function(e,t=Kd()){try{return new qd(new oh).tokenize(e)}catch(n){t.warning("Malformed HTML detected: %s",e)}return null}(e,n)));if(!r||!o)return!1;let i,s;for(;i=ph(r);){if(s=ph(o),!s)return n.warning("Expected end of content, instead saw %o.",i),!1;if(i.type!==s.type)return n.warning("Expected token of type `%s` (%o), instead saw `%s` (%o).",s.type,s,i.type,i),!1;const e=hh[i.type];if(e&&!e(i,s,n))return!1;fh(i,o[0])?ph(o):fh(s,r[0])&&ph(r)}return!(s=ph(o))||(n.warning("Expected %o, instead saw end of content.",s),!1)}(e.originalContent,o,n);return i||n.error("Block validation failed for `%s` (%o).\n\nContent generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",r.name,r,o,e.originalContent),[i,n.getItems()]}function gh(e,t){const n={...t};if("core/cover-image"===e&&(e="core/cover"),"core/text"!==e&&"core/cover-text"!==e||(e="core/paragraph"),e&&0===e.indexOf("core/social-link-")&&(n.service=e.substring(17),e="core/social-link"),e&&0===e.indexOf("core-embed/")){const t=e.substring(11),r={speaker:"speaker-deck",polldaddy:"crowdsignal"};n.providerNameSlug=t in r?r[t]:t,["amazon-kindle","wordpress"].includes(t)||(n.responsive=!0),e="core/embed"}if("core/post-comment-author"===e&&(e="core/comment-author-name"),"core/post-comment-content"===e&&(e="core/comment-content"),"core/post-comment-date"===e&&(e="core/comment-date"),"core/comments-query-loop"===e){e="core/comments";const{className:t=""}=n;t.includes("wp-block-comments-query-loop")||(n.className=["wp-block-comments-query-loop",t].join(" "))}if("core/post-comments"===e&&(e="core/comments",n.legacy=!0),globalThis.IS_GUTENBERG_PLUGIN&&n.metadata?.bindings&&("core/paragraph"===e||"core/heading"===e||"core/image"===e||"core/button"===e)&&"core/pattern-overrides"!==n.metadata.bindings.__default?.source){let e=!1;["content","url","title","id","alt","text","linkTarget"].forEach((t=>{"core/pattern-overrides"===n.metadata.bindings[t]?.source&&(e=!0,n.metadata={...n.metadata,bindings:{...n.metadata.bindings}},delete n.metadata.bindings[t])})),e&&(n.metadata.bindings.__default={source:"core/pattern-overrides"})}return[e,n]}var bh=function(){var e;return function(){return e||(e=document.implementation.createHTMLDocument("")),e}}();function yh(e,t){if(t){if("string"==typeof e){var n=bh();n.body.innerHTML=e,e=n.body}if("function"==typeof t)return t(e);if(Object===t.constructor)return Object.keys(t).reduce((function(n,r){var o=t[r];return n[r]=yh(e,o),n}),{})}}function vh(e,t){var n,r;return 1===arguments.length?(n=e,r=void 0):(n=t,r=e),function(e){var t=e;if(r&&(t=e.querySelector(r)),t)return function(e,t){for(var n,r=t.split(".");n=r.shift();){if(!(n in e))return;e=e[n]}return e}(t,n)}}var _h=n(60204);function xh(e){const t={};for(let n=0;n<e.length;n++){const{name:r,value:o}=e[n];t[r]=o}return t}function wh(e){if((0,q.default)("wp.blocks.node.fromDOM",{since:"6.1",version:"6.3",alternative:"wp.richText.create",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),e.nodeType===e.TEXT_NODE)return e.nodeValue;if(e.nodeType!==e.ELEMENT_NODE)throw new TypeError("A block node can only be created from a node of type text or element.");return{type:e.nodeName.toLowerCase(),props:{...xh(e.attributes),children:kh(e.childNodes)}}}function kh(e){(0,q.default)("wp.blocks.children.fromDOM",{since:"6.1",version:"6.3",alternative:"wp.richText.create",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"});const t=[];for(let n=0;n<e.length;n++)try{t.push(wh(e[n]))}catch(e){}return t}function Ch(e){return(0,q.default)("wp.blocks.children.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;return e&&(n=t.querySelector(e)),n?kh(n.childNodes):[]}}const Sh={concat:function(...e){(0,q.default)("wp.blocks.children.concat",{since:"6.1",version:"6.3",alternative:"wp.richText.concat",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"});const t=[];for(let n=0;n<e.length;n++){const r=Array.isArray(e[n])?e[n]:[e[n]];for(let e=0;e<r.length;e++){const n=r[e];"string"==typeof n&&"string"==typeof t[t.length-1]?t[t.length-1]+=n:t.push(n)}}return t},getChildrenArray:function(e){return(0,q.default)("wp.blocks.children.getChildrenArray",{since:"6.1",version:"6.3",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),e},fromDOM:kh,toHTML:function(e){(0,q.default)("wp.blocks.children.toHTML",{since:"6.1",version:"6.3",alternative:"wp.richText.toHTMLString",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"});const t=e;return(0,Ed.Ay)(t)},matcher:Ch};function Ah(e,t,n,r,o){let i;switch(t.source){case void 0:i=r?r[e]:void 0;break;case"raw":i=o;break;case"attribute":case"property":case"html":case"text":case"rich-text":case"children":case"node":case"query":case"tag":i=jh(n,t)}return function(e,t){return void 0===t||function(e,t){return t.some((t=>function(e,t){switch(t){case"rich-text":return e instanceof $.RichTextData;case"string":return"string"==typeof e;case"boolean":return"boolean"==typeof e;case"object":return!!e&&e.constructor===Object;case"null":return null===e;case"array":return Array.isArray(e);case"integer":case"number":return"number"==typeof e}return!0}(e,t)))}(e,Array.isArray(t)?t:[t])}(i,t.type)&&function(e,t){return!Array.isArray(t)||t.includes(e)}(i,t.enum)||(i=void 0),void 0===i&&(i=Fc(t)),i}const Eh=(0,_h.A)((e=>{switch(e.source){case"attribute":{let t=function(e,t){var n,r;return 1===arguments.length?(n=e,r=void 0):(n=t,r=e),function(e){var t=vh(r,"attributes")(e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n].value}}(e.selector,e.attribute);return"boolean"===e.type&&(t=(e=>t=>void 0!==e(t))(t)),t}case"html":return function(e,t){return n=>{let r=n;if(e&&(r=n.querySelector(e)),!r)return"";if(t){let e="";const n=r.children.length;for(let o=0;o<n;o++){const n=r.children[o];n.nodeName.toLowerCase()===t&&(e+=n.outerHTML)}return e}return r.innerHTML}}(e.selector,e.multiline);case"text":return function(e){return vh(e,"textContent")}(e.selector);case"rich-text":return((e,t)=>n=>{const r=e?n.querySelector(e):n;return r?$.RichTextData.fromHTMLElement(r,{preserveWhiteSpace:t}):$.RichTextData.empty()})(e.selector,e.__unstablePreserveWhiteSpace);case"children":return Ch(e.selector);case"node":return function(e){return(0,q.default)("wp.blocks.node.matcher",{since:"6.1",version:"6.3",alternative:"html source",link:"https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/"}),t=>{let n=t;e&&(n=t.querySelector(e));try{return wh(n)}catch(e){return null}}}(e.selector);case"query":const t=Object.fromEntries(Object.entries(e.query).map((([e,t])=>[e,Eh(t)])));return function(e,t){return function(n){var r=n.querySelectorAll(e);return[].map.call(r,(function(e){return yh(e,t)}))}}(e.selector,t);case"tag":{const t=vh(e.selector,"nodeName");return e=>t(e)?.toLowerCase()}default:console.error(`Unknown source type "${e.source}"`)}}));function Ih(e){return yh(e,(e=>e))}function jh(e,t){return Eh(t)(Ih(e))}function Th(e,t,n={}){var r;const o=Ih(t),i=Pc(e),s=Object.fromEntries(Object.entries(null!==(r=i.attributes)&&void 0!==r?r:{}).map((([e,r])=>[e,Ah(e,r,o,n,t)])));return(0,Tu.applyFilters)("blocks.getBlockAttributes",s,i,t,n)}const Bh={type:"string",source:"attribute",selector:"[data-custom-class-name] > *",attribute:"class"};function Rh(e){const t=jh(`<div data-custom-class-name>${e}</div>`,Bh);return t?t.trim().split(/\s+/):[]}function Nh(e,t){const n=function(e,t,n){if(Ic(t,"customClassName",!0)){const{className:r,...o}=e,i=Od(t,o),s=Rh(i),a=Rh(n).filter((e=>!s.includes(e)));a.length?e.className=a.join(" "):i&&delete e.className}return e}(e.attributes,t,e.originalContent);return{...e,attributes:n}}function Dh(){return!1}function Mh(e,t){const n=wc(),r=e.blockName||wc(),o=e.attrs||{},i=e.innerBlocks||[];let s=e.innerHTML.trim();return r!==n||"core/freeform"!==r||t?.__unstableSkipAutop||(s=function(e,t=!0){const n=[];if(""===e.trim())return"";if(-1!==(e+="\n").indexOf("<pre")){const t=e.split("</pre>"),r=t.pop();e="";for(let r=0;r<t.length;r++){const o=t[r],i=o.indexOf("<pre");if(-1===i){e+=o;continue}const s="<pre wp-pre-tag-"+r+"></pre>";n.push([s,o.substr(i)+"</pre>"]),e+=o.substr(0,i)+s}e+=r}const r="(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)";-1!==(e=function(e,t){const n=function(e){const t=[];let n,r=e;for(;n=r.match(Sd);){const e=n.index;t.push(r.slice(0,e)),t.push(n[0]),r=r.slice(e+n[0].length)}return r.length&&t.push(r),t}(e);let r=!1;const o=Object.keys(t);for(let e=1;e<n.length;e+=2)for(let i=0;i<o.length;i++){const s=o[i];if(-1!==n[e].indexOf(s)){n[e]=n[e].replace(new RegExp(s,"g"),t[s]),r=!0;break}}return r&&(e=n.join("")),e}(e=(e=(e=(e=e.replace(/<br\s*\/?>\s*<br\s*\/?>/g,"\n\n")).replace(new RegExp("(<"+r+"[\\s/>])","g"),"\n\n$1")).replace(new RegExp("(</"+r+">)","g"),"$1\n\n")).replace(/\r\n|\r/g,"\n"),{"\n":" \x3c!-- wpnl --\x3e "})).indexOf("<option")&&(e=(e=e.replace(/\s*<option/g,"<option")).replace(/<\/option>\s*/g,"</option>")),-1!==e.indexOf("</object>")&&(e=(e=(e=e.replace(/(<object[^>]*>)\s*/g,"$1")).replace(/\s*<\/object>/g,"</object>")).replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/g,"$1")),-1===e.indexOf("<source")&&-1===e.indexOf("<track")||(e=(e=(e=e.replace(/([<\[](?:audio|video)[^>\]]*[>\]])\s*/g,"$1")).replace(/\s*([<\[]\/(?:audio|video)[>\]])/g,"$1")).replace(/\s*(<(?:source|track)[^>]*>)\s*/g,"$1")),-1!==e.indexOf("<figcaption")&&(e=(e=e.replace(/\s*(<figcaption[^>]*>)/,"$1")).replace(/<\/figcaption>\s*/,"</figcaption>"));const o=(e=e.replace(/\n\n+/g,"\n\n")).split(/\n\s*\n/).filter(Boolean);return e="",o.forEach((t=>{e+="<p>"+t.replace(/^\n*|\n*$/g,"")+"</p>\n"})),e=(e=(e=(e=(e=(e=(e=(e=e.replace(/<p>\s*<\/p>/g,"")).replace(/<p>([^<]+)<\/(div|address|form)>/g,"<p>$1</p></$2>")).replace(new RegExp("<p>\\s*(</?"+r+"[^>]*>)\\s*</p>","g"),"$1")).replace(/<p>(<li.+?)<\/p>/g,"$1")).replace(/<p><blockquote([^>]*)>/gi,"<blockquote$1><p>")).replace(/<\/blockquote><\/p>/g,"</p></blockquote>")).replace(new RegExp("<p>\\s*(</?"+r+"[^>]*>)","g"),"$1")).replace(new RegExp("(</?"+r+"[^>]*>)\\s*</p>","g"),"$1"),t&&(e=e.replace(/<(script|style).*?<\/\\1>/g,(e=>e[0].replace(/\n/g,"<WPPreserveNewline />"))),e=(e=e.replace(/<br>|<br\/>/g,"<br />")).replace(/(<br \/>)?\s*\n/g,((e,t)=>t?e:"<br />\n")),e=e.replace(/<WPPreserveNewline \/>/g,"\n")),e=(e=(e=e.replace(new RegExp("(</?"+r+"[^>]*>)\\s*<br />","g"),"$1")).replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g,"$1")).replace(/\n<\/p>$/g,"</p>"),n.forEach((t=>{const[n,r]=t;e=e.replace(n,r)})),-1!==e.indexOf("\x3c!-- wpnl --\x3e")&&(e=e.replace(/\s?<!-- wpnl -->\s?/g,"\n")),e}(s).trim()),{...e,blockName:r,attrs:o,innerHTML:s,innerBlocks:i}}function Ph(e,t){let n=Mh(e,t);n=function(e){const[t,n]=gh(e.blockName,e.attrs);return{...e,blockName:t,attrs:n}}(n);let r=Sc(n.blockName);r||(n=function(e){const t=kc()||wc(),n=jd(e,{isCommentDelimited:!1}),r=jd(e,{isCommentDelimited:!0});return{blockName:t,attrs:{originalName:e.blockName,originalContent:r,originalUndelimitedContent:n},innerHTML:e.blockName?r:e.innerHTML,innerBlocks:e.innerBlocks,innerContent:e.innerContent}}(n),r=Sc(n.blockName));const o=n.blockName===wc()||n.blockName===kc();if(!r||!n.innerHTML&&o)return;const i=n.innerBlocks.map((e=>Ph(e,t))).filter((e=>!!e)),s=td(n.blockName,Th(r,n.innerHTML,n.attrs),i);s.originalContent=n.innerHTML;const a=function(e,t){const[n]=mh(e,t);if(n)return{...e,isValid:n,validationIssues:[]};const r=Nh(e,t),[o,i]=mh(e,t);return{...r,isValid:o,validationIssues:i}}(s,r),{validationIssues:l}=a,c=function(e,t,n){const r=t.attrs,{deprecated:o}=n;if(!o||!o.length)return e;for(let i=0;i<o.length;i++){const{isEligible:s=Dh}=o[i];if(e.isValid&&!s(r,e.innerBlocks,{blockNode:t,block:e}))continue;const a=Object.assign(Uc(n,cc),o[i]);let l={...e,attributes:Th(a,e.originalContent,r)},[c]=mh(l,a);if(c||(l=Nh(l,a),[c]=mh(l,a)),!c)continue;let u=l.innerBlocks,d=l.attributes;const{migrate:h}=a;if(h){let t=h(d,e.innerBlocks);Array.isArray(t)||(t=[t]),[d=r,u=e.innerBlocks]=t}e={...e,attributes:d,innerBlocks:u,isValid:!0,validationIssues:[]}}return e}(a,n,r);return c.isValid||(c.__unstableBlockSource=e),a.isValid||!c.isValid||t?.__unstableSkipMigrationLogs?a.isValid||c.isValid||l.forEach((({log:e,args:t})=>e(...t))):(console.groupCollapsed("Updated Block: %s",r.name),console.info("Block successfully updated for `%s` (%o).\n\nNew content generated by `save` function:\n\n%s\n\nContent retrieved from post body:\n\n%s",r.name,r,Od(r,c.attributes),c.originalContent),console.groupEnd()),c}function Oh(e,t){return _d(e).reduce(((e,n)=>{const r=Ph(n,t);return r&&e.push(r),e}),[])}var Lh=n(28636);function Fh(){return cd("from").filter((({type:e})=>"raw"===e)).map((e=>e.isMatch?e:{...e,isMatch:t=>e.selector&&t.matches(e.selector)}))}function zh(e,t){const n=document.implementation.createHTMLDocument("");return n.body.innerHTML=e,Array.from(n.body.children).flatMap((e=>{const n=ld(Fh(),(({isMatch:t})=>t(e)));if(!n)return Lh.A.isNative?Oh(`\x3c!-- wp:html --\x3e${e.outerHTML}\x3c!-- /wp:html --\x3e`):td("core/html",Th("core/html",e.outerHTML));const{transform:r,blockName:o}=n;if(r){const n=r(e,t);return e.hasAttribute("class")&&(n.attributes.className=e.getAttribute("class")),n}return td(o,Th(o,e.outerHTML))}))}var Uh=n(59652),Vh=n(8171);function Hh(e,t={}){const n=document.implementation.createHTMLDocument(""),r=document.implementation.createHTMLDocument(""),o=n.body,i=r.body;for(o.innerHTML=e;o.firstChild;){const e=o.firstChild;e.nodeType===e.TEXT_NODE?(0,Uh.A)(e)?o.removeChild(e):(i.lastChild&&"P"===i.lastChild.nodeName||i.appendChild(r.createElement("P")),i.lastChild.appendChild(e)):e.nodeType===e.ELEMENT_NODE?"BR"===e.nodeName?(e.nextSibling&&"BR"===e.nextSibling.nodeName&&(i.appendChild(r.createElement("P")),o.removeChild(e.nextSibling)),i.lastChild&&"P"===i.lastChild.nodeName&&i.lastChild.hasChildNodes()?i.lastChild.appendChild(e):o.removeChild(e)):"P"===e.nodeName?(0,Uh.A)(e)&&!t.raw?o.removeChild(e):i.appendChild(e):(0,Vh.S)(e)?(i.lastChild&&"P"===i.lastChild.nodeName||i.appendChild(r.createElement("P")),i.lastChild.appendChild(e)):i.appendChild(e):o.removeChild(e)}return i.innerHTML}var $h=n(52042),Wh=n(32664);function Gh(e,t){if(e.nodeType!==e.COMMENT_NODE)return;if("nextpage"!==e.nodeValue&&0!==e.nodeValue.indexOf("more"))return;const n=function(e,t){if("nextpage"===e.nodeValue)return function(e){const t=e.createElement("wp-block");return t.dataset.block="core/nextpage",t}(t);const n=e.nodeValue.slice(4).trim();let r=e,o=!1;for(;r=r.nextSibling;)if(r.nodeType===r.COMMENT_NODE&&"noteaser"===r.nodeValue){o=!0,(0,Wh.A)(r);break}return function(e,t,n){const r=n.createElement("wp-block");return r.dataset.block="core/more",e&&(r.dataset.customText=e),t&&(r.dataset.noTeaser=""),r}(n,o,t)}(e,t);if(e.parentNode&&"P"===e.parentNode.nodeName){const r=Array.from(e.parentNode.childNodes),o=r.indexOf(e),i=e.parentNode.parentNode||t.body,s=(e,n)=>(e||(e=t.createElement("p")),e.appendChild(n),e);[r.slice(0,o).reduce(s,null),n,r.slice(o+1).reduce(s,null)].forEach((t=>t&&i.insertBefore(t,e.parentNode))),(0,Wh.A)(e.parentNode)}else(0,$h.A)(e,n)}var qh=n(58475);function Kh(e){return"OL"===e.nodeName||"UL"===e.nodeName}function Yh(e){if(!Kh(e))return;const t=e,n=e.previousElementSibling;if(n&&n.nodeName===e.nodeName&&1===t.children.length){for(;t.firstChild;)n.appendChild(t.firstChild);t.parentNode.removeChild(t)}const r=e.parentNode;if(r&&"LI"===r.nodeName&&1===r.children.length&&!/\S/.test((o=r,Array.from(o.childNodes).map((({nodeValue:e=""})=>e)).join("")))){const e=r,n=e.previousElementSibling,o=e.parentNode;n?(n.appendChild(t),o.removeChild(e)):(o.parentNode.insertBefore(t,o),o.parentNode.removeChild(o))}var o;if(r&&Kh(r)){const t=e.previousElementSibling;t?t.appendChild(e):(0,qh.A)(e)}}function Jh(e){return t=>{"BLOCKQUOTE"===t.nodeName&&(t.innerHTML=Hh(t.innerHTML,e))}}function Xh(e,t=e){const n=e.ownerDocument.createElement("figure");t.parentNode.insertBefore(n,t),n.appendChild(e)}function Zh(e,t,n){if(!function(e,t){var n;const r=e.nodeName.toLowerCase();return"figcaption"!==r&&!(0,Vh.jw)(e)&&r in(null!==(n=t?.figure?.children)&&void 0!==n?n:{})}(e,n))return;let r=e;const o=e.parentNode;(function(e,t){var n;return e.nodeName.toLowerCase()in(null!==(n=t?.figure?.children?.a?.children)&&void 0!==n?n:{})})(e,n)&&"A"===o.nodeName&&1===o.childNodes.length&&(r=e.parentNode);const i=r.closest("p,div");i?e.classList?(e.classList.contains("alignright")||e.classList.contains("alignleft")||e.classList.contains("aligncenter")||!i.textContent.trim())&&Xh(r,i):Xh(r,i):"BODY"===r.parentNode.nodeName&&Xh(r)}function Qh(e,t,n=0){const r=ep(e);r.lastIndex=n;const o=r.exec(t);if(!o)return;if("["===o[1]&&"]"===o[7])return Qh(e,t,r.lastIndex);const i={index:o.index,content:o[0],shortcode:np(o)};return o[1]&&(i.content=i.content.slice(1),i.index++),o[7]&&(i.content=i.content.slice(0,-1)),i}function ep(e){return new RegExp("\\[(\\[?)("+e+")(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)","g")}const tp=(0,_h.A)((e=>{const t={},n=[],r=/([\w-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w-]+)\s*=\s*'([^']*)'(?:\s|$)|([\w-]+)\s*=\s*([^\s'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|'([^']*)'(?:\s|$)|(\S+)(?:\s|$)/g;let o;for(e=e.replace(/[\u00a0\u200b]/g," ");o=r.exec(e);)o[1]?t[o[1].toLowerCase()]=o[2]:o[3]?t[o[3].toLowerCase()]=o[4]:o[5]?t[o[5].toLowerCase()]=o[6]:o[7]?n.push(o[7]):o[8]?n.push(o[8]):o[9]&&n.push(o[9]);return{named:t,numeric:n}}));function np(e){let t;return t=e[4]?"self-closing":e[6]?"closed":"single",new rp({tag:e[2],attrs:e[3],type:t,content:e[5]})}const rp=Object.assign((function(e){const{tag:t,attrs:n,type:r,content:o}=e||{};if(Object.assign(this,{tag:t,type:r,content:o}),this.attrs={named:{},numeric:[]},!n)return;const i=["named","numeric"];"string"==typeof n?this.attrs=tp(n):n.length===i.length&&i.every(((e,t)=>e===n[t]))?this.attrs=n:Object.entries(n).forEach((([e,t])=>{this.set(e,t)}))}),{next:Qh,replace:function(e,t,n){return t.replace(ep(e),(function(e,t,r,o,i,s,a,l){if("["===t&&"]"===l)return e;const c=n(np(arguments));return c||""===c?t+c+l:e}))},string:function(e){return new rp(e).string()},regexp:ep,attrs:tp,fromMatch:np});Object.assign(rp.prototype,{get(e){return this.attrs["number"==typeof e?"numeric":"named"][e]},set(e,t){return this.attrs["number"==typeof e?"numeric":"named"][e]=t,this},string(){let e="["+this.tag;return this.attrs.numeric.forEach((t=>{/\s/.test(t)?e+=' "'+t+'"':e+=" "+t})),Object.entries(this.attrs.named).forEach((([t,n])=>{e+=" "+t+'="'+n+'"'})),"single"===this.type?e+"]":"self-closing"===this.type?e+" /]":(e+="]",this.content&&(e+=this.content),e+"[/"+this.tag+"]")}});const op=e=>Array.isArray(e)?e:[e],ip=/(\n|<p>)\s*$/,sp=/^\s*(\n|<\/p>)/,ap=function e(t,n=0,r=[]){const o=ld(cd("from"),(e=>-1===r.indexOf(e.blockName)&&"shortcode"===e.type&&op(e.tag).some((e=>ep(e).test(t)))));if(!o)return[t];const i=op(o.tag).find((e=>ep(e).test(t)));let s;const a=n;if(s=Qh(i,t,n)){n=s.index+s.content.length;const i=t.substr(0,s.index),l=t.substr(n);if(!(s.shortcode.content?.includes("<")||ip.test(i)&&sp.test(l)))return e(t,n);if(o.isMatch&&!o.isMatch(s.shortcode.attrs))return e(t,a,[...r,o.blockName]);let c=[];if("function"==typeof o.transform)c=[].concat(o.transform(s.shortcode.attrs,s)),c=c.map((e=>(e.originalContent=s.shortcode.content,Nh(e,Sc(e.name)))));else{const e=Object.fromEntries(Object.entries(o.attributes).filter((([,e])=>e.shortcode)).map((([e,t])=>[e,t.shortcode(s.shortcode.attrs,s)]))),n=Sc(o.blockName);if(!n)return[t];const r={...n,attributes:o.attributes};let i=td(o.blockName,Th(r,s.shortcode.content,e));i.originalContent=s.shortcode.content,i=Nh(i,r),c=[i]}return[...e(i.replace(ip,"")),...c,...e(l.replace(sp,""))]}return[t]};function lp(e){return function(e,t){const n={phrasingContentSchema:(0,Vh.dA)(t),isPaste:"paste"===t},r=e.map((({isMatch:e,blockName:t,schema:r})=>{const o=Ic(t,"anchor");return r="function"==typeof r?r(n):r,o||e?r?Object.fromEntries(Object.entries(r).map((([t,n])=>{let r=n.attributes||[];return o&&(r=[...r,"id"]),[t,{...n,attributes:r,isMatch:e||void 0}]}))):{}:r}));function o(e,t,n){switch(n){case"children":return"*"===e||"*"===t?"*":{...e,...t};case"attributes":case"require":return[...e||[],...t||[]];case"isMatch":if(!e||!t)return;return(...n)=>e(...n)||t(...n)}}function i(e,t){for(const n in t)e[n]=e[n]?o(e[n],t[n],n):{...t[n]};return e}return r.reduce((function(e,t){for(const n in t)e[n]=e[n]?i(e[n],t[n]):{...t[n]};return e}),{})}(Fh(),e)}function cp(e,t,n,r){Array.from(e).forEach((e=>{cp(e.childNodes,t,n,r),t.forEach((t=>{n.contains(e)&&t(e,n,r)}))}))}function up(e,t=[],n){const r=document.implementation.createHTMLDocument("");return r.body.innerHTML=e,cp(r.body.childNodes,t,r,n),r.body.innerHTML}function dp(e,t){const n=e[`${t}Sibling`];if(n&&(0,Vh.S)(n))return n;const{parentNode:r}=e;return r&&(0,Vh.S)(r)?dp(r,t):void 0}function hp({HTML:e=""}){if(-1!==e.indexOf("\x3c!-- wp:"))return Oh(e);const t=ap(e),n=lp();return t.map((e=>"string"!=typeof e?e:zh(e=Hh(e=up(e,[Yh,Gh,Zh,Jh({raw:!0})],n),{raw:!0}),hp))).flat().filter(Boolean)}var pp=n(75450);function fp(e){e.nodeType===e.COMMENT_NODE&&(0,Wh.A)(e)}function mp(e,t){return e.every((e=>function(e,t){if((0,Vh.jw)(e))return!0;if(!t)return!1;const n=e.nodeName.toLowerCase();return[["ul","li","ol"],["h1","h2","h3","h4","h5","h6"]].some((e=>0===[n,t].filter((t=>!e.includes(t))).length))}(e,t)&&mp(Array.from(e.children),t)))}function gp(e){return"BR"===e.nodeName&&e.previousSibling&&"BR"===e.previousSibling.nodeName}var bp=n(22676),yp=n(62891);function vp(e,t){if("SPAN"===e.nodeName&&e.style){const{fontWeight:n,fontStyle:r,textDecorationLine:o,textDecoration:i,verticalAlign:s}=e.style;"bold"!==n&&"700"!==n||(0,bp.A)(t.createElement("strong"),e),"italic"===r&&(0,bp.A)(t.createElement("em"),e),("line-through"===o||i.includes("line-through"))&&(0,bp.A)(t.createElement("s"),e),"super"===s?(0,bp.A)(t.createElement("sup"),e):"sub"===s&&(0,bp.A)(t.createElement("sub"),e)}else"B"===e.nodeName?e=(0,yp.A)(e,"strong"):"I"===e.nodeName?e=(0,yp.A)(e,"em"):"A"===e.nodeName&&(e.target&&"_blank"===e.target.toLowerCase()?e.rel="noreferrer noopener":(e.removeAttribute("target"),e.removeAttribute("rel")),e.name&&!e.id&&(e.id=e.name),e.id&&!e.ownerDocument.querySelector(`[href="#${e.id}"]`)&&e.removeAttribute("id"))}function _p(e){"SCRIPT"!==e.nodeName&&"NOSCRIPT"!==e.nodeName&&"TEMPLATE"!==e.nodeName&&"STYLE"!==e.nodeName||e.parentNode.removeChild(e)}function xp(e){if(e.nodeType!==e.ELEMENT_NODE)return;const t=e.getAttribute("style");if(!t||!t.includes("mso-list"))return;const n=t.split(";").reduce(((e,t)=>{const[n,r]=t.split(":");return n&&r&&(e[n.trim().toLowerCase()]=r.trim().toLowerCase()),e}),{});"ignore"===n["mso-list"]&&e.remove()}function wp(e){return"OL"===e.nodeName||"UL"===e.nodeName}function kp(e,t){if("P"!==e.nodeName)return;const n=e.getAttribute("style");if(!n||!n.includes("mso-list"))return;const r=e.previousElementSibling;if(!r||!wp(r)){const n=e.textContent.trim().slice(0,1),r=/[1iIaA]/.test(n),o=t.createElement(r?"ol":"ul");r&&o.setAttribute("type",n),e.parentNode.insertBefore(o,e)}const o=e.previousElementSibling,i=o.nodeName,s=t.createElement("li");let a=o;s.innerHTML=up(e.innerHTML,[xp]);const l=/mso-list\s*:[^;]+level([0-9]+)/i.exec(n);let c=l&&parseInt(l[1],10)-1||0;for(;c--;)a=a.lastChild||a,wp(a)&&(a=a.lastChild||a);wp(a)||(a=a.appendChild(t.createElement(i))),a.appendChild(s),e.parentNode.removeChild(e)}function Cp(e){if("IMG"===e.nodeName){if(0===e.src.indexOf("file:")&&(e.src=""),0===e.src.indexOf("data:")){const[t,n]=e.src.split(","),[r]=t.slice(5).split(";");if(!n||!r)return void(e.src="");let o;try{o=atob(n)}catch(t){return void(e.src="")}const i=new Uint8Array(o.length);for(let e=0;e<i.length;e++)i[e]=o.charCodeAt(e);const s=r.replace("/","."),a=new window.File([i],s,{type:r});e.src=Zl(a)}1!==e.height&&1!==e.width||e.parentNode.removeChild(e)}}function Sp(e){"DIV"===e.nodeName&&(e.innerHTML=Hh(e.innerHTML))}var Ap=n(49482);const Ep=new(n.n(Ap)().Converter)({noHeaderId:!0,tables:!0,literalMidWordUnderscores:!0,omitExtraWLInCodeBlocks:!0,simpleLineBreaks:!0,strikethrough:!0});function Ip(e){if("IFRAME"===e.nodeName){const t=e.ownerDocument.createTextNode(e.src);e.parentNode.replaceChild(t,e)}}function jp(e){e.id&&0===e.id.indexOf("docs-internal-guid-")&&("B"===e.tagName?(0,qh.A)(e):e.removeAttribute("id"))}function Tp(e){if(e.nodeType!==e.TEXT_NODE)return;let t=e;for(;t=t.parentNode;)if(t.nodeType===t.ELEMENT_NODE&&"PRE"===t.nodeName)return;let n=e.data.replace(/[ \r\n\t]+/g," ");if(" "===n[0]){const t=dp(e,"previous");t&&"BR"!==t.nodeName&&" "!==t.textContent.slice(-1)||(n=n.slice(1))}if(" "===n[n.length-1]){const t=dp(e,"next");(!t||"BR"===t.nodeName||t.nodeType===t.TEXT_NODE&&function(e){return" "===e||"\r"===e||"\n"===e||"\t"===e}(t.textContent[0]))&&(n=n.slice(0,-1))}n?e.data=n:e.parentNode.removeChild(e)}function Bp(e){"BR"===e.nodeName&&(dp(e,"next")||e.parentNode.removeChild(e))}function Rp(e){"P"===e.nodeName&&(e.hasChildNodes()||e.parentNode.removeChild(e))}function Np(e){if("SPAN"!==e.nodeName)return;if("paragraph-break"!==e.getAttribute("data-stringify-type"))return;const{parentNode:t}=e;t.insertBefore(e.ownerDocument.createElement("br"),e),t.insertBefore(e.ownerDocument.createElement("br"),e),t.removeChild(e)}const Dp=(...e)=>window?.console?.log?.(...e);function Mp(e){return e=up(e,[_p,jp,xp,vp,fp]),e=up(e=(0,pp.A)(e,(0,Vh.dA)("paste"),{inline:!0}),[Tp,Bp]),Dp("Processed inline HTML:\n\n",e),e}function Pp({HTML:e="",plainText:t="",mode:n="AUTO",tagName:r}){if(e=(e=(e=e.replace(/<meta[^>]+>/g,"")).replace(/^\s*<html[^>]*>\s*<body[^>]*>(?:\s*<!--\s*StartFragment\s*-->)?/i,"")).replace(/(?:<!--\s*EndFragment\s*-->\s*)?<\/body>\s*<\/html>\s*$/i,""),"INLINE"!==n){const n=e||t;if(-1!==n.indexOf("\x3c!-- wp:"))return Oh(n)}String.prototype.normalize&&(e=e.normalize()),e=up(e,[Np]);const o=t&&(!e||function(e){return!/<(?!br[ />])/i.test(e)}(e));var i;o&&(e=t,/^\s+$/.test(t)||(i=e,e=Ep.makeHtml(function(e){return e.replace(/((?:^|\n)```)([^\n`]+)(```(?:$|\n))/,((e,t,n,r)=>`${t}\n${n}\n${r}`))}(function(e){return e.replace(/(^|\n)•( +)/g,"$1*$2")}(i)))));const s=ap(e),a=s.length>1;if(o&&!a&&"AUTO"===n&&-1===t.indexOf("\n")&&0!==t.indexOf("<p>")&&0===e.indexOf("<p>")&&(n="INLINE"),"INLINE"===n)return Mp(e);if("AUTO"===n&&!a&&function(e,t){const n=document.implementation.createHTMLDocument("");n.body.innerHTML=e;const r=Array.from(n.body.children);return!r.some(gp)&&mp(r,t)}(e,r))return Mp(e);const l=(0,Vh.dA)("paste"),c=lp("paste"),u=s.map((e=>{if("string"!=typeof e)return e;const t=[jp,kp,_p,Yh,Cp,vp,Gh,fp,Ip,Zh,Jh(),Sp],n={...c,...l};return e=up(e,t,c),e=up(e=Hh(e=(0,pp.A)(e,n)),[Tp,Bp,Rp],c),Dp("Processed HTML piece:\n\n",e),zh(e,Pp)})).flat().filter(Boolean);if("AUTO"===n&&1===u.length&&Ic(u[0].name,"__unstablePasteTextInline",!1)){const e=/^[\n]+|[\n]+$/g,n=t.replace(e,"");if(""!==n&&-1===n.indexOf("\n"))return(0,pp.A)(Ld(u[0]),l).replace(e,"")}return u}function Op(e=[],t=[]){return e.length===t.length&&t.every((([t,,n],r)=>{const o=e[r];return t===o.name&&Op(o.innerBlocks,n)}))}const Lp=e=>"html"===e?.source,Fp=e=>"query"===e?.source;function zp(e,t){return t?Object.fromEntries(Object.entries(t).map((([t,n])=>[t,Up(e[t],n)]))):{}}function Up(e,t){return Lp(e)&&Array.isArray(t)?(0,Ed.Ay)(t):Fp(e)&&t?t.map((t=>zp(e.query,t))):t}function Vp(e=[],t){return t?t.map((([t,n,r],o)=>{var i;const s=e[o];if(s&&s.name===t){const e=Vp(s.innerBlocks,r);return{...s,innerBlocks:e}}const a=Sc(t),l=zp(null!==(i=a?.attributes)&&void 0!==i?i:{},n);let[c,u]=gh(t,l);return void 0===Sc(c)&&(u={originalName:t,originalContent:"",originalUndelimitedContent:""},c="core/missing"),td(c,u,Vp([],r))})):e}var Hp=n(90637),$p=n(60457);const Wp=Symbol("mayDisplayControls"),Gp=Symbol("mayDisplayParentControls"),qp=Symbol("blockEditingMode"),Kp=Symbol("blockBindings"),Yp=Symbol("isPreviewMode"),Jp={name:"",isSelected:!1},Xp=(0,S.createContext)(Jp),{Provider:Zp}=Xp;function Qp(){return(0,S.useContext)(Xp)}var ef=n(78528);const tf={insertUsage:{}},nf={alignWide:!1,supportsLayout:!0,colors:[{name:(0,H.__)("Black"),slug:"black",color:"#000000"},{name:(0,H.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,H.__)("White"),slug:"white",color:"#ffffff"},{name:(0,H.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,H.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,H.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,H.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,H.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,H.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,H.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,H.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,H.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,H._x)("Small","font size name"),size:13,slug:"small"},{name:(0,H._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,H._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,H._x)("Large","font size name"),size:36,slug:"large"},{name:(0,H._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,H.__)("Thumbnail")},{slug:"medium",name:(0,H.__)("Medium")},{slug:"large",name:(0,H.__)("Large")},{slug:"full",name:(0,H.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,enableOpenverseMediaCategory:!0,clearBlockSelection:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__unstableGalleryWithImageBlocks:!1,__unstableIsPreviewMode:!1,blockInspectorAnimation:{animationParent:"core/navigation","core/navigation":{enterDirection:"leftToRight"},"core/navigation-submenu":{enterDirection:"rightToLeft"},"core/navigation-link":{enterDirection:"rightToLeft"},"core/search":{enterDirection:"rightToLeft"},"core/social-links":{enterDirection:"rightToLeft"},"core/page-list":{enterDirection:"rightToLeft"},"core/spacer":{enterDirection:"rightToLeft"},"core/home-link":{enterDirection:"rightToLeft"},"core/site-title":{enterDirection:"rightToLeft"},"core/site-logo":{enterDirection:"rightToLeft"}},generateAnchors:!1,gradients:[{name:(0,H.__)("Vivid cyan blue to vivid purple"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:(0,H.__)("Light green cyan to vivid green cyan"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:(0,H.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,H.__)("Luminous vivid orange to vivid red"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:(0,H.__)("Very light gray to cyan bluish gray"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:(0,H.__)("Cool to warm spectrum"),gradient:"linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",slug:"cool-to-warm-spectrum"},{name:(0,H.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,H.__)("Blush bordeaux"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:(0,H.__)("Luminous dusk"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:(0,H.__)("Pale ocean"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:(0,H.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,H.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function rf(e,t,n){return[...e.slice(0,n),...Array.isArray(t)?t:[t],...e.slice(n)]}function of(e,t,n,r=1){const o=[...e];return o.splice(t,r),rf(o,e.slice(t,t+r),n)}const sf=e=>e;function af(e,t=""){const n=new Map,r=[];return n.set(t,r),e.forEach((e=>{const{clientId:t,innerBlocks:o}=e;r.push(t),af(o,t).forEach(((e,t)=>{n.set(t,e)}))})),n}function lf(e,t=""){const n=[],r=[[t,e]];for(;r.length;){const[e,t]=r.shift();t.forEach((({innerBlocks:t,...o})=>{n.push([o.clientId,e]),t?.length&&r.push([o.clientId,t])}))}return n}function cf(e,t=sf){const n=[],r=[...e];for(;r.length;){const{innerBlocks:e,...o}=r.shift();r.push(...e),n.push([o.clientId,t(o)])}return n}function uf(e){return cf(e,(e=>{const{attributes:t,...n}=e;return n}))}function df(e){return cf(e,(e=>e.attributes))}function hf(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&M()(e.clientIds,t.clientIds)&&function(e,t){return M()(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function pf(e,t){const n=e.tree,r=[...t],o=[...t];for(;r.length;){const e=r.shift();r.push(...e.innerBlocks),o.push(...e.innerBlocks)}for(const e of o)n.set(e.clientId,{});for(const t of o)n.set(t.clientId,Object.assign(n.get(t.clientId),{...e.byClientId.get(t.clientId),attributes:e.attributes.get(t.clientId),innerBlocks:t.innerBlocks.map((e=>n.get(e.clientId)))}))}function ff(e,t,n=!1){const r=e.tree,o=new Set([]),i=new Set;for(const r of t){let t=n?r:e.parents.get(r);do{if(e.controlledInnerBlocks[t]){i.add(t);break}o.add(t),t=e.parents.get(t)}while(void 0!==t)}for(const e of o)r.set(e,{...r.get(e)});for(const t of o)r.get(t).innerBlocks=(e.order.get(t)||[]).map((e=>r.get(e)));for(const t of i)r.set("controlled||"+t,{innerBlocks:(e.order.get(t)||[]).map((e=>r.get(e)))})}const mf=(0,ef.h)(N.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:r}=n;if(e===r)return t;(t={...t}).attributes=new Map(t.attributes),t.attributes.forEach(((n,o)=>{const{name:i}=t.byClientId.get(o);"core/block"===i&&n.ref===e&&t.attributes.set(o,{...n,ref:r})}))}return e(t,n)}),(e=>(t={},n)=>{const r=e(t,n);if(r===t)return t;switch(r.tree=t.tree?t.tree:new Map,n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":r.tree=new Map(r.tree),pf(r,n.blocks),ff(r,n.rootClientId?[n.rootClientId]:[""],!0);break;case"UPDATE_BLOCK":r.tree=new Map(r.tree),r.tree.set(n.clientId,{...r.tree.get(n.clientId),...r.byClientId.get(n.clientId),attributes:r.attributes.get(n.clientId)}),ff(r,[n.clientId],!1);break;case"SYNC_DERIVED_BLOCK_ATTRIBUTES":case"UPDATE_BLOCK_ATTRIBUTES":r.tree=new Map(r.tree),n.clientIds.forEach((e=>{r.tree.set(e,{...r.tree.get(e),attributes:r.attributes.get(e)})})),ff(r,n.clientIds,!1);break;case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=function(e){const t={},n=[...e];for(;n.length;){const{innerBlocks:e,...r}=n.shift();n.push(...e),t[r.clientId]=!0}return t}(n.blocks);r.tree=new Map(r.tree),n.replacedClientIds.forEach((t=>{r.tree.delete(t),e[t]||r.tree.delete("controlled||"+t)})),pf(r,n.blocks),ff(r,n.blocks.map((e=>e.clientId)),!1);const o=[];for(const e of n.clientIds){const n=t.parents.get(e);void 0===n||""!==n&&!r.byClientId.get(n)||o.push(n)}ff(r,o,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const o of n.clientIds){const n=t.parents.get(o);void 0===n||""!==n&&!r.byClientId.get(n)||e.push(n)}r.tree=new Map(r.tree),n.removedClientIds.forEach((e=>{r.tree.delete(e),r.tree.delete("controlled||"+e)})),ff(r,e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId?e.push(n.fromRootClientId):e.push(""),n.toRootClientId&&e.push(n.toRootClientId),r.tree=new Map(r.tree),ff(r,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];r.tree=new Map(r.tree),ff(r,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=[];r.attributes.forEach(((t,o)=>{"core/block"===r.byClientId.get(o).name&&t.ref===n.updatedId&&e.push(o)})),r.tree=new Map(r.tree),e.forEach((e=>{r.tree.set(e,{...r.byClientId.get(e),attributes:r.attributes.get(e),innerBlocks:r.tree.get(e).innerBlocks})})),ff(r,e,!1)}}return r}),(e=>(t,n)=>{const r=e=>{let r=e;for(let o=0;o<r.length;o++)!t.order.get(r[o])||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[r[o]]||(r===e&&(r=[...r]),r.push(...t.order.get(r[o])));return r};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:r(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:r(n.clientIds)}}return e(t,n)}),(e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const r={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...o}=e.shift();e.push(...n),t.controlledInnerBlocks[o.clientId]&&(r[o.clientId]=!0)}}let o=t;t.order.get(n.rootClientId)&&(o=e(o,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:r,clientIds:t.order.get(n.rootClientId)}));let i=o;if(n.blocks.length){i=e(i,{...n,type:"INSERT_BLOCKS",index:0});const o=new Map(i.order);Object.keys(r).forEach((e=>{t.order.get(e)&&o.set(e,t.order.get(e))})),i.order=o,i.tree=new Map(i.tree),Object.keys(r).forEach((e=>{const n=`controlled||${e}`;t.tree.has(n)&&i.tree.set(n,t.tree.get(n))}))}return i}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:new Map(uf(n.blocks)),attributes:new Map(df(n.blocks)),order:af(n.blocks),parents:new Map(lf(n.blocks)),controlledInnerBlocks:{}};return e.tree=new Map(t?.tree),pf(e,n.blocks),e.tree.set("",{innerBlocks:n.blocks.map((t=>e.tree.get(t.clientId)))}),e}return e(t,n)}),(function(e){let t,n,r=!1;return(o,i)=>{let s,a=e(o,i);var l;if("SET_EXPLICIT_PERSISTENT"===i.type&&(n=i.isPersistentChange,s=null===(l=o.isPersistentChange)||void 0===l||l),void 0!==n)return s=n,s===a.isPersistentChange?a:{...a,isPersistentChange:s};const c="MARK_LAST_CHANGE_AS_PERSISTENT"===i.type||r;var u;return o!==a||c?(a={...a,isPersistentChange:c?!r:!hf(i,t)},t=i,r="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===i.type,a):(r="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===i.type,s=null===(u=o?.isPersistentChange)||void 0===u||u,o.isPersistentChange===s?o:{...a,isPersistentChange:s})}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,r)=>{const o=e(n,r);return o!==n&&(o.isIgnoredChange=t.has(r.type)),o}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const r=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(r,n)}return e(t,n)}))({byClientId(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return uf(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"UPDATE_BLOCK":{if(!e.has(t.clientId))return e;const{attributes:n,...r}=t.updates;if(0===Object.values(r).length)return e;const o=new Map(e);return o.set(t.clientId,{...e.get(t.clientId),...r}),o}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),uf(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},attributes(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const n=new Map(e);return df(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"UPDATE_BLOCK":{if(!e.get(t.clientId)||!t.updates.attributes)return e;const n=new Map(e);return n.set(t.clientId,{...e.get(t.clientId),...t.updates.attributes}),n}case"SYNC_DERIVED_BLOCK_ATTRIBUTES":case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e.get(t))))return e;let r=!1;const o=new Map(e);for(const i of t.clientIds){var n;const s=Object.entries(t.uniqueByBlock?t.attributes[i]:null!==(n=t.attributes)&&void 0!==n?n:{});if(0===s.length)continue;let a=!1;const l=e.get(i),c={};s.forEach((([e,t])=>{l[e]!==t&&(a=!0,c[e]=t)})),r=r||a,a&&o.set(i,{...l,...c})}return r?o:e}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{if(!t.blocks)return e;const n=new Map(e);return t.replacedClientIds.forEach((e=>{n.delete(e)})),df(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},order(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{var n;const r=af(t.blocks),o=new Map(e);return r.forEach(((e,t)=>{""!==t&&o.set(t,e)})),o.set("",(null!==(n=e.get(""))&&void 0!==n?n:[]).concat(r[""])),o}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,r=e.get(n)||[],o=af(t.blocks,n),{index:i=r.length}=t,s=new Map(e);return o.forEach(((e,t)=>{s.set(t,e)})),s.set(n,rf(r,o.get(n),i)),s}case"MOVE_BLOCKS_TO_POSITION":{var r;const{fromRootClientId:n="",toRootClientId:o="",clientIds:i}=t,{index:s=e.get(o).length}=t;if(n===o){const t=e.get(o).indexOf(i[0]),n=new Map(e);return n.set(o,of(e.get(o),t,s,i.length)),n}const a=new Map(e);return a.set(n,null!==(r=e.get(n)?.filter((e=>!i.includes(e))))&&void 0!==r?r:[]),a.set(o,rf(e.get(o),i,s)),a}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:r=""}=t,o=n[0],i=e.get(r);if(!i.length||o===i[0])return e;const s=i.indexOf(o),a=new Map(e);return a.set(r,of(i,s,s-1,n.length)),a}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:r=""}=t,o=n[0],i=n[n.length-1],s=e.get(r);if(!s.length||i===s[s.length-1])return e;const a=s.indexOf(o),l=new Map(e);return l.set(r,of(s,a,a+1,n.length)),l}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const r=af(t.blocks),o=new Map(e);return t.replacedClientIds.forEach((e=>{o.delete(e)})),r.forEach(((e,t)=>{""!==t&&o.set(t,e)})),o.forEach(((e,t)=>{const i=Object.values(e).reduce(((e,t)=>t===n[0]?[...e,...r.get("")]:(-1===n.indexOf(t)&&e.push(t),e)),[]);o.set(t,i)})),o}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n.forEach(((e,r)=>{var o;const i=null!==(o=e?.filter((e=>!t.removedClientIds.includes(e))))&&void 0!==o?o:[];i.length!==e.length&&n.set(r,i)})),n}}return e},parents(e=new Map,t){switch(t.type){case"RECEIVE_BLOCKS":{const n=new Map(e);return lf(t.blocks).forEach((([e,t])=>{n.set(e,t)})),n}case"INSERT_BLOCKS":{const n=new Map(e);return lf(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)})),lf(t.blocks,e.get(t.clientIds[0])).forEach((([e,t])=>{n.set(e,t)})),n}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const n=new Map(e);return t.removedClientIds.forEach((e=>{n.delete(e)})),n}}return e},controlledInnerBlocks:(e={},{type:t,clientId:n,hasControlledInnerBlocks:r})=>"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:r}:e});function gf(e={},t){switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}const bf=(0,N.combineReducers)({blocks:mf,isDragging:function(e=!1,t){switch(t.type){case"START_DRAGGING":return!0;case"STOP_DRAGGING":return!1}return e},isTyping:function(e=!1,t){switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},isBlockInterfaceHidden:function(e=!1,t){switch(t.type){case"HIDE_BLOCK_INTERFACE":return!0;case"SHOW_BLOCK_INTERFACE":return!1}return e},draggedBlocks:function(e=[],t){switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},selection:function(e={},t){switch(t.type){case"SELECTION_CHANGE":return t.clientId?{selectionStart:{clientId:t.clientId,attributeKey:t.attributeKey,offset:t.startOffset},selectionEnd:{clientId:t.clientId,attributeKey:t.attributeKey,offset:t.endOffset}}:{selectionStart:t.start||e.selectionStart,selectionEnd:t.end||e.selectionEnd};case"RESET_SELECTION":const{selectionStart:n,selectionEnd:r}=t;return{selectionStart:n,selectionEnd:r};case"MULTI_SELECT":const{start:o,end:i}=t;return o===e.selectionStart?.clientId&&i===e.selectionEnd?.clientId?e:{selectionStart:{clientId:o},selectionEnd:{clientId:i}};case"RESET_BLOCKS":const s=e?.selectionStart?.clientId,a=e?.selectionEnd?.clientId;if(!s&&!a)return e;if(!t.blocks.some((e=>e.clientId===s)))return{selectionStart:{},selectionEnd:{}};if(!t.blocks.some((e=>e.clientId===a)))return{...e,selectionEnd:e.selectionStart}}const n=gf(e.selectionStart,t),r=gf(e.selectionEnd,t);return n===e.selectionStart&&r===e.selectionEnd?e:{selectionStart:n,selectionEnd:r}},isMultiSelecting:function(e=!1,t){switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(e=!0,t){return"TOGGLE_SELECTION"===t.type?t.isSelectionEnabled:e},initialPosition:function(e=null,t){return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(e={},t){if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:(e={},t)=>{switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return Object.fromEntries(Object.entries(e).filter((([e])=>!t.clientIds.includes(e))));case"UPDATE_BLOCK_LIST_SETTINGS":{const n="string"==typeof t.clientId?{[t.clientId]:t.settings}:t.clientId;for(const t in n)n[t]?M()(e[t],n[t])&&delete n[t]:e[t]||delete n[t];if(0===Object.keys(n).length)return e;const r={...e,...n};for(const e in n)n[e]||delete r[e];return r}}return e},insertionPoint:function(e=null,t){switch(t.type){case"SHOW_INSERTION_POINT":{const{rootClientId:n,index:r,__unstableWithInserter:o,operation:i,nearestSide:s}=t,a={rootClientId:n,index:r,__unstableWithInserter:o,operation:i,nearestSide:s};return M()(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=nf,t){return"UPDATE_SETTINGS"===t.type?t.reset?{...nf,...t.settings}:{...e,...t.settings}:e},preferences:function(e=tf,t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":{const n=t.blocks.reduce(((e,n)=>{const{attributes:r,name:o}=n;let i=o;const s=(0,pc.L)(ed).getActiveBlockVariation(o,r);return s?.name&&(i+="/"+s.name),"core/block"===o&&(i+="/"+r.ref),{...e,[i]:{time:t.time,count:e[i]?e[i].count+1:1}}}),e.insertUsage);return{...e,insertUsage:n}}}return e},lastBlockAttributesChange:function(e=null,t){switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return e},lastFocus:function(e=!1,t){return"LAST_FOCUS"===t.type?t.lastFocus:e},editorMode:function(e="edit",t){return"INSERT_BLOCKS"===t.type&&"navigation"===e?"edit":"SET_EDITOR_MODE"===t.type?t.mode:e},hasBlockMovingClientId:function(e=null,t){return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_EDITOR_MODE"===t.type?null:e},expandedBlock:function(e=null,t){switch(t.type){case"SET_BLOCK_EXPANDED_IN_LIST_VIEW":return t.clientId;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:r}=t;return r?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(e={},t){switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":if(!t.blocks.length)return e;const n=t.blocks.map((e=>e.clientId)),r=t.meta?.source;return{clientIds:n,source:r};case"RESET_BLOCKS":return{}}return e},temporarilyEditingAsBlocks:function(e="",t){return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.temporarilyEditingAsBlocks:e},temporarilyEditingFocusModeRevert:function(e="",t){return"SET_TEMPORARILY_EDITING_AS_BLOCKS"===t.type?t.focusModeToRevert:e},blockVisibility:function(e={},t){return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e},blockEditingModes:function(e=new Map,t){switch(t.type){case"SET_BLOCK_EDITING_MODE":return new Map(e).set(t.clientId,t.mode);case"UNSET_BLOCK_EDITING_MODE":{const n=new Map(e);return n.delete(t.clientId),n}case"RESET_BLOCKS":return e.has("")?(new Map).set("",e.get("")):e}return e},styleOverrides:function(e=new Map,t){switch(t.type){case"SET_STYLE_OVERRIDE":return new Map(e).set(t.id,t.style);case"DELETE_STYLE_OVERRIDE":{const n=new Map(e);return n.delete(t.id),n}}return e},removalPromptData:function(e=!1,t){switch(t.type){case"DISPLAY_BLOCK_REMOVAL_PROMPT":const{clientIds:e,selectPrevious:n,message:r}=t;return{clientIds:e,selectPrevious:n,message:r};case"CLEAR_BLOCK_REMOVAL_PROMPT":return!1}return e},blockRemovalRules:function(e=!1,t){return"SET_BLOCK_REMOVAL_RULES"===t.type?t.rules:e},openedBlockSettingsMenu:function(e=null,t){var n;return"SET_OPENED_BLOCK_SETTINGS_MENU"===t.type?null!==(n=t?.clientId)&&void 0!==n?n:null:e},registeredInserterMediaCategories:function(e=[],t){return"REGISTER_INSERTER_MEDIA_CATEGORY"===t.type?[...e,t.category]:e}}),yf=function(e){return(t,n)=>{const r=e(t,n);return t?(r.automaticChangeStatus=t.automaticChangeStatus,"MARK_AUTOMATIC_CHANGE"===n.type?{...r,automaticChangeStatus:"pending"}:"MARK_AUTOMATIC_CHANGE_FINAL"===n.type&&"pending"===t.automaticChangeStatus?{...r,automaticChangeStatus:"final"}:r.blocks===t.blocks&&r.selection===t.selection||"final"!==r.automaticChangeStatus&&r.selection!==t.selection?r:{...r,automaticChangeStatus:void 0}):r}}(bf);var vf=n(28510);const _f=Symbol("globalStylesDataKey"),xf=Symbol("selectBlockPatternsKey"),wf=Symbol("reusableBlocksSelect"),{lock:kf,unlock:Cf}=(0,Nl.yf)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/block-editor"),Sf="core/block-editor",Af=Symbol("withRootClientId"),Ef=(e,t,n=null)=>"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n,If=(e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){const e=n.shift();if(!Ef(t,e.name||e.blockName,!0))return!1;e.innerBlocks?.forEach((e=>{n.push(e)}))}return!0},jf=e=>t=>[t.settings.__experimentalBlockPatterns,t.settings.__experimentalUserPatternCategories,t.settings.__experimentalReusableBlocks,t.settings[xf]?.(e),t.blockPatterns,Cf(e(Sf)).getReusableBlocks()];function Tf(e,t){return[e.blockListSettings[t],e.blocks.byClientId.get(t),e.settings.allowedBlockTypes,e.settings.templateLock,e.blockEditingModes]}const Bf=(e,t,n)=>(r,o)=>{let i,s;if("function"==typeof e?(i=e(r),s=e(o)):(i=r[e],s=o[e]),i>s)return"asc"===n?1:-1;if(s>i)return"asc"===n?-1:1;const a=t.findIndex((e=>e===r)),l=t.findIndex((e=>e===o));return a>l?1:l>a?-1:0};function Rf(e,t,n="asc"){return e.concat().sort(Bf(t,e,n))}const Nf={user:"user",theme:"theme",directory:"directory"},Df={full:"fully",unsynced:"unsynced"},Mf={name:"allPatterns",label:(0,H._x)("All","patterns")},Pf={name:"myPatterns",label:(0,H.__)("My patterns")};function Of(e,t,n){const r=e.name.startsWith("core/block"),o="core"===e.source||e.source?.startsWith("pattern-directory");return!(t!==Nf.theme||!r&&!o)||!(t!==Nf.directory||!r&&o)||t===Nf.user&&e.type!==Nf.user||n===Df.full&&""!==e.syncStatus||!(n!==Df.unsynced||"unsynced"===e.syncStatus||!r)}function Lf(e,t,n){t=Array.isArray(t)?[...t]:[t],e=Array.isArray(e)?[...e]:{...e};const r=t.pop();let o=e;for(const e of t){const t=o[e];o=o[e]=Array.isArray(t)?[...t]:{...t}}return o[r]=n,e}const Ff=(e,t,n)=>{var r;const o=Array.isArray(t)?t:t.split(".");let i=e;return o.forEach((e=>{i=i?.[e]})),null!==(r=i)&&void 0!==r?r:n},zf=["color","border","dimensions","typography","spacing"],Uf={"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},Vf={"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"},Hf=e=>Vf[e]||e;function $f(e,t,...n){const r=ym(e,t),o=[];if(t){let n=t;do{Ic(ym(e,n),"__experimentalSettings",!1)&&o.push(n)}while(n=e.blocks.parents.get(n))}return n.map((n=>{if(zf.includes(n))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let i=(0,Tu.applyFilters)("blockEditor.useSetting.before",void 0,n,t,r);if(void 0!==i)return i;const s=Hf(n);for(const t of o){var a;const n=_m(e,t);if(i=null!==(a=Ff(n.settings?.blocks?.[r],s))&&void 0!==a?a:Ff(n.settings,s),void 0!==i)break}const l=sb(e);var c,u;if(void 0===i&&r&&(i=Ff(l.__experimentalFeatures?.blocks?.[r],s)),void 0===i&&(i=Ff(l.__experimentalFeatures,s)),void 0!==i)return hc[s]?null!==(c=null!==(u=i.custom)&&void 0!==u?u:i.theme)&&void 0!==c?c:i.default:i;const d=Uf[s]?.(l);return void 0!==d?d:"typography.dropCap"===s||void 0}))}function Wf(e){return e.isBlockInterfaceHidden}function Gf(e){return e?.lastBlockInserted?.clientIds}function qf(e,t){return e.blocks.byClientId.get(t)}const Kf=(e,t)=>{const n=t=>"disabled"===Cb(e,t)&&hg(e,t).every(n);return hg(e,t).every(n)},Yf=(0,Ws.A)((function e(t,n){const r=hg(t,n),o=[];for(const n of r){const r=e(t,n);"disabled"!==Cb(t,n)?o.push({clientId:n,innerBlocks:r}):o.push(...r)}return o}),(e=>[e.blocks.order,e.blockEditingModes,e.settings.templateLock,e.blockListSettings])),Jf=(0,Ws.A)(((e,t,n=!1)=>Hm(e,t,n).filter((t=>"disabled"!==Cb(e,t)))),(e=>[e.blocks.parents,e.blockEditingModes,e.settings.templateLock,e.blockListSettings]));function Xf(e){return e.removalPromptData}function Zf(e){return e.blockRemovalRules}function Qf(e){return e.openedBlockSettingsMenu}const em=(0,Ws.A)((e=>{const t=Em(e).reduce(((e,t,n)=>(e[t]=n,e)),{});return[...e.styleOverrides].sort(((e,n)=>{var r,o;const[,{clientId:i}]=e,[,{clientId:s}]=n;return(null!==(r=t[i])&&void 0!==r?r:-1)-(null!==(o=t[s])&&void 0!==o?o:-1)}))}),(e=>[e.blocks.order,e.styleOverrides]));function tm(e){return e.registeredInserterMediaCategories}const nm=(0,Ws.A)((e=>{const{settings:{inserterMediaCategories:t,allowedMimeTypes:n,enableOpenverseMediaCategory:r},registeredInserterMediaCategories:o}=e;if(!t&&!o.length||!n)return;const i=t?.map((({name:e})=>e))||[],s=[...t||[],...(o||[]).filter((({name:e})=>!i.includes(e)))];return s.filter((e=>!(!r&&"openverse"===e.name)&&Object.values(n).some((t=>t.startsWith(`${e.mediaType}/`)))))}),(e=>[e.settings.inserterMediaCategories,e.settings.allowedMimeTypes,e.settings.enableOpenverseMediaCategory,e.registeredInserterMediaCategories])),rm=(0,$s.N)((e=>(0,Ws.A)(((t,n=null)=>{const{getAllPatterns:r,__experimentalGetParsedPattern:o}=Cf(e(Sf)),i=r(),{allowedBlockTypes:s}=sb(t);return i.some((({name:e,inserter:r=!0})=>{if(!r)return!1;const{blocks:i}=o(e);return If(i,s)&&i.every((({name:e})=>Dg(t,e,n)))}))}),((t,n)=>[...jf(e)(t),...Tf(t,n)]))));function om(e,t=[]){return{name:`core/block/${e.id}`,id:e.id,type:Nf.user,title:e.title.raw,categories:e.wp_pattern_category.map((e=>{const n=t.find((({id:t})=>t===e));return n?n.slug:e})),content:e.content.raw,syncStatus:e.wp_pattern_sync_status}}const im=(0,$s.N)((e=>(0,Ws.A)(((t,n)=>{var r,o;if(n?.startsWith("core/block/")){const r=parseInt(n.slice(11),10),o=Cf(e(Sf)).getReusableBlocks().find((({id:e})=>e===r));return o?om(o,t.settings.__experimentalUserPatternCategories):null}return[...null!==(r=t.settings.__experimentalBlockPatterns)&&void 0!==r?r:[],...null!==(o=t.settings[xf]?.(e))&&void 0!==o?o:[]].find((({name:e})=>e===n))}),((t,n)=>n?.startsWith("core/block/")?[Cf(e(Sf)).getReusableBlocks(),t.settings.__experimentalReusableBlocks]:[t.settings.__experimentalBlockPatterns,t.settings[xf]?.(e)])))),sm=(0,$s.N)((e=>(0,Ws.A)((t=>{var n,r;return[...Cf(e(Sf)).getReusableBlocks().map((e=>om(e,t.settings.__experimentalUserPatternCategories))),...null!==(n=t.settings.__experimentalBlockPatterns)&&void 0!==n?n:[],...null!==(r=t.settings[xf]?.(e))&&void 0!==r?r:[]].filter(((e,t,n)=>t===n.findIndex((t=>e.name===t.name))))}),jf(e)))),am=(0,$s.N)((e=>(0,Ws.A)((t=>{const n=t.settings[xf],r=t.settings[wf];return!!n&&void 0===n(e)||!!r&&void 0===r(e)}),jf(e)))),lm=[],cm=(0,$s.N)((e=>t=>{var n;const r=t.settings[wf];return r?r(e):null!==(n=t.settings.__experimentalReusableBlocks)&&void 0!==n?n:lm}));function um(e){return e.lastFocus}function dm(e){return e.isDragging}function hm(e){return e.expandedBlock}const pm=(0,Ws.A)(((e,t)=>{let n,r=t;for(;r=e.blocks.parents.get(r);)"core/block"!==ym(e,r)&&"contentOnly"!==Rg(e,r)||(n=r);return n}),(e=>[e.blocks.parents,e.blockListSettings]));function fm(e){return e.temporarilyEditingAsBlocks}function mm(e){return e.temporarilyEditingFocusModeRevert}const gm=[],bm=new Set;function ym(e,t){const n=e.blocks.byClientId.get(t),r="core/social-link";if("web"!==Lh.A.OS&&n?.name===r){const n=e.blocks.attributes.get(t),{service:o}=null!=n?n:{};return o?`${r}-${o}`:r}return n?n.name:null}function vm(e,t){const n=e.blocks.byClientId.get(t);return!!n&&n.isValid}function _m(e,t){return e.blocks.byClientId.get(t)?e.blocks.attributes.get(t):null}function xm(e,t){return e.blocks.byClientId.has(t)?e.blocks.tree.get(t):null}const wm=(0,Ws.A)(((e,t)=>{const n=e.blocks.byClientId.get(t);return n?{...n,attributes:_m(e,t)}:null}),((e,t)=>[e.blocks.byClientId.get(t),e.blocks.attributes.get(t)]));function km(e,t){const n=t&&bb(e,t)?"controlled||"+t:t||"";return e.blocks.tree.get(n)?.innerBlocks||gm}const Cm=(0,Ws.A)(((e,t)=>((0,q.default)("wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree",{since:"6.3",version:"6.5"}),{clientId:t,innerBlocks:Sm(e,t)})),(e=>[e.blocks.order])),Sm=(0,Ws.A)(((e,t="")=>((0,q.default)("wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree",{since:"6.3",version:"6.5"}),hg(e,t).map((t=>Cm(e,t))))),(e=>[e.blocks.order])),Am=(0,Ws.A)(((e,t)=>{t=Array.isArray(t)?[...t]:[t];const n=[];for(const r of t){const t=e.blocks.order.get(r);t&&n.push(...t)}let r=0;for(;r<n.length;){const t=n[r],o=e.blocks.order.get(t);o&&n.splice(r+1,0,...o),r++}return n}),(e=>[e.blocks.order])),Em=e=>Am(e,""),Im=(0,Ws.A)(((e,t)=>{const n=Em(e);if(!t)return n.length;let r=0;for(const o of n)e.blocks.byClientId.get(o).name===t&&r++;return r}),(e=>[e.blocks.order,e.blocks.byClientId])),jm=(0,Ws.A)(((e,t)=>{if(!t)return gm;const n=Array.isArray(t)?t:[t],r=Em(e).filter((t=>{const r=e.blocks.byClientId.get(t);return n.includes(r.name)}));return r.length>0?r:gm}),(e=>[e.blocks.order,e.blocks.byClientId]));function Tm(e,t){return(0,q.default)("wp.data.select( 'core/block-editor' ).__experimentalGetGlobalBlocksByName",{since:"6.5",alternative:"wp.data.select( 'core/block-editor' ).getBlocksByName"}),jm(e,t)}const Bm=(0,Ws.A)(((e,t)=>(Array.isArray(t)?t:[t]).map((t=>xm(e,t)))),((e,t)=>(Array.isArray(t)?t:[t]).map((t=>e.blocks.tree.get(t))))),Rm=(0,Ws.A)(((e,t)=>Bm(e,t).filter(Boolean).map((e=>e.name))),((e,t)=>Bm(e,t)));function Nm(e,t){return hg(e,t).length}function Dm(e){return e.selection.selectionStart}function Mm(e){return e.selection.selectionEnd}function Pm(e){return e.selection.selectionStart.clientId}function Om(e){return e.selection.selectionEnd.clientId}function Lm(e){return Zm(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 zm(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:r}=t;return r&&r===n.clientId?r:null}function Um(e){const t=zm(e);return t?xm(e,t):null}function Vm(e,t){var n;return null!==(n=e.blocks.parents.get(t))&&void 0!==n?n:null}const Hm=(0,Ws.A)(((e,t,n=!1)=>{const r=[];let o=t;for(;o=e.blocks.parents.get(o);)r.push(o);return r.length?n?r:r.reverse():gm}),(e=>[e.blocks.parents])),$m=(0,Ws.A)(((e,t,n,r=!1)=>{const o=Hm(e,t,r),i=Array.isArray(n)?e=>n.includes(e):e=>n===e;return o.filter((t=>i(ym(e,t))))}),(e=>[e.blocks.parents]));function Wm(e,t){let n,r=t;do{n=r,r=e.blocks.parents.get(r)}while(r);return n}function Gm(e,t){const n=zm(e),r=[...Hm(e,t),t],o=[...Hm(e,n),n];let i;const s=Math.min(r.length,o.length);for(let e=0;e<s&&r[e]===o[e];e++)i=r[e];return i}function qm(e,t,n=1){if(void 0===t&&(t=zm(e)),void 0===t&&(t=n<0?eg(e):tg(e)),!t)return null;const r=Vm(e,t);if(null===r)return null;const{order:o}=e.blocks,i=o.get(r),s=i.indexOf(t)+1*n;return s<0||s===i.length?null:i[s]}function Km(e,t){return qm(e,t,-1)}function Ym(e,t){return qm(e,t,1)}function Jm(e){return e.initialPosition}const Xm=(0,Ws.A)((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(!t.clientId||!n.clientId)return gm;if(t.clientId===n.clientId)return[t.clientId];const r=Vm(e,t.clientId);if(null===r)return gm;const o=hg(e,r),i=o.indexOf(t.clientId),s=o.indexOf(n.clientId);return i>s?o.slice(s,i+1):o.slice(i,s+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Zm(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?gm:Xm(e)}const Qm=(0,Ws.A)((e=>{const t=Zm(e);return t.length?t.map((t=>xm(e,t))):gm}),(e=>[...Xm.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function eg(e){return Zm(e)[0]||null}function tg(e){const t=Zm(e);return t[t.length-1]||null}function ng(e,t){return eg(e)===t}function rg(e,t){return-1!==Zm(e).indexOf(t)}const og=(0,Ws.A)(((e,t)=>{let n=t,r=!1;for(;n&&!r;)n=Vm(e,n),r=rg(e,n);return r}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function ig(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function sg(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function ag(e){const t=Dm(e),n=Mm(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function lg(e){const t=Dm(e),n=Mm(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function cg(e){return Xm(e).some((t=>!Sc(ym(e,t)).merge))}function ug(e,t){const n=Dm(e),r=Mm(e);if(n.clientId===r.clientId)return!1;if(!n.attributeKey||!r.attributeKey||void 0===n.offset||void 0===r.offset)return!1;const o=Vm(e,n.clientId);if(o!==Vm(e,r.clientId))return!1;const i=hg(e,o);let s,a;i.indexOf(n.clientId)>i.indexOf(r.clientId)?(s=r,a=n):(s=n,a=r);const l=t?a.clientId:s.clientId,c=t?s.clientId:a.clientId,u=ym(e,l);if(!Sc(u).merge)return!1;const d=xm(e,c);if(d.name===u)return!0;const h=dd(d,u);return h&&h.length}const dg=e=>{const t=Dm(e),n=Mm(e);if(t.clientId===n.clientId)return gm;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return gm;const r=Vm(e,t.clientId);if(r!==Vm(e,n.clientId))return gm;const o=hg(e,r),i=o.indexOf(t.clientId),s=o.indexOf(n.clientId),[a,l]=i>s?[n,t]:[t,n],c=xm(e,a.clientId),u=xm(e,l.clientId),d=c.attributes[a.attributeKey],h=u.attributes[l.attributeKey];let p=(0,$.create)({html:d}),f=(0,$.create)({html:h});return p=(0,$.remove)(p,0,a.offset),f=(0,$.remove)(f,l.offset,f.text.length),[{...c,attributes:{...c.attributes,[a.attributeKey]:(0,$.toHTMLString)({value:p})}},{...u,attributes:{...u.attributes,[l.attributeKey]:(0,$.toHTMLString)({value:f})}}]};function hg(e,t){return e.blocks.order.get(t||"")||gm}function pg(e,t){return hg(e,Vm(e,t)).indexOf(t)}function fg(e,t){const{selectionStart:n,selectionEnd:r}=e.selection;return n.clientId===r.clientId&&n.clientId===t}function mg(e,t,n=!1){const r=Xm(e);return!!r.length&&(n?r.some((n=>Hm(e,n,!0).includes(t))):r.some((n=>Vm(e,n)===t)))}function gg(e,t,n=!1){return hg(e,t).some((t=>Sg(e,t)||n&&gg(e,t,n)))}function bg(e,t){if(!t)return!1;const n=Zm(e),r=n.indexOf(t);return r>-1&&r<n.length-1}function yg(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function vg(e){return e.isMultiSelecting}function _g(e){return e.isSelectionEnabled}function xg(e,t){return e.blocksMode[t]||"visual"}function wg(e){return e.isTyping}function kg(e){return!!e.draggedBlocks.length}function Cg(e){return e.draggedBlocks}function Sg(e,t){return e.draggedBlocks.includes(t)}function Ag(e,t){return!!kg(e)&&Hm(e,t).some((t=>Sg(e,t)))}function Eg(){return(0,q.default)('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}const Ig=(0,Ws.A)((e=>{let t,n;const{insertionPoint:r,selection:{selectionEnd:o}}=e;if(null!==r)return r;const{clientId:i}=o;return i?(t=Vm(e,i)||void 0,n=pg(e,o.clientId)+1):n=hg(e).length,{rootClientId:t,index:n}}),(e=>[e.insertionPoint,e.selection.selectionEnd.clientId,e.blocks.parents,e.blocks.order]));function jg(e){return null!==e.insertionPoint}function Tg(e){return e.template.isValid}function Bg(e){return e.settings.template}function Rg(e,t){var n,r;return t?null!==(n=ib(e,t)?.templateLock)&&void 0!==n&&n:null!==(r=e.settings.templateLock)&&void 0!==r&&r}const Ng=(e,t,n=null)=>{let r;if(t&&"object"==typeof t?(r=t,t=r.name):r=Sc(t),!r)return!1;const{allowedBlockTypes:o}=sb(e);if(!Ef(o,t,!0))return!1;if(Rg(e,n))return!1;if("disabled"===Cb(e,null!=n?n:""))return!1;const i=ib(e,n);if(n&&void 0===i)return!1;const s=ym(e,n),a=Sc(s),l=a?.allowedBlocks;let c=Ef(l,t);if(!1!==c){const e=i?.allowedBlocks,n=Ef(e,t);null!==n&&(c=n)}const u=r.parent,d=Ef(u,s);let h=!0;const p=r.ancestor;p&&(h=[n,...Hm(e,n)].some((t=>Ef(p,ym(e,t)))));const f=h&&(null===c&&null===d||!0===c||!0===d);return f?(0,Tu.applyFilters)("blockEditor.__unstableCanInsertBlockType",f,r,n,{getBlock:xm.bind(null,e),getBlockParentsByBlockName:$m.bind(null,e)}):f},Dg=(0,Ws.A)(Ng,((e,t,n)=>Tf(e,n)));function Mg(e,t,n=null){return t.every((t=>Dg(e,ym(e,t),n)))}function Pg(e,t,n=null){const r=_m(e,t);return null===r||(void 0!==r.lock?.remove?!r.lock.remove:!Rg(e,n)&&"disabled"!==Cb(e,n))}function Og(e,t,n=null){return t.every((t=>Pg(e,t,n)))}function Lg(e,t,n=null){const r=_m(e,t);return null===r||(void 0!==r.lock?.move?!r.lock.move:"all"!==Rg(e,n)&&"disabled"!==Cb(e,n))}function Fg(e,t,n=null){return t.every((t=>Lg(e,t,n)))}function zg(e,t){const n=_m(e,t);if(null===n)return!0;const{lock:r}=n;return!r?.edit}function Ug(e,t){return!!Ic(t,"lock",!0)&&!!e.settings?.canLockBlocks}function Vg(e,t){var n;return null!==(n=e.preferences.insertUsage?.[t])&&void 0!==n?n:null}const Hg=(e,t,n)=>!!Ic(t,"inserter",!0)&&Ng(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}},Wg=(e,{buildScope:t="inserter"})=>n=>{const r=n.name;let o=!1;Ic(n.name,"multiple",!0)||(o=Bm(e,Em(e)).some((({name:e})=>e===n.name)));const{time:i,count:s=0}=Vg(e,r)||{},a={id:r,name:n.name,title:n.title,icon:n.icon,isDisabled:o,frecency:$g(i,s)};if("transform"===t)return a;const l=Bc(n.name,"inserter");return{...a,initialAttributes:{},description:n.description,category:n.category,keywords:n.keywords,variations:l,example:n.example,utility:1}},Gg=(0,$s.N)((e=>(0,Ws.A)(((t,n=null,r={})=>{const o=Ng(t,"core/block",n)?Cf(e(Sf)).getReusableBlocks().map((e=>{const n=e.wp_pattern_sync_status?vf.A:{src:vf.A,foreground:"var(--wp-block-synced-color)"},r=`core/block/${e.id}`,{time:o,count:i=0}=Vg(t,r)||{},s=$g(o,i);return{id:r,name:"core/block",initialAttributes:{ref:e.id},title:e.title?.raw,icon:n,category:"reusable",keywords:["reusable"],isDisabled:!1,utility:1,frecency:s,content:e.content?.raw,syncStatus:e.wp_pattern_sync_status}})):[],i=Wg(t,{buildScope:"inserter"});let s=Ac().filter((e=>Ic(e,"inserter",!0))).map(i);s=r[Af]?s.reduce(((e,r)=>{for(r.rootClientId=null!=n?n:"";!Ng(t,r.name,r.rootClientId);){if(!r.rootClientId){let e;try{e=Cf(sb(t)).sectionRootClientId}catch(e){}e&&Ng(t,r.name,e)?r.rootClientId=e:delete r.rootClientId;break}{const e=Vm(t,r.rootClientId);r.rootClientId=e}}return r.hasOwnProperty("rootClientId")&&e.push(r),e}),[]):s.filter((e=>Hg(t,e,n)));const a=s.reduce(((e,n)=>{const{variations:r=[]}=n;if(r.some((({isDefault:e})=>e))||e.push(n),r.length){const o=((e,t)=>n=>{const r=`${t.id}/${n.name}`,{time:o,count:i=0}=Vg(e,r)||{};return{...t,id:r,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:$g(o,i)}})(t,n);e.push(...r.map(o))}return e}),[]),{core:l,noncore:c}=a.reduce(((e,t)=>{const{core:n,noncore:r}=e;return(t.name.startsWith("core/")?n:r).push(t),e}),{core:[],noncore:[]});return[...l,...c,...o]}),((t,n)=>[Ac(),Cf(e(Sf)).getReusableBlocks(),t.blocks.order,t.preferences.insertUsage,...Tf(t,n)])))),qg=(0,Ws.A)(((e,t,n=null)=>{const r=Array.isArray(t)?t:[t],o=Wg(e,{buildScope:"transform"}),i=Ac().filter((t=>Hg(e,t,n))).map(o),s=Object.fromEntries(Object.entries(i).map((([,e])=>[e.name,e]))),a=function(e){if(!e.length)return[];const t=(e=>e.length?Ac().filter((t=>!!ld(cd("from",t.name),(t=>id(t,"from",e))))):[])(e),n=(e=>{if(!e.length)return[];const t=Sc(e[0].name);return(t?cd("to",t.name):[]).filter((t=>t&&id(t,"to",e))).map((e=>e.blocks)).flat().map(Sc)})(e);return[...new Set([...t,...n])]}(r).reduce(((e,t)=>(s[t?.name]&&e.push(s[t.name]),e)),[]);return Rf(a,(e=>s[e.name].frecency),"desc")}),((e,t,n)=>[Ac(),e.preferences.insertUsage,...Tf(e,n)])),Kg=(0,$s.N)((e=>(t,n=null)=>!!Ac().some((e=>Hg(t,e,n)))||Ng(t,"core/block",n)&&Cf(e(Sf)).getReusableBlocks().length>0)),Yg=(0,$s.N)((e=>(0,Ws.A)(((t,n=null)=>{if(!n)return;const r=Ac().filter((e=>Hg(t,e,n)));return Ng(t,"core/block",n)&&Cf(e(Sf)).getReusableBlocks().length>0&&r.push("core/block"),r}),((t,n)=>[Ac(),Cf(e(Sf)).getReusableBlocks(),...Tf(t,n)])))),Jg=(0,Ws.A)(((e,t=null)=>((0,q.default)('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks',{alternative:'wp.data.select( "core/block-editor" ).getAllowedBlocks',since:"6.2",version:"6.4"}),Yg(e,t))),((e,t)=>Yg.getDependants(e,t)));function Xg(e,t=null){var n;if(!t)return;const{defaultBlock:r,directInsert:o}=null!==(n=e.blockListSettings[t])&&void 0!==n?n:{};return r&&o?r:void 0}function Zg(e,t=null){return(0,q.default)('wp.data.select( "core/block-editor" ).__experimentalGetDirectInsertBlock',{alternative:'wp.data.select( "core/block-editor" ).getDirectInsertBlock',since:"6.3",version:"6.4"}),Xg(e,t)}const Qg=(0,$s.N)((e=>(0,Ws.A)(((t,n)=>{const r=Cf(e(Sf)).getPatternBySlug(n);if(!r)return null;const o=Oh(r.content,{__unstableSkipMigrationLogs:!0});return 1===o.length&&(o[0].attributes={...o[0].attributes,metadata:{...o[0].attributes.metadata||{},categories:r.categories,patternName:r.name,name:o[0].attributes.metadata?.name||r.title}}),{...r,blocks:o}}),((t,n)=>[Cf(e(Sf)).getPatternBySlug(n)])))),eb=e=>(t,n)=>[...jf(e)(t),...Tf(t,n)],tb=(0,$s.N)((e=>(0,Ws.A)(((t,n=null)=>{const{getAllPatterns:r,__experimentalGetParsedPattern:o}=Cf(e(Sf)),i=r(),{allowedBlockTypes:s}=sb(t),a=i.filter((({inserter:e=!0})=>!!e)).map((({name:e})=>o(e))),l=a.filter((({blocks:e})=>If(e,s))),c=l.filter((({blocks:e})=>e.every((({name:e})=>Dg(t,e,n)))));return c}),eb(e)))),nb=(0,$s.N)((e=>(0,Ws.A)(((t,n,r=null)=>{if(!n)return gm;const o=e(Sf).__experimentalGetAllowedPatterns(r),i=Array.isArray(n)?n:[n],s=o.filter((e=>e?.blockTypes?.some?.((e=>i.includes(e)))));return 0===s.length?gm:s}),((t,n,r)=>eb(e)(t,r))))),rb=(0,$s.N)((e=>((0,q.default)('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes',{alternative:'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes',since:"6.2",version:"6.4"}),e(Sf).getPatternsByBlockTypes))),ob=(0,$s.N)((e=>(0,Ws.A)(((t,n,r=null)=>{if(!n)return gm;if(n.some((({clientId:e,innerBlocks:n})=>n.length||bb(t,e))))return gm;const o=Array.from(new Set(n.map((({name:e})=>e))));return e(Sf).getPatternsByBlockTypes(o,r)}),((t,n,r)=>eb(e)(t,r)))));function ib(e,t){return e.blockListSettings[t]}function sb(e){return e.settings}function ab(e){return e.blocks.isPersistentChange}const lb=(0,Ws.A)(((e,t=[])=>t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})),(e=>[e.blockListSettings])),cb=(0,$s.N)((e=>(0,Ws.A)(((t,n)=>{(0,q.default)("wp.data.select( 'core/block-editor' ).__experimentalGetReusableBlockTitle",{since:"6.6",version:"6.8"});const r=Cf(e(Sf)).getReusableBlocks().find((e=>e.id===n));return r?r.title?.raw:null}),(()=>[Cf(e(Sf)).getReusableBlocks()]))));function ub(e){return e.blocks.isIgnoredChange}function db(e){return e.lastBlockAttributesChange}function hb(e){return"navigation"===e.editorMode}function pb(e){return e.editorMode}function fb(e){return e.hasBlockMovingClientId}function mb(e){return!!e.automaticChangeStatus}function gb(e,t){return e.highlightedBlock===t}function bb(e,t){return!!e.blocks.controlledInnerBlocks[t]}const yb=(0,Ws.A)(((e,t)=>{if(!t.length)return null;const n=zm(e);if(t.includes(ym(e,n)))return n;const r=Zm(e),o=$m(e,n||r[0],t);return o?o[o.length-1]:null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function vb(e,t,n){const{lastBlockInserted:r}=e;return r.clientIds?.includes(t)&&r.source===n}function _b(e,t){var n;return null===(n=e.blockVisibility?.[t])||void 0===n||n}const xb=(0,Ws.A)((e=>{const t=new Set(Object.keys(e.blockVisibility).filter((t=>e.blockVisibility[t])));return 0===t.size?bm:t}),(e=>[e.blockVisibility]));function wb(e,t){if("default"!==Cb(e,t))return!1;if(!zg(e,t))return!0;const n=pb(e);if("zoom-out"===n){const{sectionRootClientId:n}=Cf(sb(e));if(n){const r=hg(e,n);if(r?.includes(t))return!0}else if(t&&!Vm(e,t))return!0}const r=Ic(ym(e,t),"__experimentalDisableBlockOverlay",!1);return("navigation"===n||!r&&bb(e,t))&&!fg(e,t)&&!mg(e,t,!0)}function kb(e,t){let n=e.blocks.parents.get(t);for(;n;){if(wb(e,n))return!0;n=e.blocks.parents.get(n)}return!1}const Cb=(0,$s.N)((e=>(t,n="")=>{if(null===n&&(n=""),"zoom-out"===pb(t)){const{sectionRootClientId:e}=Cf(sb(t));if(""===n)return e?"disabled":"contentOnly";if(n===e)return"contentOnly";const r=hg(t,e);if(!r?.includes(n))return"disabled"}const r=t.blockEditingModes.get(n);if(r)return r;if(!n)return"default";const o=Vm(t,n);if("contentOnly"===Rg(t,o)){const r=ym(t,n);return e(ed).__experimentalHasContentRoleAttribute(r)?"contentOnly":"disabled"}const i=Cb(t,o);return"contentOnly"===i?"default":i})),Sb=(0,$s.N)((e=>(t,n="")=>{const r=n||zm(t);if(!r)return!1;const{getGroupingBlockName:o}=e(ed),i=xm(t,r),s=o();return i&&(i.name===s||Sc(i.name)?.transforms?.ungroup)&&!!i.innerBlocks.length&&Pg(t,r)})),Ab=(0,$s.N)((e=>(t,n=gm)=>{const{getGroupingBlockName:r}=e(ed),o=r(),i=n?.length?n:Xm(t),s=i?.length?Vm(t,i[0]):void 0;return Dg(t,o,s)&&i.length&&Og(t,i,s)})),Eb=(e,t)=>((0,q.default)("wp.data.select( 'core/block-editor' ).__unstableGetContentLockingParent",{since:"6.1",version:"6.7"}),pm(e,t));function Ib(e){return(0,q.default)("wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingAsBlocks",{since:"6.1",version:"6.7"}),fm(e)}function jb(e){return(0,q.default)("wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingFocusModeToRevert",{since:"6.5",version:"6.7"}),mm(e)}const Tb=new WeakSet,Bb=["inserterMediaCategories","blockInspectorAnimation"];function Rb(e,{stripExperimentalSettings:t=!1,reset:n=!1}={}){let r=e;if(t&&"web"===Lh.A.OS){r={};for(const t in e)Bb.includes(t)||(r[t]=e[t])}return{type:"UPDATE_SETTINGS",settings:r,reset:n}}function Nb(){return{type:"HIDE_BLOCK_INTERFACE"}}function Db(){return{type:"SHOW_BLOCK_INTERFACE"}}const Mb=(e,t=!0,n=!1)=>({select:r,dispatch:o,registry:i})=>{if(!e||!e.length)return;var s;s=e,e=Array.isArray(s)?s:[s];const a=r.getBlockRootClientId(e[0]);if(!r.canRemoveBlocks(e,a))return;const l=!n&&r.getBlockRemovalRules();if(l){function c(e){const t=[],n=[...e];for(;n.length;){const{innerBlocks:e,...r}=n.shift();n.push(...e),t.push(r)}return t}const u=c(e.map(r.getBlock));let d;for(const h of l)if(d=h.callback(u),d)return void o(Ob(e,t,d))}t&&o.selectPreviousBlock(e[0],t),i.batch((()=>{o({type:"REMOVE_BLOCKS",clientIds:e}),o(Pb())}))},Pb=()=>({select:e,dispatch:t})=>{if(e.getBlockCount()>0)return;const{__unstableHasCustomAppender:n}=e.getSettings();n||t.insertDefaultBlock()};function Ob(e,t,n){return{type:"DISPLAY_BLOCK_REMOVAL_PROMPT",clientIds:e,selectPrevious:t,message:n}}function Lb(){return{type:"CLEAR_BLOCK_REMOVAL_PROMPT"}}function Fb(e=!1){return{type:"SET_BLOCK_REMOVAL_RULES",rules:e}}function zb(e){return{type:"SET_OPENED_BLOCK_SETTINGS_MENU",clientId:e}}function Ub(e,t){return{type:"SET_STYLE_OVERRIDE",id:e,style:t}}function Vb(e){return{type:"DELETE_STYLE_OVERRIDE",id:e}}function Hb(e){return({dispatch:t,select:n,registry:r})=>{r.batch((()=>{t({type:"SET_EXPLICIT_PERSISTENT",isPersistentChange:!1}),e(),t({type:"SET_EXPLICIT_PERSISTENT",isPersistentChange:void 0});const r=n.getBlocks();Tb.add(r)}))}}function $b(e=null){return{type:"LAST_FOCUS",lastFocus:e}}function Wb(e){return({select:t,dispatch:n,registry:r})=>{const o=Cf(r.select(hv)).getTemporarilyEditingFocusModeToRevert();n.__unstableMarkNextChangeAsNotPersistent(),n.updateBlockAttributes(e,{templateLock:"contentOnly"}),n.updateBlockListSettings(e,{...t.getBlockListSettings(e),templateLock:"contentOnly"}),n.updateSettings({focusMode:o}),n.__unstableSetTemporarilyEditingAsBlocks()}}function Gb(){return{type:"START_DRAGGING"}}function qb(){return{type:"STOP_DRAGGING"}}function Kb(e){return{type:"SET_BLOCK_EXPANDED_IN_LIST_VIEW",clientId:e}}const Yb=e=>({select:t,dispatch:n})=>{n.__unstableMarkNextChangeAsNotPersistent(),n.updateBlockAttributes(e,{templateLock:void 0}),n.updateBlockListSettings(e,{...t.getBlockListSettings(e),templateLock:!1});const r=t.getSettings().focusMode;n.updateSettings({focusMode:!0}),n.__unstableSetTemporarilyEditingAsBlocks(e,r)};var Jb=n(6012),Xb=n(74679);const Zb="†";function Qb(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return("string"==typeof n||n instanceof $.RichTextData)&&-1!==n.toString().indexOf(Zb)}))}function ey(e){for(const[t,n]of Object.entries(e.attributes))if("rich-text"===n.source||"html"===n.source)return t}const ty=e=>Array.isArray(e)?e:[e],ny=e=>({dispatch:t})=>{t({type:"RESET_BLOCKS",blocks:e}),t(ry(e))},ry=e=>({select:t,dispatch:n})=>{const r=t.getTemplate(),o=t.getTemplateLock(),i=!r||"all"!==o||Op(e,r);if(i!==t.isValidTemplate())return n.setTemplateValidity(i),i};function oy(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function iy(e){return(0,q.default)('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function sy(e,t,n=!1){return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:ty(e),attributes:t,uniqueByBlock:n}}function ay(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function ly(e,t=0){return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const cy=(e,t=!1)=>({select:n,dispatch:r})=>{const o=n.getPreviousBlockClientId(e);if(o)r.selectBlock(o,-1);else if(t){const t=n.getBlockRootClientId(e);t&&r.selectBlock(t,-1)}},uy=e=>({select:t,dispatch:n})=>{const r=t.getNextBlockClientId(e);r&&n.selectBlock(r)};function dy(){return{type:"START_MULTI_SELECT"}}function hy(){return{type:"STOP_MULTI_SELECT"}}const py=(e,t,n=0)=>({select:r,dispatch:o})=>{if(r.getBlockRootClientId(e)!==r.getBlockRootClientId(t))return;o({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const i=r.getSelectedBlockCount();(0,Jb.speak)((0,H.sprintf)((0,H._n)("%s block selected.","%s blocks selected.",i),i),"assertive")};function fy(){return{type:"CLEAR_SELECTED_BLOCK"}}function my(e=!0){return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}const gy=(e,t,n,r=0,o)=>({select:i,dispatch:s,registry:a})=>{e=ty(e),t=ty(t);const l=i.getBlockRootClientId(e[0]);for(let e=0;e<t.length;e++){const n=t[e];if(!i.canInsertBlockType(n.name,l))return}a.batch((()=>{s({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:r,meta:o}),s.ensureDefaultBlock()}))};function by(e,t){return gy(e,t)}const yy=e=>(t,n)=>({select:r,dispatch:o})=>{r.canMoveBlocks(t,n)&&o({type:e,clientIds:ty(t),rootClientId:n})},vy=yy("MOVE_BLOCKS_DOWN"),_y=yy("MOVE_BLOCKS_UP"),xy=(e,t="",n="",r)=>({select:o,dispatch:i})=>{if(o.canMoveBlocks(e,t)){if(t!==n){if(!o.canRemoveBlocks(e,t))return;if(!o.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:r})}};function wy(e,t="",n="",r){return xy([e],t,n,r)}function ky(e,t,n,r,o){return Cy([e],t,n,r,0,o)}const Cy=(e,t,n,r=!0,o=0,i)=>({select:s,dispatch:a})=>{null!==o&&"object"==typeof o&&(i=o,o=0,(0,q.default)("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=ty(e);const l=[];for(const t of e)s.canInsertBlockType(t.name,n)&&l.push(t);l.length&&a({type:"INSERT_BLOCKS",blocks:l,index:t,rootClientId:n,time:Date.now(),updateSelection:r,initialPosition:r?o:null,meta:i})};function Sy(e,t,n={}){const{__unstableWithInserter:r,operation:o,nearestSide:i}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:r,operation:o,nearestSide:i}}const Ay=()=>({select:e,dispatch:t})=>{e.isBlockInsertionPointVisible()&&t({type:"HIDE_INSERTION_POINT"})};function Ey(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const Iy=()=>({select:e,dispatch:t})=>{t({type:"SYNCHRONIZE_TEMPLATE"});const n=Vp(e.getBlocks(),e.getTemplate());t.resetBlocks(n)},jy=e=>({registry:t,select:n,dispatch:r})=>{const o=n.getSelectionStart(),i=n.getSelectionEnd();if(o.clientId===i.clientId)return;if(!o.attributeKey||!i.attributeKey||void 0===o.offset||void 0===i.offset)return!1;const s=n.getBlockRootClientId(o.clientId);if(s!==n.getBlockRootClientId(i.clientId))return;const a=n.getBlockOrder(s);let l,c;a.indexOf(o.clientId)>a.indexOf(i.clientId)?(l=i,c=o):(l=o,c=i);const u=e?c:l,d=n.getBlock(u.clientId),h=Sc(d.name);if(!h.merge)return;const p=l,f=c,m=n.getBlock(p.clientId),g=n.getBlock(f.clientId),b=m.attributes[p.attributeKey],y=g.attributes[f.attributeKey];let v=(0,$.create)({html:b}),_=(0,$.create)({html:y});v=(0,$.remove)(v,p.offset,v.text.length),_=(0,$.insert)(_,Zb,0,f.offset);const x=od(m,{[p.attributeKey]:(0,$.toHTMLString)({value:v})}),w=od(g,{[f.attributeKey]:(0,$.toHTMLString)({value:_})}),k=e?x:w,C=m.name===g.name?[k]:dd(k,h.name);if(!C||!C.length)return;let S;if(e){const e=C.pop();S=h.merge(e.attributes,w.attributes)}else{const e=C.shift();S=h.merge(x.attributes,e.attributes)}const A=Qb(S),E=S[A],I=(0,$.create)({html:E}),j=I.text.indexOf(Zb),T=(0,$.remove)(I,j,j+1),B=(0,$.toHTMLString)({value:T});S[A]=B;const R=n.getSelectedBlockClientIds(),N=[...e?C:[],{...d,attributes:{...d.attributes,...S}},...e?[]:C];t.batch((()=>{r.selectionChange(d.clientId,A,j,j),r.replaceBlocks(R,N,0,n.getSelectedBlocksInitialCaretPosition())}))},Ty=(e=[])=>({registry:t,select:n,dispatch:r})=>{const o=n.getSelectionStart(),i=n.getSelectionEnd(),s=n.getBlockRootClientId(o.clientId),a=n.getBlockRootClientId(i.clientId);if(s!==a)return;const l=n.getBlockOrder(s);let c,u;l.indexOf(o.clientId)>l.indexOf(i.clientId)?(c=i,u=o):(c=o,u=i);const d=c,h=u,p=n.getBlock(d.clientId),f=n.getBlock(h.clientId),m=Sc(p.name),g=Sc(f.name),b="string"==typeof d.attributeKey?d.attributeKey:ey(m),y="string"==typeof h.attributeKey?h.attributeKey:ey(g),v=n.getBlockAttributes(d.clientId),_=v?.metadata?.bindings;if(_?.[b]){if(e.length){const{createWarningNotice:M}=t.dispatch(Xb.store);return void M((0,H.__)("Blocks can't be inserted into other blocks with bindings"),{type:"snackbar"})}return void r.insertAfterBlock(d.clientId)}if(!b||!y||void 0===o.offset||void 0===i.offset)return;if(d.clientId===h.clientId&&b===y&&d.offset===h.offset)if(e.length){if(Dc(p))return void r.replaceBlocks([d.clientId],e,e.length-1,-1)}else if(!n.getBlockOrder(d.clientId).length){function P(){const e=Cc();return n.canInsertBlockType(e,s)?td(e):td(n.getBlockName(d.clientId))}const O=v[b].length;if(0===d.offset&&O)return void r.insertBlocks([P()],n.getBlockIndex(d.clientId),s,!1);if(d.offset===O)return void r.insertBlocks([P()],n.getBlockIndex(d.clientId)+1,s)}const x=p.attributes[b],w=f.attributes[y];let k=(0,$.create)({html:x}),C=(0,$.create)({html:w});k=(0,$.remove)(k,d.offset,k.text.length),C=(0,$.remove)(C,0,h.offset);let S={...p,innerBlocks:p.clientId===f.clientId?[]:p.innerBlocks,attributes:{...p.attributes,[b]:(0,$.toHTMLString)({value:k})}};const A={...f,clientId:p.clientId===f.clientId?td(f.name).clientId:f.clientId,attributes:{...f.attributes,[y]:(0,$.toHTMLString)({value:C})}};if(!e.length)return void r.replaceBlocks(n.getSelectedBlockClientIds(),[S,A]);let E;const I=[],j=[...e],T=j.shift(),B=Sc(S.name),R=B.merge&&T.name===B.name?[T]:dd(T,B.name);if(R?.length){const L=R.shift();S={...S,attributes:{...S.attributes,...B.merge(S.attributes,L.attributes)}},I.push(S),E={clientId:S.clientId,attributeKey:b,offset:(0,$.create)({html:S.attributes[b]}).text.length},j.unshift(...R)}else Nc(S)||I.push(S),I.push(T);const N=j.pop(),D=Sc(A.name);if(j.length&&I.push(...j),N){const F=D.merge&&D.name===N.name?[N]:dd(N,D.name);if(F?.length){const z=F.pop();I.push({...A,attributes:{...A.attributes,...D.merge(z.attributes,A.attributes)}}),I.push(...F),E={clientId:A.clientId,attributeKey:y,offset:(0,$.create)({html:z.attributes[y]}).text.length}}else I.push(N),Nc(A)||I.push(A)}else Nc(A)||I.push(A);t.batch((()=>{r.replaceBlocks(n.getSelectedBlockClientIds(),I,I.length-1,0),E&&r.selectionChange(E.clientId,E.attributeKey,E.offset,E.offset)}))},By=()=>({select:e,dispatch:t})=>{const n=e.getSelectionStart(),r=e.getSelectionEnd();t.selectionChange({start:{clientId:n.clientId},end:{clientId:r.clientId}})},Ry=(e,t)=>({registry:n,select:r,dispatch:o})=>{const i=e,s=t,a=r.getBlock(i),l=Sc(a.name);if(!l)return;const c=r.getBlock(s);if(!l.merge&&Ec(a.name,"__experimentalOnMerge")){const e=dd(c,l.name);if(1!==e?.length)return void o.selectBlock(a.clientId);const[t]=e;return t.innerBlocks.length<1?void o.selectBlock(a.clientId):void n.batch((()=>{o.insertBlocks(t.innerBlocks,void 0,i),o.removeBlock(s),o.selectBlock(t.innerBlocks[0].clientId);const e=r.getNextBlockClientId(i);if(e&&r.getBlockName(i)===r.getBlockName(e)){const t=r.getBlockAttributes(i),n=r.getBlockAttributes(e);Object.keys(t).every((e=>t[e]===n[e]))&&(o.moveBlocksToPosition(r.getBlockOrder(e),e,i),o.removeBlock(e,!1))}}))}if(Dc(a))return void o.removeBlock(i,r.isBlockSelected(i));if(Dc(c))return void o.removeBlock(s,r.isBlockSelected(s));if(!l.merge)return void o.selectBlock(a.clientId);const u=Sc(c.name),{clientId:d,attributeKey:h,offset:p}=r.getSelectionStart(),f=(d===i?l:u).attributes[h],m=(d===i||d===s)&&void 0!==h&&void 0!==p&&!!f;f||("number"==typeof h?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof h):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const g=od(a),b=od(c);if(m){const e=d===i?g:b,t=e.attributes[h],n=(0,$.insert)((0,$.create)({html:t}),Zb,p,p);e.attributes[h]=(0,$.toHTMLString)({value:n})}const y=a.name===c.name?[b]:dd(b,a.name);if(!y||!y.length)return;const v=l.merge(g.attributes,y[0].attributes);if(m){const e=Qb(v),t=v[e],n=(0,$.create)({html:t}),r=n.text.indexOf(Zb),i=(0,$.remove)(n,r,r+1),s=(0,$.toHTMLString)({value:i});v[e]=s,o.selectionChange(a.clientId,e,r,r)}o.replaceBlocks([a.clientId,c.clientId],[{...a,attributes:{...a.attributes,...v}},...y.slice(1)],0)},Ny=(e,t=!0)=>Mb(e,t);function Dy(e,t){return Ny([e],t)}function My(e,t,n=!1,r=0){return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?r:null,time:Date.now()}}function Py(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Oy(){return{type:"START_TYPING"}}function Ly(){return{type:"STOP_TYPING"}}function Fy(e=[]){return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function zy(){return{type:"STOP_DRAGGING_BLOCKS"}}function Uy(){return(0,q.default)('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Vy(){return(0,q.default)('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Hy(e,t,n,r){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:r}:{type:"SELECTION_CHANGE",...e}}const $y=(e,t,n)=>({dispatch:r})=>{const o=Cc();if(!o)return;const i=td(o,e);return r.insertBlock(i,n,t)};function Wy(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function Gy(e){return Rb(e,{stripExperimentalSettings:!0})}function qy(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Ky(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Yy(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Jy=()=>({dispatch:e})=>{e({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:t=(e=>setTimeout(e,100))}=window;t((()=>{e({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},Xy=(e=!0)=>({dispatch:t})=>{t.__unstableSetEditorMode(e?"navigation":"edit")},Zy=e=>({dispatch:t,select:n,registry:r})=>{if("zoom-out"===e){const e=n.getBlockSelectionStart(),{sectionRootClientId:o}=Cf(r.select(Sf).getSettings());if(e){let r;if(o){const t=n.getBlockOrder(o);r=n.getBlockParents(e).find((e=>t.includes(e)))}else r=n.getBlockHierarchyRootClientId(e);r?t.selectBlock(r):t.clearSelectedBlock()}}t({type:"SET_EDITOR_MODE",mode:e}),"navigation"===e?(0,Jb.speak)((0,H.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):"edit"===e?(0,Jb.speak)((0,H.__)("You are currently in edit mode. To return to the navigation mode, press Escape.")):"zoom-out"===e&&(0,Jb.speak)((0,H.__)("You are currently in zoom-out mode."))},Qy=(e=null)=>({dispatch:t})=>{t({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,Jb.speak)((0,H.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))},ev=(e,t=!0)=>({select:n,dispatch:r})=>{if(!e||!e.length)return;const o=n.getBlocksByClientId(e);if(o.some((e=>!e)))return;const i=o.map((e=>e.name));if(i.some((e=>!Ic(e,"multiple",!0))))return;const s=n.getBlockRootClientId(e[0]),a=ty(e),l=n.getBlockIndex(a[a.length-1]),c=o.map((e=>rd(e)));return r.insertBlocks(c,l+1,s,t),c.length>1&&t&&r.multiSelect(c[0].clientId,c[c.length-1].clientId),c.map((e=>e.clientId))},tv=e=>({select:t,dispatch:n})=>{if(!e)return;const r=t.getBlockRootClientId(e);if(t.getTemplateLock(r))return;const o=t.getBlockIndex(e),i=r?t.getDirectInsertBlock(r):null;if(!i)return n.insertDefaultBlock({},r,o);const s={};if(i.attributesToCopy){const n=t.getBlockAttributes(e);i.attributesToCopy.forEach((e=>{n[e]&&(s[e]=n[e])}))}const a=td(i.name,{...i.attributes,...s});return n.insertBlock(a,o,r)},nv=e=>({select:t,dispatch:n})=>{if(!e)return;const r=t.getBlockRootClientId(e);if(t.getTemplateLock(r))return;const o=t.getBlockIndex(e),i=r?t.getDirectInsertBlock(r):null;if(!i)return n.insertDefaultBlock({},r,o+1);const s={};if(i.attributesToCopy){const n=t.getBlockAttributes(e);i.attributesToCopy.forEach((e=>{n[e]&&(s[e]=n[e])}))}const a=td(i.name,{...i.attributes,...s});return n.insertBlock(a,o+1,r)};function rv(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const ov=e=>async({dispatch:t})=>{t(rv(e,!0)),await new Promise((e=>setTimeout(e,150))),t(rv(e,!1))};function iv(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function sv(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}function av(e,t){return{type:"SET_TEMPORARILY_EDITING_AS_BLOCKS",temporarilyEditingAsBlocks:e,focusModeToRevert:t}}const lv=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<InserterMediaItem[]>`.");const r=t.getRegisteredInserterMediaCategories();r.some((({name:t})=>t===e.name))?console.error(`A category is already registered with the same name: "${e.name}".`):r.some((({labels:{name:t}={}})=>t===e.labels?.name))?console.error(`A category is already registered with the same labels.name: "${e.labels.name}".`):n({type:"REGISTER_INSERTER_MEDIA_CATEGORY",category:{...e,isExternalResource:!0}})};function cv(e="",t){return{type:"SET_BLOCK_EDITING_MODE",clientId:e,mode:t}}function uv(e=""){return{type:"UNSET_BLOCK_EDITING_MODE",clientId:e}}const dv={reducer:yf,selectors:h,actions:f},hv=(0,R.A)(Sf,{...dv,persist:["preferences"]}),pv=(0,N.registerStore)(Sf,{...dv,persist:["preferences"]});function fv(...e){const{clientId:t=null}=Qp();return(0,Ul.A)((n=>Cf(n(hv)).getBlockSettings(t,...e)),[t,...e])}Cf(pv).registerPrivateActions(p),Cf(pv).registerPrivateSelectors(d),Cf(hv).registerPrivateActions(p),Cf(hv).registerPrivateSelectors(d);const mv="1600px",gv="320px",bv=1,yv=.25,vv=.75,_v="14px";function xv(e,t={}){if("string"!=typeof e&&"number"!=typeof e)return null;isFinite(e)&&(e=`${e}px`);const{coerceTo:n,rootSizeValue:r,acceptableUnits:o}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},i=o?.join("|"),s=new RegExp(`^(\\d*\\.?\\d+)(${i}){1,1}$`),a=e.match(s);if(!a||a.length<3)return null;let[,l,c]=a,u=parseFloat(l);return"px"!==n||"em"!==c&&"rem"!==c||(u*=r,c=n),"px"!==c||"em"!==n&&"rem"!==n||(u/=r,c=n),"em"!==n&&"rem"!==n||"em"!==c&&"rem"!==c||(c=n),{value:wv(u,3),unit:c}}function wv(e,t=3){const n=Math.pow(10,t);return Number.isFinite(e)?parseFloat(Math.round(e*n)/n):void 0}function kv(e,t){const{size:n}=e;if(!Cv(t?.typography))return n;if(!n||"0"===n||!1===e?.fluid)return n;let r=function(e){const t=e?.typography,n=e?.layout,r=xv(n?.wideSize)?n?.wideSize:null;return Cv(t)&&r?{fluid:{maxViewportWidth:r,...t.fluid}}:{fluid:t?.fluid}}(t);r="object"==typeof r?.fluid?r?.fluid:{};const o=function({minimumFontSize:e,maximumFontSize:t,fontSize:n,minimumViewportWidth:r=gv,maximumViewportWidth:o=mv,scaleFactor:i=bv,minimumFontSizeLimit:s}){if(s=xv(s)?s:_v,n){const r=xv(n);if(!r?.unit)return null;const o=xv(s,{coerceTo:r.unit});if(o?.value&&!e&&!t&&r?.value<=o?.value)return null;if(t||(t=`${r.value}${r.unit}`),!e){const t="px"===r.unit?r.value:16*r.value,n=Math.min(Math.max(1-.075*Math.log2(t),yv),vv),i=wv(r.value*n,3);e=o?.value&&i<o?.value?`${o.value}${o.unit}`:`${i}${r.unit}`}}const a=xv(e),l=a?.unit||"rem",c=xv(t,{coerceTo:l});if(!a||!c)return null;const u=xv(e,{coerceTo:"rem"}),d=xv(o,{coerceTo:l}),h=xv(r,{coerceTo:l});if(!d||!h||!u)return null;const p=d.value-h.value;if(!p)return null;const f=wv(h.value/100,3),m=wv(f,3)+l,g=wv(((c.value-a.value)/p*100||1)*i,3);return`clamp(${e}, ${u.value}${u.unit} + ((1vw - ${m}) * ${g}), ${t})`}({minimumFontSize:e?.fluid?.min,maximumFontSize:e?.fluid?.max,fontSize:n,minimumFontSizeLimit:r?.minFontSize,maximumViewportWidth:r?.maxViewportWidth,minimumViewportWidth:r?.minViewportWidth});return o||n}function Cv(e){const t=e?.fluid;return!0===t||t&&"object"==typeof t&&Object.keys(t).length>0}const Sv="body",Av=":root",Ev=[{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)=>kv(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:[]}],Iv={"color.background":"color","color.text":"color","filter.duotone":"duotone","elements.link.color.text":"color","elements.link.:hover.color.text":"color","elements.link.typography.fontFamily":"font-family","elements.link.typography.fontSize":"font-size","elements.button.color.text":"color","elements.button.color.background":"color","elements.caption.color.text":"color","elements.button.typography.fontFamily":"font-family","elements.button.typography.fontSize":"font-size","elements.heading.color":"color","elements.heading.color.background":"color","elements.heading.typography.fontFamily":"font-family","elements.heading.gradient":"gradient","elements.heading.color.gradient":"gradient","elements.h1.color":"color","elements.h1.color.background":"color","elements.h1.typography.fontFamily":"font-family","elements.h1.color.gradient":"gradient","elements.h2.color":"color","elements.h2.color.background":"color","elements.h2.typography.fontFamily":"font-family","elements.h2.color.gradient":"gradient","elements.h3.color":"color","elements.h3.color.background":"color","elements.h3.typography.fontFamily":"font-family","elements.h3.color.gradient":"gradient","elements.h4.color":"color","elements.h4.color.background":"color","elements.h4.typography.fontFamily":"font-family","elements.h4.color.gradient":"gradient","elements.h5.color":"color","elements.h5.color.background":"color","elements.h5.typography.fontFamily":"font-family","elements.h5.color.gradient":"gradient","elements.h6.color":"color","elements.h6.color.background":"color","elements.h6.typography.fontFamily":"font-family","elements.h6.color.gradient":"gradient","color.gradient":"gradient",shadow:"shadow","typography.fontSize":"font-size","typography.fontFamily":"font-family"},jv={popoverProps:{placement:"left-start",offset:259}};function Tv(e,t,n,r,o){const i=[Ff(e,["blocks",t,...n]),Ff(e,n)];for(const s of i)if(s){const i=["custom","theme","default"];for(const a of i){const i=s[a];if(i){const s=i.find((e=>e[r]===o));if(s)return"slug"===r||Tv(e,t,n,"slug",s.slug)[r]===s[r]?s:void 0}}}}function Bv(e,t,n){if(!n||"string"!=typeof n){if(!n?.ref||"string"!=typeof n?.ref)return n;{const t=n.ref.split(".");if(!(n=Ff(e,t))||n?.ref)return n}}let r;if(n.startsWith("var:"))r=n.slice(4).split("|");else{if(!n.startsWith("var(--wp--")||!n.endsWith(")"))return n;r=n.slice(10,-1).split("--")}const[o,...i]=r;return"preset"===o?function(e,t,n,[r,o]){const i=Ev.find((e=>e.cssVarInfix===r));if(!i)return n;const s=Tv(e.settings,t,i.path,"slug",o);if(s){const{valueKey:n}=i;return Bv(e,t,s[n])}return n}(e,t,n,i):"custom"===o?function(e,t,n,r){var o;const i=null!==(o=Ff(e.settings,["blocks",t,"custom",...r]))&&void 0!==o?o:Ff(e.settings,["custom",...r]);return i?Bv(e,t,i):n}(e,t,n,i):n}function Rv(e,t){if(!e||!t)return t;const n=e.split(","),r=t.split(","),o=[];return n.forEach((e=>{r.forEach((t=>{o.push(`${e.trim()} ${t.trim()}`)}))})),o.join(", ")}function Nv(e,t){return"object"!=typeof e||"object"!=typeof t?e===t:M()(e?.styles,t?.styles)&&M()(e?.settings,t?.settings)}const Dv=(0,S.createContext)({user:{},base:{},merged:{},setUserConfig:()=>{}}),Mv={settings:{},styles:{}},Pv=["appearanceTools","useRootPaddingAwareAlignments","background.backgroundImage","background.backgroundRepeat","background.backgroundSize","background.backgroundPosition","border.color","border.radius","border.style","border.width","shadow.presets","shadow.defaultPresets","color.background","color.button","color.caption","color.custom","color.customDuotone","color.customGradient","color.defaultDuotone","color.defaultGradients","color.defaultPalette","color.duotone","color.gradients","color.heading","color.link","color.palette","color.text","custom","dimensions.aspectRatio","dimensions.minHeight","layout.contentSize","layout.definitions","layout.wideSize","lightbox.enabled","lightbox.allowEditing","position.fixed","position.sticky","spacing.customSpacingSize","spacing.defaultSpacingSizes","spacing.spacingSizes","spacing.spacingScale","spacing.blockGap","spacing.margin","spacing.padding","spacing.units","typography.fluid","typography.customFontSize","typography.defaultFontSizes","typography.dropCap","typography.fontFamilies","typography.fontSizes","typography.fontStyle","typography.fontWeight","typography.letterSpacing","typography.lineHeight","typography.textAlign","typography.textColumns","typography.textDecoration","typography.textTransform","typography.writingMode"],Ov=()=>{const{user:e,setUserConfig:t}=(0,S.useContext)(Dv);return[!!e&&!M()(e,Mv),(0,S.useCallback)((()=>t((()=>Mv))),[t])]};function Lv(e,t,n="all"){const{setUserConfig:r,...o}=(0,S.useContext)(Dv),i=t?".blocks."+t:"",s=e?"."+e:"",a=`settings${i}${s}`,l=`settings${s}`,c="all"===n?"merged":n;return[(0,S.useMemo)((()=>{const t=o[c];if(!t)throw"Unsupported source";var n;if(e)return null!==(n=Ff(t,a))&&void 0!==n?n:Ff(t,l);let r={};return Pv.forEach((e=>{var n;const o=null!==(n=Ff(t,`settings${i}.${e}`))&&void 0!==n?n:Ff(t,`settings.${e}`);void 0!==o&&(r=Lf(r,e.split("."),o))})),r}),[o,c,e,a,l,i]),e=>{r((t=>Lf(t,a.split("."),e)))}]}function Fv(e,t,n="all",{shouldDecodeEncode:r=!0}={}){const{merged:o,base:i,user:s,setUserConfig:a}=(0,S.useContext)(Dv),l=e?"."+e:"",c=t?`styles.blocks.${t}${l}`:`styles${l}`;let u,d;switch(n){case"all":u=Ff(o,c),d=r?Bv(o,t,u):u;break;case"user":u=Ff(s,c),d=r?Bv(o,t,u):u;break;case"base":u=Ff(i,c),d=r?Bv(i,t,u):u;break;default:throw"Unsupported source"}return[d,n=>{a((i=>Lf(i,c.split("."),r?function(e,t,n,r){if(!r)return r;const o=Iv[n],i=Ev.find((e=>e.cssVarInfix===o));if(!i)return r;const{valueKey:s,path:a}=i,l=Tv(e,t,a,s,r);return l?`var:preset|${o}|${l.slug}`:r}(o.settings,t,e,n):n)))}]}function zv(){const{merged:e}=(0,S.useContext)(Dv);return e?._links}function Uv(e,t,n){const{supportedStyles:r,supports:o}=(0,Ul.A)((e=>({supportedStyles:Cf(e(ed)).getSupportedStyles(t,n),supports:e(ed).getBlockType(t)?.supports})),[t,n]);return(0,S.useMemo)((()=>{const t={...e};return r.includes("fontSize")||(t.typography={...t.typography,fontSizes:{},customFontSize:!1,defaultFontSizes:!1}),r.includes("fontFamily")||(t.typography={...t.typography,fontFamilies:{}}),t.color={...t.color,text:t.color?.text&&r.includes("color"),background:t.color?.background&&(r.includes("background")||r.includes("backgroundColor")),button:t.color?.button&&r.includes("buttonColor"),heading:t.color?.heading&&r.includes("headingColor"),link:t.color?.link&&r.includes("linkColor"),caption:t.color?.caption&&r.includes("captionColor")},r.includes("background")||(t.color.gradients=[],t.color.customGradient=!1),r.includes("filter")||(t.color.defaultDuotone=!1,t.color.customDuotone=!1),["lineHeight","fontStyle","fontWeight","letterSpacing","textTransform","textDecoration","writingMode"].forEach((e=>{r.includes(e)||(t.typography={...t.typography,[e]:!1})})),r.includes("columnCount")||(t.typography={...t.typography,textColumns:!1}),["contentSize","wideSize"].forEach((e=>{r.includes(e)||(t.layout={...t.layout,[e]:!1})})),["padding","margin","blockGap"].forEach((e=>{r.includes(e)||(t.spacing={...t.spacing,[e]:!1});const n=Array.isArray(o?.spacing?.[e])?o?.spacing?.[e]:o?.spacing?.[e]?.sides;n?.length&&t.spacing?.[e]&&(t.spacing={...t.spacing,[e]:{...t.spacing?.[e],sides:n}})})),["aspectRatio","minHeight"].forEach((e=>{r.includes(e)||(t.dimensions={...t.dimensions,[e]:!1})})),["radius","color","style","width"].forEach((e=>{r.includes("border"+e.charAt(0).toUpperCase()+e.slice(1))||(t.border={...t.border,[e]:!1})})),t.shadow=!!r.includes("shadow")&&t.shadow,n&&(t.typography.textAlign=!1),t}),[e,r,o,n])}function Vv(e){const t=e?.color?.palette?.custom,n=e?.color?.palette?.theme,r=e?.color?.palette?.default,o=e?.color?.defaultPalette;return(0,S.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,H._x)("Theme","Indicates this palette comes from the theme."),colors:n}),o&&r&&r.length&&e.push({name:(0,H._x)("Default","Indicates this palette comes from WordPress."),colors:r}),t&&t.length&&e.push({name:(0,H._x)("Custom","Indicates this palette is created by the user."),colors:t}),e}),[t,n,r,o])}function Hv(e){const t=e?.color?.gradients?.custom,n=e?.color?.gradients?.theme,r=e?.color?.gradients?.default,o=e?.color?.defaultGradients;return(0,S.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,H._x)("Theme","Indicates this palette comes from the theme."),gradients:n}),o&&r&&r.length&&e.push({name:(0,H._x)("Default","Indicates this palette comes from WordPress."),gradients:r}),t&&t.length&&e.push({name:(0,H._x)("Custom","Indicates this palette is created by the user."),gradients:t}),e}),[t,n,r,o])}var $v=n(23372);const Wv=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=Object.entries(e).map((([e,t])=>[e,Wv(t)])).filter((([,e])=>void 0!==e));return t.length?Object.fromEntries(t):void 0};function Gv(e,t,n,r,o,i){if(Object.values(null!=e?e:{}).every((e=>!e)))return n;if(1===i.length&&n.innerBlocks.length===r.length)return n;let s=r[0]?.attributes;if(i.length>1&&r.length>1){if(!r[o])return n;s=r[o]?.attributes}let a=n;return Object.entries(e).forEach((([e,n])=>{n&&t[e].forEach((e=>{const t=Ff(s,e);t&&(a={...a,attributes:Lf(a.attributes,e,t)})}))})),a}function qv(e,t,n){const r=Ec(e,t),o=r?.__experimentalSkipSerialization;return Array.isArray(o)?o.includes(n):o}const Kv=new WeakMap;function Yv({id:e,css:t,assets:n,__unstableType:r,clientId:o}={}){const{setStyleOverride:i,deleteStyleOverride:s}=Cf((0,Vl.A)(hv)),a=(0,Hp.A)(),l=(0,S.useId)();(0,S.useEffect)((()=>{if(!t&&!n)return;const c=e||l,u={id:e,css:t,assets:n,__unstableType:r,clientId:o};return Kv.get(a)||Kv.set(a,[]),Kv.get(a).push([c,u]),window.queueMicrotask((()=>{Kv.get(a)?.length&&a.batch((()=>{Kv.get(a).forEach((e=>{i(...e)})),Kv.set(a,[])}))})),()=>{const e=Kv.get(a)?.find((([e])=>e===c));e?Kv.set(a,Kv.get(a).filter((([e])=>e!==c))):s(c)}}),[e,t,o,n,r,l,i,s,a])}function Jv(e,t){const[n,r,o,i,s,a,l,c,u,d,h,p,f,m,g,b,y,v,_,x,w,k,C,A,E,I,j,T,B,R,N,D,M,P,O,L,F,z,U,V,H,$,W,G,q,K,Y,J,X,Z,Q,ee,te,ne,re,oe]=fv("background.backgroundImage","background.backgroundSize","typography.fontFamilies.custom","typography.fontFamilies.default","typography.fontFamilies.theme","typography.defaultFontSizes","typography.fontSizes.custom","typography.fontSizes.default","typography.fontSizes.theme","typography.customFontSize","typography.fontStyle","typography.fontWeight","typography.lineHeight","typography.textAlign","typography.textColumns","typography.textDecoration","typography.writingMode","typography.textTransform","typography.letterSpacing","spacing.padding","spacing.margin","spacing.blockGap","spacing.defaultSpacingSizes","spacing.customSpacingSize","spacing.spacingSizes.custom","spacing.spacingSizes.default","spacing.spacingSizes.theme","spacing.units","dimensions.aspectRatio","dimensions.minHeight","layout","border.color","border.radius","border.style","border.width","color.custom","color.palette.custom","color.customDuotone","color.palette.theme","color.palette.default","color.defaultPalette","color.defaultDuotone","color.duotone.custom","color.duotone.theme","color.duotone.default","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients","color.customGradient","color.background","color.link","color.text","color.heading","color.button","shadow");return Uv((0,S.useMemo)((()=>({background:{backgroundImage:n,backgroundSize:r},color:{palette:{custom:F,theme:U,default:V},gradients:{custom:K,theme:Y,default:J},duotone:{custom:W,theme:G,default:q},defaultGradients:X,defaultPalette:H,defaultDuotone:$,custom:L,customGradient:Z,customDuotone:z,background:Q,link:ee,heading:ne,button:re,text:te},typography:{fontFamilies:{custom:o,default:i,theme:s},fontSizes:{custom:l,default:c,theme:u},customFontSize:d,defaultFontSizes:a,fontStyle:h,fontWeight:p,lineHeight:f,textAlign:m,textColumns:g,textDecoration:b,textTransform:v,letterSpacing:_,writingMode:y},spacing:{spacingSizes:{custom:E,default:I,theme:j},customSpacingSize:A,defaultSpacingSizes:C,padding:x,margin:w,blockGap:k,units:T},border:{color:D,radius:M,style:P,width:O},dimensions:{aspectRatio:B,minHeight:R},layout:N,parentLayout:t,shadow:oe})),[n,r,o,i,s,a,l,c,u,d,h,p,f,m,g,b,v,_,y,x,w,k,C,A,E,I,j,T,B,R,N,t,D,M,P,O,L,F,z,U,V,H,$,W,G,q,K,Y,J,X,Z,Q,ee,te,ne,re,oe]),e)}const Xv=(0,S.memo)((function({index:e,useBlockProps:t,setAllWrapperProps:n,...r}){const o=t(r),i=t=>n((n=>{const r=[...n];return r[e]=t,r}));return(0,S.useEffect)((()=>(i(o),()=>{i(void 0)}))),null}));(0,Tu.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&Ic(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));var Zv=n(66248),Qv=n(20660),e_=n(29149);const t_=({children:e,className:t})=>(0,Td.jsx)("div",{className:t,children:e}),n_=(0,S.forwardRef)((function({children:e,className:t,containerClassName:n,extraProps:r,isActive:o,isDisabled:i,title:s,...a},l){return(0,S.useContext)(e_.A)?(0,Td.jsx)(Qv.A,{className:(0,$v.A)("components-toolbar-button",t),...r,...a,ref:l,children:t=>(0,Td.jsx)(Zv.Ay,{label:s,isPressed:o,disabled:i,...t,children:e})}):(0,Td.jsx)(t_,{className:n,children:(0,Td.jsx)(Zv.Ay,{ref:l,icon:a.icon,label:s,shortcut:a.shortcut,"data-subscript":a.subscript,onClick:e=>{e.stopPropagation(),a.onClick&&a.onClick(e)},className:(0,$v.A)("components-toolbar__control",t),isPressed:o,disabled:i,"data-toolbar-item":!0,...r,...a,children:e})})})),r_=n_,o_=({className:e,children:t,...n})=>(0,Td.jsx)("div",{className:e,...n,children:t});var i_=n(79855);const s_=function({controls:e=[],toggleProps:t,...n}){const r=t=>(0,Td.jsx)(i_.A,{controls:e,toggleProps:{...t,"data-toolbar-item":!0},...n});return(0,S.useContext)(e_.A)?(0,Td.jsx)(Qv.A,{...t,children:r}):r(t)},a_=function({controls:e=[],children:t,className:n,isCollapsed:r,title:o,...i}){const s=(0,S.useContext)(e_.A);if(!(e&&e.length||t))return null;const a=(0,$v.A)(s?"components-toolbar-group":"components-toolbar",n);let l;var c;return c=e,l=Array.isArray(c)&&Array.isArray(c[0])?e:[e],r?(0,Td.jsx)(s_,{label:o,controls:l,className:a,children:t,...i}):(0,Td.jsxs)(o_,{className:a,...i,children:[l?.flatMap(((e,t)=>e.map(((e,n)=>(0,Td.jsx)(r_,{containerClassName:t>0&&0===n?"has-left-divider":void 0,...e},[t,n].join()))))),t]})};var l_=n(41657);const c_={default:(0,Hl.QJ)("BlockControls"),block:(0,Hl.QJ)("BlockControlsBlock"),inline:(0,Hl.QJ)("BlockFormatControls"),other:(0,Hl.QJ)("BlockControlsOther"),parent:(0,Hl.QJ)("BlockControlsParent")};function u_({group:e="default",controls:t,children:n,__experimentalShareWithChildBlocks:r=!1}){const o=function(e,t){const n=Qp();return n[Wp]?c_[e]?.Fill:n[Gp]&&t?c_.parent.Fill:null}(e,r);if(!o)return null;const i=(0,Td.jsxs)(Td.Fragment,{children:["default"===e&&(0,Td.jsx)(a_,{controls:t}),n]});return(0,Td.jsx)(l_.A,{document,children:(0,Td.jsx)(o,{children:e=>{const{forwardedContext:t=[]}=e;return t.reduce(((e,[t,n])=>(0,Td.jsx)(t,{...n,children:e})),i)}})})}var d_=n(96606),h_=n(4134),p_=n(58595);function f_(e){const t=(0,S.useContext)(p_.A);return(0,h_.A)(t.fills,e)}var m_=n(7532);const{ComponentsContext:g_}=Cf(d_.j);function b_({group:e="default",...t}){const n=(0,S.useContext)(e_.A),r=(0,S.useContext)(g_),o=(0,S.useMemo)((()=>({forwardedContext:[[e_.A.Provider,{value:n}],[g_.Provider,{value:r}]]})),[n,r]),i=c_[e]?.Slot,s=f_(i?.__unstableName);if(!i)return!0===globalThis.SCRIPT_DEBUG&&(0,m_.default)(`Unknown BlockControls group "${e}" provided.`),null;if(!s?.length)return null;const a=(0,Td.jsx)(i,{...t,bubblesVirtually:!0,fillProps:o});return"default"===e?a:(0,Td.jsx)(a_,{children:a})}const y_=u_;y_.Slot=b_;const v_=e=>(0,Td.jsx)(u_,{group:"inline",...e});v_.Slot=e=>(0,Td.jsx)(b_,{group:"inline",...e});const __=y_,x_=(0,S.forwardRef)((function(e,t){return(0,S.useContext)(e_.A)?(0,Td.jsx)(Qv.A,{ref:t,...e.toggleProps,children:t=>(0,Td.jsx)(i_.A,{...e,popoverProps:{...e.popoverProps},toggleProps:t})}):(0,Td.jsx)(i_.A,{...e})}));var w_=n(17741),k_=n(32785),C_=n(5180),S_=n(67428),A_=n(70903),E_=n(39526),I_=n(47388),j_=n(87334),T_=n(7278),B_=n(28800),R_=n(9026),N_=n(13555);const D_=(0,S.createContext)(null);var M_=n(42218);const P_=e=>!e.isLayoutDirty&&e.willUpdate(!1);function O_(){const e=new Set,t=new WeakMap,n=()=>e.forEach(P_);return{add:r=>{e.add(r),t.set(r,r.addEventListener("willUpdate",n))},remove:r=>{e.delete(r);const o=t.get(r);o&&(o(),t.delete(r)),n()},dirty:n}}const L_=e=>!0===e,F_=({children:e,id:t,inherit:n=!0})=>{const r=(0,S.useContext)(N_.L),o=(0,S.useContext)(D_),[i,s]=(0,M_.C)(),a=(0,S.useRef)(null),l=r.id||o;null===a.current&&((e=>L_(!0===e)||"id"===e)(n)&&l&&(t=t?l+"-"+t:l),a.current={id:t,group:L_(n)&&r.group||O_()});const c=(0,S.useMemo)((()=>({...a.current,forceRender:i})),[s]);return(0,Td.jsx)(N_.L.Provider,{value:c,children:e})};var z_=n(80810),U_=n(76219),V_=n(36471),H_=n(74493),$_=n(73393),W_=n(54395),G_=n(35366),q_=n(34592),K_=n(73474);var Y_={name:"1aqh2c7",styles:"min-height:40px;padding:3px"},J_={name:"1ndywgm",styles:"min-height:36px;padding:2px"};const X_={name:"7whenc",styles:"display:flex;width:100%"},Z_=(0,W_.default)("div",{target:"eakva830"})({name:"zjik7",styles:"display:flex"});var Q_=n(38423),ex=n(29165),tx=n(31599),nx=n(60810),rx=n(19497),ox=n(26913);function ix(e={}){var t,n=(0,ox.YG)(e,[]);const r=null==(t=n.store)?void 0:t.getState(),o=(0,tx.z)((0,ox.ko)((0,ox.IA)({},n),{focusLoop:(0,rx.Jh)(n.focusLoop,null==r?void 0:r.focusLoop,!0)})),i=(0,ox.ko)((0,ox.IA)({},o.getState()),{value:(0,rx.Jh)(n.value,null==r?void 0:r.value,n.defaultValue,null)}),s=(0,nx.y$)(i,o,n.store);return(0,ox.ko)((0,ox.IA)((0,ox.IA)({},o),s),{setValue:e=>s.setState("value",e)})}var sx=n(21093),ax=n(49200),lx=n(68620),cx=n(50676),ux=n(28977),dx=(0,lx.ab)((e=>{var t=e,{store:n}=t,r=(0,ux.YG)(t,["store"]);const o=(0,sx.XF)();return n=n||o,(0,rx.V1)(n,!1),r=(0,cx.w7)(r,(e=>(0,Td.jsx)(sx.aN,{value:n,children:e})),[n]),r=(0,ux.IA)({role:"radiogroup"},r),(0,ax.T)((0,ux.IA)({store:n},r))})),hx=(0,lx.a0)((e=>{const t=dx(e);return(0,lx.n)("div",t)})),px=n(29238);const fx=(0,S.createContext)({}),mx=fx;var gx=n(52718);function bx(e){const t=(0,S.useRef)(!0),n=(0,gx.A)(e),r=(0,S.useRef)(!1);(0,S.useEffect)((()=>{t.current&&(t.current=!1)}),[]);const o=r.current||!t.current&&n!==e;return(0,S.useEffect)((()=>{r.current=o}),[o]),o?{value:null!=e?e:"",defaultValue:void 0}:{value:void 0,defaultValue:e}}const yx=(0,S.forwardRef)((function({children:e,isAdaptiveWidth:t,label:n,onChange:r,size:o,value:i,id:s,...a},l){const c=(0,z_.A)(yx,"toggle-group-control-as-radio-group"),u=s||c,{value:d,defaultValue:h}=bx(i),p=r?e=>{r(null!=e?e:void 0)}:void 0,f=function(e={}){const[t,n]=(0,ex.Pj)(ix,e);return function(e,t,n){return e=(0,Q_.Y)(e,t,n),(0,ex.Tz)(e,n,"value","setValue"),e}(t,n,e)}({defaultValue:h,value:d,setValue:p}),m=f.useState("value"),g=f.setValue,b=(0,S.useMemo)((()=>({baseId:u,isBlock:!t,size:o,value:m,setValue:g})),[u,t,o,m,g]);return(0,Td.jsx)(mx.Provider,{value:b,children:(0,Td.jsx)(hx,{store:f,"aria-label":n,render:(0,Td.jsx)(px.A,{}),...a,id:u,ref:l,children:e})})}));var vx=n(18688);const _x=(0,S.forwardRef)((function({children:e,isAdaptiveWidth:t,label:n,onChange:r,size:o,value:i,id:s,...a},l){const c=(0,z_.A)(_x,"toggle-group-control-as-button-group"),u=s||c,{value:d,defaultValue:h}=bx(i),[p,f]=(0,vx.j)({defaultValue:h,value:d,onChange:r}),m=(0,S.useMemo)((()=>({baseId:u,value:p,setValue:f,isBlock:!t,isDeselectable:!0,size:o})),[u,p,f,t,o]);return(0,Td.jsx)(mx.Provider,{value:m,children:(0,Td.jsx)(px.A,{"aria-label":n,...a,ref:l,role:"group",children:e})})})),xx=(0,V_.KZ)((function(e,t){const{__nextHasNoMarginBottom:n=!1,__next40pxDefaultSize:r=!1,className:o,isAdaptiveWidth:i=!1,isBlock:s=!1,isDeselectable:a=!1,label:l,hideLabelFromVision:c=!1,help:u,onChange:d,size:h="default",value:p,children:f,...m}=(0,U_.A)(e,"ToggleGroupControl"),g=(0,z_.A)(xx,"toggle-group-control"),b=r&&"default"===h?"__unstable-large":h,y=(0,H_.l)(),v=(0,S.useMemo)((()=>y((({isBlock:e,isDeselectable:t,size:n})=>(0,G_.css)("background:",q_.l.ui.background,";border:1px solid transparent;border-radius:",K_.A.controlBorderRadius,";display:inline-flex;min-width:0;position:relative;",(e=>({default:J_,"__unstable-large":Y_}[e]))(n)," ",!t&&(e=>{const t=(0,G_.css)("border-color:",q_.l.ui.border,";","");return(0,G_.css)(e&&t," &:hover{border-color:",q_.l.ui.borderHover,";}&:focus-within{border-color:",q_.l.ui.borderFocus,";box-shadow:",K_.A.controlBoxShadowFocus,";z-index:1;outline:2px solid transparent;outline-offset:-2px;}","")})(e),";",""))({isBlock:s,isDeselectable:a,size:b}),s&&X_,o)),[o,y,s,a,b]),_=a?_x:yx;return(0,Td.jsxs)($_.Ay,{help:u,__nextHasNoMarginBottom:n,children:[!c&&(0,Td.jsx)(Z_,{children:(0,Td.jsx)($_.Ay.VisualLabel,{children:l})}),(0,Td.jsx)(_,{...m,className:v,isAdaptiveWidth:i,label:l,onChange:d,ref:t,size:b,value:p,children:(0,Td.jsx)(F_,{id:g,children:f})})]})}),"ToggleGroupControl"),wx=xx;var kx=n(65302),Cx=n(57207),Sx=n(95228);const Ax=(0,W_.default)("div",{target:"et6ln9s1"})({name:"sln1fl",styles:"display:inline-flex;max-width:100%;min-width:0;position:relative"}),Ex={name:"82a6rk",styles:"flex:1"},Ix=({isDeselectable:e,isIcon:t,isPressed:n,size:r})=>(0,G_.css)("align-items:center;appearance:none;background:transparent;border:none;border-radius:",K_.A.controlBorderRadius,";color:",q_.l.gray[700],";fill:currentColor;cursor:pointer;display:flex;font-family:inherit;height:100%;justify-content:center;line-height:100%;outline:none;padding:0 12px;position:relative;text-align:center;@media not ( prefers-reduced-motion ){transition:background ",K_.A.transitionDurationFast," linear,color ",K_.A.transitionDurationFast," linear,font-weight 60ms linear;}user-select:none;width:100%;z-index:2;&::-moz-focus-inner{border:0;}&:active{background:",K_.A.toggleGroupControlBackgroundColor,";}",e&&Tx," ",t&&Rx({size:r})," ",n&&jx,";",""),jx=(0,G_.css)("color:",q_.l.white,";&:active{background:transparent;}",""),Tx=(0,G_.css)("color:",q_.l.gray[900],";&:focus{box-shadow:inset 0 0 0 1px ",q_.l.white,",0 0 0 ",K_.A.borderWidthFocus," ",q_.l.theme.accent,";outline:2px solid transparent;}",""),Bx=(0,W_.default)("div",{target:"et6ln9s0"})("display:flex;font-size:",K_.A.fontSize,";line-height:1;"),Rx=({size:e="default"})=>(0,G_.css)("color:",q_.l.gray[900],";height:",{default:"30px","__unstable-large":"32px"}[e],";aspect-ratio:1;padding-left:0;padding-right:0;",""),Nx=(0,G_.css)("background:",q_.l.gray[900],";border-radius:",K_.A.controlBorderRadius,";position:absolute;inset:0;z-index:1;outline:2px solid transparent;outline-offset:-3px;","");var Dx=n(95486);const{Rp:Mx,y0:Px}=m,Ox={duration:0},Lx=({showTooltip:e,text:t,children:n})=>e&&t?(0,Td.jsx)(Dx.Ay,{text:t,placement:"top",children:n}):(0,Td.jsx)(Td.Fragment,{children:n}),Fx=(0,V_.KZ)((function e(t,n){const r=(0,Sx.A)(),o=(0,S.useContext)(fx),i=(0,z_.A)(e,o.baseId||"toggle-group-control-option-base"),s=(0,U_.A)({...t,id:i},"ToggleGroupControlOptionBase"),{isBlock:a=!1,isDeselectable:l=!1,size:c="default"}=o,{className:u,isIcon:d=!1,value:h,children:p,showTooltip:f=!1,onFocus:m,...g}=s,b=o.value===h,y=(0,H_.l)(),v=(0,S.useMemo)((()=>y(a&&Ex)),[y,a]),_=(0,S.useMemo)((()=>y(Ix({isDeselectable:l,isIcon:d,isPressed:b,size:c}),u)),[y,l,d,b,c,u]),x=(0,S.useMemo)((()=>y(Nx)),[y]),w={...g,className:_,"data-value":h,ref:n};return(0,Td.jsxs)(Px,{className:v,children:[(0,Td.jsx)(Lx,{showTooltip:f,text:g["aria-label"],children:l?(0,Td.jsx)("button",{...w,onFocus:m,"aria-pressed":b,type:"button",onClick:()=>{l&&b?o.setValue(void 0):o.setValue(h)},children:(0,Td.jsx)(Mx,{children:p})}):(0,Td.jsx)(kx.s,{render:(0,Td.jsx)("button",{type:"button",...w,onFocus:e=>{m?.(e),e.defaultPrevented||o.setValue(h)}}),value:h,children:(0,Td.jsx)(Mx,{children:p})})}),b?(0,Td.jsx)(Cx.P.div,{layout:!0,layoutRoot:!0,children:(0,Td.jsx)(Cx.P.div,{className:x,transition:r?Ox:void 0,role:"presentation",layoutId:"toggle-group-backdrop-shared-layout-id"})}):null]})}),"ToggleGroupControlOptionBase"),zx=Fx;var Ux=n(56973);const Vx=(0,S.forwardRef)((function(e,t){const{icon:n,label:r,...o}=e;return(0,Td.jsx)(zx,{...o,isIcon:!0,"aria-label":r,showTooltip:!0,ref:t,children:(0,Td.jsx)(Ux.A,{icon:n})})}));var Hx=n(3672);const $x={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 Wx(e,t=""){return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function Gx(e,t=$x,n,r){let o="";return t?.[n]?.spacingStyles?.length&&r&&t[n].spacingStyles.forEach((t=>{o+=`${Wx(e,t.selector.trim())} { `,o+=Object.entries(t.rules).map((([e,t])=>`${e}: ${t||r}`)).join("; "),o+="; }"})),o}function qx(e){const{contentSize:t,wideSize:n,type:r="default"}=e,o={},i=/^(?!0)\d+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i;return i.test(t)&&"constrained"===r&&(o.none=(0,H.sprintf)((0,H.__)("Max %s wide"),t)),i.test(n)&&(o.wide=(0,H.sprintf)((0,H.__)("Max %s wide"),n)),o}var Kx=n(80194),Yx=n(19897),Jx=n(68591),Xx=n(9926),Zx=n(67119),Qx=n(91482),ew=n(61172);const tw=8,nw=["top","right","bottom","left"],rw={top:void 0,right:void 0,bottom:void 0,left:void 0},ow={custom:Kx.A,axial:Kx.A,horizontal:Yx.A,vertical:Jx.A,top:Xx.A,right:Zx.A,bottom:Qx.A,left:ew.A},iw={default:(0,H.__)("Spacing control"),top:(0,H.__)("Top"),bottom:(0,H.__)("Bottom"),left:(0,H.__)("Left"),right:(0,H.__)("Right"),mixed:(0,H.__)("Mixed"),vertical:(0,H.__)("Vertical"),horizontal:(0,H.__)("Horizontal"),axial:(0,H.__)("Horizontal & vertical"),custom:(0,H.__)("Custom")},sw={axial:"axial",top:"top",right:"right",bottom:"bottom",left:"left",custom:"custom"};function aw(e){return!!e?.includes&&("0"===e||e.includes("var:preset|spacing|"))}function lw(e,t){if(!e||aw(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 cw(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function uw(e){if(!e)return;if("0"===e||"default"===e)return e;const t=e.match(/var:preset\|spacing\|(.+)/);return t?t[1]:void 0}function dw(e,t){if(!e||!e.length)return!1;const n=e.includes("horizontal")||e.includes("left")&&e.includes("right"),r=e.includes("vertical")||e.includes("top")&&e.includes("bottom");return"horizontal"===t?n:"vertical"===t?r:n||r}function hw(e,t="0"){const n=function(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:e?.top,left:t?e:e?.left}}(e);if(!n)return null;const r=cw(n?.top)||t,o=cw(n?.left)||t;return r===o?r:`${r} ${o}`}var pw=n(64348);const fw=(0,Td.jsx)(pw.t4,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Td.jsx)(pw.wA,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})}),mw=(0,Td.jsx)(pw.t4,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Td.jsx)(pw.wA,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})}),gw=(0,Td.jsx)(pw.t4,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Td.jsx)(pw.wA,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})}),bw=(0,Td.jsx)(pw.t4,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Td.jsx)(pw.wA,{d:"M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z"})}),yw=(0,Td.jsx)(pw.t4,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Td.jsx)(pw.wA,{d:"M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z"})}),vw={top:{icon:gw,title:(0,H._x)("Align top","Block vertical alignment setting")},center:{icon:mw,title:(0,H._x)("Align middle","Block vertical alignment setting")},bottom:{icon:fw,title:(0,H._x)("Align bottom","Block vertical alignment setting")},stretch:{icon:bw,title:(0,H._x)("Stretch to fill","Block vertical alignment setting")},"space-between":{icon:yw,title:(0,H._x)("Space between","Block vertical alignment setting")}},_w=["top","center","bottom"],xw=function({value:e,onChange:t,controls:n=_w,isCollapsed:r=!0,isToolbar:o}){function i(n){return()=>t(e===n?void 0:n)}const s=vw[e],a=vw.top,l=o?a_:x_,c=o?{isCollapsed:r}:{};return(0,Td.jsx)(l,{icon:s?s.icon:a.icon,label:(0,H._x)("Change vertical alignment","Block vertical alignment setting label"),controls:n.map((t=>({...vw[t],isActive:e===t,role:r?"menuitemradio":void 0,onClick:i(t)}))),...c})},ww=e=>(0,Td.jsx)(xw,{...e,isToolbar:!1}),kw=e=>(0,Td.jsx)(xw,{...e,isToolbar:!0}),Cw={left:C_.A,center:S_.A,right:A_.A,"space-between":E_.A,stretch:I_.A},Sw=function({allowedControls:e=["left","center","right","space-between"],isCollapsed:t=!0,onChange:n,value:r,popoverProps:o,isToolbar:i}){const s=e=>{n(e===r?void 0:e)},a=r?Cw[r]:Cw.left,l=[{name:"left",icon:C_.A,title:(0,H.__)("Justify items left"),isActive:"left"===r,onClick:()=>s("left")},{name:"center",icon:S_.A,title:(0,H.__)("Justify items center"),isActive:"center"===r,onClick:()=>s("center")},{name:"right",icon:A_.A,title:(0,H.__)("Justify items right"),isActive:"right"===r,onClick:()=>s("right")},{name:"space-between",icon:E_.A,title:(0,H.__)("Space between items"),isActive:"space-between"===r,onClick:()=>s("space-between")},{name:"stretch",icon:I_.A,title:(0,H.__)("Stretch items"),isActive:"stretch"===r,onClick:()=>s("stretch")}],c=i?a_:x_,u=i?{isCollapsed:t}:{};return(0,Td.jsx)(c,{icon:a,popoverProps:o,label:(0,H.__)("Change items justification"),controls:l.filter((t=>e.includes(t.name))),...u})},Aw=e=>(0,Td.jsx)(Sw,{...e,isToolbar:!1}),Ew={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},Iw={left:"flex-start",right:"flex-end",center:"center",stretch:"stretch"},jw={top:"flex-start",center:"center",bottom:"flex-end",stretch:"stretch","space-between":"space-between"},Tw=["wrap","nowrap"],Bw={name:"flex",label:(0,H.__)("Flex"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowOrientation:r=!0}=n;return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsxs)(B_.A,{children:[(0,Td.jsx)(R_.A,{children:(0,Td.jsx)(Dw,{layout:e,onChange:t})}),(0,Td.jsx)(R_.A,{children:r&&(0,Td.jsx)(Pw,{layout:e,onChange:t})})]}),(0,Td.jsx)(Mw,{layout:e,onChange:t})]})},toolBarControls:function({layout:e={},onChange:t,layoutBlockSupport:n}){if(n?.allowSwitching)return null;const{allowVerticalAlignment:r=!0}=n;return(0,Td.jsxs)(__,{group:"block",__experimentalShareWithChildBlocks:!0,children:[(0,Td.jsx)(Dw,{layout:e,onChange:t,isToolbar:!0}),r&&(0,Td.jsx)(Rw,{layout:e,onChange:t,isToolbar:!0})]})},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:r,hasBlockGapSupport:o,layoutDefinitions:i=$x}){const{orientation:s="horizontal"}=t,a=n?.spacing?.blockGap&&!qv(r,"spacing","blockGap")?hw(n?.spacing?.blockGap,"0.5em"):void 0,l=Ew[t.justifyContent],c=Tw.includes(t.flexWrap)?t.flexWrap:"wrap",u=jw[t.verticalAlignment],d=Iw[t.justifyContent]||Iw.left;let h="";const p=[];return c&&"wrap"!==c&&p.push(`flex-wrap: ${c}`),"horizontal"===s?(u&&p.push(`align-items: ${u}`),l&&p.push(`justify-content: ${l}`)):(u&&p.push(`justify-content: ${u}`),p.push("flex-direction: column"),p.push(`align-items: ${d}`)),p.length&&(h=`${Wx(e)} {\n\t\t\t\t${p.join("; ")};\n\t\t\t}`),o&&a&&(h+=Gx(e,i,"flex",a)),h},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function Rw({layout:e,onChange:t,isToolbar:n=!1}){const{orientation:r="horizontal"}=e,o="horizontal"===r?jw.center:jw.top,{verticalAlignment:i=o}=e,s=n=>{t({...e,verticalAlignment:n})};if(n)return(0,Td.jsx)(ww,{onChange:s,value:i,controls:"horizontal"===r?["top","center","bottom","stretch"]:["top","center","bottom","space-between"]});const a=[{value:"flex-start",label:(0,H.__)("Align items top")},{value:"center",label:(0,H.__)("Align items center")},{value:"flex-end",label:(0,H.__)("Align items bottom")}];return(0,Td.jsxs)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control",children:[(0,Td.jsx)("legend",{children:(0,H.__)("Vertical alignment")}),(0,Td.jsx)("div",{children:a.map(((e,t,n)=>(0,Td.jsx)(Zv.Ay,{label:n,icon:t,isPressed:i===e,onClick:()=>s(e)},e)))})]})}const Nw={placement:"bottom-start"};function Dw({layout:e,onChange:t,isToolbar:n=!1}){const{justifyContent:r="left",orientation:o="horizontal"}=e,i=n=>{t({...e,justifyContent:n})},s=["left","center","right"];if("horizontal"===o?s.push("space-between"):s.push("stretch"),n)return(0,Td.jsx)(Aw,{allowedControls:s,value:r,onChange:i,popoverProps:Nw});const a=[{value:"left",icon:C_.A,label:(0,H.__)("Justify items left")},{value:"center",icon:S_.A,label:(0,H.__)("Justify items center")},{value:"right",icon:A_.A,label:(0,H.__)("Justify items right")}];return"horizontal"===o?a.push({value:"space-between",icon:E_.A,label:(0,H.__)("Space between items")}):a.push({value:"stretch",icon:I_.A,label:(0,H.__)("Stretch items")}),(0,Td.jsx)(wx,{__nextHasNoMarginBottom:!0,label:(0,H.__)("Justification"),value:r,onChange:i,className:"block-editor-hooks__flex-layout-justification-controls",children:a.map((({value:e,icon:t,label:n})=>(0,Td.jsx)(Vx,{value:e,icon:t,label:n},e)))})}function Mw({layout:e,onChange:t}){const{flexWrap:n="wrap"}=e;return(0,Td.jsx)(Hx.A,{__nextHasNoMarginBottom:!0,label:(0,H.__)("Allow to wrap to multiple lines"),onChange:n=>{t({...e,flexWrap:n?"wrap":"nowrap"})},checked:"wrap"===n})}function Pw({layout:e,onChange:t}){const{orientation:n="horizontal",verticalAlignment:r,justifyContent:o}=e;return(0,Td.jsxs)(wx,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__flex-layout-orientation-controls",label:(0,H.__)("Orientation"),value:n,onChange:n=>{let i=r,s=o;return"horizontal"===n?("space-between"===r&&(i="center"),"stretch"===o&&(s="left")):("stretch"===r&&(i="top"),"space-between"===o&&(s="left")),t({...e,orientation:n,verticalAlignment:i,justifyContent:s})},children:[(0,Td.jsx)(Vx,{icon:j_.A,value:"horizontal",label:(0,H.__)("Horizontal")}),(0,Td.jsx)(Vx,{icon:T_.A,value:"vertical",label:(0,H.__)("Vertical")})]})}const Ow={name:"default",label:(0,H.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,style:t,blockName:n,hasBlockGapSupport:r,layoutDefinitions:o=$x}){const i=hw(t?.spacing?.blockGap);let s="";qv(n,"spacing","blockGap")||(i?.top?s=hw(i?.top):"string"==typeof i&&(s=hw(i)));let a="";return r&&s&&(a+=Gx(e,o,"default",s)),a},getOrientation:()=>"vertical",getAlignments(e,t){const n=qx(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:n[e]})));const r=[{name:"left"},{name:"center"},{name:"right"}];if(!t){const{contentSize:t,wideSize:o}=e;t&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:n.wide})}return r.unshift({name:"none",info:n.none}),r}},Lw="web"===Lh.A.OS,Fw={px:{value:"px",label:Lw?"px":(0,H.__)("Pixels (px)"),a11yLabel:(0,H.__)("Pixels (px)"),step:1},"%":{value:"%",label:Lw?"%":(0,H.__)("Percentage (%)"),a11yLabel:(0,H.__)("Percent (%)"),step:.1},em:{value:"em",label:Lw?"em":(0,H.__)("Relative to parent font size (em)"),a11yLabel:(0,H._x)("ems","Relative to parent font size (em)"),step:.01},rem:{value:"rem",label:Lw?"rem":(0,H.__)("Relative to root font size (rem)"),a11yLabel:(0,H._x)("rems","Relative to root font size (rem)"),step:.01},vw:{value:"vw",label:Lw?"vw":(0,H.__)("Viewport width (vw)"),a11yLabel:(0,H.__)("Viewport width (vw)"),step:.1},vh:{value:"vh",label:Lw?"vh":(0,H.__)("Viewport height (vh)"),a11yLabel:(0,H.__)("Viewport height (vh)"),step:.1},vmin:{value:"vmin",label:Lw?"vmin":(0,H.__)("Viewport smallest dimension (vmin)"),a11yLabel:(0,H.__)("Viewport smallest dimension (vmin)"),step:.1},vmax:{value:"vmax",label:Lw?"vmax":(0,H.__)("Viewport largest dimension (vmax)"),a11yLabel:(0,H.__)("Viewport largest dimension (vmax)"),step:.1},ch:{value:"ch",label:Lw?"ch":(0,H.__)("Width of the zero (0) character (ch)"),a11yLabel:(0,H.__)("Width of the zero (0) character (ch)"),step:.01},ex:{value:"ex",label:Lw?"ex":(0,H.__)("x-height of the font (ex)"),a11yLabel:(0,H.__)("x-height of the font (ex)"),step:.01},cm:{value:"cm",label:Lw?"cm":(0,H.__)("Centimeters (cm)"),a11yLabel:(0,H.__)("Centimeters (cm)"),step:.001},mm:{value:"mm",label:Lw?"mm":(0,H.__)("Millimeters (mm)"),a11yLabel:(0,H.__)("Millimeters (mm)"),step:.1},in:{value:"in",label:Lw?"in":(0,H.__)("Inches (in)"),a11yLabel:(0,H.__)("Inches (in)"),step:.001},pc:{value:"pc",label:Lw?"pc":(0,H.__)("Picas (pc)"),a11yLabel:(0,H.__)("Picas (pc)"),step:1},pt:{value:"pt",label:Lw?"pt":(0,H.__)("Points (pt)"),a11yLabel:(0,H.__)("Points (pt)"),step:1},svw:{value:"svw",label:Lw?"svw":(0,H.__)("Small viewport width (svw)"),a11yLabel:(0,H.__)("Small viewport width (svw)"),step:.1},svh:{value:"svh",label:Lw?"svh":(0,H.__)("Small viewport height (svh)"),a11yLabel:(0,H.__)("Small viewport height (svh)"),step:.1},svi:{value:"svi",label:Lw?"svi":(0,H.__)("Viewport smallest size in the inline direction (svi)"),a11yLabel:(0,H.__)("Small viewport width or height (svi)"),step:.1},svb:{value:"svb",label:Lw?"svb":(0,H.__)("Viewport smallest size in the block direction (svb)"),a11yLabel:(0,H.__)("Small viewport width or height (svb)"),step:.1},svmin:{value:"svmin",label:Lw?"svmin":(0,H.__)("Small viewport smallest dimension (svmin)"),a11yLabel:(0,H.__)("Small viewport smallest dimension (svmin)"),step:.1},lvw:{value:"lvw",label:Lw?"lvw":(0,H.__)("Large viewport width (lvw)"),a11yLabel:(0,H.__)("Large viewport width (lvw)"),step:.1},lvh:{value:"lvh",label:Lw?"lvh":(0,H.__)("Large viewport height (lvh)"),a11yLabel:(0,H.__)("Large viewport height (lvh)"),step:.1},lvi:{value:"lvi",label:Lw?"lvi":(0,H.__)("Large viewport width or height (lvi)"),a11yLabel:(0,H.__)("Large viewport width or height (lvi)"),step:.1},lvb:{value:"lvb",label:Lw?"lvb":(0,H.__)("Large viewport width or height (lvb)"),a11yLabel:(0,H.__)("Large viewport width or height (lvb)"),step:.1},lvmin:{value:"lvmin",label:Lw?"lvmin":(0,H.__)("Large viewport smallest dimension (lvmin)"),a11yLabel:(0,H.__)("Large viewport smallest dimension (lvmin)"),step:.1},dvw:{value:"dvw",label:Lw?"dvw":(0,H.__)("Dynamic viewport width (dvw)"),a11yLabel:(0,H.__)("Dynamic viewport width (dvw)"),step:.1},dvh:{value:"dvh",label:Lw?"dvh":(0,H.__)("Dynamic viewport height (dvh)"),a11yLabel:(0,H.__)("Dynamic viewport height (dvh)"),step:.1},dvi:{value:"dvi",label:Lw?"dvi":(0,H.__)("Dynamic viewport width or height (dvi)"),a11yLabel:(0,H.__)("Dynamic viewport width or height (dvi)"),step:.1},dvb:{value:"dvb",label:Lw?"dvb":(0,H.__)("Dynamic viewport width or height (dvb)"),a11yLabel:(0,H.__)("Dynamic viewport width or height (dvb)"),step:.1},dvmin:{value:"dvmin",label:Lw?"dvmin":(0,H.__)("Dynamic viewport smallest dimension (dvmin)"),a11yLabel:(0,H.__)("Dynamic viewport smallest dimension (dvmin)"),step:.1},dvmax:{value:"dvmax",label:Lw?"dvmax":(0,H.__)("Dynamic viewport largest dimension (dvmax)"),a11yLabel:(0,H.__)("Dynamic viewport largest dimension (dvmax)"),step:.1},svmax:{value:"svmax",label:Lw?"svmax":(0,H.__)("Small viewport largest dimension (svmax)"),a11yLabel:(0,H.__)("Small viewport largest dimension (svmax)"),step:.1},lvmax:{value:"lvmax",label:Lw?"lvmax":(0,H.__)("Large viewport largest dimension (lvmax)"),a11yLabel:(0,H.__)("Large viewport largest dimension (lvmax)"),step:.1}},zw=Object.values(Fw),Uw=[Fw.px,Fw["%"],Fw.em,Fw.rem,Fw.vw,Fw.vh],Vw=Fw.px;function Hw(e,t,n){return Ww(t?`${null!=e?e:""}${t}`:e,n)}function $w(e){return Array.isArray(e)&&!!e.length}function Ww(e,t=zw){let n,r;if(void 0!==e||null===e){n=`${e}`.trim();const t=parseFloat(n);r=isFinite(t)?t:void 0}const o=n?.match(/[\d.\-\+]*\s*(.*)/),i=o?.[1]?.toLowerCase();let s;if($w(t)){const e=t.find((e=>e.value===i));s=e?.value}else s=Vw.value;return[r,s]}const Gw=({units:e=zw,availableUnits:t=[],defaultValues:n})=>{const r=function(e=[],t){return Array.isArray(t)?t.filter((t=>e.includes(t.value))):[]}(t,e);return n&&r.forEach(((e,t)=>{if(n[e.value]){const[o]=Ww(n[e.value]);r[t].default=o}})),r};var qw=n(2711),Kw=n(28795),Yw=n(31110),Jw=n(34579);const Xw=(0,W_.default)(Kw.A,{target:"e1bagdl32"})("&&&{input{display:block;width:100%;}",Yw.Hr,"{transition:box-shadow 0.1s linear;}}"),Zw=({selectSize:e})=>({small:(0,G_.css)("box-sizing:border-box;padding:2px 1px;width:20px;color:",q_.l.gray[800],";font-size:8px;line-height:1;letter-spacing:-0.5px;text-transform:uppercase;text-align-last:center;",""),default:(0,G_.css)("box-sizing:border-box;min-width:24px;max-width:48px;height:24px;margin-inline-end:",(0,Jw.x)(2),";padding:",(0,Jw.x)(1),";color:",q_.l.theme.accent,";font-size:13px;line-height:1;text-align-last:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;","")}[e]),Qw=(0,W_.default)("div",{target:"e1bagdl31"})("&&&{pointer-events:none;",Zw,";color:",q_.l.gray[900],";}"),ek=({selectSize:e="default"})=>({small:(0,G_.css)("height:100%;border:1px solid transparent;transition:box-shadow 0.1s linear,border 0.1s linear;",(0,qw.h)({borderTopLeftRadius:0,borderBottomLeftRadius:0})()," &:not(:disabled):hover{background-color:",q_.l.gray[100],";}&:focus{border:1px solid ",q_.l.ui.borderFocus,";box-shadow:inset 0 0 0 ",K_.A.borderWidth+" "+q_.l.ui.borderFocus,";outline-offset:0;outline:2px solid transparent;z-index:1;}",""),default:(0,G_.css)("display:flex;justify-content:center;align-items:center;&:hover{color:",q_.l.ui.borderFocus,";box-shadow:inset 0 0 0 ",K_.A.borderWidth+" "+q_.l.ui.borderFocus,";outline:",K_.A.borderWidth," solid transparent;}&:focus{box-shadow:0 0 0 ",K_.A.borderWidthFocus+" "+q_.l.ui.borderFocus,";outline:",K_.A.borderWidthFocus," solid transparent;}","")}[e]),tk=(0,W_.default)("select",{target:"e1bagdl30"})("&&&{appearance:none;background:transparent;border-radius:2px;border:none;display:block;outline:none;margin:0;min-height:auto;font-family:inherit;",Zw,";",ek,";&:not( :disabled ){cursor:pointer;}}"),nk=(0,S.forwardRef)((function({className:e,isUnitSelectTabbable:t=!0,onChange:n,size:r="default",unit:o="px",units:i=Uw,...s},a){if(!$w(i)||1===i?.length)return(0,Td.jsx)(Qw,{className:"components-unit-control__unit-label",selectSize:r,children:o});const l=(0,$v.A)("components-unit-control__select",e);return(0,Td.jsx)(tk,{ref:a,className:l,onChange:e=>{const{value:t}=e.target,r=i.find((e=>e.value===t));n?.(t,{event:e,data:r})},selectSize:r,tabIndex:t?void 0:-1,value:o,...s,children:i.map((e=>(0,Td.jsx)("option",{value:e.value,children:e.label},e.value)))})}));var rk=n(31084),ok=n(94647),ik=n(90309);const sk=(0,S.forwardRef)((function(e,t){const{__unstableStateReducer:n,autoComplete:r="off",children:o,className:i,disabled:s=!1,disableUnits:a=!1,isPressEnterToChange:l=!1,isResetValueOnUnitChange:c=!1,isUnitSelectTabbable:u=!0,label:d,onChange:h,onUnitChange:p,size:f="default",unit:m,units:g=Uw,value:b,onFocus:y,...v}=(0,ik.R)(e);"unit"in e&&(0,q.default)("UnitControl unit prop",{since:"5.6",hint:"The unit should be provided within the `value` prop.",version:"6.2"});const _=null!=b?b:void 0,[x,w]=(0,S.useMemo)((()=>{const e=function(e,t,n=zw){const r=Array.isArray(n)?[...n]:[],[,o]=Hw(e,t,zw);return o&&!r.some((e=>e.value===o))&&Fw[o]&&r.unshift(Fw[o]),r}(_,m,g),[{value:t=""}={},...n]=e,r=n.reduce(((e,{value:t})=>{const n=(0,ok.Nt)(t?.substring(0,1)||"");return e.includes(n)?e:`${e}|${n}`}),(0,ok.Nt)(t.substring(0,1)));return[e,new RegExp(`^(?:${r})$`,"i")]}),[_,m,g]),[k,C]=Hw(_,m,x),[A,E]=(0,rk.A)(1===x.length?x[0].value:m,{initial:C,fallback:""});(0,S.useEffect)((()=>{void 0!==C&&E(C)}),[C,E]);const I=(0,$v.A)("components-unit-control","components-unit-control-wrapper",i);let j;!a&&u&&x.length&&(j=e=>{v.onKeyDown?.(e),!e.metaKey&&w.test(e.key)&&T.current?.focus()});const T=(0,S.useRef)(null),B=a?null:(0,Td.jsx)(nk,{ref:T,"aria-label":(0,H.__)("Select unit"),disabled:s,isUnitSelectTabbable:u,onChange:(e,t)=>{const{data:n}=t;let r=`${null!=k?k:""}${e}`;c&&void 0!==n?.default&&(r=`${n.default}${e}`),h?.(r,t),p?.(e,t),E(e)},size:["small","compact"].includes(f)||"default"===f&&!v.__next40pxDefaultSize?"small":"default",unit:A,units:x,onFocus:y,onBlur:e.onBlur});let R=v.step;if(!R&&x){var N;const e=x.find((e=>e.value===A));R=null!==(N=e?.step)&&void 0!==N?N:1}return(0,Td.jsx)(Xw,{...v,autoComplete:r,className:I,disabled:s,spinControls:"none",isPressEnterToChange:l,label:d,onKeyDown:j,onChange:(e,t)=>{if(""===e||null==e)return void h?.("",t);const n=function(e,t,n,r){const[o,i]=Ww(e,t),s=null!=o?o:n;let a=i||r;return!a&&$w(t)&&(a=t[0].value),[s,a]}(e,x,k,A).join("");h?.(n,t)},ref:t,size:f,suffix:B,type:l?"text":"number",value:null!=k?k:"",step:R,onFocus:y,__unstableStateReducer:n})})),ak=sk;var lk=n(77780),ck=n(29791),uk=n(59473),dk=n(11789);const hk="var:",pk="|",fk="--",mk=(e,t)=>{let n=e;return t.forEach((e=>{n=n?.[e]})),n};function gk(e,t,n,r){const o=mk(e,n);return o?[{selector:t?.selector,key:r,value:yk(o)}]:[]}function bk(e,t,n,r,o=["top","right","bottom","left"]){const i=mk(e,n);if(!i)return[];const s=[];if("string"==typeof i)s.push({selector:t?.selector,key:r.default,value:i});else{const e=o.reduce(((e,n)=>{const o=yk(mk(i,[n]));return o&&e.push({selector:t?.selector,key:r?.individual.replace("%s",vk(n)),value:o}),e}),[]);s.push(...e)}return s}function yk(e){return"string"==typeof e&&e.startsWith(hk)?`var(--wp--${e.slice(hk.length).split(pk).map((e=>(0,dk.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(fk)})`:e}function vk(e){const[t,...n]=e;return t.toUpperCase()+n.join("")}function _k(e){try{return decodeURI(e)}catch(t){return e}}function xk(e){return(t,n)=>gk(t,n,e,function(e){const[t,...n]=e;return t.toLowerCase()+n.map(vk).join("")}(e))}function wk(e){return(t,n)=>["color","style","width"].flatMap((r=>xk(["border",e,r])(t,n)))}const kk={name:"radius",generate:(e,t)=>bk(e,t,["border","radius"],{default:"borderRadius",individual:"border%sRadius"},["topLeft","topRight","bottomLeft","bottomRight"])},Ck={name:"background",generate:(e,t)=>gk(e,t,["color","background"],"backgroundColor")},Sk={name:"gradient",generate:(e,t)=>gk(e,t,["color","gradient"],"background")},Ak={name:"text",generate:(e,t)=>gk(e,t,["color","text"],"color")},Ek={name:"minHeight",generate:(e,t)=>gk(e,t,["dimensions","minHeight"],"minHeight")},Ik={name:"aspectRatio",generate:(e,t)=>gk(e,t,["dimensions","aspectRatio"],"aspectRatio")},jk={name:"backgroundImage",generate:(e,t)=>{const n=e?.background?.backgroundImage;return"object"==typeof n&&n?.url?[{selector:t.selector,key:"backgroundImage",value:`url( '${encodeURI(_k(n.url))}' )`}]:"string"==typeof n?gk(e,t,["background","backgroundImage"],"backgroundImage"):[]}},Tk={name:"backgroundPosition",generate:(e,t)=>gk(e,t,["background","backgroundPosition"],"backgroundPosition")},Bk={name:"backgroundRepeat",generate:(e,t)=>gk(e,t,["background","backgroundRepeat"],"backgroundRepeat")},Rk={name:"backgroundSize",generate:(e,t)=>gk(e,t,["background","backgroundSize"],"backgroundSize")},Nk={name:"shadow",generate:(e,t)=>gk(e,t,["shadow"],"boxShadow")},Dk={name:"color",generate:(e,t,n=["outline","color"],r="outlineColor")=>gk(e,t,n,r)},Mk={name:"offset",generate:(e,t,n=["outline","offset"],r="outlineOffset")=>gk(e,t,n,r)},Pk={name:"style",generate:(e,t,n=["outline","style"],r="outlineStyle")=>gk(e,t,n,r)},Ok={name:"width",generate:(e,t,n=["outline","width"],r="outlineWidth")=>gk(e,t,n,r)},Lk={name:"padding",generate:(e,t)=>bk(e,t,["spacing","padding"],{default:"padding",individual:"padding%s"})},Fk={name:"margin",generate:(e,t)=>bk(e,t,["spacing","margin"],{default:"margin",individual:"margin%s"})},zk={name:"fontSize",generate:(e,t)=>gk(e,t,["typography","fontSize"],"fontSize")},Uk={name:"fontStyle",generate:(e,t)=>gk(e,t,["typography","fontStyle"],"fontStyle")},Vk={name:"fontWeight",generate:(e,t)=>gk(e,t,["typography","fontWeight"],"fontWeight")},Hk={name:"fontFamily",generate:(e,t)=>gk(e,t,["typography","fontFamily"],"fontFamily")},$k={name:"letterSpacing",generate:(e,t)=>gk(e,t,["typography","letterSpacing"],"letterSpacing")},Wk={name:"lineHeight",generate:(e,t)=>gk(e,t,["typography","lineHeight"],"lineHeight")},Gk={name:"textColumns",generate:(e,t)=>gk(e,t,["typography","textColumns"],"columnCount")},qk={name:"textDecoration",generate:(e,t)=>gk(e,t,["typography","textDecoration"],"textDecoration")},Kk={name:"textTransform",generate:(e,t)=>gk(e,t,["typography","textTransform"],"textTransform")},Yk={name:"writingMode",generate:(e,t)=>gk(e,t,["typography","writingMode"],"writingMode")},Jk=[{name:"color",generate:xk(["border","color"])},{name:"style",generate:xk(["border","style"])},{name:"width",generate:xk(["border","width"])},kk,{name:"borderTop",generate:wk("top")},{name:"borderRight",generate:wk("right")},{name:"borderBottom",generate:wk("bottom")},{name:"borderLeft",generate:wk("left")},Ak,Sk,Ck,Ek,Ik,Dk,Pk,Mk,Ok,Fk,Lk,Hk,zk,Uk,Vk,$k,Wk,Gk,qk,Kk,Yk,Nk,jk,Tk,Bk,Rk];function Xk(e,t={}){const n=Zk(e,t);if(!t?.selector){const e=[];return n.forEach((t=>{e.push(`${(0,dk.c)(t.key)}: ${t.value};`)})),e.join(" ")}const r=n.reduce(((e,t)=>{const{selector:n}=t;return n?(e[n]||(e[n]=[]),e[n].push(t),e):e}),{});return Object.keys(r).reduce(((e,t)=>(e.push(`${t} { ${r[t].map((e=>`${(0,dk.c)(e.key)}: ${e.value};`)).join(" ")} }`),e)),[]).join("\n")}function Zk(e,t={}){const n=[];return Jk.forEach((r=>{"function"==typeof r.generate&&n.push(...r.generate(e,t))})),n}const Qk={name:"constrained",label:(0,H.__)("Constrained"),inspectorControls:function({layout:e,onChange:t,layoutBlockSupport:n={}}){const{wideSize:r,contentSize:o,justifyContent:i="center"}=e,{allowJustification:s=!0,allowCustomContentAndWideSize:a=!0}=n,l=[{value:"left",icon:C_.A,label:(0,H.__)("Justify items left")},{value:"center",icon:S_.A,label:(0,H.__)("Justify items center")},{value:"right",icon:A_.A,label:(0,H.__)("Justify items right")}],[c]=fv("spacing.units"),u=Gw({availableUnits:c||["%","px","em","rem","vw"]});return(0,Td.jsxs)(Td.Fragment,{children:[a&&(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsxs)("div",{className:"block-editor-hooks__layout-controls",children:[(0,Td.jsxs)("div",{className:"block-editor-hooks__layout-controls-unit",children:[(0,Td.jsx)(ak,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,H.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,contentSize:n})},units:u}),(0,Td.jsx)(lk.A,{icon:ck.A})]}),(0,Td.jsxs)("div",{className:"block-editor-hooks__layout-controls-unit",children:[(0,Td.jsx)(ak,{className:"block-editor-hooks__layout-controls-unit-input",label:(0,H.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:n=>{n=0>parseFloat(n)?"0":n,t({...e,wideSize:n})},units:u}),(0,Td.jsx)(lk.A,{icon:uk.A})]})]}),(0,Td.jsx)("p",{className:"block-editor-hooks__layout-controls-helptext",children:(0,H.__)("Customize the width for all elements that are assigned to the center or wide columns.")})]}),s&&(0,Td.jsx)(wx,{__nextHasNoMarginBottom:!0,label:(0,H.__)("Justification"),value:i,onChange:n=>{t({...e,justifyContent:n})},children:l.map((({value:e,icon:t,label:n})=>(0,Td.jsx)(Vx,{value:e,icon:t,label:n},e)))})]})},toolBarControls:function(){return null},getLayoutStyle:function({selector:e,layout:t={},style:n,blockName:r,hasBlockGapSupport:o,layoutDefinitions:i=$x}){const{contentSize:s,wideSize:a,justifyContent:l}=t,c=hw(n?.spacing?.blockGap);let u="";qv(r,"spacing","blockGap")||(c?.top?u=hw(c?.top):"string"==typeof c&&(u=hw(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${Wx(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=s?s:a};\n\t\t\t\t\t\tmargin-left: ${d};\n\t\t\t\t\t\tmargin-right: ${h};\n\t\t\t\t\t}\n\t\t\t\t\t${Wx(e,"> .alignwide")}  {\n\t\t\t\t\t\tmax-width: ${null!=a?a:s};\n\t\t\t\t\t}\n\t\t\t\t\t${Wx(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+=`${Wx(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-left: ${d}; }`:"right"===l&&(p+=`${Wx(e,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")}\n\t\t\t{ margin-right: ${h}; }`),n?.spacing?.padding&&Zk(n).forEach((t=>{"paddingRight"===t.key?p+=`\n\t\t\t\t\t${Wx(e,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${t.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`:"paddingLeft"===t.key&&(p+=`\n\t\t\t\t\t${Wx(e,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${t.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`)})),o&&u&&(p+=Gx(e,i,"constrained",u)),p},getOrientation:()=>"vertical",getAlignments(e){const t=qx(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:r}=e,o=[{name:"left"},{name:"center"},{name:"right"}];return n&&o.unshift({name:"full"}),r&&o.unshift({name:"wide",info:t.wide}),o.unshift({name:"none",info:t.none}),o}};var eC=n(46774),tC=n(75015);function nC(e,t,n){return"number"!=typeof e?null:parseFloat(`${(0,tC.qE)(e,t,n)}`)}const rC=()=>(0,G_.css)({height:30,minHeight:30},"",""),oC=({__next40pxDefaultSize:e})=>!e&&(0,G_.css)({minHeight:30},"",""),iC=(0,W_.default)("div",{target:"e1epgpqk14"})("-webkit-tap-highlight-color:transparent;align-items:center;display:flex;justify-content:flex-start;padding:0;position:relative;touch-action:none;width:100%;min-height:40px;",oC,";"),sC=({color:e=q_.l.ui.borderFocus})=>(0,G_.css)({color:e},"",""),aC=({marks:e,__nextHasNoMarginBottom:t})=>t?"":(0,G_.css)({marginBottom:e?16:void 0},"",""),lC=(0,W_.default)("div",{target:"e1epgpqk13"})("display:block;flex:1;position:relative;width:100%;",sC,";",rC,";",aC,";"),cC=(0,W_.default)("span",{target:"e1epgpqk12"})("display:flex;margin-top:",4,"px;",(0,qw.h)({marginRight:6}),";"),uC=(0,W_.default)("span",{target:"e1epgpqk11"})("display:flex;margin-top:",4,"px;",(0,qw.h)({marginLeft:6}),";"),dC=({disabled:e,railColor:t})=>{let n=t||"";return e&&(n=q_.l.ui.backgroundDisabled),(0,G_.css)({background:n},"","")},hC=(0,W_.default)("span",{target:"e1epgpqk10"})("background-color:",q_.l.gray[300],";left:0;pointer-events:none;right:0;display:block;height:",4,"px;position:absolute;margin-top:",13,"px;top:0;border-radius:",4,"px;",dC,";"),pC=({disabled:e,trackColor:t})=>{let n=t||"currentColor";return e&&(n=q_.l.gray[400]),(0,G_.css)({background:n},"","")},fC=(0,W_.default)("span",{target:"e1epgpqk9"})("background-color:currentColor;border-radius:",4,"px;height:",4,"px;pointer-events:none;display:block;position:absolute;margin-top:",13,"px;top:0;",pC,";"),mC=(0,W_.default)("span",{target:"e1epgpqk8"})({name:"l7tjj5",styles:"display:block;pointer-events:none;position:relative;width:100%;user-select:none"}),gC=({disabled:e,isFilled:t})=>{let n=t?"currentColor":q_.l.gray[300];return e&&(n=q_.l.gray[400]),(0,G_.css)({backgroundColor:n},"","")},bC=(0,W_.default)("span",{target:"e1epgpqk7"})("height:",12,"px;left:0;position:absolute;top:-4px;width:1px;",gC,";"),yC=({isFilled:e})=>(0,G_.css)({color:e?q_.l.gray[700]:q_.l.gray[300]},"",""),vC=(0,W_.default)("span",{target:"e1epgpqk6"})("color:",q_.l.gray[300],";left:0;font-size:11px;position:absolute;top:12px;transform:translateX( -50% );white-space:nowrap;",yC,";"),_C=({disabled:e})=>e?(0,G_.css)("background-color:",q_.l.gray[400],";",""):(0,G_.css)("background-color:",q_.l.theme.accent,";",""),xC=(0,W_.default)("span",{target:"e1epgpqk5"})("align-items:center;display:flex;height:",12,"px;justify-content:center;margin-top:",9,"px;outline:0;pointer-events:none;position:absolute;top:0;user-select:none;width:",12,"px;border-radius:50%;",_C,";",(0,qw.h)({marginLeft:-10}),";",(0,qw.h)({transform:"translateX( 4.5px )"},{transform:"translateX( -4.5px )"}),";"),wC=({isFocused:e})=>e?(0,G_.css)("&::before{content:' ';position:absolute;background-color:",q_.l.theme.accent,";opacity:0.4;border-radius:50%;height:",20,"px;width:",20,"px;top:-4px;left:-4px;}",""):"",kC=(0,W_.default)("span",{target:"e1epgpqk4"})("align-items:center;border-radius:50%;height:100%;outline:0;position:absolute;user-select:none;width:100%;",_C,";",wC,";"),CC=(0,W_.default)("input",{target:"e1epgpqk3"})("box-sizing:border-box;cursor:pointer;display:block;height:100%;left:0;margin:0 -",6,"px;opacity:0;outline:none;position:absolute;right:0;top:0;width:calc( 100% + ",12,"px );"),SC=({show:e})=>(0,G_.css)({opacity:e?1:0},"","");var AC={name:"1cypxip",styles:"top:-80%"},EC={name:"1lr98c4",styles:"bottom:-80%"};const IC=({position:e})=>"bottom"===e?EC:AC,jC=(0,W_.default)("span",{target:"e1epgpqk2"})("background:rgba( 0, 0, 0, 0.8 );border-radius:2px;color:white;display:inline-block;font-size:12px;min-width:32px;opacity:0;padding:4px 8px;pointer-events:none;position:absolute;text-align:center;user-select:none;line-height:1.4;@media not ( prefers-reduced-motion ){transition:opacity 120ms ease;}",SC,";",IC,";",(0,qw.h)({transform:"translateX(-50%)"},{transform:"translateX(50%)"}),";"),TC=(0,W_.default)(Kw.A,{target:"e1epgpqk1"})("display:inline-block;font-size:13px;margin-top:0;input[type='number']&{",rC,";}",(0,qw.h)({marginLeft:`${(0,Jw.x)(4)} !important`}),";"),BC=(0,W_.default)("span",{target:"e1epgpqk0"})("display:block;margin-top:0;button,button.is-small{margin-left:0;",rC,";}",(0,qw.h)({marginLeft:8}),";"),RC=(0,S.forwardRef)((function(e,t){const{describedBy:n,label:r,value:o,...i}=e;return(0,Td.jsx)(CC,{...i,"aria-describedby":n,"aria-label":r,"aria-hidden":!1,ref:t,tabIndex:0,type:"range",value:o})}));function NC(e){const{className:t,isFilled:n=!1,label:r,style:o={},...i}=e,s=(0,$v.A)("components-range-control__mark",n&&"is-filled",t),a=(0,$v.A)("components-range-control__mark-label",n&&"is-filled");return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(bC,{...i,"aria-hidden":"true",className:s,isFilled:n,style:o}),r&&(0,Td.jsx)(vC,{"aria-hidden":"true",className:a,isFilled:n,style:o,children:r})]})}function DC(e){const{disabled:t=!1,marks:n=!1,min:r=0,max:o=100,step:i=1,value:s=0,...a}=e;return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(hC,{disabled:t,...a}),n&&(0,Td.jsx)(MC,{disabled:t,marks:n,min:r,max:o,step:i,value:s})]})}function MC(e){const{disabled:t=!1,marks:n=!1,min:r=0,max:o=100,step:i=1,value:s=0}=e,a=function({marks:e,min:t=0,max:n=100,step:r=1,value:o=0}){if(!e)return[];const i=n-t;if(!Array.isArray(e)){e=[];const n=1+Math.round(i/r);for(;n>e.push({value:r*e.length+t}););}const s=[];return e.forEach(((e,r)=>{if(e.value<t||e.value>n)return;const a=`mark-${r}`,l=e.value<=o,c=(e.value-t)/i*100+"%",u={[(0,H.isRTL)()?"right":"left"]:c};s.push({...e,isFilled:l,key:a,style:u})})),s}({marks:n,min:r,max:o,step:"any"===i?1:i,value:s});return(0,Td.jsx)(mC,{"aria-hidden":"true",className:"components-range-control__marks",children:a.map((e=>(0,S.createElement)(NC,{...e,key:e.key,"aria-hidden":"true",disabled:t})))})}function PC(e){const{className:t,inputRef:n,tooltipPosition:r,show:o=!1,style:i={},value:s=0,renderTooltipContent:a=(e=>e),zIndex:l=100,...c}=e,u=function({inputRef:e,tooltipPosition:t}){const[n,r]=(0,S.useState)(),o=(0,S.useCallback)((()=>{e&&e.current&&r(t)}),[t,e]);return(0,S.useEffect)((()=>{o()}),[o]),(0,S.useEffect)((()=>(window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}))),n}({inputRef:n,tooltipPosition:r}),d=(0,$v.A)("components-simple-tooltip",t),h={...i,zIndex:l};return(0,Td.jsx)(jC,{...c,"aria-hidden":o,className:d,position:u,show:o,role:"tooltip",style:h,children:a(s)})}const OC=()=>{},LC=(0,S.forwardRef)((function e(t,n){const{__nextHasNoMarginBottom:r=!1,afterIcon:o,allowReset:i=!1,beforeIcon:s,className:a,color:l=q_.l.theme.accent,currentInput:c,disabled:u=!1,help:d,hideLabelFromVision:h=!1,initialPosition:p,isShiftStepEnabled:f=!0,label:m,marks:g=!1,max:b=100,min:y=0,onBlur:v=OC,onChange:_=OC,onFocus:x=OC,onMouseLeave:w=OC,onMouseMove:k=OC,railColor:C,renderTooltipContent:A=(e=>e),resetFallbackValue:E,__next40pxDefaultSize:I=!1,shiftStep:j=10,showTooltip:T,step:B=1,trackColor:R,value:N,withInputField:D=!0,...M}=t,[P,O]=function(e){const{min:t,max:n,value:r,initial:o}=e,[i,s]=(0,rk.A)(nC(r,t,n),{initial:nC(null!=o?o:null,t,n),fallback:null});return[i,(0,S.useCallback)((e=>{s(null===e?null:nC(e,t,n))}),[t,n,s])]}({min:y,max:b,value:null!=N?N:null,initial:p}),L=(0,S.useRef)(!1);let F=T,z=D;"any"===B&&(F=!1,z=!1);const[U,V]=(0,S.useState)(F),[$,W]=(0,S.useState)(!1),G=(0,S.useRef)(),q=G.current?.matches(":focus"),K=!u&&$,Y=null===P,J=Y?"":void 0!==P?P:c,X=Y?(b-y)/2+y:P,Z=Y?50:(P-y)/(b-y)*100,Q=`${(0,tC.qE)(Z,0,100)}%`,ee=(0,$v.A)("components-range-control",a),te=(0,$v.A)("components-range-control__wrapper",!!g&&"is-marked"),ne=(0,z_.A)(e,"inspector-range-control"),re=d?`${ne}__help`:void 0,oe=!1!==F&&Number.isFinite(P),ie=()=>{let e=parseFloat(`${E}`),t=e;isNaN(e)&&(e=null,t=void 0),O(e),_(t)},se={[(0,H.isRTL)()?"right":"left"]:Q};return(0,Td.jsx)($_.Ay,{__nextHasNoMarginBottom:r,className:ee,label:m,hideLabelFromVision:h,id:`${ne}`,help:d,children:(0,Td.jsxs)(iC,{className:"components-range-control__root",__next40pxDefaultSize:I,children:[s&&(0,Td.jsx)(cC,{children:(0,Td.jsx)(Ux.A,{icon:s})}),(0,Td.jsxs)(lC,{__nextHasNoMarginBottom:r,className:te,color:l,marks:!!g,children:[(0,Td.jsx)(RC,{...M,className:"components-range-control__slider",describedBy:re,disabled:u,id:`${ne}`,label:m,max:b,min:y,onBlur:e=>{v(e),W(!1),V(!1)},onChange:e=>{const t=parseFloat(e.target.value);O(t),_(t)},onFocus:e=>{x(e),W(!0),V(!0)},onMouseMove:k,onMouseLeave:w,ref:(0,eC.A)([G,n]),step:B,value:null!=J?J:void 0}),(0,Td.jsx)(DC,{"aria-hidden":!0,disabled:u,marks:g,max:b,min:y,railColor:C,step:B,value:X}),(0,Td.jsx)(fC,{"aria-hidden":!0,className:"components-range-control__track",disabled:u,style:{width:Q},trackColor:R}),(0,Td.jsx)(xC,{className:"components-range-control__thumb-wrapper",style:se,disabled:u,children:(0,Td.jsx)(kC,{"aria-hidden":!0,isFocused:K,disabled:u})}),oe&&(0,Td.jsx)(PC,{className:"components-range-control__tooltip",inputRef:G,tooltipPosition:"bottom",renderTooltipContent:A,show:q||U,style:se,value:P})]}),o&&(0,Td.jsx)(uC,{children:(0,Td.jsx)(Ux.A,{icon:o})}),z&&(0,Td.jsx)(TC,{"aria-label":m,className:"components-range-control__number",disabled:u,inputMode:"decimal",isShiftStepEnabled:f,max:b,min:y,onBlur:()=>{L.current&&(ie(),L.current=!1)},onChange:e=>{let t=parseFloat(e);O(t),isNaN(t)?i&&(L.current=!0):((t<y||t>b)&&(t=nC(t,y,b)),_(t),L.current=!1)},shiftStep:j,size:I?"__unstable-large":"default",__unstableInputWidth:I?(0,Jw.x)(20):(0,Jw.x)(16),step:B,value:J}),i&&(0,Td.jsx)(BC,{children:(0,Td.jsx)(Zv.Ay,{className:"components-range-control__reset",disabled:u||void 0===P,variant:"secondary",size:"small",onClick:ie,children:(0,H.__)("Reset")})})]})})})),FC=LC,zC=(0,S.forwardRef)((function(e,t){const{label:n,...r}=e,o=r["aria-label"]||n;return(0,Td.jsx)(zx,{...r,"aria-label":o,ref:t,children:n})}));var UC=n(93982),VC=n(59880);const HC=(0,S.createContext)({refsMap:(0,VC.u)()});function $C({children:e}){const t=(0,S.useMemo)((()=>({refsMap:(0,VC.u)()})),[]);return(0,Td.jsx)(HC.Provider,{value:t,children:e})}function WC(e){const{refsMap:t}=(0,S.useContext)(HC);return(0,UC.A)((n=>(t.set(e,n),()=>t.delete(e))),[e])}function GC(e){const{refsMap:t}=(0,S.useContext)(HC),n=(0,S.useRef)();return n.current=e,(0,S.useMemo)((()=>({get current(){var e;return null!==(e=t.get(n.current))&&void 0!==e?e:null}})),[t])}function qC(e){var t;const{refsMap:n}=(0,S.useContext)(HC);return null!==(t=(0,h_.A)(n,e))&&void 0!==t?t:null}var KC=n(15915);const YC=function(e){return(0,UC.A)((t=>{if(!e)return;function n(t){const{deltaX:n,deltaY:r}=t;e.current.scrollBy(n,r)}const r={passive:!0};return t.addEventListener("wheel",n,r),()=>{t.removeEventListener("wheel",n,r)}}),[e])},JC=Number.MAX_SAFE_INTEGER,XC=(0,S.forwardRef)((function({clientId:e,bottomClientId:t,children:n,__unstablePopoverSlot:r,__unstableContentRef:o,shift:i=!0,...s},a){const l=qC(e),c=qC(null!=t?t:e),u=(0,eC.A)([a,YC(o)]),[d,h]=(0,S.useReducer)((e=>(e+1)%JC),0);(0,S.useLayoutEffect)((()=>{if(!l)return;const e=new window.MutationObserver(h);return e.observe(l,{attributes:!0}),()=>{e.disconnect()}}),[l]);const p=(0,S.useMemo)((()=>{if(!(d<0||!l||t&&!c))return{getBoundingClientRect(){var e,t,n,r;const o=l.getBoundingClientRect(),i=c?.getBoundingClientRect(),s=Math.min(o.left,null!==(e=i?.left)&&void 0!==e?e:1/0),a=Math.min(o.top,null!==(t=i?.top)&&void 0!==t?t:1/0),u=Math.max(o.right,null!==(n=i.right)&&void 0!==n?n:-1/0)-s,d=Math.max(o.bottom,null!==(r=i.bottom)&&void 0!==r?r:-1/0)-a;return new window.DOMRect(s,a,u,d)},contextElement:l}}),[t,c,l,d]);return!l||t&&!c?null:(0,Td.jsx)(KC.Ay,{ref:u,animate:!1,focusOnMount:!1,anchor:p,__unstableSlotName:r,inline:!r,placement:"top-start",resize:!1,flip:!1,shift:i,...s,className:(0,$v.A)("block-editor-block-popover",s.className),variant:"unstyled",children:n})})),ZC=(0,S.forwardRef)((({clientId:e,bottomClientId:t,children:n,...r},o)=>(0,Td.jsx)(XC,{...r,bottomClientId:t,clientId:e,__unstableContentRef:void 0,__unstablePopoverSlot:void 0,ref:o,children:n})));function QC({selectedElement:e,additionalStyles:t={},children:n}){const[r,o]=(0,S.useState)(e.offsetWidth),[i,s]=(0,S.useState)(e.offsetHeight);(0,S.useEffect)((()=>{const t=new window.ResizeObserver((()=>{o(e.offsetWidth),s(e.offsetHeight)}));return t.observe(e,{box:"border-box"}),()=>t.disconnect()}),[e]);const a=(0,S.useMemo)((()=>({position:"absolute",width:r,height:i,...t})),[r,i,t]);return(0,Td.jsx)("div",{style:a,children:n})}const eS=(0,S.forwardRef)((function({clientId:e,bottomClientId:t,children:n,shift:r=!1,additionalStyles:o,...i},s){var a;null!==(a=t)&&void 0!==a||(t=e);const l=qC(e);return(0,Td.jsx)(XC,{ref:s,clientId:e,bottomClientId:t,shift:r,...i,children:l&&e===t?(0,Td.jsx)(QC,{selectedElement:l,additionalStyles:o,children:n}):n})}));function tS(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function nS({clientId:e,contentRef:t}){const n=(0,Ul.A)((e=>e(hv).getSettings().isDistractionFree),[]),r=qC(e);return n||!r?null:(0,Td.jsx)(eS,{className:"block-editor-grid-visualizer",clientId:e,__unstablePopoverSlot:"block-toolbar",children:(0,Td.jsx)(rS,{ref:t,blockElement:r})})}const rS=(0,S.forwardRef)((({blockElement:e},t)=>{const[n,r]=(0,S.useState)((()=>oS(e)));return(0,S.useEffect)((()=>{const t=[];for(const n of[e,...e.children]){const o=new window.ResizeObserver((()=>{r(oS(e))}));o.observe(n),t.push(o)}return()=>{for(const e of t)e.disconnect()}}),[e]),(0,Td.jsx)("div",{ref:t,className:"block-editor-grid-visualizer__grid",style:n.style,children:Array.from({length:n.numItems},((e,t)=>(0,Td.jsx)("div",{className:"block-editor-grid-visualizer__item",style:{boxShadow:`inset 0 0 0 1px color-mix(in srgb, ${n.currentColor} 20%, #0000)`}},t)))})}));function oS(e){const t=tS(e,"grid-template-columns"),n=tS(e,"grid-template-rows");return{numItems:t.split(" ").length*n.split(" ").length,currentColor:tS(e,"color"),style:{gridTemplateColumns:t,gridTemplateRows:n,gap:tS(e,"gap"),padding:tS(e,"padding")}}}const iS={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},sS=[{value:"px",label:"px",default:0},{value:"rem",label:"rem",default:0},{value:"em",label:"em",default:0}],aS={name:"grid",label:(0,H.__)("Grid"),inspectorControls:function({layout:e={},onChange:t,layoutBlockSupport:n={}}){const{allowSizingOnChildren:r=!1}=n;return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(uS,{layout:e,onChange:t}),e?.columnCount?(0,Td.jsx)(cS,{layout:e,onChange:t,allowSizingOnChildren:r}):(0,Td.jsx)(lS,{layout:e,onChange:t})]})},toolBarControls:function({clientId:e}){return(0,Td.jsx)(nS,{clientId:e})},getLayoutStyle:function({selector:e,layout:t,style:n,blockName:r,hasBlockGapSupport:o,layoutDefinitions:i=$x}){const{minimumColumnWidth:s="12rem",columnCount:a=null,rowCount:l=null}=t,c=n?.spacing?.blockGap&&!qv(r,"spacing","blockGap")?hw(n?.spacing?.blockGap,"0.5em"):void 0;let u="";const d=[];return a?(d.push(`grid-template-columns: repeat(${a}, minmax(0, 1fr))`),l&&d.push(`grid-template-rows: repeat(${l}, minmax(0, 1fr))`)):s&&d.push(`grid-template-columns: repeat(auto-fill, minmax(min(${s}, 100%), 1fr))`,"container-type: inline-size"),d.length&&(u=`${Wx(e)} { ${d.join("; ")}; }`),o&&c&&(u+=Gx(e,i,"grid",c)),u},getOrientation:()=>"horizontal",getAlignments:()=>[]};function lS({layout:e,onChange:t}){const{minimumColumnWidth:n="12rem"}=e,[r,o]=Ww(n);return(0,Td.jsxs)("fieldset",{children:[(0,Td.jsx)($_.Ay.VisualLabel,{as:"legend",children:(0,H.__)("Minimum column width")}),(0,Td.jsxs)(B_.A,{gap:4,children:[(0,Td.jsx)(R_.A,{isBlock:!0,children:(0,Td.jsx)(ak,{size:"__unstable-large",onChange:n=>{t({...e,minimumColumnWidth:n})},onUnitChange:n=>{let i;["em","rem"].includes(n)&&"px"===o?i=(r/16).toFixed(2)+n:["em","rem"].includes(o)&&"px"===n&&(i=Math.round(16*r)+n),t({...e,minimumColumnWidth:i})},value:n,units:sS,min:0,label:(0,H.__)("Minimum column width"),hideLabelFromVision:!0})}),(0,Td.jsx)(R_.A,{isBlock:!0,children:(0,Td.jsx)(FC,{onChange:n=>{t({...e,minimumColumnWidth:[n,o].join("")})},value:r,min:0,max:iS[o]||600,withInputField:!1,label:(0,H.__)("Minimum column width"),hideLabelFromVision:!0})})]})]})}function cS({layout:e,onChange:t,allowSizingOnChildren:n}){const{columnCount:r=3,rowCount:o}=e;return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsxs)("fieldset",{children:[(0,Td.jsx)($_.Ay.VisualLabel,{as:"legend",children:(0,H.__)("Columns")}),(0,Td.jsxs)(B_.A,{gap:4,children:[(0,Td.jsx)(R_.A,{isBlock:!0,children:(0,Td.jsx)(Kw.A,{size:"__unstable-large",onChange:n=>{const r=""!==n?n:"1";t({...e,columnCount:r})},value:r,min:1,label:(0,H.__)("Columns"),hideLabelFromVision:!0})}),(0,Td.jsx)(R_.A,{isBlock:!0,children:(0,Td.jsx)(FC,{value:parseInt(r,10),onChange:n=>t({...e,columnCount:n}),min:1,max:16,withInputField:!1,label:(0,H.__)("Columns"),hideLabelFromVision:!0})})]})]}),n&&window.__experimentalEnableGridInteractivity&&(0,Td.jsxs)("fieldset",{children:[(0,Td.jsx)($_.Ay.VisualLabel,{as:"legend",children:(0,H.__)("Rows")}),(0,Td.jsxs)(B_.A,{gap:4,children:[(0,Td.jsx)(R_.A,{isBlock:!0,children:(0,Td.jsx)(Kw.A,{size:"__unstable-large",onChange:n=>{t({...e,rowCount:n})},value:o,min:1,label:(0,H.__)("Rows"),hideLabelFromVision:!0})}),(0,Td.jsx)(R_.A,{isBlock:!0,children:(0,Td.jsx)(FC,{value:parseInt(o,10),onChange:n=>t({...e,rowCount:n}),min:1,max:16,withInputField:!1,label:(0,H.__)("Rows"),hideLabelFromVision:!0})})]})]})]})}function uS({layout:e,onChange:t}){const{columnCount:n,minimumColumnWidth:r}=e,[o,i]=(0,S.useState)(n||3),[s,a]=(0,S.useState)(r||"12rem"),l=n?"manual":"auto";return(0,Td.jsxs)(wx,{__nextHasNoMarginBottom:!0,label:(0,H.__)("Type"),value:l,onChange:l=>{"manual"===l?a(r||"12rem"):i(n||3),t({...e,columnCount:"manual"===l?o:null,minimumColumnWidth:"auto"===l?s:null})},isBlock:!0,children:[(0,Td.jsx)(zC,{value:"auto",label:(0,H.__)("Auto")},"auto"),(0,Td.jsx)(zC,{value:"manual",label:(0,H.__)("Manual")},"manual")]})}const dS=[Ow,Bw,Qk,aS];function hS(e="default"){return dS.find((t=>t.name===e))}const pS={type:"default"},fS=(0,S.createContext)(pS),mS=fS.Provider;function gS(){return(0,S.useContext)(fS)}const bS=[],yS=["none","left","center","right","wide","full"],vS=["wide","full"];function _S(e=yS){e.includes("none")||(e=["none",...e]);const t=1===e.length&&"none"===e[0],[n,r,o]=(0,Ul.A)((e=>{var n;if(t)return[!1,!1,!1];const r=e(hv).getSettings();return[null!==(n=r.alignWide)&&void 0!==n&&n,r.supportsLayout,r.__unstableIsBlockBasedTheme]}),[t]),i=gS();if(t)return bS;const s=hS(i?.type);if(r){const t=s.getAlignments(i,o).filter((t=>e.includes(t.name)));return 1===t.length&&"none"===t[0].name?bS:t}if("default"!==s.name&&"constrained"!==s.name)return bS;const a=e.filter((e=>i.alignments?i.alignments.includes(e):!(!n&&vS.includes(e))&&yS.includes(e))).map((e=>({name:e})));return 1===a.length&&"none"===a[0].name?bS:a}var xS=n(8336),wS=n(66867),kS=n(88282),CS=n(84122);const SS={none:{icon:xS.A,title:(0,H._x)("None","Alignment option")},left:{icon:wS.A,title:(0,H.__)("Align left")},center:{icon:ck.A,title:(0,H.__)("Align center")},right:{icon:kS.A,title:(0,H.__)("Align right")},wide:{icon:uk.A,title:(0,H.__)("Wide width")},full:{icon:CS.A,title:(0,H.__)("Full width")}},AS=function({value:e,onChange:t,controls:n,isToolbar:r,isCollapsed:o=!0}){const i=_S(n);if(!i.length)return null;function s(n){t([e,"none"].includes(n)?void 0:n)}const a=SS[e],l=SS.none,c=r?a_:x_,u={icon:a?a.icon:l.icon,label:(0,H.__)("Align")},d=r?{isCollapsed:o,controls:i.map((({name:t})=>({...SS[t],isActive:e===t||!e&&"none"===t,role:o?"menuitemradio":void 0,onClick:()=>s(t)})))}:{toggleProps:{describedBy:(0,H.__)("Change alignment")},children:({onClose:t})=>(0,Td.jsx)(Td.Fragment,{children:(0,Td.jsx)(w_.A,{className:"block-editor-block-alignment-control__menu-group",children:i.map((({name:n,info:r})=>{const{icon:o,title:i}=SS[n],a=n===e||!e&&"none"===n;return(0,Td.jsx)(k_.A,{icon:o,iconPosition:"left",className:(0,$v.A)("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{s(n),t()},role:"menuitemradio",info:r,children:i},n)}))})})};return(0,Td.jsx)(c,{...u,...d})},ES=e=>(0,Td.jsx)(AS,{...e,isToolbar:!1});function IS(e){const t=Qp(),{clientId:n=""}=t,{setBlockEditingMode:r,unsetBlockEditingMode:o}=(0,Vl.A)(hv),i=(0,Ul.A)((e=>n?null:e(hv).getBlockEditingMode()),[n]);return(0,S.useEffect)((()=>(e&&r(n,e),()=>{e&&o(n)})),[n,e,r,o]),n?t[qp]:i}const jS=["left","center","right","wide","full"],TS=["wide","full"];function BS(e,t=!0,n=!0){let r;return r=Array.isArray(e)?jS.filter((t=>e.includes(t))):!0===e?[...jS]:[],!n||!0===e&&!t?r.filter((e=>!TS.includes(e))):r}const RS={shareWithChildBlocks:!0,edit:function({name:e,align:t,setAttributes:n}){const r=_S(BS(Ec(e,"align"),Ic(e,"alignWide",!0))).map((({name:e})=>e)),o=IS();return r.length&&"default"===o?(0,Td.jsx)(__,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,Td.jsx)(ES,{value:t,onChange:t=>{if(!t){const n=Sc(e),r=n?.attributes?.align?.default;r&&(t="")}n({align:t})},controls:r})}):null},useBlockProps:function({name:e,align:t}){return _S(BS(Ec(e,"align"),Ic(e,"alignWide",!0))).some((e=>e.name===t))?{"data-align":t}:{}},addSaveProps:function(e,t,n){const{align:r}=n;return BS(Ec(t,"align"),Ic(t,"alignWide",!0)).includes(r)&&(e.className=(0,$v.A)(`align${r}`,e.className)),e},attributeKeys:["align"],hasSupport:e=>Ic(e,"align",!1)};(0,Tu.addFilter)("blocks.registerBlockType","core/editor/align/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.align)&&void 0!==t?t:{})||Ic(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...jS,""]}}),e}));const NS=()=>{},DS=(0,S.createContext)({menuItems:{default:{},optional:{}},hasMenuItems:!1,isResetting:!1,shouldRenderPlaceholderItems:!1,registerPanelItem:NS,deregisterPanelItem:NS,flagItemCustomization:NS,registerResetAllFilter:NS,deregisterResetAllFilter:NS,areAllOptionalControlsHidden:!0}),MS=()=>(0,S.useContext)(DS),PS=(0,Hl.QJ)("InspectorControls"),OS=(0,Hl.QJ)("InspectorAdvancedControls"),LS=(0,Hl.QJ)("InspectorControlsBackground"),FS=(0,Hl.QJ)("InspectorControlsBorder"),zS=(0,Hl.QJ)("InspectorControlsColor"),US=(0,Hl.QJ)("InspectorControlsFilter"),VS=(0,Hl.QJ)("InspectorControlsDimensions"),HS=(0,Hl.QJ)("InspectorControlsPosition"),$S=(0,Hl.QJ)("InspectorControlsTypography"),WS=(0,Hl.QJ)("InspectorControlsListView"),GS=(0,Hl.QJ)("InspectorControlsStyles"),qS={default:PS,advanced:OS,background:LS,border:FS,color:zS,dimensions:VS,effects:(0,Hl.QJ)("InspectorControlsEffects"),filter:US,list:WS,position:HS,settings:PS,styles:GS,typography:$S};function KS({children:e,group:t="default",__experimentalGroup:n,resetAllFilter:r}){n&&((0,q.default)("`__experimentalGroup` property in `InspectorControlsFill`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=n);const o=Qp(),i=qS[t]?.Fill;return i?o[Wp]?(0,Td.jsx)(l_.A,{document,children:(0,Td.jsx)(i,{children:t=>(0,Td.jsx)(JS,{fillProps:t,children:e,resetAllFilter:r})})}):null:(!0===globalThis.SCRIPT_DEBUG&&(0,m_.default)(`Unknown InspectorControls group "${t}" provided.`),null)}function YS({resetAllFilter:e,children:t}){const{registerResetAllFilter:n,deregisterResetAllFilter:r}=(0,S.useContext)(DS);return(0,S.useEffect)((()=>{if(e&&n&&r)return n(e),()=>{r(e)}}),[e,n,r]),t}function JS({children:e,resetAllFilter:t,fillProps:n}){const{forwardedContext:r=[]}=n,o=(0,Td.jsx)(YS,{resetAllFilter:t,children:e});return r.reduce(((e,[t,n])=>(0,Td.jsx)(t,{...n,children:e})),o)}var XS=n(97091),ZS=n(39528),QS=n(48410),eA=n(52710),tA=n(56886),nA=n(82021),rA=n(54894);const oA={columns:e=>(0,G_.css)("grid-template-columns:",`repeat( ${e}, minmax(0, 1fr) )`,";",""),spacing:(0,G_.css)("column-gap:",(0,Jw.x)(2),";row-gap:",(0,Jw.x)(4),";",""),item:{fullWidth:{name:"18iuzk9",styles:"grid-column:1/-1"}}},iA={name:"huufmu",styles:">div:not( :first-of-type ){display:none;}"},sA=(0,G_.css)(oA.item.fullWidth," gap:",(0,Jw.x)(2),";.components-dropdown-menu{margin:",(0,Jw.x)(-1)," 0;line-height:0;}&&&& .components-dropdown-menu__toggle{padding:0;min-width:",(0,Jw.x)(6),";}",""),aA={name:"1pmxm02",styles:"font-size:inherit;font-weight:500;line-height:normal;&&{margin:0;}"},lA=(0,G_.css)(oA.item.fullWidth,"&>div,&>fieldset{padding-bottom:0;margin-bottom:0;max-width:100%;}&& ",rA.mO,"{margin-bottom:0;",rA.mh,":last-child{margin-bottom:0;}}",rA.te,"{margin-bottom:0;}&& ",Yw.cR,"{label{line-height:1.4em;}}",""),cA={name:"eivff4",styles:"display:none"},uA={name:"16gsvie",styles:"min-width:200px"},dA=(0,W_.default)("span",{target:"ews648u0"})("color:",q_.l.theme.accentDarker10,";font-size:11px;font-weight:500;line-height:1.4;",(0,qw.h)({marginLeft:(0,Jw.x)(3)})," text-transform:uppercase;"),hA=(0,G_.css)("color:",q_.l.gray[900],";&&[aria-disabled='true']{color:",q_.l.gray[700],";opacity:1;&:hover{color:",q_.l.gray[700],";}",dA,"{opacity:0.3;}}",""),pA=({itemClassName:e,items:t,toggleItem:n})=>{if(!t.length)return null;const r=(0,Td.jsx)(dA,{"aria-hidden":!0,children:(0,H.__)("Reset")});return(0,Td.jsx)(Td.Fragment,{children:t.map((([t,o])=>o?(0,Td.jsx)(k_.A,{className:e,role:"menuitem",label:(0,H.sprintf)((0,H.__)("Reset %s"),t),onClick:()=>{n(t),(0,Jb.speak)((0,H.sprintf)((0,H.__)("%s reset to default"),t),"assertive")},suffix:r,children:t},t):(0,Td.jsx)(k_.A,{icon:ZS.A,className:e,role:"menuitemcheckbox",isSelected:!0,"aria-disabled":!0,children:t},t)))})},fA=({items:e,toggleItem:t})=>e.length?(0,Td.jsx)(Td.Fragment,{children:e.map((([e,n])=>{const r=n?(0,H.sprintf)((0,H.__)("Hide and reset %s"),e):(0,H.sprintf)((0,H.__)("Show %s"),e);return(0,Td.jsx)(k_.A,{icon:n?ZS.A:null,isSelected:n,label:r,onClick:()=>{n?(0,Jb.speak)((0,H.sprintf)((0,H.__)("%s hidden and reset to default"),e),"assertive"):(0,Jb.speak)((0,H.sprintf)((0,H.__)("%s is now visible"),e),"assertive"),t(e)},role:"menuitemcheckbox",children:e},e)}))}):null,mA=(0,V_.KZ)(((e,t)=>{const{areAllOptionalControlsHidden:n,defaultControlsItemClassName:r,dropdownMenuClassName:o,hasMenuItems:i,headingClassName:s,headingLevel:a=2,label:l,menuItems:c,resetAll:u,toggleItem:d,dropdownMenuProps:h,...p}=function(e){const{className:t,headingLevel:n=2,...r}=(0,U_.A)(e,"ToolsPanelHeader"),o=(0,H_.l)(),i=(0,S.useMemo)((()=>o(sA,t)),[t,o]),s=(0,S.useMemo)((()=>o(uA)),[o]),a=(0,S.useMemo)((()=>o(aA)),[o]),l=(0,S.useMemo)((()=>o(hA)),[o]),{menuItems:c,hasMenuItems:u,areAllOptionalControlsHidden:d}=MS();return{...r,areAllOptionalControlsHidden:d,defaultControlsItemClassName:l,dropdownMenuClassName:s,hasMenuItems:u,headingClassName:a,headingLevel:n,menuItems:c,className:i}}(e);if(!l)return null;const f=Object.entries(c?.default||{}),m=Object.entries(c?.optional||{}),g=n?QS.A:eA.A,b=(0,H.sprintf)((0,H._x)("%s options","Button label to reveal tool panel options"),l),y=n?(0,H.__)("All options are currently hidden"):void 0,v=[...f,...m].some((([,e])=>e));return(0,Td.jsxs)(tA.A,{...p,ref:t,children:[(0,Td.jsx)(nA.A,{level:a,className:s,children:l}),i&&(0,Td.jsx)(i_.A,{...h,icon:g,label:b,menuProps:{className:o},toggleProps:{size:"small",describedBy:y},children:()=>(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsxs)(w_.A,{label:l,children:[(0,Td.jsx)(pA,{items:f,toggleItem:d,itemClassName:r}),(0,Td.jsx)(fA,{items:m,toggleItem:d})]}),(0,Td.jsx)(w_.A,{children:(0,Td.jsx)(k_.A,{"aria-disabled":!v,variant:"tertiary",onClick:()=>{v&&(u(),(0,Jb.speak)((0,H.__)("All options reset"),"assertive"))},children:(0,H.__)("Reset all")})})]})})]})}),"ToolsPanelHeader"),gA=({panelItems:e,shouldReset:t,currentMenuItems:n,menuItemOrder:r})=>{const o={default:{},optional:{}},i={default:{},optional:{}};return e.forEach((({hasValue:e,isShownByDefault:r,label:i})=>{const s=r?"default":"optional",a=n?.[s]?.[i],l=a||e();o[s][i]=!t&&l})),r.forEach((e=>{o.default.hasOwnProperty(e)&&(i.default[e]=o.default[e]),o.optional.hasOwnProperty(e)&&(i.optional[e]=o.optional[e])})),Object.keys(o.default).forEach((e=>{i.default.hasOwnProperty(e)||(i.default[e]=o.default[e])})),Object.keys(o.optional).forEach((e=>{i.optional.hasOwnProperty(e)||(i.optional[e]=o.optional[e])})),i},bA=e=>e&&0===Object.keys(e).length;const yA={bottom:{alignItems:"flex-end",justifyContent:"center"},bottomLeft:{alignItems:"flex-start",justifyContent:"flex-end"},bottomRight:{alignItems:"flex-end",justifyContent:"flex-end"},center:{alignItems:"center",justifyContent:"center"},spaced:{alignItems:"center",justifyContent:"space-between"},left:{alignItems:"center",justifyContent:"flex-start"},right:{alignItems:"center",justifyContent:"flex-end"},stretch:{alignItems:"stretch"},top:{alignItems:"flex-start",justifyContent:"center"},topLeft:{alignItems:"flex-start",justifyContent:"flex-start"},topRight:{alignItems:"flex-start",justifyContent:"flex-end"}};var vA=n(17849);const _A=(0,V_.KZ)((function(e,t){const n=function(e){const{align:t,alignment:n,className:r,columnGap:o,columns:i=2,gap:s=3,isInline:a=!1,justify:l,rowGap:c,rows:u,templateColumns:d,templateRows:h,...p}=(0,U_.A)(e,"Grid"),f=Array.isArray(i)?i:[i],m=(0,vA.t)(f),g=Array.isArray(u)?u:[u],b=(0,vA.t)(g),y=d||!!i&&`repeat( ${m}, 1fr )`,v=h||!!u&&`repeat( ${b}, 1fr )`,_=(0,H_.l)();return{...p,className:(0,S.useMemo)((()=>{const e=function(e){return e?yA[e]:{}}(n),i=(0,G_.css)({alignItems:t,display:a?"inline-grid":"grid",gap:`calc( ${K_.A.gridBase} * ${s} )`,gridTemplateColumns:y||void 0,gridTemplateRows:v||void 0,gridRowGap:c,gridColumnGap:o,justifyContent:l,verticalAlign:a?"middle":void 0,...e},"","");return _(i,r)}),[t,n,r,o,_,s,y,v,a,l,c])}}(e);return(0,Td.jsx)(px.A,{...n,ref:t})}),"Grid"),xA=(0,V_.KZ)(((e,t)=>{const{children:n,label:r,panelContext:o,resetAllItems:i,toggleItem:s,headingLevel:a,dropdownMenuProps:l,...c}=function(e){const{className:t,headingLevel:n=2,resetAll:r,panelId:o,hasInnerWrapper:i=!1,shouldRenderPlaceholderItems:s=!1,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:l,...c}=(0,U_.A)(e,"ToolsPanel"),u=(0,S.useRef)(!1),d=u.current;(0,S.useEffect)((()=>{d&&(u.current=!1)}),[d]);const[h,p]=(0,S.useState)([]),[f,m]=(0,S.useState)([]),[g,b]=(0,S.useState)([]),y=(0,S.useCallback)((e=>{p((t=>{const n=[...t],r=n.findIndex((t=>t.label===e.label));return-1!==r&&n.splice(r,1),[...n,e]})),m((t=>t.includes(e.label)?t:[...t,e.label]))}),[p,m]),v=(0,S.useCallback)((e=>{p((t=>{const n=[...t],r=n.findIndex((t=>t.label===e));return-1!==r&&n.splice(r,1),n}))}),[p]),_=(0,S.useCallback)((e=>{b((t=>[...t,e]))}),[b]),x=(0,S.useCallback)((e=>{b((t=>t.filter((t=>t!==e))))}),[b]),[w,k]=(0,S.useState)({default:{},optional:{}});(0,S.useEffect)((()=>{k((e=>gA({panelItems:h,shouldReset:!1,currentMenuItems:e,menuItemOrder:f})))}),[h,k,f]);const C=(0,S.useCallback)(((e,t,n="default")=>{k((r=>({...r,[n]:{...r[n],[t]:e}})))}),[k]),[A,E]=(0,S.useState)(!1);(0,S.useEffect)((()=>{if(bA(w?.default)&&!bA(w?.optional)){const e=!Object.entries(w.optional).some((([,e])=>e));E(e)}}),[w,E]);const I=(0,H_.l)(),j=(0,S.useMemo)((()=>{const e=i&&(0,G_.css)(">div:not( :first-of-type ){display:grid;",oA.columns(2)," ",oA.spacing," ",oA.item.fullWidth,";}",""),n=bA(w?.default)&&A&&iA;return I((0,G_.css)(oA.columns(2)," ",oA.spacing," border-top:",K_.A.borderWidth," solid ",q_.l.gray[300],";margin-top:-1px;padding:",(0,Jw.x)(4),";",""),e,n,t)}),[A,t,I,i,w]),T=(0,S.useCallback)((e=>{const t=h.find((t=>t.label===e));if(!t)return;const n=t.isShownByDefault?"default":"optional",r={...w,[n]:{...w[n],[e]:!w[n][e]}};k(r)}),[w,h,k]),B=(0,S.useCallback)((()=>{"function"==typeof r&&(u.current=!0,r(g));const e=gA({panelItems:h,menuItemOrder:f,shouldReset:!0});k(e)}),[h,g,r,k,f]),R=e=>{const t=w.optional||{},n=e.find((e=>e.isShownByDefault||!!t[e.label]));return n?.label},N=R(h),D=R([...h].reverse());return{...c,headingLevel:n,panelContext:(0,S.useMemo)((()=>({areAllOptionalControlsHidden:A,deregisterPanelItem:v,deregisterResetAllFilter:x,firstDisplayedItem:N,flagItemCustomization:C,hasMenuItems:!!h.length,isResetting:u.current,lastDisplayedItem:D,menuItems:w,panelId:o,registerPanelItem:y,registerResetAllFilter:_,shouldRenderPlaceholderItems:s,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:l})),[A,v,x,N,C,D,w,o,h,_,y,s,a,l]),resetAllItems:B,toggleItem:T,className:j}}(e);return(0,Td.jsx)(_A,{...c,columns:2,ref:t,children:(0,Td.jsxs)(DS.Provider,{value:o,children:[(0,Td.jsx)(mA,{label:r,resetAll:i,toggleItem:s,headingLevel:a,dropdownMenuProps:l}),n]})})}),"ToolsPanel"),wA=xA;function kA({children:e,group:t,label:n}){const{updateBlockAttributes:r}=(0,Vl.A)(hv),{getBlockAttributes:o,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:s,hasMultiSelection:a}=(0,Ul.A)(hv),l=s(),c=(0,S.useCallback)(((e=[])=>{const t={},n=a()?i():[l];n.forEach((n=>{const{style:r}=o(n);let i={style:r};e.forEach((e=>{i={...i,...e(i)}})),i={...i,style:Wv(i.style)},t[n]=i})),r(n,t,!0)}),[o,i,a,l,r]);return(0,Td.jsx)(wA,{className:`${t}-block-support-panel`,label:n,resetAll:c,panelId:l,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:jv,children:e},l)}function CA({Slot:e,fillProps:t,...n}){const r=(0,S.useContext)(DS),o=(0,S.useMemo)((()=>{var e;return{...null!=t?t:{},forwardedContext:[...null!==(e=t?.forwardedContext)&&void 0!==e?e:[],[DS.Provider,{value:r}]]}}),[r,t]);return(0,Td.jsx)(e,{...n,fillProps:o,bubblesVirtually:!0})}function SA({__experimentalGroup:e,group:t="default",label:n,fillProps:r,...o}){e&&((0,q.default)("`__experimentalGroup` property in `InspectorControlsSlot`",{since:"6.2",version:"6.4",alternative:"`group`"}),t=e);const i=qS[t]?.Slot,s=f_(i?.__unstableName),a=(0,S.useContext)(XS.A),l=(0,S.useMemo)((()=>{var e;return{...null!=r?r:{},forwardedContext:[...null!==(e=r?.forwardedContext)&&void 0!==e?e:[],[XS.A.Provider,{value:a}]]}}),[a,r]);return i?s?.length?n?(0,Td.jsx)(kA,{group:t,label:n,children:(0,Td.jsx)(CA,{...o,fillProps:l,Slot:i})}):(0,Td.jsx)(i,{...o,fillProps:l,bubblesVirtually:!0}):null:(!0===globalThis.SCRIPT_DEBUG&&(0,m_.default)(`Unknown InspectorControls group "${t}" provided.`),null)}const AA=KS;AA.Slot=SA;const EA=e=>(0,Td.jsx)(KS,{...e,group:"advanced"});EA.Slot=e=>(0,Td.jsx)(SA,{...e,group:"advanced"}),EA.slotName="InspectorAdvancedControls";const IA=AA;var jA=n(34147);const TA={name:"1bcj5ek",styles:"width:100%;display:block"},BA={name:"150ruhm",styles:"box-sizing:border-box;width:100%;display:block;margin:0;color:inherit"},RA=(0,G_.css)("border:1px solid ",K_.A.surfaceBorderColor,";",""),NA=(0,G_.css)(">*:not( marquee )>*{border-bottom:1px solid ",K_.A.surfaceBorderColor,";}>*:last-of-type>*:not( :focus ){border-bottom-color:transparent;}",""),DA=K_.A.controlBorderRadius,MA=(0,G_.css)("border-radius:",DA,";",""),PA=(0,G_.css)("border-radius:",DA,";>*:first-of-type>*{border-top-left-radius:",DA,";border-top-right-radius:",DA,";}>*:last-of-type>*{border-bottom-left-radius:",DA,";border-bottom-right-radius:",DA,";}",""),OA=`calc(${K_.A.fontSize} * ${K_.A.fontLineHeightBase})`,LA=`calc((${K_.A.controlHeight} - ${OA} - 2px) / 2)`,FA=`calc((${K_.A.controlHeightSmall} - ${OA} - 2px) / 2)`,zA=`calc((${K_.A.controlHeightLarge} - ${OA} - 2px) / 2)`,UA={small:(0,G_.css)("padding:",FA," ",K_.A.controlPaddingXSmall,";",""),medium:(0,G_.css)("padding:",LA," ",K_.A.controlPaddingX,";",""),large:(0,G_.css)("padding:",zA," ",K_.A.controlPaddingXLarge,";","")},VA=(0,S.createContext)({size:"medium"}),HA=()=>(0,S.useContext)(VA),$A=(0,V_.KZ)((function(e,t){const{isBordered:n,isSeparated:r,size:o,...i}=function(e){const{className:t,isBordered:n=!1,isRounded:r=!0,isSeparated:o=!1,role:i="list",...s}=(0,U_.A)(e,"ItemGroup");return{isBordered:n,className:(0,H_.l)()(n&&RA,o&&NA,r&&PA,t),role:i,isSeparated:o,...s}}(e),{size:s}=HA(),a={spacedAround:!n&&!r,size:o||s};return(0,Td.jsx)(VA.Provider,{value:a,children:(0,Td.jsx)(px.A,{...i,ref:t})})}),"ItemGroup");var WA=n(4545),GA=n(11508);const qA=()=>{},KA=(0,V_.KZ)(((e,t)=>{const{children:n,isShown:r,shouldRenderPlaceholder:o,...i}=function(e){const{className:t,hasValue:n,isShownByDefault:r=!1,label:o,panelId:i,resetAllFilter:s=qA,onDeselect:a,onSelect:l,...c}=(0,U_.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:w}=MS(),k=(0,S.useCallback)(n,[i]),C=(0,S.useCallback)(s,[i]),A=(0,gx.A)(u),E=u===i||null===u;(0,S.useLayoutEffect)((()=>(E&&null!==A&&f({hasValue:k,isShownByDefault:r,label:o,panelId:i}),()=>{(null===A&&u||u===i)&&m(o)})),[u,E,r,o,k,i,A,f,m]),(0,S.useEffect)((()=>(E&&h(C),()=>{E&&p(C)})),[h,p,C,E]);const I=r?"default":"optional",j=d?.[I]?.[o],T=(0,gx.A)(j),B=void 0!==d?.[I]?.[o],R=n();(0,S.useEffect)((()=>{(r||R)&&g(R,o,I)}),[R,I,o,g,r]),(0,S.useEffect)((()=>{B&&!b&&E&&(!j||R||T||l?.(),!j&&R&&T&&a?.())}),[E,j,B,b,R,T,l,a]);const N=r?void 0!==d?.[I]?.[o]:j,D=(0,H_.l)(),M=(0,S.useMemo)((()=>{const e=y&&!N;return D(lA,e&&cA,!e&&t,v===o&&x,_===o&&w)}),[N,y,t,D,v,_,x,w,o]);return{...c,isShown:N,shouldRenderPlaceholder:y,className:M}}(e);return r?(0,Td.jsx)(px.A,{...i,ref:t,children:n}):o?(0,Td.jsx)(px.A,{...i,ref:t}):null}),"ToolsPanelItem"),YA=KA;var JA=n(37815),XA=n(95893),ZA=n(65823),QA=n(44907);const eE={hidden:{opacity:0},show:{opacity:1,transition:{type:"tween",duration:.2,delay:0,delayChildren:.1}},exit:{opacity:0,transition:{duration:.2,delayChildren:0}}},tE={hidden:{opacity:0,scale:.9},show:{opacity:1,scale:1,transition:{duration:.1}},exit:{opacity:0,scale:.9}};function nE({label:e}){const t=(0,Sx.A)(),n=(0,Td.jsx)(Cx.P.div,{variants:eE,initial:t?"show":"hidden",animate:"show",exit:t?"show":"exit",className:"components-drop-zone__content",style:{pointerEvents:"none"},children:(0,Td.jsxs)(Cx.P.div,{variants:tE,children:[(0,Td.jsx)(lk.A,{icon:JA.A,className:"components-drop-zone__content-icon"}),(0,Td.jsx)("span",{className:"components-drop-zone__content-text",children:e||(0,H.__)("Drop files to upload")})]})});return t?n:(0,Td.jsx)(QA.N,{children:n})}const rE=function({className:e,label:t,onFilesDrop:n,onHTMLDrop:r,onDrop:o,...i}){const[s,a]=(0,S.useState)(),[l,c]=(0,S.useState)(),[u,d]=(0,S.useState)(),h=(0,ZA.A)({onDrop(e){const t=e.dataTransfer?(0,XA.$)(e.dataTransfer):[],i=e.dataTransfer?.getData("text/html");i&&r?r(i):t.length&&n?n(t):o&&o(e)},onDragStart(e){a(!0);let t="default";e.dataTransfer?.types.includes("text/html")?t="html":(e.dataTransfer?.types.includes("Files")||(e.dataTransfer?(0,XA.$)(e.dataTransfer):[]).length>0)&&(t="file"),d(t)},onDragEnd(){a(!1),d(void 0)},onDragEnter(){c(!0)},onDragLeave(){c(!1)}}),p=(0,$v.A)("components-drop-zone",e,{"is-active":(s||l)&&("file"===u&&n||"html"===u&&r||"default"===u&&o),"is-dragging-over-document":s,"is-dragging-over-element":l,[`is-dragging-${u}`]:!!u});return(0,Td.jsx)("div",{...i,ref:h,className:p,children:l&&(0,Td.jsx)(nE,{label:t})})};var oE=n(53926),iE=n(33398),sE=n(74115);const aE={width:200,height:170},lE=["avi","mpg","mpeg","mov","mp4","m4v","ogg","ogv","webm","wmv"];function cE(e){return Math.round(100*e)}const uE=(0,W_.default)("div",{target:"eeew7dm8"})({name:"jqnsxy",styles:"background-color:transparent;display:flex;text-align:center;width:100%"}),dE=(0,W_.default)("div",{target:"eeew7dm7"})("align-items:center;border-radius:",K_.A.radiusBlockUi,";cursor:pointer;display:inline-flex;justify-content:center;margin:auto;position:relative;height:100%;&:after{border-radius:inherit;bottom:0;box-shadow:inset 0 0 0 1px rgba( 0, 0, 0, 0.1 );content:'';left:0;pointer-events:none;position:absolute;right:0;top:0;}img,video{border-radius:inherit;box-sizing:border-box;display:block;height:auto;margin:0;max-height:100%;max-width:100%;pointer-events:none;user-select:none;width:auto;}"),hE=(0,W_.default)("div",{target:"eeew7dm6"})("background:",q_.l.gray[100],";border-radius:inherit;box-sizing:border-box;height:",aE.height,"px;max-width:280px;min-width:",aE.width,"px;width:100%;"),pE=(0,W_.default)(ak,{target:"eeew7dm5"})({name:"1d3w5wq",styles:"width:100%"});var fE={name:"1mn7kwb",styles:"padding-bottom:1em"};const mE=({__nextHasNoMarginBottom:e})=>e?void 0:fE;var gE={name:"1mn7kwb",styles:"padding-bottom:1em"};const bE=({hasHelpText:e=!1})=>e?gE:void 0,yE=(0,W_.default)(B_.A,{target:"eeew7dm4"})("max-width:320px;padding-top:1em;",bE," ",mE,";"),vE=(0,W_.default)("div",{target:"eeew7dm3"})("left:50%;overflow:hidden;pointer-events:none;position:absolute;top:50%;transform:translate3d( -50%, -50%, 0 );z-index:1;@media not ( prefers-reduced-motion ){transition:opacity 100ms linear;}opacity:",(({showOverlay:e})=>e?1:0),";"),_E=(0,W_.default)("div",{target:"eeew7dm2"})({name:"1yzbo24",styles:"background:rgba( 255, 255, 255, 0.4 );backdrop-filter:blur( 16px ) saturate( 180% );position:absolute;transform:translateZ( 0 )"}),xE=(0,W_.default)(_E,{target:"eeew7dm1"})({name:"1sw8ur",styles:"height:1px;left:1px;right:1px"}),wE=(0,W_.default)(_E,{target:"eeew7dm0"})({name:"188vg4t",styles:"width:1px;top:1px;bottom:1px"}),kE=0,CE=100,SE=()=>{};function AE({__nextHasNoMarginBottom:e,__next40pxDefaultSize:t,hasHelpText:n,onChange:r=SE,point:o={x:.5,y:.5}}){const i=cE(o.x),s=cE(o.y),a=(e,t)=>{if(void 0===e)return;const n=parseInt(e,10);isNaN(n)||r({...o,[t]:n/100})};return(0,Td.jsxs)(yE,{className:"focal-point-picker__controls",__nextHasNoMarginBottom:e,hasHelpText:n,gap:4,children:[(0,Td.jsx)(EE,{__next40pxDefaultSize:t,label:(0,H.__)("Left"),"aria-label":(0,H.__)("Focal point left position"),value:[i,"%"].join(""),onChange:e=>a(e,"x"),dragDirection:"e"}),(0,Td.jsx)(EE,{__next40pxDefaultSize:t,label:(0,H.__)("Top"),"aria-label":(0,H.__)("Focal point top position"),value:[s,"%"].join(""),onChange:e=>a(e,"y"),dragDirection:"s"})]})}function EE(e){return(0,Td.jsx)(pE,{className:"focal-point-picker__controls-position-unit-control",labelPosition:"top",max:CE,min:kE,units:[{value:"%",label:"%"}],...e})}const IE=(0,W_.default)("div",{target:"e19snlhg0"})("background-color:transparent;cursor:grab;height:40px;margin:-20px 0 0 -20px;position:absolute;user-select:none;width:40px;will-change:transform;z-index:10000;background:rgba( 255, 255, 255, 0.4 );border:1px solid rgba( 255, 255, 255, 0.4 );border-radius:50%;backdrop-filter:blur( 16px ) saturate( 180% );box-shadow:rgb( 0 0 0 / 10% ) 0px 0px 8px;@media not ( prefers-reduced-motion ){transition:transform 100ms linear;}",(({isDragging:e})=>e&&"\n\t\t\tbox-shadow: rgb( 0 0 0 / 12% ) 0px 0px 10px;\n\t\t\ttransform: scale( 1.1 );\n\t\t\tcursor: grabbing;\n\t\t\t"),";");function jE({left:e="50%",top:t="50%",...n}){const r={left:e,top:t};return(0,Td.jsx)(IE,{...n,className:"components-focal-point-picker__icon_container",style:r})}function TE({bounds:e,...t}){return(0,Td.jsxs)(vE,{...t,className:"components-focal-point-picker__grid",style:{width:e.width,height:e.height},children:[(0,Td.jsx)(xE,{style:{top:"33%"}}),(0,Td.jsx)(xE,{style:{top:"66%"}}),(0,Td.jsx)(wE,{style:{left:"33%"}}),(0,Td.jsx)(wE,{style:{left:"66%"}})]})}function BE({alt:e,autoPlay:t,src:n,onLoad:r,mediaRef:o,muted:i=!0,...s}){return n?function(e=""){return!!e&&(e.startsWith("data:video/")||lE.includes(function(e=""){const t=e.split(".");return t[t.length-1]}(e)))}(n)?(0,Td.jsx)("video",{...s,autoPlay:t,className:"components-focal-point-picker__media components-focal-point-picker__media--video",loop:!0,muted:i,onLoadedData:r,ref:o,src:n}):(0,Td.jsx)("img",{...s,alt:e,className:"components-focal-point-picker__media components-focal-point-picker__media--image",onLoad:r,ref:o,src:n}):(0,Td.jsx)(hE,{className:"components-focal-point-picker__media components-focal-point-picker__media--placeholder",ref:o,...s})}var RE=n(70573);const NE=function e({__nextHasNoMarginBottom:t,__next40pxDefaultSize:n=!1,autoPlay:r=!0,className:o,help:i,label:s,onChange:a,onDrag:l,onDragEnd:c,onDragStart:u,resolvePoint:d,url:h,value:p={x:.5,y:.5},...f}){const[m,g]=(0,S.useState)(p),[b,y]=(0,S.useState)(!1),{startDrag:v,endDrag:_,isDragging:x}=(0,iE.A)({onDragStart:e=>{C.current?.focus();const t=j(e);t&&(u?.(t,e),g(t))},onDragMove:e=>{e.preventDefault();const t=j(e);t&&(l?.(t,e),g(t))},onDragEnd:()=>{c?.(),a?.(m)}}),{x:w,y:k}=x?m:p,C=(0,S.useRef)(null),[A,E]=(0,S.useState)(aE),I=(0,S.useRef)((()=>{if(!C.current)return;const{clientWidth:e,clientHeight:t}=C.current;E(e>0&&t>0?{width:e,height:t}:{...aE})}));(0,S.useEffect)((()=>{const e=I.current;if(!C.current)return;const{defaultView:t}=C.current.ownerDocument;return t?.addEventListener("resize",e),()=>t?.removeEventListener("resize",e)}),[]),(0,sE.A)((()=>{I.current()}),[]);const j=({clientX:e,clientY:t,shiftKey:n})=>{if(!C.current)return;const{top:r,left:o}=C.current.getBoundingClientRect();let i=(e-o)/A.width,s=(t-r)/A.height;return n&&(i=.1*Math.round(i/.1),s=.1*Math.round(s/.1)),T({x:i,y:s})},T=e=>{var t;const n=null!==(t=d?.(e))&&void 0!==t?t:e;n.x=Math.max(0,Math.min(n.x,1)),n.y=Math.max(0,Math.min(n.y,1));const r=e=>Math.round(100*e)/100;return{x:r(n.x),y:r(n.y)}},B={left:void 0!==w?w*A.width:.5*A.width,top:void 0!==k?k*A.height:.5*A.height},R=(0,$v.A)("components-focal-point-picker-control",o),N=`inspector-focal-point-picker-control-${(0,z_.A)(e)}`;return(0,RE.A)((()=>{y(!0);const e=window.setTimeout((()=>{y(!1)}),600);return()=>window.clearTimeout(e)}),[w,k]),(0,Td.jsxs)($_.Ay,{...f,__nextHasNoMarginBottom:t,label:s,id:N,help:i,className:R,children:[(0,Td.jsx)(uE,{className:"components-focal-point-picker-wrapper",children:(0,Td.jsxs)(dE,{className:"components-focal-point-picker",onKeyDown:e=>{const{code:t,shiftKey:n}=e;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t))return;e.preventDefault();const r={x:w,y:k},o=n?.1:.01,i="ArrowUp"===t||"ArrowLeft"===t?-1*o:o,s="ArrowUp"===t||"ArrowDown"===t?"y":"x";r[s]=r[s]+i,a?.(T(r))},onMouseDown:v,onBlur:()=>{x&&_()},ref:C,role:"button",tabIndex:-1,children:[(0,Td.jsx)(TE,{bounds:A,showOverlay:b}),(0,Td.jsx)(BE,{alt:(0,H.__)("Media preview"),autoPlay:r,onLoad:I.current,src:h}),(0,Td.jsx)(jE,{...B,isDragging:x})]})}),(0,Td.jsx)(AE,{__nextHasNoMarginBottom:t,__next40pxDefaultSize:n,hasHelpText:!!i,point:{x:w,y:k},onChange:e=>{a?.(T(e))}})]})};var DE=n(21863),ME=n(70508),PE=n(92449),OE=n(47625);const LE=function({accept:e,children:t,multiple:n=!1,onChange:r,onClick:o,render:i,...s}){const a=(0,S.useRef)(null),l=()=>{a.current?.click()},c=i?i({openFileDialog:l}):(0,Td.jsx)(Zv.Ay,{onClick:l,...s,children:t});return(0,Td.jsxs)("div",{className:"components-form-file-upload",children:[c,(0,Td.jsx)("input",{type:"file",ref:a,multiple:n,style:{display:"none"},accept:e,onChange:r,onClick:o,"data-testid":"form-file-upload-input"})]})};var FE=n(44137);function zE(e){return(0,$p.f)((t=>{const n="core/with-filters/"+e;let r;class o extends S.Component{constructor(n){super(n),void 0===r&&(r=(0,Tu.applyFilters)(e,t))}componentDidMount(){o.instances.push(this),1===o.instances.length&&((0,Tu.addAction)("hookRemoved",n,s),(0,Tu.addAction)("hookAdded",n,s))}componentWillUnmount(){o.instances=o.instances.filter((e=>e!==this)),0===o.instances.length&&((0,Tu.removeAction)("hookRemoved",n),(0,Tu.removeAction)("hookAdded",n))}render(){return(0,Td.jsx)(r,{...this.props})}}o.instances=[];const i=(0,FE.s)((()=>{r=(0,Tu.applyFilters)(e,t),o.instances.forEach((e=>{e.forceUpdate()}))}),16);function s(t){t===e&&i()}return o}),"withFilters")}var UE=n(38133),VE=n(34343),HE=n(21340),$E=n(91851);const WE=zE("editor.MediaUpload")((()=>null)),GE=function({fallback:e=null,children:t}){const n=(0,Ul.A)((e=>{const{getSettings:t}=e(hv);return!!t().mediaUpload}),[]);return n?t:e};var qE=n(83471),KE=n(57699),YE=n(78048),JE=n(35706),XE=n(97893),ZE=n(95702),QE=n(89395),eI=n(24070);const tI=function e({children:t,settingsOpen:n,setSettingsOpen:r}){const o=(0,Sx.A)(),i=o?S.Fragment:QA.N,s=o?"div":Cx.P.div,a=`link-control-settings-drawer-${(0,z_.A)(e)}`;return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(Zv.Ay,{className:"block-editor-link-control__drawer-toggle","aria-expanded":n,onClick:()=>r(!n),icon:(0,H.isRTL)()?QE.A:eI.A,"aria-controls":a,children:(0,H._x)("Advanced","Additional link settings")}),(0,Td.jsx)(i,{children:n&&(0,Td.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,Td.jsx)("div",{className:"block-editor-link-control__drawer-inner",children:t})})})]})};var nI=n(1879),rI=n(38602),oI=n(84961),iI=n(25222),sI=n(13417);function aI(e){return"function"==typeof e}class lI extends S.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,S.createRef)(),this.inputRef=(0,S.createRef)(),this.updateSuggestions=(0,FE.s)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.suggestionsRequest=null,this.state={suggestions:[],showSuggestions:!1,suggestionsValue:null,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:r,__experimentalShowInitialSuggestions:o=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&this.suggestionNodes[n].scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}),e.value===r||this.props.disableSuggestions||(r?.length?this.updateSuggestions(r):o&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{__experimentalShowInitialSuggestions:e=!1,value:t}=this.props;return e&&!(t&&t.length)}updateSuggestions(e=""){const{__experimentalFetchLinkSuggestions:t,__experimentalHandleURLSuggestions:n}=this.props;if(!t)return;const r=!e?.length;if(e=e.trim(),!r&&(e.length<2||!n&&(0,sI.m)(e)))return this.suggestionsRequest?.cancel?.(),this.suggestionsRequest=null,void this.setState({suggestions:[],showSuggestions:!1,suggestionsValue:e,selectedSuggestion:null,loading:!1});this.setState({selectedSuggestion:null,loading:!0});const o=t(e,{isInitialSuggestions:r});o.then((t=>{this.suggestionsRequest===o&&(this.setState({suggestions:t,suggestionsValue:e,loading:!1,showSuggestions:!!t.length}),t.length?this.props.debouncedSpeak((0,H.sprintf)((0,H._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",t.length),t.length),"assertive"):this.props.debouncedSpeak((0,H.__)("No results."),"assertive"))})).catch((()=>{this.suggestionsRequest===o&&this.setState({loading:!1})})).finally((()=>{this.suggestionsRequest===o&&(this.suggestionsRequest=null)})),this.suggestionsRequest=o}onChange(e){this.props.onChange(e.target.value)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||e&&e.length||null!==this.suggestionsRequest||this.updateSuggestions(n)}onKeyDown(e){this.props.onKeyDown?.(e);const{showSuggestions:t,selectedSuggestion:n,suggestions:r,loading:o}=this.state;if(!t||!r.length||o){switch(e.keyCode){case VE.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case VE.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case VE.ENTER:this.props.onSubmit&&(e.preventDefault(),this.props.onSubmit(null,e))}return}const i=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case VE.UP:{e.preventDefault();const t=n?n-1:r.length-1;this.setState({selectedSuggestion:t});break}case VE.DOWN:{e.preventDefault();const t=null===n||n===r.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case VE.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(i),this.props.speak((0,H.__)("Link selected.")));break;case VE.ENTER:e.preventDefault(),null!==this.state.selectedSuggestion?(this.selectLink(i),this.props.onSubmit&&this.props.onSubmit(i,e)):this.props.onSubmit&&this.props.onSubmit(null,e)}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps({value:e,instanceId:t,disableSuggestions:n,__experimentalShowInitialSuggestions:r=!1},{showSuggestions:o}){let i=o;const s=e&&e.length;return r||s||(i=!1),!0===n&&(i=!1),{showSuggestions:i,suggestionsListboxId:`block-editor-url-input-suggestions-${t}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${t}`}}render(){return(0,Td.jsxs)(Td.Fragment,{children:[this.renderControl(),this.renderSuggestions()]})}renderControl(){const{__nextHasNoMarginBottom:e=!1,label:t=null,className:n,isFullWidth:r,instanceId:o,placeholder:i=(0,H.__)("Paste URL or type to search"),__experimentalRenderControl:s,value:a="",hideLabelFromVision:l=!1}=this.props,{loading:c,showSuggestions:u,selectedSuggestion:d,suggestionsListboxId:h,suggestionOptionIdPrefix:p}=this.state,f=`url-input-control-${o}`,m={id:f,label:t,className:(0,$v.A)("block-editor-url-input",n,{"is-full-width":r}),hideLabelFromVision:l},g={id:f,value:a,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:i,onKeyDown:this.onKeyDown,role:"combobox","aria-label":t?void 0:(0,H.__)("URL"),"aria-expanded":u,"aria-autocomplete":"list","aria-owns":h,"aria-activedescendant":null!==d?`${p}-${d}`:void 0,ref:this.inputRef};return s?s(m,g,c):(e||(0,q.default)("Bottom margin styles for wp.blockEditor.URLInput",{since:"6.2",version:"6.5",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"}),(0,Td.jsxs)($_.Ay,{__nextHasNoMarginBottom:e,...m,children:[(0,Td.jsx)("input",{...g}),c&&(0,Td.jsx)(qE.Ay,{})]}))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t}=this.props,{showSuggestions:n,suggestions:r,suggestionsValue:o,selectedSuggestion:i,suggestionsListboxId:s,suggestionOptionIdPrefix:a,loading:l}=this.state;if(!n||0===r.length)return null;const c={id:s,ref:this.autocompleteRef,role:"listbox"},u=(e,t)=>({role:"option",tabIndex:"-1",id:`${a}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===i||void 0});return aI(t)?t({suggestions:r,selectedSuggestion:i,suggestionsListProps:c,buildSuggestionItemProps:u,isLoading:l,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:!o?.length,currentInputValue:o}):(0,Td.jsx)(KC.Ay,{placement:"bottom",focusOnMount:!1,children:(0,Td.jsx)("div",{...c,className:(0,$v.A)("block-editor-url-input__suggestions",`${e}__suggestions`),children:r.map(((e,t)=>(0,S.createElement)(Zv.Ay,{...u(0,t),key:e.id,className:(0,$v.A)("block-editor-url-input__suggestion",{"is-selected":t===i}),onClick:()=>this.handleOnClick(e)},e.title)))})})}}const cI=(0,P.A)(rI.A,nI.A,oI.A,(0,iI.A)(((e,t)=>{if(aI(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(hv);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(lI);var uI=n(87948);const dI=({searchTerm:e,onClick:t,itemProps:n,buttonText:r})=>{if(!e)return null;let o;return o=r?"function"==typeof r?r(e):r:(0,uI.A)((0,H.sprintf)((0,H.__)("Create: <mark>%s</mark>"),e),{mark:(0,Td.jsx)("mark",{})}),(0,Td.jsx)(k_.A,{...n,iconPosition:"left",icon:QS.A,className:"block-editor-link-control__search-item",onClick:t,children:o})},hI=e=>{const{text:t="",highlight:n=""}=e,r=n.trim();if(!r)return(0,Td.jsx)(Td.Fragment,{children:t});const o=new RegExp(`(${(0,ok.Nt)(r)})`,"gi");return(0,uI.A)(t.replace(o,"<mark>$&</mark>"),{mark:(0,Td.jsx)("mark",{})})};var pI=n(97169),fI=n(693),mI=n(27692),gI=n(31486),bI=n(19212),yI=n(48329),vI=n(32637),_I=n(25913),xI=n(17424),wI=n(51737),kI=n(99502);const CI={post:pI.A,page:fI.A,post_tag:mI.A,category:gI.A,attachment:bI.A};function SI({isURL:e,suggestion:t}){let n=null;return e?n=yI.A:t.type in CI&&(n=CI[t.type],"page"===t.type&&(t.isFrontPage&&(n=vI.A),t.isBlogHome&&(n=_I.A))),n?(0,Td.jsx)(lk.A,{className:"block-editor-link-control__search-item-icon",icon:n}):null}function AI(e){const t=e?.trim();return t?.length?e?.replace(/^\/?/,"/"):e}function EI(e){const t=e?.trim();return t?.length?e?.replace(/\/$/,""):e}function II(e){return e.isFrontPage?"front page":e.isBlogHome?"blog home":"post_tag"===e.type?"tag":e.type}const jI=({itemProps:e,suggestion:t,searchTerm:n,onClick:r,isURL:o=!1,shouldShowType:i=!1})=>{const s=o?(0,H.__)("Press ENTER to add this link"):(a=t.url)?(0,ef.h)(xI.S,wI.Y,(e=>null==e||e!=e?"":e),((e,...t)=>(...n)=>e(...n,...t))(kI.r,24),EI,AI)(a):a;var a;return(0,Td.jsx)(k_.A,{...e,info:s,iconPosition:"left",icon:(0,Td.jsx)(SI,{suggestion:t,isURL:o}),onClick:r,shortcut:i&&II(t),className:"block-editor-link-control__search-item",children:(0,Td.jsx)(hI,{text:(0,ac.A)(t.title),highlight:n})})},TI="__CREATE__",BI="link",RI="mailto",NI="internal",DI=[BI,RI,"tel",NI],MI=[{id:"opensInNewTab",title:(0,H.__)("Open in new tab")}];function PI({instanceId:e,withCreateSuggestion:t,currentInputValue:n,handleSuggestionClick:r,suggestionsListProps:o,buildSuggestionItemProps:i,suggestions:s,selectedSuggestion:a,isLoading:l,isInitialSuggestions:c,createSuggestionButtonText:u,suggestionsQuery:d}){const h=(0,$v.A)("block-editor-link-control__search-results",{"is-loading":l}),p=1===s.length&&DI.includes(s[0].type),f=t&&!p&&!c,m=!d?.type,g=`block-editor-link-control-search-results-label-${e}`,b=c?(0,H.__)("Suggestions"):(0,H.sprintf)((0,H.__)('Search results for "%s"'),n),y=(0,Td.jsx)(GA.A,{id:g,children:b});return(0,Td.jsxs)("div",{className:"block-editor-link-control__search-results-wrapper",children:[y,(0,Td.jsx)("div",{...o,className:h,"aria-labelledby":g,children:(0,Td.jsx)(w_.A,{children:s.map(((e,t)=>f&&TI===e.type?(0,Td.jsx)(dI,{searchTerm:n,buttonText:u,onClick:()=>r(e),itemProps:i(e,t),isSelected:t===a},e.type):TI===e.type?null:(0,Td.jsx)(jI,{itemProps:i(e,t),suggestion:e,index:t,onClick:()=>{r(e)},isSelected:t===a,isURL:DI.includes(e.type),searchTerm:n,shouldShowType:m,isFrontPage:e?.isFrontPage,isBlogHome:e?.isBlogHome},`${e.id}-${e.type}`)))})})]})}var OI=n(40670),LI=n(98526),FI=n(12319),zI=n(76403);function UI(e){if(e.includes(" "))return!1;const t=(0,OI.J)(e),n=(0,FI.v)(t),r=function(e,t=6){const n=e.split(/[?#]/)[0];return new RegExp(`(?<=\\S)\\.(?:[a-zA-Z_]{2,${t}})(?:\\/|$)`).test(n)}(e),o=e?.startsWith("www."),i=e?.startsWith("#")&&(0,zI.R)(e);return n||o||i||r}const VI=()=>Promise.resolve([]),HI=e=>{let t=BI;const n=(0,OI.J)(e)||"";return n.includes("mailto")&&(t=RI),n.includes("tel")&&(t="tel"),e?.startsWith("#")&&(t=NI),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,LI.N)(e):e,type:t}])};const $I=()=>Promise.resolve([]),WI=()=>{},GI=(0,S.forwardRef)((({value:e,children:t,currentLink:n={},className:r=null,placeholder:o=null,withCreateSuggestion:i=!1,onCreateSuggestion:s=WI,onChange:a=WI,onSelect:l=WI,showSuggestions:c=!0,renderSuggestions:u=(e=>(0,Td.jsx)(PI,{...e})),fetchSuggestions:d=null,allowDirectEntry:h=!0,showInitialSuggestions:p=!1,suggestionsQuery:f={},withURLSuggestion:m=!0,createSuggestionButtonText:g,hideLabelFromVision:b=!1},y)=>{const v=function(e,t,n){const{fetchSearchSuggestions:r,pageOnFront:o,pageForPosts:i}=(0,Ul.A)((e=>{const{getSettings:t}=e(hv);return{pageOnFront:t().pageOnFront,pageForPosts:t().pageForPosts,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),s=t?HI:VI;return(0,S.useCallback)(((t,{isInitialSuggestions:a})=>UI(t)?s(t,{isInitialSuggestions:a}):(async(e,t,n,r,o,i)=>{const{isInitialSuggestions:s}=t,a=await n(e,t);return a.map((e=>Number(e.id)===o?(e.isFrontPage=!0,e):Number(e.id)===i?(e.isBlogHome=!0,e):e)),s||UI(e)||!r?a:a.concat({title:e,url:e,type:TI})})(t,{...e,isInitialSuggestions:a},r,n,o,i)),[s,r,o,i,e,n])}(f,h,i),_=c?d||v:$I,x=(0,z_.A)(GI),[w,k]=(0,S.useState)(),C=async e=>{let t=e;if(TI!==e.type){if(h||t&&Object.keys(t).length>=1){const{id:e,url:r,...o}=null!=n?n:{};l({...o,...t},t)}}else try{t=await s(e.title),t?.url&&l(t)}catch(e){}};return(0,Td.jsxs)("div",{className:"block-editor-link-control__search-input-container",children:[(0,Td.jsx)(cI,{disableSuggestions:n?.url===e,__nextHasNoMarginBottom:!0,label:(0,H.__)("Link"),hideLabelFromVision:b,className:r,value:e,onChange:(e,t)=>{a(e),k(t)},placeholder:null!=o?o:(0,H.__)("Search or type url"),__experimentalRenderSuggestions:c?e=>u({...e,instanceId:x,withCreateSuggestion:i,createSuggestionButtonText:g,suggestionsQuery:f,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),C(t)}}):null,__experimentalFetchLinkSuggestions:_,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:p,onSubmit:(t,n)=>{const r=t||w;r||e?.trim()?.length?C(r||{url:e}):n.preventDefault()},ref:y}),t]})})),qI=GI;var KI=n(79566),YI=n(34691),JI=n(74314),XI=n(50446),ZI=n(42622),QI=n(6497);const{Slot:ej,Fill:tj}=(0,Hl.QJ)("BlockEditorLinkControlViewer");function nj(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}const rj=function(e){const[t,n]=(0,S.useReducer)(nj,{richData:null,isFetching:!1}),{fetchRichUrlData:r}=(0,Ul.A)((e=>{const{getSettings:t}=e(hv);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,S.useEffect)((()=>{if(e?.length&&r&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,o=t.signal;return r(e,{signal:o}).then((e=>{n({type:"RESOLVED",richData:e})})).catch((()=>{o.aborted||n({type:"ERROR"})})),()=>{t.abort()}}}),[e]),t};function oj({value:e,onEditClick:t,hasRichPreviews:n=!1,hasUnlinkControl:r=!1,onRemove:o}){const i=(0,Ul.A)((e=>e(XE.M).get("core","showIconLabels")),[]),s=n?e?.url:null,{richData:a,isFetching:l}=rj(s),c=a&&Object.keys(a).length,u=e&&(0,kI.r)((0,xI.S)(e.url),24)||"",d=!e?.url?.length,h=!d&&(0,ac.A)(a?.title||e?.title||u);let p;p=a?.icon?(0,Td.jsx)("img",{src:a?.icon,alt:""}):d?(0,Td.jsx)(lk.A,{icon:JI.A,size:32}):(0,Td.jsx)(lk.A,{icon:yI.A});const{createNotice:f}=(0,Vl.A)(Xb.store),m=(0,YI.A)(e.url,(()=>{f("info",(0,H.__)("Link copied to clipboard."),{isDismissible:!0,type:"snackbar"})}));return(0,Td.jsx)("div",{"aria-label":(0,H.__)("Currently selected"),className:(0,$v.A)("block-editor-link-control__search-item",{"is-current":!0,"is-rich":c,"is-fetching":!!l,"is-preview":!0,"is-error":d,"is-url-title":h===u}),children:(0,Td.jsxs)("div",{className:"block-editor-link-control__search-item-top",children:[(0,Td.jsxs)("span",{className:"block-editor-link-control__search-item-header",children:[(0,Td.jsx)("span",{className:(0,$v.A)("block-editor-link-control__search-item-icon",{"is-image":a?.icon}),children:p}),(0,Td.jsx)("span",{className:"block-editor-link-control__search-item-details",children:d?(0,Td.jsx)("span",{className:"block-editor-link-control__search-item-error-notice",children:(0,H.__)("Link is empty")}):(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(KI.A,{className:"block-editor-link-control__search-item-title",href:e.url,children:(0,Td.jsx)(WA.A,{numberOfLines:1,children:h})}),e?.url&&h!==u&&(0,Td.jsx)("span",{className:"block-editor-link-control__search-item-info",children:(0,Td.jsx)(WA.A,{numberOfLines:1,children:u})})]})})]}),(0,Td.jsx)(Zv.Ay,{icon:XI.A,label:(0,H.__)("Edit link"),onClick:t,size:"compact"}),r&&(0,Td.jsx)(Zv.Ay,{icon:ZI.A,label:(0,H.__)("Remove link"),onClick:o,size:"compact"}),(0,Td.jsx)(Zv.Ay,{icon:QI.A,label:(0,H.sprintf)((0,H.__)("Copy link%s"),d||i?"":": "+e.url),ref:m,disabled:d,size:"compact"}),(0,Td.jsx)(ej,{fillProps:e})]})})}var ij=n(33973);const sj=()=>{},aj=({value:e,onChange:t=sj,settings:n})=>{if(!n||!n.length)return null;const r=n=>r=>{t({...e,[n.id]:r})},o=n.map((t=>(0,Td.jsx)(ij.A,{__nextHasNoMarginBottom:!0,className:"block-editor-link-control__setting",label:t.title,onChange:r(t),checked:!!e&&!!e[t.id],help:t?.help},t.id)));return(0,Td.jsxs)("fieldset",{className:"block-editor-link-control__settings",children:[(0,Td.jsx)(GA.A,{as:"legend",children:(0,H.__)("Currently selected link settings")}),o]})};var lj=n(7040),cj=n.n(lj);const uj=()=>{},dj="core/block-editor",hj="linkControlSettingsDrawer";function pj({searchInputPlaceholder:e,value:t,settings:n=MI,onChange:r=uj,onRemove:o,onCancel:i,noDirectEntry:s=!1,showSuggestions:a=!0,showInitialSuggestions:l,forceIsEditingLink:c,createSuggestion:u,withCreateSuggestion:d,inputValue:h="",suggestionsQuery:p={},noURLSuggestion:f=!1,createSuggestionButtonText:m,hasRichPreviews:g=!1,hasTextControl:b=!1,renderControlBottom:y=null}){void 0===d&&u&&(d=!0);const[v,_]=(0,S.useState)(!1),{advancedSettingsPreference:x}=(0,Ul.A)((e=>{var t;return{advancedSettingsPreference:null!==(t=e(XE.M).get(dj,hj))&&void 0!==t&&t}}),[]),{set:w}=(0,Vl.A)(XE.M),k=x||v,C=(0,S.useRef)(!0),A=(0,S.useRef)(),E=(0,S.useRef)(),I=(0,S.useRef)(!1),j=n.map((({id:e})=>e)),[T,B,R,N,D]=function(e){const[t,n]=(0,S.useState)(e||{}),[r,o]=(0,S.useState)(e);return cj()(e,r)||(o(e),n(e)),[t,n,e=>{n({...t,url:e})},e=>{n({...t,title:e})},e=>r=>{const o=Object.keys(r).reduce(((t,n)=>(e.includes(n)&&(t[n]=r[n]),t)),{});n({...t,...o})}]}(t),M=t&&!(0,JE.A)(T,t),[P,O]=(0,S.useState)(void 0!==c?c:!t||!t.url),{createPage:L,isCreatingPage:F,errorMessage:z}=function(e){const t=(0,S.useRef)(),[n,r]=(0,S.useState)(!1),[o,i]=(0,S.useState)(null);return(0,S.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){r(!0),i(null);try{return t.current=(e=>{let t=!1;const n=new Promise(((n,r)=>{e.then((e=>t?r({isCanceled:!0}):n(e)),(e=>r(t?{isCanceled:!0}:e)))}));return{promise:n,cancel(){t=!0}}})(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw i(e.message||(0,H.__)("An unknown error occurred during creation. Please try again.")),e}finally{r(!1)}},isCreatingPage:n,errorMessage:o}}(u);(0,S.useEffect)((()=>{void 0!==c&&O(c)}),[c]),(0,S.useEffect)((()=>{C.current||((ME.focus.focusable.find(A.current)[0]||A.current).focus(),I.current=!1)}),[P,F]),(0,S.useEffect)((()=>(C.current=!1,()=>{C.current=!0})),[]);const U=t?.url?.trim()?.length>0,V=()=>{I.current=!!A.current?.contains(A.current.ownerDocument.activeElement),O(!1)},$=()=>{M&&r({...t,...T,url:W}),V()},W=h||T?.url||"",G=!W?.trim()?.length,q=o&&t&&!P&&!F,K=P&&U,Y=U&&b,J=(P||!t)&&!F,X=!M||G,Z=!!n?.length&&P&&U;return(0,Td.jsxs)("div",{tabIndex:-1,ref:A,className:"block-editor-link-control",children:[F&&(0,Td.jsxs)("div",{className:"block-editor-link-control__loading",children:[(0,Td.jsx)(qE.Ay,{})," ",(0,H.__)("Creating"),"…"]}),J&&(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsxs)("div",{className:(0,$v.A)({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":Y,"has-actions":K}),children:[Y&&(0,Td.jsx)(KE.A,{__nextHasNoMarginBottom:!0,ref:E,className:"block-editor-link-control__field block-editor-link-control__text-content",label:(0,H.__)("Text"),value:T?.title,onChange:N,onKeyDown:e=>{const{keyCode:t}=e;t!==VE.ENTER||G||(e.preventDefault(),$())},size:"__unstable-large"}),(0,Td.jsx)(qI,{currentLink:t,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:e,value:W,withCreateSuggestion:d,onCreateSuggestion:L,onChange:R,onSelect:e=>{const t=Object.keys(e).reduce(((t,n)=>(j.includes(n)||(t[n]=e[n]),t)),{});r({...T,...t,title:T?.title||e?.title}),V()},showInitialSuggestions:l,allowDirectEntry:!s,showSuggestions:a,suggestionsQuery:p,withURLSuggestion:!f,createSuggestionButtonText:m,hideLabelFromVision:!Y}),!K&&(0,Td.jsx)("div",{className:"block-editor-link-control__search-enter",children:(0,Td.jsx)(Zv.Ay,{onClick:X?uj:$,label:(0,H.__)("Submit"),icon:ZE.A,className:"block-editor-link-control__search-submit","aria-disabled":X})})]}),z&&(0,Td.jsx)(YE.A,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1,children:z})]}),t&&!P&&!F&&(0,Td.jsx)(oj,{value:t,onEditClick:()=>O(!0),hasRichPreviews:g,hasUnlinkControl:q,onRemove:()=>{o(),O(!0)}},t?.url),Z&&(0,Td.jsx)("div",{className:"block-editor-link-control__tools",children:!G&&(0,Td.jsx)(tI,{settingsOpen:k,setSettingsOpen:e=>{w&&w(dj,hj,e),_(e)},children:(0,Td.jsx)(aj,{value:T,settings:n,onChange:D(j)})})}),K&&(0,Td.jsxs)(tA.A,{justify:"right",className:"block-editor-link-control__search-actions",children:[(0,Td.jsx)(Zv.Ay,{variant:"tertiary",onClick:e=>{e.preventDefault(),e.stopPropagation(),B(t),U?V():o?.(),i?.()},children:(0,H.__)("Cancel")}),(0,Td.jsx)(Zv.Ay,{variant:"primary",onClick:X?uj:$,className:"block-editor-link-control__search-submit","aria-disabled":X,children:(0,H.__)("Save")})]}),!F&&y&&y()]})}pj.ViewerFill=tj,pj.DEFAULT_LINK_SETTINGS=MI;const fj=pj,mj=()=>{};let gj=0;const bj=(0,P.A)([(0,UE.A)((e=>{const{createNotice:t,removeNotice:n}=e(Xb.store);return{createNotice:t,removeNotice:n}})),zE("editor.MediaReplaceFlow")])((({mediaURL:e,mediaId:t,mediaIds:n,allowedTypes:r,accept:o,onError:i,onSelect:s,onSelectURL:a,onToggleFeaturedImage:l,useFeaturedImage:c,onFilesUpload:u=mj,name:d=(0,H.__)("Replace"),createNotice:h,removeNotice:p,children:f,multiple:m=!1,addToGallery:g,handleUpload:b=!0,popoverProps:y})=>{const v=(0,Ul.A)((e=>e(hv).getSettings().mediaUpload),[]),_=!!v,x=(0,S.useRef)(),w="block-editor/media-replace-flow/error-notice/"+ ++gj,k=e=>{const t=(0,ac.A)(e);i?i(t):setTimeout((()=>{h("error",t,{speak:!0,id:w,isDismissible:!0})}),1e3)},C=(e,t)=>{c&&l&&l(),t(),s(e),(0,Jb.speak)((0,H.__)("The media file has been replaced")),p(w)},A=e=>{e.keyCode===VE.DOWN&&(e.preventDefault(),e.target.click())},E=m&&!(!r||0===r.length)&&r.every((e=>"image"===e||e.startsWith("image/")));return(0,Td.jsx)(PE.A,{popoverProps:y,contentClassName:"block-editor-media-replace-flow__options",renderToggle:({isOpen:e,onToggle:t})=>(0,Td.jsx)(r_,{ref:x,"aria-expanded":e,"aria-haspopup":"true",onClick:t,onKeyDown:A,children:d}),renderContent:({onClose:i})=>(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsxs)(OE.Ay,{className:"block-editor-media-replace-flow__media-upload-menu",children:[(0,Td.jsxs)(GE,{children:[(0,Td.jsx)(WE,{gallery:E,addToGallery:g,multiple:m,value:m?n:t,onSelect:e=>C(e,i),allowedTypes:r,render:({open:e})=>(0,Td.jsx)(k_.A,{icon:HE.A,onClick:e,children:(0,H.__)("Open Media Library")})}),(0,Td.jsx)(LE,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!b)return t(),s(n);u(n),v({allowedTypes:r,filesList:n,onFileChange:([e])=>{C(e,t)},onError:k})})(e,i)},accept:o,multiple:!!m,render:({openFileDialog:e})=>(0,Td.jsx)(k_.A,{icon:JA.A,onClick:()=>{e()},children:(0,H.__)("Upload")})})]}),l&&(0,Td.jsx)(k_.A,{icon:$E.A,onClick:l,isPressed:c,children:(0,H.__)("Use featured image")}),f]}),a&&(0,Td.jsxs)("form",{className:(0,$v.A)("block-editor-media-flow__url-input",{"has-siblings":_||l}),children:[(0,Td.jsx)("span",{className:"block-editor-media-replace-flow__image-url-label",children:(0,H.__)("Current media URL:")}),(0,Td.jsx)(fj,{value:{url:e},settings:[],showSuggestions:!1,onChange:({url:e})=>{a(e),x.current.focus()}})]})]})})}));function yj(e,t=[]){const n=t.find((t=>t.name===e));return n?.href?n?.href:e}const vj="image",_j={backgroundImage:!0,backgroundSize:!1};function xj(e){return"web"===Lh.A.OS&&e?.background?.backgroundImage}function wj(e){return!!e?.background?.backgroundImage?.id||"string"==typeof e?.background?.backgroundImage||!!e?.background?.backgroundImage?.url}const kj=e=>{if(!(!e||isNaN(e.x)&&isNaN(e.y)))return`${100*(isNaN(e.x)?.5:e.x)}% ${100*(isNaN(e.y)?.5:e.y)}%`},Cj=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 Sj({label:e,filename:t,url:n}){const r=e||(0,DE.e)(n)||(0,H.__)("Add background image");return(0,Td.jsx)($A,{as:"span",children:(0,Td.jsxs)(tA.A,{justify:n?"flex-start":"center",as:"span",children:[n&&(0,Td.jsx)("span",{className:(0,$v.A)("block-editor-global-styles-background-panel__inspector-image-indicator-wrapper",{"has-image":n}),"aria-hidden":!0,children:(0,Td.jsx)("span",{className:"block-editor-global-styles-background-panel__inspector-image-indicator",style:{backgroundImage:`url(${n})`}})}),(0,Td.jsxs)(R_.A,{as:"span",children:[(0,Td.jsx)(WA.A,{numberOfLines:1,className:"block-editor-global-styles-background-panel__inspector-media-replace-title",children:r}),(0,Td.jsx)(GA.A,{as:"span",children:n?(0,H.sprintf)((0,H.__)("Background image: %s"),t||r):(0,H.__)("No background image selected")})]})]})})}function Aj({panelId:e,isShownByDefault:t,onChange:n,style:r,inheritedValue:o,themeFileURIs:i}){const s=(0,Ul.A)((e=>e(hv).getSettings().mediaUpload),[]),{id:a,title:l,url:c}=r?.background?.backgroundImage||{...o?.background?.backgroundImage},u=(0,S.useRef)(),{createErrorNotice:d}=(0,Vl.A)(Xb.store),h=e=>{d(e,{type:"snackbar"})},p=()=>n(Lf(r,["background","backgroundImage"],void 0)),f=e=>{if(!e||!e.url)return void p();if(ec(e.url))return;if(e.media_type&&e.media_type!==vj||!e.media_type&&e.type&&e.type!==vj)return void h((0,H.__)("Only images can be used as a background image."));const t=r?.background?.backgroundSize,o=r?.background?.backgroundPosition;n(Lf(r,["background"],{...r?.background,backgroundImage:{url:e.url,id:e.id,source:"file",title:e.title||void 0},backgroundPosition:o||"auto"!==t&&t?o:"50% 0"}))},m=(0,S.useCallback)((e=>({...e,style:{...e.style,background:void 0}})),[]),g=wj(r),b=()=>{const[e]=ME.focus.tabbable.find(u.current);e?.focus(),e?.click()},y=!g&&wj(o);return(0,Td.jsx)(YA,{className:"single-column",hasValue:()=>g,label:(0,H.__)("Background image"),onDeselect:p,isShownByDefault:t,resetAllFilter:m,panelId:e,children:(0,Td.jsxs)("div",{className:"block-editor-global-styles-background-panel__inspector-media-replace-container",ref:u,children:[(0,Td.jsxs)(bj,{mediaId:a,mediaURL:c,allowedTypes:[vj],accept:"image/*",onSelect:f,name:(0,Td.jsx)(Sj,{label:l,filename:l,url:yj(c,i)}),variant:"secondary",children:[y&&(0,Td.jsx)(k_.A,{onClick:()=>{b(),n(Lf(r,["background","backgroundImage"],"none"))},children:(0,H.__)("Remove")}),g&&(0,Td.jsx)(k_.A,{onClick:()=>{b(),p()},children:(0,H.__)("Reset ")})]}),(0,Td.jsx)(rE,{onFilesDrop:e=>{s({allowedTypes:[vj],filesList:e,onFileChange([e]){ec(e?.url)||f(e)},onError:h})},label:(0,H.__)("Drop to upload")})]})})}function Ej({panelId:e,isShownByDefault:t,onChange:n,style:r,inheritedValue:o,defaultValues:i,themeFileURIs:s}){const a=r?.background?.backgroundSize||o?.background?.backgroundSize,l=r?.background?.backgroundRepeat||o?.background?.backgroundRepeat,c=r?.background?.backgroundImage?.url||o?.background?.backgroundImage?.url,u=r?.background?.backgroundPosition||o?.background?.backgroundPosition,d=void 0!==a&&"cover"!==a&&"contain"!==a||""===a?"auto":a||i?.backgroundSize,h=!("no-repeat"===l||"cover"===d&&void 0===l),p=function(e){return void 0!==e?.background?.backgroundPosition||void 0!==e?.background?.backgroundSize}(r),f=(0,S.useCallback)((e=>({...e,style:{...e.style,background:{...e.style?.background,backgroundRepeat:void 0,backgroundSize:void 0}}})),[]),m=e=>{let t=l,o=u;"contain"===e&&(t="no-repeat",o=void 0),"cover"===e&&(t=void 0,o=void 0),"cover"!==d&&"contain"!==d||"auto"!==e||(t=void 0,r?.background?.backgroundImage?.id&&(o="50% 0")),e||"auto"!==d||(e="auto"),n(Lf(r,["background"],{...r?.background,backgroundPosition:o,backgroundRepeat:t,backgroundSize:e}))};return(0,Td.jsxs)(oE.A,{as:YA,spacing:2,className:"single-column",hasValue:()=>p,label:(0,H.__)("Size"),onDeselect:()=>n(Lf(r,["background"],{...r?.background,backgroundPosition:void 0,backgroundRepeat:void 0,backgroundSize:void 0})),isShownByDefault:t,resetAllFilter:f,panelId:e,children:[(0,Td.jsx)(NE,{__next40pxDefaultSize:!0,label:(0,H.__)("Position"),url:yj(c,s),value:Cj(u),onChange:e=>{n(Lf(r,["background","backgroundPosition"],kj(e)))}}),(0,Td.jsxs)(wx,{size:"__unstable-large",label:(0,H.__)("Size"),value:d,onChange:m,isBlock:!0,help:(g=a||i?.backgroundSize,"cover"===g||void 0===g?(0,H.__)("Image covers the space evenly."):"contain"===g?(0,H.__)("Image is contained without distortion."):(0,H.__)("Image has a fixed width.")),children:[(0,Td.jsx)(zC,{value:"cover",label:(0,H.__)("Cover")},"cover"),(0,Td.jsx)(zC,{value:"contain",label:(0,H.__)("Contain")},"contain"),(0,Td.jsx)(zC,{value:"auto",label:(0,H.__)("Tile")},"tile")]}),(0,Td.jsxs)(tA.A,{justify:"flex-start",spacing:2,as:"span",children:[void 0!==d&&"cover"!==d&&"contain"!==d?(0,Td.jsx)(ak,{"aria-label":(0,H.__)("Background image width"),onChange:m,value:a,size:"__unstable-large",__unstableInputWidth:"100px",min:0,placeholder:(0,H.__)("Auto")}):null,"cover"!==d&&(0,Td.jsx)(Hx.A,{label:(0,H.__)("Repeat"),checked:h,onChange:()=>n(Lf(r,["background","backgroundRepeat"],!0===h?"no-repeat":"repeat"))})]})]});var g}function Ij({resetAllFilter:e,onChange:t,value:n,panelId:r,children:o,headerLabel:i}){return(0,Td.jsx)(oE.A,{as:wA,spacing:4,label:i,resetAll:()=>{const r=e(n);t(r)},panelId:r,dropdownMenuProps:jv,children:o})}function jj({as:e=Ij,value:t,onChange:n,inheritedValue:r=t,settings:o,panelId:i,defaultControls:s=_j,defaultValues:a={},headerLabel:l=(0,H.__)("Background image"),themeFileURIs:c}){const u=(0,S.useCallback)((e=>({...e,background:{}})),[]),d=o?.background?.backgroundSize;return(0,Td.jsxs)(e,{resetAllFilter:u,value:t,onChange:n,panelId:i,headerLabel:l,children:[(0,Td.jsx)(Aj,{onChange:n,panelId:i,isShownByDefault:s.backgroundImage,style:t,inheritedValue:r,themeFileURIs:c}),d&&(0,Td.jsx)(Ej,{onChange:n,panelId:i,isShownByDefault:s.backgroundSize,style:t,inheritedValue:r,defaultValues:a,themeFileURIs:c})]})}const Tj="background",Bj={backgroundSize:"cover"};function Rj(e,t="any"){const n=Ec(e,Tj);return!!(!0===n||("any"===t?n?.backgroundImage||n?.backgroundSize||n?.backgroundRepeat:n?.[t]))}function Nj(e){return wj(e)?"has-background":""}function Dj({children:e}){const t=(0,S.useCallback)((e=>({...e,style:{...e.style,background:void 0}})),[]);return(0,Td.jsx)(IA,{group:"background",resetAllFilter:t,children:e})}function Mj({clientId:e,name:t,setAttributes:n,settings:r}){const o=(0,Ul.A)((t=>t(hv).getBlockAttributes(e)?.style),[e]);if(!xj(r)||!Rj(t,"backgroundImage"))return null;const i=Ec(t,[Tj,"__experimentalDefaultControls"]),s={...r,background:{...r.background,backgroundSize:r?.background?.backgroundSize&&Rj(t,"backgroundSize")}};return(0,Td.jsx)(jj,{as:Dj,panelId:e,defaultControls:i,defaultValues:Bj,settings:s,onChange:e=>{n({style:Wv(e)})},value:o})}const Pj={useBlockProps:function({name:e,style:t}){if(!Rj(e)||!t?.background?.backgroundImage)return;const n=function(e){if(!e)return;const t=e?.backgroundImage;let n;return t?.url&&(e?.backgroundSize||(n={backgroundSize:"cover"}),"contain"!==e?.backgroundSize||e?.backgroundPosition||(n={backgroundPosition:"center"})),n}(t?.background);return n?{style:{...n}}:void 0},attributeKeys:["style"],hasSupport:Rj};(0,Tu.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.lock)&&void 0!==t?t:{})||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const Oj=/[\s#]/g,Lj={type:"string",source:"attribute",attribute:"id",selector:"*"},Fj={addSaveProps:function(e,t,n){return Ic(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e},edit:function({anchor:e,setAttributes:t}){if("default"!==IS())return null;const n="web"===Lh.A.OS;return(0,Td.jsx)(IA,{group:"advanced",children:(0,Td.jsx)(KE.A,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"html-anchor-control",label:(0,H.__)("HTML anchor"),help:(0,Td.jsxs)(Td.Fragment,{children:[(0,H.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor”. Then, you’ll be able to link directly to this section of your page."),n&&(0,Td.jsxs)(Td.Fragment,{children:[" ",(0,Td.jsx)(KI.A,{href:(0,H.__)("https://wordpress.org/documentation/article/page-jumps/"),children:(0,H.__)("Learn more about anchors")})]})]}),value:e||"",placeholder:n?null:(0,H.__)("Add an anchor"),onChange:e=>{e=e.replace(Oj,"-"),t({anchor:e})},autoCapitalize:"none",autoComplete:"off"})})},attributeKeys:["anchor"],hasSupport:e=>Ic(e,"anchor")};(0,Tu.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.anchor)&&void 0!==t?t:{})||Ic(e,"anchor")&&(e.attributes={...e.attributes,anchor:Lj}),e}));const zj={type:"string",source:"attribute",attribute:"aria-label",selector:"*"},Uj={addSaveProps:function(e,t,n){return Ic(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e},attributeKeys:["ariaLabel"],hasSupport:e=>Ic(e,"ariaLabel")};(0,Tu.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){return e?.attributes?.ariaLabel?.type||Ic(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:zj}),e}));const Vj={edit:function({className:e,setAttributes:t}){return"default"!==IS()?null:(0,Td.jsx)(IA,{group:"advanced",children:(0,Td.jsx)(KE.A,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,autoComplete:"off",label:(0,H.__)("Additional CSS class(es)"),value:e||"",onChange:e=>{t({className:""!==e?e:void 0})},help:(0,H.__)("Separate multiple classes with spaces.")})})},addSaveProps:function(e,t,n){return Ic(t,"customClassName",!0)&&n.className&&(e.className=(0,$v.A)(e.className,n.className)),e},attributeKeys:["className"],hasSupport:e=>Ic(e,"customClassName",!0)};(0,Tu.addFilter)("blocks.registerBlockType","core/editor/custom-class-name/attribute",(function(e){return Ic(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,Tu.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,r){if(!Ic(e.name,"customClassName",!0))return e;if(1===r.length&&e.innerBlocks.length===t.length)return e;if(1===r.length&&t.length>1||r.length>1&&1===t.length)return e;if(t[n]){const r=t[n]?.attributes.className;if(r)return{...e,attributes:{...e.attributes,className:r}}}return e})),(0,Tu.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return Ic(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([Bd(t.name),...e.className.split(" ")])].join(" ").trim():e.className=Bd(t.name)),e}));const Hj=/^([\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)?$/,$j=["top","right","bottom","left"],Wj=["color","style","width"],Gj=e=>!e||!Wj.some((t=>void 0!==e[t])),qj=e=>!!e&&(Kj(e)?!$j.every((t=>Gj(e[t]))):!Gj(e)),Kj=(e={})=>Object.keys(e).some((e=>-1!==$j.indexOf(e))),Yj=e=>{if(!Kj(e))return!1;const t=$j.map((t=>Jj(e?.[t])));return!t.every((e=>e===t[0]))},Jj=(e,t)=>{if(Gj(e))return t;const{color:n,style:r,width:o}=t||{},{color:i=n,style:s=r,width:a=o}=e;return[a,a&&"0"!==a||i?s||"solid":s,i].filter(Boolean).join(" ")},Xj=e=>function(e){if(0===e.length)return;const t={};let n,r=0;return e.forEach((e=>{t[e]=void 0===t[e]?1:t[e]+1,t[e]>r&&(n=e,r=t[e])})),n}(e.map((e=>void 0===e?void 0:function(e){const t=e.trim().match(Hj);if(!t)return[void 0,void 0];const[,n,r]=t;let o=parseFloat(n);return o=Number.isNaN(o)?void 0:o,[o,r]}(`${e}`)[1])).filter((e=>void 0!==e)));(0,oc.X$)([ic.A,sc.A]);const{kebabCase:Zj}=Cf(d_.j),Qj=(e,t,n)=>{if(t){const n=e?.find((e=>e.slug===t));if(n)return n}return{color:n}},eT=(e,t)=>e?.find((e=>e.color===t));function tT(e,t){if(e&&t)return`has-${Zj(t)}-${e}`}function nT(){const[e,t,n,r,o,i,s,a,l,c]=fv("color.custom","color.palette.custom","color.palette.theme","color.palette.default","color.defaultPalette","color.customGradient","color.gradients.custom","color.gradients.theme","color.gradients.default","color.defaultGradients"),u={disableCustomColors:!e,disableCustomGradients:!i};return u.colors=(0,S.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,H._x)("Theme","Indicates this palette comes from the theme."),colors:n}),o&&r&&r.length&&e.push({name:(0,H._x)("Default","Indicates this palette comes from WordPress."),colors:r}),t&&t.length&&e.push({name:(0,H._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[t,n,r,o]),u.gradients=(0,S.useMemo)((()=>{const e=[];return a&&a.length&&e.push({name:(0,H._x)("Theme","Indicates this palette comes from the theme."),gradients:a}),c&&l&&l.length&&e.push({name:(0,H._x)("Default","Indicates this palette comes from WordPress."),gradients:l}),s&&s.length&&e.push({name:(0,H._x)("Custom","Indicates this palette is created by the user."),gradients:s}),e}),[s,a,l,c]),u.hasColorsOrGradients=!!u.colors.length||!!u.gradients.length,u}var rT=n(92982);const oT=(0,G_.css)("",""),iT={name:"bjn8wh",styles:"position:relative"},sT=e=>{const{color:t=q_.l.gray[200],style:n="solid",width:r=K_.A.borderWidth}=e||{};return`${t} ${r&&"0"!==r||t?n||"solid":n} ${r!==K_.A.borderWidth?`clamp(1px, ${r}, 10px)`:r}`},aT={name:"1nwbfnf",styles:"grid-column:span 2;margin:0 auto"};const lT=(0,V_.KZ)(((e,t)=>{const{className:n,isLinked:r,...o}=function(e){const{className:t,size:n="default",...r}=(0,U_.A)(e,"BorderBoxControlLinkedButton"),o=(0,H_.l)();return{...r,className:(0,S.useMemo)((()=>o((e=>(0,G_.css)("position:absolute;top:","__unstable-large"===e?"8px":"3px",";",(0,qw.h)({right:0})()," line-height:0;",""))(n),t)),[t,o,n])}}(e),i=r?(0,H.__)("Unlink sides"):(0,H.__)("Link sides");return(0,Td.jsx)(Dx.Ay,{text:i,children:(0,Td.jsx)(px.A,{className:n,children:(0,Td.jsx)(Zv.Ay,{...o,size:"small",icon:r?rT.A:ZI.A,iconSize:24,"aria-label":i,ref:t})})})}),"BorderBoxControlLinkedButton");const cT=(0,V_.KZ)(((e,t)=>{const{value:n,...r}=function(e){const{className:t,value:n,size:r="default",...o}=(0,U_.A)(e,"BorderBoxControlVisualizer"),i=(0,H_.l)();return{...o,className:(0,S.useMemo)((()=>i(((e,t)=>(0,G_.css)("position:absolute;top:","__unstable-large"===t?"20px":"15px",";right:","__unstable-large"===t?"39px":"29px",";bottom:","__unstable-large"===t?"20px":"15px",";left:","__unstable-large"===t?"39px":"29px",";border-top:",sT(e?.top),";border-bottom:",sT(e?.bottom),";",(0,qw.h)({borderLeft:sT(e?.left)})()," ",(0,qw.h)({borderRight:sT(e?.right)})(),";",""))(n,r),t)),[i,t,n,r]),value:n}}(e);return(0,Td.jsx)(px.A,{...r,ref:t})}),"BorderBoxControlVisualizer");var uT=n(63254),dT=n(83358),hT=n(32632),pT=n(72825);const fT=[{label:(0,H.__)("Solid"),icon:dT.A,value:"solid"},{label:(0,H.__)("Dashed"),icon:hT.A,value:"dashed"},{label:(0,H.__)("Dotted"),icon:pT.A,value:"dotted"}],mT=(0,V_.KZ)((function({onChange:e,...t},n){return(0,Td.jsx)(wx,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,ref:n,isDeselectable:!0,onChange:t=>{e?.(t)},...t,children:fT.map((e=>(0,Td.jsx)(Vx,{value:e.value,icon:e.icon,label:e.label},e.value)))})}),"BorderControlStylePicker"),gT=mT,bT=(0,S.forwardRef)((function(e,t){const{className:n,colorValue:r,...o}=e;return(0,Td.jsx)("span",{className:(0,$v.A)("component-color-indicator",n),style:{background:r},ref:t,...o})}));var yT=n(16228),vT=n(64364),_T=n(71612),xT=n(22223);const wT=(0,W_.default)(Kw.A,{target:"ez9hsf47"})("width:",(0,Jw.x)(24),";"),kT=(0,W_.default)(_T.A,{target:"ez9hsf46"})("margin-left:",(0,Jw.x)(-2),";width:5em;"),CT=(0,W_.default)(FC,{target:"ez9hsf45"})("flex:1;margin-right:",(0,Jw.x)(2),";"),ST=`\n.react-colorful__interactive {\n\twidth: calc( 100% - ${(0,Jw.x)(2)} );\n\tmargin-left: ${(0,Jw.x)(1)};\n}`,AT=(0,W_.default)("div",{target:"ez9hsf44"})("padding-top:",(0,Jw.x)(2),";padding-right:0;padding-left:0;padding-bottom:0;"),ET=(0,W_.default)(tA.A,{target:"ez9hsf43"})("padding-left:",(0,Jw.x)(4),";padding-right:",(0,Jw.x)(4),";"),IT=(0,W_.default)(B_.A,{target:"ez9hsf42"})("padding-top:",(0,Jw.x)(4),";padding-left:",(0,Jw.x)(4),";padding-right:",(0,Jw.x)(3),";padding-bottom:",(0,Jw.x)(5),";"),jT=(0,W_.default)("div",{target:"ez9hsf41"})(xT.r,";width:216px;.react-colorful{display:flex;flex-direction:column;align-items:center;width:216px;height:auto;}.react-colorful__saturation{width:100%;border-radius:0;height:216px;margin-bottom:",(0,Jw.x)(4),";border-bottom:none;}.react-colorful__hue,.react-colorful__alpha{width:184px;height:16px;border-radius:16px;margin-bottom:",(0,Jw.x)(2),";}.react-colorful__pointer{height:16px;width:16px;border:none;box-shadow:0 0 2px 0 rgba( 0, 0, 0, 0.25 );outline:2px solid transparent;}.react-colorful__pointer-fill{box-shadow:inset 0 0 0 ",K_.A.borderWidthFocus," #fff;}",ST,";"),TT=(0,W_.default)(Zv.Ay,{target:"ez9hsf40"})("&&&&&{min-width:",(0,Jw.x)(6),";padding:0;>svg{margin-right:0;}}");var BT=n(11551);const RT=e=>{const{color:t,colorType:n}=e,[r,o]=(0,S.useState)(null),i=(0,S.useRef)(),s=(0,YI.A)((()=>{switch(n){case"hsl":return t.toHslString();case"rgb":return t.toRgbString();default:return t.toHex()}}),(()=>{i.current&&clearTimeout(i.current),o(t.toHex()),i.current=setTimeout((()=>{o(null),i.current=void 0}),3e3)}));return(0,S.useEffect)((()=>()=>{i.current&&clearTimeout(i.current)}),[]),(0,Td.jsx)(Dx.Ay,{delay:0,hideOnClick:!1,text:r===t.toHex()?(0,H.__)("Copied!"):(0,H.__)("Copy"),children:(0,Td.jsx)(TT,{size:"small",ref:s,icon:BT.A,showTooltip:!1})})};var NT=n(98232),DT=n(43735);const MT=({min:e,max:t,label:n,abbreviation:r,onChange:o,value:i})=>(0,Td.jsxs)(tA.A,{spacing:4,children:[(0,Td.jsx)(wT,{min:e,max:t,label:n,hideLabelFromVision:!0,value:i,onChange:e=>{o(e?"string"!=typeof e?e:parseInt(e,10):0)},prefix:(0,Td.jsx)(DT.A,{as:NT.A,paddingLeft:(0,Jw.x)(4),color:q_.l.theme.accent,lineHeight:1,children:r}),spinControls:"none",size:"__unstable-large"}),(0,Td.jsx)(CT,{__nextHasNoMarginBottom:!0,label:n,hideLabelFromVision:!0,min:e,max:t,value:i,onChange:o,withInputField:!1})]}),PT=({color:e,onChange:t,enableAlpha:n})=>{const{r,g:o,b:i,a:s}=e.toRgb();return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(MT,{min:0,max:255,label:"Red",abbreviation:"R",value:r,onChange:e=>t((0,oc.Mj)({r:e,g:o,b:i,a:s}))}),(0,Td.jsx)(MT,{min:0,max:255,label:"Green",abbreviation:"G",value:o,onChange:e=>t((0,oc.Mj)({r,g:e,b:i,a:s}))}),(0,Td.jsx)(MT,{min:0,max:255,label:"Blue",abbreviation:"B",value:i,onChange:e=>t((0,oc.Mj)({r,g:o,b:e,a:s}))}),n&&(0,Td.jsx)(MT,{min:0,max:100,label:"Alpha",abbreviation:"A",value:Math.trunc(100*s),onChange:e=>t((0,oc.Mj)({r,g:o,b:i,a:e/100}))})]})},OT=({color:e,onChange:t,enableAlpha:n})=>{const r=(0,S.useMemo)((()=>e.toHsl()),[e]),[o,i]=(0,S.useState)({...r}),s=e.isEqual((0,oc.Mj)(o));(0,S.useEffect)((()=>{s||i(r)}),[r,s]);const a=s?o:r,l=n=>{const r=(0,oc.Mj)({...a,...n});e.isEqual(r)?i((e=>({...e,...n}))):t(r)};return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(MT,{min:0,max:359,label:"Hue",abbreviation:"H",value:a.h,onChange:e=>{l({h:e})}}),(0,Td.jsx)(MT,{min:0,max:100,label:"Saturation",abbreviation:"S",value:a.s,onChange:e=>{l({s:e})}}),(0,Td.jsx)(MT,{min:0,max:100,label:"Lightness",abbreviation:"L",value:a.l,onChange:e=>{l({l:e})}}),n&&(0,Td.jsx)(MT,{min:0,max:100,label:"Alpha",abbreviation:"A",value:Math.trunc(100*a.a),onChange:e=>{l({a:e/100})}})]})};var LT=n(8967);const FT=({color:e,onChange:t,enableAlpha:n})=>(0,Td.jsx)(LT.ey,{prefix:(0,Td.jsx)(DT.A,{as:NT.A,marginLeft:(0,Jw.x)(4),color:q_.l.theme.accent,lineHeight:1,children:"#"}),value:e.toHex().slice(1).toUpperCase(),onChange:e=>{if(!e)return;const n=e.startsWith("#")?e:"#"+e;t((0,oc.Mj)(n))},maxLength:n?9:7,label:(0,H.__)("Hex color"),hideLabelFromVision:!0,size:"__unstable-large",__unstableStateReducer:(e,t)=>{const n=t.payload?.event?.nativeEvent;if("insertFromPaste"!==n?.inputType)return{...e};const r=e.value?.startsWith("#")?e.value.slice(1).toUpperCase():e.value?.toUpperCase();return{...e,value:r}},__unstableInputWidth:"9em"}),zT=({colorType:e,color:t,onChange:n,enableAlpha:r})=>{const o={color:t,onChange:n,enableAlpha:r};switch(e){case"hsl":return(0,Td.jsx)(OT,{...o});case"rgb":return(0,Td.jsx)(PT,{...o});default:return(0,Td.jsx)(FT,{...o})}};function UT(){return(UT=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function VT(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}function HT(e){var t=(0,S.useRef)(e),n=(0,S.useRef)((function(e){t.current&&t.current(e)}));return t.current=e,n.current}var $T=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e<t?t:e},WT=function(e){return"touches"in e},GT=function(e){return e&&e.ownerDocument.defaultView||self},qT=function(e,t,n){var r=e.getBoundingClientRect(),o=WT(t)?function(e,t){for(var n=0;n<e.length;n++)if(e[n].identifier===t)return e[n];return e[0]}(t.touches,n):t;return{left:$T((o.pageX-(r.left+GT(e).pageXOffset))/r.width),top:$T((o.pageY-(r.top+GT(e).pageYOffset))/r.height)}},KT=function(e){!WT(e)&&e.preventDefault()},YT=S.memo((function(e){var t=e.onMove,n=e.onKey,r=VT(e,["onMove","onKey"]),o=(0,S.useRef)(null),i=HT(t),s=HT(n),a=(0,S.useRef)(null),l=(0,S.useRef)(!1),c=(0,S.useMemo)((function(){var e=function(e){KT(e),(WT(e)?e.touches.length>0:e.buttons>0)&&o.current?i(qT(o.current,e,a.current)):n(!1)},t=function(){return n(!1)};function n(n){var r=l.current,i=GT(o.current),s=n?i.addEventListener:i.removeEventListener;s(r?"touchmove":"mousemove",e),s(r?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,r=o.current;if(r&&(KT(t),!function(e,t){return t&&!WT(e)}(t,l.current)&&r)){if(WT(t)){l.current=!0;var s=t.changedTouches||[];s.length&&(a.current=s[0].identifier)}r.focus(),i(qT(r,t,a.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},n]}),[s,i]),u=c[0],d=c[1],h=c[2];return(0,S.useEffect)((function(){return h}),[h]),S.createElement("div",UT({},r,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:o,onKeyDown:d,tabIndex:0,role:"slider"}))})),JT=function(e){return e.filter(Boolean).join(" ")},XT=function(e){var t=e.color,n=e.left,r=e.top,o=void 0===r?.5:r,i=JT(["react-colorful__pointer",e.className]);return S.createElement("div",{className:i,style:{top:100*o+"%",left:100*n+"%"}},S.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},ZT=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},QT=(Math.PI,function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:ZT(e.h),s:ZT(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:ZT(o/2),a:ZT(r,2)}}),eB=function(e){var t=QT(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},tB=function(e){var t=QT(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},nB=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),s=r*(1-n),a=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:ZT(255*[r,a,s,s,l,r][c]),g:ZT(255*[l,r,r,a,s,s][c]),b:ZT(255*[s,s,l,r,r,a][c]),a:ZT(o,2)}},rB=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?iB({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},oB=rB,iB=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),s=i-Math.min(t,n,r),a=s?i===t?(n-r)/s:i===n?2+(r-t)/s:4+(t-n)/s:0;return{h:ZT(60*(a<0?a+6:a)),s:ZT(i?s/i*100:0),v:ZT(i/255*100),a:o}},sB=S.memo((function(e){var t=e.hue,n=e.onChange,r=JT(["react-colorful__hue",e.className]);return S.createElement("div",{className:r},S.createElement(YT,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:$T(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":ZT(t),"aria-valuemax":"360","aria-valuemin":"0"},S.createElement(XT,{className:"react-colorful__hue-pointer",left:t/360,color:eB({h:t,s:100,v:100,a:1})})))})),aB=S.memo((function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:eB({h:t.h,s:100,v:100,a:1})};return S.createElement("div",{className:"react-colorful__saturation",style:r},S.createElement(YT,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:$T(t.s+100*e.left,0,100),v:$T(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+ZT(t.s)+"%, Brightness "+ZT(t.v)+"%"},S.createElement(XT,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:eB(t)})))})),lB=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")};function cB(e,t,n){var r=HT(n),o=(0,S.useState)((function(){return e.toHsva(t)})),i=o[0],s=o[1],a=(0,S.useRef)({color:t,hsva:i});(0,S.useEffect)((function(){if(!e.equal(t,a.current.color)){var n=e.toHsva(t);a.current={hsva:n,color:t},s(n)}}),[t,e]),(0,S.useEffect)((function(){var t;(function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0})(i,a.current.hsva)||e.equal(t=e.fromHsva(i),a.current.color)||(a.current={hsva:i,color:t},r(t))}),[i,e,r]);var l=(0,S.useCallback)((function(e){s((function(t){return Object.assign({},t,e)}))}),[]);return[i,l]}var uB="undefined"!=typeof window?S.useLayoutEffect:S.useEffect,dB=new Map,hB=function(e){uB((function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!dB.has(t)){var r=t.createElement("style");r.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',dB.set(t,r);var o=n.nc;o&&r.setAttribute("nonce",o),t.head.appendChild(r)}}),[])},pB=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,i=e.onChange,s=VT(e,["className","colorModel","color","onChange"]),a=(0,S.useRef)(null);hB(a);var l=cB(n,o,i),c=l[0],u=l[1],d=JT(["react-colorful",t]);return S.createElement("div",UT({},s,{ref:a,className:d}),S.createElement(aB,{hsva:c,onChange:u}),S.createElement(sB,{hue:c.h,onChange:u,className:"react-colorful__last-control"}))},fB=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+tB(Object.assign({},n,{a:0}))+", "+tB(Object.assign({},n,{a:1}))+")"},i=JT(["react-colorful__alpha",t]),s=ZT(100*n.a);return S.createElement("div",{className:i},S.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),S.createElement(YT,{onMove:function(e){r({a:e.left})},onKey:function(e){r({a:$T(n.a+e.left)})},"aria-label":"Alpha","aria-valuetext":s+"%","aria-valuenow":s,"aria-valuemin":"0","aria-valuemax":"100"},S.createElement(XT,{className:"react-colorful__alpha-pointer",left:n.a,color:tB(n)})))},mB=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,i=e.onChange,s=VT(e,["className","colorModel","color","onChange"]),a=(0,S.useRef)(null);hB(a);var l=cB(n,o,i),c=l[0],u=l[1],d=JT(["react-colorful",t]);return S.createElement("div",UT({},s,{ref:a,className:d}),S.createElement(aB,{hsva:c,onChange:u}),S.createElement(sB,{hue:c.h,onChange:u}),S.createElement(fB,{hsva:c,onChange:u,className:"react-colorful__last-control"}))},gB={defaultColor:"rgba(0, 0, 0, 1)",toHsva:rB,fromHsva:function(e){var t=nB(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:lB},bB=function(e){return S.createElement(mB,UT({},e,{colorModel:gB}))},yB={defaultColor:"rgb(0, 0, 0)",toHsva:oB,fromHsva:function(e){var t=nB(e);return"rgb("+t.r+", "+t.g+", "+t.b+")"},equal:lB},vB=function(e){return S.createElement(pB,UT({},e,{colorModel:yB}))};const _B=({color:e,enableAlpha:t,onChange:n})=>{const r=t?bB:vB,o=(0,S.useMemo)((()=>e.toRgbString()),[e]);return(0,Td.jsx)(r,{color:o,onChange:e=>{n((0,oc.Mj)(e))},onPointerDown:({currentTarget:e,pointerId:t})=>{e.setPointerCapture(t)},onPointerUp:({currentTarget:e,pointerId:t})=>{e.releasePointerCapture(t)}})};(0,oc.X$)([ic.A]);const xB=[{label:"RGB",value:"rgb"},{label:"HSL",value:"hsl"},{label:"Hex",value:"hex"}],wB={InputBase:{isBorderless:!0}},kB=(0,V_.KZ)(((e,t)=>{const{enableAlpha:n=!1,color:r,onChange:o,defaultValue:i="#fff",copyFormat:s,...a}=(0,U_.A)(e,"ColorPicker"),[l,c]=(0,vx.j)({onChange:o,value:r,defaultValue:i}),u=(0,S.useMemo)((()=>(0,oc.Mj)(l||"")),[l]),d=(0,yT.A)(c),h=(0,S.useCallback)((e=>{d(e.toHex())}),[d]),[p,f]=(0,S.useState)(s||"hex");return(0,Td.jsxs)(jT,{ref:t,...a,children:[(0,Td.jsx)(_B,{onChange:h,color:u,enableAlpha:n}),(0,Td.jsxs)(AT,{children:[(0,Td.jsxs)(ET,{justify:"space-between",children:[(0,Td.jsx)(vT.c7,{value:wB,children:(0,Td.jsx)(kT,{__nextHasNoMarginBottom:!0,options:xB,value:p,onChange:e=>f(e),label:(0,H.__)("Color format"),hideLabelFromVision:!0})}),(0,Td.jsx)(RT,{color:u,colorType:s||p})]}),(0,Td.jsx)(IT,{direction:"column",gap:2,children:(0,Td.jsx)(zT,{colorType:p,color:u,onChange:h,enableAlpha:n})})]})]})}),"ColorPicker");function CB(e){if(void 0!==e)return"string"==typeof e?e:e.hex?e.hex:void 0}const SB=(0,_h.A)((e=>{const t=(0,oc.Mj)(e),n=t.toHex(),r=t.toRgb(),o=t.toHsv(),i=t.toHsl();return{hex:n,rgb:r,hsv:o,hsl:i,source:"hex",oldHue:i.h}}));function AB(e){const{onChangeComplete:t}=e,n=(0,S.useCallback)((e=>{t(SB(e))}),[t]);return function(e){return void 0!==e.onChangeComplete||void 0!==e.disableAlpha||"string"==typeof e.color?.hex}(e)?{color:CB(e.color),enableAlpha:!e.disableAlpha,onChange:n}:{...e,color:e.color,enableAlpha:e.enableAlpha,onChange:e.onChange}}const EB=e=>(0,Td.jsx)(kB,{...AB(e)}),IB=(0,S.createContext)({});var jB=n(8748);const TB=(0,S.forwardRef)((function(e,t){const{isPressed:n,...r}=e;return(0,Td.jsx)(Zv.Ay,{...r,"aria-pressed":n,ref:t})})),BB=(0,S.forwardRef)((function(e,t){const{id:n,isSelected:r,compositeStore:o,...i}=e,s=o.useState("activeId");return r&&!s&&o.setActiveId(n),(0,Td.jsx)(jB.l,{render:(0,Td.jsx)(Zv.Ay,{...i,role:"option","aria-selected":!!r,ref:t}),store:o,id:n})}));function RB(e){const{actions:t,options:n,baseId:r,className:o,loop:i=!0,children:s,...a}=e,l=(0,Q_.q)({focusLoop:i,rtl:(0,H.isRTL)()}),c={baseId:r,compositeStore:l};return(0,Td.jsx)("div",{className:o,children:(0,Td.jsxs)(IB.Provider,{value:c,children:[(0,Td.jsx)(ax.e,{...a,id:r,store:l,role:"listbox",children:n}),s,t]})})}function NB(e){const{actions:t,options:n,children:r,baseId:o,...i}=e;return(0,Td.jsx)("div",{...i,id:o,children:(0,Td.jsxs)(IB.Provider,{value:{baseId:o},children:[n,r,t]})})}function DB(e){const{asButtons:t,actions:n,options:r,children:o,className:i,...s}=e,a=(0,z_.A)(DB,"components-circular-option-picker",s.id),l=t?NB:RB,c=n?(0,Td.jsx)("div",{className:"components-circular-option-picker__custom-clear-wrapper",children:n}):void 0,u=(0,Td.jsx)("div",{className:"components-circular-option-picker__swatches",children:r});return(0,Td.jsx)(l,{...s,baseId:a,className:(0,$v.A)("components-circular-option-picker",i),actions:c,options:u,children:o})}DB.Option=function e({className:t,isSelected:n,selectedIconProps:r={},tooltipText:o,...i}){const{baseId:s,compositeStore:a}=(0,S.useContext)(IB),l={id:(0,z_.A)(e,s||"components-circular-option-picker__option"),className:"components-circular-option-picker__option",...i},c=a?(0,Td.jsx)(BB,{...l,compositeStore:a,isSelected:n}):(0,Td.jsx)(TB,{...l,isPressed:n});return(0,Td.jsxs)("div",{className:(0,$v.A)(t,"components-circular-option-picker__option-wrapper"),children:[o?(0,Td.jsx)(Dx.Ay,{text:o,children:c}):c,n&&(0,Td.jsx)(lk.A,{icon:ZS.A,...r})]})},DB.OptionGroup=function({className:e,options:t,...n}){const r="aria-label"in n||"aria-labelledby"in n?"group":void 0;return(0,Td.jsx)("div",{...n,role:r,className:(0,$v.A)("components-circular-option-picker__option-group","components-circular-option-picker__swatches",e),children:t})},DB.ButtonAction=function({className:e,children:t,...n}){return(0,Td.jsx)(Zv.Ay,{className:(0,$v.A)("components-circular-option-picker__clear",e),variant:"tertiary",...n,children:t})},DB.DropdownLinkAction=function({buttonProps:e,className:t,dropdownProps:n,linkText:r}){return(0,Td.jsx)(PE.A,{className:(0,$v.A)("components-circular-option-picker__dropdown-link-action",t),renderToggle:({isOpen:t,onToggle:n})=>(0,Td.jsx)(Zv.Ay,{"aria-expanded":t,"aria-haspopup":"true",onClick:n,variant:"link",...e,children:r}),...n})};const MB=DB,PB=(0,W_.default)(nA.A,{target:"ev9wop70"})({name:"13lxv2o",styles:"text-transform:uppercase;line-height:24px;font-weight:500;&&&{font-size:11px;margin-bottom:0;}"}),OB=({paddingSize:e="small"})=>{if("none"===e)return;const t={small:(0,Jw.x)(2),medium:(0,Jw.x)(4)};return(0,G_.css)("padding:",t[e]||t.small,";","")},LB=(0,W_.default)("div",{target:"eovvns30"})("margin-left:",(0,Jw.x)(-2),";margin-right:",(0,Jw.x)(-2),";&:first-of-type{margin-top:",(0,Jw.x)(-2),";}&:last-of-type{margin-bottom:",(0,Jw.x)(-2),";}",OB,";"),FB=(0,V_.KZ)((function(e,t){const{paddingSize:n="small",...r}=(0,U_.A)(e,"DropdownContentWrapper");return(0,Td.jsx)(LB,{...r,paddingSize:n,ref:t})}),"DropdownContentWrapper");(0,oc.X$)([ic.A,sc.A]);const zB=e=>e.length>0&&e.every((e=>{return t=e,Array.isArray(t.colors)&&!("color"in t);var t}));function UB({className:e,clearColor:t,colors:n,onChange:r,value:o,...i}){const s=(0,S.useMemo)((()=>n.map((({color:e,name:n},i)=>{const s=(0,oc.Mj)(e),a=o===e;return(0,Td.jsx)(MB.Option,{isSelected:a,selectedIconProps:a?{fill:s.contrast()>s.contrast("#000")?"#fff":"#000"}:{},tooltipText:n||(0,H.sprintf)((0,H.__)("Color code: %s"),e),style:{backgroundColor:e,color:e},onClick:a?t:()=>r(e,i),"aria-label":n?(0,H.sprintf)((0,H.__)("Color: %s"),n):(0,H.sprintf)((0,H.__)("Color code: %s"),e)},`${e}-${i}`)}))),[n,o,r,t]);return(0,Td.jsx)(MB.OptionGroup,{className:e,options:s,...i})}function VB({className:e,clearColor:t,colors:n,onChange:r,value:o,headingLevel:i}){const s=(0,z_.A)(VB,"color-palette");return 0===n.length?null:(0,Td.jsx)(oE.A,{spacing:3,className:e,children:n.map((({name:e,colors:n},a)=>{const l=`${s}-${a}`;return(0,Td.jsxs)(oE.A,{spacing:2,children:[(0,Td.jsx)(PB,{id:l,level:i,children:e}),(0,Td.jsx)(UB,{clearColor:t,colors:n,onChange:e=>r(e,a),value:o,"aria-labelledby":l})]},a)}))})}function HB({isRenderedInSidebar:e,popoverProps:t,...n}){const r=(0,S.useMemo)((()=>({shift:!0,resize:!1,...e?{placement:"left-start",offset:34}:{placement:"bottom",offset:8},...t})),[e,t]);return(0,Td.jsx)(PE.A,{contentClassName:"components-color-palette__custom-color-dropdown-content",popoverProps:r,...n})}(0,oc.X$)([ic.A,sc.A]);const $B=(0,S.forwardRef)((function(e,t){const{asButtons:n,loop:r,clearable:o=!0,colors:i=[],disableCustomColors:s=!1,enableAlpha:a=!1,onChange:l,value:c,__experimentalIsRenderedInSidebar:u=!1,headingLevel:d=2,"aria-label":h,"aria-labelledby":p,...f}=e,[m,g]=(0,S.useState)(c),b=(0,S.useCallback)((()=>l(void 0)),[l]),y=(0,S.useCallback)((e=>{g(((e,t)=>{if(!/^var\(/.test(null!=e?e:"")||null===t)return e;const{ownerDocument:n}=t,{defaultView:r}=n,o=r?.getComputedStyle(t).backgroundColor;return o?(0,oc.Mj)(o).toHex():e})(c,e))}),[c]),v=zB(i),_=(0,S.useMemo)((()=>((e,t=[],n=!1)=>{if(!e)return"";const r=/^var\(/.test(e),o=r?e:(0,oc.Mj)(e).toHex(),i=n?t:[{colors:t}];for(const{colors:e}of i)for(const{name:t,color:n}of e)if(o===(r?n:(0,oc.Mj)(n).toHex()))return t;return(0,H.__)("Custom")})(c,i,v)),[c,i,v]),x=c?.startsWith("#"),w=c?.replace(/^var\((.+)\)$/,"$1"),k=w?(0,H.sprintf)((0,H.__)('Custom color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),_,w):(0,H.__)("Custom color picker."),C={clearColor:b,onChange:l,value:c},A=!!o&&(0,Td.jsx)(MB.ButtonAction,{onClick:b,children:(0,H.__)("Clear")});let E;if(n)E={asButtons:!0};else{const e={asButtons:!1,loop:r};E=h?{...e,"aria-label":h}:p?{...e,"aria-labelledby":p}:{...e,"aria-label":(0,H.__)("Custom color picker.")}}return(0,Td.jsxs)(oE.A,{spacing:3,ref:t,...f,children:[!s&&(0,Td.jsx)(HB,{isRenderedInSidebar:u,renderContent:()=>(0,Td.jsx)(FB,{paddingSize:"none",children:(0,Td.jsx)(EB,{color:m,onChange:e=>l(e),enableAlpha:a})}),renderToggle:({isOpen:e,onToggle:t})=>(0,Td.jsxs)(oE.A,{className:"components-color-palette__custom-color-wrapper",spacing:0,children:[(0,Td.jsx)("button",{ref:y,className:"components-color-palette__custom-color-button","aria-expanded":e,"aria-haspopup":"true",onClick:t,"aria-label":k,style:{background:c},type:"button"}),(0,Td.jsxs)(oE.A,{className:"components-color-palette__custom-color-text-wrapper",spacing:.5,children:[(0,Td.jsx)(WA.A,{className:"components-color-palette__custom-color-name",children:c?_:(0,H.__)("No color selected")}),(0,Td.jsx)(WA.A,{className:(0,$v.A)("components-color-palette__custom-color-value",{"components-color-palette__custom-color-value--is-hex":x}),children:w})]})]})}),(0,Td.jsx)(MB,{...E,actions:A,options:v?(0,Td.jsx)(VB,{...C,headingLevel:d,colors:i,value:c}):(0,Td.jsx)(UB,{...C,colors:i,value:c})})]})})),WB=$B,GB={name:"f3vz0n",styles:"font-weight:500"},qB=(0,G_.css)("box-shadow:inset ",K_.A.controlBoxShadowFocus,";",""),KB=(0,G_.css)("border:0;padding:0;margin:0;",xT.r,";",""),YB=(0,G_.css)(Xw,"{flex:0 0 auto;}",""),JB=(0,G_.css)("background:#fff;&&>button{aspect-ratio:1;padding:0;display:flex;align-items:center;justify-content:center;",(0,qw.h)({borderRadius:"2px 0 0 2px"},{borderRadius:"0 2px 2px 0"})()," border:",K_.A.borderWidth," solid ",q_.l.ui.border,";&:focus,&:hover:not( :disabled ){",qB," border-color:",q_.l.ui.borderFocus,";z-index:1;position:relative;}}",""),XB=(0,G_.css)("width:",228,"px;>div:first-of-type>",rA.Gw,"{margin-bottom:0;",GB,";}&& ",rA.Gw,"+button:not( .has-text ){min-width:24px;padding:0;}",""),ZB=(0,G_.css)("",""),QB=(0,G_.css)("",""),eR=(0,G_.css)("justify-content:center;width:100%;&&{border-top:",K_.A.borderWidth," solid ",q_.l.gray[400],";border-top-left-radius:0;border-top-right-radius:0;height:40px;}",""),tR=e=>e.replace(/^var\((.+)\)$/,"$1"),nR=(0,V_.KZ)(((e,t)=>{const{__experimentalIsRenderedInSidebar:n,border:r,colors:o,disableCustomColors:i,enableAlpha:s,enableStyle:a,indicatorClassName:l,indicatorWrapperClassName:c,isStyleSettable:u,onReset:d,onColorChange:h,onStyleChange:p,popoverContentClassName:f,popoverControlsClassName:m,resetButtonClassName:g,showDropdownHeader:b,size:y,__unstablePopoverProps:v,..._}=function(e){const{border:t,className:n,colors:r=[],enableAlpha:o=!1,enableStyle:i=!0,onChange:s,previousStyleSelection:a,size:l="default",__experimentalIsRenderedInSidebar:c=!1,...u}=(0,U_.A)(e,"BorderControlDropdown"),[d]=Ww(t?.width),h=0===d,p=(0,H_.l)(),f=(0,S.useMemo)((()=>p(JB,n)),[n,p]),m=(0,S.useMemo)((()=>p(QB)),[p]),g=(0,S.useMemo)((()=>p(((e,t)=>{const{style:n}=e||{};return(0,G_.css)("border-radius:9999px;border:2px solid transparent;",n?(e=>{const{color:t,style:n}=e||{},r=n&&"none"!==n?q_.l.gray[300]:void 0;return(0,G_.css)("border-style:","none"===n?"solid":n,";border-color:",t||r,";","")})(e):void 0," width:","__unstable-large"===t?"24px":"22px",";height:","__unstable-large"===t?"24px":"22px",";padding:","__unstable-large"===t?"2px":"1px",";&>span{height:",(0,Jw.x)(4),";width:",(0,Jw.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,S.useMemo)((()=>p(XB)),[p]),y=(0,S.useMemo)((()=>p(ZB)),[p]),v=(0,S.useMemo)((()=>p(eR)),[p]);return{...u,border:t,className:f,colors:r,enableAlpha:o,enableStyle:i,indicatorClassName:m,indicatorWrapperClassName:g,onColorChange:e=>{s({color:e,style:"none"===t?.style?a:t?.style,width:h&&e?"1px":t?.width})},onStyleChange:e=>{const n=h&&e?"1px":t?.width;s({...t,style:e,width:n})},onReset:()=>{s({...t,color:void 0,style:void 0})},popoverContentClassName:y,popoverControlsClassName:b,resetButtonClassName:v,size:l,__experimentalIsRenderedInSidebar:c}}(e),{color:x,style:w}=r||{},k=((e,t)=>{if(e&&t){if(zB(t)){let n;return t.some((t=>t.colors.some((t=>t.color===e&&(n=t,!0))))),n}return t.find((t=>t.color===e))}})(x,o),C=((e,t,n,r)=>{if(r){if(t){const e=tR(t.color);return n?(0,H.sprintf)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s". The currently selected style is "%3$s".',t.name,e,n):(0,H.sprintf)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s".',t.name,e)}if(e){const t=tR(e);return n?(0,H.sprintf)('Border color and style picker. The currently selected color has a value of "%1$s". The currently selected style is "%2$s".',t,n):(0,H.sprintf)('Border color and style picker. The currently selected color has a value of "%1$s".',t)}return(0,H.__)("Border color and style picker.")}return t?(0,H.sprintf)('Border color picker. The currently selected color is called "%1$s" and has a value of "%2$s".',t.name,tR(t.color)):e?(0,H.sprintf)('Border color picker. The currently selected color has a value of "%1$s".',tR(e)):(0,H.__)("Border color picker.")})(x,k,w,a),A=x||w&&"none"!==w,E=n?"bottom left":void 0;return(0,Td.jsx)(PE.A,{renderToggle:({onToggle:e})=>(0,Td.jsx)(Zv.Ay,{onClick:e,variant:"tertiary","aria-label":C,tooltipPosition:E,label:(0,H.__)("Border color and style picker"),showTooltip:!0,__next40pxDefaultSize:"__unstable-large"===y,children:(0,Td.jsx)("span",{className:c,children:(0,Td.jsx)(bT,{className:l,colorValue:x})})}),renderContent:({onClose:e})=>(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(FB,{paddingSize:"medium",children:(0,Td.jsxs)(oE.A,{className:m,spacing:6,children:[b?(0,Td.jsxs)(tA.A,{children:[(0,Td.jsx)(rA.Gw,{children:(0,H.__)("Border color")}),(0,Td.jsx)(Zv.Ay,{size:"small",label:(0,H.__)("Close border color"),icon:uT.A,onClick:e})]}):void 0,(0,Td.jsx)(WB,{className:f,value:x,onChange:h,colors:o,disableCustomColors:i,__experimentalIsRenderedInSidebar:n,clearable:!1,enableAlpha:s}),a&&u&&(0,Td.jsx)(gT,{label:(0,H.__)("Style"),value:w,onChange:p})]})}),A&&(0,Td.jsx)(FB,{paddingSize:"none",children:(0,Td.jsx)(Zv.Ay,{className:g,variant:"tertiary",onClick:()=>{d(),e()},children:(0,H.__)("Reset")})})]}),popoverProps:{...v},..._,ref:t})}),"BorderControlDropdown"),rR=nR,oR=e=>void 0!==e?.width&&""!==e.width||void 0!==e?.color;const iR=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,Td.jsx)(GA.A,{as:"legend",children:t}):(0,Td.jsx)(rA.Gw,{as:"legend",children:t}):null},sR=(0,V_.KZ)(((e,t)=>{const{__next40pxDefaultSize:n=!1,colors:r,disableCustomColors:o,disableUnits:i,enableAlpha:s,enableStyle:a,hideLabelFromVision:l,innerWrapperClassName:c,inputWidth:u,isStyleSettable:d,label:h,onBorderChange:p,onSliderChange:f,onWidthChange:m,placeholder:g,__unstablePopoverProps:b,previousStyleSelection:y,showDropdownHeader:v,size:_,sliderClassName:x,value:w,widthUnit:k,widthValue:C,withSlider:A,__experimentalIsRenderedInSidebar:E,...I}=function(e){const{className:t,colors:n=[],isCompact:r,onChange:o,enableAlpha:i=!0,enableStyle:s=!0,shouldSanitizeBorder:a=!0,size:l="default",value:c,width:u,__experimentalIsRenderedInSidebar:d=!1,__next40pxDefaultSize:h,...p}=(0,U_.A)(e,"BorderControl"),f="default"===l&&h?"__unstable-large":l,[m,g]=Ww(c?.width),b=g||"px",y=0===m,[v,_]=(0,S.useState)(),[x,w]=(0,S.useState)(),k=!a||oR(c),C=(0,S.useCallback)((e=>{!a||oR(e)?o(e):o(void 0)}),[o,a]),A=(0,S.useCallback)((e=>{const t=""===e?void 0:e,[n]=Ww(e),r=0===n,o={...c,width:t};r&&!y&&(_(c?.color),w(c?.style),o.color=void 0,o.style="none"),!r&&y&&(void 0===o.color&&(o.color=v),"none"===o.style&&(o.style=x)),C(o)}),[c,y,v,x,C]),E=(0,S.useCallback)((e=>{A(`${e}${b}`)}),[A,b]),I=(0,H_.l)(),j=(0,S.useMemo)((()=>I(KB,t)),[t,I]);let T=u;r&&(T="__unstable-large"===l?"116px":"90px");const B=(0,S.useMemo)((()=>{const e=!!T&&YB,t=(e=>(0,G_.css)("height:","__unstable-large"===e?"40px":"30px",";",""))(f);return I((0,G_.css)(Xw,"{flex:1 1 40%;}&& ",tk,"{min-height:0;}",""),e,t)}),[T,I,f]),R=(0,S.useMemo)((()=>I((0,G_.css)("flex:1 1 60%;",(0,qw.h)({marginRight:(0,Jw.x)(3)})(),";",""))),[I]);return{...p,className:j,colors:n,enableAlpha:i,enableStyle:s,innerWrapperClassName:B,inputWidth:T,isStyleSettable:k,onBorderChange:C,onSliderChange:E,onWidthChange:A,previousStyleSelection:x,sliderClassName:R,value:c,widthUnit:b,widthValue:m,size:f,__experimentalIsRenderedInSidebar:d,__next40pxDefaultSize:h}}(e);return(0,Td.jsxs)(px.A,{as:"fieldset",...I,ref:t,children:[(0,Td.jsx)(iR,{label:h,hideLabelFromVision:l}),(0,Td.jsxs)(tA.A,{spacing:4,className:c,children:[(0,Td.jsx)(ak,{prefix:(0,Td.jsx)(rR,{border:w,colors:r,__unstablePopoverProps:b,disableCustomColors:o,enableAlpha:s,enableStyle:a,isStyleSettable:d,onChange:p,previousStyleSelection:y,showDropdownHeader:v,__experimentalIsRenderedInSidebar:E,size:_}),label:(0,H.__)("Border width"),hideLabelFromVision:!0,min:0,onChange:m,value:w?.width||"",placeholder:g,disableUnits:i,__unstableInputWidth:u,size:_}),A&&(0,Td.jsx)(FC,{__nextHasNoMarginBottom:!0,label:(0,H.__)("Border width"),hideLabelFromVision:!0,className:x,initialPosition:0,max:100,min:0,onChange:f,step:["px","%"].includes(k)?1:.1,value:C||void 0,withInputField:!1,__next40pxDefaultSize:n})]})]})}),"BorderControl"),aR=sR;const lR=(0,V_.KZ)(((e,t)=>{const{centeredClassName:n,colors:r,disableCustomColors:o,enableAlpha:i,enableStyle:s,onChange:a,popoverPlacement:l,popoverOffset:c,rightAlignedClassName:u,size:d="default",value:h,__experimentalIsRenderedInSidebar:p,...f}=function(e){const{className:t,colors:n=[],enableAlpha:r=!1,enableStyle:o=!0,size:i="default",__experimentalIsRenderedInSidebar:s=!1,...a}=(0,U_.A)(e,"BorderBoxControlSplitControls"),l=(0,H_.l)(),c=(0,S.useMemo)((()=>l((e=>(0,G_.css)("position:relative;flex:1;width:","__unstable-large"===e?void 0:"80%",";",""))(i),t)),[l,t,i]);return{...a,centeredClassName:(0,S.useMemo)((()=>l(aT,t)),[l,t]),className:c,colors:n,enableAlpha:r,enableStyle:o,rightAlignedClassName:(0,S.useMemo)((()=>l((0,G_.css)((0,qw.h)({marginLeft:"auto"})(),";",""),t)),[l,t]),size:i,__experimentalIsRenderedInSidebar:s}}(e),[m,g]=(0,S.useState)(null),b=(0,S.useMemo)((()=>l?{placement:l,offset:c,anchor:m,shift:!0}:void 0),[l,c,m]),y={colors:r,disableCustomColors:o,enableAlpha:i,enableStyle:s,isCompact:!0,__experimentalIsRenderedInSidebar:p,size:d},v=(0,eC.A)([g,t]);return(0,Td.jsxs)(_A,{...f,ref:v,gap:4,children:[(0,Td.jsx)(cT,{value:h,size:d}),(0,Td.jsx)(aR,{className:n,hideLabelFromVision:!0,label:(0,H.__)("Top border"),onChange:e=>a(e,"top"),__unstablePopoverProps:b,value:h?.top,...y}),(0,Td.jsx)(aR,{hideLabelFromVision:!0,label:(0,H.__)("Left border"),onChange:e=>a(e,"left"),__unstablePopoverProps:b,value:h?.left,...y}),(0,Td.jsx)(aR,{className:u,hideLabelFromVision:!0,label:(0,H.__)("Right border"),onChange:e=>a(e,"right"),__unstablePopoverProps:b,value:h?.right,...y}),(0,Td.jsx)(aR,{className:n,hideLabelFromVision:!0,label:(0,H.__)("Bottom border"),onChange:e=>a(e,"bottom"),__unstablePopoverProps:b,value:h?.bottom,...y})]})}),"BorderBoxControlSplitControls"),cR=lR;function uR(e){const{className:t,colors:n=[],onChange:r,enableAlpha:o=!1,enableStyle:i=!0,size:s="default",value:a,__experimentalIsRenderedInSidebar:l=!1,__next40pxDefaultSize:c,...u}=(0,U_.A)(e,"BorderBoxControl"),d="default"===s&&c?"__unstable-large":s,h=Yj(a),p=Kj(a),f=p?(e=>{if(!e)return;const t=[],n=[],r=[];$j.forEach((o=>{t.push(e[o]?.color),n.push(e[o]?.style),r.push(e[o]?.width)}));const o=t.every((e=>e===t[0])),i=n.every((e=>e===n[0])),s=r.every((e=>e===r[0]));return{color:o?t[0]:void 0,style:i?n[0]:void 0,width:s?r[0]:Xj(r)}})(a):a,m=p?a:(e=>{if(e&&!Gj(e))return{top:e,right:e,bottom:e,left:e}})(a),g=!isNaN(parseFloat(`${f?.width}`)),[b,y]=(0,S.useState)(!h),v=(0,H_.l)(),_=(0,S.useMemo)((()=>v(oT,t)),[v,t]),x=(0,S.useMemo)((()=>v((0,G_.css)("flex:1;",(0,qw.h)({marginRight:"24px"})(),";",""))),[v]),w=(0,S.useMemo)((()=>v(iT)),[v]);return{...u,className:_,colors:n,disableUnits:h&&!g,enableAlpha:o,enableStyle:i,hasMixedBorders:h,isLinked:b,linkedControlClassName:x,onLinkedChange:e=>{if(!e)return r(void 0);if(!h||(t=e)&&Wj.every((e=>void 0!==t[e])))return r(Gj(e)?void 0:e);var t;const n=((e,t)=>{const n={};return e.color!==t.color&&(n.color=t.color),e.style!==t.style&&(n.style=t.style),e.width!==t.width&&(n.width=t.width),n})(f,e),o={top:{...a?.top,...n},right:{...a?.right,...n},bottom:{...a?.bottom,...n},left:{...a?.left,...n}};if(Yj(o))return r(o);const i=Gj(o.top)?void 0:o.top;r(i)},onSplitChange:(e,t)=>{const n={...m,[t]:e};Yj(n)?r(n):r(e)},toggleLinked:()=>y(!b),linkedValue:f,size:d,splitValue:m,wrapperClassName:w,__experimentalIsRenderedInSidebar:l}}const dR=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,Td.jsx)(GA.A,{as:"label",children:t}):(0,Td.jsx)(rA.Gw,{children:t}):null},hR=(0,V_.KZ)(((e,t)=>{const{className:n,colors:r,disableCustomColors:o,disableUnits:i,enableAlpha:s,enableStyle:a,hasMixedBorders:l,hideLabelFromVision:c,isLinked:u,label:d,linkedControlClassName:h,linkedValue:p,onLinkedChange:f,onSplitChange:m,popoverPlacement:g,popoverOffset:b,size:y,splitValue:v,toggleLinked:_,wrapperClassName:x,__experimentalIsRenderedInSidebar:w,...k}=uR(e),[C,A]=(0,S.useState)(null),E=(0,S.useMemo)((()=>g?{placement:g,offset:b,anchor:C,shift:!0}:void 0),[g,b,C]),I=(0,eC.A)([A,t]);return(0,Td.jsxs)(px.A,{className:n,...k,ref:I,children:[(0,Td.jsx)(dR,{label:d,hideLabelFromVision:c}),(0,Td.jsxs)(px.A,{className:x,children:[u?(0,Td.jsx)(aR,{className:h,colors:r,disableUnits:i,disableCustomColors:o,enableAlpha:s,enableStyle:a,onChange:f,placeholder:l?(0,H.__)("Mixed"):void 0,__unstablePopoverProps:E,shouldSanitizeBorder:!1,value:p,withSlider:!0,width:"__unstable-large"===y?"116px":"110px",__experimentalIsRenderedInSidebar:w,size:y}):(0,Td.jsx)(cR,{colors:r,disableCustomColors:o,enableAlpha:s,enableStyle:a,onChange:m,popoverPlacement:g,popoverOffset:b,value:v,__experimentalIsRenderedInSidebar:w,size:y}),(0,Td.jsx)(lT,{onClick:_,isLinked:u,size:y})]})]})}),"BorderBoxControl"),pR=hR;function fR(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function mR(e={}){const{flat:t,...n}=e;return t||fR(Object.values(n).filter(Boolean))||"px"}function gR(e={}){if("string"==typeof e)return e;const t=Object.values(e).map((e=>Ww(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),r=t.map((e=>e[1])),o=n.every((e=>e===n[0]))?n[0]:"",i=fR(r);return 0===o||o?`${o}${i}`:void 0}function bR(e={}){const t=gR(e);return"string"!=typeof e&&isNaN(parseFloat(t))}function yR(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function vR({onChange:e,selectedUnits:t,setSelectedUnits:n,values:r,...o}){let i=gR(r);void 0===i&&(i=mR(t));const s=yR(r)&&bR(r),a=s?(0,H.__)("Mixed"):null;return(0,Td.jsx)(ak,{...o,"aria-label":(0,H.__)("Border radius"),disableUnits:s,isOnly:!0,value:i,onChange:t=>{const n=!isNaN(parseFloat(t));e(n?t:void 0)},onUnitChange:e=>{n({topLeft:e,topRight:e,bottomLeft:e,bottomRight:e})},placeholder:a,size:"__unstable-large"})}const _R={topLeft:(0,H.__)("Top left"),topRight:(0,H.__)("Top right"),bottomLeft:(0,H.__)("Bottom left"),bottomRight:(0,H.__)("Bottom right")};function xR({onChange:e,selectedUnits:t,setSelectedUnits:n,values:r,...o}){const i=t=>n=>{if(!e)return;const r=isNaN(parseFloat(n))?void 0:n;e({...s,[t]:r})},s="string"!=typeof r?r:{topLeft:r,topRight:r,bottomLeft:r,bottomRight:r};return(0,Td.jsx)("div",{className:"components-border-radius-control__input-controls-wrapper",children:Object.entries(_R).map((([e,r])=>{const[a,l]=Ww(s[e]),c=s[e]?l:t[e]||t.flat;return(0,Td.jsx)(Dx.Ay,{text:r,placement:"top",children:(0,Td.jsx)("div",{className:"components-border-radius-control__tooltip-wrapper",children:(0,Td.jsx)(ak,{...o,"aria-label":r,value:[a,c].join(""),onChange:i(e),onUnitChange:(u=e,e=>{const r={...t};r[u]=e,n(r)}),size:"__unstable-large"})})},e);var u}))})}function wR({isLinked:e,...t}){const n=e?(0,H.__)("Unlink radii"):(0,H.__)("Link radii");return(0,Td.jsx)(Dx.Ay,{text:n,children:(0,Td.jsx)(Zv.Ay,{...t,className:"component-border-radius-control__linked-button",size:"small",icon:e?rT.A:ZI.A,iconSize:24,"aria-label":n})})}const kR={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},CR=0,SR={px:100,em:20,rem:20};function AR({onChange:e,values:t}){const[n,r]=(0,S.useState)(!yR(t)||!bR(t)),[o,i]=(0,S.useState)({flat:"string"==typeof t?Ww(t)[1]:void 0,topLeft:Ww(t?.topLeft)[1],topRight:Ww(t?.topRight)[1],bottomLeft:Ww(t?.bottomLeft)[1],bottomRight:Ww(t?.bottomRight)[1]}),[s]=fv("spacing.units"),a=Gw({availableUnits:s||["px","em","rem"]}),l=mR(o),c=a&&a.find((e=>e.value===l)),u=c?.step||1,[d]=Ww(gR(t));return(0,Td.jsxs)("fieldset",{className:"components-border-radius-control",children:[(0,Td.jsx)($_.Ay.VisualLabel,{as:"legend",children:(0,H.__)("Radius")}),(0,Td.jsxs)("div",{className:"components-border-radius-control__wrapper",children:[n?(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(vR,{className:"components-border-radius-control__unit-control",values:t,min:CR,onChange:e,selectedUnits:o,setSelectedUnits:i,units:a}),(0,Td.jsx)(FC,{label:(0,H.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=d?d:"",min:CR,max:SR[l],initialPosition:0,withInputField:!1,onChange:t=>{e(void 0!==t?`${t}${l}`:void 0)},step:u,__nextHasNoMarginBottom:!0})]}):(0,Td.jsx)(xR,{min:CR,onChange:e,selectedUnits:o,setSelectedUnits:i,values:t||kR,units:a}),(0,Td.jsx)(wR,{onClick:()=>r(!n),isLinked:n})]})]})}var ER=n(77582);const IR=[],{CompositeItemV2:jR,CompositeV2:TR,useCompositeStoreV2:BR}=Cf(d_.j);function RR({shadow:e,onShadowChange:t,settings:n}){const r=PR(n);return(0,Td.jsx)("div",{className:"block-editor-global-styles__shadow-popover-container",children:(0,Td.jsxs)(oE.A,{spacing:4,children:[(0,Td.jsx)(nA.A,{level:5,children:(0,H.__)("Drop shadow")}),(0,Td.jsx)(NR,{presets:r,activeShadow:e,onSelect:t}),(0,Td.jsx)("div",{className:"block-editor-global-styles__clear-shadow",children:(0,Td.jsx)(Zv.Ay,{variant:"tertiary",onClick:()=>t(void 0),children:(0,H.__)("Clear")})})]})})}function NR({presets:e,activeShadow:t,onSelect:n}){const r=BR();return e?(0,Td.jsx)(TR,{store:r,role:"listbox",className:"block-editor-global-styles__shadow__list","aria-label":(0,H.__)("Drop shadows"),children:e.map((({name:e,slug:r,shadow:o})=>(0,Td.jsx)(DR,{label:e,isActive:o===t,type:"unset"===r?"unset":"preset",onSelect:()=>n(o===t?void 0:o),shadow:o},r)))}):null}function DR({type:e,label:t,isActive:n,onSelect:r,shadow:o}){return(0,Td.jsx)(jR,{role:"option","aria-label":t,"aria-selected":n,className:(0,$v.A)("block-editor-global-styles__shadow__item",{"is-active":n}),render:(0,Td.jsx)(Zv.Ay,{className:(0,$v.A)("block-editor-global-styles__shadow-indicator",{unset:"unset"===e}),onClick:r,label:t,style:{boxShadow:o},showTooltip:!0,children:n&&(0,Td.jsx)(lk.A,{icon:ZS.A})})})}function MR({shadow:e,onShadowChange:t,settings:n}){return(0,Td.jsx)(PE.A,{popoverProps:{placement:"left-start",offset:36,shift:!0},className:"block-editor-global-styles__shadow-dropdown",renderToggle:({onToggle:e,isOpen:t})=>{const n={onClick:e,className:(0,$v.A)({"is-open":t}),"aria-expanded":t};return(0,Td.jsx)(Zv.Ay,{...n,children:(0,Td.jsxs)(tA.A,{justify:"flex-start",children:[(0,Td.jsx)(lk.A,{className:"block-editor-global-styles__toggle-icon",icon:ER.A,size:24}),(0,Td.jsx)(R_.A,{children:(0,H.__)("Drop shadow")})]})})},renderContent:()=>(0,Td.jsx)(FB,{paddingSize:"medium",children:(0,Td.jsx)(RR,{shadow:e,onShadowChange:t,settings:n})})})}function PR(e){return(0,S.useMemo)((()=>{var t;if(!e?.shadow)return IR;const n=e?.shadow?.defaultPresets,{default:r,theme:o,custom:i}=null!==(t=e?.shadow?.presets)&&void 0!==t?t:{},s={name:(0,H.__)("Unset"),slug:"unset",shadow:"none"},a=[...n&&r||IR,...o||IR,...i||IR];return a.length&&a.unshift(s),a}),[e])}function OR(e){return Object.values(LR(e)).some(Boolean)}function LR(e){return{hasBorderColor:FR(e),hasBorderRadius:zR(e),hasBorderStyle:UR(e),hasBorderWidth:VR(e),hasShadow:HR(e)}}function FR(e){return e?.border?.color}function zR(e){return e?.border?.radius}function UR(e){return e?.border?.style}function VR(e){return e?.border?.width}function HR(e){const t=PR(e);return!!e?.shadow&&t.length>0}function $R({resetAllFilter:e,onChange:t,value:n,panelId:r,children:o,label:i}){return(0,Td.jsx)(wA,{label:i,resetAll:()=>{const r=e(n);t(r)},panelId:r,dropdownMenuProps:jv,children:o})}const WR={radius:!0,color:!0,width:!0,shadow:!0};function GR({as:e=$R,value:t,onChange:n,inheritedValue:r=t,settings:o,panelId:i,name:s,defaultControls:a=WR}){var l,c,u,d;const h=Vv(o),p=(0,S.useCallback)((e=>Bv({settings:o},"",e)),[o]),f=e=>{const t=h.flatMap((({colors:e})=>e)).find((({color:t})=>t===e));return t?"var:preset|color|"+t.slug:e},m=(0,S.useMemo)((()=>{if(Kj(r?.border)){const e={...r?.border};return["top","right","bottom","left"].forEach((t=>{e[t]={...e[t],color:p(e[t]?.color)}})),e}return{...r?.border,color:r?.border?.color?p(r?.border?.color):void 0}}),[r?.border,p]),g=e=>n({...t,border:e}),b=FR(o),y=UR(o),v=VR(o),_=zR(o),x=p(m?.radius),w=e=>g({...m,radius:e}),k=()=>{const e=t?.border?.radius;return"object"==typeof e?Object.entries(e).some(Boolean):!!e},C=HR(o),A=p(r?.shadow),E=null!==(l=o?.shadow?.presets)&&void 0!==l?l:{},I=null!==(c=null!==(u=null!==(d=E.custom)&&void 0!==d?d:E.theme)&&void 0!==u?u:E.default)&&void 0!==c?c:[],j=e=>{const r=I?.find((({shadow:t})=>t===e))?.slug;n(Lf(t,["shadow"],r?`var:preset|shadow|${r}`:e||void 0))},T=(0,S.useCallback)((e=>({...e,border:void 0,shadow:void 0})),[]),B=a?.color||a?.width,R=b||y||v||_,N=rN({blockName:s,hasShadowControl:C,hasBorderControl:R});return(0,Td.jsxs)(e,{resetAllFilter:T,value:t,onChange:n,panelId:i,label:N,children:[(v||b)&&(0,Td.jsx)(YA,{hasValue:()=>qj(t?.border),label:(0,H.__)("Border"),onDeselect:()=>(()=>{if(k())return g({radius:t?.border?.radius});g(void 0)})(),isShownByDefault:B,panelId:i,children:(0,Td.jsx)(pR,{colors:h,enableAlpha:!0,enableStyle:y,onChange:e=>{const t={...e};Kj(t)?["top","right","bottom","left"].forEach((e=>{t[e]&&(t[e]={...t[e],color:f(t[e]?.color)})})):t&&(t.color=f(t.color)),g({radius:m?.radius,...t})},popoverOffset:40,popoverPlacement:"left-start",value:m,__experimentalIsRenderedInSidebar:!0,size:"__unstable-large",hideLabelFromVision:!C,label:(0,H.__)("Border")})}),_&&(0,Td.jsx)(YA,{hasValue:k,label:(0,H.__)("Radius"),onDeselect:()=>w(void 0),isShownByDefault:a.radius,panelId:i,children:(0,Td.jsx)(AR,{values:x,onChange:e=>{w(e||void 0)}})}),C&&(0,Td.jsxs)(YA,{label:(0,H.__)("Shadow"),hasValue:()=>!!t?.shadow,onDeselect:()=>j(void 0),isShownByDefault:a.shadow,panelId:i,children:[R?(0,Td.jsx)($_.Ay.VisualLabel,{as:"legend",children:(0,H.__)("Shadow")}):null,(0,Td.jsx)($A,{isBordered:!0,isSeparated:!0,children:(0,Td.jsx)(MR,{shadow:A,onShadowChange:j,settings:o})})]})]})}const qR="__experimentalBorder",KR="shadow",YR=(e,t,n)=>{let r;return e.some((e=>e.colors.some((e=>e[t]===n&&(r=e,!0))))),r},JR=({colors:e,namedColor:t,customColor:n})=>{if(t){const n=YR(e,"slug",t);if(n)return n}if(!n)return{color:void 0};return YR(e,"color",n)||{color:n}};function XR(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function ZR(e){if(Kj(e?.border))return{style:e,borderColor:void 0};const t=e?.border?.color,n=t?.startsWith("var:preset|color|")?t.substring(17):void 0,r={...e};return r.border={...r.border,color:n?void 0:t},{style:Wv(r),borderColor:n}}function QR(e){return Kj(e.style?.border)?e.style:{...e.style,border:{...e.style?.border,color:e.borderColor?"var:preset|color|"+e.borderColor:e.style?.border?.color}}}function eN({label:e,children:t,resetAllFilter:n}){const r=(0,S.useCallback)((e=>{const t=QR(e),r=n(t);return{...e,...ZR(r)}}),[n]);return(0,Td.jsx)(IA,{group:"border",resetAllFilter:r,label:e,children:t})}function tN({clientId:e,name:t,setAttributes:n,settings:r}){const o=OR(r),{style:i,borderColor:s}=(0,Ul.A)((function(t){const{style:n,borderColor:r}=t(hv).getBlockAttributes(e)||{};return{style:n,borderColor:r}}),[e]),a=(0,S.useMemo)((()=>QR({style:i,borderColor:s})),[i,s]);if(!o)return null;const l={...Ec(t,[qR,"__experimentalDefaultControls"]),...Ec(t,[KR,"__experimentalDefaultControls"])};return(0,Td.jsx)(GR,{as:eN,panelId:e,settings:r,value:a,onChange:e=>{n(ZR(e))},defaultControls:l})}function nN(e,t="any"){if("web"!==Lh.A.OS)return!1;const n=Ec(e,qR);return!0===n||("any"===t?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t])}function rN({blockName:e,hasBorderControl:t,hasShadowControl:n}={}){const r=LR(Jv(e));return t||n||!e||(t=r?.hasBorderColor||r?.hasBorderStyle||r?.hasBorderWidth||r?.hasBorderRadius,n=r?.hasShadow),t&&n?(0,H.__)("Border & Shadow"):n?(0,H.__)("Shadow"):(0,H.__)("Border")}function oN(e,t,n){if(!nN(t,"color")||qv(t,qR,"color"))return e;const r=iN(n),o=(0,$v.A)(e.className,r);return e.className=o||void 0,e}function iN(e){const{borderColor:t,style:n}=e,r=tT("border-color",t);return(0,$v.A)({"has-border-color":t||n?.border?.color,[r]:!!r})}const sN={useBlockProps:function({name:e,borderColor:t,style:n}){const{colors:r}=nT();if(!nN(e,"color")||qv(e,qR,"color"))return{};const{color:o}=JR({colors:r,namedColor:t}),{color:i}=JR({colors:r,namedColor:XR(n?.border?.top?.color)}),{color:s}=JR({colors:r,namedColor:XR(n?.border?.right?.color)}),{color:a}=JR({colors:r,namedColor:XR(n?.border?.bottom?.color)}),{color:l}=JR({colors:r,namedColor:XR(n?.border?.left?.color)});return oN({style:Wv({borderTopColor:i||o,borderRightColor:s||o,borderBottomColor:a||o,borderLeftColor:l||o})||{}},e,{borderColor:t,style:n})},addSaveProps:oN,attributeKeys:["borderColor","style"],hasSupport:e=>nN(e,"color")};(0,Tu.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return nN(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e}));var aN=n(7652);const lN=(0,W_.default)("div",{target:"ebn2ljm1"})("&:not( :first-of-type ){",(({offsetAmount:e})=>(0,G_.css)({marginInlineStart:e},"","")),";}",(({zIndex:e})=>(0,G_.css)({zIndex:e},"","")),";");var cN={name:"rs0gp6",styles:"grid-row-start:1;grid-column-start:1"};const uN=(0,W_.default)("div",{target:"ebn2ljm0"})("display:inline-grid;grid-auto-flow:column;position:relative;&>",lN,"{position:relative;justify-self:start;",(({isLayered:e})=>e?cN:void 0),";}"),dN=(0,V_.KZ)((function(e,t){const{children:n,className:r,isLayered:o=!0,isReversed:i=!1,offset:s=0,...a}=(0,U_.A)(e,"ZStack"),l=(0,aN.a)(n),c=l.length-1,u=l.map(((e,t)=>{const n=i?c-t:t,r=o?s*t:s,a=(0,S.isValidElement)(e)?e.key:t;return(0,Td.jsx)(lN,{offsetAmount:r,zIndex:n,children:e},a)}));return(0,Td.jsx)(uN,{...a,className:r,isLayered:o,ref:t,children:u})}),"ZStack"),hN=dN;var pN=n(78874);const fN=(0,W_.default)("div",{target:"eln3bjz3"})("border-radius:50%;border:",K_.A.borderWidth," solid ",q_.l.ui.border,";box-sizing:border-box;cursor:grab;height:",32,"px;overflow:hidden;width:",32,"px;:active{cursor:grabbing;}"),mN=(0,W_.default)("div",{target:"eln3bjz2"})({name:"1r307gh",styles:"box-sizing:border-box;position:relative;width:100%;height:100%;:focus-visible{outline:none;}"}),gN=(0,W_.default)("div",{target:"eln3bjz1"})("background:",q_.l.theme.accent,";border-radius:50%;box-sizing:border-box;display:block;left:50%;top:4px;transform:translateX( -50% );position:absolute;width:",6,"px;height:",6,"px;"),bN=(0,W_.default)(NT.A,{target:"eln3bjz0"})("color:",q_.l.theme.accent,";margin-right:",(0,Jw.x)(3),";"),yN=function({value:e,onChange:t,...n}){const r=(0,S.useRef)(null),o=(0,S.useRef)(),i=(0,S.useRef)(),s=e=>{if(void 0!==e&&(e.preventDefault(),e.target?.focus(),void 0!==o.current&&void 0!==t)){const{x:n,y:r}=o.current;t(function(e,t,n,r){const o=r-t,i=n-e,s=Math.atan2(o,i),a=Math.round(s*(180/Math.PI))+90;return a<0?360+a:a}(n,r,e.clientX,e.clientY))}},{startDrag:a,isDragging:l}=(0,iE.A)({onDragStart:e=>{(()=>{if(null===r.current)return;const e=r.current.getBoundingClientRect();o.current={x:e.x+e.width/2,y:e.y+e.height/2}})(),s(e)},onDragMove:s,onDragEnd:s});return(0,S.useEffect)((()=>{l?(void 0===i.current&&(i.current=document.body.style.cursor),document.body.style.cursor="grabbing"):(document.body.style.cursor=i.current||"",i.current=void 0)}),[l]),(0,Td.jsx)(fN,{ref:r,onMouseDown:a,className:"components-angle-picker-control__angle-circle",...n,children:(0,Td.jsx)(mN,{style:e?{transform:`rotate(${e}deg)`}:void 0,className:"components-angle-picker-control__angle-circle-indicator-wrapper",tabIndex:-1,children:(0,Td.jsx)(gN,{className:"components-angle-picker-control__angle-circle-indicator"})})})},vN=(0,S.forwardRef)((function(e,t){const{className:n,label:r=(0,H.__)("Angle"),onChange:o,value:i,...s}=e,a=(0,$v.A)("components-angle-picker-control",n),l=(0,Td.jsx)(bN,{children:"°"}),[c,u]=(0,H.isRTL)()?[l,null]:[null,l];return(0,Td.jsxs)(B_.A,{...s,ref:t,className:a,gap:2,children:[(0,Td.jsx)(pN.A,{children:(0,Td.jsx)(Kw.A,{label:r,className:"components-angle-picker-control__input-field",max:360,min:0,onChange:e=>{if(void 0===o)return;const t=void 0!==e&&""!==e?parseInt(e,10):0;o(t)},size:"__unstable-large",step:"1",value:i,spinControls:"none",prefix:c,suffix:u})}),(0,Td.jsx)(DT.A,{marginBottom:"1",marginTop:"auto",children:(0,Td.jsx)(yN,{"aria-hidden":"true",value:i,onChange:o})})]})})),_N=vN,xN=10,wN=0,kN=xN;function CN(e){return Math.max(0,Math.min(100,e))}function SN(e,t,n){const r=e.slice();return r[t]=n,r}function AN(e,t,n){return function(e,t,n,r=wN){const o=e[t].position,i=Math.min(o,n),s=Math.max(o,n);return e.some((({position:e},o)=>o!==t&&(Math.abs(e-n)<r||i<e&&e<s)))}(e,t,n)?e:SN(e,t,{...e[t],position:n})}function EN(e,t,n){return SN(e,t,{...e[t],color:n})}function IN(e,t){if(!t)return;const{x:n,width:r}=t.getBoundingClientRect(),o=e-n;return Math.round(CN(100*o/r))}function jN({isOpen:e,position:t,color:n,...r}){const o=`components-custom-gradient-picker__control-point-button-description-${(0,z_.A)(jN)}`;return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(Zv.Ay,{"aria-label":(0,H.sprintf)((0,H.__)("Gradient control point at position %1$s%% with color code %2$s."),t,n),"aria-describedby":o,"aria-haspopup":"true","aria-expanded":e,className:(0,$v.A)("components-custom-gradient-picker__control-point-button",{"is-active":e}),...r}),(0,Td.jsx)(GA.A,{id:o,children:(0,H.__)("Use your left or right arrow keys or drag and drop with the mouse to change the gradient position. Press the button to change the color or remove the control point.")})]})}function TN({isRenderedInSidebar:e,className:t,...n}){const r=(0,S.useMemo)((()=>({placement:"bottom",offset:8,resize:!1})),[]),o=(0,$v.A)("components-custom-gradient-picker__control-point-dropdown",t);return(0,Td.jsx)(HB,{isRenderedInSidebar:e,popoverProps:r,className:o,...n})}function BN({disableRemove:e,disableAlpha:t,gradientPickerDomRef:n,ignoreMarkerPosition:r,value:o,onChange:i,onStartControlPointChange:s,onStopControlPointChange:a,__experimentalIsRenderedInSidebar:l}){const c=(0,S.useRef)(),u=e=>{if(void 0===c.current||null===n.current)return;const t=IN(e.clientX,n.current),{initialPosition:r,index:s,significantMoveHappened:a}=c.current;!a&&Math.abs(r-t)>=5&&(c.current.significantMoveHappened=!0),i(AN(o,s,t))},d=()=>{window&&window.removeEventListener&&c.current&&c.current.listenersActivated&&(window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",d),a(),c.current.listenersActivated=!1)},h=(0,S.useRef)();return h.current=d,(0,S.useEffect)((()=>()=>{h.current?.()}),[]),(0,Td.jsx)(Td.Fragment,{children:o.map(((n,h)=>{const p=n?.position;return r!==p&&(0,Td.jsx)(TN,{isRenderedInSidebar:l,onClose:a,renderToggle:({isOpen:e,onToggle:t})=>(0,Td.jsx)(jN,{onClick:()=>{c.current&&c.current.significantMoveHappened||(e?a():s(),t())},onMouseDown:()=>{window&&window.addEventListener&&(c.current={initialPosition:p,index:h,significantMoveHappened:!1,listenersActivated:!0},s(),window.addEventListener("mousemove",u),window.addEventListener("mouseup",d))},onKeyDown:e=>{"ArrowLeft"===e.code?(e.stopPropagation(),i(AN(o,h,CN(n.position-kN)))):"ArrowRight"===e.code&&(e.stopPropagation(),i(AN(o,h,CN(n.position+kN))))},isOpen:e,position:n.position,color:n.color},h),renderContent:({onClose:r})=>(0,Td.jsxs)(FB,{paddingSize:"none",children:[(0,Td.jsx)(EB,{enableAlpha:!t,color:n.color,onChange:e=>{i(EN(o,h,(0,oc.Mj)(e).toRgbString()))}}),!e&&o.length>2&&(0,Td.jsx)(tA.A,{className:"components-custom-gradient-picker__remove-control-point-wrapper",alignment:"center",children:(0,Td.jsx)(Zv.Ay,{onClick:()=>{i(function(e,t){return e.filter(((e,n)=>n!==t))}(o,h)),r()},variant:"link",children:(0,H.__)("Remove Control Point")})})]}),style:{left:`${n.position}%`,transform:"translateX( -50% )"}},h)}))})}BN.InsertPoint=function({value:e,onChange:t,onOpenInserter:n,onCloseInserter:r,insertPosition:o,disableAlpha:i,__experimentalIsRenderedInSidebar:s}){const[a,l]=(0,S.useState)(!1);return(0,Td.jsx)(TN,{isRenderedInSidebar:s,className:"components-custom-gradient-picker__inserter",onClose:()=>{r()},renderToggle:({isOpen:e,onToggle:t})=>(0,Td.jsx)(Zv.Ay,{"aria-expanded":e,"aria-haspopup":"true",onClick:()=>{e?r():(l(!1),n()),t()},className:"components-custom-gradient-picker__insert-point-dropdown",icon:QS.A}),renderContent:()=>(0,Td.jsx)(FB,{paddingSize:"none",children:(0,Td.jsx)(EB,{enableAlpha:!i,onChange:n=>{a?t(function(e,t,n){const r=e.findIndex((e=>e.position===t));return EN(e,r,n)}(e,o,(0,oc.Mj)(n).toRgbString())):(t(function(e,t,n){const r=e.findIndex((e=>e.position>t)),o={color:n,position:t},i=e.slice();return i.splice(r-1,0,o),i}(e,o,(0,oc.Mj)(n).toRgbString())),l(!0))}})}),style:null!==o?{left:`${o}%`,transform:"translateX( -50% )"}:void 0})};const RN=BN,NN=(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},DN={id:"IDLE"};function MN({background:e,hasGradient:t,value:n,onChange:r,disableInserter:o=!1,disableAlpha:i=!1,__experimentalIsRenderedInSidebar:s=!1}){const a=(0,S.useRef)(null),[l,c]=(0,S.useReducer)(NN,DN),u=e=>{if(!a.current)return;const t=IN(e.clientX,a.current);n.some((({position:e})=>Math.abs(t-e)<xN))?"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,Td.jsxs)("div",{className:(0,$v.A)("components-custom-gradient-picker__gradient-bar",{"has-gradient":t}),onMouseEnter:u,onMouseMove:u,onMouseLeave:()=>{c({type:"STOP_INSERTER_MOVE"})},children:[(0,Td.jsx)("div",{className:"components-custom-gradient-picker__gradient-bar-background",style:{background:e,opacity:t?1:.4}}),(0,Td.jsxs)("div",{ref:a,className:"components-custom-gradient-picker__markers-container",children:[!o&&(d||h)&&(0,Td.jsx)(RN.InsertPoint,{__experimentalIsRenderedInSidebar:s,disableAlpha:i,insertPosition:l.insertPosition,value:n,onChange:r,onOpenInserter:()=>{c({type:"OPEN_INSERTER"})},onCloseInserter:()=>{c({type:"CLOSE_INSERTER"})}}),(0,Td.jsx)(RN,{__experimentalIsRenderedInSidebar:s,disableAlpha:i,disableRemove:o,gradientPickerDomRef:a,ignoreMarkerPosition:h?l.insertPosition:void 0,value:n,onChange:r,onStartControlPointChange:()=>{c({type:"START_CONTROL_CHANGE"})},onStopControlPointChange:()=>{c({type:"STOP_CONTROL_CHANGE"})}})]})]})}var PN=n(37328);const ON="linear-gradient(135deg, rgba(6, 147, 227, 1) 0%, rgb(155, 81, 224) 100%)",LN={type:"angular",value:"90"},FN=[{value:"linear-gradient",label:(0,H.__)("Linear")},{value:"radial-gradient",label:(0,H.__)("Radial")}],zN={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 UN({type:e,value:t,length:n}){return`${function({type:e,value:t}){return"literal"===e?t:"hex"===e?`#${t}`:`${e}(${t.join(",")})`}({type:e,value:t})} ${function(e){if(!e)return"";const{value:t,type:n}=e;return`${t}${n}`}(n)}`}function VN({type:e,orientation:t,colorStops:n}){const r=function(e){if(!Array.isArray(e)&&e&&"angular"===e.type)return`${e.value}deg`}(t);return`${e}(${[r,...n.sort(((e,t)=>{const n=e=>void 0===e?.length?.value?0:parseInt(e.length.value);return n(e)-n(t)})).map(UN)].filter(Boolean).join(",")})`}function HN(e){return void 0===e.length||"%"!==e.length.type}function $N(e){switch(e.type){case"hex":return`#${e.value}`;case"literal":return e.value;case"rgb":case"rgba":return`${e.type}(${e.value.join(",")})`;default:return"transparent"}}(0,oc.X$)([ic.A]);const WN=(0,W_.default)(pN.A,{target:"e10bzpgi1"})({name:"1gvx10y",styles:"flex-grow:5"}),GN=(0,W_.default)(pN.A,{target:"e10bzpgi0"})({name:"1gvx10y",styles:"flex-grow:5"}),qN=({gradientAST:e,hasGradient:t,onChange:n})=>{var r;const o=null!==(r=e?.orientation?.value)&&void 0!==r?r:180;return(0,Td.jsx)(_N,{onChange:t=>{n(VN({...e,orientation:{type:"angular",value:`${t}`}}))},value:t?o:""})},KN=({gradientAST:e,hasGradient:t,onChange:n})=>{const{type:r}=e;return(0,Td.jsx)(_T.A,{__nextHasNoMarginBottom:!0,className:"components-custom-gradient-picker__type-picker",label:(0,H.__)("Type"),labelPosition:"top",onChange:t=>{"linear-gradient"===t&&n(VN({...e,orientation:e.orientation?void 0:LN,type:"linear-gradient"})),"radial-gradient"===t&&(()=>{const{orientation:t,...r}=e;n(VN({...r,type:"radial-gradient"}))})()},options:FN,size:"__unstable-large",value:t?r:void 0})},YN=function({value:e,onChange:t,__experimentalIsRenderedInSidebar:n=!1}){const{gradientAST:r,hasGradient:o}=function(e){let t,n=!!e;const r=null!=e?e:ON;try{t=PN.parse(r)[0]}catch(e){console.warn("wp.components.CustomGradientPicker failed to parse the gradient with error",e),t=PN.parse(ON)[0],n=!1}if(Array.isArray(t.orientation)||"directional"!==t.orientation?.type||(t.orientation={type:"angular",value:zN[t.orientation.value].toString()}),t.colorStops.some(HN)){const{colorStops:e}=t,n=100/(e.length-1);e.forEach(((e,t)=>{e.length={value:""+n*t,type:"%"}}))}return{gradientAST:t,hasGradient:n}}(e),i=function(e){return VN({type:"linear-gradient",orientation:LN,colorStops:e.colorStops})}(r),s=r.colorStops.map((e=>({color:$N(e),position:parseInt(e.length.value)})));return(0,Td.jsxs)(oE.A,{spacing:4,className:"components-custom-gradient-picker",children:[(0,Td.jsx)(MN,{__experimentalIsRenderedInSidebar:n,background:i,hasGradient:o,value:s,onChange:e=>{t(VN(function(e,t){return{...e,colorStops:t.map((({position:e,color:t})=>{const{r:n,g:r,b:o,a:i}=(0,oc.Mj)(t).toRgb();return{length:{type:"%",value:e?.toString()},type:i<1?"rgba":"rgb",value:i<1?[`${n}`,`${r}`,`${o}`,`${i}`]:[`${n}`,`${r}`,`${o}`]}}))}}(r,e)))}}),(0,Td.jsxs)(B_.A,{gap:3,className:"components-custom-gradient-picker__ui-line",children:[(0,Td.jsx)(WN,{children:(0,Td.jsx)(KN,{gradientAST:r,hasGradient:o,onChange:t})}),(0,Td.jsx)(GN,{children:"linear-gradient"===r.type&&(0,Td.jsx)(qN,{gradientAST:r,hasGradient:o,onChange:t})})]})]})};function JN({className:e,clearGradient:t,gradients:n,onChange:r,value:o,...i}){const s=(0,S.useMemo)((()=>n.map((({gradient:e,name:n,slug:i},s)=>(0,Td.jsx)(MB.Option,{value:e,isSelected:o===e,tooltipText:n||(0,H.sprintf)((0,H.__)("Gradient code: %s"),e),style:{color:"rgba( 0,0,0,0 )",background:e},onClick:o===e?t:()=>r(e,s),"aria-label":n?(0,H.sprintf)((0,H.__)("Gradient: %s"),n):(0,H.sprintf)((0,H.__)("Gradient code: %s"),e)},i)))),[n,o,r,t]);return(0,Td.jsx)(MB.OptionGroup,{className:e,options:s,...i})}function XN({className:e,clearGradient:t,gradients:n,onChange:r,value:o,headingLevel:i}){const s=(0,z_.A)(XN);return(0,Td.jsx)(oE.A,{spacing:3,className:e,children:n.map((({name:e,gradients:n},a)=>{const l=`color-palette-${s}-${a}`;return(0,Td.jsxs)(oE.A,{spacing:2,children:[(0,Td.jsx)(PB,{level:i,id:l,children:e}),(0,Td.jsx)(JN,{clearGradient:t,gradients:n,onChange:e=>r(e,a),value:o,"aria-labelledby":l})]},a)}))})}function ZN(e){const{asButtons:t,loop:n,actions:r,headingLevel:o,"aria-label":i,"aria-labelledby":s,...a}=e,l=(c=e.gradients).length>0&&c.every((e=>{return t=e,Array.isArray(t.gradients)&&!("gradient"in t);var t}))?(0,Td.jsx)(XN,{headingLevel:o,...a}):(0,Td.jsx)(JN,{...a});var c;let u;if(t)u={asButtons:!0};else{const e={asButtons:!1,loop:n};u=i?{...e,"aria-label":i}:s?{...e,"aria-labelledby":s}:{...e,"aria-label":(0,H.__)("Custom color picker.")}}return(0,Td.jsx)(MB,{...u,actions:r,options:l})}const QN=function({className:e,gradients:t=[],onChange:n,value:r,clearable:o=!0,disableCustomGradients:i=!1,__experimentalIsRenderedInSidebar:s,headingLevel:a=2,...l}){const c=(0,S.useCallback)((()=>n(void 0)),[n]);return(0,Td.jsxs)(oE.A,{spacing:t.length?4:0,children:[!i&&(0,Td.jsx)(YN,{__experimentalIsRenderedInSidebar:s,value:r,onChange:n}),(t.length>0||o)&&(0,Td.jsx)(ZN,{...l,className:e,clearGradient:c,gradients:t,onChange:n,value:r,actions:o&&!i&&(0,Td.jsx)(MB.ButtonAction,{onClick:c,children:(0,H.__)("Clear")}),headingLevel:a})]})},{Tabs:eD}=Cf(d_.j),tD=["colors","disableCustomColors","gradients","disableCustomGradients"],nD={color:"color",gradient:"gradient"};function rD({colors:e,gradients:t,disableCustomColors:n,disableCustomGradients:r,__experimentalIsRenderedInSidebar:o,className:i,label:s,onColorChange:a,onGradientChange:l,colorValue:c,gradientValue:u,clearable:d,showTitle:h=!0,enableAlpha:p,headingLevel:f}){const m=a&&(e&&e.length>0||!n),g=l&&(t&&t.length>0||!r);if(!m&&!g)return null;const b={[nD.color]:(0,Td.jsx)(WB,{value:c,onChange:g?e=>{a(e),l()}:a,colors:e,disableCustomColors:n,__experimentalIsRenderedInSidebar:o,clearable:d,enableAlpha:p,headingLevel:f}),[nD.gradient]:(0,Td.jsx)(QN,{value:u,onChange:m?e=>{l(e),a()}:l,gradients:t,disableCustomGradients:r,__experimentalIsRenderedInSidebar:o,clearable:d,headingLevel:f})},y=e=>(0,Td.jsx)("div",{className:"block-editor-color-gradient-control__panel",children:b[e]});return(0,Td.jsx)($_.Ay,{__nextHasNoMarginBottom:!0,className:(0,$v.A)("block-editor-color-gradient-control",i),children:(0,Td.jsx)("fieldset",{className:"block-editor-color-gradient-control__fieldset",children:(0,Td.jsxs)(oE.A,{spacing:1,children:[h&&(0,Td.jsx)("legend",{children:(0,Td.jsx)("div",{className:"block-editor-color-gradient-control__color-indicator",children:(0,Td.jsx)($_.Ay.VisualLabel,{children:s})})}),m&&g&&(0,Td.jsx)("div",{children:(0,Td.jsxs)(eD,{defaultTabId:u?nD.gradient:!!m&&nD.color,children:[(0,Td.jsxs)(eD.TabList,{children:[(0,Td.jsx)(eD.Tab,{tabId:nD.color,children:(0,H.__)("Color")}),(0,Td.jsx)(eD.Tab,{tabId:nD.gradient,children:(0,H.__)("Gradient")})]}),(0,Td.jsx)(eD.TabPanel,{tabId:nD.color,className:"block-editor-color-gradient-control__panel",focusable:!1,children:b.color}),(0,Td.jsx)(eD.TabPanel,{tabId:nD.gradient,className:"block-editor-color-gradient-control__panel",focusable:!1,children:b.gradient})]})}),!g&&y(nD.color),!m&&y(nD.gradient)]})})})}function oD(e){const[t,n,r,o]=fv("color.palette","color.gradients","color.custom","color.customGradient");return(0,Td.jsx)(rD,{colors:t,gradients:n,disableCustomColors:!r,disableCustomGradients:!o,...e})}const iD=function(e){return tD.every((t=>e.hasOwnProperty(t)))?(0,Td.jsx)(rD,{...e}):(0,Td.jsx)(oD,{...e})};function sD(e){const t=aD(e),n=hD(e),r=lD(e),o=uD(e),i=dD(e),s=cD(e);return t||n||r||o||i||s}function aD(e){const t=Vv(e);return e?.color?.text&&(t?.length>0||e?.color?.custom)}function lD(e){const t=Vv(e);return e?.color?.link&&(t?.length>0||e?.color?.custom)}function cD(e){const t=Vv(e);return e?.color?.caption&&(t?.length>0||e?.color?.custom)}function uD(e){const t=Vv(e),n=Hv(e);return e?.color?.heading&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function dD(e){const t=Vv(e),n=Hv(e);return e?.color?.button&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function hD(e){const t=Vv(e),n=Hv(e);return e?.color?.background&&(t?.length>0||e?.color?.custom||n?.length>0||e?.color?.customGradient)}function pD({resetAllFilter:e,onChange:t,value:n,panelId:r,children:o}){return(0,Td.jsx)(wA,{label:(0,H.__)("Elements"),resetAll:()=>{const r=e(n);t(r)},panelId:r,hasInnerWrapper:!0,headingLevel:3,className:"color-block-support-panel",__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",dropdownMenuProps:jv,children:(0,Td.jsx)("div",{className:"color-block-support-panel__inner-wrapper",children:o})})}const fD={text:!0,background:!0,link:!0,heading:!0,button:!0,caption:!0},mD={placement:"left-start",offset:36,shift:!0},{Tabs:gD}=Cf(d_.j),bD=({indicators:e,label:t})=>(0,Td.jsxs)(tA.A,{justify:"flex-start",children:[(0,Td.jsx)(hN,{isLayered:!1,offset:-8,children:e.map(((e,t)=>(0,Td.jsx)(B_.A,{expanded:!1,children:(0,Td.jsx)(bT,{colorValue:e})},t)))}),(0,Td.jsx)(R_.A,{className:"block-editor-panel-color-gradient-settings__color-name",title:t,children:t})]});function yD({isGradient:e,inheritedValue:t,userValue:n,setValue:r,colorGradientControlSettings:o}){return(0,Td.jsx)(iD,{...o,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:e?void 0:t,gradientValue:e?t:void 0,onColorChange:e?void 0:r,onGradientChange:e?r:void 0,clearable:t===n,headingLevel:3})}function vD({label:e,hasValue:t,resetValue:n,isShownByDefault:r,indicators:o,tabs:i,colorGradientControlSettings:s,panelId:a}){var l;const c=i.find((e=>void 0!==e.userValue)),{key:u,...d}=null!==(l=i[0])&&void 0!==l?l:{};return(0,Td.jsx)(YA,{className:"block-editor-tools-panel-color-gradient-settings__item",hasValue:t,label:e,onDeselect:n,isShownByDefault:r,panelId:a,children:(0,Td.jsx)(PE.A,{popoverProps:mD,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:t,isOpen:n})=>{const r={onClick:t,className:(0,$v.A)("block-editor-panel-color-gradient-settings__dropdown",{"is-open":n}),"aria-expanded":n,"aria-label":(0,H.sprintf)((0,H.__)("Color %s styles"),e)};return(0,Td.jsx)(Zv.Ay,{...r,children:(0,Td.jsx)(bD,{indicators:o,label:e})})},renderContent:()=>(0,Td.jsx)(FB,{paddingSize:"none",children:(0,Td.jsxs)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:[1===i.length&&(0,Td.jsx)(yD,{...d,colorGradientControlSettings:s},u),i.length>1&&(0,Td.jsxs)(gD,{defaultTabId:c?.key,children:[(0,Td.jsx)(gD.TabList,{children:i.map((e=>(0,Td.jsx)(gD.Tab,{tabId:e.key,children:e.label},e.key)))}),i.map((e=>{const{key:t,...n}=e;return(0,Td.jsx)(gD.TabPanel,{tabId:t,focusable:!1,children:(0,Td.jsx)(yD,{...n,colorGradientControlSettings:s},t)},t)}))]})]})})})})}function _D({as:e=pD,value:t,onChange:n,inheritedValue:r=t,settings:o,panelId:i,defaultControls:s=fD,children:a}){const l=Vv(o),c=Hv(o),u=o?.color?.custom,d=o?.color?.customGradient,h=l.length>0||u,p=c.length>0||d,f=e=>Bv({settings:o},"",e),m=e=>{const t=l.flatMap((({colors:e})=>e)).find((({color:t})=>t===e));return t?"var:preset|color|"+t.slug:e},g=e=>{const t=c.flatMap((({gradients:e})=>e)).find((({gradient:t})=>t===e));return t?"var:preset|gradient|"+t.slug:e},b=hD(o),y=f(r?.color?.background),v=f(t?.color?.background),_=f(r?.color?.gradient),x=f(t?.color?.gradient),w=lD(o),k=f(r?.elements?.link?.color?.text),C=f(t?.elements?.link?.color?.text),A=f(r?.elements?.link?.[":hover"]?.color?.text),E=f(t?.elements?.link?.[":hover"]?.color?.text),I=aD(o),j=f(r?.color?.text),T=f(t?.color?.text),B=e=>{let r=Lf(t,["color","text"],m(e));j===k&&(r=Lf(r,["elements","link","color","text"],m(e))),n(r)},R=[{name:"caption",label:(0,H.__)("Captions"),showPanel:cD(o)},{name:"button",label:(0,H.__)("Button"),showPanel:dD(o)},{name:"heading",label:(0,H.__)("Heading"),showPanel:uD(o)},{name:"h1",label:(0,H.__)("H1"),showPanel:uD(o)},{name:"h2",label:(0,H.__)("H2"),showPanel:uD(o)},{name:"h3",label:(0,H.__)("H3"),showPanel:uD(o)},{name:"h4",label:(0,H.__)("H4"),showPanel:uD(o)},{name:"h5",label:(0,H.__)("H5"),showPanel:uD(o)},{name:"h6",label:(0,H.__)("H6"),showPanel:uD(o)}],N=(0,S.useCallback)((e=>({...e,color:void 0,elements:{...e?.elements,link:{...e?.elements?.link,color:void 0,":hover":{color:void 0}},...R.reduce(((t,n)=>({...t,[n.name]:{...e?.elements?.[n.name],color:void 0}})),{})}})),[]),D=[I&&{key:"text",label:(0,H.__)("Text"),hasValue:()=>!!T,resetValue:()=>B(void 0),isShownByDefault:s.text,indicators:[j],tabs:[{key:"text",label:(0,H.__)("Text"),inheritedValue:j,setValue:B,userValue:T}]},b&&{key:"background",label:(0,H.__)("Background"),hasValue:()=>!!v||!!x,resetValue:()=>{const e=Lf(t,["color","background"],void 0);e.color.gradient=void 0,n(e)},isShownByDefault:s.background,indicators:[null!=_?_:y],tabs:[h&&{key:"background",label:(0,H.__)("Color"),inheritedValue:y,setValue:e=>{const r=Lf(t,["color","background"],m(e));r.color.gradient=void 0,n(r)},userValue:v},p&&{key:"gradient",label:(0,H.__)("Gradient"),inheritedValue:_,setValue:e=>{const r=Lf(t,["color","gradient"],g(e));r.color.background=void 0,n(r)},userValue:x,isGradient:!0}].filter(Boolean)},w&&{key:"link",label:(0,H.__)("Link"),hasValue:()=>!!C||!!E,resetValue:()=>{let e=Lf(t,["elements","link",":hover","color","text"],void 0);e=Lf(e,["elements","link","color","text"],void 0),n(e)},isShownByDefault:s.link,indicators:[k,A],tabs:[{key:"link",label:(0,H.__)("Default"),inheritedValue:k,setValue:e=>{n(Lf(t,["elements","link","color","text"],m(e)))},userValue:C},{key:"hover",label:(0,H.__)("Hover"),inheritedValue:A,setValue:e=>{n(Lf(t,["elements","link",":hover","color","text"],m(e)))},userValue:E}]}].filter(Boolean);return R.forEach((({name:e,label:o,showPanel:i})=>{if(!i)return;const a=f(r?.elements?.[e]?.color?.background),l=f(r?.elements?.[e]?.color?.gradient),c=f(r?.elements?.[e]?.color?.text),u=f(t?.elements?.[e]?.color?.background),d=f(t?.elements?.[e]?.color?.gradient),b=f(t?.elements?.[e]?.color?.text),y="caption"!==e;D.push({key:e,label:o,hasValue:()=>!!(b||u||d),resetValue:()=>{const r=Lf(t,["elements",e,"color","background"],void 0);r.elements[e].color.gradient=void 0,r.elements[e].color.text=void 0,n(r)},isShownByDefault:s[e],indicators:y?[c,null!=l?l:a]:[c],tabs:[h&&{key:"text",label:(0,H.__)("Text"),inheritedValue:c,setValue:r=>{n(Lf(t,["elements",e,"color","text"],m(r)))},userValue:b},h&&y&&{key:"background",label:(0,H.__)("Background"),inheritedValue:a,setValue:r=>{const o=Lf(t,["elements",e,"color","background"],m(r));o.elements[e].color.gradient=void 0,n(o)},userValue:u},p&&y&&{key:"gradient",label:(0,H.__)("Gradient"),inheritedValue:l,setValue:r=>{const o=Lf(t,["elements",e,"color","gradient"],g(r));o.elements[e].color.background=void 0,n(o)},userValue:d,isGradient:!0}].filter(Boolean)})})),(0,Td.jsxs)(e,{resetAllFilter:N,value:t,onChange:n,panelId:i,children:[D.map((e=>{const{key:t,...n}=e;return(0,Td.jsx)(vD,{...n,colorGradientControlSettings:{colors:l,disableCustomColors:!u,gradients:c,disableCustomGradients:!d},panelId:i},t)})),a]})}(0,oc.X$)([ic.A,sc.A]);const xD=function({backgroundColor:e,fallbackBackgroundColor:t,fallbackTextColor:n,fallbackLinkColor:r,fontSize:o,isLargeText:i,textColor:s,linkColor:a,enableAlphaChecker:l=!1}){const c=e||t;if(!c)return null;const u=s||n,d=a||r;if(!u&&!d)return null;const h=[{color:u,description:(0,H.__)("text color")},{color:d,description:(0,H.__)("link color")}],p=(0,oc.Mj)(c),f=p.alpha()<1,m=p.brightness(),g={level:"AA",size:i||!1!==i&&o>=24?"large":"small"};let b="",y="";for(const e of h){if(!e.color)continue;const t=(0,oc.Mj)(e.color),n=t.isReadable(p,g),r=t.alpha()<1;if(!n){if(f||r)continue;b=m<t.brightness()?(0,H.sprintf)((0,H.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,H.sprintf)((0,H.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),y=(0,H.__)("This color combination may be hard for people to read.");break}r&&l&&(b=(0,H.__)("Transparent text may be hard for people to read."),y=(0,H.__)("Transparent text may be hard for people to read."))}return b?((0,Jb.speak)(y),(0,Td.jsx)("div",{className:"block-editor-contrast-checker",children:(0,Td.jsx)(YE.A,{spokenMessage:null,status:"warning",isDismissible:!1,children:b})})):null};function wD(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function kD({clientId:e}){const[t,n]=(0,S.useState)(),[r,o]=(0,S.useState)(),[i,s]=(0,S.useState)(),a=GC(e);return(0,S.useEffect)((()=>{if(!a.current)return;o(wD(a.current).color);const e=a.current?.querySelector("a");e&&e.innerText&&s(wD(e).color);let t=a.current,r=wD(t).backgroundColor;for(;"rgba(0, 0, 0, 0)"===r&&t.parentNode&&t.parentNode.nodeType===t.parentNode.ELEMENT_NODE;)t=t.parentNode,r=wD(t).backgroundColor;n(r)})),(0,Td.jsx)(xD,{backgroundColor:t,textColor:r,enableAlphaChecker:!0,linkColor:i})}const CD="color",SD=e=>{const t=Ec(e,CD);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},AD=e=>{if("web"!==Lh.A.OS)return!1;const t=Ec(e,CD);return null!==t&&"object"==typeof t&&!!t.link},ED=e=>{const t=Ec(e,CD);return null!==t&&"object"==typeof t&&!!t.gradients},ID=e=>{const t=Ec(e,CD);return t&&!1!==t.background},jD=e=>{const t=Ec(e,CD);return t&&!1!==t.text};function TD(e,t,n){if(!SD(t)||qv(t,CD))return e;const r=ED(t),{backgroundColor:o,textColor:i,gradient:s,style:a}=n,l=e=>!qv(t,CD,e),c=l("text")?tT("color",i):void 0,u=l("gradients")?function(e){if(e)return`has-${e}-gradient-background`}(s):void 0,d=l("background")?tT("background-color",o):void 0,h=l("background")||l("gradients"),p=o||a?.color?.background||r&&(s||a?.color?.gradient),f=(0,$v.A)(e.className,c,u,{[d]:!(r&&a?.color?.gradient||!d),"has-text-color":l("text")&&(i||a?.color?.text),"has-background":h&&p,"has-link-color":l("link")&&a?.elements?.link?.color});return e.className=f||void 0,e}function BD(e){const t=e?.color?.text,n=t?.startsWith("var:preset|color|")?t.substring(17):void 0,r=e?.color?.background,o=r?.startsWith("var:preset|color|")?r.substring(17):void 0,i=e?.color?.gradient,s=i?.startsWith("var:preset|gradient|")?i.substring(20):void 0,a={...e};return a.color={...a.color,text:n?void 0:t,background:o?void 0:r,gradient:s?void 0:i},{style:Wv(a),textColor:n,backgroundColor:o,gradient:s}}function RD(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 ND({children:e,resetAllFilter:t}){const n=(0,S.useCallback)((e=>{const n=RD(e),r=t(n);return{...e,...BD(r)}}),[t]);return(0,Td.jsx)(IA,{group:"color",resetAllFilter:n,children:e})}function DD({clientId:e,name:t,setAttributes:n,settings:r}){const o=sD(r),{style:i,textColor:s,backgroundColor:a,gradient:l}=(0,Ul.A)((function(t){const{style:n,textColor:r,backgroundColor:o,gradient:i}=t(hv).getBlockAttributes(e)||{};return{style:n,textColor:r,backgroundColor:o,gradient:i}}),[e]),c=(0,S.useMemo)((()=>RD({style:i,textColor:s,backgroundColor:a,gradient:l})),[i,s,a,l]);if(!o)return null;const u=Ec(t,[CD,"__experimentalDefaultControls"]),d="web"===Lh.A.OS&&!c?.color?.gradient&&(r?.color?.text||r?.color?.link)&&!1!==Ec(t,[CD,"enableContrastChecker"]);return(0,Td.jsx)(_D,{as:ND,panelId:e,settings:r,value:c,onChange:e=>{n(BD(e))},defaultControls:u,enableContrastChecker:!1!==Ec(t,[CD,"enableContrastChecker"]),children:d&&(0,Td.jsx)(kD,{clientId:e})})}const MD={useBlockProps:function({name:e,backgroundColor:t,textColor:n,gradient:r,style:o}){const[i,s,a]=fv("color.palette.custom","color.palette.theme","color.palette.default"),l=(0,S.useMemo)((()=>[...i||[],...s||[],...a||[]]),[i,s,a]);if(!SD(e)||qv(e,CD))return{};const c={};n&&!qv(e,CD,"text")&&(c.color=Qj(l,n)?.color),t&&!qv(e,CD,"background")&&(c.backgroundColor=Qj(l,t)?.color);const u=TD({style:c},e,{textColor:n,backgroundColor:t,gradient:r,style:o}),d=t||o?.color?.background||r||o?.color?.gradient;return{...u,className:(0,$v.A)(u.className,!d&&Nj(o))}},addSaveProps:TD,attributeKeys:["backgroundColor","textColor","gradient","style"],hasSupport:SD},PD={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,Tu.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return SD(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),ED(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,Tu.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,r){const o=e.name;return Gv({linkColor:AD(o),textColor:jD(o),backgroundColor:ID(o),gradient:ED(o)},PD,e,t,n,r)}));var OD=n(56875);function LD(e){const[t,...n]=e;if(!t)return null;const[,r]=Ww(t.size),o=n.every((e=>{const[,t]=Ww(e.size);return t===r}));return o?r:null}const FD=(0,W_.default)("fieldset",{target:"e8tqeku4"})({name:"1t1ytme",styles:"border:0;margin:0;padding:0"}),zD=(0,W_.default)(tA.A,{target:"e8tqeku3"})("height:",(0,Jw.x)(4),";"),UD=(0,W_.default)(Zv.Ay,{target:"e8tqeku2"})("margin-top:",(0,Jw.x)(-1),";"),VD=(0,W_.default)($_.Ay.VisualLabel,{target:"e8tqeku1"})("display:flex;gap:",(0,Jw.x)(1),";justify-content:flex-start;margin-bottom:0;"),HD=(0,W_.default)("span",{target:"e8tqeku0"})("color:",q_.l.gray[700],";");var $D=n(76502);const WD={key:"default",name:(0,H.__)("Default"),value:void 0},GD={key:"custom",name:(0,H.__)("Custom")},qD=e=>{var t;const{__next40pxDefaultSize:n,fontSizes:r,value:o,disableCustomFontSizes:i,size:s,onChange:a,onSelectCustom:l}=e,c=!!LD(r),u=[WD,...r.map((e=>{let t;if(c){const[n]=Ww(e.size);void 0!==n&&(t=String(n))}else(function(e){return/^[\d\.]+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i.test(String(e))})(e.size)&&(t=String(e.size));return{key:e.slug,name:e.name||e.slug,value:e.size,__experimentalHint:t}})),...i?[]:[GD]],d=o?null!==(t=u.find((e=>e.value===o)))&&void 0!==t?t:GD:WD;return(0,Td.jsx)($D.A,{__next40pxDefaultSize:n,className:"components-font-size-picker__select",label:(0,H.__)("Font size"),hideLabelFromVision:!0,describedBy:(0,H.sprintf)((0,H.__)("Currently selected font size: %s"),d.name),options:u,value:d,__experimentalShowSelectedHint:!0,onChange:({selectedItem:e})=>{e===GD?l():a(e.value)},size:s})},KD=[(0,H.__)("S"),(0,H.__)("M"),(0,H.__)("L"),(0,H.__)("XL"),(0,H.__)("XXL")],YD=[(0,H.__)("Small"),(0,H.__)("Medium"),(0,H.__)("Large"),(0,H.__)("Extra Large"),(0,H.__)("Extra Extra Large")],JD=e=>{const{fontSizes:t,value:n,__next40pxDefaultSize:r,size:o,onChange:i}=e;return(0,Td.jsx)(wx,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:r,label:(0,H.__)("Font size"),hideLabelFromVision:!0,value:n,onChange:i,isBlock:!0,size:o,children:t.map(((e,t)=>(0,Td.jsx)(zC,{value:e.size,label:KD[t],"aria-label":e.name||YD[t],showTooltip:!0},e.slug)))})},XD=["px","em","rem","vw","vh"],ZD=(0,S.forwardRef)(((e,t)=>{const{__next40pxDefaultSize:n=!1,fallbackFontSize:r,fontSizes:o=[],disableCustomFontSizes:i=!1,onChange:s,size:a="default",units:l=XD,value:c,withSlider:u=!1,withReset:d=!0}=e,h=Gw({availableUnits:l}),p=o.length>5,f=o.find((e=>e.size===c)),m=!!c&&!f,[g,b]=(0,S.useState)(!i&&m),y=(0,S.useMemo)((()=>{if(g)return(0,H.__)("Custom");if(!p)return f?f.name||YD[o.indexOf(f)]:"";const e=LD(o);return e?`(${e})`:""}),[g,p,f,o]);if(0===o.length&&i)return null;const v="string"==typeof c||"string"==typeof o[0]?.size,[_,x]=Ww(c,h),w=!!x&&["em","rem","vw","vh"].includes(x),k=void 0===c;return(0,Td.jsxs)(FD,{ref:t,className:"components-font-size-picker",children:[(0,Td.jsx)(GA.A,{as:"legend",children:(0,H.__)("Font size")}),(0,Td.jsx)(DT.A,{children:(0,Td.jsxs)(zD,{className:"components-font-size-picker__header",children:[(0,Td.jsxs)(VD,{"aria-label":`${(0,H.__)("Size")} ${y||""}`,children:[(0,H.__)("Size"),y&&(0,Td.jsx)(HD,{className:"components-font-size-picker__header__hint",children:y})]}),!i&&(0,Td.jsx)(UD,{label:g?(0,H.__)("Use size preset"):(0,H.__)("Set custom size"),icon:OD.A,onClick:()=>{b(!g)},isPressed:g,size:"small"})]})}),(0,Td.jsxs)("div",{children:[!!o.length&&p&&!g&&(0,Td.jsx)(qD,{__next40pxDefaultSize:n,fontSizes:o,value:c,disableCustomFontSizes:i,size:a,onChange:e=>{void 0===e?s?.(void 0):s?.(v?e:Number(e),o.find((t=>t.size===e)))},onSelectCustom:()=>b(!0)}),!p&&!g&&(0,Td.jsx)(JD,{fontSizes:o,value:c,__next40pxDefaultSize:n,size:a,onChange:e=>{void 0===e?s?.(void 0):s?.(v?e:Number(e),o.find((t=>t.size===e)))}}),!i&&g&&(0,Td.jsxs)(B_.A,{className:"components-font-size-picker__custom-size-control",children:[(0,Td.jsx)(R_.A,{isBlock:!0,children:(0,Td.jsx)(ak,{__next40pxDefaultSize:n,label:(0,H.__)("Custom"),labelPosition:"top",hideLabelFromVision:!0,value:c,onChange:e=>{s?.(void 0===e?void 0:v?e:parseInt(e,10))},size:a,units:v?h:[],min:0})}),u&&(0,Td.jsx)(R_.A,{isBlock:!0,children:(0,Td.jsx)(DT.A,{marginX:2,marginBottom:0,children:(0,Td.jsx)(FC,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:n,className:"components-font-size-picker__custom-input",label:(0,H.__)("Custom Size"),hideLabelFromVision:!0,value:_,initialPosition:r,withInputField:!1,onChange:e=>{s?.(void 0===e?void 0:v?e+(null!=x?x:"px"):e)},min:0,max:w?10:100,step:w?.1:1})})}),d&&(0,Td.jsx)(R_.A,{children:(0,Td.jsx)(Zv.$n,{disabled:k,__experimentalIsFocusable:!0,onClick:()=>{s?.(void 0)},variant:"secondary",__next40pxDefaultSize:!0,size:"__unstable-large"===a||e.__next40pxDefaultSize?"default":"small",children:(0,H.__)("Reset")})})]})]})]})})),QD=ZD;function eM({value:e="",onChange:t,fontFamilies:n,...r}){const[o]=fv("typography.fontFamilies");if(n||(n=o),!n||0===n.length)return null;const i=[{value:"",label:(0,H.__)("Default")},...n.map((({fontFamily:e,name:t})=>({value:e,label:t||e})))];return(0,Td.jsx)(_T.A,{label:(0,H.__)("Font"),options:i,value:e,onChange:t,labelPosition:"top",...r})}const tM=[{name:(0,H._x)("Regular","font style"),value:"normal"},{name:(0,H._x)("Italic","font style"),value:"italic"}],nM=[{name:(0,H._x)("Thin","font weight"),value:"100"},{name:(0,H._x)("Extra Light","font weight"),value:"200"},{name:(0,H._x)("Light","font weight"),value:"300"},{name:(0,H._x)("Regular","font weight"),value:"400"},{name:(0,H._x)("Medium","font weight"),value:"500"},{name:(0,H._x)("Semi Bold","font weight"),value:"600"},{name:(0,H._x)("Bold","font weight"),value:"700"},{name:(0,H._x)("Extra Bold","font weight"),value:"800"},{name:(0,H._x)("Black","font weight"),value:"900"}],rM=(e,t)=>e?t?(0,H.__)("Appearance"):(0,H.__)("Font style"):(0,H.__)("Font weight");function oM(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:r=!0,value:{fontStyle:o,fontWeight:i},...s}=e,a=n||r,l=rM(n,r),c={key:"default",name:(0,H.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,S.useMemo)((()=>n&&r?(()=>{const e=[c];return tM.forEach((({name:t,value:n})=>{nM.forEach((({name:r,value:o})=>{const i="normal"===n?r:(0,H.sprintf)((0,H.__)("%1$s %2$s"),r,t);e.push({key:`${n}-${o}`,name:i,style:{fontStyle:n,fontWeight:o}})}))})),e})():n?(()=>{const e=[c];return tM.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:n,fontWeight:void 0}})})),e})():(()=>{const e=[c];return nM.forEach((({name:t,value:n})=>{e.push({key:n,name:t,style:{fontStyle:void 0,fontWeight:n}})})),e})()),[e.options]),d=u.find((e=>e.style.fontStyle===o&&e.style.fontWeight===i))||u[0];return a&&(0,Td.jsx)($D.G,{...s,className:"components-font-appearance-control",label:l,describedBy:d?n?r?(0,H.sprintf)((0,H.__)("Currently selected font appearance: %s"),d.name):(0,H.sprintf)((0,H.__)("Currently selected font style: %s"),d.name):(0,H.sprintf)((0,H.__)("Currently selected font weight: %s"),d.name):(0,H.__)("No selected font appearance"),options:u,value:d,onChange:({selectedItem:e})=>t(e.style)})}const iM=({value:e,onChange:t,__nextHasNoMarginBottom:n=!1,__unstableInputWidth:r="60px",...o})=>{const i=function(e){return void 0!==e&&""!==e}(e),s=(e,t)=>{if(i)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return 1.5;default:return e}},a=i?e:"";n||(0,q.default)("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const l=n?void 0:{marginBottom:24};return(0,Td.jsx)("div",{className:"block-editor-line-height-control",style:l,children:(0,Td.jsx)(Kw.A,{...o,__unstableInputWidth:r,__unstableStateReducer:(e,t)=>{const n=["insertText","insertFromPaste"].includes(t.payload.event.nativeEvent?.inputType),r=s(e.value,n);return{...e,value:r}},onChange:(e,{event:n})=>{""!==e?"click"!==n.type?t(`${e}`):t(s(`${e}`,!1)):t()},label:(0,H.__)("Line height"),placeholder:1.5,step:.01,spinFactor:10,value:a,min:0,spinControls:"custom"})})};function sM({value:e,onChange:t,__unstableInputWidth:n="60px",...r}){const[o]=fv("spacing.units"),i=Gw({availableUnits:o||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,Td.jsx)(ak,{...r,label:(0,H.__)("Letter spacing"),value:e,__unstableInputWidth:n,units:i,onChange:t})}var aM=n(1807),lM=n(48123),cM=n(19758),uM=n(63900);function dM({label:e,value:t,options:n,onChange:r,className:o}){return(0,Td.jsxs)("fieldset",{className:(0,$v.A)("block-editor-segmented-text-control",o),children:[(0,Td.jsx)($_.Ay.VisualLabel,{as:"legend",children:e}),(0,Td.jsx)("div",{className:"block-editor-segmented-text-control__buttons",children:n.map((e=>(0,Td.jsx)(Zv.Ay,{size:"compact",icon:e.icon,label:e.label,isPressed:e.value===t,onClick:()=>r(e.value)},e.value)))})]})}const hM=[{label:(0,H.__)("Align text left"),value:"left",icon:aM.A},{label:(0,H.__)("Align text center"),value:"center",icon:lM.A},{label:(0,H.__)("Align text right"),value:"right",icon:cM.A},{label:(0,H.__)("Justify text"),value:"justify",icon:uM.A}],pM=["left","center","right"];function fM({className:e,value:t,onChange:n,options:r=pM}){const o=(0,S.useMemo)((()=>hM.filter((e=>r.includes(e.value)))),[r]);return o.length?(0,Td.jsx)(dM,{label:(0,H.__)("Text alignment"),options:o,className:(0,$v.A)("block-editor-text-alignment-control",e),value:t,onChange:e=>{n(e===t?void 0:e)}}):null}var mM=n(69267),gM=n(8732),bM=n(12941),yM=n(26868);const vM=[{label:(0,H.__)("None"),value:"none",icon:mM.A},{label:(0,H.__)("Uppercase"),value:"uppercase",icon:gM.A},{label:(0,H.__)("Lowercase"),value:"lowercase",icon:bM.A},{label:(0,H.__)("Capitalize"),value:"capitalize",icon:yM.A}];function _M({className:e,value:t,onChange:n}){return(0,Td.jsx)(dM,{label:(0,H.__)("Letter case"),options:vM,className:(0,$v.A)("block-editor-text-transform-control",e),value:t,onChange:e=>{n(e===t?void 0:e)}})}var xM=n(73048),wM=n(11047);const kM=[{label:(0,H.__)("None"),value:"none",icon:mM.A},{label:(0,H.__)("Underline"),value:"underline",icon:xM.A},{label:(0,H.__)("Strikethrough"),value:"line-through",icon:wM.A}];function CM({value:e,onChange:t,className:n}){return(0,Td.jsx)(dM,{label:(0,H.__)("Decoration"),options:kM,className:(0,$v.A)("block-editor-text-decoration-control",n),value:e,onChange:n=>{t(n===e?void 0:n)}})}var SM=n(33690),AM=n(12816);const EM=[{label:(0,H.__)("Horizontal"),value:"horizontal-tb",icon:SM.A},{label:(0,H.__)("Vertical"),value:(0,H.isRTL)()?"vertical-lr":"vertical-rl",icon:AM.A}];function IM({className:e,value:t,onChange:n}){return(0,Td.jsx)(dM,{label:(0,H.__)("Orientation"),options:EM,className:(0,$v.A)("block-editor-writing-mode-control",e),value:t,onChange:e=>{n(e===t?void 0:e)}})}const jM=1,TM=6;function BM(e){const t=NM(e),n=DM(e),r=MM(e),o=PM(e),i=LM(e),s=OM(e),a=FM(e),l=zM(e),c=UM(e),u=RM(e);return t||n||r||o||i||s||u||a||l||c}function RM(e){return!1!==e?.typography?.defaultFontSizes&&e?.typography?.fontSizes?.default?.length||e?.typography?.fontSizes?.theme?.length||e?.typography?.fontSizes?.custom?.length||e?.typography?.customFontSize}function NM(e){return["default","theme","custom"].some((t=>e?.typography?.fontFamilies?.[t]?.length))}function DM(e){return e?.typography?.lineHeight}function MM(e){return e?.typography?.fontStyle||e?.typography?.fontWeight}function PM(e){return e?.typography?.letterSpacing}function OM(e){return e?.typography?.textTransform}function LM(e){return e?.typography?.textAlign}function FM(e){return e?.typography?.textDecoration}function zM(e){return e?.typography?.writingMode}function UM(e){return e?.typography?.textColumns}function VM({resetAllFilter:e,onChange:t,value:n,panelId:r,children:o}){return(0,Td.jsx)(wA,{label:(0,H.__)("Typography"),resetAll:()=>{const r=e(n);t(r)},panelId:r,dropdownMenuProps:jv,children:o})}const HM={fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!0,textAlign:!0,textTransform:!0,textDecoration:!0,writingMode:!0,textColumns:!0};function $M({as:e=VM,value:t,onChange:n,inheritedValue:r=t,settings:o,panelId:i,defaultControls:s=HM}){const a=e=>Bv({settings:o},"",e),l=NM(o),c=o?.typography?.fontFamilies,u=(0,S.useMemo)((()=>["default","theme","custom"].flatMap((e=>{var t;return null!==(t=c?.[e])&&void 0!==t?t:[]}))),[c]),d=a(r?.typography?.fontFamily),h=e=>{const r=u?.find((({fontFamily:t})=>t===e))?.slug;n(Lf(t,["typography","fontFamily"],r?`var:preset|font-family|${r}`:e||void 0))},p=RM(o),f=!o?.typography?.customFontSize,m=function(e){var t,n,r;const o=e?.typography?.fontSizes,i=!!e?.typography?.defaultFontSizes;return[...null!==(t=o?.custom)&&void 0!==t?t:[],...null!==(n=o?.theme)&&void 0!==n?n:[],...i&&null!==(r=o?.default)&&void 0!==r?r:[]]}(o),g=a(r?.typography?.fontSize),b=(e,r)=>{n(Lf(t,["typography","fontSize"],(r?.slug?`var:preset|font-size|${r?.slug}`:e)||void 0))},y=MM(o),v=function(e){return e?.typography?.fontStyle?e?.typography?.fontWeight?(0,H.__)("Appearance"):(0,H.__)("Font style"):(0,H.__)("Font weight")}(o),_=o?.typography?.fontStyle,x=o?.typography?.fontWeight,w=a(r?.typography?.fontStyle),k=a(r?.typography?.fontWeight),C=({fontStyle:e,fontWeight:r})=>{n({...t,typography:{...t?.typography,fontStyle:e||void 0,fontWeight:r||void 0}})},A=DM(o),E=a(r?.typography?.lineHeight),I=e=>{n(Lf(t,["typography","lineHeight"],e||void 0))},j=PM(o),T=a(r?.typography?.letterSpacing),B=e=>{n(Lf(t,["typography","letterSpacing"],e||void 0))},R=UM(o),N=a(r?.typography?.textColumns),D=e=>{n(Lf(t,["typography","textColumns"],e||void 0))},M=OM(o),P=a(r?.typography?.textTransform),O=e=>{n(Lf(t,["typography","textTransform"],e||void 0))},L=FM(o),F=a(r?.typography?.textDecoration),z=e=>{n(Lf(t,["typography","textDecoration"],e||void 0))},U=zM(o),V=a(r?.typography?.writingMode),$=e=>{n(Lf(t,["typography","writingMode"],e||void 0))},W=LM(o),G=a(r?.typography?.textAlign),q=e=>{n(Lf(t,["typography","textAlign"],e||void 0))},K=(0,S.useCallback)((e=>({...e,typography:{}})),[]);return(0,Td.jsxs)(e,{resetAllFilter:K,value:t,onChange:n,panelId:i,children:[l&&(0,Td.jsx)(YA,{label:(0,H.__)("Font"),hasValue:()=>!!t?.typography?.fontFamily,onDeselect:()=>h(void 0),isShownByDefault:s.fontFamily,panelId:i,children:(0,Td.jsx)(eM,{fontFamilies:u,value:d,onChange:h,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),p&&(0,Td.jsx)(YA,{label:(0,H.__)("Size"),hasValue:()=>!!t?.typography?.fontSize,onDeselect:()=>b(void 0),isShownByDefault:s.fontSize,panelId:i,children:(0,Td.jsx)(QD,{value:g,onChange:b,fontSizes:m,disableCustomFontSizes:f,withReset:!1,withSlider:!0,size:"__unstable-large"})}),y&&(0,Td.jsx)(YA,{className:"single-column",label:v,hasValue:()=>!!t?.typography?.fontStyle||!!t?.typography?.fontWeight,onDeselect:()=>{C({})},isShownByDefault:s.fontAppearance,panelId:i,children:(0,Td.jsx)(oM,{value:{fontStyle:w,fontWeight:k},onChange:C,hasFontStyles:_,hasFontWeights:x,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),A&&(0,Td.jsx)(YA,{className:"single-column",label:(0,H.__)("Line height"),hasValue:()=>void 0!==t?.typography?.lineHeight,onDeselect:()=>I(void 0),isShownByDefault:s.lineHeight,panelId:i,children:(0,Td.jsx)(iM,{__nextHasNoMarginBottom:!0,__unstableInputWidth:"auto",value:E,onChange:I,size:"__unstable-large"})}),j&&(0,Td.jsx)(YA,{className:"single-column",label:(0,H.__)("Letter spacing"),hasValue:()=>!!t?.typography?.letterSpacing,onDeselect:()=>B(void 0),isShownByDefault:s.letterSpacing,panelId:i,children:(0,Td.jsx)(sM,{value:T,onChange:B,size:"__unstable-large",__unstableInputWidth:"auto"})}),R&&(0,Td.jsx)(YA,{className:"single-column",label:(0,H.__)("Columns"),hasValue:()=>!!t?.typography?.textColumns,onDeselect:()=>D(void 0),isShownByDefault:s.textColumns,panelId:i,children:(0,Td.jsx)(Kw.A,{label:(0,H.__)("Columns"),max:TM,min:jM,onChange:D,size:"__unstable-large",spinControls:"custom",value:N,initialPosition:1})}),L&&(0,Td.jsx)(YA,{className:"single-column",label:(0,H.__)("Decoration"),hasValue:()=>!!t?.typography?.textDecoration,onDeselect:()=>z(void 0),isShownByDefault:s.textDecoration,panelId:i,children:(0,Td.jsx)(CM,{value:F,onChange:z,size:"__unstable-large",__unstableInputWidth:"auto"})}),U&&(0,Td.jsx)(YA,{className:"single-column",label:(0,H.__)("Orientation"),hasValue:()=>!!t?.typography?.writingMode,onDeselect:()=>$(void 0),isShownByDefault:s.writingMode,panelId:i,children:(0,Td.jsx)(IM,{value:V,onChange:$,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),M&&(0,Td.jsx)(YA,{label:(0,H.__)("Letter case"),hasValue:()=>!!t?.typography?.textTransform,onDeselect:()=>O(void 0),isShownByDefault:s.textTransform,panelId:i,children:(0,Td.jsx)(_M,{value:P,onChange:O,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),W&&(0,Td.jsx)(YA,{label:(0,H.__)("Text alignment"),hasValue:()=>!!t?.typography?.textAlign,onDeselect:()=>q(void 0),isShownByDefault:s.textAlign,panelId:i,children:(0,Td.jsx)(fM,{value:G,onChange:q,size:"__unstable-large",__nextHasNoMarginBottom:!0})})]})}class WM{constructor(e=""){this.value=e,this._currentValue,this._valueAsArray}entries(...e){return this._valueAsArray.entries(...e)}forEach(...e){return this._valueAsArray.forEach(...e)}keys(...e){return this._valueAsArray.keys(...e)}values(...e){return this._valueAsArray.values(...e)}get value(){return this._currentValue}set value(e){e=String(e),this._valueAsArray=[...new Set(e.split(/\s+/g).filter(Boolean))],this._currentValue=this._valueAsArray.join(" ")}get length(){return this._valueAsArray.length}toString(){return this.value}*[Symbol.iterator](){return yield*this._valueAsArray}item(e){return this._valueAsArray[e]}contains(e){return-1!==this._valueAsArray.indexOf(e)}add(...e){this.value+=" "+e.join(" ")}remove(...e){this.value=this._valueAsArray.filter((t=>!e.includes(t))).join(" ")}toggle(e,t){return void 0===t&&(t=!this.contains(e)),t?this.add(e):this.remove(e),t}replace(e,t){return!!this.contains(e)&&(this.remove(e),this.add(t),!0)}supports(){return!0}}const GM="typography.__experimentalFontFamily",{kebabCase:qM}=Cf(d_.j);function KM(e,t,n){if(!Ic(t,GM))return e;if(qv(t,fP,"fontFamily"))return e;if(!n?.fontFamily)return e;const r=new WM(e.className);r.add(`has-${qM(n?.fontFamily)}-font-family`);const o=r.value;return e.className=o||void 0,e}const YM={useBlockProps:function({name:e,fontFamily:t}){return KM({},e,{fontFamily:t})},addSaveProps:KM,attributeKeys:["fontFamily"],hasSupport:e=>Ic(e,GM)};(0,Tu.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return Ic(e,GM)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e}));const{kebabCase:JM}=Cf(d_.j),XM=(e,t,n)=>{if(t){const n=e?.find((({slug:e})=>e===t));if(n)return n}return{size:n}};function ZM(e){if(e)return`has-${JM(e)}-font-size`}const QM="typography.fontSize";function eP(e,t,n){if(!Ic(t,QM))return e;if(qv(t,fP,"fontSize"))return e;const r=new WM(e.className);r.add(ZM(n.fontSize));const o=r.value;return e.className=o||void 0,e}const tP={useBlockProps:function({name:e,fontSize:t,style:n}){const[r,o,i]=fv("typography.fontSizes","typography.fluid","layout");if(!Ic(e,QM)||qv(e,fP,"fontSize")||!t&&!n?.typography?.fontSize)return;let s;return n?.typography?.fontSize&&(s={style:{fontSize:kv({size:n.typography.fontSize},{typography:{fluid:o},layout:i})}}),t&&(s={style:{fontSize:XM(r,t,n?.typography?.fontSize).size}}),s?eP(s,e,{fontSize:t}):void 0},addSaveProps:eP,attributeKeys:["fontSize","style"],hasSupport:e=>Ic(e,QM)},nP={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,Tu.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return Ic(e,QM)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,Tu.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,r){return Gv({fontSize:Ic(e.name,QM)},nP,e,t,n,r)}));const rP=[{icon:aM.A,title:(0,H.__)("Align text left"),align:"left"},{icon:lM.A,title:(0,H.__)("Align text center"),align:"center"},{icon:cM.A,title:(0,H.__)("Align text right"),align:"right"}],oP={placement:"bottom-start"},iP=function({value:e,onChange:t,alignmentControls:n=rP,label:r=(0,H.__)("Align text"),describedBy:o=(0,H.__)("Change text alignment"),isCollapsed:i=!0,isToolbar:s}){function a(n){return()=>t(e===n?void 0:n)}const l=n.find((t=>t.align===e)),c=s?a_:x_,u=s?{isCollapsed:i}:{toggleProps:{describedBy:o},popoverProps:oP};return(0,Td.jsx)(c,{icon:l?l.icon:(0,H.isRTL)()?cM.A:aM.A,label:r,controls:n.map((t=>{const{align:n}=t,r=e===n;return{...t,isActive:r,role:i?"menuitemradio":void 0,onClick:a(n)}})),...u})},sP=e=>(0,Td.jsx)(iP,{...e,isToolbar:!1}),aP="typography.textAlign",lP=[{icon:aM.A,title:(0,H.__)("Align text left"),align:"left"},{icon:lM.A,title:(0,H.__)("Align text center"),align:"center"},{icon:cM.A,title:(0,H.__)("Align text right"),align:"right"}],cP=["left","center","right"],uP=[];function dP(e){return Array.isArray(e)?cP.filter((t=>e.includes(t))):!0===e?cP:uP}const hP={edit:function({style:e,name:t,setAttributes:n}){const r=Jv(t),o=r?.typography?.textAlign,i=IS();if(!o||"default"!==i)return null;const s=dP(Ec(t,aP));if(!s.length)return null;const a=lP.filter((e=>s.includes(e.align)));return(0,Td.jsx)(__,{group:"block",children:(0,Td.jsx)(sP,{value:e?.typography?.textAlign,onChange:t=>{const r={...e,typography:{...e?.typography,textAlign:t}};n({style:Wv(r)})},alignmentControls:a})})},useBlockProps:function({name:e,style:t}){if(!t?.typography?.textAlign)return null;if(!dP(Ec(e,aP)).length)return null;if(qv(e,fP,"textAlign"))return null;const n=t.typography.textAlign;return{className:(0,$v.A)({[`has-text-align-${n}`]:n})}},addSaveProps:function(e,t,n){if(!n?.style?.typography?.textAlign)return e;const{textAlign:r}=n.style.typography;return dP(Ec(t,aP)).includes(r)&&!qv(t,fP,"textAlign")&&(e.className=(0,$v.A)(`has-text-align-${r}`,e.className)),e},attributeKeys:["style"],hasSupport:e=>Ic(e,aP,!1)};function pP(e,t){return Object.fromEntries(Object.entries(e).filter((([e])=>!t.includes(e))))}const fP="typography",mP=["typography.lineHeight",QM,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",GM,aP,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalWritingMode","typography.__experimentalTextTransform","typography.__experimentalLetterSpacing"];function gP(e){const t={...pP(e,["fontFamily"])},n=e?.typography?.fontSize,r=e?.typography?.fontFamily,o=n?.startsWith("var:preset|font-size|")?n.substring(21):void 0,i=r?.startsWith("var:preset|font-family|")?r.substring(23):void 0;return t.typography={...pP(t.typography,["fontFamily"]),fontSize:o?void 0:n},{style:Wv(t),fontFamily:i,fontSize:o}}function bP(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 yP({children:e,resetAllFilter:t}){const n=(0,S.useCallback)((e=>{const n=bP(e),r=t(n);return{...e,...gP(r)}}),[t]);return(0,Td.jsx)(IA,{group:"typography",resetAllFilter:n,children:e})}function vP({clientId:e,name:t,setAttributes:n,settings:r}){const{style:o,fontFamily:i,fontSize:s}=(0,Ul.A)((function(t){const{style:n,fontFamily:r,fontSize:o}=t(hv).getBlockAttributes(e)||{};return{style:n,fontFamily:r,fontSize:o}}),[e]),a=BM(r),l=(0,S.useMemo)((()=>bP({style:o,fontFamily:i,fontSize:s})),[o,s,i]);if(!a)return null;const c=Ec(t,[fP,"__experimentalDefaultControls"]);return(0,Td.jsx)($M,{as:yP,panelId:e,settings:r,value:l,onChange:e=>{n(gP(e))},defaultControls:c})}const _P=(0,W_.default)("span",{target:"e1j5nr4z8"})({name:"1w884gc",styles:"box-sizing:border-box;display:block;width:24px;height:24px;position:relative;padding:4px"}),xP=(0,W_.default)("span",{target:"e1j5nr4z7"})({name:"i6vjox",styles:"box-sizing:border-box;display:block;position:relative;width:100%;height:100%"}),wP=({isFocused:e})=>(0,G_.css)({backgroundColor:"currentColor",opacity:e?1:.3},"",""),kP=(0,W_.default)("span",{target:"e1j5nr4z6"})("box-sizing:border-box;display:block;pointer-events:none;position:absolute;",wP,";"),CP=(0,W_.default)(kP,{target:"e1j5nr4z5"})({name:"1k2w39q",styles:"bottom:3px;top:3px;width:2px"}),SP=(0,W_.default)(kP,{target:"e1j5nr4z4"})({name:"1q9b07k",styles:"height:2px;left:3px;right:3px"}),AP=(0,W_.default)(SP,{target:"e1j5nr4z3"})({name:"abcix4",styles:"top:0"}),EP=(0,W_.default)(CP,{target:"e1j5nr4z2"})({name:"1wf8jf",styles:"right:0"}),IP=(0,W_.default)(SP,{target:"e1j5nr4z1"})({name:"8tapst",styles:"bottom:0"}),jP=(0,W_.default)(CP,{target:"e1j5nr4z0"})({name:"1ode3cm",styles:"left:0"});function TP({size:e=24,side:t="all",sides:n,...r}){const o=e=>!(e=>n?.length&&!n.includes(e))(e)&&("all"===t||t===e),i=o("top")||o("vertical"),s=o("right")||o("horizontal"),a=o("bottom")||o("vertical"),l=o("left")||o("horizontal"),c=e/24;return(0,Td.jsx)(_P,{style:{transform:`scale(${c})`},...r,children:(0,Td.jsxs)(xP,{children:[(0,Td.jsx)(AP,{isFocused:i}),(0,Td.jsx)(EP,{isFocused:s}),(0,Td.jsx)(IP,{isFocused:a}),(0,Td.jsx)(jP,{isFocused:l})]})})}const BP=(0,W_.default)(ak,{target:"e1jovhle5"})({name:"1ejyr19",styles:"max-width:90px"}),RP=(0,W_.default)(tA.A,{target:"e1jovhle4"})({name:"1j1lmoi",styles:"grid-column:1/span 3"}),NP=(0,W_.default)(Zv.Ay,{target:"e1jovhle3"})({name:"tkya7b",styles:"grid-area:1/2;justify-self:end"}),DP=(0,W_.default)("div",{target:"e1jovhle2"})({name:"1dfa8al",styles:"grid-area:1/3;justify-self:end"}),MP=(0,W_.default)(TP,{target:"e1jovhle1"})({name:"ou8xsw",styles:"flex:0 0 auto"}),PP=(0,W_.default)(FC,{target:"e1jovhle0"})("width:100%;margin-inline-end:",(0,Jw.x)(2),";"),OP={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}},LP={all:(0,H.__)("All sides"),top:(0,H.__)("Top side"),bottom:(0,H.__)("Bottom side"),left:(0,H.__)("Left side"),right:(0,H.__)("Right side"),mixed:(0,H.__)("Mixed"),vertical:(0,H.__)("Top and bottom sides"),horizontal:(0,H.__)("Left and right sides")},FP={top:void 0,right:void 0,bottom:void 0,left:void 0},zP=["top","right","bottom","left"];function UP(e){return e.sort(((t,n)=>e.filter((e=>e===t)).length-e.filter((e=>e===n)).length)).pop()}function VP(e={},t,n=zP){const r=function(e){const t=[];if(!e?.length)return zP;if(e.includes("vertical"))t.push("top","bottom");else if(e.includes("horizontal"))t.push("left","right");else{const n=zP.filter((t=>e.includes(t)));t.push(...n)}return t}(n).map((t=>Ww(e[t]))),o=r.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),i=r.map((e=>e[1])),s=o.every((e=>e===o[0]))?o[0]:"";let a;var l;return a="number"==typeof s?UP(i):null!==(l=function(e){if(!e||"object"!=typeof e)return;return UP(Object.values(e).filter(Boolean))}(t))&&void 0!==l?l:UP(i),[s,a].join("")}function HP(e={},t,n=zP){const r=VP(e,t,n);return isNaN(parseFloat(r))}function $P(e){return void 0!==e&&Object.values(e).filter((e=>!!e&&/\d/.test(e))).length>0}function WP(e,t){let n="all";return e||(n=t?"vertical":"top"),n}function GP(e,t,n){const r={...e};return n?.length?n.forEach((e=>{"vertical"===e?(r.top=t,r.bottom=t):"horizontal"===e?(r.left=t,r.right=t):r[e]=t})):zP.forEach((e=>r[e]=t)),r}const qP=()=>{};function KP({__next40pxDefaultSize:e,onChange:t=qP,onFocus:n=qP,values:r,sides:o,selectedUnits:i,setSelectedUnits:s,...a}){var l,c;const u=(0,z_.A)(KP,"box-control-input-all"),d=VP(r,i,o),h=$P(r)&&HP(r,i,o),p=h?LP.mixed:void 0,[f,m]=Ww(d),g=e=>{const n=void 0!==e&&!isNaN(parseFloat(e)),i=GP(r,n?e:void 0,o);t(i)};return(0,Td.jsxs)(tA.A,{children:[(0,Td.jsx)(BP,{...a,__next40pxDefaultSize:e,className:"component-box-control__unit-control",disableUnits:h,id:u,isPressEnterToChange:!0,value:d,onChange:g,onUnitChange:e=>{const t=GP(i,e,o);s(t)},onFocus:e=>{n(e,{side:"all"})},placeholder:p,label:LP.all,hideLabelFromVision:!0}),(0,Td.jsx)(PP,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:e,"aria-controls":u,label:LP.all,hideLabelFromVision:!0,onChange:e=>{g(void 0!==e?[e,m].join(""):void 0)},min:0,max:null!==(l=OP[null!=m?m:"px"]?.max)&&void 0!==l?l:10,step:null!==(c=OP[null!=m?m:"px"]?.step)&&void 0!==c?c:.1,value:null!=f?f:0,withInputField:!1})]})}const YP=()=>{};function JP({__next40pxDefaultSize:e,onChange:t=YP,onFocus:n=YP,values:r,selectedUnits:o,setSelectedUnits:i,sides:s,...a}){const l=(0,z_.A)(JP,"box-control-input"),c=e=>t=>{n(t,{side:e})},u=(e,n,o)=>{const i={...r},s=void 0===n||isNaN(parseFloat(n))?void 0:n;if(i[e]=s,o?.event.altKey)switch(e){case"top":i.bottom=s;break;case"bottom":i.top=s;break;case"left":i.right=s;break;case"right":i.left=s}(e=>{t(e)})(i)},d=e=>t=>{const n={...o};n[e]=t,i(n)},h=s?.length?zP.filter((e=>s.includes(e))):zP;return(0,Td.jsx)(Td.Fragment,{children:h.map((t=>{var n,i;const[h,p]=Ww(r[t]),f=r[t]?p:o[t],m=[l,t].join("-");return(0,Td.jsxs)(RP,{expanded:!0,children:[(0,Td.jsx)(MP,{side:t,sides:s}),(0,Td.jsx)(Dx.Ay,{placement:"top-end",text:LP[t],children:(0,Td.jsx)(BP,{...a,__next40pxDefaultSize:e,className:"component-box-control__unit-control",id:m,isPressEnterToChange:!0,value:[h,f].join(""),onChange:(e,n)=>u(t,e,n),onUnitChange:d(t),onFocus:c(t),label:LP[t],hideLabelFromVision:!0})}),(0,Td.jsx)(PP,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:e,"aria-controls":m,label:LP[t],hideLabelFromVision:!0,onChange:e=>{u(t,void 0!==e?[e,f].join(""):void 0)},min:0,max:null!==(n=OP[null!=f?f:"px"]?.max)&&void 0!==n?n:10,step:null!==(i=OP[null!=f?f:"px"]?.step)&&void 0!==i?i:.1,value:null!=h?h:0,withInputField:!1})]},`box-control-${t}`)}))})}const XP=["vertical","horizontal"];function ZP({__next40pxDefaultSize:e,onChange:t,onFocus:n,values:r,selectedUnits:o,setSelectedUnits:i,sides:s,...a}){const l=(0,z_.A)(ZP,"box-control-input"),c=e=>t=>{n&&n(t,{side:e})},u=(e,n)=>{if(!t)return;const o={...r},i=void 0===n||isNaN(parseFloat(n))?void 0:n;"vertical"===e&&(o.top=i,o.bottom=i),"horizontal"===e&&(o.left=i,o.right=i),t(o)},d=e=>t=>{const n={...o};"vertical"===e&&(n.top=t,n.bottom=t),"horizontal"===e&&(n.left=t,n.right=t),i(n)},h=s?.length?XP.filter((e=>s.includes(e))):XP;return(0,Td.jsx)(Td.Fragment,{children:h.map((t=>{var n,i;const[h,p]=Ww("vertical"===t?r.top:r.left),f="vertical"===t?o.top:o.left,m=[l,t].join("-");return(0,Td.jsxs)(RP,{children:[(0,Td.jsx)(MP,{side:t,sides:s}),(0,Td.jsx)(Dx.Ay,{placement:"top-end",text:LP[t],children:(0,S.createElement)(BP,{...a,__next40pxDefaultSize:e,className:"component-box-control__unit-control",id:m,isPressEnterToChange:!0,value:[h,null!=f?f:p].join(""),onChange:e=>u(t,e),onUnitChange:d(t),onFocus:c(t),label:LP[t],hideLabelFromVision:!0,key:t})}),(0,Td.jsx)(PP,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:e,"aria-controls":m,label:LP[t],hideLabelFromVision:!0,onChange:e=>u(t,void 0!==e?[e,null!=f?f:p].join(""):void 0),min:0,max:null!==(n=OP[null!=f?f:"px"]?.max)&&void 0!==n?n:10,step:null!==(i=OP[null!=f?f:"px"]?.step)&&void 0!==i?i:.1,value:null!=h?h:0,withInputField:!1})]},t)}))})}function QP({isLinked:e,...t}){const n=e?(0,H.__)("Unlink sides"):(0,H.__)("Link sides");return(0,Td.jsx)(Dx.Ay,{text:n,children:(0,Td.jsx)(Zv.Ay,{...t,className:"component-box-control__linked-button",size:"small",icon:e?rT.A:ZI.A,iconSize:24,"aria-label":n})})}const eO={min:0},tO=()=>{};const nO=function e({__next40pxDefaultSize:t=!1,id:n,inputProps:r=eO,onChange:o=tO,label:i=(0,H.__)("Box Control"),values:s,units:a,sides:l,splitOnAxis:c=!1,allowReset:u=!0,resetValues:d=FP,onMouseOver:h,onMouseOut:p}){const[f,m]=(0,rk.A)(s,{fallback:FP}),g=f||FP,b=$P(s),y=1===l?.length,[v,_]=(0,S.useState)(b),[x,w]=(0,S.useState)(!b||!HP(g)||y),[k,C]=(0,S.useState)(WP(x,c)),[A,E]=(0,S.useState)({top:Ww(s?.top)[1],right:Ww(s?.right)[1],bottom:Ww(s?.bottom)[1],left:Ww(s?.left)[1]}),I=function(t){const n=(0,z_.A)(e,"inspector-box-control");return t||n}(n),j=`${I}-heading`,T={...r,onChange:e=>{o(e),m(e),_(!0)},onFocus:(e,{side:t})=>{C(t)},isLinked:x,units:a,selectedUnits:A,setSelectedUnits:E,sides:l,values:g,onMouseOver:h,onMouseOut:p,__next40pxDefaultSize:t};return(0,Td.jsxs)(_A,{id:I,columns:3,templateColumns:"1fr min-content min-content",role:"group","aria-labelledby":j,children:[(0,Td.jsx)($_.pu.VisualLabel,{id:j,children:i}),x&&(0,Td.jsxs)(RP,{children:[(0,Td.jsx)(MP,{side:k,sides:l}),(0,Td.jsx)(KP,{...T})]}),!y&&(0,Td.jsx)(DP,{children:(0,Td.jsx)(QP,{onClick:()=>{w(!x),C(WP(!x,c))},isLinked:x})}),!x&&c&&(0,Td.jsx)(ZP,{...T}),!x&&!c&&(0,Td.jsx)(JP,{...T}),u&&(0,Td.jsx)(NP,{className:"component-box-control__reset-button",variant:"secondary",size:"small",onClick:()=>{o(d),m(d),E(d),_(!1)},disabled:!v,children:(0,H.__)("Reset")})]})},rO={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 oO({icon:e,isMixed:t=!1,minimumCustomValue:n,onChange:r,onMouseOut:o,onMouseOver:i,showSideInLabel:s=!0,side:a,spacingSizes:l,type:c,value:u}){var d,h;u=lw(u,l);let p=l;const f=l.length<=tw,m=(0,Ul.A)((e=>{const t=e(hv).getSettings();return t?.disableCustomSpacingSizes})),[g,b]=(0,S.useState)(!m&&void 0!==u&&!aw(u)),[y,v]=(0,S.useState)(n),_=(0,gx.A)(u);u&&_!==u&&!aw(u)&&!0!==g&&b(!0);const[x]=fv("spacing.units"),w=Gw({availableUnits:x||["px","em","rem"]});let k=null;f||g||void 0===u||!(!aw(u)||aw(u)&&t)?t||(k=g?function(e,t){if(!aw(e))return e;const n=uw(e),r=t.find((e=>String(e.slug)===n));return r?.size}(u,l):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":uw(e),r=t.findIndex((e=>String(e.slug)===n));return-1!==r?r:NaN}(u,l)):(p=[...l,{name:t?(0,H.__)("Mixed"):(0,H.sprintf)((0,H.__)("Custom (%s)"),u),slug:"custom",size:u}],k=p.length-1);const C=(0,S.useMemo)((()=>Ww(k)),[k])[1]||w[0]?.value,A=parseFloat(k,10),E=(e,t)=>{const n=parseInt(e,10);if("selectList"===t){if(0===n)return;if(1===n)return"0"}else if(0===n)return"0";return`var:preset|spacing|${l[e]?.slug}`},I=t?(0,H.__)("Mixed"):null,j=p.map(((e,t)=>({key:t,name:e.name}))),T=l.map(((e,t)=>({value:t,label:void 0}))),B=nw.includes(a)&&s?iw[a]:"",R=s?c?.toLowerCase():c,N=(0,H.sprintf)((0,H.__)("%1$s %2$s"),B,R).trim();return(0,Td.jsxs)(tA.A,{className:"spacing-sizes-control__wrapper",children:[e&&(0,Td.jsx)(Ux.A,{className:"spacing-sizes-control__icon",icon:e,size:24}),g&&(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(ak,{onMouseOver:i,onMouseOut:o,onFocus:i,onBlur:o,onChange:e=>r((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:k,units:w,min:y,placeholder:I,disableUnits:t,label:N,hideLabelFromVision:!0,className:"spacing-sizes-control__custom-value-input",size:"__unstable-large",onDragStart:()=>{"-"===u?.charAt(0)&&v(0)},onDrag:()=>{"-"===u?.charAt(0)&&v(0)},onDragEnd:()=>{v(n)}}),(0,Td.jsx)(FC,{onMouseOver:i,onMouseOut:o,onFocus:i,onBlur:o,value:A,min:0,max:null!==(d=rO[C]?.max)&&void 0!==d?d:10,step:null!==(h=rO[C]?.steps)&&void 0!==h?h:.1,withInputField:!1,onChange:e=>{r([e,C].join(""))},className:"spacing-sizes-control__custom-value-range",__nextHasNoMarginBottom:!0})]}),f&&!g&&(0,Td.jsx)(FC,{onMouseOver:i,onMouseOut:o,className:"spacing-sizes-control__range-control",value:k,onChange:e=>r(E(e)),onMouseDown:e=>{e?.nativeEvent?.offsetX<35&&void 0===u&&r("0")},withInputField:!1,"aria-valuenow":k,"aria-valuetext":l[k]?.name,renderTooltipContent:e=>void 0===u?void 0:l[e]?.name,min:0,max:l.length-1,marks:T,label:N,hideLabelFromVision:!0,__nextHasNoMarginBottom:!0,onFocus:i,onBlur:o}),!f&&!g&&(0,Td.jsx)($D.G,{className:"spacing-sizes-control__custom-select-control",value:j.find((e=>e.key===k))||"",onChange:e=>{r(E(e.selectedItem.key,"selectList"))},options:j,label:N,hideLabelFromVision:!0,size:"__unstable-large",onMouseOver:i,onMouseOut:o,onFocus:i,onBlur:o}),!m&&(0,Td.jsx)(Zv.Ay,{label:g?(0,H.__)("Use size preset"):(0,H.__)("Set custom size"),icon:OD.A,onClick:()=>{b(!g)},isPressed:g,size:"small",className:"spacing-sizes-control__custom-toggle",iconSize:24})]})}const iO=["vertical","horizontal"];function sO({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:r,sides:o,spacingSizes:i,type:s,values:a}){const l=e=>n=>{if(!t)return;const r={...Object.keys(a).reduce(((e,t)=>(e[t]=lw(a[t],i),e)),{})};"vertical"===e&&(r.top=n,r.bottom=n),"horizontal"===e&&(r.left=n,r.right=n),t(r)},c=o?.length?iO.filter((e=>dw(o,e))):iO;return(0,Td.jsx)(Td.Fragment,{children:c.map((t=>{const o="vertical"===t?a.top:a.left;return(0,Td.jsx)(oO,{icon:ow[t],label:iw[t],minimumCustomValue:e,onChange:l(t),onMouseOut:n,onMouseOver:r,side:t,spacingSizes:i,type:s,value:o,withInputField:!1},`spacing-sizes-control-${t}`)}))})}function aO({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:r,sides:o,spacingSizes:i,type:s,values:a}){const l=o?.length?nw.filter((e=>o.includes(e))):nw,c=e=>n=>{const r={...Object.keys(a).reduce(((e,t)=>(e[t]=lw(a[t],i),e)),{})};r[e]=n,t(r)};return(0,Td.jsx)(Td.Fragment,{children:l.map((t=>(0,Td.jsx)(oO,{icon:ow[t],label:iw[t],minimumCustomValue:e,onChange:c(t),onMouseOut:n,onMouseOver:r,side:t,spacingSizes:i,type:s,value:a[t],withInputField:!1},`spacing-sizes-control-${t}`)))})}function lO({minimumCustomValue:e,onChange:t,onMouseOut:n,onMouseOver:r,showSideInLabel:o,side:i,spacingSizes:s,type:a,values:l}){return(0,Td.jsx)(oO,{label:iw[i],minimumCustomValue:e,onChange:(c=i,e=>{const n={...Object.keys(l).reduce(((e,t)=>(e[t]=lw(l[t],s),e)),{})};n[c]=e,t(n)}),onMouseOut:n,onMouseOver:r,showSideInLabel:o,side:i,spacingSizes:s,type:a,value:l[i],withInputField:!1});var c}const cO=(0,Td.jsx)(Ux.A,{icon:ZS.A,size:24});function uO({label:e,onChange:t,sides:n,value:r}){if(!n||!n.length)return;const o=function(e){if(!e||!e.length)return{};const t={},n=dw(e,"horizontal"),r=dw(e,"vertical");n&&r?t.axial={label:iw.axial,icon:ow.axial}:n?t.axial={label:iw.horizontal,icon:ow.horizontal}:r&&(t.axial={label:iw.vertical,icon:ow.vertical});let o=0;return nw.forEach((n=>{e.includes(n)&&(o+=1,t[n]={label:iw[n],icon:ow[n]})})),o>1&&(t.custom={label:iw.custom,icon:ow.custom}),t}(n),i=o[r].icon,{custom:s,...a}=o;return(0,Td.jsx)(i_.A,{icon:i,label:e,className:"spacing-sizes-control__dropdown",toggleProps:{size:"small"},children:({onClose:e})=>(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(w_.A,{children:Object.entries(a).map((([n,{label:o,icon:i}])=>{const s=r===n;return(0,Td.jsx)(k_.A,{icon:i,iconPosition:"left",isSelected:s,role:"menuitemradio",onClick:()=>{t(n),e()},suffix:s?cO:void 0,children:o},n)}))}),!!s&&(0,Td.jsx)(w_.A,{children:(0,Td.jsx)(k_.A,{icon:s.icon,iconPosition:"left",isSelected:r===sw.custom,role:"menuitemradio",onClick:()=>{t(sw.custom),e()},suffix:r===sw.custom?cO:void 0,children:s.label})})]})})}const dO=[],hO=new Intl.Collator("und",{numeric:!0}).compare;function pO(){const[e,t,n,r]=fv("spacing.spacingSizes.custom","spacing.spacingSizes.theme","spacing.spacingSizes.default","spacing.defaultSpacingSizes"),o=null!=e?e:dO,i=null!=t?t:dO,s=n&&!1!==r?n:dO;return(0,S.useMemo)((()=>{const e=[{name:(0,H.__)("None"),slug:"0",size:0},...o,...i,...s].sort(((e,t)=>hO(e.slug,t.slug)));return e.length>tw?[{name:(0,H.__)("Default"),slug:"default",size:void 0},...e]:e.map((({slug:e,size:t},n)=>({name:n,slug:e,size:t})))}),[o,i,s])}function fO({inputProps:e,label:t,minimumCustomValue:n=0,onChange:r,onMouseOut:o,onMouseOver:i,showSideInLabel:s=!0,sides:a=nw,useSelect:l,values:c}){const u=pO(),d=c||rw,h=1===a?.length,p=a?.includes("horizontal")&&a?.includes("vertical")&&2===a?.length,[f,m]=(0,S.useState)(function(e={},t){const{top:n,right:r,bottom:o,left:i}=e,s=[n,r,o,i].filter(Boolean),a=!(n!==o||i!==r||!n&&!i),l=!s.length&&function(e=[]){const t={top:0,right:0,bottom:0,left:0};return e.forEach((e=>t[e]+=1)),(t.top+t.bottom)%2==0&&(t.left+t.right)%2==0}(t);if(dw(t)&&(a||l))return sw.axial;if(1===s.length){let t;return Object.entries(e).some((([e,n])=>(t=e,void 0!==n))),t}return 1!==t?.length||s.length?sw.custom:t[0]}(d,a)),g={...e,minimumCustomValue:n,onChange:e=>{const t={...c,...e};r(t)},onMouseOut:o,onMouseOver:i,sides:a,spacingSizes:u,type:t,useSelect:l,values:d},b=nw.includes(f)&&s?iw[f]:"",y=(0,H.sprintf)((0,H.__)("%1$s %2$s"),t,b).trim(),v=(0,H.sprintf)((0,H._x)("%s options","Button label to reveal side configuration options"),t);return(0,Td.jsxs)("fieldset",{className:"spacing-sizes-control",children:[(0,Td.jsxs)(tA.A,{className:"spacing-sizes-control__header",children:[(0,Td.jsx)($_.Ay.VisualLabel,{as:"legend",className:"spacing-sizes-control__label",children:y}),!h&&!p&&(0,Td.jsx)(uO,{label:v,onChange:m,sides:a,value:f})]}),(0,Td.jsx)(oE.A,{spacing:.5,children:f===sw.axial?(0,Td.jsx)(sO,{...g}):f===sw.custom?(0,Td.jsx)(aO,{...g}):(0,Td.jsx)(lO,{side:f,...g,showSideInLabel:s})})]})}const mO={px:{max:1e3,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:50,step:.1},rem:{max:50,step:.1},svw:{max:100,step:1},lvw:{max:100,step:1},dvw:{max:100,step:1},svh:{max:100,step:1},lvh:{max:100,step:1},dvh:{max:100,step:1},vi:{max:100,step:1},svi:{max:100,step:1},lvi:{max:100,step:1},dvi:{max:100,step:1},vb:{max:100,step:1},svb:{max:100,step:1},lvb:{max:100,step:1},dvb:{max:100,step:1},vmin:{max:100,step:1},svmin:{max:100,step:1},lvmin:{max:100,step:1},dvmin:{max:100,step:1},vmax:{max:100,step:1},svmax:{max:100,step:1},lvmax:{max:100,step:1},dvmax:{max:100,step:1}};function gO({label:e=(0,H.__)("Height"),onChange:t,value:n}){var r,o;const i=parseFloat(n),[s]=fv("spacing.units"),a=Gw({availableUnits:s||["%","px","em","rem","vh","vw"]}),l=(0,S.useMemo)((()=>Ww(n)),[n])[1]||a[0]?.value||"px";return(0,Td.jsxs)("fieldset",{className:"block-editor-height-control",children:[(0,Td.jsx)($_.Ay.VisualLabel,{as:"legend",children:e}),(0,Td.jsxs)(B_.A,{children:[(0,Td.jsx)(R_.A,{isBlock:!0,children:(0,Td.jsx)(ak,{value:n,units:a,onChange:t,onUnitChange:e=>{const[r,o]=Ww(n);["em","rem"].includes(e)&&"px"===o?t((r/16).toFixed(2)+e):["em","rem"].includes(o)&&"px"===e?t(Math.round(16*r)+e):["%","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax"].includes(e)&&r>100&&t(100+e)},min:0,size:"__unstable-large",label:e,hideLabelFromVision:!0})}),(0,Td.jsx)(R_.A,{isBlock:!0,children:(0,Td.jsx)(DT.A,{marginX:2,marginBottom:0,children:(0,Td.jsx)(FC,{value:i,min:0,max:null!==(r=mO[l]?.max)&&void 0!==r?r:100,step:null!==(o=mO[l]?.step)&&void 0!==o?o:.1,withInputField:!1,onChange:e=>{t([e,l].join(""))},__nextHasNoMarginBottom:!0,label:e,hideLabelFromVision:!0})})})]})]})}function bO(e,t){const{orientation:n="horizontal"}=t;return"fill"===e?(0,H.__)("Stretch to fill available space."):"fixed"===e&&"horizontal"===n?(0,H.__)("Specify a fixed width."):"fixed"===e?(0,H.__)("Specify a fixed height."):(0,H.__)("Fit contents.")}function yO({value:e={},onChange:t,parentLayout:n,isShownByDefault:r,panelId:o}){const{selfStretch:i,flexSize:s,columnStart:a,rowStart:l,columnSpan:c,rowSpan:u}=e,{type:d,default:{type:h="default"}={},orientation:p="horizontal"}=null!=n?n:{},f=d||h,m="horizontal"===p?(0,H.__)("Width"):(0,H.__)("Height");return(0,S.useEffect)((()=>{"fixed"!==i||s||t({...e,selfStretch:"fit"})}),[]),(0,Td.jsxs)(Td.Fragment,{children:["flex"===f&&(0,Td.jsxs)(oE.A,{as:YA,spacing:2,hasValue:()=>!!i,label:m,onDeselect:()=>{t({selfStretch:void 0,flexSize:void 0})},isShownByDefault:r,panelId:o,children:[(0,Td.jsxs)(wx,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:vO(n),value:i||"fit",help:bO(i,n),onChange:e=>{t({selfStretch:e,flexSize:"fixed"!==e?null:s})},isBlock:!0,children:[(0,Td.jsx)(zC,{value:"fit",label:(0,H.__)("Fit")},"fit"),(0,Td.jsx)(zC,{value:"fill",label:(0,H.__)("Fill")},"fill"),(0,Td.jsx)(zC,{value:"fixed",label:(0,H.__)("Fixed")},"fixed")]}),"fixed"===i&&(0,Td.jsx)(ak,{size:"__unstable-large",onChange:e=>{t({selfStretch:i,flexSize:e})},value:s})]}),"grid"===f&&(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsxs)(tA.A,{as:YA,hasValue:()=>!!c||!!u,label:(0,H.__)("Grid span"),onDeselect:()=>{t({columnSpan:void 0,rowSpan:void 0})},isShownByDefault:r,panelId:o,children:[(0,Td.jsx)(LT.Ay,{size:"__unstable-large",label:(0,H.__)("Column span"),type:"number",onChange:e=>{t({columnStart:a,rowStart:l,rowSpan:u,columnSpan:e})},value:c,min:1}),(0,Td.jsx)(LT.Ay,{size:"__unstable-large",label:(0,H.__)("Row span"),type:"number",onChange:e=>{t({columnStart:a,rowStart:l,columnSpan:c,rowSpan:e})},value:u,min:1})]}),window.__experimentalEnableGridInteractivity&&(0,Td.jsxs)(B_.A,{as:YA,hasValue:()=>!!a||!!l,label:(0,H.__)("Grid placement"),onDeselect:()=>{t({columnStart:void 0,rowStart:void 0})},isShownByDefault:!1,panelId:o,children:[(0,Td.jsx)(R_.A,{style:{width:"50%"},children:(0,Td.jsx)(LT.Ay,{size:"__unstable-large",label:(0,H.__)("Column"),type:"number",onChange:e=>{t({columnStart:e,rowStart:l,columnSpan:c,rowSpan:u})},value:a,min:1,max:n?.columnCount?n.columnCount-(null!=c?c:1)+1:void 0})}),(0,Td.jsx)(R_.A,{style:{width:"50%"},children:(0,Td.jsx)(LT.Ay,{size:"__unstable-large",label:(0,H.__)("Row"),type:"number",onChange:e=>{t({columnStart:a,rowStart:e,columnSpan:c,rowSpan:u})},value:l,min:1,max:n?.rowCount?n.rowCount-(null!=u?u:1)+1:void 0})})]})]})]})}function vO(e){const{orientation:t="horizontal"}=e;return"horizontal"===t?(0,H.__)("Width"):(0,H.__)("Height")}function _O({panelId:e,value:t,onChange:n=(()=>{}),options:r,defaultValue:o="auto",hasValue:i,isShownByDefault:s=!0}){const a=null!=t?t:"auto",[l,c,u]=fv("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios"),d=c?.map((({name:e,ratio:t})=>({label:e,value:t}))),h=l?.map((({name:e,ratio:t})=>({label:e,value:t}))),p=[{label:(0,H._x)("Original","Aspect ratio option for dimensions control"),value:"auto"},...u?h:[],...d||[],{label:(0,H._x)("Custom","Aspect ratio option for dimensions control"),value:"custom",disabled:!0,hidden:!0}];return(0,Td.jsx)(YA,{hasValue:i||(()=>a!==o),label:(0,H.__)("Aspect ratio"),onDeselect:()=>n(void 0),isShownByDefault:s,panelId:e,children:(0,Td.jsx)(_T.A,{label:(0,H.__)("Aspect ratio"),value:a,options:null!=r?r:p,onChange:n,size:"__unstable-large",__nextHasNoMarginBottom:!0})})}const xO=["horizontal","vertical"];function wO(e){const t=kO(e),n=CO(e),r=SO(e),o=AO(e),i=EO(e),s=IO(e),a=jO(e),l=TO(e);return"web"===Lh.A.OS&&(t||n||r||o||i||s||a||l)}function kO(e){return e?.layout?.contentSize}function CO(e){return e?.layout?.wideSize}function SO(e){return e?.spacing?.padding}function AO(e){return e?.spacing?.margin}function EO(e){return e?.spacing?.blockGap}function IO(e){return e?.dimensions?.minHeight}function jO(e){return e?.dimensions?.aspectRatio}function TO(e){var t;const{type:n="default",default:{type:r="default"}={},allowSizingOnChildren:o=!1}=null!==(t=e?.parentLayout)&&void 0!==t?t:{},i=("flex"===r||"flex"===n||"grid"===r||"grid"===n)&&o;return!!e?.layout&&i}function BO(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 RO(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function NO({resetAllFilter:e,onChange:t,value:n,panelId:r,children:o}){return(0,Td.jsx)(wA,{label:(0,H.__)("Dimensions"),resetAll:()=>{const r=e(n);t(r)},panelId:r,dropdownMenuProps:jv,children:o})}const DO={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,minHeight:!0,aspectRatio:!0,childLayout:!0};function MO({as:e=NO,value:t,onChange:n,inheritedValue:r=t,settings:o,panelId:i,defaultControls:s=DO,onVisualize:a=(()=>{}),includeLayoutControls:l=!1}){var c,u,d,h,p,f,m,g;const{dimensions:b,spacing:y}=o,v=e=>e&&"object"==typeof e?Object.keys(e).reduce(((t,n)=>(t[n]=Bv({settings:{dimensions:b,spacing:y}},"",e[n]),t)),{}):Bv({settings:{dimensions:b,spacing:y}},"",e),_=function(e){const{defaultSpacingSizes:t,spacingSizes:n}=e?.spacing||{};return!1!==t&&n?.default?.length>0||n?.theme?.length>0||n?.custom?.length>0}(o),x=Gw({availableUnits:o?.spacing?.units||["%","px","em","rem","vw"]}),w=-1/0,[k,C]=(0,S.useState)(w),A=kO(o)&&l,E=v(r?.layout?.contentSize),I=e=>{n(Lf(t,["layout","contentSize"],e||void 0))},j=CO(o)&&l,T=v(r?.layout?.wideSize),B=e=>{n(Lf(t,["layout","wideSize"],e||void 0))},R=SO(o),N=RO(v(r?.spacing?.padding)),D=Array.isArray(o?.spacing?.padding)?o?.spacing?.padding:o?.spacing?.padding?.sides,M=D&&D.some((e=>xO.includes(e))),P=e=>{const r=BO(e,D);n(Lf(t,["spacing","padding"],r))},O=()=>a("padding"),L=AO(o),F=RO(v(r?.spacing?.margin)),z=Array.isArray(o?.spacing?.margin)?o?.spacing?.margin:o?.spacing?.margin?.sides,U=z&&z.some((e=>xO.includes(e))),V=e=>{const r=BO(e,z);n(Lf(t,["spacing","margin"],r))},$=()=>a("margin"),W=EO(o),G=v(r?.spacing?.blockGap),q=function(e){return e&&"string"==typeof e?{top:e}:e?{...e,right:e?.left,bottom:e?.top}:e}(G),K=Array.isArray(o?.spacing?.blockGap)?o?.spacing?.blockGap:o?.spacing?.blockGap?.sides,Y=K&&K.some((e=>xO.includes(e))),J=e=>{n(Lf(t,["spacing","blockGap"],e))},X=e=>{e||J(null),!Y&&e?.hasOwnProperty("top")?J(e.top):J({top:e?.top,left:e?.left})},Z=IO(o),Q=v(r?.dimensions?.minHeight),ee=e=>{const r=Lf(t,["dimensions","minHeight"],e);n(Lf(r,["dimensions","aspectRatio"],void 0))},te=jO(o),ne=v(r?.dimensions?.aspectRatio),re=TO(o),oe=r?.layout,ie=(0,S.useCallback)((e=>({...e,layout:Wv({...e?.layout,contentSize:void 0,wideSize:void 0,selfStretch:void 0,flexSize:void 0,columnStart:void 0,rowStart:void 0,columnSpan:void 0,rowSpan:void 0}),spacing:{...e?.spacing,padding:void 0,margin:void 0,blockGap:void 0},dimensions:{...e?.dimensions,minHeight:void 0,aspectRatio:void 0}})),[]),se=()=>a(!1),ae={min:k,onDragStart:()=>{C(0)},onDragEnd:()=>{C(w)}};return(0,Td.jsxs)(e,{resetAllFilter:ie,value:t,onChange:n,panelId:i,children:[(A||j)&&(0,Td.jsx)("span",{className:"span-columns",children:(0,H.__)("Set the width of the main content area.")}),A&&(0,Td.jsx)(YA,{className:"single-column",label:(0,H.__)("Content size"),hasValue:()=>!!t?.layout?.contentSize,onDeselect:()=>I(void 0),isShownByDefault:null!==(c=s.contentSize)&&void 0!==c?c:DO.contentSize,panelId:i,children:(0,Td.jsxs)(tA.A,{alignment:"flex-end",justify:"flex-start",children:[(0,Td.jsx)(ak,{label:(0,H.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:E||"",onChange:e=>{I(e)},units:x}),(0,Td.jsx)(px.A,{children:(0,Td.jsx)(lk.A,{icon:ck.A})})]})}),j&&(0,Td.jsx)(YA,{className:"single-column",label:(0,H.__)("Wide size"),hasValue:()=>!!t?.layout?.wideSize,onDeselect:()=>B(void 0),isShownByDefault:null!==(u=s.wideSize)&&void 0!==u?u:DO.wideSize,panelId:i,children:(0,Td.jsxs)(tA.A,{alignment:"flex-end",justify:"flex-start",children:[(0,Td.jsx)(ak,{label:(0,H.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:T||"",onChange:e=>{B(e)},units:x}),(0,Td.jsx)(px.A,{children:(0,Td.jsx)(lk.A,{icon:uk.A})})]})}),R&&(0,Td.jsxs)(YA,{hasValue:()=>!!t?.spacing?.padding&&Object.keys(t?.spacing?.padding).length,label:(0,H.__)("Padding"),onDeselect:()=>P(void 0),isShownByDefault:null!==(d=s.padding)&&void 0!==d?d:DO.padding,className:(0,$v.A)({"tools-panel-item-spacing":_}),panelId:i,children:[!_&&(0,Td.jsx)(nO,{values:N,onChange:P,label:(0,H.__)("Padding"),sides:D,units:x,allowReset:!1,splitOnAxis:M,onMouseOver:O,onMouseOut:se}),_&&(0,Td.jsx)(fO,{values:N,onChange:P,label:(0,H.__)("Padding"),sides:D,units:x,allowReset:!1,onMouseOver:O,onMouseOut:se})]}),L&&(0,Td.jsxs)(YA,{hasValue:()=>!!t?.spacing?.margin&&Object.keys(t?.spacing?.margin).length,label:(0,H.__)("Margin"),onDeselect:()=>V(void 0),isShownByDefault:null!==(h=s.margin)&&void 0!==h?h:DO.margin,className:(0,$v.A)({"tools-panel-item-spacing":_}),panelId:i,children:[!_&&(0,Td.jsx)(nO,{values:F,onChange:V,inputProps:ae,label:(0,H.__)("Margin"),sides:z,units:x,allowReset:!1,splitOnAxis:U,onMouseOver:$,onMouseOut:se}),_&&(0,Td.jsx)(fO,{values:F,onChange:V,minimumCustomValue:-1/0,label:(0,H.__)("Margin"),sides:z,units:x,allowReset:!1,onMouseOver:$,onMouseOut:se})]}),W&&(0,Td.jsxs)(YA,{hasValue:()=>!!t?.spacing?.blockGap,label:(0,H.__)("Block spacing"),onDeselect:()=>J(void 0),isShownByDefault:null!==(p=s.blockGap)&&void 0!==p?p:DO.blockGap,className:(0,$v.A)({"tools-panel-item-spacing":_}),panelId:i,children:[!_&&(Y?(0,Td.jsx)(nO,{label:(0,H.__)("Block spacing"),min:0,onChange:X,units:x,sides:K,values:q,allowReset:!1,splitOnAxis:Y}):(0,Td.jsx)(ak,{label:(0,H.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:J,units:x,value:G})),_&&(0,Td.jsx)(fO,{label:(0,H.__)("Block spacing"),min:0,onChange:X,showSideInLabel:!1,sides:Y?K:["top"],values:q,allowReset:!1})]}),re&&(0,Td.jsx)(yO,{value:oe,onChange:e=>{n({...t,layout:{...e}})},parentLayout:o?.parentLayout,panelId:i,isShownByDefault:null!==(f=s.childLayout)&&void 0!==f?f:DO.childLayout}),Z&&(0,Td.jsx)(YA,{hasValue:()=>!!t?.dimensions?.minHeight,label:(0,H.__)("Minimum height"),onDeselect:()=>{ee(void 0)},isShownByDefault:null!==(m=s.minHeight)&&void 0!==m?m:DO.minHeight,panelId:i,children:(0,Td.jsx)(gO,{label:(0,H.__)("Minimum height"),value:Q,onChange:ee})}),te&&(0,Td.jsx)(_O,{hasValue:()=>!!t?.dimensions?.aspectRatio,value:ne,onChange:e=>{const r=Lf(t,["dimensions","aspectRatio"],e);n(Lf(r,["dimensions","minHeight"],void 0))},panelId:i,isShownByDefault:null!==(g=s.aspectRatio)&&void 0!==g?g:DO.aspectRatio})]})}function PO({clientId:e,value:t,computeStyle:n,forceShow:r}){const o=qC(e),[i,s]=(0,S.useReducer)((()=>n(o)));(0,S.useLayoutEffect)((()=>{o&&window.requestAnimationFrame((()=>window.requestAnimationFrame(s)))}),[o,t]);const a=(0,S.useRef)(t),[l,c]=(0,S.useState)(!1);return(0,S.useEffect)((()=>{if((0,Id.default)(t,a.current)||r)return;c(!0),a.current=t;const e=setTimeout((()=>{c(!1)}),400);return()=>{c(!1),clearTimeout(e)}}),[t,r]),l||r?(0,Td.jsx)(eS,{clientId:e,__unstablePopoverSlot:"block-toolbar",children:(0,Td.jsx)("div",{className:"block-editor__spacing-visualizer",style:i})}):null}function OO(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)}function LO({clientId:e,value:t,forceShow:n}){return(0,Td.jsx)(PO,{clientId:e,value:t?.spacing?.margin,computeStyle:e=>{const t=OO(e,"margin-top"),n=OO(e,"margin-right"),r=OO(e,"margin-bottom"),o=OO(e,"margin-left");return{borderTopWidth:t,borderRightWidth:n,borderBottomWidth:r,borderLeftWidth:o,top:t?`-${t}`:0,right:n?`-${n}`:0,bottom:r?`-${r}`:0,left:o?`-${o}`:0}},forceShow:n})}function FO({clientId:e,value:t,forceShow:n}){return(0,Td.jsx)(PO,{clientId:e,value:t?.spacing?.padding,computeStyle:e=>({borderTopWidth:OO(e,"padding-top"),borderRightWidth:OO(e,"padding-right"),borderBottomWidth:OO(e,"padding-bottom"),borderLeftWidth:OO(e,"padding-left")}),forceShow:n})}const zO="dimensions",UO="spacing";function VO({children:e,resetAllFilter:t}){const n=(0,S.useCallback)((e=>{const n=e.style,r=t(n);return{...e,style:r}}),[t]);return(0,Td.jsx)(IA,{group:"dimensions",resetAllFilter:n,children:e})}function HO({clientId:e,name:t,setAttributes:n,settings:r}){const o=wO(r),i=(0,Ul.A)((t=>t(hv).getBlockAttributes(e)?.style),[e]),[s,a]=function(){const[e,t]=(0,S.useState)(!1),{hideBlockInterface:n,showBlockInterface:r}=Cf((0,Vl.A)(hv));return(0,S.useEffect)((()=>{e?n():r()}),[e,r,n]),[e,t]}();if(!o)return null;const l={...Ec(t,[zO,"__experimentalDefaultControls"]),...Ec(t,[UO,"__experimentalDefaultControls"])};return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(MO,{as:VO,panelId:e,settings:r,value:i,onChange:e=>{n({style:Wv(e)})},defaultControls:l,onVisualize:a}),!!r?.spacing?.padding&&(0,Td.jsx)(FO,{forceShow:"padding"===s,clientId:e,value:i}),!!r?.spacing?.margin&&(0,Td.jsx)(LO,{forceShow:"margin"===s,clientId:e,value:i})]})}function $O(e,t="any"){if("web"!==Lh.A.OS)return!1;const n=Ec(e,zO);return!(!0!==n&&("any"===t?!n?.aspectRatio&&!n?.minHeight:!n?.[t]))}const WO={useBlockProps:function({name:e,minHeight:t,style:n}){if(!$O(e,"aspectRatio")||qv(e,zO,"aspectRatio"))return{};const r=(0,$v.A)({"has-aspect-ratio":!!n?.dimensions?.aspectRatio}),o={};return n?.dimensions?.aspectRatio?o.minHeight="unset":(t||n?.dimensions?.minHeight)&&(o.aspectRatio="unset"),{className:r,style:o}},attributeKeys:["minHeight","style"],hasSupport:e=>$O(e,"aspectRatio")},GO=[...mP,qR,CD,zO,Tj,UO,KR],qO=e=>GO.some((t=>Ic(e,t)));function KO(e={}){const t={};return Zk(e).forEach((e=>{t[e.key]=e.value})),t}const YO={[`${qR}.__experimentalSkipSerialization`]:["border"],[`${CD}.__experimentalSkipSerialization`]:[CD],[`${fP}.__experimentalSkipSerialization`]:[fP],[`${zO}.__experimentalSkipSerialization`]:[zO],[`${UO}.__experimentalSkipSerialization`]:[UO],[`${KR}.__experimentalSkipSerialization`]:[KR]},JO={...YO,[`${zO}.aspectRatio`]:[`${zO}.aspectRatio`],[`${Tj}`]:[Tj]},XO={[`${zO}.aspectRatio`]:!0,[`${Tj}`]:!0},ZO={gradients:"gradient"};function QO(e,t,n=!1){if(!e)return e;let r=e;return n||(r=JSON.parse(JSON.stringify(e))),Array.isArray(t)||(t=[t]),t.forEach((e=>{if(Array.isArray(e)||(e=e.split(".")),e.length>1){const[t,...n]=e;QO(r[t],[n],!0)}else 1===e.length&&delete r[e[0]]})),r}function eL(e,t,n,r=JO){if(!qO(t))return e;let{style:o}=n;return Object.entries(r).forEach((([e,n])=>{const r=XO[e]||Ec(t,e);!0===r&&(o=QO(o,n)),Array.isArray(r)&&r.forEach((e=>{const t=ZO[e]||e;o=QO(o,[[...n,t]])}))})),e.style={...KO(o),...e.style},e}const tL={edit:function({clientId:e,name:t,setAttributes:n,__unstableParentLayout:r}){const o=Jv(t,r),i=IS(),s={clientId:e,name:t,setAttributes:n,settings:{...o,typography:{...o.typography,textAlign:!1}}};return"default"!==i?null:(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(DD,{...s}),(0,Td.jsx)(Mj,{...s}),(0,Td.jsx)(vP,{...s}),(0,Td.jsx)(tN,{...s}),(0,Td.jsx)(HO,{...s})]})},hasSupport:qO,addSaveProps:eL,attributeKeys:["style"],useBlockProps:function e({name:t,style:n}){const r=`wp-elements-${(0,z_.A)(e)}`,o=`.editor-styles-wrapper .${r}`,i=n?.elements,s=(0,S.useMemo)((()=>{if(!i)return;const e=[];return nL.forEach((({elementType:n,pseudo:r,elements:s})=>{if(qv(t,CD,n))return;const a=i?.[n];if(a){const t=Rv(o,dc[n]);e.push(Xk(a,{selector:t})),r&&r.forEach((t=>{a[t]&&e.push(Xk(a[t],{selector:Rv(o,`${dc[n]}${t}`)}))}))}s&&s.forEach((t=>{i[t]&&e.push(Xk(i[t],{selector:Rv(o,dc[t])}))}))})),e.length>0?e.join(""):void 0}),[o,i,t]);return Yv({css:s}),eL({className:r},t,{style:n},YO)}},nL=[{elementType:"button"},{elementType:"link",pseudo:[":hover"]},{elementType:"heading",elements:["h1","h2","h3","h4","h5","h6"]}];(0,Tu.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return qO(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,Tu.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){return Ic(e,"__experimentalSettings",!1)?(e?.attributes?.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e}));var rL=n(10854);function oL(e=[],t="90deg"){const n=100/e.length,r=e.map(((e,t)=>`${e} ${t*n}%, ${e} ${(t+1)*n}%`)).join(", ");return`linear-gradient( ${t}, ${r} )`}(0,oc.X$)([ic.A]);const iL=function({values:e}){return e?(0,Td.jsx)(bT,{colorValue:oL(e,"135deg")}):(0,Td.jsx)(Ux.A,{icon:rL.A})};function sL({label:e,value:t,colors:n,disableCustomColors:r,enableAlpha:o,onChange:i}){const[s,a]=(0,S.useState)(!1),l=(0,z_.A)(sL,"color-list-picker-option"),c=`${l}__label`,u=`${l}__content`;return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(Zv.Ay,{className:"components-color-list-picker__swatch-button",onClick:()=>a((e=>!e)),"aria-expanded":s,"aria-controls":u,children:(0,Td.jsxs)(tA.A,{justify:"flex-start",spacing:2,children:[t?(0,Td.jsx)(bT,{colorValue:t,className:"components-color-list-picker__swatch-color"}):(0,Td.jsx)(Ux.A,{icon:rL.A}),(0,Td.jsx)("span",{id:c,children:e})]})}),(0,Td.jsx)("div",{role:"group",id:u,"aria-labelledby":c,"aria-hidden":!s,children:s&&(0,Td.jsx)(WB,{"aria-label":(0,H.__)("Color options"),className:"components-color-list-picker__color-picker",colors:n,value:t,clearable:!1,onChange:i,disableCustomColors:r,enableAlpha:o})})]})}const aL=function({colors:e,labels:t,value:n=[],disableCustomColors:r,enableAlpha:o,onChange:i}){return(0,Td.jsx)("div",{className:"components-color-list-picker",children:t.map(((t,s)=>(0,Td.jsx)(sL,{label:t,value:n[s],colors:e,disableCustomColors:r,enableAlpha:o,onChange:e=>{const t=n.slice();t[s]=e,i(t)}},s)))})},lL=["#333","#CCC"];function cL({value:e,onChange:t}){const n=!!e,r=n?e:lL,o=oL(r),i=(s=r).map(((e,t)=>({position:100*t/(s.length-1),color:e})));var s;return(0,Td.jsx)(MN,{disableInserter:!0,background:o,hasGradient:n,value:i,onChange:e=>{const n=function(e=[]){return e.map((({color:e})=>e))}(e);t(n)}})}const uL=function({asButtons:e,loop:t,clearable:n=!0,unsetable:r=!0,colorPalette:o,duotonePalette:i,disableCustomColors:s,disableCustomDuotone:a,value:l,onChange:c,"aria-label":u,"aria-labelledby":d,...h}){const[p,f]=(0,S.useMemo)((()=>{return!(e=o)||e.length<2?["#000","#fff"]:e.map((({color:e})=>({color:e,brightness:(0,oc.Mj)(e).brightness()}))).reduce((([e,t],n)=>[n.brightness<=e.brightness?n:e,n.brightness>=t.brightness?n:t]),[{brightness:1,color:""},{brightness:0,color:""}]).map((({color:e})=>e));var e}),[o]),m="unset"===l,g=(0,H.__)("Unset"),b=(0,Td.jsx)(MB.Option,{value:"unset",isSelected:m,tooltipText:g,"aria-label":g,className:"components-duotone-picker__color-indicator",onClick:()=>{c(m?void 0:"unset")}},"unset"),y=i.map((({colors:e,slug:t,name:n})=>{const r={background:oL(e,"135deg"),color:"transparent"},o=null!=n?n:(0,H.sprintf)((0,H.__)("Duotone code: %s"),t),i=n?(0,H.sprintf)((0,H.__)("Duotone: %s"),n):o,s=M()(e,l);return(0,Td.jsx)(MB.Option,{value:e,isSelected:s,"aria-label":i,tooltipText:o,style:r,onClick:()=>{c(s?void 0:e)}},t)}));let v;if(e)v={asButtons:!0};else{const e={asButtons:!1,loop:t};v=u?{...e,"aria-label":u}:d?{...e,"aria-labelledby":d}:{...e,"aria-label":(0,H.__)("Custom color picker.")}}const _=r?[b,...y]:y;return(0,Td.jsx)(MB,{...h,...v,options:_,actions:!!n&&(0,Td.jsx)(MB.ButtonAction,{onClick:()=>c(void 0),children:(0,H.__)("Clear")}),children:(0,Td.jsx)(DT.A,{paddingTop:0===_.length?0:4,children:(0,Td.jsxs)(oE.A,{spacing:3,children:[!s&&!a&&(0,Td.jsx)(cL,{value:m?void 0:l,onChange:c}),!a&&(0,Td.jsx)(aL,{labels:[(0,H.__)("Shadows"),(0,H.__)("Highlights")],colors:o,value:m?void 0:l,disableCustomColors:s,enableAlpha:!0,onChange:e=>{e[0]||(e[0]=p),e[1]||(e[1]=f);const t=e.length>=2?e:void 0;c(t)}})]})})})};var dL=n(96360);const hL=function e({id:t,colorPalette:n,duotonePalette:r,disableCustomColors:o,disableCustomDuotone:i,value:s,onChange:a}){let l;l="unset"===s?(0,Td.jsx)(bT,{className:"block-editor-duotone-control__unset-indicator"}):s?(0,Td.jsx)(iL,{values:s}):(0,Td.jsx)(lk.A,{icon:dL.A});const c=(0,H.__)("Apply duotone filter"),u=`${(0,z_.A)(e,"duotone-control",t)}__description`;return(0,Td.jsx)(PE.A,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,H.__)("Duotone")},renderToggle:({isOpen:e,onToggle:t})=>(0,Td.jsx)(r_,{showTooltip:!0,onClick:t,"aria-haspopup":"true","aria-expanded":e,onKeyDown:n=>{e||n.keyCode!==VE.DOWN||(n.preventDefault(),t())},label:c,icon:l}),renderContent:()=>(0,Td.jsxs)(w_.A,{label:(0,H.__)("Duotone"),children:[(0,Td.jsx)("p",{children:(0,H.__)("Create a two-tone color effect without losing your original image.")}),(0,Td.jsx)(uL,{"aria-label":c,"aria-describedby":u,colorPalette:n,duotonePalette:r,disableCustomColors:o,disableCustomDuotone:i,value:s,onChange:a})]})})};function pL(e){return`${e}{filter:none}`}function fL(e,t){return`${e}{filter:url(#${t})}`}function mL(e,t){const n=function(e=[]){const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=(0,oc.Mj)(e).toRgb();t.r.push(n.r/255),t.g.push(n.g/255),t.b.push(n.b/255),t.a.push(n.a)})),t}(t);return`\n<svg\n\txmlns:xlink="http://www.w3.org/1999/xlink"\n\tviewBox="0 0 0 0"\n\twidth="0"\n\theight="0"\n\tfocusable="false"\n\trole="none"\n\taria-hidden="true"\n\tstyle="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;"\n>\n\t<defs>\n\t\t<filter id="${e}">\n\t\t\t\x3c!--\n\t\t\t\tUse sRGB instead of linearRGB so transparency looks correct.\n\t\t\t\tUse perceptual brightness to convert to grayscale.\n\t\t\t--\x3e\n\t\t\t<feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "></feColorMatrix>\n\t\t\t\x3c!-- Use sRGB instead of linearRGB to be consistent with how CSS gradients work. --\x3e\n\t\t\t<feComponentTransfer color-interpolation-filters="sRGB">\n\t\t\t\t<feFuncR type="table" tableValues="${n.r.join(" ")}"></feFuncR>\n\t\t\t\t<feFuncG type="table" tableValues="${n.g.join(" ")}"></feFuncG>\n\t\t\t\t<feFuncB type="table" tableValues="${n.b.join(" ")}"></feFuncB>\n\t\t\t\t<feFuncA type="table" tableValues="${n.a.join(" ")}"></feFuncA>\n\t\t\t</feComponentTransfer>\n\t\t\t\x3c!-- Re-mask the image with the original transparency since the feColorMatrix above loses that information. --\x3e\n\t\t\t<feComposite in2="SourceGraphic" operator="in"></feComposite>\n\t\t</filter>\n\t</defs>\n</svg>`}function gL(e,t="root",n={}){if(!t)return null;const{fallback:r=!1}=n,{name:o,selectors:i,supports:s}=e,a=i&&Object.keys(i).length>0,l=Array.isArray(t)?t.join("."):t;let c=null;if(c=a&&i.root?i?.root:s?.__experimentalSelector?s.__experimentalSelector:".wp-block-"+o.replace("core/","").replace("/","-"),"root"===l)return c;const u=Array.isArray(t)?t:t.split(".");if(1===u.length){const e=r?c:null;if(a)return Ff(i,`${l}.root`,null)||Ff(i,l,null)||e;const t=Ff(s,`${l}.__experimentalSelector`,null);return t?Rv(c,t):e}let d;return a&&(d=Ff(i,l,null)),d||(r?gL(e,u[0],n):null)}const bL=[];function yL(e,{presetSetting:t,defaultSetting:n}){const r=!e?.color?.[n],o=e?.color?.[t]?.custom||bL,i=e?.color?.[t]?.theme||bL,s=e?.color?.[t]?.default||bL;return(0,S.useMemo)((()=>[...o,...i,...r?bL:s]),[r,o,i,s])}function vL(e){return _L(e)}function _L(e){return e.color.customDuotone||e.color.defaultDuotone||e.color.duotone.length>0}function xL({resetAllFilter:e,onChange:t,value:n,panelId:r,children:o}){return(0,Td.jsx)(wA,{label:(0,H._x)("Filters","Name for applying graphical effects"),resetAll:()=>{const r=e(n);t(r)},panelId:r,dropdownMenuProps:jv,children:o})}const wL={duotone:!0},kL={placement:"left-start",offset:36,shift:!0,className:"block-editor-duotone-control__popover",headerTitle:(0,H.__)("Duotone")},CL=({indicator:e,label:t})=>(0,Td.jsxs)(tA.A,{justify:"flex-start",children:[(0,Td.jsx)(hN,{isLayered:!1,offset:-8,children:(0,Td.jsx)(B_.A,{expanded:!1,children:"unset"!==e&&e?(0,Td.jsx)(iL,{values:e}):(0,Td.jsx)(bT,{className:"block-editor-duotone-control__unset-indicator"})})}),(0,Td.jsx)(R_.A,{title:t,children:t})]});function SL({as:e=xL,value:t,onChange:n,inheritedValue:r=t,settings:o,panelId:i,defaultControls:s=wL}){const a=_L(o),l=yL(o,{presetSetting:"duotone",defaultSetting:"defaultDuotone"}),c=yL(o,{presetSetting:"palette",defaultSetting:"defaultPalette"}),u=(d=r?.filter?.duotone,Bv({settings:o},"",d));var d;const h=e=>{const r=l.find((({colors:t})=>t===e)),o=r?`var:preset|duotone|${r.slug}`:e;n(Lf(t,["filter","duotone"],o))},p=(0,S.useCallback)((e=>({...e,filter:{...e.filter,duotone:void 0}})),[]);return(0,Td.jsx)(e,{resetAllFilter:p,value:t,onChange:n,panelId:i,children:a&&(0,Td.jsx)(YA,{label:(0,H.__)("Duotone"),hasValue:()=>!!t?.filter?.duotone,onDeselect:()=>h(void 0),isShownByDefault:s.duotone,panelId:i,children:(0,Td.jsx)(PE.A,{popoverProps:kL,className:"block-editor-global-styles-filters-panel__dropdown",renderToggle:({onToggle:e,isOpen:t})=>{const n={onClick:e,className:(0,$v.A)({"is-open":t}),"aria-expanded":t};return(0,Td.jsx)($A,{isBordered:!0,isSeparated:!0,children:(0,Td.jsx)(Zv.Ay,{...n,children:(0,Td.jsx)(CL,{indicator:u,label:(0,H.__)("Duotone")})})})},renderContent:()=>(0,Td.jsx)(FB,{paddingSize:"small",children:(0,Td.jsxs)(w_.A,{label:(0,H.__)("Duotone"),children:[(0,Td.jsx)("p",{children:(0,H.__)("Create a two-tone color effect without losing your original image.")}),(0,Td.jsx)(uL,{colorPalette:c,duotonePalette:l,disableCustomColors:!0,disableCustomDuotone:!0,value:u,onChange:h})]})})})})})}const AL=[],EL=window?.navigator.userAgent&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")&&!window.navigator.userAgent.includes("Chromium");function IL({presetSetting:e,defaultSetting:t}){const[n,r,o,i]=fv(t,`${e}.custom`,`${e}.theme`,`${e}.default`);return(0,S.useMemo)((()=>[...r||AL,...o||AL,...n&&i||AL]),[n,r,o,i])}function jL(e,t){if(!e)return;const n=t?.find((({slug:t})=>e===`var:preset|duotone|${t}`));return n?n.colors:void 0}(0,oc.X$)([ic.A]);const TL={shareWithChildBlocks:!0,edit:function({style:e,setAttributes:t,name:n}){const r=e?.color?.duotone,o=Jv(n),i=IS(),s=IL({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=IL({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),[l,c]=fv("color.custom","color.customDuotone"),u=!l,d=!c||0===a?.length&&u;if(0===s?.length&&d)return null;if("default"!==i)return null;const h=Array.isArray(r)?r:jL(r,s);return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(IA,{group:"filter",children:(0,Td.jsx)(SL,{value:{filter:{duotone:h}},onChange:n=>{const r={...e,color:{...n?.filter}};t({style:r})},settings:o})}),(0,Td.jsx)(__,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,Td.jsx)(hL,{duotonePalette:s,colorPalette:a,disableCustomDuotone:d,disableCustomColors:u,value:h,onChange:n=>{const r=function(e,t){if(!e||!Array.isArray(e))return;const n=t?.find((t=>t?.colors?.every(((t,n)=>t===e[n]))));return n?`var:preset|duotone|${n.slug}`:void 0}(n,s),o={...e,color:{...e?.color,duotone:null!=r?r:n}};t({style:o})},settings:o})})]})},useBlockProps:function e({name:t,style:n}){const r=(0,z_.A)(e),o=(0,S.useMemo)((()=>{const e=Sc(t);if(e){if(!Ec(e,"filter.duotone",!1))return null;const t=Ec(e,"color.__experimentalDuotone",!1);if(t){const n=gL(e);return"string"==typeof t?Rv(n,t):n}return gL(e,"filter.duotone",{fallback:!0})}}),[t]),i=n?.color?.duotone,s=`wp-duotone-${r}`,a=o&&i;return function({clientId:e,id:t,selector:n,attribute:r}){const o=IL({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),i=Array.isArray(r),s=i?void 0:jL(r,o),a="string"==typeof r&&s;let l=null;a?l=s:("string"==typeof r&&!a||i)&&(l=r);const c=n.split(",").map((e=>`.${t}${e.trim()}`)).join(", "),u=Array.isArray(l)||"unset"===l;Yv(u?{css:"unset"!==l?fL(c,t):pL(c),__unstableType:"presets"}:void 0),Yv(u?{assets:"unset"!==l?mL(t,l):"",__unstableType:"svgs"}:void 0);const d=qC(e);(0,S.useEffect)((()=>{if(u&&d&&EL){const e=d.style.display;d.style.display="inline-block",d.offsetHeight,d.style.display=e}}),[u,d])}({clientId:r,id:s,selector:o,attribute:i}),{className:a?s:""}},attributeKeys:["style"],hasSupport:e=>Ic(e,"filter.duotone")};function BL(e){return(0,Ul.A)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:r}=t(hv),{getBlockType:o,getActiveBlockVariation:i}=t(ed),s=n(e),a=o(s);if(!a)return null;const l=r(e),c=i(s,l),u=jc(a)||Tc(a),d=(u?Oc(a,l):void 0)||a.title,h=function(e){const t=e?.style?.position?.type;return"sticky"===t?(0,H.__)("Sticky"):"fixed"===t?(0,H.__)("Fixed"):null}(l),p={isSynced:u,title:d,icon:a.icon,description:a.description,anchor:l?.anchor,positionLabel:h,positionType:l?.style?.position?.type,name:l?.metadata?.name};return c?{isSynced:u,title:c.title||a.title,icon:c.icon||a.icon,description:c.description||a.description,anchor:l?.anchor,positionLabel:h,positionType:l?.style?.position?.type,name:l?.metadata?.name}:p}),[e])}(0,Tu.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return Ic(e,"filter.duotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e}));const{CustomSelectControl:RL}=Cf(d_.j),NL="position",DL="block-editor-hooks__position-selection__select-control__option",ML={key:"default",value:"",name:(0,H.__)("Default"),className:DL},PL={key:"sticky",value:"sticky",name:(0,H._x)("Sticky","Name for the value of the CSS position property"),className:DL,__experimentalHint:(0,H.__)("The block will stick to the top of the window instead of scrolling.")},OL={key:"fixed",value:"fixed",name:(0,H._x)("Fixed","Name for the value of the CSS position property"),className:DL,__experimentalHint:(0,H.__)("The block will not move when the page is scrolled.")},LL=["top","right","bottom","left"],FL=["sticky","fixed"];function zL(e){const t=e?.style?.position?.type;return"sticky"===t||"fixed"===t}function UL({name:e}={}){const[t,n]=fv("position.fixed","position.sticky"),r=!t&&!n;return!Ec(e,NL)||r}function VL({style:e={},clientId:t,name:n,setAttributes:r}){const o=function(e){const t=Ec(e,NL);return!(!0!==t&&!t?.fixed)}(n),i=function(e){const t=Ec(e,NL);return!(!0!==t&&!t?.sticky)}(n),s=e?.position?.type,{firstParentClientId:a}=(0,Ul.A)((e=>{const{getBlockParents:n}=e(hv),r=n(t);return{firstParentClientId:r[r.length-1]}}),[t]),l=BL(a),c=i&&s===PL.value&&l?(0,H.sprintf)((0,H.__)("The block will stick to the scrollable area of the parent %s block."),l.title):null,u=(0,S.useMemo)((()=>{const e=[ML];return(i||s===PL.value)&&e.push(PL),(o||s===OL.value)&&e.push(OL),e}),[o,i,s]),d=s&&u.find((e=>e.value===s))||ML;return Lh.A.select({web:u.length>1?(0,Td.jsx)(IA,{group:"position",children:(0,Td.jsx)($_.Ay,{className:"block-editor-hooks__position-selection",__nextHasNoMarginBottom:!0,help:c,children:(0,Td.jsx)(RL,{__next40pxDefaultSize:!0,className:"block-editor-hooks__position-selection__select-control",label:(0,H.__)("Position"),hideLabelFromVision:!0,describedBy:(0,H.sprintf)((0,H.__)("Currently selected position: %s"),d.name),options:u,value:d,__experimentalShowSelectedHint:!0,onChange:({selectedItem:t})=>{(t=>{const n={...e,position:{...e?.position,type:t,top:"sticky"===t||"fixed"===t?"0px":void 0}};r({style:Wv(n)})})(t.value)},size:"__unstable-large"})})}):null,native:null})}const HL={edit:function(e){return UL(e)?null:(0,Td.jsx)(VL,{...e})},useBlockProps:function e({name:t,style:n}){const r=Ic(t,NL),o=UL({name:t}),i=r&&!o,s=(0,z_.A)(e);let a;i&&(a=function({selector:e,style:t}){let n="";const{type:r}=t?.position||{};return FL.includes(r)?(n+=`${e} {`,n+=`position: ${r};`,LL.forEach((e=>{void 0!==t?.position?.[e]&&(n+=`${e}: ${t.position[e]};`)})),"sticky"!==r&&"fixed"!==r||(n+="z-index: 10"),n+="}",n):n}({selector:`.wp-container-${s}.wp-container-${s}`,style:n})||"");const l=(0,$v.A)({[`wp-container-${s}`]:i&&!!a,[`is-position-${n?.position?.type}`]:i&&!!a&&!!n?.position?.type});return Yv({css:a}),{className:l}},attributeKeys:["style"],hasSupport:e=>Ic(e,NL)},$L={__experimentalBorder:"border",color:"color",spacing:"spacing",typography:"typography"},{kebabCase:WL}=Cf(d_.j);function GL(e){return e?.startsWith?.("var:")?`var(--wp--${e.slice(4).split("|").join("--")})`:e}function qL(e={},t,n){let r=[];return Object.keys(e).forEach((o=>{const i=t+WL(o.replace("/","-")),s=e[o];if(s instanceof Object){const e=i+n;r=[...r,...qL(s,e,n)]}else r.push(`${i}: ${s}`)})),r}const KL=(e,t)=>{const n={};return Object.entries(e).forEach((([e,r])=>{if("root"===e||!t?.[e])return;const o="string"==typeof r;if(o||Object.entries(r).forEach((([r,o])=>{if("root"===r||!t?.[e][r])return;const i=YL({[e]:{[r]:t[e][r]}});n[o]=[...n[o]||[],...i],delete t[e][r]})),o||r.root){const i=o?r:r.root,s=YL({[e]:t[e]});n[i]=[...n[i]||[],...s],delete t[e]}})),n};function YL(e={},t="",n,r={},o=!1){const i=Sv===t,s=Object.entries(uc).reduce(((t,[r,{value:o,properties:s,useEngine:a,rootOnly:l}])=>{if(l&&!i)return t;const c=o;if("elements"===c[0]||a)return t;const u=Ff(e,c);if("--wp--style--root--padding"===r&&("string"==typeof u||!n))return t;if(s&&"string"!=typeof u)Object.entries(s).forEach((e=>{const[n,r]=e;if(!Ff(u,[r],!1))return;const o=n.startsWith("--")?n:WL(n);t.push(`${o}: ${GL(Ff(u,[r]))}`)}));else if(Ff(e,c,!1)){const n=r.startsWith("--")?r:WL(r);t.push(`${n}: ${GL(Ff(e,c))}`)}return t}),[]);return Zk(e).forEach((e=>{if(i&&(n||o)&&e.key.startsWith("padding"))return;const t=e.key.startsWith("--")?e.key:WL(e.key);let a=e.value;if("string"!=typeof a&&a?.ref){const e=a.ref.split(".");if(a=GL(Ff(r,e)),!a||a?.ref)return}"font-size"===t&&(a=kv({size:a},r?.settings)),"aspect-ratio"===t&&s.push("min-height: unset"),s.push(`${t}: ${a}`)})),s}function JL({layoutDefinitions:e=$x,style:t,selector:n,hasBlockGapSupport:r,hasFallbackGapSupport:o,fallbackGapValue:i}){let s="",a=r?hw(t?.spacing?.blockGap):"";if(o&&(n===Sv?a=a||"0.5em":!r&&i&&(a=i)),a&&e&&(Object.values(e).forEach((({className:e,name:t,spacingStyles:o})=>{(r||"flex"===t||"grid"===t)&&o?.length&&o.forEach((t=>{const o=[];if(t.rules&&Object.entries(t.rules).forEach((([e,t])=>{o.push(`${e}: ${t||a}`)})),o.length){let i="";i=r?n===Sv?`.${e}${t?.selector||""}`:`${n}-${e}${t?.selector||""}`:n===Sv?`:where(.${e}${t?.selector||""})`:`:where(${n}.${e}${t?.selector||""})`,s+=`${i} { ${o.join("; ")}; }`}}))})),n===Sv&&r&&(s+=`${Av} { --wp--style--block-gap: ${a}; }`)),n===Sv&&e){const t=["block","flex","grid"];Object.values(e).forEach((({className:e,displayMode:r,baseStyles:o})=>{r&&t.includes(r)&&(s+=`${n} .${e} { display:${r}; }`),o?.length&&o.forEach((t=>{const n=[];t.rules&&Object.entries(t.rules).forEach((([e,t])=>{n.push(`${e}: ${t}`)})),n.length&&(s+=`.${e}${t?.selector||""} { ${n.join("; ")}; }`)}))}))}return s}const XL=["border","color","dimensions","spacing","typography","filter","outline","shadow","background"];function ZL(e){if(!e)return{};const t=Object.entries(e).filter((([e])=>XL.includes(e))).map((([e,t])=>[e,JSON.parse(JSON.stringify(t))]));return Object.fromEntries(t)}const QL=(e,t)=>{var n;const r=[];if(!e?.settings)return r;const o=e=>{let t={};return Ev.forEach((({path:n})=>{const r=Ff(e,n,!1);!1!==r&&(t=Lf(t,n,r))})),t},i=o(e.settings),s=e.settings?.custom;return(Object.keys(i).length>0||s)&&r.push({presets:i,custom:s,selector:Av}),Object.entries(null!==(n=e.settings?.blocks)&&void 0!==n?n:{}).forEach((([e,n])=>{const i=o(n),s=n.custom;(Object.keys(i).length>0||s)&&r.push({presets:i,custom:s,selector:t[e]?.selector})})),r},eF=(e,t)=>{const n=QL(e,t);let r="";return n.forEach((({presets:t,custom:n,selector:o})=>{const i=function(e={},t){return Ev.reduce(((n,{path:r,valueKey:o,valueFunc:i,cssVarInfix:s})=>{const a=Ff(e,r,[]);return["default","theme","custom"].forEach((e=>{a[e]&&a[e].forEach((e=>{o&&!i?n.push(`--wp--preset--${s}--${WL(e.slug)}: ${e[o]}`):i&&"function"==typeof i&&n.push(`--wp--preset--${s}--${WL(e.slug)}: ${i(e,t)}`)}))})),n}),[])}(t,e?.settings),s=qL(n,"--wp--custom--","--");s.length>0&&i.push(...s),i.length>0&&(r+=`${o}{${i.join(";")};}`)})),r},tF=(e,t,n,r,o=!1,i=!1,s=void 0)=>{const a={blockGap:!0,blockStyles:!0,layoutStyles:!0,marginReset:!0,presets:!0,rootPadding:!0,...s},l=((e,t)=>{var n;const r=[];if(!e?.styles)return r;const o=ZL(e.styles);return o&&r.push({styles:o,selector:Sv}),Object.entries(dc).forEach((([t,n])=>{e.styles?.elements?.[t]&&r.push({styles:e.styles?.elements?.[t],selector:n})})),Object.entries(null!==(n=e.styles?.blocks)&&void 0!==n?n:{}).forEach((([e,n])=>{var o;const i=ZL(n);if(n?.variations){const o={};Object.entries(n.variations).forEach((([n,i])=>{var s,a;o[n]=ZL(i);const l=t[e].styleVariationSelectors?.[n];Object.entries(null!==(s=i?.elements)&&void 0!==s?s:{}).forEach((([e,t])=>{t&&dc[e]&&r.push({styles:t,selector:Rv(l,dc[e])})})),Object.entries(null!==(a=i?.blocks)&&void 0!==a?a:{}).forEach((([e,n])=>{var o;const i=Rv(l,t[e].selector),s=Rv(l,t[e].duotoneSelector),a=function(e,t){if(!e||!t)return;const n={};return Object.entries(t).forEach((([t,r])=>{"string"==typeof r&&(n[t]=Rv(e,r)),"object"==typeof r&&(n[t]={},Object.entries(r).forEach((([r,o])=>{n[t][r]=Rv(e,o)})))})),n}(l,t[e].featureSelectors);r.push({selector:i,duotoneSelector:s,featureSelectors:a,fallbackGapValue:t[e].fallbackGapValue,hasLayoutSupport:t[e].hasLayoutSupport,styles:ZL(n)}),Object.entries(null!==(o=n.elements)&&void 0!==o?o:{}).forEach((([e,t])=>{t&&dc[e]&&r.push({styles:t,selector:Rv(i,dc[e])})}))}))})),i.variations=o}t?.[e]?.selector&&r.push({duotoneSelector:t[e].duotoneSelector,fallbackGapValue:t[e].fallbackGapValue,hasLayoutSupport:t[e].hasLayoutSupport,selector:t[e].selector,styles:i,featureSelectors:t[e].featureSelectors,styleVariationSelectors:t[e].styleVariationSelectors}),Object.entries(null!==(o=n?.elements)&&void 0!==o?o:{}).forEach((([n,o])=>{o&&t?.[e]&&dc[n]&&r.push({styles:o,selector:t[e]?.selector.split(",").map((e=>dc[n].split(",").map((t=>e+" "+t)))).join(",")})}))})),r})(e,t),c=QL(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+=`${Av} {`,f=d?f+` --wp--style--global--content-size: ${d};`:f,f=h?f+` --wp--style--global--wide-size: ${h};`:f,f+="}"),p&&(f+=":where(body) {margin: 0;",a.rootPadding&&u&&(f+="padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }\n\t\t\t\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t\t.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }\n\t\t\t\t.has-global-padding :where(.has-global-padding:not(.wp-block-block, .alignfull, .alignwide)) { padding-right: 0; padding-left: 0; }\n\t\t\t\t.has-global-padding :where(.has-global-padding:not(.wp-block-block, .alignfull, .alignwide)) > .alignfull { margin-left: 0; margin-right: 0;\n\t\t\t\t"),f+="}"),a.blockStyles&&l.forEach((({selector:t,duotoneSelector:s,styles:a,fallbackGapValue:l,hasLayoutSupport:c,featureSelectors:d,styleVariationSelectors:h})=>{if(d){const e=KL(d,a);Object.entries(e).forEach((([e,t])=>{if(t.length){const n=t.join(";");f+=`:root :where(${e}){${n};}`}}))}if(s){const e={};a?.filter&&(e.filter=a.filter,delete a.filter);const t=YL(e);t.length&&(f+=`${s}{${t.join(";")};}`)}o||Sv!==t&&!c||(f+=JL({style:a,selector:t,hasBlockGapSupport:n,hasFallbackGapSupport:r,fallbackGapValue:l}));const p=YL(a,t,u,e,i);p?.length&&(f+=`:root :where(${t}){${p.join(";")};}`),h&&Object.entries(h).forEach((([t,n])=>{const r=a?.variations?.[t];if(r){if(d){const e=KL(d,r);Object.entries(e).forEach((([e,t])=>{if(t.length){const r=function(e,t){const n=e.split(","),r=[];return n.forEach((e=>{r.push(`${t.trim()}${e.trim()}`)})),r.join(", ")}(e,n),o=t.join(";");f+=`:root :where(${r}){${o};}`}}))}const t=YL(r,n,u,e);t.length&&(f+=`:root :where(${n}){${t.join(";")};}`)}}));const m=Object.entries(a).filter((([e])=>e.startsWith(":")));m?.length&&m.forEach((([e,n])=>{const r=YL(n);if(!r?.length)return;const o=`${t.split(",").map((t=>t+e)).join(",")}{${r.join(";")};}`;f+=o}))})),a.layoutStyles&&(f+=".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",f+=".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",f+=".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }"),a.blockGap&&n){const t=hw(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})=>{Sv!==e&&Av!==e||(e="");const n=function(e="*",t={}){return Ev.reduce(((n,{path:r,cssVarInfix:o,classes:i})=>{if(!i)return n;const s=Ff(t,r,[]);return["default","theme","custom"].forEach((t=>{s[t]&&s[t].forEach((({slug:t})=>{i.forEach((({classSuffix:r,propertyName:i})=>{const s=`.has-${WL(t)}-${r}`,a=e.split(",").map((e=>`${e}${s}`)).join(","),l=`var(--wp--preset--${o}--${WL(t)})`;n+=`${a}{${i}: ${l} !important;}`}))}))})),n}),"")}(e,t);n.length>0&&(f+=n)})),f};const nF=(e,t,n)=>{const r={};return e.forEach((e=>{const o=e.name,i=gL(e);let s=gL(e,"filter.duotone");if(!s){const t=gL(e),n=Ec(e,"color.__experimentalDuotone",!1);s=n&&Rv(t,n)}const a=!!e?.supports?.layout||!!e?.supports?.__experimentalLayout,l=e?.supports?.spacing?.blockGap?.__experimentalDefault,c=t(o),u={};c?.forEach((e=>{const t=n?`-${n}`:"",r=`${e.name}${t}`,o=function(e,t){const n=`.is-style-${e}`;if(!t)return n;const r=/((?::\([^)]+\))?\s*)([^\s:]+)/,o=(e,t,r)=>t+r+n;return t.split(",").map((e=>e.replace(r,o))).join(",")}(r,i);u[r]=o}));const d=((e,t)=>{if(e?.selectors&&Object.keys(e.selectors).length>0)return e.selectors;const n={root:t};return Object.entries($L).forEach((([t,r])=>{const o=gL(e,t);o&&(n[r]=o)})),n})(e,i);r[o]={duotoneSelector:s,fallbackGapValue:l,featureSelectors:Object.keys(d).length?d:void 0,hasLayoutSupport:a,name:o,selector:i,styleVariationSelectors:c?.length?u:void 0}})),r};function rF(e,t){let n="";return e.split("&").forEach((e=>{if(e.includes("{")){const r=e.replace("}","").split("{");if(2!==r.length)return;const[o,i]=r,s=o.startsWith(" ")?Rv(t,o):function(e,t){return e.includes(",")?e.split(",").map((e=>e+t)).join(","):e+t}(t,o);n+=`:root :where(${s}){${i.trim()}}`}else n+=`:root :where(${t}){${e.trim()}}`})),n}function oF(e={},t){const[n]=Lv("spacing.blockGap");var r,o;r=e,o=e?._links?.["wp:theme-file"],e=r?.styles&&o?(o.forEach((({name:e,href:t,target:n})=>{Ff(r,n)===e&&(r=function(e,t,n){const r=(t=t.split(".")).pop();let o=e;for(const e of t)o=o[e];return o[r]=n,e}(r,n,t))})),r):r;const i=null!==n,s=!i,a=(0,Ul.A)((e=>{const{getSettings:t}=e(hv);return!!t().disableLayoutStyles})),{getBlockStyles:l}=(0,Ul.A)(ed);return(0,S.useMemo)((()=>{var n;if(!e?.styles||!e?.settings)return[];const r=(p=e,p.styles?.blocks?.["core/separator"]&&p.styles?.blocks?.["core/separator"].color?.background&&!p.styles?.blocks?.["core/separator"].color?.text&&!p.styles?.blocks?.["core/separator"].border?.color?{...p,styles:{...p.styles,blocks:{...p.styles.blocks,"core/separator":{...p.styles.blocks["core/separator"],color:{...p.styles.blocks["core/separator"].color,text:p.styles?.blocks["core/separator"].color.background}}}}}:p),o=nF(Ac(),l),c=eF(r,o),u=tF(r,o,i,s,a,t),d=function(e,t){return QL(e,t).flatMap((({presets:e})=>function(e={}){return Ev.filter((e=>"duotone"===e.path.at(-1))).flatMap((t=>{const n=Ff(e,t.path,{});return["default","theme"].filter((e=>n[e])).flatMap((e=>n[e].map((e=>mL(`wp-duotone-${e.slug}`,e.colors))))).join("")}))}(e)))}(r,o),h=[{css:c,isGlobalStyles:!0},{css:u,isGlobalStyles:!0},{css:null!==(n=r.styles.css)&&void 0!==n?n:"",isGlobalStyles:!0},{assets:d,__unstableType:"svg",isGlobalStyles:!0}];var p;return Ac().forEach((e=>{if(r.styles.blocks[e.name]?.css){const t=o[e.name].selector;h.push({css:rF(r.styles.blocks[e.name]?.css,t),isGlobalStyles:!0})}})),[h,r.settings]}),[i,s,e,a,t,l])}function iF(e=!1){const{merged:t}=(0,S.useContext)(Dv);return oF(t,e)}const sF={hasSupport:()=>!0,attributeKeys:["className"],useBlockProps:function({name:e,className:t,clientId:n}){const{getBlockStyles:r}=(0,Ul.A)(ed),o=function(e,t=[]){const n=e?.match(/\bis-style-(?!default)(\S+)\b/g);if(!n)return null;for(const e of n){const n=e.substring(9);if(t.some((e=>e.name===n)))return n}return null}(t,r(e)),i=`is-style-${o}-${n}`,{settings:s,styles:a}=function(e,t,n){const{merged:r}=(0,S.useContext)(Dv),{globalSettings:o,globalStyles:i}=(0,Ul.A)((e=>{const t=e(hv).getSettings();return{globalSettings:t.__experimentalFeatures,globalStyles:t[_f]}}),[]);return(0,S.useMemo)((()=>{var s,a;const l=null!==(s=r?.styles)&&void 0!==s?s:i,c=l?.blocks?.[e]?.variations?.[t];return{settings:null!==(a=r?.settings)&&void 0!==a?a:o,styles:{blocks:{[e]:{variations:{[`${t}-${n}`]:c}}}}}}),[r,o,i,t,n,e])}(e,o,n),l=(0,S.useMemo)((()=>{if(!o)return;const e={settings:s,styles:a},t=nF(Ac(),r,n);return tF(e,t,!1,!0,!0,!0,{blockGap:!1,blockStyles:!0,layoutStyles:!1,marginReset:!1,presets:!1,rootPadding:!1})}),[o,s,a,r,n]);return Yv({id:`variation-${n}`,css:l,__unstableType:"variation",clientId:n}),o?{className:i}:{}}};var aF=n(99252),lF=n(48194);const cF="layout",{kebabCase:uF}=Cf(d_.j);function dF(e){return Ic(e,"layout")||Ic(e,"__experimentalLayout")}function hF(e={},t=""){const{layout:n}=e,{default:r}=Ec(t,cF)||{},o=n?.inherit||n?.contentSize||n?.wideSize?{...n,type:"constrained"}:n||r||{},i=[];if($x[o?.type||"default"]?.className){const e=$x[o?.type||"default"]?.className,n=t.split("/"),r=`wp-block-${"core"===n[0]?n.pop():n.join("-")}-${e}`;i.push(e,r)}return(0,Ul.A)((e=>(o?.inherit||o?.contentSize||"constrained"===o?.type)&&e(hv).getSettings().__experimentalFeatures?.useRootPaddingAwareAlignments),[o?.contentSize,o?.inherit,o?.type])&&i.push("has-global-padding"),o?.orientation&&i.push(`is-${uF(o.orientation)}`),o?.justifyContent&&i.push(`is-content-justification-${uF(o.justifyContent)}`),o?.flexWrap&&"nowrap"===o.flexWrap&&i.push("is-nowrap"),i}const pF={shareWithChildBlocks:!0,edit:function({layout:e,setAttributes:t,name:n,clientId:r}){const o=Jv(n),{layout:i}=o,{themeSupportsLayout:s}=(0,Ul.A)((e=>{const{getSettings:t}=e(hv);return{themeSupportsLayout:t().supportsLayout}}),[]);if("default"!==IS())return null;const a=Ec(n,cF,{}),l={...i,...a},{allowSwitching:c,allowEditing:u=!0,allowInheriting:d=!0,default:h}=l;if(!u)return null;const p={...a,...e},{type:f,default:{type:m="default"}={}}=p,g=f||m,b=!(!d||g&&"default"!==g&&"constrained"!==g&&!p.inherit),y=e||h||{},{inherit:v=!1,contentSize:_=null}=y;if(("default"===g||"constrained"===g)&&!s)return null;const x=hS(g),w=hS("constrained"),k=!y.type&&(_||v),C=!!v||!!_,S=e=>t({layout:e});return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(IA,{children:(0,Td.jsxs)(aF.Ay,{title:(0,H.__)("Layout"),children:[b&&(0,Td.jsx)(Td.Fragment,{children:(0,Td.jsx)(Hx.A,{__nextHasNoMarginBottom:!0,className:"block-editor-hooks__toggle-control",label:(0,H.__)("Inner blocks use content width"),checked:"constrained"===x?.name||C,onChange:()=>t({layout:{type:"constrained"===x?.name||C?"default":"constrained"}}),help:"constrained"===x?.name||C?(0,H.__)("Nested blocks use content width with options for full and wide widths."):(0,H.__)("Nested blocks will fill the width of this container. Toggle to constrain.")})}),!v&&c&&(0,Td.jsx)(fF,{type:g,onChange:e=>t({layout:{type:e}})}),x&&"default"!==x.name&&(0,Td.jsx)(x.inspectorControls,{layout:y,onChange:S,layoutBlockSupport:l,name:n,clientId:r}),w&&k&&(0,Td.jsx)(w.inspectorControls,{layout:y,onChange:S,layoutBlockSupport:l,name:n,clientId:r})]})}),!v&&x&&(0,Td.jsx)(x.toolBarControls,{layout:y,onChange:S,layoutBlockSupport:a,name:n,clientId:r})]})},attributeKeys:["layout"],hasSupport:e=>dF(e)};function fF({type:e,onChange:t}){return(0,Td.jsx)(lF.A,{children:dS.map((({name:n,label:r})=>(0,Td.jsx)(Zv.Ay,{isPressed:e===n,onClick:()=>t(n),children:r},n)))})}function mF({block:e,props:t,blockGapSupport:n,layoutClasses:r}){const{name:o,attributes:i}=t,s=(0,z_.A)(e),{layout:a}=i,{default:l}=Ec(o,cF)||{},c=a?.inherit||a?.contentSize||a?.wideSize?{...a,type:"constrained"}:a||l||{},u=`wp-container-${uF(o)}-is-layout-`,d=`.${u}${s}`,h=null!==n,p=hS(c?.type||"default"),f=p?.getLayoutStyle?.({blockName:o,selector:d,layout:c,style:i?.style,hasBlockGapSupport:h}),m=(0,$v.A)({[`${u}${s}`]:!!f},r);return Yv({css:f}),(0,Td.jsx)(e,{...t,__unstableLayoutClassNames:m})}const gF=(0,$p.f)((e=>t=>{const{clientId:n,name:r,attributes:o}=t,i=dF(r),s=hF(o,r),a=(0,Ul.A)((e=>{if(!i)return;const{getSettings:t,getBlockSettings:r}=Cf(e(hv)),{disableLayoutStyles:o}=t();if(o)return;const[s]=r(n,"spacing.blockGap");return{blockGapSupport:s}}),[i,n]);return a?(0,Td.jsx)(mF,{block:e,props:t,layoutClasses:s,...a}):(0,Td.jsx)(e,{...t,__unstableLayoutClassNames:i?s:void 0})}),"withLayoutStyles");(0,Tu.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){var t;return"type"in(null!==(t=e.attributes?.layout)&&void 0!==t?t:{})||dF(e)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,Tu.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",gF);var bF=n(54652),yF=n(50088);const vF=()=>{},_F="bottom",xF="corner";const wF=(0,W_.default)("div",{target:"e1wq7y4k3"})({name:"1cd7zoc",styles:"bottom:0;box-sizing:border-box;left:0;pointer-events:none;position:absolute;right:0;top:0"}),kF=(0,W_.default)("div",{target:"e1wq7y4k2"})({name:"ajymcs",styles:"align-items:center;box-sizing:border-box;display:inline-flex;justify-content:center;opacity:0;pointer-events:none;transition:opacity 120ms linear"}),CF=(0,W_.default)("div",{target:"e1wq7y4k1"})("background:",q_.l.theme.foreground,";border-radius:2px;box-sizing:border-box;font-family:",(0,jA.g)("default.fontFamily"),";font-size:12px;color:",q_.l.theme.foregroundInverted,";padding:4px 8px;position:relative;"),SF=(0,W_.default)(NT.A,{target:"e1wq7y4k0"})("&&&{color:",q_.l.theme.foregroundInverted,";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}"),AF=(0,S.forwardRef)((function({label:e,position:t=xF,zIndex:n=1e3,...r},o){const i=!!e,s=t===xF;if(!i)return null;let a={opacity:i?1:void 0,zIndex:n},l={};return t===_F&&(a={...a,position:"absolute",bottom:-10,left:"50%",transform:"translate(-50%, 0)"},l={transform:"translate(0, 100%)"}),s&&(a={...a,position:"absolute",top:4,right:(0,H.isRTL)()?void 0:4,left:(0,H.isRTL)()?4:void 0}),(0,Td.jsx)(kF,{"aria-hidden":"true",className:"components-resizable-tooltip__tooltip-wrapper",ref:o,style:a,...r,children:(0,Td.jsx)(CF,{className:"components-resizable-tooltip__tooltip",style:l,children:(0,Td.jsx)(SF,{as:"span",children:e})})})})),EF=AF,IF=()=>{},jF=(0,S.forwardRef)((function({axis:e,className:t,fadeTimeout:n=180,isVisible:r=!0,labelRef:o,onResize:i=IF,position:s=_F,showPx:a=!0,zIndex:l=1e3,...c},u){const{label:d,resizeListener:h}=function({axis:e,fadeTimeout:t=180,onResize:n=vF,position:r=_F,showPx:o=!1}){const[i,s]=(0,yF.A)(),a=!!e,[l,c]=(0,S.useState)(!1),[u,d]=(0,S.useState)(!1),{width:h,height:p}=s,f=(0,S.useRef)(p),m=(0,S.useRef)(h),g=(0,S.useRef)(),b=(0,S.useCallback)((()=>{g.current&&window.clearTimeout(g.current),g.current=window.setTimeout((()=>{a||(c(!1),d(!1))}),t)}),[t,a]);(0,S.useEffect)((()=>{if(null===h&&null===p)return;const e=h!==m.current,t=p!==f.current;if(e||t){if(h&&!m.current&&p&&!f.current)return m.current=h,void(f.current=p);e&&(c(!0),m.current=h),t&&(d(!0),f.current=p),n({width:h,height:p}),b()}}),[h,p,n,b]);const y=function({axis:e,height:t,moveX:n=!1,moveY:r=!1,position:o=_F,showPx:i=!1,width:s}){if(!n&&!r)return;if(o===xF)return`${s} x ${t}`;const a=i?" px":"";if(e){if("x"===e&&n)return`${s}${a}`;if("y"===e&&r)return`${t}${a}`}return n&&r?`${s} x ${t}`:n?`${s}${a}`:r?`${t}${a}`:void 0}({axis:e,height:p,moveX:l,moveY:u,position:r,showPx:o,width:h});return{label:y,resizeListener:i}}({axis:e,fadeTimeout:n,onResize:i,showPx:a,position:s});if(!r)return null;const p=(0,$v.A)("components-resize-tooltip",t);return(0,Td.jsxs)(wF,{"aria-hidden":"true",className:p,ref:u,...c,children:[h,(0,Td.jsx)(EF,{"aria-hidden":c["aria-hidden"],label:d,position:s,ref:o,zIndex:l})]})})),TF=jF,BF="components-resizable-box__handle",RF="components-resizable-box__side-handle",NF="components-resizable-box__corner-handle",DF={top:(0,$v.A)(BF,RF,"components-resizable-box__handle-top"),right:(0,$v.A)(BF,RF,"components-resizable-box__handle-right"),bottom:(0,$v.A)(BF,RF,"components-resizable-box__handle-bottom"),left:(0,$v.A)(BF,RF,"components-resizable-box__handle-left"),topLeft:(0,$v.A)(BF,NF,"components-resizable-box__handle-top","components-resizable-box__handle-left"),topRight:(0,$v.A)(BF,NF,"components-resizable-box__handle-top","components-resizable-box__handle-right"),bottomRight:(0,$v.A)(BF,NF,"components-resizable-box__handle-bottom","components-resizable-box__handle-right"),bottomLeft:(0,$v.A)(BF,NF,"components-resizable-box__handle-bottom","components-resizable-box__handle-left")},MF={width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0},PF={top:MF,right:MF,bottom:MF,left:MF,topLeft:MF,topRight:MF,bottomRight:MF,bottomLeft:MF},OF=(0,S.forwardRef)((function({className:e,children:t,showHandle:n=!0,__experimentalShowTooltip:r=!1,__experimentalTooltipProps:o={},...i},s){return(0,Td.jsxs)(bF.Resizable,{className:(0,$v.A)("components-resizable-box__container",n&&"has-show-handle",e),handleClasses:DF,handleStyles:PF,ref:s,...i,children:[t,r&&(0,Td.jsx)(TF,{...o})]})})),LF=OF;function FF({clientId:e,bounds:t,onChange:n}){const r=qC(e),o=r?.parentElement;return r&&o?(0,Td.jsx)(zF,{clientId:e,bounds:t,blockElement:r,rootBlockElement:o,onChange:n}):null}function zF({clientId:e,bounds:t,blockElement:n,rootBlockElement:r,onChange:o}){const[i,s]=(0,S.useState)(null),[a,l]=(0,S.useState)({top:!1,bottom:!1,left:!1,right:!1});(0,S.useEffect)((()=>{const e=new window.ResizeObserver((()=>{const e=n.getBoundingClientRect(),t=r.getBoundingClientRect();l({top:e.top>t.top,bottom:e.bottom<t.bottom,left:e.left>t.left,right:e.right<t.right})}));return e.observe(n),()=>e.disconnect()}),[n,r]);const c={right:"flex-start",left:"flex-end"},u={top:"flex-end",bottom:"flex-start"},d={display:"flex",justifyContent:"center",alignItems:"center",...c[i]&&{justifyContent:c[i]},...u[i]&&{alignItems:u[i]}};return(0,Td.jsx)(eS,{className:"block-editor-grid-item-resizer",clientId:e,__unstablePopoverSlot:"block-toolbar",additionalStyles:d,children:(0,Td.jsx)(LF,{className:"block-editor-grid-item-resizer__box",size:{width:"100%",height:"100%"},enable:{bottom:a.bottom,bottomLeft:!1,bottomRight:!1,left:a.left,right:a.right,top:a.top,topLeft:!1,topRight:!1},bounds:t,boundsByDirection:!0,onResizeStart:(e,t)=>{s(t),n.ownerDocument.addEventListener("mouseup",(()=>{e.target.dispatchEvent(new Event("mouseup",{bubbles:!0}))}),{once:!0})},onResizeStop:(e,t,i)=>{const s=parseFloat(tS(r,"column-gap")),a=parseFloat(tS(r,"row-gap")),l=UF(tS(r,"grid-template-columns"),s),c=UF(tS(r,"grid-template-rows"),a),u=new window.DOMRect(n.offsetLeft+i.offsetLeft,n.offsetTop+i.offsetTop,i.offsetWidth,i.offsetHeight),d=VF(l,u.left)+1,h=VF(c,u.top)+1,p=VF(l,u.right,"end")+1,f=VF(c,u.bottom,"end")+1;o({columnSpan:p-d+1,rowSpan:f-h+1})}})})}function UF(e,t){const n=[];for(const r of e.split(" ")){const e=n[n.length-1],o=e?e.end+t:0,i=o+parseFloat(r);n.push({start:o,end:i})}return n}function VF(e,t,n="start"){return e.reduce(((r,o,i)=>Math.abs(o[n]-t)<Math.abs(e[r][n]-t)?i:r),0)}const HF={useBlockProps:function e({style:t}){var n;const r=(0,Ul.A)((e=>!e(hv).getSettings().disableLayoutStyles)),o=null!==(n=t?.layout)&&void 0!==n?n:{},{selfStretch:i,flexSize:s,columnStart:a,rowStart:l,columnSpan:c,rowSpan:u}=o,d=gS()||{},{columnCount:h,minimumColumnWidth:p}=d,f=(0,z_.A)(e),m=`.wp-container-content-${f}`;let g="";if(r){if("fixed"===i&&s?g=`${m} {\n\t\t\t\tflex-basis: ${s};\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`:"fill"===i?g=`${m} {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`:a&&c?g=`${m} {\n\t\t\t\tgrid-column: ${a} / span ${c};\n\t\t\t}`:a?g=`${m} {\n\t\t\t\tgrid-column: ${a};\n\t\t\t}`:c&&(g=`${m} {\n\t\t\t\tgrid-column: span ${c};\n\t\t\t}`),(c||a)&&(p||!h)){const e=c?parseInt(c):null,t=a?parseInt(a):null,n=Math.max(e,t);let r=parseFloat(p);isNaN(r)&&(r=12);let o=p?.replace(r,"");["px","rem","em"].includes(o)||(o="rem"),g+=`@container (max-width: ${n*r+(n-1)*("px"===o?24:1.5)}${o}) {\n\t\t\t\t${m} {\n\t\t\t\t\tgrid-column: ${c?"1/-1":"auto"};\n\t\t\t\t}\n\t\t\t}`}l&&u?g+=`${m} {\n\t\t\t\tgrid-row: ${l} / span ${u};\n\t\t\t}`:l?g+=`${m} {\n\t\t\t\tgrid-row: ${l};\n\t\t\t}`:u&&(g+=`${m} {\n\t\t\t\tgrid-row: span ${u};\n\t\t\t}`)}if(Yv({css:g}),g)return{className:`wp-container-content-${f}`}},edit:function({clientId:e,style:t,setAttributes:n}){const{type:r="default",allowSizingOnChildren:o=!1}=gS()||{},i=(0,Ul.A)((t=>t(hv).getBlockRootClientId(e)),[e]),[s,a]=(0,S.useState)();return"grid"!==r?null:(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(nS,{clientId:i,contentRef:a}),o&&(0,Td.jsx)(FF,{clientId:e,bounds:s,onChange:({columnSpan:e,rowSpan:r})=>{n({style:{...t,layout:{...t?.layout,columnSpan:e,rowSpan:r}}})}})]})},attributeKeys:["style"],hasSupport:()=>!0};function $F(e){return(0,Ul.A)((t=>{const{getBlocksByClientId:n,getSelectedBlockClientIds:r,isUngroupable:o,isGroupable:i}=t(hv),{getGroupingBlockName:s,getBlockType:a}=t(ed),l=e?.length?e:r(),c=n(l),[u]=c,d=1===l.length&&o(l[0]);return{clientIds:l,isGroupable:i(l),isUngroupable:d,blocksSelection:c,groupingBlockName:s(),onUngroup:d&&a(u.name)?.transforms?.ungroup}}),[e])}function WF({clientIds:e,isGroupable:t,isUngroupable:n,onUngroup:r,blocksSelection:o,groupingBlockName:i,onClose:s=(()=>{})}){const{getSelectedBlockClientIds:a}=(0,Ul.A)(hv),{replaceBlocks:l}=(0,Vl.A)(hv);if(!t&&!n)return null;const c=a();return(0,Td.jsxs)(Td.Fragment,{children:[t&&(0,Td.jsx)(k_.A,{shortcut:c.length>1?VE.displayShortcut.primary("g"):void 0,onClick:()=>{(()=>{const t=dd(o,i);t&&l(e,t)})(),s()},children:(0,H._x)("Group","verb")}),n&&(0,Td.jsx)(k_.A,{onClick:()=>{(()=>{let t=o[0].innerBlocks;t.length&&(r&&(t=r(o[0].attributes,o[0].innerBlocks)),l(e,t))})(),s()},children:(0,H._x)("Ungroup","Ungrouping blocks from within a grouping block back into individual blocks within the Editor ")})]})}function GF(e){return(0,Ul.A)((t=>{const{canEditBlock:n,canMoveBlock:r,canRemoveBlock:o,canLockBlockType:i,getBlockName:s,getBlockRootClientId:a,getTemplateLock:l}=t(hv),c=a(e),u=n(e),d=r(e,c),h=o(e,c);return{canEdit:u,canMove:d,canRemove:h,canLock:i(s(e)),isContentLocked:"contentOnly"===l(e),isLocked:!u||!d||!h}}),[e])}var qF=n(23690),KF=n(51994),YF=n(98968),JF=n(54441);const XF=["core/block","core/navigation"];function ZF(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function QF({clientId:e,onClose:t}){const[n,r]=(0,S.useState)({move:!1,remove:!1}),{canEdit:o,canMove:i,canRemove:s}=GF(e),{allowsEditLocking:a,templateLock:l,hasTemplateLock:c}=(0,Ul.A)((t=>{const{getBlockName:n,getBlockAttributes:r}=t(hv),o=n(e),i=Sc(o);return{allowsEditLocking:XF.includes(o),templateLock:r(e)?.templateLock,hasTemplateLock:!!i?.attributes?.templateLock}}),[e]),[u,d]=(0,S.useState)(!!l),{updateBlockAttributes:h}=(0,Vl.A)(hv),p=BL(e),f=(0,z_.A)(QF,"block-editor-block-lock-modal__options-title");(0,S.useEffect)((()=>{r({move:!i,remove:!s,...a?{edit:!o}:{}})}),[o,i,s,a]);const m=Object.values(n).every(Boolean),g=Object.values(n).some(Boolean)&&!m;return(0,Td.jsxs)(YF.A,{title:(0,H.sprintf)((0,H.__)("Lock %s"),p.title),overlayClassName:"block-editor-block-lock-modal",onRequestClose:t,children:[(0,Td.jsx)("p",{children:(0,H.__)("Choose specific attributes to restrict or lock all available options.")}),(0,Td.jsxs)("form",{onSubmit:r=>{r.preventDefault(),h([e],{lock:n,templateLock:u?ZF(n):void 0}),t()},children:[(0,Td.jsxs)("div",{role:"group","aria-labelledby":f,className:"block-editor-block-lock-modal__options",children:[(0,Td.jsx)(ij.A,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__options-title",label:(0,Td.jsx)("span",{id:f,children:(0,H.__)("Lock all")}),checked:m,indeterminate:g,onChange:e=>r({move:e,remove:e,...a?{edit:e}:{}})}),(0,Td.jsxs)("ul",{className:"block-editor-block-lock-modal__checklist",children:[a&&(0,Td.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,Td.jsx)(ij.A,{__nextHasNoMarginBottom:!0,label:(0,H.__)("Restrict editing"),checked:!!n.edit,onChange:e=>r((t=>({...t,edit:e})))}),(0,Td.jsx)(Ux.A,{className:"block-editor-block-lock-modal__lock-icon",icon:n.edit?JF.A:qF.A})]}),(0,Td.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,Td.jsx)(ij.A,{__nextHasNoMarginBottom:!0,label:(0,H.__)("Disable movement"),checked:n.move,onChange:e=>r((t=>({...t,move:e})))}),(0,Td.jsx)(Ux.A,{className:"block-editor-block-lock-modal__lock-icon",icon:n.move?JF.A:qF.A})]}),(0,Td.jsxs)("li",{className:"block-editor-block-lock-modal__checklist-item",children:[(0,Td.jsx)(ij.A,{__nextHasNoMarginBottom:!0,label:(0,H.__)("Prevent removal"),checked:n.remove,onChange:e=>r((t=>({...t,remove:e})))}),(0,Td.jsx)(Ux.A,{className:"block-editor-block-lock-modal__lock-icon",icon:n.remove?JF.A:qF.A})]})]}),c&&(0,Td.jsx)(Hx.A,{__nextHasNoMarginBottom:!0,className:"block-editor-block-lock-modal__template-lock",label:(0,H.__)("Apply to all blocks inside"),checked:u,disabled:n.move&&!n.remove,onChange:()=>d(!u)})]}),(0,Td.jsxs)(B_.A,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,Td.jsx)(R_.A,{children:(0,Td.jsx)(Zv.Ay,{variant:"tertiary",onClick:t,children:(0,H.__)("Cancel")})}),(0,Td.jsx)(R_.A,{children:(0,Td.jsx)(Zv.Ay,{variant:"primary",type:"submit",children:(0,H.__)("Apply")})})]})]})]})}function ez({clientId:e}){const{canLock:t,isLocked:n}=GF(e),[r,o]=(0,S.useReducer)((e=>!e),!1);if(!t)return null;const i=n?(0,H.__)("Unlock"):(0,H.__)("Lock");return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(k_.A,{icon:n?qF.A:KF.A,onClick:o,"aria-expanded":r,"aria-haspopup":"dialog",children:i}),r&&(0,Td.jsx)(QF,{clientId:e,onClose:o})]})}const tz=()=>{},nz=(0,P.A)([(0,iI.A)(((e,{clientId:t})=>{const{getBlock:n,getBlockMode:r,getSettings:o}=e(hv),i=n(t),s=o().codeEditingEnabled;return{mode:r(t),blockType:i?Sc(i.name):null,isCodeEditingEnabled:s}})),(0,UE.A)(((e,{onToggle:t=tz,clientId:n})=>({onToggleMode(){e(hv).toggleBlockMode(n),t()}})))])((function({blockType:e,mode:t,onToggleMode:n,small:r=!1,isCodeEditingEnabled:o=!0}){if(!e||!Ic(e,"html",!0)||!o)return null;const i="visual"===t?(0,H.__)("Edit as HTML"):(0,H.__)("Edit visually");return(0,Td.jsx)(k_.A,{onClick:n,children:!r&&i})}));function rz(e){return 0===e?.trim()?.length}function oz({blockName:e,originalBlockName:t,onClose:n,onSave:r,hasOverridesWarning:o}){const[i,s]=(0,S.useState)(e),a=(0,S.useId)(),l=i!==e,c=i===t,u=rz(i),d=l||c;return(0,Td.jsx)(YF.A,{title:(0,H.__)("Rename"),onRequestClose:n,overlayClassName:"block-editor-block-rename-modal",focusOnMount:"firstContentElement",aria:{describedby:a},size:"small",children:(0,Td.jsxs)("form",{onSubmit:e=>{e.preventDefault(),d&&(()=>{const e=c||u?(0,H.sprintf)((0,H.__)('Block name reset to: "%s".'),i):(0,H.sprintf)((0,H.__)('Block name changed to: "%s".'),i);(0,Jb.speak)(e,"assertive"),r(i),n()})()},children:[(0,Td.jsx)("p",{id:a,children:(0,H.__)("Enter a custom name for this block.")}),(0,Td.jsxs)(oE.A,{spacing:"3",children:[(0,Td.jsx)(KE.A,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:i,label:(0,H.__)("Block name"),hideLabelFromVision:!0,help:o?(0,H.__)("This block allows overrides. Changing the name can cause problems with content entered into instances of this pattern."):void 0,placeholder:t,onChange:s,onFocus:e=>e.target.select()}),(0,Td.jsxs)(tA.A,{justify:"right",children:[(0,Td.jsx)(Zv.Ay,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:n,children:(0,H.__)("Cancel")}),(0,Td.jsx)(Zv.Ay,{__next40pxDefaultSize:!0,"aria-disabled":!d,variant:"primary",type:"submit",children:(0,H.__)("Save")})]})]})]})})}function iz({clientId:e}){const[t,n]=(0,S.useState)(!1),{metadata:r}=(0,Ul.A)((t=>{const{getBlockAttributes:n}=t(hv),r=n(e)?.metadata;return{metadata:r}}),[e]),{updateBlockAttributes:o}=(0,Vl.A)(hv),i=r?.name,s=!!i&&!!r?.bindings&&Object.values(r.bindings).some((e=>"core/pattern-overrides"===e.source)),a=BL(e);return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(k_.A,{onClick:()=>{n(!0)},"aria-expanded":t,"aria-haspopup":"dialog",children:(0,H.__)("Rename")}),t&&(0,Td.jsx)(oz,{blockName:i||"",originalBlockName:a?.title,hasOverridesWarning:s,onClose:()=>n(!1),onSave:t=>{(t===a?.title||rz(t))&&(t=void 0),function(t){o([e],{metadata:{...r,name:t}})}(t)}})]})}const{Fill:sz,Slot:az}=(0,Hl.QJ)("BlockSettingsMenuControls");function lz({...e}){return(0,Td.jsx)(l_.A,{document,children:(0,Td.jsx)(sz,{...e})})}lz.Slot=({fillProps:e,clientIds:t=null})=>{const{selectedBlocks:n,selectedClientIds:r,isContentOnly:o}=(0,Ul.A)((e=>{const{getBlockNamesByClientId:n,getSelectedBlockClientIds:r,getBlockEditingMode:o}=e(hv),i=null!==t?t:r();return{selectedBlocks:n(i),selectedClientIds:i,isContentOnly:"contentOnly"===o(i[0])}}),[t]),{canLock:i}=GF(r[0]),{canRename:s}=function(e){return{canRename:Ec(e,"renaming",!0)}}(n[0]),a=1===r.length&&i&&!o,l=1===r.length&&s&&!o,c=$F(r),{isGroupable:u,isUngroupable:d}=c,h=u||d;return(0,Td.jsx)(az,{fillProps:{...e,selectedBlocks:n,selectedClientIds:r},children:t=>!t?.length>0&&!h&&!a?null:(0,Td.jsxs)(w_.A,{children:[h&&(0,Td.jsx)(WF,{...c,onClose:e?.onClose}),a&&(0,Td.jsx)(ez,{clientId:r[0]}),l&&(0,Td.jsx)(iz,{clientId:r[0]}),t,e?.canMove&&!e?.onlyBlock&&!o&&(0,Td.jsx)(k_.A,{onClick:(0,ef.h)(e?.onClose,e?.onMoveTo),children:(0,H.__)("Move to")}),1===e?.count&&!o&&(0,Td.jsx)(nz,{clientId:e?.firstBlockClientId,onToggle:e?.onClose})]})})};const cz=lz,uz={edit:function({clientId:e,isSelected:t}){const{templateLock:n,isLockedByParent:r,isEditingAsBlocks:o}=(0,Ul.A)((t=>{const{getContentLockingParent:n,getTemplateLock:r,getTemporarilyEditingAsBlocks:o}=Cf(t(hv));return{templateLock:r(e),isLockedByParent:!!n(e),isEditingAsBlocks:o()===e}}),[e]),{stopEditingAsBlocks:i,modifyContentLockBlock:s}=Cf((0,Vl.A)(hv)),a=!r&&"contentOnly"===n,l=(0,S.useCallback)((()=>{i(e)}),[e,i]);if(!a&&!o)return null;const c=o&&!a,u=!o&&a&&t;return(0,Td.jsxs)(Td.Fragment,{children:[c&&(0,Td.jsx)(Td.Fragment,{children:(0,Td.jsx)(__,{group:"other",children:(0,Td.jsx)(r_,{onClick:l,children:(0,H.__)("Done")})})}),u&&(0,Td.jsx)(cz,{children:({selectedClientIds:t,onClose:n})=>1===t.length&&t[0]===e&&(0,Td.jsx)(k_.A,{onClick:()=>{s(e),n()},children:(0,H.__)("Modify")})})]})},hasSupport:()=>!0},dz="metadata";(0,Tu.addFilter)("blocks.registerBlockType","core/metadata/addMetaAttribute",(function(e){return e?.attributes?.[dz]?.type||(e.attributes={...e.attributes,[dz]:{type:"object"}}),e}));var hz=n(3445);const pz=(0,S.memo)((function({icon:e,showColors:t=!1,className:n,context:r}){"block-default"===e?.src&&(e={src:hz.A});const o=(0,Td.jsx)(Ux.A,{icon:e&&e.src?e.src:e,context:r}),i=t?{backgroundColor:e&&e.background,color:e&&e.foreground}:{};return(0,Td.jsx)("span",{style:i,className:(0,$v.A)("block-editor-block-icon",n,{"has-colors":t}),children:o})})),fz={},mz={edit:function({name:e,clientId:t,metadata:{ignoredHookedBlocks:n=[]}={}}){const r=(0,Ul.A)((e=>e(ed).getBlockTypes()),[]),o=(0,S.useMemo)((()=>r?.filter((({name:t,blockHooks:r})=>r&&e in r||n.includes(t)))),[r,e,n]),{blockIndex:i,rootClientId:s,innerBlocksLength:a}=(0,Ul.A)((e=>{const{getBlocks:n,getBlockIndex:r,getBlockRootClientId:o}=e(hv);return{blockIndex:r(t),innerBlocksLength:n(t)?.length,rootClientId:o(t)}}),[t]),l=(0,Ul.A)((n=>{const{getBlocks:r,getGlobalBlockCount:i}=n(hv),a=o.reduce(((n,o)=>{if(0===i(o.name))return n;const a=o?.blockHooks?.[e];let l;switch(a){case"before":case"after":l=r(s);break;case"first_child":case"last_child":l=r(t);break;case void 0:l=[...r(s),...r(t)]}const c=l?.find((e=>e.name===o.name));return c?{...n,[o.name]:c.clientId}:n}),{});return Object.values(a).length>0?a:fz}),[o,e,t,s]),{insertBlock:c,removeBlock:u}=(0,Vl.A)(hv);if(!o.length)return null;const d=o.reduce(((e,t)=>{const[n]=t.name.split("/");return e[n]||(e[n]=[]),e[n].push(t),e}),{});return(0,Td.jsx)(IA,{children:(0,Td.jsxs)(aF.Ay,{className:"block-editor-hooks__block-hooks",title:(0,H.__)("Plugins"),initialOpen:!0,children:[(0,Td.jsx)("p",{className:"block-editor-hooks__block-hooks-helptext",children:(0,H.__)("Manage the inclusion of blocks added automatically by plugins.")}),Object.keys(d).map((n=>(0,Td.jsxs)(S.Fragment,{children:[(0,Td.jsx)("h3",{children:n}),d[n].map((n=>{const r=n.name in l;return(0,Td.jsx)(Hx.A,{checked:r,label:(0,Td.jsxs)(tA.A,{justify:"flex-start",children:[(0,Td.jsx)(pz,{icon:n.icon}),(0,Td.jsx)("span",{children:n.title})]}),onChange:()=>{if(r)u(l[n.name],!1);else{const r=n.blockHooks[e];((e,n)=>{switch(n){case"before":case"after":c(e,"after"===n?i+1:i,s,!1);break;case"first_child":case"last_child":c(e,"first_child"===n?0:a,t,!1);break;case void 0:c(e,i+1,s,!1)}})(td(n.name),r)}}},n.title)}))]},n)))]})})},attributeKeys:["metadata"],hasSupport:()=>!0},gz=(0,V_.KZ)((function(e,t){const{role:n,wrapperClassName:r,...o}=function(e){const{as:t,className:n,onClick:r,role:o="listitem",size:i,...s}=(0,U_.A)(e,"Item"),{spacedAround:a,size:l}=HA(),c=i||l,u=t||(void 0!==r?"button":"div"),d=(0,H_.l)(),h=(0,S.useMemo)((()=>d(("button"===u||"a"===u)&&(e=>(0,G_.css)("font-size:",(0,jA.g)("default.fontSize"),";font-family:inherit;appearance:none;border:1px solid transparent;cursor:pointer;background:none;text-align:start;text-decoration:","a"===e?"none":void 0,";svg,path{fill:currentColor;}&:hover{color:",q_.l.theme.accent,";}&:focus{box-shadow:none;outline:none;}&:focus-visible{box-shadow:0 0 0 var( --wp-admin-border-width-focus ) ",q_.l.theme.accent,";outline:2px solid transparent;outline-offset:0;}",""))(u),UA[c]||UA.medium,BA,a&&MA,n)),[u,n,d,c,a]),p=d(TA);return{as:u,className:h,onClick:r,wrapperClassName:p,role:o,...s}}(e);return(0,Td.jsx)("div",{role:n,className:r,children:(0,Td.jsx)(px.A,{...o,ref:t})})}),"Item"),bz={"core/paragraph":["content"],"core/heading":["content"],"core/image":["id","url","title","alt"],"core/button":["url","text","linkTarget","rel"]};function yz(e){return e in bz}function vz(e,t){return yz(e)&&bz[e].includes(t)}const _z=(0,$p.f)((e=>t=>{const n=(0,Hp.A)(),r=(0,Ul.A)((e=>Cf(e(ed)).getAllBlockBindingsSources())),{name:o,clientId:i,context:s}=t,a=(0,S.useMemo)((()=>function(e,t){if("core/pattern-overrides"===t?.__default?.source){const n=bz[e],r={};for(const e of n){const n=t[e]?t[e]:{source:"core/pattern-overrides"};r[e]=n}return r}return t}(o,t.attributes.metadata?.bindings)),[t.attributes.metadata?.bindings,o]),l=(0,Ul.A)((()=>{if(!a)return;const e={};for(const[t,l]of Object.entries(a)){const a=r[l.source];if(!a?.getValue||!vz(o,t))continue;const c={registry:n,context:s,clientId:i,attributeName:t,args:l.args};e[t]=a.getValue(c),void 0===e[t]&&(e[t]="url"===t?null:a.getPlaceholder?.(c))}return e}),[a,o,i,s,n,r]),{setAttributes:c}=t,u=(0,S.useCallback)((e=>{n.batch((()=>{if(!a)return void c(e);const t={...e},l=new Map;for(const[e,n]of Object.entries(t)){if(!a[e]||!vz(o,e))continue;const i=a[e],s=r[i?.source];(s?.setValue||s?.setValues)&&(l.set(s,{...l.get(s),[e]:n}),delete t[e])}if(l.size)for(const[e,t]of l)if(e.setValues)e.setValues({registry:n,context:s,clientId:i,attributes:t});else for(const[r,o]of Object.entries(t)){const t=a[r];e.setValue({registry:n,context:s,clientId:i,attributeName:r,args:t.args,value:o})}Object.keys(t).length&&c(t)}))}),[n,a,o,i,s,c,r]);return(0,Td.jsx)(Td.Fragment,{children:(0,Td.jsx)(e,{...t,attributes:{...t.attributes,...l},setAttributes:u})})}),"withBlockBindingSupport");(0,Tu.addFilter)("blocks.registerBlockType","core/editor/custom-sources-backwards-compatibility/shim-attribute-source",(function(e,t){return yz(t)?{...e,edit:_z(e.edit)}:e}));const xz={edit:({name:e,metadata:t})=>{const{bindings:n}=t||{},{sources:r}=(0,Ul.A)((e=>({sources:Cf(e(ed)).getAllBlockBindingsSources()})),[]);if(!n)return null;const o={...n};return Object.keys(o).forEach((t=>{vz(e,t)&&"core/pattern-overrides"!==o[t].source||delete o[t]})),0===Object.keys(o).length?null:(0,Td.jsx)(IA,{children:(0,Td.jsx)(aF.Ay,{title:(0,H.__)("Bindings"),className:"components-panel__block-bindings-panel",children:(0,Td.jsx)($A,{isBordered:!0,isSeparated:!0,size:"large",children:Object.keys(o).map((e=>(0,Td.jsx)(gz,{children:(0,Td.jsxs)(tA.A,{children:[(0,Td.jsx)("span",{children:e}),(0,Td.jsx)("span",{className:"components-item__block-bindings-source",children:r[o[e].source]?r[o[e].source].label:o[e].source})]})},e)))})})})},attributeKeys:["metadata"],hasSupport:()=>!0};function wz(e){const t=e.style?.border||{};return{className:iN(e)||void 0,style:KO({border:t})}}function kz(e){const{colors:t}=nT(),n=wz(e),{borderColor:r}=e;if(r){const e=JR({colors:t,namedColor:r});n.style.borderColor=e.color}return n}function Cz(e){return{style:KO({shadow:e.style?.shadow||""})}}(0,Tu.addFilter)("blocks.registerBlockType","core/metadata/addLabelCallback",(function(e){return e.__experimentalLabel||Ic(e,"renaming",!0)&&(e.__experimentalLabel=(e,{context:t})=>{const{metadata:n}=e;if("list-view"===t&&n?.name)return n.name}),e}));const{kebabCase:Sz}=Cf(d_.j);var Az;!function(e){e=e.map((e=>({...e,Edit:(0,S.memo)(e.edit)})));const t=(0,$p.f)((t=>n=>{const r=Qp();return[...e.map(((e,t)=>{const{Edit:o,hasSupport:i,attributeKeys:s=[],shareWithChildBlocks:a}=e;if(!(r[Wp]||r[Gp]&&a)||!i(n.name))return null;const l={};for(const e of s)n.attributes[e]&&(l[e]=n.attributes[e]);return(0,Td.jsx)(o,{name:n.name,isSelected:n.isSelected,clientId:n.clientId,setAttributes:n.setAttributes,__unstableParentLayout:n.__unstableParentLayout,...l},t)})),(0,Td.jsx)(t,{...n},"edit")]}),"withBlockEditHooks");(0,Tu.addFilter)("editor.BlockEdit","core/editor/hooks",t)}([xz,RS,hP,Fj,Vj,tL,TL,HL,pF,uz,mz,HF].filter(Boolean)),function(e){const t=(0,$p.f)((t=>n=>{const[r,o]=(0,S.useState)(Array(e.length).fill(void 0));return[...e.map(((e,t)=>{const{hasSupport:r,attributeKeys:i=[],useBlockProps:s}=e,a={};for(const e of i)n.attributes[e]&&(a[e]=n.attributes[e]);return Object.keys(a).length&&r(n.name)?(0,Td.jsx)(Xv,{index:t,useBlockProps:s,setAllWrapperProps:o,name:n.name,clientId:n.clientId,...a},t):null})),(0,Td.jsx)(t,{...n,wrapperProps:r.filter(Boolean).reduce(((e,t)=>({...e,...t,className:(0,$v.A)(e.className,t.className),style:{...e.style,...t.style}})),n.wrapperProps||{})},"edit")]}),"withBlockListBlockHooks");(0,Tu.addFilter)("editor.BlockListBlock","core/editor/hooks",t)}([RS,hP,Pj,tL,MD,WO,TL,YM,tP,sN,HL,sF,HF]),Az=[RS,hP,Fj,Uj,Vj,sN,MD,tL,YM,tP],(0,Tu.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",(function(e,t,n){return Az.reduce(((e,r)=>{const{hasSupport:o,attributeKeys:i=[],addSaveProps:s}=r,a={};for(const e of i)n[e]&&(a[e]=n[e]);return Object.keys(a).length&&o(t)?s(e,t,a):e}),e)}),0),(0,Tu.addFilter)("blocks.getSaveContent.extraProps","core/editor/hooks",(e=>(e.hasOwnProperty("className")&&!e.className&&delete e.className,e)));var Ez=n(28998),Iz=n(9899),jz=n(8686),Tz=n(18861),Bz=n(78008),Rz=n(12367),Nz=n(50114);const Dz={0:Ez.A,1:Iz.A,2:jz.A,3:Tz.A,4:Bz.A,5:Rz.A,6:Nz.A};function Mz({level:e}){return Dz[e]?(0,Td.jsx)(Ux.A,{icon:Dz[e]}):null}const Pz=[1,2,3,4,5,6],Oz={className:"block-library-heading-level-dropdown"};function Lz({options:e=Pz,value:t,onChange:n}){return(0,Td.jsx)(x_,{popoverProps:Oz,icon:(0,Td.jsx)(Mz,{level:t}),label:(0,H.__)("Change level"),controls:e.map((e=>{const r=e===t;return{icon:(0,Td.jsx)(Mz,{level:e}),title:0===e?(0,H.__)("Paragraph"):(0,H.sprintf)((0,H.__)("Heading %d"),e),isActive:r,onClick(){n(e)},role:"menuitemradio"}}))})}const Fz=(0,Td.jsx)(pw.t4,{className:"components-placeholder__illustration",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60",preserveAspectRatio:"none",children:(0,Td.jsx)(pw.wA,{vectorEffect:"non-scaling-stroke",d:"M60 60 0 0"})}),zz=function(e){const{icon:t,children:n,label:r,instructions:o,className:i,notices:s,preview:a,isColumnLayout:l,withIllustration:c,...u}=e,[d,{width:h}]=(0,yF.A)();let p;"number"==typeof h&&(p={"is-large":h>=480,"is-medium":h>=160&&h<480,"is-small":h<160});const f=(0,$v.A)("components-placeholder",i,p,c?"has-illustration":null),m=(0,$v.A)("components-placeholder__fieldset",{"is-column-layout":l});return(0,S.useEffect)((()=>{o&&(0,Jb.speak)(o)}),[o]),(0,Td.jsxs)("div",{...u,className:f,children:[c?Fz:null,d,s,a&&(0,Td.jsx)("div",{className:"components-placeholder__preview",children:a}),(0,Td.jsxs)("div",{className:"components-placeholder__label",children:[(0,Td.jsx)(Ux.A,{icon:t}),r]}),!!o&&(0,Td.jsx)("div",{className:"components-placeholder__instructions",children:o}),(0,Td.jsx)("div",{className:m,children:n})]})};var Uz=n(82432);const Vz=function({icon:e=Uz.A,label:t=(0,H.__)("Choose variation"),instructions:n=(0,H.__)("Select a variation to start with:"),variations:r,onSelect:o,allowSkip:i}){const s=(0,$v.A)("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,Td.jsxs)(zz,{icon:e,label:t,instructions:n,className:s,children:[(0,Td.jsx)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,H.__)("Block variations"),children:r.map((e=>(0,Td.jsxs)("li",{children:[(0,Td.jsx)(Zv.Ay,{__next40pxDefaultSize:!0,variant:"tertiary",icon:e.icon&&e.icon.src?e.icon.src:e.icon,iconSize:48,onClick:()=>o(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,Td.jsx)("span",{className:"block-editor-block-variation-picker__variation-label",children:e.title})]},e.name)))}),i&&(0,Td.jsx)("div",{className:"block-editor-block-variation-picker__skip",children:(0,Td.jsx)(Zv.Ay,{variant:"link",onClick:()=>o(),children:(0,H.__)("Skip")})})]})},Hz=(0,$p.f)((e=>t=>{const[n,r]=fv("color.palette","color.custom"),{colors:o=n,disableCustomColors:i=!r}=t,s=o&&o.length>0||!i;return(0,Td.jsx)(e,{...t,colors:o,disableCustomColors:i,hasColorsToChoose:s})}),"withColorContext")(WB);var $z=n(48768);const Wz=100,Gz=300,qz={placement:"bottom-start"},Kz=(0,S.createContext)({}),Yz=()=>(0,S.useContext)(Kz);function Jz({id:e,url:t,naturalWidth:n,naturalHeight:r,onFinishEditing:o,onSaveImage:i,children:s}){const a=function({url:e,naturalWidth:t,naturalHeight:n}){const[r,o]=(0,S.useState)(),[i,s]=(0,S.useState)(),[a,l]=(0,S.useState)({x:0,y:0}),[c,u]=(0,S.useState)(100),[d,h]=(0,S.useState)(0),p=t/n,[f,m]=(0,S.useState)(p),g=(0,S.useCallback)((()=>{const t=(d+90)%360;let n=p;if(d%180==90&&(n=1/p),0===t)return o(),h(t),m(p),void l((e=>({x:-e.y*n,y:e.x*n})));const r=new window.Image;r.src=e,r.onload=function(e){const r=document.createElement("canvas");let i=0,s=0;t%180?(r.width=e.target.height,r.height=e.target.width):(r.width=e.target.width,r.height=e.target.height),90!==t&&180!==t||(i=r.width),270!==t&&180!==t||(s=r.height);const a=r.getContext("2d");a.translate(i,s),a.rotate(t*Math.PI/180),a.drawImage(e.target,0,0),r.toBlob((e=>{o(URL.createObjectURL(e)),h(t),m(r.width/r.height),l((e=>({x:-e.y*n,y:e.x*n})))}))};const i=(0,Tu.applyFilters)("media.crossOrigin",void 0,e);"string"==typeof i&&(r.crossOrigin=i)}),[d,p,e]);return(0,S.useMemo)((()=>({editedUrl:r,setEditedUrl:o,crop:i,setCrop:s,position:a,setPosition:l,zoom:c,setZoom:u,rotation:d,setRotation:h,rotateClockwise:g,aspect:f,setAspect:m,defaultAspect:p})),[r,i,a,c,d,g,f,p])}({url:t,naturalWidth:n,naturalHeight:r}),l=function({crop:e,rotation:t,url:n,id:r,onSaveImage:o,onFinishEditing:i}){const{createErrorNotice:s}=(0,Vl.A)(Xb.store),[a,l]=(0,S.useState)(!1),c=(0,S.useCallback)((()=>{l(!1),i()}),[i]),u=(0,S.useCallback)((()=>{l(!0);const a=[];t>0&&a.push({type:"rotate",args:{angle:t}}),(e.width<99.9||e.height<99.9)&&a.push({type:"crop",args:{left:e.x,top:e.y,width:e.width,height:e.height}}),(0,E.default)({path:`/wp/v2/media/${r}/edit`,method:"POST",data:{src:n,modifiers:a}}).then((e=>{o({id:e.id,url:e.source_url})})).catch((e=>{s((0,H.sprintf)((0,H.__)("Could not edit image. %s"),(0,ac.A)(e.message)),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{l(!1),i()}))}),[e,t,r,n,o,s,i]);return(0,S.useMemo)((()=>({isInProgress:a,apply:u,cancel:c})),[a,u,c])}({id:e,url:t,onSaveImage:i,onFinishEditing:o,...a}),c=(0,S.useMemo)((()=>({...a,...l})),[a,l]);return(0,Td.jsx)(Kz.Provider,{value:c,children:s})}function Xz({aspectRatios:e,isDisabled:t,label:n,onClick:r,value:o}){return(0,Td.jsx)(w_.A,{label:n,children:e.map((({name:e,slug:n,ratio:i})=>(0,Td.jsx)(k_.A,{disabled:t,onClick:()=>{r(i)},role:"menuitemradio",isSelected:i===o,icon:i===o?ZS.A:void 0,children:e},n)))})}function Zz(e){const[t,n,...r]=e.split("/").map(Number);return t<=0||n<=0||Number.isNaN(t)||Number.isNaN(n)||r.length?NaN:n?t/n:t}function Qz({ratio:e,...t}){return{ratio:Zz(e),...t}}function eU({toggleProps:e}){const{isInProgress:t,aspect:n,setAspect:r,defaultAspect:o}=Yz(),[i,s,a]=fv("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios");return(0,Td.jsx)(i_.A,{icon:$z.A,label:(0,H.__)("Aspect Ratio"),popoverProps:qz,toggleProps:e,className:"wp-block-image__aspect-ratio",children:({onClose:e})=>(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(Xz,{isDisabled:t,onClick:t=>{r(t),e()},value:n,aspectRatios:[{slug:"original",name:(0,H.__)("Original"),aspect:o},...a?i.map(Qz).filter((({ratio:e})=>1===e)):[]]}),s?.length>0&&(0,Td.jsx)(Xz,{label:(0,H.__)("Theme"),isDisabled:t,onClick:t=>{r(t),e()},value:n,aspectRatios:s}),a&&(0,Td.jsx)(Xz,{label:(0,H.__)("Landscape"),isDisabled:t,onClick:t=>{r(t),e()},value:n,aspectRatios:i.map(Qz).filter((({ratio:e})=>e>1))}),a&&(0,Td.jsx)(Xz,{label:(0,H.__)("Portrait"),isDisabled:t,onClick:t=>{r(t),e()},value:n,aspectRatios:i.map(Qz).filter((({ratio:e})=>e<1))})]})})}var tU=n(7728),nU=n(75187),rU=n.n(nU);function oU(e,t,n,r,o){void 0===o&&(o=0);var i=dU(t.width,t.height,o),s=i.width,a=i.height;return{x:iU(e.x,s,n.width,r),y:iU(e.y,a,n.height,r)}}function iU(e,t,n,r){var o=t*r/2-n/2;return hU(e,-o,o)}function sU(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function aU(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function lU(e,t){return Math.min(e,Math.max(0,t))}function cU(e,t){return t}function uU(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function dU(e,t,n){var r=n*Math.PI/180;return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}function hU(e,t,n){return Math.min(Math.max(e,t),n)}function pU(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return"string"==typeof e&&e.length>0})).join(" ").trim()}var fU=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=S.createRef(),n.videoRef=S.createRef(),n.containerPosition={x:0,y:0},n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc="undefined"!=typeof document?document:null,n.currentWindow="undefined"!=typeof window?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},n.initResizeObserver=function(){if(void 0!==window.ResizeObserver&&n.containerRef){var e=!0;n.resizeObserver=new window.ResizeObserver((function(t){e?e=!1:n.computeSizes()})),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd),n.currentDoc.removeEventListener("scroll",n.onScroll))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var e=n.computeSizes();e&&(n.emitCropData(),n.setInitialCrop(e)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(e){if(n.props.initialCroppedAreaPercentages){var t=function(e,t,n,r,o,i){var s=dU(t.width,t.height,n),a=hU(r.width/s.width*(100/e.width),o,i);return{crop:{x:a*s.width/2-r.width/2-s.width*a*(e.x/100),y:a*s.height/2-r.height/2-s.height*a*(e.y/100)},zoom:a}}(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom),r=t.crop,o=t.zoom;n.props.onCropChange(r),n.props.onZoomChange&&n.props.onZoomChange(o)}else if(n.props.initialCroppedAreaPixels){var i=function(e,t,n,r,o,i){void 0===n&&(n=0);var s=dU(t.naturalWidth,t.naturalHeight,n),a=hU(function(e,t,n){var r=function(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}(t);return n.height>n.width?n.height/(e.height*r):n.width/(e.width*r)}(e,t,r),o,i),l=r.height>r.width?r.height/e.height:r.width/e.width;return{crop:{x:((s.width-e.width)/2-e.x)*l,y:((s.height-e.height)/2-e.y)*l},zoom:a}}(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,e,n.props.minZoom,n.props.maxZoom);r=i.crop,o=i.zoom,n.props.onCropChange(r),n.props.onZoomChange&&n.props.onZoomChange(o)}},n.computeSizes=function(){var e,t,r,o,i,s,a=n.imageRef.current||n.videoRef.current;if(a&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.saveContainerPosition();var l=n.containerRect.width/n.containerRect.height,c=(null===(e=n.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef.current)||void 0===t?void 0:t.videoWidth)||0,u=(null===(r=n.imageRef.current)||void 0===r?void 0:r.naturalHeight)||(null===(o=n.videoRef.current)||void 0===o?void 0:o.videoHeight)||0,d=c/u,h=void 0;if(a.offsetWidth<c||a.offsetHeight<u)switch(n.state.mediaObjectFit){default:case"contain":h=l>d?{width:n.containerRect.height*d,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/d};break;case"horizontal-cover":h={width:n.containerRect.width,height:n.containerRect.width/d};break;case"vertical-cover":h={width:n.containerRect.height*d,height:n.containerRect.height}}else h={width:a.offsetWidth,height:a.offsetHeight};n.mediaSize=(0,tU.Cl)((0,tU.Cl)({},h),{naturalWidth:c,naturalHeight:u}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var p=n.props.cropSize?n.props.cropSize:function(e,t,n,r,o,i){void 0===i&&(i=0);var s=dU(e,t,i),a=s.width,l=s.height,c=Math.min(a,n),u=Math.min(l,r);return c>u*o?{width:u*o,height:u}:{width:c,height:c/o}}(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(null===(i=n.state.cropSize)||void 0===i?void 0:i.height)===p.height&&(null===(s=n.state.cropSize)||void 0===s?void 0:s.width)===p.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(p),n.setState({cropSize:p},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(p),p}},n.saveContainerPosition=function(){if(n.containerRef){var e=n.containerRef.getBoundingClientRect();n.containerPosition={x:e.left,y:e.top}}},n.onMouseDown=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.saveContainerPosition(),n.onDragStart(t.getMousePoint(e)))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onScroll=function(e){n.currentDoc&&(e.preventDefault(),n.saveContainerPosition())},n.onTouchStart=function(e){n.currentDoc&&(n.isTouching=!0,n.props.onTouchRequest&&!n.props.onTouchRequest(e)||(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),n.saveContainerPosition(),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onGestureStart=function(e){n.currentDoc&&(e.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureMove=function(e){if(e.preventDefault(),!n.isTouching){var r=t.getMousePoint(e),o=n.gestureZoomStart-1+e.scale;if(n.setNewZoom(o,r,{shouldUpdatePosition:!0}),n.props.onRotationChange){var i=n.gestureRotationStart+e.rotation;n.props.onRotationChange(i)}}},n.onGestureEnd=function(e){n.cleanEvents()},n.onDragStart=function(e){var t,r,o=e.x,i=e.y;n.dragStartPosition={x:o,y:i},n.dragStartCrop=(0,tU.Cl)({},n.props.crop),null===(r=(t=n.props).onInteractionStart)||void 0===r||r.call(t)},n.onDrag=function(e){var t=e.x,r=e.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==r){var e=t-n.dragStartPosition.x,o=r-n.dragStartPosition.y,i={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+o},s=n.props.restrictPosition?oU(i,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):i;n.props.onCropChange(s)}})))},n.onDragStopped=function(){var e,t;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){if(n.currentWindow&&(!n.props.onWheelRequest||n.props.onWheelRequest(e))){e.preventDefault();var r=t.getMousePoint(e),o=rU()(e).pixelY,i=n.props.zoom-o*n.props.zoomSpeed/200;n.setNewZoom(i,r,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)}},n.getPointOnContainer=function(e,t){var r=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(r-t.x),y:n.containerRect.height/2-(o-t.y)}},n.getPointOnMedia=function(e){var t=e.x,r=e.y,o=n.props,i=o.crop,s=o.zoom;return{x:(t+i.x)/s,y:(r+i.y)/s}},n.setNewZoom=function(e,t,r){var o=(void 0===r?{}:r).shouldUpdatePosition,i=void 0===o||o;if(n.state.cropSize&&n.props.onZoomChange){var s=hU(e,n.props.minZoom,n.props.maxZoom);if(i){var a=n.getPointOnContainer(t,n.containerPosition),l=n.getPointOnMedia(a),c={x:l.x*s-a.x,y:l.y*s-a.y},u=n.props.restrictPosition?oU(c,n.mediaSize,n.state.cropSize,s,n.props.rotation):c;n.props.onCropChange(u)}n.props.onZoomChange(s)}},n.getCropData=function(){return n.state.cropSize?function(e,t,n,r,o,i,s){void 0===i&&(i=0),void 0===s&&(s=!0);var a=s?lU:cU,l=dU(t.width,t.height,i),c=dU(t.naturalWidth,t.naturalHeight,i),u={x:a(100,((l.width-n.width/o)/2-e.x/o)/l.width*100),y:a(100,((l.height-n.height/o)/2-e.y/o)/l.height*100),width:a(100,n.width/l.width*100/o),height:a(100,n.height/l.height*100/o)},d=Math.round(a(c.width,u.width*c.width/100)),h=Math.round(a(c.height,u.height*c.height/100)),p=c.width>=c.height*r?{width:Math.round(h*r),height:h}:{width:d,height:Math.round(d/r)};return{croppedAreaPercentages:u,croppedAreaPixels:(0,tU.Cl)((0,tU.Cl)({},p),{x:Math.round(a(c.width-p.width,u.x*c.width/100)),y:Math.round(a(c.height-p.height,u.y*c.height/100))})}}(n.props.restrictPosition?oU(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition):null},n.emitCropData=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,r),n.props.onCropAreaChange&&n.props.onCropAreaChange(t,r)}},n.emitCropAreaChange=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(t,r)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?oU(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return(0,tU.C6)(t,e),t.prototype.componentDidMount=function(){this.currentDoc&&this.currentWindow&&(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),void 0===window.ResizeObserver&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n  position: absolute;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  overflow: hidden;\n  user-select: none;\n  touch-action: none;\n  cursor: move;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n  will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n  max-width: 100%;\n  max-height: 100%;\n  margin: auto;\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  left: 0;\n  right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n  width: 100%;\n  height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n  width: auto;\n  height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n  position: absolute;\n  left: 50%;\n  top: 50%;\n  transform: translate(-50%, -50%);\n  border: 1px solid rgba(255, 255, 255, 0.5);\n  box-sizing: border-box;\n  box-shadow: 0 0 0 9999em;\n  color: rgba(0, 0, 0, 0.5);\n  overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n  border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n  content: ' ';\n  box-sizing: border-box;\n  position: absolute;\n  border: 1px solid rgba(255, 255, 255, 0.5);\n  top: 0;\n  bottom: 0;\n  left: 33.33%;\n  right: 33.33%;\n  border-top: 0;\n  border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n  content: ' ';\n  box-sizing: border-box;\n  position: absolute;\n  border: 1px solid rgba(255, 255, 255, 0.5);\n  top: 33.33%;\n  bottom: 33.33%;\n  left: 0;\n  right: 0;\n  border-left: 0;\n  border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef))},t.prototype.componentWillUnmount=function(){var e,t;this.currentDoc&&this.currentWindow&&(void 0===window.ResizeObserver&&this.currentWindow.removeEventListener("resize",this.computeSizes),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&(null===(t=this.styleRef.parentNode)||void 0===t||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(e){var t,n,r,o,i,s,a,l,c;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect||e.objectFit!==this.props.objectFit?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(n=this.props.cropSize)||void 0===n?void 0:n.height)||(null===(r=e.cropSize)||void 0===r?void 0:r.width)!==(null===(o=this.props.cropSize)||void 0===o?void 0:o.width)?this.computeSizes():(null===(i=e.crop)||void 0===i?void 0:i.x)===(null===(s=this.props.crop)||void 0===s?void 0:s.x)&&(null===(a=e.crop)||void 0===a?void 0:a.y)===(null===(l=this.props.crop)||void 0===l?void 0:l.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(c=this.videoRef.current)||void 0===c||c.load());var u=this.getObjectFit();u!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:u},this.computeSizes)},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.getObjectFit=function(){var e,t,n,r;if("cover"===this.props.objectFit){if((this.imageRef.current||this.videoRef.current)&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var o=this.containerRect.width/this.containerRect.height;return((null===(e=this.imageRef.current)||void 0===e?void 0:e.naturalWidth)||(null===(t=this.videoRef.current)||void 0===t?void 0:t.videoWidth)||0)/((null===(n=this.imageRef.current)||void 0===n?void 0:n.naturalHeight)||(null===(r=this.videoRef.current)||void 0===r?void 0:r.videoHeight)||0)<o?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=sU(n,r),this.lastPinchRotation=aU(n,r),this.onDragStart(uU(n,r))},t.prototype.onPinchMove=function(e){var n=this;if(this.currentDoc&&this.currentWindow){var r=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]),i=uU(r,o);this.onDrag(i),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame((function(){var e=sU(r,o),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,i,{shouldUpdatePosition:!1}),n.lastPinchDistance=e;var s=aU(r,o),a=n.props.rotation+(s-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(a),n.lastPinchRotation=s}))}},t.prototype.render=function(){var e=this,t=this.props,n=t.image,r=t.video,o=t.mediaProps,i=t.transform,s=t.crop,a=s.x,l=s.y,c=t.rotation,u=t.zoom,d=t.cropShape,h=t.showGrid,p=t.style,f=p.containerStyle,m=p.cropAreaStyle,g=p.mediaStyle,b=t.classes,y=b.containerClassName,v=b.cropAreaClassName,_=b.mediaClassName,x=this.state.mediaObjectFit;return S.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:f,className:pU("reactEasyCrop_Container",y)},n?S.createElement("img",(0,tU.Cl)({alt:"",className:pU("reactEasyCrop_Image","contain"===x&&"reactEasyCrop_Contain","horizontal-cover"===x&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===x&&"reactEasyCrop_Cover_Vertical",_)},o,{src:n,ref:this.imageRef,style:(0,tU.Cl)((0,tU.Cl)({},g),{transform:i||"translate(".concat(a,"px, ").concat(l,"px) rotate(").concat(c,"deg) scale(").concat(u,")")}),onLoad:this.onMediaLoad})):r&&S.createElement("video",(0,tU.Cl)({autoPlay:!0,loop:!0,muted:!0,className:pU("reactEasyCrop_Video","contain"===x&&"reactEasyCrop_Contain","horizontal-cover"===x&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===x&&"reactEasyCrop_Cover_Vertical",_)},o,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:(0,tU.Cl)((0,tU.Cl)({},g),{transform:i||"translate(".concat(a,"px, ").concat(l,"px) rotate(").concat(c,"deg) scale(").concat(u,")")}),controls:!1}),(Array.isArray(r)?r:[{src:r}]).map((function(e){return S.createElement("source",(0,tU.Cl)({key:e.src},e))}))),this.state.cropSize&&S.createElement("div",{style:(0,tU.Cl)((0,tU.Cl)({},m),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:pU("reactEasyCrop_CropArea","round"===d&&"reactEasyCrop_CropAreaRound",h&&"reactEasyCrop_CropAreaGrid",v)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(S.Component);function mU({url:e,width:t,height:n,naturalHeight:r,naturalWidth:o,borderProps:i}){const{isInProgress:s,editedUrl:a,position:l,zoom:c,aspect:u,setPosition:d,setCrop:h,setZoom:p,rotation:f}=Yz(),[m,{width:g}]=(0,yF.A)();let b=n||g*r/o;f%180==90&&(b=g*o/r);const y=(0,Td.jsxs)("div",{className:(0,$v.A)("wp-block-image__crop-area",i?.className,{"is-applying":s}),style:{...i?.style,width:t||g,height:b},children:[(0,Td.jsx)(fU,{image:a||e,disabled:s,minZoom:Wz/100,maxZoom:Gz/100,crop:l,zoom:c/100,aspect:u,onCropChange:e=>{d(e)},onCropComplete:e=>{h(e)},onZoomChange:e=>{p(100*e)}}),s&&(0,Td.jsx)(qE.Ay,{})]});return(0,Td.jsxs)(Td.Fragment,{children:[m,y]})}var gU=n(86662);function bU(){const{isInProgress:e,zoom:t,setZoom:n}=Yz();return(0,Td.jsx)(PE.A,{contentClassName:"wp-block-image__zoom",popoverProps:qz,renderToggle:({isOpen:t,onToggle:n})=>(0,Td.jsx)(r_,{icon:gU.A,label:(0,H.__)("Zoom"),onClick:n,"aria-expanded":t,disabled:e}),renderContent:()=>(0,Td.jsx)(FC,{__nextHasNoMarginBottom:!0,label:(0,H.__)("Zoom"),min:Wz,max:Gz,value:Math.round(t),onChange:n})})}var yU=n(65754);function vU(){const{isInProgress:e,rotateClockwise:t}=Yz();return(0,Td.jsx)(r_,{icon:yU.A,label:(0,H.__)("Rotate"),onClick:t,disabled:e})}function _U(){const{isInProgress:e,apply:t,cancel:n}=Yz();return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(r_,{onClick:t,disabled:e,children:(0,H.__)("Apply")}),(0,Td.jsx)(r_,{onClick:n,children:(0,H.__)("Cancel")})]})}function xU({id:e,url:t,width:n,height:r,naturalHeight:o,naturalWidth:i,onSaveImage:s,onFinishEditing:a,borderProps:l}){return(0,Td.jsxs)(Jz,{id:e,url:t,naturalWidth:i,naturalHeight:o,onSaveImage:s,onFinishEditing:a,children:[(0,Td.jsx)(mU,{borderProps:l,url:t,width:n,height:r,naturalHeight:o,naturalWidth:i}),(0,Td.jsxs)(__,{children:[(0,Td.jsxs)(a_,{children:[(0,Td.jsx)(bU,{}),(0,Td.jsx)(Qv.A,{children:e=>(0,Td.jsx)(eU,{toggleProps:e})}),(0,Td.jsx)(vU,{})]}),(0,Td.jsx)(a_,{children:(0,Td.jsx)(_U,{})})]})]})}var wU=n(69892),kU=n(39116),CU=n(54629),SU=n(62145);const AU=function(e){const{children:t}=e;return(0,Td.jsxs)("div",{className:"components-tip",children:[(0,Td.jsx)(lk.A,{icon:SU.A}),(0,Td.jsx)("p",{children:t})]})},EU=[(0,uI.A)((0,H.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,Td.jsx)("kbd",{})}),(0,uI.A)((0,H.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,Td.jsx)("kbd",{})}),(0,uI.A)((0,H.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,Td.jsx)("kbd",{})}),(0,H.__)("Drag files into the editor to automatically insert media blocks."),(0,H.__)("Change a block's type by pressing the block icon on the toolbar.")],IU=function(){const[e]=(0,S.useState)(Math.floor(Math.random()*EU.length));return(0,Td.jsx)(AU,{children:EU[e]})};var jU=n(59820),TU=n(30221);const BU=function({title:e,icon:t,description:n,blockType:r,className:o}){r&&((0,q.default)("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:e,icon:t,description:n}=r));const{parentNavBlockClientId:i}=(0,Ul.A)((e=>{const{getSelectedBlockClientId:t,getBlockParentsByBlockName:n}=e(hv);return{parentNavBlockClientId:n(t(),"core/navigation",!0)[0]}}),[]),{selectBlock:s}=(0,Vl.A)(hv);return(0,Td.jsxs)("div",{className:(0,$v.A)("block-editor-block-card",o),children:[i&&(0,Td.jsx)(Zv.Ay,{onClick:()=>s(i),label:(0,H.__)("Go to parent Navigation block"),style:{minWidth:24,padding:0},icon:(0,H.isRTL)()?jU.A:TU.A,size:"small"}),(0,Td.jsx)(pz,{icon:t,showColors:!0}),(0,Td.jsxs)(oE.A,{spacing:1,children:[(0,Td.jsx)("h2",{className:"block-editor-block-card__title",children:e}),n&&(0,Td.jsx)(NT.A,{className:"block-editor-block-card__description",children:n})]})]})};var RU=n(76949),NU=n(47225);const DU=(0,$p.f)((e=>({useSubRegistry:t=!0,...n})=>{const r=(0,Hp.A)(),[o]=(0,S.useState)((()=>new WeakMap)),i=function(e,t,n){if(!n)return t;let r=e.get(t);return r||(r=(0,RU.I)({},t),r.registerStore(Sf,dv),e.set(t,r)),r}(o,r,t);return i===r?(0,Td.jsx)(e,{registry:r,...n}):(0,Td.jsx)(NU.Ay,{value:i,children:(0,Td.jsx)(e,{registry:i,...n})})}),"withRegistryProvider"),MU=()=>{};function PU({clientId:e=null,value:t,selection:n,onChange:r=MU,onInput:o=MU}){const i=(0,Hp.A)(),{resetBlocks:s,resetSelection:a,replaceInnerBlocks:l,setHasControlledInnerBlocks:c,__unstableMarkNextChangeAsNotPersistent:u}=i.dispatch(hv),{getBlockName:d,getBlocks:h,getSelectionStart:p,getSelectionEnd:f}=i.select(hv),m=(0,Ul.A)((t=>!e||t(hv).areInnerBlocksControlled(e)),[e]),g=(0,S.useRef)({incoming:null,outgoing:[]}),b=(0,S.useRef)(!1),y=()=>{t&&(u(),e?i.batch((()=>{c(e,!0);const n=t.map((e=>od(e)));b.current&&(g.current.incoming=n),u(),l(e,n)})):(b.current&&(g.current.incoming=t),s(t)))},v=(0,S.useRef)(o),_=(0,S.useRef)(r);(0,S.useEffect)((()=>{v.current=o,_.current=r}),[o,r]),(0,S.useEffect)((()=>{g.current.outgoing.includes(t)?g.current.outgoing[g.current.outgoing.length-1]===t&&(g.current.outgoing=[]):h(e)!==t&&(g.current.outgoing=[],y(),n&&a(n.selectionStart,n.selectionEnd,n.initialPosition))}),[t,e]);const x=(0,S.useRef)(!1);(0,S.useEffect)((()=>{x.current?m||(g.current.outgoing=[],y()):x.current=!0}),[m]),(0,S.useEffect)((()=>{const{getSelectedBlocksInitialCaretPosition:t,isLastBlockChangePersistent:n,__unstableIsLastBlockChangeIgnored:r,areInnerBlocksControlled:o}=i.select(hv);let s=h(e),a=n(),l=!1;b.current=!0;const c=i.subscribe((()=>{if(null!==e&&null===d(e))return;if(e&&!o(e))return;const i=n(),c=h(e),u=c!==s;if(s=c,u&&(g.current.incoming||r()))return g.current.incoming=null,void(a=i);if(u||l&&!u&&i&&!a){a=i,g.current.outgoing.push(s);const e=a?_.current:v.current,n=Tb.has(s);n&&Tb.delete(s),e(s,{selection:{selectionStart:p(),selectionEnd:f(),initialPosition:t()},undoIgnore:n})}l=u}),hv);return()=>{b.current=!1,c()}}),[i,e]),(0,S.useEffect)((()=>()=>{u(),e?(c(e,!1),u(),l(e,[])):s([])}),[])}var OU=n(99671);function LU(){return null}LU.Register=function(){const{registerShortcut:e}=(0,Vl.A)(OU.M_);return(0,S.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,H.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,H.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,H.__)("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:(0,H.__)("Insert a new block after the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"y"}}),e({name:"core/block-editor/delete-multi-selection",category:"block",description:(0,H.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,H.__)("Select all text when typing. Press again to select all blocks."),keyCombination:{modifier:"primary",character:"a"}}),e({name:"core/block-editor/unselect",category:"selection",description:(0,H.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/multi-text-selection",category:"selection",description:(0,H.__)("Select text across multiple blocks."),keyCombination:{modifier:"shift",character:"arrow"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,H.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,H.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,H.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}}),e({name:"core/block-editor/collapse-list-view",category:"list-view",description:(0,H.__)("Collapse all other items."),keyCombination:{modifier:"alt",character:"l"}}),e({name:"core/block-editor/group",category:"block",description:(0,H.__)("Create a group block from the selected multiple blocks."),keyCombination:{modifier:"primary",character:"g"}})}),[e]),null};const FU=LU,zU=DU((e=>{const{children:t,settings:n,stripExperimentalSettings:r=!1}=e,{__experimentalUpdateSettings:o}=Cf((0,Vl.A)(hv));return(0,S.useEffect)((()=>{o({...n,__internalIsInitialized:!0},{stripExperimentalSettings:r,reset:!0})}),[n,r,o]),PU(e),(0,Td.jsxs)(Hl.Kq,{passthrough:!0,children:[!n?.__unstableIsPreviewMode&&(0,Td.jsx)(FU.Register,{}),(0,Td.jsx)($C,{children:t})]})})),UU=e=>(0,Td.jsx)(zU,{...e,stripExperimentalSettings:!0,children:e.children}),VU={name:"u2jump",styles:"position:relative;pointer-events:none;&::after{content:'';position:absolute;top:0;right:0;bottom:0;left:0;}*{pointer-events:none;}"},HU=(0,S.createContext)(!1),{Consumer:$U,Provider:WU}=HU;function GU({className:e,children:t,isDisabled:n=!0,...r}){const o=(0,H_.l)();return(0,Td.jsx)(WU,{value:n,children:(0,Td.jsx)("div",{inert:n?"true":void 0,className:n?o(VU,e,"components-disabled"):void 0,...r,children:t})})}GU.Context=HU,GU.Consumer=$U;const qU=GU;var KU=n(25720),YU=n(18193),JU=n(73247);const XU=(0,S.createContext)({});function ZU({value:e,children:t}){const n=(0,S.useContext)(XU),r=(0,S.useMemo)((()=>({...n,...e})),[n,e]);return(0,Td.jsx)(XU.Provider,{value:r,children:t})}const QU=XU,eV={},tV=zE("editor.BlockEdit")((e=>{const{name:t}=e,n=Sc(t);if(!n)return null;const r=n.edit||n.save;return(0,Td.jsx)(r,{...e})})),nV=e=>{const{attributes:t={},name:n}=e,r=Sc(n),o=(0,S.useContext)(QU),i=(0,S.useMemo)((()=>r&&r.usesContext?Object.fromEntries(Object.entries(o).filter((([e])=>r.usesContext.includes(e)))):eV),[r,o]);if(!r)return null;if(r.apiVersion>1)return(0,Td.jsx)(tV,{...e,context:i});const s=Ic(r,"className",!0)?Bd(n):null,a=(0,$v.A)(s,t.className,e.className);return(0,Td.jsx)(tV,{...e,context:i,className:a})},rV=function({className:e,actions:t,children:n,secondaryActions:r}){return(0,Td.jsx)("div",{style:{display:"contents",all:"initial"},children:(0,Td.jsx)("div",{className:(0,$v.A)(e,"block-editor-warning"),children:(0,Td.jsxs)("div",{className:"block-editor-warning__contents",children:[(0,Td.jsx)("p",{className:"block-editor-warning__message",children:n}),(S.Children.count(t)>0||r)&&(0,Td.jsxs)("div",{className:"block-editor-warning__actions",children:[S.Children.count(t)>0&&S.Children.map(t,((e,t)=>(0,Td.jsx)("span",{className:"block-editor-warning__action",children:e},t))),r&&(0,Td.jsx)(i_.A,{className:"block-editor-warning__secondary",icon:eA.A,label:(0,H.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0,children:()=>(0,Td.jsx)(w_.A,{children:r.map(((e,t)=>(0,Td.jsx)(k_.A,{onClick:e.onClick,children:e.title},t)))})})]})]})})})};function oV({originalBlockClientId:e,name:t,onReplace:n}){const{selectBlock:r}=(0,Vl.A)(hv),o=Sc(t);return(0,Td.jsxs)(rV,{actions:[(0,Td.jsx)(Zv.Ay,{variant:"secondary",onClick:()=>r(e),children:(0,H.__)("Find original")},"find-original"),(0,Td.jsx)(Zv.Ay,{variant:"secondary",onClick:()=>n([]),children:(0,H.__)("Remove")},"remove")],children:[(0,Td.jsxs)("strong",{children:[o?.title,": "]}),(0,H.__)("This block can only be used once.")]})}const iV=(0,S.createContext)({});function sV({mayDisplayControls:e,mayDisplayParentControls:t,blockEditingMode:n,isPreviewMode:r,...o}){const{name:i,isSelected:s,clientId:a,attributes:l={},__unstableLayoutClassNames:c}=o,{layout:u=null,metadata:d={}}=l,{bindings:h}=d,p=Ic(i,"layout",!1)||Ic(i,"__experimentalLayout",!1),{originalBlockClientId:f}=(0,S.useContext)(iV);return(0,Td.jsxs)(Zp,{value:(0,S.useMemo)((()=>({name:i,isSelected:s,clientId:a,layout:p?u:null,__unstableLayoutClassNames:c,[Wp]:e,[Gp]:t,[qp]:n,[Kp]:h,[Yp]:r})),[i,s,a,p,u,c,e,t,n,h,r]),children:[(0,Td.jsx)(nV,{...o}),f&&(0,Td.jsx)(oV,{originalBlockClientId:f,name:i,onReplace:o.onReplace})]})}var aV=n(56900);function lV({title:e,rawContent:t,renderedContent:n,action:r,actionText:o,className:i}){return(0,Td.jsxs)("div",{className:i,children:[(0,Td.jsxs)("div",{className:"block-editor-block-compare__content",children:[(0,Td.jsx)("h2",{className:"block-editor-block-compare__heading",children:e}),(0,Td.jsx)("div",{className:"block-editor-block-compare__html",children:t}),(0,Td.jsx)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor",children:(0,Td.jsx)(Ad.A,{children:(0,JU.A)(n)})})]}),(0,Td.jsx)("div",{className:"block-editor-block-compare__action",children:(0,Td.jsx)(Zv.Ay,{variant:"secondary",tabIndex:"0",onClick:r,children:o})})]})}const cV=function({block:e,onKeep:t,onConvert:n,convertor:r,convertButtonText:o}){const i=function(e){const t=(Array.isArray(e)?e:[e]).map((e=>Od(e.name,e.attributes,e.innerBlocks)));return t.join("")}(r(e)),s=(a=e.originalContent,l=i,(0,aV.JJ)(a,l).map(((e,t)=>{const n=(0,$v.A)({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,Td.jsx)("span",{className:n,children:e.value},t)})));var a,l;return(0,Td.jsxs)("div",{className:"block-editor-block-compare__wrapper",children:[(0,Td.jsx)(lV,{title:(0,H.__)("Current"),className:"block-editor-block-compare__current",action:t,actionText:(0,H.__)("Convert to HTML"),rawContent:e.originalContent,renderedContent:e.originalContent}),(0,Td.jsx)(lV,{title:(0,H.__)("After Conversion"),className:"block-editor-block-compare__converted",action:n,actionText:o,rawContent:s,renderedContent:i})]})},uV=e=>hp({HTML:e.originalContent});function dV({clientId:e}){const{block:t,canInsertHTMLBlock:n,canInsertClassicBlock:r}=(0,Ul.A)((t=>{const{canInsertBlockType:n,getBlock:r,getBlockRootClientId:o}=t(hv),i=o(e);return{block:r(e),canInsertHTMLBlock:n("core/html",i),canInsertClassicBlock:n("core/freeform",i)}}),[e]),{replaceBlock:o}=(0,Vl.A)(hv),[i,s]=(0,S.useState)(!1),a=(0,S.useCallback)((()=>s(!1)),[]),l=(0,S.useMemo)((()=>({toClassic(){const e=td("core/freeform",{content:t.originalContent});return o(t.clientId,e)},toHTML(){const e=td("core/html",{content:t.originalContent});return o(t.clientId,e)},toBlocks(){const e=uV(t);return o(t.clientId,e)},toRecoveredBlock(){const e=td(t.name,t.attributes,t.innerBlocks);return o(t.clientId,e)}})),[t,o]),c=(0,S.useMemo)((()=>[{title:(0,H._x)("Resolve","imperative verb"),onClick:()=>s(!0)},n&&{title:(0,H.__)("Convert to HTML"),onClick:l.toHTML},r&&{title:(0,H.__)("Convert to Classic Block"),onClick:l.toClassic}].filter(Boolean)),[n,r,l]);return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(rV,{actions:[(0,Td.jsx)(Zv.Ay,{onClick:l.toRecoveredBlock,variant:"primary",children:(0,H.__)("Attempt Block Recovery")},"recover")],secondaryActions:c,children:(0,H.__)("This block contains unexpected or invalid content.")}),i&&(0,Td.jsx)(YF.A,{title:(0,H.__)("Resolve Block"),onRequestClose:a,className:"block-editor-block-compare",children:(0,Td.jsx)(cV,{block:t,onKeep:l.toHTML,onConvert:l.toBlocks,convertor:uV,convertButtonText:(0,H.__)("Convert to Blocks")})})]})}const hV=(0,Td.jsx)(rV,{className:"block-editor-block-list__block-crash-warning",children:(0,H.__)("This block has encountered an error and cannot be previewed.")}),pV=()=>hV;class fV extends S.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}const mV=fV;var gV=n(28716);const bV=function({clientId:e}){const[t,n]=(0,S.useState)(""),r=(0,Ul.A)((t=>t(hv).getBlock(e)),[e]),{updateBlock:o}=(0,Vl.A)(hv);return(0,S.useEffect)((()=>{n(Ld(r))}),[r]),(0,Td.jsx)(gV.A,{className:"block-editor-block-list__block-html-textarea",value:t,onBlur:()=>{const i=Sc(r.name);if(!i)return;const s=Th(i,t,r.attributes),a=t||Od(i,s),[l]=t?mh({...r,attributes:s,originalContent:a}):[!0];o(e,{attributes:s,originalContent:a,isValid:l}),t||n(a)},onChange:e=>n(e.target.value)})};var yV=n(88211),vV=MV(),_V=e=>BV(e,vV),xV=MV();_V.write=e=>BV(e,xV);var wV=MV();_V.onStart=e=>BV(e,wV);var kV=MV();_V.onFrame=e=>BV(e,kV);var CV=MV();_V.onFinish=e=>BV(e,CV);var SV=[];_V.setTimeout=(e,t)=>{let n=_V.now()+t,r=()=>{let e=SV.findIndex((e=>e.cancel==r));~e&&SV.splice(e,1),jV-=~e?1:0},o={time:n,handler:e,cancel:r};return SV.splice(AV(n),0,o),jV+=1,RV(),o};var AV=e=>~(~SV.findIndex((t=>t.time>e))||~SV.length);_V.cancel=e=>{wV.delete(e),kV.delete(e),CV.delete(e),vV.delete(e),xV.delete(e)},_V.sync=e=>{TV=!0,_V.batchedUpdates(e),TV=!1},_V.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...e){t=e,_V.onStart(n)}return r.handler=e,r.cancel=()=>{wV.delete(n),t=null},r};var EV=typeof window<"u"?window.requestAnimationFrame:()=>{};_V.use=e=>EV=e,_V.now=typeof performance<"u"?()=>performance.now():Date.now,_V.batchedUpdates=e=>e(),_V.catch=console.error,_V.frameLoop="always",_V.advance=()=>{"demand"!==_V.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):DV()};var IV=-1,jV=0,TV=!1;function BV(e,t){TV?(t.delete(e),e(0)):(t.add(e),RV())}function RV(){IV<0&&(IV=0,"demand"!==_V.frameLoop&&EV(NV))}function NV(){~IV&&(EV(NV),_V.batchedUpdates(DV))}function DV(){let e=IV;IV=_V.now();let t=AV(IV);t&&(PV(SV.splice(0,t),(e=>e.handler())),jV-=t),jV?(wV.flush(),vV.flush(e?Math.min(64,IV-e):16.667),kV.flush(),xV.flush(),CV.flush()):IV=-1}function MV(){let e=new Set,t=e;return{add(n){jV+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(jV-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,jV-=t.size,PV(t,(t=>t(n)&&e.add(t))),jV+=e.size,t=e)}}}function PV(e,t){e.forEach((e=>{try{t(e)}catch(e){_V.catch(e)}}))}var OV=Object.defineProperty,LV={};function FV(){}((e,t)=>{for(var n in t)OV(e,n,{get:t[n],enumerable:!0})})(LV,{assign:()=>QV,colors:()=>JV,createStringInterpolator:()=>GV,skipAnimation:()=>XV,to:()=>qV,willAdvance:()=>ZV});var zV={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 UV(e,t){if(zV.arr(e)){if(!zV.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}var VV=(e,t)=>e.forEach(t);function HV(e,t,n){if(zV.arr(e))for(let r=0;r<e.length;r++)t.call(n,e[r],`${r}`);else for(let r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r)}var $V=e=>zV.und(e)?[]:zV.arr(e)?e:[e];function WV(e,t){if(e.size){let n=Array.from(e);e.clear(),VV(n,t)}}var GV,qV,KV=(e,...t)=>WV(e,(e=>e(...t))),YV=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),JV=null,XV=!1,ZV=FV,QV=e=>{e.to&&(qV=e.to),e.now&&(_V.now=e.now),void 0!==e.colors&&(JV=e.colors),null!=e.skipAnimation&&(XV=e.skipAnimation),e.createStringInterpolator&&(GV=e.createStringInterpolator),e.requestAnimationFrame&&_V.use(e.requestAnimationFrame),e.batchedUpdates&&(_V.batchedUpdates=e.batchedUpdates),e.willAdvance&&(ZV=e.willAdvance),e.frameLoop&&(_V.frameLoop=e.frameLoop)},eH=new Set,tH=[],nH=[],rH=0,oH={get idle(){return!eH.size&&!tH.length},start(e){rH>e.priority?(eH.add(e),_V.onStart(iH)):(sH(e),_V(lH))},advance:lH,sort(e){if(rH)_V.onFrame((()=>oH.sort(e)));else{let t=tH.indexOf(e);~t&&(tH.splice(t,1),aH(e))}},clear(){tH=[],eH.clear()}};function iH(){eH.forEach(sH),eH.clear(),_V(lH)}function sH(e){tH.includes(e)||aH(e)}function aH(e){tH.splice(function(e,t){let n=e.findIndex(t);return n<0?e.length:n}(tH,(t=>t.priority>e.priority)),0,e)}function lH(e){let t=nH;for(let n=0;n<tH.length;n++){let r=tH[n];rH=r.priority,r.idle||(ZV(r),r.advance(e),r.idle||t.push(r))}return rH=0,(nH=tH).length=0,(tH=t).length>0}var cH="[-+]?\\d*\\.?\\d+",uH=cH+"%";function dH(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var hH=new RegExp("rgb"+dH(cH,cH,cH)),pH=new RegExp("rgba"+dH(cH,cH,cH,cH)),fH=new RegExp("hsl"+dH(cH,uH,uH)),mH=new RegExp("hsla"+dH(cH,uH,uH,cH)),gH=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,bH=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,yH=/^#([0-9a-fA-F]{6})$/,vH=/^#([0-9a-fA-F]{8})$/;function _H(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 xH(e,t,n){let r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=_H(o,r,e+1/3),s=_H(o,r,e),a=_H(o,r,e-1/3);return Math.round(255*i)<<24|Math.round(255*s)<<16|Math.round(255*a)<<8}function wH(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function kH(e){return(parseFloat(e)%360+360)%360/360}function CH(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function SH(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function AH(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=yH.exec(e))?parseInt(t[1]+"ff",16)>>>0:JV&&void 0!==JV[e]?JV[e]:(t=hH.exec(e))?(wH(t[1])<<24|wH(t[2])<<16|wH(t[3])<<8|255)>>>0:(t=pH.exec(e))?(wH(t[1])<<24|wH(t[2])<<16|wH(t[3])<<8|CH(t[4]))>>>0:(t=gH.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=vH.exec(e))?parseInt(t[1],16)>>>0:(t=bH.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=fH.exec(e))?(255|xH(kH(t[1]),SH(t[2]),SH(t[3])))>>>0:(t=mH.exec(e))?(xH(kH(t[1]),SH(t[2]),SH(t[3]))|CH(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 EH=(e,t,n)=>{if(zV.fun(e))return e;if(zV.arr(e))return EH({range:e,output:t,extrapolate:n});if(zV.str(e.output[0]))return GV(e);let r=e,o=r.output,i=r.range||[0,1],s=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",l=r.easing||(e=>e);return e=>{let t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,i);return function(e,t,n,r,o,i,s,a,l){let c=l?l(e):e;if(c<t){if("identity"===s)return c;"clamp"===s&&(c=t)}if(c>n){if("identity"===a)return c;"clamp"===a&&(c=n)}return r===o?r:t===n?e<=t?r:o:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=i(c),r===-1/0?c=-c:o===1/0?c+=r:c=c*(o-r)+r,c)}(e,i[t],i[t+1],o[t],o[t+1],l,s,a,r.map)}},IH=1.70158,jH=2.5949095,TH=2.70158,BH=2*Math.PI/3,RH=2*Math.PI/4.5,NH=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,DH={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=>TH*e*e*e-IH*e*e,easeOutBack:e=>1+TH*Math.pow(e-1,3)+IH*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*(7.189819*e-jH)/2:(Math.pow(2*e-2,2)*((jH+1)*(2*e-2)+jH)+2)/2,easeInElastic:e=>0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*BH),easeOutElastic:e=>0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*BH)+1,easeInOutElastic:e=>0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*RH)/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*RH)/2+1,easeInBounce:e=>1-NH(1-e),easeOutBounce:NH,easeInOutBounce:e=>e<.5?(1-NH(1-2*e))/2:(1+NH(2*e-1))/2,steps:(e,t="end")=>n=>{let r=(n="end"===t?Math.min(n,.999):Math.max(n,.001))*e;return((e,t,n)=>Math.min(Math.max(n,0),1))(0,0,("end"===t?Math.floor(r):Math.ceil(r))/e)}},MH=Symbol.for("FluidValue.get"),PH=Symbol.for("FluidValue.observers"),OH=e=>Boolean(e&&e[MH]),LH=e=>e&&e[MH]?e[MH]():e,FH=e=>e[PH]||null;function zH(e,t){let n=e[PH];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}var UH=class{[MH];[PH];constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");VH(this,e)}},VH=(e,t)=>GH(e,MH,t);function HH(e,t){if(e[MH]){let n=e[PH];n||GH(e,PH,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function $H(e,t){let n=e[PH];if(n&&n.has(t)){let r=n.size-1;r?n.delete(t):e[PH]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var WH,GH=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),qH=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,KH=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,YH=new RegExp(`(${qH.source})(%|[a-z]+)`,"i"),JH=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,XH=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,ZH=e=>{let[t,n]=QH(e);if(!t||YV())return e;let r=window.getComputedStyle(document.documentElement).getPropertyValue(t);return r?r.trim():n&&n.startsWith("--")?window.getComputedStyle(document.documentElement).getPropertyValue(n)||e:n&&XH.test(n)?ZH(n):n||e},QH=e=>{let t=XH.exec(e);if(!t)return[,];let[,n,r]=t;return[n,r]},e$=(e,t,n,r,o)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${o})`,t$=e=>{WH||(WH=JV?new RegExp(`(${Object.keys(JV).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map((e=>LH(e).replace(XH,ZH).replace(KH,AH).replace(WH,AH))),n=t.map((e=>e.match(qH).map(Number))),r=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>EH({...e,output:t})));return e=>{let n=!YH.test(t[0])&&t.find((e=>YH.test(e)))?.replace(qH,""),o=0;return t[0].replace(qH,(()=>`${r[o++](e)}${n||""}`)).replace(JH,e$)}},n$="react-spring: ",r$=e=>{let t=e,n=!1;if("function"!=typeof t)throw new TypeError(`${n$}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},o$=r$(console.warn);function i$(e){return zV.str(e)&&("#"==e[0]||/\d/.test(e)||!YV()&&XH.test(e)||e in(JV||{}))}r$(console.warn),new WeakMap,new Set,new WeakMap,new WeakMap,new WeakMap;var s$=YV()?S.useEffect:S.useLayoutEffect;var a$=[],l$=Symbol.for("Animated:node"),c$=e=>e&&e[l$],u$=(e,t)=>((e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}))(e,l$,t),d$=e=>e&&e[l$]&&e[l$].getPayload(),h$=class{payload;constructor(){u$(this,this)}getPayload(){return this.payload||[]}},p$=class extends h${constructor(e){super(),this._value=e,zV.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(e){return new p$(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return zV.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,zV.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},f$=class extends p${_string=null;_toString;constructor(e){super(0),this._toString=EH({output:[e,e]})}static create(e){return new f$(e)}getValue(){return this._string??(this._string=this._toString(this._value))}setValue(e){if(zV.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=EH({output:[this.getValue(),e]})),this._value=0,super.reset()}},m$={dependencies:null},g$=class extends h${constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return HV(this.source,((n,r)=>{var o;(o=n)&&o[l$]===o?t[r]=n.getValue(e):OH(n)?t[r]=LH(n):e||(t[r]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&VV(this.payload,(e=>e.reset()))}_makePayload(e){if(e){let t=new Set;return HV(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){m$.dependencies&&OH(e)&&m$.dependencies.add(e);let t=d$(e);t&&VV(t,(e=>this.add(e)))}},b$=class extends g${constructor(e){super(e)}static create(e){return new b$(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(y$)),!0)}};function y$(e){return(i$(e)?f$:p$).create(e)}function v$(e){let t=c$(e);return t?t.constructor:zV.arr(e)?b$:i$(e)?f$:p$}var _$=(e,t)=>{let n=!zV.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,S.forwardRef)(((r,o)=>{let i=(0,S.useRef)(null),s=n&&(0,S.useCallback)((e=>{i.current=function(e,t){return e&&(zV.fun(e)?e(t):e.current=t),t}(o,e)}),[o]),[a,l]=function(e,t){let n=new Set;return m$.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new g$(e),m$.dependencies=null,[e,n]}(r,t),c=function(){let e=(0,S.useState)()[1],t=(()=>{let e=(0,S.useRef)(!1);return s$((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}(),u=()=>{let e=i.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,a.getValue(!0)))&&c()},d=new x$(u,l),h=(0,S.useRef)();s$((()=>(h.current=d,VV(l,(e=>HH(e,d))),()=>{h.current&&(VV(h.current.deps,(e=>$H(e,h.current))),_V.cancel(h.current.update))}))),(0,S.useEffect)(u,[]),(0,S.useEffect)((()=>()=>{let e=h.current;VV(e.deps,(t=>$H(t,e)))}),a$);let p=t.getComponentProps(a.getValue());return S.createElement(e,{...p,ref:s})}))},x$=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&_V.write(this.update)}},w$=Symbol.for("AnimatedComponent"),k$=e=>zV.str(e)?e:e&&zV.str(e.displayName)?e.displayName:zV.fun(e)&&e.name||null;function C$(e,...t){return zV.fun(e)?e(...t):e}var S$=(e,t)=>!0===e||!!(t&&e&&(zV.fun(e)?e(t):$V(e).includes(t))),A$=(e,t)=>zV.obj(e)?t&&e[t]:e,E$=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,I$=e=>e,j$=(e,t=I$)=>{let n=T$;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));let r={};for(let o of n){let n=t(e[o],o);zV.und(n)||(r[o]=n)}return r},T$=["config","onProps","onStart","onChange","onPause","onResume","onRest"],B$={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 R$(e){let t=function(e){let t={},n=0;if(HV(e,((e,r)=>{B$[r]||(t[r]=e,n++)})),n)return t}(e);if(t){let n={to:t};return HV(e,((e,r)=>r in t||(n[r]=e))),n}return{...e}}function N$(e){return e=LH(e),zV.arr(e)?e.map(N$):i$(e)?LV.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function D$(e){return zV.fun(e)||zV.arr(e)&&zV.obj(e[0])}var M$={tension:170,friction:26,mass:1,damping:1,easing:DH.linear,clamp:!1},P$=class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,M$)}};function O$(e,t){if(zV.und(t.decay)){let n=!zV.und(t.tension)||!zV.und(t.friction);(n||!zV.und(t.frequency)||!zV.und(t.damping)||!zV.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}var L$=[],F$=class{changed=!1;values=L$;toValues=null;fromValues=L$;to;from;config=new P$;immediate=!1};function z$(e,{key:t,props:n,defaultProps:r,state:o,actions:i}){return new Promise(((s,a)=>{let l,c,u=S$(n.cancel??r?.cancel,t);if(u)p();else{zV.und(n.pause)||(o.paused=S$(n.pause,t));let e=r?.pause;!0!==e&&(e=o.paused||S$(e,t)),l=C$(n.delay||0,t),e?(o.resumeQueue.add(h),i.pause()):(i.resume(),h())}function d(){o.resumeQueue.add(h),o.timeouts.delete(c),c.cancel(),l=c.time-_V.now()}function h(){l>0&&!LV.skipAnimation?(o.delayed=!0,c=_V.setTimeout(p,l),o.pauseQueue.add(d),o.timeouts.add(c)):p()}function p(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(d),o.timeouts.delete(c),e<=(o.cancelId||0)&&(u=!0);try{i.start({...n,callId:e,cancel:u},s)}catch(e){a(e)}}}))}var U$=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?$$(e.get()):t.every((e=>e.noop))?V$(e.get()):H$(e.get(),t.every((e=>e.finished))),V$=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),H$=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),$$=e=>({value:e,cancelled:!0,finished:!1});function W$(e,t,n,r){let{callId:o,parentId:i,onRest:s}=t,{asyncTo:a,promise:l}=n;return i||e!==a||t.reset?n.promise=(async()=>{n.asyncId=o,n.asyncTo=e;let c,u,d,h=j$(t,((e,t)=>"onRest"===t?void 0:e)),p=new Promise(((e,t)=>(c=e,u=t))),f=e=>{let t=o<=(n.cancelId||0)&&$$(r)||o!==n.asyncId&&H$(r,!1);if(t)throw e.result=t,u(e),e},m=(e,t)=>{let i=new q$,s=new K$;return(async()=>{if(LV.skipAnimation)throw G$(n),s.result=H$(r,!1),u(s),s;f(i);let a=zV.obj(e)?{...e}:{...t,to:e};a.parentId=o,HV(h,((e,t)=>{zV.und(a[t])&&(a[t]=e)}));let l=await r.start(a);return f(i),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),l})()};if(LV.skipAnimation)return G$(n),H$(r,!1);try{let t;t=zV.arr(e)?(async e=>{for(let t of e)await m(t)})(e):Promise.resolve(e(m,r.stop.bind(r))),await Promise.all([t.then(c),p]),d=H$(r.get(),!0,!1)}catch(e){if(e instanceof q$)d=e.result;else{if(!(e instanceof K$))throw e;d=e.result}}finally{o==n.asyncId&&(n.asyncId=i,n.asyncTo=i?a:void 0,n.promise=i?l:void 0)}return zV.fun(s)&&_V.batchedUpdates((()=>{s(d,r,r.item)})),d})():l}function G$(e,t){WV(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var q$=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.")}},K$=class extends Error{result;constructor(){super("SkipAnimationSignal")}},Y$=e=>e instanceof X$,J$=1,X$=class extends UH{id=J$++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=c$(this);return e&&e.getValue()}to(...e){return LV.to(this,e)}interpolate(...e){return o$(`${n$}The "interpolate" function is deprecated in v9 (use "to" instead)`),LV.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){zH(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||oH.sort(this),zH(this,{type:"priority",parent:this,priority:e})}},Z$=Symbol.for("SpringPhase"),Q$=e=>(1&e[Z$])>0,eW=e=>(2&e[Z$])>0,tW=e=>(4&e[Z$])>0,nW=(e,t)=>t?e[Z$]|=3:e[Z$]&=-3,rW=(e,t)=>t?e[Z$]|=4:e[Z$]&=-5,oW=class extends X${key;animation=new F$;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(),!zV.und(e)||!zV.und(t)){let n=zV.obj(e)?{...e}:{...t,from:e};zV.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(eW(this)||this._state.asyncTo)||tW(this)}get goal(){return LH(this.animation.to)}get velocity(){let e=c$(this);return e instanceof p$?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Q$(this)}get isAnimating(){return eW(this)}get isPaused(){return tW(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1,r=this.animation,{config:o,toValues:i}=r,s=d$(r.to);!s&&OH(r.to)&&(i=$V(LH(r.to))),r.values.forEach(((a,l)=>{if(a.done)return;let c=a.constructor==f$?1:s?s[l].lastPosition:i[l],u=r.immediate,d=c;if(!u){if(d=a.lastPosition,o.tension<=0)return void(a.done=!0);let t,n=a.elapsedTime+=e,i=r.fromValues[l],s=null!=a.v0?a.v0:a.v0=zV.arr(o.velocity)?o.velocity[l]:o.velocity,h=o.precision||(i==c?.005:Math.min(1,.001*Math.abs(c-i)));if(zV.und(o.duration))if(o.decay){let e=!0===o.decay?.998:o.decay,r=Math.exp(-(1-e)*n);d=i+s/(1-e)*(1-r),u=Math.abs(a.lastPosition-d)<=h,t=s*r}else{t=null==a.lastVelocity?s:a.lastVelocity;let n,r=o.restVelocity||h/10,l=o.clamp?0:o.bounce,p=!zV.und(l),f=i==c?a.v0>0:i<c,m=!1,g=1,b=Math.ceil(e/g);for(let e=0;e<b&&(n=Math.abs(t)>r,n||(u=Math.abs(c-d)<=h,!u));++e)p&&(m=d==c||d>c==f,m&&(t=-t*l,d=c)),t+=(1e-6*-o.tension*(d-c)+.001*-o.friction*t)/o.mass*g,d+=t*g}else{let r=1;o.duration>0&&(this._memoizedDuration!==o.duration&&(this._memoizedDuration=o.duration,a.durationProgress>0&&(a.elapsedTime=o.duration*a.durationProgress,n=a.elapsedTime+=e)),r=(o.progress||0)+n/this._memoizedDuration,r=r>1?1:r<0?0:r,a.durationProgress=r),d=i+o.easing(r)*(c-i),t=(d-a.lastPosition)/e,u=1==r}a.lastVelocity=t,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}s&&!s[l].done&&(u=!1),u?a.done=!0:t=!1,a.setValue(d,o.round)&&(n=!0)}));let a=c$(this),l=a.getValue();if(t){let e=LH(r.to);l===e&&!n||o.decay?n&&o.decay&&this._onChange(l):(a.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(l)}set(e){return _V.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(eW(this)){let{to:e,config:t}=this.animation;_V.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 zV.und(e)?(n=this.queue||[],this.queue=[]):n=[zV.obj(e)?e:{...t,to:e}],Promise.all(n.map((e=>this._update(e)))).then((e=>U$(this,e)))}stop(e){let{to:t}=this.animation;return this._focus(this.get()),G$(this._state,e&&this._lastCallId),_V.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){let t=this.key||"",{to:n,from:r}=e;n=zV.obj(n)?n[t]:n,(null==n||D$(n))&&(n=void 0),r=zV.obj(r)?r[t]:r,null==r&&(r=void 0);let o={to:n,from:r};return Q$(this)||(e.reverse&&([n,r]=[r,n]),r=LH(r),zV.und(r)?c$(this)||this._set(n):this._set(r)),o}_update({...e},t){let{key:n,defaultProps:r}=this;e.default&&Object.assign(r,j$(e,((e,t)=>/^on/.test(t)?A$(e,n):e))),uW(this,e,"onProps"),dW(this,"onProps",e,this);let o=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let i=this._state;return z$(++this._lastCallId,{key:n,props:e,defaultProps:r,state:i,actions:{pause:()=>{tW(this)||(rW(this,!0),KV(i.pauseQueue),dW(this,"onPause",H$(this,iW(this,this.animation.to)),this))},resume:()=>{tW(this)&&(rW(this,!1),eW(this)&&this._resume(),KV(i.resumeQueue),dW(this,"onResume",H$(this,iW(this,this.animation.to)),this))},start:this._merge.bind(this,o)}}).then((n=>{if(e.loop&&n.finished&&(!t||!n.noop)){let t=sW(e);if(t)return this._update(t,!0)}return n}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n($$(this));let r=!zV.und(e.to),o=!zV.und(e.from);if(r||o){if(!(t.callId>this._lastToId))return n($$(this));this._lastToId=t.callId}let{key:i,defaultProps:s,animation:a}=this,{to:l,from:c}=a,{to:u=l,from:d=c}=e;o&&!r&&(!t.default||zV.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);let h=!UV(d,c);h&&(a.from=d),d=LH(d);let p=!UV(u,l);p&&this._focus(u);let f=D$(t.to),{config:m}=a,{decay:g,velocity:b}=m;(r||o)&&(m.velocity=0),t.config&&!f&&function(e,t,n){n&&(O$(n={...n},t),t={...n,...t}),O$(e,t),Object.assign(e,t);for(let t in M$)null==e[t]&&(e[t]=M$[t]);let{mass:r,frequency:o,damping:i}=e;zV.und(o)||(o<.01&&(o=.01),i<0&&(i=0),e.tension=Math.pow(2*Math.PI/o,2)*r,e.friction=4*Math.PI*i*r/o)}(m,C$(t.config,i),t.config!==s.config?C$(s.config,i):void 0);let y=c$(this);if(!y||zV.und(u))return n(H$(this,!0));let v=zV.und(t.reset)?o&&!t.default:!zV.und(d)&&S$(t.reset,i),_=v?d:this.get(),x=N$(u),w=zV.num(x)||zV.arr(x)||i$(x),k=!f&&(!w||S$(s.immediate||t.immediate,i));if(p){let e=v$(u);if(e!==y.constructor){if(!k)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=OH(u),A=!1;if(!S){let e=v||!Q$(this)&&h;(p||e)&&(A=UV(N$(_),x),S=!A),(!UV(a.immediate,k)&&!k||!UV(m.decay,g)||!UV(m.velocity,b))&&(S=!0)}if(A&&eW(this)&&(a.changed&&!v?S=!0:S||this._stop(l)),!f&&((S||OH(l))&&(a.values=y.getPayload(),a.toValues=OH(u)?null:C==f$?[1]:$V(x)),a.immediate!=k&&(a.immediate=k,!k&&!v&&this._set(l)),S)){let{onRest:e}=a;VV(cW,(e=>uW(this,t,e)));let r=H$(this,iW(this,l));KV(this._pendingCalls,r),this._pendingCalls.add(n),a.changed&&_V.batchedUpdates((()=>{a.changed=!v,e?.(r,this),v?C$(s.onRest,r):a.onStart?.(r,this)}))}v&&this._set(_),f?n(W$(t.to,t,this._state,this)):S?this._start():eW(this)&&!p?this._pendingCalls.add(n):n(V$(_))}_focus(e){let t=this.animation;e!==t.to&&(FH(this)&&this._detach(),t.to=e,FH(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;OH(t)&&(HH(t,this),Y$(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;OH(e)&&$H(e,this)}_set(e,t=!0){let n=LH(e);if(!zV.und(n)){let e=c$(this);if(!e||!UV(n,e.getValue())){let r=v$(n);e&&e.constructor==r?e.setValue(n):u$(this,r.create(n)),e&&_V.batchedUpdates((()=>{this._onChange(n,t)}))}}return c$(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,dW(this,"onStart",H$(this,iW(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),C$(this.animation.onChange,e,this)),C$(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){let e=this.animation;c$(this).reset(LH(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),eW(this)||(nW(this,!0),tW(this)||this._resume())}_resume(){LV.skipAnimation?this.finish():oH.start(this)}_stop(e,t){if(eW(this)){nW(this,!1);let n=this.animation;VV(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),zH(this,{type:"idle",parent:this});let r=t?$$(this.get()):H$(this.get(),iW(this,e??n.to));KV(this._pendingCalls,r),n.changed&&(n.changed=!1,dW(this,"onRest",r,this))}}};function iW(e,t){let n=N$(t);return UV(N$(e.get()),n)}function sW(e,t=e.loop,n=e.to){let r=C$(t);if(r){let o=!0!==r&&R$(r),i=(o||e).reverse,s=!o||o.reset;return aW({...e,loop:t,default:!1,pause:void 0,to:!i||D$(n)?n:void 0,from:s?e.from:void 0,reset:s,...o})}}function aW(e){let{to:t,from:n}=e=R$(e),r=new Set;return zV.obj(t)&&lW(t,r),zV.obj(n)&&lW(n,r),e.keys=r.size?Array.from(r):null,e}function lW(e,t){HV(e,((e,n)=>null!=e&&t.add(n)))}var cW=["onStart","onRest","onChange","onPause","onResume"];function uW(e,t,n){e.animation[n]=t[n]!==E$(t,n)?A$(t[n],e.key):void 0}function dW(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var hW=["onStart","onChange","onRest"],pW=1,fW=class{id=pW++;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];zV.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(aW(e)),this}start(e){let{queue:t}=this;return e?t=$V(e).map(aW):this.queue=[],this._flush?this._flush(this,t):(gW(this,t),function(e,t){return Promise.all(t.map((t=>mW(e,t)))).then((t=>U$(e,t)))}(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let n=this.springs;VV($V(t),(t=>n[t].stop(!!e)))}else G$(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(zV.und(e))this.start({pause:!0});else{let t=this.springs;VV($V(e),(e=>t[e].pause()))}return this}resume(e){if(zV.und(e))this.start({pause:!1});else{let t=this.springs;VV($V(e),(e=>t[e].resume()))}return this}each(e){HV(this.springs,e)}_onFrame(){let{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,o=this._changed.size>0;(r&&!this._started||o&&!this._started)&&(this._started=!0,WV(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));let i=!r&&this._started,s=o||i&&n.size?this.get():null;o&&t.size&&WV(t,(([e,t])=>{t.value=s,e(t,this,this._item)})),i&&(this._started=!1,WV(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)}_V.onFrame(this._onFrame)}};async function mW(e,t,n){let{keys:r,to:o,from:i,loop:s,onRest:a,onResolve:l}=t,c=zV.obj(t.default)&&t.default;s&&(t.loop=!1),!1===o&&(t.to=null),!1===i&&(t.from=null);let u=zV.arr(o)||zV.fun(o)?o:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):VV(hW,(n=>{let r=t[n];if(zV.fun(r)){let o=e._events[n];t[n]=({finished:e,cancelled:t})=>{let n=o.get(r);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):o.set(r,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));let d=e._state;t.pause===!d.paused?(d.paused=t.pause,KV(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);let h=(r||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),p=!0===t.cancel||!0===E$(t,"cancel");(u||p&&d.asyncId)&&h.push(z$(++e._lastAsyncId,{props:t,state:d,actions:{pause:FV,resume:FV,start(t,n){p?(G$(d,e._lastAsyncId),n($$(e))):(t.onRest=a,n(W$(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));let f=U$(e,await Promise.all(h));if(s&&f.finished&&(!n||!f.noop)){let n=sW(t,s,o);if(n)return gW(e,[n]),mW(e,n,!0)}return l&&_V.batchedUpdates((()=>l(f,e,e.item))),f}function gW(e,t){VV(t,(t=>{!function(e,t,n){t.keys&&VV(t.keys,(r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)}))}(e.springs,t,(t=>function(e,t){let n=new oW;return n.key=e,t&&HH(n,t),n}(t,e)))}))}var bW=({children:e,...t})=>{let n=(0,S.useContext)(yW),r=t.pause||!!n.pause,o=t.immediate||!!n.immediate;t=function(e,t){let[n]=(0,S.useState)((()=>({inputs:t,result:e()}))),r=(0,S.useRef)(),o=r.current,i=o;return i?Boolean(t&&i.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,i.inputs))||(i={inputs:t,result:e()}):i=n,(0,S.useEffect)((()=>{r.current=i,o==n&&(n.inputs=n.result=void 0)}),[i]),i.result}((()=>({pause:r,immediate:o})),[r,o]);let{Provider:i}=yW;return S.createElement(i,{value:t},e)},yW=function(e,t){return Object.assign(e,S.createContext({})),e.Provider._context=e,e.Consumer._context=e,e}(bW);bW.Provider=yW.Provider,bW.Consumer=yW.Consumer;var vW=class extends X${constructor(e,t){super(),this.source=e,this.calc=EH(...t);let n=this._get(),r=v$(n);u$(this,r.create(n))}key;idle=!0;calc;_active=new Set;advance(e){let t=this._get();UV(t,this.get())||(c$(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&xW(this._active)&&wW(this)}_get(){let e=zV.arr(this.source)?this.source.map(LH):$V(LH(this.source));return this.calc(...e)}_start(){this.idle&&!xW(this._active)&&(this.idle=!1,VV(d$(this),(e=>{e.done=!1})),LV.skipAnimation?(_V.batchedUpdates((()=>this.advance())),wW(this)):oH.start(this))}_attach(){let e=1;VV($V(this.source),(t=>{OH(t)&&HH(t,this),Y$(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){VV($V(this.source),(e=>{OH(e)&&$H(e,this)})),this._active.clear(),wW(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=$V(this.source).reduce(((e,t)=>Math.max(e,(Y$(t)?t.priority:0)+1)),0))}};function _W(e){return!1!==e.idle}function xW(e){return!e.size||Array.from(e).every(_W)}function wW(e){e.idle||(e.idle=!0,VV(d$(e),(e=>{e.done=!0})),zH(e,{type:"idle",parent:e}))}LV.assign({createStringInterpolator:t$,to:(e,t)=>new vW(e,t)}),oH.advance;var kW=n(44059),CW=/^--/;function SW(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||CW.test(e)||EW.hasOwnProperty(e)&&EW[e]?(""+t).trim():t+"px"}var AW={},EW={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},IW=["Webkit","Ms","Moz","O"];EW=Object.keys(EW).reduce(((e,t)=>(IW.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),EW);var jW=/^(matrix|translate|scale|rotate|skew)/,TW=/^(translate)/,BW=/^(rotate|skew)/,RW=(e,t)=>zV.num(e)&&0!==e?e+t:e,NW=(e,t)=>zV.arr(e)?e.every((e=>NW(e,t))):zV.num(e)?e===t:parseFloat(e)===t,DW=class extends g${constructor({x:e,y:t,z:n,...r}){let o=[],i=[];(e||t||n)&&(o.push([e||0,t||0,n||0]),i.push((e=>[`translate3d(${e.map((e=>RW(e,"px"))).join(",")})`,NW(e,0)]))),HV(r,((e,t)=>{if("transform"===t)o.push([e||""]),i.push((e=>[e,""===e]));else if(jW.test(t)){if(delete r[t],zV.und(e))return;let n=TW.test(t)?"px":BW.test(t)?"deg":"";o.push($V(e)),i.push("rotate3d"===t?([e,t,r,o])=>[`rotate3d(${e},${t},${r},${RW(o,n)})`,NW(o,0)]:e=>[`${t}(${e.map((e=>RW(e,n))).join(",")})`,NW(e,t.startsWith("scale")?1:0)])}})),o.length&&(r.transform=new MW(o,i)),super(r)}},MW=class extends UH{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 VV(this.inputs,((n,r)=>{let o=LH(n[0]),[i,s]=this.transforms[r](zV.arr(o)?o:n.map(LH));e+=" "+i,t=t&&s})),t?"none":e}observerAdded(e){1==e&&VV(this.inputs,(e=>VV(e,(e=>OH(e)&&HH(e,this)))))}observerRemoved(e){0==e&&VV(this.inputs,(e=>VV(e,(e=>OH(e)&&$H(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),zH(this,e)}};LV.assign({batchedUpdates:kW.unstable_batchedUpdates,createStringInterpolator:t$,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 PW=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new g$(e)),getComponentProps:r=(e=>e)}={})=>{let o={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},i=e=>{let t=k$(e)||"Anonymous";return(e=zV.str(e)?i[e]||(i[e]=_$(e,o)):e[w$]||(e[w$]=_$(e,o))).displayName=`Animated(${t})`,e};return HV(e,((t,n)=>{zV.arr(e)&&(n=k$(t)),i[n]=i(t)})),{animated:i}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;let n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,{style:r,children:o,scrollTop:i,scrollLeft:s,viewBox:a,...l}=t,c=Object.values(l),u=Object.keys(l).map((t=>n||e.hasAttribute(t)?t:AW[t]||(AW[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==o&&(e.textContent=o);for(let t in r)if(r.hasOwnProperty(t)){let n=SW(t,r[t]);CW.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==i&&(e.scrollTop=i),void 0!==s&&(e.scrollLeft=s),void 0!==a&&e.setAttribute("viewBox",a)},createAnimatedStyle:e=>new DW(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),OW=PW.animated,LW=n(17116);function FW(e){return{top:e.offsetTop,left:e.offsetLeft}}const zW=function({triggerAnimationOnChange:e,clientId:t}){const n=(0,S.useRef)(),{isTyping:r,getGlobalBlockCount:o,isBlockSelected:i,isFirstMultiSelectedBlock:s,isBlockMultiSelected:a,isAncestorMultiSelected:l}=(0,Ul.A)(hv),{previous:c,prevRect:u}=(0,S.useMemo)((()=>({previous:n.current&&FW(n.current),prevRect:n.current&&n.current.getBoundingClientRect()})),[e]);return(0,S.useLayoutEffect)((()=>{if(!c||!n.current)return;const e=(0,LW.A)(n.current),d=i(t),h=d||s(t);function p(){if(h&&u){const t=n.current.getBoundingClientRect().top-u.top;t&&(e.scrollTop+=t)}}if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||r()||o()>200)return void p();const f=d||a(t)||l(t)?"1":"",m=new fW({x:0,y:0,config:{mass:5,tension:2e3,friction:200},onChange({value:e}){if(!n.current)return;let{x:t,y:r}=e;t=Math.round(t),r=Math.round(r);const o=0===t&&0===r;n.current.style.transformOrigin="center center",n.current.style.transform=o?null:`translate3d(${t}px,${r}px,0)`,n.current.style.zIndex=f,p()}});n.current.style.transform=void 0;const g=FW(n.current),b=Math.round(c.left-g.left),y=Math.round(c.top-g.top);return m.start({x:0,y:0,from:{x:b,y}}),()=>{m.stop(),m.set({x:0,y:0})}}),[c,u,t,r,o,i,s,a,l]),n};var UW=n(30815),VW=n(57110),HW=n(67430);const $W=".block-editor-block-list__block",WW=".block-list-appender",GW=".block-editor-button-block-appender";function qW(e,t){return e.closest($W)===t.closest($W)}function KW(e,t){return t.closest([$W,WW,GW].join(","))===e}function YW(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest($W);return t?t.id.slice(6):void 0}function JW({clientId:e,initialPosition:t}){const n=(0,S.useRef)(),{isBlockSelected:r,isMultiSelecting:o,__unstableGetEditorMode:i}=(0,Ul.A)(hv);return(0,S.useEffect)((()=>{if(!r(e)||o()||"zoom-out"===i())return;if(null==t)return;if(!n.current)return;const{ownerDocument:s}=n.current;if(KW(n.current,s.activeElement))return;const a=ME.focus.tabbable.find(n.current).filter((e=>(0,UW.A)(e))),l=-1===t,c=a[l?a.length-1:0]||n.current;if(KW(n.current,c)){if(!n.current.getAttribute("contenteditable")){const e=ME.focus.tabbable.findNext(n.current);if(e&&KW(n.current,e)&&(0,VW.A)(e))return void e.focus()}(0,HW.A)(c,l)}else n.current.focus()}),[t,e]),n}function XW(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function ZW(e){const{isBlockSelected:t}=(0,Ul.A)(hv),{selectBlock:n,selectionChange:r}=(0,Vl.A)(hv);return(0,UC.A)((o=>{function i(i){o.parentElement.closest('[contenteditable="true"]')||(t(e)?i.target.isContentEditable||r(e):KW(o,i.target)&&n(e))}return o.addEventListener("focusin",i),()=>{o.removeEventListener("focusin",i)}}),[t,n])}function QW({clientId:e,isSelected:t}){const{getBlockRootClientId:n,getBlockIndex:r}=(0,Ul.A)(hv),{insertAfterBlock:o,removeBlock:i}=(0,Vl.A)(hv);return(0,UC.A)((n=>{if(t)return n.addEventListener("keydown",r),n.addEventListener("dragstart",s),()=>{n.removeEventListener("keydown",r),n.removeEventListener("dragstart",s)};function r(t){const{keyCode:r,target:s}=t;r!==VE.ENTER&&r!==VE.BACKSPACE&&r!==VE.DELETE||s!==n||(0,UW.A)(s)||(t.preventDefault(),r===VE.ENTER?o(e):i(e))}function s(e){e.preventDefault()}}),[e,t,n,r,o,i])}function eG(e){const{isNavigationMode:t,isBlockSelected:n}=(0,Ul.A)(hv),{setNavigationMode:r,selectBlock:o}=(0,Vl.A)(hv);return(0,UC.A)((i=>{function s(i){t()&&!i.defaultPrevented&&(i.preventDefault(),n(e)?r(!1):o(e))}return i.addEventListener("mousedown",s),()=>{i.removeEventListener("mousedown",s)}}),[e,t,n,r])}function tG(){const e=(0,S.useContext)(EG);return(0,UC.A)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function nG({isSelected:e}){const t=(0,Sx.A)();return(0,UC.A)((n=>{if(e){const{ownerDocument:e}=n,{defaultView:r}=e;if(!r.IntersectionObserver)return;const o=new r.IntersectionObserver((e=>{e[0].isIntersecting||n.scrollIntoView({behavior:t?"instant":"smooth"}),o.disconnect()}));return o.observe(n),()=>{o.disconnect()}}}),[e])}function rG({clientId:e="",isEnabled:t=!0}={}){const{getEnabledClientIdsTree:n}=Cf((0,Ul.A)(hv));return(0,UC.A)((r=>{if(!t)return;const o=t=>{(t.target===r||t.target.classList.contains("is-root-container"))&&(t.defaultPrevented||(t.preventDefault(),n(e).forEach((({clientId:e})=>{const t=r.querySelector(`[data-block="${e}"]`);t&&(t.classList.remove("has-editable-outline"),t.offsetWidth,t.classList.add("has-editable-outline"))}))))};return r.addEventListener("click",o),()=>r.removeEventListener("click",o)}),[t])}function oG(e={},{__unstableIsHtml:t}={}){const{clientId:n,className:r,wrapperProps:o={},isAligned:i,index:s,mode:a,name:l,blockApiVersion:c,blockTitle:u,isSelected:d,isSubtreeDisabled:h,hasOverlay:p,initialPosition:f,blockEditingMode:m,isHighlighted:g,isMultiSelected:b,isPartiallySelected:y,isReusable:v,isDragging:_,hasChildSelected:x,isBlockMovingMode:w,canInsertMovingBlock:k,isEditingDisabled:C,hasEditableOutline:A,isTemporarilyEditingAsBlocks:E,defaultClassName:I,templateLock:j}=(0,S.useContext)(iV),T=(0,H.sprintf)((0,H.__)("Block: %s"),u),B="html"!==a||t?"":"-visual",R=(0,eC.A)([e.ref,JW({clientId:n,initialPosition:f}),WC(n),ZW(n),QW({clientId:n,isSelected:d}),eG(n),(0,UC.A)((e=>(e.addEventListener("mouseout",XW),e.addEventListener("mouseover",XW),()=>{e.removeEventListener("mouseout",XW),e.removeEventListener("mouseover",XW),e.classList.remove("is-hovered")})),[]),tG(),zW({triggerAnimationOnChange:s,clientId:n}),(0,yV.A)({isDisabled:!p}),rG({clientId:n,isEnabled:"core/block"===l||"contentOnly"===j}),nG({isSelected:d})]),N=Qp(),D=N[Kp]&&yz(l)?{"--wp-admin-theme-color":"var(--wp-block-synced-color)","--wp-admin-theme-color--rgb":"var(--wp-block-synced-color--rgb)"}:{};c<2&&n===N.clientId&&!0===globalThis.SCRIPT_DEBUG&&(0,m_.default)(`Block type "${l}" must support API version 2 or higher to work correctly with "useBlockProps" method.`);let M=!1;return"-"!==o?.style?.marginTop?.charAt(0)&&"-"!==o?.style?.marginBottom?.charAt(0)&&"-"!==o?.style?.marginLeft?.charAt(0)&&"-"!==o?.style?.marginRight?.charAt(0)||(M=!0),{tabIndex:"disabled"===m?-1:0,...o,...e,ref:R,id:`block-${n}${B}`,role:"document","aria-label":T,"data-block":n,"data-type":l,"data-title":u,inert:h?"true":void 0,className:(0,$v.A)("block-editor-block-list__block",{"wp-block":!i,"has-block-overlay":p,"is-selected":d,"is-highlighted":g,"is-multi-selected":b,"is-partially-selected":y,"is-reusable":v,"is-dragging":_,"has-child-selected":x,"is-block-moving-mode":w,"can-insert-moving-block":k,"is-editing-disabled":C,"has-editable-outline":A,"has-negative-margin":M,"is-content-locked-temporarily-editing-as-blocks":E},r,e.className,o.className,I),style:{...o.style,...e.style,...D}}}function iG({children:e,isHtml:t,...n}){return(0,Td.jsx)("div",{...oG(n,{__unstableIsHtml:t}),children:e})}function sG({block:{__unstableBlockSource:e},mode:t,isLocked:n,canRemove:r,clientId:o,isSelected:i,isSelectionEnabled:s,className:a,__unstableLayoutClassNames:l,name:c,isValid:u,attributes:d,wrapperProps:h,setAttributes:p,onReplace:f,onInsertBlocksAfter:m,onMerge:g,toggleSelection:b}){var y;const{mayDisplayControls:v,mayDisplayParentControls:_,themeSupportsLayout:x,...w}=(0,S.useContext)(iV),{removeBlock:k}=(0,Vl.A)(hv),C=(0,S.useCallback)((()=>k(o)),[o,k]),A=gS()||{};let E=(0,Td.jsx)(sV,{name:c,isSelected:i,attributes:d,setAttributes:p,insertBlocksAfter:n?void 0:m,onReplace:r?f:void 0,onRemove:r?C:void 0,mergeBlocks:r?g:void 0,clientId:o,isSelectionEnabled:s,toggleSelection:b,__unstableLayoutClassNames:l,__unstableParentLayout:Object.keys(A).length?A:void 0,mayDisplayControls:v,mayDisplayParentControls:_,blockEditingMode:w.blockEditingMode,isPreviewMode:w.isPreviewMode});const I=Sc(c);I?.getEditWrapperProps&&(h=function(e,t){const n={...e,...t};return e?.hasOwnProperty("className")&&t?.hasOwnProperty("className")&&(n.className=(0,$v.A)(e.className,t.className)),e?.hasOwnProperty("style")&&t?.hasOwnProperty("style")&&(n.style={...e.style,...t.style}),n}(h,I.getEditWrapperProps(d)));const j=h&&!!h["data-align"]&&!x,T=a?.includes("is-position-sticky");let B;if(j&&(E=(0,Td.jsx)("div",{className:(0,$v.A)("wp-block",T&&a),"data-align":h["data-align"],children:E})),u)B="html"===t?(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)("div",{style:{display:"none"},children:E}),(0,Td.jsx)(iG,{isHtml:!0,children:(0,Td.jsx)(bV,{clientId:o})})]}):I?.apiVersion>1?E:(0,Td.jsx)(iG,{children:E});else{const t=e?jd(e):Od(I,d);B=(0,Td.jsxs)(iG,{className:"has-warning",children:[(0,Td.jsx)(dV,{clientId:o}),(0,Td.jsx)(Ad.A,{children:(0,JU.A)(t)})]})}const{"data-align":R,...N}=null!==(y=h)&&void 0!==y?y:{},D={...N,className:(0,$v.A)(N.className,R&&x&&`align${R}`,!(R&&T)&&a)};return(0,Td.jsx)(iV.Provider,{value:{wrapperProps:D,isAligned:j,...w},children:(0,Td.jsx)(mV,{fallback:(0,Td.jsx)(iG,{className:"has-warning",children:(0,Td.jsx)(pV,{})}),children:B})})}oG.save=Md;const aG=(0,UE.A)(((e,t,n)=>{const{updateBlockAttributes:r,insertBlocks:o,mergeBlocks:i,replaceBlocks:s,toggleSelection:a,__unstableMarkLastChangeAsPersistent:l,moveBlocksToPosition:c,removeBlock:u,selectBlock:d}=e(hv);return{setAttributes(e){const{getMultiSelectedBlockClientIds:o}=n.select(hv),i=o(),{clientId:s}=t,a=i.length?i:[s];r(a,e)},onInsertBlocks(e,n){const{rootClientId:r}=t;o(e,n,r)},onInsertBlocksAfter(e){const{clientId:r,rootClientId:i}=t,{getBlockIndex:s}=n.select(hv),a=s(r);o(e,a+1,i)},onMerge(e){const{clientId:r,rootClientId:a}=t,{getPreviousBlockClientId:l,getNextBlockClientId:h,getBlock:p,getBlockAttributes:f,getBlockName:m,getBlockOrder:g,getBlockIndex:b,getBlockRootClientId:y,canInsertBlockType:v}=n.select(hv);function _(){const e=p(r),t=Cc();if(m(r)!==t){const n=dd(e,t);n&&n.length&&s(r,n)}else if(Dc(e)){const e=h(r);e&&n.batch((()=>{u(r),d(e)}))}}function x(e,t=!0){const r=y(e),i=g(e),[s]=i;1===i.length&&Nc(p(s))?u(e):n.batch((()=>{if(v(m(s),r))c([s],e,r,b(e));else{const n=dd(p(s),Cc());n&&n.length&&n.every((e=>v(e.name,r)))?(o(n,b(e),r,t),u(s,!1)):_()}!g(e).length&&Nc(p(e))&&u(e,!1)}))}if(e){if(a){const e=h(a);if(e){if(m(a)!==m(e))return void i(a,e);{const t=f(a),r=f(e);if(Object.keys(t).every((e=>t[e]===r[e])))return void n.batch((()=>{c(g(e),e,a),u(e,!1)}))}}}const e=h(r);if(!e)return;g(e).length?x(e,!1):i(r,e)}else{const e=l(r);if(e)i(e,r);else if(a){const e=l(a);if(e&&m(a)===m(e)){const t=f(a),r=f(e);if(Object.keys(t).every((e=>t[e]===r[e])))return void n.batch((()=>{c(g(a),a,e),u(a,!1)}))}x(a)}else _()}},onReplace(e,n,r){e.length&&!Dc(e[e.length-1])&&l();const o=1===e?.length&&Array.isArray(e[0])?e[0]:e;s([t.clientId],o,n,r)},toggleSelection(e){a(e)}}}));sG=(0,P.A)(aG,zE("editor.BlockListBlock"))(sG);const lG=(0,S.memo)((function(e){const{clientId:t,rootClientId:n}=e,r=(0,Ul.A)((e=>{const{isBlockSelected:r,getBlockMode:o,isSelectionEnabled:i,getTemplateLock:s,getBlockWithoutAttributes:a,getBlockAttributes:l,canRemoveBlock:c,canMoveBlock:u,getSettings:d,getTemporarilyEditingAsBlocks:h,getBlockEditingMode:p,getBlockName:f,isFirstMultiSelectedBlock:m,getMultiSelectedBlockClientIds:g,hasSelectedInnerBlock:b,getBlocksByName:y,getBlockIndex:v,isBlockMultiSelected:_,isBlockSubtreeDisabled:x,isBlockHighlighted:w,__unstableIsFullySelected:k,__unstableSelectionHasUnmergeableBlock:C,isBlockBeingDragged:S,isDragging:A,hasBlockMovingClientId:E,canInsertBlockType:I,__unstableHasActiveBlockOverlayActive:j,__unstableGetEditorMode:T,getSelectedBlocksInitialCaretPosition:B}=Cf(e(hv)),R=a(t);if(!R)return;const{hasBlockSupport:N,getActiveBlockVariation:D}=e(ed),M=l(t),{name:P,isValid:O}=R,L=Sc(P),{supportsLayout:F,__unstableIsPreviewMode:z}=d(),U=L?.apiVersion>1,V={isPreviewMode:z,blockWithoutAttributes:R,name:P,attributes:M,isValid:O,themeSupportsLayout:F,index:v(t),isReusable:jc(L),className:U?M.className:void 0,defaultClassName:U?Bd(P):void 0,blockTitle:L?.title};if(z)return V;const H=r(t),$=c(t,n),W=u(t,n),G=D(P,M),q=_(t),K=b(t,!0),Y=E(),J=p(t),X=Ic(P,"multiple",!0)?[]:y(P),Z=X.length&&X[0]!==t;return{...V,mode:o(t),isSelectionEnabled:i(),isLocked:!!s(n),templateLock:s(t),canRemove:$,canMove:W,isSelected:H,isTemporarilyEditingAsBlocks:h()===t,blockEditingMode:J,mayDisplayControls:H||m(t)&&g().every((e=>f(e)===P)),mayDisplayParentControls:N(f(t),"__experimentalExposeControlsToChildren",!1)&&b(t),blockApiVersion:L?.apiVersion||1,blockTitle:G?.title||L?.title,isSubtreeDisabled:"disabled"===J&&x(t),hasOverlay:j(t)&&!A(),initialPosition:!H||"edit"!==T()&&"zoom-out"!==T()?void 0:B(),isHighlighted:w(t),isMultiSelected:q,isPartiallySelected:q&&!k()&&!C(),isDragging:S(t),hasChildSelected:K,isBlockMovingMode:!!Y,canInsertMovingBlock:Y&&I(f(Y),n),isEditingDisabled:"disabled"===J,hasEditableOutline:"disabled"!==J&&"disabled"===p(n),originalBlockClientId:!!Z&&X[0]}}),[t,n]),{isPreviewMode:o,mode:i="visual",isSelectionEnabled:s=!1,isLocked:a=!1,canRemove:l=!1,canMove:c=!1,blockWithoutAttributes:u,name:d,attributes:h,isValid:p,isSelected:f=!1,themeSupportsLayout:m,isTemporarilyEditingAsBlocks:g,blockEditingMode:b,mayDisplayControls:y,mayDisplayParentControls:v,index:_,blockApiVersion:x,blockTitle:w,isSubtreeDisabled:k,hasOverlay:C,initialPosition:A,isHighlighted:E,isMultiSelected:I,isPartiallySelected:j,isReusable:T,isDragging:B,hasChildSelected:R,isBlockMovingMode:N,canInsertMovingBlock:D,templateLock:M,isEditingDisabled:P,hasEditableOutline:O,className:L,defaultClassName:F,originalBlockClientId:z}=r,U=(0,S.useMemo)((()=>({...u,attributes:h})),[u,h]);if(!r)return null;const V={isPreviewMode:o,clientId:t,className:L,index:_,mode:i,name:d,blockApiVersion:x,blockTitle:w,isSelected:f,isSubtreeDisabled:k,hasOverlay:C,initialPosition:A,blockEditingMode:b,isHighlighted:E,isMultiSelected:I,isPartiallySelected:j,isReusable:T,isDragging:B,hasChildSelected:R,isBlockMovingMode:N,canInsertMovingBlock:D,templateLock:M,isEditingDisabled:P,hasEditableOutline:O,isTemporarilyEditingAsBlocks:g,defaultClassName:F,mayDisplayControls:y,mayDisplayParentControls:v,originalBlockClientId:z,themeSupportsLayout:m};return(0,Td.jsx)(iV.Provider,{value:V,children:(0,Td.jsx)(sG,{...e,mode:i,isSelectionEnabled:s,isLocked:a,canRemove:l,canMove:c,block:U,name:d,attributes:h,isValid:p,isSelected:f})})})),cG="\ufeff";function uG({rootClientId:e}){const{showPrompt:t,isLocked:n,placeholder:r}=(0,Ul.A)((t=>{const{getBlockCount:n,getSettings:r,getTemplateLock:o}=t(hv),i=!n(e),{bodyPlaceholder:s}=r();return{showPrompt:i,isLocked:!!o(e),placeholder:s}}),[e]),{insertDefaultBlock:o,startTyping:i}=(0,Vl.A)(hv);if(n)return null;const s=(0,Qa.decodeEntities)(r)||(0,H.__)("Type / to choose a block"),a=()=>{o(void 0,e),i()};return(0,Td.jsxs)("div",{"data-root-client-id":e||"",className:(0,$v.A)("block-editor-default-block-appender",{"has-visible-prompt":t}),children:[(0,Td.jsx)("p",{tabIndex:"0",role:"button","aria-label":(0,H.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{VE.ENTER!==e.keyCode&&VE.SPACE!==e.keyCode||a()},onClick:()=>a(),onFocus:()=>{t&&a()},children:t?s:cG}),(0,Td.jsx)(rJ,{rootClientId:e,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0})]})}function dG({rootClientId:e}){return(0,Ul.A)((t=>t(hv).canInsertBlockType(Cc(),e)))?(0,Td.jsx)(uG,{rootClientId:e}):(0,Td.jsx)(iJ,{rootClientId:e,className:"block-list-appender__toggle"})}function hG({rootClientId:e,CustomAppender:t,className:n,tagName:r="div"}){const o=(0,Ul.A)((t=>{const{getBlockInsertionPoint:n,isBlockInsertionPointVisible:r,getBlockCount:o}=t(hv),i=n();return r()&&e===i?.rootClientId&&0===o(e)}),[e]);return(0,Td.jsx)(r,{tabIndex:-1,className:(0,$v.A)("block-list-appender wp-block",n,{"is-drag-over":o}),contentEditable:!1,"data-block":!0,children:t?(0,Td.jsx)(t,{}):(0,Td.jsx)(dG,{rootClientId:e})})}const pG=Number.MAX_SAFE_INTEGER;(0,S.createContext)();const fG=function({previousClientId:e,nextClientId:t,children:n,__unstablePopoverSlot:r,__unstableContentRef:o,operation:i="insert",nearestSide:s="right",...a}){const[l,c]=(0,S.useReducer)((e=>(e+1)%pG),0),{orientation:u,rootClientId:d,isVisible:h}=(0,Ul.A)((n=>{const{getBlockListSettings:r,getBlockRootClientId:o,isBlockVisible:i}=n(hv),s=o(null!=e?e:t);return{orientation:r(s)?.orientation||"vertical",rootClientId:s,isVisible:i(e)&&i(t)}}),[e,t]),p=qC(e),f=qC(t),m="vertical"===u,g=(0,S.useMemo)((()=>{if(!(l<0||!p&&!f)&&h)return{contextElement:"group"===i?f||p:p||f,getBoundingClientRect(){const e=p?p.getBoundingClientRect():null,t=f?f.getBoundingClientRect():null;let n=0,r=0,o=0,a=0;if("group"===i){const i=t||e;r=i.top,o=0,a=i.bottom-i.top,n="left"===s?i.left-2:i.right-2}else m?(r=e?e.bottom:t.top,o=e?e.width:t.width,a=t&&e?t.top-e.bottom:0,n=e?e.left:t.left):(r=e?e.top:t.top,a=e?e.height:t.height,(0,H.isRTL)()?(n=t?t.right:e.left,o=e&&t?e.left-t.right:0):(n=e?e.right:t.left,o=e&&t?t.left-e.right:0));return new window.DOMRect(n,r,o,a)}}}),[p,f,l,m,h,i,s]),b=YC(o);return(0,S.useLayoutEffect)((()=>{if(!p)return;const e=new window.MutationObserver(c);return e.observe(p,{attributes:!0}),()=>{e.disconnect()}}),[p]),(0,S.useLayoutEffect)((()=>{if(!f)return;const e=new window.MutationObserver(c);return e.observe(f,{attributes:!0}),()=>{e.disconnect()}}),[f]),(0,S.useLayoutEffect)((()=>{if(p)return p.ownerDocument.defaultView.addEventListener("resize",c),()=>{p.ownerDocument.defaultView?.removeEventListener("resize",c)}}),[p]),(p||f)&&h?(0,Td.jsx)(KC.Ay,{ref:b,animate:!1,anchor:g,focusOnMount:!1,__unstableSlotName:r,inline:!r,...a,className:(0,$v.A)("block-editor-block-popover","block-editor-block-popover__inbetween",a.className),resize:!1,flip:!1,placement:"overlay",variant:"unstyled",children:(0,Td.jsx)("div",{className:"block-editor-block-popover__inbetween-container",children:n})},t+"--"+d):null},mG={hide:{opacity:0,scaleY:.75},show:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.9}},gG=function({__unstablePopoverSlot:e,__unstableContentRef:t}){const{clientId:n}=(0,Ul.A)((e=>{const{getBlockOrder:t,getBlockInsertionPoint:n}=e(hv),r=n(),o=t(r.rootClientId);return o.length?{clientId:o[r.index]}:{}}),[]),r=(0,Sx.A)();return(0,Td.jsx)(eS,{clientId:n,__unstablePopoverSlot:e,__unstableContentRef:t,className:"block-editor-block-popover__drop-zone",children:(0,Td.jsx)(Cx.P.div,{"data-testid":"block-popover-drop-zone",initial:r?mG.show:mG.hide,animate:mG.show,exit:r?mG.show:mG.exit,className:"block-editor-block-popover__drop-zone-foreground"})})},bG=(0,S.createContext)();function yG({__unstablePopoverSlot:e,__unstableContentRef:t,operation:n="insert",nearestSide:r="right"}){const{selectBlock:o,hideInsertionPoint:i}=(0,Vl.A)(hv),s=(0,S.useContext)(bG),a=(0,S.useRef)(),{orientation:l,previousClientId:c,nextClientId:u,rootClientId:d,isInserterShown:h,isDistractionFree:p,isNavigationMode:f}=(0,Ul.A)((e=>{const{getBlockOrder:t,getBlockListSettings:n,getBlockInsertionPoint:r,isBlockBeingDragged:o,getPreviousBlockClientId:i,getNextBlockClientId:s,getSettings:a,isNavigationMode:l}=e(hv),c=r(),u=t(c.rootClientId);if(!u.length)return{};let d=u[c.index-1],h=u[c.index];for(;o(d);)d=i(d);for(;o(h);)h=s(h);const p=a();return{previousClientId:d,nextClientId:h,orientation:n(c.rootClientId)?.orientation||"vertical",rootClientId:c.rootClientId,isNavigationMode:l(),isDistractionFree:p.isDistractionFree,isInserterShown:c?.__unstableWithInserter}}),[]),{getBlockEditingMode:m}=(0,Ul.A)(hv),g=(0,Sx.A)(),b={start:{opacity:0,scale:0},rest:{opacity:1,scale:1,transition:{delay:h?.5:0,type:"tween"}},hover:{opacity:1,scale:1,transition:{delay:.5,type:"tween"}}},y={start:{scale:g?1:0},rest:{scale:1,transition:{delay:.4,type:"tween"}}};if(p&&!f)return null;const v="horizontal"===l||"group"===n?"is-horizontal":"is-vertical",_=(0,$v.A)("block-editor-block-list__insertion-point",v);return(0,Td.jsx)(fG,{previousClientId:c,nextClientId:u,__unstablePopoverSlot:e,__unstableContentRef:t,operation:n,nearestSide:r,children:(0,Td.jsxs)(Cx.P.div,{layout:!g,initial:g?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:a,tabIndex:-1,onClick:function(e){e.target===a.current&&u&&"disabled"!==m(u)&&o(u,-1)},onFocus:function(e){e.target!==a.current&&(s.current=!0)},className:(0,$v.A)(_,{"is-with-inserter":h}),onHoverEnd:function(e){e.target!==a.current||s.current||i()},children:[(0,Td.jsx)(Cx.P.div,{variants:b,className:"block-editor-block-list__insertion-point-indicator","data-testid":"block-list-insertion-point-indicator"}),h&&(0,Td.jsx)(Cx.P.div,{variants:y,className:(0,$v.A)("block-editor-block-list__insertion-point-inserter"),children:(0,Td.jsx)(rJ,{position:"bottom center",clientId:u,rootClientId:d,__experimentalIsQuick:!0,onToggle:e=>{s.current=e},onSelectOrClose:()=>{s.current=!1}})})]})})}function vG(e){const{insertionPoint:t,isVisible:n,isBlockListEmpty:r}=(0,Ul.A)((e=>{const{getBlockInsertionPoint:t,isBlockInsertionPointVisible:n,getBlockCount:r}=e(hv),o=t();return{insertionPoint:o,isVisible:n(),isBlockListEmpty:0===r(o?.rootClientId)}}),[]);return!n||r?null:"replace"===t.operation?(0,Td.jsx)(gG,{...e},`${t.rootClientId}-${t.index}`):(0,Td.jsx)(yG,{operation:t.operation,nearestSide:t.nearestSide,...e})}function _G(){const e=(0,S.useContext)(bG),t=(0,Ul.A)((e=>e(hv).getSettings().isDistractionFree||"zoom-out"===e(hv).__unstableGetEditorMode()),[]),{getBlockListSettings:n,getBlockIndex:r,isMultiSelecting:o,getSelectedBlockClientIds:i,getTemplateLock:s,__unstableIsWithinBlockOverlay:a,getBlockEditingMode:l,getBlockName:c}=(0,Ul.A)(hv),{showInsertionPoint:u,hideInsertionPoint:d}=(0,Vl.A)(hv);return(0,UC.A)((h=>{if(!t)return h.addEventListener("mousemove",p),()=>{h.removeEventListener("mousemove",p)};function p(t){if(e.current)return;if(t.target.nodeType===t.target.TEXT_NODE)return;if(o())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void d();let h;if(t.target.classList.contains("is-root-container")||(h=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")),s(h)||"disabled"===l(h)||"core/block"===c(h))return;const p=n(h)?.orientation||"vertical",f=t.clientY,m=t.clientX;let g=Array.from(t.target.children).find((e=>{const t=e.getBoundingClientRect();return e.classList.contains("wp-block")&&"vertical"===p&&t.top>f||e.classList.contains("wp-block")&&"horizontal"===p&&((0,H.isRTL)()?t.right<m:t.left>m)}));if(!g)return void d();if(!g.id&&(g=g.firstElementChild,!g))return void d();const b=g.id.slice(6);if(!b||a(b))return;if(i().includes(b))return;const y=g.getBoundingClientRect();if("horizontal"===p&&(t.clientY>y.bottom||t.clientY<y.top)||"vertical"===p&&(t.clientX>y.right||t.clientX<y.left))return void d();const v=r(b);0!==v?u(h,v,{__unstableWithInserter:!0}):d()}}),[e,n,r,o,u,d,i,t])}function xG(){const{getSettings:e,hasSelectedBlock:t,hasMultiSelection:n}=(0,Ul.A)(hv),{clearSelectedBlock:r}=(0,Vl.A)(hv),{clearBlockSelection:o}=e();return(0,UC.A)((e=>{if(o)return e.addEventListener("mousedown",i),()=>{e.removeEventListener("mousedown",i)};function i(o){(t()||n())&&o.target===e&&r()}}),[t,n,r,o])}function wG(e){return(0,Td.jsx)("div",{ref:xG(),...e})}const kG=new Set([VE.UP,VE.RIGHT,VE.DOWN,VE.LEFT,VE.ENTER,VE.BACKSPACE]);function CG(){const e=(0,Ul.A)((e=>e(hv).isTyping()),[]),{stopTyping:t}=(0,Vl.A)(hv);return(0,UC.A)((n=>{if(!e)return;const{ownerDocument:r}=n;let o,i;function s(e){const{clientX:n,clientY:r}=e;o&&i&&(o!==n||i!==r)&&t(),o=n,i=r}return r.addEventListener("mousemove",s),()=>{r.removeEventListener("mousemove",s)}}),[e,t])}function SG(){const{isTyping:e}=(0,Ul.A)((e=>{const{isTyping:t}=e(hv);return{isTyping:t()}}),[]),{startTyping:t,stopTyping:n}=(0,Vl.A)(hv),r=CG(),o=(0,UC.A)((r=>{const{ownerDocument:o}=r,{defaultView:i}=o,s=i.getSelection();if(e){let l;function c(e){const{target:t}=e;l=i.setTimeout((()=>{(0,UW.A)(t)||n()}))}function u(e){const{keyCode:t}=e;t!==VE.ESCAPE&&t!==VE.TAB||n()}function d(){s.isCollapsed||n()}return r.addEventListener("focus",c),r.addEventListener("keydown",u),o.addEventListener("selectionchange",d),()=>{i.clearTimeout(l),r.removeEventListener("focus",c),r.removeEventListener("keydown",u),o.removeEventListener("selectionchange",d)}}function a(e){const{type:n,target:o}=e;(0,UW.A)(o)&&r.contains(o)&&("keydown"!==n||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&kG.has(t)}(e))&&t()}return r.addEventListener("keypress",a),r.addEventListener("keydown",a),()=>{r.removeEventListener("keypress",a),r.removeEventListener("keydown",a)}}),[e,t,n]);return(0,eC.A)([r,o])}const AG=function({children:e}){return(0,Td.jsx)("div",{ref:SG(),children:e})},EG=(0,S.createContext)(),IG=new WeakMap;function jG({className:e,...t}){const n=(0,YU.A)("medium"),{isOutlineMode:r,isFocusMode:o,editorMode:i,temporarilyEditingAsBlocks:s}=(0,Ul.A)((e=>{const{getSettings:t,__unstableGetEditorMode:n,getTemporarilyEditingAsBlocks:r,isTyping:o}=Cf(e(hv)),{outlineMode:i,focusMode:s}=t();return{isOutlineMode:i&&!o(),isFocusMode:s,editorMode:n(),temporarilyEditingAsBlocks:r()}}),[]),a=(0,Hp.A)(),{setBlockVisibility:l}=(0,Vl.A)(hv),c=(0,yT.A)((0,S.useCallback)((()=>{const e={};IG.get(a).forEach((([t,n])=>{e[t]=n})),l(e)}),[a]),300,{trailing:!0}),u=(0,S.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{IG.get(a)||IG.set(a,[]);for(const t of e){const e=t.target.getAttribute("data-block");IG.get(a).push([e,t.isIntersecting])}c()}))}),[]),d=CJ({ref:(0,eC.A)([xG(),_G(),SG()]),className:(0,$v.A)("is-root-container",e,{"is-outline-mode":r,"is-focus-mode":o&&n,"is-navigate-mode":"navigation"===i})},t);return(0,Td.jsxs)(EG.Provider,{value:u,children:[(0,Td.jsx)("div",{...d}),!!s&&(0,Td.jsx)(TG,{clientId:s})]})}function TG({clientId:e}){const{stopEditingAsBlocks:t}=Cf((0,Vl.A)(hv)),n=(0,Ul.A)((t=>{const{isBlockSelected:n,hasSelectedInnerBlock:r}=t(hv);return n(e)||r(e,!0)}),[e]);return(0,S.useEffect)((()=>{n||t(e)}),[n,e,t]),null}function BG(e){return(0,Td.jsx)(Zp,{value:Jp,children:(0,Td.jsx)(jG,{...e})})}const RG=[],NG=new Set;function DG({placeholder:e,rootClientId:t,renderAppender:n,__experimentalAppenderTagName:r,layout:o=pS}){const i=!1!==n,s=!!n,{order:a,selectedBlocks:l,visibleBlocks:c,shouldRenderAppender:u}=(0,Ul.A)((e=>{const{getSettings:n,getBlockOrder:r,getSelectedBlockClientId:o,getSelectedBlockClientIds:a,__unstableGetVisibleBlocks:l,getTemplateLock:c,getBlockEditingMode:u,__unstableGetEditorMode:d}=e(hv),h=r(t);if(n().__unstableIsPreviewMode)return{order:h,selectedBlocks:RG,visibleBlocks:NG};const p=o();return{order:h,selectedBlocks:a(),visibleBlocks:l(),shouldRenderAppender:i&&"zoom-out"!==d()&&(s?!c(t)&&"disabled"!==u(t):t===p||!t&&!p&&!h.length)}}),[t,i,s]);return(0,Td.jsxs)(mS,{value:o,children:[a.map((e=>(0,Td.jsx)(KU.Ay,{value:!c.has(e)&&!l.includes(e),children:(0,Td.jsx)(lG,{rootClientId:t,clientId:e})},e))),a.length<1&&e,u&&(0,Td.jsx)(hG,{tagName:r,rootClientId:t,CustomAppender:n})]})}function MG(e){return(0,Td.jsx)(KU.Ay,{value:!1,children:(0,Td.jsx)(DG,{...e})})}function PG(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:r,getSelectedBlockClientId:o,getSelectedBlocksInitialCaretPosition:i,__unstableIsFullySelected:s}=e(hv);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:r(),selectedBlockClientId:o(),initialPosition:i(),isFullSelection:s()}}function OG(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:r,selectedBlockClientId:o,isFullSelection:i}=(0,Ul.A)(PG,[]);return(0,UC.A)((o=>{const{ownerDocument:s}=o,{defaultView:a}=s;if(null==e)return;if(!r||t)return;const{length:l}=n;l<2||i&&(o.contentEditable=!0,o.focus(),a.getSelection().removeAllRanges())}),[r,t,n,o,e,i])}var LG=n(13149),FG=n(24855),zG=n(91512),UG=n(30967),VG=n(53932);function HG(e,t,n,r){let o,i=ME.focus.focusable.find(n);return t&&i.reverse(),i=i.slice(i.indexOf(e)+1),r&&(o=e.getBoundingClientRect()),i.find((function(e){if(!(e.closest("[inert]")||1===e.children.length&&qW(e,e.firstElementChild)&&"true"===e.firstElementChild.getAttribute("contenteditable"))){if(!ME.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(r){const t=e.getBoundingClientRect();if(t.left>=o.right||t.right<=o.left)return!1}return!0}}))}function $G(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:r,__unstableIsFullySelected:o}=(0,Ul.A)(hv),{selectBlock:i}=(0,Vl.A)(hv);return(0,UC.A)((s=>{let a;function l(){a=null}function c(l){if(l.defaultPrevented)return;const{keyCode:c,target:u,shiftKey:d,ctrlKey:h,altKey:p,metaKey:f}=l,m=c===VE.UP,g=c===VE.DOWN,b=c===VE.LEFT,y=c===VE.RIGHT,v=m||b,_=b||y,x=m||g,w=_||x,k=d||h||p||f,C=x?LG.A:FG.A,{ownerDocument:S}=s,{defaultView:A}=S;if(!w)return;if(r()){if(d)return;if(!o())return;return l.preventDefault(),void(v?i(e()):i(t(),-1))}if(!function(e,t,n){const r=t===VE.UP||t===VE.DOWN,{tagName:o}=e,i=e.getAttribute("type");return r&&!n?"INPUT"!==o||!["date","datetime-local","month","number","range","time","week"].includes(i):"INPUT"===o?["button","checkbox","number","color","file","image","radio","reset","submit"].includes(i):"TEXTAREA"!==o}(u,c,k))return;x?a||(a=(0,zG.A)(A)):a=null;const E=(0,UG.A)(u)?!v:v,{keepCaretInsideBlock:I}=n();if(d)(function(e,t){const n=HG(e,t,s);return n&&YW(n)})(u,v)&&C(u,v)&&(s.contentEditable=!0,s.focus());else if(!x||!(0,LG.A)(u,v)||p&&!(0,FG.A)(u,E)||I){if(_&&A.getSelection().isCollapsed&&(0,FG.A)(u,E)&&!I){const e=HG(u,E,s);(0,HW.A)(e,v),l.preventDefault()}}else{const e=HG(u,v,s,!0);e&&((0,VG.A)(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)}}),[])}var WG=n(82569);function GG(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,Ul.A)(hv),{multiSelect:r,selectBlock:o}=(0,Vl.A)(hv),i=(0,OU.ZK)();return(0,UC.A)((s=>{function a(a){if(!i("core/block-editor/select-all",a))return;const l=t();if(l.length<2&&!(0,WG.A)(a.target))return;a.preventDefault();const[c]=l,u=n(c),d=e(u);l.length!==d.length?r(d[0],d[d.length-1]):u&&(s.ownerDocument.defaultView.getSelection().removeAllRanges(),o(u))}return s.addEventListener("keydown",a),()=>{s.removeEventListener("keydown",a)}}),[])}function qG(e,t){e.contentEditable=t,t&&e.focus()}function KG(){const{startMultiSelect:e,stopMultiSelect:t}=(0,Vl.A)(hv),{isSelectionEnabled:n,hasSelectedBlock:r,isDraggingBlocks:o,isMultiSelecting:i}=(0,Ul.A)(hv);return(0,UC.A)((s=>{const{ownerDocument:a}=s,{defaultView:l}=a;let c,u;function d(){t(),l.removeEventListener("mouseup",d),u=l.requestAnimationFrame((()=>{if(!r())return;qG(s,!1);const e=l.getSelection();if(e.rangeCount){const t=e.getRangeAt(0),{commonAncestorContainer:n}=t,r=t.cloneRange();c.contains(n)&&(c.focus(),e.removeAllRanges(),e.addRange(r))}}))}function h({buttons:t,target:r,relatedTarget:a}){r.contains(a)||o()||1===t&&(i()||s!==r&&"true"===r.getAttribute("contenteditable")&&n()&&(c=r,e(),l.addEventListener("mouseup",d),qG(s,!0)))}return s.addEventListener("mouseout",h),()=>{s.removeEventListener("mouseout",h),l.removeEventListener("mouseup",d),l.cancelAnimationFrame(u)}}),[e,t,n,r])}function YG(e,t){e.contentEditable!==String(t)&&(e.contentEditable=t,t&&e.focus())}function JG(e){const t=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;return t?.closest("[data-wp-block-attribute-key]")}function XG(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,Vl.A)(hv),{getBlockParents:r,getBlockSelectionStart:o,isMultiSelecting:i}=(0,Ul.A)(hv);return(0,UC.A)((s=>{const{ownerDocument:a}=s,{defaultView:l}=a;function c(a){const c=l.getSelection();if(!c.rangeCount)return;const u=function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(c),d=function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE||n===t.childNodes.length?t:t.childNodes[n]}(c);if(!s.contains(u)||!s.contains(d))return;const h=a.shiftKey&&"mouseup"===a.type;if(c.isCollapsed&&!h){if("true"===s.contentEditable&&!i()){YG(s,!1);let e=u.nodeType===u.ELEMENT_NODE?u:u.parentElement;e=e?.closest("[contenteditable]"),e?.focus()}return}let p=YW(u),f=YW(d);if(h){const e=o(),t=YW(a.target),n=t!==f;(p===f&&c.isCollapsed||!f||n)&&(f=t),p!==e&&(p=e)}if(void 0!==p||void 0!==f)if(p===f)i()?e(p,p):t(p);else{const t=[...r(p),p],o=[...r(f),f],i=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,o);if(t[i]!==p||o[i]!==f)return void e(t[i],o[i]);const s=JG(u),a=JG(d);if(s&&a){var m,g;const e=c.getRangeAt(0),t=(0,$.create)({element:s,range:e,__unstableIsEditableTree:!0}),r=(0,$.create)({element:a,range:e,__unstableIsEditableTree:!0}),o=null!==(m=t.start)&&void 0!==m?m:t.end,i=null!==(g=r.start)&&void 0!==g?g:r.end;n({start:{clientId:p,attributeKey:s.dataset.wpBlockAttributeKey,offset:o},end:{clientId:f,attributeKey:a.dataset.wpBlockAttributeKey,offset:i}})}else e(p,f)}else YG(s,!1)}return a.addEventListener("selectionchange",c),l.addEventListener("mouseup",c),()=>{a.removeEventListener("selectionchange",c),l.removeEventListener("mouseup",c)}}),[e,t,n,r])}function ZG(){const{selectBlock:e}=(0,Vl.A)(hv),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:r}=(0,Ul.A)(hv);return(0,UC.A)((o=>{function i(i){if(!t()||0!==i.button)return;const s=n(),a=YW(i.target);i.shiftKey?s!==a&&(o.contentEditable=!0,o.focus()):r()&&e(a)}return o.addEventListener("mousedown",i),()=>{o.removeEventListener("mousedown",i)}}),[e,t,n,r])}function QG(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,getSelectedBlockClientId:n,__unstableIsSelectionMergeable:r,hasMultiSelection:o,getBlockName:i,canInsertBlockType:s,getBlockRootClientId:a,getSelectionStart:l,getSelectionEnd:c,getBlockAttributes:u}=(0,Ul.A)(hv),{replaceBlocks:d,__unstableSplitSelection:h,removeBlocks:p,__unstableDeleteSelection:f,__unstableExpandSelection:m,__unstableMarkAutomaticChange:g}=(0,Vl.A)(hv);return(0,UC.A)((b=>{function y(e){"true"===b.contentEditable&&e.preventDefault()}function v(y){if(!y.defaultPrevented)if(o())y.keyCode===VE.ENTER?(b.contentEditable=!1,y.preventDefault(),e()?d(t(),td(Cc())):h()):y.keyCode===VE.BACKSPACE||y.keyCode===VE.DELETE?(b.contentEditable=!1,y.preventDefault(),e()?p(t()):r()?f(y.keyCode===VE.DELETE):m()):1!==y.key.length||y.metaKey||y.ctrlKey||(b.contentEditable=!1,r()?f(y.keyCode===VE.DELETE):(y.preventDefault(),b.ownerDocument.defaultView.getSelection().removeAllRanges()));else if(y.keyCode===VE.ENTER){if(y.shiftKey||e())return;const t=n(),r=i(t),o=l(),p=c();if(o.attributeKey===p.attributeKey){const e=u(t)[o.attributeKey],n=ld(cd("from").filter((({type:e})=>"enter"===e)),(t=>t.regExp.test(e)));if(n)return d(t,n.transform({content:e})),void g()}if(!Ic(r,"splitting",!1)&&!y.__deprecatedOnSplit)return;s(r,a(t))&&(h(),y.preventDefault())}}function _(e){o()&&(b.contentEditable=!1,r()?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",_)}}),[])}var eq=n(55647),tq=n(46771);function nq(){const{getBlockName:e}=(0,Ul.A)(hv),{getBlockType:t}=(0,Ul.A)(ed),{createSuccessNotice:n}=(0,Vl.A)(Xb.store);return(0,S.useCallback)(((r,o)=>{let i="";if(1===o.length){const n=o[0],s=t(e(n))?.title;i="copy"===r?(0,H.sprintf)((0,H.__)('Copied "%s" to clipboard.'),s):(0,H.sprintf)((0,H.__)('Moved "%s" to clipboard.'),s)}else i="copy"===r?(0,H.sprintf)((0,H._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",o.length),o.length):(0,H.sprintf)((0,H._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",o.length),o.length);n(i,{type:"snackbar"})}),[])}function rq({clipboardData:e}){let t="",n="";try{t=e.getData("text/plain"),n=e.getData("text/html")}catch(t){try{n=e.getData("Text")}catch(e){return}}n=function(e){const t=e.indexOf("\x3c!--StartFragment--\x3e");if(!(t>-1))return e;const n=(e=e.substring(t+20)).indexOf("\x3c!--EndFragment--\x3e");return n>-1&&(e=e.substring(0,n)),e}(n),n=function(e){return e.startsWith("<meta charset='utf-8'>")?e.slice(22):e}(n);const r=(0,XA.$)(e);return r.length&&!function(e,t){if(t&&1===e?.length&&0===e[0].type.indexOf("image/")){const e=/<\s*img\b/gi;if(1!==t.match(e)?.length)return!0;const n=/<\s*img\b[^>]*\bsrc="file:\/\//i;if(t.match(n))return!0}return!1}(r,n)?{files:r}:{html:n,plainText:t,files:[]}}const oq=Symbol("requiresWrapperOnCopy");function iq(e,t,n){let r=t;const[o]=t;if(o&&n.select(ed).getBlockType(o.name)[oq]){const{getBlockRootClientId:e,getBlockName:t,getBlockAttributes:i}=n.select(hv),s=e(o.clientId),a=t(s);a&&(r=td(a,i(s),r))}const i=zd(r);e.clipboardData.setData("text/plain",function(e){e=e.replace(/<br>/g,"\n");return(0,ac.A)(e).trim().replace(/\n\n+/g,"\n\n")}(i)),e.clipboardData.setData("text/html",i)}function sq(){const e=(0,Hp.A)(),{getBlocksByClientId:t,getSelectedBlockClientIds:n,hasMultiSelection:r,getSettings:o,getBlockName:i,__unstableIsFullySelected:s,__unstableIsSelectionCollapsed:a,__unstableIsSelectionMergeable:l,__unstableGetSelectedBlocksWithPartialSelection:c,canInsertBlockType:u,getBlockRootClientId:d}=(0,Ul.A)(hv),{flashBlock:h,removeBlocks:p,replaceBlocks:f,__unstableDeleteSelection:m,__unstableExpandSelection:g,__unstableSplitSelection:b}=(0,Vl.A)(hv),y=nq();return(0,UC.A)((v=>{function _(_){if(_.defaultPrevented)return;const x=n();if(0===x.length)return;if(!r()){const{target:e}=_,{ownerDocument:t}=e;if("copy"===_.type||"cut"===_.type?(0,eq.A)(t):(0,tq.A)(t)&&!t.activeElement.isContentEditable)return}const{activeElement:w}=_.target.ownerDocument;if(!v.contains(w))return;const k=l(),C=a()||s(),S=!C&&!k;if("copy"===_.type||"cut"===_.type)if(_.preventDefault(),1===x.length&&h(x[0]),S)g();else{let n;if(y(_.type,x),C)n=t(x);else{const[e,r]=c();n=[e,...t(x.slice(1,x.length-1)),r]}iq(_,n,e)}if("cut"===_.type)C&&!S?p(x):(_.target.ownerDocument.activeElement.contentEditable=!1,m());else if("paste"===_.type){const{__experimentalCanUserUseUnfilteredHTML:e}=o();if("true"===_.clipboardData.getData("rich-text"))return;const{plainText:t,html:n,files:a}=rq(_),l=s();let c=[];if(a.length){const e=cd("from");c=a.reduce(((t,n)=>{const r=ld(e,(e=>"files"===e.type&&e.isMatch([n])));return r&&t.push(r.transform([n])),t}),[]).flat()}else c=Pp({HTML:n,plainText:t,mode:l?"BLOCKS":"AUTO",canUserUseUnfilteredHTML:e});if("string"==typeof c)return;if(l)return f(x,c,c.length-1,-1),void _.preventDefault();if(!r()&&!Ic(i(x[0]),"splitting",!1)&&!_.__deprecatedOnSplit)return;const[h]=x,p=d(h);if(!c.every((e=>u(e.name,p))))return;b(c),_.preventDefault()}}return 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 aq(){const[e,t,n]=function(){const e=(0,S.useRef)(),t=(0,S.useRef)(),n=(0,S.useRef)(),{hasMultiSelection:r,getSelectedBlockClientId:o,getBlockCount:i}=(0,Ul.A)(hv),{setNavigationMode:s,setLastFocus:a}=Cf((0,Vl.A)(hv)),l=(0,Ul.A)((e=>e(hv).isNavigationMode()),[]),{getLastFocus:c}=Cf((0,Ul.A)(hv)),u=l?void 0:"0",d=(0,S.useRef)();function h(t){if(d.current)d.current=null;else if(r())e.current.focus();else if(o())c()?.current?c().current.focus():e.current.querySelector(`[data-block="${o()}"]`).focus();else{s(!0);const n=e.current.ownerDocument===t.target.ownerDocument?e.current:e.current.ownerDocument.defaultView.frameElement,r=t.target.compareDocumentPosition(n)&t.target.DOCUMENT_POSITION_FOLLOWING,o=ME.focus.tabbable.find(e.current);o.length&&(r?o[0]:o[o.length-1]).focus()}}const p=(0,Td.jsx)("div",{ref:t,tabIndex:u,onFocus:h}),f=(0,Td.jsx)("div",{ref:n,tabIndex:u,onFocus:h}),m=(0,UC.A)((l=>{function u(e){if(e.defaultPrevented)return;if(e.keyCode===VE.ESCAPE&&!r())return e.preventDefault(),void s(!0);if(e.keyCode!==VE.TAB)return;const i=e.shiftKey,a=i?"findPrevious":"findNext";if(!r()&&!o())return void(e.target===l&&s(!0));const c=ME.focus.tabbable[a](e.target),u=e.target.closest("[data-block]"),h=u&&c&&(qW(u,c)||KW(u,c));if((0,VW.A)(c)&&h)return;const p=i?t:n;d.current=!0,p.current.focus({preventScroll:!0})}function h(e){a({...c(),current:e.target});const{ownerDocument:t}=l;e.relatedTarget||t.activeElement!==t.body||0!==i()||l.focus()}function p(r){if(r.keyCode!==VE.TAB)return;if("region"===r.target?.getAttribute("role"))return;if(e.current===r.target)return;const o=r.shiftKey?"findPrevious":"findNext",i=ME.focus.tabbable[o](r.target);i!==t.current&&i!==n.current||(r.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:f}=l,{defaultView:m}=f;return m.addEventListener("keydown",p),l.addEventListener("keydown",u),l.addEventListener("focusout",h),()=>{m.removeEventListener("keydown",p),l.removeEventListener("keydown",u),l.removeEventListener("focusout",h)}}),[]);return[p,(0,eC.A)([e,m]),f]}(),r=(0,Ul.A)((e=>e(hv).hasMultiSelection()),[]);return[e,(0,eC.A)([t,sq(),QG(),KG(),XG(),ZG(),OG(),GG(),$G(),(0,UC.A)((e=>{if(e.tabIndex=0,r)return e.classList.add("has-multi-selection"),e.setAttribute("aria-label",(0,H.__)("Multiple selected blocks")),()=>{e.classList.remove("has-multi-selection"),e.removeAttribute("aria-label")}}),[r])]),n]}const lq=(0,S.forwardRef)((function({children:e,...t},n){const[r,o,i]=aq();return(0,Td.jsxs)(Td.Fragment,{children:[r,(0,Td.jsx)("div",{...t,ref:(0,eC.A)([o,n]),className:(0,$v.A)(t.className,"block-editor-writing-flow"),children:e}),i]})}));let cq=null;function uq(e,t,n){const r={};for(const t in e)r[t]=e[t];if(e instanceof n.contentDocument.defaultView.MouseEvent){const e=n.getBoundingClientRect();r.clientX+=e.left,r.clientY+=e.top}const o=new t(e.type,r);r.defaultPrevented&&o.preventDefault(),!n.dispatchEvent(o)&&e.preventDefault()}function dq(e){return(0,UC.A)((()=>{const{defaultView:t}=e;if(!t)return;const{frameElement:n}=t,r=e.documentElement,o=["dragover","mousemove"],i={};for(const e of o)i[e]=e=>{const t=Object.getPrototypeOf(e).constructor.name;uq(e,window[t],n)},r.addEventListener(e,i[e]);return()=>{for(const e of o)r.removeEventListener(e,i[e])}}))}function hq({contentRef:e,children:t,tabIndex:n=0,scale:r=1,frameSize:o=0,readonly:i,forwardedRef:s,title:a=(0,H.__)("Editor canvas"),...l}){const{resolvedAssets:c,isPreviewMode:u}=(0,Ul.A)((e=>{const{getSettings:t}=e(hv),n=t();return{resolvedAssets:n.__unstableResolvedAssets,isPreviewMode:n.__unstableIsPreviewMode}}),[]),{styles:d="",scripts:h=""}=c,[p,f]=(0,S.useState)(),m=(0,S.useRef)(),[g,b]=(0,S.useState)([]),y=xG(),[v,_,x]=aq(),[w,{height:k}]=(0,yF.A)(),[C,{width:A}]=(0,yF.A)(),E=(0,UC.A)((e=>{let t;function n(e){e.preventDefault()}function r(){const{contentDocument:r,ownerDocument:o}=e,{documentElement:i}=r;t=r,i.classList.add("block-editor-iframe__html"),y(i),b(Array.from(o.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),r.dir=o.dir;for(const e of cq||(cq=Array.from(document.styleSheets).reduce(((e,t)=>{try{t.cssRules}catch(t){return e}const{ownerNode:n,cssRules:r}=t;if(null===n)return e;if(!r)return e;if("wp-reset-editor-styles-css"===n.id)return e;if(!n.id)return e;if(function e(t){return Array.from(t).find((({selectorText:t,conditionText:n,cssRules:r})=>n?e(r):t&&(t.includes(".editor-styles-wrapper")||t.includes(".wp-block"))))}(r)){const t="STYLE"===n.tagName;if(t){const t=n.id.replace("-inline-css","-css"),r=document.getElementById(t);r&&e.push(r.cloneNode(!0))}if(e.push(n.cloneNode(!0)),!t){const t=n.id.replace("-css","-inline-css"),r=document.getElementById(t);r&&e.push(r.cloneNode(!0))}}return e}),[]),cq))r.getElementById(e.id)||(r.head.appendChild(e.cloneNode(!0)),u||console.warn(`${e.id} was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,e));t.addEventListener("dragover",n,!1),t.addEventListener("drop",n,!1)}return e._load=()=>{f(e.contentDocument)},e.addEventListener("load",r),()=>{delete e._load,e.removeEventListener("load",r),t?.removeEventListener("dragover",n),t?.removeEventListener("drop",n)}}),[]),[I,j]=(0,S.useState)(),T=(0,UC.A)((e=>{const t=e.ownerDocument.defaultView;j(t.innerHeight);const n=()=>{j(t.innerHeight)};return t.addEventListener("resize",n),()=>{t.removeEventListener("resize",n)}}),[]),[B,R]=(0,S.useState)(),N=(0,UC.A)((e=>{const t=e.ownerDocument.defaultView;R(t.innerWidth);const n=()=>{R(t.innerWidth)};return t.addEventListener("resize",n),()=>{t.removeEventListener("resize",n)}}),[]),D=1!==r;(0,S.useEffect)((()=>{D||(m.current=A)}),[A,D]);const M=(0,yV.A)({isDisabled:!i}),P=(0,eC.A)([dq(p),e,y,_,M,D?T:null]),O=`<!doctype html>\n<html>\n\t<head>\n\t\t<meta charset="utf-8">\n\t\t<script>window.frameElement._load()<\/script>\n\t\t<style>\n\t\t\thtml{\n\t\t\t\theight: auto !important;\n\t\t\t\tmin-height: 100%;\n\t\t\t}\n\t\t\t/* Lowest specificity to not override global styles */\n\t\t\t:where(body) {\n\t\t\t\tmargin: 0;\n\t\t\t\t/* Default background color in case zoom out mode background\n\t\t\t\tcolors the html element */\n\t\t\t\tbackground-color: white;\n\t\t\t}\n\t\t</style>\n\t\t${d}\n\t\t${h}\n\t</head>\n\t<body>\n\t\t<script>document.currentScript.parentElement.remove()<\/script>\n\t</body>\n</html>`,[L,F]=(0,S.useMemo)((()=>{const e=URL.createObjectURL(new window.Blob([O],{type:"text/html"}));return[e,()=>URL.revokeObjectURL(e)]}),[O]);(0,S.useEffect)((()=>F),[F]),(0,S.useEffect)((()=>{if(p&&D)return p.documentElement.classList.add("is-zoomed-out"),p.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-scale","default"===r?Math.min(A,800)/m.current:r),p.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-frame-size","number"==typeof o?`${o}px`:o),p.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-content-height",`${k}px`),p.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-inner-height",`${I}px`),p.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-container-width",`${A}px`),p.documentElement.style.setProperty("--wp-block-editor-iframe-zoom-out-prev-container-width",`${m.current}px`),()=>{p.documentElement.classList.remove("is-zoomed-out"),p.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-scale"),p.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-frame-size"),p.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-content-height"),p.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-inner-height"),p.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-container-width"),p.documentElement.style.removeProperty("--wp-block-editor-iframe-zoom-out-prev-container-width")}}),[r,o,p,I,k,A,B,D]);const z=n>=0&&!u,U=(0,Td.jsxs)(Td.Fragment,{children:[z&&v,(0,Td.jsx)("iframe",{...l,style:{border:0,...l.style,height:l.style?.height,transition:"all .3s"},ref:(0,eC.A)([s,E]),tabIndex:n,src:L,title:a,onKeyDown:e=>{if(l.onKeyDown&&l.onKeyDown(e),e.currentTarget.ownerDocument!==e.target.ownerDocument){const{stopPropagation:t}=e.nativeEvent;e.nativeEvent.stopPropagation=()=>{},e.stopPropagation(),e.nativeEvent.stopPropagation=t,uq(e,window.KeyboardEvent,e.currentTarget)}},children:p&&(0,kW.createPortal)((0,Td.jsxs)("body",{ref:P,className:(0,$v.A)("block-editor-iframe__body","editor-styles-wrapper",...g),children:[w,(0,Td.jsx)(l_.A,{document:p,children:t})]}),p.documentElement)}),z&&x]});return(0,Td.jsxs)("div",{className:"block-editor-iframe__container",ref:N,children:[C,(0,Td.jsx)("div",{className:(0,$v.A)("block-editor-iframe__scale-container",D&&"is-zoomed-out"),style:{"--wp-block-editor-iframe-zoom-out-container-width":D&&`${A}px`,"--wp-block-editor-iframe-zoom-out-prev-container-width":D&&`${m.current}px`},children:U})]})}const pq=(0,S.forwardRef)((function(e,t){return(0,Ul.A)((e=>e(hv).getSettings().__internalIsInitialized),[])?(0,Td.jsx)(hq,{...e,forwardedRef:t}):null}));var fq=n(45279);const mq=fq,gq=(fq.stringify,fq.fromJSON,fq.plugin,fq.parse,fq.list,fq.document,fq.comment,fq.atRule,fq.rule,fq.decl,fq.root,fq.CssSyntaxError);fq.Declaration,fq.Container,fq.Processor,fq.Document,fq.Comment,fq.Warning,fq.AtRule,fq.Result,fq.Input,fq.Rule,fq.Root,fq.Node;var bq=n(68868),yq=n.n(bq),vq=n(48790),_q=n.n(vq);const xq=new Map,wq=(e,t="")=>{let n=xq.get(t);return n||(n=new WeakMap,xq.set(t,n)),e.map((e=>{let r=n.get(e);return r||(r=function({css:e,ignoredSelectors:t=[],baseURL:n},r=""){if(!r&&!n)return e;const o=e.replace(/:root :where\(body\)/g,"body").replace(/:where\(body\)/g,"body");try{return mq([r&&yq()(r,{ignoredSelectors:[...t,r]}),n&&_q()({rootUrl:n})].filter(Boolean)).process(o,{}).css}catch(e){return e instanceof gq?console.warn("wp.blockEditor.transformStyles Failed to transform CSS.",e.message+"\n"+e.showSourceCode(!1)):console.warn("wp.blockEditor.transformStyles Failed to transform CSS.",e),null}}(e,t),n.set(e,r)),r}))};function kq(e,t){return(0,S.useCallback)((e=>{if(!e)return;const{ownerDocument:n}=e,{defaultView:r,body:o}=n,i=t?n.querySelector(t):o;let s;if(i)s=r?.getComputedStyle(i,null).getPropertyValue("background-color");else{const e=n.createElement("div");e.classList.add("editor-styles-wrapper"),o.appendChild(e),s=r?.getComputedStyle(e,null).getPropertyValue("background-color"),o.removeChild(e)}const a=(0,oc.Mj)(s);a.luminance()>.5||0===a.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e,t])}(0,oc.X$)([ic.A,sc.A]);const Cq=(0,S.memo)((function({styles:e,scope:t}){const n=(0,Ul.A)((e=>Cf(e(hv)).getStyleOverrides()),[]),[r,o]=(0,S.useMemo)((()=>{const r=Object.values(null!=e?e:[]);for(const[e,t]of n){const n=r.findIndex((({id:t})=>e===t)),o={...t,id:e};-1===n?r.push(o):r[n]=o}return[wq(r.filter((e=>e?.css)),t),r.filter((e=>"svgs"===e.__unstableType)).map((e=>e.assets)).join("")]}),[e,n,t]);return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)("style",{ref:kq(r,t)}),r.map(((e,t)=>(0,Td.jsx)("style",{children:e},t))),(0,Td.jsx)(pw.t4,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 0 0",width:"0",height:"0",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"},dangerouslySetInnerHTML:{__html:o}})]})}));let Sq;const Aq=2e3,Eq=[];function Iq({viewportWidth:e,containerWidth:t,minHeight:n,additionalStyles:r=Eq}){e||(e=t);const[o,{height:i}]=(0,yF.A)(),{styles:s}=(0,Ul.A)((e=>({styles:e(hv).getSettings().styles})),[]),a=(0,S.useMemo)((()=>s?[...s,{css:"body{height:auto;overflow:hidden;border:none;padding:0;}",__unstableType:"presets"},...r]:s),[s,r]);Sq=Sq||(0,S.memo)(BG);const l=t/e,c=i?t/(i*l):0;return(0,Td.jsx)(qU,{className:"block-editor-block-preview__content",style:{transform:`scale(${l})`,aspectRatio:c,maxHeight:i>Aq?Aq*l:void 0,minHeight:n},children:(0,Td.jsxs)(pq,{contentRef:(0,UC.A)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.boxSizing="border-box",e.style.position="absolute",e.style.width="100%"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:e,height:i,pointerEvents:"none",maxHeight:Aq,minHeight:0!==l&&l<1&&n?n/l:n},children:[(0,Td.jsx)(Cq,{styles:a}),o,(0,Td.jsx)(Sq,{renderAppender:!1})]})})}function jq(e){const[t,{width:n}]=(0,yF.A)();return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)("div",{style:{position:"relative",width:"100%",height:0},children:t}),(0,Td.jsx)("div",{className:"block-editor-block-preview__container",children:!!n&&(0,Td.jsx)(Iq,{...e,containerWidth:n})})]})}const Tq=[],Bq=(0,S.memo)((function({blocks:e,viewportWidth:t=1200,minHeight:n,additionalStyles:r=Tq,__experimentalMinHeight:o,__experimentalPadding:i}){o&&(n=o,(0,q.default)("The __experimentalMinHeight prop",{since:"6.2",version:"6.4",alternative:"minHeight"})),i&&(r=[...r,{css:`body { padding: ${i}px; }`}],(0,q.default)("The __experimentalPadding prop of BlockPreview",{since:"6.2",version:"6.4",alternative:"additionalStyles"}));const s=(0,Ul.A)((e=>e(hv).getSettings()),[]),a=(0,S.useMemo)((()=>({...s,focusMode:!1,__unstableIsPreviewMode:!0})),[s]),l=(0,S.useMemo)((()=>Array.isArray(e)?e:[e]),[e]);return e&&0!==e.length?(0,Td.jsx)(zU,{value:l,settings:a,children:(0,Td.jsx)(jq,{viewportWidth:t,minHeight:n,additionalStyles:r})}):null})),Rq=function({item:e}){var t;const{name:n,title:r,icon:o,description:i,initialAttributes:s,example:a}=e,l=jc(e),c=(0,S.useMemo)((()=>a?hd(n,{attributes:{...a.attributes,...s},innerBlocks:a.innerBlocks}):td(n,s)),[n,a,s]);return(0,Td.jsxs)("div",{className:"block-editor-inserter__preview-container",children:[(0,Td.jsx)("div",{className:"block-editor-inserter__preview",children:l||a?(0,Td.jsx)("div",{className:"block-editor-inserter__preview-content",children:(0,Td.jsx)(Bq,{blocks:c,viewportWidth:null!==(t=a?.viewportWidth)&&void 0!==t?t:500,additionalStyles:[{css:"body { padding: 24px; }"}]})}):(0,Td.jsx)("div",{className:"block-editor-inserter__preview-content-missing",children:(0,H.__)("No preview available.")})}),!l&&(0,Td.jsx)(BU,{title:r,icon:o,description:i})]})};var Nq=n(8348),Dq=n(67316);const{CompositeItemV2:Mq}=Cf(d_.j),Pq=(0,S.forwardRef)((function({isFirst:e,as:t,children:n,...r},o){return(0,Td.jsx)(Mq,{ref:o,role:"option",accessibleWhenDisabled:!0,...r,render:r=>{const o={...r,tabIndex:e?0:r.tabIndex};return t?(0,Td.jsx)(t,{...o,children:n}):"function"==typeof n?n(o):(0,Td.jsx)(Zv.Ay,{...o,children:n})}})}));var Oq=n(16342);const Lq="is-dragging-components-draggable",Fq=function({children:e,onDragStart:t,onDragOver:n,onDragEnd:r,appendToOwnerDocument:o=!1,cloneClassname:i,elementId:s,transferData:a,__experimentalTransferDataType:l="text",__experimentalDragComponent:c}){const u=(0,S.useRef)(null),d=(0,S.useRef)((()=>{}));return(0,S.useEffect)((()=>()=>{d.current()}),[]),(0,Td.jsxs)(Td.Fragment,{children:[e({onDraggableStart:function(e){const{ownerDocument:r}=e.target;e.dataTransfer.setData(l,JSON.stringify(a));const c=r.createElement("div");c.style.top="0",c.style.left="0";const h=r.createElement("div");"function"==typeof e.dataTransfer.setDragImage&&(h.classList.add("components-draggable__invisible-drag-image"),r.body.appendChild(h),e.dataTransfer.setDragImage(h,0,0)),c.classList.add("components-draggable__clone"),i&&c.classList.add(i);let p=0,f=0;if(u.current){p=e.clientX,f=e.clientY,c.style.transform=`translate( ${p}px, ${f}px )`;const t=r.createElement("div");t.innerHTML=u.current.innerHTML,c.appendChild(t),r.body.appendChild(c)}else{const e=r.getElementById(s),t=e.getBoundingClientRect(),n=e.parentNode,i=t.top,a=t.left;c.style.width=`${t.width+0}px`;const l=e.cloneNode(!0);l.id=`clone-${s}`,p=a-0,f=i-0,c.style.transform=`translate( ${p}px, ${f}px )`,Array.from(l.querySelectorAll("iframe")).forEach((e=>e.parentNode?.removeChild(e))),c.appendChild(l),o?r.body.appendChild(c):n?.appendChild(c)}let m=e.clientX,g=e.clientY;const b=(0,Oq.n)((function(e){if(m===e.clientX&&g===e.clientY)return;const t=p+e.clientX-m,r=f+e.clientY-g;c.style.transform=`translate( ${t}px, ${r}px )`,m=e.clientX,g=e.clientY,p=t,f=r,n&&n(e)}),16);r.addEventListener("dragover",b),r.body.classList.add(Lq),t&&t(e),d.current=()=>{c&&c.parentNode&&c.parentNode.removeChild(c),h&&h.parentNode&&h.parentNode.removeChild(h),r.body.classList.remove(Lq),r.removeEventListener("dragover",b)}},onDraggableEnd:function(e){e.preventDefault(),d.current(),r&&r(e)}}),c&&(0,Td.jsx)("div",{className:"components-draggable-drag-component-root",style:{display:"none"},ref:u,children:c})]})};var zq=n(90399);function Uq({count:e,icon:t,isPattern:n,fadeWhenDisabled:r}){const o=n&&(0,H.__)("Pattern");return(0,Td.jsx)("div",{className:"block-editor-block-draggable-chip-wrapper",children:(0,Td.jsx)("div",{className:"block-editor-block-draggable-chip","data-testid":"block-draggable-chip",children:(0,Td.jsxs)(B_.A,{justify:"center",className:"block-editor-block-draggable-chip__content",children:[(0,Td.jsx)(R_.A,{children:t?(0,Td.jsx)(pz,{icon:t}):o||(0,H.sprintf)((0,H._n)("%d block","%d blocks",e),e)}),(0,Td.jsx)(R_.A,{children:(0,Td.jsx)(pz,{icon:zq.A})}),r&&(0,Td.jsx)(R_.A,{className:"block-editor-block-draggable-chip__disabled",children:(0,Td.jsx)("span",{className:"block-editor-block-draggable-chip__disabled-icon"})})]})})})}const Vq=({isEnabled:e,blocks:t,icon:n,children:r,pattern:o})=>{const i={type:"inserter",blocks:t},s=(0,Ul.A)((e=>{const{getBlockType:n}=e(ed);return 1===t.length&&n(t[0].name)?.icon}),[t]),{startDragging:a,stopDragging:l}=Cf((0,Vl.A)(hv));return(0,Td.jsx)(Fq,{__experimentalTransferDataType:"wp-blocks",transferData:i,onDragStart:e=>{a();const n=o?.type===Nf.user&&"unsynced"!==o?.syncStatus?[td("core/block",{ref:o.id})]:t;e.dataTransfer.setData("text/html",zd(n))},onDragEnd:()=>{l()},__experimentalDragComponent:(0,Td.jsx)(Uq,{count:t.length,icon:n||!o&&s,isPattern:!!o}),children:({onDraggableStart:t,onDraggableEnd:n})=>r({draggable:e,onDragStart:e?t:void 0,onDragEnd:e?n:void 0})})},Hq=(0,S.memo)((function({className:e,isFirst:t,item:n,onSelect:r,onHover:o,isDraggable:i,...s}){const a=(0,S.useRef)(!1),l=n.icon?{backgroundColor:n.icon.background,color:n.icon.foreground}:{},c=(0,S.useMemo)((()=>[td(n.name,n.initialAttributes,nd(n.innerBlocks))]),[n.name,n.initialAttributes,n.innerBlocks]),u=jc(n)&&"unsynced"!==n.syncStatus||Tc(n);return(0,Td.jsx)(Vq,{isEnabled:i&&!n.isDisabled,blocks:c,icon:n.icon,children:({draggable:i,onDragStart:c,onDragEnd:d})=>(0,Td.jsx)("div",{className:(0,$v.A)("block-editor-block-types-list__list-item",{"is-synced":u}),draggable:i,onDragStart:e=>{a.current=!0,c&&(o(null),c(e))},onDragEnd:e=>{a.current=!1,d&&d(e)},children:(0,Td.jsxs)(Pq,{isFirst:t,className:(0,$v.A)("block-editor-block-types-list__item",e),disabled:n.isDisabled,onClick:e=>{e.preventDefault(),r(n,(0,Dq.H)()?e.metaKey:e.ctrlKey),o(null)},onKeyDown:e=>{const{keyCode:t}=e;t===VE.ENTER&&(e.preventDefault(),r(n,(0,Dq.H)()?e.metaKey:e.ctrlKey),o(null))},onMouseEnter:()=>{a.current||o(n)},onMouseLeave:()=>o(null),...s,children:[(0,Td.jsx)("span",{className:"block-editor-block-types-list__item-icon",style:l,children:(0,Td.jsx)(pz,{icon:n.icon,showColors:!0})}),(0,Td.jsx)("span",{className:"block-editor-block-types-list__item-title",children:(0,Td.jsx)(WA.A,{numberOfLines:3,children:n.title})})]})})})})),$q=(0,S.forwardRef)((function(e,t){const[n,r]=(0,S.useState)(!1);return(0,S.useEffect)((()=>{n&&(0,Jb.speak)((0,H.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,Td.jsx)("div",{ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{r(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&r(!1)},...e})})),{CompositeGroupV2:Wq}=Cf(d_.j),Gq=(0,S.forwardRef)((function(e,t){return(0,Td.jsx)(Wq,{role:"presentation",ref:t,...e})}));function qq(e,t){const n=[];for(let r=0,o=e.length;r<o;r+=t)n.push(e.slice(r,r+t));return n}const Kq=function e({items:t=[],onSelect:n,onHover:r=(()=>{}),children:o,label:i,isDraggable:s=!0}){const a="block-editor-block-types-list",l=(0,z_.A)(e,a);return(0,Td.jsxs)($q,{className:a,"aria-label":i,children:[qq(t,3).map(((e,t)=>(0,Td.jsx)(Gq,{children:e.map(((e,o)=>(0,Td.jsx)(Hq,{item:e,className:Rd(e.id),onSelect:n,onHover:r,isDraggable:s&&!e.isDisabled,isFirst:0===t&&0===o,rowId:`${l}-${t}`},e.id)))},t))),o]})},Yq=function({title:e,icon:t,children:n}){return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsxs)("div",{className:"block-editor-inserter__panel-header",children:[(0,Td.jsx)("h2",{className:"block-editor-inserter__panel-title",children:e}),(0,Td.jsx)(Ux.A,{icon:t})]}),(0,Td.jsx)("div",{className:"block-editor-inserter__panel-content",children:n})]})},Jq=(e,t,n)=>{const[r]=(0,Ul.A)((t=>[t(hv).getInserterItems(e,{[Af]:!n})]),[e,n]),[o,i]=(0,Ul.A)((e=>{const{getCategories:t,getCollections:n}=e(ed);return[t(),n()]}),[]),s=(0,S.useCallback)((({name:e,initialAttributes:n,innerBlocks:r,syncStatus:o,content:i,rootClientId:s},a)=>{const l="unsynced"===o?Oh(i,{__unstableSkipMigrationLogs:!0}):td(e,n,nd(r));t(l,void 0,a,s)}),[t]);return[r,o,i,s]},{CompositeV2:Xq,useCompositeStoreV2:Zq}=Cf(d_.j),Qq=function({children:e}){const t=Zq({focusShift:!0,focusWrap:"horizontal"});return(0,Td.jsx)(Xq,{store:t,render:(0,Td.jsx)(Td.Fragment,{}),children:e})},eK=function(){return(0,Td.jsxs)("div",{className:"block-editor-inserter__no-results",children:[(0,Td.jsx)(lk.A,{className:"block-editor-inserter__no-results-icon",icon:hz.A}),(0,Td.jsx)("p",{children:(0,H.__)("No results found.")})]})},tK=[];function nK({items:e,collections:t,categories:n,onSelectItem:r,onHover:o,showMostUsedBlocks:i,className:s}){const a=(0,S.useMemo)((()=>Rf(e,"frecency","desc").slice(0,6)),[e]),l=(0,S.useMemo)((()=>e.filter((e=>!e.category))),[e]),c=(0,S.useMemo)((()=>{const n={...t};return Object.keys(t).forEach((t=>{n[t]=e.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===n[t].length&&delete n[t]})),n}),[e,t]);(0,S.useEffect)((()=>()=>o(null)),[]);const u=(0,Nq.A)(n),d=n.length===u.length,h=(0,S.useMemo)((()=>Object.entries(t)),[t]),p=(0,Nq.A)(d?h:tK);return(0,Td.jsxs)("div",{className:s,children:[i&&e.length>3&&!!a.length&&(0,Td.jsx)(Yq,{title:(0,H._x)("Most used","blocks"),children:(0,Td.jsx)(Kq,{items:a,onSelect:r,onHover:o,label:(0,H._x)("Most used","blocks")})}),u.map((t=>{const n=e.filter((e=>e.category===t.slug));return n&&n.length?(0,Td.jsx)(Yq,{title:t.title,icon:t.icon,children:(0,Td.jsx)(Kq,{items:n,onSelect:r,onHover:o,label:t.title})},t.slug):null})),d&&l.length>0&&(0,Td.jsx)(Yq,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,H.__)("Uncategorized"),children:(0,Td.jsx)(Kq,{items:l,onSelect:r,onHover:o,label:(0,H.__)("Uncategorized")})}),p.map((([e,t])=>{const n=c[e];return n&&n.length?(0,Td.jsx)(Yq,{title:t.title,icon:t.icon,children:(0,Td.jsx)(Kq,{items:n,onSelect:r,onHover:o,label:t.title})},e):null}))]})}const rK=(0,S.forwardRef)((function({rootClientId:e,onInsert:t,onHover:n,showMostUsedBlocks:r},o){const[i,s,a,l]=Jq(e,t);if(!i.length)return(0,Td.jsx)(eK,{});const c=[],u=[];for(const t of i)"reusable"!==t.category&&(e&&t.rootClientId===e?c.push(t):u.push(t));return(0,Td.jsx)(Qq,{children:(0,Td.jsxs)("div",{ref:o,children:[!!c.length&&(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(nK,{items:c,categories:s,collections:a,onSelectItem:l,onHover:n,showMostUsedBlocks:r,className:"block-editor-inserter__insertable-blocks-at-selection"}),(0,Td.jsx)("hr",{})]}),(0,Td.jsx)(nK,{items:u,categories:s,collections:a,onSelectItem:l,onHover:n,showMostUsedBlocks:r,className:"block-editor-inserter__all-blocks"})]})})}));function oK({selectedCategory:e,patternCategories:t,onClickCategory:n}){const r="block-editor-block-patterns-explorer__sidebar";return(0,Td.jsx)("div",{className:`${r}__categories-list`,children:t.map((({name:t,label:o})=>(0,Td.jsx)(Zv.Ay,{label:o,className:`${r}__categories-list__item`,isPressed:e===t,onClick:()=>{n(t)},children:o},t)))})}function iK({searchValue:e,setSearchValue:t}){return(0,Td.jsx)("div",{className:"block-editor-block-patterns-explorer__search",children:(0,Td.jsx)(kU.A,{__nextHasNoMarginBottom:!0,onChange:t,value:e,label:(0,H.__)("Search for patterns"),placeholder:(0,H.__)("Search")})})}const sK=function({selectedCategory:e,patternCategories:t,onClickCategory:n,searchValue:r,setSearchValue:o}){return(0,Td.jsxs)("div",{className:"block-editor-block-patterns-explorer__sidebar",children:[(0,Td.jsx)(iK,{searchValue:r,setSearchValue:o}),!r&&(0,Td.jsx)(oK,{selectedCategory:e,patternCategories:t,onClickCategory:n})]})};function aK({currentPage:e,numPages:t,changePage:n,totalItems:r}){return(0,Td.jsxs)(oE.A,{className:"block-editor-patterns__grid-pagination-wrapper",children:[(0,Td.jsx)(NT.A,{variant:"muted",children:(0,H.sprintf)((0,H._n)("%s item","%s items",r),r)}),t>1&&(0,Td.jsxs)(tA.A,{expanded:!1,spacing:3,justify:"flex-start",className:"block-editor-patterns__grid-pagination",children:[(0,Td.jsxs)(tA.A,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-previous",children:[(0,Td.jsx)(Zv.Ay,{variant:"tertiary",onClick:()=>n(1),disabled:1===e,"aria-label":(0,H.__)("First page"),__experimentalIsFocusable:!0,children:(0,Td.jsx)("span",{children:"«"})}),(0,Td.jsx)(Zv.Ay,{variant:"tertiary",onClick:()=>n(e-1),disabled:1===e,"aria-label":(0,H.__)("Previous page"),__experimentalIsFocusable:!0,children:(0,Td.jsx)("span",{children:"‹"})})]}),(0,Td.jsx)(NT.A,{variant:"muted",children:(0,H.sprintf)((0,H._x)("%1$s of %2$s","paging"),e,t)}),(0,Td.jsxs)(tA.A,{expanded:!1,spacing:1,className:"block-editor-patterns__grid-pagination-next",children:[(0,Td.jsx)(Zv.Ay,{variant:"tertiary",onClick:()=>n(e+1),disabled:e===t,"aria-label":(0,H.__)("Next page"),__experimentalIsFocusable:!0,children:(0,Td.jsx)("span",{children:"›"})}),(0,Td.jsx)(Zv.Ay,{variant:"tertiary",onClick:()=>n(t),disabled:e===t,"aria-label":(0,H.__)("Last page"),size:"default",__experimentalIsFocusable:!0,children:(0,Td.jsx)("span",{children:"»"})})]})]})]})}const{CompositeV2:lK,CompositeItemV2:cK,useCompositeStoreV2:uK}=Cf(d_.j),dK=({showTooltip:e,title:t,children:n})=>e?(0,Td.jsx)(Dx.Ay,{text:t,children:n}):(0,Td.jsx)(Td.Fragment,{children:n});function hK({id:e,isDraggable:t,pattern:n,onClick:r,onHover:o,showTitle:i=!0,showTooltip:s,category:a}){const[l,c]=(0,S.useState)(!1),{blocks:u,viewportWidth:d}=n,h=`block-editor-block-patterns-list__item-description-${(0,z_.A)(hK)}`,p=(0,S.useMemo)((()=>a&&t?(null!=u?u:[]).map((e=>{const t=od(e);return t.attributes.metadata?.categories?.includes(a)&&(t.attributes.metadata.categories=[a]),t})):u),[u,t,a]);return(0,Td.jsx)(Vq,{isEnabled:t,blocks:p,pattern:n,children:({draggable:t,onDragStart:a,onDragEnd:p})=>(0,Td.jsx)("div",{className:"block-editor-block-patterns-list__list-item",draggable:t,onDragStart:e=>{c(!0),a&&(o?.(null),a(e))},onDragEnd:e=>{c(!1),p&&p(e)},children:(0,Td.jsx)(dK,{showTooltip:s&&!n.type!==Nf.user,title:n.title,children:(0,Td.jsxs)(cK,{render:(0,Td.jsx)("div",{role:"option","aria-label":n.title,"aria-describedby":n.description?h:void 0,className:(0,$v.A)("block-editor-block-patterns-list__item",{"block-editor-block-patterns-list__list-item-synced":n.type===Nf.user&&!n.syncStatus})}),id:e,onClick:()=>{r(n,u),o?.(null)},onMouseEnter:()=>{l||o?.(n)},onMouseLeave:()=>o?.(null),children:[(0,Td.jsx)(Bq,{blocks:u,viewportWidth:d}),i&&(0,Td.jsxs)(tA.A,{className:"block-editor-patterns__pattern-details",spacing:2,children:[n.type===Nf.user&&!n.syncStatus&&(0,Td.jsx)("div",{className:"block-editor-patterns__pattern-icon-wrapper",children:(0,Td.jsx)(lk.A,{className:"block-editor-patterns__pattern-icon",icon:vf.A})}),(!s||n.type===Nf.user)&&(0,Td.jsx)("div",{className:"block-editor-block-patterns-list__item-title",children:n.title})]}),!!n.description&&(0,Td.jsx)(GA.A,{id:h,children:n.description})]})})})})}function pK(){return(0,Td.jsx)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}const fK=(0,S.forwardRef)((function({isDraggable:e,blockPatterns:t,shownPatterns:n,onHover:r,onClickPattern:o,orientation:i,label:s=(0,H.__)("Block patterns"),category:a,showTitle:l=!0,showTitlesAsTooltip:c,pagingProps:u},d){const h=uK({orientation:i}),{setActiveId:p}=h;return(0,S.useEffect)((()=>{p(void 0)}),[p,n,t]),(0,Td.jsxs)(lK,{store:h,role:"listbox",className:"block-editor-block-patterns-list","aria-label":s,ref:d,children:[t.map((t=>n.includes(t)?(0,Td.jsx)(hK,{id:t.name,pattern:t,onClick:o,onHover:r,isDraggable:e,showTitle:l,showTooltip:c,category:a},t.name):(0,Td.jsx)(pK,{},t.name))),u&&(0,Td.jsx)(aK,{...u})]})}));function mK({destinationRootClientId:e,destinationIndex:t,rootClientId:n,registry:r}){if(n===e)return t;const o=["",...r.select(hv).getBlockParents(e),e],i=o.indexOf(n);return-1!==i?r.select(hv).getBlockIndex(o[i+1])+1:r.select(hv).getBlockOrder(n).length}const gK=function({rootClientId:e="",insertionIndex:t,clientId:n,isAppender:r,onSelect:o,shouldFocusBlock:i=!0,selectBlockOnInsert:s=!0}){const a=(0,Hp.A)(),{getSelectedBlock:l}=(0,Ul.A)(hv),{destinationRootClientId:c,destinationIndex:u}=(0,Ul.A)((o=>{const{getSelectedBlockClientId:i,getBlockRootClientId:s,getBlockIndex:a,getBlockOrder:l}=o(hv),c=i();let u,d=e;return void 0!==t?u=t:n?u=a(n):!r&&c?(d=s(c),u=a(c)+1):u=l(d).length,{destinationRootClientId:d,destinationIndex:u}}),[e,t,n,r]),{replaceBlocks:d,insertBlocks:h,showInsertionPoint:p,hideInsertionPoint:f,setLastFocus:m}=Cf((0,Vl.A)(hv)),g=(0,S.useCallback)(((e,t,n=!1,p)=>{(n||i||s)&&m(null);const f=l();!r&&f&&Dc(f)?d(f.clientId,e,null,i||n?0:null,t):h(e,r||void 0===p?u:mK({destinationRootClientId:c,destinationIndex:u,rootClientId:p,registry:a}),r||void 0===p?c:p,s,i||n?0:null,t);const g=Array.isArray(e)?e.length:1,b=(0,H.sprintf)((0,H._n)("%d block added.","%d blocks added.",g),g);(0,Jb.speak)(b),o&&o(e)}),[r,l,d,h,c,u,o,i,s]),b=(0,S.useCallback)((e=>{e?.hasOwnProperty("rootClientId")?p(e.rootClientId,mK({destinationRootClientId:c,destinationIndex:u,rootClientId:e.rootClientId,registry:a})):f()}),[p,f,c,u]);return[c,g,b]},bK=(e,t,n)=>{const{patternCategories:r,patterns:o,userPatternCategories:i}=(0,Ul.A)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:r}=e(hv),{__experimentalUserPatternCategories:o,__experimentalBlockPatternCategories:i}=r();return{patterns:n(t),userPatternCategories:o,patternCategories:i}}),[t]),s=(0,S.useMemo)((()=>{const e=[...r];return i?.forEach((t=>{e.find((e=>e.name===t.name))||e.push(t)})),e}),[r,i]),{createSuccessNotice:a}=(0,Vl.A)(Xb.store),l=(0,S.useCallback)(((t,r)=>{const o=t.type===Nf.user&&"unsynced"!==t.syncStatus?[td("core/block",{ref:t.id})]:r;e((null!=o?o:[]).map((e=>{const t=od(e);return t.attributes.metadata?.categories?.includes(n)&&(t.attributes.metadata.categories=[n]),t})),t.name),a((0,H.sprintf)((0,H.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar",id:"block-pattern-inserted-notice"})}),[a,e,n]);return[o,s,l]};var yK=n(84467);const vK=e=>e.name||"",_K=e=>e.title,xK=e=>e.description||"",wK=e=>e.keywords||[],kK=e=>e.category,CK=()=>null,SK=[/([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu,/([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu],AK=/(\p{C}|\p{P}|\p{S})+/giu,EK=new Map,IK=new Map;function jK(e=""){if(EK.has(e))return EK.get(e);const t=(0,yK.W)(e,{splitRegexp:SK,stripRegexp:AK}).split(" ").filter(Boolean);return EK.set(e,t),t}function TK(e=""){if(IK.has(e))return IK.get(e);let t=Zc()(e);return t=t.replace(/^\//,""),t=t.toLowerCase(),IK.set(e,t),t}const BK=(e="")=>jK(TK(e)),RK=(e,t,n,r)=>{if(0===BK(r).length)return e;const o={getCategory:e=>t.find((({slug:t})=>t===e.category))?.title,getCollection:e=>n[e.name.split("/")[0]]?.title};return NK(e,r,o)},NK=(e=[],t="",n={})=>{if(0===BK(t).length)return e;const r=e.map((e=>[e,DK(e,t,n)])).filter((([,e])=>e>0));return r.sort((([,e],[,t])=>t-e)),r.map((([e])=>e))};function DK(e,t,n={}){const{getName:r=vK,getTitle:o=_K,getDescription:i=xK,getKeywords:s=wK,getCategory:a=kK,getCollection:l=CK}=n,c=r(e),u=o(e),d=i(e),h=s(e),p=a(e),f=l(e),m=TK(t),g=TK(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=jK(m),v=e,y.filter((e=>!BK(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}const MK=20,PK=5;function OK(e,t,n,r=""){const[o,i]=(0,S.useState)(1),s=(0,gx.A)(t),a=(0,gx.A)(r);s===t&&a===r||1===o||i(1);const l=e.length,c=o-1,u=(0,S.useMemo)((()=>e.slice(c*MK,c*MK+MK)),[c,e]),d=(0,Nq.A)(u,{step:PK}),h=Math.ceil(e.length/MK);return(0,S.useEffect)((function(){const e=(0,LW.A)(n?.current);e?.scrollTo(0,0)}),[t,n]),{totalItems:l,categoryPatterns:u,categoryPatternsAsyncList:d,numPages:h,changePage:e=>{const t=(0,LW.A)(n?.current);t?.scrollTo(0,0),i(e)},currentPage:o}}function LK({filterValue:e,filteredBlockPatternsLength:t}){return e?(0,Td.jsx)(nA.A,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count",children:(0,H.sprintf)((0,H._n)("%d pattern found","%d patterns found",t),t)}):null}const FK=function({searchValue:e,selectedCategory:t,patternCategories:n,rootClientId:r}){const o=(0,S.useRef)(),i=(0,yT.A)(Jb.speak,500),[s,a]=gK({rootClientId:r,shouldFocusBlock:!0}),[l,,c]=bK(a,s,t),u=(0,S.useMemo)((()=>n.map((e=>e.name))),[n]),d=(0,S.useMemo)((()=>{const n=l.filter((e=>{if(t===Mf.name)return!0;if(t===Pf.name&&e.type===Nf.user)return!0;if("uncategorized"===t){const t=e.categories.some((e=>u.includes(e)));return!e.categories?.length||!t}return e.categories?.includes(t)}));return e?NK(n,e):n}),[e,l,t,u]);(0,S.useEffect)((()=>{if(!e)return;const t=d.length,n=(0,H.sprintf)((0,H._n)("%d result found.","%d results found.",t),t);i(n)}),[e,i,d.length]);const h=OK(d,t,o),[p,f]=(0,S.useState)(e);e!==p&&(f(e),h.changePage(1));const m=!!d?.length;return(0,Td.jsxs)("div",{className:"block-editor-block-patterns-explorer__list",ref:o,children:[(0,Td.jsx)(LK,{filterValue:e,filteredBlockPatternsLength:d.length}),(0,Td.jsx)(Qq,{children:m&&(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(fK,{shownPatterns:h.categoryPatternsAsyncList,blockPatterns:h.categoryPatterns,onClickPattern:c,isDraggable:!1}),(0,Td.jsx)(aK,{...h})]})})]})};function zK(e,t="all"){const[n,r]=bK(void 0,e),o=(0,S.useMemo)((()=>"all"===t?n:n.filter((e=>!Of(e,t)))),[t,n]),i=(0,S.useMemo)((()=>{const e=r.filter((e=>o.some((t=>t.categories?.includes(e.name))))).sort(((e,t)=>e.label.localeCompare(t.label)));return o.some((e=>!function(e,t){return!(!e.categories||!e.categories.length)&&e.categories.some((e=>t.some((t=>t.name===e))))}(e,r)))&&!e.find((e=>"uncategorized"===e.name))&&e.push({name:"uncategorized",label:(0,H._x)("Uncategorized")}),o.some((e=>e.type===Nf.user))&&e.unshift(Pf),o.length>0&&e.unshift({name:Mf.name,label:Mf.label}),(0,Jb.speak)((0,H.sprintf)((0,H._n)("%d category button displayed.","%d category buttons displayed.",e.length),e.length)),e}),[r,o]);return i}function UK({initialCategory:e,rootClientId:t}){const[n,r]=(0,S.useState)(""),[o,i]=(0,S.useState)(e?.name),s=zK(t);return(0,Td.jsxs)("div",{className:"block-editor-block-patterns-explorer",children:[(0,Td.jsx)(sK,{selectedCategory:o,patternCategories:s,onClickCategory:i,searchValue:n,setSearchValue:r}),(0,Td.jsx)(FK,{searchValue:n,selectedCategory:o,patternCategories:s,rootClientId:t})]})}const VK=function({onModalClose:e,...t}){return(0,Td.jsx)(YF.A,{title:(0,H.__)("Patterns"),onRequestClose:e,isFullScreen:!0,children:(0,Td.jsx)(UK,{...t})})},HK=(0,S.createContext)({location:{},goTo:()=>{},goBack:()=>{},goToParent:()=>{},addScreen:()=>{},removeScreen:()=>{},params:{}}),$K=function(){const{location:e,params:t,goTo:n,goBack:r,goToParent:o}=(0,S.useContext)(HK);return{location:e,goTo:n,goBack:r,goToParent:o,params:t}},WK=(0,V_.KZ)((function(e,t){const n=function(e){const{onClick:t,as:n=Zv.Ay,goToParent:r=!1,...o}=(0,U_.A)(e,"NavigatorBackButton"),{goBack:i,goToParent:s}=$K();return{as:n,onClick:(0,S.useCallback)((e=>{e.preventDefault(),r?s():i(),t?.(e)}),[r,s,i,t]),...o}}(e);return(0,Td.jsx)(px.A,{ref:t,...n})}),"NavigatorBackButton"),GK=WK;var qK=n(5775);function KK(e,t){return(0,qK.match)(t,{decode:decodeURIComponent})(e)}const YK={name:"xpkswc",styles:"overflow-x:hidden;contain:content"},JK=(0,G_.keyframes)({"0%":{opacity:0,transform:"translateX( 50px )"},"100%":{opacity:1,transform:"none"}}),XK=(0,G_.keyframes)({"0%":{opacity:0,transform:"translateX( -50px )"},"100%":{opacity:1,transform:"none"}}),ZK=50;function QK({locationHistory:e}){return e.length<=1?e:[...e.slice(0,-2),{...e[e.length-2],isBack:!0,hasRestoredFocus:!1}]}function eY(e,t,n={}){const{locationHistory:r}=e,{focusTargetSelector:o,isBack:i=!1,skipFocus:s=!1,replace:a=!1,...l}=n;if(r.length>0&&r[r.length-1].path===t)return r;if(i&&r.length>1&&r[r.length-2].path===t)return QK(e);const c={...l,path:t,isBack:i,hasRestoredFocus:!1,skipFocus:s};if(0===r.length)return a?[]:[c];const u=r.slice(r.length>ZK-1?1:0,-1);return a||u.push({...r[r.length-1],focusTargetSelector:o}),u.push(c),u}function tY(e,t){let{screens:n,locationHistory:r,matchedPath:o}=e;switch(t.type){case"add":n=function({screens:e},t){return[...e,t]}(e,t.screen);break;case"remove":n=function({screens:e},t){return e.filter((e=>e.id!==t.id))}(e,t.screen);break;case"goback":r=QK(e);break;case"goto":r=eY(e,t.path,t.options);break;case"gotoparent":r=function(e,t={}){const{locationHistory:n,screens:r}=e,o=n[n.length-1].path;if(void 0===o)return n;const i=function(e,t){if(!e.startsWith("/"))return;const n=e.split("/");let r;for(;n.length>1&&void 0===r;){n.pop();const e=""===n.join("/")?"/":n.join("/");t.find((t=>!1!==KK(e,t.path)))&&(r=e)}return r}(o,r);return void 0===i?n:eY(e,i,{...t,isBack:!0})}(e,t.options)}if(n===e.screens&&r===e.locationHistory)return e;const i=r.length>0?r[r.length-1].path:void 0;return o=void 0!==i?function(e,t){for(const n of t){const t=KK(e,n.path);if(t)return{params:t.params,id:n.id}}}(i,n):void 0,o&&e.matchedPath&&o.id===e.matchedPath.id&&(0,Id.default)(o.params,e.matchedPath.params)&&(o=e.matchedPath),{screens:n,locationHistory:r,matchedPath:o}}const nY=(0,V_.KZ)((function(e,t){const{initialPath:n,children:r,className:o,...i}=(0,U_.A)(e,"NavigatorProvider"),[s,a]=(0,S.useReducer)(tY,n,(e=>({screens:[],locationHistory:[{path:e}],matchedPath:void 0}))),l=(0,S.useMemo)((()=>({goBack:()=>a({type:"goback"}),goTo:(e,t)=>a({type:"goto",path:e,options:t}),goToParent:e=>a({type:"gotoparent",options:e}),addScreen:e=>a({type:"add",screen:e}),removeScreen:e=>a({type:"remove",screen:e})})),[]),{locationHistory:c,matchedPath:u}=s,d=(0,S.useMemo)((()=>{var e;return{location:{...c[c.length-1],isInitial:1===c.length},params:null!==(e=u?.params)&&void 0!==e?e:{},match:u?.id,...l}}),[c,u,l]),h=(0,H_.l)(),p=(0,S.useMemo)((()=>h(YK,o)),[o,h]);return(0,Td.jsx)(px.A,{ref:t,className:p,...i,children:(0,Td.jsx)(HK.Provider,{value:d,children:r})})}),"NavigatorProvider"),rY=nY;var oY=n(10697);const iY=(0,V_.KZ)((function(e,t){const n=(0,S.useId)(),{children:r,className:o,path:i,...s}=(0,U_.A)(e,"NavigatorScreen"),{location:a,match:l,addScreen:c,removeScreen:u}=(0,S.useContext)(HK),d=l===n,h=(0,S.useRef)(null);(0,S.useEffect)((()=>{const e={id:n,path:(0,oY.escapeAttribute)(i)};return c(e),()=>u(e)}),[n,i,c,u]);const p=(0,H.isRTL)(),{isInitial:f,isBack:m}=a,g=(0,H_.l)(),b=(0,S.useMemo)((()=>g((e=>(0,G_.css)("overflow-x:auto;max-height:100%;",(({isInitial:e,isBack:t,isRTL:n})=>{if(e&&!t)return;const r=n&&t||!n&&!t?JK:XK;return(0,G_.css)("animation-duration:0.14s;animation-timing-function:ease-in-out;will-change:transform,opacity;animation-name:",r,";@media ( prefers-reduced-motion ){animation-duration:0s;}","")})(e),";",""))({isInitial:f,isBack:m,isRTL:p}),o)),[o,g,f,m,p]),y=(0,S.useRef)(a);(0,S.useEffect)((()=>{y.current=a}),[a]);const v=a.isInitial&&!a.isBack;(0,S.useEffect)((()=>{if(v||!d||!h.current||y.current.hasRestoredFocus||a.skipFocus)return;const e=h.current.ownerDocument.activeElement;if(h.current.contains(e))return;let t=null;if(a.isBack&&a.focusTargetSelector&&(t=h.current.querySelector(a.focusTargetSelector)),!t){const[e]=ME.focus.tabbable.find(h.current);t=null!=e?e:h.current}y.current.hasRestoredFocus=!0,t.focus()}),[v,d,a.isBack,a.focusTargetSelector,a.skipFocus]);const _=(0,eC.A)([t,h]);return d?(0,Td.jsx)(px.A,{ref:_,className:b,...s,children:r}):null}),"NavigatorScreen"),sY=iY,aY=(0,V_.KZ)((function(e,t){const n=function(e){const{path:t,onClick:n,as:r=Zv.Ay,attributeName:o="id",...i}=(0,U_.A)(e,"NavigatorButton"),s=(0,oY.escapeAttribute)(t),{goTo:a}=$K();return{as:r,onClick:(0,S.useCallback)((e=>{var t,r;e.preventDefault(),a(s,{focusTargetSelector:(t=o,r=s,`[${t}="${r}"]`)}),n?.(e)}),[a,n,o,s]),...i,[o]:s}}(e);return(0,Td.jsx)(px.A,{ref:t,...n})}),"NavigatorButton"),lY=aY;function cY({title:e}){return(0,Td.jsx)(oE.A,{spacing:0,children:(0,Td.jsx)(px.A,{children:(0,Td.jsx)(DT.A,{marginBottom:0,paddingX:4,paddingY:3,children:(0,Td.jsxs)(tA.A,{spacing:2,children:[(0,Td.jsx)(GK,{style:{minWidth:24,padding:0},icon:(0,H.isRTL)()?jU.A:TU.A,size:"small",label:(0,H.__)("Back")}),(0,Td.jsx)(DT.A,{children:(0,Td.jsx)(nA.A,{level:5,children:e})})]})})})})}function uY({categories:e,children:t}){return(0,Td.jsxs)(rY,{initialPath:"/",className:"block-editor-inserter__mobile-tab-navigation",children:[(0,Td.jsx)(sY,{path:"/",children:(0,Td.jsx)($A,{children:e.map((e=>(0,Td.jsx)(lY,{path:`/category/${e.name}`,as:gz,isAction:!0,children:(0,Td.jsxs)(tA.A,{children:[(0,Td.jsx)(pN.A,{children:e.label}),(0,Td.jsx)(lk.A,{icon:(0,H.isRTL)()?TU.A:jU.A})]})},e.name)))})}),e.map((e=>(0,Td.jsxs)(sY,{path:`/category/${e.name}`,children:[(0,Td.jsx)(cY,{title:(0,H.__)("Back")}),t(e)]},e.name)))]})}const dY=()=>{},hY=function({choices:e=[],onHover:t=dY,onSelect:n,value:r}){return(0,Td.jsx)(Td.Fragment,{children:e.map((e=>{const o=r===e.value;return(0,Td.jsx)(k_.A,{role:"menuitemradio",disabled:e.disabled,icon:o?ZS.A:null,info:e.info,isSelected:o,shortcut:e.shortcut,className:"components-menu-items-choice",onClick:()=>{o||n(e.value)},onMouseEnter:()=>t(e.value),onMouseLeave:()=>t(null),"aria-label":e["aria-label"],children:e.label},e.value)}))})},pY=e=>"all"!==e,fY=e=>e.name===Pf.name;function mY({setPatternSyncFilter:e,setPatternSourceFilter:t,patternSyncFilter:n,patternSourceFilter:r,scrollContainerRef:o,category:i}){const s=i.name===Pf.name?Nf.user:r,a=pY(s),l=fY(i),c=(0,S.useMemo)((()=>[{value:"all",label:(0,H._x)("All","patterns")},{value:Df.full,label:(0,H._x)("Synced","patterns"),disabled:a},{value:Df.unsynced,label:(0,H._x)("Not synced","patterns"),disabled:a}]),[a]),u=(0,S.useMemo)((()=>[{value:"all",label:(0,H._x)("All","patterns"),disabled:l},{value:Nf.directory,label:(0,H.__)("Pattern Directory"),disabled:l},{value:Nf.theme,label:(0,H.__)("Theme & Plugins"),disabled:l},{value:Nf.user,label:(0,H.__)("User")}]),[l]);return(0,Td.jsx)(Td.Fragment,{children:(0,Td.jsx)(i_.A,{popoverProps:{placement:"right-end"},label:(0,H.__)("Filter patterns"),toggleProps:{size:"compact"},icon:(0,Td.jsx)(lk.A,{icon:(0,Td.jsx)(pw.t4,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Td.jsx)(pw.wA,{d:"M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z",fill:"currentColor"})})}),children:()=>(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(w_.A,{label:(0,H.__)("Source"),children:(0,Td.jsx)(hY,{choices:u,onSelect:n=>{var r;t(r=n),pY(r)&&e("all"),o.current?.scrollTo(0,0)},value:s})}),(0,Td.jsx)(w_.A,{label:(0,H.__)("Type"),children:(0,Td.jsx)(hY,{choices:c,onSelect:t=>{e(t),o.current?.scrollTo(0,0)},value:n})}),(0,Td.jsx)("div",{className:"block-editor-tool-selector__help",children:(0,uI.A)((0,H.__)("Patterns are available from the <Link>WordPress.org Pattern Directory</Link>, bundled in the active theme, or created by users on this site. Only patterns created on this site can be synced."),{Link:(0,Td.jsx)(KI.A,{href:(0,H.__)("https://wordpress.org/patterns/")})})})]})})})}const gY=()=>{};function bY({rootClientId:e,onInsert:t,onHover:n=gY,category:r,showTitlesAsTooltip:o}){const[i,,s]=bK(t,e,r?.name),[a,l]=(0,S.useState)("all"),[c,u]=(0,S.useState)("all"),d=zK(e,c),h=(0,S.useRef)(),p=(0,S.useMemo)((()=>i.filter((e=>!Of(e,c,a)&&(r.name===Mf.name||r.name===Pf.name&&e.type===Nf.user||("uncategorized"===r.name?!e.categories||!e.categories.some((e=>d.some((t=>t.name===e)))):e.categories?.includes(r.name)))))),[i,d,r.name,c,a]),f=OK(p,r,h),{changePage:m}=f;(0,S.useEffect)((()=>()=>n(null)),[]);const g=(0,S.useCallback)((e=>{l(e),m(1)}),[l,m]),b=(0,S.useCallback)((e=>{u(e),m(1)}),[u,m]);return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsxs)(oE.A,{spacing:2,className:"block-editor-inserter__patterns-category-panel-header",children:[(0,Td.jsxs)(tA.A,{children:[(0,Td.jsx)(pN.A,{children:(0,Td.jsx)(nA.A,{className:"block-editor-inserter__patterns-category-panel-title",size:13,level:4,as:"div",children:r.label})}),(0,Td.jsx)(mY,{patternSyncFilter:a,patternSourceFilter:c,setPatternSyncFilter:g,setPatternSourceFilter:b,scrollContainerRef:h,category:r})]}),!p.length&&(0,Td.jsx)(NT.A,{variant:"muted",className:"block-editor-inserter__patterns-category-no-results",children:(0,H.__)("No results found")})]}),p.length>0&&(0,Td.jsx)(fK,{ref:h,shownPatterns:f.categoryPatternsAsyncList,blockPatterns:f.categoryPatterns,onClickPattern:s,onHover:n,label:r.label,orientation:"vertical",category:r.name,isDraggable:!0,showTitlesAsTooltip:o,patternFilter:c,pagingProps:f})]})}const{Tabs:yY}=Cf(d_.j),vY=function({categories:e,selectedCategory:t,onSelectCategory:n,children:r}){return(0,Td.jsxs)(yY,{className:"block-editor-inserter__category-tabs",selectOnMove:!1,selectedTabId:t?t.name:null,orientation:"vertical",onSelect:t=>{n(e.find((e=>e.name===t)))},children:[(0,Td.jsx)(yY.TabList,{className:"block-editor-inserter__category-tablist",children:e.map((e=>(0,Td.jsx)(yY.Tab,{tabId:e.name,className:"block-editor-inserter__category-tab","aria-label":e.label,"aria-current":e===t?"true":void 0,children:(0,Td.jsxs)(tA.A,{children:[(0,Td.jsx)(pN.A,{children:e.label}),(0,Td.jsx)(lk.A,{icon:(0,H.isRTL)()?TU.A:jU.A})]})},e.name)))}),e.map((e=>(0,Td.jsx)(yY.TabPanel,{tabId:e.name,focusable:!1,className:"block-editor-inserter__category-panel",children:r},e.name)))]})},_Y=function({onSelectCategory:e,selectedCategory:t,onInsert:n,rootClientId:r,children:o}){const[i,s]=(0,S.useState)(!1),a=zK(r),l=(0,YU.A)("medium","<");return(0,Ul.A)((e=>Cf(e(hv)).isResolvingPatterns()),[])?(0,Td.jsx)("div",{className:"block-editor-inserter__patterns-loading",children:(0,Td.jsx)(qE.Ay,{})}):a.length?(0,Td.jsxs)(Td.Fragment,{children:[!l&&(0,Td.jsxs)("div",{className:"block-editor-inserter__block-patterns-tabs-container",children:[(0,Td.jsx)(vY,{categories:a,selectedCategory:t,onSelectCategory:e,children:o}),(0,Td.jsx)(Zv.Ay,{className:"block-editor-inserter__patterns-explore-button",onClick:()=>s(!0),variant:"secondary",children:(0,H.__)("Explore all patterns")})]}),l&&(0,Td.jsx)(uY,{categories:a,children:e=>(0,Td.jsx)("div",{className:"block-editor-inserter__category-panel",children:(0,Td.jsx)(bY,{onInsert:n,rootClientId:r,category:e,showTitlesAsTooltip:!1},e.name)})}),i&&(0,Td.jsx)(VK,{initialCategory:t||a[0],patternCategories:a,onModalClose:()=>s(!1),rootClientId:r})]}):(0,Td.jsx)(eK,{})};function xY({rootClientId:e,onInsert:t,onHover:n,category:r,showTitlesAsTooltip:o,patternFilter:i}){return(0,Td.jsx)(bY,{rootClientId:e,onInsert:t,onHover:n,category:r,showTitlesAsTooltip:o,patternFilter:i},r.name)}function wY(e){return function(e=!0){const{__unstableSetEditorMode:t}=(0,Vl.A)(hv),{__unstableGetEditorMode:n}=(0,Ul.A)(hv),r=(0,S.useRef)(null),o=n();(0,S.useEffect)((()=>(r.current||(r.current=o),()=>{"zoom-out"===n()&&n()!==r.current&&t(r.current)})),[]),(0,S.useEffect)((()=>{e&&"zoom-out"!==o?t("zoom-out"):e||"zoom-out"!==n()||r.current===o||t(r.current)}),[t,e,o])}(),(0,Td.jsx)(xY,{...e})}function kY(e){return window.__experimentalEnableZoomedOutPatternsTab?(0,Td.jsx)(wY,{...e}):(0,Td.jsx)(xY,{...e})}var CY=n(32881);const SY={image:"img",video:"video",audio:"audio"};function AY(e,t){const n={id:e.id||void 0,caption:e.caption||void 0},r=e.url,o=e.alt||void 0;"image"===t?(n.url=r,n.alt=o):["video","audio"].includes(t)&&(n.src=r);const i=SY[t],s=(0,Td.jsx)(i,{src:e.previewUrl||r,alt:o,controls:"audio"===t||void 0,inert:"true",onError:({currentTarget:t})=>{t.src===e.previewUrl&&(t.src=r)}});return[td(`core/${t}`,n),s]}const EY=["image"],IY={position:"bottom left",className:"block-editor-inserter__media-list__item-preview-options__popover"},{CompositeItemV2:jY}=Cf(d_.j);function TY({category:e,media:t}){if(!e.getReportUrl)return null;const n=e.getReportUrl(t);return(0,Td.jsx)(i_.A,{className:"block-editor-inserter__media-list__item-preview-options",label:(0,H.__)("Options"),popoverProps:IY,icon:eA.A,children:()=>(0,Td.jsx)(w_.A,{children:(0,Td.jsx)(k_.A,{onClick:()=>window.open(n,"_blank").focus(),icon:CY.A,children:(0,H.sprintf)((0,H.__)("Report %s"),e.mediaType)})})})}function BY({onClose:e,onSubmit:t}){return(0,Td.jsxs)(YF.A,{title:(0,H.__)("Insert external image"),onRequestClose:e,className:"block-editor-inserter-media-tab-media-preview-inserter-external-image-modal",children:[(0,Td.jsxs)(oE.A,{spacing:3,children:[(0,Td.jsx)("p",{children:(0,H.__)("This image cannot be uploaded to your Media Library, but it can still be inserted as an external image.")}),(0,Td.jsx)("p",{children:(0,H.__)("External images can be removed by the external provider without warning and could even have legal compliance issues related to privacy legislation.")})]}),(0,Td.jsxs)(B_.A,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1,children:[(0,Td.jsx)(R_.A,{children:(0,Td.jsx)(Zv.Ay,{variant:"tertiary",onClick:e,children:(0,H.__)("Cancel")})}),(0,Td.jsx)(R_.A,{children:(0,Td.jsx)(Zv.Ay,{variant:"primary",onClick:t,children:(0,H.__)("Insert")})})]})]})}function RY({media:e,onClick:t,category:n}){const[r,o]=(0,S.useState)(!1),[i,s]=(0,S.useState)(!1),[a,l]=(0,S.useState)(!1),[c,u]=(0,S.useMemo)((()=>AY(e,n.mediaType)),[e,n.mediaType]),{createErrorNotice:d,createSuccessNotice:h}=(0,Vl.A)(Xb.store),{getSettings:p}=(0,Ul.A)(hv),f=(0,S.useCallback)((e=>{if(a)return;const n=p(),r=od(e),{id:i,url:s,caption:c}=r.attributes;i||n.mediaUpload?i?t(r):(l(!0),window.fetch(s).then((e=>e.blob())).then((e=>{n.mediaUpload({filesList:[e],additionalData:{caption:c},onFileChange([e]){ec(e.url)||(t({...r,attributes:{...r.attributes,id:e.id,url:e.url}}),h((0,H.__)("Image uploaded and inserted."),{type:"snackbar"}),l(!1))},allowedTypes:EY,onError(e){d(e,{type:"snackbar"}),l(!1)}})})).catch((()=>{o(!0),l(!1)}))):o(!0)}),[a,p,t,h,d]),m="string"==typeof e.title?e.title:e.title?.rendered||(0,H.__)("no title");let g;if(m.length>25){const e="...";g=m.slice(0,25-e.length)+e}const b=(0,S.useCallback)((()=>s(!0)),[]),y=(0,S.useCallback)((()=>s(!1)),[]);return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(Vq,{isEnabled:!0,blocks:[c],children:({draggable:t,onDragStart:r,onDragEnd:o})=>(0,Td.jsx)("div",{className:(0,$v.A)("block-editor-inserter__media-list__list-item",{"is-hovered":i}),draggable:t,onDragStart:r,onDragEnd:o,children:(0,Td.jsxs)("div",{onMouseEnter:b,onMouseLeave:y,children:[(0,Td.jsx)(Dx.Ay,{text:g||m,children:(0,Td.jsx)(jY,{render:(0,Td.jsx)("div",{"aria-label":m,role:"option",className:"block-editor-inserter__media-list__item"}),onClick:()=>f(c),children:(0,Td.jsxs)("div",{className:"block-editor-inserter__media-list__item-preview",children:[u,a&&(0,Td.jsx)("div",{className:"block-editor-inserter__media-list__item-preview-spinner",children:(0,Td.jsx)(qE.Ay,{})})]})})}),!a&&(0,Td.jsx)(TY,{category:n,media:e})]})})}),r&&(0,Td.jsx)(BY,{onClose:()=>o(!1),onSubmit:()=>{t(od(c)),h((0,H.__)("Image inserted."),{type:"snackbar"}),o(!1)}})]})}const{CompositeV2:NY,useCompositeStoreV2:DY}=Cf(d_.j),MY=function({mediaList:e,category:t,onClick:n,label:r=(0,H.__)("Media List")}){const o=DY();return(0,Td.jsx)(NY,{store:o,role:"listbox",className:"block-editor-inserter__media-list","aria-label":r,children:e.map(((e,r)=>(0,Td.jsx)(RY,{media:e,category:t,onClick:n},e.id||e.sourceId||r)))})};function PY({rootClientId:e,onInsert:t,category:n}){const[r,o,i]=(0,CU.A)(),{mediaList:s,isLoading:a}=function(e,t={}){const[n,r]=(0,S.useState)(),[o,i]=(0,S.useState)(!1),s=(0,S.useRef)();return(0,S.useEffect)((()=>{(async()=>{const n=JSON.stringify({category:e.name,...t});s.current=n,i(!0),r([]);const o=await(e.fetch?.(t));n===s.current&&(r(o),i(!1))})()}),[e.name,...Object.values(t)]),{mediaList:n,isLoading:o}}(n,{per_page:i?20:10,search:i}),l="block-editor-inserter__media-panel",c=n.labels.search_items||(0,H.__)("Search");return(0,Td.jsxs)("div",{className:l,children:[(0,Td.jsx)(kU.A,{className:`${l}-search`,onChange:o,value:r,label:c,placeholder:c}),a&&(0,Td.jsx)("div",{className:`${l}-spinner`,children:(0,Td.jsx)(qE.Ay,{})}),!a&&!s?.length&&(0,Td.jsx)(eK,{}),!a&&!!s?.length&&(0,Td.jsx)(MY,{rootClientId:e,onClick:t,mediaList:s,category:n})]})}const OY=["image","video","audio"],LY=function({rootClientId:e,selectedCategory:t,onSelectCategory:n,onInsert:r,children:o}){const i=function(e){const[t,n]=(0,S.useState)([]),r=(0,Ul.A)((e=>Cf(e(hv)).getInserterMediaCategories()),[]),{canInsertImage:o,canInsertVideo:i,canInsertAudio:s}=(0,Ul.A)((t=>{const{canInsertBlockType:n}=t(hv);return{canInsertImage:n("core/image",e),canInsertVideo:n("core/video",e),canInsertAudio:n("core/audio",e)}}),[e]);return(0,S.useEffect)((()=>{(async()=>{const e=[];if(!r)return;const t=new Map(await Promise.all(r.map((async e=>{if(e.isExternalResource)return[e.name,!0];let t=[];try{t=await e.fetch({per_page:1})}catch(e){}return[e.name,!!t.length]})))),a={image:o,video:i,audio:s};r.forEach((n=>{a[n.mediaType]&&t.get(n.name)&&e.push(n)})),e.length&&n(e)})()}),[o,i,s,r]),t}(e),s=(0,YU.A)("medium","<"),a=(0,S.useCallback)((e=>{if(!e?.url)return;const[t]=AY(e,e.type);r(t)}),[r]),l=(0,S.useMemo)((()=>i.map((e=>({...e,label:e.labels.name})))),[i]);return l.length?(0,Td.jsxs)(Td.Fragment,{children:[!s&&(0,Td.jsxs)("div",{className:"block-editor-inserter__media-tabs-container",children:[(0,Td.jsx)(vY,{categories:l,selectedCategory:t,onSelectCategory:n,children:o}),(0,Td.jsx)(GE,{children:(0,Td.jsx)(WE,{multiple:!1,onSelect:a,allowedTypes:OY,render:({open:e})=>(0,Td.jsx)(Zv.Ay,{onClick:t=>{t.target.focus(),e()},className:"block-editor-inserter__media-library-button",variant:"secondary","data-unstable-ignore-focus-outside-for-relatedtarget":".media-modal",children:(0,H.__)("Open Media Library")})})})]}),s&&(0,Td.jsx)(uY,{categories:l,children:t=>(0,Td.jsx)(PY,{onInsert:r,rootClientId:e,category:t})})]}):(0,Td.jsx)(eK,{})},{Fill:FY,Slot:zY}=(0,Hl.QJ)("__unstableInserterMenuExtension");FY.Slot=zY;const UY=FY,VY=(e,t)=>t?(e.sort((({id:e},{id:n})=>{let r=t.indexOf(e),o=t.indexOf(n);return r<0&&(r=t.length),o<0&&(o=t.length),r-o})),e):e,HY=[],$Y=function({filterValue:e,onSelect:t,onHover:n,onHoverPattern:r,rootClientId:o,clientId:i,isAppender:s,__experimentalInsertionIndex:a,maxBlockPatterns:l,maxBlockTypes:c,showBlockDirectory:u=!1,isDraggable:d=!0,shouldFocusBlock:h=!0,prioritizePatterns:p,selectBlockOnInsert:f,isQuick:m}){const g=(0,yT.A)(Jb.speak,500),{prioritizedBlocks:b}=(0,Ul.A)((e=>{const t=e(hv).getBlockListSettings(o);return{prioritizedBlocks:t?.prioritizedInserterBlocks||HY}}),[o]),[y,v]=gK({onSelect:t,rootClientId:o,clientId:i,isAppender:s,insertionIndex:a,shouldFocusBlock:h,selectBlockOnInsert:f}),[_,x,w,k]=Jq(y,v,m),[C,,A]=bK(v,y),E=(0,S.useMemo)((()=>{if(0===l)return[];const t=NK(C,e);return void 0!==l?t.slice(0,l):t}),[e,C,l]);let I=c;p&&E.length>2&&(I=0);const j=(0,S.useMemo)((()=>{if(0===I)return[];let t=Rf(_.filter((e=>"core/block"!==e.name)),"frecency","desc");!e&&b.length&&(t=VY(t,b));const n=RK(t,x,w,e);return void 0!==I?n.slice(0,I):n}),[e,_,x,w,I,b]);(0,S.useEffect)((()=>{if(!e)return;const t=j.length+E.length,n=(0,H.sprintf)((0,H._n)("%d result found.","%d results found.",t),t);g(n)}),[e,g,j,E]);const T=(0,Nq.A)(j,{step:9}),B=(0,Nq.A)(T.length===j.length?E:HY),R=j.length>0||E.length>0,N=!!j.length&&(0,Td.jsx)(Yq,{title:(0,Td.jsx)(GA.A,{children:(0,H.__)("Blocks")}),children:(0,Td.jsx)(Kq,{items:T,onSelect:k,onHover:n,label:(0,H.__)("Blocks"),isDraggable:d})}),D=!!E.length&&(0,Td.jsx)(Yq,{title:(0,Td.jsx)(GA.A,{children:(0,H.__)("Block patterns")}),children:(0,Td.jsx)("div",{className:"block-editor-inserter__quick-inserter-patterns",children:(0,Td.jsx)(fK,{shownPatterns:B,blockPatterns:E,onClickPattern:A,onHover:r,isDraggable:d})})});return(0,Td.jsxs)(Qq,{children:[!u&&!R&&(0,Td.jsx)(eK,{}),p?D:N,!!j.length&&!!E.length&&(0,Td.jsx)("div",{className:"block-editor-inserter__quick-inserter-separator"}),p?N:D,u&&(0,Td.jsx)(UY.Slot,{fillProps:{onSelect:k,onHover:n,filterValue:e,hasItems:R,rootClientId:y},children:e=>e.length?e:R?null:(0,Td.jsx)(eK,{})})]})},{Tabs:WY}=Cf(d_.j),GY={name:"blocks",title:(0,H.__)("Blocks")},qY={name:"patterns",title:(0,H.__)("Patterns")},KY={name:"media",title:(0,H.__)("Media")},YY=(0,S.forwardRef)((function({onSelect:e,children:t,onClose:n,selectedTab:r},o){const i=[GY,qY,KY];return(0,Td.jsx)("div",{className:"block-editor-inserter__tabs",ref:o,children:(0,Td.jsxs)(WY,{onSelect:e,selectedTabId:r,children:[(0,Td.jsxs)("div",{className:"block-editor-inserter__tablist-and-close-button",children:[(0,Td.jsx)(Zv.Ay,{className:"block-editor-inserter__close-button",icon:uT.A,label:(0,H.__)("Close block inserter"),onClick:()=>n(),size:"small"}),(0,Td.jsx)(WY.TabList,{className:"block-editor-inserter__tablist",children:i.map((e=>(0,Td.jsx)(WY.Tab,{tabId:e.name,className:"block-editor-inserter__tab",children:e.title},e.name)))})]}),i.map((e=>(0,Td.jsx)(WY.TabPanel,{tabId:e.name,focusable:!1,className:"block-editor-inserter__tabpanel",children:t},e.name)))]})})})),JY=()=>{},XY=(0,S.forwardRef)((function({rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:r,onSelect:o,showInserterHelpPanel:i,showMostUsedBlocks:s,__experimentalFilterValue:a="",shouldFocusBlock:l=!0,onPatternCategorySelection:c,onClose:u,__experimentalInitialTab:d,__experimentalInitialCategory:h},p){const f=(0,Ul.A)((e=>"zoom-out"===e(hv).__unstableGetEditorMode()),[]),[m,g,b]=(0,CU.A)(a),[y,v]=(0,S.useState)(null),[_,x]=(0,S.useState)(h),[w,k]=(0,S.useState)("all"),[C,A]=(0,S.useState)(null),[E,I]=(0,S.useState)(d),[j,T,B]=gK({rootClientId:e,clientId:t,isAppender:n,insertionIndex:r,shouldFocusBlock:l}),R=(0,S.useRef)(),N=(0,S.useCallback)(((e,t,n,r)=>{T(e,t,n,r),o(),window.requestAnimationFrame((()=>{l||R?.current.contains(p.current.ownerDocument.activeElement)||R?.current.querySelector("button").focus()}))}),[T,o,l]),D=(0,S.useCallback)(((e,t)=>{T(e,{patternName:t}),o()}),[T,o]),M=(0,S.useCallback)((e=>{B(e),v(e)}),[B,v]),P=(0,S.useCallback)((e=>{B(!!e)}),[B]),O=(0,S.useCallback)(((e,t)=>{x(e),k(t),c?.()}),[x,c]),L="patterns"===E&&!b&&!!_,F="media"===E&&!!C,z=(0,S.useMemo)((()=>"media"===E?null:(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(kU.A,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",onChange:e=>{y&&v(null),g(e)},value:m,label:(0,H.__)("Search for blocks and patterns"),placeholder:(0,H.__)("Search")}),!!b&&(0,Td.jsx)($Y,{filterValue:b,onSelect:o,onHover:M,onHoverPattern:P,rootClientId:e,clientId:t,isAppender:n,__experimentalInsertionIndex:r,showBlockDirectory:!0,shouldFocusBlock:l,prioritizePatterns:"patterns"===E})]})),[E,y,v,g,m,b,o,M,P,l,t,e,r,n]),U=(0,S.useMemo)((()=>(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)("div",{className:"block-editor-inserter__block-list",children:(0,Td.jsx)(rK,{ref:R,rootClientId:j,onInsert:N,onHover:M,showMostUsedBlocks:s})}),i&&(0,Td.jsxs)("div",{className:"block-editor-inserter__tips",children:[(0,Td.jsx)(GA.A,{as:"h2",children:(0,H.__)("A tip for using the block editor")}),(0,Td.jsx)(IU,{})]})]})),[j,N,M,s,i]),V=(0,S.useMemo)((()=>(0,Td.jsx)(_Y,{rootClientId:j,onInsert:D,onSelectCategory:O,selectedCategory:_,children:L&&(0,Td.jsx)(kY,{rootClientId:j,onInsert:D,onHover:P,category:_,patternFilter:w,showTitlesAsTooltip:!0})})),[j,P,D,O,w,_,L]),$=(0,S.useMemo)((()=>(0,Td.jsx)(LY,{rootClientId:j,selectedCategory:C,onSelectCategory:A,onInsert:N,children:F&&(0,Td.jsx)(PY,{rootClientId:j,onInsert:N,category:C})})),[j,N,C,A,F]),W=(0,S.useRef)();return(0,S.useLayoutEffect)((()=>{W.current&&window.requestAnimationFrame((()=>{W.current.querySelector('[role="tab"][aria-selected="true"]')?.focus()}))}),[]),(0,Td.jsxs)("div",{className:(0,$v.A)("block-editor-inserter__menu",{"show-panel":L||F,"is-zoom-out":f}),ref:p,children:[(0,Td.jsx)("div",{className:"block-editor-inserter__main-area",children:(0,Td.jsxs)(YY,{ref:W,onSelect:e=>{"patterns"!==e&&x(null),I(e)},onClose:u,selectedTab:E,children:[z,"blocks"===E&&!b&&U,"patterns"===E&&!b&&V,"media"===E&&$]})}),i&&y&&(0,Td.jsx)(KC.Ay,{className:"block-editor-inserter__preview-container__popover",placement:"right-start",offset:16,focusOnMount:!1,animate:!1,children:(0,Td.jsx)(Rq,{item:y})})]})})),ZY=(0,S.forwardRef)((function(e,t){return(0,Td.jsx)(XY,{...e,onPatternCategorySelection:JY,ref:t})}));function QY({onSelect:e,rootClientId:t,clientId:n,isAppender:r,prioritizePatterns:o,selectBlockOnInsert:i,hasSearch:s=!0}){const[a,l]=(0,S.useState)(""),[c,u]=gK({onSelect:e,rootClientId:t,clientId:n,isAppender:r,selectBlockOnInsert:i}),[d]=Jq(c,u,!0),[h]=bK(u,c),{setInserterIsOpened:p,insertionIndex:f}=(0,Ul.A)((e=>{const{getSettings:t,getBlockIndex:r,getBlockCount:o}=e(hv),i=t(),s=r(n),a=o();return{setInserterIsOpened:i.__experimentalSetIsInserterOpened,insertionIndex:-1===s?a:s}}),[n]),m=h.length&&(!!a||o),g=s&&(m&&h.length>6||d.length>6);(0,S.useEffect)((()=>{p&&p(!1)}),[p]);let b=0;return m&&(b=o?4:2),(0,Td.jsxs)("div",{className:(0,$v.A)("block-editor-inserter__quick-inserter",{"has-search":g,"has-expand":p}),children:[g&&(0,Td.jsx)(kU.A,{__nextHasNoMarginBottom:!0,className:"block-editor-inserter__search",value:a,onChange:e=>{l(e)},label:(0,H.__)("Search for blocks and patterns"),placeholder:(0,H.__)("Search")}),(0,Td.jsx)("div",{className:"block-editor-inserter__quick-inserter-results",children:(0,Td.jsx)($Y,{filterValue:a,onSelect:e,rootClientId:t,clientId:n,isAppender:r,maxBlockPatterns:b,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:o,selectBlockOnInsert:i,isQuick:!0})}),p&&(0,Td.jsx)(Zv.Ay,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{p({rootClientId:t,insertionIndex:f,filterValue:a})},"aria-label":(0,H.__)("Browse all. This will open the main inserter panel in the editor toolbar."),children:(0,H.__)("Browse all")})]})}const eJ=({onToggle:e,disabled:t,isOpen:n,blockTitle:r,hasSingleBlockType:o,toggleProps:i={},prioritizePatterns:s})=>{const{as:a=Zv.Ay,label:l,onClick:c,...u}=i;let d=l;return!d&&o?d=(0,H.sprintf)((0,H._x)("Add %s","directly add the only allowed block"),r):!d&&s?d=(0,H.__)("Add pattern"):d||(d=(0,H._x)("Add block","Generic label for block inserter button")),(0,Td.jsx)(a,{icon:QS.A,label:d,tooltipPosition:"bottom",onClick:function(t){e&&e(t),c&&c(t)},className:"block-editor-inserter__toggle","aria-haspopup":!o&&"true","aria-expanded":!o&&n,disabled:t,...u})};class tJ extends S.Component{constructor(){super(...arguments),this.onToggle=this.onToggle.bind(this),this.renderToggle=this.renderToggle.bind(this),this.renderContent=this.renderContent.bind(this)}onToggle(e){const{onToggle:t}=this.props;t&&t(e)}renderToggle({onToggle:e,isOpen:t}){const{disabled:n,blockTitle:r,hasSingleBlockType:o,directInsertBlock:i,toggleProps:s,hasItems:a,renderToggle:l=eJ,prioritizePatterns:c}=this.props;return l({onToggle:e,isOpen:t,disabled:n||!a,blockTitle:r,hasSingleBlockType:o,directInsertBlock:i,toggleProps:s,prioritizePatterns:c})}renderContent({onClose:e}){const{rootClientId:t,clientId:n,isAppender:r,showInserterHelpPanel:o,__experimentalIsQuick:i,prioritizePatterns:s,onSelectOrClose:a,selectBlockOnInsert:l}=this.props;return i?(0,Td.jsx)(QY,{onSelect:t=>{const n=Array.isArray(t)&&t?.length?t[0]:t;a&&"function"==typeof a&&a(n),e()},rootClientId:t,clientId:n,isAppender:r,prioritizePatterns:s,selectBlockOnInsert:l}):(0,Td.jsx)(ZY,{onSelect:()=>{e()},rootClientId:t,clientId:n,isAppender:r,showInserterHelpPanel:o})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:r,__experimentalIsQuick:o,onSelectOrClose:i}=this.props;return t||n?this.renderToggle({onToggle:r}):(0,Td.jsx)(PE.A,{className:"block-editor-inserter",contentClassName:(0,$v.A)("block-editor-inserter__popover",{"is-quick":o}),popoverProps:{position:e,shift:!0},onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,H.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:i})}}const nJ=(0,P.A)([(0,iI.A)(((e,{clientId:t,rootClientId:n,shouldDirectInsert:r=!0})=>{const{getBlockRootClientId:o,hasInserterItems:i,getAllowedBlocks:s,getDirectInsertBlock:a,getSettings:l}=e(hv),{getBlockVariations:c}=e(ed),u=s(n=n||o(t)||void 0),d=r&&a(n),h=l(),p=1===u?.length&&0===c(u[0].name,"inserter")?.length;let f=!1;return p&&(f=u[0]),{hasItems:i(n),hasSingleBlockType:p,blockTitle:f?f.title:"",allowedBlockType:f,directInsertBlock:d,rootClientId:n,prioritizePatterns:h.__experimentalPreferPatternsOnRoot&&!n}})),(0,UE.A)(((e,t,{select:n})=>({insertOnlyAllowedBlock(){const{rootClientId:r,clientId:o,isAppender:i,hasSingleBlockType:s,allowedBlockType:a,directInsertBlock:l,onSelectOrClose:c,selectBlockOnInsert:u}=t;if(!s&&!l)return;const{insertBlock:d}=e(hv);let h;if(l){const e=function(e){const{getBlock:t,getPreviousBlockClientId:i}=n(hv);if(!e||!o&&!r)return{};const s={};let a={};if(o){const e=t(o),n=t(i(o));e?.name===n?.name&&(a=n?.attributes||{})}else{const e=t(r);if(e?.innerBlocks?.length){const t=e.innerBlocks[e.innerBlocks.length-1];l&&l?.name===t.name&&(a=t.attributes)}}return e.forEach((e=>{a.hasOwnProperty(e)&&(s[e]=a[e])})),s}(l.attributesToCopy);h=td(l.name,{...l.attributes||{},...e})}else h=td(a.name);d(h,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:s,getBlockRootClientId:a}=n(hv);if(o)return e(o);const l=t();return!i&&l&&a(l)===r?e(l)+1:s(r).length}(),r,u),c&&c({clientId:h?.clientId});const p=(0,H.sprintf)((0,H.__)("%s block added"),a.title);(0,Jb.speak)(p)}}))),(0,wU.A)((({hasItems:e,isAppender:t,rootClientId:n,clientId:r})=>e||!t&&!n&&!r))])(tJ),rJ=(0,S.forwardRef)(((e,t)=>(0,Td.jsx)(nJ,{ref:t,...e})));function oJ({rootClientId:e,className:t,onFocus:n,tabIndex:r},o){return(0,Td.jsx)(rJ,{position:"bottom center",rootClientId:e,__experimentalIsQuick:!0,renderToggle:({onToggle:e,disabled:i,isOpen:s,blockTitle:a,hasSingleBlockType:l})=>{let c;c=l?(0,H.sprintf)((0,H._x)("Add %s","directly add the only allowed block"),a):(0,H._x)("Add block","Generic label for block inserter button");const u=!l;let d=(0,Td.jsxs)(Zv.Ay,{ref:o,onFocus:n,tabIndex:r,className:(0,$v.A)(t,"block-editor-button-block-appender"),onClick:e,"aria-haspopup":u?"true":void 0,"aria-expanded":u?s:void 0,disabled:i,label:c,children:[!l&&(0,Td.jsx)(GA.A,{as:"span",children:c}),(0,Td.jsx)(lk.A,{icon:QS.A})]});return(u||l)&&(d=(0,Td.jsx)(Dx.Ay,{text:c,children:d})),d},isAppender:!0})}(0,S.forwardRef)(((e,t)=>((0,q.default)("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),oJ(e,t))));const iJ=(0,S.forwardRef)(oJ),sJ=(0,$p.f)((e=>t=>{const{clientId:n}=Qp();return(0,Td.jsx)(e,{...t,clientId:n})}),"withClientId"),aJ=sJ((({clientId:e,showSeparator:t,isFloating:n,onAddBlock:r,isToggle:o})=>(0,Td.jsx)(iJ,{className:(0,$v.A)({"block-list-appender__toggle":o}),rootClientId:e,showSeparator:t,isFloating:n,onAddBlock:r}))),lJ=(0,P.A)([sJ,(0,iI.A)(((e,{clientId:t})=>{const{getBlockOrder:n}=e(hv),r=n(t);return{lastBlockClientId:r[r.length-1]}}))])((({clientId:e})=>(0,Td.jsx)(uG,{rootClientId:e}))),cJ=new WeakMap;var uJ=n(87211);function dJ(e,t,n={}){const{operation:r="insert",nearestSide:o="right"}=n,{canInsertBlockType:i,getBlockIndex:s,getClientIdsOfDescendants:a,getBlockOrder:l,getBlocksByClientId:c,getSettings:u,getBlock:d,isGroupable:h}=(0,Ul.A)(hv),{getGroupingBlockName:p}=(0,Ul.A)(ed),{insertBlocks:f,moveBlocksToPosition:m,updateBlockAttributes:g,clearSelectedBlock:b,replaceBlocks:y,removeBlocks:v}=(0,Vl.A)(hv),_=(0,Hp.A)(),x=(0,S.useCallback)(((n,s=!0,a=0,c=[])=>{Array.isArray(n)||(n=[n]);const u=l(e)[t],m=n.map((e=>e.clientId)),g=h([...m,u]);if("replace"===r)y(u,n,void 0,a);else if("group"===r&&g){const t=d(u);"left"===o?n.push(t):n.unshift(t);const r=n.map((e=>td(e.name,e.attributes,e.innerBlocks))),s=n.every((e=>"core/image"===e.name)),l=i("core/gallery",e),h=td(s&&l?"core/gallery":p(),{layout:{type:"flex",flexWrap:s&&l?null:"nowrap"}},r);y([u,...c],h,void 0,a)}else f(n,t,e,s,a)}),[l,e,t,h,r,y,d,o,i,p,f]),w=(0,S.useCallback)(((n,o,i)=>{if("replace"===r){const r=c(n),o=l(e)[t];_.batch((()=>{v(n,!1),y(o,r,void 0,0)}))}else m(n,o,e,i)}),[r,l,c,m,_,v,y,t,e]),k=function(e,t,n,r,o,i,s,a,l){return c=>{const{srcRootClientId:u,srcClientIds:d,type:h,blocks:p}=function(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(e){return t}return t}(c);if("inserter"===h){s();const e=p.map((e=>od(e)));i(e,!0,null)}if("block"===h){const s=n(d[0]);if(u===e&&s===t)return;if(d.includes(e)||r(d).some((t=>t===e)))return;if("group"===a){const e=d.map((e=>l(e)));return void i(e,!0,null,d)}const c=u===e,h=d.length;o(d,u,c&&s<t?t-h:t)}}}(e,t,s,a,w,x,b,r,d),C=function(e,t,n,r,o){return i=>{if(!t().mediaUpload)return;const s=ld(cd("from"),(t=>"files"===t.type&&r(t.blockName,e)&&t.isMatch(i)));if(s){const e=s.transform(i,n);o(e)}}}(e,u,g,i,x),A=function(e){return t=>{const n=Pp({HTML:t,mode:"BLOCKS"});n.length&&e(n)}}(x);return e=>{const t=(0,XA.$)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?A(n):t.length?C(t):k(e)}}function hJ(e,t,n=["top","bottom","left","right"]){let r,o;return n.forEach((n=>{const i=function(e,t,n){const r="top"===n||"bottom"===n,{x:o,y:i}=e,s=r?o:i,a=r?i:o,l=r?t.left:t.top,c=r?t.right:t.bottom,u=t[n];let d;return d=s>=l&&s<=c?s:s<c?l:c,Math.sqrt((s-d)**2+(a-u)**2)}(e,t,n);(void 0===r||i<r)&&(r=i,o=n)})),[r,o]}function pJ(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const fJ=30,mJ=120,gJ=120;function bJ(e,t,n,r){let o=!0;if(t){const e=t?.map((({name:e})=>e));o=n.every((t=>e?.includes(t)))}const i=n.map((t=>e(t))),s=i.every((e=>{const[t]=e?.parent||[];return!t||t===r}));return o&&s}const yJ={};function vJ({children:e,clientId:t}){const n=function(e){return(0,Ul.A)((t=>{const n=t(hv).getBlock(e);if(!n)return;const r=t(ed).getBlockType(n.name);return r&&0!==Object.keys(r.providesContext).length?Object.fromEntries(Object.entries(r.providesContext).map((([e,t])=>[e,n.attributes[t]]))):void 0}),[e])}(t);return(0,Td.jsx)(ZU,{value:n,children:e})}const _J=(0,S.memo)(MG);function xJ(e){const{clientId:t,allowedBlocks:n,prioritizedInserterBlocks:r,defaultBlock:o,directInsert:i,__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,r,o,i,s,a,l,c,u,d){const h=(0,Hp.A)(),p=function(e){const[t,n]=(0,S.useState)(e);return(0,Id.default)(t,e)||n(e),t}(n),f=(0,S.useMemo)((()=>r),r),m=void 0===l||"contentOnly"===t?t:l;(0,S.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=hS(d?.type);t.orientation=e.getOrientation(d)}void 0!==s&&((0,q.default)("__experimentalDefaultBlock",{alternative:"defaultBlock",since:"6.3",version:"6.4"}),t.defaultBlock=s),void 0!==o&&(t.defaultBlock=o),void 0!==a&&((0,q.default)("__experimentalDirectInsert",{alternative:"directInsert",since:"6.3",version:"6.4"}),t.directInsert=a),void 0!==i&&(t.directInsert=i),void 0!==t.directInsert&&"boolean"!=typeof t.directInsert&&(0,q.default)("Using `Function` as a `directInsert` argument",{alternative:"`boolean` values",since:"6.5"}),cJ.get(h)||cJ.set(h,{}),cJ.get(h)[e]=t,window.queueMicrotask((()=>{const e=cJ.get(h);if(Object.keys(e).length){const{updateBlockListSettings:t}=h.dispatch(hv);t(e),cJ.set(h,{})}}))}),[e,p,f,m,o,i,s,a,c,u,d,h])})(t,_,n,r,o,i,s,a,c,h,m,b),function(e,t,n,r){const{getBlocks:o,getSelectedBlocksInitialCaretPosition:i,isBlockSelected:s}=(0,Ul.A)(hv),{replaceInnerBlocks:a,__unstableMarkNextChangeAsNotPersistent:l}=(0,Vl.A)(hv),c=(0,S.useRef)(null);(0,S.useLayoutEffect)((()=>{let u=!1;return window.queueMicrotask((()=>{if(u)return;const d=o(e),h=0===d.length||"all"===n||"contentOnly"===n,p=!M()(t,c.current);if(!h||!p)return;c.current=t;const f=Vp(d,t);M()(f,d)||(l(),a(e,f,0===d.length&&r&&0!==f.length&&s(e),i()))})),()=>{u=!0}}),[t,n,e])}(t,l,c,d);const w=Ec(y,"layout")||Ec(y,"__experimentalLayout")||yJ,{allowSizingOnChildren:k=!1}=w,C=b||w,A=(0,S.useMemo)((()=>({...x,...C,...k&&{allowSizingOnChildren:!0}})),[x,C,k]),E=(0,Td.jsx)(_J,{rootClientId:t,renderAppender:f,__experimentalAppenderTagName:p,layout:A,wrapperRef:u,placeholder:g});return 0===Object.keys(v.providesContext).length?E:(0,Td.jsx)(vJ,{clientId:t,children:E})}function wJ(e){return PU(e),(0,Td.jsx)(xJ,{...e})}const kJ=(0,S.forwardRef)(((e,t)=>{const n=CJ({ref:t},e);return(0,Td.jsx)("div",{className:"block-editor-inner-blocks",children:(0,Td.jsx)("div",{...n})})}));function CJ(e={},t={}){const{__unstableDisableLayoutClassNames:n,__unstableDisableDropZone:r,dropZoneElement:o}=t,{clientId:i,layout:s=null,__unstableLayoutClassNames:a=""}=Qp(),l=(0,Ul.A)((e=>{const{getBlockName:t,isBlockSelected:n,hasSelectedInnerBlock:r,__unstableGetEditorMode:o,getTemplateLock:s,getBlockRootClientId:a,getBlockEditingMode:l,getBlockSettings:c,isDragging:u,getSettings:d}=Cf(e(hv));let h;if("zoom-out"===o()){const{sectionRootClientId:e}=Cf(d());h=i!==e}if(!i)return{isDropZoneDisabled:h};const{hasBlockSupport:p,getBlockType:f}=e(ed),m=t(i),g="navigation"===o(),b=l(i),y=a(i),[v]=c(i,"layout");return void 0!==h&&(h="disabled"===b),{__experimentalCaptureToolbars:p(m,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==m&&!n(i)&&!r(i,!0)&&g&&!u(),name:m,blockType:f(m),parentLock:s(y),parentClientId:y,isDropZoneDisabled:h,defaultLayout:v}}),[i]),{__experimentalCaptureToolbars:c,hasOverlay:u,name:d,blockType:h,parentLock:p,parentClientId:f,isDropZoneDisabled:m,defaultLayout:g}=l,b=function({dropZoneElement:e,rootClientId:t="",parentClientId:n="",isDisabled:r=!1}={}){const o=(0,Hp.A)(),[i,s]=(0,S.useState)({index:null,operation:"insert"}),{getBlockType:a}=(0,Ul.A)(ed),{getBlockListSettings:l,getBlocks:c,getBlockIndex:u,getDraggedBlockClientIds:d,getBlockNamesByClientId:h,getAllowedBlocks:p,isDragging:f}=Cf((0,Ul.A)(hv)),{showInsertionPoint:m,hideInsertionPoint:g,startDragging:b,stopDragging:y}=Cf((0,Vl.A)(hv)),v=dJ("before"===i.operation||"after"===i.operation?n:t,i.index,{operation:i.operation,nearestSide:i.nearestSide}),_=(0,uJ.A)((0,S.useCallback)(((r,i)=>{f()||b();const g=p(t),y=h([t])[0],v=h(d());if(!bJ(a,g,v,y))return;const _=c(t);if(0===_.length)return void o.batch((()=>{s({index:0,operation:"insert"}),m(t,0,{operation:"insert"})}));const x=_.map((e=>{const t=e.clientId;return{isUnmodifiedDefaultBlock:Dc(e),getBoundingClientRect:()=>i.getElementById(`block-${t}`).getBoundingClientRect(),blockIndex:u(t),blockOrientation:l(t)?.orientation}})),[w,k,C]=function(e,t,n="vertical",r={}){const o="horizontal"===n?["left","right"]:["top","bottom"];let i=0,s="before",a=1/0,l=null,c="right";const{dropZoneElement:u,parentBlockOrientation:d,rootBlockIndex:h=0}=r;if(u&&"horizontal"!==d){const e=u.getBoundingClientRect(),[n,r]=hJ(t,e,["top","bottom"]);if(e.height>mJ&&n<fJ){if("top"===r)return[h,"before"];if("bottom"===r)return[h+1,"after"]}}const p=(0,H.isRTL)();if(u&&"horizontal"===d){const e=u.getBoundingClientRect(),[n,r]=hJ(t,e,["left","right"]);if(e.width>gJ&&n<fJ){if(p&&"right"===r||!p&&"left"===r)return[h,"before"];if(p&&"left"===r||!p&&"right"===r)return[h+1,"after"]}}e.forEach((({isUnmodifiedDefaultBlock:e,getBoundingClientRect:r,blockIndex:u,blockOrientation:d})=>{const h=r();let[f,m]=hJ(t,h,o);const[g,b]=hJ(t,h,["left","right"]),y=pJ(t,h);e&&y?f=0:"vertical"===n&&"horizontal"!==d&&(y&&g<fJ||!y&&function(e,t){return t.top<=e.y&&t.bottom>=e.y}(t,h))&&(l=u,c=b),f<a&&(s="bottom"===m||!p&&"right"===m||p&&"left"===m?"after":"before",a=f,i=u)}));const f=i+("after"===s?1:-1),m=!!e[i]?.isUnmodifiedDefaultBlock,g=!!e[f]?.isUnmodifiedDefaultBlock;return null!==l?[l,"group",c]:m||g?[m?i:f,"replace"]:["after"===s?i+1:i,"insert"]}(x,{x:r.clientX,y:r.clientY},l(t)?.orientation,{dropZoneElement:e,parentBlockClientId:n,parentBlockOrientation:n?l(n)?.orientation:void 0,rootBlockIndex:u(t)});o.batch((()=>{s({index:w,operation:k,nearestSide:C});const e=["before","after"].includes(k)?n:t;m(e,w,{operation:k,nearestSide:C})}))}),[p,t,h,d,a,c,l,e,n,u,o,m,f,b]),200);return(0,ZA.A)({dropZoneElement:e,isDisabled:r,onDrop:v,onDragOver(e){_(e,e.currentTarget.ownerDocument)},onDragLeave(){_.cancel(),g()},onDragEnd(){_.cancel(),y(),g()}})}({dropZoneElement:o,rootClientId:i,parentClientId:f}),y=(0,eC.A)([e.ref,r||m?null:b]),v={__experimentalCaptureToolbars:c,layout:s,name:d,blockType:h,parentLock:p,defaultLayout:g,...t},_=v.value&&v.onChange?wJ:xJ;return{...e,ref:y,className:(0,$v.A)(e.className,"block-editor-block-list__layout",n?"":a,{"has-overlay":u}),children:i?(0,Td.jsx)(_,{...v,clientId:i}):(0,Td.jsx)(MG,{...t})}}CJ.save=function(e={}){const{innerBlocks:t}=Dd;if(!Array.isArray(t))return{...e,children:t};const n=zd(t,{isInnerBlocks:!0}),r=(0,Td.jsx)(Ad.A,{children:n});return{...e,children:r}},kJ.DefaultBlockAppender=lJ,kJ.ButtonBlockAppender=aJ,kJ.Content=()=>CJ.save().children;const SJ=kJ;var AJ=n(16218);const EJ=(0,S.createContext)(void 0),IJ=EJ.Provider;function jJ({children:e}){const[t,n]=(0,S.useState)(),r=(0,S.useMemo)((()=>({lastFocusedElement:t,setLastFocusedElement:n})),[t]);return(0,Td.jsx)(IJ,{value:r,children:e})}function TJ(e){return ME.focus.focusable.find(e,{sequential:!0}).filter((t=>t.closest('[role="row"]')===e))}const BJ=(0,S.forwardRef)((function({children:e,onExpandRow:t=(()=>{}),onCollapseRow:n=(()=>{}),onFocusRow:r=(()=>{}),applicationAriaLabel:o,...i},s){const a=(0,S.useCallback)((e=>{const{keyCode:o,metaKey:i,ctrlKey:s,altKey:a}=e;if(i||s||a||![VE.UP,VE.DOWN,VE.LEFT,VE.RIGHT,VE.HOME,VE.END].includes(o))return;e.stopPropagation();const{activeElement:l}=document,{currentTarget:c}=e;if(!l||!c.contains(l))return;const u=l.closest('[role="row"]');if(!u)return;const d=TJ(u),h=d.indexOf(l),p=0===h,f=p&&("false"===u.getAttribute("data-expanded")||"false"===u.getAttribute("aria-expanded"))&&o===VE.RIGHT;if([VE.LEFT,VE.RIGHT].includes(o)){let r;if(r=o===VE.LEFT?Math.max(0,h-1):Math.min(h+1,d.length-1),p){if(o===VE.LEFT){var m;if("true"===u.getAttribute("data-expanded")||"true"===u.getAttribute("aria-expanded"))return n(u),void e.preventDefault();const t=Math.max(parseInt(null!==(m=u?.getAttribute("aria-level"))&&void 0!==m?m:"1",10)-1,1),r=Array.from(c.querySelectorAll('[role="row"]'));let o=u;for(let e=r.indexOf(u);e>=0;e--){const n=r[e].getAttribute("aria-level");if(null!==n&&parseInt(n,10)===t){o=r[e];break}}TJ(o)?.[0]?.focus()}if(o===VE.RIGHT){if("false"===u.getAttribute("data-expanded")||"false"===u.getAttribute("aria-expanded"))return t(u),void e.preventDefault();const n=TJ(u);n.length>0&&n[r]?.focus()}return void e.preventDefault()}if(f)return;d[r].focus(),e.preventDefault()}else if([VE.UP,VE.DOWN].includes(o)){const t=Array.from(c.querySelectorAll('[role="row"]')),n=t.indexOf(u);let i;if(i=o===VE.UP?Math.max(0,n-1):Math.min(n+1,t.length-1),i===n)return void e.preventDefault();const s=TJ(t[i]);if(!s||!s.length)return void e.preventDefault();s[Math.min(h,s.length-1)].focus(),r(e,u,t[i]),e.preventDefault()}else if([VE.HOME,VE.END].includes(o)){const t=Array.from(c.querySelectorAll('[role="row"]')),n=t.indexOf(u);let i;if(i=o===VE.HOME?0:t.length-1,i===n)return void e.preventDefault();const s=TJ(t[i]);if(!s||!s.length)return void e.preventDefault();s[Math.min(h,s.length-1)].focus(),r(e,u,t[i]),e.preventDefault()}}),[t,n,r]);return(0,Td.jsx)(jJ,{children:(0,Td.jsx)("div",{role:"application","aria-label":o,children:(0,Td.jsx)("table",{...i,role:"treegrid",onKeyDown:a,ref:s,children:(0,Td.jsx)("tbody",{children:e})})})})})),RJ=BJ,NJ=(0,S.forwardRef)((function({children:e,level:t,positionInSet:n,setSize:r,isExpanded:o,...i},s){return(0,Td.jsx)("tr",{...i,ref:s,role:"row","aria-level":t,"aria-posinset":n,"aria-setsize":r,"aria-expanded":o,children:e})})),DJ=NJ,MJ=(0,S.forwardRef)((function({children:e,as:t,...n},r){const o=(0,S.useRef)(),i=r||o,{lastFocusedElement:s,setLastFocusedElement:a}=(0,S.useContext)(EJ);let l;s&&(l=s===("current"in i?i.current:void 0)?0:-1);const c={ref:i,tabIndex:l,onFocus:e=>a?.(e.target),...n};return"function"==typeof e?e(c):t?(0,Td.jsx)(t,{...c,children:e}):null})),PJ=MJ,OJ=(0,S.forwardRef)((function({children:e,...t},n){return(0,Td.jsx)(PJ,{ref:n,...t,children:e})})),LJ=OJ,FJ=(0,S.forwardRef)((function({children:e,withoutGridItem:t=!1,...n},r){return(0,Td.jsx)("td",{...n,role:"gridcell",children:t?(0,Td.jsx)(Td.Fragment,{children:e}):(0,Td.jsx)(LJ,{ref:r,children:e})})})),zJ=FJ;function UJ({clientId:e,maximumLength:t,context:n}){const r=(0,Ul.A)((t=>{if(!e)return null;const{getBlockName:r,getBlockAttributes:o}=t(hv),{getBlockType:i,getActiveBlockVariation:s}=t(ed),a=r(e),l=i(a);if(!l)return null;const c=o(e),u=Oc(l,c,n);if(u!==l.title)return u;const d=s(a,c);return d?.title||l.title}),[e,n]);if(!r)return null;if(t&&t>0&&r.length>t){const e="...";return r.slice(0,t-e.length)+e}return r}const VJ=(0,S.createContext)({}),HJ=()=>(0,S.useContext)(VJ);function $J({children:e,...t}){const n=(0,S.useRef)();return(0,S.useEffect)((()=>{n.current&&(n.current.textContent=n.current.textContent)}),[e]),(0,Td.jsx)("div",{hidden:!0,...t,ref:n,children:e})}const WJ=(0,S.forwardRef)((({nestingLevel:e,blockCount:t,clientId:n,...r},o)=>{const{insertedBlock:i,setInsertedBlock:s}=HJ(),a=(0,z_.A)(WJ),l=(0,Ul.A)((e=>{const{getTemplateLock:t,__unstableGetEditorMode:r}=e(hv);return!!t(n)||"zoom-out"===r()}),[n]),c=UJ({clientId:n,context:"list-view"}),u=UJ({clientId:i?.clientId,context:"list-view"});if((0,S.useEffect)((()=>{u?.length&&(0,Jb.speak)((0,H.sprintf)((0,H.__)("%s block inserted"),u),"assertive")}),[u]),l)return null;const d=`list-view-appender__${a}`,h=(0,H.sprintf)((0,H.__)("Append to %1$s block at position %2$d, Level %3$d"),c,t+1,e);return(0,Td.jsxs)("div",{className:"list-view-appender",children:[(0,Td.jsx)(rJ,{ref:o,rootClientId:n,position:"bottom right",isAppender:!0,selectBlockOnInsert:!1,shouldDirectInsert:!1,__experimentalIsQuick:!0,...r,toggleProps:{"aria-describedby":d},onSelectOrClose:e=>{e?.clientId&&s(e)}}),(0,Td.jsx)($J,{id:d,children:h})]})})),GJ=OW(DJ),qJ=(0,S.forwardRef)((({isDragged:e,isSelected:t,position:n,level:r,rowCount:o,children:i,className:s,path:a,...l},c)=>{const u=zW({clientId:l["data-block"],enableAnimation:!0,triggerAnimationOnChange:a}),d=(0,eC.A)([c,u]);return(0,Td.jsx)(GJ,{ref:d,className:(0,$v.A)("block-editor-list-view-leaf",s),level:r,positionInSet:n,setSize:o,isExpanded:void 0,...l,children:i})})),KJ=qJ;var YJ=n(4217),JJ=n(74476);const XJ=(e,t)=>"up"===e?"horizontal"===t?(0,H.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,H.isRTL)()?"left":"right":"down":null;function ZJ(e,t,n,r,o,i,s){const a=n+1;if(e>1)return function(e,t,n,r,o,i){const s=t+1;if(n&&r)return(0,H.__)("All blocks are selected, and cannot be moved");if(o>0&&!r){const t=XJ("down",i);if("down"===t)return(0,H.sprintf)((0,H.__)("Move %1$d blocks from position %2$d down by one place"),e,s);if("left"===t)return(0,H.sprintf)((0,H.__)("Move %1$d blocks from position %2$d left by one place"),e,s);if("right"===t)return(0,H.sprintf)((0,H.__)("Move %1$d blocks from position %2$d right by one place"),e,s)}if(o>0&&r){const e=XJ("down",i);if("down"===e)return(0,H.__)("Blocks cannot be moved down as they are already at the bottom");if("left"===e)return(0,H.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,H.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(o<0&&!n){const t=XJ("up",i);if("up"===t)return(0,H.sprintf)((0,H.__)("Move %1$d blocks from position %2$d up by one place"),e,s);if("left"===t)return(0,H.sprintf)((0,H.__)("Move %1$d blocks from position %2$d left by one place"),e,s);if("right"===t)return(0,H.sprintf)((0,H.__)("Move %1$d blocks from position %2$d right by one place"),e,s)}if(o<0&&n){const e=XJ("up",i);if("up"===e)return(0,H.__)("Blocks cannot be moved up as they are already at the top");if("left"===e)return(0,H.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,H.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}(e,n,r,o,i,s);if(r&&o)return(0,H.sprintf)((0,H.__)("Block %s is the only block, and cannot be moved"),t);if(i>0&&!o){const e=XJ("down",s);if("down"===e)return(0,H.sprintf)((0,H.__)("Move %1$s block from position %2$d down to position %3$d"),t,a,a+1);if("left"===e)return(0,H.sprintf)((0,H.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a+1);if("right"===e)return(0,H.sprintf)((0,H.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a+1)}if(i>0&&o){const e=XJ("down",s);if("down"===e)return(0,H.sprintf)((0,H.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,H.sprintf)((0,H.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,H.sprintf)((0,H.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(i<0&&!r){const e=XJ("up",s);if("up"===e)return(0,H.sprintf)((0,H.__)("Move %1$s block from position %2$d up to position %3$d"),t,a,a-1);if("left"===e)return(0,H.sprintf)((0,H.__)("Move %1$s block from position %2$d left to position %3$d"),t,a,a-1);if("right"===e)return(0,H.sprintf)((0,H.__)("Move %1$s block from position %2$d right to position %3$d"),t,a,a-1)}if(i<0&&r){const e=XJ("up",s);if("up"===e)return(0,H.sprintf)((0,H.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,H.sprintf)((0,H.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,H.sprintf)((0,H.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}const QJ=(e,t)=>"up"===e?"horizontal"===t?(0,H.isRTL)()?jU.A:TU.A:YJ.A:"down"===e?"horizontal"===t?(0,H.isRTL)()?TU.A:jU.A:JJ.A:null,eX=(e,t)=>"up"===e?"horizontal"===t?(0,H.isRTL)()?(0,H.__)("Move right"):(0,H.__)("Move left"):(0,H.__)("Move up"):"down"===e?"horizontal"===t?(0,H.isRTL)()?(0,H.__)("Move left"):(0,H.__)("Move right"):(0,H.__)("Move down"):null,tX=(0,S.forwardRef)((({clientIds:e,direction:t,orientation:n,...r},o)=>{const i=(0,z_.A)(tX),s=Array.isArray(e)?e:[e],a=s.length,{disabled:l}=r,{blockType:c,isDisabled:u,rootClientId:d,isFirst:h,isLast:p,firstIndex:f,orientation:m="vertical"}=(0,Ul.A)((e=>{const{getBlockIndex:r,getBlockRootClientId:o,getBlockOrder:i,getBlock:a,getBlockListSettings:c}=e(hv),u=s[0],d=o(u),h=r(u),p=r(s[s.length-1]),f=i(d),m=a(u),g=0===h,b=p===f.length-1,{orientation:y}=c(d)||{};return{blockType:m?Sc(m.name):null,isDisabled:l||("up"===t?g:b),rootClientId:d,firstIndex:h,isFirst:g,isLast:b,orientation:n||y}}),[e,t]),{moveBlocksDown:g,moveBlocksUp:b}=(0,Vl.A)(hv),y="up"===t?b:g,v=`block-editor-block-mover-button__description-${i}`;return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(Zv.Ay,{ref:o,className:(0,$v.A)("block-editor-block-mover-button",`is-${t}-button`),icon:QJ(t,m),label:eX(t,m),"aria-describedby":v,...r,onClick:u?null:t=>{y(e,d),r.onClick&&r.onClick(t)},disabled:u,__experimentalIsFocusable:!0}),(0,Td.jsx)(GA.A,{id:v,children:ZJ(a,c&&c.title,f,h,p,"up"===t?-1:1,m)})]})})),nX=(0,S.forwardRef)(((e,t)=>(0,Td.jsx)(tX,{direction:"up",ref:t,...e}))),rX=(0,S.forwardRef)(((e,t)=>(0,Td.jsx)(tX,{direction:"down",ref:t,...e})));var oX=n(24129),iX=n(61615);function sX({onClick:e}){return(0,Td.jsx)("span",{className:"block-editor-list-view__expander",onClick:t=>e(t,{forceToggle:!0}),"aria-hidden":"true","data-testid":"list-view-expander",children:(0,Td.jsx)(lk.A,{icon:(0,H.isRTL)()?QE.A:eI.A})})}function aX(e){if("core/image"===e.name)return e.attributes?.url?{url:e.attributes.url,alt:e.attributes.alt,clientId:e.clientId}:void 0}const lX=(0,S.forwardRef)((function({className:e,block:{clientId:t},onClick:n,onContextMenu:r,onMouseDown:o,onToggleExpanded:i,tabIndex:s,onFocus:a,onDragStart:l,onDragEnd:c,draggable:u,isExpanded:d,ariaDescribedBy:h},p){const f=BL(t),m=UJ({clientId:t,context:"list-view"}),{isLocked:g}=GF(t),{isContentOnly:b}=(0,Ul.A)((e=>({isContentOnly:"contentOnly"===e(hv).getBlockEditingMode(t)})),[t]),y=g&&!b,v="sticky"===f?.positionType,_=function({clientId:e,isExpanded:t}){const{block:n}=(0,Ul.A)((t=>({block:t(hv).getBlock(e)})),[e]);return(0,S.useMemo)((()=>function(e,t){const n=aX(e);return n?[n]:t?[]:function(e){if("core/gallery"!==e.name||!e.innerBlocks)return[];const t=[];for(const n of e.innerBlocks){const e=aX(n);if(e&&t.push(e),t.length>=3)return t}return t}(e)}(n,t)),[n,t])}({clientId:t,isExpanded:d}),x=f?.positionLabel?(0,H.sprintf)((0,H.__)("Position: %1$s"),f.positionLabel):"";return(0,Td.jsxs)(Zv.Ay,{className:(0,$v.A)("block-editor-list-view-block-select-button",e),onClick:n,onContextMenu:r,onKeyDown:function(e){e.keyCode!==VE.ENTER&&e.keyCode!==VE.SPACE||n(e)},onMouseDown:o,ref:p,tabIndex:s,onFocus:a,onDragStart:e=>{e.dataTransfer.clearData(),l?.(e)},onDragEnd:c,draggable:u,href:`#block-${t}`,"aria-describedby":h,"aria-expanded":d,children:[(0,Td.jsx)(sX,{onClick:i}),(0,Td.jsx)(pz,{icon:f?.icon,showColors:!0,context:"list-view"}),(0,Td.jsxs)(tA.A,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:[(0,Td.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,Td.jsx)(WA.A,{ellipsizeMode:"auto",children:m})}),f?.anchor&&(0,Td.jsx)("span",{className:"block-editor-list-view-block-select-button__anchor-wrapper",children:(0,Td.jsx)(WA.A,{className:"block-editor-list-view-block-select-button__anchor",ellipsizeMode:"auto",children:f.anchor})}),x&&v&&(0,Td.jsx)(Dx.Ay,{text:x,children:(0,Td.jsx)(lk.A,{icon:oX.A})}),_.length?(0,Td.jsx)("span",{className:"block-editor-list-view-block-select-button__images","aria-hidden":!0,children:_.map(((e,t)=>(0,Td.jsx)("span",{className:"block-editor-list-view-block-select-button__image",style:{backgroundImage:`url(${e.url})`,zIndex:_.length-t}},e.clientId)))}):null,y&&(0,Td.jsx)("span",{className:"block-editor-list-view-block-select-button__lock",children:(0,Td.jsx)(lk.A,{icon:iX.A})})]})]})})),cX=({appendToOwnerDocument:e,children:t,clientIds:n,cloneClassname:r,elementId:o,onDragStart:i,onDragEnd:s,fadeWhenDisabled:a=!1,dragComponent:l})=>{const{srcRootClientId:c,isDraggable:u,icon:d,visibleInserter:h,getBlockType:p}=(0,Ul.A)((e=>{const{canMoveBlocks:t,getBlockRootClientId:r,getBlockName:o,getBlockAttributes:i,isBlockInsertionPointVisible:s}=e(hv),{getBlockType:a,getActiveBlockVariation:l}=e(ed),c=r(n[0]),u=o(n[0]),d=l(u,i(n[0]));return{srcRootClientId:c,isDraggable:t(n,c),icon:d?.icon||a(u)?.icon,visibleInserter:s(),getBlockType:a}}),[n]),f=(0,S.useRef)(!1),[m,g,b]=function(){const e=(0,S.useRef)(null),t=(0,S.useRef)(null),n=(0,S.useRef)(null),r=(0,S.useRef)(null);return(0,S.useEffect)((()=>()=>{r.current&&(clearInterval(r.current),r.current=null)}),[]),[(0,S.useCallback)((o=>{e.current=o.clientY,n.current=(0,LW.A)(o.target),r.current=setInterval((()=>{if(n.current&&t.current){const e=n.current.scrollTop+t.current;n.current.scroll({top:e})}}),25)}),[]),(0,S.useCallback)((r=>{if(!n.current)return;const o=n.current.offsetHeight,i=e.current-n.current.offsetTop,s=r.clientY-n.current.offsetTop;if(r.clientY>i){const e=Math.max(o-i-50,0),n=Math.max(s-i-50,0),r=0===e||0===n?0:n/e;t.current=25*r}else if(r.clientY<i){const e=Math.max(i-50,0),n=Math.max(i-s-50,0),r=0===e||0===n?0:n/e;t.current=-25*r}else t.current=0}),[]),()=>{e.current=null,n.current=null,r.current&&(clearInterval(r.current),r.current=null)}]}(),{getAllowedBlocks:y,getBlockNamesByClientId:v,getBlockRootClientId:_}=(0,Ul.A)(hv),{startDraggingBlocks:x,stopDraggingBlocks:w}=(0,Vl.A)(hv);(0,S.useEffect)((()=>()=>{f.current&&w()}),[]);const k=GC(n[0]),C=k.current?.closest("body");if((0,S.useEffect)((()=>{if(!C||!a)return;const e=(0,Oq.n)((e=>{if(!e.target.closest("[data-block]"))return;const t=v(n),r=e.target.closest("[data-block]").getAttribute("data-block"),o=y(r),i=v([r])[0];let s;if(0===o?.length){const e=_(r),n=v([e])[0],o=y(e);s=bJ(p,o,t,n)}else s=bJ(p,o,t,i);s||h?window?.document?.body?.classList?.remove("block-draggable-invalid-drag-token"):window?.document?.body?.classList?.add("block-draggable-invalid-drag-token")}),200);return C.addEventListener("dragover",e),()=>{C.removeEventListener("dragover",e)}}),[n,C,a,y,v,_,p,h]),!u)return t({draggable:!1});const A={type:"block",srcClientIds:n,srcRootClientId:c};return(0,Td.jsx)(Fq,{appendToOwnerDocument:e,cloneClassname:r,__experimentalTransferDataType:"wp-blocks",transferData:A,onDragStart:e=>{window.requestAnimationFrame((()=>{x(n),f.current=!0,m(e),i&&i()}))},onDragOver:g,onDragEnd:()=>{w(),f.current=!1,b(),s&&s()},__experimentalDragComponent:void 0!==l?l:(0,Td.jsx)(Uq,{count:n.length,icon:d,fadeWhenDisabled:!0}),elementId:o,children:({onDraggableStart:e,onDraggableEnd:n})=>t({draggable:!0,onDragStart:e,onDragEnd:n})})},uX=(0,S.forwardRef)((({onClick:e,onToggleExpanded:t,block:n,isSelected:r,position:o,siblingBlockCount:i,level:s,isExpanded:a,selectedClientIds:l,...c},u)=>{const{clientId:d}=n,{blockMovingClientId:h,selectedBlockInBlockEditor:p}=(0,Ul.A)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(hv);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[]),{AdditionalBlockContent:f,insertedBlock:m,setInsertedBlock:g}=HJ(),b=h&&p===d,y=(0,$v.A)("block-editor-list-view-block-contents",{"is-dropping-before":b}),v=l.includes(d)?l:[d];return(0,Td.jsxs)(Td.Fragment,{children:[f&&(0,Td.jsx)(f,{block:n,insertedBlock:m,setInsertedBlock:g}),(0,Td.jsx)(cX,{appendToOwnerDocument:!0,clientIds:v,cloneClassname:"block-editor-list-view-draggable-chip",children:({draggable:l,onDragStart:d,onDragEnd:h})=>(0,Td.jsx)(lX,{ref:u,className:y,block:n,onClick:e,onToggleExpanded:t,isSelected:r,position:o,siblingBlockCount:i,level:s,draggable:l,onDragStart:d,onDragEnd:h,isExpanded:a,...c})})]})})),dX=uX;function hX(e,t){const n=()=>{const n=t?.querySelector(`[role=row][data-block="${e}"]`);return n?ME.focus.focusable.find(n)[0]:null};let r=n();r?r.focus():window.requestAnimationFrame((()=>{r=n(),r&&r.focus()}))}const pX=(0,S.memo)((function e({block:{clientId:t},displacement:n,isAfterDraggedBlocks:r,isDragged:o,isNesting:i,isSelected:s,isBranchSelected:a,selectBlock:l,position:c,level:u,rowCount:d,siblingBlockCount:h,showBlockMovers:p,path:f,isExpanded:m,selectedClientIds:g,isSyncedBranch:b}){const y=(0,S.useRef)(null),v=(0,S.useRef)(null),_=(0,S.useRef)(null),[x,w]=(0,S.useState)(!1),[k,C]=(0,S.useState)(),{isLocked:A,canEdit:E,canMove:I}=GF(t),j=s&&g[0]===t,T=s&&g[g.length-1]===t,{toggleBlockHighlight:B,duplicateBlocks:R,multiSelect:N,replaceBlocks:D,removeBlocks:M,insertAfterBlock:P,insertBeforeBlock:O,setOpenedBlockSettingsMenu:L}=Cf((0,Vl.A)(hv)),{canInsertBlockType:F,getSelectedBlockClientIds:z,getPreviousBlockClientId:U,getBlockRootClientId:V,getBlockOrder:$,getBlockParents:W,getBlocksByClientId:G,canRemoveBlocks:q,isGroupable:K}=(0,Ul.A)(hv),{getGroupingBlockName:Y}=(0,Ul.A)(ed),J=BL(t),{block:X,blockName:Z,allowRightClickOverrides:Q}=(0,Ul.A)((e=>{const{getBlock:n,getBlockName:r,getSettings:o}=e(hv);return{block:n(t),blockName:r(t),allowRightClickOverrides:o().allowRightClickOverrides}}),[t]),ee=Ic(Z,"__experimentalToolbar",!0),te=`list-view-block-select-button__description-${(0,z_.A)(e)}`,{expand:ne,collapse:re,collapseAll:oe,BlockSettingsMenu:ie,listViewInstanceId:se,expandedState:ae,setInsertedBlock:le,treeGridElementRef:ce,rootClientId:ue}=HJ(),de=(0,OU.ZK)();function he(){const e=z(),n=e.includes(t),r=n?e[0]:t,o=V(r);return{blocksToUpdate:n?e:[t],firstBlockClientId:r,firstBlockRootClientId:o,selectedBlockClientIds:e}}const pe=(0,S.useCallback)((()=>{w(!0),B(t,!0)}),[t,w,B]),fe=(0,S.useCallback)((()=>{w(!1),B(t,!1)}),[t,w,B]),me=(0,S.useCallback)((e=>{l(e,t),e.preventDefault()}),[t,l]),ge=(0,S.useCallback)(((e,t)=>{t&&l(void 0,e,null,null),hX(e,ce?.current)}),[l,ce]),be=(0,S.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===m?re(t):!1===m&&ne(t)}),[t,ne,re,m]),ye=(0,S.useCallback)((e=>{ee&&Q&&(_.current?.click(),C(new window.DOMRect(e.clientX,e.clientY,0,0)),e.preventDefault())}),[Q,_,ee]),ve=(0,S.useCallback)((e=>{Q&&2===e.button&&e.preventDefault()}),[Q]),_e=(0,S.useMemo)((()=>{const{ownerDocument:e}=v?.current||{};if(k&&e)return{ownerDocument:e,getBoundingClientRect:()=>k}}),[k]),xe=(0,S.useCallback)((()=>{C(void 0)}),[C]);if(function({isSelected:e,selectedClientIds:t,rowItemRef:n}){const r=1===t.length;(0,S.useLayoutEffect)((()=>{if(!e||!r||!n.current)return;const t=(0,LW.A)(n.current),{ownerDocument:o}=n.current;if(t===o.body||t===o.documentElement||!t)return;const i=n.current.getBoundingClientRect(),s=t.getBoundingClientRect();(i.top<s.top||i.bottom>s.bottom)&&n.current.scrollIntoView()}),[e,r,n])}({isSelected:s,rowItemRef:v,selectedClientIds:g}),!X)return null;const we=((e,t,n)=>(0,H.sprintf)((0,H.__)("Block %1$d of %2$d, Level %3$d."),e,t,n))(c,h,u),ke=(e=>e?(0,H.__)("This block is locked."):"")(A),Ce=p&&h>0,Se=(0,$v.A)("block-editor-list-view-block__mover-cell",{"is-visible":x||s}),Ae=(0,$v.A)("block-editor-list-view-block__menu-cell",{"is-visible":x||j});let Ee;Ce?Ee=2:ee||(Ee=3);const Ie=(0,$v.A)({"is-selected":s,"is-first-selected":j,"is-last-selected":T,"is-branch-selected":a,"is-synced-branch":b,"is-dragging":o,"has-single-cell":!ee,"is-synced":J?.isSynced,"is-draggable":I,"is-displacement-normal":"normal"===n,"is-displacement-up":"up"===n,"is-displacement-down":"down"===n,"is-after-dragged-blocks":r,"is-nesting":i}),je=g.includes(t)?g:[t],Te=s&&1===g.length;return(0,Td.jsxs)(KJ,{className:Ie,isDragged:o,onKeyDown:async function(e){if(e.defaultPrevented)return;const t=[VE.BACKSPACE,VE.DELETE].includes(e.keyCode);if(de("core/block-editor/unselect",e)&&g.length>0)e.stopPropagation(),e.preventDefault(),l(e,void 0);else if(t||de("core/block-editor/remove",e)){var n;if(t&&e.target.closest("[role=dialog]"))return;const{blocksToUpdate:r,firstBlockClientId:o,firstBlockRootClientId:i,selectedBlockClientIds:s}=he();if(!q(r,i))return;let a=null!==(n=U(o))&&void 0!==n?n:i;M(r,!1);const l=s.length>0&&0===z().length;a||(a=$()[0]),ge(a,l)}else if(de("core/block-editor/duplicate",e)){e.preventDefault();const{blocksToUpdate:t,firstBlockRootClientId:n}=he();if(G(t).every((e=>!!e&&Ic(e.name,"multiple",!0)&&F(e.name,n)))){const e=await R(t,!1);e?.length&&ge(e[0],!1)}}else if(de("core/block-editor/insert-before",e)){e.preventDefault();const{blocksToUpdate:t}=he();await O(t[0]);const n=z();L(void 0),ge(n[0],!1)}else if(de("core/block-editor/insert-after",e)){e.preventDefault();const{blocksToUpdate:t}=he();await P(t.at(-1));const n=z();L(void 0),ge(n[0],!1)}else if(de("core/block-editor/select-all",e)){e.preventDefault();const{firstBlockRootClientId:t,selectedBlockClientIds:n}=he(),r=$(t);if(!r.length)return;if((0,Id.default)(n,r)&&t&&t!==ue)return void ge(t,!0);N(r[0],r[r.length-1],null)}else if(de("core/block-editor/collapse-list-view",e)){e.preventDefault();const{firstBlockClientId:t}=he(),n=W(t,!1);oe(),ne(n)}else if(de("core/block-editor/group",e)){const{blocksToUpdate:t}=he();if(t.length>1&&K(t)){e.preventDefault();const n=dd(G(t),Y());D(t,n),(0,Jb.speak)((0,H.__)("Selected blocks are grouped."));const r=z();L(void 0),ge(r[0],!1)}}},onMouseEnter:pe,onMouseLeave:fe,onFocus:pe,onBlur:fe,level:u,position:c,rowCount:d,path:f,id:`list-view-${se}-block-${t}`,"data-block":t,"data-expanded":E?m:void 0,ref:v,children:[(0,Td.jsx)(zJ,{className:"block-editor-list-view-block__contents-cell",colSpan:Ee,ref:y,"aria-selected":!!s,children:({ref:e,tabIndex:t,onFocus:n})=>(0,Td.jsxs)("div",{className:"block-editor-list-view-block__contents-container",children:[(0,Td.jsx)(dX,{block:X,onClick:me,onContextMenu:ye,onMouseDown:ve,onToggleExpanded:be,isSelected:s,position:c,siblingBlockCount:h,level:u,ref:e,tabIndex:Te?0:t,onFocus:n,isExpanded:E?m:void 0,selectedClientIds:g,ariaDescribedBy:te}),(0,Td.jsx)($J,{id:te,children:`${we} ${ke}`})]})}),Ce&&(0,Td.jsx)(Td.Fragment,{children:(0,Td.jsxs)(zJ,{className:Se,withoutGridItem:!0,children:[(0,Td.jsx)(LJ,{children:({ref:e,tabIndex:n,onFocus:r})=>(0,Td.jsx)(nX,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:r})}),(0,Td.jsx)(LJ,{children:({ref:e,tabIndex:n,onFocus:r})=>(0,Td.jsx)(rX,{orientation:"vertical",clientIds:[t],ref:e,tabIndex:n,onFocus:r})})]})}),ee&&ie&&(0,Td.jsx)(zJ,{className:Ae,"aria-selected":!!s,ref:_,children:({ref:e,tabIndex:t,onFocus:n})=>(0,Td.jsx)(ie,{clientIds:je,block:X,icon:eA.A,label:(0,H.__)("Options"),popoverProps:{anchor:_e},toggleProps:{ref:e,className:"block-editor-list-view-block__menu",tabIndex:t,onClick:xe,onFocus:n},disableOpenOnArrowDown:!0,expand:ne,expandedState:ae,setInsertedBlock:le,__experimentalSelectBlock:ge})})]})}));function fX(e,t,n,r){var o;const i=n?.includes(e.clientId);return i?0:(null!==(o=t[e.clientId])&&void 0!==o?o:r)?1+e.innerBlocks.reduce(mX(t,n,r),0):1}const mX=(e,t,n)=>(r,o)=>{var i;const s=t?.includes(o.clientId);return s?r:(null!==(i=e[o.clientId])&&void 0!==i?i:n)&&o.innerBlocks.length>0?r+fX(o,e,t,n):r+1},gX=()=>{},bX=(0,S.memo)((function e(t){const{blocks:n,selectBlock:r=gX,showBlockMovers:o,selectedClientIds:i,level:s=1,path:a="",isBranchSelected:l=!1,listPosition:c=0,fixedListWindow:u,isExpanded:d,parentId:h,shouldShowInnerBlocks:p=!0,isSyncedBranch:f=!1,showAppender:m=!0}=t,g=BL(h),b=f||!!g?.isSynced,y=(0,Ul.A)((e=>!h||e(hv).canEditBlock(h)),[h]),{blockDropPosition:v,blockDropTargetIndex:_,firstDraggedBlockIndex:x,blockIndexes:w,expandedState:k,draggedClientIds:C}=HJ();if(!y)return null;const S=m&&1===s,A=n.filter(Boolean),E=A.length,I=S?E+1:E;let j=c;return(0,Td.jsxs)(Td.Fragment,{children:[A.map(((t,n)=>{var c;const{clientId:h,innerBlocks:f}=t;n>0&&(j+=fX(A[n-1],k,C,d));const m=!!C?.includes(h),{displacement:g,isAfterDraggedBlocks:y,isNesting:S}=function({blockIndexes:e,blockDropTargetIndex:t,blockDropPosition:n,clientId:r,firstDraggedBlockIndex:o,isDragged:i}){let s,a,l;if(!i){a=!1;const i=e[r];l=i>o,null!=t&&void 0!==o?void 0!==i&&(s=i>=o&&i<t?"up":i<o&&i>=t?"down":"normal",a="number"==typeof t&&t-1===i&&"inside"===n):null===t&&void 0!==o?s=void 0!==i&&i>=o?"up":"normal":null!=t&&void 0===o?void 0!==i&&(s=i<t?"normal":"down"):null===t&&(s="normal")}return{displacement:s,isNesting:a,isAfterDraggedBlocks:l}}({blockIndexes:w,blockDropTargetIndex:_,blockDropPosition:v,clientId:h,firstDraggedBlockIndex:x,isDragged:m}),{itemInView:T}=u,B=T(j),R=n+1,N=a.length>0?`${a}_${R}`:`${R}`,D=!!f?.length,M=D&&p?null!==(c=k[h])&&void 0!==c?c:d:void 0,P=((e,t)=>Array.isArray(t)&&t.length?-1!==t.indexOf(e):t===e)(h,i),O=l||P&&D,L=m||B||P&&h===i[0];return(0,Td.jsxs)(KU.Ay,{value:!P,children:[L&&(0,Td.jsx)(pX,{block:t,selectBlock:r,isSelected:P,isBranchSelected:O,isDragged:m,level:s,position:R,rowCount:I,siblingBlockCount:E,showBlockMovers:o,path:N,isExpanded:!m&&M,listPosition:j,selectedClientIds:i,isSyncedBranch:b,displacement:g,isAfterDraggedBlocks:y,isNesting:S}),!L&&(0,Td.jsx)("tr",{children:(0,Td.jsx)("td",{className:"block-editor-list-view-placeholder"})}),D&&M&&!m&&(0,Td.jsx)(e,{parentId:h,blocks:f,selectBlock:r,showBlockMovers:o,level:s+1,path:N,listPosition:j+1,fixedListWindow:u,isBranchSelected:O,selectedClientIds:i,isExpanded:d,isSyncedBranch:b})]},h)})),S&&(0,Td.jsx)(DJ,{level:s,setSize:I,positionInSet:I,isExpanded:!0,children:(0,Td.jsx)(zJ,{children:e=>(0,Td.jsx)(WJ,{clientId:h,nestingLevel:s,blockCount:E,...e})})})]})}));function yX({draggedBlockClientId:e,listViewRef:t,blockDropTarget:n}){const r=BL(e),o=UJ({clientId:e,context:"list-view"}),{rootClientId:i,clientId:s,dropPosition:a}=n||{},[l,c]=(0,S.useMemo)((()=>t.current?[i?t.current.querySelector(`[data-block="${i}"]`):void 0,s?t.current.querySelector(`[data-block="${s}"]`):void 0]:[]),[t,i,s]),u=c||l,d=(0,H.isRTL)(),h=(0,S.useCallback)(((e,t)=>{if(!u)return 0;let n=u.offsetWidth;const r=(0,LW.A)(u,"horizontal"),o=u.ownerDocument,i=r===o.body||r===o.documentElement;if(r&&!i){const o=r.getBoundingClientRect(),i=(0,H.isRTL)()?o.right-e.right:e.left-o.left,s=r.clientWidth;if(s<n+i&&(n=s-i),!d&&e.left+t<o.left)return n-=o.left-e.left,n;if(d&&e.right-t>o.right)return n-=e.right-o.right,n}return n-t}),[d,u]),p=(0,S.useMemo)((()=>{if(!u)return{};const e=u.getBoundingClientRect();return{width:h(e,0)}}),[h,u]),f=(0,S.useMemo)((()=>{if(!u)return{};const e=(0,LW.A)(u),t=u.ownerDocument,n=e===t.body||e===t.documentElement;if(e&&!n){const t=e.getBoundingClientRect(),n=u.getBoundingClientRect(),r=d?t.right-n.right:n.left-t.left;if(!d&&t.left>n.left)return{transform:`translateX( ${r}px )`};if(d&&t.right<n.right)return{transform:`translateX( ${-1*r}px )`}}return{}}),[d,u]),m=(0,S.useMemo)((()=>{if(!l)return 1;const e=parseInt(l.getAttribute("aria-level"),10);return e?e+1:1}),[l]),g=(0,S.useMemo)((()=>!!u&&u.classList.contains("is-branch-selected")),[u]),b=(0,S.useMemo)((()=>{if(u&&("top"===a||"bottom"===a||"inside"===a))return{contextElement:u,getBoundingClientRect(){const e=u.getBoundingClientRect();let t=e.left,n=0;const r=(0,LW.A)(u,"horizontal"),o=u.ownerDocument,i=r===o.body||r===o.documentElement;if(r&&!i){const e=r.getBoundingClientRect(),n=d?r.offsetWidth-r.clientWidth:0;t<e.left+n&&(t=e.left+n)}n="top"===a?e.top-2*e.height:e.top;const s=h(e,0),l=e.height;return new window.DOMRect(t,n,s,l)}}}),[u,a,h,d]);return u?(0,Td.jsx)(KC.Ay,{animate:!1,anchor:b,focusOnMount:!1,className:"block-editor-list-view-drop-indicator--preview",variant:"unstyled",flip:!1,resize:!0,children:(0,Td.jsx)("div",{style:p,className:(0,$v.A)("block-editor-list-view-drop-indicator__line",{"block-editor-list-view-drop-indicator__line--darker":g}),children:(0,Td.jsxs)("div",{className:"block-editor-list-view-leaf","aria-level":m,children:[(0,Td.jsxs)("div",{className:(0,$v.A)("block-editor-list-view-block-select-button","block-editor-list-view-block-contents"),style:f,children:[(0,Td.jsx)(sX,{onClick:()=>{}}),(0,Td.jsx)(pz,{icon:r?.icon,showColors:!0,context:"list-view"}),(0,Td.jsx)(tA.A,{alignment:"center",className:"block-editor-list-view-block-select-button__label-wrapper",justify:"flex-start",spacing:1,children:(0,Td.jsx)("span",{className:"block-editor-list-view-block-select-button__title",children:(0,Td.jsx)(WA.A,{ellipsizeMode:"auto",children:o})})})]}),(0,Td.jsx)("div",{className:"block-editor-list-view-block__menu-cell"})]})})}):null}const vX=24;function _X(e,t){const n=e[t+1];return n&&n.isDraggedBlock?_X(e,t+1):n}const xX=["top","bottom"];function wX(e,t,n=!1){let r,o,i,s,a;for(let n=0;n<e.length;n++){const l=e[n];if(l.isDraggedBlock)continue;const c=l.element.getBoundingClientRect(),[u,d]=hJ(t,c,xX),h=pJ(t,c);if(void 0===i||u<i||h){i=u;const t=e.indexOf(l),n=e[t-1];if("top"===d&&n&&n.rootClientId===l.rootClientId&&!n.isDraggedBlock?(o=n,r="bottom",s=n.element.getBoundingClientRect(),a=t-1):(o=l,r=d,s=c,a=t),h)break}}if(!o)return;const l=function(e,t){const n=[];let r=e;for(;r;)n.push({...r}),r=t.find((e=>e.clientId===r.rootClientId));return n}(o,e),c="bottom"===r;if(c&&o.canInsertDraggedBlocksAsChild&&(o.innerBlockCount>0&&o.isExpanded||function(e,t,n=1,r=!1){const o=r?t.right-n*vX:t.left+n*vX;return(r?e.x<o-vX:e.x>o+vX)&&e.y<t.bottom}(t,s,l.length,n))){const e=o.isExpanded?0:o.innerBlockCount||0;return{rootClientId:o.clientId,clientId:o.clientId,blockIndex:e,dropPosition:"inside"}}if(c&&o.rootClientId&&function(e,t,n=1,r=!1){const o=r?t.right-n*vX:t.left+n*vX;return r?e.x>o:e.x<o}(t,s,l.length,n)){const i=_X(e,a),c=o.nestingLevel,u=i?i.nestingLevel:1;if(c&&u){const d=function(e,t,n=1,r=!1){const o=r?t.right-n*vX:t.left+n*vX,i=r?o-e.x:e.x-o,s=Math.round(i/vX);return Math.abs(s)}(t,s,l.length,n),h=Math.max(Math.min(d,c-u),0);if(l[h]){let t=o.blockIndex;if(l[h].nestingLevel===i?.nestingLevel)t=i?.blockIndex;else for(let n=a;n>=0;n--){const r=e[n];if(r.rootClientId===l[h].rootClientId){t=r.blockIndex+1;break}}return{rootClientId:l[h].rootClientId,clientId:o.clientId,blockIndex:t,dropPosition:r}}}}if(!o.canInsertDraggedBlocksAsSibling)return;const u=c?1:0;return{rootClientId:o.rootClientId,clientId:o.clientId,blockIndex:o.blockIndex+u,dropPosition:r}}const kX={leading:!1,trailing:!0},CX="__experimentalBorder",SX="color",AX="typography.__experimentalFontFamily",EX="typography.fontSize",IX="typography.textAlign",jX=["shadow","typography.lineHeight",EX,"typography.__experimentalFontStyle","typography.__experimentalFontWeight",AX,IX,"typography.textColumns","typography.__experimentalTextDecoration","typography.__experimentalTextTransform","typography.__experimentalWritingMode","typography.__experimentalLetterSpacing",CX,SX,"spacing"],TX={align:e=>Ic(e,"align"),borderColor:e=>function(e,t="any"){if("web"!==Lh.A.OS)return!1;const n=Ec(e,CX);return!0===n||("any"===t?!!(n?.color||n?.radius||n?.width||n?.style):!!n?.[t])}(e,"color"),backgroundColor:e=>{const t=Ec(e,SX);return t&&!1!==t.background},textAlign:e=>Ic(e,IX),textColor:e=>{const t=Ec(e,SX);return t&&!1!==t.text},gradient:e=>{const t=Ec(e,SX);return null!==t&&"object"==typeof t&&!!t.gradients},className:e=>Ic(e,"customClassName",!0),fontFamily:e=>Ic(e,AX),fontSize:e=>Ic(e,EX),layout:e=>Ic(e,"layout"),style:e=>jX.some((t=>Ic(e,t)))};function BX(e,t){return Object.entries(TX).reduce(((n,[r,o])=>(o(e.name)&&o(t.name)&&(n[r]=e.attributes[r]),n)),{})}function RX(e,t,n){for(let r=0;r<Math.min(t.length,e.length);r+=1)n(e[r].clientId,BX(t[r],e[r])),RX(e[r].innerBlocks,t[r].innerBlocks,n)}function NX({clientIds:e,children:t,__experimentalUpdateSelection:n}){const{getDefaultBlockName:r,getGroupingBlockName:o}=(0,Ul.A)(ed),i=(0,Ul.A)((t=>{const{canInsertBlockType:n,getBlockRootClientId:o,getBlocksByClientId:i,getDirectInsertBlock:s,canMoveBlocks:a,canRemoveBlocks:l,getBlockEditingMode:c}=t(hv),u=i(e),d=o(e[0]),h=c(d),p=n(r(),d),f=d?s(d):null;return{canMove:a(e,d),canRemove:l(e,d),canInsertBlock:(p||!!f)&&"default"===h,canCopyStyles:u.every((e=>!!e&&(Ic(e.name,"color")||Ic(e.name,"typography")))),canDuplicate:u.every((e=>!!e&&Ic(e.name,"multiple",!0)&&n(e.name,d)))}}),[e,r]),{getBlocksByClientId:s,getBlocks:a}=(0,Ul.A)(hv),{canMove:l,canRemove:c,canInsertBlock:u,canCopyStyles:d,canDuplicate:h}=i,{removeBlocks:p,replaceBlocks:f,duplicateBlocks:m,insertAfterBlock:g,insertBeforeBlock:b,flashBlock:y,setBlockMovingClientId:v,setNavigationMode:_,selectBlock:x}=(0,Vl.A)(hv),w=nq(),k=function(){const e=(0,Hp.A)(),{updateBlockAttributes:t}=(0,Vl.A)(hv),{createSuccessNotice:n,createWarningNotice:r,createErrorNotice:o}=(0,Vl.A)(Xb.store);return(0,S.useCallback)((async i=>{let s="";try{if(!window.navigator.clipboard)return void o((0,H.__)("Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers."),{type:"snackbar"});s=await window.navigator.clipboard.readText()}catch(e){return void o((0,H.__)("Unable to paste styles. Please allow browser clipboard permissions before continuing."),{type:"snackbar"})}if(!s||!function(e){try{const t=Oh(e,{__unstableSkipMigrationLogs:!0,__unstableSkipAutop:!0});return 1!==t.length||"core/freeform"!==t[0].name}catch(e){return!1}}(s))return void r((0,H.__)("Unable to paste styles. Block styles couldn't be found within the copied content."),{type:"snackbar"});const a=Oh(s);if(1===a.length?e.batch((()=>{RX(i,i.map((()=>a[0])),t)})):e.batch((()=>{RX(i,a,t)})),1===i.length){const e=Sc(i[0].name)?.title;n((0,H.sprintf)((0,H.__)("Pasted styles to %s."),e),{type:"snackbar"})}else n((0,H.sprintf)((0,H.__)("Pasted styles to %d blocks."),i.length),{type:"snackbar"})}),[e.batch,t,n,r,o])}();return t({canCopyStyles:d,canDuplicate:h,canInsertBlock:u,canMove:l,canRemove:c,onDuplicate:()=>m(e,n),onRemove:()=>p(e,n),onInsertBefore(){b(e[0])},onInsertAfter(){g(e[e.length-1])},onMoveTo(){_(!0),x(e[0]),v(e[0])},onGroup(){if(!e.length)return;const t=o(),n=dd(s(e),t);n&&f(e,n)},onUngroup(){if(!e.length)return;const t=a(e[0]);t.length&&f(e,t)},onCopy(){1===e.length&&y(e[0]),w("copy",e)},async onPasteStyles(){await k(s(e))}})}const DX=function({clientId:e}){const t=(0,Ul.A)((t=>t(hv).getBlock(e)),[e]),{replaceBlocks:n}=(0,Vl.A)(hv);return t&&"core/html"===t.name?(0,Td.jsx)(k_.A,{onClick:()=>n(e,hp({HTML:Ld(t)})),children:(0,H.__)("Convert to Blocks")}):null},{Fill:MX,Slot:PX}=(0,Hl.QJ)("__unstableBlockSettingsMenuFirstItem");MX.Slot=PX;const OX=MX,{clearTimeout:LX,setTimeout:FX}=window,zX=200;function UX({ref:e,isFocused:t,highlightParent:n,debounceTimeout:r=zX}){const{getSelectedBlockClientId:o,getBlockRootClientId:i}=(0,Ul.A)(hv),{toggleBlockHighlight:s}=(0,Vl.A)(hv),a=(0,S.useRef)(),l=(0,Ul.A)((e=>e(hv).getSettings().isDistractionFree),[]),c=e=>{if(e&&l)return;const t=o(),r=n?i(t):t;s(r,e)},u=()=>{const e=a.current;e&&LX&&LX(e)};return(0,S.useEffect)((()=>()=>{c(!1),u()}),[]),{debouncedShowGestures:e=>{e&&e.stopPropagation(),u(),c(!0)},debouncedHideGestures:n=>{n&&n.stopPropagation(),u(),a.current=FX((()=>{(()=>{const n=e?.current&&e.current.matches(":hover");return!t&&!n})()&&c(!1)}),r)}}}function VX({ref:e,highlightParent:t=!1,debounceTimeout:n=zX}){const[r,o]=(0,S.useState)(!1),{debouncedShowGestures:i,debouncedHideGestures:s}=UX({ref:e,debounceTimeout:n,isFocused:r,highlightParent:t}),a=(0,S.useRef)(!1),l=()=>e?.current&&e.current.contains(e.current.ownerDocument.activeElement);return(0,S.useEffect)((()=>{const t=e.current,n=()=>{l()&&(o(!0),i())},r=()=>{l()||(o(!1),s())};return t&&!a.current&&(t.addEventListener("focus",n,!0),t.addEventListener("blur",r,!0),a.current=!0),()=>{t&&(t.removeEventListener("focus",n),t.removeEventListener("blur",r))}}),[e,a,o,i,s]),{onMouseMove:i,onMouseLeave:s}}function HX({parentClientId:e,parentBlockType:t}){const n=(0,YU.A)("medium","<"),{selectBlock:r}=(0,Vl.A)(hv),o=(0,S.useRef)(),i=VX({ref:o,highlightParent:!0});return n?(0,Td.jsx)(k_.A,{...i,ref:o,icon:(0,Td.jsx)(pz,{icon:t.icon}),onClick:()=>r(e),children:(0,H.sprintf)((0,H.__)("Select parent block (%s)"),t.title)}):null}const $X={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"};function WX({clientIds:e,onCopy:t,label:n,shortcut:r}){const{getBlocksByClientId:o}=(0,Ul.A)(hv),i=(0,YI.A)((()=>zd(o(e))),t),s=n||(0,H.__)("Copy");return(0,Td.jsx)(k_.A,{ref:i,shortcut:r,children:s})}function GX({block:e,clientIds:t,children:n,__experimentalSelectBlock:r,...o}){const i=e?.clientId,s=t.length,a=t[0],{firstParentClientId:l,onlyBlock:c,parentBlockType:u,previousBlockClientId:d,selectedBlockClientIds:h,openedBlockSettingsMenu:p,isContentOnly:f}=(0,Ul.A)((e=>{const{getBlockCount:t,getBlockName:n,getBlockRootClientId:r,getPreviousBlockClientId:o,getSelectedBlockClientIds:i,getBlockAttributes:s,getOpenedBlockSettingsMenu:l,getBlockEditingMode:c}=Cf(e(hv)),{getActiveBlockVariation:u}=e(ed),d=r(a),h=d&&n(d);return{firstParentClientId:d,onlyBlock:1===t(d),parentBlockType:d&&(u(h,s(d))||Sc(h)),previousBlockClientId:o(a),selectedBlockClientIds:i(),openedBlockSettingsMenu:l(),isContentOnly:"contentOnly"===c(a)}}),[a]),{getBlockOrder:m,getSelectedBlockClientIds:g}=(0,Ul.A)(hv),{setOpenedBlockSettingsMenu:b}=Cf((0,Vl.A)(hv)),y=(0,Ul.A)((e=>{const{getShortcutRepresentation:t}=e(OU.M_);return{duplicate:t("core/block-editor/duplicate"),remove:t("core/block-editor/remove"),insertAfter:t("core/block-editor/insert-after"),insertBefore:t("core/block-editor/insert-before")}}),[]),v=h.length>0;async function _(e){if(!r)return;const t=await e;t&&t[0]&&r(t[0],!1)}function x(){if(!r)return;let e=d||l;e||(e=m()[0]);const t=v&&0===g().length;r(e,t)}const w=h?.includes(l),k=i?p===i||!1:void 0;function C(e){e&&p!==i?b(i):!e&&p&&p===i&&b(void 0)}return(0,Td.jsx)(NX,{clientIds:t,__experimentalUpdateSelection:!r,children:({canCopyStyles:e,canDuplicate:r,canInsertBlock:i,canMove:d,canRemove:h,onDuplicate:p,onInsertAfter:m,onInsertBefore:g,onRemove:b,onCopy:v,onPasteStyles:A,onMoveTo:E})=>(0,Td.jsx)(i_.A,{icon:eA.A,label:(0,H.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:$X,open:k,onToggle:C,noIcons:!0,...o,children:({onClose:o})=>(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsxs)(w_.A,{children:[(0,Td.jsx)(OX.Slot,{fillProps:{onClose:o}}),!w&&!!l&&(0,Td.jsx)(HX,{parentClientId:l,parentBlockType:u}),1===s&&(0,Td.jsx)(DX,{clientId:a}),!f&&(0,Td.jsx)(WX,{clientIds:t,onCopy:v,shortcut:VE.displayShortcut.primary("c")}),r&&(0,Td.jsx)(k_.A,{onClick:(0,ef.h)(o,p,_),shortcut:y.duplicate,children:(0,H.__)("Duplicate")}),i&&(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(k_.A,{onClick:(0,ef.h)(o,g),shortcut:y.insertBefore,children:(0,H.__)("Add before")}),(0,Td.jsx)(k_.A,{onClick:(0,ef.h)(o,m),shortcut:y.insertAfter,children:(0,H.__)("Add after")})]})]}),e&&!f&&(0,Td.jsxs)(w_.A,{children:[(0,Td.jsx)(WX,{clientIds:t,onCopy:v,label:(0,H.__)("Copy styles")}),(0,Td.jsx)(k_.A,{onClick:A,children:(0,H.__)("Paste styles")})]}),(0,Td.jsx)(cz.Slot,{fillProps:{onClose:o,canMove:d,onMoveTo:E,onlyBlock:c,count:s,firstBlockClientId:a},clientIds:t}),"function"==typeof n?n({onClose:o}):S.Children.map((e=>(0,S.cloneElement)(e,{onClose:o}))),h&&(0,Td.jsx)(w_.A,{children:(0,Td.jsx)(k_.A,{onClick:(0,ef.h)(o,b,x),shortcut:y.remove,children:(0,H.__)("Delete")})})]})})})}const qX=GX;const KX=(e,t)=>"clear"===t.type?{}:Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e,YX=(0,S.forwardRef)((function e({id:t,blocks:n,dropZoneElement:r,showBlockMovers:o=!1,isExpanded:i=!1,showAppender:s=!1,blockSettingsMenu:a=GX,rootClientId:l,description:c,onSelect:u,additionalBlockContent:d},h){n&&(0,q.default)("`blocks` property in `wp.blockEditor.__experimentalListView`",{since:"6.3",alternative:"`rootClientId` property"});const p=(0,z_.A)(e),{clientIdsTree:f,draggedClientIds:m,selectedClientIds:g}=function({blocks:e,rootClientId:t}){return(0,Ul.A)((n=>{const{getDraggedBlockClientIds:r,getSelectedBlockClientIds:o,getEnabledClientIdsTree:i}=Cf(n(hv));return{selectedClientIds:o(),draggedClientIds:r(),clientIdsTree:null!=e?e:i(t)}}),[e,t])}({blocks:n,rootClientId:l}),b=function(e){const t=(0,S.useMemo)((()=>{const t={};let n=0;const r=e=>{e.forEach((e=>{t[e.clientId]=n,n++,e.innerBlocks.length>0&&r(e.innerBlocks)}))};return r(e),t}),[e]);return t}(f),{getBlock:y}=(0,Ul.A)(hv),{visibleBlockCount:v,shouldShowInnerBlocks:_}=(0,Ul.A)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n,__unstableGetEditorMode:r}=e(hv),o=m?.length>0?n(m).length+1:0;return{visibleBlockCount:t()-o,shouldShowInnerBlocks:"zoom-out"!==r()}}),[m]),{updateBlockSelection:x}=function(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,Vl.A)(hv),{getBlockName:r,getBlockParents:o,getBlockSelectionStart:i,getSelectedBlockClientIds:s,hasMultiSelection:a,hasSelectedBlock:l}=(0,Ul.A)(hv),{getBlockType:c}=(0,Ul.A)(ed),u=(0,S.useCallback)((async(u,d,h,p)=>{if(!u?.shiftKey&&u?.keyCode!==VE.ESCAPE)return void n(d,p);u.preventDefault();const f="keydown"===u.type&&u.keyCode===VE.ESCAPE,m="keydown"===u.type&&(u.keyCode===VE.UP||u.keyCode===VE.DOWN||u.keyCode===VE.HOME||u.keyCode===VE.END);if(!m&&!l()&&!a())return void n(d,null);const g=s(),b=[...o(d),d];if((f||m&&!g.some((e=>b.includes(e))))&&await e(),!f){let e=i(),n=d;m&&(l()||a()||(e=d),h&&(n=h));const r=o(e),s=o(n),{start:c,end:u}=function(e,t,n,r){const o=[...n,e],i=[...r,t],s=Math.min(o.length,i.length)-1;return{start:o[s],end:i[s]}}(e,n,r,s);await t(c,u,null)}const y=s();if((u.keyCode===VE.HOME||u.keyCode===VE.END)&&y.length>1)return;const v=g.filter((e=>!y.includes(e)));let _;if(1===v.length){const e=c(r(v[0]))?.title;e&&(_=(0,H.sprintf)((0,H.__)("%s deselected."),e))}else v.length>1&&(_=(0,H.sprintf)((0,H.__)("%s blocks deselected."),v.length));_&&(0,Jb.speak)(_,"assertive")}),[e,r,c,o,i,s,a,l,t,n]);return{updateBlockSelection:u}}(),[w,k]=(0,S.useReducer)(KX,{}),[C,A]=(0,S.useState)(null),{setSelectedTreeId:E}=function({firstSelectedBlockClientId:e,setExpandedState:t}){const[n,r]=(0,S.useState)(null),{selectedBlockParentClientIds:o}=(0,Ul.A)((t=>{const{getBlockParents:n}=t(hv);return{selectedBlockParentClientIds:n(e,!1)}}),[e]);return(0,S.useEffect)((()=>{n!==e&&o?.length&&t({type:"expand",clientIds:o})}),[e,o,n,t]),{setSelectedTreeId:r}}({firstSelectedBlockClientId:g[0],setExpandedState:k}),I=(0,S.useCallback)(((e,t,n)=>{x(e,t,null,n),E(t),u&&u(y(t))}),[E,x,u,y]),{ref:j,target:T}=function({dropZoneElement:e,expandedState:t,setExpandedState:n}){const{getBlockRootClientId:r,getBlockIndex:o,getBlockCount:i,getDraggedBlockClientIds:s,canInsertBlocks:a}=(0,Ul.A)(hv),[l,c]=(0,S.useState)(),{rootClientId:u,blockIndex:d}=l||{},h=dJ(u,d),p=(0,H.isRTL)(),f=(0,gx.A)(u),m=(0,S.useCallback)(((e,t)=>{const{rootClientId:r}=t||{};r&&("inside"!==t?.dropPosition||e[r]||n({type:"expand",clientIds:[r]}))}),[n]),g=(0,uJ.A)(m,500,kX);(0,S.useEffect)((()=>{"inside"===l?.dropPosition&&f===l?.rootClientId?g(t,l):g.cancel()}),[t,f,l,g]);const b=s(),y=(0,uJ.A)((0,S.useCallback)(((e,t)=>{const n={x:e.clientX,y:e.clientY},s=!!b?.length,l=wX(Array.from(t.querySelectorAll("[data-block]")).map((e=>{const t=e.dataset.block,n="true"===e.dataset.expanded,l=e.classList.contains("is-dragging"),c=parseInt(e.getAttribute("aria-level"),10),u=r(t);return{clientId:t,isExpanded:n,rootClientId:u,blockIndex:o(t),element:e,nestingLevel:c||void 0,isDraggedBlock:!!s&&l,innerBlockCount:i(t),canInsertDraggedBlocksAsSibling:!s||a(b,u),canInsertDraggedBlocksAsChild:!s||a(b,t)}})),n,p);l&&c(l)}),[a,b,i,o,r,p]),50);return{ref:(0,ZA.A)({dropZoneElement:e,onDrop(e){y.cancel(),l&&h(e),c(void 0)},onDragLeave(){y.cancel(),c(null)},onDragOver(e){y(e,e.currentTarget)},onDragEnd(){y.cancel(),c(void 0)}}),target:l}}({dropZoneElement:r,expandedState:w,setExpandedState:k}),B=(0,S.useRef)(),R=function({selectBlock:e}){const t=(0,Hp.A)(),{getBlockOrder:n,getBlockRootClientId:r,getBlocksByClientId:o,getPreviousBlockClientId:i,getSelectedBlockClientIds:s,getSettings:a,canInsertBlockType:l,canRemoveBlocks:c}=(0,Ul.A)(hv),{flashBlock:u,removeBlocks:d,replaceBlocks:h,insertBlocks:p}=(0,Vl.A)(hv),f=nq();return(0,UC.A)((m=>{function g(t,n){n&&e(void 0,t,null,null),hX(t,m)}function b(e){if(e.defaultPrevented)return;if(!m.contains(e.target.ownerDocument.activeElement))return;const b=e.target.ownerDocument.activeElement?.closest("[role=row]"),y=b?.dataset?.block;if(!y)return;const{blocksToUpdate:v,firstBlockClientId:_,firstBlockRootClientId:x,originallySelectedBlockClientIds:w}=function(e){const t=s(),n=t.includes(e),o=n?t[0]:e;return{blocksToUpdate:n?t:[e],firstBlockClientId:o,firstBlockRootClientId:r(o),originallySelectedBlockClientIds:t}}(y);if(0!==v.length)if(e.preventDefault(),("copy"===e.type||"cut"===e.type)&&(1===v.length&&u(v[0]),f(e.type,v),iq(e,o(v),t)),"cut"===e.type){var k;if(!c(v,x))return;let e=null!==(k=i(_))&&void 0!==k?k:x;d(v,!1);const t=w.length>0&&0===s().length;e||(e=n()[0]),g(e,t)}else if("paste"===e.type){const{__experimentalCanUserUseUnfilteredHTML:t}=a(),n=function(e,t){const{plainText:n,html:r,files:o}=rq(e);let i=[];if(o.length){const e=cd("from");i=o.reduce(((t,n)=>{const r=ld(e,(e=>"files"===e.type&&e.isMatch([n])));return r&&t.push(r.transform([n])),t}),[]).flat()}else i=Pp({HTML:r,plainText:n,mode:"BLOCKS",canUserUseUnfilteredHTML:t});return i}(e,t);if(1===v.length){const[e]=v;if(n.every((t=>l(t.name,e))))return p(n,void 0,e),void g(n[0]?.clientId,!1)}h(v,n,n.length-1,-1),g(n[0]?.clientId,!1)}}return m.ownerDocument.addEventListener("copy",b),m.ownerDocument.addEventListener("cut",b),m.ownerDocument.addEventListener("paste",b),()=>{m.ownerDocument.removeEventListener("copy",b),m.ownerDocument.removeEventListener("cut",b),m.ownerDocument.removeEventListener("paste",b)}}),[])}({selectBlock:I}),N=(0,eC.A)([R,B,j,h]);(0,S.useEffect)((()=>{g?.length&&hX(g[0],B?.current)}),[]);const D=(0,S.useCallback)((e=>{if(!e)return;const t=Array.isArray(e)?e:[e];k({type:"expand",clientIds:t})}),[k]),M=(0,S.useCallback)((e=>{e&&k({type:"collapse",clientIds:[e]})}),[k]),P=(0,S.useCallback)((()=>{k({type:"clear"})}),[k]),O=(0,S.useCallback)((e=>{D(e?.dataset?.block)}),[D]),L=(0,S.useCallback)((e=>{M(e?.dataset?.block)}),[M]),F=(0,S.useCallback)(((e,t,n)=>{e.shiftKey&&x(e,t?.dataset?.block,n?.dataset?.block)}),[x]);!function({collapseAll:e,expand:t}){const{expandedBlock:n,getBlockParents:r}=(0,Ul.A)((e=>{const{getBlockParents:t,getExpandedBlock:n}=Cf(e(hv));return{expandedBlock:n(),getBlockParents:t}}),[]);(0,S.useEffect)((()=>{if(n){const o=r(n,!1);e(),t(o)}}),[e,t,n,r])}({collapseAll:P,expand:D});const z=m?.[0],{blockDropTargetIndex:U,blockDropPosition:V,firstDraggedBlockIndex:$}=(0,S.useMemo)((()=>{let e,t;if(T?.clientId){const t=b[T.clientId];e=void 0===t||"top"===T?.dropPosition?t:t+1}else null===T&&(e=null);if(z){const e=b[z];t=void 0===e||"top"===T?.dropPosition?e:e+1}return{blockDropTargetIndex:e,blockDropPosition:T?.dropPosition,firstDraggedBlockIndex:t}}),[T,b,z]),W=(0,S.useMemo)((()=>({blockDropPosition:V,blockDropTargetIndex:U,blockIndexes:b,draggedClientIds:m,expandedState:w,expand:D,firstDraggedBlockIndex:$,collapse:M,collapseAll:P,BlockSettingsMenu:a,listViewInstanceId:p,AdditionalBlockContent:d,insertedBlock:C,setInsertedBlock:A,treeGridElementRef:B,rootClientId:l})),[V,U,b,m,w,D,$,M,P,a,p,d,C,A,l]),[G]=(0,AJ.A)(B,32,v,{expandedState:w,useWindowing:!0,windowOverscan:40});if(!f.length&&!s)return null;const K=c&&`block-editor-list-view-description-${p}`;return(0,Td.jsxs)(KU.Ay,{value:!0,children:[(0,Td.jsx)(yX,{draggedBlockClientId:z,listViewRef:B,blockDropTarget:T}),c&&(0,Td.jsx)(GA.A,{id:K,children:c}),(0,Td.jsx)(RJ,{id:t,className:(0,$v.A)("block-editor-list-view-tree",{"is-dragging":m?.length>0&&void 0!==U}),"aria-label":(0,H.__)("Block navigation structure"),ref:N,onCollapseRow:L,onExpandRow:O,onFocusRow:F,applicationAriaLabel:(0,H.__)("Block navigation structure"),"aria-describedby":K,style:{"--wp-admin--list-view-dragged-items-height":m?.length?32*(m.length-1)+"px":null},children:(0,Td.jsx)(VJ.Provider,{value:W,children:(0,Td.jsx)(bX,{blocks:f,parentId:l,selectBlock:I,showBlockMovers:o,fixedListWindow:G,selectedClientIds:g,isExpanded:i,shouldShowInnerBlocks:_,showAppender:s})})})]})})),JX=(0,S.forwardRef)(((e,t)=>(0,Td.jsx)(YX,{ref:t,...e,showAppender:!1,rootClientId:null,onSelect:null,additionalBlockContent:null,blockSettingsMenu:void 0})));function XX({url:e,urlLabel:t,className:n}){const r=(0,$v.A)(n,"block-editor-url-popover__link-viewer-url");return e?(0,Td.jsx)(KI.A,{className:r,href:e,children:t||(0,kI.r)((0,xI.S)(e))}):(0,Td.jsx)("span",{className:r})}const{__experimentalPopoverLegacyPositionToPlacement:ZX}=Cf(d_.j),QX=(0,S.forwardRef)((({additionalControls:e,children:t,renderSettings:n,placement:r,focusOnMount:o="firstElement",position:i,...s},a)=>{let l;void 0!==i&&(0,q.default)("`position` prop in wp.blockEditor.URLPopover",{since:"6.2",alternative:"`placement` prop"}),void 0!==r?l=r:void 0!==i&&(l=ZX(i)),l=l||"bottom";const[c,u]=(0,S.useState)(!1),d=!!n&&c;return(0,Td.jsxs)(KC.Ay,{ref:a,className:"block-editor-url-popover",focusOnMount:o,placement:l,shift:!0,variant:"toolbar",...s,children:[(0,Td.jsx)("div",{className:"block-editor-url-popover__input-container",children:(0,Td.jsxs)("div",{className:"block-editor-url-popover__row",children:[t,!!n&&(0,Td.jsx)(Zv.Ay,{className:"block-editor-url-popover__settings-toggle",icon:JJ.A,label:(0,H.__)("Link settings"),onClick:()=>{u(!c)},"aria-expanded":c,size:"compact"})]})}),d&&(0,Td.jsx)("div",{className:"block-editor-url-popover__settings",children:n()}),e&&!d&&(0,Td.jsx)("div",{className:"block-editor-url-popover__additional-controls",children:e})]})}));QX.LinkEditor=function({autocompleteRef:e,className:t,onChangeInputValue:n,value:r,...o}){return(0,Td.jsxs)("form",{className:(0,$v.A)("block-editor-url-popover__link-editor",t),...o,children:[(0,Td.jsx)(cI,{__nextHasNoMarginBottom:!0,value:r,onChange:n,autocompleteRef:e}),(0,Td.jsx)(Zv.Ay,{icon:ZE.A,label:(0,H.__)("Apply"),type:"submit",size:"compact"})]})},QX.LinkViewer=function({className:e,linkClassName:t,onEditLinkClick:n,url:r,urlLabel:o,...i}){return(0,Td.jsxs)("div",{className:(0,$v.A)("block-editor-url-popover__link-viewer",e),...i,children:[(0,Td.jsx)(XX,{url:r,urlLabel:o,className:t}),n&&(0,Td.jsx)(Zv.Ay,{icon:XI.A,label:(0,H.__)("Edit"),onClick:n,size:"compact"})]})};const eZ=QX,tZ=()=>{},nZ=({src:e,onChange:t,onSubmit:n,onClose:r,popoverAnchor:o})=>(0,Td.jsx)(eZ,{anchor:o,onClose:r,children:(0,Td.jsxs)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:n,children:[(0,Td.jsx)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":(0,H.__)("URL"),placeholder:(0,H.__)("Paste or type URL"),onChange:t,value:e}),(0,Td.jsx)(Zv.Ay,{className:"block-editor-media-placeholder__url-input-submit-button",icon:ZE.A,label:(0,H.__)("Apply"),type:"submit"})]})}),rZ=({isURLInputVisible:e,src:t,onChangeSrc:n,onSubmitSrc:r,openURLInput:o,closeURLInput:i})=>{const[s,a]=(0,S.useState)(null);return(0,Td.jsxs)("div",{className:"block-editor-media-placeholder__url-input-container",ref:a,children:[(0,Td.jsx)(Zv.Ay,{className:"block-editor-media-placeholder__button",onClick:o,isPressed:e,variant:"secondary",children:(0,H.__)("Insert from URL")}),e&&(0,Td.jsx)(nZ,{src:t,onChange:n,onSubmit:r,onClose:i,popoverAnchor:s})]})},oZ=zE("editor.MediaPlaceholder")((function({value:e={},allowedTypes:t,className:n,icon:r,labels:o={},mediaPreview:i,notices:s,isAppender:a,accept:l,addToGallery:c,multiple:u=!1,handleUpload:d=!0,disableDropZone:h,disableMediaButtons:p,onError:f,onSelect:m,onCancel:g,onSelectURL:b,onToggleFeaturedImage:y,onDoubleClick:v,onFilesPreUpload:_=tZ,onHTMLDrop:x,children:w,mediaLibraryButton:k,placeholder:C,style:A}){x&&(0,q.default)("wp.blockEditor.MediaPlaceholder onHTMLDrop prop",{since:"6.2",version:"6.4"});const E=(0,Ul.A)((e=>{const{getSettings:t}=e(hv);return t().mediaUpload}),[]),[I,j]=(0,S.useState)(""),[T,B]=(0,S.useState)(!1);(0,S.useEffect)((()=>{var t;j(null!==(t=e?.src)&&void 0!==t?t:"")}),[e?.src]);const R=e=>{j(e.target.value)},N=()=>{B(!0)},D=()=>{B(!1)},M=e=>{e.preventDefault(),I&&b&&(b(I),D())},P=n=>{if(!d)return m(n);let r;if(_(n),u)if(c){let t=[];r=n=>{const r=(null!=e?e:[]).filter((e=>e.id?!t.some((({id:t})=>Number(t)===Number(e.id))):!t.some((({urlSlug:t})=>e.url.includes(t)))));m(r.concat(n)),t=n.map((e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else r=m;else r=([e])=>m(e);E({allowedTypes:t,filesList:n,onFileChange:r,onError:f})};async function O(e){const n=Pp({HTML:e});return await async function(e){if(!e||!Array.isArray(e))return;const n=function e(t){return t.flatMap((t=>"core/image"!==t.name&&"core/audio"!==t.name&&"core/video"!==t.name||!t.attributes.url?e(t.innerBlocks):[t]))}(e);if(!n.length)return;const r=await Promise.all(n.map((e=>e.attributes.id?e.attributes:new Promise(((n,r)=>{window.fetch(e.attributes.url).then((e=>e.blob())).then((o=>E({filesList:[o],additionalData:{title:e.attributes.title,alt_text:e.attributes.alt,caption:e.attributes.caption},onFileChange:([e])=>{e.id&&n(e)},allowedTypes:t,onError:r}))).catch((()=>n(e.attributes.url)))}))))).catch((e=>f(e)));m(u?r:r[0])}(n)}const L=e=>{P(e.target.files)},F=null!=C?C:e=>{let{instructions:l,title:c}=o;if(E||b||(l=(0,H.__)("To edit this block, you need permission to upload media.")),void 0===l||void 0===c){const e=null!=t?t:[],[n]=e,r=1===e.length,o=r&&"audio"===n,i=r&&"image"===n,s=r&&"video"===n;void 0===l&&E&&(l=(0,H.__)("Upload a media file or pick one from your media library."),o?l=(0,H.__)("Upload an audio file, pick one from your media library, or add one with a URL."):i?l=(0,H.__)("Upload an image file, pick one from your media library, or add one with a URL."):s&&(l=(0,H.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===c&&(c=(0,H.__)("Media"),o?c=(0,H.__)("Audio"):i?c=(0,H.__)("Image"):s&&(c=(0,H.__)("Video")))}const u=(0,$v.A)("block-editor-media-placeholder",n,{"is-appender":a});return(0,Td.jsxs)(zz,{icon:r,label:c,instructions:l,className:u,notices:s,onDoubleClick:v,preview:i,style:A,children:[e,w]})},z=()=>h?null:(0,Td.jsx)(rE,{onFilesDrop:P,onHTMLDrop:O}),U=()=>g&&(0,Td.jsx)(Zv.Ay,{className:"block-editor-media-placeholder__cancel-button",title:(0,H.__)("Cancel"),variant:"link",onClick:g,children:(0,H.__)("Cancel")}),V=()=>b&&(0,Td.jsx)(rZ,{isURLInputVisible:T,src:I,onChangeSrc:R,onSubmitSrc:M,openURLInput:N,closeURLInput:D}),$=()=>y&&(0,Td.jsx)("div",{className:"block-editor-media-placeholder__url-input-container",children:(0,Td.jsx)(Zv.Ay,{className:"block-editor-media-placeholder__button",onClick:y,variant:"secondary",children:(0,H.__)("Use featured image")})});return p?(0,Td.jsx)(GE,{children:z()}):(0,Td.jsx)(GE,{fallback:F(V()),children:(()=>{const n=null!=k?k:({open:e})=>(0,Td.jsx)(Zv.Ay,{variant:"secondary",onClick:()=>{e()},children:(0,H.__)("Media Library")}),r=(0,Td.jsx)(WE,{addToGallery:c,gallery:u&&!(!t||0===t.length)&&t.every((e=>"image"===e||e.startsWith("image/"))),multiple:u,onSelect:m,allowedTypes:t,mode:"browse",value:Array.isArray(e)?e.map((({id:e})=>e)):e.id,render:n});if(E&&a)return(0,Td.jsxs)(Td.Fragment,{children:[z(),(0,Td.jsx)(LE,{onChange:L,accept:l,multiple:!!u,render:({openFileDialog:e})=>{const t=(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(Zv.Ay,{variant:"primary",className:(0,$v.A)("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:e,children:(0,H.__)("Upload")}),r,V(),$(),U()]});return F(t)}})]});if(E){const e=(0,Td.jsxs)(Td.Fragment,{children:[z(),(0,Td.jsx)(LE,{variant:"primary",className:(0,$v.A)("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:L,accept:l,multiple:!!u,children:(0,H.__)("Upload")}),r,V(),$(),U()]});return F(e)}return F(r)})()})}));function iZ({items:e,onSelect:t,selectedIndex:n,instanceId:r,listBoxId:o,className:i,Component:s="div"}){return(0,Td.jsx)(s,{id:o,role:"listbox",className:"components-autocomplete__results",children:e.map(((e,o)=>(0,Td.jsx)(Zv.Ay,{id:`components-autocomplete-item-${r}-${e.key}`,role:"option","aria-selected":o===n,disabled:e.isDisabled,className:(0,$v.A)("components-autocomplete__result",i,{"is-selected":o===n}),onClick:()=>t(e),children:e.label},e.key)))})}function sZ(e){var t;const n=null!==(t=e.useItems)&&void 0!==t?t:function(e){return t=>{const[n,r]=(0,S.useState)([]);return(0,S.useLayoutEffect)((()=>{const{options:n,isDebounced:o}=e,i=(0,FE.s)((()=>{const o=Promise.resolve("function"==typeof n?n(t):n).then((n=>{if(o.canceled)return;const i=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,ok.Nt)(t),"i");r(function(e,t=[],n=10){const r=[];for(let o=0;o<t.length;o++){const i=t[o];let{keywords:s=[]}=i;"string"==typeof i.label&&(s=[...s,i.label]);const a=s.some((t=>e.test(Zc()(t))));if(a&&(r.push(i),r.length===n))break}return r}(s,i))}));return o}),o?250:0),s=i();return()=>{i.cancel(),s&&(s.canceled=!0)}}),[t]),[n]}}(e);return function({filterValue:e,instanceId:t,listBoxId:r,className:o,selectedIndex:i,onChangeOptions:s,onSelect:a,onReset:l,reset:c,contentRef:u}){const[d]=n(e),h=(0,$.useAnchor)({editableContentElement:u.current}),[p,f]=(0,S.useState)(!1),m=(0,S.useRef)(null),g=(0,eC.A)([m,(0,UC.A)((e=>{u.current&&f(e.ownerDocument!==u.current.ownerDocument)}),[u])]);var b,y;b=m,y=c,(0,S.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]);const v=(0,yT.A)(Jb.speak,500);return(0,S.useLayoutEffect)((()=>{s(d),function(t){v&&(t.length?v(e?(0,H.sprintf)((0,H._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",t.length),t.length):(0,H.sprintf)((0,H._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.",t.length),t.length),"assertive"):v((0,H.__)("No results."),"assertive"))}(d)}),[d]),0===d.length?null:(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(KC.Ay,{focusOnMount:!1,onClose:l,placement:"top-start",className:"components-autocomplete__popover",anchor:h,ref:g,children:(0,Td.jsx)(iZ,{items:d,onSelect:a,selectedIndex:i,instanceId:t,listBoxId:r,className:o})}),u.current&&p&&(0,kW.createPortal)((0,Td.jsx)(iZ,{items:d,onSelect:a,selectedIndex:i,instanceId:t,listBoxId:r,className:o,Component:GA.A}),u.current.ownerDocument.body)]})}}var aZ=n(76064);const lZ=e=>{if(null===e)return"";switch(typeof e){case"string":case"number":return e.toString();case"boolean":default:return"";case"object":if(e instanceof Array)return e.map(lZ).join("");if("props"in e)return lZ(e.props.children)}return""},cZ=[];function uZ({record:e,onChange:t,onReplace:n,completers:r,contentRef:o}){const i=(0,z_.A)(uZ),[s,a]=(0,S.useState)(0),[l,c]=(0,S.useState)(cZ),[u,d]=(0,S.useState)(""),[h,p]=(0,S.useState)(null),[f,m]=(0,S.useState)(null),g=(0,S.useRef)(!1);function b(r){const{getOptionCompletion:o}=h||{};if(!r.isDisabled){if(o){const s=o(r.value,u),a=null!==(i=s)&&"object"==typeof i&&"action"in i&&void 0!==i.action&&"value"in i&&void 0!==i.value?s:{action:"insert-at-caret",value:s};if("replace"===a.action)return void n([a.value]);"insert-at-caret"===a.action&&function(n){if(null===h)return;const r=e.start,o=r-h.triggerPrefix.length-u.length,i=(0,$.create)({html:(0,Ed.Ay)(n)});t((0,$.insert)(e,i,o,r))}(a.value)}y()}var i}function y(){a(0),c(cZ),d(""),p(null),m(null)}const v=(0,S.useMemo)((()=>(0,$.isCollapsed)(e)?(0,$.getTextContent)((0,$.slice)(e,0)):""),[e]);(0,S.useEffect)((()=>{if(!v)return void(h&&y());const t=r.reduce(((e,t)=>v.lastIndexOf(t.triggerPrefix)>(null!==e?v.lastIndexOf(e.triggerPrefix):-1)?t:e),null);if(!t)return void(h&&y());const{allowContext:n,triggerPrefix:o}=t,i=v.lastIndexOf(o),s=v.slice(i+o.length);if(s.length>50)return;const a=0===l.length,c=s.split(/\s/),u=1===c.length,b=g.current&&c.length<=3;if(a&&!b&&!u)return void(h&&y());const _=(0,$.getTextContent)((0,$.slice)(e,void 0,(0,$.getTextContent)(e).length));if(n&&!n(v.slice(0,i),_))return void(h&&y());if(/^\s/.test(s)||/\s\s+$/.test(s))return void(h&&y());if(!/[\u0000-\uFFFF]*$/.test(s))return void(h&&y());const x=(0,ok.Nt)(t.triggerPrefix),w=Zc()(v),k=w.slice(w.lastIndexOf(t.triggerPrefix)).match(new RegExp(`${x}([\0-￿]*)$`)),C=k&&k[1];p(t),m((()=>t!==h?sZ(t):f)),d(null===C?"":C)}),[v]);const{key:_=""}=l[s]||{},{className:x}=h||{},w=!!h&&l.length>0,k=w?`components-autocomplete-listbox-${i}`:void 0,C=w?`components-autocomplete-item-${i}-${_}`:null,A=void 0!==e.start;return{listBoxId:k,activeId:C,onKeyDown:(0,aZ.n)((function(e){if(g.current="Backspace"===e.key,h&&0!==l.length&&!e.defaultPrevented){switch(e.key){case"ArrowUp":{const e=(0===s?l.length:s)-1;a(e),(0,Dq.H)()&&(0,Jb.speak)(lZ(l[e].label),"assertive");break}case"ArrowDown":{const e=(s+1)%l.length;a(e),(0,Dq.H)()&&(0,Jb.speak)(lZ(l[e].label),"assertive");break}case"Escape":p(null),m(null),e.preventDefault();break;case"Enter":b(l[s]);break;case"ArrowLeft":case"ArrowRight":return void y();default:return}e.preventDefault()}})),popover:A&&f&&(0,Td.jsx)(f,{className:x,filterValue:u,instanceId:i,listBoxId:k,selectedIndex:s,onChangeOptions:function(e){a(e.length===l.length?s:0),c(e)},onSelect:b,value:e,contentRef:o,reset:y})}}const dZ=()=>{},hZ={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n,prioritizedBlocks:r}=(0,Ul.A)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockListSettings:r,getBlockRootClientId:o}=e(hv),i=t(),s=o(i);return{selectedBlockName:i?n(i):null,rootClientId:s,prioritizedBlocks:r(s)?.prioritizedInserterBlocks}}),[]),[o,i,s]=Jq(t,dZ),a=(0,S.useMemo)((()=>(e.trim()?RK(o,i,s,e):VY(Rf(o,"frecency","desc"),r)).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,i,s,r]),l=(0,S.useMemo)((()=>a.map((e=>{const{title:t,icon:n,isDisabled:r}=e;return{key:`block-${e.id}`,value:e,label:(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(pz,{icon:n,showColors:!0},"icon"),t]}),isDisabled:r}}))),[a]);return[l]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:r,syncStatus:o,content:i}=e;return{action:"replace",value:"unsynced"===o?Oh(i,{__unstableSkipMigrationLogs:!0}):td(t,n,nd(r))}}};var pZ=n(59304);const fZ={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await(0,E.default)({path:(0,G.F)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords:e=>[...e.title.split(/\s+/)],getOptionLabel:e=>(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(lk.A,{icon:"page"===e.subtype?fI.A:pZ.A},"icon"),e.title]}),getOptionCompletion:e=>(0,Td.jsx)("a",{href:e.url,children:e.title})},mZ=[];function gZ({completers:e=mZ}){const{name:t}=Qp();return(0,S.useMemo)((()=>{let n=[...e,fZ];return(t===Cc()||Ec(t,"__experimentalSlashInserter",!1))&&(n=[...n,hZ]),(0,Tu.hasFilter)("editor.Autocomplete.completers")&&(n===e&&(n=n.map((e=>({...e})))),n=(0,Tu.applyFilters)("editor.Autocomplete.completers",n,t)),n}),[e,t])}const bZ={placement:"bottom-start"},yZ=()=>(0,Td.jsxs)(Td.Fragment,{children:[["bold","italic","link","unknown"].map((e=>(0,Td.jsx)(Hl.DX,{name:`RichText.ToolbarControls.${e}`},e))),(0,Td.jsx)(Hl.DX,{name:"RichText.ToolbarControls",children:e=>{if(!e.length)return null;const t=e.map((([{props:e}])=>e)).some((({isActive:e})=>e));return(0,Td.jsx)(Qv.A,{children:n=>(0,Td.jsx)(i_.A,{icon:JJ.A,label:(0,H.__)("More"),toggleProps:{...n,className:(0,$v.A)(n.className,{"is-pressed":t}),describedBy:(0,H.__)("Displays more block tools")},controls:Rf(e.map((([{props:e}])=>e)),"title"),popoverProps:bZ})})}})]});function vZ(e={}){var t;const n=null==(t=e.store)?void 0:t.getState();return(0,tx.z)((0,ox.ko)((0,ox.IA)({},e),{orientation:(0,rx.Jh)(e.orientation,null==n?void 0:n.orientation,"horizontal"),focusLoop:(0,rx.Jh)(e.focusLoop,null==n?void 0:n.focusLoop,!0)}))}function _Z(e={}){const[t,n]=(0,ex.Pj)(vZ,e);return function(e,t,n){return(0,Q_.Y)(e,t,n)}(t,n,e)}var xZ=n(24736),wZ=(0,lx.ab)((e=>{var t=e,{store:n,orientation:r,virtualFocus:o,focusLoop:i,rtl:s}=t,a=(0,ux.YG)(t,["store","orientation","virtualFocus","focusLoop","rtl"]);const l=(0,xZ.P$)(),c=_Z({store:n=n||l,orientation:r,virtualFocus:o,focusLoop:i,rtl:s}),u=c.useState((e=>"both"===e.orientation?void 0:e.orientation));return a=(0,cx.w7)(a,(e=>(0,Td.jsx)(xZ._N,{value:c,children:e})),[c]),a=(0,ux.IA)({role:"toolbar","aria-orientation":u},a),(0,ax.T)((0,ux.IA)({store:c},a))})),kZ=(0,lx.a0)((e=>{const t=wZ(e);return(0,lx.n)("div",t)}));const CZ=(0,S.forwardRef)((function({label:e,...t},n){const r=_Z({focusLoop:!0,rtl:(0,H.isRTL)()});return(0,Td.jsx)(e_.A.Provider,{value:r,children:(0,Td.jsx)(kZ,{ref:n,"aria-label":e,store:r,...t})})})),SZ=(0,S.forwardRef)((function({className:e,label:t,variant:n,...r},o){const i=void 0!==n,s=(0,S.useMemo)((()=>i?{}:{DropdownMenu:{variant:"toolbar"},Dropdown:{variant:"toolbar"}}),[i]);if(!t){(0,q.default)("Using Toolbar without label prop",{since:"5.6",alternative:"ToolbarGroup component",link:"https://developer.wordpress.org/block-editor/components/toolbar/"});const{title:t,...n}=r;return(0,Td.jsx)(a_,{isCollapsed:!1,...n,className:e})}const a=(0,$v.A)("components-accessible-toolbar",e,n&&`is-${n}`);return(0,Td.jsx)(vT.c7,{value:s,children:(0,Td.jsx)(CZ,{className:a,label:t,ref:o,...r})})}));function AZ(e){return Array.from(e.querySelectorAll("[data-toolbar-item]:not([disabled])"))}function EZ(e){return e.contains(e.ownerDocument.activeElement)}function IZ({children:e,focusOnMount:t,focusEditorOnEscape:n=!1,shouldUseKeyboardFocusShortcut:r=!0,__experimentalInitialIndex:o,__experimentalOnIndexChange:i,...s}){const a=(0,S.useRef)(),l=function(e){const[t,n]=(0,S.useState)(!0),r=(0,S.useCallback)((()=>{const t=!ME.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||(0,q.default)("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,S.useLayoutEffect)((()=>{const t=new window.MutationObserver(r);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[r,t,e]),t}(a);return function({toolbarRef:e,focusOnMount:t,isAccessibleToolbar:n,defaultIndex:r,onIndexChange:o,shouldUseKeyboardFocusShortcut:i,focusEditorOnEscape:s}){const[a]=(0,S.useState)(t),[l]=(0,S.useState)(r),c=(0,S.useCallback)((()=>{!function(e){const[t]=ME.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[e]);(0,OU.wk)("core/block-editor/focus-toolbar",(()=>{i&&c()})),(0,S.useEffect)((()=>{a&&c()}),[n,a,c]),(0,S.useEffect)((()=>{const t=e.current;let n=0;return a||EZ(t)||(n=window.requestAnimationFrame((()=>{const e=AZ(t),n=l||0;e[n]&&EZ(t)&&e[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(n),!o||!t)return;const e=AZ(t).findIndex((e=>0===e.tabIndex));o(e)}}),[l,a,o,e]);const{getLastFocus:u}=Cf((0,Ul.A)(hv));(0,S.useEffect)((()=>{const t=e.current;if(s){const e=e=>{const t=u();e.keyCode===VE.ESCAPE&&t?.current&&(e.preventDefault(),t.current.focus())};return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}}),[s,u,e])}({toolbarRef:a,focusOnMount:t,defaultIndex:o,onIndexChange:i,isAccessibleToolbar:l,shouldUseKeyboardFocusShortcut:r,focusEditorOnEscape:n}),l?(0,Td.jsx)(SZ,{label:s["aria-label"],ref:a,...s,children:e}):(0,Td.jsx)(OE.Ay,{orientation:"horizontal",role:"toolbar",ref:a,...s,children:e})}function jZ({popoverAnchor:e}){return(0,Td.jsx)(KC.Ay,{placement:"top",focusOnMount:!1,anchor:e,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar",children:(0,Td.jsx)(IZ,{className:"block-editor-rich-text__inline-format-toolbar-group","aria-label":(0,H.__)("Format tools"),children:(0,Td.jsx)(a_,{children:(0,Td.jsx)(yZ,{})})})})}const TZ=({inline:e,editableContentElement:t})=>e?(0,Td.jsx)(jZ,{popoverAnchor:t}):(0,Td.jsx)(__,{group:"inline",children:(0,Td.jsx)(yZ,{})});function BZ(e){return e($.store).getFormatTypes()}const RZ=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function NZ(e,t){return"object"!=typeof e?{[t]:e}:Object.fromEntries(Object.entries(e).map((([e,n])=>[`${t}.${e}`,n])))}function DZ(e,t){return e[t]?e[t]:Object.keys(e).filter((e=>e.startsWith(t+"."))).reduce(((n,r)=>(n[r.slice(t.length+1)]=e[r],n)),{})}const MZ=["`",'"',"'","“”","‘’"];function PZ(e){let t=e.length;for(;t--;){const n=Qb(e[t].attributes);if(n)return e[t].attributes[n]=e[t].attributes[n].toString().replace(Zb,""),[e[t].clientId,n,0,0];const r=PZ(e[t].innerBlocks);if(r)return r}return[]}function OZ(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function LZ({allowedFormats:e,disableFormats:t}){return t?LZ.EMPTY_ARRAY:e}LZ.EMPTY_ARRAY=[];const FZ=[e=>t=>{function n(n){const{inputType:r,data:o}=n,{value:i,onChange:s,registry:a}=e.current;if("insertText"!==r)return;if((0,$.isCollapsed)(i))return;const l=(0,Tu.applyFilters)("blockEditor.wrapSelectionSettings",MZ).find((([e,t])=>e===o||t===o));if(!l)return;const[c,u=c]=l,d=i.start,h=i.end+c.length;let p=(0,$.insert)(i,c,d,d);p=(0,$.insert)(p,u,h,h);const{__unstableMarkLastChangeAsPersistent:f,__unstableMarkAutomaticChange:m}=a.dispatch(hv);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:r,registry:o}=e.current;if(!n)return;const i=t(),{start:s,text:a}=i;if(" "!==a.slice(s-1,s))return;const l=a.slice(0,s).trim(),c=ld(cd("from").filter((({type:e})=>"prefix"===e)),(({prefix:e})=>l===e));if(!c)return;const u=(0,$.toHTMLString)({value:(0,$.insert)(i,Zb,0,s)}),d=c.transform(u);return r(...PZ([d])),n([d]),o.dispatch(hv).__unstableMarkAutomaticChange(),!0}function r(t){const{inputType:r,type:o}=t,{getValue:i,onChange:s,__unstableAllowPrefixTransformations:a,formatTypes:l,registry:c}=e.current;if("insertText"!==r&&"compositionend"!==o)return;if(a&&n())return;const u=i(),d=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:(0,$.insert)(e," 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️")}(u)),{__unstableMarkLastChangeAsPersistent:h,__unstableMarkAutomaticChange:p}=c.dispatch(hv);d!==u&&(h(),s({...d,activeFormats:u.activeFormats}),p())}return t.addEventListener("input",r),t.addEventListener("compositionend",r),()=>{t.removeEventListener("input",r),t.removeEventListener("compositionend",r)}},e=>t=>{function n(t){if("insertReplacementText"!==t.inputType)return;const{registry:n}=e.current;n.dispatch(hv).__unstableMarkLastChangeAsPersistent()}return t.addEventListener("beforeinput",n),()=>{t.removeEventListener("beforeinput",n)}},()=>e=>{function t(e){(VE.isKeyboardEvent.primary(e,"z")||VE.isKeyboardEvent.primary(e,"y")||VE.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}},e=>t=>{const{keyboardShortcuts:n}=e.current;function r(e){for(const t of n.current)t(e)}return t.addEventListener("keydown",r),()=>{t.removeEventListener("keydown",r)}},e=>t=>{const{inputEvents:n}=e.current;function r(e){for(const t of n.current)t(e)}return t.addEventListener("input",r),()=>{t.removeEventListener("input",r)}},e=>t=>{function n(t){const{keyCode:n}=t;if(t.defaultPrevented)return;if(n!==VE.BACKSPACE&&n!==VE.ESCAPE)return;const{registry:r}=e.current,{didAutomaticChange:o,getSettings:i}=r.select(hv),{__experimentalUndo:s}=i();s&&o()&&(t.preventDefault(),s())}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{function n(n){const{disableFormats:r,onChange:o,value:i,formatTypes:s,tagName:a,onReplace:l,__unstableEmbedURLOnPaste:c,preserveWhiteSpace:u,pastePlainText:d}=e.current;if(n.target!==t)return;if(n.defaultPrevented)return;const{plainText:h,html:p}=rq(n);if(n.preventDefault(),window.console.log("Received HTML:\n\n",p),window.console.log("Received plain text:\n\n",h),r)return void o((0,$.insert)(i,h));function f(e){const t=s.reduce(((e,{__unstablePasteRule:t})=>(t&&e===i&&(e=t(i,{html:p,plainText:h})),e)),i);if(t!==i)o(t);else{const t=(0,$.create)({html:e});!function(e,t){if(t?.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}(t,i.activeFormats),o((0,$.insert)(i,t))}}if("true"===n.clipboardData.getData("rich-text"))return void f(p);if(d)return void o((0,$.insert)(i,(0,$.create)({text:h})));let m="INLINE";const g=h.trim();c&&(0,$.isEmpty)(i)&&(0,sI.m)(g)&&/^https?:/.test(g)&&(m="BLOCKS");const b=Pp({HTML:p,plainText:h,mode:m,tagName:a,preserveWhiteSpace:u});"string"==typeof b?f(b):b.length>0&&l&&(0,$.isEmpty)(i)&&l(b,b.length-1,-1)}const{defaultView:r}=t.ownerDocument;return r.addEventListener("paste",n),()=>{r.removeEventListener("paste",n)}},e=>t=>{function n(t){const{keyCode:n}=t;if(t.defaultPrevented)return;const{value:r,onMerge:o,onRemove:i}=e.current;if(n===VE.DELETE||n===VE.BACKSPACE){const{start:e,end:s,text:a}=r,l=n===VE.BACKSPACE,c=r.activeFormats&&!!r.activeFormats.length;if(!(0,$.isCollapsed)(r)||c||l&&0!==e||!l&&s!==a.length)return;o?o(!l):i&&(0,$.isEmpty)(r)&&l&&i(!l),t.preventDefault()}}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{function n(t){if(t.keyCode!==VE.ENTER)return;const{onReplace:n,onSplit:r}=e.current;n&&r&&(t.__deprecatedOnSplit=!0)}function r(n){if(n.defaultPrevented)return;if(n.target!==t)return;if(n.keyCode!==VE.ENTER)return;const{value:r,onChange:o,disableLineBreaks:i,onSplitAtEnd:s,onSplitAtDoubleLineEnd:a,registry:l}=e.current;n.preventDefault();const{text:c,start:u,end:d}=r;n.shiftKey?i||o((0,$.insert)(r,"\n")):s&&u===d&&d===c.length?s():a&&u===d&&d===c.length&&"\n\n"===c.slice(-2)?l.batch((()=>{const e={...r};e.start=e.end-2,o((0,$.remove)(e)),a()})):i||o((0,$.insert)(r,"\n"))}const{defaultView:o}=t.ownerDocument;return o.addEventListener("keydown",r),t.addEventListener("keydown",n),()=>{o.removeEventListener("keydown",r),t.removeEventListener("keydown",n)}},e=>t=>{function n(){const{registry:n}=e.current;if(!n.select(hv).isMultiSelecting())return;const r=t.parentElement.closest('[contenteditable="true"]');r&&r.focus()}return t.addEventListener("focus",n),()=>{t.removeEventListener("focus",n)}}];function zZ(e){const t=(0,S.useRef)(e);t.current=e;const n=(0,S.useMemo)((()=>FZ.map((e=>e(t)))),[t]);return(0,UC.A)((t=>{if(!e.isSelected)return;const r=n.map((e=>e(t)));return()=>{r.forEach((e=>e()))}}),[n,e.isSelected])}const UZ={},VZ=Symbol("usesContext");function HZ({onChange:e,onFocus:t,value:n,forwardedRef:r,settings:o}){const{name:i,edit:s,[VZ]:a}=o,l=(0,S.useContext)(QU),c=(0,S.useMemo)((()=>a?Object.fromEntries(Object.entries(l).filter((([e])=>a.includes(e)))):UZ),[a,l]);if(!s)return null;const u=(0,$.getActiveFormat)(n,i),d=void 0!==u,h=(0,$.getActiveObject)(n),p=void 0!==h&&h.type===i;return(0,Td.jsx)(s,{isActive:d,activeAttributes:d&&u.attributes||{},isObjectActive:p,activeObjectAttributes:p&&h.attributes||{},value:n,onChange:e,onFocus:t,contentRef:r,context:c},i)}function $Z({formatTypes:e,...t}){return e.map((e=>(0,S.createElement)(HZ,{settings:e,...t,key:e.name})))}function WZ(e,t){if(tQ.isEmpty(e)){const e=OZ(t);return e?`<${e}></${e}>`:""}return Array.isArray(e)?((0,q.default)("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/"}),Sh.toHTML(e)):"string"==typeof e?e:e.toHTMLString()}function GZ({value:e,tagName:t,multiline:n,format:r,...o}){return e=(0,Td.jsx)(Ad.A,{children:WZ(e,n)}),t?(0,Td.jsx)(t,{...o,children:e}):e}const qZ=(0,S.forwardRef)((function({children:e,identifier:t,tagName:n="div",value:r="",onChange:o,multiline:i,...s},a){(0,q.default)("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}=Qp(),{getSelectionStart:c,getSelectionEnd:u}=(0,Ul.A)(hv),{selectionChange:d}=(0,Vl.A)(hv),h=OZ(i),p=`</${h}>${r=r||`<${h}></${h}>`}<${h}>`.split(`</${h}><${h}>`);function f(e){o(`<${h}>${e.join(`</${h}><${h}>`)}</${h}>`)}return p.shift(),p.pop(),(0,Td.jsx)(n,{ref:a,children:p.map(((e,n)=>(0,Td.jsx)(ZZ,{identifier:`${t}-${n}`,tagName:h,value:e,onChange:e=>{const t=p.slice();t[n]=e,f(t)},isSelected:void 0,onKeyDown:r=>{if(r.keyCode!==VE.ENTER)return;r.preventDefault();const{offset:o}=c(),{offset:i}=u();if("number"!=typeof o||"number"!=typeof i)return;const s=(0,$.create)({html:e});s.start=o,s.end=i;const a=(0,$.split)(s).map((e=>(0,$.toHTMLString)({value:e}))),h=p.slice();h.splice(n,1,...a),f(h),d(l,`${t}-${n+1}`,0,0)},onMerge:e=>{const r=p.slice();let o=0;if(e){if(!r[n+1])return;r.splice(n,2,r[n]+r[n+1]),o=r[n].length-1}else{if(!r[n-1])return;r.splice(n-1,2,r[n-1]+r[n]),o=r[n-1].length-1}f(r),d(l,`${t}-${n-(e?0:1)}`,o,o)},...s},n)))})})),KZ=(0,S.createContext)(),YZ=(0,S.createContext)(),JZ=Symbol("instanceId");function XZ(e){const{__unstableMobileNoFocusOnMount:t,deleteEnter:n,placeholderTextColor:r,textAlign:o,selectionColor:i,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 ZZ({children:e,tagName:t="div",value:n="",onChange:r,isSelected:o,multiline:i,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:w,disableLineBreaks:k,__unstableAllowPrefixTransformations:C,readOnly:A,...E},I){E=XZ(E),m&&(0,q.default)("wp.blockEditor.RichText onSplit prop",{since:"6.4",alternative:'block.json support key: "splitting"'});const j=(0,z_.A)(ZZ),T=(0,S.useRef)(),B=Qp(),{clientId:R,isSelected:N,name:D}=B,M=B[Kp],P=(0,S.useContext)(QU),{selectionStart:O,selectionEnd:L,isSelected:F}=(0,Ul.A)((e=>{if(!N)return{isSelected:!1};const{getSelectionStart:t,getSelectionEnd:n}=e(hv),r=t(),i=n();let s;return void 0===o?s=r.clientId===R&&i.clientId===R&&(y?r.attributeKey===y:r[JZ]===j):o&&(s=r.clientId===R),{selectionStart:s?r.offset:void 0,selectionEnd:s?i.offset:void 0,isSelected:s}}),[R,y,j,o,N]),z=(0,Ul.A)((e=>{let t=!1;if(M&&yz(D)){const n=Sc(D).attributes,{getBlockBindingsSource:r}=Cf(e(ed));for(const[o,i]of Object.entries(M)){if("rich-text"!==n?.[o]?.source)break;const s=r(i.source);if(!s?.canUserEditValue({select:e,context:P,args:i.args})){t=!0;break}}}return t}),[M,D]),U=A||z,{getSelectionStart:V,getSelectionEnd:H,getBlockRootClientId:W}=(0,Ul.A)(hv),{selectionChange:G}=(0,Vl.A)(hv),K=LZ({allowedFormats:d,disableFormats:w}),Y=!K||K.length>0,J=(0,S.useCallback)(((e,t)=>{const n={},r=void 0===e&&void 0===t,o={clientId:R,[y?"attributeKey":JZ]:y||j};if("number"==typeof e||r){if(void 0===t&&W(R)!==W(H().clientId))return;n.start={...o,offset:e}}if("number"==typeof t||r){if(void 0===e&&W(R)!==W(V().clientId))return;n.end={...o,offset:t}}G(n)}),[R,W,H,V,y,j,G]),{formatTypes:X,prepareHandlers:Z,valueHandlers:Q,changeHandlers:ee,dependencies:te}=function({clientId:e,identifier:t,withoutInteractiveFormatting:n,allowedFormats:r}){const o=(0,Ul.A)(BZ,[]),i=(0,S.useMemo)((()=>o.filter((({name:e,interactive:t,tagName:o})=>!(r&&!r.includes(e)||n&&(t||RZ.has(o)))))),[o,r,n]),s=(0,Ul.A)((n=>i.reduce(((r,o)=>o.__experimentalGetPropsForEditableTreePreparation?{...r,...NZ(o.__experimentalGetPropsForEditableTreePreparation(n,{richTextIdentifier:t,blockClientId:e}),o.name)}:r),{})),[i,e,t]),a=(0,Vl.A)(),l=[],c=[],u=[],d=[];for(const e in s)d.push(s[e]);return i.forEach((n=>{if(n.__experimentalCreatePrepareEditableTree){const r=n.__experimentalCreatePrepareEditableTree(DZ(s,n.name),{richTextIdentifier:t,blockClientId:e});n.__experimentalCreateOnChangeEditableValue?c.push(r):l.push(r)}if(n.__experimentalCreateOnChangeEditableValue){let r={};n.__experimentalGetPropsForEditableTreeChangeHandler&&(r=n.__experimentalGetPropsForEditableTreeChangeHandler(a,{richTextIdentifier:t,blockClientId:e}));const o=DZ(s,n.name);u.push(n.__experimentalCreateOnChangeEditableValue({..."object"==typeof o?o:{},...r},{richTextIdentifier:t,blockClientId:e}))}})),{formatTypes:i,prepareHandlers:l,valueHandlers:c,changeHandlers:u,dependencies:d}}({clientId:R,identifier:y,withoutInteractiveFormatting:h,allowedFormats:K});function ne(e){return X.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,$.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:re,getValue:oe,onChange:ie,ref:se}=(0,$.__unstableUseRichText)({value:n,onChange(e,{__unstableFormats:t,__unstableText:n}){r(e),Object.values(ee).forEach((e=>{e(t,n)}))},selectionStart:O,selectionEnd:L,onSelectionChange:J,placeholder:u,__unstableIsSelected:F,__unstableDisableFormats:w,preserveWhiteSpace:v,__unstableDependencies:[...te,t],__unstableAfterParse:function(e){return Q.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:ne,__unstableAddInvisibleFormats:function(e){return Z.reduce(((t,n)=>n(t,e.text)),e.formats)}}),ae=function(e){return function(e){const t=(0,S.useRef)(null),n=(0,S.useRef)(),{record:r}=e,o=function(e){const t=(0,S.useRef)(new Set);return t.current.add(e),t.current.size>2&&t.current.delete(Array.from(t.current)[0]),Array.from(t.current)[0]}(r),{popover:i,listBoxId:s,activeId:a,onKeyDown:l}=uZ({...e,contentRef:t});n.current=l;const c=(0,eC.A)([t,(0,UC.A)((e=>{function t(e){n.current?.(e)}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[])]);return r.text!==o?.text?{ref:c,children:i,"aria-autocomplete":s?"list":void 0,"aria-owns":s,"aria-activedescendant":a}:{ref:c}}({...e,completers:gZ(e)})}({onReplace:c,completers:l,record:re,onChange:ie});!function({html:e,value:t}){const n=(0,S.useRef)(),r=!!t.activeFormats?.length,{__unstableMarkLastChangeAsPersistent:o}=(0,Vl.A)(hv);(0,S.useLayoutEffect)((()=>{if(n.current){if(n.current!==t.text){const e=window.setTimeout((()=>{o()}),1e3);return n.current=t.text,()=>{window.clearTimeout(e)}}o()}else n.current=t.text}),[e,r])}({html:n,value:re});const le=(0,S.useRef)(new Set),ce=(0,S.useRef)(new Set);function ue(){T.current?.focus()}const de=(0,Hp.A)(),he=t;return(0,Td.jsxs)(Td.Fragment,{children:[F&&(0,Td.jsx)(KZ.Provider,{value:le,children:(0,Td.jsx)(YZ.Provider,{value:ce,children:(0,Td.jsxs)(KC.Ay.__unstableSlotNameProvider,{value:"__unstable-block-tools-after",children:[e&&e({value:re,onChange:ie,onFocus:ue}),(0,Td.jsx)($Z,{value:re,onChange:ie,onFocus:ue,formatTypes:X,forwardedRef:T})]})})}),F&&Y&&(0,Td.jsx)(TZ,{inline:s,editableContentElement:T.current}),(0,Td.jsx)(he,{role:"textbox","aria-multiline":!k,"aria-label":u,"aria-readonly":U,...E,...ae,ref:(0,eC.A)([se,I,ae.ref,E.ref,zZ({registry:de,getValue:oe,onChange:ie,__unstableAllowPrefixTransformations:C,formatTypes:X,onReplace:c,selectionChange:G,isSelected:F,disableFormats:w,value:re,tagName:t,onSplit:m,__unstableEmbedURLOnPaste:x,pastePlainText:_,onMerge:f,onRemove:p,removeEditorOnlyFormats:ne,disableLineBreaks:k,onSplitAtEnd:g,onSplitAtDoubleLineEnd:b,keyboardShortcuts:le,inputEvents:ce}),T]),contentEditable:!U,suppressContentEditableWarning:!0,className:(0,$v.A)("block-editor-rich-text__editable",E.className,"rich-text"),tabIndex:0!==E.tabIndex||U?E.tabIndex:null,"data-wp-block-attribute-key":y})]})}const QZ=function(e){return(0,S.forwardRef)(((t,n)=>{let r=t.value,o=t.onChange;Array.isArray(r)&&((0,q.default)("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/"}),r=Sh.toHTML(t.value),o=e=>t.onChange(Sh.fromDOM((0,$.__unstableCreateElement)(document,e).childNodes)));const i=t.multiline?qZ:e;return(0,Td.jsx)(i,{...t,value:r,onChange:o,ref:n})}))}((0,S.forwardRef)(ZZ));QZ.Content=GZ,QZ.isEmpty=e=>!e||0===e.length;const eQ=(0,S.forwardRef)(((e,t)=>{if(Qp()[Yp]){const{children:t,tagName:n="div",value:r,onChange:o,isSelected:i,multiline:s,inlineToolbar:a,wrapperClassName:l,autocompleters:c,onReplace:u,placeholder:d,allowedFormats:h,withoutInteractiveFormatting:p,onRemove:f,onMerge:m,onSplit:g,__unstableOnSplitAtEnd:b,__unstableOnSplitAtDoubleLineEnd:y,identifier:v,preserveWhiteSpace:_,__unstablePastePlainText:x,__unstableEmbedURLOnPaste:w,__unstableDisableFormats:k,disableLineBreaks:C,__unstableAllowPrefixTransformations:S,readOnly:A,...E}=XZ(e);return(0,Td.jsx)(n,{...E,dangerouslySetInnerHTML:{__html:WZ(r,s)}})}return(0,Td.jsx)(QZ,{ref:t,...e,readOnly:!1})}));eQ.Content=GZ,eQ.isEmpty=e=>!e||0===e.length;const tQ=eQ;function nQ({character:e,type:t,onUse:n}){const r=(0,S.useContext)(KZ),o=(0,S.useRef)();return o.current=n,(0,S.useEffect)((()=>{function n(n){VE.isKeyboardEvent[t](n,e)&&(o.current(),n.preventDefault())}return r.current.add(n),()=>{r.current.delete(n)}}),[e,t]),null}function rQ({name:e,shortcutType:t,shortcutCharacter:n,...r}){let o,i="RichText.ToolbarControls";return e&&(i+=`.${e}`),t&&n&&(o=VE.displayShortcut[t](n)),(0,Td.jsx)(Hl.SQ,{name:i,children:(0,Td.jsx)(r_,{...r,shortcut:o})})}function oQ({inputType:e,onInput:t}){const n=(0,S.useContext)(YZ),r=(0,S.useRef)();return r.current=t,(0,S.useEffect)((()=>{function t(t){t.inputType===e&&(r.current(),t.preventDefault())}return n.current.add(t),()=>{n.current.delete(t)}}),[e]),null}var iQ=n(49217),sQ=n(70827);const aQ="none",lQ="custom",cQ="media",uQ="attachment",dQ=["noreferrer","noopener"],hQ=({linkDestination:e,onChangeUrl:t,url:n,mediaType:r="image",mediaUrl:o,mediaLink:i,linkTarget:s,linkClass:a,rel:l,showLightboxSetting:c,lightboxEnabled:u,onSetLightbox:d,resetLightbox:h})=>{const[p,f]=(0,S.useState)(!1),[m,g]=(0,S.useState)(null),[b,y]=(0,S.useState)(!1),[v,_]=(0,S.useState)(null),x=(0,S.useRef)(null),w=(0,S.useRef)();(0,S.useEffect)((()=>{w.current&&(ME.focus.focusable.find(w.current)[0]||w.current).focus()}),[b,n,u]);const k=()=>{y(!1)},C=()=>{const e=[{linkDestination:cQ,title:(0,H.__)("Link to image file"),url:"image"===r?o:void 0,icon:iQ.A}];return"image"===r&&i&&e.push({linkDestination:uQ,title:(0,H.__)("Link to attachment page"),url:"image"===r?i:void 0,icon:fI.A}),e},A=(0,Td.jsxs)(oE.A,{spacing:"3",children:[(0,Td.jsx)(Hx.A,{__nextHasNoMarginBottom:!0,label:(0,H.__)("Open in new tab"),onChange:e=>{const n=(e=>{const t=e?"_blank":void 0;let n;if(t){const e=(null!=l?l:"").split(" ");dQ.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(null!=l?l:"").split(" ").filter((e=>!1===dQ.includes(e)));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);t(n)},checked:"_blank"===s}),(0,Td.jsx)(KE.A,{__nextHasNoMarginBottom:!0,label:(0,H.__)("Link rel"),value:null!=l?l:"",onChange:e=>{t({rel:e})}}),(0,Td.jsx)(KE.A,{__nextHasNoMarginBottom:!0,label:(0,H.__)("Link CSS class"),value:a||"",onChange:e=>{t({linkClass:e})}})]}),E=null!==v?v:n,I=!u||u&&!c,j=!E&&I,T=(C().find((t=>t.linkDestination===e))||{}).title;return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(r_,{icon:rT.A,className:"components-toolbar__control",label:(0,H.__)("Link"),"aria-expanded":p,onClick:()=>{f(!0)},ref:g,isActive:!!n||u&&c}),p&&(0,Td.jsx)(eZ,{ref:w,anchor:m,onFocusOutside:e=>{const t=x.current;t&&t.contains(e.target)||(f(!1),_(null),k())},onClose:()=>{_(null),k(),f(!1)},renderSettings:I?()=>A:null,additionalControls:j&&(0,Td.jsxs)(OE.Ay,{children:[C().map((e=>(0,Td.jsx)(k_.A,{icon:e.icon,iconPosition:"left",onClick:()=>{_(null),(e=>{const n=C();let r;r=e?(n.find((t=>t.url===e))||{linkDestination:lQ}).linkDestination:aQ,t({linkDestination:r,href:e})})(e.url),k()},children:e.title},e.linkDestination))),c&&(0,Td.jsx)(k_.A,{className:"block-editor-url-popover__expand-on-click",icon:sQ.A,info:(0,H.__)("Scale the image with a lightbox effect."),iconPosition:"left",onClick:()=>{_(null),t({linkDestination:aQ,href:""}),d(!0),k()},children:(0,H.__)("Expand on click")},"expand-on-click")]}),offset:13,children:u&&c&&!n&&!b?(0,Td.jsxs)("div",{className:"block-editor-url-popover__expand-on-click",children:[(0,Td.jsx)(lk.A,{icon:sQ.A}),(0,Td.jsxs)("div",{className:"text",children:[(0,Td.jsx)("p",{children:(0,H.__)("Expand on click")}),(0,Td.jsx)("p",{className:"description",children:(0,H.__)("Scales the image with a lightbox effect")})]}),(0,Td.jsx)(Zv.Ay,{icon:ZI.A,label:(0,H.__)("Disable expand on click"),onClick:()=>{d(!1)},size:"compact"})]}):!n||b?(0,Td.jsx)(eZ.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:E,onChangeInputValue:_,onSubmit:e=>{if(v){const e=C().find((e=>e.url===v))?.linkDestination||lQ;t({href:v,linkDestination:e,lightbox:{enabled:!1}})}k(),_(null),e.preventDefault()},autocompleteRef:x}):n&&!b?(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(eZ.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:n,onEditLinkClick:()=>{e!==cQ&&e!==uQ||_(""),y(!0)},urlLabel:T}),(0,Td.jsx)(Zv.Ay,{icon:ZI.A,label:(0,H.__)("Remove link"),onClick:()=>{t({linkDestination:aQ,href:""}),h()},size:"compact"})]}):void 0})]})};function pQ(){const e=(0,Ul.A)((e=>e(hv).getBlockSelectionStart()),[]),t=GC(e);return e?(0,Td.jsx)(Zv.Ay,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{t.current.focus()},children:(0,H.__)("Skip to the selected block")}):null}const fQ={HTMLRegExp:/<\/?[a-z][^>]*?>/gi,HTMLcommentRegExp:/<!--[\s\S]*?-->/g,spaceRegExp:/&nbsp;|&#160;/gi,HTMLEntityRegExp:/&\S+?;/g,connectorRegExp:/--|\u2014/g,removeRegExp:new RegExp(["[","!-/:-@[-`{-~","€-¿×÷"," -⯿","⸀-⹿","]"].join(""),"g"),astralRegExp:/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,wordsRegExp:/\S\s+/g,characters_excluding_spacesRegExp:/\S/g,characters_including_spacesRegExp:/[^\f\n\r\t\v\u00AD\u2028\u2029]/g,l10n:{type:"words"}};function mQ(e,t){return t.replace(e.HTMLRegExp,"\n")}function gQ(e,t){return t.replace(e.astralRegExp,"a")}function bQ(e,t){return t.replace(e.HTMLEntityRegExp,"")}function yQ(e,t){return t.replace(e.connectorRegExp," ")}function vQ(e,t){return t.replace(e.removeRegExp,"")}function _Q(e,t){return t.replace(e.HTMLcommentRegExp,"")}function xQ(e,t){return e.shortcodesRegExp?t.replace(e.shortcodesRegExp,"\n"):t}function wQ(e,t){return t.replace(e.spaceRegExp," ")}function kQ(e,t){return t.replace(e.HTMLEntityRegExp,"a")}function CQ(e,t,n){var r;return e=[mQ.bind(null,n),_Q.bind(null,n),xQ.bind(null,n),gQ.bind(null,n),wQ.bind(null,n),kQ.bind(null,n)].reduce(((e,t)=>t(e)),e),e+="\n",null!==(r=e.match(t)?.length)&&void 0!==r?r:0}const SQ=(0,iI.A)((e=>{const{getMultiSelectedBlocks:t}=e(hv);return{blocks:t()}}))((function({blocks:e}){const t=function(e,t,n){const r=function(e,t){var n;const r=Object.assign({},fQ,t);return r.shortcodes=null!==(n=r.l10n?.shortcodes)&&void 0!==n?n:[],r.shortcodes&&r.shortcodes.length&&(r.shortcodesRegExp=new RegExp("\\[\\/?(?:"+r.shortcodes.join("|")+")[^\\]]*?\\]","g")),r.type=e,"characters_excluding_spaces"!==r.type&&"characters_including_spaces"!==r.type&&(r.type="words"),r}(t,n);let o;switch(r.type){case"words":return o=r.wordsRegExp,function(e,t,n){var r;return e=[mQ.bind(null,n),_Q.bind(null,n),xQ.bind(null,n),wQ.bind(null,n),bQ.bind(null,n),yQ.bind(null,n),vQ.bind(null,n)].reduce(((e,t)=>t(e)),e),e+="\n",null!==(r=e.match(t)?.length)&&void 0!==r?r:0}(e,o,r);case"characters_including_spaces":return o=r.characters_including_spacesRegExp,CQ(e,o,r);case"characters_excluding_spaces":return o=r.characters_excluding_spacesRegExp,CQ(e,o,r);default:return 0}}(zd(e),"words");return(0,Td.jsxs)("div",{className:"block-editor-multi-selection-inspector__card",children:[(0,Td.jsx)(pz,{icon:BT.A,showColors:!0}),(0,Td.jsxs)("div",{className:"block-editor-multi-selection-inspector__card-content",children:[(0,Td.jsx)("div",{className:"block-editor-multi-selection-inspector__card-title",children:(0,H.sprintf)((0,H._n)("%d Block","%d Blocks",e.length),e.length)}),(0,Td.jsx)("div",{className:"block-editor-multi-selection-inspector__card-description",children:(0,H.sprintf)((0,H._n)("%d word selected.","%d words selected.",t),t)})]})]})}));function AQ({className:e,onSelectVariation:t,selectedValue:n,variations:r}){return(0,Td.jsxs)("fieldset",{className:e,children:[(0,Td.jsx)(GA.A,{as:"legend",children:(0,H.__)("Transform to variation")}),r.map((e=>(0,Td.jsx)(Zv.Ay,{icon:(0,Td.jsx)(pz,{icon:e.icon,showColors:!0}),isPressed:n===e.name,label:n===e.name?e.title:(0,H.sprintf)((0,H.__)("Transform to %s"),e.title),onClick:()=>t(e.name),"aria-label":e.title,showTooltip:!0},e.name)))]})}function EQ({className:e,onSelectVariation:t,selectedValue:n,variations:r}){const o=r.map((({name:e,title:t,description:n})=>({value:e,label:t,info:n})));return(0,Td.jsx)(i_.A,{className:e,label:(0,H.__)("Transform to variation"),text:(0,H.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${e}__popover`},icon:JJ.A,toggleProps:{iconPosition:"right"},children:()=>(0,Td.jsx)("div",{className:`${e}__container`,children:(0,Td.jsx)(w_.A,{children:(0,Td.jsx)(hY,{choices:o,value:n,onSelect:t})})})})}function IQ({className:e,onSelectVariation:t,selectedValue:n,variations:r}){return(0,Td.jsx)("div",{className:e,children:(0,Td.jsx)(wx,{label:(0,H.__)("Transform to variation"),value:n,hideLabelFromVision:!0,onChange:t,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:r.map((e=>(0,Td.jsx)(Vx,{icon:(0,Td.jsx)(pz,{icon:e.icon,showColors:!0}),value:e.name,label:n===e.name?e.title:(0,H.sprintf)((0,H.__)("Transform to %s"),e.title)},e.name)))})})}const jQ=function({blockClientId:e}){const{updateBlockAttributes:t}=(0,Vl.A)(hv),{activeBlockVariation:n,variations:r}=(0,Ul.A)((t=>{const{getActiveBlockVariation:n,getBlockVariations:r}=t(ed),{getBlockName:o,getBlockAttributes:i}=t(hv),s=e&&o(e);return{activeBlockVariation:n(s,i(e)),variations:s&&r(s,"transform")}}),[e]),o=n?.name,i=(0,S.useMemo)((()=>{const e=new Set;return!!r&&(r.forEach((t=>{t.icon&&e.add(t.icon?.src||t.icon)})),e.size===r.length)}),[r]);if(!r?.length)return null;const s=r.length>5,a=i?s?AQ:IQ:EQ;return(0,Td.jsx)(a,{className:"block-editor-block-variation-transforms",onSelectVariation:n=>{t(e,{...r.find((({name:e})=>e===n)).attributes})},selectedValue:o,variations:r})};function TQ(e,t,n){const r=new WM(e);return t&&r.remove("is-style-"+t.name),r.add("is-style-"+n.name),r.value}function BQ(e){return e?.find((e=>e.isDefault))}function RQ({genericPreviewBlock:e,style:t,className:n,activeStyle:r}){const o=Sc(e.name)?.example,i=TQ(n,r,t),s=(0,S.useMemo)((()=>({...e,title:t.label||t.name,description:t.description,initialAttributes:{...e.attributes,className:i+" block-editor-block-styles__block-preview-container"},example:o})),[e,i]);return(0,Td.jsx)(Rq,{item:s})}function NQ({clientId:e,onSwitch:t}){const{styles:n,block:r,blockType:o,className:i}=(0,Ul.A)((t=>{const{getBlock:n}=t(hv),r=n(e);if(!r)return{};const o=Sc(r.name),{getBlockStyles:i}=t(ed);return{block:r,blockType:o,styles:i(r.name),className:r.attributes.className||""}}),[e]),{updateBlockAttributes:s}=(0,Vl.A)(hv),a=function(e){return e&&0!==e.length?BQ(e)?e:[{name:"default",label:(0,H._x)("Default","block style"),isDefault:!0},...e]:[]}(n),l=function(e,t){for(const n of new WM(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),r=e?.find((({name:e})=>e===t));if(r)return r}return BQ(e)}(a,i),c=function(e,t){return(0,S.useMemo)((()=>{const n=t?.example,r=t?.name;return n&&r?hd(r,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?od(e):void 0}),[t?.example?e?.name:e,t])}(r,o);return{onSelect:n=>{const r=TQ(i,l,n);s(e,{className:r}),t()},stylesToRender:a,activeStyle:l,genericPreviewBlock:c,className:i}}const DQ=()=>{},MQ=function({clientId:e,onSwitch:t=DQ,onHoverClassName:n=DQ}){const{onSelect:r,stylesToRender:o,activeStyle:i,genericPreviewBlock:s,className:a}=NQ({clientId:e,onSwitch:t}),[l,c]=(0,S.useState)(null),u=(0,YU.A)("medium","<");if(!o||0===o.length)return null;const d=(0,FE.s)(c,250),h=e=>{var t;l!==e?(d(e),n(null!==(t=e?.name)&&void 0!==t?t:null)):d.cancel()};return(0,Td.jsxs)("div",{className:"block-editor-block-styles",children:[(0,Td.jsx)("div",{className:"block-editor-block-styles__variants",children:o.map((e=>{const t=e.label||e.name;return(0,Td.jsx)(Zv.Ay,{__next40pxDefaultSize:!0,className:(0,$v.A)("block-editor-block-styles__item",{"is-active":i.name===e.name}),variant:"secondary",label:t,onMouseEnter:()=>h(e),onFocus:()=>h(e),onMouseLeave:()=>h(null),onBlur:()=>h(null),onClick:()=>(e=>{r(e),n(null),c(null),d.cancel()})(e),"aria-current":i.name===e.name,children:(0,Td.jsx)(WA.A,{numberOfLines:1,className:"block-editor-block-styles__item-text",children:t})},e.name)}))}),l&&!u&&(0,Td.jsx)(KC.Ay,{placement:"left-start",offset:34,focusOnMount:!1,children:(0,Td.jsx)("div",{className:"block-editor-block-styles__preview-panel",onMouseLeave:()=>h(null),children:(0,Td.jsx)(RQ,{activeStyle:i,className:a,genericPreviewBlock:s,style:l})})})]})};var PQ=n(26563),OQ=n(528),LQ=n(96066);const FQ={name:"settings",title:(0,H.__)("Settings"),value:"settings",icon:PQ.A,className:"block-editor-block-inspector__tab-item"},zQ={name:"styles",title:(0,H.__)("Styles"),value:"styles",icon:OQ.A,className:"block-editor-block-inspector__tab-item"},UQ={name:"list",title:(0,H.__)("List View"),value:"list-view",icon:LQ.A,className:"block-editor-block-inspector__tab-item"},VQ=()=>{const e=f_(EA.slotName);return Boolean(e&&e.length)?(0,Td.jsx)(aF.Ay,{className:"block-editor-block-inspector__advanced",title:(0,H.__)("Advanced"),initialOpen:!1,children:(0,Td.jsx)(IA.Slot,{group:"advanced"})}):null},HQ=()=>{const[e,t]=(0,S.useState)(),{multiSelectedBlocks:n}=(0,Ul.A)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:n}=e(hv);return{multiSelectedBlocks:t(n())}}),[]);return(0,S.useLayoutEffect)((()=>{void 0===e&&t(n.some((({attributes:e})=>!!e?.style?.position?.type)))}),[e,n,t]),(0,Td.jsx)(aF.Ay,{className:"block-editor-block-inspector__position",title:(0,H.__)("Position"),initialOpen:null!=e&&e,children:(0,Td.jsx)(IA.Slot,{group:"position"})})},$Q=()=>{const e=f_(qS.position.Slot.__unstableName);return Boolean(e&&e.length)?(0,Td.jsx)(HQ,{}):null};var WQ=n(98236);const GQ="isInspectorControlsTabsHintVisible";function qQ(){const e=(0,Ul.A)((e=>{var t;return null===(t=e(XE.M).get("core",GQ))||void 0===t||t}),[]),t=(0,S.useRef)(),{set:n}=(0,Vl.A)(XE.M);return e?(0,Td.jsxs)("div",{ref:t,className:"block-editor-inspector-controls-tabs__hint",children:[(0,Td.jsx)("div",{className:"block-editor-inspector-controls-tabs__hint-content",children:(0,H.__)("Looking for other block settings? They've moved to the styles tab.")}),(0,Td.jsx)(Zv.Ay,{className:"block-editor-inspector-controls-tabs__hint-dismiss",icon:WQ.A,iconSize:"16",label:(0,H.__)("Dismiss hint"),onClick:()=>{const e=ME.focus.tabbable.findPrevious(t.current);e?.focus(),n("core",GQ,!1)},showTooltip:!1})]}):null}const KQ=({showAdvancedControls:e=!1})=>(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(IA.Slot,{}),(0,Td.jsx)($Q,{}),e&&(0,Td.jsx)("div",{children:(0,Td.jsx)(VQ,{})}),(0,Td.jsx)(qQ,{})]}),YQ=({blockName:e,clientId:t,hasBlockStyles:n})=>{const r=rN({blockName:e});return(0,Td.jsxs)(Td.Fragment,{children:[n&&(0,Td.jsx)("div",{children:(0,Td.jsx)(aF.Ay,{title:(0,H.__)("Styles"),children:(0,Td.jsx)(MQ,{clientId:t})})}),(0,Td.jsx)(IA.Slot,{group:"color",label:(0,H.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,Td.jsx)(IA.Slot,{group:"background",label:(0,H.__)("Background image")}),(0,Td.jsx)(IA.Slot,{group:"filter"}),(0,Td.jsx)(IA.Slot,{group:"typography",label:(0,H.__)("Typography")}),(0,Td.jsx)(IA.Slot,{group:"dimensions",label:(0,H.__)("Dimensions")}),(0,Td.jsx)(IA.Slot,{group:"border",label:r}),(0,Td.jsx)(IA.Slot,{group:"styles"})]})},JQ=["core/navigation"],XQ=e=>!JQ.includes(e),{Tabs:ZQ}=Cf(d_.j);function QQ({blockName:e,clientId:t,hasBlockStyles:n,tabs:r}){const o=(0,Ul.A)((e=>e(XE.M).get("core","showIconLabels")),[]),i=XQ(e)?void 0:UQ.name;return(0,Td.jsx)("div",{className:"block-editor-block-inspector__tabs",children:(0,Td.jsxs)(ZQ,{defaultTabId:i,children:[(0,Td.jsx)(ZQ.TabList,{children:r.map((e=>(0,Td.jsx)(ZQ.Tab,{tabId:e.name,render:(0,Td.jsx)(Zv.Ay,{icon:o?void 0:e.icon,label:o?void 0:e.title,className:e.className,children:o&&e.title})},e.name)))}),(0,Td.jsx)(ZQ.TabPanel,{tabId:FQ.name,focusable:!1,children:(0,Td.jsx)(KQ,{showAdvancedControls:!!e})}),(0,Td.jsx)(ZQ.TabPanel,{tabId:zQ.name,focusable:!1,children:(0,Td.jsx)(YQ,{blockName:e,clientId:t,hasBlockStyles:n})}),(0,Td.jsx)(ZQ.TabPanel,{tabId:UQ.name,focusable:!1,children:(0,Td.jsx)(IA.Slot,{group:"list"})})]},t)})}const e0=[];function t0(e){const t=[],{border:n,color:r,default:o,dimensions:i,list:s,position:a,styles:l,typography:c,effects:u}=qS,d=XQ(e),h=f_(s.Slot.__unstableName),p=!d&&!!h&&h.length,f=[...f_(n.Slot.__unstableName)||[],...f_(r.Slot.__unstableName)||[],...f_(i.Slot.__unstableName)||[],...f_(l.Slot.__unstableName)||[],...f_(c.Slot.__unstableName)||[],...f_(u.Slot.__unstableName)||[]].length,m=f_(EA.slotName)||[],g=[...f_(o.Slot.__unstableName)||[],...f_(a.Slot.__unstableName)||[],...p&&f>1?m:[]];p&&t.push(UQ),g.length&&t.push(FQ),f&&t.push(zQ);const b=function(e,t={}){return void 0!==t[e]?t[e]:void 0===t.default||t.default}(e,(0,Ul.A)((e=>e(hv).getSettings().blockInspectorTabs),[]));return b?t:e0}const{createPrivateSlotFill:n0}=Cf(d_.j),{Fill:r0,Slot:o0}=n0("BlockInformation"),i0=e=>Qp()[Wp]?(0,Td.jsx)(r0,{...e}):null;i0.Slot=e=>(0,Td.jsx)(o0,{...e});const s0=i0;function a0({clientIds:e}){return e.length?(0,Td.jsx)(oE.A,{spacing:1,children:e.map((e=>(0,Td.jsx)(l0,{clientId:e},e)))}):null}function l0({clientId:e}){const{name:t,icon:n,isSelected:r}=(0,Ul.A)((t=>{const{getBlockName:n,getBlockAttributes:r,isBlockSelected:o,hasSelectedInnerBlock:i}=t(hv),{getBlockType:s}=t(ed),a=s(n(e)),l=r(e);return{name:a&&Oc(a,l,"list-view"),icon:a?.icon,isSelected:o(e)||i(e,!0)}}),[e]),{selectBlock:o}=(0,Vl.A)(hv);return(0,Td.jsx)(Zv.Ay,{isPressed:r,onClick:()=>o(e),children:(0,Td.jsxs)(B_.A,{children:[(0,Td.jsx)(R_.A,{children:(0,Td.jsx)(pz,{icon:n})}),(0,Td.jsx)(pN.A,{style:{textAlign:"left"},children:(0,Td.jsx)(WA.A,{children:t})})]})})}function c0({topLevelLockedBlock:e}){const t=(0,Ul.A)((t=>{const{getClientIdsOfDescendants:n,getBlockName:r,getBlockEditingMode:o}=t(hv);return n(e).filter((e=>"core/list-item"!==r(e)&&"contentOnly"===o(e)))}),[e]),n=BL(e);return(0,Td.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,Td.jsx)(BU,{...n,className:n.isSynced&&"is-synced"}),(0,Td.jsx)(jQ,{blockClientId:e}),(0,Td.jsx)(s0.Slot,{}),t.length>0&&(0,Td.jsx)(aF.Ay,{title:(0,H.__)("Content"),children:(0,Td.jsx)(a0,{clientIds:t})})]})}const u0=({animate:e,wrapper:t,children:n})=>e?t(n):n,d0=({blockInspectorAnimationSettings:e,selectedBlockClientId:t,children:n})=>{const r=e&&"leftToRight"===e.enterDirection?-50:50;return(0,Td.jsx)(Cx.P.div,{animate:{x:0,opacity:1,transition:{ease:"easeInOut",duration:.14}},initial:{x:r,opacity:0},children:n},t)},h0=({clientId:e,blockName:t})=>{const n=t0(t),r=n?.length>1,o=(0,Ul.A)((e=>{const{getBlockStyles:n}=e(ed),r=n(t);return r&&r.length>0}),[t]),i=BL(e),s=rN({blockName:t});return(0,Td.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,Td.jsx)(BU,{...i,className:i.isSynced&&"is-synced"}),(0,Td.jsx)(jQ,{blockClientId:e}),(0,Td.jsx)(s0.Slot,{}),r&&(0,Td.jsx)(QQ,{hasBlockStyles:o,clientId:e,blockName:t,tabs:n}),!r&&(0,Td.jsxs)(Td.Fragment,{children:[o&&(0,Td.jsx)("div",{children:(0,Td.jsx)(aF.Ay,{title:(0,H.__)("Styles"),children:(0,Td.jsx)(MQ,{clientId:e})})}),(0,Td.jsx)(IA.Slot,{}),(0,Td.jsx)(IA.Slot,{group:"list"}),(0,Td.jsx)(IA.Slot,{group:"color",label:(0,H.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,Td.jsx)(IA.Slot,{group:"typography",label:(0,H.__)("Typography")}),(0,Td.jsx)(IA.Slot,{group:"dimensions",label:(0,H.__)("Dimensions")}),(0,Td.jsx)(IA.Slot,{group:"border",label:s}),(0,Td.jsx)(IA.Slot,{group:"styles"}),(0,Td.jsx)(IA.Slot,{group:"background",label:(0,H.__)("Background image")}),(0,Td.jsx)($Q,{}),(0,Td.jsx)("div",{children:(0,Td.jsx)(VQ,{})})]}),(0,Td.jsx)(pQ,{},"back")]})},p0=({showNoBlockSelectedMessage:e=!0})=>{const{count:t,selectedBlockName:n,selectedBlockClientId:r,blockType:o,topLevelLockedBlock:i}=(0,Ul.A)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:r,getContentLockingParent:o,getTemplateLock:i}=Cf(e(hv)),s=t(),a=s&&r(s),l=a&&Sc(a);return{count:n(),selectedBlockClientId:s,selectedBlockName:a,blockType:l,topLevelLockedBlock:o(s)||("contentOnly"===i(s)||"core/block"===a?s:void 0)}}),[]),s=t0(o?.name),a=s?.length>1,l=function(e){return(0,Ul.A)((t=>{if(e){const n=t(hv).getSettings().blockInspectorAnimation,r=n?.animationParent,{getSelectedBlockClientId:o,getBlockParentsByBlockName:i}=t(hv);return i(o(),r,!0)[0]||e.name===r?n?.[e.name]:null}return null}),[e])}(o),c=rN({blockName:n});if(t>1)return(0,Td.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,Td.jsx)(SQ,{}),a?(0,Td.jsx)(QQ,{tabs:s}):(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(IA.Slot,{}),(0,Td.jsx)(IA.Slot,{group:"color",label:(0,H.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,Td.jsx)(IA.Slot,{group:"typography",label:(0,H.__)("Typography")}),(0,Td.jsx)(IA.Slot,{group:"dimensions",label:(0,H.__)("Dimensions")}),(0,Td.jsx)(IA.Slot,{group:"border",label:c}),(0,Td.jsx)(IA.Slot,{group:"styles"})]})]});const u=n===kc();return o&&r&&!u?i?(0,Td.jsx)(c0,{topLevelLockedBlock:i}):(0,Td.jsx)(u0,{animate:l,wrapper:e=>(0,Td.jsx)(d0,{blockInspectorAnimationSettings:l,selectedBlockClientId:r,children:e}),children:(0,Td.jsx)(h0,{clientId:r,blockName:o.name})}):e?(0,Td.jsx)("span",{className:"block-editor-block-inspector__no-blocks",children:(0,H.__)("No block selected.")}):null},f0={placement:"top-start"},m0={...f0,flip:!1,shift:!0},g0={...f0,flip:!0,shift:!1};function b0(e,t,n,r,o){if(!e||!t)return m0;const i=n?.scrollTop||0,s=t.getBoundingClientRect(),a=i+e.getBoundingClientRect().top,l=e.ownerDocument.documentElement.clientHeight,c=a+r,u=s.top>c,d=s.height>l-r;return o||!u&&!d?g0:m0}function y0({contentElement:e,clientId:t}){const n=qC(t),[r,o]=(0,S.useState)(0),{blockIndex:i,isSticky:s}=(0,Ul.A)((e=>{const{getBlockIndex:n,getBlockAttributes:r}=e(hv);return{blockIndex:n(t),isSticky:zL(r(t))}}),[t]),a=(0,S.useMemo)((()=>{if(e)return(0,LW.A)(e)}),[e]),[l,c]=(0,S.useState)((()=>b0(e,n,a,r,s))),u=(0,UC.A)((e=>{o(e.offsetHeight)}),[]),d=(0,S.useCallback)((()=>c(b0(e,n,a,r,s))),[e,n,a,r]);return(0,S.useLayoutEffect)(d,[i,d]),(0,S.useLayoutEffect)((()=>{if(!e||!n)return;const t=e?.ownerDocument?.defaultView;let r;t?.addEventHandler?.("resize",d);const o=n?.ownerDocument?.defaultView;return o.ResizeObserver&&(r=new o.ResizeObserver(d),r.observe(n)),()=>{t?.removeEventHandler?.("resize",d),r&&r.disconnect()}}),[d,e,n]),{...l,ref:u}}function v0(e){const t=(0,Ul.A)((t=>{const{getBlockRootClientId:n,getBlockParents:r,__experimentalGetBlockListSettingsForBlocks:o,isBlockInsertionPointVisible:i,getBlockInsertionPoint:s,getBlockOrder:a,hasMultiSelection:l,getLastMultiSelectedBlockClientId:c}=t(hv),u=r(e),d=o(u),h=u.find((e=>d[e]?.__experimentalCaptureToolbars));let p=!1;if(i()){const t=s();p=a(t.rootClientId)[t.index]===e}return{capturingClientId:h,isInsertionPointVisible:p,lastClientId:l()?c():null,rootClientId:n(e)}}),[e]);return t}function _0({clientId:e,__unstableContentRef:t}){const{capturingClientId:n,isInsertionPointVisible:r,lastClientId:o,rootClientId:i}=v0(e),s=y0({contentElement:t?.current,clientId:e});return(0,Td.jsx)(eS,{clientId:n||e,bottomClientId:o,className:(0,$v.A)("block-editor-block-list__block-side-inserter-popover",{"is-insertion-point-visible":r}),__unstableContentRef:t,...s,children:(0,Td.jsx)("div",{className:"block-editor-block-list__empty-block-inserter",children:(0,Td.jsx)(rJ,{position:"bottom right",rootClientId:i,clientId:e,__experimentalIsQuick:!0})})})}const x0=function({clientIds:e,hideDragHandle:t,isBlockMoverUpButtonDisabled:n,isBlockMoverDownButtonDisabled:r}){const{canMove:o,rootClientId:i,isFirst:s,isLast:a,orientation:l}=(0,Ul.A)((t=>{const{getBlockIndex:n,getBlockListSettings:r,canMoveBlocks:o,getBlockOrder:i,getBlockRootClientId:s}=t(hv),a=Array.isArray(e)?e:[e],l=a[0],c=s(l),u=n(l),d=n(a[a.length-1]),h=i(c);return{canMove:o(e,c),rootClientId:c,isFirst:0===u,isLast:d===h.length-1,orientation:r(c)?.orientation}}),[e]);if(!o||s&&a&&!i)return null;const c=(0,H.__)("Drag");return(0,Td.jsxs)(a_,{className:(0,$v.A)("block-editor-block-mover",{"is-horizontal":"horizontal"===l}),children:[!t&&(0,Td.jsx)(cX,{clientIds:e,fadeWhenDisabled:!0,children:e=>(0,Td.jsx)(Zv.Ay,{icon:zq.A,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:c,tabIndex:"-1",...e})}),(0,Td.jsxs)("div",{className:"block-editor-block-mover__move-button-container",children:[(0,Td.jsx)(Qv.A,{children:t=>(0,Td.jsx)(nX,{disabled:n,clientIds:e,...t})}),(0,Td.jsx)(Qv.A,{children:t=>(0,Td.jsx)(rX,{disabled:r,clientIds:e,...t})})]})]})};function w0(){const{selectBlock:e}=(0,Vl.A)(hv),{firstParentClientId:t,isVisible:n}=(0,Ul.A)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:r,getBlockEditingMode:o}=e(hv),{hasBlockSupport:i}=e(ed),s=n(r()),a=s[s.length-1],l=Sc(t(a));return{firstParentClientId:a,isVisible:a&&"default"===o(a)&&i(l,"__experimentalParentSelector",!0)}}),[]),r=BL(t),o=(0,S.useRef)(),i=VX({ref:o,highlightParent:!0});return n?(0,Td.jsx)("div",{className:"block-editor-block-parent-selector",ref:o,...i,children:(0,Td.jsx)(r_,{className:"block-editor-block-parent-selector__button",onClick:()=>e(t),label:(0,H.sprintf)((0,H.__)("Select parent block: %s"),r?.title),showTooltip:!0,icon:(0,Td.jsx)(pz,{icon:r?.icon})})},t):null}function k0({blocks:e}){return(0,Td.jsx)("div",{className:"block-editor-block-switcher__popover__preview__parent",children:(0,Td.jsx)("div",{className:"block-editor-block-switcher__popover__preview__container",children:(0,Td.jsx)(KC.Ay,{className:"block-editor-block-switcher__preview__popover",placement:"bottom-start",focusOnMount:!1,children:(0,Td.jsxs)("div",{className:"block-editor-block-switcher__preview",children:[(0,Td.jsx)("div",{className:"block-editor-block-switcher__preview-title",children:(0,H.__)("Preview")}),(0,Td.jsx)(Bq,{viewportWidth:500,blocks:e})]})})})})}const C0={};function S0({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:r,icon:o,title:i}=e;return(0,Td.jsxs)(k_.A,{className:Rd(r),onClick:e=>{e.preventDefault(),t(r)},onMouseLeave:()=>n(null),onMouseEnter:()=>n(r),children:[(0,Td.jsx)(pz,{icon:o,showColors:!0}),i]})}const A0=({transformations:e,onSelect:t,blocks:n})=>{const[r,o]=(0,S.useState)();return(0,Td.jsxs)(Td.Fragment,{children:[r&&(0,Td.jsx)(k0,{blocks:od(n[0],e.find((({name:e})=>e===r)).attributes)}),e?.map((e=>(0,Td.jsx)(S0,{item:e,onSelect:t,setHoveredTransformItemName:o},e.name)))]})};function E0({restTransformations:e,onSelect:t,setHoveredTransformItemName:n}){return e.map((e=>(0,Td.jsx)(I0,{item:e,onSelect:t,setHoveredTransformItemName:n},e.name)))}function I0({item:e,onSelect:t,setHoveredTransformItemName:n}){const{name:r,icon:o,title:i,isDisabled:s}=e;return(0,Td.jsxs)(k_.A,{className:Rd(r),onClick:e=>{e.preventDefault(),t(r)},disabled:s,onMouseLeave:()=>n(null),onMouseEnter:()=>n(r),children:[(0,Td.jsx)(pz,{icon:o,showColors:!0}),i]})}const j0=({className:e,possibleBlockTransformations:t,possibleBlockVariationTransformations:n,onSelect:r,onSelectVariation:o,blocks:i})=>{const[s,a]=(0,S.useState)(),{priorityTextTransformations:l,restTransformations:c}=function(e){const t={"core/paragraph":1,"core/heading":2,"core/list":3,"core/quote":4},n=(0,S.useMemo)((()=>{const n=Object.keys(t),r=e.reduce(((e,t)=>{const{name:r}=t;return n.includes(r)?e.priorityTextTransformations.push(t):e.restTransformations.push(t),e}),{priorityTextTransformations:[],restTransformations:[]});if(1===r.priorityTextTransformations.length&&"core/quote"===r.priorityTextTransformations[0].name){const e=r.priorityTextTransformations.pop();r.restTransformations.push(e)}return r}),[e]);return n.priorityTextTransformations.sort((({name:e},{name:n})=>t[e]<t[n]?-1:1)),n}(t),u=l.length&&c.length,d=!!c.length&&(0,Td.jsx)(E0,{restTransformations:c,onSelect:r,setHoveredTransformItemName:a});return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsxs)(w_.A,{label:(0,H.__)("Transform to"),className:e,children:[s&&(0,Td.jsx)(k0,{blocks:dd(i,s)}),!!n?.length&&(0,Td.jsx)(A0,{transformations:n,blocks:i,onSelect:o}),l.map((e=>(0,Td.jsx)(I0,{item:e,onSelect:r,setHoveredTransformItemName:a},e.name))),!u&&d]}),!!u&&(0,Td.jsx)(w_.A,{className:e,children:d})]})},T0=()=>{};function B0({clientId:e,onSwitch:t=T0}){const{onSelect:n,stylesToRender:r,activeStyle:o}=NQ({clientId:e,onSwitch:t});return r&&0!==r.length?(0,Td.jsx)(Td.Fragment,{children:r.map((e=>{const t=e.label||e.name;return(0,Td.jsx)(k_.A,{icon:o.name===e.name?ZS.A:null,onClick:()=>n(e),children:(0,Td.jsx)(NT.A,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0,children:t})},e.name)}))}):null}function R0({hoveredBlock:e,onSwitch:t}){const{clientId:n}=e;return(0,Td.jsx)(w_.A,{label:(0,H.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup",children:(0,Td.jsx)(B0,{clientId:n,onSwitch:t})})}const N0=(e,t,n=new Set)=>{const{clientId:r,name:o,innerBlocks:i=[]}=e;if(!n.has(r)){if(o===t)return e;for(const e of i){const r=N0(e,t,n);if(r)return r}}},D0=(e,t)=>{const n=((e,t)=>{const n=function(e,t){const n=Sc(e)?.attributes;if(!n)return[];const r=Object.keys(n);return t?r.filter((e=>n[e]?.__experimentalRole===t)):r}(e,"content");return n?.length?n.reduce(((e,n)=>(t[n]&&(e[n]=t[n]),e)),{}):t})(t.name,t.attributes);e.attributes={...e.attributes,...n}},{CompositeV2:M0,CompositeItemV2:P0,useCompositeStoreV2:O0}=Cf(d_.j);function L0({patterns:e,onSelect:t}){return(0,Td.jsx)("div",{className:"block-editor-block-switcher__popover__preview__parent",children:(0,Td.jsx)("div",{className:"block-editor-block-switcher__popover__preview__container",children:(0,Td.jsx)(KC.Ay,{className:"block-editor-block-switcher__preview__popover",position:"bottom right",children:(0,Td.jsx)("div",{className:"block-editor-block-switcher__preview is-pattern-list-preview",children:(0,Td.jsx)(F0,{patterns:e,onSelect:t})})})})})}function F0({patterns:e,onSelect:t}){const n=O0();return(0,Td.jsx)(M0,{store:n,role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,H.__)("Patterns list"),children:e.map((e=>(0,Td.jsx)(z0,{pattern:e,onSelect:t},e.name)))})}function z0({pattern:e,onSelect:t}){const n="block-editor-block-switcher__preview-patterns-container",r=(0,z_.A)(z0,`${n}-list__item-description`);return(0,Td.jsxs)("div",{className:`${n}-list__list-item`,children:[(0,Td.jsxs)(P0,{render:(0,Td.jsx)("div",{role:"option","aria-label":e.title,"aria-describedby":e.description?r:void 0,className:`${n}-list__item`}),onClick:()=>t(e.transformedBlocks),children:[(0,Td.jsx)(Bq,{blocks:e.transformedBlocks,viewportWidth:e.viewportWidth||500}),(0,Td.jsx)("div",{className:`${n}-list__item-title`,children:e.title})]}),!!e.description&&(0,Td.jsx)(GA.A,{id:r,children:e.description})]})}const U0=function({blocks:e,patterns:t,onSelect:n}){const[r,o]=(0,S.useState)(!1),i=((e,t)=>(0,S.useMemo)((()=>e.reduce(((e,n)=>{const r=((e,t)=>{const n=t.map((e=>od(e))),r=new Set;for(const t of e){let e=!1;for(const o of n){const n=N0(o,t.name,r);if(n){e=!0,r.add(n.clientId),D0(n,t);break}}if(!e)return}return n})(t,n.blocks);return r&&e.push({...n,transformedBlocks:r}),e}),[])),[e,t]))(t,e);return i.length?(0,Td.jsxs)(w_.A,{className:"block-editor-block-switcher__pattern__transforms__menugroup",children:[r&&(0,Td.jsx)(L0,{patterns:i,onSelect:n}),(0,Td.jsx)(k_.A,{onClick:e=>{e.preventDefault(),o(!r)},icon:jU.A,children:(0,H.__)("Patterns")})]}):null};function V0({onClose:e,clientIds:t,hasBlockStyles:n,canRemove:r}){const{replaceBlocks:o,multiSelect:i,updateBlockAttributes:s}=(0,Vl.A)(hv),{possibleBlockTransformations:a,patterns:l,blocks:c}=(0,Ul.A)((e=>{const{getBlocksByClientId:n,getBlockRootClientId:r,getBlockTransformItems:o,__experimentalGetPatternTransformItems:i}=e(hv),s=r(Array.isArray(t)?t[0]:t),a=n(t);return{blocks:a,possibleBlockTransformations:o(a,s),patterns:i(a,s)}}),[t]),u=function({clientIds:e,blocks:t}){const{activeBlockVariation:n,blockVariationTransformations:r}=(0,Ul.A)((n=>{const{getBlockRootClientId:r,getBlockAttributes:o,canRemoveBlocks:i}=n(hv),{getActiveBlockVariation:s,getBlockVariations:a}=n(ed),l=r(Array.isArray(e)?e[0]:e),c=i(e,l);if(1!==t.length||!c)return C0;const[u]=t;return{blockVariationTransformations:a(u.name,"transform"),activeBlockVariation:s(u.name,o(u.clientId))}}),[e,t]),o=(0,S.useMemo)((()=>r?.filter((({name:e})=>e!==n?.name))),[r,n]);return o}({clientIds:t,blocks:c});function d(e){e.length>1&&i(e[0].clientId,e[e.length-1].clientId)}const h=1===c.length&&Tc(c[0]),p=!!a.length&&r&&!h,f=!!u?.length,m=!!l?.length&&r,g=p||f;return n||g||m?(0,Td.jsxs)("div",{className:"block-editor-block-switcher__container",children:[m&&(0,Td.jsx)(U0,{blocks:c,patterns:l,onSelect:n=>{!function(e){o(t,e),d(e)}(n),e()}}),g&&(0,Td.jsx)(j0,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:a,possibleBlockVariationTransformations:u,blocks:c,onSelect:n=>{!function(e){const n=dd(c,e);o(t,n),d(n)}(n),e()},onSelectVariation:t=>{!function(e){s(c[0].clientId,{...u.find((({name:t})=>t===e)).attributes})}(t),e()}}),n&&(0,Td.jsx)(R0,{hoveredBlock:c[0],onSwitch:e})]}):(0,Td.jsx)("p",{className:"block-editor-block-switcher__no-transforms",children:(0,H.__)("No transforms.")})}const H0=({clientIds:e,disabled:t})=>{const{canRemove:n,hasBlockStyles:r,icon:o,invalidBlocks:i,isReusable:s,isTemplate:a}=(0,Ul.A)((t=>{const{getBlockRootClientId:n,getBlocksByClientId:r,getBlockAttributes:o,canRemoveBlocks:i}=t(hv),{getBlockStyles:s,getBlockType:a,getActiveBlockVariation:l}=t(ed),c=r(e);if(!c.length||c.some((e=>!e)))return{invalidBlocks:!0};const u=n(Array.isArray(e)?e[0]:e),[{name:d}]=c,h=1===c.length,p=a(d);let f;if(h){const t=l(d,o(e[0]));f=t?.icon||p.icon}else{const e=1===new Set(c.map((({name:e})=>e))).size;f=e?p.icon:BT.A}return{canRemove:i(e,u),hasBlockStyles:h&&!!s(d)?.length,icon:f,isReusable:h&&jc(c[0]),isTemplate:h&&Tc(c[0])}}),[e]),l=UJ({clientId:e?.[0],maximumLength:35});if(i)return null;const c=1===e.length,u=c?l:(0,H.__)("Multiple blocks selected");if(t||!r&&!n)return(0,Td.jsx)(a_,{children:(0,Td.jsx)(r_,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:u,icon:(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(pz,{icon:o,showColors:!0}),(s||a)&&(0,Td.jsx)("span",{className:"block-editor-block-switcher__toggle-text",children:l})]})})});const d=c?(0,H.__)("Change block type or style"):(0,H.sprintf)((0,H._n)("Change type of %d block","Change type of %d blocks",e.length),e.length);return(0,Td.jsx)(a_,{children:(0,Td.jsx)(Qv.A,{children:t=>(0,Td.jsx)(i_.A,{className:"block-editor-block-switcher",label:u,popoverProps:{placement:"bottom-start",className:"block-editor-block-switcher__popover"},icon:(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(pz,{icon:o,className:"block-editor-block-switcher__toggle",showColors:!0}),(s||a)&&(0,Td.jsx)("span",{className:"block-editor-block-switcher__toggle-text",children:l})]}),toggleProps:{describedBy:d,...t},menuProps:{orientation:"both"},children:({onClose:t})=>(0,Td.jsx)(V0,{onClose:t,clientIds:e,hasBlockStyles:r,canRemove:n})})})})},{Fill:$0,Slot:W0}=(0,Hl.QJ)("__unstableBlockToolbarLastItem");$0.Slot=W0;const G0=$0,q0=function({clientIds:e,...t}){return(0,Td.jsx)(a_,{children:(0,Td.jsx)(Qv.A,{children:n=>(0,Td.jsx)(qX,{clientIds:e,toggleProps:n,...t})})})};function K0({clientId:e}){const{canLock:t,isLocked:n}=GF(e),[r,o]=(0,S.useReducer)((e=>!e),!1),i=(0,S.useRef)(!1);if((0,S.useEffect)((()=>{n&&(i.current=!0)}),[n]),!n&&!i.current)return null;let s=n?(0,H.__)("Unlock"):(0,H.__)("Lock");return!t&&n&&(s=(0,H.__)("Locked")),(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(a_,{className:"block-editor-block-lock-toolbar",children:(0,Td.jsx)(r_,{accessibleWhenDisabled:!0,disabled:!t,icon:n?JF.A:qF.A,label:s,onClick:o,"aria-expanded":r,"aria-haspopup":"dialog"})}),r&&(0,Td.jsx)(QF,{clientId:e,onClose:o})]})}var Y0=n(45287),J0=n(21572),X0=n(33040),Z0=n(83950);const Q0={group:{type:"constrained"},row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"},grid:{type:"grid"}},e1=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:r}=$F(),{replaceBlocks:o}=(0,Vl.A)(hv),{canRemove:i,variations:s}=(0,Ul.A)((e=>{const{canRemoveBlocks:r}=e(hv),{getBlockVariations:o}=e(ed);return{canRemove:r(t),variations:o(n,"transform")}}),[t,n]),a=r=>{const i=dd(e,n);"string"!=typeof r&&(r="group"),i&&i.length>0&&(i[0].attributes.layout=Q0[r],o(t,i))};if(!r||!i)return null;const l=!!s.find((({name:e})=>"group-row"===e)),c=!!s.find((({name:e})=>"group-stack"===e)),u=!!s.find((({name:e})=>"group-grid"===e));return(0,Td.jsxs)(a_,{children:[(0,Td.jsx)(r_,{icon:Y0.A,label:(0,H._x)("Group","verb"),onClick:a}),l&&(0,Td.jsx)(r_,{icon:J0.A,label:(0,H._x)("Row","single horizontal line"),onClick:()=>a("row")}),c&&(0,Td.jsx)(r_,{icon:X0.A,label:(0,H._x)("Stack","verb"),onClick:()=>a("stack")}),u&&(0,Td.jsx)(r_,{icon:Z0.A,label:(0,H._x)("Grid","verb"),onClick:()=>a("grid")})]})};function t1({clientIds:e}){const t=1===e.length?e[0]:void 0,n=(0,Ul.A)((e=>!!t&&"html"===e(hv).getBlockMode(t)),[t]),{toggleBlockMode:r}=(0,Vl.A)(hv);return n?(0,Td.jsx)(a_,{children:(0,Td.jsx)(r_,{onClick:()=>{r(t)},children:(0,H.__)("Edit visually")})}):null}const n1=(0,S.createContext)("");var r1=n(4733);const o1=[];function i1(e){return(0,Td.jsx)(a_,{children:(0,Td.jsx)(r_,{...e})})}function s1({clientId:e,as:t=i1}){const{categories:n,patterns:r,patternName:o}=(0,Ul.A)((t=>{const{getBlockAttributes:n,getBlockRootClientId:r,__experimentalGetAllowedPatterns:o}=t(hv),i=n(e),s=i?.metadata?.categories||o1,a=i?.metadata?.patternName;return{categories:s,patterns:o(r(e)),patternName:a}}),[e]),{replaceBlocks:i}=(0,Vl.A)(hv),s=(0,S.useMemo)((()=>n&&0!==n.length&&r&&0!==r.length?r.filter((e=>1===e.blocks.length&&e.categories?.some((e=>n.includes(e))))):o1),[n,r]);if(0===s.length)return null;const a=t;return(0,Td.jsx)(a,{label:(0,H.__)("Shuffle"),icon:r1.A,onClick:()=>{const t=function(){const e=s.length,t=s.findIndex((({name:e})=>e===o));return s[t+1<e?t+1:0]}();t.blocks[0].attributes={...t.blocks[0].attributes,metadata:{...t.blocks[0].attributes.metadata,categories:n}},i(e,t.blocks)}})}function a1({clientIds:e}){const t=1===e.length,{icon:n,firstBlockName:r,isConnectedToPatternOverrides:o}=(0,Ul.A)((n=>{const{getBlockAttributes:r,getBlockNamesByClientId:o,getBlocksByClientId:i}=n(hv),{getBlockType:s,getActiveBlockVariation:a}=n(ed),l=o(e),c=l[0],u=s(c);let d;if(t){const t=a(c,r(e[0]));d=t?.icon||u.icon}else d=1===new Set(l).size?u.icon:BT.A;return{icon:d,firstBlockName:r(e[0]).metadata.name,isConnectedToPatternOverrides:i(e).some((e=>Object.values(e?.attributes.metadata?.bindings).some((e=>"core/pattern-overrides"===e.source))))}}),[e,t]),i=UJ({clientId:e[0],maximumLength:35});let s=t?(0,H._x)("This block is connected.","block toolbar button label and description"):(0,H._x)("These blocks are connected.","block toolbar button label and description");o&&r&&(s=t?(0,H.sprintf)((0,H.__)('This %1$s is editable using the "%2$s" override.'),i.toLowerCase(),r):(0,H.__)("These blocks are editable using overrides."));const a=(0,S.useId)();return(0,Td.jsx)(a_,{children:(0,Td.jsx)(Qv.A,{children:e=>(0,Td.jsx)(i_.A,{className:"block-editor-block-bindings-toolbar-indicator",label:i,popoverProps:{placement:"bottom-start",className:"block-editor-block-bindings-toolbar-indicator__popover"},icon:(0,Td.jsx)(Td.Fragment,{children:(0,Td.jsx)(pz,{icon:n,className:"block-editor-block-bindings-toolbar-indicator-icon",showColors:!0})}),toggleProps:{describedBy:s,...e},menuProps:{orientation:"both","aria-describedby":a},children:()=>(0,Td.jsx)(NT.A,{id:a,children:s})})})})}function l1(e="default"){const t=c_[e]?.Slot,n=f_(t?.__unstableName);return t?!!n?.length:(!0===globalThis.SCRIPT_DEBUG&&(0,m_.default)(`Unknown BlockControls group "${e}" provided.`),null)}function c1(){const{isToolbarEnabled:e,isDefaultEditingMode:t}=(0,Ul.A)((e=>{const{getBlockEditingMode:t,getBlockName:n,getBlockSelectionStart:r}=e(hv),o=r(),i=o&&Sc(n(o));return{isToolbarEnabled:i&&Ic(i,"__experimentalToolbar",!0),isDefaultEditingMode:"default"===t(o)}}),[]),n=function(){let e=!1;for(const t in c_)l1(t)&&(e=!0);return e}();return!(!e||!t&&!n)}function u1({hideDragHandle:e,focusOnMount:t,__experimentalInitialIndex:n,__experimentalOnIndexChange:r,variant:o="unstyled"}){const{blockClientId:i,blockClientIds:s,isDefaultEditingMode:a,blockType:l,blockName:c,toolbarKey:u,shouldShowVisualToolbar:d,showParentSelector:h,isUsingBindings:p}=(0,Ul.A)((e=>{const{getBlockName:t,getBlockMode:n,getBlockParents:r,getSelectedBlockClientIds:o,isBlockValid:i,getBlockRootClientId:s,getBlockEditingMode:a,getBlockAttributes:l}=e(hv),c=o(),u=c[0],d=s(u),h=r(u),p=h[h.length-1],f=Sc(t(p)),m="default"===a(u),g=t(u),b=c.every((e=>i(e))),y=c.every((e=>"visual"===n(e))),v=!!l(u)?.metadata?.bindings;return{blockClientId:u,blockClientIds:c,isDefaultEditingMode:m,blockName:g,blockType:u&&Sc(g),shouldShowVisualToolbar:b&&y,rootClientId:d,toolbarKey:`${u}${p}`,showParentSelector:f&&"default"===a(p)&&Ic(f,"__experimentalParentSelector",!0)&&1===c.length&&m,isUsingBindings:v}}),[]),f=(0,S.useRef)(null),m=(0,S.useRef)(),g=VX({ref:m}),b=!(0,YU.A)("medium","<");if(!c1())return null;const y=s.length>1,v=jc(l)||Tc(l),_=(0,$v.A)("block-editor-block-contextual-toolbar",{"has-parent":h}),x=(0,$v.A)("block-editor-block-toolbar",{"is-synced":v});return(0,Td.jsx)(IZ,{focusEditorOnEscape:!0,className:_,"aria-label":(0,H.__)("Block tools"),variant:"toolbar"===o?void 0:o,focusOnMount:t,__experimentalInitialIndex:n,__experimentalOnIndexChange:r,children:(0,Td.jsxs)("div",{ref:f,className:x,children:[!y&&b&&a&&(0,Td.jsx)(w0,{}),p&&yz(c)&&(0,Td.jsx)(a1,{clientIds:s}),(d||y)&&(a||v)&&(0,Td.jsx)("div",{ref:m,...g,children:(0,Td.jsxs)(a_,{className:"block-editor-block-toolbar__block-controls",children:[(0,Td.jsx)(H0,{clientIds:s,disabled:!a}),a&&(0,Td.jsxs)(Td.Fragment,{children:[!y&&(0,Td.jsx)(K0,{clientId:i}),(0,Td.jsx)(x0,{clientIds:s,hideDragHandle:e})]})]})}),(0,Td.jsx)(s1,{clientId:i}),d&&y&&(0,Td.jsx)(e1,{}),d&&(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(__.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,Td.jsx)(__.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,Td.jsx)(__.Slot,{className:"block-editor-block-toolbar__slot"}),(0,Td.jsx)(__.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,Td.jsx)(__.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,Td.jsx)(n1.Provider,{value:l?.name,children:(0,Td.jsx)(G0.Slot,{})})]}),(0,Td.jsx)(t1,{clientIds:s}),a&&(0,Td.jsx)(q0,{clientIds:s})]})},u)}function d1({clientId:e,isTyping:t,__unstableContentRef:n}){const{capturingClientId:r,isInsertionPointVisible:o,lastClientId:i}=v0(e),s=(0,S.useRef)();(0,S.useEffect)((()=>{s.current=void 0}),[e]);const{stopTyping:a}=(0,Vl.A)(hv),l=(0,S.useRef)(!1);(0,OU.wk)("core/block-editor/focus-toolbar",(()=>{l.current=!0,a(!0)})),(0,S.useEffect)((()=>{l.current=!1}));const c=y0({contentElement:n?.current,clientId:e});return!t&&(0,Td.jsx)(ZC,{clientId:r||e,bottomClientId:i,className:(0,$v.A)("block-editor-block-list__block-popover",{"is-insertion-point-visible":o}),resize:!1,...c,children:(0,Td.jsx)(u1,{focusOnMount:l.current,__experimentalInitialIndex:s.current,__experimentalOnIndexChange:e=>{s.current=e},variant:"toolbar"})})}var h1=n(89626);function p1({clientId:e,maximumLength:t,context:n}){return UJ({clientId:e,maximumLength:t,context:n})}const f1=function({clientId:e,rootClientId:t}){const n=(0,Ul.A)((n=>{const{getBlock:r,getBlockIndex:o,hasBlockMovingClientId:i,getBlockListSettings:s,__unstableGetEditorMode:a,getNextBlockClientId:l,getPreviousBlockClientId:c,canRemoveBlock:u,canMoveBlock:d}=n(hv),{getActiveBlockVariation:h,getBlockType:p}=n(ed),f=o(e),{name:m,attributes:g}=r(e),b=p(m),y=s(t)?.orientation,v=h(m,g),_="core/template-part"===b?.name;let x=!1;const w=l();if(w){const{name:e}=r(w),t=p(e);x="core/template-part"===t?.name}let k=!1;const C=c();if(C){const{name:e}=r(C),t=p(e);k="core/template-part"===t?.name}return{blockMovingMode:i(),editorMode:a(),icon:v?.icon||b.icon,label:Lc(b,g,f+1,y),isBlockTemplatePart:_,isNextBlockTemplatePart:x,isPrevBlockTemplatePart:k,canRemove:u(e,t),canMove:d(e,t)}}),[e,t]),{label:r,icon:o,blockMovingMode:i,editorMode:s,isBlockTemplatePart:a,isNextBlockTemplatePart:l,isPrevBlockTemplatePart:c,canRemove:u,canMove:d}=n,{setNavigationMode:h,removeBlock:p}=(0,Vl.A)(hv),f=(0,S.useRef)();(0,S.useEffect)((()=>{"navigation"===s&&(f.current.focus(),(0,Jb.speak)(r))}),[r,s]);const m=qC(e),{hasBlockMovingClientId:g,getBlockIndex:b,getBlockRootClientId:y,getClientIdsOfDescendants:v,getSelectedBlockClientId:_,getMultiSelectedBlocksEndClientId:x,getPreviousBlockClientId:w,getNextBlockClientId:k}=(0,Ul.A)(hv),{selectBlock:C,clearSelectedBlock:A,setBlockMovingClientId:E,moveBlockToPosition:I}=(0,Vl.A)(hv),j=(0,$v.A)("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!i}),T=(0,H.__)("Drag"),B=d&&"navigation"===s||"zoom-out"===s&&d&&!a;return(0,Td.jsx)("div",{className:j,children:(0,Td.jsxs)(B_.A,{justify:"center",className:"block-editor-block-list__block-selection-button__content",children:[(0,Td.jsx)(R_.A,{children:(0,Td.jsx)(pz,{icon:o,showColors:!0})}),B&&(0,Td.jsx)(R_.A,{children:(0,Td.jsx)(cX,{clientIds:[e],children:e=>(0,Td.jsx)(Zv.Ay,{icon:zq.A,className:"block-selection-button_drag-handle","aria-hidden":"true",label:T,tabIndex:"-1",...e})})}),"zoom-out"===s&&!a&&(0,Td.jsx)(R_.A,{children:(0,Td.jsx)(x0,{clientIds:[e],hideDragHandle:!0,isBlockMoverUpButtonDisabled:c,isBlockMoverDownButtonDisabled:l})}),d&&u&&"zoom-out"===s&&(0,Td.jsx)(s1,{clientId:e,as:Zv.Ay}),u&&"zoom-out"===s&&!a&&(0,Td.jsx)(R_.A,{children:(0,Td.jsx)(r_,{icon:h1.A,label:"Delete",onClick:()=>{p(e)}})}),"navigation"===s&&(0,Td.jsx)(R_.A,{children:(0,Td.jsx)(Zv.Ay,{ref:f,onClick:"navigation"===s?()=>h(!1):void 0,onKeyDown:function(t){const{keyCode:n}=t,r=n===VE.UP,o=n===VE.DOWN,i=n===VE.LEFT,a=n===VE.RIGHT,l=n===VE.TAB,c=n===VE.ESCAPE,u=n===VE.ENTER,d=n===VE.SPACE,f=t.shiftKey;if(c&&"navigation"===s)return h(!1),void t.preventDefault();if(n===VE.BACKSPACE||n===VE.DELETE)return p(e),void t.preventDefault();const S=_(),j=x(),T=w(j||S),B=k(j||S),R=l&&f||r,N=l&&!f||o,D=i,M=a;let P;if(R)P=T;else if(N)P=B;else if(D){var O;P=null!==(O=y(S))&&void 0!==O?O:S}else if(M){var L;P=null!==(L=v(S)[0])&&void 0!==L?L:S}const F=g();if(c&&F&&!t.defaultPrevented&&(E(null),t.preventDefault()),(u||d)&&F){const e=y(F),t=y(S),n=b(F);let r=b(S);n<r&&e===t&&(r-=1),I(F,e,t,r),C(F),E(null)}if((!F||S!==F||!M)&&(N||R||D||M))if(P)t.preventDefault(),C(P);else if(l&&S){let e;if(N){e=m;do{e=ME.focus.tabbable.findNext(e)}while(e&&m.contains(e));e||(e=m.ownerDocument.defaultView.frameElement,e=ME.focus.tabbable.findNext(e))}else e=ME.focus.tabbable.findPrevious(m);e&&(t.preventDefault(),e.focus(),A())}},label:r,showTooltip:!1,className:"block-selection-button_select-button",children:(0,Td.jsx)(p1,{clientId:e,maximumLength:35})})})]})})};function m1({clientId:e,__unstableContentRef:t}){const{capturingClientId:n,isInsertionPointVisible:r,lastClientId:o,rootClientId:i}=v0(e),s=y0({contentElement:t?.current,clientId:e});return(0,Td.jsx)(XC,{clientId:n||e,bottomClientId:o,className:(0,$v.A)("block-editor-block-list__block-popover",{"is-insertion-point-visible":r}),resize:!1,...s,children:(0,Td.jsx)(f1,{clientId:e,rootClientId:i})})}const g1=function(){const[e,t]=(0,S.useState)(!1),{blockOrder:n,sectionRootClientId:r,insertionPoint:o,setInserterIsOpened:i,selectedSection:s}=(0,Ul.A)((e=>{const{getSettings:t,getBlockOrder:n}=e(hv),{sectionRootClientId:r}=Cf(t()),o=e("core/editor");return{selectedSection:o.getSelectedBlock(),blockOrder:n(r),insertionPoint:Cf(o).getInsertionPoint(),sectionRootClientId:r,setInserterIsOpened:t().__experimentalSetIsInserterOpened}}),[]),a=(0,S.useRef)(!1);return(0,S.useEffect)((()=>{a.current?i(!0):a.current=!0}),[n,i]),(0,S.useEffect)((()=>{const e=setTimeout((()=>{t(!0)}),500);return()=>{clearTimeout(e)}}),[]),e&&s?[void 0,...n].map(((e,t)=>(0,Td.jsxs)(fG,{previousClientId:e,nextClientId:n[t],children:[o.insertionIndex===t&&(0,Td.jsx)("div",{style:{borderRadius:"0",height:"12px",opacity:1,transform:"translateY(-50%)",width:"100%"},className:"block-editor-block-list__insertion-point-indicator"}),o.insertionIndex!==t&&(0,Td.jsx)(Zv.Ay,{variant:"primary",icon:QS.A,size:"compact",className:"block-editor-button-pattern-inserter__button",onClick:()=>{i({rootClientId:r,insertionIndex:t,tab:"patterns",category:"all"})},label:(0,H._x)("Add pattern","Generic label for pattern inserter button")})]},t))):null};function b1(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getSettings:r,__unstableGetEditorMode:o,isTyping:i}=e(hv),s=t()||n(),a=o();return{clientId:s,hasFixedToolbar:r().hasFixedToolbar,isTyping:i(),isZoomOutMode:"zoom-out"===a}}function y1({children:e,__unstableContentRef:t,...n}){const{clientId:r,hasFixedToolbar:o,isTyping:i,isZoomOutMode:s}=(0,Ul.A)(b1,[]),a=(0,OU.ZK)(),{getBlocksByClientId:l,getSelectedBlockClientIds:c,getBlockRootClientId:u,isGroupable:d}=(0,Ul.A)(hv),{getGroupingBlockName:h}=(0,Ul.A)(ed),{showEmptyBlockSideInserter:p,showBreadcrumb:f,showBlockToolbarPopover:m}=(0,Ul.A)((e=>{const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlock:r,getSettings:o,hasMultiSelection:i,__unstableGetEditorMode:s,isTyping:a}=e(hv),l=t()||n(),c=r(l)||{name:"",attributes:{}},u=s(),d=l&&c?.name,h=Dc(c),p=l&&!a()&&"edit"===u&&h,f=d&&!i()&&("navigation"===u||"zoom-out"===u);return{showEmptyBlockSideInserter:p,showBreadcrumb:!p&&f,showBlockToolbarPopover:!o().hasFixedToolbar&&!p&&d&&!h&&!f}}),[]),{duplicateBlocks:g,removeBlocks:b,replaceBlocks:y,insertAfterBlock:v,insertBeforeBlock:_,selectBlock:x,moveBlocksUp:w,moveBlocksDown:k,expandBlock:C}=Cf((0,Vl.A)(hv)),A=YC(t),E=YC(t);return(0,Td.jsx)("div",{...n,onKeyDown:function(e){if(!e.defaultPrevented)if(a("core/block-editor/move-up",e)){const t=c();if(t.length){e.preventDefault();const n=u(t[0]);w(t,n)}}else if(a("core/block-editor/move-down",e)){const t=c();if(t.length){e.preventDefault();const n=u(t[0]);k(t,n)}}else if(a("core/block-editor/duplicate",e)){const t=c();t.length&&(e.preventDefault(),g(t))}else if(a("core/block-editor/remove",e)){const t=c();t.length&&(e.preventDefault(),b(t))}else if(a("core/block-editor/insert-after",e)){const t=c();t.length&&(e.preventDefault(),v(t[t.length-1]))}else if(a("core/block-editor/insert-before",e)){const t=c();t.length&&(e.preventDefault(),_(t[0]))}else if(a("core/block-editor/unselect",e)){if(e.target.closest("[role=toolbar]"))return;const t=c();t.length>1&&(e.preventDefault(),x(t[0]))}else if(a("core/block-editor/collapse-list-view",e)){if((0,UW.A)(e.target)||(0,UW.A)(e.target?.contentWindow?.document?.activeElement))return;e.preventDefault(),C(r)}else if(a("core/block-editor/group",e)){const t=c();if(t.length>1&&d(t)){e.preventDefault();const n=dd(l(t),h());y(t,n),(0,Jb.speak)((0,H.__)("Selected blocks are grouped."))}}},children:(0,Td.jsxs)(bG.Provider,{value:(0,S.useRef)(!1),children:[!i&&(0,Td.jsx)(vG,{__unstableContentRef:t}),p&&(0,Td.jsx)(_0,{__unstableContentRef:t,clientId:r}),m&&(0,Td.jsx)(d1,{__unstableContentRef:t,clientId:r,isTyping:i}),f&&(0,Td.jsx)(m1,{__unstableContentRef:t,clientId:r}),!s&&!o&&(0,Td.jsx)(KC.Ay.Slot,{name:"block-toolbar",ref:A}),e,(0,Td.jsx)(KC.Ay.Slot,{name:"__unstable-block-tools-after",ref:E}),window.__experimentalEnableZoomedOutPatternsTab&&s&&(0,Td.jsx)(g1,{__unstableContentRef:t})]})})}const v1=()=>{},_1=(0,S.forwardRef)((function({rootClientId:e,clientId:t,isAppender:n,showInserterHelpPanel:r,showMostUsedBlocks:o=!1,__experimentalInsertionIndex:i,__experimentalInitialTab:s,__experimentalInitialCategory:a,__experimentalFilterValue:l,onPatternCategorySelection:c,onSelect:u=v1,shouldFocusBlock:d=!1,onClose:h},p){const{destinationRootClientId:f}=(0,Ul.A)((n=>{const{getBlockRootClientId:r}=n(hv);return{destinationRootClientId:e||r(t)||void 0}}),[t,e]);return(0,Td.jsx)(XY,{onSelect:u,rootClientId:f,clientId:t,isAppender:n,showInserterHelpPanel:r,showMostUsedBlocks:o,__experimentalInsertionIndex:i,__experimentalFilterValue:l,onPatternCategorySelection:c,__experimentalInitialTab:s,__experimentalInitialCategory:a,shouldFocusBlock:d,ref:p,onClose:h})})),x1=(0,S.forwardRef)((function(e,t){return(0,Td.jsx)(_1,{...e,onPatternCategorySelection:void 0,ref:t})})),w1={button:"wp-element-button",caption:"wp-element-caption"},k1=e=>w1[e]?w1[e]:"";function C1(e,t,n){return"core/image"===e&&n?.lightbox?.allowEditing||!!t?.lightbox}function S1({onChange:e,value:t,inheritedValue:n,panelId:r}){const o=()=>{e(void 0)};let i=!1;return n?.lightbox?.enabled&&(i=n.lightbox.enabled),(0,Td.jsx)(Td.Fragment,{children:(0,Td.jsx)(wA,{label:(0,H._x)("Settings","Image settings"),resetAll:o,panelId:r,dropdownMenuProps:jv,children:(0,Td.jsx)(YA,{hasValue:()=>!!t?.lightbox,label:(0,H.__)("Expand on click"),onDeselect:o,isShownByDefault:!0,panelId:r,children:(0,Td.jsx)(Hx.A,{label:(0,H.__)("Expand on click"),checked:i,onChange:t=>{e({enabled:t})}})})})})}var A1=n(92017);function E1({value:e,onChange:t,inheritedValue:n=e}){const[r,o]=(0,S.useState)(null),i=n?.css;return(0,Td.jsxs)(oE.A,{spacing:3,children:[r&&(0,Td.jsx)(YE.A,{status:"error",onRemove:()=>o(null),children:r}),(0,Td.jsx)(A1.A,{label:(0,H.__)("Additional CSS"),__nextHasNoMarginBottom:!0,value:i,onChange:n=>function(n){if(t({...e,css:n}),r){const[e]=wq([{css:n}],".for-validation-only");e&&o(null)}}(n),onBlur:function(e){if(!e?.target?.value)return void o(null);const[t]=wq([{css:e.target.value}],".for-validation-only");o(null===t?(0,H.__)("There is an error with your CSS structure."):null)},className:"block-editor-global-styles-advanced-panel__custom-css-input",spellCheck:!1})]})}const I1=new Map,j1=[],T1={caption:(0,H.__)("Caption"),link:(0,H.__)("Link"),button:(0,H.__)("Button"),heading:(0,H.__)("Heading"),h1:(0,H.__)("H1"),h2:(0,H.__)("H2"),h3:(0,H.__)("H3"),h4:(0,H.__)("H4"),h5:(0,H.__)("H5"),h6:(0,H.__)("H6"),"settings.color":(0,H.__)("Color"),"settings.typography":(0,H.__)("Typography"),"styles.color":(0,H.__)("Colors"),"styles.spacing":(0,H.__)("Spacing"),"styles.background":(0,H.__)("Background"),"styles.typography":(0,H.__)("Typography")},B1=(0,_h.A)((()=>Ac().reduce(((e,{name:t,title:n})=>(e[t]=n,e)),{}))),R1=e=>null!==e&&"object"==typeof e;function N1(e,t,n=""){if(!R1(e)&&!R1(t))return e!==t?n.split(".").slice(0,2).join("."):void 0;e=R1(e)?e:{},t=R1(t)?t:{};const r=new Set([...Object.keys(e),...Object.keys(t)]);let o=[];for(const i of r){const r=n?n+"."+i:i,s=N1(e[i],t[i],r);s&&(o=o.concat(s))}return o}function D1(e,t){const n=JSON.stringify({next:e,previous:t});if(I1.has(n))return I1.get(n);const r=N1({styles:{background:e?.styles?.background,color:e?.styles?.color,typography:e?.styles?.typography,spacing:e?.styles?.spacing},blocks:e?.styles?.blocks,elements:e?.styles?.elements,settings:e?.settings},{styles:{background:t?.styles?.background,color:t?.styles?.color,typography:t?.styles?.typography,spacing:t?.styles?.spacing},blocks:t?.styles?.blocks,elements:t?.styles?.elements,settings:t?.settings});if(!r.length)return I1.set(n,j1),j1;const o=[...new Set(r)].reduce(((e,t)=>{const n=function(e){if(T1[e])return T1[e];const t=e.split(".");if("blocks"===t?.[0]){const e=B1()?.[t[1]];return e||t[1]}return"elements"===t?.[0]?T1[t[1]]||t[1]:void 0}(t);return n&&e.push([t.split(".")[0],n]),e}),[]);return I1.set(n,o),o}function M1(e,t,n={}){let r=D1(e,t);const o=r.length,{maxResults:i}=n;return o?(i&&o>i&&(r=r.slice(0,i)),Object.entries(r.reduce(((e,t)=>{const n=e[t[0]]||[];return n.includes(t[1])||(e[t[0]]=[...n,t[1]]),e}),{})).map((([e,t])=>{const n=t.length,r=t.join((0,H.__)(", "));switch(e){case"blocks":return(0,H.sprintf)((0,H._n)("%s block.","%s blocks.",n),r);case"elements":return(0,H.sprintf)((0,H._n)("%s element.","%s elements.",n),r);case"settings":return(0,H.sprintf)((0,H.__)("%s settings."),r);case"styles":return(0,H.sprintf)((0,H.__)("%s styles."),r);default:return(0,H.sprintf)((0,H.__)("%s."),r)}}))):j1}function P1(e,t,n){if(null==e||!1===e)return;if(Array.isArray(e))return O1(e,t,n);switch(typeof e){case"string":case"number":return}const{type:r,props:o}=e;switch(r){case S.StrictMode:case S.Fragment:return O1(o.children,t,n);case Ad.A:return;case SJ.Content:return L1(t,n);case GZ:return void t.push(o.value)}switch(typeof r){case"string":return void 0!==o.children?O1(o.children,t,n):void 0;case"function":return P1(r.prototype&&"function"==typeof r.prototype.render?new r(o).render():r(o),t,n)}}function O1(e,...t){e=Array.isArray(e)?e:[e];for(let n=0;n<e.length;n++)P1(e[n],...t)}function L1(e,t){for(let n=0;n<t.length;n++){const{name:r,attributes:o,innerBlocks:i}=t[n];P1(Pd(r,o,(0,Td.jsx)(SJ.Content,{})),e,i)}}const F1=[{value:"fill",label:(0,H._x)("Fill","Scale option for dimensions control"),help:(0,H.__)("Fill the space by stretching the content.")},{value:"contain",label:(0,H._x)("Contain","Scale option for dimensions control"),help:(0,H.__)("Fit the content to the space without clipping.")},{value:"cover",label:(0,H._x)("Cover","Scale option for dimensions control"),help:(0,H.__)("Fill the space by clipping what doesn't fit.")},{value:"none",label:(0,H._x)("None","Scale option for dimensions control"),help:(0,H.__)("Do not adjust the sizing of the content. Content that is too large will be clipped, and content that is too small will have additional padding.")},{value:"scale-down",label:(0,H._x)("Scale down","Scale option for dimensions control"),help:(0,H.__)("Scale down the content to fit the space if it is too big. Content that is too small will have additional padding.")}];function z1({panelId:e,value:t,onChange:n,options:r=F1,defaultValue:o=F1[0].value,isShownByDefault:i=!0}){const s=null!=t?t:"fill",a=(0,S.useMemo)((()=>r.reduce(((e,t)=>(e[t.value]=t.help,e)),{})),[r]);return(0,Td.jsx)(YA,{label:(0,H.__)("Scale"),isShownByDefault:i,hasValue:()=>s!==o,onDeselect:()=>n(o),panelId:e,children:(0,Td.jsx)(wx,{label:(0,H.__)("Scale"),isBlock:!0,help:a[s],value:s,onChange:n,size:"__unstable-large",children:r.map((e=>(0,Td.jsx)(zC,{...e},e.value)))})})}const U1=(0,W_.default)(YA,{target:"ef8pe3d0"})({name:"957xgf",styles:"grid-column:span 1"});function V1({panelId:e,value:t={},onChange:n=(()=>{}),units:r,isShownByDefault:o=!0}){var i,s;const a="auto"===t.width?"":null!==(i=t.width)&&void 0!==i?i:"",l="auto"===t.height?"":null!==(s=t.height)&&void 0!==s?s:"",c=e=>r=>{const o={...t};r?o[e]=r:delete o[e],n(o)};return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(U1,{label:(0,H.__)("Width"),isShownByDefault:o,hasValue:()=>""!==a,onDeselect:c("width"),panelId:e,children:(0,Td.jsx)(ak,{label:(0,H.__)("Width"),placeholder:(0,H.__)("Auto"),labelPosition:"top",units:r,min:0,value:a,onChange:c("width"),size:"__unstable-large"})}),(0,Td.jsx)(U1,{label:(0,H.__)("Height"),isShownByDefault:o,hasValue:()=>""!==l,onDeselect:c("height"),panelId:e,children:(0,Td.jsx)(ak,{label:(0,H.__)("Height"),placeholder:(0,H.__)("Auto"),labelPosition:"top",units:r,min:0,value:l,onChange:c("height"),size:"__unstable-large"})})]})}const H1=[{label:(0,H._x)("Thumbnail","Image size option for resolution control"),value:"thumbnail"},{label:(0,H._x)("Medium","Image size option for resolution control"),value:"medium"},{label:(0,H._x)("Large","Image size option for resolution control"),value:"large"},{label:(0,H._x)("Full Size","Image size option for resolution control"),value:"full"}],$1="isResuableBlocksrRenameHintVisible",W1=(0,N.combineReducers)({commands:function(e={},t){switch(t.type){case"REGISTER_COMMAND":return{...e,[t.name]:{name:t.name,label:t.label,searchLabel:t.searchLabel,context:t.context,callback:t.callback,icon:t.icon}};case"UNREGISTER_COMMAND":{const{[t.name]:n,...r}=e;return r}}return e},commandLoaders:function(e={},t){switch(t.type){case"REGISTER_COMMAND_LOADER":return{...e,[t.name]:{name:t.name,context:t.context,hook:t.hook}};case"UNREGISTER_COMMAND_LOADER":{const{[t.name]:n,...r}=e;return r}}return e},isOpen:function(e=!1,t){switch(t.type){case"OPEN":return!0;case"CLOSE":return!1}return e},context:function(e="root",t){return"SET_CONTEXT"===t.type?t.context:e}});function G1(e){return{type:"REGISTER_COMMAND",...e}}function q1(e){return{type:"UNREGISTER_COMMAND",name:e}}function K1(e){return{type:"REGISTER_COMMAND_LOADER",...e}}function Y1(e){return{type:"UNREGISTER_COMMAND_LOADER",name:e}}function J1(){return{type:"OPEN"}}function X1(){return{type:"CLOSE"}}const Z1=(0,Ws.A)(((e,t=!1)=>Object.values(e.commands).filter((n=>{const r=n.context&&n.context===e.context;return t?r:!r}))),(e=>[e.commands,e.context])),Q1=(0,Ws.A)(((e,t=!1)=>Object.values(e.commandLoaders).filter((n=>{const r=n.context&&n.context===e.context;return t?r:!r}))),(e=>[e.commandLoaders,e.context]));function e2(e){return e.isOpen}function t2(e){return e.context}function n2(e){return{type:"SET_CONTEXT",context:e}}const{lock:r2,unlock:o2}=(0,Nl.yf)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/commands"),i2=(0,R.A)("core/commands",{reducer:W1,actions:b,selectors:y});function s2(e){const{registerCommandLoader:t,unregisterCommandLoader:n}=(0,Vl.A)(i2);(0,S.useEffect)((()=>{if(!e.disabled)return t({name:e.name,hook:e.hook,context:e.context}),()=>{n(e.name)}}),[e.name,e.hook,e.context,e.disabled,t,n])}(0,N.register)(i2),o2(i2).registerPrivateActions(v),(0,H.__)("Search commands and settings"),r2({},{useCommandContext:function(e){const{getContext:t}=(0,Ul.A)(i2),n=(0,S.useRef)(t()),{setContext:r}=o2((0,Vl.A)(i2));(0,S.useEffect)((()=>{r(e)}),[e,r]),(0,S.useEffect)((()=>{const e=n.current;return()=>r(e)}),[r])}});var a2=n(20613),l2=n(14770);const c2=()=>{const{replaceBlocks:e,multiSelect:t}=(0,Vl.A)(hv),{blocks:n,clientIds:r,canRemove:o,possibleBlockTransformations:i,invalidSelection:s}=(0,Ul.A)((e=>{const{getBlockRootClientId:t,getBlockTransformItems:n,getSelectedBlockClientIds:r,getBlocksByClientId:o,canRemoveBlocks:i}=e(hv),s=r(),a=o(s);if(a.filter((e=>!e)).length>0)return{invalidSelection:!0};const l=t(s[0]);return{blocks:a,clientIds:s,possibleBlockTransformations:n(a,l),canRemove:i(s,l),invalidSelection:!1}}),[]);if(s)return{isLoading:!1,commands:[]};const a=1===n.length&&Tc(n[0]);const l=!!i.length&&o&&!a;if(!r||r.length<1||!l)return{isLoading:!1,commands:[]};const c=i.map((o=>{const{name:i,title:s,icon:a}=o;return{name:"core/block-editor/transform-to-"+i.replace("/","-"),label:(0,H.sprintf)((0,H.__)("Transform to %s"),s),icon:(0,Td.jsx)(pz,{icon:a}),callback:({close:o})=>{(function(o){const i=dd(n,o);var s;e(r,i),(s=i).length>1&&t(s[0].clientId,s[s.length-1].clientId)})(i),o()}}}));return{isLoading:!1,commands:c}},u2=()=>{const{clientIds:e}=(0,Ul.A)((e=>{const{getSelectedBlockClientIds:t}=e(hv);return{clientIds:t()}}),[]),{getBlockRootClientId:t,canMoveBlocks:n,getBlockCount:r}=(0,Ul.A)(hv),{setBlockMovingClientId:o,setNavigationMode:i,selectBlock:s}=(0,Vl.A)(hv);if(!e||e.length<1)return{isLoading:!1,commands:[]};const a=t(e[0]),l=[];return n(e,a)&&1!==r(a)&&l.push({name:"move-to",label:(0,H.__)("Move to"),callback:()=>{i(!0),s(e[0]),o(e[0])},icon:a2.A}),{isLoading:!1,commands:l.map((e=>({...e,name:"core/block-editor/action-"+e.name,callback:({close:t})=>{e.callback(),t()}})))}},d2=()=>{const{clientIds:e,isUngroupable:t,isGroupable:n}=(0,Ul.A)((e=>{const{getSelectedBlockClientIds:t,isUngroupable:n,isGroupable:r}=e(hv);return{clientIds:t(),isUngroupable:n(),isGroupable:r()}}),[]),{canInsertBlockType:r,getBlockRootClientId:o,getBlocksByClientId:i,canRemoveBlocks:s}=(0,Ul.A)(hv),{getDefaultBlockName:a,getGroupingBlockName:l}=(0,Ul.A)(ed),c=i(e),{removeBlocks:u,replaceBlocks:d,duplicateBlocks:h,insertAfterBlock:p,insertBeforeBlock:f}=(0,Vl.A)(hv);if(!e||e.length<1)return{isLoading:!1,commands:[]};const m=o(e[0]),g=r(a(),m),b=c.every((e=>!!e&&Ic(e.name,"multiple",!0)&&r(e.name,m))),y=s(e,m),v=[];return b&&v.push({name:"duplicate",label:(0,H.__)("Duplicate"),callback:()=>h(e,!0),icon:BT.A}),g&&v.push({name:"add-before",label:(0,H.__)("Add before"),callback:()=>{const t=Array.isArray(e)?e[0]:t;f(t)},icon:QS.A},{name:"add-after",label:(0,H.__)("Add after"),callback:()=>{const t=Array.isArray(e)?e[e.length-1]:t;p(t)},icon:QS.A}),n&&v.push({name:"Group",label:(0,H.__)("Group"),callback:()=>{if(!c.length)return;const t=l(),n=dd(c,t);n&&d(e,n)},icon:Y0.A}),t&&v.push({name:"ungroup",label:(0,H.__)("Ungroup"),callback:()=>{if(!c.length)return;const t=c[0].innerBlocks;t.length&&d(e,t)},icon:l2.A}),y&&v.push({name:"remove",label:(0,H.__)("Delete"),callback:()=>u(e,!0),icon:h1.A}),{isLoading:!1,commands:v.map((e=>({...e,name:"core/block-editor/action-"+e.name,callback:({close:t})=>{e.callback(),t()}})))}};var h2=n(26110),p2=n(25356),f2=n(62694);function m2({title:e,help:t,actions:n=[],onClose:r}){return(0,Td.jsxs)(oE.A,{className:"block-editor-inspector-popover-header",spacing:4,children:[(0,Td.jsxs)(tA.A,{alignment:"center",children:[(0,Td.jsx)(nA.A,{className:"block-editor-inspector-popover-header__heading",level:2,size:13,children:e}),(0,Td.jsx)(DT.A,{}),n.map((({label:e,icon:t,onClick:n})=>(0,Td.jsx)(Zv.Ay,{className:"block-editor-inspector-popover-header__action",label:e,icon:t,variant:!t&&"tertiary",onClick:n,children:!t&&e},e))),r&&(0,Td.jsx)(Zv.Ay,{className:"block-editor-inspector-popover-header__action",label:(0,H.__)("Close"),icon:uT.A,onClick:r})]}),t&&(0,Td.jsx)(NT.A,{children:t})]})}const g2=(0,S.forwardRef)((function({onClose:e,onChange:t,showPopoverHeaderActions:n,isCompact:r,currentDate:o,...i},s){const a={startOfWeek:(0,f2.getSettings)().l10n.startOfWeek,onChange:t,currentDate:r?void 0:o,currentTime:r?o:void 0,...i},l=r?h2.h:p2.Ay;return(0,Td.jsxs)("div",{ref:s,className:"block-editor-publish-date-time-picker",children:[(0,Td.jsx)(m2,{title:(0,H.__)("Publish"),actions:n?[{label:(0,H.__)("Now"),onClick:()=>t?.(null)}]:void 0,onClose:e}),(0,Td.jsx)(l,{...a})]})}));(0,S.forwardRef)((function(e,t){return(0,Td.jsx)(g2,{...e,showPopoverHeaderActions:!0,isCompact:!1,ref:t})}));const b2={};kf(b2,{...g,ExperimentalBlockCanvas:function({shouldIframe:e=!0,height:t="300px",children:n=(0,Td.jsx)(BG,{}),styles:r,contentRef:o,iframeProps:i}){s2({name:"core/block-editor/blockTransforms",hook:c2}),s2({name:"core/block-editor/blockActions",hook:u2}),s2({name:"core/block-editor/blockQuickActions",hook:d2,context:"block-selection-edit"});const s=CG(),a=xG(),l=(0,S.useRef)(),c=(0,eC.A)([o,a,l]);return e?(0,Td.jsx)(y1,{__unstableContentRef:l,style:{height:t,display:"flex"},children:(0,Td.jsxs)(pq,{...i,ref:s,contentRef:c,style:{...i?.style},name:"editor-canvas",children:[(0,Td.jsx)(Cq,{styles:r}),n]})}):(0,Td.jsxs)(y1,{__unstableContentRef:l,style:{height:t,display:"flex"},children:[(0,Td.jsx)(Cq,{styles:r,scope:".editor-styles-wrapper"}),(0,Td.jsx)(lq,{ref:c,className:"editor-styles-wrapper",tabIndex:-1,style:{height:"100%",width:"100%"},children:n})]})},ExperimentalBlockEditorProvider:zU,getDuotoneFilter:mL,getRichTextValues:function(e=[]){Md.skipFilters=!0;const t=[];return L1(t,e),Md.skipFilters=!1,t.map((e=>e instanceof $.RichTextData?e:$.RichTextData.fromHTMLString(e)))},PrivateInserter:nJ,PrivateQuickInserter:QY,extractWords:jK,getNormalizedSearchTerms:BK,normalizeString:TK,PrivateListView:YX,ResizableBoxPopover:function({clientId:e,resizableBoxProps:t,...n}){return(0,Td.jsx)(eS,{clientId:e,__unstablePopoverSlot:"block-toolbar",...n,children:(0,Td.jsx)(LF,{...t})})},BlockInfo:s0,useHasBlockToolbar:c1,cleanEmptyObject:Wv,useStyleOverride:Yv,BlockQuickNavigation:a0,LayoutStyle:function({layout:e={},css:t,...n}){const r=hS(e.type),[o]=fv("spacing.blockGap"),i=null!==o;if(r){if(t)return(0,Td.jsx)("style",{children:t});const o=r.getLayoutStyle?.({hasBlockGapSupport:i,layout:e,...n});if(o)return(0,Td.jsx)("style",{children:o})}return null},BlockRemovalWarningModal:function({rules:e}){const{clientIds:t,selectPrevious:n,message:r}=(0,Ul.A)((e=>Cf(e(hv)).getRemovalPromptData())),{clearBlockRemovalPrompt:o,setBlockRemovalRules:i,privateRemoveBlocks:s}=Cf((0,Vl.A)(hv));if((0,S.useEffect)((()=>(i(e),()=>{i()})),[e,i]),r)return(0,Td.jsxs)(YF.A,{title:(0,H.__)("Be careful!"),onRequestClose:o,size:"medium",children:[(0,Td.jsx)("p",{children:r}),(0,Td.jsxs)(tA.A,{justify:"right",children:[(0,Td.jsx)(Zv.Ay,{variant:"tertiary",onClick:o,children:(0,H.__)("Cancel")}),(0,Td.jsx)(Zv.Ay,{variant:"primary",onClick:()=>{s(t,n,!0),o()},children:(0,H.__)("Delete")})]})]})},useLayoutClasses:hF,useLayoutStyles:function(e={},t,n){const{layout:r={},style:o={}}=e,i=r?.inherit||r?.contentSize||r?.wideSize?{...r,type:"constrained"}:r||{},s=hS(i?.type||"default"),[a]=fv("spacing.blockGap"),l=null!==a;return s?.getLayoutStyle?.({blockName:t,selector:n,layout:r,style:o,hasBlockGapSupport:l})},DimensionsTool:function({panelId:e,value:t={},onChange:n=(()=>{}),aspectRatioOptions:r,defaultAspectRatio:o="auto",scaleOptions:i,defaultScale:s="fill",unitsOptions:a}){const l=void 0===t.width||"auto"===t.width?null:t.width,c=void 0===t.height||"auto"===t.height?null:t.height,u=void 0===t.aspectRatio||"auto"===t.aspectRatio?null:t.aspectRatio,d=void 0===t.scale||"fill"===t.scale?null:t.scale,[h,p]=(0,S.useState)(d),[f,m]=(0,S.useState)(u),g=l&&c?"custom":f,b=u||l&&c;return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(_O,{panelId:e,options:r,defaultValue:o,value:g,onChange:e=>{const r={...t};m(e="auto"===e?null:e),e?r.aspectRatio=e:delete r.aspectRatio,e?h?r.scale=h:(r.scale=s,p(s)):delete r.scale,"custom"!==e&&l&&c&&delete r.height,n(r)}}),(0,Td.jsx)(V1,{panelId:e,units:a,value:{width:l,height:c},onChange:({width:e,height:r})=>{const o={...t};r="auto"===r?null:r,(e="auto"===e?null:e)?o.width=e:delete o.width,r?o.height=r:delete o.height,e&&r?delete o.aspectRatio:f&&(o.aspectRatio=f),f||!!e==!!r?h?o.scale=h:(o.scale=s,p(s)):delete o.scale,n(o)}}),b&&(0,Td.jsx)(z1,{panelId:e,options:i,defaultValue:s,value:h,onChange:e=>{const r={...t};p(e="fill"===e?null:e),e?r.scale=e:delete r.scale,n(r)}})]})},ResolutionTool:function({panelId:e,value:t,onChange:n,options:r=H1,defaultValue:o=H1[0].value,isShownByDefault:i=!0}){const s=null!=t?t:o;return(0,Td.jsx)(YA,{hasValue:()=>s!==o,label:(0,H.__)("Resolution"),onDeselect:()=>n(o),isShownByDefault:i,panelId:e,children:(0,Td.jsx)(_T.A,{label:(0,H.__)("Resolution"),value:s,options:r,onChange:n,help:(0,H.__)("Select the size of the source image."),size:"__unstable-large"})})},TextAlignmentControl:fM,ReusableBlocksRenameHint:function(){const e=(0,Ul.A)((e=>{var t;return null===(t=e(XE.M).get("core",$1))||void 0===t||t}),[]),t=(0,S.useRef)(),{set:n}=(0,Vl.A)(XE.M);return e?(0,Td.jsxs)("div",{ref:t,className:"reusable-blocks-menu-items__rename-hint",children:[(0,Td.jsx)("div",{className:"reusable-blocks-menu-items__rename-hint-content",children:(0,H.__)("Reusable blocks are now synced patterns. A synced pattern will behave in exactly the same way as a reusable block.")}),(0,Td.jsx)(Zv.Ay,{className:"reusable-blocks-menu-items__rename-hint-dismiss",icon:WQ.A,iconSize:"16",label:(0,H.__)("Dismiss hint"),onClick:()=>{const e=ME.focus.tabbable.findPrevious(t.current);e?.focus(),n("core",$1,!1)},showTooltip:!1})]}):null},useReusableBlocksRenameHint:function(){return(0,Ul.A)((e=>{var t;return null===(t=e(XE.M).get("core",$1))||void 0===t||t}),[])},usesContextKey:VZ,useFlashEditableBlocks:rG,globalStylesDataKey:_f,selectBlockPatternsKey:xf,requiresWrapperOnCopy:oq,PrivateRichText:QZ,PrivateInserterLibrary:_1,reusableBlocksSelectKey:wf,PrivateBlockPopover:XC,PrivatePublishDateTimePicker:g2,useSpacingSizes:pO});var y2=n(93554),v2=n(78631),_2=n(43318);const x2=async(e,{perPage:t=20}={})=>{const n=await(0,E.default)({path:(0,G.F)("/wp/v2/search",{search:e,per_page:t,type:"post"})});return Array.isArray(n)?n.map((e=>({id:e.id,url:e.url,title:(0,Qa.decodeEntities)(e.title)||`(${_2.U.I18n.t("noName")})`,type:e.subtype||e.type}))):[]};var w2=n(23108),k2=n.n(w2);function C2({isActive:e,label:t,info:n,onToggle:r}){return(0,Td.jsx)(k_.A,{icon:e&&ZS.A,isSelected:e,onClick:r,role:"menuitemcheckbox",info:n,children:t})}var S2=n(84960);const A2="mailpoet-form-editor",E2=nf.fontSizes.map((e=>({...e,size:`${e.size}${Number.isNaN(Number(`${e.size}`||NaN))?"":"px"}`})));var I2=n(25043);const j2=e=>{const t={full_width:e.fullWidth?"1":"0"};return e.inheritFromTheme||(t.bold=e.bold?"1":"0",(0,I2.has)(e,"backgroundColor")&&e.backgroundColor&&(t.background_color=e.backgroundColor),(0,I2.has)(e,"gradient")&&e.gradient&&(t.gradient=e.gradient),(0,I2.has)(e,"fontSize")&&void 0!==e.fontSize&&(t.font_size=e.fontSize),(0,I2.has)(e,"fontColor")&&e.fontColor&&(t.font_color=e.fontColor),(0,I2.has)(e,"borderSize")&&void 0!==e.borderSize&&(t.border_size=e.borderSize),(0,I2.has)(e,"borderRadius")&&void 0!==e.borderRadius&&(t.border_radius=e.borderRadius),(0,I2.has)(e,"borderColor")&&e.borderColor&&(t.border_color=e.borderColor),(0,I2.has)(e,"padding")&&void 0!==e.padding&&(t.padding=e.padding),(0,I2.has)(e,"fontFamily")&&e.fontFamily&&(t.font_family=e.fontFamily)),t},T2=(e,t,n=null)=>{const r=e.find((e=>e.slug===t));return r?r.color:n},B2=(e,t,n=null)=>{const r=e.find((e=>e.slug===t));return r?r.gradient:n},R2=(e,t,n=null)=>{const r=e.find((e=>e.slug===t));return r?r.size:n},N2=(e,t,n,r)=>{if(!Array.isArray(r))throw new Error("Mapper expects customFields to be an array.");const o=i=>{if(!Array.isArray(i))throw new Error("Mapper expects blocks to be an array.");return i.map((i=>{const s={type:"text",params:{label:i.attributes.label,class_name:i.attributes.className||null}};switch(i.attributes.mandatory&&(s.params.required="1"),i.attributes.labelWithinInput&&(s.params.label_within="1"),i.name){case"core/heading":return{type:"heading",id:"heading",params:{content:i.attributes.content?.toString(),level:i.attributes.level,align:i.attributes.textAlign||"left",font_size:R2(e,i.attributes.fontSize,i.attributes.style?.typography?.fontSize||null),text_color:T2(t,i.attributes.textColor,i.attributes.style?.color?.text||null),line_height:i.attributes.style?.typography?.lineHeight,background_color:T2(t,i.attributes.backgroundColor,i.attributes.style?.color?.background||null),gradient:B2(n,i.attributes.gradient,i.attributes.style?.color?.gradient||null),anchor:i.attributes.anchor||null,class_name:i.attributes.className||null,padding:i.attributes.style?.spacing?.padding||null}};case"core/paragraph":return{type:"paragraph",id:"paragraph",params:{content:i.attributes.content?.toString(),drop_cap:i.attributes.dropCap?"1":"0",align:i.attributes.align||"left",font_size:R2(e,i.attributes.fontSize,i.attributes.style?.typography?.fontSize||null),line_height:i.attributes.style?.typography?.lineHeight,text_color:T2(t,i.attributes.textColor,i.attributes.style?.color?.text||null),background_color:T2(t,i.attributes.backgroundColor,i.attributes.style?.color?.background||null),gradient:B2(n,i.attributes.gradient,i.attributes.style?.color?.gradient||null),class_name:i.attributes.className||null,padding:i.attributes.style?.spacing?.padding||null}};case"core/image":return{type:"image",id:"image",params:{class_name:i.attributes.className||null,align:i.attributes.align||null,url:i.attributes.url||null,alt:i.attributes.alt||null,title:i.attributes.title||null,caption:i.attributes.caption||null,link_destination:i.attributes.linkDestination||null,link:i.attributes.link||null,href:i.attributes.href||null,link_class:i.attributes.linkClass||null,rel:i.attributes.rel||null,link_target:i.attributes.linkTarget||null,id:i.attributes.id||null,size_slug:i.attributes.sizeSlug||null,width:i.attributes.width||null,height:i.attributes.height||null}};case"core/column":return{type:"column",body:o(i.innerBlocks),params:{class_name:i.attributes.className||null,vertical_alignment:i.attributes.verticalAlignment||null,width:i.attributes.width||null,padding:i.attributes.style?.spacing?.padding||null,text_color:T2(t,i.attributes.textColor,i.attributes.style?.color?.text||null),background_color:T2(t,i.attributes.backgroundColor,i.attributes.style?.color?.background||null),gradient:B2(n,i.attributes.gradient,i.attributes.style?.color?.gradient||null)}};case"core/columns":return{type:"columns",body:o(i.innerBlocks),params:{vertical_alignment:i.attributes.verticalAlignment||null,is_stacked_on_mobile:i.attributes.isStackedOnMobile||void 0===i.attributes.isStackedOnMobile?"1":"0",class_name:i.attributes.className||null,padding:i.attributes.style?.spacing?.padding||null,text_color:T2(t,i.attributes.textColor,i.attributes.style?.color?.text||null),background_color:T2(t,i.attributes.backgroundColor,i.attributes.style?.color?.background||null),gradient:B2(n,i.attributes.gradient,i.attributes.style?.color?.gradient||null)}};case"mailpoet-form/email-input":return{...s,id:"email",name:"Email",params:{...s.params,required:"1"},styles:j2(i.attributes.styles)};case"mailpoet-form/first-name-input":return{...s,id:"first_name",name:"First name",styles:j2(i.attributes.styles)};case"mailpoet-form/last-name-input":return{...s,id:"last_name",name:"Last name",styles:j2(i.attributes.styles)};case"mailpoet-form/segment-select":return{...s,id:"segments",type:"segment",name:"List selection",params:{...s.params,values:i.attributes.values.map((e=>({id:e.id,is_checked:e.isChecked?"1":void 0})))}};case"mailpoet-form/submit-button":return{...s,id:"submit",type:"submit",name:"Submit",styles:j2(i.attributes.styles)};case"mailpoet-form/divider":return{...s,id:"divider",type:"divider",name:"Divider",params:{class_name:i.attributes.className||null,height:i.attributes.height,type:i.attributes.type,style:i.attributes.style,divider_height:i.attributes.dividerHeight,divider_width:i.attributes.dividerWidth,color:i.attributes.color}};case"mailpoet-form/html":return{...s,id:"html",type:"html",name:"Custom text or HTML",params:{text:i.attributes&&i.attributes.content?i.attributes.content:"",nl2br:i.attributes&&i.attributes.nl2br?"1":"0",class_name:i.attributes.className||null}};default:return i.name.startsWith("mailpoet-form/custom-")?((e,t,n)=>{const r=t.find((t=>t.id===e.attributes.customFieldId));if(!r)return null;const o={...n,id:e.attributes.customFieldId.toString(),name:r.name};return e.name.startsWith("mailpoet-form/custom-date")&&(o.type="date"),e.name.startsWith("mailpoet-form/custom-text")&&(o.type="text",o.styles=j2(e.attributes.styles)),e.name.startsWith("mailpoet-form/custom-textarea")&&(o.type="textarea",o.styles=j2(e.attributes.styles)),e.name.startsWith("mailpoet-form/custom-radio")&&(o.type="radio"),e.name.startsWith("mailpoet-form/custom-checkbox")&&(o.type="checkbox"),e.name.startsWith("mailpoet-form/custom-select")&&(o.type="select"),(0,I2.has)(e.attributes,"validate")&&(o.params.validate=e.attributes.validate),(0,I2.has)(e.attributes,"hideLabel")&&e.attributes.hideLabel&&(o.params.hide_label="1"),(0,I2.has)(e.attributes,"defaultToday")&&e.attributes.defaultToday&&(o.params.is_default_today="1"),(0,I2.has)(e.attributes,"dateType")&&(o.params.date_type=e.attributes.dateType),(0,I2.has)(e.attributes,"lines")&&(o.params.lines=e.attributes.lines),(0,I2.has)(e.attributes,"dateFormat")&&(o.params.date_format=e.attributes.dateFormat),(0,I2.has)(e.attributes,"values")&&(o.params.values=e.attributes.values.map((e=>{const t={value:e.name};return(0,I2.has)(e,"isChecked")&&e.isChecked&&(t.is_checked="1"),t}))),o})(i,r,s):null}})).filter(Boolean)};return o};function D2(e){const t={...e,settings:{...e.settings,form_placement:{popup:{enabled:!0===e.settings.formPlacement?.popup?.enabled?"1":"",exit_intent_enabled:e.settings.formPlacement?.popup?.exitIntentEnabled?"1":"",delay:e.settings.formPlacement?.popup?.delay,cookieExpiration:e.settings.formPlacement?.popup?.cookieExpiration,styles:e.settings.formPlacement?.popup?.styles,animation:e.settings.formPlacement?.popup?.animation,categories:e.settings.formPlacement?.popup?.categories??[],tags:e.settings.formPlacement?.popup?.tags??[],posts:{all:!0===e.settings.formPlacement?.popup?.posts?.all?"1":"",selected:e.settings.formPlacement?.popup?.posts?.selected},pages:{all:!0===e.settings.formPlacement?.popup?.pages?.all?"1":"",selected:e.settings.formPlacement?.popup?.pages?.selected},homepage:!0===e.settings.formPlacement?.popup?.homepage?"1":"",tagArchives:{all:!0===e.settings.formPlacement?.popup?.tagArchives?.all?"1":"",selected:e.settings.formPlacement?.popup?.tagArchives?.selected},categoryArchives:{all:!0===e.settings.formPlacement?.popup?.categoryArchives?.all?"1":"",selected:e.settings.formPlacement?.popup?.categoryArchives?.selected}},fixed_bar:{enabled:!0===e.settings.formPlacement?.fixedBar?.enabled?"1":"",delay:e.settings.formPlacement?.fixedBar?.delay,cookieExpiration:e.settings.formPlacement?.fixedBar?.cookieExpiration,styles:e.settings.formPlacement?.fixedBar?.styles,position:e.settings.formPlacement?.fixedBar?.position,animation:e.settings.formPlacement?.fixedBar?.animation,categories:e.settings.formPlacement?.fixedBar?.categories??[],tags:e.settings.formPlacement?.fixedBar?.tags??[],posts:{all:!0===e.settings.formPlacement?.fixedBar?.posts?.all?"1":"",selected:e.settings.formPlacement?.fixedBar?.posts?.selected},pages:{all:!0===e.settings.formPlacement?.fixedBar?.pages?.all?"1":"",selected:e.settings.formPlacement?.fixedBar?.pages?.selected},homepage:!0===e.settings.formPlacement?.fixedBar?.homepage?"1":"",tagArchives:{all:!0===e.settings.formPlacement?.fixedBar?.tagArchives?.all?"1":"",selected:e.settings.formPlacement?.fixedBar?.tagArchives?.selected},categoryArchives:{all:!0===e.settings.formPlacement?.fixedBar?.categoryArchives?.all?"1":"",selected:e.settings.formPlacement?.fixedBar?.categoryArchives?.selected}},below_posts:{enabled:!0===e.settings.formPlacement?.belowPosts?.enabled?"1":"",styles:e.settings.formPlacement?.belowPosts?.styles,categories:e.settings.formPlacement?.belowPosts?.categories??[],tags:e.settings.formPlacement?.belowPosts?.tags??[],posts:{all:!0===e.settings.formPlacement?.belowPosts?.posts?.all?"1":"",selected:e.settings.formPlacement?.belowPosts?.posts?.selected},pages:{all:!0===e.settings.formPlacement?.belowPosts?.pages?.all?"1":"",selected:e.settings.formPlacement?.belowPosts?.pages?.selected}},slide_in:{enabled:!0===e.settings.formPlacement?.slideIn?.enabled?"1":"",delay:e.settings.formPlacement?.slideIn?.delay,cookieExpiration:e.settings.formPlacement?.slideIn?.cookieExpiration,position:e.settings.formPlacement?.slideIn?.position,animation:e.settings.formPlacement?.slideIn?.animation,styles:e.settings.formPlacement?.slideIn?.styles,categories:e.settings.formPlacement?.slideIn?.categories??[],tags:e.settings.formPlacement?.slideIn?.tags??[],posts:{all:!0===e.settings.formPlacement?.slideIn?.posts?.all?"1":"",selected:e.settings.formPlacement?.slideIn?.posts?.selected},pages:{all:!0===e.settings.formPlacement?.slideIn?.pages?.all?"1":"",selected:e.settings.formPlacement?.slideIn?.pages?.selected},homepage:!0===e.settings.formPlacement?.slideIn?.homepage?"1":"",tagArchives:{all:!0===e.settings.formPlacement?.slideIn?.tagArchives?.all?"1":"",selected:e.settings.formPlacement?.slideIn?.tagArchives?.selected},categoryArchives:{all:!0===e.settings.formPlacement?.slideIn?.categoryArchives?.all?"1":"",selected:e.settings.formPlacement?.slideIn?.categoryArchives?.selected}},others:{styles:e.settings.formPlacement?.others?.styles}},border_radius:e.settings.borderRadius,border_size:e.settings.borderSize,form_padding:e.settings.formPadding,input_padding:e.settings.inputPadding,border_color:e.settings.borderColor,font_family:e.settings.fontFamily,success_validation_color:e.settings.successValidationColor,error_validation_color:e.settings.errorValidationColor,background_image_url:e.settings.backgroundImageUrl,background_image_display:e.settings.backgroundImageDisplay,close_button:e.settings.closeButton}};return""===t.settings.font_family&&delete t.settings.font_family,delete t.settings.formPlacement,delete t.settings.successValidationColor,delete t.settings.errorValidationColor,delete t.settings.borderRadius,delete t.settings.borderSize,delete t.settings.formPadding,delete t.settings.inputPadding,delete t.settings.borderColor,delete t.settings.backgroundImageUrl,delete t.settings.backgroundImageDisplay,delete t.settings.fontFamily,delete t.settings.closeButton,t}function M2(e){return{type:"TOGGLE_SIDEBAR",toggleTo:e}}function P2(e){return{type:"TOGGLE_INSERTER_SIDEBAR",value:e}}function O2(){return{type:"TOGGLE_LIST_VIEW"}}function L2(e){return e?{type:"ENABLE_FORM"}:{type:"DISABLE_FORM"}}function*F2(e){yield{type:"STORE_LOCALLY",key:"mailpoet_form_view_options",value:e},yield{type:"TOGGLE_FULLSCREEN",toggleTo:e}}function z2(e){return{type:"CHANGE_FORM_BLOCKS",blocks:e}}function U2(e){return{type:"CHANGE_FORM_NAME",name:e}}function V2(){return{type:"DELETE_CUSTOM_FIELD_STARTED"}}function H2(e,t){return{type:"DELETE_CUSTOM_FIELD_DONE",customFieldId:e,clientId:t}}function $2(e=void 0){return{type:"DELETE_CUSTOM_FIELD_FAILED",message:e}}function W2(e){return{type:"CHANGE_FORM_STYLES",styles:e}}function G2(){return{type:"CUSTOM_FIELD_EDITED"}}function q2(e,t){return{type:"SAVE_CUSTOM_FIELD_DONE",customFieldId:e,response:t}}function K2(){return{type:"SAVE_CUSTOM_FIELD_STARTED"}}function Y2(e=void 0){return{type:"SAVE_CUSTOM_FIELD_FAILED",message:e}}function J2(e){return{type:"CREATE_CUSTOM_FIELD_DONE",response:e}}function X2(e){return{type:"CREATE_CUSTOM_FIELD_STARTED",customField:e}}function Z2(e=void 0){return{type:"CREATE_CUSTOM_FIELD_FAILED",message:e}}function Q2(e){return{type:"CHANGE_FORM_SETTINGS",settings:e}}function*e5(e){yield{type:"SAVE_FORM_DONE",formId:e},yield{type:"ENSURE_BROWSER_URL",formId:e}}function t5(){return{type:"SAVE_FORM_STARTED"}}function n5(e=void 0){return{type:"SAVE_FORM_FAILED",message:e}}function r5(e){return"placement_settings"===e&&(0,fc.J)(hv).clearSelectedBlock(),{type:"CHANGE_ACTIVE_SIDEBAR",sidebar:e}}function*o5(e){const t=(0,pc.L)(A2).getFormData();null!==t.id&&(yield{type:"STORE_LOCALLY",key:`mailpoet_form_preview_settings${t.id}`,value:e}),yield{type:"CHANGE_PREVIEW_SETTINGS",settings:e}}function*i5(e){const t={...(0,pc.L)(A2).getPreviewSettings(),formType:e};return yield*o5(t),r5("placement_settings")}function*s5(){yield{type:"SHOW_PREVIEW"},yield r5("default");const e=(0,pc.L)(A2).getAllAvailableCustomFields(),t=(0,pc.L)(A2).getFormData(),n=(0,pc.L)(A2).getFormBlocks(),r=N2(E2,nf.colors,nf.gradients,e),{success:o,error:i}=yield{type:"CALL_API",endpoint:"forms",action:"previewEditor",data:{...D2(t),body:r(n)}};return o?{type:"PREVIEW_DATA_SAVED"}:{type:"PREVIEW_DATA_NOT_SAVED",error:i}}function a5(){return{type:"HIDE_PREVIEW"}}function l5(e){return{type:"REMOVE_NOTICE",id:e}}function c5(e){return{type:"SWITCH_DEFAULT_SIDEBAR_TAB",id:e}}function u5(e,t=void 0){return{type:"TOGGLE_SIDEBAR_PANEL",id:e,toggleTo:t}}function*d5(){yield{type:"SAVE_FORM"}}function*h5(e){yield{type:"SAVE_CUSTOM_FIELD",...e}}function*p5(e,t){yield{type:"CREATE_CUSTOM_FIELD",clientId:t,data:e}}function*f5(e,t){yield{type:"DELETE_CUSTOM_FIELD",customFieldId:e,clientId:t}}function*m5(e){yield{type:"BLOCKS_CHANGED_IN_BLOCK_EDITOR",blocks:e}}function*g5(e){yield{type:"APPLY_STYLES_TO_ALL_TEXT_INPUTS",styles:e}}function b5(){return{type:"HISTORY_UNDO"}}function y5(){return{type:"HISTORY_REDO"}}function*v5(){yield{type:"TUTORIAL_DISMISS"},yield{type:"TUTORIAL_DISMISSED"}}const _5=(e,t)=>e.reduce(((e,n)=>e||(n.name===t?n:Array.isArray(n.innerBlocks)&&n.innerBlocks.length?_5(n.innerBlocks,t):null)),null),x5=(e,t)=>{if(!e||!e.settings||!Array.isArray(e.settings.segments))throw new Error("formData.settings.segments are expected to be an array.");if(!Array.isArray(t))throw new Error("formBlocks are expected to be an array.");const n=_5(t,"mailpoet-form/segment-select"),r=[];n&&0!==n.attributes.values.length||e.settings.segments&&0!==e.settings.segments.length||r.push("missing-lists"),n&&0===n.attributes.values.length&&r.push("missing-lists-in-custom-segments-block");const o=_5(t,"mailpoet-form/email-input"),i=_5(t,"mailpoet-form/submit-button");return o||r.push("missing-email-input"),i||r.push("missing-submit"),r},w5=e=>{let t=e.editorHistory,n=e.editorHistoryOffset;const r=((e,t)=>{const n=e[e.length-1],r=Date.now();if(void 0!==n&&r-n.time<1e3&&e.length>1)return e.pop(),{blocks:t.formBlocks,data:t.formData,time:n.time};const o={blocks:t.formBlocks,data:t.formData,time:r};return void 0!==n&&(0,I2.isEqual)(n.data,o.data)&&(0,I2.isEqual)(n.blocks,o.blocks)?null:o})(t,e);if(null===r)return e;if(0!==e.editorHistoryOffset){const r=e.editorHistory.length-(e.editorHistoryOffset+1);n=0,t=t.slice(0,r)}return t.length>=100&&t.shift(),t.push(r),{...e,editorHistory:t,editorHistoryOffset:n}},k5=(e,t)=>{let n=e.editorHistoryOffset;0===n&&w5(e),n+=t;const r=e.editorHistory.length-(n+1);let o,i;if(void 0===e.editorHistory[r])return e;{const t=e.editorHistory[r];o=t.blocks,i=t.data}return{...e,editorHistoryOffset:n,formBlocks:o,formData:i}},C5=(S5=_2.U,(e,t)=>{const n=e.notices.filter((e=>"custom-field"!==e.id)),r=(0,I2.trim)(t.customField.name),o=e.customFields.find((e=>e.name===r));return o&&n.push({id:"custom-field",content:S5.I18n.t("customFieldWithNameExists").replace("[name]",r),isDismissible:!0,status:"error"}),{...e,isCustomFieldCreating:!o,notices:n}});var S5;const A5=(e=>t=>{const n=t.notices.filter((e=>!["missing-lists-in-custom-segments-block","save-form","missing-lists","missing-block"].includes(e.id))),r=t.formErrors.includes("missing-lists")||t.formErrors.includes("missing-lists-in-custom-segments-block"),o=[...t.sidebar.openedPanels];r&&(n.push({id:"missing-lists",content:e.I18n.t("settingsPleaseSelectList"),isDismissible:!0,status:"error"}),o.includes("basic-settings")||o.push("basic-settings"));const i=t.formErrors.includes("missing-email-input"),s=t.formErrors.includes("missing-submit");return(i||s)&&n.push({id:"missing-block",content:e.I18n.t("missingObligatoryBlock"),isDismissible:!0,status:"error"}),{...t,isFormSaving:!r,sidebar:{...t.sidebar,activeTab:r?"form":t.sidebar.activeTab,openedPanels:o},notices:n}})(_2.U),E5=e=>(t=e,n={})=>{const r=((e,t)=>"CHANGE_FORM_BLOCKS"===t.type||"CHANGE_FORM_NAME"===t.type||"CHANGE_FORM_SETTINGS"===t.type||"CHANGE_FORM_STYLES"===t.type?w5(e):e)(t,n);return((e,t)=>{switch(t.type){case"ENABLE_FORM":return(e=>({...e,formData:{...e.formData,hasUnsavedChanges:!0,status:"enabled"}}))(e);case"DISABLE_FORM":return(e=>({...e,formData:{...e.formData,hasUnsavedChanges:!0,status:"disabled"}}))(e);case"TOGGLE_FULLSCREEN":return((e,t)=>({...e,fullscreenStatus:t.toggleTo}))(e,t);case"CREATE_CUSTOM_FIELD_DONE":return((e,t)=>{const n=e.notices.filter((e=>"custom-field"!==e.id));n.push({id:"custom-field",content:_2.U.I18n.t("customFieldSaved"),isDismissible:!0,status:"success"});const r=[...e.customFields];return r.push(t.response),{...e,isCustomFieldCreating:!1,notices:n,customFields:r}})(e,t);case"CREATE_CUSTOM_FIELD_FAILED":return((e,t)=>{const n=e.notices.filter((e=>"custom-field"!==e.id));return n.push({id:"custom-field",content:t.message,isDismissible:!0,status:"error"}),{...e,isCustomFieldCreating:!1,notices:n}})(e,t);case"CREATE_CUSTOM_FIELD_STARTED":return C5(e,t);case"CHANGE_FORM_BLOCKS":return((e,t)=>{const n={...e,formBlocks:t.blocks};return{...n,hasUnsavedChanges:!0,formErrors:x5(n.formData,n.formBlocks)}})(e,t);case"CHANGE_FORM_NAME":return((e,t)=>({...e,formData:{...e.formData,hasUnsavedChanges:!0,name:t.name}}))(e,t);case"CHANGE_FORM_SETTINGS":return((e,t)=>{const n={...e,formData:{...e.formData,settings:t.settings}};return{...n,hasUnsavedChanges:!0,formErrors:x5(n.formData,n.formBlocks)}})(e,t);case"CHANGE_FORM_STYLES":return((e,t)=>({...e,formData:{...e.formData,styles:t.styles,hasUnsavedChanges:!0}}))(e,t);case"CHANGE_PREVIEW_SETTINGS":return((e,{settings:t})=>({...e,previewSettings:t}))(e,t);case"CUSTOM_FIELD_EDITED":return(e=>({...e,hasUnsavedChanges:!0}))(e);case"REMOVE_NOTICE":return((e,t)=>({...e,notices:[...e.notices].filter((e=>e.id!==t.id))}))(e,t);case"SHOW_PREVIEW":return(e=>({...e,isPreviewShown:!0}))(e);case"HIDE_PREVIEW":return(e=>({...e,isPreviewShown:!1,isPreviewReady:!1}))(e);case"PREVIEW_DATA_NOT_SAVED":return(e=>({...e,isPreviewReady:!1}))(e);case"PREVIEW_DATA_SAVED":return(e=>({...e,isPreviewReady:!0}))(e);case"SAVE_FORM_DONE":return((e,t)=>{const n=e.notices.filter((e=>"save-form"!==e.id));return n.push({id:"save-form",content:`${_2.U.I18n.t("formSaved")} ${_2.U.I18n.t("formSavedAppendix")}`,isDismissible:!0,status:"success"}),{...e,formData:{...e.formData,id:parseInt(t.formId,10)},isFormSaving:!1,hasUnsavedChanges:!1,notices:n}})(e,t);case"SAVE_FORM_FAILED":return((e,t)=>{const n=e.notices.filter((e=>"save-form"!==e.id));return n.push({id:"save-form",content:t.message,isDismissible:!0,status:"error"}),{...e,isFormSaving:!1,notices:n}})(e,t);case"SAVE_FORM_STARTED":return A5(e);case"SAVE_CUSTOM_FIELD_DONE":return((e,t)=>{const n=e.notices.filter((e=>"custom-field"!==e.id));n.push({id:"custom-field",content:_2.U.I18n.t("customFieldSaved"),isDismissible:!0,status:"success"});const r=e.customFields.map((e=>e.id===t.customFieldId?t.response:e));return{...e,isCustomFieldSaving:!1,notices:n,customFields:r}})(e,t);case"SAVE_CUSTOM_FIELD_FAILED":return((e,t)=>{const n=e.notices.filter((e=>"custom-field"!==e.id));return n.push({id:"custom-field",content:t.message,isDismissible:!0,status:"error"}),{...e,isCustomFieldSaving:!1,notices:n}})(e,t);case"SAVE_CUSTOM_FIELD_STARTED":return(e=>{const t=e.notices.filter((e=>"custom-field"!==e.id));return{...e,isCustomFieldSaving:!0,notices:t}})(e);case"SWITCH_DEFAULT_SIDEBAR_TAB":return((e,t)=>({...e,sidebar:{...e.sidebar,activeTab:t.id}}))(e,t);case"TOGGLE_SIDEBAR":return((e,t)=>({...e,sidebarOpened:t.toggleTo}))(e,t);case"TOGGLE_INSERTER_SIDEBAR":return((e,t)=>{let n;return n=t.value?!0===t.value?{rootClientId:void 0,insertionIndex:void 0}:t.value:null,{...e,inserterPanel:n,isListViewOpened:!1}})(e,t);case"TOGGLE_LIST_VIEW":return(e=>({...e,isListViewOpened:!e.isListViewOpened,inserterPanel:null}))(e);case"TOGGLE_SIDEBAR_PANEL":return((e,t)=>{let n;!0===t.toggleTo&&(n="opened"),!1===t.toggleTo&&(n="closed");const r=[...e.sidebar.openedPanels],o=((e,t,n)=>{const r=e.includes(t);let o=n;return void 0===o&&(o=r?"closed":"opened"),r&&"closed"===o?"close":r||"opened"!==o?null:"open"})(r,t.id,n);return"open"===o?r.push(t.id):"close"===o&&(0,I2.remove)(r,(e=>e===t.id)),{...e,sidebar:{...e.sidebar,openedPanels:r}}})(e,t);case"DELETE_CUSTOM_FIELD_STARTED":return(e=>{const t=e.notices.filter((e=>"custom-field"!==e.id));return{...e,...t,isCustomFieldDeleting:!0}})(e);case"DELETE_CUSTOM_FIELD_DONE":return((e,t)=>{const n=e.customFields.filter((e=>e.id!==t.customFieldId)),r=e.formBlocks.filter((e=>e.clientId!==t.clientId));return{...e,formBlocks:r,isCustomFieldDeleting:!1,customFields:n}})(e,t);case"DELETE_CUSTOM_FIELD_FAILED":return((e,t)=>{const n=e.notices.filter((e=>"custom-field"!==e.id));return n.push({id:"custom-field",content:t.message,isDismissible:!0,status:"error"}),{...e,isCustomFieldSaving:!1,notices:n}})(e,t);case"CHANGE_ACTIVE_SIDEBAR":return((e,t)=>({...e,sidebar:{...e.sidebar,activeSidebar:t.sidebar}}))(e,t);case"HISTORY_UNDO":return(e=>k5(e,1))(e);case"HISTORY_REDO":return(e=>k5(e,-1))(e);case"TUTORIAL_DISMISSED":return(e=>({...e,tutorialSeen:!0}))(e);default:return e}})(r,n)},I5=(e,t,n=[])=>e.reduce(((e,r)=>{if(e.length)return e;if(Array.isArray(r.innerBlocks)&&r.innerBlocks.length){n.push(r);const e=r.innerBlocks.find((e=>e.clientId===t));return e?n:I5(r.innerBlocks,t,n)}return[]}),[]),j5={isFormSaved:e=>"number"==typeof e.formData.id,isFormEnabled:e=>"enabled"===e.formData.status,isFullscreenEnabled:e=>e.fullscreenStatus,isInserterOpened:e=>!!e.inserterPanel,getInserterPanelInsertPoint:e=>e.inserterPanel,isListViewOpened:e=>e.isListViewOpened,getSidebarOpened:e=>e.sidebarOpened,getFormName:e=>e.formData.name,getFormData:e=>e.formData,getFormStyles:e=>e.formData.styles,getFormExports:e=>Object.fromEntries(Object.entries(e.formExports).map((([t,n])=>[t,n.replace(":form_id:",`${e.formData.id}`)]))),getFormSettings:e=>e.formData.settings,getAllAvailableSegments:e=>e.segments,getAllAvailableCustomFields:e=>e.customFields,getIsFormSaving:e=>e.isFormSaving,getIsPreviewShown:e=>e.isPreviewShown,getIsPreviewReady:e=>e.isPreviewReady,getPreviewSettings(e){if(e.previewSettings)return e.previewSettings;const t={displayType:"desktop",formType:"others"},n=e.formData.settings;return n.formPlacement.belowPosts.enabled&&(t.formType="below_posts"),n.formPlacement.popup.enabled&&(t.formType="popup"),n.formPlacement.fixedBar.enabled&&(t.formType="fixed_bar"),n.formPlacement.slideIn.enabled&&(t.formType="slide_in"),t},getFormWidth(e,t){const n=e.formData.settings;switch(t){case"below_posts":return n.formPlacement.belowPosts.styles.width;case"popup":return n.formPlacement.popup.styles.width;case"slide_in":return n.formPlacement.slideIn.styles.width;case"fixed_bar":return n.formPlacement.fixedBar.styles.width;case"others":return n.formPlacement.others.styles.width;default:throw Error(`Invalid form display type ${t}`)}},getIsCustomFieldSaving:e=>e.isCustomFieldSaving,getIsCustomFieldDeleting:e=>e.isCustomFieldDeleting,getDismissibleNotices:e=>e.notices.filter((e=>!0===e.isDismissible)),getNonDismissibleNotices:e=>e.notices.filter((e=>!1===e.isDismissible)),getNotice:(e,t)=>e.notices.find((e=>e.id===t)),getFormErrors:e=>e.formErrors,getDefaultSidebarActiveTab:e=>e.sidebar.activeTab,getSidebarOpenedPanels:e=>e.sidebar.openedPanels,getFormBlocks:e=>e.formBlocks,getDateSettingsData:e=>e.dateSettingData,getIsCustomFieldCreating:e=>e.isCustomFieldCreating,hasUnsavedChanges:e=>e.hasUnsavedChanges,getEditorUrl:e=>e.editorUrl,getPreviewPageUrl:e=>e.previewPageUrl,getCloseIconsUrl:e=>e.closeIconsUrl,getAllCustomFonts:e=>e.customFonts,getActiveSidebar:e=>e.sidebar.activeSidebar,getAllWPPosts:e=>e.allWpPosts,getAllWPPages:e=>e.allWpPages,getAllWPCategories:e=>e.allWpCategories,getAllWPTags:e=>e.allWpTags,getAllWooCommerceProducts:e=>e.allWooCommerceProducts,getAllWooCommerceCategories:e=>e.allWooCommerceCategories,getAllWooCommerceTags:e=>e.allWooCommerceTags,getTutorialSeen:e=>e.tutorialSeen,getFormEditorUrl:e=>e.formEditorUrl,getTutorialUrl:e=>e.tutorialUrl,getClosestParentAttribute:(e,t,n)=>I5(e.formBlocks,t).reduce(((e,t)=>t.attributes&&void 0!==t.attributes[n]?t.attributes[n]:e),null),hasEditorUndo(e){let t=e.editorHistory.length;return e.editorHistory.length>1&&(t-=1),t>0&&t>e.editorHistoryOffset},hasEditorRedo:e=>e.editorHistoryOffset>0,isUserAdministrator:e=>e.user.isAdministrator,getThemeSupport:e=>e.theme};function T5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var B5=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=T5({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var s in o)o[s]&&(i+="; "+s,!0!==o[s]&&(i+="="+o[s].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+i}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var i=n[o].split("="),s=i.slice(1).join("=");try{var a=decodeURIComponent(i[0]);if(r[a]=t.read(s,a),e===a)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",T5({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,T5({},this.attributes,t))},withConverter:function(t){return e(T5({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),R5=n(96721),N5=n(29065),D5=n.n(N5);function M5(e,t){return`${e}-${D5()(t.name,{lower:!0}).replace(/[^a-z0-9]+/g,"").replace(/-$/,"")}`}const P5=(0,Td.jsxs)(pw.t4,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,Td.jsx)(pw.wA,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,Td.jsx)(pw.wA,{d:"M20,4H4C2.9,4,2,4.9,2,6v12c0,1.1,0.9,2,2,2h16c1.1,0,2-0.9,2-2V6C22,4.9,21.1,4,20,4z M20,18H4V6h16V18z"}),(0,Td.jsx)(pw.rw,{x:"6",y:"10",width:"2",height:"2"}),(0,Td.jsx)(pw.rw,{x:"6",y:"14",width:"8",height:"2"}),(0,Td.jsx)(pw.rw,{x:"16",y:"14",width:"2",height:"2"}),(0,Td.jsx)(pw.rw,{x:"10",y:"10",width:"8",height:"2"})]});var O5=n(36637),L5=n.n(O5),F5=n(53247);function z5({isBusy:e=!1,onDelete:t=(()=>{})}){const n=(0,S.useCallback)((()=>{window.confirm(_2.U.I18n.t("customFieldDeleteConfirm"))&&t()}),[t]);return(0,Td.jsx)(Zv.Ay,{isDestructive:!0,isLink:!0,isBusy:e,onClick:n,className:"button-on-top",children:_2.U.I18n.t("customFieldDeleteCTA")})}function U5({dateSettings:e,label:t="",mandatory:n=!1,dateType:r=null,dateFormat:o=null,defaultToday:i=!1,isSaving:s=!1,onSave:a=null,isDeleting:l=!1,onCustomFieldDelete:c=null,onChange:u=null}){const[d,h]=(0,S.useState)(t),[p,f]=(0,S.useState)(n),[m,g]=(0,S.useState)(i),[b,y]=(0,S.useState)(r),[v,_]=(0,S.useState)(o),x=(0,S.useMemo)((()=>({label:d,mandatory:p,dateType:b,dateFormat:v,defaultToday:m})),[d,p,b,v,m]),w=p!==n||m!==i||b!==r||v!==o||d!==t;return(0,S.useEffect)((()=>{u&&u(x,w)}),[x,u,w]),(0,Td.jsxs)("div",{className:"custom-field-settings",children:[(0,Td.jsx)(KE.A,{label:_2.U.I18n.t("label"),value:d,"data-automation-id":"settings_custom_date_label_input",onChange:h}),(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("blockMandatory"),checked:p,onChange:f}),(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("customFieldDefaultToday"),checked:m,onChange:g}),(0,Td.jsx)(_T.A,{label:_2.U.I18n.t("customFieldDateType"),"data-automation-id":"settings_custom_date_type",value:b,onChange:t=>{y(t);const n=e.dateFormats[t];_(n[0])},options:e.dateTypes}),(()=>{const t=e.dateFormats[b];return Array.isArray(t)&&1===t.length?null:(0,Td.jsx)(_T.A,{label:_2.U.I18n.t("customFieldDateFormat"),"data-automation-id":"settings_custom_date_format",value:v,onChange:e=>_(e),options:t.map((e=>({value:e,label:e})))})})(),a?(0,Td.jsx)(Zv.Ay,{variant:"primary",onClick:()=>a({mandatory:p,dateType:b,dateFormat:v,defaultToday:m,label:d}),isBusy:s,disabled:s||!w,className:"button-on-top","data-automation-id":"custom_field_save",children:_2.U.I18n.t("customFieldSaveCTA")}):null,c?(0,Td.jsx)(z5,{isBusy:s||l,onDelete:c}):null]})}z5.propTypes={isBusy:k2().bool,onDelete:k2().func},U5.propTypes={mandatory:k2().bool,label:k2().string,dateType:k2().string,dateFormat:k2().string,defaultToday:k2().bool,onSave:k2().func,isSaving:k2().bool,dateSettings:k2().shape({dateTypes:k2().arrayOf(k2().shape({label:k2().string,value:k2().string})),dateFormats:k2().objectOf(k2().arrayOf(k2().string)),months:k2().arrayOf(k2().string)}).isRequired,isDeleting:k2().bool,onCustomFieldDelete:k2().func,onChange:k2().func};const V5=e=>{const t=e.label?e.label:"";return e.mandatory?`${t} *`:t};function H5(e){const t=[];void 0!==e.placeholder&&t.push((0,Td.jsx)("option",{value:"",children:e.placeholder},0));const n=L5()().year();for(let e=n;e>=n-100;e-=1)t.push((0,Td.jsx)("option",{value:e,children:e},e));return(0,Td.jsx)("select",{name:`${e.name}[year]`,value:e.year,onChange:e.onValueChange,className:B()({mailpoet_date_year:e.addDefaultClasses}),children:t})}function $5(e){const t=[];void 0!==e.placeholder&&t.push((0,Td.jsx)("option",{value:"",children:e.placeholder},0));for(let n=1;n<=12;n+=1)t.push((0,Td.jsx)("option",{value:n,children:e.monthNames[n-1]},n));return(0,Td.jsx)("select",{name:`${e.name}[month]`,value:e.month,onChange:e.onValueChange,className:B()({mailpoet_date_month:e.addDefaultClasses}),children:t})}function W5(e){const t=[];void 0!==e.placeholder&&t.push((0,Td.jsx)("option",{value:"",children:e.placeholder},0));for(let e=1;e<=31;e+=1)t.push((0,Td.jsx)("option",{value:e,children:e},e));return(0,Td.jsx)("select",{name:`${e.name}[day]`,value:e.day,onChange:e.onValueChange,className:B()({mailpoet_date_day:e.addDefaultClasses}),children:t})}H5.propTypes={name:k2().string.isRequired,placeholder:k2().string.isRequired,onValueChange:k2().func.isRequired,year:k2().oneOfType([k2().string,k2().number]).isRequired,addDefaultClasses:k2().bool.isRequired},$5.propTypes={name:k2().string.isRequired,placeholder:k2().string.isRequired,onValueChange:k2().func.isRequired,month:k2().oneOfType([k2().string,k2().number]).isRequired,monthNames:k2().arrayOf(k2().string).isRequired,addDefaultClasses:k2().bool.isRequired},W5.propTypes={name:k2().string.isRequired,placeholder:k2().string.isRequired,onValueChange:k2().func.isRequired,day:k2().oneOfType([k2().string,k2().number]).isRequired,addDefaultClasses:k2().bool.isRequired};class G5 extends S.Component{constructor(e){super(e),this.state={year:"",month:"",day:""},this.onValueChange=this.onValueChange.bind(this)}componentDidMount(){this.extractDateParts()}componentDidUpdate(e){void 0!==this.props.item&&void 0!==e.item&&this.props.item.id!==e.item.id&&this.extractDateParts()}onValueChange(e){const t=e.target.name.match(/(.*?)\[(.*?)\]/);let n=null,r=null;if(null!==t&&3===t.length){[,n,r]=t;const o=Number(e.target.value);this.setState({[`${r}`]:o},(()=>{this.props.onValueChange({target:{name:n,value:this.formatValue()}})}))}}formatValue(){let e;switch(this.props.field.params.date_type){case"year_month_day":e={year:this.state.year,month:this.state.month,day:this.state.day};break;case"year_month":e={year:this.state.year,month:this.state.month};break;case"month":e={month:this.state.month};break;case"year":e={year:this.state.year};break;default:e={value:"invalid type"}}return e}extractDateParts(){const e=void 0!==this.props.item[this.props.field.name]?this.props.item[this.props.field.name].trim():"";if(""===e)return;const t=L5()(e);this.setState({year:t.format("YYYY"),month:t.format("M"),day:t.format("D")})}render(){const{field:e,addDefaultClasses:t=!1}=this.props,n=window.mailpoet_month_names||[];let r=(window.mailpoet_date_formats||{})[e.params.date_type][0];e.params.date_format&&(r=e.params.date_format);const o=r.split("/").map((r=>{switch(r){case"YYYY":return(0,Td.jsx)(H5,{onValueChange:this.onValueChange,name:e.name,addDefaultClasses:t,year:this.state.year,placeholder:e.year_placeholder},"year");case"MM":return(0,Td.jsx)($5,{onValueChange:this.onValueChange,name:e.name,addDefaultClasses:t,month:this.state.month,monthNames:n,placeholder:e.month_placeholder},"month");case"DD":return(0,Td.jsx)(W5,{onValueChange:this.onValueChange,name:e.name,addDefaultClasses:t,day:this.state.day,placeholder:e.day_placeholder},"day");default:return(0,Td.jsx)("div",{children:"Invalid date type"})}}));return(0,Td.jsx)("div",{children:o})}}function q5({children:e,className:t=""}){return(0,Td.jsx)("div",{className:B()("mailpoet_paragraph",t),children:e})}function K5(e,t){switch(e){case"checkbox":return{label:t.label,required:t.mandatory?"1":"",values:[{is_checked:t.isChecked?"1":"",value:t.checkboxLabel}]};case"date":return{label:t.label,required:t.mandatory?"1":"",date_type:t.dateType,date_format:t.dateFormat,is_default_today:t.defaultToday?"1":""};case"radio":case"select":return{required:t.mandatory?"1":"",label:t.label,values:t.values.map((e=>{const t={value:e.name};return e.isChecked?t.is_checked="1":t.is_checked="",t}))};case"text":return{required:t.mandatory?"1":"",validate:t.validate,label:t.label};case"textarea":return{required:t.mandatory?"1":"",validate:t.validate,lines:t.lines?t.lines:"1",label:t.label};default:throw new Error(`Invalid custom field type ${e}!`)}}function Y5({attributes:e,setAttributes:t,clientId:n}){const r=(0,Ul.A)((e=>e(A2).getIsCustomFieldSaving()),[]),o=(0,Ul.A)((e=>e(A2).getDateSettingsData()),[]),i=(0,Ul.A)((e=>e(A2).getIsCustomFieldDeleting()),[]),{saveCustomField:s,deleteCustomField:a,customFieldEdited:l}=(0,Vl.A)(A2),c=(0,Td.jsx)(IA,{children:(0,Td.jsx)(F5.A,{children:(0,Td.jsx)(aF.Ay,{title:_2.U.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,Td.jsx)(U5,{label:e.label,mandatory:e.mandatory,dateSettings:o,defaultToday:e.defaultToday,dateFormat:e.dateFormat,dateType:e.dateType,isSaving:r,onSave:n=>s({customFieldId:e.customFieldId,data:{params:K5("date",n)},onFinish:()=>t({mandatory:n.mandatory,dateType:n.dateType,dateFormat:n.dateFormat,defaultToday:n.defaultToday,label:n.label})}),onCustomFieldDelete:()=>a(e.customFieldId,n),isDeleting:i,onChange:(e,t)=>t&&l()})})})});return(0,Td.jsx)(q5,{className:e.className,children:(0,Td.jsxs)("div",{className:"mailpoet_custom_date",children:[c,(0,Td.jsx)("label",{className:"mailpoet_date_label","data-automation-id":"editor_custom_date_label",htmlFor:n,children:V5(e)}),(0,Td.jsx)(G5,{field:{name:n,day_placeholder:_2.U.I18n.t("customFieldDay"),month_placeholder:_2.U.I18n.t("customFieldMonth"),year_placeholder:_2.U.I18n.t("customFieldYear"),params:{date_type:e.dateType,date_format:e.dateFormat}},item:{[n]:e.defaultToday?L5()().format("YYYY-MM-DD"):""},addDefaultClasses:!0,onValueChange:()=>{}})]})})}function J5(e){return{title:e.name,description:"",icon:P5,category:"custom-fields",attributes:{label:{type:"string",default:e.name},mandatory:{type:"boolean",default:!!e.params.required&&!!e.params.required},defaultToday:{type:"boolean",default:!1},dateType:{type:"string",default:e.params.date_type},dateFormat:{type:"string",default:e.params.date_format},customFieldId:{type:"string",default:e.id}},supports:{html:!1,multiple:!1},edit:Y5,save:()=>null}}G5.propTypes={item:k2().object.isRequired,field:k2().shape({name:k2().string,day_placeholder:k2().string,month_placeholder:k2().string,year_placeholder:k2().string,params:k2().object}).isRequired,onValueChange:k2().func.isRequired,addDefaultClasses:k2().bool},q5.propTypes={children:k2().node.isRequired,className:k2().string},Y5.propTypes={attributes:k2().shape({label:k2().string.isRequired,dateFormat:k2().string.isRequired,dateType:k2().string.isRequired,defaultToday:k2().bool,mandatory:k2().bool.isRequired,customFieldId:k2().number.isRequired,className:k2().string}).isRequired,clientId:k2().string.isRequired,setAttributes:k2().func.isRequired};const X5={fullWidth:!0,inheritFromTheme:!0},Z5={fullWidth:!1,inheritFromTheme:!0},Q5=e=>{if(!e)return Z5;const t={fullWidth:"1"===e.full_width||!0===e.full_width,inheritFromTheme:!(0,I2.has)(e,"bold")};return t.inheritFromTheme||(t.bold="1"===e.bold||!0===e.bold,(0,I2.has)(e,"background_color")&&e.background_color&&(t.backgroundColor=e.background_color),(0,I2.has)(e,"gradient")&&e.gradient&&(t.gradient=e.gradient),(0,I2.has)(e,"border_size")&&void 0!==e.border_size&&(t.borderSize=Number(e.border_size)),(0,I2.has)(e,"font_size")&&void 0!==e.font_size&&(t.fontSize=Number(e.font_size)),(0,I2.has)(e,"font_color")&&e.font_color&&(t.fontColor=e.font_color),(0,I2.has)(e,"border_radius")&&void 0!==e.border_radius&&(t.borderRadius=Number(e.border_radius)),(0,I2.has)(e,"border_color")&&e.border_color&&(t.borderColor=e.border_color),(0,I2.has)(e,"padding")&&void 0!==e.padding&&(t.padding=Number(e.padding)),(0,I2.has)(e,"font_family")&&e.font_family&&(t.fontFamily=e.font_family)),t},e4=(e,t)=>{const n=e.find((e=>e.color===t));return n?n.slug:void 0},t4=(e,t)=>{const n=e.find((e=>e.gradient===t));return n?n.slug:void 0};function n4({label:e="",mandatory:t=!1,validate:n="",isSaving:r=!1,onSave:o=null,isDeleting:i=!1,onCustomFieldDelete:s=null,onChange:a=null,fieldType:l=""}){const[c,u]=(0,S.useState)(e),[d,h]=(0,S.useState)(t),[p,f]=(0,S.useState)(n),m=(0,S.useMemo)((()=>({label:c,mandatory:d,validate:p})),[c,d,p]),g=d!==t||p!==n||c!==e;return(0,S.useEffect)((()=>{a&&a(m,g)}),[m,a,g,l]),(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(KE.A,{label:_2.U.I18n.t("label"),value:c,"data-automation-id":"settings_custom_text_label_input",onChange:u}),(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("blockMandatory"),checked:d,onChange:h}),(0,Td.jsx)(_T.A,{label:`${_2.U.I18n.t("customFieldValidateFor")}:`,"data-automation-id":"settings_custom_text_input_validation_type",options:[{label:_2.U.I18n.t("customFieldValidateNothing"),value:""},{label:_2.U.I18n.t("customFieldValidateNumbersOnly"),value:"number"},{label:_2.U.I18n.t("customFieldValidateAlphanumerical"),value:"alphanum"},{label:_2.U.I18n.t("customFieldValidatePhoneNumber"),value:"phone"}],value:p,onChange:f}),o?(0,Td.jsx)(Zv.Ay,{variant:"primary",onClick:()=>o(m),isBusy:r,disabled:r||i||!g,className:"button-on-top","data-automation-id":"custom_field_save",children:_2.U.I18n.t("customFieldSaveCTA")}):null,s?(0,Td.jsx)(z5,{isBusy:r||i,onDelete:s}):null]})}n4.propTypes={label:k2().string,mandatory:k2().bool,validate:k2().string,onSave:k2().func,isSaving:k2().bool,isDeleting:k2().bool,onCustomFieldDelete:k2().func,onChange:k2().func,fieldType:k2().string};const r4=({setting:e,children:t,panelId:n,...r})=>(0,Td.jsx)(YA,{hasValue:()=>!!e.colorValue||!!e.gradientValue,label:e.label,onDeselect:()=>{e.colorValue?e.onColorChange():e.gradientValue&&e.onGradientChange()},isShownByDefault:void 0===e.isShownByDefault||e.isShownByDefault,...r,className:"block-editor-tools-panel-color-gradient-settings__item",panelId:n,resetAllFilter:e.resetAllFilter,children:t}),o4=({colorValue:e,label:t})=>(0,Td.jsxs)(tA.A,{justify:"flex-start",children:[(0,Td.jsx)(bT,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:e}),(0,Td.jsx)(R_.A,{className:"block-editor-panel-color-gradient-settings__color-name",title:t,children:t})]}),i4=e=>({onToggle:t,isOpen:n})=>{const{colorValue:r,label:o}=e,i={onClick:t,className:(0,$v.A)("block-editor-panel-color-gradient-settings__dropdown",{"is-open":n}),"aria-expanded":n};return(0,Td.jsx)(Zv.Ay,{...i,children:(0,Td.jsx)(o4,{colorValue:r,label:o})})};function s4({colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:r,gradients:o,settings:i,__experimentalIsRenderedInSidebar:s,...a}){let l;return s&&(l={placement:"left-start",offset:36,shift:!0}),(0,Td.jsx)(Td.Fragment,{children:i.map(((i,c)=>{var u;const d={clearable:!1,colorValue:i.colorValue,colors:e,disableCustomColors:t,disableCustomGradients:n,enableAlpha:r,gradientValue:i.gradientValue,gradients:o,label:i.label,onColorChange:i.onColorChange,onGradientChange:i.onGradientChange,showTitle:!1,__experimentalIsRenderedInSidebar:s,...i},h={colorValue:null!==(u=i.gradientValue)&&void 0!==u?u:i.colorValue,label:i.label};return i&&(0,Td.jsx)(r4,{setting:i,...a,children:(0,Td.jsx)(PE.A,{popoverProps:l,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:i4(h),renderContent:()=>(0,Td.jsx)(FB,{paddingSize:"none",children:(0,Td.jsx)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:(0,Td.jsx)(iD,{...d})})})})},c)}))})}const a4=["colors","disableCustomColors","gradients","disableCustomGradients"],l4=({className:e,colors:t,gradients:n,disableCustomColors:r,disableCustomGradients:o,children:i,settings:s,title:a,showTitle:l=!0,__experimentalIsRenderedInSidebar:c,enableAlpha:u})=>{const d=(0,z_.A)(l4),{batch:h}=(0,Hp.A)();return t&&0!==t.length||n&&0!==n.length||!r||!o||!s?.every((e=>(!e.colors||0===e.colors.length)&&(!e.gradients||0===e.gradients.length)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients)))?(0,Td.jsxs)(wA,{className:(0,$v.A)("block-editor-panel-color-gradient-settings",e),label:l?a:void 0,resetAll:()=>{h((()=>{s.forEach((({colorValue:e,gradientValue:t,onColorChange:n,onGradientChange:r})=>{e?n():t&&r()}))}))},panelId:d,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last",children:[(0,Td.jsx)(s4,{settings:s,panelId:d,colors:t,gradients:n,disableCustomColors:r,disableCustomGradients:o,__experimentalIsRenderedInSidebar:c,enableAlpha:u}),!!i&&(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(DT.A,{marginY:4})," ",i]})]}):null},c4=e=>{const t=nT();return(0,Td.jsx)(l4,{...t,...e})},u4=e=>a4.every((t=>e.hasOwnProperty(t)))?(0,Td.jsx)(l4,{...e}):(0,Td.jsx)(c4,{...e});function d4({title:e,settings:t}){const[n,r]=fv("color.palette","color.gradients");return(0,Td.jsx)("div",{children:(0,Td.jsx)(u4,{title:e,colors:n,gradients:r,settings:t})})}d4.displayName="ColorGradientSettings";const h4=(0,v2.withBoundary)(d4);function p4({styles:e,onChange:t}){const n=(0,S.useRef)(e),r=n.current,{applyStylesToAllTextInputs:o}=(0,Vl.A)(A2),i=(e,r)=>{const o={...n.current};o[e]=r,t(o),n.current=o};return(0,Td.jsx)(F5.A,{className:"mailpoet-automation-input-styles-panel",children:(0,Td.jsx)(aF.Ay,{title:_2.U.I18n.t("formSettingsStyles"),initialOpen:!1,children:(0,Td.jsxs)("div",{className:"mailpoet-styles-settings","data-automation-id":"input_styles_settings",children:[(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("formSettingsDisplayFullWidth"),checked:r.fullWidth,onChange:(0,I2.partial)(i,"fullWidth")}),(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("formSettingsInheritStyleFromTheme"),checked:r.inheritFromTheme,onChange:e=>{if(e)return void i("inheritFromTheme",e);const r={...n.current};r.backgroundColor="#ffffff",r.bold=!1,r.borderRadius=0,r.borderSize=1,r.borderColor="#313131",r.inheritFromTheme=e,t(r),n.current=r},className:"mailpoet-automation-inherit-theme-toggle"}),r.inheritFromTheme?null:(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(h4,{title:_2.U.I18n.t("formSettingsColor"),settings:[{label:_2.U.I18n.t("formSettingsStylesFont"),colorValue:r.fontColor,onColorChange:(0,I2.partial)(i,"fontColor")},{label:_2.U.I18n.t("formSettingsStylesBackground"),colorValue:r.backgroundColor,onColorChange:(0,I2.partial)(i,"backgroundColor")},{label:_2.U.I18n.t("formSettingsBorder"),colorValue:r.borderColor,onColorChange:(0,I2.partial)(i,"borderColor")}]}),(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("formSettingsBold"),checked:r.bold||!1,onChange:(0,I2.partial)(i,"bold"),className:"mailpoet-automation-styles-bold-toggle"}),(0,Td.jsx)(FC,{label:_2.U.I18n.t("formSettingsBorderSize"),value:void 0===r.borderSize?1:r.borderSize,min:0,max:10,allowReset:!0,onChange:(0,I2.partial)(i,"borderSize"),className:"mailpoet-automation-styles-border-size"}),(0,Td.jsx)(FC,{label:_2.U.I18n.t("formSettingsBorderRadius"),value:void 0===r.borderRadius?1:r.borderRadius,min:0,max:40,allowReset:!0,onChange:(0,I2.partial)(i,"borderRadius"),className:"mailpoet-automation-styles-border-radius-size"})]}),(0,Td.jsx)("div",{children:(0,Td.jsx)(Zv.Ay,{variant:"primary",onClick:()=>o(r),"data-automation-id":"styles_apply_to_all",children:_2.U.I18n.t("formSettingsApplyToAll")})})]})})})}const f4=k2().shape({fullWidth:k2().bool.isRequired,inheritFromTheme:k2().bool.isRequired,bold:k2().bool,backgroundColor:k2().string,borderSize:k2().number,borderRadius:k2().number,borderColor:k2().string});let m4=function(e){return e.Left="left",e.Center="center",e.Right="right",e}({});function g4(e){return e===m4.Right?"0 0 0 auto":e===m4.Center?"0 auto":"auto 0"}function b4({label:e,labelWithinInput:t,name:n,mandatory:r,styles:o,className:i=""}){const s=(0,Ul.A)((e=>e(A2).getFormSettings()),[]),a=(0,S.useRef)(null),l=`${n}_${Math.random().toString(36).substring(2,15)}`,[c,u]=(0,S.useState)(""),d=o.inheritFromTheme?{}:{fontWeight:o.bold?"bold":"inherit"},h=o.inheritFromTheme?{}:{borderRadius:o.borderRadius?`${o.borderRadius}px`:0,borderWidth:void 0!==o.borderSize?`${o.borderSize}px`:"1px",borderColor:o.borderColor||"initial",borderStyle:"solid"};void 0!==s.inputPadding&&(h.padding=s.inputPadding),void 0!==s.inputPadding&&(h.padding=s.inputPadding),void 0!==s.alignment&&(h.textAlign=s.alignment,h.margin=g4(h.textAlign)),o.fullWidth&&(h.width="100%"),o.backgroundColor&&!o.inheritFromTheme&&(h.backgroundColor=o.backgroundColor);const p={};return o.fontColor&&!o.inheritFromTheme&&(h.color=o.fontColor,t&&(p.color=o.fontColor)),(0,Td.jsxs)(q5,{className:i,children:[t?null:(0,Td.jsx)("label",{className:"mailpoet_text_label","data-automation-id":`editor_${n}_label`,htmlFor:l,style:d,children:V5({label:e,mandatory:r})}),(e=>{let t=`#${l}::placeholder {`;return void 0!==p.color&&(t+=`color: ${p.color};`),s.fontFamily&&(t+=`font-family: ${s.fontFamily};`),t+="}",(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)("style",{children:t}),(0,Td.jsx)("input",{id:l,ref:a,className:"mailpoet_text",type:"text",name:n,value:c,onChange:()=>u(""),placeholder:e,"data-automation-id":`editor_${n}_input`,style:h,autoComplete:"off"})]})})(t?V5({label:e,mandatory:r}):"")]})}function y4({attributes:e,setAttributes:t,clientId:n}){const r=(0,Ul.A)((e=>e(A2).getIsCustomFieldSaving()),[]),o=(0,Ul.A)((e=>e(A2).getIsCustomFieldDeleting()),[]),{saveCustomField:i,deleteCustomField:s,customFieldEdited:a}=(0,Vl.A)(A2),l=(0,Td.jsxs)(IA,{children:[(0,Td.jsx)(F5.A,{children:(0,Td.jsx)(aF.Ay,{title:_2.U.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,Td.jsx)(n4,{updateAttributes:e=>t(e),customFieldId:e.customFieldId,label:e.label,mandatory:e.mandatory,validate:e.validate,isSaving:r,onSave:n=>{i({customFieldId:e.customFieldId,data:{params:K5("text",n)},onFinish:()=>t({mandatory:n.mandatory,validate:n.validate,label:n.label})})},onCustomFieldDelete:()=>s(e.customFieldId,n),isDeleting:o,onChange:(e,t)=>t&&a()})})}),(0,Td.jsx)(F5.A,{children:(0,Td.jsx)(aF.Ay,{title:_2.U.I18n.t("customFieldsFormSettings"),initialOpen:!0,children:(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("displayLabelWithinInput"),checked:e.labelWithinInput,onChange:e=>t({labelWithinInput:e})})})}),(0,Td.jsx)(p4,{styles:e.styles,onChange:e=>t({styles:e})})]});return(0,Td.jsxs)(Td.Fragment,{children:[l,(0,Td.jsx)(b4,{className:e.className,name:"custom_text",mandatory:e.mandatory,labelWithinInput:e.labelWithinInput,label:e.label,styles:e.styles})]})}function v4(e){return{title:e.name,description:"",icon:P5,category:"custom-fields",attributes:{label:{type:"string",default:e.name},labelWithinInput:{type:"boolean",default:!0},mandatory:{type:"boolean",default:!!e.params.required&&!!e.params.required},validate:{type:"string",default:e.params.validate?e.params.validate:""},customFieldId:{type:"string",default:e.id},styles:{type:"object",default:X5}},supports:{html:!1,multiple:!1},edit:y4,save:()=>null}}function _4({name:e,attributes:t,setAttributes:n,clientId:r}){const o=`${e.replace(/[^a-zA-Z]/g,"")}_${Math.random().toString(36).substring(2,15)}`,i=(0,Ul.A)((e=>e(A2).getFormSettings()),[]),s=(0,Ul.A)((e=>e(A2).getIsCustomFieldSaving()),[]),a=(0,Ul.A)((e=>e(A2).getIsCustomFieldDeleting()),[]),[l,c]=(0,S.useState)(""),{saveCustomField:u,deleteCustomField:d,customFieldEdited:h}=(0,Vl.A)(A2),p=(0,Td.jsxs)(IA,{children:[(0,Td.jsx)(F5.A,{children:(0,Td.jsx)(aF.Ay,{title:_2.U.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,Td.jsx)(n4,{label:t.label,mandatory:t.mandatory,validate:t.validate,isSaving:s,onSave:e=>u({customFieldId:t.customFieldId,data:{params:K5("textarea",e)},onFinish:()=>n({mandatory:e.mandatory,validate:e.validate,lines:e.lines,label:e.label})}),onCustomFieldDelete:()=>d(t.customFieldId,r),isDeleting:a,onChange:(e,t)=>t&&h()})})}),(0,Td.jsx)(F5.A,{children:(0,Td.jsxs)(aF.Ay,{title:_2.U.I18n.t("formSettings"),initialOpen:!0,children:[(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("displayLabelWithinInput"),checked:t.labelWithinInput,onChange:e=>n({labelWithinInput:e})}),(0,Td.jsx)(_T.A,{label:`${_2.U.I18n.t("customFieldNumberOfLines")}:`,"data-automation-id":"settings_custom_text_area_number_of_lines",value:t.lines,options:[{label:_2.U.I18n.t("customField1Line"),value:"1"},{label:_2.U.I18n.t("customField2Lines"),value:"2"},{label:_2.U.I18n.t("customField3Lines"),value:"3"},{label:_2.U.I18n.t("customField4Lines"),value:"4"},{label:_2.U.I18n.t("customField5Lines"),value:"5"}],onChange:e=>n({lines:e})})]})}),(0,Td.jsx)(p4,{styles:t.styles,onChange:e=>n({styles:e})})]}),f=t.styles.inheritFromTheme?{}:{fontWeight:t.styles.bold?"bold":"inherit"},m=t.styles.inheritFromTheme?{}:{borderRadius:t.styles.borderRadius?`${t.styles.borderRadius}px`:0,borderWidth:void 0!==t.styles.borderSize?`${t.styles.borderSize}px`:"1px",borderColor:t.styles.borderColor||"initial",borderStyle:"solid"};t.styles.fullWidth&&(m.width="100%"),t.styles.backgroundColor&&!t.styles.inheritFromTheme&&(m.backgroundColor=t.styles.backgroundColor),void 0!==i.inputPadding&&(m.padding=i.inputPadding),void 0!==i.alignment&&(m.textAlign=i.alignment,m.margin=g4(m.textAlign)),m.resize="none";const g={};t.styles.fontColor&&!t.styles.inheritFromTheme&&(m.color=t.styles.fontColor,t.labelWithinInput&&(g.color=t.styles.fontColor));const b=(0,S.useRef)(null),y=e=>{let n=`#${o}::placeholder {`;return void 0!==g.color&&(n+=`color: ${g.color};`),i.fontFamily&&(n+=`font-family: ${i.fontFamily};`),n+="}",(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)("style",{children:n}),(0,Td.jsx)("textarea",{id:o,ref:b,className:"mailpoet_textarea",name:"custom_text","data-automation-id":"editor_custom_textarea_input",rows:t.lines,style:m,onChange:()=>c(""),placeholder:e,value:l})]})};return(0,Td.jsxs)(q5,{className:t.className,children:[p,t.labelWithinInput?y(V5(t)):(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)("label",{className:"mailpoet_textarea_label","data-automation-id":"editor_custom_text_label",htmlFor:o,style:f,children:V5(t)}),y("")]})]})}function x4(e){return{title:e.name,description:"",icon:P5,category:"custom-fields",attributes:{label:{type:"string",default:e.name},labelWithinInput:{type:"boolean",default:!0},mandatory:{type:"boolean",default:!!e.params.required&&!!e.params.required},validate:{type:"string",default:e.params.validate?e.params.validate:""},lines:{type:"string",default:"1"},customFieldId:{type:"string",default:e.id},styles:{type:"object",default:X5}},supports:{html:!1,multiple:!1},edit:_4,save:()=>null}}b4.propTypes={label:k2().string.isRequired,labelWithinInput:k2().bool.isRequired,name:k2().string.isRequired,mandatory:k2().bool.isRequired,className:k2().string,styles:f4.isRequired},y4.propTypes={attributes:k2().shape({label:k2().string.isRequired,validate:k2().string,labelWithinInput:k2().bool.isRequired,mandatory:k2().bool.isRequired,customFieldId:k2().number.isRequired,styles:f4.isRequired,className:k2().string}).isRequired,setAttributes:k2().func.isRequired,clientId:k2().string.isRequired},_4.propTypes={attributes:k2().shape({label:k2().string.isRequired,customFieldId:k2().number.isRequired,validate:k2().string,labelWithinInput:k2().bool.isRequired,mandatory:k2().bool.isRequired,lines:k2().string,styles:f4.isRequired,className:k2().string}).isRequired,setAttributes:k2().func.isRequired,clientId:k2().string.isRequired,name:k2().string.isRequired};var w4=n(55089),k4=n(13331);function C4(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(0,k4.A)(e,t)}var S4=n(70211),A4=n(9489),E4=S.createContext(null),I4=function(e){e()},j4=function(){return I4},T4={notify:function(){},get:function(){return[]}};function B4(e,t){var n,r=T4;function o(){s.onStateChange&&s.onStateChange()}function i(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=function(){var e=j4(),t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}var s={addNestedSub:function(e){return i(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return Boolean(n)},trySubscribe:i,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=T4)},getListeners:function(){return r}};return s}var R4="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?S.useLayoutEffect:S.useEffect;const N4=function(e){var t=e.store,n=e.context,r=e.children,o=(0,S.useMemo)((function(){var e=B4(t);return{store:t,subscription:e}}),[t]),i=(0,S.useMemo)((function(){return t.getState()}),[t]);R4((function(){var e=o.subscription;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),i!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[o,i]);var s=n||E4;return S.createElement(s.Provider,{value:o},r)};var D4=n(634),M4=n(33871),P4=n.n(M4),O4=n(57537),L4=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],F4=["reactReduxForwardedRef"],z4=[],U4=[null,null];function V4(e,t){var n=e[1];return[t.payload,n+1]}function H4(e,t,n){R4((function(){return e.apply(void 0,t)}),n)}function $4(e,t,n,r,o,i,s){e.current=r,t.current=o,n.current=!1,i.current&&(i.current=null,s())}function W4(e,t,n,r,o,i,s,a,l,c){if(e){var u=!1,d=null,h=function(){if(!u){var e,n,h=t.getState();try{e=r(h,o.current)}catch(e){n=e,d=e}n||(d=null),e===i.current?s.current||l():(i.current=e,a.current=e,s.current=!0,c({type:"STORE_UPDATED",payload:{error:n}}))}};return n.onStateChange=h,n.trySubscribe(),h(),function(){if(u=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}}var G4=function(){return[null,0]};function q4(e,t){void 0===t&&(t={});var n=t,r=n.getDisplayName,o=void 0===r?function(e){return"ConnectAdvanced("+e+")"}:r,i=n.methodName,s=void 0===i?"connectAdvanced":i,a=n.renderCountProp,l=void 0===a?void 0:a,c=n.shouldHandleStateChanges,u=void 0===c||c,d=n.storeKey,h=void 0===d?"store":d,p=(n.withRef,n.forwardRef),f=void 0!==p&&p,m=n.context,g=void 0===m?E4:m,b=(0,D4.A)(n,L4),y=g;return function(t){var n=t.displayName||t.name||"Component",r=o(n),i=(0,S4.A)({},b,{getDisplayName:o,methodName:s,renderCountProp:l,shouldHandleStateChanges:u,storeKey:h,displayName:r,wrappedComponentName:n,WrappedComponent:t}),a=b.pure,c=a?S.useMemo:function(e){return e()};function d(n){var r=(0,S.useMemo)((function(){var e=n.reactReduxForwardedRef,t=(0,D4.A)(n,F4);return[n.context,e,t]}),[n]),o=r[0],s=r[1],a=r[2],l=(0,S.useMemo)((function(){return o&&o.Consumer&&(0,O4.isContextConsumer)(S.createElement(o.Consumer,null))?o:y}),[o,y]),d=(0,S.useContext)(l),h=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(d)&&Boolean(d.store);var p=h?n.store:d.store,f=(0,S.useMemo)((function(){return function(t){return e(t.dispatch,i)}(p)}),[p]),m=(0,S.useMemo)((function(){if(!u)return U4;var e=B4(p,h?null:d.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[p,h,d]),g=m[0],b=m[1],v=(0,S.useMemo)((function(){return h?d:(0,S4.A)({},d,{subscription:g})}),[h,d,g]),_=(0,S.useReducer)(V4,z4,G4),x=_[0][0],w=_[1];if(x&&x.error)throw x.error;var k=(0,S.useRef)(),C=(0,S.useRef)(a),A=(0,S.useRef)(),E=(0,S.useRef)(!1),I=c((function(){return A.current&&a===C.current?A.current:f(p.getState(),a)}),[p,x,a]);H4($4,[C,k,E,a,I,A,b]),H4(W4,[u,p,g,f,C,k,E,A,b,w],[p,g,f]);var j=(0,S.useMemo)((function(){return S.createElement(t,(0,S4.A)({},I,{ref:s}))}),[s,t,I]);return(0,S.useMemo)((function(){return u?S.createElement(l.Provider,{value:v},j):j}),[l,j,v])}var p=a?S.memo(d):d;if(p.WrappedComponent=t,p.displayName=d.displayName=r,f){var m=S.forwardRef((function(e,t){return S.createElement(p,(0,S4.A)({},e,{reactReduxForwardedRef:t}))}));return m.displayName=r,m.WrappedComponent=t,P4()(m,t)}return P4()(p,t)}}function K4(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function Y4(e,t){if(K4(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!K4(e[n[o]],t[n[o]]))return!1;return!0}function J4(e){return function(t,n){var r=e(t,n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function X4(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function Z4(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=X4(e);var o=r(t,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=X4(o),o=r(t,n)),o},r}}const Q4=[function(e){return"function"==typeof e?Z4(e):void 0},function(e){return e?void 0:J4((function(e){return{dispatch:e}}))},function(e){return e&&"object"==typeof e?J4((function(t){return function(e,t){var n={},r=function(r){var o=e[r];"function"==typeof o&&(n[r]=function(){return t(o.apply(void 0,arguments))})};for(var o in e)r(o);return n}(e,t)})):void 0}],e3=[function(e){return"function"==typeof e?Z4(e):void 0},function(e){return e?void 0:J4((function(){return{}}))}];function t3(e,t,n){return(0,S4.A)({},n,e,t)}const n3=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r,o=n.pure,i=n.areMergedPropsEqual,s=!1;return function(t,n,a){var l=e(t,n,a);return s?o&&i(l,r)||(r=l):(s=!0,r=l),r}}}(e):void 0},function(e){return e?void 0:function(){return t3}}];var r3=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function o3(e,t,n,r){return function(o,i){return n(e(o,i),t(r,i),i)}}function i3(e,t,n,r,o){var i,s,a,l,c,u=o.areStatesEqual,d=o.areOwnPropsEqual,h=o.areStatePropsEqual,p=!1;return function(o,f){return p?function(o,p){var f,m,g=!d(p,s),b=!u(o,i,p,s);return i=o,s=p,g&&b?(a=e(i,s),t.dependsOnOwnProps&&(l=t(r,s)),c=n(a,l,s)):g?(e.dependsOnOwnProps&&(a=e(i,s)),t.dependsOnOwnProps&&(l=t(r,s)),c=n(a,l,s)):b?(f=e(i,s),m=!h(f,a),a=f,m&&(c=n(a,l,s)),c):c}(o,f):(a=e(i=o,s=f),l=t(r,s),c=n(a,l,s),p=!0,c)}}function s3(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,o=t.initMergeProps,i=(0,D4.A)(t,r3),s=n(e,i),a=r(e,i),l=o(e,i);return(i.pure?i3:o3)(s,a,l,e,i)}var a3=["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"];function l3(e,t,n){for(var r=t.length-1;r>=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function c3(e,t){return e===t}function u3(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?q4:n,o=t.mapStateToPropsFactories,i=void 0===o?e3:o,s=t.mapDispatchToPropsFactories,a=void 0===s?Q4:s,l=t.mergePropsFactories,c=void 0===l?n3:l,u=t.selectorFactory,d=void 0===u?s3:u;return function(e,t,n,o){void 0===o&&(o={});var s=o,l=s.pure,u=void 0===l||l,h=s.areStatesEqual,p=void 0===h?c3:h,f=s.areOwnPropsEqual,m=void 0===f?Y4:f,g=s.areStatePropsEqual,b=void 0===g?Y4:g,y=s.areMergedPropsEqual,v=void 0===y?Y4:y,_=(0,D4.A)(s,a3),x=l3(e,i,"mapStateToProps"),w=l3(t,a,"mapDispatchToProps"),k=l3(n,c,"mergeProps");return r(d,(0,S4.A)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:x,initMapDispatchToProps:w,initMergeProps:k,pure:u,areStatesEqual:p,areOwnPropsEqual:m,areStatePropsEqual:b,areMergedPropsEqual:v},_))}}const d3=u3();var h3;h3=kW.unstable_batchedUpdates,I4=h3;var p3=n(49724),f3=function(e){var t=e.top,n=e.right,r=e.bottom,o=e.left;return{top:t,right:n,bottom:r,left:o,width:n-o,height:r-t,x:o,y:t,center:{x:(n+o)/2,y:(r+t)/2}}},m3=function(e,t){return{top:e.top-t.top,left:e.left-t.left,bottom:e.bottom+t.bottom,right:e.right+t.right}},g3=function(e,t){return{top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right}},b3={top:0,right:0,bottom:0,left:0},y3=function(e){var t=e.borderBox,n=e.margin,r=void 0===n?b3:n,o=e.border,i=void 0===o?b3:o,s=e.padding,a=void 0===s?b3:s,l=f3(m3(t,r)),c=f3(g3(t,i)),u=f3(g3(c,a));return{marginBox:l,borderBox:f3(t),paddingBox:c,contentBox:u,margin:r,border:i,padding:a}},v3=function(e){var t=e.slice(0,-2);if("px"!==e.slice(-2))return 0;var n=Number(t);return isNaN(n)&&function(e,t){throw new Error("Invariant failed")}(),n},_3=function(e,t){var n,r,o=e.borderBox,i=e.border,s=e.margin,a=e.padding,l=(r=t,{top:(n=o).top+r.y,left:n.left+r.x,bottom:n.bottom+r.y,right:n.right+r.x});return y3({borderBox:l,border:i,margin:s,padding:a})},x3=function(e,t){return void 0===t&&(t={x:window.pageXOffset,y:window.pageYOffset}),_3(e,t)},w3=function(e,t){var n={top:v3(t.marginTop),right:v3(t.marginRight),bottom:v3(t.marginBottom),left:v3(t.marginLeft)},r={top:v3(t.paddingTop),right:v3(t.paddingRight),bottom:v3(t.paddingBottom),left:v3(t.paddingLeft)},o={top:v3(t.borderTopWidth),right:v3(t.borderRightWidth),bottom:v3(t.borderBottomWidth),left:v3(t.borderLeftWidth)};return y3({borderBox:e,margin:n,padding:r,border:o})},k3=function(e){var t=e.getBoundingClientRect(),n=window.getComputedStyle(e);return w3(t,n)},C3=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function S3(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(r=e[n],o=t[n],!(r===o||C3(r)&&C3(o)))return!1;var r,o;return!0}const A3=function(e,t){var n;void 0===t&&(t=S3);var r,o=[],i=!1;return function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];return i&&n===this&&t(s,o)||(r=e.apply(this,s),i=!0,n=this,o=s),r}},E3=function(e){var t=[],n=null,r=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];t=o,n||(n=requestAnimationFrame((function(){n=null,e.apply(void 0,t)})))};return r.cancel=function(){n&&(cancelAnimationFrame(n),n=null)},r};function I3(e,t){}function j3(){}function T3(e,t,n){var r=t.map((function(t){var r,o,i=(r=n,o=t.options,(0,S4.A)({},r,{},o));return e.addEventListener(t.eventName,t.fn,i),function(){e.removeEventListener(t.eventName,t.fn,i)}}));return function(){r.forEach((function(e){e()}))}}I3.bind(null,"warn"),I3.bind(null,"error");var B3=!0,R3="Invariant failed";function N3(e){this.message=e}function D3(e,t){if(!e)throw new N3(B3?R3:R3+": "+(t||""))}N3.prototype.toString=function(){return this.message};var M3=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).callbacks=null,t.unbind=j3,t.onWindowError=function(e){var n=t.getCallbacks();n.isDragging()&&n.tryAbort(),e.error instanceof N3&&e.preventDefault()},t.getCallbacks=function(){if(!t.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return t.callbacks},t.setCallbacks=function(e){t.callbacks=e},t}C4(t,e);var n=t.prototype;return n.componentDidMount=function(){this.unbind=T3(window,[{eventName:"error",fn:this.onWindowError}])},n.componentDidCatch=function(e){if(!(e instanceof N3))throw e;this.setState({})},n.componentWillUnmount=function(){this.unbind()},n.render=function(){return this.props.children(this.setCallbacks)},t}(S.Component),P3=function(e){return e+1},O3=function(e,t){var n=e.droppableId===t.droppableId,r=P3(e.index),o=P3(t.index);return n?"\n      You have moved the item from position "+r+"\n      to position "+o+"\n    ":"\n    You have moved the item from position "+r+"\n    in list "+e.droppableId+"\n    to list "+t.droppableId+"\n    in position "+o+"\n  "},L3=function(e,t,n){return t.droppableId===n.droppableId?"\n      The item "+e+"\n      has been combined with "+n.draggableId:"\n      The item "+e+"\n      in list "+t.droppableId+"\n      has been combined with "+n.draggableId+"\n      in list "+n.droppableId+"\n    "},F3=function(e){return"\n  The item has returned to its starting position\n  of "+P3(e.index)+"\n"},z3={dragHandleUsageInstructions:"\n  Press space bar to start a drag.\n  When dragging you can use the arrow keys to move the item around and escape to cancel.\n  Some screen readers may require you to be in focus mode or to use your pass through key\n",onDragStart:function(e){return"\n  You have lifted an item in position "+P3(e.source.index)+"\n"},onDragUpdate:function(e){var t=e.destination;if(t)return O3(e.source,t);var n=e.combine;return n?L3(e.draggableId,e.source,n):"You are over an area that cannot be dropped on"},onDragEnd:function(e){if("CANCEL"===e.reason)return"\n      Movement cancelled.\n      "+F3(e.source)+"\n    ";var t=e.destination,n=e.combine;return t?"\n      You have dropped the item.\n      "+O3(e.source,t)+"\n    ":n?"\n      You have dropped the item.\n      "+L3(e.draggableId,e.source,n)+"\n    ":"\n    The item has been dropped while not over a drop area.\n    "+F3(e.source)+"\n  "}},U3={x:0,y:0},V3=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},H3=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},$3=function(e,t){return e.x===t.x&&e.y===t.y},W3=function(e){return{x:0!==e.x?-e.x:0,y:0!==e.y?-e.y:0}},G3=function(e,t,n){var r;return void 0===n&&(n=0),(r={})[e]=t,r["x"===e?"y":"x"]=n,r},q3=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},K3=function(e,t){return Math.min.apply(Math,t.map((function(t){return q3(e,t)})))},Y3=function(e){return function(t){return{x:e(t.x),y:e(t.y)}}},J3=function(e,t){return{top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}},X3=function(e){return[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}]},Z3=function(e,t){return t&&t.shouldClipSubject?function(e,t){var n=f3({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return n.width<=0||n.height<=0?null:n}(t.pageMarginBox,e):f3(e)},Q3=function(e){var t=e.page,n=e.withPlaceholder,r=e.axis,o=e.frame,i=function(e,t){return t?J3(e,t.scroll.diff.displacement):e}(t.marginBox,o),s=function(e,t,n){var r;return n&&n.increasedBy?(0,S4.A)({},e,((r={})[t.end]=e[t.end]+n.increasedBy[t.line],r)):e}(i,r,n);return{page:t,withPlaceholder:n,active:Z3(s,o)}},e8=function(e,t){e.frame||D3(!1);var n=e.frame,r=H3(t,n.scroll.initial),o=W3(r),i=(0,S4.A)({},n,{scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:o},max:n.scroll.max}}),s=Q3({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:i});return(0,S4.A)({},e,{frame:i,subject:s})};function t8(e){return Object.values?Object.values(e):Object.keys(e).map((function(t){return e[t]}))}function n8(e,t){if(e.findIndex)return e.findIndex(t);for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1}function r8(e,t){if(e.find)return e.find(t);var n=n8(e,t);return-1!==n?e[n]:void 0}function o8(e){return Array.prototype.slice.call(e)}var i8=A3((function(e){return e.reduce((function(e,t){return e[t.descriptor.id]=t,e}),{})})),s8=A3((function(e){return e.reduce((function(e,t){return e[t.descriptor.id]=t,e}),{})})),a8=A3((function(e){return t8(e)})),l8=A3((function(e){return t8(e)})),c8=A3((function(e,t){var n=l8(t).filter((function(t){return e===t.descriptor.droppableId})).sort((function(e,t){return e.descriptor.index-t.descriptor.index}));return n}));function u8(e){return e.at&&"REORDER"===e.at.type?e.at.destination:null}function d8(e){return e.at&&"COMBINE"===e.at.type?e.at.combine:null}var h8=A3((function(e,t){return t.filter((function(t){return t.descriptor.id!==e.descriptor.id}))})),p8=function(e,t){return e.descriptor.droppableId===t.descriptor.id},f8={point:U3,value:0},m8={invisible:{},visible:{},all:[]},g8={displaced:m8,displacedBy:f8,at:null},b8=function(e,t){return function(n){return e<=n&&n<=t}},y8=function(e){var t=b8(e.top,e.bottom),n=b8(e.left,e.right);return function(r){if(t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right))return!0;var o=t(r.top)||t(r.bottom),i=n(r.left)||n(r.right);if(o&&i)return!0;var s=r.top<e.top&&r.bottom>e.bottom,a=r.left<e.left&&r.right>e.right;return!(!s||!a)||s&&i||a&&o}},v8=function(e){var t=b8(e.top,e.bottom),n=b8(e.left,e.right);return function(e){return t(e.top)&&t(e.bottom)&&n(e.left)&&n(e.right)}},_8={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},x8={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},w8=function(e){var t=e.target,n=e.destination,r=e.viewport,o=e.withDroppableDisplacement,i=e.isVisibleThroughFrameFn,s=o?function(e,t){var n=t.frame?t.frame.scroll.diff.displacement:U3;return J3(e,n)}(t,n):t;return function(e,t,n){return!!t.subject.active&&n(t.subject.active)(e)}(s,n,i)&&function(e,t,n){return n(t)(e)}(s,r,i)},k8=function(e){return w8((0,S4.A)({},e,{isVisibleThroughFrameFn:y8}))},C8=function(e){return w8((0,S4.A)({},e,{isVisibleThroughFrameFn:v8}))},S8=function(e,t,n){if("boolean"==typeof n)return n;if(!t)return!0;var r=t.invisible,o=t.visible;if(r[e])return!1;var i=o[e];return!i||i.shouldAnimate};function A8(e){var t=e.afterDragging,n=e.destination,r=e.displacedBy,o=e.viewport,i=e.forceShouldAnimate,s=e.last;return t.reduce((function(e,t){var a=function(e,t){var n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return f3(m3(n,r))}(t,r),l=t.descriptor.id;if(e.all.push(l),!k8({target:a,destination:n,viewport:o,withDroppableDisplacement:!0}))return e.invisible[t.descriptor.id]=!0,e;var c={draggableId:l,shouldAnimate:S8(l,s,i)};return e.visible[l]=c,e}),{all:[],visible:{},invisible:{}})}function E8(e){var t=e.insideDestination,n=e.inHomeList,r=e.displacedBy,o=e.destination,i=function(e,t){if(!e.length)return 0;var n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}(t,{inHomeList:n});return{displaced:m8,displacedBy:r,at:{type:"REORDER",destination:{droppableId:o.descriptor.id,index:i}}}}function I8(e){var t=e.draggable,n=e.insideDestination,r=e.destination,o=e.viewport,i=e.displacedBy,s=e.last,a=e.index,l=e.forceShouldAnimate,c=p8(t,r);if(null==a)return E8({insideDestination:n,inHomeList:c,displacedBy:i,destination:r});var u=r8(n,(function(e){return e.descriptor.index===a}));if(!u)return E8({insideDestination:n,inHomeList:c,displacedBy:i,destination:r});var d=h8(t,n),h=n.indexOf(u);return{displaced:A8({afterDragging:d.slice(h),destination:r,displacedBy:i,last:s,viewport:o.frame,forceShouldAnimate:l}),displacedBy:i,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:a}}}}function j8(e,t){return Boolean(t.effected[e])}var T8=function(e,t){return t.margin[e.start]+t.borderBox[e.size]/2},B8=function(e,t,n){return t[e.crossAxisStart]+n.margin[e.crossAxisStart]+n.borderBox[e.crossAxisSize]/2},R8=function(e){var t=e.axis,n=e.moveRelativeTo,r=e.isMoving;return G3(t.line,n.marginBox[t.end]+T8(t,r),B8(t,n.marginBox,r))},N8=function(e){var t=e.axis,n=e.moveRelativeTo,r=e.isMoving;return G3(t.line,n.marginBox[t.start]-function(e,t){return t.margin[e.end]+t.borderBox[e.size]/2}(t,r),B8(t,n.marginBox,r))},D8=function(e,t){var n=e.frame;return n?V3(t,n.scroll.diff.displacement):t},M8=function(e){var t=function(e){var t=e.impact,n=e.draggable,r=e.droppable,o=e.draggables,i=e.afterCritical,s=n.page.borderBox.center,a=t.at;return r&&a?"REORDER"===a.type?function(e){var t=e.impact,n=e.draggable,r=e.draggables,o=e.droppable,i=e.afterCritical,s=c8(o.descriptor.id,r),a=n.page,l=o.axis;if(!s.length)return function(e){var t=e.axis,n=e.moveInto,r=e.isMoving;return G3(t.line,n.contentBox[t.start]+T8(t,r),B8(t,n.contentBox,r))}({axis:l,moveInto:o.page,isMoving:a});var c=t.displaced,u=t.displacedBy,d=c.all[0];if(d){var h=r[d];if(j8(d,i))return N8({axis:l,moveRelativeTo:h.page,isMoving:a});var p=_3(h.page,u.point);return N8({axis:l,moveRelativeTo:p,isMoving:a})}var f=s[s.length-1];if(f.descriptor.id===n.descriptor.id)return a.borderBox.center;if(j8(f.descriptor.id,i)){var m=_3(f.page,W3(i.displacedBy.point));return R8({axis:l,moveRelativeTo:m,isMoving:a})}return R8({axis:l,moveRelativeTo:f.page,isMoving:a})}({impact:t,draggable:n,draggables:o,droppable:r,afterCritical:i}):function(e){var t=e.afterCritical,n=e.impact,r=e.draggables,o=d8(n);o||D3(!1);var i=o.draggableId,s=r[i].page.borderBox.center,a=function(e){var t=e.displaced,n=e.afterCritical,r=e.combineWith,o=e.displacedBy,i=Boolean(t.visible[r]||t.invisible[r]);return j8(r,n)?i?U3:W3(o.point):i?o.point:U3}({displaced:n.displaced,afterCritical:t,combineWith:i,displacedBy:n.displacedBy});return V3(s,a)}({impact:t,draggables:o,afterCritical:i}):s}(e),n=e.droppable;return n?D8(n,t):t},P8=function(e,t){var n=H3(t,e.scroll.initial),r=W3(n);return{frame:f3({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:n,displacement:r}}}};function O8(e,t){return e.map((function(e){return t[e]}))}var L8=function(e){var t,n,r=e.pageBorderBoxCenter,o=e.draggable,i=(t=e.viewport,n=r,V3(t.scroll.diff.displacement,n)),s=H3(i,o.page.borderBox.center);return V3(o.client.borderBox.center,s)},F8=function(e){var t=e.draggable,n=e.destination,r=e.newPageBorderBoxCenter,o=e.viewport,i=e.withDroppableDisplacement,s=e.onlyOnMainAxis,a=void 0!==s&&s,l=H3(r,t.page.borderBox.center),c={target:J3(t.page.borderBox,l),destination:n,withDroppableDisplacement:i,viewport:o};return a?function(e){return w8((0,S4.A)({},e,{isVisibleThroughFrameFn:(t=e.destination.axis,function(e){var n=b8(e.top,e.bottom),r=b8(e.left,e.right);return function(e){return t===_8?n(e.top)&&n(e.bottom):r(e.left)&&r(e.right)}})}));var t}(c):C8(c)},z8=function(e){var t=e.isMovingForward,n=e.draggable,r=e.destination,o=e.draggables,i=e.previousImpact,s=e.viewport,a=e.previousPageBorderBoxCenter,l=e.previousClientSelection,c=e.afterCritical;if(!r.isEnabled)return null;var u=c8(r.descriptor.id,o),d=p8(n,r),h=function(e){var t=e.isMovingForward,n=e.draggable,r=e.destination,o=e.insideDestination,i=e.previousImpact;if(!r.isCombineEnabled)return null;if(!u8(i))return null;function s(e){var t={type:"COMBINE",combine:{draggableId:e,droppableId:r.descriptor.id}};return(0,S4.A)({},i,{at:t})}var a=i.displaced.all,l=a.length?a[0]:null;if(t)return l?s(l):null;var c=h8(n,o);if(!l)return c.length?s(c[c.length-1].descriptor.id):null;var u=n8(c,(function(e){return e.descriptor.id===l}));-1===u&&D3(!1);var d=u-1;return d<0?null:s(c[d].descriptor.id)}({isMovingForward:t,draggable:n,destination:r,insideDestination:u,previousImpact:i})||function(e){var t=e.isMovingForward,n=e.isInHomeList,r=e.draggable,o=e.draggables,i=e.destination,s=e.insideDestination,a=e.previousImpact,l=e.viewport,c=e.afterCritical,u=a.at;if(u||D3(!1),"REORDER"===u.type){var d=function(e){var t=e.isMovingForward,n=e.isInHomeList,r=e.insideDestination,o=e.location;if(!r.length)return null;var i=o.index,s=t?i+1:i-1,a=r[0].descriptor.index,l=r[r.length-1].descriptor.index;return s<a||s>(n?l:l+1)?null:s}({isMovingForward:t,isInHomeList:n,location:u.destination,insideDestination:s});return null==d?null:I8({draggable:r,insideDestination:s,destination:i,viewport:l,last:a.displaced,displacedBy:a.displacedBy,index:d})}var h=function(e){var t=e.isMovingForward,n=e.draggables,r=e.combine,o=e.afterCritical;if(!e.destination.isCombineEnabled)return null;var i=r.draggableId,s=n[i].descriptor.index;return j8(i,o)?t?s:s-1:t?s+1:s}({isMovingForward:t,destination:i,displaced:a.displaced,draggables:o,combine:u.combine,afterCritical:c});return null==h?null:I8({draggable:r,insideDestination:s,destination:i,viewport:l,last:a.displaced,displacedBy:a.displacedBy,index:h})}({isMovingForward:t,isInHomeList:d,draggable:n,draggables:o,destination:r,insideDestination:u,previousImpact:i,viewport:s,afterCritical:c});if(!h)return null;var p=M8({impact:h,draggable:n,droppable:r,draggables:o,afterCritical:c});if(F8({draggable:n,destination:r,newPageBorderBoxCenter:p,viewport:s.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:L8({pageBorderBoxCenter:p,draggable:n,viewport:s}),impact:h,scrollJumpRequest:null};var f=H3(p,a),m=function(e){var t=e.impact,n=e.viewport,r=e.destination,o=e.draggables,i=e.maxScrollChange,s=P8(n,V3(n.scroll.current,i)),a=r.frame?e8(r,V3(r.frame.scroll.current,i)):r,l=t.displaced,c=A8({afterDragging:O8(l.all,o),destination:r,displacedBy:t.displacedBy,viewport:s.frame,last:l,forceShouldAnimate:!1}),u=A8({afterDragging:O8(l.all,o),destination:a,displacedBy:t.displacedBy,viewport:n.frame,last:l,forceShouldAnimate:!1}),d={},h={},p=[l,c,u];return l.all.forEach((function(e){var t=function(e,t){for(var n=0;n<t.length;n++){var r=t[n].visible[e];if(r)return r}return null}(e,p);t?h[e]=t:d[e]=!0})),(0,S4.A)({},t,{displaced:{all:l.all,invisible:d,visible:h}})}({impact:h,viewport:s,destination:r,draggables:o,maxScrollChange:f});return{clientSelection:l,impact:m,scrollJumpRequest:f}},U8=function(e){var t=e.subject.active;return t||D3(!1),t},V8=function(e,t){var n=e.page.borderBox.center;return j8(e.descriptor.id,t)?H3(n,t.displacedBy.point):n},H8=function(e,t){var n=e.page.borderBox;return j8(e.descriptor.id,t)?J3(n,W3(t.displacedBy.point)):n},$8=A3((function(e,t){var n=t[e.line];return{value:n,point:G3(e.line,n)}})),W8=function(e,t){return(0,S4.A)({},e,{scroll:(0,S4.A)({},e.scroll,{max:t})})},G8=function(e,t,n){var r=e.frame;p8(t,e)&&D3(!1),e.subject.withPlaceholder&&D3(!1);var o=$8(e.axis,t.displaceBy).point,i=function(e,t,n){var r=e.axis;if("virtual"===e.descriptor.mode)return G3(r.line,t[r.line]);var o=e.subject.page.contentBox[r.size],i=c8(e.descriptor.id,n).reduce((function(e,t){return e+t.client.marginBox[r.size]}),0)+t[r.line]-o;return i<=0?null:G3(r.line,i)}(e,o,n),s={placeholderSize:o,increasedBy:i,oldFrameMaxScroll:e.frame?e.frame.scroll.max:null};if(!r){var a=Q3({page:e.subject.page,withPlaceholder:s,axis:e.axis,frame:e.frame});return(0,S4.A)({},e,{subject:a})}var l=i?V3(r.scroll.max,i):r.scroll.max,c=W8(r,l),u=Q3({page:e.subject.page,withPlaceholder:s,axis:e.axis,frame:c});return(0,S4.A)({},e,{subject:u,frame:c})},q8=function(e){var t=e.at;return t?"REORDER"===t.type?t.destination.droppableId:t.combine.droppableId:null},K8=function(e){var t=e.state,n=e.type,r=function(e,t){var n=q8(e);return n?t[n]:null}(t.impact,t.dimensions.droppables),o=Boolean(r),i=t.dimensions.droppables[t.critical.droppable.id],s=r||i,a=s.axis.direction,l="vertical"===a&&("MOVE_UP"===n||"MOVE_DOWN"===n)||"horizontal"===a&&("MOVE_LEFT"===n||"MOVE_RIGHT"===n);if(l&&!o)return null;var c="MOVE_DOWN"===n||"MOVE_RIGHT"===n,u=t.dimensions.draggables[t.critical.draggable.id],d=t.current.page.borderBoxCenter,h=t.dimensions,p=h.draggables,f=h.droppables;return l?z8({isMovingForward:c,previousPageBorderBoxCenter:d,draggable:u,destination:s,draggables:p,viewport:t.viewport,previousClientSelection:t.current.client.selection,previousImpact:t.impact,afterCritical:t.afterCritical}):function(e){var t=e.isMovingForward,n=e.previousPageBorderBoxCenter,r=e.draggable,o=e.isOver,i=e.draggables,s=e.droppables,a=e.viewport,l=e.afterCritical,c=function(e){var t=e.isMovingForward,n=e.pageBorderBoxCenter,r=e.source,o=e.droppables,i=e.viewport,s=r.subject.active;if(!s)return null;var a=r.axis,l=b8(s[a.start],s[a.end]),c=a8(o).filter((function(e){return e!==r})).filter((function(e){return e.isEnabled})).filter((function(e){return Boolean(e.subject.active)})).filter((function(e){return y8(i.frame)(U8(e))})).filter((function(e){var n=U8(e);return t?s[a.crossAxisEnd]<n[a.crossAxisEnd]:n[a.crossAxisStart]<s[a.crossAxisStart]})).filter((function(e){var t=U8(e),n=b8(t[a.start],t[a.end]);return l(t[a.start])||l(t[a.end])||n(s[a.start])||n(s[a.end])})).sort((function(e,n){var r=U8(e)[a.crossAxisStart],o=U8(n)[a.crossAxisStart];return t?r-o:o-r})).filter((function(e,t,n){return U8(e)[a.crossAxisStart]===U8(n[0])[a.crossAxisStart]}));if(!c.length)return null;if(1===c.length)return c[0];var u=c.filter((function(e){return b8(U8(e)[a.start],U8(e)[a.end])(n[a.line])}));return 1===u.length?u[0]:u.length>1?u.sort((function(e,t){return U8(e)[a.start]-U8(t)[a.start]}))[0]:c.sort((function(e,t){var r=K3(n,X3(U8(e))),o=K3(n,X3(U8(t)));return r!==o?r-o:U8(e)[a.start]-U8(t)[a.start]}))[0]}({isMovingForward:t,pageBorderBoxCenter:n,source:o,droppables:s,viewport:a});if(!c)return null;var u=c8(c.descriptor.id,i),d=function(e){var t=e.pageBorderBoxCenter,n=e.viewport,r=e.destination,o=e.afterCritical,i=e.insideDestination.filter((function(e){return C8({target:H8(e,o),destination:r,viewport:n.frame,withDroppableDisplacement:!0})})).sort((function(e,n){var i=q3(t,D8(r,V8(e,o))),s=q3(t,D8(r,V8(n,o)));return i<s?-1:s<i?1:e.descriptor.index-n.descriptor.index}));return i[0]||null}({pageBorderBoxCenter:n,viewport:a,destination:c,insideDestination:u,afterCritical:l}),h=function(e){var t=e.previousPageBorderBoxCenter,n=e.moveRelativeTo,r=e.insideDestination,o=e.draggable,i=e.draggables,s=e.destination,a=e.viewport,l=e.afterCritical;if(!n){if(r.length)return null;var c={displaced:m8,displacedBy:f8,at:{type:"REORDER",destination:{droppableId:s.descriptor.id,index:0}}},u=M8({impact:c,draggable:o,droppable:s,draggables:i,afterCritical:l}),d=p8(o,s)?s:G8(s,o,i);return F8({draggable:o,destination:d,newPageBorderBoxCenter:u,viewport:a.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?c:null}var h,p=Boolean(t[s.axis.line]<=n.page.borderBox.center[s.axis.line]),f=(h=n.descriptor.index,n.descriptor.id===o.descriptor.id||p?h:h+1);return I8({draggable:o,insideDestination:r,destination:s,viewport:a,displacedBy:$8(s.axis,o.displaceBy),last:m8,index:f})}({previousPageBorderBoxCenter:n,destination:c,draggable:r,draggables:i,moveRelativeTo:d,insideDestination:u,viewport:a,afterCritical:l});if(!h)return null;var p=M8({impact:h,draggable:r,droppable:c,draggables:i,afterCritical:l});return{clientSelection:L8({pageBorderBoxCenter:p,draggable:r,viewport:a}),impact:h,scrollJumpRequest:null}}({isMovingForward:c,previousPageBorderBoxCenter:d,draggable:u,isOver:s,draggables:p,droppables:f,viewport:t.viewport,afterCritical:t.afterCritical})};function Y8(e){return"DRAGGING"===e.phase||"COLLECTING"===e.phase}function J8(e){var t=b8(e.top,e.bottom),n=b8(e.left,e.right);return function(e){return t(e.y)&&n(e.x)}}var X8=function(e,t){return f3(J3(e,t))};function Z8(e){var t=e.displaced,n=e.id;return Boolean(t.visible[n]||t.invisible[n])}var Q8=function(e){var t=e.pageOffset,n=e.draggable,r=e.draggables,o=e.droppables,i=e.previousImpact,s=e.viewport,a=e.afterCritical,l=X8(n.page.borderBox,t),c=function(e){var t=e.pageBorderBox,n=e.draggable,r=e.droppables,o=a8(r).filter((function(e){if(!e.isEnabled)return!1;var n,r,o=e.subject.active;if(!o)return!1;if(r=o,!((n=t).left<r.right&&n.right>r.left&&n.top<r.bottom&&n.bottom>r.top))return!1;if(J8(o)(t.center))return!0;var i=e.axis,s=o.center[i.crossAxisLine],a=t[i.crossAxisStart],l=t[i.crossAxisEnd],c=b8(o[i.crossAxisStart],o[i.crossAxisEnd]),u=c(a),d=c(l);return!u&&!d||(u?a<s:l>s)}));return o.length?1===o.length?o[0].descriptor.id:function(e){var t=e.pageBorderBox,n=e.candidates,r=e.draggable.page.borderBox.center,o=n.map((function(e){var n=e.axis,o=G3(e.axis.line,t.center[n.line],e.page.borderBox.center[n.crossAxisLine]);return{id:e.descriptor.id,distance:q3(r,o)}})).sort((function(e,t){return t.distance-e.distance}));return o[0]?o[0].id:null}({pageBorderBox:t,draggable:n,candidates:o}):null}({pageBorderBox:l,draggable:n,droppables:o});if(!c)return g8;var u=o[c],d=c8(u.descriptor.id,r),h=function(e,t){var n=e.frame;return n?X8(t,n.scroll.diff.value):t}(u,l);return function(e){var t=e.draggable,n=e.pageBorderBoxWithDroppableScroll,r=e.previousImpact,o=e.destination,i=e.insideDestination,s=e.afterCritical;if(!o.isCombineEnabled)return null;var a=o.axis,l=$8(o.axis,t.displaceBy),c=l.value,u=n[a.start],d=n[a.end],h=r8(h8(t,i),(function(e){var t=e.descriptor.id,n=e.page.borderBox,o=n[a.size]/4,i=j8(t,s),l=Z8({displaced:r.displaced,id:t});return i?l?d>n[a.start]+o&&d<n[a.end]-o:u>n[a.start]-c+o&&u<n[a.end]-c-o:l?d>n[a.start]+c+o&&d<n[a.end]+c-o:u>n[a.start]+o&&u<n[a.end]-o}));return h?{displacedBy:l,displaced:r.displaced,at:{type:"COMBINE",combine:{draggableId:h.descriptor.id,droppableId:o.descriptor.id}}}:null}({pageBorderBoxWithDroppableScroll:h,draggable:n,previousImpact:i,destination:u,insideDestination:d,afterCritical:a})||function(e){var t=e.pageBorderBoxWithDroppableScroll,n=e.draggable,r=e.destination,o=e.insideDestination,i=e.last,s=e.viewport,a=e.afterCritical,l=r.axis,c=$8(r.axis,n.displaceBy),u=c.value,d=t[l.start],h=t[l.end],p=r8(h8(n,o),(function(e){var t=e.descriptor.id,n=e.page.borderBox.center[l.line],r=j8(t,a),o=Z8({displaced:i,id:t});return r?o?h<=n:d<n-u:o?h<=n+u:d<n})),f=function(e){var t=e.draggable,n=e.closest;return n?e.inHomeList&&n.descriptor.index>t.descriptor.index?n.descriptor.index-1:n.descriptor.index:null}({draggable:n,closest:p,inHomeList:p8(n,r)});return I8({draggable:n,insideDestination:o,destination:r,viewport:s,last:i,displacedBy:c,index:f})}({pageBorderBoxWithDroppableScroll:h,draggable:n,destination:u,insideDestination:d,last:i.displaced,viewport:s,afterCritical:a})},e6=function(e,t){var n;return(0,S4.A)({},e,((n={})[t.descriptor.id]=t,n))},t6=function(e){var t=e.state,n=e.clientSelection,r=e.dimensions,o=e.viewport,i=e.impact,s=e.scrollJumpRequest,a=o||t.viewport,l=r||t.dimensions,c=n||t.current.client.selection,u=H3(c,t.initial.client.selection),d={offset:u,selection:c,borderBoxCenter:V3(t.initial.client.borderBoxCenter,u)},h={selection:V3(d.selection,a.scroll.current),borderBoxCenter:V3(d.borderBoxCenter,a.scroll.current),offset:V3(d.offset,a.scroll.diff.value)},p={client:d,page:h};if("COLLECTING"===t.phase)return(0,S4.A)({phase:"COLLECTING"},t,{dimensions:l,viewport:a,current:p});var f=l.draggables[t.critical.draggable.id],m=i||Q8({pageOffset:h.offset,draggable:f,draggables:l.draggables,droppables:l.droppables,previousImpact:t.impact,viewport:a,afterCritical:t.afterCritical}),g=function(e){var t=e.draggable,n=e.draggables,r=e.droppables,o=e.impact,i=function(e){var t=e.previousImpact,n=e.impact,r=e.droppables,o=q8(t),i=q8(n);if(!o)return r;if(o===i)return r;var s=r[o];if(!s.subject.withPlaceholder)return r;var a=function(e){var t=e.subject.withPlaceholder;t||D3(!1);var n=e.frame;if(!n){var r=Q3({page:e.subject.page,axis:e.axis,frame:null,withPlaceholder:null});return(0,S4.A)({},e,{subject:r})}var o=t.oldFrameMaxScroll;o||D3(!1);var i=W8(n,o),s=Q3({page:e.subject.page,axis:e.axis,frame:i,withPlaceholder:null});return(0,S4.A)({},e,{subject:s,frame:i})}(s);return e6(r,a)}({previousImpact:e.previousImpact,impact:o,droppables:r}),s=q8(o);if(!s)return i;var a=r[s];if(p8(t,a))return i;if(a.subject.withPlaceholder)return i;var l=G8(a,t,n);return e6(i,l)}({draggable:f,impact:m,previousImpact:t.impact,draggables:l.draggables,droppables:l.droppables});return(0,S4.A)({},t,{current:p,dimensions:{draggables:l.draggables,droppables:g},impact:m,viewport:a,scrollJumpRequest:s||null,forceShouldAnimate:!s&&null})},n6=function(e){var t=e.impact,n=e.viewport,r=e.draggables,o=e.destination,i=e.forceShouldAnimate,s=t.displaced,a=function(e,t){return e.map((function(e){return t[e]}))}(s.all,r),l=A8({afterDragging:a,destination:o,displacedBy:t.displacedBy,viewport:n.frame,forceShouldAnimate:i,last:s});return(0,S4.A)({},t,{displaced:l})},r6=function(e){var t=e.impact,n=e.draggable,r=e.droppable,o=e.draggables,i=e.viewport,s=e.afterCritical,a=M8({impact:t,draggable:n,draggables:o,droppable:r,afterCritical:s});return L8({pageBorderBoxCenter:a,draggable:n,viewport:i})},o6=function(e){var t=e.state,n=e.dimensions,r=e.viewport;"SNAP"!==t.movementMode&&D3(!1);var o=t.impact,i=r||t.viewport,s=n||t.dimensions,a=s.draggables,l=s.droppables,c=a[t.critical.draggable.id],u=q8(o);u||D3(!1);var d=l[u],h=n6({impact:o,viewport:i,destination:d,draggables:a}),p=r6({impact:h,draggable:c,droppable:d,draggables:a,viewport:i,afterCritical:t.afterCritical});return t6({impact:h,clientSelection:p,state:t,dimensions:s,viewport:i})},i6=function(e){var t=e.draggable,n=e.home,r=e.draggables,o=e.viewport,i=$8(n.axis,t.displaceBy),s=c8(n.descriptor.id,r),a=s.indexOf(t);-1===a&&D3(!1);var l,c=s.slice(a+1),u=c.reduce((function(e,t){return e[t.descriptor.id]=!0,e}),{}),d={inVirtualList:"virtual"===n.descriptor.mode,displacedBy:i,effected:u};return{impact:{displaced:A8({afterDragging:c,destination:n,displacedBy:i,last:null,viewport:o.frame,forceShouldAnimate:!1}),displacedBy:i,at:{type:"REORDER",destination:(l=t.descriptor,{index:l.index,droppableId:l.droppableId})}},afterCritical:d}},s6=function(e){return"SNAP"===e.movementMode},a6=function(e,t,n){var r=function(e,t){return{draggables:e.draggables,droppables:e6(e.droppables,t)}}(e.dimensions,t);return!s6(e)||n?t6({state:e,dimensions:r}):o6({state:e,dimensions:r})};function l6(e){return e.isDragging&&"SNAP"===e.movementMode?(0,S4.A)({phase:"DRAGGING"},e,{scrollJumpRequest:null}):e}var c6={phase:"IDLE",completed:null,shouldFlush:!1},u6=function(e,t){if(void 0===e&&(e=c6),"FLUSH"===t.type)return(0,S4.A)({},c6,{shouldFlush:!0});if("INITIAL_PUBLISH"===t.type){"IDLE"!==e.phase&&D3(!1);var n=t.payload,r=n.critical,o=n.clientSelection,i=n.viewport,s=n.dimensions,a=n.movementMode,l=s.draggables[r.draggable.id],c=s.droppables[r.droppable.id],u={selection:o,borderBoxCenter:l.client.borderBox.center,offset:U3},d={client:u,page:{selection:V3(u.selection,i.scroll.initial),borderBoxCenter:V3(u.selection,i.scroll.initial),offset:V3(u.selection,i.scroll.diff.value)}},h=a8(s.droppables).every((function(e){return!e.isFixedOnPage})),p=i6({draggable:l,home:c,draggables:s.draggables,viewport:i}),f=p.impact;return{phase:"DRAGGING",isDragging:!0,critical:r,movementMode:a,dimensions:s,initial:d,current:d,isWindowScrollAllowed:h,impact:f,afterCritical:p.afterCritical,onLiftImpact:f,viewport:i,scrollJumpRequest:null,forceShouldAnimate:null}}if("COLLECTION_STARTING"===t.type)return"COLLECTING"===e.phase||"DROP_PENDING"===e.phase?e:("DRAGGING"!==e.phase&&D3(!1),(0,S4.A)({phase:"COLLECTING"},e,{phase:"COLLECTING"}));if("PUBLISH_WHILE_DRAGGING"===t.type)return"COLLECTING"!==e.phase&&"DROP_PENDING"!==e.phase&&D3(!1),function(e){var t=e.state,n=e.published,r=n.modified.map((function(e){var n=t.dimensions.droppables[e.droppableId];return e8(n,e.scroll)})),o=(0,S4.A)({},t.dimensions.droppables,{},i8(r)),i=s8(function(e){var t=e.additions,n=e.updatedDroppables,r=e.viewport,o=r.scroll.diff.value;return t.map((function(e){var t=e.descriptor.droppableId,i=function(e){var t=e.frame;return t||D3(!1),t}(n[t]),s=i.scroll.diff.value,a=function(e){var t=e.draggable,n=e.offset,r=e.initialWindowScroll,o=_3(t.client,n),i=x3(o,r);return(0,S4.A)({},t,{placeholder:(0,S4.A)({},t.placeholder,{client:o}),client:o,page:i})}({draggable:e,offset:V3(o,s),initialWindowScroll:r.scroll.initial});return a}))}({additions:n.additions,updatedDroppables:o,viewport:t.viewport})),s=(0,S4.A)({},t.dimensions.draggables,{},i);n.removals.forEach((function(e){delete s[e]}));var a={droppables:o,draggables:s},l=q8(t.impact),c=l?a.droppables[l]:null,u=a.draggables[t.critical.draggable.id],d=a.droppables[t.critical.droppable.id],h=i6({draggable:u,home:d,draggables:s,viewport:t.viewport}),p=h.impact,f=h.afterCritical,m=c&&c.isCombineEnabled?t.impact:p,g=Q8({pageOffset:t.current.page.offset,draggable:a.draggables[t.critical.draggable.id],draggables:a.draggables,droppables:a.droppables,previousImpact:m,viewport:t.viewport,afterCritical:f}),b=(0,S4.A)({phase:"DRAGGING"},t,{phase:"DRAGGING",impact:g,onLiftImpact:p,dimensions:a,afterCritical:f,forceShouldAnimate:!1});return"COLLECTING"===t.phase?b:(0,S4.A)({phase:"DROP_PENDING"},b,{phase:"DROP_PENDING",reason:t.reason,isWaiting:!1})}({state:e,published:t.payload});if("MOVE"===t.type){if("DROP_PENDING"===e.phase)return e;Y8(e)||D3(!1);var m=t.payload.client;return $3(m,e.current.client.selection)?e:t6({state:e,clientSelection:m,impact:s6(e)?e.impact:null})}if("UPDATE_DROPPABLE_SCROLL"===t.type){if("DROP_PENDING"===e.phase)return l6(e);if("COLLECTING"===e.phase)return l6(e);Y8(e)||D3(!1);var g=t.payload,b=g.id,y=g.newScroll,v=e.dimensions.droppables[b];if(!v)return e;var _=e8(v,y);return a6(e,_,!1)}if("UPDATE_DROPPABLE_IS_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;Y8(e)||D3(!1);var x=t.payload,w=x.id,k=x.isEnabled,C=e.dimensions.droppables[w];C||D3(!1),C.isEnabled===k&&D3(!1);var S=(0,S4.A)({},C,{isEnabled:k});return a6(e,S,!0)}if("UPDATE_DROPPABLE_IS_COMBINE_ENABLED"===t.type){if("DROP_PENDING"===e.phase)return e;Y8(e)||D3(!1);var A=t.payload,E=A.id,I=A.isCombineEnabled,j=e.dimensions.droppables[E];j||D3(!1),j.isCombineEnabled===I&&D3(!1);var T=(0,S4.A)({},j,{isCombineEnabled:I});return a6(e,T,!0)}if("MOVE_BY_WINDOW_SCROLL"===t.type){if("DROP_PENDING"===e.phase||"DROP_ANIMATING"===e.phase)return e;Y8(e)||D3(!1),e.isWindowScrollAllowed||D3(!1);var B=t.payload.newScroll;if($3(e.viewport.scroll.current,B))return l6(e);var R=P8(e.viewport,B);return s6(e)?o6({state:e,viewport:R}):t6({state:e,viewport:R})}if("UPDATE_VIEWPORT_MAX_SCROLL"===t.type){if(!Y8(e))return e;var N=t.payload.maxScroll;if($3(N,e.viewport.scroll.max))return e;var D=(0,S4.A)({},e.viewport,{scroll:(0,S4.A)({},e.viewport.scroll,{max:N})});return(0,S4.A)({phase:"DRAGGING"},e,{viewport:D})}if("MOVE_UP"===t.type||"MOVE_DOWN"===t.type||"MOVE_LEFT"===t.type||"MOVE_RIGHT"===t.type){if("COLLECTING"===e.phase||"DROP_PENDING"===e.phase)return e;"DRAGGING"!==e.phase&&D3(!1);var M=K8({state:e,type:t.type});return M?t6({state:e,impact:M.impact,clientSelection:M.clientSelection,scrollJumpRequest:M.scrollJumpRequest}):e}if("DROP_PENDING"===t.type){var P=t.payload.reason;return"COLLECTING"!==e.phase&&D3(!1),(0,S4.A)({phase:"DROP_PENDING"},e,{phase:"DROP_PENDING",isWaiting:!0,reason:P})}if("DROP_ANIMATE"===t.type){var O=t.payload,L=O.completed,F=O.dropDuration,z=O.newHomeClientOffset;return"DRAGGING"!==e.phase&&"DROP_PENDING"!==e.phase&&D3(!1),{phase:"DROP_ANIMATING",completed:L,dropDuration:F,newHomeClientOffset:z,dimensions:e.dimensions}}return"DROP_COMPLETE"===t.type?{phase:"IDLE",completed:t.payload.completed,shouldFlush:!1}:e},d6=function(e){return{type:"LIFT",payload:e}},h6=function(e){return{type:"PUBLISH_WHILE_DRAGGING",payload:e}},p6=function(){return{type:"COLLECTION_STARTING",payload:null}},f6=function(e){return{type:"UPDATE_DROPPABLE_SCROLL",payload:e}},m6=function(e){return{type:"UPDATE_DROPPABLE_IS_ENABLED",payload:e}},g6=function(e){return{type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:e}},b6=function(e){return{type:"MOVE",payload:e}},y6=function(){return{type:"MOVE_UP",payload:null}},v6=function(){return{type:"MOVE_DOWN",payload:null}},_6=function(){return{type:"MOVE_RIGHT",payload:null}},x6=function(){return{type:"MOVE_LEFT",payload:null}},w6=function(){return{type:"FLUSH",payload:null}},k6=function(e){return{type:"DROP_COMPLETE",payload:e}},C6=function(e){return{type:"DROP",payload:e}},S6="cubic-bezier(.2,1,.1,1)",A6=0,E6=.7,I6=.75,j6="0.2s cubic-bezier(0.2, 0, 0, 1)",T6={fluid:"opacity "+j6,snap:"transform "+j6+", opacity "+j6,drop:function(e){var t=e+"s "+S6;return"transform "+t+", opacity "+t},outOfTheWay:"transform "+j6,placeholder:"height "+j6+", width "+j6+", margin "+j6},B6=function(e){return $3(e,U3)?null:"translate("+e.x+"px, "+e.y+"px)"},R6=B6,N6=function(e,t){var n=B6(e);return n?t?n+" scale("+I6+")":n:null},D6=.33,M6=.55-D6,P6=function(e){var t=e.getState,n=e.dispatch;return function(e){return function(r){if("DROP"===r.type){var o=t(),i=r.payload.reason;if("COLLECTING"!==o.phase){if("IDLE"!==o.phase){"DROP_PENDING"===o.phase&&o.isWaiting&&D3(!1),"DRAGGING"!==o.phase&&"DROP_PENDING"!==o.phase&&D3(!1);var s=o.critical,a=o.dimensions,l=a.draggables[o.critical.draggable.id],c=function(e){var t=e.draggables,n=e.reason,r=e.lastImpact,o=e.home,i=e.viewport,s=e.onLiftImpact;return r.at&&"DROP"===n?"REORDER"===r.at.type?{impact:r,didDropInsideDroppable:!0}:{impact:(0,S4.A)({},r,{displaced:m8}),didDropInsideDroppable:!0}:{impact:n6({draggables:t,impact:s,destination:o,viewport:i,forceShouldAnimate:!0}),didDropInsideDroppable:!1}}({reason:i,lastImpact:o.impact,afterCritical:o.afterCritical,onLiftImpact:o.onLiftImpact,home:o.dimensions.droppables[o.critical.droppable.id],viewport:o.viewport,draggables:o.dimensions.draggables}),u=c.impact,d=c.didDropInsideDroppable,h=d?u8(u):null,p=d?d8(u):null,f={index:s.draggable.index,droppableId:s.droppable.id},m={draggableId:l.descriptor.id,type:l.descriptor.type,source:f,reason:i,mode:o.movementMode,destination:h,combine:p},g=function(e){var t=e.impact,n=e.draggable,r=e.dimensions,o=e.viewport,i=e.afterCritical,s=r.draggables,a=r.droppables,l=q8(t),c=l?a[l]:null,u=a[n.descriptor.droppableId],d=r6({impact:t,draggable:n,draggables:s,afterCritical:i,droppable:c||u,viewport:o});return H3(d,n.client.borderBox.center)}({impact:u,draggable:l,dimensions:a,viewport:o.viewport,afterCritical:o.afterCritical}),b={critical:o.critical,afterCritical:o.afterCritical,result:m,impact:u};if(!$3(o.current.client.offset,g)||Boolean(m.combine)){var y=function(e){var t=e.reason,n=q3(e.current,e.destination);if(n<=0)return D6;if(n>=1500)return.55;var r=D6+M6*(n/1500);return Number(("CANCEL"===t?.6*r:r).toFixed(2))}({current:o.current.client.offset,destination:g,reason:i});n(function(e){return{type:"DROP_ANIMATE",payload:e}}({newHomeClientOffset:g,dropDuration:y,completed:b}))}else n(k6({completed:b}))}}else n(function(e){return{type:"DROP_PENDING",payload:e}}({reason:i}))}else e(r)}}},O6=function(){return{x:window.pageXOffset,y:window.pageYOffset}};var L6=function(e){var t=function(e){var t=e.onWindowScroll,n=E3((function(){t(O6())})),r=function(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(t){t.target!==window&&t.target!==window.document||e()}}}(n),o=j3;function i(){return o!==j3}return{start:function(){i()&&D3(!1),o=T3(window,[r])},stop:function(){i()||D3(!1),n.cancel(),o(),o=j3},isActive:i}}({onWindowScroll:function(t){e.dispatch(function(e){return{type:"MOVE_BY_WINDOW_SCROLL",payload:e}}({newScroll:t}))}});return function(e){return function(n){t.isActive()||"INITIAL_PUBLISH"!==n.type||t.start(),t.isActive()&&function(e){return"DROP_COMPLETE"===e.type||"DROP_ANIMATE"===e.type||"FLUSH"===e.type}(n)&&t.stop(),e(n)}}},F6=function(e,t){t()},z6=function(e,t){return{draggableId:e.draggable.id,type:e.droppable.type,source:{droppableId:e.droppable.id,index:e.draggable.index},mode:t}},U6=function(e,t,n,r){if(e){var o=function(e){var t=!1,n=!1,r=setTimeout((function(){n=!0})),o=function(o){t||n||(t=!0,e(o),clearTimeout(r))};return o.wasCalled=function(){return t},o}(n);e(t,{announce:o}),o.wasCalled()||n(r(t))}else n(r(t))},V6=function(e,t){var n=function(e,t){var n,r=(n=[],{add:function(e){var t=setTimeout((function(){return function(e){var t=n8(n,(function(t){return t.timerId===e}));-1===t&&D3(!1),n.splice(t,1)[0].callback()}(t)})),r={timerId:t,callback:e};n.push(r)},flush:function(){if(n.length){var e=[].concat(n);n.length=0,e.forEach((function(e){clearTimeout(e.timerId),e.callback()}))}}}),o=null,i=function(n){o||D3(!1),o=null,F6(0,(function(){return U6(e().onDragEnd,n,t,z3.onDragEnd)}))};return{beforeCapture:function(t,n){o&&D3(!1),F6(0,(function(){var r=e().onBeforeCapture;r&&r({draggableId:t,mode:n})}))},beforeStart:function(t,n){o&&D3(!1),F6(0,(function(){var r=e().onBeforeDragStart;r&&r(z6(t,n))}))},start:function(n,i){o&&D3(!1);var s=z6(n,i);o={mode:i,lastCritical:n,lastLocation:s.source,lastCombine:null},r.add((function(){F6(0,(function(){return U6(e().onDragStart,s,t,z3.onDragStart)}))}))},update:function(n,i){var s=u8(i),a=d8(i);o||D3(!1);var l=!function(e,t){if(e===t)return!0;var n=e.draggable.id===t.draggable.id&&e.draggable.droppableId===t.draggable.droppableId&&e.draggable.type===t.draggable.type&&e.draggable.index===t.draggable.index,r=e.droppable.id===t.droppable.id&&e.droppable.type===t.droppable.type;return n&&r}(n,o.lastCritical);l&&(o.lastCritical=n);var c,u,d=(c=o.lastLocation,u=s,!(null==c&&null==u||null!=c&&null!=u&&c.droppableId===u.droppableId&&c.index===u.index));d&&(o.lastLocation=s);var h=!function(e,t){return null==e&&null==t||null!=e&&null!=t&&e.draggableId===t.draggableId&&e.droppableId===t.droppableId}(o.lastCombine,a);if(h&&(o.lastCombine=a),l||d||h){var p=(0,S4.A)({},z6(n,o.mode),{combine:a,destination:s});r.add((function(){F6(0,(function(){return U6(e().onDragUpdate,p,t,z3.onDragUpdate)}))}))}},flush:function(){o||D3(!1),r.flush()},drop:i,abort:function(){if(o){var e=(0,S4.A)({},z6(o.lastCritical,o.mode),{combine:null,destination:null,reason:"CANCEL"});i(e)}}}}(e,t);return function(e){return function(t){return function(r){if("BEFORE_INITIAL_CAPTURE"!==r.type){if("INITIAL_PUBLISH"===r.type){var o=r.payload.critical;return n.beforeStart(o,r.payload.movementMode),t(r),void n.start(o,r.payload.movementMode)}if("DROP_COMPLETE"===r.type){var i=r.payload.completed.result;return n.flush(),t(r),void n.drop(i)}if(t(r),"FLUSH"!==r.type){var s=e.getState();"DRAGGING"===s.phase&&n.update(s.critical,s.impact)}else n.abort()}else n.beforeCapture(r.payload.draggableId,r.payload.movementMode)}}}},H6=function(e){return function(t){return function(n){if("DROP_ANIMATION_FINISHED"===n.type){var r=e.getState();"DROP_ANIMATING"!==r.phase&&D3(!1),e.dispatch(k6({completed:r.completed}))}else t(n)}}},$6=function(e){var t=null,n=null;return function(r){return function(o){if("FLUSH"!==o.type&&"DROP_COMPLETE"!==o.type&&"DROP_ANIMATION_FINISHED"!==o.type||(n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)),r(o),"DROP_ANIMATE"===o.type){var i={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){"DROP_ANIMATING"===e.getState().phase&&e.dispatch({type:"DROP_ANIMATION_FINISHED",payload:null})}};n=requestAnimationFrame((function(){n=null,t=T3(window,[i])}))}}}},W6=function(e){return function(t){return function(n){if(t(n),"PUBLISH_WHILE_DRAGGING"===n.type){var r=e.getState();"DROP_PENDING"===r.phase&&(r.isWaiting||e.dispatch(C6({reason:r.reason})))}}}},G6=A4.Zz,q6=function(e){var t,n=e.dimensionMarshal,r=e.focusMarshal,o=e.styleMarshal,i=e.getResponders,s=e.announce,a=e.autoScroller;return(0,A4.y$)(u6,G6((0,A4.Tw)((t=o,function(){return function(e){return function(n){"INITIAL_PUBLISH"===n.type&&t.dragging(),"DROP_ANIMATE"===n.type&&t.dropping(n.payload.completed.result.reason),"FLUSH"!==n.type&&"DROP_COMPLETE"!==n.type||t.resting(),e(n)}}}),function(e){return function(){return function(t){return function(n){"DROP_COMPLETE"!==n.type&&"FLUSH"!==n.type&&"DROP_ANIMATE"!==n.type||e.stopPublishing(),t(n)}}}}(n),function(e){return function(t){var n=t.getState,r=t.dispatch;return function(t){return function(o){if("LIFT"===o.type){var i=o.payload,s=i.id,a=i.clientSelection,l=i.movementMode,c=n();"DROP_ANIMATING"===c.phase&&r(k6({completed:c.completed})),"IDLE"!==n().phase&&D3(!1),r(w6()),r(function(e){return{type:"BEFORE_INITIAL_CAPTURE",payload:e}}({draggableId:s,movementMode:l}));var u={draggableId:s,scrollOptions:{shouldPublishImmediately:"SNAP"===l}},d=e.startPublishing(u),h=d.critical,p=d.dimensions,f=d.viewport;r(function(e){return{type:"INITIAL_PUBLISH",payload:e}}({critical:h,dimensions:p,clientSelection:a,movementMode:l,viewport:f}))}else t(o)}}}}(n),P6,H6,$6,W6,function(e){return function(t){return function(n){return function(r){if(function(e){return"DROP_COMPLETE"===e.type||"DROP_ANIMATE"===e.type||"FLUSH"===e.type}(r))return e.stop(),void n(r);if("INITIAL_PUBLISH"===r.type){n(r);var o=t.getState();return"DRAGGING"!==o.phase&&D3(!1),void e.start(o)}n(r),e.scroll(t.getState())}}}}(a),L6,function(e){var t=!1;return function(){return function(n){return function(r){if("INITIAL_PUBLISH"===r.type)return t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),void e.tryRestoreFocusRecorded();if(n(r),t){if("FLUSH"===r.type)return t=!1,void e.tryRestoreFocusRecorded();if("DROP_COMPLETE"===r.type){t=!1;var o=r.payload.completed.result;o.combine&&e.tryShiftRecord(o.draggableId,o.combine.draggableId),e.tryRestoreFocusRecorded()}}}}}}(r),V6(i,s))))},K6=function(e){var t=e.scrollHeight,n=e.scrollWidth,r=e.height,o=e.width,i=H3({x:n,y:t},{x:o,y:r});return{x:Math.max(0,i.x),y:Math.max(0,i.y)}},Y6=function(){var e=document.documentElement;return e||D3(!1),e},J6=function(){var e=Y6();return K6({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight})};function X6(e,t,n){return n.descriptor.id!==t.id&&n.descriptor.type===t.type&&"virtual"===e.droppable.getById(n.descriptor.droppableId).descriptor.mode}var Z6,Q6=function(e,t){var n=null,r=function(e){var t=e.registry,n=e.callbacks,r={additions:{},removals:{},modified:{}},o=null,i=function(){o||(n.collectionStarting(),o=requestAnimationFrame((function(){o=null;var e=r,i=e.additions,s=e.removals,a=e.modified,l=Object.keys(i).map((function(e){return t.draggable.getById(e).getDimension(U3)})).sort((function(e,t){return e.descriptor.index-t.descriptor.index})),c=Object.keys(a).map((function(e){return{droppableId:e,scroll:t.droppable.getById(e).callbacks.getScrollWhileDragging()}})),u={additions:l,removals:Object.keys(s),modified:c};r={additions:{},removals:{},modified:{}},n.publish(u)})))};return{add:function(e){var t=e.descriptor.id;r.additions[t]=e,r.modified[e.descriptor.droppableId]=!0,r.removals[t]&&delete r.removals[t],i()},remove:function(e){var t=e.descriptor;r.removals[t.id]=!0,r.modified[t.droppableId]=!0,r.additions[t.id]&&delete r.additions[t.id],i()},stop:function(){o&&(cancelAnimationFrame(o),o=null,r={additions:{},removals:{},modified:{}})}}}({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),o=function(t){n||D3(!1);var o=n.critical.draggable;"ADDITION"===t.type&&X6(e,o,t.value)&&r.add(t.value),"REMOVAL"===t.type&&X6(e,o,t.value)&&r.remove(t.value)},i={updateDroppableIsEnabled:function(r,o){e.droppable.exists(r)||D3(!1),n&&t.updateDroppableIsEnabled({id:r,isEnabled:o})},updateDroppableIsCombineEnabled:function(r,o){n&&(e.droppable.exists(r)||D3(!1),t.updateDroppableIsCombineEnabled({id:r,isCombineEnabled:o}))},scrollDroppable:function(t,r){n&&e.droppable.getById(t).callbacks.scroll(r)},updateDroppableScroll:function(r,o){n&&(e.droppable.exists(r)||D3(!1),t.updateDroppableScroll({id:r,newScroll:o}))},startPublishing:function(t){n&&D3(!1);var r=e.draggable.getById(t.draggableId),i=e.droppable.getById(r.descriptor.droppableId),s={draggable:r.descriptor,droppable:i.descriptor},a=e.subscribe(o);return n={critical:s,unsubscribe:a},function(e){var t=e.critical,n=e.scrollOptions,r=e.registry,o=function(){var e=O6(),t=J6(),n=e.y,r=e.x,o=Y6(),i=o.clientWidth,s=o.clientHeight;return{frame:f3({top:n,left:r,right:r+i,bottom:n+s}),scroll:{initial:e,current:e,max:t,diff:{value:U3,displacement:U3}}}}(),i=o.scroll.current,s=t.droppable,a=r.droppable.getAllByType(s.type).map((function(e){return e.callbacks.getDimensionAndWatchScroll(i,n)})),l=r.draggable.getAllByType(t.draggable.type).map((function(e){return e.getDimension(i)}));return{dimensions:{draggables:s8(l),droppables:i8(a)},critical:t,viewport:o}}({critical:s,registry:e,scrollOptions:t.scrollOptions})},stopPublishing:function(){if(n){r.stop();var t=n.critical.droppable;e.droppable.getAllByType(t.type).forEach((function(e){return e.callbacks.dragStopped()})),n.unsubscribe(),n=null}}};return i},e9=function(e,t){return"IDLE"===e.phase||"DROP_ANIMATING"===e.phase&&e.completed.result.draggableId!==t&&"DROP"===e.completed.result.reason},t9=function(e){window.scrollBy(e.x,e.y)},n9=A3((function(e){return a8(e).filter((function(e){return!!e.isEnabled&&!!e.frame}))})),r9=function(e){return Math.pow(e,2)},o9=function(e){var t=e.startOfRange,n=e.endOfRange,r=e.current,o=n-t;return 0===o?0:(r-t)/o},i9=360,s9=1200,a9=function(e){var t=e.distanceToEdge,n=e.thresholds,r=e.dragStartTime,o=e.shouldUseTimeDampening,i=function(e,t){if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return 28;if(e===t.startScrollingFrom)return 1;var n=o9({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),r=28*r9(1-n);return Math.ceil(r)}(t,n);return 0===i?0:o?Math.max(function(e,t){var n=t,r=s9,o=Date.now()-n;if(o>=s9)return e;if(o<i9)return 1;var i=o9({startOfRange:i9,endOfRange:r,current:o}),s=e*r9(i);return Math.ceil(s)}(i,r),1):i},l9=function(e){var t=e.container,n=e.distanceToEdges,r=e.dragStartTime,o=e.axis,i=e.shouldUseTimeDampening,s=function(e,t){return{startScrollingFrom:.25*e[t.size],maxScrollValueAt:.05*e[t.size]}}(t,o);return n[o.end]<n[o.start]?a9({distanceToEdge:n[o.end],thresholds:s,dragStartTime:r,shouldUseTimeDampening:i}):-1*a9({distanceToEdge:n[o.start],thresholds:s,dragStartTime:r,shouldUseTimeDampening:i})},c9=Y3((function(e){return 0===e?0:e})),u9=function(e){var t=e.dragStartTime,n=e.container,r=e.subject,o=e.center,i=e.shouldUseTimeDampening,s={top:o.y-n.top,right:n.right-o.x,bottom:n.bottom-o.y,left:o.x-n.left},a=l9({container:n,distanceToEdges:s,dragStartTime:t,axis:_8,shouldUseTimeDampening:i}),l=l9({container:n,distanceToEdges:s,dragStartTime:t,axis:x8,shouldUseTimeDampening:i}),c=c9({x:l,y:a});if($3(c,U3))return null;var u=function(e){var t=e.container,n=e.subject,r=e.proposedScroll,o=n.height>t.height,i=n.width>t.width;return i||o?i&&o?null:{x:i?0:r.x,y:o?0:r.y}:r}({container:n,subject:r,proposedScroll:c});return u?$3(u,U3)?null:u:null},d9=Y3((function(e){return 0===e?0:e>0?1:-1})),h9=(Z6=function(e,t){return e<0?e:e>t?e-t:0},function(e){var t=e.current,n=e.max,r=e.change,o=V3(t,r),i={x:Z6(o.x,n.x),y:Z6(o.y,n.y)};return $3(i,U3)?null:i}),p9=function(e){var t=e.max,n=e.current,r=e.change,o={x:Math.max(n.x,t.x),y:Math.max(n.y,t.y)},i=d9(r),s=h9({max:o,current:n,change:i});return!s||0!==i.x&&0===s.x||0!==i.y&&0===s.y},f9=function(e,t){return p9({current:e.scroll.current,max:e.scroll.max,change:t})},m9=function(e,t){var n=e.frame;return!!n&&p9({current:n.scroll.current,max:n.scroll.max,change:t})},g9=function(e){var t=e.state,n=e.dragStartTime,r=e.shouldUseTimeDampening,o=e.scrollWindow,i=e.scrollDroppable,s=t.current.page.borderBoxCenter,a=t.dimensions.draggables[t.critical.draggable.id].page.marginBox;if(t.isWindowScrollAllowed){var l=function(e){var t=e.viewport,n=e.subject,r=e.center,o=e.shouldUseTimeDampening,i=u9({dragStartTime:e.dragStartTime,container:t.frame,subject:n,center:r,shouldUseTimeDampening:o});return i&&f9(t,i)?i:null}({dragStartTime:n,viewport:t.viewport,subject:a,center:s,shouldUseTimeDampening:r});if(l)return void o(l)}var c=function(e){var t=e.center,n=e.destination,r=e.droppables;if(n){var o=r[n];return o.frame?o:null}var i=function(e,t){var n=r8(n9(t),(function(t){return t.frame||D3(!1),J8(t.frame.pageMarginBox)(e)}));return n}(t,r);return i}({center:s,destination:q8(t.impact),droppables:t.dimensions.droppables});if(c){var u=function(e){var t=e.droppable,n=e.subject,r=e.center,o=e.dragStartTime,i=e.shouldUseTimeDampening,s=t.frame;if(!s)return null;var a=u9({dragStartTime:o,container:s.pageMarginBox,subject:n,center:r,shouldUseTimeDampening:i});return a&&m9(t,a)?a:null}({dragStartTime:n,droppable:c,subject:a,center:s,shouldUseTimeDampening:r});u&&i(c.descriptor.id,u)}},b9=function(e){var t=e.move,n=e.scrollDroppable,r=e.scrollWindow;return function(e){var o=e.scrollJumpRequest;if(o){var i=q8(e.impact);i||D3(!1);var s=function(e,t){if(!m9(e,t))return t;var r=function(e,t){var n=e.frame;return n&&m9(e,t)?h9({current:n.scroll.current,max:n.scroll.max,change:t}):null}(e,t);if(!r)return n(e.descriptor.id,t),null;var o=H3(t,r);return n(e.descriptor.id,o),H3(t,o)}(e.dimensions.droppables[i],o);if(s){var a=e.viewport,l=function(e,t,n){if(!e)return n;if(!f9(t,n))return n;var o=function(e,t){if(!f9(e,t))return null;var n=e.scroll.max,r=e.scroll.current;return h9({current:r,max:n,change:t})}(t,n);if(!o)return r(n),null;var i=H3(n,o);return r(i),H3(n,i)}(e.isWindowScrollAllowed,a,s);l&&function(e,n){var r=V3(e.current.client.selection,n);t({client:r})}(e,l)}}}},y9=function(e){var t=e.scrollDroppable,n=e.scrollWindow,r=e.move,o=function(e){var t=e.scrollDroppable,n=E3(e.scrollWindow),r=E3(t),o=null,i=function(e){o||D3(!1);var t=o,i=t.shouldUseTimeDampening,s=t.dragStartTime;g9({state:e,scrollWindow:n,scrollDroppable:r,dragStartTime:s,shouldUseTimeDampening:i})};return{start:function(e){o&&D3(!1);var t=Date.now(),n=!1,r=function(){n=!0};g9({state:e,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:r,scrollDroppable:r}),o={dragStartTime:t,shouldUseTimeDampening:n},n&&i(e)},stop:function(){o&&(n.cancel(),r.cancel(),o=null)},scroll:i}}({scrollWindow:n,scrollDroppable:t}),i=b9({move:r,scrollWindow:n,scrollDroppable:t});return{scroll:function(e){"DRAGGING"===e.phase&&("FLUID"!==e.movementMode?e.scrollJumpRequest&&i(e):o.scroll(e))},start:o.start,stop:o.stop}},v9="data-rbd",_9=function(){var e=v9+"-drag-handle";return{base:e,draggableId:e+"-draggable-id",contextId:e+"-context-id"}}(),x9=function(){var e=v9+"-draggable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),w9=function(){var e=v9+"-droppable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),k9={contextId:v9+"-scroll-container-context-id"},C9=function(e,t){return e.map((function(e){var n=e.styles[t];return n?e.selector+" { "+n+" }":""})).join(" ")},S9=function(e){var t,n,r=function(e){return function(t){return"["+t+'="'+e+'"]'}}(e),o=(t="\n      cursor: -webkit-grab;\n      cursor: grab;\n    ",{selector:r(_9.contextId),styles:{always:"\n          -webkit-touch-callout: none;\n          -webkit-tap-highlight-color: rgba(0,0,0,0);\n          touch-action: manipulation;\n        ",resting:t,dragging:"pointer-events: none;",dropAnimating:t}}),i=[(n="\n      transition: "+T6.outOfTheWay+";\n    ",{selector:r(x9.contextId),styles:{dragging:n,dropAnimating:n,userCancel:n}}),o,{selector:r(w9.contextId),styles:{always:"overflow-anchor: none;"}},{selector:"body",styles:{dragging:"\n        cursor: grabbing;\n        cursor: -webkit-grabbing;\n        user-select: none;\n        -webkit-user-select: none;\n        -moz-user-select: none;\n        -ms-user-select: none;\n        overflow-anchor: none;\n      "}}];return{always:C9(i,"always"),resting:C9(i,"resting"),dragging:C9(i,"dragging"),dropAnimating:C9(i,"dropAnimating"),userCancel:C9(i,"userCancel")}},A9="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?S.useLayoutEffect:S.useEffect,E9=function(){var e=document.querySelector("head");return e||D3(!1),e},I9=function(e){var t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.type="text/css",t},j9=function(e){return e&&e.ownerDocument?e.ownerDocument.defaultView:window};function T9(e){return e instanceof j9(e).HTMLElement}function B9(){var e={draggables:{},droppables:{}},t=[];function n(e){t.length&&t.forEach((function(t){return t(e)}))}function r(t){return e.draggables[t]||null}var o={register:function(t){e.draggables[t.descriptor.id]=t,n({type:"ADDITION",value:t})},update:function(t,n){var r=e.draggables[n.descriptor.id];r&&r.uniqueId===t.uniqueId&&(delete e.draggables[n.descriptor.id],e.draggables[t.descriptor.id]=t)},unregister:function(t){var o=t.descriptor.id,i=r(o);i&&t.uniqueId===i.uniqueId&&(delete e.draggables[o],n({type:"REMOVAL",value:t}))},getById:function(e){var t=r(e);return t||D3(!1),t},findById:r,exists:function(e){return Boolean(r(e))},getAllByType:function(t){return t8(e.draggables).filter((function(e){return e.descriptor.type===t}))}};function i(t){return e.droppables[t]||null}var s={register:function(t){e.droppables[t.descriptor.id]=t},unregister:function(t){var n=i(t.descriptor.id);n&&t.uniqueId===n.uniqueId&&delete e.droppables[t.descriptor.id]},getById:function(e){var t=i(e);return t||D3(!1),t},findById:i,exists:function(e){return Boolean(i(e))},getAllByType:function(t){return t8(e.droppables).filter((function(e){return e.descriptor.type===t}))}};return{draggable:o,droppable:s,subscribe:function(e){return t.push(e),function(){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}},clean:function(){e.draggables={},e.droppables={},t.length=0}}}var R9=S.createContext(null),N9=function(){var e=document.body;return e||D3(!1),e},D9={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},M9=function(e){return"rbd-announcement-"+e},P9=0,O9={separator:"::"};function L9(e,t){return void 0===t&&(t=O9),(0,p3.Kr)((function(){return""+e+t.separator+P9++}),[t.separator,e])}var F9=S.createContext(null);function z9(e){var t=(0,S.useRef)(e);return(0,S.useEffect)((function(){t.current=e})),t}var U9,V9,H9=((U9={})[13]=!0,U9[9]=!0,U9),$9=function(e){H9[e.keyCode]&&e.preventDefault()},W9=function(){var e="visibilitychange";return"undefined"==typeof document?e:r8([e,"ms"+e,"webkit"+e,"moz"+e,"o"+e],(function(e){return"on"+e in document}))||e}(),G9={type:"IDLE"};function q9(){}var K9=((V9={})[34]=!0,V9[33]=!0,V9[36]=!0,V9[35]=!0,V9);var Y9={type:"IDLE"},J9={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function X9(e,t){if(null==t)return!1;if(Boolean(J9[t.tagName.toLowerCase()]))return!0;var n=t.getAttribute("contenteditable");return"true"===n||""===n||t!==e&&X9(e,t.parentElement)}function Z9(e,t){var n=t.target;return!!T9(n)&&X9(e,n)}var Q9=function(e){return f3(e.getBoundingClientRect()).center},e7=function(){var e="matches";if("undefined"==typeof document)return e;var t=r8([e,"msMatchesSelector","webkitMatchesSelector"],(function(e){return e in Element.prototype}));return t||e}();function t7(e,t){return null==e?null:e[e7](t)?e:t7(e.parentElement,t)}function n7(e,t){return e.closest?e.closest(t):t7(e,t)}function r7(e){e.preventDefault()}function o7(e){var t=e.expected,n=e.phase,r=e.isLockActive;return e.shouldWarn,!!r()&&t===n}function i7(e){var t=e.lockAPI,n=e.store,r=e.registry,o=e.draggableId;if(t.isClaimed())return!1;var i=r.draggable.findById(o);return!!i&&!!i.options.isEnabled&&!!e9(n.getState(),o)}var s7=[function(e){var t=(0,S.useRef)(G9),n=(0,S.useRef)(j3),r=(0,p3.Kr)((function(){return{eventName:"mousedown",fn:function(t){if(!t.defaultPrevented&&0===t.button&&!(t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)){var r=e.findClosestDraggableId(t);if(r){var o=e.tryGetLock(r,s,{sourceEvent:t});if(o){t.preventDefault();var i={x:t.clientX,y:t.clientY};n.current(),c(o,i)}}}}}}),[e]),o=(0,p3.Kr)((function(){return{eventName:"webkitmouseforcewillbegin",fn:function(t){if(!t.defaultPrevented){var n=e.findClosestDraggableId(t);if(n){var r=e.findOptionsForDraggable(n);r&&(r.shouldRespectForcePress||e.canGetLock(n)&&t.preventDefault())}}}}}),[e]),i=(0,p3.hb)((function(){n.current=T3(window,[o,r],{passive:!1,capture:!0})}),[o,r]),s=(0,p3.hb)((function(){"IDLE"!==t.current.type&&(t.current=G9,n.current(),i())}),[i]),a=(0,p3.hb)((function(){var e=t.current;s(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[s]),l=(0,p3.hb)((function(){var e=function(e){var t=e.cancel,n=e.completed,r=e.getPhase,o=e.setPhase;return[{eventName:"mousemove",fn:function(e){var t=e.button,n=e.clientX,i=e.clientY;if(0===t){var s={x:n,y:i},a=r();if("DRAGGING"===a.type)return e.preventDefault(),void a.actions.move(s);if("PENDING"!==a.type&&D3(!1),l=a.point,c=s,Math.abs(c.x-l.x)>=5||Math.abs(c.y-l.y)>=5){var l,c;e.preventDefault();var u=a.actions.fluidLift(s);o({type:"DRAGGING",actions:u})}}}},{eventName:"mouseup",fn:function(e){var o=r();"DRAGGING"===o.type?(e.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),n()):t()}},{eventName:"mousedown",fn:function(e){"DRAGGING"===r().type&&e.preventDefault(),t()}},{eventName:"keydown",fn:function(e){if("PENDING"!==r().type)return 27===e.keyCode?(e.preventDefault(),void t()):void $9(e);t()}},{eventName:"resize",fn:t},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){"PENDING"===r().type&&t()}},{eventName:"webkitmouseforcedown",fn:function(e){var n=r();"IDLE"===n.type&&D3(!1),n.actions.shouldRespectForcePress()?t():e.preventDefault()}},{eventName:W9,fn:t}]}({cancel:a,completed:s,getPhase:function(){return t.current},setPhase:function(e){t.current=e}});n.current=T3(window,e,{capture:!0,passive:!1})}),[a,s]),c=(0,p3.hb)((function(e,n){"IDLE"!==t.current.type&&D3(!1),t.current={type:"PENDING",point:n,actions:e},l()}),[l]);A9((function(){return i(),function(){n.current()}}),[i])},function(e){var t=(0,S.useRef)(q9),n=(0,p3.Kr)((function(){return{eventName:"keydown",fn:function(n){if(!n.defaultPrevented&&32===n.keyCode){var o=e.findClosestDraggableId(n);if(o){var i=e.tryGetLock(o,l,{sourceEvent:n});if(i){n.preventDefault();var s=!0,a=i.snapLift();t.current(),t.current=T3(window,function(e,t){function n(){t(),e.cancel()}return[{eventName:"keydown",fn:function(r){return 27===r.keyCode?(r.preventDefault(),void n()):32===r.keyCode?(r.preventDefault(),t(),void e.drop()):40===r.keyCode?(r.preventDefault(),void e.moveDown()):38===r.keyCode?(r.preventDefault(),void e.moveUp()):39===r.keyCode?(r.preventDefault(),void e.moveRight()):37===r.keyCode?(r.preventDefault(),void e.moveLeft()):void(K9[r.keyCode]?r.preventDefault():$9(r))}},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:W9,fn:n}]}(a,l),{capture:!0,passive:!1})}}}function l(){s||D3(!1),s=!1,t.current(),r()}}}}),[e]),r=(0,p3.hb)((function(){t.current=T3(window,[n],{passive:!1,capture:!0})}),[n]);A9((function(){return r(),function(){t.current()}}),[r])},function(e){var t=(0,S.useRef)(Y9),n=(0,S.useRef)(j3),r=(0,p3.hb)((function(){return t.current}),[]),o=(0,p3.hb)((function(e){t.current=e}),[]),i=(0,p3.Kr)((function(){return{eventName:"touchstart",fn:function(t){if(!t.defaultPrevented){var r=e.findClosestDraggableId(t);if(r){var o=e.tryGetLock(r,a,{sourceEvent:t});if(o){var i=t.touches[0],s={x:i.clientX,y:i.clientY};n.current(),d(o,s)}}}}}}),[e]),s=(0,p3.hb)((function(){n.current=T3(window,[i],{capture:!0,passive:!1})}),[i]),a=(0,p3.hb)((function(){var e=t.current;"IDLE"!==e.type&&("PENDING"===e.type&&clearTimeout(e.longPressTimerId),o(Y9),n.current(),s())}),[s,o]),l=(0,p3.hb)((function(){var e=t.current;a(),"DRAGGING"===e.type&&e.actions.cancel({shouldBlockNextClick:!0}),"PENDING"===e.type&&e.actions.abort()}),[a]),c=(0,p3.hb)((function(){var e={capture:!0,passive:!1},t={cancel:l,completed:a,getPhase:r},o=T3(window,function(e){var t=e.cancel,n=e.completed,r=e.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(e){var n=r();if("DRAGGING"===n.type){n.hasMoved=!0;var o=e.touches[0],i={x:o.clientX,y:o.clientY};e.preventDefault(),n.actions.move(i)}else t()}},{eventName:"touchend",fn:function(e){var o=r();"DRAGGING"===o.type?(e.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),n()):t()}},{eventName:"touchcancel",fn:function(e){"DRAGGING"===r().type?(e.preventDefault(),t()):t()}},{eventName:"touchforcechange",fn:function(e){var n=r();"IDLE"===n.type&&D3(!1);var o=e.touches[0];if(o&&o.force>=.15){var i=n.actions.shouldRespectForcePress();if("PENDING"!==n.type)return i?n.hasMoved?void e.preventDefault():void t():void e.preventDefault();i&&t()}}},{eventName:W9,fn:t}]}(t),e),i=T3(window,function(e){var t=e.cancel,n=e.getPhase;return[{eventName:"orientationchange",fn:t},{eventName:"resize",fn:t},{eventName:"contextmenu",fn:function(e){e.preventDefault()}},{eventName:"keydown",fn:function(e){"DRAGGING"===n().type?(27===e.keyCode&&e.preventDefault(),t()):t()}},{eventName:W9,fn:t}]}(t),e);n.current=function(){o(),i()}}),[l,r,a]),u=(0,p3.hb)((function(){var e=r();"PENDING"!==e.type&&D3(!1);var t=e.actions.fluidLift(e.point);o({type:"DRAGGING",actions:t,hasMoved:!1})}),[r,o]),d=(0,p3.hb)((function(e,t){"IDLE"!==r().type&&D3(!1);var n=setTimeout(u,120);o({type:"PENDING",point:t,actions:e,longPressTimerId:n}),c()}),[c,r,o,u]);A9((function(){return s(),function(){n.current();var e=r();"PENDING"===e.type&&(clearTimeout(e.longPressTimerId),o(Y9))}}),[r,s,o]),A9((function(){return T3(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}])}),[])}];function a7(e){var t=e.contextId,n=e.store,r=e.registry,o=e.customSensors,i=e.enableDefaultSensors,s=[].concat(i?s7:[],o||[]),a=(0,S.useState)((function(){return function(){var e=null;function t(){e||D3(!1),e=null}return{isClaimed:function(){return Boolean(e)},isActive:function(t){return t===e},claim:function(t){e&&D3(!1);var n={abandon:t};return e=n,n},release:t,tryAbandon:function(){e&&(e.abandon(),t())}}}()}))[0],l=(0,p3.hb)((function(e,t){e.isDragging&&!t.isDragging&&a.tryAbandon()}),[a]);A9((function(){var e=n.getState();return n.subscribe((function(){var t=n.getState();l(e,t),e=t}))}),[a,n,l]),A9((function(){return a.tryAbandon}),[a.tryAbandon]);for(var c=(0,p3.hb)((function(e){return i7({lockAPI:a,registry:r,store:n,draggableId:e})}),[a,r,n]),u=(0,p3.hb)((function(e,o,i){return function(e){var t=e.lockAPI,n=e.contextId,r=e.store,o=e.registry,i=e.draggableId,s=e.forceSensorStop,a=e.sourceEvent;if(!i7({lockAPI:t,store:r,registry:o,draggableId:i}))return null;var l=o.draggable.getById(i),c=function(e,t){var n="["+x9.contextId+'="'+e+'"]',r=r8(o8(document.querySelectorAll(n)),(function(e){return e.getAttribute(x9.id)===t}));return r&&T9(r)?r:null}(n,l.descriptor.id);if(!c)return null;if(a&&!l.options.canDragInteractiveElements&&Z9(c,a))return null;var u=t.claim(s||j3),d="PRE_DRAG";function h(){return l.options.shouldRespectForcePress}function p(){return t.isActive(u)}var f=function(e,t){o7({expected:e,phase:d,isLockActive:p,shouldWarn:!0})&&r.dispatch(t())}.bind(null,"DRAGGING");function m(e){function n(){t.release(),d="COMPLETED"}function o(t,o){if(void 0===o&&(o={shouldBlockNextClick:!1}),e.cleanup(),o.shouldBlockNextClick){var i=T3(window,[{eventName:"click",fn:r7,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(i)}n(),r.dispatch(C6({reason:t}))}return"PRE_DRAG"!==d&&(n(),"PRE_DRAG"!==d&&D3(!1)),r.dispatch(d6(e.liftActionArgs)),d="DRAGGING",(0,S4.A)({isActive:function(){return o7({expected:"DRAGGING",phase:d,isLockActive:p,shouldWarn:!1})},shouldRespectForcePress:h,drop:function(e){return o("DROP",e)},cancel:function(e){return o("CANCEL",e)}},e.actions)}var g={isActive:function(){return o7({expected:"PRE_DRAG",phase:d,isLockActive:p,shouldWarn:!1})},shouldRespectForcePress:h,fluidLift:function(e){var t=E3((function(e){f((function(){return b6({client:e})}))})),n=m({liftActionArgs:{id:i,clientSelection:e,movementMode:"FLUID"},cleanup:function(){return t.cancel()},actions:{move:t}});return(0,S4.A)({},n,{move:t})},snapLift:function(){var e={moveUp:function(){return f(y6)},moveRight:function(){return f(_6)},moveDown:function(){return f(v6)},moveLeft:function(){return f(x6)}};return m({liftActionArgs:{id:i,clientSelection:Q9(c),movementMode:"SNAP"},cleanup:j3,actions:e})},abort:function(){o7({expected:"PRE_DRAG",phase:d,isLockActive:p,shouldWarn:!0})&&t.release()}};return g}({lockAPI:a,registry:r,contextId:t,store:n,draggableId:e,forceSensorStop:o,sourceEvent:i&&i.sourceEvent?i.sourceEvent:null})}),[t,a,r,n]),d=(0,p3.hb)((function(e){return function(e,t){var n=function(e,t){var n,r=t.target;if(!((n=r)instanceof j9(n).Element))return null;var o=function(e){return"["+_9.contextId+'="'+e+'"]'}(e),i=n7(r,o);return i&&T9(i)?i:null}(e,t);return n?n.getAttribute(_9.draggableId):null}(t,e)}),[t]),h=(0,p3.hb)((function(e){var t=r.draggable.findById(e);return t?t.options:null}),[r.draggable]),p=(0,p3.hb)((function(){a.isClaimed()&&(a.tryAbandon(),"IDLE"!==n.getState().phase&&n.dispatch(w6()))}),[a,n]),f=(0,p3.hb)(a.isClaimed,[a]),m=(0,p3.Kr)((function(){return{canGetLock:c,tryGetLock:u,findClosestDraggableId:d,findOptionsForDraggable:h,tryReleaseLock:p,isLockClaimed:f}}),[c,u,d,h,p,f]),g=0;g<s.length;g++)s[g](m)}var l7=function(e){return{onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragEnd:e.onDragEnd,onDragUpdate:e.onDragUpdate}};function c7(e){return e.current||D3(!1),e.current}function u7(e){var t=e.contextId,n=e.setCallbacks,r=e.sensors,o=e.nonce,i=e.dragHandleUsageInstructions,s=(0,S.useRef)(null),a=z9(e),l=(0,p3.hb)((function(){return l7(a.current)}),[a]),c=function(e){var t=(0,p3.Kr)((function(){return M9(e)}),[e]),n=(0,S.useRef)(null);return(0,S.useEffect)((function(){var e=document.createElement("div");return n.current=e,e.id=t,e.setAttribute("aria-live","assertive"),e.setAttribute("aria-atomic","true"),(0,S4.A)(e.style,D9),N9().appendChild(e),function(){setTimeout((function(){var t=N9();t.contains(e)&&t.removeChild(e),e===n.current&&(n.current=null)}))}}),[t]),(0,p3.hb)((function(e){var t=n.current;t&&(t.textContent=e)}),[])}(t),u=function(e){var t=e.contextId,n=e.text,r=L9("hidden-text",{separator:"-"}),o=(0,p3.Kr)((function(){return function(e){return"rbd-hidden-text-"+e.contextId+"-"+e.uniqueId}({contextId:t,uniqueId:r})}),[r,t]);return(0,S.useEffect)((function(){var e=document.createElement("div");return e.id=o,e.textContent=n,e.style.display="none",N9().appendChild(e),function(){var t=N9();t.contains(e)&&t.removeChild(e)}}),[o,n]),o}({contextId:t,text:i}),d=function(e,t){var n=(0,p3.Kr)((function(){return S9(e)}),[e]),r=(0,S.useRef)(null),o=(0,S.useRef)(null),i=(0,p3.hb)(A3((function(e){var t=o.current;t||D3(!1),t.textContent=e})),[]),s=(0,p3.hb)((function(e){var t=r.current;t||D3(!1),t.textContent=e}),[]);A9((function(){(r.current||o.current)&&D3(!1);var a=I9(t),l=I9(t);return r.current=a,o.current=l,a.setAttribute(v9+"-always",e),l.setAttribute(v9+"-dynamic",e),E9().appendChild(a),E9().appendChild(l),s(n.always),i(n.resting),function(){var e=function(e){var t=e.current;t||D3(!1),E9().removeChild(t),e.current=null};e(r),e(o)}}),[t,s,i,n.always,n.resting,e]);var a=(0,p3.hb)((function(){return i(n.dragging)}),[i,n.dragging]),l=(0,p3.hb)((function(e){i("DROP"!==e?n.userCancel:n.dropAnimating)}),[i,n.dropAnimating,n.userCancel]),c=(0,p3.hb)((function(){o.current&&i(n.resting)}),[i,n.resting]);return(0,p3.Kr)((function(){return{dragging:a,dropping:l,resting:c}}),[a,l,c])}(t,o),h=(0,p3.hb)((function(e){c7(s).dispatch(e)}),[]),p=(0,p3.Kr)((function(){return(0,A4.zH)({publishWhileDragging:h6,updateDroppableScroll:f6,updateDroppableIsEnabled:m6,updateDroppableIsCombineEnabled:g6,collectionStarting:p6},h)}),[h]),f=function(){var e=(0,p3.Kr)(B9,[]);return(0,S.useEffect)((function(){return function(){requestAnimationFrame(e.clean)}}),[e]),e}(),m=(0,p3.Kr)((function(){return Q6(f,p)}),[f,p]),g=(0,p3.Kr)((function(){return y9((0,S4.A)({scrollWindow:t9,scrollDroppable:m.scrollDroppable},(0,A4.zH)({move:b6},h)))}),[m.scrollDroppable,h]),b=function(e){var t=(0,S.useRef)({}),n=(0,S.useRef)(null),r=(0,S.useRef)(null),o=(0,S.useRef)(!1),i=(0,p3.hb)((function(e,n){var r={id:e,focus:n};return t.current[e]=r,function(){var n=t.current;n[e]!==r&&delete n[e]}}),[]),s=(0,p3.hb)((function(t){var n=function(e,t){var n="["+_9.contextId+'="'+e+'"]',r=o8(document.querySelectorAll(n));if(!r.length)return null;var o=r8(r,(function(e){return e.getAttribute(_9.draggableId)===t}));return o&&T9(o)?o:null}(e,t);n&&n!==document.activeElement&&n.focus()}),[e]),a=(0,p3.hb)((function(e,t){n.current===e&&(n.current=t)}),[]),l=(0,p3.hb)((function(){r.current||o.current&&(r.current=requestAnimationFrame((function(){r.current=null;var e=n.current;e&&s(e)})))}),[s]),c=(0,p3.hb)((function(e){n.current=null;var t=document.activeElement;t&&t.getAttribute(_9.draggableId)===e&&(n.current=e)}),[]);return A9((function(){return o.current=!0,function(){o.current=!1;var e=r.current;e&&cancelAnimationFrame(e)}}),[]),(0,p3.Kr)((function(){return{register:i,tryRecordFocus:c,tryRestoreFocusRecorded:l,tryShiftRecord:a}}),[i,c,l,a])}(t),y=(0,p3.Kr)((function(){return q6({announce:c,autoScroller:g,dimensionMarshal:m,focusMarshal:b,getResponders:l,styleMarshal:d})}),[c,g,m,b,l,d]);s.current=y;var v=(0,p3.hb)((function(){var e=c7(s);"IDLE"!==e.getState().phase&&e.dispatch(w6())}),[]),_=(0,p3.hb)((function(){var e=c7(s).getState();return e.isDragging||"DROP_ANIMATING"===e.phase}),[]);n((0,p3.Kr)((function(){return{isDragging:_,tryAbort:v}}),[_,v]));var x=(0,p3.hb)((function(e){return e9(c7(s).getState(),e)}),[]),w=(0,p3.hb)((function(){return Y8(c7(s).getState())}),[]),k=(0,p3.Kr)((function(){return{marshal:m,focus:b,contextId:t,canLift:x,isMovementAllowed:w,dragHandleUsageInstructionsId:u,registry:f}}),[t,m,u,b,x,w,f]);return a7({contextId:t,store:y,registry:f,customSensors:r,enableDefaultSensors:!1!==e.enableDefaultSensors}),(0,S.useEffect)((function(){return v}),[v]),S.createElement(F9.Provider,{value:k},S.createElement(N4,{context:R9,store:y},e.children))}var d7=0;function h7(e){var t=(0,p3.Kr)((function(){return""+d7++}),[]),n=e.dragHandleUsageInstructions||z3.dragHandleUsageInstructions;return S.createElement(M3,null,(function(r){return S.createElement(u7,{nonce:e.nonce,contextId:t,setCallbacks:r,dragHandleUsageInstructions:n,enableDefaultSensors:e.enableDefaultSensors,sensors:e.sensors,onBeforeCapture:e.onBeforeCapture,onBeforeDragStart:e.onBeforeDragStart,onDragStart:e.onDragStart,onDragUpdate:e.onDragUpdate,onDragEnd:e.onDragEnd},e.children)}))}var p7=function(e){return function(t){return e===t}},f7=p7("scroll"),m7=p7("auto"),g7=(p7("visible"),function(e,t){return t(e.overflowX)||t(e.overflowY)}),b7=function e(t){return null==t||t===document.body||t===document.documentElement?null:function(e){var t=window.getComputedStyle(e),n={overflowX:t.overflowX,overflowY:t.overflowY};return g7(n,f7)||g7(n,m7)}(t)?t:e(t.parentElement)},y7=function(e){return{x:e.scrollLeft,y:e.scrollTop}},v7=function e(t){return!!t&&("fixed"===window.getComputedStyle(t).position||e(t.parentElement))},_7={passive:!1},x7={passive:!0},w7=function(e){return e.shouldPublishImmediately?_7:x7};function k7(e){var t=(0,S.useContext)(e);return t||D3(!1),t}var C7=function(e){return e&&e.env.closestScrollable||null};function S7(){}var A7={width:0,height:0,margin:{top:0,right:0,bottom:0,left:0}},E7=S.memo((function(e){var t=(0,S.useRef)(null),n=(0,p3.hb)((function(){t.current&&(clearTimeout(t.current),t.current=null)}),[]),r=e.animate,o=e.onTransitionEnd,i=e.onClose,s=e.contextId,a=(0,S.useState)("open"===e.animate),l=a[0],c=a[1];(0,S.useEffect)((function(){return l?"open"!==r?(n(),c(!1),S7):t.current?S7:(t.current=setTimeout((function(){t.current=null,c(!1)})),n):S7}),[r,l,n]);var u=(0,p3.hb)((function(e){"height"===e.propertyName&&(o(),"close"===r&&i())}),[r,i,o]),d=function(e){var t=e.isAnimatingOpenOnMount,n=e.placeholder,r=e.animate,o=function(e){var t=e.placeholder;return e.isAnimatingOpenOnMount||"close"===e.animate?A7:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin}}({isAnimatingOpenOnMount:t,placeholder:n,animate:r});return{display:n.display,boxSizing:"border-box",width:o.width,height:o.height,marginTop:o.margin.top,marginRight:o.margin.right,marginBottom:o.margin.bottom,marginLeft:o.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:"none"!==r?T6.placeholder:null}}({isAnimatingOpenOnMount:l,animate:e.animate,placeholder:e.placeholder});return S.createElement(e.placeholder.tagName,{style:d,"data-rbd-placeholder-context-id":s,onTransitionEnd:u,ref:e.innerRef})})),I7=S.createContext(null),j7=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).state={isVisible:Boolean(t.props.on),data:t.props.on,animate:t.props.shouldAnimate&&t.props.on?"open":"none"},t.onClose=function(){"close"===t.state.animate&&t.setState({isVisible:!1})},t}return C4(t,e),t.getDerivedStateFromProps=function(e,t){return e.shouldAnimate?e.on?{isVisible:!0,data:e.on,animate:"open"}:t.isVisible?{isVisible:!0,data:t.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:Boolean(e.on),data:e.on,animate:"none"}},t.prototype.render=function(){if(!this.state.isVisible)return null;var e={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(e)},t}(S.PureComponent),T7=5e3,B7=4500,R7=function(e,t){return t?T6.drop(t.duration):e?T6.snap:T6.fluid},N7=function(e,t){return e?t?A6:E6:null};function D7(e){e.preventDefault()}var M7=function(e,t){return e===t},P7=function(e){var t=e.combine,n=e.destination;return n?n.droppableId:t?t.droppableId:null};function O7(e){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:e,combineWith:null}}var L7={mapped:{type:"SECONDARY",offset:U3,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:O7(null)}},F7=d3((function(){var e,t,n,r=(e=A3((function(e,t){return{x:e,y:t}})),t=A3((function(e,t,n,r,o){return{isDragging:!0,isClone:t,isDropAnimating:Boolean(o),dropAnimation:o,mode:e,draggingOver:n,combineWith:r,combineTargetFor:null}})),n=A3((function(e,n,r,o,i,s,a){return{mapped:{type:"DRAGGING",dropping:null,draggingOver:i,combineWith:s,mode:n,offset:e,dimension:r,forceShouldAnimate:a,snapshot:t(n,o,i,s,null)}}})),function(r,o){if(r.isDragging){if(r.critical.draggable.id!==o.draggableId)return null;var i=r.current.client.offset,s=r.dimensions.draggables[o.draggableId],a=q8(r.impact),l=(u=r.impact).at&&"COMBINE"===u.at.type?u.at.combine.draggableId:null,c=r.forceShouldAnimate;return n(e(i.x,i.y),r.movementMode,s,o.isClone,a,l,c)}var u;if("DROP_ANIMATING"===r.phase){var d=r.completed;if(d.result.draggableId!==o.draggableId)return null;var h=o.isClone,p=r.dimensions.draggables[o.draggableId],f=d.result,m=f.mode,g=P7(f),b=function(e){return e.combine?e.combine.draggableId:null}(f),y={duration:r.dropDuration,curve:S6,moveTo:r.newHomeClientOffset,opacity:b?A6:null,scale:b?I6:null};return{mapped:{type:"DRAGGING",offset:r.newHomeClientOffset,dimension:p,dropping:y,draggingOver:g,combineWith:b,mode:m,forceShouldAnimate:null,snapshot:t(m,h,g,b,y)}}}return null}),o=function(){var e=A3((function(e,t){return{x:e,y:t}})),t=A3(O7),n=A3((function(e,n,r){return void 0===n&&(n=null),{mapped:{type:"SECONDARY",offset:e,combineTargetFor:n,shouldAnimateDisplacement:r,snapshot:t(n)}}})),r=function(e){return e?n(U3,e,!0):null},o=function(t,o,i,s){var a=i.displaced.visible[t],l=Boolean(s.inVirtualList&&s.effected[t]),c=d8(i),u=c&&c.draggableId===t?o:null;if(!a){if(!l)return r(u);if(i.displaced.invisible[t])return null;var d=W3(s.displacedBy.point),h=e(d.x,d.y);return n(h,u,!0)}if(l)return r(u);var p=i.displacedBy.point,f=e(p.x,p.y);return n(f,u,a.shouldAnimate)};return function(e,t){if(e.isDragging)return e.critical.draggable.id===t.draggableId?null:o(t.draggableId,e.critical.draggable.id,e.impact,e.afterCritical);if("DROP_ANIMATING"===e.phase){var n=e.completed;return n.result.draggableId===t.draggableId?null:o(t.draggableId,n.result.draggableId,n.impact,n.afterCritical)}return null}}();return function(e,t){return r(e,t)||o(e,t)||L7}}),{dropAnimationFinished:function(){return{type:"DROP_ANIMATION_FINISHED",payload:null}}},null,{context:R9,pure:!0,areStatePropsEqual:M7})((function(e){var t=(0,S.useRef)(null),n=(0,p3.hb)((function(e){t.current=e}),[]),r=(0,p3.hb)((function(){return t.current}),[]),o=k7(F9),i=o.contextId,s=o.dragHandleUsageInstructionsId,a=o.registry,l=k7(I7),c=l.type,u=l.droppableId,d=(0,p3.Kr)((function(){return{id:e.draggableId,index:e.index,type:c,droppableId:u}}),[e.draggableId,e.index,c,u]),h=e.children,p=e.draggableId,f=e.isEnabled,m=e.shouldRespectForcePress,g=e.canDragInteractiveElements,b=e.isClone,y=e.mapped,v=e.dropAnimationFinished;b||function(e){var t=L9("draggable"),n=e.descriptor,r=e.registry,o=e.getDraggableRef,i=e.canDragInteractiveElements,s=e.shouldRespectForcePress,a=e.isEnabled,l=(0,p3.Kr)((function(){return{canDragInteractiveElements:i,shouldRespectForcePress:s,isEnabled:a}}),[i,a,s]),c=(0,p3.hb)((function(e){var t=o();return t||D3(!1),function(e,t,n){void 0===n&&(n=U3);var r=window.getComputedStyle(t),o=t.getBoundingClientRect(),i=w3(o,r),s=x3(i,n);return{descriptor:e,placeholder:{client:i,tagName:t.tagName.toLowerCase(),display:r.display},displaceBy:{x:i.marginBox.width,y:i.marginBox.height},client:i,page:s}}(n,t,e)}),[n,o]),u=(0,p3.Kr)((function(){return{uniqueId:t,descriptor:n,options:l,getDimension:c}}),[n,c,l,t]),d=(0,S.useRef)(u),h=(0,S.useRef)(!0);A9((function(){return r.draggable.register(d.current),function(){return r.draggable.unregister(d.current)}}),[r.draggable]),A9((function(){if(h.current)h.current=!1;else{var e=d.current;d.current=u,r.draggable.update(u,e)}}),[u,r.draggable])}((0,p3.Kr)((function(){return{descriptor:d,registry:a,getDraggableRef:r,canDragInteractiveElements:g,shouldRespectForcePress:m,isEnabled:f}}),[d,a,r,g,m,f]));var _=(0,p3.Kr)((function(){return f?{tabIndex:0,role:"button","aria-describedby":s,"data-rbd-drag-handle-draggable-id":p,"data-rbd-drag-handle-context-id":i,draggable:!1,onDragStart:D7}:null}),[i,s,p,f]),x=(0,p3.hb)((function(e){"DRAGGING"===y.type&&y.dropping&&"transform"===e.propertyName&&v()}),[v,y]),w=(0,p3.Kr)((function(){var e=function(e){return"DRAGGING"===e.type?function(e){var t=e.dimension.client,n=e.offset,r=e.combineWith,o=e.dropping,i=Boolean(r),s=function(e){return null!=e.forceShouldAnimate?e.forceShouldAnimate:"SNAP"===e.mode}(e),a=Boolean(o),l=a?N6(n,i):R6(n);return{position:"fixed",top:t.marginBox.top,left:t.marginBox.left,boxSizing:"border-box",width:t.borderBox.width,height:t.borderBox.height,transition:R7(s,o),transform:l,opacity:N7(i,a),zIndex:a?B7:T7,pointerEvents:"none"}}(e):{transform:R6((t=e).offset),transition:t.shouldAnimateDisplacement?null:"none"};var t}(y),t="DRAGGING"===y.type&&y.dropping?x:null;return{innerRef:n,draggableProps:{"data-rbd-draggable-context-id":i,"data-rbd-draggable-id":p,style:e,onTransitionEnd:t},dragHandleProps:_}}),[i,_,p,y,x,n]),k=(0,p3.Kr)((function(){return{draggableId:d.id,type:d.type,source:{index:d.index,droppableId:d.droppableId}}}),[d.droppableId,d.id,d.index,d.type]);return h(w,y.snapshot,k)}));function z7(e){return k7(I7).isUsingCloneFor!==e.draggableId||e.isClone?S.createElement(F7,e):null}function U7(e){var t="boolean"!=typeof e.isDragDisabled||!e.isDragDisabled,n=Boolean(e.disableInteractiveElementBlocking),r=Boolean(e.shouldRespectForcePress);return S.createElement(z7,(0,S4.A)({},e,{isClone:!1,isEnabled:t,canDragInteractiveElements:n,shouldRespectForcePress:r}))}var V7=function(e,t){return e===t.droppable.type},H7=function(e,t){return t.draggables[e.draggable.id]},$7={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:function(){return document.body||D3(!1),document.body}},W7=d3((function(){var e={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},t=(0,S4.A)({},e,{shouldAnimatePlaceholder:!1}),n=A3((function(e){return{draggableId:e.id,type:e.type,source:{index:e.index,droppableId:e.droppableId}}})),r=A3((function(r,o,i,s,a,l){var c=a.descriptor.id;if(a.descriptor.droppableId===r){var u=l?{render:l,dragging:n(a.descriptor)}:null,d={isDraggingOver:i,draggingOverWith:i?c:null,draggingFromThisWith:c,isUsingPlaceholder:!0};return{placeholder:a.placeholder,shouldAnimatePlaceholder:!1,snapshot:d,useClone:u}}if(!o)return t;if(!s)return e;var h={isDraggingOver:i,draggingOverWith:c,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:a.placeholder,shouldAnimatePlaceholder:!0,snapshot:h,useClone:null}}));return function(n,o){var i=o.droppableId,s=o.type,a=!o.isDropDisabled,l=o.renderClone;if(n.isDragging){var c=n.critical;if(!V7(s,c))return t;var u=H7(c,n.dimensions),d=q8(n.impact)===i;return r(i,a,d,d,u,l)}if("DROP_ANIMATING"===n.phase){var h=n.completed;if(!V7(s,h.critical))return t;var p=H7(h.critical,n.dimensions);return r(i,a,P7(h.result)===i,q8(h.impact)===i,p,l)}if("IDLE"===n.phase&&n.completed&&!n.shouldFlush){var f=n.completed;if(!V7(s,f.critical))return t;var m=q8(f.impact)===i,g=Boolean(f.impact.at&&"COMBINE"===f.impact.at.type),b=f.critical.droppable.id===i;return m?g?e:t:b?e:t}return t}}),{updateViewportMaxScroll:function(e){return{type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:e}}},null,{context:R9,pure:!0,areStatePropsEqual:M7})((function(e){var t=(0,S.useContext)(F9);t||D3(!1);var n=t.contextId,r=t.isMovementAllowed,o=(0,S.useRef)(null),i=(0,S.useRef)(null),s=e.children,a=e.droppableId,l=e.type,c=e.mode,u=e.direction,d=e.ignoreContainerClipping,h=e.isDropDisabled,p=e.isCombineEnabled,f=e.snapshot,m=e.useClone,g=e.updateViewportMaxScroll,b=e.getContainerForClone,y=(0,p3.hb)((function(){return o.current}),[]),v=(0,p3.hb)((function(e){o.current=e}),[]),_=((0,p3.hb)((function(){return i.current}),[]),(0,p3.hb)((function(e){i.current=e}),[])),x=(0,p3.hb)((function(){r()&&g({maxScroll:J6()})}),[r,g]);!function(e){var t=(0,S.useRef)(null),n=k7(F9),r=L9("droppable"),o=n.registry,i=n.marshal,s=z9(e),a=(0,p3.Kr)((function(){return{id:e.droppableId,type:e.type,mode:e.mode}}),[e.droppableId,e.mode,e.type]),l=(0,S.useRef)(a),c=(0,p3.Kr)((function(){return A3((function(e,n){t.current||D3(!1);var r={x:e,y:n};i.updateDroppableScroll(a.id,r)}))}),[a.id,i]),u=(0,p3.hb)((function(){var e=t.current;return e&&e.env.closestScrollable?y7(e.env.closestScrollable):U3}),[]),d=(0,p3.hb)((function(){var e=u();c(e.x,e.y)}),[u,c]),h=(0,p3.Kr)((function(){return E3(d)}),[d]),p=(0,p3.hb)((function(){var e=t.current,n=C7(e);e&&n||D3(!1),e.scrollOptions.shouldPublishImmediately?d():h()}),[h,d]),f=(0,p3.hb)((function(e,r){t.current&&D3(!1);var o=s.current,i=o.getDroppableRef();i||D3(!1);var l=function(e){return{closestScrollable:b7(e),isFixedOnPage:v7(e)}}(i),c={ref:i,descriptor:a,env:l,scrollOptions:r};t.current=c;var u=function(e){var t=e.ref,n=e.descriptor,r=e.env,o=e.windowScroll,i=e.direction,s=e.isDropDisabled,a=e.isCombineEnabled,l=e.shouldClipSubject,c=r.closestScrollable,u=function(e,t){var n=k3(e);if(!t)return n;if(e!==t)return n;var r=n.paddingBox.top-t.scrollTop,o=n.paddingBox.left-t.scrollLeft,i=r+t.scrollHeight,s=o+t.scrollWidth,a=m3({top:r,right:s,bottom:i,left:o},n.border);return y3({borderBox:a,margin:n.margin,border:n.border,padding:n.padding})}(t,c),d=x3(u,o),h=function(){if(!c)return null;var e=k3(c),t={scrollHeight:c.scrollHeight,scrollWidth:c.scrollWidth};return{client:e,page:x3(e,o),scroll:y7(c),scrollSize:t,shouldClipSubject:l}}(),p=function(e){var t=e.descriptor,n=e.isEnabled,r=e.isCombineEnabled,o=e.isFixedOnPage,i=e.direction,s=e.client,a=e.page,l=e.closest,c=function(){if(!l)return null;var e=l.scrollSize,t=l.client,n=K6({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,height:t.paddingBox.height,width:t.paddingBox.width});return{pageMarginBox:l.page.marginBox,frameClient:t,scrollSize:e,shouldClipSubject:l.shouldClipSubject,scroll:{initial:l.scroll,current:l.scroll,max:n,diff:{value:U3,displacement:U3}}}}(),u="vertical"===i?_8:x8;return{descriptor:t,isCombineEnabled:r,isFixedOnPage:o,axis:u,isEnabled:n,client:s,page:a,frame:c,subject:Q3({page:a,withPlaceholder:null,axis:u,frame:c})}}({descriptor:n,isEnabled:!s,isCombineEnabled:a,isFixedOnPage:r.isFixedOnPage,direction:i,client:u,page:d,closest:h});return p}({ref:i,descriptor:a,env:l,windowScroll:e,direction:o.direction,isDropDisabled:o.isDropDisabled,isCombineEnabled:o.isCombineEnabled,shouldClipSubject:!o.ignoreContainerClipping}),d=l.closestScrollable;return d&&(d.setAttribute(k9.contextId,n.contextId),d.addEventListener("scroll",p,w7(c.scrollOptions))),u}),[n.contextId,a,p,s]),m=(0,p3.hb)((function(){var e=t.current,n=C7(e);return e&&n||D3(!1),y7(n)}),[]),g=(0,p3.hb)((function(){var e=t.current;e||D3(!1);var n=C7(e);t.current=null,n&&(h.cancel(),n.removeAttribute(k9.contextId),n.removeEventListener("scroll",p,w7(e.scrollOptions)))}),[p,h]),b=(0,p3.hb)((function(e){var n=t.current;n||D3(!1);var r=C7(n);r||D3(!1),r.scrollTop+=e.y,r.scrollLeft+=e.x}),[]),y=(0,p3.Kr)((function(){return{getDimensionAndWatchScroll:f,getScrollWhileDragging:m,dragStopped:g,scroll:b}}),[g,f,m,b]),v=(0,p3.Kr)((function(){return{uniqueId:r,descriptor:a,callbacks:y}}),[y,a,r]);A9((function(){return l.current=v.descriptor,o.droppable.register(v),function(){t.current&&g(),o.droppable.unregister(v)}}),[y,a,g,v,i,o.droppable]),A9((function(){t.current&&i.updateDroppableIsEnabled(l.current.id,!e.isDropDisabled)}),[e.isDropDisabled,i]),A9((function(){t.current&&i.updateDroppableIsCombineEnabled(l.current.id,e.isCombineEnabled)}),[e.isCombineEnabled,i])}({droppableId:a,type:l,mode:c,direction:u,isDropDisabled:h,isCombineEnabled:p,ignoreContainerClipping:d,getDroppableRef:y});var w=S.createElement(j7,{on:e.placeholder,shouldAnimate:e.shouldAnimatePlaceholder},(function(e){var t=e.onClose,r=e.data,o=e.animate;return S.createElement(E7,{placeholder:r,onClose:t,innerRef:_,animate:o,contextId:n,onTransitionEnd:x})})),k=(0,p3.Kr)((function(){return{innerRef:v,placeholder:w,droppableProps:{"data-rbd-droppable-id":a,"data-rbd-droppable-context-id":n}}}),[n,a,w,v]),C=m?m.dragging.draggableId:null,A=(0,p3.Kr)((function(){return{droppableId:a,type:l,isUsingCloneFor:C}}),[a,C,l]);return S.createElement(I7.Provider,{value:A},s(k,f),function(){if(!m)return null;var e=m.dragging,t=m.render,n=S.createElement(z7,{draggableId:e.draggableId,index:e.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(function(n,r){return t(n,r,e)}));return kW.createPortal(n,b())}())}));function G7({children:e,...t}){const[n,r]=(0,S.useState)(!1);return(0,S.useEffect)((()=>{const e=requestAnimationFrame((()=>r(!0)));return()=>{cancelAnimationFrame(e),r(!1)}}),[]),n?(0,Td.jsx)(W7,{...t,children:e}):null}function q7({value:e,remove:t,onUpdate:n,onCheck:r,index:o}){return(0,Td.jsxs)("div",{className:"mailpoet-form-segments-settings-list","data-automation-id":"custom_field_value_settings",children:[(0,Td.jsx)("input",{type:"checkbox",defaultChecked:e.isChecked||!1,onChange:t=>r(e.id,t.target.checked)},`check-${e.id}`),(0,Td.jsx)("input",{type:"text",value:e.name,"data-automation-id":"custom_field_value_settings_value",onChange:t=>n(e.id,t.target.value)}),0!==o&&(0,Td.jsx)(w4.A,{icon:"no-alt",color:"#900",className:"mailpoet-form-segments-segment-remove",onClick:(0,I2.partial)(t,e.id)})]},e.id)}function K7({values:e,update:t,remove:n,onReorder:r}){const[o,i]=(0,S.useState)(e);if((0,S.useEffect)((()=>{i(e)}),[e]),0===o.length)return null;const s=(e,n)=>{const r=o.find((t=>t.id===e));r.name=n,t(r)},a=(e,n)=>{const r=o.find((t=>t.id===e));if(n){const e=o.find((e=>e.isChecked));e&&(delete e.isChecked,t(e)),r.isChecked=!0}else delete r.isChecked;t(r)};return(0,Td.jsx)("div",{className:"mailpoet-dnd-items-list",children:(0,Td.jsx)(h7,{onDragEnd:e=>{const t=e.source.index,n=e.destination.index,s=[...o],[a]=s.splice(t,1);s.splice(n,0,a),i(s),r(s)},children:(0,Td.jsx)(G7,{droppableId:"droppable",children:e=>(0,Td.jsxs)("div",{...e.droppableProps,ref:e.innerRef,children:[o.map(((e,t)=>(0,Td.jsx)(U7,{draggableId:e.id,index:t,children:r=>(0,Td.jsx)("div",{ref:r.innerRef,...r.draggableProps,...r.dragHandleProps,children:(0,Td.jsx)(q7,{index:t,value:e,remove:n,onCheck:a,onUpdate:s},`inner${e.id}`)})},e.id))),e.placeholder]})})})})}function Y7({label:e="",mandatory:t=!1,values:n=[],isSaving:r=!1,onSave:o=null,isDeleting:i=!1,onCustomFieldDelete:s=null,onChange:a=null,useDragAndDrop:l=!0}){const[c,u]=(0,S.useState)(e),[d,h]=(0,S.useState)(t),[p,f]=(0,S.useState)(JSON.parse(JSON.stringify(n))),m=(0,S.useMemo)((()=>({label:c,mandatory:d,values:p,isValid:(0,I2.reduce)(p,((e,t)=>!(0,I2.isEmpty)(t.name)&&e),!0)})),[c,d,p]),g=d!==t||!(0,I2.isEqualWith)(n,p)||c!==e;return(0,S.useEffect)((()=>{a&&a(m,g)}),[m,a,g]),(0,Td.jsxs)("div",{className:"custom-field-settings","data-automation-id":"custom_field_settings",children:[(0,Td.jsx)(KE.A,{label:_2.U.I18n.t("label"),value:c,"data-automation-id":"settings_custom_text_label_input",onChange:u}),(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("blockMandatory"),checked:d,onChange:h}),(0,Td.jsx)(K7,{remove:e=>{f(p.filter((t=>e!==t.id)))},update:e=>{f(p.map((t=>e.id!==t.id?t:e)))},values:p,onReorder:f,useDragAndDrop:l}),(0,Td.jsx)(Zv.Ay,{variant:"link",onClick:()=>f([...p,{id:`${1e3*Math.random()}-${Date.now()}`,name:`Option ${p.length+1}`}]),className:"button-on-top","data-automation-id":"custom_field_values_add_item",children:_2.U.I18n.t("customFieldAddItem")}),(0,Td.jsx)("br",{}),o?(0,Td.jsx)(Zv.Ay,{variant:"primary",onClick:()=>o({mandatory:d,values:p,label:c}),isBusy:r,disabled:r||!g,className:"button-on-top","data-automation-id":"custom_field_save",children:_2.U.I18n.t("customFieldSaveCTA")}):null,s?(0,Td.jsx)(z5,{isBusy:r||i,onDelete:s}):null]})}function J7({attributes:e,setAttributes:t,clientId:n}){const r=(0,Ul.A)((e=>e(A2).getIsCustomFieldSaving()),[]),o=(0,Ul.A)((e=>e(A2).getIsCustomFieldDeleting()),[]),{saveCustomField:i,deleteCustomField:s,customFieldEdited:a}=(0,Vl.A)(A2),l=(0,Td.jsxs)(IA,{children:[(0,Td.jsx)(F5.A,{children:(0,Td.jsx)(aF.Ay,{title:_2.U.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,Td.jsx)(Y7,{label:e.label,mandatory:e.mandatory,values:e.values,isSaving:r,onSave:n=>i({customFieldId:e.customFieldId,data:{params:K5("radio",n)},onFinish:()=>t({mandatory:n.mandatory,values:n.values,label:n.label})}),onCustomFieldDelete:()=>s(e.customFieldId,n),isDeleting:o,onChange:(e,t)=>t&&a()})})}),(0,Td.jsx)(F5.A,{children:(0,Td.jsx)(aF.Ay,{title:_2.U.I18n.t("formSettings"),initialOpen:!0,children:(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("displayLabel"),checked:!e.hideLabel,onChange:e=>t({hideLabel:!e})})})})]});return(0,Td.jsxs)(q5,{className:e.className,children:[l,(0,Td.jsx)("span",{className:"mailpoet_radio_label","data-automation-id":"editor_custom_field_radio_buttons_block",children:e.hideLabel?null:V5(e)}),Array.isArray(e.values)&&e.values.map((e=>(0,Td.jsx)("div",{children:(0,Td.jsxs)("label",{children:[(0,Td.jsx)("input",{type:"radio",disabled:!0,checked:e.isChecked||!1,className:"mailpoet_radio"}),e.name]})},e.id)))]})}function X7(e){const t=parseInt(e,10);if(!Number.isNaN(t))return t}W7.defaultProps=$7,q7.propTypes={value:k2().shape({name:k2().string.isRequired,id:k2().string.isRequired,isChecked:k2().bool}).isRequired,onUpdate:k2().func.isRequired,onCheck:k2().func.isRequired,index:k2().number.isRequired,remove:k2().func.isRequired},K7.propTypes={values:k2().arrayOf(k2().shape({name:k2().string.isRequired,id:k2().string.isRequired}).isRequired).isRequired,update:k2().func.isRequired,remove:k2().func.isRequired,onReorder:k2().func.isRequired},Y7.propTypes={label:k2().string,mandatory:k2().bool,values:k2().arrayOf(k2().shape({name:k2().string.isRequired,id:k2().string.isRequired})),onSave:k2().func,isSaving:k2().bool,isDeleting:k2().bool,onCustomFieldDelete:k2().func,onChange:k2().func,useDragAndDrop:k2().bool},J7.propTypes={attributes:k2().shape({label:k2().string.isRequired,customFieldId:k2().number.isRequired,values:k2().arrayOf(k2().shape({name:k2().string.isRequired,id:k2().string.isRequired,isChecked:k2().bool})),mandatory:k2().bool.isRequired,hideLabel:k2().bool,className:k2().string}).isRequired,setAttributes:k2().func.isRequired,clientId:k2().string.isRequired};let Z7=function(e){return e.Divider="divider",e.Spacer="spacer",e}({}),Q7=function(e){return e.Solid="solid",e.Dashed="dashed",e.Dotted="dotted",e}({});const eee={className:void 0,height:1,type:Z7.Divider,style:Q7.Solid,dividerHeight:1,dividerWidth:100,color:"black"},tee=()=>`${Math.random().toString()}-${Date.now()}`,nee=e=>e.map((e=>{const t={name:e.value,id:tee()};return(0,I2.has)(e,"is_checked")&&e.is_checked&&(t.isChecked=!0),t})),ree=(e,t,n,r=[])=>{if(!Array.isArray(r))throw new Error("Mapper expects customFields to be an array.");return o=>{if(!Array.isArray(o))throw new Error("Mapper expects form body to be an array.");return o.map((o=>{if(["column","columns"].includes(o.type))return((e,t,n,r,o=[])=>{const i=ree(t,n,r,o),s={clientId:tee(),name:`core/${e.type}`,isValid:!0,attributes:{style:{color:{}}},innerBlocks:i(e.body?e.body:[])},a=e4(n,e.params.text_color),l=e4(n,e.params.background_color),c=t4(r,e.params.gradient);return(0,I2.has)(e.params,"width")&&(s.attributes.width=Number.isNaN(Number(e.params.width))?e.params.width:`${e.params.width}%`),(0,I2.has)(e.params,"vertical_alignment")&&(s.attributes.verticalAlignment=e.params.vertical_alignment),(0,I2.has)(e.params,"text_color")&&(s.attributes.textColor=a,s.attributes.style.color.text=a?void 0:e.params.text_color),(0,I2.has)(e.params,"background_color")&&(s.attributes.backgroundColor=l,s.attributes.style.color.background=l?void 0:e.params.background_color),(0,I2.has)(e.params,"gradient")&&(s.attributes.gradient=c,s.attributes.style.color.gradient=c?void 0:e.params.gradient),(0,I2.has)(e.params,"class_name")&&e.params.class_name&&(s.attributes.className=e.params.class_name),(0,I2.has)(e.params,"padding")&&(s.attributes.style.spacing={padding:e.params.padding}),(0,I2.has)(e.params,"is_stacked_on_mobile")&&(s.attributes.isStackedOnMobile="1"===e.params.is_stacked_on_mobile),"columns"!==e.type||(0,I2.has)(e.params,"is_stacked_on_mobile")||(s.attributes.isStackedOnMobile=!0),s})(o,e,t,n,r);const i={clientId:`${o.id}_${tee()}`,isValid:!0,innerBlocks:[],attributes:{labelWithinInput:!1,mandatory:!1,className:null}};if(["heading","paragraph"].includes(o.type)&&(i.attributes.style={color:{},typography:{fontSize:void 0,lineHeight:void 0}}),o.params&&(0,I2.has)(o.params,"class_name")&&(i.attributes.className=o.params.class_name),o.params&&(0,I2.has)(o.params,"required")&&(i.attributes.mandatory=!!o.params.required),o.params&&(0,I2.has)(o.params,"label_within")&&(i.attributes.labelWithinInput=!!o.params.label_within),o.params&&(i.attributes.label=o.params.label?o.params.label:""),o.params&&(0,I2.has)(o.params,"text_color")){const e=e4(t,o.params.text_color);i.attributes.textColor=e,["heading","paragraph"].includes(o.type)&&!e?i.attributes.style.color.text=o.params.text_color:e||(i.attributes.customTextColor=o.params.text_color)}if(o.params&&(0,I2.has)(o.params,"background_color")){const e=e4(t,o.params.background_color);i.attributes.backgroundColor=e,["heading","paragraph"].includes(o.type)&&!e?i.attributes.style.color.background=o.params.background_color:e||(i.attributes.customBackgroundColor=o.params.background_color)}if(o.params&&(0,I2.has)(o.params,"gradient")){const e=t4(n,o.params.gradient);i.attributes.gradient=e,e||(i.attributes.style.color.gradient=o.params.gradient)}if((0,I2.has)(o.params,"padding")&&(i.attributes.style.spacing={padding:o.params.padding}),o.params&&(0,I2.has)(o.params,"font_size")){const t=`${o.params.font_size}${Number.isNaN(Number(`${o.params.font_size}`||NaN))?"":"px"}`,n=((e,t)=>{const n=e.find((e=>e.size===t));return n?n.slug:void 0})(e,t);i.attributes.fontSize=n,i.attributes.style.typography.fontSize=n?void 0:t}o.params&&(0,I2.has)(o.params,"line_height")&&(i.attributes.style.typography.lineHeight=o.params.line_height);let s=2;switch(o.id){case"email":return{...i,name:"mailpoet-form/email-input",attributes:{...i.attributes,styles:Q5(o.styles)}};case"heading":return o.params&&(0,I2.has)(o.params,"level")&&(s=X7(o.params.level),void 0===s&&(s=2)),{...i,attributes:{...i.attributes,content:o.params?.content||"",level:s,textAlign:o.params?.align,anchor:o.params?.anchor,className:o.params?.class_name},name:"core/heading"};case"paragraph":return{...i,attributes:{...i.attributes,content:o.params?.content||"",align:o.params?.align,className:o.params?.class_name,dropCap:"1"===o.params?.drop_cap},name:"core/paragraph"};case"image":return{...i,name:"core/image",attributes:{className:o.params?.class_name||"",align:o.params?.align,url:o.params?.url,alt:o.params?.alt,title:o.params?.title,caption:o.params?.caption,linkDestination:o.params?.link_destination,link:o.params?.link,href:o.params?.href,linkClass:o.params?.link_class,rel:o.params?.rel,linkTarget:o.params?.link_target,id:o.params?.id,sizeSlug:o.params?.size_slug,width:o.params?.width,height:o.params?.height}};case"first_name":return{...i,name:"mailpoet-form/first-name-input",attributes:{...i.attributes,styles:Q5(o.styles)}};case"last_name":return{...i,name:"mailpoet-form/last-name-input",attributes:{...i.attributes,styles:Q5(o.styles)}};case"segments":return o.params&&(0,I2.has)(o.params,"values")&&Array.isArray(o.params.values)?i.attributes.values=o.params.values.map((e=>({id:e.id,isChecked:"1"===e.is_checked||void 0}))):i.attributes.values=[],{...i,name:"mailpoet-form/segment-select"};case"submit":return{...i,name:"mailpoet-form/submit-button",attributes:{...i.attributes,styles:Q5(o.styles)}};case"divider":return delete i.attributes.label,{...i,name:"mailpoet-form/divider",attributes:{className:i.attributes.className,height:X7(o.params?.height??eee.height),type:o.params?.type??eee.type,style:o.params?.style??eee.style,dividerHeight:X7(o.params?.divider_height??eee.dividerHeight),dividerWidth:X7(o.params?.divider_width??eee.dividerWidth),color:o.params?.color??eee.color}};case"html":return{...i,name:"mailpoet-form/html",attributes:{className:i.attributes.className,content:o.params&&o.params.text?o.params.text:"",nl2br:!(!o.params||!o.params.nl2br||!o.params.nl2br)}};default:return Number.isInteger(parseInt(o.id,10))?((e,t,n)=>{const r=t.find((t=>t.id===parseInt(e.id,10)));if(!r)return null;const o={...n,name:M5({text:"mailpoet-form/custom-text",textarea:"mailpoet-form/custom-textarea",radio:"mailpoet-form/custom-radio",checkbox:"mailpoet-form/custom-checkbox",select:"mailpoet-form/custom-select",date:"mailpoet-form/custom-date"}[r.type],r)};return o.attributes.customFieldId=r.id,e.params&&((0,I2.has)(e.params,"validate")&&e.params.validate&&(o.attributes.validate=e.params.validate),(0,I2.has)(e.params,"hide_label")&&(o.attributes.hideLabel=!!e.params.hide_label),(0,I2.has)(e.params,"lines")&&(o.attributes.lines=e.params.lines),(0,I2.has)(e.params,"date_type")&&(o.attributes.dateType=e.params.date_type),(0,I2.has)(e.params,"date_format")&&(o.attributes.dateFormat=e.params.date_format),(0,I2.has)(e.params,"is_default_today")&&(o.attributes.defaultToday=!!e.params.is_default_today),(0,I2.has)(e.params,"values")&&Array.isArray(e.params.values)&&(o.attributes.values=nee(e.params.values))),"text"!==r.type&&"textarea"!==r.type||(o.attributes.styles=Q5(e.styles)),o})(o,r,i):null}})).filter(Boolean)}};function oee(e){return{title:e.name,description:"",icon:P5,category:"custom-fields",attributes:{label:{type:"string",default:e.name},hideLabel:{type:"boolean",default:!1},mandatory:{type:"boolean",default:!!e.params.required&&!!e.params.required},values:{type:"array",default:e.params.values?nee(e.params.values):[]},customFieldId:{type:"string",default:e.id}},supports:{html:!1,multiple:!1},edit:J7,save:()=>null}}function iee({label:e="",mandatory:t=!1,isSaving:n=!1,onSave:r=null,isChecked:o=!1,checkboxLabel:i="",isDeleting:s=!1,onCustomFieldDelete:a=null,onChange:l=(()=>{})}){const[c,u]=(0,S.useState)(e),[d,h]=(0,S.useState)(t),[p,f]=(0,S.useState)(o),[m,g]=(0,S.useState)(i),b=d!==t||p!==o||c!==e||m!==i,y=(0,S.useMemo)((()=>({mandatory:d,isChecked:p,label:c,checkboxLabel:m,isValid:!(0,I2.isEmpty)(m)})),[c,d,p,m]);return(0,S.useEffect)((()=>{l(y,b)}),[y,l,b]),(0,Td.jsxs)("div",{className:"custom-field-settings",children:[(0,Td.jsx)(KE.A,{label:_2.U.I18n.t("label"),value:c,"data-automation-id":"settings_custom_text_label_input",onChange:u}),(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("blockMandatory"),checked:d,onChange:h}),(0,Td.jsxs)($_.Ay,{children:[(0,Td.jsx)("input",{type:"checkbox",checked:p,onChange:e=>f(!!e.target.checked)}),(0,Td.jsx)("input",{value:m,"data-automation-id":"settings_custom_checkbox_value",type:"text",onChange:e=>g(e.target.value)})]}),r?(0,Td.jsx)(Zv.Ay,{variant:"primary",onClick:()=>r(y),isBusy:n,disabled:n||!b,className:"button-on-top","data-automation-id":"custom_field_save",children:_2.U.I18n.t("customFieldSaveCTA")}):null,a?(0,Td.jsx)(z5,{isBusy:n||s,onDelete:a}):null]})}function see({attributes:e,setAttributes:t,clientId:n}){const r=(0,Ul.A)((e=>e(A2).getIsCustomFieldSaving()),[]),o=(0,Ul.A)((e=>e(A2).getIsCustomFieldDeleting()),[]),{saveCustomField:i,deleteCustomField:s,customFieldEdited:a}=(0,Vl.A)(A2),l=()=>{if(Array.isArray(e.values)){const t=e.values[0];if(t)return t.name}return""},c=()=>{let t=!1;if(Array.isArray(e.values)){const n=e.values[0];n&&n.isChecked&&(t=!0)}return t},u=(0,Td.jsxs)(IA,{children:[(0,Td.jsx)(F5.A,{children:(0,Td.jsx)(aF.Ay,{title:_2.U.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,Td.jsx)(iee,{label:e.label,mandatory:e.mandatory,isSaving:r,isChecked:c(),checkboxLabel:l(),onSave:n=>i({customFieldId:e.customFieldId,data:{params:K5("checkbox",n)},onFinish:()=>t({mandatory:n.mandatory,label:n.label,values:[{isChecked:n.isChecked,name:n.checkboxLabel}]})}),onCustomFieldDelete:()=>s(e.customFieldId,n),isDeleting:o,onChange:(e,t)=>t&&a()})})}),(0,Td.jsx)(F5.A,{children:(0,Td.jsx)(aF.Ay,{title:_2.U.I18n.t("formSettings"),initialOpen:!0,children:(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("displayLabel"),checked:!e.hideLabel,onChange:e=>t({hideLabel:!e})})})})]});let d=l();return e.mandatory&&(d+=" *"),(0,Td.jsxs)(q5,{className:e.className,children:[u,(0,Td.jsx)("span",{className:"mailpoet_checkbox_label","data-automation-id":"editor_custom_field_checkbox_block",children:e.hideLabel||!e.label?null:e.label}),(0,Td.jsx)("div",{children:(0,Td.jsxs)("label",{children:[(0,Td.jsx)("input",{type:"checkbox",disabled:!0,checked:c(),className:"mailpoet_checkbox"}),(0,Td.jsx)("span",{dangerouslySetInnerHTML:{__html:d}})]})})]})}function aee(e){return{title:e.name,description:"",icon:P5,category:"custom-fields",attributes:{label:{type:"string",default:e.name},hideLabel:{type:"boolean",default:!1},values:{type:"array",default:e.params.values?nee(e.params.values):[]},mandatory:{type:"boolean",default:!!e.params.required&&!!e.params.required},customFieldId:{type:"string",default:e.id}},supports:{html:!1,multiple:!1},edit:see,save:()=>null}}function lee({attributes:e,setAttributes:t,clientId:n}){const r=(0,Ul.A)((e=>e(A2).getFormSettings()),[]),o=(0,Ul.A)((e=>e(A2).getIsCustomFieldSaving()),[]),i=(0,Ul.A)((e=>e(A2).getIsCustomFieldDeleting()),[]),{saveCustomField:s,deleteCustomField:a,customFieldEdited:l}=(0,Vl.A)(A2),c=(0,Td.jsxs)(IA,{children:[(0,Td.jsx)(F5.A,{children:(0,Td.jsx)(aF.Ay,{title:_2.U.I18n.t("customFieldSettings"),initialOpen:!0,children:(0,Td.jsx)(Y7,{label:e.label,mandatory:e.mandatory,values:e.values,isSaving:o,onSave:n=>s({customFieldId:e.customFieldId,data:{params:K5("select",n)},onFinish:()=>t({mandatory:n.mandatory,values:n.values,label:n.label})}),onCustomFieldDelete:()=>a(e.customFieldId,n),isDeleting:i,onChange:(e,t)=>t&&l()})})}),(0,Td.jsx)(F5.A,{children:(0,Td.jsx)(aF.Ay,{title:_2.U.I18n.t("formSettings"),initialOpen:!0,children:(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("displayLabelWithinInput"),checked:e.labelWithinInput,onChange:e=>t({labelWithinInput:e})})})})]});return(0,Td.jsxs)(q5,{className:e.className,children:[c,(0,Td.jsxs)("div",{className:"mailpoet_custom_select","data-automation-id":"custom_select_block",children:[e.labelWithinInput?null:(0,Td.jsx)("label",{className:"mailpoet_select_label",htmlFor:n,children:V5(e)}),(()=>{let t=e.labelWithinInput?V5(e):"-";const o=[{label:t}];!Array.isArray(e.values)&&e.values.length||e.values.forEach((n=>{o.push({label:n.name}),!e.labelWithinInput&&n.isChecked&&(t=n.name)}));const i={};return void 0!==r.inputPadding&&(i.padding=r.inputPadding),void 0!==r.alignment&&(i.textAlign=r.alignment,i.margin=g4(i.textAlign)),r.fontFamily&&(i.fontFamily=r.fontFamily),(0,Td.jsx)("select",{style:i,className:"mailpoet_select",id:n,value:t,readOnly:!0,children:o.map(((e,t)=>(0,Td.jsx)("option",{value:e.label,disabled:0===t,children:e.label},e.label)))})})()]})]})}function cee(e){return{title:e.name,description:"",icon:P5,category:"custom-fields",attributes:{label:{type:"string",default:e.name},labelWithinInput:{type:"boolean",default:!0},mandatory:{type:"boolean",default:!!e.params.required&&!!e.params.required},values:{type:"array",default:e.params.values?nee(e.params.values):[]},customFieldId:{type:"string",default:e.id}},supports:{html:!1,multiple:!1},edit:lee,save:()=>null}}function uee(e){return{date:{name:"mailpoet-form/custom-date",settings:J5(e)},text:{name:"mailpoet-form/custom-text",settings:v4(e)},textarea:{name:"mailpoet-form/custom-textarea",settings:x4(e)},radio:{name:"mailpoet-form/custom-radio",settings:oee(e)},checkbox:{name:"mailpoet-form/custom-checkbox",settings:aee(e)},select:{name:"mailpoet-form/custom-select",settings:cee(e)}}}iee.propTypes={label:k2().string,mandatory:k2().bool,onSave:k2().func,isSaving:k2().bool,isChecked:k2().bool,checkboxLabel:k2().string,isDeleting:k2().bool,onCustomFieldDelete:k2().func,onChange:k2().func},see.propTypes={attributes:k2().shape({label:k2().string.isRequired,customFieldId:k2().number.isRequired,mandatory:k2().bool.isRequired,hideLabel:k2().bool,className:k2().string,values:k2().arrayOf(k2().shape({name:k2().string.isRequired,isChecked:k2().bool}))}).isRequired,setAttributes:k2().func.isRequired,clientId:k2().string.isRequired},lee.propTypes={attributes:k2().shape({customFieldId:k2().number.isRequired,labelWithinInput:k2().bool.isRequired,label:k2().string.isRequired,values:k2().arrayOf(k2().shape({name:k2().string.isRequired,isChecked:k2().bool,id:k2().string.isRequired})),mandatory:k2().bool.isRequired,className:k2().string}).isRequired,setAttributes:k2().func.isRequired,clientId:k2().string.isRequired};const dee=(0,Td.jsxs)(pw.t4,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,Td.jsx)(pw.wA,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,Td.jsx)(pw.wA,{d:"M19 13H5v-2h14v2z"})]}),hee={title:_2.U.I18n.t("blockDivider"),description:null,icon:dee,category:"design",attributes:{height:{type:"number",default:eee.height},type:{type:"string",default:eee.type},style:{type:"string",default:eee.style},dividerHeight:{type:"number",default:eee.dividerHeight},dividerWidth:{type:"number",default:eee.dividerWidth},color:{type:"string",default:eee.color}},supports:{html:!1,multiple:!0},edit:function({attributes:e,setAttributes:t}){const n=e.dividerHeight??eee.dividerHeight,r=e.dividerWidth??eee.dividerWidth,o=e.height??eee.height,i=(0,Td.jsxs)("div",{className:"mailpoet-styles-settings",children:[(0,Td.jsx)(_T.A,{label:_2.U.I18n.t("blockDividerStyle"),"data-automation-id":"settings_divider_style",value:e.style,onChange:e=>t({style:e}),options:[{value:Q7.Solid,label:_2.U.I18n.t("blockDividerStyleSolid")},{value:Q7.Dashed,label:_2.U.I18n.t("blockDividerStyleDashed")},{value:Q7.Dotted,label:_2.U.I18n.t("blockDividerStyleDotted")}]}),(0,Td.jsx)(FC,{label:_2.U.I18n.t("blockDividerDividerHeight"),className:"mailpoet-automation-styles-divider-height",value:n,min:1,max:40,allowReset:!0,onChange:e=>{let n=o;void 0!==e&&(n=Math.max(e,o)),t({dividerHeight:e,height:n})}}),(0,Td.jsx)(FC,{label:_2.U.I18n.t("blockDividerDividerWidth"),className:"mailpoet-automation-styles-divider-width",value:r,min:1,max:100,allowReset:!0,onChange:e=>t({dividerWidth:e})}),(0,Td.jsx)(h4,{title:_2.U.I18n.t("formSettingsColor"),settings:[{label:_2.U.I18n.t("blockDividerBackground"),colorValue:e.color,onColorChange:e=>t({color:e})}]})]}),s={};return e.type===Z7.Divider&&(s.borderTopStyle=e.style,s.borderTopWidth=n,s.borderTopColor=e.color,s.height=n,s.width=`${r}%`),(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(IA,{children:(0,Td.jsx)(F5.A,{children:(0,Td.jsxs)(aF.Ay,{title:_2.U.I18n.t("formSettingsStyles"),initialOpen:!0,children:[(0,Td.jsx)(FC,{label:_2.U.I18n.t("blockSpacerHeight"),className:"mailpoet-automation-spacer-height-size",value:o,min:1,max:400,allowReset:!0,onChange:e=>{let r=n;r=void 0!==e?Math.min(e,n):1,t({height:e,dividerHeight:r})}}),(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("blockSpacerEnableDivider"),className:"mailpoet-automation-divider-togle-enable",checked:e.type===Z7.Divider,onChange:e=>t({type:e?Z7.Divider:Z7.Spacer})}),e.type===Z7.Divider&&i]})})}),(0,Td.jsx)("div",{className:B()("mailpoet_spacer",e.className),"data-automation-id":"editor_spacer_block",style:{height:o,display:"flex",flexDirection:"column",alignItems:"center",width:"100%",justifyContent:"center"},children:(0,Td.jsx)("div",{className:"mailpoet_divider","data-automation-id":"editor_divider_block",style:s})})]})},save:()=>null};function pee({attributes:e,setAttributes:t}){const n=(0,Td.jsxs)(IA,{children:[(0,Td.jsx)(F5.A,{children:(0,Td.jsxs)(aF.Ay,{title:_2.U.I18n.t("formSettings"),initialOpen:!0,children:[(0,Td.jsx)(KE.A,{label:_2.U.I18n.t("label"),value:e.label,"data-automation-id":"settings_email_label_input",onChange:e=>t({label:e})}),(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("displayLabelWithinInput"),checked:e.labelWithinInput,onChange:e=>t({labelWithinInput:e})})]})}),(0,Td.jsx)(p4,{styles:e.styles,onChange:e=>t({styles:e})})]});return(0,Td.jsxs)(Td.Fragment,{children:[n,(0,Td.jsx)(b4,{className:e.className,name:"email",label:e.label,labelWithinInput:!!e.labelWithinInput,mandatory:!0,styles:e.styles})]})}pee.propTypes={attributes:k2().shape({label:k2().string.isRequired,labelWithinInput:k2().bool.isRequired,className:k2().string,styles:f4.isRequired}).isRequired,setAttributes:k2().func.isRequired};const fee=(0,Td.jsxs)(pw.t4,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,Td.jsx)(pw.wA,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,Td.jsx)(pw.G,{children:(0,Td.jsx)(pw.wA,{fill:"#32373C",d:"m18.82592,6.5l-14,0c-0.8,0 -1.5,0.7 -1.5,1.5l0,8c0,0.8 0.7,1.5 1.5,1.5l14,0c0.8,0 1.5,-0.7 1.5,-1.5l0,-8c0,-0.8 -0.7,-1.5 -1.5,-1.5zm-1.2,1l-5.8,4.9l-5.8,-4.9l11.6,0zm1.7,8.5c0,0.3 -0.2,0.5 -0.5,0.5l-14,0c-0.3,0 -0.5,-0.2 -0.5,-0.5l0,-8c0,-0.2 0.1,-0.4 0.3,-0.4l6.9,5.9c0.1,0.1 0.2,0.1 0.3,0.1s0.2,0 0.3,-0.1l6.9,-5.9c0.2,0.1 0.3,0.2 0.3,0.4l0,8z"})})]}),mee={title:_2.U.I18n.t("blockEmail"),description:_2.U.I18n.t("blockEmailDescription"),icon:fee,category:"obligatory",attributes:{label:{type:"string",default:_2.U.I18n.t("blockEmail")},labelWithinInput:{type:"boolean",default:!0},styles:{type:"object",default:X5}},supports:{html:!1,inserter:!1,multiple:!1},edit:pee,save:()=>null};function gee({value:e,onChange:t}){const[n]=fv("typography.fontSizes");return(0,Td.jsx)(QD,{value:e,onChange:t,fontSizes:n,__nextHasNoMarginBottom:!0})}const bee=["Arial","Comic Sans MS","Courier New","Georgia","Lucida","Tahoma","Times New Roman","Trebuchet MS","Verdana"];function yee({onChange:e,value:t,name:n,hideLabelFromVision:r=!1}){const o=(0,Ul.A)((e=>e(A2).getAllCustomFonts()),[]),i={color:"lightgray",backgroundColor:"white",cursor:"default"},s=e=>({fontFamily:e,cursor:"default",marginLeft:16}),a=[{key:_2.U.I18n.t("formFontsDefaultTheme"),name:_2.U.I18n.t("formFontsDefaultTheme"),selectable:!0,value:""},{key:_2.U.I18n.t("formFontsStandard"),name:_2.U.I18n.t("formFontsStandard"),selectable:!1,style:i},...bee.map((e=>({key:e,name:e,selectable:!0,style:s(e),value:e})))];_2.U.libs3rdPartyEnabled&&(a.push({key:_2.U.I18n.t("formFontsCustom"),name:_2.U.I18n.t("formFontsCustom"),selectable:!1,style:i}),o.forEach((e=>{a.push({key:e,name:e,selectable:!0,style:s(e),value:e})})));let l=void 0!==t&&a.find((e=>e.value===t));return l||(l=a[0]),(0,Td.jsx)($D.G,{__nextUnconstrainedWidth:!0,options:a,onChange:t=>{const n=t.selectedItem;n.selectable&&e(n.value)},value:l,label:n,className:"mailpoet-font-family-select",hideLabelFromVision:r})}function vee(){const e=(0,Ul.A)((e=>e(A2).getAllCustomFonts()),[]);if(!_2.U.libs3rdPartyEnabled)return null;const t=e.map((e=>e.replace(" ","+"))).map((e=>e.concat(":400,400i,700,700i"))).join("|");return(0,Td.jsx)("link",{rel:"stylesheet",href:`https://fonts.googleapis.com/css?family=${t}`})}function _ee({styles:e,onChange:t,formInputPadding:n,formFontFamily:r}){const o=(0,S.useRef)(e),i=o.current,s=(e,n)=>{const r={...o.current};r[e]=n,t(r),o.current=r};return(0,Td.jsx)(F5.A,{className:"mailpoet-automation-input-styles-panel",children:(0,Td.jsx)(aF.Ay,{title:_2.U.I18n.t("formSettingsStyles"),initialOpen:!1,children:(0,Td.jsxs)("div",{className:"mailpoet-styles-settings","data-automation-id":"input_styles_settings",children:[(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("formSettingsDisplayFullWidth"),checked:i.fullWidth,onChange:(0,I2.partial)(s,"fullWidth")}),(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("formSettingsInheritStyleFromTheme"),checked:i.inheritFromTheme,onChange:e=>{if(e)return void s("inheritFromTheme",e);const r={...o.current};r.backgroundColor="#eeeeee",r.bold=!1,r.borderRadius=0,r.borderSize=1,r.borderColor="#313131",r.fontColor="#313131",r.fontSize=void 0,r.padding=n,r.inheritFromTheme=e,t(r),o.current=r},className:"mailpoet-automation-inherit-theme-toggle"}),i.inheritFromTheme?null:(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(h4,{title:_2.U.I18n.t("formSettingsColor"),settings:[{label:_2.U.I18n.t("formSettingsStylesBackground"),colorValue:e.backgroundColor,gradientValue:e.gradient,onColorChange:(0,I2.partial)(s,"backgroundColor"),onGradientChange:(0,I2.partial)(s,"gradient")},{label:_2.U.I18n.t("formSettingsStylesFont"),colorValue:e.fontColor,onColorChange:(0,I2.partial)(s,"fontColor")},{label:_2.U.I18n.t("formSettingsBorder"),colorValue:i.borderColor,onColorChange:(0,I2.partial)(s,"borderColor")}]}),(0,Td.jsx)(gee,{value:e.fontSize,onChange:(0,I2.partial)(s,"fontSize")}),(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("formSettingsBold"),checked:i.bold||!1,onChange:(0,I2.partial)(s,"bold"),className:"mailpoet-automation-styles-bold-toggle"}),(0,Td.jsx)(yee,{name:_2.U.I18n.t("formSettingsStylesFontFamily"),value:e.fontFamily||r,onChange:(0,I2.partial)(s,"fontFamily")}),(0,Td.jsx)(FC,{label:_2.U.I18n.t("formSettingsInputPadding"),value:void 0!==i.padding?i.padding:n,min:0,max:30,allowReset:!0,onChange:(0,I2.partial)(s,"padding")}),(0,Td.jsx)(FC,{label:_2.U.I18n.t("formSettingsBorderSize"),value:void 0!==i.borderSize?i.borderSize:1,min:0,max:10,allowReset:!0,onChange:(0,I2.partial)(s,"borderSize"),className:"mailpoet-automation-styles-border-size"}),(0,Td.jsx)(FC,{label:_2.U.I18n.t("formSettingsBorderRadius"),value:void 0!==i.borderRadius?i.borderRadius:0,min:0,max:40,allowReset:!0,onChange:(0,I2.partial)(s,"borderRadius")})]})]})})})}const xee=(0,Td.jsxs)(pw.t4,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,Td.jsx)(pw.wA,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,Td.jsx)(pw.G,{children:(0,Td.jsx)(pw.wA,{d:"M19 6H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H5V8h14v8z"})})]}),wee={title:_2.U.I18n.t("blockSubmit"),description:_2.U.I18n.t("blockSubmitDescription"),icon:xee,category:"obligatory",attributes:{label:{type:"string",default:_2.U.I18n.t("blockSubmitLabel")},styles:{type:"object",default:{fullWidth:!0,inheritFromTheme:!0}}},supports:{html:!1,inserter:!1,multiple:!1},edit:function({attributes:e,setAttributes:t}){const n=(0,Ul.A)((e=>e(A2).getFormSettings()),[]),r=(0,Td.jsxs)(IA,{children:[(0,Td.jsx)(F5.A,{children:(0,Td.jsx)(aF.Ay,{title:_2.U.I18n.t("formSettings"),initialOpen:!0,children:(0,Td.jsx)(KE.A,{label:_2.U.I18n.t("label"),value:e.label,onChange:e=>t({label:e}),"data-automation-id":"settings_submit_label_input"})})}),(0,Td.jsx)(_ee,{onChange:e=>t({styles:e}),styles:e.styles,formInputPadding:n.inputPadding,formFontFamily:n.fontFamily})]}),o="number"==typeof e.styles.fontSize?`${e.styles.fontSize}px`:e.styles.fontSize,i=e.styles.inheritFromTheme?{}:{fontWeight:e.styles.bold?"bold":"inherit",borderRadius:void 0!==e.styles.borderRadius?`${e.styles.borderRadius}px`:0,borderWidth:void 0!==e.styles.borderSize?`${e.styles.borderSize}px`:"1px",borderColor:e.styles.borderColor||"transparent",borderStyle:"solid",fontSize:o||"inherit",color:e.styles.fontColor||"inherit"};e.styles.fullWidth&&(i.width="100%"),void 0===e.styles.padding||e.styles.inheritFromTheme?void 0!==n.inputPadding&&(i.padding=n.inputPadding):i.padding=e.styles.padding,e.styles.backgroundColor&&!e.styles.inheritFromTheme&&(i.backgroundColor=e.styles.backgroundColor),e.styles.backgroundColor&&!e.styles.inheritFromTheme&&(i.backgroundColor=e.styles.backgroundColor),e.styles.gradient&&!e.styles.inheritFromTheme&&(i.backgroundColor=void 0,i.background=e.styles.gradient),e.styles.fontFamily&&!e.styles.inheritFromTheme&&(i.fontFamily=e.styles.fontFamily);const s=B()("mailpoet_submit",{button:e.styles.inheritFromTheme});return(0,Td.jsxs)(q5,{className:e.className,children:[r,(0,Td.jsx)("input",{className:s,type:"submit",value:e.label,"data-automation-id":"editor_submit_input",style:i})]})},save:()=>null},kee=(0,Td.jsxs)(pw.t4,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,Td.jsx)(pw.wA,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,Td.jsx)(pw.G,{children:(0,Td.jsx)(pw.wA,{d:"M19 6H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H5V8h14v8z"})})]});function Cee({attributes:e,setAttributes:t}){const n=(0,Td.jsxs)(IA,{children:[(0,Td.jsx)(F5.A,{children:(0,Td.jsxs)(aF.Ay,{title:_2.U.I18n.t("formSettings"),initialOpen:!0,children:[(0,Td.jsx)(KE.A,{label:_2.U.I18n.t("label"),value:e.label,"data-automation-id":"settings_first_name_label_input",onChange:e=>t({label:e})}),(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("displayLabelWithinInput"),checked:e.labelWithinInput,onChange:e=>t({labelWithinInput:e}),className:"mailpoet-automation-label-within-input-toggle"}),(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("blockMandatory"),checked:e.mandatory,onChange:e=>t({mandatory:e})})]})}),(0,Td.jsx)(p4,{styles:e.styles,onChange:e=>t({styles:e})})]});return(0,Td.jsxs)(Td.Fragment,{children:[n,(0,Td.jsx)(b4,{className:e.className,name:"first_name",mandatory:e.mandatory,labelWithinInput:e.labelWithinInput,label:e.label,styles:e.styles})]})}Cee.propTypes={attributes:k2().shape({label:k2().string.isRequired,labelWithinInput:k2().bool.isRequired,mandatory:k2().bool.isRequired,className:k2().string,styles:f4.isRequired}).isRequired,setAttributes:k2().func.isRequired};const See={title:_2.U.I18n.t("blockFirstName"),description:_2.U.I18n.t("blockFirstNameDescription"),icon:kee,category:"fields",attributes:{label:{type:"string",default:_2.U.I18n.t("blockFirstName")},labelWithinInput:{type:"boolean",default:!0},mandatory:{type:"boolean",default:!1},styles:{type:"object",default:X5}},supports:{html:!1,multiple:!1},edit:Cee,save:()=>null},Aee=(0,Td.jsxs)(pw.t4,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,Td.jsx)(pw.wA,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,Td.jsx)(pw.G,{children:(0,Td.jsx)(pw.wA,{d:"M19 6H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 10H5V8h14v8z"})})]});function Eee({attributes:e,setAttributes:t}){const n=(0,Td.jsxs)(IA,{children:[(0,Td.jsx)(F5.A,{children:(0,Td.jsxs)(aF.Ay,{title:_2.U.I18n.t("formSettings"),initialOpen:!0,children:[(0,Td.jsx)(KE.A,{label:_2.U.I18n.t("label"),value:e.label,"data-automation-id":"settings_last_name_label_input",onChange:e=>t({label:e})}),(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("displayLabelWithinInput"),checked:e.labelWithinInput,onChange:e=>t({labelWithinInput:e})}),(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("blockMandatory"),checked:e.mandatory,onChange:e=>t({mandatory:e})})]})}),(0,Td.jsx)(p4,{styles:e.styles,onChange:e=>t({styles:e})})]});return(0,Td.jsxs)(Td.Fragment,{children:[n,(0,Td.jsx)(b4,{className:e.className,name:"last_name",mandatory:e.mandatory,labelWithinInput:e.labelWithinInput,label:e.label,styles:e.styles})]})}Eee.propTypes={attributes:k2().shape({label:k2().string.isRequired,labelWithinInput:k2().bool.isRequired,mandatory:k2().bool.isRequired,className:k2().string,styles:f4.isRequired}).isRequired,setAttributes:k2().func.isRequired};const Iee={title:_2.U.I18n.t("blockLastName"),description:_2.U.I18n.t("blockLastNameDescription"),icon:Aee,category:"fields",attributes:{label:{type:"string",default:_2.U.I18n.t("blockLastName")},labelWithinInput:{type:"boolean",default:!0},mandatory:{type:"boolean",default:!1},styles:{type:"object",default:X5}},supports:{html:!1,multiple:!1},edit:Eee,save:()=>null},jee=(0,Td.jsx)(pw.t4,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Td.jsx)(pw.G,{children:(0,Td.jsx)(pw.wA,{d:"M9 19h12v-2H9v2zm0-6h12v-2H9v2zm0-8v2h12V5H9zm-4-.5c-.828 0-1.5.672-1.5 1.5S4.172 7.5 5 7.5 6.5 6.828 6.5 6 5.828 4.5 5 4.5zm0 6c-.828 0-1.5.672-1.5 1.5s.672 1.5 1.5 1.5 1.5-.672 1.5-1.5-.672-1.5-1.5-1.5zm0 6c-.828 0-1.5.672-1.5 1.5s.672 1.5 1.5 1.5 1.5-.672 1.5-1.5-.672-1.5-1.5-1.5z"})})});var Tee=n(64214);function Bee({segment:e,removeSegment:t,onCheck:n}){return(0,Td.jsxs)("div",{className:"mailpoet-form-segments-settings-list",children:[(0,Td.jsx)(ij.A,{label:e.name,defaultChecked:!!e.isChecked,onChange:(0,I2.partial)(n,e.id)},`check-${e.id}`),(0,Td.jsx)(w4.A,{icon:"no-alt",color:"#900",className:"mailpoet-form-segments-segment-remove",onClick:(0,I2.partial)(t,e.id)})]},e.id)}function Ree({segments:e,updateSegment:t,removeSegment:n,onSegmentsReorder:r}){const[o,i]=(0,S.useState)(e);if((0,S.useEffect)((()=>{i(e)}),[e]),0===o.length)return null;const s=(e,n)=>{const r=o.find((t=>t.id===e));r.isChecked=n,t(r)};return(0,Td.jsx)(h7,{onDragEnd:e=>{const t=e.source.index,n=e.destination.index,s=[...o],[a]=s.splice(t,1);s.splice(n,0,a),i(s),r(s)},children:(0,Td.jsx)(W7,{droppableId:"droppable",children:e=>(0,Td.jsxs)("div",{...e.droppableProps,ref:e.innerRef,children:[o.map(((e,t)=>(0,Td.jsx)(U7,{draggableId:e.id,index:t,children:r=>(0,Td.jsx)("div",{ref:r.innerRef,...r.draggableProps,...r.dragHandleProps,children:(0,Td.jsx)(Bee,{index:t,segment:e,onCheck:s,removeSegment:n},e.id)})},e.id))),e.placeholder]})})})}Bee.propTypes={segment:k2().shape({name:k2().string.isRequired,isChecked:k2().bool,id:k2().string.isRequired}).isRequired,onCheck:k2().func.isRequired,removeSegment:k2().func.isRequired},Ree.propTypes={segments:k2().arrayOf(k2().shape({name:k2().string.isRequired,isChecked:k2().bool,id:k2().string.isRequired}).isRequired).isRequired,updateSegment:k2().func.isRequired,removeSegment:k2().func.isRequired,onSegmentsReorder:k2().func.isRequired};const Nee=(e,t)=>e.find((e=>e.id===t));function Dee({label:e,onLabelChanged:t,segmentsAddedIntoSelection:n,addSegmentIntoSelection:r,setNewSelection:o}){const i=(0,Ul.A)((e=>e(A2).getAllAvailableSegments()),[]),s=i.map((e=>({label:e.name,value:e.id}))).filter((e=>!Nee(n,e.value)));return(0,Td.jsx)(IA,{children:(0,Td.jsx)(F5.A,{children:(0,Td.jsxs)(aF.Ay,{title:_2.U.I18n.t("formSettings"),initialOpen:!0,children:[(0,Td.jsx)(Tee.A,{children:(0,Td.jsx)(KE.A,{label:_2.U.I18n.t("label"),value:e,"data-automation-id":"settings_first_name_label_input",onChange:t})}),(0,Td.jsx)(Tee.A,{children:s.length?(0,Td.jsx)(_T.A,{label:`${_2.U.I18n.t("blockSegmentSelectListLabel")}:`,"data-automation-id":"select_list_selections_list",options:[{label:_2.U.I18n.t("settingsPleaseSelectList"),value:null},...s],onChange:e=>{const t=Nee(i,e);r({name:t.name,isChecked:!1,id:e})}}):null}),(0,Td.jsx)(Ree,{segments:n,updateSegment:e=>{o(n.map((t=>e.id!==t?t:e)))},removeSegment:e=>{o(n.filter((t=>e!==t.id)))},onSegmentsReorder:o})]})})})}function Mee({attributes:e,setAttributes:t}){const n=(0,Ul.A)((e=>e(A2).getAllAvailableSegments()),[]),r=(0,S.useMemo)((()=>e.values.map((e=>{const t={...e},r=n.find((t=>parseInt(t.id,10)===parseInt(e.id,10)));return t.name=r?r.name:"",t}))),[e.values,n]),o=e=>e.map((e=>{const t={...e};return delete t.name,t}));return(0,Td.jsxs)(q5,{className:e.className,children:[(0,Td.jsx)(Dee,{label:e.label,onLabelChanged:e=>t({label:e}),segmentsAddedIntoSelection:r,setNewSelection:e=>t({values:o(e)}),addSegmentIntoSelection:n=>t({values:o([...e.values,n])})}),(0,Td.jsx)("span",{className:"mailpoet_segment_label","data-automation-id":"mailpoet_list_selection_block",children:e.label}),0===e.values.length?(0,Td.jsx)("p",{className:"mailpoet_error",children:_2.U.I18n.t("blockSegmentSelectNoLists")}):r.map((e=>(0,Td.jsxs)("label",{className:"mailpoet_checkbox_label",children:[(0,Td.jsx)("input",{type:"checkbox",disabled:!0,checked:!!e.isChecked,className:"mailpoet_checkbox"},e.id),e.name]},e.id)))]})}Dee.propTypes={label:k2().string.isRequired,onLabelChanged:k2().func.isRequired,addSegmentIntoSelection:k2().func.isRequired,setNewSelection:k2().func.isRequired,segmentsAddedIntoSelection:k2().arrayOf(k2().shape({name:k2().string.isRequired,isChecked:k2().bool,id:k2().string.isRequired}).isRequired).isRequired},Mee.propTypes={attributes:k2().shape({label:k2().string.isRequired,className:k2().string,values:k2().arrayOf(k2().shape({isChecked:k2().bool,id:k2().string.isRequired})).isRequired}).isRequired,setAttributes:k2().func.isRequired};const Pee={title:_2.U.I18n.t("blockSegmentSelect"),description:_2.U.I18n.t("blockLastNameDescription"),icon:jee,category:"fields",attributes:{label:{type:"string",default:_2.U.I18n.t("blockSegmentSelectLabel")},values:{type:"array",default:[]}},supports:{html:!1,multiple:!1},edit:Mee,save:()=>null},Oee=(0,Td.jsx)(pw.t4,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Td.jsx)(pw.wA,{d:"M4.5,11h-2V9H1v6h1.5v-2.5h2V15H6V9H4.5V11z M7,10.5h1.5V15H10v-4.5h1.5V9H7V10.5z M14.5,10l-1-1H12v6h1.5v-3.9  l1,1l1-1V15H17V9h-1.5L14.5,10z M19.5,13.5V9H18v6h5v-1.5H19.5z"})});var Lee=n(12596);const Fee=function(){const{MutationObserver:e}=window;function t(){const e=document.body.getBoundingClientRect();window.parent.postMessage({action:"resize",width:e.width,height:e.height},"*")}function n(e){e.style&&["width","height","minHeight","maxHeight"].forEach((function(t){/^\\d+(vw|vh|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)$/.test(e.style[t])&&(e.style[t]="")}))}e&&document.body&&window.parent&&(new e(t).observe(document.body,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),window.addEventListener("load",t,!0),Array.prototype.forEach.call(document.querySelectorAll("[style]"),n),Array.prototype.forEach.call(document.styleSheets,(function(e){Array.prototype.forEach.call(e.cssRules||e.rules,n)})),document.body.style.position="absolute",document.body.style.width="100%",document.body.setAttribute("data-resizable-iframe-connected",""),t(),window.addEventListener("resize",t,!0))},zee=function({html:e="",title:t="",type:n,styles:r=[],scripts:o=[],onFocus:i,tabIndex:s}){const a=(0,S.useRef)(),[l,c]=(0,S.useState)(0),[u,d]=(0,S.useState)(0);function h(i=!1){if(!function(){try{return!!a.current?.contentDocument?.body}catch(e){return!1}}())return;const{contentDocument:s,ownerDocument:l}=a.current;if(!i&&null!==s?.body.getAttribute("data-resizable-iframe-connected"))return;const c=(0,Td.jsxs)("html",{lang:l.documentElement.lang,className:n,children:[(0,Td.jsxs)("head",{children:[(0,Td.jsx)("title",{children:t}),(0,Td.jsx)("style",{dangerouslySetInnerHTML:{__html:"\n\tbody {\n\t\tmargin: 0;\n\t}\n\thtml,\n\tbody,\n\tbody > div {\n\t\twidth: 100%;\n\t}\n\thtml.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio > div,\n\tbody.wp-has-aspect-ratio > div iframe {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\toverflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */\n\t}\n\tbody > div > * {\n\t\tmargin-top: 0 !important; /* Has to have !important to override inline styles. */\n\t\tmargin-bottom: 0 !important;\n\t}\n"}}),r.map(((e,t)=>(0,Td.jsx)("style",{dangerouslySetInnerHTML:{__html:e}},t)))]}),(0,Td.jsxs)("body",{"data-resizable-iframe-connected":"data-resizable-iframe-connected",className:n,children:[(0,Td.jsx)("div",{dangerouslySetInnerHTML:{__html:e}}),(0,Td.jsx)("script",{type:"text/javascript",dangerouslySetInnerHTML:{__html:`(${Fee.toString()})();`}}),o.map((e=>(0,Td.jsx)("script",{src:e},e)))]})]});s.open(),s.write("<!DOCTYPE html>"+(0,Ed.Ay)(c)),s.close()}return(0,S.useEffect)((()=>{function e(){h(!1)}function t(e){const t=a.current;if(!t||t.contentWindow!==e.source)return;let n=e.data||{};if("string"==typeof n)try{n=JSON.parse(n)}catch(e){}"resize"===n.action&&(c(n.width),d(n.height))}h();const n=a.current,r=n?.ownerDocument?.defaultView;return n?.addEventListener("load",e,!1),r?.addEventListener("message",t),()=>{n?.removeEventListener("load",e,!1),r?.removeEventListener("message",t)}}),[]),(0,S.useEffect)((()=>{h()}),[t,r,o]),(0,S.useEffect)((()=>{h(!0)}),[e,n]),(0,Td.jsx)("iframe",{ref:(0,eC.A)([a,(0,Lee.A)()]),title:t,tabIndex:s,className:"components-sandbox",sandbox:"allow-scripts allow-same-origin allow-presentation",onFocus:i,width:Math.ceil(l),height:Math.ceil(u)})};function Uee({attributes:e,setAttributes:t,clientId:n}){const r=function(e){(0,q.default)("wp.blockEditor.useSetting",{since:"6.5",alternative:"wp.blockEditor.useSettings",note:"The new useSettings function can retrieve multiple settings at once, with better performance."});const[t]=fv("color.palette");return t}(),{fontColor:o,fontSize:i,alignment:s,fontFamily:a}=(0,Ul.A)((e=>{const t=e(A2).getFormSettings(),o=T2(r,e(A2).getClosestParentAttribute(n,"backgroundColor"),e(A2).getClosestParentAttribute(n,"customBackgroundColor")),i=T2(r,e(A2).getClosestParentAttribute(n,"textColor"),e(A2).getClosestParentAttribute(n,"customTextColor"));return{backgroundColor:o||t.backgroundColor,fontColor:i||t.fontColor,fontSize:t.fontSize,alignment:t.alignment,fontFamily:t.fontFamily}}),[]),[l,c]=(0,S.useState)(e.content),u=(0,S.useCallback)((0,I2.debounce)((e=>{c(e)}),300),[]),d=(0,Td.jsx)(IA,{children:(0,Td.jsx)(F5.A,{children:(0,Td.jsxs)(aF.Ay,{title:_2.U.I18n.t("formSettings"),initialOpen:!0,children:[(0,Td.jsx)(A1.A,{label:_2.U.I18n.t("blockCustomHtmlContentLabel"),value:e.content,"data-automation-id":"settings_custom_html_content",rows:4,onChange:e=>{t({content:e}),u(e)}}),(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("blockCustomHtmlNl2br"),checked:e.nl2br,onChange:e=>t({nl2br:e})})]})})}),h=e.nl2br?["body { white-space: pre-line; }"]:[];h.push(` body {font-family: ${getComputedStyle(document.body).fontFamily};}`),o?h.push(` body {color: ${o};}`):h.push(` body {color: ${getComputedStyle(document.body).color};}`),i?h.push(` body {font-size: ${i}px }`):h.push(` body {font-size: ${getComputedStyle(document.body).fontSize};}`),s&&h.push(` body {text-align: ${s}}`),a&&h.push(` body {font-family: "${a}"}`);const p=`${l}_${h}`;return(0,Td.jsxs)(q5,{className:e.className,children:[d,(0,Td.jsx)("div",{className:"mailpoet-html-block-editor-content-wrapper",children:(0,Td.jsx)(zee,{html:l,styles:h},p)})]})}Uee.propTypes={attributes:k2().shape({content:k2().string.isRequired,nl2br:k2().bool.isRequired,className:k2().string}).isRequired,setAttributes:k2().func.isRequired,clientId:k2().string.isRequired};const Vee={title:_2.U.I18n.t("blockCustomHtml"),description:_2.U.I18n.t("blockCustomHtmlDescription"),icon:Oee,category:"fields",attributes:{content:{type:"string",default:_2.U.I18n.t("blockCustomHtmlDefault")},nl2br:{type:"boolean",default:!0}},supports:{html:!1,multiple:!0},edit:Uee,save:()=>null},Hee=(0,Td.jsx)(pw.t4,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 694 694",children:(0,Td.jsx)(pw.G,{children:(0,Td.jsx)(pw.wA,{d:"m 347,44.407738 c 25.64881,0 46.33333,21.800595 46.33333,47.96131 V 299.03869 h 195.26191 c 24.82143,0 45.50595,21.8006 45.50595,47.96131 0,27.03274 -20.68452,48.83333 -45.50595,48.83333 H 393.33333 v 205.79762 c 0,26.16072 -20.68452,47.96131 -46.33333,47.96131 -24.82143,0 -45.50595,-21.80059 -45.50595,-47.96131 V 395.83333 H 105.40476 c -24.821427,0 -45.50595,-21.80059 -45.50595,-48.83333 0,-26.16071 20.684523,-47.96131 45.50595,-47.96131 H 301.49405 V 92.369048 c 0,-26.160715 20.68452,-47.96131 45.50595,-47.96131 z",fillRule:"evenodd",clipRule:"evenodd"})})}),$ee=[{value:"text",label:_2.U.I18n.t("customFieldTypeText")},{value:"textarea",label:_2.U.I18n.t("customFieldTypeTextarea")},{value:"radio",label:_2.U.I18n.t("customFieldTypeRadio")},{value:"checkbox",label:_2.U.I18n.t("customFieldTypeCheckbox")},{value:"select",label:_2.U.I18n.t("customFieldTypeSelect")},{value:"date",label:_2.U.I18n.t("customFieldTypeDate")}];function Wee({dateSettings:e,onSubmit:t}){const[n,r]=(0,S.useState)("text"),[o,i]=(0,S.useState)(null),[s,a]=(0,S.useState)({}),l=o&&!(0,I2.isEmpty)(s)&&!1!==s.isValid,c=e.dateTypes[0].value,u=e.dateFormats[c][0];return(0,Td.jsxs)("div",{className:"mailpoet_custom_field_add_form","data-automation-id":"create_custom_field_form",children:[(0,Td.jsx)("hr",{}),(0,Td.jsx)(_T.A,{label:_2.U.I18n.t("selectCustomFieldType"),options:$ee,"data-automation-id":"create_custom_field_type_select",onChange:e=>{a({}),r(e)}}),(0,Td.jsx)(KE.A,{label:_2.U.I18n.t("customFieldName"),onChange:i,"data-automation-id":"create_custom_field_name_input"}),(0,Td.jsx)("hr",{}),(()=>{switch(n){case"checkbox":return(0,Td.jsx)(iee,{mandatory:!!s.mandatory&&s.mandatory,isChecked:!!s.isChecked&&s.isChecked,checkboxLabel:s.checkboxLabel?s.checkboxLabel:"",onChange:a});case"date":return(0,Td.jsx)(U5,{dateSettings:e,mandatory:!!s.mandatory&&s.mandatory,dateFormat:s.dateFormat?s.dateFormat:u,dateType:s.dateType?s.dateType:c,defaultToday:!!s.defaultToday&&s.defaultToday,onChange:a});case"radio":case"select":return(0,Td.jsx)(Y7,{mandatory:!!s.mandatory&&s.mandatory,values:s.values?s.values:[{name:"",id:Math.random().toString()}],onChange:a});default:return(0,Td.jsx)(n4,{mandatory:!!s.mandatory&&s.mandatory,validate:s.validate?s.validate:"",fieldType:n,onChange:a})}})(),(0,Td.jsx)(Zv.Ay,{variant:"secondary",disabled:!l,"data-automation-id":"create_custom_field_submit",onClick:()=>{const e={name:o,type:n,params:K5(n,s)};t(e)},children:_2.U.I18n.t("blockCreateButton")})]})}function Gee({clientId:e}){const{createCustomField:t}=(0,Vl.A)(A2),n=(0,Ul.A)((e=>e(A2).getDateSettingsData()),[]),r=(0,Ul.A)((e=>e(A2).getIsCustomFieldCreating()),[]);return(0,Td.jsx)(zz,{icon:(0,Td.jsx)(pz,{icon:Hee,showColors:!0}),label:_2.U.I18n.t("blockAddCustomFieldFormHeading"),className:"mailpoet_custom_field_add_placeholder",children:r?(0,Td.jsx)(qE.Ay,{}):(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)("p",{children:_2.U.I18n.t("blockAddCustomFieldDescription")}),(0,Td.jsx)(Wee,{onSubmit:n=>{t(n,e)},dateSettings:n})]})})}Wee.propTypes={dateSettings:k2().shape({dateTypes:k2().arrayOf(k2().shape({label:k2().string,value:k2().string})),dateFormats:k2().objectOf(k2().arrayOf(k2().string)),months:k2().arrayOf(k2().string)}).isRequired,onSubmit:k2().func.isRequired},Gee.propTypes={clientId:k2().string.isRequired};const qee={title:_2.U.I18n.t("blockAddCustomField"),description:_2.U.I18n.t("blockAddCustomFieldDescription"),icon:Hee,category:"custom-fields",attributes:{},supports:{html:!1,multiple:!1},edit:Gee,save:()=>null};var Kee=n(359);function Yee(e){let t,{doc:n}=Yee;n||(n=document.implementation.createHTMLDocument(""),Yee.doc=n),n.body.innerHTML=e;for(const e of n.body.firstChild.classList)if(t=e.match(/^layout-column-(\d+)$/))return Number(t[1])-1}const Jee=[{attributes:{verticalAlignment:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>{if(!e.customTextColor&&!e.customBackgroundColor)return e;const t={color:{}};e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor);const{customTextColor:n,customBackgroundColor:r,...o}=e;return{...o,style:t,isStackedOnMobile:!0}},save({attributes:e}){const{verticalAlignment:t,backgroundColor:n,customBackgroundColor:r,textColor:o,customTextColor:i}=e,s=tT("background-color",n),a=tT("color",o),l=(0,$v.A)({"has-background":n||r,"has-text-color":o||i,[s]:s,[a]:a,[`are-vertically-aligned-${t}`]:t}),c={backgroundColor:s?void 0:r,color:a?void 0:i};return(0,Td.jsx)("div",{className:l||void 0,style:c,children:(0,Td.jsx)(SJ.Content,{})})}},{attributes:{columns:{type:"number",default:2}},isEligible:(e,t)=>!!t.some((e=>/layout-column-\d+/.test(e.originalContent)))&&t.some((e=>void 0!==Yee(e.originalContent))),migrate(e,t){const n=t.reduce(((e,t)=>{const{originalContent:n}=t;let r=Yee(n);return void 0===r&&(r=0),e[r]||(e[r]=[]),e[r].push(t),e}),[]).map((e=>td("core/column",{},e))),{columns:r,...o}=e;return[{...o,isStackedOnMobile:!0},n]},save({attributes:e}){const{columns:t}=e;return(0,Td.jsx)("div",{className:`has-${t}-columns`,children:(0,Td.jsx)(SJ.Content,{})})}},{attributes:{columns:{type:"number",default:2}},migrate(e,t){const{columns:n,...r}=e;return[e={...r,isStackedOnMobile:!0},t]},save({attributes:e}){const{verticalAlignment:t,columns:n}=e,r=(0,$v.A)(`has-${n}-columns`,{[`are-vertically-aligned-${t}`]:t});return(0,Td.jsx)("div",{className:r,children:(0,Td.jsx)(SJ.Content,{})})}}],Xee=e=>{const t=parseFloat(e);return Number.isFinite(t)?parseFloat(t.toFixed(2)):void 0};function Zee(e,t){const{width:n=100/t}=e.attributes;return Xee(n)}function Qee(e,t,n=e.length){const r=function(e,t=e.length){return e.reduce(((e,n)=>e+Zee(n,t)),0)}(e,n);return Object.fromEntries(Object.entries(function(e,t=e.length){return e.reduce(((e,n)=>{const r=Zee(n,t);return Object.assign(e,{[n.clientId]:r})}),{})}(e,n)).map((([e,n])=>[e,Xee(t*n/r)])))}function ete(e,t){return e.map((e=>({...e,attributes:{...e.attributes,width:`${t[e.clientId]}%`}})))}const tte={name:"core/column"};function nte({clientId:e,setAttributes:t,isStackedOnMobile:n}){const{count:r,canInsertColumnBlock:o,minCount:i}=(0,Ul.A)((t=>{const{canInsertBlockType:n,canRemoveBlock:r,getBlocks:o,getBlockCount:i}=t(hv),s=o(e).reduce(((e,t,n)=>(r(t.clientId)||e.push(n),e)),[]);return{count:i(e),canInsertColumnBlock:n("core/column",e),minCount:Math.max(...s)+1}}),[e]),{getBlocks:s}=(0,Ul.A)(hv),{replaceInnerBlocks:a}=(0,Vl.A)(hv);return(0,Td.jsxs)(aF.Ay,{title:(0,H.__)("Settings"),children:[o&&(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(FC,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,H.__)("Columns"),value:r,onChange:t=>function(t,n){let r=s(e);const o=function(e){return e.every((e=>{const t=e.attributes.width;return Number.isFinite(t?.endsWith?.("%")?parseFloat(t):t)}))}(r),i=n>t;if(i&&o){const e=Xee(100/n),o=n-t;r=[...ete(r,Qee(r,100-e*o)),...Array.from({length:o}).map((()=>td("core/column",{width:`${e}%`})))]}else i?r=[...r,...Array.from({length:n-t}).map((()=>td("core/column")))]:n<t&&(r=r.slice(0,-(t-n)),o)&&(r=ete(r,Qee(r,100)));a(e,r)}(r,Math.max(i,t)),min:Math.max(1,i),max:Math.max(6,r)}),r>6&&(0,Td.jsx)(YE.A,{status:"warning",isDismissible:!1,children:(0,H.__)("This column count exceeds the recommended amount and may cause visual breakage.")})]}),(0,Td.jsx)(Hx.A,{__nextHasNoMarginBottom:!0,label:(0,H.__)("Stack on mobile"),checked:n,onChange:()=>t({isStackedOnMobile:!n})})]})}function rte({attributes:e,setAttributes:t,clientId:n}){const{isStackedOnMobile:r,verticalAlignment:o,templateLock:i}=e,s=(0,Hp.A)(),{getBlockOrder:a}=(0,Ul.A)(hv),{updateBlockAttributes:l}=(0,Vl.A)(hv),c=CJ(oG({className:(0,$v.A)({[`are-vertically-aligned-${o}`]:o,"is-not-stacked-on-mobile":!r})}),{defaultBlock:tte,directInsert:!0,orientation:"horizontal",renderAppender:!1,templateLock:i});return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(__,{children:(0,Td.jsx)(kw,{onChange:function(e){const r=a(n);s.batch((()=>{t({verticalAlignment:e}),l(r,{verticalAlignment:e})}))},value:o})}),(0,Td.jsx)(IA,{children:(0,Td.jsx)(nte,{clientId:n,setAttributes:t,isStackedOnMobile:r})}),(0,Td.jsx)("div",{...c})]})}function ote({clientId:e,name:t,setAttributes:n}){const{blockType:r,defaultVariation:o,variations:i}=(0,Ul.A)((e=>{const{getBlockVariations:n,getBlockType:r,getDefaultBlockVariation:o}=e(ed);return{blockType:r(t),defaultVariation:o(t,"block"),variations:n(t,"block")}}),[t]),{replaceInnerBlocks:s}=(0,Vl.A)(hv),a=oG();return(0,Td.jsx)("div",{...a,children:(0,Td.jsx)(Vz,{icon:r?.icon?.src,label:r?.title,variations:i,instructions:(0,H.__)("Divide into columns. Select a layout:"),onSelect:(t=o)=>{t.attributes&&n(t.attributes),t.innerBlocks&&s(e,nd(t.innerBlocks),!0)},allowSkip:!0})})}const ite=[{name:"one-column-full",title:(0,H.__)("100"),description:(0,H.__)("One column"),icon:(0,Td.jsx)(pw.t4,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Td.jsx)(pw.wA,{d:"M0 10a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Z"})}),innerBlocks:[["core/column"]],scope:["block"]},{name:"two-columns-equal",title:(0,H.__)("50 / 50"),description:(0,H.__)("Two columns; equal split"),icon:(0,Td.jsx)(pw.t4,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Td.jsx)(pw.wA,{d:"M0 10a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V10Z"})}),isDefault:!0,innerBlocks:[["core/column"],["core/column"]],scope:["block"]},{name:"two-columns-one-third-two-thirds",title:(0,H.__)("33 / 66"),description:(0,H.__)("Two columns; one-third, two-thirds split"),icon:(0,Td.jsx)(pw.t4,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Td.jsx)(pw.wA,{d:"M0 10a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm17 0a2 2 0 0 1 2-2h27a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H19a2 2 0 0 1-2-2V10Z"})}),innerBlocks:[["core/column",{width:"33.33%"}],["core/column",{width:"66.66%"}]],scope:["block"]},{name:"two-columns-two-thirds-one-third",title:(0,H.__)("66 / 33"),description:(0,H.__)("Two columns; two-thirds, one-third split"),icon:(0,Td.jsx)(pw.t4,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Td.jsx)(pw.wA,{d:"M0 10a2 2 0 0 1 2-2h27a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm33 0a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H35a2 2 0 0 1-2-2V10Z"})}),innerBlocks:[["core/column",{width:"66.66%"}],["core/column",{width:"33.33%"}]],scope:["block"]},{name:"three-columns-equal",title:(0,H.__)("33 / 33 / 33"),description:(0,H.__)("Three columns; equal split"),icon:(0,Td.jsx)(pw.t4,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Td.jsx)(pw.wA,{d:"M0 10a2 2 0 0 1 2-2h10.531c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H2a2 2 0 0 1-2-2V10Zm16.5 0c0-1.105.864-2 1.969-2H29.53c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H18.47c-1.105 0-1.969-.895-1.969-2V10Zm17 0c0-1.105.864-2 1.969-2H46a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H35.469c-1.105 0-1.969-.895-1.969-2V10Z"})}),innerBlocks:[["core/column"],["core/column"],["core/column"]],scope:["block"]},{name:"three-columns-wider-center",title:(0,H.__)("25 / 50 / 25"),description:(0,H.__)("Three columns; wide center column"),icon:(0,Td.jsx)(pw.t4,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Td.jsx)(pw.wA,{d:"M0 10a2 2 0 0 1 2-2h7.531c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H2a2 2 0 0 1-2-2V10Zm13.5 0c0-1.105.864-2 1.969-2H32.53c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H15.47c-1.105 0-1.969-.895-1.969-2V10Zm23 0c0-1.105.864-2 1.969-2H46a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2h-7.531c-1.105 0-1.969-.895-1.969-2V10Z"})}),innerBlocks:[["core/column",{width:"25%"}],["core/column",{width:"50%"}],["core/column",{width:"25%"}]],scope:["block"]}],ste={from:[{type:"block",isMultiBlock:!0,blocks:["*"],__experimentalConvert:e=>{const t=+(100/e.length).toFixed(2),n=e.map((({name:e,attributes:n,innerBlocks:r})=>["core/column",{width:`${t}%`},[[e,{...n},r]]]));return td("core/columns",{},nd(n))},isMatch:({length:e},t)=>(1!==t.length||"core/columns"!==t[0].name)&&e&&e<=6},{type:"block",blocks:["core/media-text"],priority:1,transform:(e,t)=>{const{align:n,backgroundColor:r,textColor:o,style:i,mediaAlt:s,mediaId:a,mediaPosition:l,mediaSizeSlug:c,mediaType:u,mediaUrl:d,mediaWidth:h,verticalAlignment:p}=e;let f;f="image"!==u&&u?["core/video",{id:a,src:d}]:["core/image",{id:a,alt:s,url:d,sizeSlug:c,href:e.href,linkClass:e.linkClass,linkDestination:e.linkDestination,linkTarget:e.linkTarget,rel:e.rel}];const m=[["core/column",{width:`${h}%`},[f]],["core/column",{width:100-h+"%"},t]];return"right"===l&&m.reverse(),td("core/columns",{align:n,backgroundColor:r,textColor:o,style:i,verticalAlignment:p},nd(m))}}],ungroup:(e,t)=>t.flatMap((e=>e.innerBlocks))},ate=ste,lte={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/columns",title:"Columns",category:"design",allowedBlocks:["core/column"],description:"Display content in multiple columns, with blocks added to each column.",textdomain:"default",attributes:{verticalAlignment:{type:"string"},isStackedOnMobile:{type:"boolean",default:!0},templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1]}},supports:{anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,link:!0,heading:!0,button:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{blockGap:{__experimentalDefault:"2em",sides:["horizontal","vertical"]},margin:["top","bottom"],padding:!0,__experimentalDefaultControls:{padding:!0,blockGap:!0}},layout:{allowSwitching:!1,allowInheriting:!1,allowEditing:!1,default:{type:"flex",flexWrap:"nowrap"}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},shadow:!0},editorStyle:"wp-block-columns-editor",style:"wp-block-columns"},{name:cte}=lte,ute={icon:Kee.A,variations:ite,example:{viewportWidth:600,innerBlocks:[{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{content:(0,H.__)("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.")}},{name:"core/image",attributes:{url:"https://s.w.org/images/core/5.3/Windbuchencom.jpg"}},{name:"core/paragraph",attributes:{content:(0,H.__)("Suspendisse commodo neque lacus, a dictum orci interdum et.")}}]},{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{content:(0,H.__)("Etiam et egestas lorem. Vivamus sagittis sit amet dolor quis lobortis. Integer sed fermentum arcu, id vulputate lacus. Etiam fermentum sem eu quam hendrerit.")}},{name:"core/paragraph",attributes:{content:(0,H.__)("Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim.")}}]}]},deprecated:Jee,edit:e=>{const{clientId:t}=e,n=(0,Ul.A)((e=>e(hv).getBlocks(t).length>0),[t])?rte:ote;return(0,Td.jsx)(n,{...e})},save:function({attributes:e}){const{isStackedOnMobile:t,verticalAlignment:n}=e,r=(0,$v.A)({[`are-vertically-aligned-${n}`]:n,"is-not-stacked-on-mobile":!t}),o=oG.save({className:r}),i=CJ.save(o);return(0,Td.jsx)("div",{...i})},transforms:ate},dte="core/columns",hte={name:dte,examples:null,deprecated:null,save:()=>null},pte={...lte,...ute,...hte,category:"design",supports:{...lte.supports,anchor:!1}};var fte=n(16696);const mte=[{attributes:{verticalAlignment:{type:"string"},width:{type:"number",min:0,max:100}},isEligible:({width:e})=>isFinite(e),migrate:e=>({...e,width:`${e.width}%`}),save({attributes:e}){const{verticalAlignment:t,width:n}=e,r=(0,$v.A)({[`is-vertically-aligned-${t}`]:t}),o={flexBasis:n+"%"};return(0,Td.jsx)("div",{className:r,style:o,children:(0,Td.jsx)(SJ.Content,{})})}}],gte=mte;function bte({width:e,setAttributes:t}){const[n]=fv("spacing.units"),r=Gw({availableUnits:n||["%","px","em","rem","vw"]});return(0,Td.jsx)(aF.Ay,{title:(0,H.__)("Settings"),children:(0,Td.jsx)(ak,{label:(0,H.__)("Width"),labelPosition:"edge",__unstableInputWidth:"80px",value:e||"",onChange:e=>{e=0>parseFloat(e)?"0":e,t({width:e})},units:r})})}const yte={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/column",title:"Column",category:"design",parent:["core/columns"],description:"A single column within a columns block.",textdomain:"default",attributes:{verticalAlignment:{type:"string"},width:{type:"string"},allowedBlocks:{type:"array"},templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1]}},supports:{__experimentalOnEnter:!0,anchor:!0,reusable:!1,html:!1,color:{gradients:!0,heading:!0,button:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},shadow:!0,spacing:{blockGap:!0,padding:!0,__experimentalDefaultControls:{padding:!0,blockGap:!0}},__experimentalBorder:{color:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,style:!0,width:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},layout:!0,interactivity:{clientNavigation:!0}}},{name:vte}=yte,_te={icon:fte.A,edit:function({attributes:{verticalAlignment:e,width:t,templateLock:n,allowedBlocks:r},setAttributes:o,clientId:i}){const s=(0,$v.A)("block-core-columns",{[`is-vertically-aligned-${e}`]:e}),{columnsIds:a,hasChildBlocks:l,rootClientId:c}=(0,Ul.A)((e=>{const{getBlockOrder:t,getBlockRootClientId:n}=e(hv),r=n(i);return{hasChildBlocks:t(i).length>0,rootClientId:r,columnsIds:t(r)}}),[i]),{updateBlockAttributes:u}=(0,Vl.A)(hv),d=Number.isFinite(t)?t+"%":t,h=oG({className:s,style:d?{flexBasis:d}:void 0}),p=a.length,f=a.indexOf(i)+1,m=(0,H.sprintf)((0,H.__)("%1$s (%2$d of %3$d)"),h["aria-label"],f,p),g=CJ({...h,"aria-label":m},{templateLock:n,allowedBlocks:r,renderAppender:l?void 0:SJ.ButtonBlockAppender});return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(__,{children:(0,Td.jsx)(kw,{onChange:e=>{o({verticalAlignment:e}),u(c,{verticalAlignment:null})},value:e,controls:["top","center","bottom","stretch"]})}),(0,Td.jsx)(IA,{children:(0,Td.jsx)(bte,{width:t,setAttributes:o})}),(0,Td.jsx)("div",{...g})]})},save:function({attributes:e}){const{verticalAlignment:t,width:n}=e,r=(0,$v.A)({[`is-vertically-aligned-${t}`]:t});let o;if(n&&/\d/.test(n)){let e=Number.isFinite(n)?n+"%":n;if(!Number.isFinite(n)&&n?.endsWith("%")){const t=1e12;e=Math.round(Number.parseFloat(n)*t)/t+"%"}o={flexBasis:e}}const i=oG.save({className:r,style:o}),s=CJ.save(i);return(0,Td.jsx)("div",{...s})},deprecated:gte},xte="core/column",wte={name:xte,examples:null,deprecated:null,save:()=>null},kte={...yte,..._te,...wte,category:"design",supports:{...yte.supports,anchor:!1}};var Cte=n(83722);const Ste={className:!1,anchor:!0},Ate={align:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:""},level:{type:"number",default:2},placeholder:{type:"string"}},Ete=e=>{if(!e.customTextColor)return e;const t={color:{text:e.customTextColor}},{customTextColor:n,...r}=e;return{...r,style:t}},Ite=["left","right","center"],jte=e=>{const{align:t,...n}=e;return Ite.includes(t)?{...n,textAlign:t}:e},Tte={supports:Ste,attributes:{...Ate,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>Ete(jte(e)),save({attributes:e}){const{align:t,level:n,content:r,textColor:o,customTextColor:i}=e,s="h"+n,a=tT("color",o),l=(0,$v.A)({[a]:a});return(0,Td.jsx)(tQ.Content,{className:l||void 0,tagName:s,style:{textAlign:t,color:a?void 0:i},value:r})}},Bte={attributes:{...Ate,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>Ete(jte(e)),save({attributes:e}){const{align:t,content:n,customTextColor:r,level:o,textColor:i}=e,s="h"+o,a=tT("color",i),l=(0,$v.A)({[a]:a,[`has-text-align-${t}`]:t});return(0,Td.jsx)(tQ.Content,{className:l||void 0,tagName:s,style:{color:a?void 0:r},value:n})},supports:Ste},Rte={supports:Ste,attributes:{...Ate,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>Ete(jte(e)),save({attributes:e}){const{align:t,content:n,customTextColor:r,level:o,textColor:i}=e,s="h"+o,a=tT("color",i),l=(0,$v.A)({[a]:a,"has-text-color":i||r,[`has-text-align-${t}`]:t});return(0,Td.jsx)(tQ.Content,{className:l||void 0,tagName:s,style:{color:a?void 0:r},value:n})}},Nte={supports:{align:["wide","full"],anchor:!0,className:!1,color:{link:!0},fontSize:!0,lineHeight:!0,__experimentalSelector:{"core/heading/h1":"h1","core/heading/h2":"h2","core/heading/h3":"h3","core/heading/h4":"h4","core/heading/h5":"h5","core/heading/h6":"h6"},__unstablePasteTextInline:!0},attributes:Ate,isEligible:({align:e})=>Ite.includes(e),migrate:jte,save({attributes:e}){const{align:t,content:n,level:r}=e,o="h"+r,i=(0,$v.A)({[`has-text-align-${t}`]:t});return(0,Td.jsx)(o,{...oG.save({className:i}),children:(0,Td.jsx)(tQ.Content,{value:n})})}},Dte={supports:{align:["wide","full"],anchor:!0,className:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0,textTransform:!0}},__experimentalSelector:"h1,h2,h3,h4,h5,h6",__unstablePasteTextInline:!0,__experimentalSlashInserter:!0},attributes:{textAlign:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:"",__experimentalRole:"content"},level:{type:"number",default:2},placeholder:{type:"string"}},save({attributes:e}){const{textAlign:t,content:n,level:r}=e,o="h"+r,i=(0,$v.A)({[`has-text-align-${t}`]:t});return(0,Td.jsx)(o,{...oG.save({className:i}),children:(0,Td.jsx)(tQ.Content,{value:n})})}},Mte=[Dte,Nte,Rte,Bte,Tte],Pte={},Ote=(e,t)=>{const n=(e=>Zc()((e=>{const t=document.createElement("div");return t.innerHTML=e,t.innerText})(e)).replace(/[^\p{L}\p{N}]+/gu,"-").toLowerCase().replace(/(^-+)|(-+$)/g,""))(t);if(""===n)return null;delete Pte[e];let r=n,o=0;for(;Object.values(Pte).includes(r);)o+=1,r=n+"-"+o;return r},Lte=(e,t)=>{Pte[e]=t};function Fte(e,t,n){if(!e)return;const{supports:r}=Sc(t),o=[];if(["core/paragraph","core/heading","core/image","core/button"].includes(t)&&n&&o.push("id","bindings"),!1!==r.renaming&&o.push("name"),!o.length)return;const i=Object.entries(e).reduce(((e,[t,r])=>o.includes(t)?(e[t]="bindings"===t?n(r):r,e):e),{});return Object.keys(i).length?i:void 0}const zte={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map((({content:e,anchor:t,align:n,metadata:r})=>td("core/heading",{content:e,anchor:t,textAlign:n,metadata:Fte(r,"core/heading",(({content:e})=>({content:e})))})))},{type:"raw",selector:"h1,h2,h3,h4,h5,h6",schema:({phrasingContentSchema:e,isPaste:t})=>{const n={children:e,attributes:t?[]:["style","id"]};return{h1:n,h2:n,h3:n,h4:n,h5:n,h6:n}},transform(e){const t=Th("core/heading",e.outerHTML),{textAlign:n}=e.style||{};var r;return t.level=(r=e.nodeName,Number(r.substr(1))),"left"!==n&&"center"!==n&&"right"!==n||(t.align=n),td("core/heading",t)}},...[1,2,3,4,5,6].map((e=>({type:"prefix",prefix:Array(e+1).join("#"),transform:t=>td("core/heading",{level:e,content:t})}))),...[1,2,3,4,5,6].map((e=>({type:"enter",regExp:new RegExp(`^/(h|H)${e}$`),transform:()=>td("core/heading",{level:e})})))],to:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map((({content:e,textAlign:t,metadata:n})=>td("core/paragraph",{content:e,align:t,metadata:Fte(n,"core/paragraph",(({content:e})=>({content:e})))})))}]},Ute=zte,Vte={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/heading",title:"Heading",category:"text",description:"Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.",keywords:["title","subtitle"],textdomain:"default",attributes:{textAlign:{type:"string"},content:{type:"rich-text",source:"rich-text",selector:"h1,h2,h3,h4,h5,h6",__experimentalRole:"content"},level:{type:"number",default:2},placeholder:{type:"string"}},supports:{align:["wide","full"],anchor:!0,className:!0,splitting:!0,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},__unstablePasteTextInline:!0,__experimentalSlashInserter:!0,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-heading-editor",style:"wp-block-heading"},{name:Hte}=Vte,$te={icon:Cte.A,example:{attributes:{content:(0,H.__)("Code is Poetry"),level:2}},__experimentalLabel(e,{context:t}){const{content:n,level:r}=e,o=e?.metadata?.name,i=n?.trim().length>0;return"list-view"===t&&(o||i)?o||n:"accessibility"===t?i?(0,H.sprintf)((0,H.__)("Level %1$s. %2$s"),r,n):(0,H.sprintf)((0,H.__)("Level %s. Empty."),r):void 0},transforms:Ute,deprecated:Mte,merge:(e,t)=>({content:(e.content||"")+(t.content||"")}),edit:function({attributes:e,setAttributes:t,mergeBlocks:n,onReplace:r,style:o,clientId:i}){const{textAlign:s,content:a,level:l,placeholder:c,anchor:u}=e,d="h"+l,h=oG({className:(0,$v.A)({[`has-text-align-${s}`]:s}),style:o}),p=IS(),{canGenerateAnchors:f}=(0,Ul.A)((e=>{const{getGlobalBlockCount:t,getSettings:n}=e(hv);return{canGenerateAnchors:!!n().generateAnchors||t("core/table-of-contents")>0}}),[]),{__unstableMarkNextChangeAsNotPersistent:m}=(0,Vl.A)(hv);return(0,S.useEffect)((()=>{if(f)return!u&&a&&(m(),t({anchor:Ote(i,a)})),Lte(i,u),()=>Lte(i,null)}),[u,a,i,f]),(0,Td.jsxs)(Td.Fragment,{children:["default"===p&&(0,Td.jsxs)(__,{group:"block",children:[(0,Td.jsx)(Lz,{value:l,onChange:e=>t({level:e})}),(0,Td.jsx)(sP,{value:s,onChange:e=>{t({textAlign:e})}})]}),(0,Td.jsx)(tQ,{identifier:"content",tagName:d,value:a,onChange:e=>{const n={content:e};!f||u&&e&&Ote(i,a)!==u||(n.anchor=Ote(i,e)),t(n)},onMerge:n,onReplace:r,onRemove:()=>r([]),placeholder:c||(0,H.__)("Heading"),textAlign:s,...Lh.A.isNative&&{deleteEnter:!0},...h})]})},save:function({attributes:e}){const{textAlign:t,content:n,level:r}=e,o="h"+r,i=(0,$v.A)({[`has-text-align-${t}`]:t});return(0,Td.jsx)(o,{...oG.save({className:i}),children:(0,Td.jsx)(tQ.Content,{value:n})})}},Wte="core/heading",Gte={name:Wte,examples:null,deprecated:null,save:()=>null},qte={...Vte,...$te,...Gte,category:"design",supports:{...Vte.supports,html:!1}},Kte={className:!1},Yte={align:{type:"string"},content:{type:"string",source:"html",selector:"p",default:""},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},textColor:{type:"string"},backgroundColor:{type:"string"},fontSize:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]},style:{type:"object"}},Jte=e=>{if(!e.customTextColor&&!e.customBackgroundColor&&!e.customFontSize)return e;const t={};(e.customTextColor||e.customBackgroundColor)&&(t.color={}),e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),e.customFontSize&&(t.typography={fontSize:e.customFontSize});const{customTextColor:n,customBackgroundColor:r,customFontSize:o,...i}=e;return{...i,style:t}},{style:Xte,...Zte}=Yte,Qte=[{supports:Kte,attributes:{...Zte,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},save({attributes:e}){const{align:t,content:n,dropCap:r,direction:o}=e,i=(0,$v.A)({"has-drop-cap":t!==((0,H.isRTL)()?"left":"right")&&"center"!==t&&r,[`has-text-align-${t}`]:t});return(0,Td.jsx)("p",{...oG.save({className:i,dir:o}),children:(0,Td.jsx)(tQ.Content,{value:n})})}},{supports:Kte,attributes:{...Zte,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:Jte,save({attributes:e}){const{align:t,content:n,dropCap:r,backgroundColor:o,textColor:i,customBackgroundColor:s,customTextColor:a,fontSize:l,customFontSize:c,direction:u}=e,d=tT("color",i),h=tT("background-color",o),p=ZM(l),f=(0,$v.A)({"has-text-color":i||a,"has-background":o||s,"has-drop-cap":r,[`has-text-align-${t}`]:t,[p]:p,[d]:d,[h]:h}),m={backgroundColor:h?void 0:s,color:d?void 0:a,fontSize:p?void 0:c};return(0,Td.jsx)(tQ.Content,{tagName:"p",style:m,className:f||void 0,value:n,dir:u})}},{supports:Kte,attributes:{...Zte,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:Jte,save({attributes:e}){const{align:t,content:n,dropCap:r,backgroundColor:o,textColor:i,customBackgroundColor:s,customTextColor:a,fontSize:l,customFontSize:c,direction:u}=e,d=tT("color",i),h=tT("background-color",o),p=ZM(l),f=(0,$v.A)({"has-text-color":i||a,"has-background":o||s,"has-drop-cap":r,[p]:p,[d]:d,[h]:h}),m={backgroundColor:h?void 0:s,color:d?void 0:a,fontSize:p?void 0:c,textAlign:t};return(0,Td.jsx)(tQ.Content,{tagName:"p",style:m,className:f||void 0,value:n,dir:u})}},{supports:Kte,attributes:{...Zte,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"},width:{type:"string"}},migrate:Jte,save({attributes:e}){const{width:t,align:n,content:r,dropCap:o,backgroundColor:i,textColor:s,customBackgroundColor:a,customTextColor:l,fontSize:c,customFontSize:u}=e,d=tT("color",s),h=tT("background-color",i),p=c&&`is-${c}-text`,f=(0,$v.A)({[`align${t}`]:t,"has-background":i||a,"has-drop-cap":o,[p]:p,[d]:d,[h]:h}),m={backgroundColor:h?void 0:a,color:d?void 0:l,fontSize:p?void 0:u,textAlign:n};return(0,Td.jsx)(tQ.Content,{tagName:"p",style:m,className:f||void 0,value:r})}},{supports:Kte,attributes:{...Zte,fontSize:{type:"number"}},save({attributes:e}){const{width:t,align:n,content:r,dropCap:o,backgroundColor:i,textColor:s,fontSize:a}=e,l=(0,$v.A)({[`align${t}`]:t,"has-background":i,"has-drop-cap":o}),c={backgroundColor:i,color:s,fontSize:a,textAlign:n};return(0,Td.jsx)("p",{style:c,className:l||void 0,children:r})},migrate:e=>Jte({...e,customFontSize:Number.isFinite(e.fontSize)?e.fontSize:void 0,customTextColor:e.textColor&&"#"===e.textColor[0]?e.textColor:void 0,customBackgroundColor:e.backgroundColor&&"#"===e.backgroundColor[0]?e.backgroundColor:void 0})},{supports:Kte,attributes:{...Yte,content:{type:"string",source:"html",default:""}},save:({attributes:e})=>(0,Td.jsx)(Ad.A,{children:e.content}),migrate:e=>e}],ene=Qte;var tne=n(58730);function nne(e){const{batch:t}=(0,Hp.A)(),{moveBlocksToPosition:n,replaceInnerBlocks:r,duplicateBlocks:o,insertBlock:i}=(0,Vl.A)(hv),{getBlockRootClientId:s,getBlockIndex:a,getBlockOrder:l,getBlockName:c,getBlock:u,getNextBlockClientId:d,canInsertBlockType:h}=(0,Ul.A)(hv),p=(0,S.useRef)(e);return p.current=e,(0,UC.A)((e=>{function f(e){if(e.defaultPrevented)return;if(e.keyCode!==VE.ENTER)return;const{content:f,clientId:m}=p.current;if(f.length)return;const g=s(m);if(!Ic(c(g),"__experimentalOnEnter",!1))return;const b=l(g),y=b.indexOf(m);if(y===b.length-1){let t=g;for(;!h(c(m),s(t));)t=s(t);return void("string"==typeof t&&(e.preventDefault(),n([m],g,s(t),a(t)+1)))}const v=Cc();if(!h(v,s(g)))return;e.preventDefault();const _=u(g);t((()=>{o([g]);const e=a(g);r(g,_.innerBlocks.slice(0,y)),r(d(g),_.innerBlocks.slice(y+1)),i(td(v),e+1,s(g),!0)}))}return e.addEventListener("keydown",f),()=>{e.removeEventListener("keydown",f)}}),[])}function rne({direction:e,setDirection:t}){return(0,H.isRTL)()&&(0,Td.jsx)(r_,{icon:tne.A,title:(0,H._x)("Left to right","editor button"),isActive:"ltr"===e,onClick:()=>{t("ltr"===e?void 0:"ltr")}})}function one(e){return e===((0,H.isRTL)()?"left":"right")||"center"===e}function ine({clientId:e,attributes:t,setAttributes:n}){const[r]=fv("typography.dropCap");if(!r)return null;const{align:o,dropCap:i}=t;let s;return s=one(o)?(0,H.__)("Not available for aligned text."):i?(0,H.__)("Showing large initial letter."):(0,H.__)("Toggle to show a large initial letter."),(0,Td.jsx)(YA,{hasValue:()=>!!i,label:(0,H.__)("Drop cap"),onDeselect:()=>n({dropCap:void 0}),resetAllFilter:()=>({dropCap:void 0}),panelId:e,children:(0,Td.jsx)(Hx.A,{__nextHasNoMarginBottom:!0,label:(0,H.__)("Drop cap"),checked:!!i,onChange:()=>n({dropCap:!i}),help:s,disabled:!!one(o)})})}const{name:sne}={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/paragraph",title:"Paragraph",category:"text",description:"Start with the basic building block of all narrative.",keywords:["text"],textdomain:"default",attributes:{align:{type:"string"},content:{type:"rich-text",source:"rich-text",selector:"p",__experimentalRole:"content"},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]}},supports:{splitting:!0,anchor:!0,className:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalSelector:"p",__unstablePasteTextInline:!0,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-paragraph-editor",style:"wp-block-paragraph"},ane={from:[{type:"raw",priority:20,selector:"p",schema:({phrasingContentSchema:e,isPaste:t})=>({p:{children:e,attributes:t?[]:["style","id"]}}),transform(e){const t=Th(sne,e.outerHTML),{textAlign:n}=e.style||{};return"left"!==n&&"center"!==n&&"right"!==n||(t.align=n),td(sne,t)}}]},lne={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/paragraph",title:"Paragraph",category:"text",description:"Start with the basic building block of all narrative.",keywords:["text"],textdomain:"default",attributes:{align:{type:"string"},content:{type:"rich-text",source:"rich-text",selector:"p",__experimentalRole:"content"},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]}},supports:{splitting:!0,anchor:!0,className:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalSelector:"p",__unstablePasteTextInline:!0,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-paragraph-editor",style:"wp-block-paragraph"},{name:cne}=lne,une={icon:Ez.A,example:{attributes:{content:(0,H.__)("In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.")}},__experimentalLabel(e,{context:t}){const n=e?.metadata?.name;if("list-view"===t&&n)return n;if("accessibility"===t){if(n)return n;const{content:t}=e;return t&&0!==t.length?t:(0,H.__)("Empty")}},transforms:ane,deprecated:ene,merge:(e,t)=>({content:(e.content||"")+(t.content||"")}),edit:function({attributes:e,mergeBlocks:t,onReplace:n,onRemove:r,setAttributes:o,clientId:i}){const{align:s,content:a,direction:l,dropCap:c,placeholder:u}=e,d=oG({ref:nne({clientId:i,content:a}),className:(0,$v.A)({"has-drop-cap":!one(s)&&c,[`has-text-align-${s}`]:s}),style:{direction:l}}),h=IS();return(0,Td.jsxs)(Td.Fragment,{children:["default"===h&&(0,Td.jsxs)(__,{group:"block",children:[(0,Td.jsx)(sP,{value:s,onChange:e=>o({align:e,dropCap:!one(e)&&c})}),(0,Td.jsx)(rne,{direction:l,setDirection:e=>o({direction:e})})]}),(0,Td.jsx)(IA,{group:"typography",children:(0,Td.jsx)(ine,{clientId:i,attributes:e,setAttributes:o})}),(0,Td.jsx)(tQ,{identifier:"content",tagName:"p",...d,value:a,onChange:e=>o({content:e}),onMerge:t,onReplace:n,onRemove:r,"aria-label":tQ.isEmpty(a)?(0,H.__)("Empty block; start writing or type forward slash to choose a block"):(0,H.__)("Block: Paragraph"),"data-empty":tQ.isEmpty(a),placeholder:u||(0,H.__)("Type / to choose a block"),"data-custom-placeholder":!!u||void 0,__unstableEmbedURLOnPaste:!0,__unstableAllowPrefixTransformations:!0})]})},save:function({attributes:e}){const{align:t,content:n,dropCap:r,direction:o}=e,i=(0,$v.A)({"has-drop-cap":t!==((0,H.isRTL)()?"left":"right")&&"center"!==t&&r,[`has-text-align-${t}`]:t});return(0,Td.jsx)("p",{...oG.save({className:i,dir:o}),children:(0,Td.jsx)(tQ.Content,{value:n})})}},dne="core/paragraph",hne={name:dne,examples:null,deprecated:null,save:()=>null},pne={...lne,...une,...hne,category:"design",supports:{...lne.supports,html:!1,anchor:!1}},fne={attributes:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"array",source:"children",selector:"figcaption"},href:{type:"string",source:"attribute",selector:"a",attribute:"href"},id:{type:"number"},align:{type:"string"},width:{type:"number"},height:{type:"number"}},save({attributes:e}){const{url:t,alt:n,caption:r,align:o,href:i,width:s,height:a}=e,l=s||a?{width:s,height:a}:{},c=(0,Td.jsx)("img",{src:t,alt:n,...l});let u={};return s?u={width:s}:"left"!==o&&"right"!==o||(u={maxWidth:"50%"}),(0,Td.jsxs)("figure",{className:o?`align${o}`:null,style:u,children:[i?(0,Td.jsx)("a",{href:i,children:c}):c,!tQ.isEmpty(r)&&(0,Td.jsx)(tQ.Content,{tagName:"figcaption",value:r})]})}},mne={attributes:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"array",source:"children",selector:"figcaption"},href:{type:"string",source:"attribute",selector:"a",attribute:"href"},id:{type:"number"},align:{type:"string"},width:{type:"number"},height:{type:"number"}},save({attributes:e}){const{url:t,alt:n,caption:r,align:o,href:i,width:s,height:a,id:l}=e,c=(0,Td.jsx)("img",{src:t,alt:n,className:l?`wp-image-${l}`:null,width:s,height:a});return(0,Td.jsxs)("figure",{className:o?`align${o}`:null,children:[i?(0,Td.jsx)("a",{href:i,children:c}):c,!tQ.isEmpty(r)&&(0,Td.jsx)(tQ.Content,{tagName:"figcaption",value:r})]})}},gne={attributes:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"array",source:"children",selector:"figcaption"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href"},id:{type:"number"},align:{type:"string"},width:{type:"number"},height:{type:"number"},linkDestination:{type:"string",default:"none"}},save({attributes:e}){const{url:t,alt:n,caption:r,align:o,href:i,width:s,height:a,id:l}=e,c=(0,$v.A)({[`align${o}`]:o,"is-resized":s||a}),u=(0,Td.jsx)("img",{src:t,alt:n,className:l?`wp-image-${l}`:null,width:s,height:a});return(0,Td.jsxs)("figure",{className:c,children:[i?(0,Td.jsx)("a",{href:i,children:u}):u,!tQ.isEmpty(r)&&(0,Td.jsx)(tQ.Content,{tagName:"figcaption",value:r})]})}},bne={attributes:{align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"string",source:"html",selector:"figcaption"},title:{type:"string",source:"attribute",selector:"img",attribute:"title"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number"},width:{type:"number"},height:{type:"number"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{anchor:!0},save({attributes:e}){const{url:t,alt:n,caption:r,align:o,href:i,rel:s,linkClass:a,width:l,height:c,id:u,linkTarget:d,sizeSlug:h,title:p}=e,f=s||void 0,m=(0,$v.A)({[`align${o}`]:o,[`size-${h}`]:h,"is-resized":l||c}),g=(0,Td.jsx)("img",{src:t,alt:n,className:u?`wp-image-${u}`:null,width:l,height:c,title:p}),b=(0,Td.jsxs)(Td.Fragment,{children:[i?(0,Td.jsx)("a",{className:a,href:i,target:d,rel:f,children:g}):g,!tQ.isEmpty(r)&&(0,Td.jsx)(tQ.Content,{tagName:"figcaption",value:r})]});return"left"===o||"right"===o||"center"===o?(0,Td.jsx)("div",{...oG.save(),children:(0,Td.jsx)("figure",{className:m,children:b})}):(0,Td.jsx)("figure",{...oG.save({className:m}),children:b})}},yne={attributes:{align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"string",source:"html",selector:"figcaption"},title:{type:"string",source:"attribute",selector:"img",attribute:"title"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number"},width:{type:"number"},height:{type:"number"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{anchor:!0,color:{__experimentalDuotone:"img",text:!1,background:!1},__experimentalBorder:{radius:!0,__experimentalDefaultControls:{radius:!0}},__experimentalStyle:{spacing:{margin:"0 0 1em 0"}}},save({attributes:e}){const{url:t,alt:n,caption:r,align:o,href:i,rel:s,linkClass:a,width:l,height:c,id:u,linkTarget:d,sizeSlug:h,title:p}=e,f=s||void 0,m=(0,$v.A)({[`align${o}`]:o,[`size-${h}`]:h,"is-resized":l||c}),g=(0,Td.jsx)("img",{src:t,alt:n,className:u?`wp-image-${u}`:null,width:l,height:c,title:p}),b=(0,Td.jsxs)(Td.Fragment,{children:[i?(0,Td.jsx)("a",{className:a,href:i,target:d,rel:f,children:g}):g,!tQ.isEmpty(r)&&(0,Td.jsx)(tQ.Content,{tagName:"figcaption",value:r})]});return(0,Td.jsx)("figure",{...oG.save({className:m}),children:b})}},vne={attributes:{align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src",__experimentalRole:"content"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:"",__experimentalRole:"content"},caption:{type:"string",source:"html",selector:"figcaption",__experimentalRole:"content"},title:{type:"string",source:"attribute",selector:"img",attribute:"title",__experimentalRole:"content"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href",__experimentalRole:"content"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number",__experimentalRole:"content"},width:{type:"number"},height:{type:"number"},aspectRatio:{type:"string"},scale:{type:"string"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{anchor:!0,color:{text:!1,background:!1},filter:{duotone:!0},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,width:!0}}},migrate(e){const{height:t,width:n}=e;return{...e,width:"number"==typeof n?`${n}px`:n,height:"number"==typeof t?`${t}px`:t}},save({attributes:e}){const{url:t,alt:n,caption:r,align:o,href:i,rel:s,linkClass:a,width:l,height:c,aspectRatio:u,scale:d,id:h,linkTarget:p,sizeSlug:f,title:m}=e,g=s||void 0,b=wz(e),y=(0,$v.A)({[`align${o}`]:o,[`size-${f}`]:f,"is-resized":l||c,"has-custom-border":!!b.className||b.style&&Object.keys(b.style).length>0}),v=(0,$v.A)(b.className,{[`wp-image-${h}`]:!!h}),_=(0,Td.jsx)("img",{src:t,alt:n,className:v||void 0,style:{...b.style,aspectRatio:u,objectFit:d},width:l,height:c,title:m}),x=(0,Td.jsxs)(Td.Fragment,{children:[i?(0,Td.jsx)("a",{className:a,href:i,target:p,rel:g,children:_}):_,!tQ.isEmpty(r)&&(0,Td.jsx)(tQ.Content,{className:k1("caption"),tagName:"figcaption",value:r})]});return(0,Td.jsx)("figure",{...oG.save({className:y}),children:x})}},_ne={attributes:{align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src",__experimentalRole:"content"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:"",__experimentalRole:"content"},caption:{type:"string",source:"html",selector:"figcaption",__experimentalRole:"content"},title:{type:"string",source:"attribute",selector:"img",attribute:"title",__experimentalRole:"content"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href",__experimentalRole:"content"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number",__experimentalRole:"content"},width:{type:"number"},height:{type:"number"},aspectRatio:{type:"string"},scale:{type:"string"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{anchor:!0,color:{text:!1,background:!1},filter:{duotone:!0},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,width:!0}}},migrate:({width:e,height:t,...n})=>({...n,width:`${e}px`,height:`${t}px`}),save({attributes:e}){const{url:t,alt:n,caption:r,align:o,href:i,rel:s,linkClass:a,width:l,height:c,aspectRatio:u,scale:d,id:h,linkTarget:p,sizeSlug:f,title:m}=e,g=s||void 0,b=wz(e),y=(0,$v.A)({[`align${o}`]:o,[`size-${f}`]:f,"is-resized":l||c,"has-custom-border":!!b.className||b.style&&Object.keys(b.style).length>0}),v=(0,$v.A)(b.className,{[`wp-image-${h}`]:!!h}),_=(0,Td.jsx)("img",{src:t,alt:n,className:v||void 0,style:{...b.style,aspectRatio:u,objectFit:d,width:l,height:c},width:l,height:c,title:m}),x=(0,Td.jsxs)(Td.Fragment,{children:[i?(0,Td.jsx)("a",{className:a,href:i,target:p,rel:g,children:_}):_,!tQ.isEmpty(r)&&(0,Td.jsx)(tQ.Content,{className:k1("caption"),tagName:"figcaption",value:r})]});return(0,Td.jsx)("figure",{...oG.save({className:y}),children:x})}},xne={attributes:{align:{type:"string"},behaviors:{type:"object"},url:{type:"string",source:"attribute",selector:"img",attribute:"src",__experimentalRole:"content"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:"",__experimentalRole:"content"},caption:{type:"string",source:"html",selector:"figcaption",__experimentalRole:"content"},title:{type:"string",source:"attribute",selector:"img",attribute:"title",__experimentalRole:"content"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href",__experimentalRole:"content"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number",__experimentalRole:"content"},width:{type:"string"},height:{type:"string"},aspectRatio:{type:"string"},scale:{type:"string"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{anchor:!0,color:{text:!1,background:!1},filter:{duotone:!0},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,width:!0}}},migrate({width:e,height:t,...n}){if(!n.behaviors?.lightbox)return n;const{behaviors:{lightbox:{enabled:r}}}=n,o={...n,lightbox:{enabled:r}};return delete o.behaviors,o},isEligible:e=>!!e.behaviors,save({attributes:e}){const{url:t,alt:n,caption:r,align:o,href:i,rel:s,linkClass:a,width:l,height:c,aspectRatio:u,scale:d,id:h,linkTarget:p,sizeSlug:f,title:m}=e,g=s||void 0,b=wz(e),y=(0,$v.A)({[`align${o}`]:o,[`size-${f}`]:f,"is-resized":l||c,"has-custom-border":!!b.className||b.style&&Object.keys(b.style).length>0}),v=(0,$v.A)(b.className,{[`wp-image-${h}`]:!!h}),_=(0,Td.jsx)("img",{src:t,alt:n,className:v||void 0,style:{...b.style,aspectRatio:u,objectFit:d,width:l,height:c},title:m}),x=(0,Td.jsxs)(Td.Fragment,{children:[i?(0,Td.jsx)("a",{className:a,href:i,target:p,rel:g,children:_}):_,!tQ.isEmpty(r)&&(0,Td.jsx)(tQ.Content,{className:k1("caption"),tagName:"figcaption",value:r})]});return(0,Td.jsx)("figure",{...oG.save({className:y}),children:x})}},wne=[xne,_ne,vne,yne,bne,gne,mne,fne];var kne=n(55316);const{lock:Cne,unlock:Sne}=(0,Nl.yf)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/block-library");var Ane=n(24472),Ene=n(56030);const Ine=[{ratio:"2.33",className:"wp-embed-aspect-21-9"},{ratio:"2.00",className:"wp-embed-aspect-18-9"},{ratio:"1.78",className:"wp-embed-aspect-16-9"},{ratio:"1.33",className:"wp-embed-aspect-4-3"},{ratio:"1.00",className:"wp-embed-aspect-1-1"},{ratio:"0.56",className:"wp-embed-aspect-9-16"},{ratio:"0.50",className:"wp-embed-aspect-1-2"}],jne="wp-embed",{name:Tne}={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter or YouTube.",textdomain:"default",attributes:{url:{type:"string",__experimentalRole:"content"},caption:{type:"rich-text",source:"rich-text",selector:"figcaption",__experimentalRole:"content"},type:{type:"string",__experimentalRole:"content"},providerNameSlug:{type:"string",__experimentalRole:"content"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1,__experimentalRole:"content"},previewable:{type:"boolean",default:!0,__experimentalRole:"content"}},supports:{align:!0,spacing:{margin:!0},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"},{kebabCase:Bne}=Sne(d_.j),Rne=e=>e&&e.includes('class="wp-embedded-content"'),Nne=e=>{if(!e)return e;const t=Ine.reduce(((e,{className:t})=>(e.push(t),e)),["wp-has-aspect-ratio"]);let n=e;for(const e of t)n=n.replace(e,"");return n.trim()};(0,_h.A)(((e,t,n,r,o=!0)=>{if(!e)return{};const i={};let{type:s="rich"}=e;const{html:a,provider_name:l}=e,c=Bne((l||t).toLowerCase());return Rne(a)&&(s=jne),(a||"photo"===s)&&(i.type=s,i.providerNameSlug=c),(u=n)&&Ine.some((({className:e})=>u.includes(e)))||(i.className=function(e,t,n=!0){if(!n)return Nne(t);const r=document.implementation.createHTMLDocument("");r.body.innerHTML=e;const o=r.body.querySelector("iframe");if(o&&o.height&&o.width){const e=(o.width/o.height).toFixed(2);for(let n=0;n<Ine.length;n++){const r=Ine[n];if(e>=r.ratio)return e-r.ratio>.1?Nne(t):(0,$v.A)(Nne(t),r.className,"wp-has-aspect-ratio")}}return t}(a,n,r&&o)),i;var u}));var Dne=n(21498);function Mne({attributeKey:e="caption",attributes:t,setAttributes:n,isSelected:r,insertBlocksAfter:o,placeholder:i=(0,H.__)("Add caption"),label:s=(0,H.__)("Caption text"),showToolbarButton:a=!0,className:l,readOnly:c,tagName:u="figcaption",addLabel:d=(0,H.__)("Add caption"),removeLabel:h=(0,H.__)("Remove caption"),icon:p=Dne.A,...f}){const m=t[e],g=(0,gx.A)(m),{PrivateRichText:b}=Sne(b2),y=b.isEmpty(m),v=b.isEmpty(g),[_,x]=(0,S.useState)(!y);(0,S.useEffect)((()=>{!y&&v&&x(!0)}),[y,v]),(0,S.useEffect)((()=>{!r&&y&&x(!1)}),[r,y]);const w=(0,S.useCallback)((e=>{e&&y&&e.focus()}),[y]);return(0,Td.jsxs)(Td.Fragment,{children:[a&&(0,Td.jsx)(__,{group:"block",children:(0,Td.jsx)(r_,{onClick:()=>{x(!_),_&&m&&n({[e]:void 0})},icon:p,isPressed:_,label:_?h:d})}),_&&(!b.isEmpty(m)||r)&&(0,Td.jsx)(b,{identifier:e,tagName:u,className:(0,$v.A)(l,k1("caption")),ref:w,"aria-label":s,placeholder:i,value:m,onChange:t=>n({[e]:t}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>o(td(Cc())),readOnly:c,...f})]})}const Pne={popoverProps:{placement:"left-start",offset:259}},One="none",Lne="media",Fne="attachment",zne="custom",Une=["image"],{DimensionsTool:Vne,ResolutionTool:Hne}=Sne(b2),$ne=[{value:"cover",label:(0,H._x)("Cover","Scale option for dimensions control"),help:(0,H.__)("Image covers the space evenly.")},{value:"contain",label:(0,H._x)("Contain","Scale option for dimensions control"),help:(0,H.__)("Image is contained without distortion.")}],Wne=({href:e,children:t})=>e?(0,Td.jsx)("a",{href:e,onClick:e=>e.preventDefault(),"aria-disabled":!0,style:{pointerEvents:"none",cursor:"default",display:"inline"},children:t}):t;function Gne({temporaryURL:e,attributes:t,setAttributes:n,isSingleSelected:r,insertBlocksAfter:o,onReplace:i,onSelectImage:s,onSelectURL:a,onUploadError:l,context:c,clientId:u,blockEditingMode:d,parentLayoutType:h}){const{url:p="",alt:f,align:m,id:g,href:b,rel:y,linkClass:v,linkDestination:_,title:x,width:w,height:k,aspectRatio:C,scale:A,linkTarget:E,sizeSlug:I,lightbox:j,metadata:T}=t,B=w?parseInt(w,10):void 0,R=k?parseInt(k,10):void 0,N=(0,S.useRef)(),{allowResize:D=!0}=c,{getBlock:M,getSettings:P}=(0,Ul.A)(hv),O=(0,Ul.A)((e=>g&&r?e(zl).getMedia(g,{context:"view"}):null),[g,r]),{canInsertCover:L,imageEditing:F,imageSizes:z,maxWidth:U}=(0,Ul.A)((e=>{const{getBlockRootClientId:t,canInsertBlockType:n}=e(hv),r=t(u),o=P();return{imageEditing:o.imageEditing,imageSizes:o.imageSizes,maxWidth:o.maxWidth,canInsertCover:n("core/cover",r)}}),[u]),{replaceBlocks:V,toggleSelection:$}=(0,Vl.A)(hv),{createErrorNotice:W,createSuccessNotice:G}=(0,Vl.A)(Xb.store),q=(0,YU.A)("medium"),K=["wide","full"].includes(m),[{loadedNaturalWidth:Y,loadedNaturalHeight:J},X]=(0,S.useState)({}),[Z,Q]=(0,S.useState)(!1),[ee,te]=(0,S.useState)(),ne="default"===d,re="contentOnly"===d,oe=D&&ne&&!K&&q&&"grid"!==h,ie=z.filter((({slug:e})=>O?.media_details?.sizes?.[e]?.source_url)).map((({name:e,slug:t})=>({value:t,label:e})));(0,S.useEffect)((()=>{qne(g,p)&&r&&P().mediaUpload?ee||window.fetch(p.includes("?")?p:p+"?").then((e=>e.blob())).then((e=>te(e))).catch((()=>{})):te()}),[g,p,r,ee]);const{naturalWidth:se,naturalHeight:ae}=(0,S.useMemo)((()=>({naturalWidth:N.current?.naturalWidth||Y||void 0,naturalHeight:N.current?.naturalHeight||J||void 0})),[Y,J,N.current?.complete]);function le(e){n({title:e})}function ce(e){n({alt:e})}(0,S.useEffect)((()=>{r||Q(!1)}),[r]);const ue=g&&se&&ae&&F,de=r&&ue&&!Z,he=Gw({availableUnits:["px"]}),[pe]=fv("lightbox"),fe=!!j&&j?.enabled!==pe?.enabled||pe?.allowEditing,me=!!j?.enabled||!j&&!!pe?.enabled,ge=(0,Td.jsx)(Vne,{value:{width:w,height:k,scale:A,aspectRatio:C},onChange:({width:e,height:t,scale:r,aspectRatio:o})=>{n({width:!e&&t?"auto":e,height:t,scale:r,aspectRatio:o})},defaultScale:"cover",defaultAspectRatio:"auto",scaleOptions:$ne,unitsOptions:he}),be=()=>{n({alt:void 0,width:void 0,height:void 0,scale:void 0,aspectRatio:void 0,lightbox:void 0})},ye=(0,Td.jsx)(IA,{children:(0,Td.jsx)(wA,{label:(0,H.__)("Settings"),resetAll:be,dropdownMenuProps:Pne,children:oe&&ge})}),{lockUrlControls:ve=!1,lockHrefControls:_e=!1,lockAltControls:xe=!1,lockAltControlsMessage:we,lockTitleControls:ke=!1,lockTitleControlsMessage:Ce,lockCaption:Se=!1}=(0,Ul.A)((e=>{if(!r)return{};const{getBlockBindingsSource:t}=Sne(e(ed)),{getBlockParentsByBlockName:n}=Sne(e(hv)),{url:o,alt:i,title:s}=T?.bindings||{},a=n(u,"core/block").length>0,l=t(o?.source),d=t(i?.source),h=t(s?.source);return{lockUrlControls:!!o&&!l?.canUserEditValue({select:e,context:c,args:o?.args}),lockHrefControls:a,lockCaption:a,lockAltControls:!!i&&!d?.canUserEditValue({select:e,context:c,args:i?.args}),lockAltControlsMessage:d?.label?(0,H.sprintf)((0,H.__)("Connected to %s"),d.label):(0,H.__)("Connected to dynamic data"),lockTitleControls:!!s&&!h?.canUserEditValue({select:e,context:c,args:s?.args}),lockTitleControlsMessage:h?.label?(0,H.sprintf)((0,H.__)("Connected to %s"),h.label):(0,H.__)("Connected to dynamic data")}}),[u,r,T?.bindings]),Ae=r&&!Z&&!_e&&!ve,Ee=r&&L,Ie=Ae||de||Ee,je=(0,Td.jsxs)(Td.Fragment,{children:[Ie&&(0,Td.jsxs)(__,{group:"block",children:[Ae&&(0,Td.jsx)(hQ,{url:b||"",onChangeUrl:function(e){n(e)},linkDestination:_,mediaUrl:O&&O.source_url||p,mediaLink:O&&O.link,linkTarget:E,linkClass:v,rel:y,showLightboxSetting:fe,lightboxEnabled:me,onSetLightbox:function(e){n(e&&!pe?.enabled?{lightbox:{enabled:!0}}:!e&&pe?.enabled?{lightbox:{enabled:!1}}:{lightbox:void 0})},resetLightbox:function(){n(pe?.enabled&&pe?.allowEditing?{lightbox:{enabled:!1}}:{lightbox:void 0})}}),de&&(0,Td.jsx)(r_,{onClick:()=>Q(!0),icon:Ane.A,label:(0,H.__)("Crop")}),Ee&&(0,Td.jsx)(r_,{icon:Ene.A,label:(0,H.__)("Add text over image"),onClick:function(){V(u,dd(M(u),"core/cover"))}})]}),r&&!Z&&!ve&&(0,Td.jsx)(__,{group:"other",children:(0,Td.jsx)(bj,{mediaId:g,mediaURL:p,allowedTypes:Une,accept:"image/*",onSelect:s,onSelectURL:a,onError:l})}),r&&ee&&(0,Td.jsx)(__,{children:(0,Td.jsx)(a_,{children:(0,Td.jsx)(r_,{onClick:function(){const{mediaUpload:e}=P();e&&e({filesList:[ee],onFileChange([e]){s(e),ec(e.url)||(te(),G((0,H.__)("Image uploaded."),{type:"snackbar"}))},allowedTypes:Une,onError(e){W(e,{type:"snackbar"})}})},icon:JA.A,label:(0,H.__)("Upload to Media Library")})})}),re&&(0,Td.jsxs)(__,{group:"other",children:[(0,Td.jsx)(PE.A,{popoverProps:{position:"bottom right"},renderToggle:({isOpen:e,onToggle:t})=>(0,Td.jsx)(r_,{onClick:t,"aria-haspopup":"true","aria-expanded":e,onKeyDown:n=>{e||n.keyCode!==VE.DOWN||(n.preventDefault(),t())},children:(0,H._x)("Alt","Alternative text for an image. Block toolbar label, a low character count is preferred.")}),renderContent:()=>(0,Td.jsx)(A1.A,{className:"wp-block-image__toolbar_content_textarea",label:(0,H.__)("Alternative text"),value:f||"",onChange:ce,disabled:xe,help:xe?(0,Td.jsx)(Td.Fragment,{children:we}):(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(KI.A,{href:(0,H.__)("https://www.w3.org/WAI/tutorials/images/decision-tree/"),children:(0,H.__)("Describe the purpose of the image.")}),(0,Td.jsx)("br",{}),(0,H.__)("Leave empty if decorative.")]}),__nextHasNoMarginBottom:!0})}),(0,Td.jsx)(PE.A,{popoverProps:{position:"bottom right"},renderToggle:({isOpen:e,onToggle:t})=>(0,Td.jsx)(r_,{onClick:t,"aria-haspopup":"true","aria-expanded":e,onKeyDown:n=>{e||n.keyCode!==VE.DOWN||(n.preventDefault(),t())},children:(0,H.__)("Title")}),renderContent:()=>(0,Td.jsx)(KE.A,{className:"wp-block-image__toolbar_content_textarea",__nextHasNoMarginBottom:!0,label:(0,H.__)("Title attribute"),value:x||"",onChange:le,disabled:ke,help:ke?(0,Td.jsx)(Td.Fragment,{children:Ce}):(0,Td.jsxs)(Td.Fragment,{children:[(0,H.__)("Describe the role of this image on the page."),(0,Td.jsx)(KI.A,{href:"https://www.w3.org/TR/html52/dom.html#the-title-attribute",children:(0,H.__)("(Note: many devices and browsers do not display this text.)")})]})})})]}),(0,Td.jsx)(IA,{children:(0,Td.jsxs)(wA,{label:(0,H.__)("Settings"),resetAll:be,dropdownMenuProps:Pne,children:[r&&(0,Td.jsx)(YA,{label:(0,H.__)("Alternative text"),isShownByDefault:!0,hasValue:()=>!!f,onDeselect:()=>n({alt:void 0}),children:(0,Td.jsx)(A1.A,{label:(0,H.__)("Alternative text"),value:f||"",onChange:ce,readOnly:xe,help:xe?(0,Td.jsx)(Td.Fragment,{children:we}):(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(KI.A,{href:(0,H.__)("https://www.w3.org/WAI/tutorials/images/decision-tree/"),children:(0,H.__)("Describe the purpose of the image.")}),(0,Td.jsx)("br",{}),(0,H.__)("Leave empty if decorative.")]}),__nextHasNoMarginBottom:!0})}),oe&&ge,!!ie.length&&(0,Td.jsx)(Hne,{value:I,onChange:function(e){const t=O?.media_details?.sizes?.[e]?.source_url;if(!t)return null;n({url:t,sizeSlug:e})},options:ie})]})}),(0,Td.jsx)(IA,{group:"advanced",children:(0,Td.jsx)(KE.A,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,H.__)("Title attribute"),value:x||"",onChange:le,readOnly:ke,help:ke?(0,Td.jsx)(Td.Fragment,{children:Ce}):(0,Td.jsxs)(Td.Fragment,{children:[(0,H.__)("Describe the role of this image on the page."),(0,Td.jsx)(KI.A,{href:"https://www.w3.org/TR/html52/dom.html#the-title-attribute",children:(0,H.__)("(Note: many devices and browsers do not display this text.)")})]})})})]}),Te=(0,DE.e)(p);let Be;Be=f||(Te?(0,H.sprintf)((0,H.__)("This image has an empty alt attribute; its file name is %s"),Te):(0,H.__)("This image has an empty alt attribute"));const Re=kz(t),Ne=Cz(t),De=t.className?.includes("is-style-rounded");let Me=(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)("img",{src:e||p,alt:Be,onError:()=>function(){const e=((e,t={})=>{const{preview:n,attributes:r={}}=e,{url:o,providerNameSlug:i,type:s,...a}=r;if(!o||!Sc(Tne))return;const l=(e=>Bc(Tne)?.find((({patterns:t})=>((e,t=[])=>t.some((t=>e.match(t))))(e,t))))(o),c="wordpress"===i||s===jne;if(!c&&l&&(l.attributes.providerNameSlug!==i||!i))return td(Tne,{url:o,...a,...l.attributes});const u=Bc(Tne)?.find((({name:e})=>"wordpress"===e));return u&&n&&Rne(n.html)&&!c?td(Tne,{url:o,...u.attributes,...t}):void 0})({attributes:{url:p}});void 0!==e&&i(e)}(),onLoad:e=>{X({loadedNaturalWidth:e.target?.naturalWidth,loadedNaturalHeight:e.target?.naturalHeight})},ref:N,className:Re.className,style:{width:w&&k||C?"100%":void 0,height:w&&k||C?"100%":void 0,objectFit:A,...Re.style,...Ne.style}}),e&&(0,Td.jsx)(qE.Ay,{})]});if(ue&&Z)Me=(0,Td.jsx)(Wne,{href:b,children:(0,Td.jsx)(xU,{id:g,url:p,width:B,height:R,naturalHeight:ae,naturalWidth:se,onSaveImage:e=>n(e),onFinishEditing:()=>{Q(!1)},borderProps:De?void 0:Re})});else if(oe){const e=C&&function(e){const[t,n=1]=e.split("/").map(Number),r=t/n;return r===1/0||0===r?NaN:r}(C),t=se/ae,o=e||B/R||t||1,i=!B&&R?R*o:B,s=!R&&B?B/o:R,a=se<ae?20:20*o,l=ae<se?20:20/o,c=2.5*U;let u=!1,d=!1;"center"===m?(u=!0,d=!0):(0,H.isRTL)()?"left"===m?u=!0:d=!0:"right"===m?d=!0:u=!0,Me=(0,Td.jsx)(LF,{style:{display:"block",objectFit:A,aspectRatio:w||k||!C?void 0:C},size:{width:null!=i?i:"auto",height:null!=s?s:"auto"},showHandle:r,minWidth:a,maxWidth:c,minHeight:l,maxHeight:c/o,lockAspectRatio:o,enable:{top:!1,right:u,bottom:!0,left:d},onResizeStart:function(){$(!1)},onResizeStop:(e,r,i)=>{$(!0),n({width:`${i.offsetWidth}px`,height:"auto",aspectRatio:o===t?void 0:String(o)})},resizeRatio:"center"===m?2:1,children:(0,Td.jsx)(Wne,{href:b,children:Me})})}else Me=(0,Td.jsx)("div",{style:{width:w,height:k,aspectRatio:C},children:(0,Td.jsx)(Wne,{href:b,children:Me})});return p||e?(0,Td.jsxs)(Td.Fragment,{children:[je,Me,(0,Td.jsx)(Mne,{attributes:t,setAttributes:n,isSelected:r,insertBlocksAfter:o,label:(0,H.__)("Image caption text"),showToolbarButton:r&&ne,readOnly:Se})]}):T?.bindings?je:ye}const qne=(e,t)=>t&&!e&&!ec(t);function Kne(e,t){var n,r;return"url"in(null!==(n=e?.sizes?.[t])&&void 0!==n?n:{})||"source_url"in(null!==(r=e?.media_details?.sizes?.[t])&&void 0!==r?r:{})}function Yne(e,t){const{body:n}=document.implementation.createHTMLDocument("");n.innerHTML=e;const{firstElementChild:r}=n;if(r&&"A"===r.nodeName)return r.getAttribute(t)||void 0}const Jne={img:{attributes:["src","alt","title"],classes:["alignleft","aligncenter","alignright","alignnone",/^wp-image-\d+$/]}},Xne={from:[{type:"raw",isMatch:e=>"FIGURE"===e.nodeName&&!!e.querySelector("img"),schema:({phrasingContentSchema:e})=>({figure:{require:["img"],children:{...Jne,a:{attributes:["href","rel","target"],children:Jne},figcaption:{children:e}}}}),transform:e=>{const t=e.className+" "+e.querySelector("img").className,n=/(?:^|\s)align(left|center|right)(?:$|\s)/.exec(t),r=""===e.id?void 0:e.id,o=n?n[1]:void 0,i=/(?:^|\s)wp-image-(\d+)(?:$|\s)/.exec(t),s=i?Number(i[1]):void 0,a=e.querySelector("a"),l=a&&a.href?"custom":void 0,c=a&&a.href?a.href:void 0,u=a&&a.rel?a.rel:void 0,d=a&&a.className?a.className:void 0;return td("core/image",Th("core/image",e.outerHTML,{align:o,id:s,linkDestination:l,href:c,rel:u,linkClass:d,anchor:r}))}},{type:"files",isMatch(e){if(e.some((e=>0===e.type.indexOf("image/")))&&e.some((e=>0!==e.type.indexOf("image/")))){const{createErrorNotice:e}=(0,fc.J)(Xb.store);e((0,H.__)("If uploading to a gallery all files need to be image formats"),{id:"gallery-transform-invalid-file",type:"snackbar"})}return e.every((e=>0===e.type.indexOf("image/")))},transform(e){const t=e.map((e=>td("core/image",{url:Zl(e)})));return t}},{type:"shortcode",tag:"caption",attributes:{url:{type:"string",source:"attribute",attribute:"src",selector:"img"},alt:{type:"string",source:"attribute",attribute:"alt",selector:"img"},caption:{shortcode:function(e,{shortcode:t}){const{body:n}=document.implementation.createHTMLDocument("");n.innerHTML=t.content;let r=n.querySelector("img");for(;r&&r.parentNode&&r.parentNode!==n;)r=r.parentNode;return r&&r.parentNode.removeChild(r),n.innerHTML.trim()}},href:{shortcode:(e,{shortcode:t})=>Yne(t.content,"href")},rel:{shortcode:(e,{shortcode:t})=>Yne(t.content,"rel")},linkClass:{shortcode:(e,{shortcode:t})=>Yne(t.content,"class")},id:{type:"number",shortcode:({named:{id:e}})=>{if(e)return parseInt(e.replace("attachment_",""),10)}},align:{type:"string",shortcode:({named:{align:e="alignnone"}})=>e.replace("align","")}}}]},Zne=Xne,Qne={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/image",title:"Image",category:"media",usesContext:["allowResize","imageCrop","fixedHeight"],description:"Insert an image to make a visual statement.",keywords:["img","photo","picture"],textdomain:"default",attributes:{url:{type:"string",source:"attribute",selector:"img",attribute:"src",__experimentalRole:"content"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:"",__experimentalRole:"content"},caption:{type:"rich-text",source:"rich-text",selector:"figcaption",__experimentalRole:"content"},lightbox:{type:"object",enabled:{type:"boolean"}},title:{type:"string",source:"attribute",selector:"img",attribute:"title",__experimentalRole:"content"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href",__experimentalRole:"content"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number",__experimentalRole:"content"},width:{type:"string"},height:{type:"string"},aspectRatio:{type:"string"},scale:{type:"string"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{interactivity:!0,align:["left","center","right","wide","full"],anchor:!0,color:{text:!1,background:!1},filter:{duotone:!0},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,width:!0}},shadow:{__experimentalSkipSerialization:!0}},selectors:{border:".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder",shadow:".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder",filter:{duotone:".wp-block-image img, .wp-block-image .components-placeholder"}},styles:[{name:"default",label:"Default",isDefault:!0},{name:"rounded",label:"Rounded"}],editorStyle:"wp-block-image-editor",style:"wp-block-image"},{name:ere}=Qne,tre={icon:iQ.A,example:{attributes:{sizeSlug:"large",url:"https://s.w.org/images/core/5.3/MtBlanc1.jpg",caption:(0,H.__)("Mont Blanc appears—still, snowy, and serene.")}},__experimentalLabel(e,{context:t}){const n=e?.metadata?.name;if("list-view"===t&&n)return n;if("accessibility"===t){const{caption:t,alt:n,url:r}=e;return r?n?n+(t?". "+t:""):t||"":(0,H.__)("Empty")}},getEditWrapperProps:e=>({"data-align":e.align}),transforms:Zne,edit:function({attributes:e,setAttributes:t,isSelected:n,className:r,insertBlocksAfter:o,onReplace:i,context:s,clientId:a,__unstableParentLayout:l}){const{url:c="",alt:u,caption:d,id:h,width:p,height:f,sizeSlug:m,aspectRatio:g,scale:b,align:y,metadata:v}=e,[_,x]=(0,S.useState)((()=>((e,t)=>!e&&ec(t))(h,c)?c:void 0)),w=(0,S.useRef)();(0,S.useEffect)((()=>{w.current=u}),[u]);const k=(0,S.useRef)();(0,S.useEffect)((()=>{k.current=d}),[d]);const{__unstableMarkNextChangeAsNotPersistent:C}=(0,Vl.A)(hv);(0,S.useEffect)((()=>{["wide","full"].includes(y)&&(C(),t({width:void 0,height:void 0,aspectRatio:void 0,scale:void 0}))}),[C,y,t]);const{getSettings:A}=(0,Ul.A)(hv),E=IS(),{createErrorNotice:I}=(0,Vl.A)(Xb.store);function j(e){I(e,{type:"snackbar"}),t({src:void 0,id:void 0,url:void 0}),x(void 0)}function T(n){if(!n||!n.url)return void t({url:void 0,alt:void 0,id:void 0,title:void 0,caption:void 0});if(ec(n.url))return void x(n.url);x();const{imageDefaultSize:r}=A();let o="full";m&&Kne(n,m)?o=m:Kne(n,r)&&(o=r);let i,s=((e,t)=>{const n=Object.fromEntries(Object.entries(null!=e?e:{}).filter((([e])=>["alt","id","link","caption"].includes(e))));return n.url=e?.sizes?.[t]?.url||e?.media_details?.sizes?.[t]?.source_url||e.url,n})(n,o);if(k.current&&!s.caption){const{caption:e,...t}=s;s=t}i=n.id&&n.id===h?{url:c}:{sizeSlug:o};let a,l=e.linkDestination;if(!l)switch(window?.wp?.media?.view?.settings?.defaultProps?.link||One){case"file":case Lne:l=Lne;break;case"post":case Fne:l=Fne;break;case zne:l=zne;break;case One:l=One}switch(l){case Lne:a=n.url;break;case Fne:a=n.link}s.href=a,t({...s,...i,linkDestination:l})}function B(e){e!==c&&t({url:e,id:void 0,sizeSlug:A().imageDefaultSize})}!function(e={}){const t=(0,S.useRef)(e),n=(0,S.useRef)(!1),{getSettings:r}=(0,Ul.A)(hv);(0,S.useLayoutEffect)((()=>{t.current=e})),(0,S.useEffect)((()=>{if(n.current)return;if(!t.current.url||!ec(t.current.url))return;const e=function(e){return Xl[e]}(t.current.url);if(!e)return;const{url:o,allowedTypes:i,onChange:s,onError:a}=t.current,{mediaUpload:l}=r();n.current=!0,l({filesList:[e],allowedTypes:i,onFileChange:([e])=>{ec(e?.url)||(Ql(o),s(e),n.current=!1)},onError:e=>{Ql(o),a(e),n.current=!1}})}),[r])}({url:c,allowedTypes:Une,onChange:T,onError:j});const R=qne(h,c)?c:void 0,N=!!c&&(0,Td.jsx)("img",{alt:(0,H.__)("Edit image"),title:(0,H.__)("Edit image"),className:"edit-image-preview",src:c}),D=kz(e),M=Cz(e),P=oG({className:(0,$v.A)(r,{"is-transient":_,"is-resized":!!p||!!f,[`size-${m}`]:m,"has-custom-border":!!D.className||D.style&&Object.keys(D.style).length>0})}),{lockUrlControls:O=!1,lockUrlControlsMessage:L}=(0,Ul.A)((e=>{if(!n)return{};const t=Sne(e(ed)).getBlockBindingsSource(v?.bindings?.url?.source);return{lockUrlControls:!!v?.bindings?.url&&!t?.canUserEditValue({select:e,context:s,args:v?.bindings?.url?.args}),lockUrlControlsMessage:t?.label?(0,H.sprintf)((0,H.__)("Connected to %s"),t.label):(0,H.__)("Connected to dynamic data")}}),[n,v?.bindings?.url]);return(0,Td.jsxs)("figure",{...P,children:[(0,Td.jsx)(Gne,{temporaryURL:_,attributes:e,setAttributes:t,isSingleSelected:n,insertBlocksAfter:o,onReplace:i,onSelectImage:T,onSelectURL:B,onUploadError:j,context:s,clientId:a,blockEditingMode:E,parentLayoutType:l?.type}),(0,Td.jsx)(oZ,{icon:(0,Td.jsx)(pz,{icon:iQ.A}),onSelect:T,onSelectURL:B,onError:j,placeholder:e=>(0,Td.jsx)(zz,{className:(0,$v.A)("block-editor-media-placeholder",{[D.className]:!!D.className&&!n}),withIllustration:!0,icon:O?kne.A:iQ.A,label:(0,H.__)("Image"),instructions:!O&&(0,H.__)("Upload an image file, pick one from your media library, or add one with a URL."),style:{aspectRatio:p&&f||!g?void 0:g,width:f&&g?"100%":p,height:p&&g?"100%":f,objectFit:b,...D.style,...M.style},children:O?(0,Td.jsx)("span",{className:"block-bindings-media-placeholder-message",children:L}):e}),accept:"image/*",allowedTypes:Une,value:{id:h,src:R},mediaPreview:N,disableMediaButtons:_||c})]})},save:function({attributes:e}){const{url:t,alt:n,caption:r,align:o,href:i,rel:s,linkClass:a,width:l,height:c,aspectRatio:u,scale:d,id:h,linkTarget:p,sizeSlug:f,title:m}=e,g=s||void 0,b=wz(e),y=Cz(e),v=(0,$v.A)({alignnone:"none"===o,[`size-${f}`]:f,"is-resized":l||c,"has-custom-border":!!b.className||b.style&&Object.keys(b.style).length>0}),_=(0,$v.A)(b.className,{[`wp-image-${h}`]:!!h}),x=(0,Td.jsx)("img",{src:t,alt:n,className:_||void 0,style:{...b.style,...y.style,aspectRatio:u,objectFit:d,width:l,height:c},title:m}),w=(0,Td.jsxs)(Td.Fragment,{children:[i?(0,Td.jsx)("a",{className:a,href:i,target:p,rel:g,children:x}):x,!tQ.isEmpty(r)&&(0,Td.jsx)(tQ.Content,{className:k1("caption"),tagName:"figcaption",value:r})]});return(0,Td.jsx)("figure",{...oG.save({className:v}),children:w})},deprecated:wne},nre="core/image",rre={name:nre,examples:null,deprecated:null,save:()=>null},ore={...Qne,...tre,...rre,category:"design",supports:{...Qne.supports,html:!1,anchor:!1}},ire=e=>{const t=uee(e);if(!t[e.type])return null;const n=M5(t[e.type].name,e);return _c(n,t[e.type].settings),n},sre=e=>{let t=null;return Array.isArray(e.errors)&&e.errors.length>0&&(t=e.errors.map((e=>e.message)),t=t.join(", ")),t},are=(e,t)=>e.map((e=>{const n=t(e);return e.innerBlocks?{...n,innerBlocks:are(e.innerBlocks,t)}:n})),lre={async SAVE_FORM(){if((0,pc.L)(A2).getIsFormSaving())return;if((0,fc.J)(A2).saveFormStarted(),(0,pc.L)(A2).getFormErrors().length)return;const e=(0,pc.L)(A2).getFormData(),t=(0,pc.L)(hv).getBlocks(),n=(0,pc.L)(A2).getAllAvailableCustomFields(),r=N2(E2,nf.colors,nf.gradients,n),o={...D2(e),body:r(t),editor_version:2};await _2.U.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"forms",action:"saveEditor",data:o}).done((e=>{(0,fc.J)(A2).saveFormDone(e.data.id),B5.remove(`popup_form_dismissed_${e.data.id}`,{path:"/"})})).fail((e=>{(0,fc.J)(A2).saveFormFailed(sre(e))}))},async SAVE_CUSTOM_FIELD(e){(0,fc.J)(A2).saveCustomFieldStarted();const t=(0,pc.L)(A2).getAllAvailableCustomFields().find((t=>t.id===e.customFieldId)),n={};(0,I2.merge)(n,t,e.data),await _2.U.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"customFields",action:"save",data:n}).then((n=>{(0,fc.J)(A2).saveCustomFieldDone(t.id,n.data),"function"==typeof e.onFinish&&e.onFinish()})).then((()=>{(0,fc.J)(A2).saveForm()})).fail((e=>{(0,fc.J)(A2).saveCustomFieldFailed(sre(e))}))},async CREATE_CUSTOM_FIELD(e){const{clientId:t,data:n}=e;(0,pc.L)(A2).getIsCustomFieldCreating()||((0,fc.J)(A2).createCustomFieldStarted(e.data),(0,pc.L)(A2).getIsCustomFieldCreating()&&await _2.U.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"customFields",action:"save",data:n}).then((e=>{const n=e.data;_2.U.trackEvent("Forms > Add new custom field",{"Field type":n.type});const r=td(ire(n));(0,fc.J)(hv).replaceBlock(t,r),(0,fc.J)(A2).createCustomFieldDone(e.data)})).fail((e=>{(0,fc.J)(A2).createCustomFieldFailed(sre(e))})))},async DELETE_CUSTOM_FIELD(e){const{customFieldId:t,clientId:n}=e;(0,fc.J)(A2).deleteCustomFieldStarted();const r=(0,pc.L)(A2).getAllAvailableCustomFields().find((e=>e.id===t)),o=uee(r);await _2.U.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"customFields",action:"delete",data:{id:t}}).then((()=>{_2.U.trackEvent("Forms > Delete custom field",{"Field type":r.type}),(0,fc.J)(A2).deleteCustomFieldDone(t,n);const e=M5(o[r.type].name,r);Sc(e)&&function(e){const t=(0,pc.L)(ed).getBlockType(e);if(t)return(0,fc.J)(ed).removeBlockTypes(e),t;console.error('Block "'+e+'" is not registered.')}(e),(0,fc.J)(hv).removeBlock(n)})).fail((e=>{(0,fc.J)(A2).deleteCustomFieldFailed(sre(e))}))},APPLY_STYLES_TO_ALL_TEXT_INPUTS(e){const t=(0,pc.L)(A2).getFormBlocks(),n=are(t,(t=>{const n={...t};return["mailpoet-form/last-name-input","mailpoet-form/first-name-input","mailpoet-form/email-input"].includes(t.name)||t.name.startsWith("mailpoet-form/custom-text")?{...n,attributes:{...n.attributes,styles:e.styles}}:n}));(0,fc.J)(hv).resetBlocks(n)},async TUTORIAL_DISMISS(){await _2.U.Ajax.post({api_version:_2.U.apiVersion,endpoint:"user_flags",action:"set",data:{form_editor_tutorial_seen:1}})},BLOCKS_CHANGED_IN_BLOCK_EDITOR(e){const t=e.blocks,n=_5(t,"mailpoet-form/email-input"),r=_5(t,"mailpoet-form/submit-button");if(n&&r)return void(0,fc.J)(A2).changeFormBlocks(t);const o=(0,pc.L)(A2).getFormBlocks(),i=[...t];if(!n){let e=_5(o,"mailpoet-form/email-input");e||(e=td("mailpoet-form/email-input")),i.unshift(e)}if(!r){let e=_5(o,"mailpoet-form/submit-button");e||(e=td("mailpoet-form/submit-button")),i.push(e)}(0,fc.J)(hv).resetBlocks(i)},STORE_LOCALLY(e){const{key:t,value:n}=e;window.localStorage.setItem(t,JSON.stringify(n))},CALL_API:R5.p,ENSURE_BROWSER_URL(e){const{formId:t}=e;let n=(0,pc.L)(A2).getFormEditorUrl();n=`${n}${t}`,window.location.href!==n&&window.history.replaceState(null,"",n)}},cre={width:{unit:"percent",value:100}},ure={formDelay:15,formCookieExpiration:7},dre={styles:{width:{unit:"pixel",value:560}},...ure,animation:"slideup"},hre={styles:{width:{unit:"percent",value:100}},position:"top",...ure,animation:"slideup"},pre={width:{unit:"percent",value:100}},fre={styles:{width:{unit:"pixel",value:560}},position:"right",...ure,animation:"slideup"},mre={formPadding:20,inputPadding:5,borderSize:0,borderRadius:0,alignment:"left",closeButton:"round_white"};function gre(e){const t={...e,settings:{...e.settings,formPlacement:{popup:{enabled:"1"===e.settings.form_placement?.popup?.enabled,exitIntentEnabled:"1"===e.settings.form_placement?.popup?.exit_intent_enabled,delay:void 0!==e.settings.form_placement?.popup?.delay?X7(e.settings.form_placement?.popup?.delay):dre.formDelay,cookieExpiration:void 0!==e.settings.form_placement?.popup?.cookieExpiration?X7(e.settings.form_placement?.popup?.cookieExpiration):dre.formCookieExpiration,animation:void 0!==e.settings.form_placement?.popup?.animation?e.settings.form_placement?.popup?.animation:dre.animation,styles:{...dre.styles,...e.settings.form_placement?.popup?.styles},categories:e.settings.form_placement?.popup?.categories??[],tags:e.settings.form_placement?.popup?.tags??[],posts:{all:"1"===e.settings.form_placement?.popup?.posts?.all,selected:Array.isArray(e.settings.form_placement?.popup?.posts?.selected)?e.settings.form_placement?.popup?.posts?.selected:[]},pages:{all:"1"===e.settings.form_placement?.popup?.pages?.all,selected:Array.isArray(e.settings.form_placement?.popup?.pages?.selected)?e.settings.form_placement?.popup?.pages?.selected:[]},homepage:"1"===e.settings.form_placement?.popup?.homepage,tagArchives:{all:"1"===e.settings.form_placement?.popup?.tagArchives?.all,selected:Array.isArray(e.settings.form_placement?.popup?.tagArchives?.selected)?e.settings.form_placement?.popup?.tagArchives?.selected:[]},categoryArchives:{all:"1"===e.settings.form_placement?.popup?.categoryArchives?.all,selected:Array.isArray(e.settings.form_placement?.popup?.categoryArchives?.selected)?e.settings.form_placement?.popup?.categoryArchives?.selected:[]}},fixedBar:{enabled:"1"===e.settings.form_placement?.fixed_bar?.enabled,delay:void 0!==e.settings.form_placement?.fixed_bar?.delay?X7(e.settings.form_placement?.fixed_bar?.delay):hre.formDelay,cookieExpiration:void 0!==e.settings.form_placement?.fixed_bar?.cookieExpiration?X7(e.settings.form_placement?.fixed_bar?.cookieExpiration):hre.formCookieExpiration,animation:e.settings.form_placement?.fixed_bar?.animation??hre.animation,styles:{...hre.styles,...e.settings.form_placement?.fixed_bar?.styles},position:e.settings.form_placement?.fixed_bar?.position??hre.position,categories:e.settings.form_placement?.fixed_bar?.categories??[],tags:e.settings.form_placement?.fixed_bar?.tags??[],posts:{all:"1"===e.settings.form_placement?.fixed_bar?.posts?.all,selected:Array.isArray(e.settings.form_placement?.fixed_bar?.posts?.selected)?e.settings.form_placement?.fixed_bar?.posts?.selected:[]},pages:{all:"1"===e.settings.form_placement?.fixed_bar?.pages?.all,selected:Array.isArray(e.settings.form_placement?.fixed_bar?.pages?.selected)?e.settings.form_placement?.fixed_bar?.pages?.selected:[]},homepage:"1"===e.settings.form_placement?.fixed_bar?.homepage,tagArchives:{all:"1"===e.settings.form_placement?.fixed_bar?.tagArchives?.all,selected:Array.isArray(e.settings.form_placement?.fixed_bar?.tagArchives?.selected)?e.settings.form_placement?.fixed_bar?.tagArchives?.selected:[]},categoryArchives:{all:"1"===e.settings.form_placement?.fixed_bar?.categoryArchives?.all,selected:Array.isArray(e.settings.form_placement?.fixed_bar?.categoryArchives?.selected)?e.settings.form_placement?.fixed_bar?.categoryArchives?.selected:[]}},belowPosts:{enabled:"1"===e.settings.form_placement?.below_posts?.enabled,styles:{...cre,...e.settings.form_placement?.below_posts?.styles},categories:e.settings.form_placement?.below_posts?.categories??[],tags:e.settings.form_placement?.below_posts?.tags??[],posts:{all:"1"===e.settings.form_placement?.below_posts?.posts?.all,selected:Array.isArray(e.settings.form_placement?.below_posts?.posts?.selected)?e.settings.form_placement?.below_posts?.posts?.selected:[]},pages:{all:"1"===e.settings.form_placement?.below_posts?.pages?.all,selected:Array.isArray(e.settings.form_placement?.below_posts?.pages?.selected)?e.settings.form_placement?.below_posts?.pages?.selected:[]}},slideIn:{enabled:"1"===e.settings.form_placement?.slide_in?.enabled,delay:void 0!==e.settings.form_placement?.slide_in?.delay?X7(e.settings.form_placement?.slide_in?.delay):fre.formDelay,cookieExpiration:void 0!==e.settings.form_placement?.slide_in?.cookieExpiration?X7(e.settings.form_placement?.slide_in?.cookieExpiration):fre.formCookieExpiration,position:e.settings.form_placement?.slide_in?.position??fre.position,animation:e.settings.form_placement?.slide_in?.animation??fre.animation,styles:{...fre.styles,...e.settings.form_placement?.slide_in?.styles},categories:e.settings.form_placement?.slide_in?.categories??[],tags:e.settings.form_placement?.slide_in?.tags??[],posts:{all:"1"===e.settings.form_placement?.slide_in?.posts?.all,selected:Array.isArray(e.settings.form_placement?.slide_in?.posts?.selected)?e.settings.form_placement?.slide_in?.posts?.selected:[]},pages:{all:"1"===e.settings.form_placement?.slide_in?.pages?.all,selected:Array.isArray(e.settings.form_placement?.slide_in?.pages?.selected)?e.settings.form_placement?.slide_in?.pages?.selected:[]},homepage:"1"===e.settings.form_placement?.slide_in?.homepage,tagArchives:{all:"1"===e.settings.form_placement?.slide_in?.tagArchives?.all,selected:Array.isArray(e.settings.form_placement?.slide_in?.tagArchives?.selected)?e.settings.form_placement?.slide_in?.tagArchives?.selected:[]},categoryArchives:{all:"1"===e.settings.form_placement?.slide_in?.categoryArchives?.all,selected:Array.isArray(e.settings.form_placement?.slide_in?.categoryArchives?.selected)?e.settings.form_placement?.slide_in?.categoryArchives?.selected:[]}},others:{styles:{...pre,...e.settings.form_placement?.others?.styles}}},alignment:e.settings.alignment??mre.alignment,borderRadius:void 0!==e.settings.border_radius?X7(e.settings.border_radius):mre.borderRadius,borderSize:void 0!==e.settings.border_size?X7(e.settings.border_size):mre.borderSize,formPadding:void 0!==e.settings.form_padding?X7(e.settings.form_padding):mre.formPadding,inputPadding:void 0!==e.settings.input_padding?X7(e.settings.input_padding):mre.inputPadding,borderColor:e.settings.border_color,fontFamily:e.settings.font_family,fontSize:e.settings.fontSize,successValidationColor:e.settings.success_validation_color,errorValidationColor:e.settings.error_validation_color,backgroundImageUrl:e.settings.background_image_url,backgroundImageDisplay:e.settings.background_image_display,closeButton:e.settings.close_button??mre.closeButton}};return t.settings.formPlacement.belowPosts.styles.width.value=X7(t.settings.formPlacement.belowPosts.styles.width.value),t.settings.formPlacement.slideIn.styles.width.value=X7(t.settings.formPlacement.slideIn.styles.width.value),t.settings.formPlacement.fixedBar.styles.width.value=X7(t.settings.formPlacement.fixedBar.styles.width.value),t.settings.formPlacement.popup.styles.width.value=X7(t.settings.formPlacement.popup.styles.width.value),t.settings.formPlacement.others.styles.width.value=X7(t.settings.formPlacement.others.styles.width.value),delete t.settings.border_radius,delete t.settings.border_size,delete t.settings.border_color,delete t.settings.input_padding,delete t.settings.form_padding,delete t.settings.close_button,delete t.settings.font_family,delete t.settings.background_image_display,delete t.settings.background_image_url,t}function bre(e){const t=(0,Ul.A)((e=>e(A2).hasEditorUndo()),[]),{historyUndo:n}=(0,Vl.A)(A2),{registerShortcut:r}=(0,Vl.A)("core/keyboard-shortcuts");return(0,OU.wk)("mailpoet-form-editor/undo",(e=>{n(),e.preventDefault()})),(0,S.useEffect)((()=>{r({name:"mailpoet-form-editor/undo",category:"block",description:(0,H.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}})}),[r]),(0,Td.jsx)(Zv.Ay,{...e,icon:S2.A,label:(0,H.__)("Undo"),shortcut:VE.displayShortcut.primary("z"),"aria-disabled":!t,onClick:t?()=>{n()}:void 0,className:"editor-history__undo"})}var yre=n(93190);function vre(e){const t=(0,Ul.A)((e=>e(A2).hasEditorRedo()),[]),{historyRedo:n}=(0,Vl.A)(A2),{registerShortcut:r}=(0,Vl.A)("core/keyboard-shortcuts"),o=()=>{n()};return(0,OU.wk)("mailpoet-form-editor/redo",(e=>{o(),e.preventDefault()})),(0,S.useEffect)((()=>{r({name:"mailpoet-form-editor/redo",category:"block",description:(0,H.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"}})}),[r]),(0,Td.jsx)(Zv.Ay,{...e,icon:yre.A,label:(0,H.__)("Redo"),shortcut:VE.displayShortcut.primaryShift("z"),"aria-disabled":!t,onClick:t?o:void 0,className:"editor-history__redo"})}function _re({isInserterOpened:e,setIsInserterOpened:t}){const{sidebarOpened:n,isFormSaving:r,isPreview:o,isFullscreen:i,isListViewOpened:s}=(0,Ul.A)((e=>({sidebarOpened:e(A2).getSidebarOpened(),isFormSaving:e(A2).getIsFormSaving(),isPreview:e(A2).getIsPreviewShown(),isFullscreen:e(A2).isFullscreenEnabled(),isListViewOpened:e(A2).isListViewOpened()})),[]),{toggleListView:a,toggleSidebar:l,saveForm:c,showPreview:u,toggleFullscreen:d}=(0,Vl.A)(A2);return(0,Td.jsxs)("div",{className:"editor-header edit-post-header",children:[(0,Td.jsxs)("div",{className:"editor-header__settings",children:[(0,Td.jsx)(Zv.Ay,{variant:"secondary",onClick:u,isPressed:o,className:"mailpoet-preview-button","data-automation-id":"form_preview_button",children:(0,H.__)("Preview")}),(0,Td.jsx)(Zv.Ay,{variant:"primary",className:"editor-post-publish-button","data-automation-id":"form_save_button",isBusy:r,onClick:c,children:r?`${(0,H.__)("Saving")}`:(0,H.__)("Save")}),(0,Td.jsx)(Zv.Ay,{icon:"admin-generic",label:_2.U.I18n.t("formSettings"),tooltipPosition:"down",onClick:()=>l(!n),isPressed:n,className:"mailpoet-editor-header-button"}),(0,Td.jsx)(i_.A,{icon:eA.A,label:(0,H.__)("More tools & options"),className:"edit-post-more-menu",popoverProps:{className:"edit-post-more-menu__content"},children:()=>(0,Td.jsx)(w_.A,{label:(0,H._x)("View","noun"),className:"mailpoet-dropdown-menu-group",children:(0,Td.jsx)(C2,{shortcut:"Ctrl+Shift+Alt+F",label:(0,H.__)("Fullscreen mode"),info:(0,H.__)("Work without distraction"),isActive:i,onToggle:()=>d(!i)})})})]}),(0,Td.jsx)("div",{className:"editor-header__toolbar",children:(0,Td.jsx)("div",{className:"toolbar edit-post-header-toolbar",children:(0,Td.jsxs)("div",{className:"editor-document-tools__left",children:[(0,Td.jsx)(Zv.Ay,{variant:"secondary",href:"?page=mailpoet-forms#/",className:"mailpoet-editor-header-button",children:_2.U.I18n.t("back")}),(0,Td.jsx)(Qv.A,{as:Zv.Ay,"data-automation-id":"form_inserter_open",className:"edit-post-header-toolbar__inserter-toggle",variant:"primary",isPressed:e,onClick:()=>t(!e),icon:QS.A,label:(0,H._x)("Add block","Generic label for block inserter button")}),(0,Td.jsx)(bre,{"data-automation-id":"form_undo_button"}),(0,Td.jsx)(vre,{"data-automation-id":"form_redo_button"}),(0,Td.jsx)(Qv.A,{as:Zv.Ay,"data-automation-id":"form_listview_open",isPressed:s,onClick:()=>a(),icon:LQ.A,label:(0,H.__)("List view","mailpoet"),showTooltip:!0})]})})})]})}_re.propTypes={isInserterOpened:k2().bool.isRequired,setIsInserterOpened:k2().func.isRequired},_re.displayName="FormEditorHeader";var xre=n(11021),wre=n(49790);function kre(){const e=(0,Ul.A)((e=>e(A2).getTutorialUrl()),[]),t=(0,Ul.A)((e=>e(A2).getTutorialSeen()),[]),{tutorialDismissed:n}=(0,Vl.A)(A2),r=(0,S.useCallback)((()=>{n()}),[n]);return t?null:(0,Td.jsx)(xre.a,{isDismissible:!0,onRequestClose:r,children:(0,Td.jsxs)("div",{className:"mailpoet_drag_and_drop_tutorial","data-automation-id":"form-editor-tutorial",children:[(0,Td.jsx)(wre.D,{level:2,children:_2.U.I18n.t("tutorialHeading")}),(0,Td.jsx)("video",{style:{height:"640px"},src:e,controls:!0,autoPlay:!0})]})})}var Cre=n(17367),Sre=n(41669),Are=n.n(Sre),Ere=n(5668);n(79537);class Ire extends S.Component{constructor(e){super(e),this.selectRef=(0,S.createRef)()}componentDidMount(){this.isSelect2Component()&&this.setupSelect2()}componentDidUpdate(e){const{field:t,item:n}=this.props;void 0!==n&&void 0!==e.item&&n.id!==e.item.id&&Are()(`#${this.selectRef.current.id}`).val(this.getSelectedValues()).trigger("change"),void 0!==n&&void 0!==e.item&&this.allowMultipleValues()&&Ere.default.isArray(n[t.name])&&!Ere.default.isEqual(n[t.name],e.item[t.name])&&Are()(`#${this.selectRef.current.id}`).val(this.getSelectedValues()).trigger("change"),this.isSelect2Initialized()&&this.getFieldId(this.props)!==this.getFieldId(e)&&void 0!==t.resetSelect2OnUpdate&&this.resetSelect2()}componentWillUnmount(){this.isSelect2Component()&&this.destroySelect2()}getFieldId=e=>{const t=e||this.props;return t.field.id||t.field.name};getSelectedValues=()=>{const{field:e,item:t}=this.props;if(void 0!==e.selected)return e.selected(t);if(void 0!==t&&void 0!==e.name){if(!this.allowMultipleValues())return t[e.name];if(Ere.default.isArray(t[e.name]))return t[e.name].map((e=>e.id))}return null};getItems=()=>{const{field:e}=this.props;let t;return void 0!==window[`mailpoet_${e.endpoint}`]?t=window[`mailpoet_${e.endpoint}`]:void 0!==e.values&&(t=e.values),Ere.default.isArray(t)&&void 0!==e.filter&&(t=t.filter(e.filter)),t};getLabel=e=>{const{field:t,item:n}=this.props;return void 0!==t.getLabel?t.getLabel(e,n):e.name};getSearchLabel=e=>{const{field:t,item:n}=this.props;return void 0!==t.getSearchLabel?t.getSearchLabel(e,n):null};getValue=e=>{const{field:t,item:n}=this.props;return void 0!==t.getValue?t.getValue(e,n):e.id};setupSelect2=()=>{if(this.isSelect2Initialized())return;const{field:e,disabled:t=!1,dropDownParent:n,width:r=""}=this.props;let o={disabled:t||!1,width:r||"",placeholder:{id:"",text:e.placeholder},templateResult:function(e){return e.element&&e.element.selected?null:e.title?e.title:e.text}};n&&(o.dropdownParent=Are()(n));const i=e.remoteQuery||null;i&&(o=Object.assign(o,{ajax:{url:window.ajaxurl,type:"POST",dataType:"json",data:function(e){return{action:"mailpoet",api_version:window.mailpoet_api_version,token:window.mailpoet_token,endpoint:i.endpoint,method:i.method,data:Object.assign(i.data,{query:e.term})}},processResults:function(e){let t;return t=Ere.default.has(e,"data")?e.data.map((e=>({id:e.id||e.value,text:e.name||e.text}))):[],{results:t}}},minimumInputLength:i.minimumInputLength||2})),void 0!==e.extendSelect2Options&&(o=Object.assign(o,e.extendSelect2Options));const s=Are()(`#${this.selectRef.current.id}`).select2(o);let a=!1;s.on("select2:unselecting",(()=>{a=!0})),s.on("select2:opening",(e=>{!0===a&&(a=!1,e.preventDefault())})),s.on("change",this.handleChange)};resetSelect2=()=>{this.destroySelect2(),this.setupSelect2()};destroySelect2=()=>{this.isSelect2Initialized()&&(Are()(`#${this.selectRef.current.id}`).select2("destroy"),this.cleanupAfterSelect2())};cleanupAfterSelect2=()=>{Are()(`#${this.selectRef.current.id}`).find("option:not(.default)").remove(),Are()(`#${this.selectRef.current.id}`).off("select2:unselecting").off("select2:opening")};allowMultipleValues=()=>!0===this.props.field.multiple;isSelect2Initialized=()=>!0===Are()(`#${this.selectRef.current.id}`).hasClass("select2-hidden-accessible");isSelect2Component=()=>this.allowMultipleValues()||this.props.field.forceSelect2;handleChange=e=>{const{field:t,onValueChange:n}=this.props;if("function"!=typeof n)return;const r=Are()(`#${this.selectRef.current.id}`).children(":selected").map((function(){return{id:Are()(this).val(),text:Are()(this).text()}})),o=t.multiple?Ere.default.pluck(r,"id"):Ere.default.pluck(r,"id").toString();n({target:{value:this.transformChangedValue(o,r),name:t.name,id:e.target.id}})};transformChangedValue=(e,t)=>{const{field:n}=this.props;return"function"==typeof n.transformChangedValue?n.transformChangedValue.call(this,e,t):e};insertEmptyOption=()=>{const{field:e}=this.props;if(!this.allowMultipleValues())return e.placeholder?(0,Td.jsx)("option",{className:"default"}):void 0};render(){const{field:e}=this.props,t=this.getItems(e),n=this.getSelectedValues(),r=t.map((e=>{const t=this.getLabel(e),n=this.getSearchLabel(e),r=this.getValue(e);return(0,Td.jsx)("option",{className:"default",value:r,title:n,children:t},`option-${e.id}`)}));return(0,Td.jsxs)("select",{id:this.getFieldId(),ref:this.selectRef,disabled:e.disabled,"data-placeholder":e.placeholder,multiple:e.multiple,defaultValue:n,...e.validation,children:[this.insertEmptyOption(),r]})}}Ire.propTypes={onValueChange:k2().func,field:k2().shape({name:k2().string.isRequired,values:k2().oneOfType([k2().object,k2().array]),getLabel:k2().func,resetSelect2OnUpdate:k2().bool,selected:k2().func,endpoint:k2().string,filter:k2().func,getSearchLabel:k2().func,getValue:k2().func,placeholder:k2().string,remoteQuery:k2().object,extendSelect2Options:k2().object,multiple:k2().bool,forceSelect2:k2().bool,transformChangedValue:k2().func,disabled:k2().bool,validation:k2().shape({"data-parsley-required":k2().bool,"data-parsley-required-message":k2().string,"data-parsley-type":k2().string,"data-parsley-errors-container":k2().string,maxLength:k2().number})}).isRequired,item:k2().object,disabled:k2().bool,width:k2().string,dropDownParent:k2().string},Ire.displayName="FormEditorSelection";const jre=(0,v2.withBoundary)(Ire);function Tre(){const[e,t]=(0,S.useState)(!1),n=(0,Ul.A)((e=>e(A2).getFormName()),[]),r=B()({"is-selected":e}),{changeFormName:o}=(0,Vl.A)(A2);return(0,Td.jsxs)("div",{className:r,children:[(0,Td.jsx)("label",{htmlFor:"post-title",className:"screen-reader-text",children:_2.U.I18n.t("addFormName")}),(0,Td.jsx)("input",{id:"form-title",className:"form-editor-title",placeholder:_2.U.I18n.t("addFormName"),"data-automation-id":"form_title_input",type:"text",onKeyPress:()=>t(!1),onBlur:()=>t(!1),onChange:e=>o(e.target.value),value:n})]})}function Bre({onToggle:e,isOpened:t}){const{settings:n,segments:r,pages:o,missingListError:i,isFormEnabled:s}=(0,Ul.A)((e=>({settings:e(A2).getFormSettings(),segments:e(A2).getAllAvailableSegments(),pages:e(A2).getAllWPPages(),missingListError:e(A2).getNotice("missing-lists"),isFormEnabled:e(A2).isFormEnabled()})),[]),{changeFormSettings:a,toggleForm:l}=(0,Vl.A)(A2),c=n.segments?r.filter((e=>n.segments.includes(e.id.toString()))):[],u=i&&!c.length;return(0,Td.jsx)(F5.A,{children:(0,Td.jsxs)(aF.Ay,{title:_2.U.I18n.t("formSettings"),opened:t,onToggle:e,children:[(0,Td.jsx)(Tre,{}),(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("displayForm"),checked:s,onChange:l}),(0,Td.jsxs)($_.Ay,{label:_2.U.I18n.t("settingsListLabel"),className:B()({"mailpoet-form-missing-lists":u}),children:[u?(0,Td.jsx)("span",{className:"mailpoet-form-lists-error",children:_2.U.I18n.t("settingsPleaseSelectList")}):null,(0,Td.jsx)(jre,{item:{segments:c},onValueChange:e=>{(0,I2.isEqual)(n.segments,e.target.value)||a({...n,segments:e.target.value})},field:{id:"segments",name:"segments",values:r,multiple:!0,placeholder:_2.U.I18n.t("settingsPleaseSelectList"),getLabel:e=>`${e.name} (${parseInt(e.subscribers,10).toLocaleString()})`,filter:e=>!(e.deleted_at||"default"!==e.type)}})]}),(0,Td.jsx)(Cre.A,{className:"mailpoet-form-inline-radios__control",onChange:e=>{a({...n,on_success:e})},selected:n.on_success||"message",label:_2.U.I18n.t("settingsAfterSubmit"),options:[{label:_2.U.I18n.t("settingsShowMessage"),value:"message"},{label:_2.U.I18n.t("settingsGoToPage"),value:"page"}]}),"page"===n.on_success?(0,Td.jsx)(_T.A,{value:n.success_page,options:o.map((e=>({value:e.id.toString(),label:e.name}))),onChange:e=>{a({...n,success_page:e})}}):(0,Td.jsx)(A1.A,{value:n.success_message,onChange:e=>{a({...n,success_message:e})},rows:3})]})})}function Rre({name:e,imageUrl:t,onImageUrlChange:n,imageDisplay:r,onImageDisplayChange:o}){return(0,Td.jsxs)("div",{className:"mailpoet-styles-settings-image-url",children:[(0,Td.jsx)($_.Ay.VisualLabel,{children:e}),(0,Td.jsxs)("div",{className:"mailpoet-styles-settings-image-url-body",children:[(0,Td.jsx)("input",{type:"text",value:t??"",onChange:e=>n(e.target.value)}),(0,Td.jsx)(WE,{onSelect:e=>n(e.url),allowedTypes:["image"],render:({open:e})=>(0,Td.jsx)(Zv.Ay,{variant:"secondary",size:"small",onClick:e,children:_2.U.I18n.t("formSettingsStylesSelectImage")})})]}),(0,Td.jsx)("div",{className:"mailpoet-styles-settings-image-url-display",children:(0,Td.jsx)(_T.A,{value:r,options:[{label:_2.U.I18n.t("imagePlacementScale"),value:"scale"},{label:_2.U.I18n.t("imagePlacementFit"),value:"fit"},{label:_2.U.I18n.t("imagePlacementTile"),value:"tile"}],onChange:o})})]})}Bre.propTypes={onToggle:k2().func.isRequired,isOpened:k2().bool.isRequired},Bre.displayName="FormEditorBasicSettingsPanel";const Nre=(0,Td.jsx)(pw.t4,{width:"14px",height:"14px",viewBox:"0 0 14 14",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:(0,Td.jsx)(pw.G,{id:"Symbols",stroke:"none",strokeWidth:"1",children:(0,Td.jsx)(pw.G,{id:"icons/ic_settings",children:(0,Td.jsx)(pw.wA,{d:"M8.05,0 L8.05101528,2.11065231 C8.65254335,2.23933489 9.2139617,2.47621094 9.71391655,2.7999267 L11.2072853,1.30779041 L12.6922096,2.79271465 L11.199432,4.28509331 C11.5234762,4.78529701 11.7605802,5.34705952 11.8893477,5.94898472 L14,5.95 L14,8.05 L11.8895604,8.05002048 C11.7608414,8.65232154 11.5236547,9.21442744 11.199432,9.71490669 L12.6922096,11.2072853 L11.2072853,12.6922096 L9.71391655,11.2000733 C9.2139617,11.5237891 8.65254335,11.7606651 8.05101528,11.8893477 L8.05,14 L5.95,14 L5.94898472,11.8893477 C5.34705952,11.7605802 4.78529701,11.5234762 4.28509331,11.199432 L2.79271465,12.6922096 L1.30779041,11.2072853 L2.7999267,9.71391655 C2.4760325,9.21368611 2.23907376,8.65192438 2.11043961,8.05002048 L8.8817842e-16,8.05 L1.01676633e-15,5.95 L2.11065231,5.94898472 C2.23933489,5.34745665 2.47621094,4.7860383 2.7999267,4.28608345 L1.30779041,2.79271465 L2.79271465,1.30779041 L4.28509331,2.80056797 C4.78529701,2.47652376 5.34705952,2.23941984 5.94898472,2.11065231 L5.95,0 L8.05,0 Z M7,4 C5.34314575,4 4,5.34314575 4,7 C4,8.65685425 5.34314575,10 7,10 C8.65685425,10 10,8.65685425 10,7 C10,5.34314575 8.65685425,4 7,4 Z",id:"ic_settings"})})})}),Dre=(0,Td.jsx)(pw.t4,{width:"13",height:"13",viewBox:"4 4 16 16",xmlns:"http://www.w3.org/2000/svg",children:(0,Td.jsx)(pw.G,{id:"icons/checkbox-on-small",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:(0,Td.jsx)(pw.wA,{d:"M12,4 C16.418278,4 20,7.581722 20,12 C20,16.418278 16.418278,20 12,20 C7.581722,20 4,16.418278 4,12 C4,7.581722 7.581722,4 12,4 Z M15.5939818,8.20494484 C15.1497095,7.86124495 14.5235958,7.95992422 14.1955177,8.42535116 L14.1955177,8.42535116 L11.2218999,12.6438652 L9.73479332,10.9561217 C9.36019283,10.530981 8.72753928,10.5044698 8.32172209,10.8969074 C7.91590488,11.289345 7.89059874,11.9521231 8.26519924,12.3772638 L8.26519924,12.3772638 L10.5728715,14.9962817 C10.9986562,15.4795122 11.7391892,15.4370557 12.1120948,14.9080343 L12.1120948,14.9080343 L15.8043703,9.66999857 C16.1324484,9.20457165 16.0382543,8.54864475 15.5939818,8.20494484 Z",id:"Combined-Shape",fill:"#ff5301",fillRule:"nonzero"})})});function Mre({label:e,active:t,onClick:n,children:r,canBeActive:o=!0,className:i,automationId:s,displaySettingsIcon:a=!0}){const[l,c]=(0,S.useState)(!1);return(0,Td.jsxs)("div",{"data-automation-id":s,className:B()(i,"selection-item",{"selection-item-active":t&&o}),onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onClick:n,onKeyDown:e=>{["keydown","keypress"].includes(e.type)&&["Enter"," "].includes(e.key)&&(e.preventDefault(),n())},role:"button",tabIndex:0,children:[(0,Td.jsxs)("div",{className:"selection-item-body",children:[(0,Td.jsxs)("div",{className:"selection-item-settings",children:[a?(0,Td.jsx)("div",{className:B()("selection-item-icon",{"selection-item-icon-hover":l}),children:Nre}):(0,Td.jsx)("div",{}),l&&!t&&o&&(0,Td.jsx)("div",{className:"selection-item-settings-oval"}),t&&o&&(0,Td.jsx)("div",{className:"selection-item-check",children:Dre})]}),r]}),l&&(0,Td.jsx)("div",{className:"selection-item-overlay"})]},e)}function Pre({label:e,active:t,onClick:n,iconUrl:r}){return(0,Td.jsx)(Mre,{label:e,onClick:n,active:t,canBeActive:!0,displaySettingsIcon:!1,className:"close-button-selection-item",children:(0,Td.jsx)("img",{src:r,alt:e.replace("_"," "),className:"close-button-selection-item-icon"})})}function Ore({name:e,value:t,onChange:n}){const r=(0,Ul.A)((e=>e(A2).getCloseIconsUrl()),[]);return(0,Td.jsxs)("div",{children:[(0,Td.jsx)($_.Ay.VisualLabel,{children:e}),(0,Td.jsxs)("div",{className:"close-button-selection-item-list",children:[(0,Td.jsx)(Pre,{label:"round_white",active:"round_white"===t,iconUrl:r.replace("img/form_close_icon","img/form_close_icon/round_white.svg"),onClick:()=>n("round_white")}),(0,Td.jsx)(Pre,{label:"round_black",active:"round_black"===t,iconUrl:r.replace("img/form_close_icon","img/form_close_icon/round_black.svg"),onClick:()=>n("round_black")}),(0,Td.jsx)(Pre,{label:"square_white",active:"square_white"===t,iconUrl:r.replace("img/form_close_icon","img/form_close_icon/square_white.svg"),onClick:()=>n("square_white")}),(0,Td.jsx)(Pre,{label:"square_black",active:"square_black"===t,iconUrl:r.replace("img/form_close_icon","img/form_close_icon/square_black.svg"),onClick:()=>n("square_black")}),(0,Td.jsx)(Pre,{label:"classic",active:"classic"===t,iconUrl:r.replace("img/form_close_icon","img/form_close_icon/classic.svg"),onClick:()=>n("classic")}),(0,Td.jsx)(Pre,{label:"classic_white",active:"classic_white"===t,iconUrl:r.replace("img/form_close_icon","img/form_close_icon/classic_white.svg"),onClick:()=>n("classic_white")})]})]})}function Lre({onToggle:e,isOpened:t}){const{changeFormSettings:n}=(0,Vl.A)(A2),r=(0,Ul.A)((e=>e(A2).getFormSettings()),[]),o=(0,S.useRef)(r);(0,S.useEffect)((()=>{o.current=r}),[r]);const i=(e,t)=>{const r={...o.current};r[e]=t??mre[e]??void 0,n(r),o.current=r};return(0,Td.jsx)(F5.A,{children:(0,Td.jsx)(aF.Ay,{title:_2.U.I18n.t("formSettingsStyles"),opened:t,onToggle:e,children:(0,Td.jsxs)("div",{className:"mailpoet-styles-settings",children:[(0,Td.jsx)(h4,{title:_2.U.I18n.t("formSettingsColor"),settings:[{label:_2.U.I18n.t("formSettingsStylesBackground"),colorValue:r.backgroundColor,gradientValue:r.gradient,onColorChange:(0,I2.partial)(i,"backgroundColor"),onGradientChange:(0,I2.partial)(i,"gradient")},{label:_2.U.I18n.t("formSettingsStylesFont"),colorValue:r.fontColor,onColorChange:(0,I2.partial)(i,"fontColor")},{label:_2.U.I18n.t("formSettingsBorder"),colorValue:r.borderColor,onColorChange:(0,I2.partial)(i,"borderColor")}]}),(0,Td.jsx)(Rre,{name:_2.U.I18n.t("formSettingsStylesBackgroundImage"),imageUrl:r.backgroundImageUrl,onImageUrlChange:(0,I2.partial)(i,"backgroundImageUrl"),imageDisplay:r.backgroundImageDisplay,onImageDisplayChange:(0,I2.partial)(i,"backgroundImageDisplay")}),(0,Td.jsx)(gee,{value:r.fontSize,onChange:(0,I2.partial)(i,"fontSize")}),(0,Td.jsx)(yee,{name:_2.U.I18n.t("formSettingsStylesFontFamily"),value:r.fontFamily,onChange:(0,I2.partial)(i,"fontFamily")}),(0,Td.jsx)(FC,{label:_2.U.I18n.t("formSettingsInputPadding"),value:r.inputPadding,min:0,max:30,allowReset:!0,onChange:(0,I2.partial)(i,"inputPadding")}),(0,Td.jsx)(FC,{label:_2.U.I18n.t("formSettingsBorderSize"),value:void 0!==r.borderSize?r.borderSize:0,min:0,max:10,allowReset:!0,onChange:(0,I2.partial)(i,"borderSize"),className:"mailpoet-automation-styles-border-size"}),(0,Td.jsx)(FC,{label:_2.U.I18n.t("formSettingsBorderRadius"),value:void 0!==r.borderRadius?r.borderRadius:0,min:0,max:40,allowReset:!0,onChange:(0,I2.partial)(i,"borderRadius")}),(0,Td.jsx)(_T.A,{label:_2.U.I18n.t("formSettingsAlignment"),onChange:(0,I2.partial)(i,"alignment"),options:[{value:m4.Left,label:_2.U.I18n.t("formSettingsAlignmentLeft")},{value:m4.Center,label:_2.U.I18n.t("formSettingsAlignmentCenter")},{value:m4.Right,label:_2.U.I18n.t("formSettingsAlignmentRight")}],value:r.alignment}),(0,Td.jsx)(FC,{label:_2.U.I18n.t("formSettingsFormPadding"),value:r.formPadding,min:0,max:40,allowReset:!0,onChange:(0,I2.partial)(i,"formPadding")}),(0,Td.jsx)(h4,{title:_2.U.I18n.t("validationMessageColor"),settings:[{label:_2.U.I18n.t("successValidationColorTitle"),colorValue:r.successValidationColor,onColorChange:(0,I2.partial)(i,"successValidationColor")},{label:_2.U.I18n.t("errorValidationColorTitle"),colorValue:r.errorValidationColor,onColorChange:(0,I2.partial)(i,"errorValidationColor")}]}),(0,Td.jsx)(Ore,{name:_2.U.I18n.t("closeButtonHeading"),value:r.closeButton,onChange:(0,I2.partial)(i,"closeButton")})]})})})}const Fre=(0,Td.jsxs)(pw.t4,{width:"144",height:"120",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 144 120",children:[(0,Td.jsxs)("defs",{children:[(0,Td.jsx)(pw.rw,{id:"a",x:"8",y:"8",width:"128",height:"68",rx:"1"}),(0,Td.jsx)(pw.rw,{id:"b",x:"8",y:"100",width:"128",height:"12",rx:"1"})]}),(0,Td.jsxs)(pw.G,{fill:"none",fillRule:"evenodd",children:[(0,Td.jsx)(pw.wA,{d:"M4 0h136a4 4 0 0 1 4 4v112a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#FFF",fillRule:"nonzero"}),(0,Td.jsx)("use",{fill:"#FFF",xlinkHref:"#a"}),(0,Td.jsx)("use",{fillOpacity:".4",fill:"#E5E9F8",xlinkHref:"#a"}),(0,Td.jsx)("use",{fill:"#FFF",xlinkHref:"#b"}),(0,Td.jsx)("use",{fillOpacity:".4",fill:"#E5E9F8",xlinkHref:"#b"}),(0,Td.jsx)(pw.rw,{fill:"#FF5301",fillRule:"nonzero",x:"98",y:"84",width:"38",height:"8",rx:"1"}),(0,Td.jsx)(pw.rw,{fill:"#FFE0D0",fillRule:"nonzero",x:"53",y:"84",width:"38",height:"8",rx:"1"}),(0,Td.jsx)(pw.rw,{fill:"#FFE0D0",fillRule:"nonzero",x:"8",y:"84",width:"38",height:"8",rx:"1"})]})]});function zre({label:e,icon:t,active:n,canBeActive:r=!0,onClick:o}){return(0,Td.jsxs)(Mre,{label:e,onClick:o,active:n,canBeActive:r,className:"form-placement-option",automationId:`form-placement-option-${e}`,children:[(0,Td.jsx)("div",{className:"form-placement-option-icon",children:t}),(0,Td.jsx)("div",{className:"form-placement-option-label",children:(0,Td.jsx)("p",{children:e})})]})}function Ure(){const e=(0,Ul.A)((e=>e(A2).getFormSettings()),[]),{showPlacementSettings:t}=(0,Vl.A)(A2);return(0,Td.jsx)(zre,{active:e.formPlacement.belowPosts.enabled,label:_2.U.I18n.t("placeFormBellowPages"),icon:Fre,onClick:()=>{t("below_posts")},canBeActive:!0})}const Vre=(0,Td.jsxs)(pw.t4,{width:"144",height:"120",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 144 120",children:[(0,Td.jsxs)("defs",{children:[(0,Td.jsx)(pw.rw,{id:"popup_icon_a",x:"8",y:"8",width:"128",height:"104",rx:"1"}),(0,Td.jsx)(pw.wA,{d:"M49 34h46a4 4 0 0 1 4 4v40a4 4 0 0 1-4 4H49a4 4 0 0 1-4-4V38a4 4 0 0 1 4-4z",id:"popup_icon_c"}),(0,Td.jsxs)("filter",{x:"-61.1%",y:"-56.2%",width:"222.2%",height:"237.5%",filterUnits:"objectBoundingBox",id:"popup_icon_b",children:[(0,Td.jsx)("feOffset",{dy:"6",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,Td.jsx)("feGaussianBlur",{stdDeviation:"10",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),(0,Td.jsx)("feColorMatrix",{values:"0 0 0 0 0.265158067 0 0 0 0 0.293073922 0 0 0 0 0.400749362 0 0 0 0.145352129 0",in:"shadowBlurOuter1"})]})]}),(0,Td.jsxs)(pw.G,{fill:"none",fillRule:"evenodd",children:[(0,Td.jsx)(pw.wA,{d:"M4 0h136a4 4 0 0 1 4 4v112a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#FFF",fillRule:"nonzero"}),(0,Td.jsx)("use",{fill:"#FFF",xlinkHref:"#popup_icon_a"}),(0,Td.jsx)("use",{fillOpacity:".4",fill:"#E5E9F8",xlinkHref:"#popup_icon_a"}),(0,Td.jsxs)(pw.G,{fillRule:"nonzero",children:[(0,Td.jsx)("use",{fill:"#000",filter:"url(#popup_icon_b)",xlinkHref:"#popup_icon_c"}),(0,Td.jsx)("use",{fill:"#FFF",xlinkHref:"#popup_icon_c"})]}),(0,Td.jsx)(pw.rw,{fill:"#FF5301",fillRule:"nonzero",x:"53",y:"66",width:"38",height:"8",rx:"1"}),(0,Td.jsx)(pw.rw,{fill:"#FFE0D0",fillRule:"nonzero",x:"53",y:"54",width:"38",height:"8",rx:"1"}),(0,Td.jsx)(pw.rw,{fill:"#FFE0D0",fillRule:"nonzero",x:"53",y:"42",width:"38",height:"8",rx:"1"})]})]});function Hre(){const e=(0,Ul.A)((e=>e(A2).getFormSettings()),[]),{showPlacementSettings:t}=(0,Vl.A)(A2);return(0,Td.jsx)(zre,{active:e.formPlacement.popup.enabled,label:_2.U.I18n.t("placePopupFormOnPages"),icon:Vre,onClick:()=>{t("popup")},canBeActive:!0})}const $re=(0,Td.jsxs)(pw.t4,{width:"144",height:"120",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 144 120",children:[(0,Td.jsx)("defs",{children:(0,Td.jsx)(pw.rw,{id:"fixed_bar_a",x:"8",y:"24",width:"128",height:"88",rx:"1"})}),(0,Td.jsxs)(pw.G,{fill:"none",fillRule:"evenodd",children:[(0,Td.jsx)(pw.wA,{d:"M4 0h136a4 4 0 0 1 4 4v112a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#FFF",fillRule:"nonzero"}),(0,Td.jsx)("use",{fill:"#FFF",xlinkHref:"#a"}),(0,Td.jsx)("use",{fillOpacity:".4",fill:"#E5E9F8",xlinkHref:"#fixed_bar_a"}),(0,Td.jsx)(pw.rw,{fill:"#FF5301",fillRule:"nonzero",x:"98",y:"8",width:"38",height:"8",rx:"1"}),(0,Td.jsx)(pw.rw,{fill:"#FFE0D0",fillRule:"nonzero",x:"53",y:"8",width:"38",height:"8",rx:"1"}),(0,Td.jsx)(pw.rw,{fill:"#FFE0D0",fillRule:"nonzero",x:"8",y:"8",width:"38",height:"8",rx:"1"})]})]});function Wre(){const e=(0,Ul.A)((e=>e(A2).getFormSettings()),[]),{showPlacementSettings:t}=(0,Vl.A)(A2);return(0,Td.jsx)(zre,{active:e.formPlacement.fixedBar.enabled,label:_2.U.I18n.t("placeFixedBarFormOnPages"),icon:$re,onClick:()=>{t("fixed_bar")},canBeActive:!0})}const Gre=(0,Td.jsxs)(pw.t4,{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"76",height:"63",viewBox:"0 0 76 63",children:[(0,Td.jsxs)("defs",{children:[(0,Td.jsxs)("filter",{id:"slide_in_prefix__a",width:"216.9%",height:"245.3%",x:"-55.8%",y:"-67.2%",filterUnits:"objectBoundingBox",children:[(0,Td.jsx)("feOffset",{dy:"4",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,Td.jsx)("feGaussianBlur",{in:"shadowOffsetOuter1",result:"shadowBlurOuter1",stdDeviation:"9"}),(0,Td.jsx)("feColorMatrix",{in:"shadowBlurOuter1",result:"shadowMatrixOuter1",values:"0 0 0 0 0.265158067 0 0 0 0 0.293073922 0 0 0 0 0.400749362 0 0 0 0.145352129 0"}),(0,Td.jsxs)("feMerge",{children:[(0,Td.jsx)("feMergeNode",{in:"shadowMatrixOuter1"}),(0,Td.jsx)("feMergeNode",{in:"SourceGraphic"})]})]}),(0,Td.jsxs)("filter",{id:"slide_in_prefix__c",width:"226.3%",height:"255.8%",x:"-73.7%",y:"-77.9%",filterUnits:"objectBoundingBox",children:[(0,Td.jsx)("feOffset",{dx:"-3",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,Td.jsx)("feGaussianBlur",{in:"shadowOffsetOuter1",result:"shadowBlurOuter1",stdDeviation:"5.5"}),(0,Td.jsx)("feColorMatrix",{in:"shadowBlurOuter1",values:"0 0 0 0 0.265158067 0 0 0 0 0.293073922 0 0 0 0 0.400749362 0 0 0 0.145352129 0"})]}),(0,Td.jsx)(pw.rw,{id:"slide_in_prefix__b",width:"67.556",height:"54.6",x:"4.222",y:"4.2",rx:".525"}),(0,Td.jsx)(pw.wA,{id:"slide_in_prefix__d",d:"M.525 0h27.45c.29 0 .525.235.525.525v22.05c0 .29-.235.525-.525.525H.525c-.29 0-.525-.235-.525-.525V.525C0 .235.235 0 .525 0z"})]}),(0,Td.jsxs)(pw.G,{fill:"none",fillRule:"evenodd",filter:"url(#slide_in_prefix__a)",children:[(0,Td.jsx)(pw.wA,{fill:"#FFF",fillRule:"nonzero",d:"M2.1 0h71.8c1.16 0 2.1.94 2.1 2.1v58.8c0 1.16-.94 2.1-2.1 2.1H2.1C.94 63 0 62.06 0 60.9V2.1C0 .94.94 0 2.1 0z"}),(0,Td.jsx)("use",{fill:"#FFF",xlinkHref:"#slide_in_prefix__b"}),(0,Td.jsx)("use",{fill:"#E5E9F8",fillOpacity:".4",xlinkHref:"#slide_in_prefix__b"}),(0,Td.jsxs)(pw.G,{fillRule:"nonzero",transform:"translate(43.278 35.7)",children:[(0,Td.jsx)("use",{fill:"#000",filter:"url(#slide_in_prefix__c)",xlinkHref:"#slide_in_prefix__d"}),(0,Td.jsx)("use",{fill:"#FFF",xlinkHref:"#slide_in_prefix__d"}),(0,Td.jsx)(pw.rw,{width:"15.833",height:"4.2",x:"6.333",y:"14.7",fill:"#FF5301",rx:".525"}),(0,Td.jsx)(pw.rw,{width:"15.833",height:"4.2",x:"6.333",y:"9.45",fill:"#FFE0D0",rx:".525"}),(0,Td.jsx)(pw.rw,{width:"15.833",height:"4.2",x:"6.333",y:"4.2",fill:"#FFE0D0",rx:".525"})]})]})]});function qre(){const e=(0,Ul.A)((e=>e(A2).getFormSettings()),[]),{showPlacementSettings:t}=(0,Vl.A)(A2);return(0,Td.jsx)(zre,{active:e.formPlacement.slideIn.enabled,label:_2.U.I18n.t("placeSlideInFormOnPages"),icon:Gre,onClick:()=>{t("slide_in")},canBeActive:!0})}const Kre=(0,Td.jsxs)(pw.t4,{xmlns:"http://www.w3.org/2000/svg",width:"144",height:"120",viewBox:"0 0 144 120",children:[(0,Td.jsxs)("defs",{children:[(0,Td.jsx)(pw.rw,{id:"sidebar_icon_prefix__b",width:"82",height:"104",x:"8",y:"8",rx:"1"}),(0,Td.jsx)(pw.rw,{id:"sidebar_icon_prefix__c",width:"38",height:"30",x:"98",y:"8",rx:"1"}),(0,Td.jsx)(pw.rw,{id:"sidebar_icon_prefix__d",width:"38",height:"30",x:"98",y:"82",rx:"1"}),(0,Td.jsxs)("filter",{id:"sidebar_icon_prefix__a",width:"212.5%",height:"235%",x:"-56.2%",y:"-67.5%",filterUnits:"objectBoundingBox",children:[(0,Td.jsx)("feOffset",{dy:"7",in:"SourceAlpha",result:"shadowOffsetOuter1"}),(0,Td.jsx)("feGaussianBlur",{in:"shadowOffsetOuter1",result:"shadowBlurOuter1",stdDeviation:"17.5"}),(0,Td.jsx)("feColorMatrix",{in:"shadowBlurOuter1",result:"shadowMatrixOuter1",values:"0 0 0 0 0.265158067 0 0 0 0 0.293073922 0 0 0 0 0.400749362 0 0 0 0.145352129 0"}),(0,Td.jsxs)("feMerge",{children:[(0,Td.jsx)("feMergeNode",{in:"shadowMatrixOuter1"}),(0,Td.jsx)("feMergeNode",{in:"SourceGraphic"})]})]})]}),(0,Td.jsxs)(pw.G,{fill:"none",fillRule:"evenodd",filter:"url(#sidebar_icon_prefix__a)",children:[(0,Td.jsx)(pw.wA,{fill:"#FFF",fillRule:"nonzero",d:"M4 0h136c2.21 0 4 1.79 4 4v112c0 2.21-1.79 4-4 4H4c-2.21 0-4-1.79-4-4V4c0-2.21 1.79-4 4-4z"}),(0,Td.jsx)("use",{fill:"#FFF",xlinkHref:"#sidebar_icon_prefix__b"}),(0,Td.jsx)("use",{fill:"#E5E9F8",fillOpacity:".4",xlinkHref:"#sidebar_icon_prefix__b"}),(0,Td.jsx)("use",{fill:"#FFF",xlinkHref:"#sidebar_icon_prefix__c"}),(0,Td.jsx)("use",{fill:"#E5E9F8",fillOpacity:".4",xlinkHref:"#sidebar_icon_prefix__c"}),(0,Td.jsx)("use",{fill:"#FFF",xlinkHref:"#sidebar_icon_prefix__d"}),(0,Td.jsx)("use",{fill:"#E5E9F8",fillOpacity:".4",xlinkHref:"#sidebar_icon_prefix__d"}),(0,Td.jsx)(pw.rw,{width:"38",height:"8",x:"98",y:"66",fill:"#FF5301",fillRule:"nonzero",rx:"1"}),(0,Td.jsx)(pw.rw,{width:"38",height:"8",x:"98",y:"56",fill:"#FFE0D0",fillRule:"nonzero",rx:"1"}),(0,Td.jsx)(pw.rw,{width:"38",height:"8",x:"98",y:"46",fill:"#FFE0D0",fillRule:"nonzero",rx:"1"})]})]});function Yre(){const{showPlacementSettings:e}=(0,Vl.A)(A2);return(0,Td.jsx)(zre,{active:!1,label:_2.U.I18n.t("formPlacementOtherLabel"),icon:Kre,onClick:()=>{e("others")},canBeActive:!1})}function Jre({onToggle:e,isOpened:t}){return(0,Td.jsx)(F5.A,{children:(0,Td.jsx)(aF.Ay,{title:_2.U.I18n.t("formPlacement"),opened:t,onToggle:e,className:"form-sidebar-form-placement-panel",children:(0,Td.jsxs)("div",{className:"form-placement-option-list",children:[(0,Td.jsx)(Ure,{}),(0,Td.jsx)(Wre,{}),(0,Td.jsx)(Hre,{}),(0,Td.jsx)(qre,{}),(0,Td.jsx)(Yre,{})]})})})}Jre.propTypes={onToggle:k2().func.isRequired,isOpened:k2().bool.isRequired};class Xre{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=soe(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),Qre.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=soe(this,e,t);let n=[];return this.decompose(e,t,n,0),Qre.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new noe(this),o=new noe(e);for(let e=t,i=t;;){if(r.next(e),o.next(e),e=0,r.lineBreak!=o.lineBreak||r.done!=o.done||r.value!=o.value)return!1;if(i+=r.value.length,r.done||i>=n)return!0}}iter(e=1){return new noe(this,e)}iterRange(e,t=this.length){return new roe(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new ooe(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(0==e.length)throw new RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new Zre(e):Qre.from(Zre.split(e,[])):Xre.empty}}class Zre extends Xre{constructor(e,t=function(e){let t=-1;for(let n of e)t+=n.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let o=0;;o++){let i=this.text[o],s=r+i.length;if((t?n:s)>=e)return new ioe(r,s,n,i);r=s+1,n++}}decompose(e,t,n,r){let o=e<=0&&t>=this.length?this:new Zre(toe(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&r){let e=n.pop(),t=eoe(o.text,e.text.slice(),0,o.length);if(t.length<=32)n.push(new Zre(t,e.length+o.length));else{let e=t.length>>1;n.push(new Zre(t.slice(0,e)),new Zre(t.slice(e)))}}else n.push(o)}replace(e,t,n){if(!(n instanceof Zre))return super.replace(e,t,n);[e,t]=soe(this,e,t);let r=eoe(this.text,eoe(n.text,toe(this.text,0,e)),t),o=this.length+n.length-(t-e);return r.length<=32?new Zre(r,o):Qre.from(Zre.split(r,[]),o)}sliceString(e,t=this.length,n="\n"){[e,t]=soe(this,e,t);let r="";for(let o=0,i=0;o<=t&&i<this.text.length;i++){let s=this.text[i],a=o+s.length;o>e&&i&&(r+=n),e<a&&t>o&&(r+=s.slice(Math.max(0,e-o),t-o)),o=a+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],r=-1;for(let o of e)n.push(o),r+=o.length+1,32==n.length&&(t.push(new Zre(n,r)),n=[],r=-1);return r>-1&&t.push(new Zre(n,r)),t}}class Qre extends Xre{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let o=0;;o++){let i=this.children[o],s=r+i.length,a=n+i.lines-1;if((t?a:s)>=e)return i.lineInner(e,t,n,r);r=s+1,n=a+1}}decompose(e,t,n,r){for(let o=0,i=0;i<=t&&o<this.children.length;o++){let s=this.children[o],a=i+s.length;if(e<=a&&t>=i){let o=r&((i<=e?1:0)|(a>=t?2:0));i>=e&&a<=t&&!o?n.push(s):s.decompose(e-i,t-i,n,o)}i=a+1}}replace(e,t,n){if([e,t]=soe(this,e,t),n.lines<this.lines)for(let r=0,o=0;r<this.children.length;r++){let i=this.children[r],s=o+i.length;if(e>=o&&t<=s){let a=i.replace(e-o,t-o,n),l=this.lines-i.lines+a.lines;if(a.lines<l>>4&&a.lines>l>>6){let o=this.children.slice();return o[r]=a,new Qre(o,this.length-(t-e)+n.length)}return super.replace(o,s,a)}o=s+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){[e,t]=soe(this,e,t);let r="";for(let o=0,i=0;o<this.children.length&&i<=t;o++){let s=this.children[o],a=i+s.length;i>e&&o&&(r+=n),e<a&&t>i&&(r+=s.sliceString(e-i,t-i,n)),i=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Qre))return 0;let n=0,[r,o,i,s]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,o+=t){if(r==i||o==s)return n;let a=this.children[r],l=e.children[o];if(a!=l)return n+a.scanIdentical(l,t);n+=a.length+1}}static from(e,t=e.reduce(((e,t)=>e+t.length+1),-1)){let n=0;for(let t of e)n+=t.lines;if(n<32){let n=[];for(let t of e)t.flatten(n);return new Zre(n,t)}let r=Math.max(32,n>>5),o=r<<1,i=r>>1,s=[],a=0,l=-1,c=[];function u(e){let t;if(e.lines>o&&e instanceof Qre)for(let t of e.children)u(t);else e.lines>i&&(a>i||!a)?(d(),s.push(e)):e instanceof Zre&&a&&(t=c[c.length-1])instanceof Zre&&e.lines+t.lines<=32?(a+=e.lines,l+=e.length+1,c[c.length-1]=new Zre(t.text.concat(e.text),t.length+1+e.length)):(a+e.lines>r&&d(),a+=e.lines,l+=e.length+1,c.push(e))}function d(){0!=a&&(s.push(1==c.length?c[0]:Qre.from(c,l)),l=-1,a=c.length=0)}for(let t of e)u(t);return d(),1==s.length?s[0]:new Qre(s,t)}}function eoe(e,t,n=0,r=1e9){for(let o=0,i=0,s=!0;i<e.length&&o<=r;i++){let a=e[i],l=o+a.length;l>=n&&(l>r&&(a=a.slice(0,r-o)),o<n&&(a=a.slice(n-o)),s?(t[t.length-1]+=a,s=!1):t.push(a)),o=l+1}return t}function toe(e,t,n){return eoe(e,[""],t,n)}Xre.empty=new Zre([""],0);class noe{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof Zre?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],o=this.offsets[n],i=o>>1,s=r instanceof Zre?r.text.length:r.children.length;if(i==(t>0?s:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&o)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(r instanceof Zre){let o=r.text[i+(t<0?-1:0)];if(this.offsets[n]+=t,o.length>Math.max(0,e))return this.value=0==e?o:t>0?o.slice(e):o.slice(0,o.length-e),this;e-=o.length}else{let o=r.children[i+(t<0?-1:0)];e>o.length?(e-=o.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(o),this.offsets.push(t>0?1:(o instanceof Zre?o.text.length:o.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class roe{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new noe(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class ooe{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(Xre.prototype[Symbol.iterator]=function(){return this.iter()},noe.prototype[Symbol.iterator]=roe.prototype[Symbol.iterator]=ooe.prototype[Symbol.iterator]=function(){return this});class ioe{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}}function soe(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}let aoe="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((e=>e?parseInt(e,36):1));for(let e=1;e<aoe.length;e++)aoe[e]+=aoe[e-1];function loe(e){for(let t=1;t<aoe.length;t+=2)if(aoe[t]>e)return aoe[t-1]<=e;return!1}function coe(e){return e>=127462&&e<=127487}const uoe=8205;function doe(e,t,n=!0,r=!0){return(n?hoe:poe)(e,t,r)}function hoe(e,t,n){if(t==e.length)return t;t&&foe(e.charCodeAt(t))&&moe(e.charCodeAt(t-1))&&t--;let r=goe(e,t);for(t+=yoe(r);t<e.length;){let o=goe(e,t);if(r==uoe||o==uoe||n&&loe(o))t+=yoe(o),r=o;else{if(!coe(o))break;{let n=0,r=t-2;for(;r>=0&&coe(goe(e,r));)n++,r-=2;if(n%2==0)break;t+=2}}}return t}function poe(e,t,n){for(;t>0;){let r=hoe(e,t-2,n);if(r<t)return r;t--}return 0}function foe(e){return e>=56320&&e<57344}function moe(e){return e>=55296&&e<56320}function goe(e,t){let n=e.charCodeAt(t);if(!moe(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return foe(r)?r-56320+(n-55296<<10)+65536:n}function boe(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function yoe(e){return e<65536?1:2}const voe=/\r\n?|\n/;var _oe=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(_oe||(_oe={}));class xoe{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let o=this.sections[t++],i=this.sections[t++];i<0?(e(n,r,o),r+=o):r+=i,n+=o}}iterChangedRanges(e,t=!1){Soe(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];r<0?e.push(n,r):e.push(r,n)}return new xoe(e)}composeDesc(e){return this.empty?e:e.empty?this:Eoe(this,e)}mapDesc(e,t=!1){return e.empty?this:Aoe(this,e,t)}mapPos(e,t=-1,n=_oe.Simple){let r=0,o=0;for(let i=0;i<this.sections.length;){let s=this.sections[i++],a=this.sections[i++],l=r+s;if(a<0){if(l>e)return o+(e-r);o+=s}else{if(n!=_oe.Simple&&l>=e&&(n==_oe.TrackDel&&r<e&&l>e||n==_oe.TrackBefore&&r<e||n==_oe.TrackAfter&&l>e))return null;if(l>e||l==e&&t<0&&!s)return e==r||t<0?o:o+a;o+=a}r=l}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return o}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let o=r+this.sections[n++];if(this.sections[n++]>=0&&r<=t&&o>=e)return!(r<e&&o>t)||"cover";r=o}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?" ":"")+n+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some((e=>"number"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeDesc");return new xoe(e)}static create(e){return new xoe(e)}}class woe extends xoe{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Soe(this,((t,n,r,o,i)=>e=e.replace(r,r+(n-t),i)),!1),e}mapDesc(e,t=!1){return Aoe(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let r=0,o=0;r<t.length;r+=2){let i=t[r],s=t[r+1];if(s>=0){t[r]=s,t[r+1]=i;let a=r>>1;for(;n.length<a;)n.push(Xre.empty);n.push(i?e.slice(o,o+i):Xre.empty)}o+=i}return new woe(t,n)}compose(e){return this.empty?e:e.empty?this:Eoe(this,e,!0)}map(e,t=!1){return e.empty?this:Aoe(this,e,t,!0)}iterChanges(e,t=!1){Soe(this,e,t)}get desc(){return xoe.create(this.sections)}filter(e){let t=[],n=[],r=[],o=new Ioe(this);e:for(let i=0,s=0;;){let a=i==e.length?1e9:e[i++];for(;s<a||s==a&&0==o.len;){if(o.done)break e;let e=Math.min(o.len,a-s);koe(r,e,-1);let i=-1==o.ins?-1:0==o.off?o.ins:0;koe(t,e,i),i>0&&Coe(n,t,o.text),o.forward(e),s+=e}let l=e[i++];for(;s<l;){if(o.done)break e;let e=Math.min(o.len,l-s);koe(t,e,-1),koe(r,e,-1==o.ins?-1:0==o.off?o.ins:0),o.forward(e),s+=e}}return{changes:new woe(t,n),filtered:xoe.create(r)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):0==r?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let r=[],o=[],i=0,s=null;function a(e=!1){if(!e&&!r.length)return;i<t&&koe(r,t-i,-1);let n=new woe(r,o);s=s?s.compose(n.map(s)):n,r=[],o=[],i=0}return function e(l){if(Array.isArray(l))for(let t of l)e(t);else if(l instanceof woe){if(l.length!=t)throw new RangeError(`Mismatched change set length (got ${l.length}, expected ${t})`);a(),s=s?s.compose(l.map(s)):l}else{let{from:e,to:s=e,insert:c}=l;if(e>s||e<0||s>t)throw new RangeError(`Invalid change range ${e} to ${s} (in doc of length ${t})`);let u=c?"string"==typeof c?Xre.of(c.split(n||voe)):c:Xre.empty,d=u.length;if(e==s&&0==d)return;e<i&&a(),e>i&&koe(r,e-i,-1),koe(r,s-e,d),Coe(o,r,u),i=s}}(e),a(!s),s}static empty(e){return new woe(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let r=0;r<e.length;r++){let o=e[r];if("number"==typeof o)t.push(o,-1);else{if(!Array.isArray(o)||"number"!=typeof o[0]||o.some(((e,t)=>t&&"string"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==o.length)t.push(o[0],0);else{for(;n.length<r;)n.push(Xre.empty);n[r]=Xre.of(o.slice(1)),t.push(o[0],n[r].length)}}}return new woe(t,n)}static createSet(e,t){return new woe(e,t)}}function koe(e,t,n,r=!1){if(0==t&&n<=0)return;let o=e.length-2;o>=0&&n<=0&&n==e[o+1]?e[o]+=t:0==t&&0==e[o]?e[o+1]+=n:r?(e[o]+=t,e[o+1]+=n):e.push(t,n)}function Coe(e,t,n){if(0==n.length)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(Xre.empty);e.push(n)}}function Soe(e,t,n){let r=e.inserted;for(let o=0,i=0,s=0;s<e.sections.length;){let a=e.sections[s++],l=e.sections[s++];if(l<0)o+=a,i+=a;else{let c=o,u=i,d=Xre.empty;for(;c+=a,u+=l,l&&r&&(d=d.append(r[s-2>>1])),!(n||s==e.sections.length||e.sections[s+1]<0);)a=e.sections[s++],l=e.sections[s++];t(o,c,i,u,d),o=c,i=u}}}function Aoe(e,t,n,r=!1){let o=[],i=r?[]:null,s=new Ioe(e),a=new Ioe(t);for(let e=-1;;)if(-1==s.ins&&-1==a.ins){let e=Math.min(s.len,a.len);koe(o,e,-1),s.forward(e),a.forward(e)}else if(a.ins>=0&&(s.ins<0||e==s.i||0==s.off&&(a.len<s.len||a.len==s.len&&!n))){let t=a.len;for(koe(o,a.ins,-1);t;){let n=Math.min(s.len,t);s.ins>=0&&e<s.i&&s.len<=n&&(koe(o,0,s.ins),i&&Coe(i,o,s.text),e=s.i),s.forward(n),t-=n}a.next()}else{if(!(s.ins>=0)){if(s.done&&a.done)return i?woe.createSet(o,i):xoe.create(o);throw new Error("Mismatched change set lengths")}{let t=0,n=s.len;for(;n;)if(-1==a.ins){let e=Math.min(n,a.len);t+=e,n-=e,a.forward(e)}else{if(!(0==a.ins&&a.len<n))break;n-=a.len,a.next()}koe(o,t,e<s.i?s.ins:0),i&&e<s.i&&Coe(i,o,s.text),e=s.i,s.forward(s.len-n)}}}function Eoe(e,t,n=!1){let r=[],o=n?[]:null,i=new Ioe(e),s=new Ioe(t);for(let e=!1;;){if(i.done&&s.done)return o?woe.createSet(r,o):xoe.create(r);if(0==i.ins)koe(r,i.len,0,e),i.next();else if(0!=s.len||s.done){if(i.done||s.done)throw new Error("Mismatched change set lengths");{let t=Math.min(i.len2,s.len),n=r.length;if(-1==i.ins){let n=-1==s.ins?-1:s.off?0:s.ins;koe(r,t,n,e),o&&n&&Coe(o,r,s.text)}else-1==s.ins?(koe(r,i.off?0:i.len,t,e),o&&Coe(o,r,i.textBit(t))):(koe(r,i.off?0:i.len,s.off?0:s.ins,e),o&&!s.off&&Coe(o,r,s.text));e=(i.ins>t||s.ins>=0&&s.len>t)&&(e||r.length>n),i.forward2(t),s.forward(t)}}else koe(r,0,s.ins,e),o&&Coe(o,r,s.text),s.next()}}class Ioe{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return-2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?Xre.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?Xre.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class joe{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let e=7&this.flags;return 7==e?null:e}get goalColumn(){let e=this.flags>>6;return 16777215==e?void 0:e}map(e,t=-1){let n,r;return this.empty?n=r=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new joe(n,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return Toe.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return Toe.range(this.anchor,n)}eq(e,t=!1){return!(this.anchor!=e.anchor||this.head!=e.head||t&&this.empty&&this.assoc!=e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return Toe.range(e.anchor,e.head)}static create(e,t,n){return new joe(e,t,n)}}class Toe{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:Toe.create(this.ranges.map((n=>n.map(e,t))),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new Toe([this.main],0)}addRange(e,t=!0){return Toe.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,Toe.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map((e=>e.toJSON())),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Toe(e.ranges.map((e=>joe.fromJSON(e))),e.main)}static single(e,t=e){return new Toe([Toe.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw new RangeError("A selection needs at least one range");for(let n=0,r=0;r<e.length;r++){let o=e[r];if(o.empty?o.from<=n:o.from<n)return Toe.normalized(e.slice(),t);n=o.to}return new Toe(e,t)}static cursor(e,t=0,n,r){return joe.create(e,e,(0==t?0:t<0?8:16)|(null==n?7:Math.min(6,n))|(null!=r?r:16777215)<<6)}static range(e,t,n,r){let o=(null!=n?n:16777215)<<6|(null==r?7:Math.min(6,r));return t<e?joe.create(t,e,48|o):joe.create(e,t,(t>e?8:0)|o)}static normalized(e,t=0){let n=e[t];e.sort(((e,t)=>e.from-t.from)),t=e.indexOf(n);for(let n=1;n<e.length;n++){let r=e[n],o=e[n-1];if(r.empty?r.from<=o.to:r.from<o.to){let i=o.from,s=Math.max(r.to,o.to);n<=t&&t--,e.splice(--n,2,r.anchor>r.head?Toe.range(s,i):Toe.range(i,s))}}return new Toe(e,t)}}function Boe(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let Roe=0;class Noe{constructor(e,t,n,r,o){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=Roe++,this.default=e([]),this.extensions="function"==typeof o?o(this):o}get reader(){return this}static define(e={}){return new Noe(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:Doe),!!e.static,e.enables)}of(e){return new Moe([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Moe(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Moe(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],(n=>t(n.field(e))))}}function Doe(e,t){return e==t||e.length==t.length&&e.every(((e,n)=>e===t[n]))}class Moe{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=Roe++}dynamicSlot(e){var t;let n=this.value,r=this.facet.compareInput,o=this.id,i=e[o]>>1,s=2==this.type,a=!1,l=!1,c=[];for(let n of this.dependencies)"doc"==n?a=!0:"selection"==n?l=!0:1&(null!==(t=e[n.id])&&void 0!==t?t:1)||c.push(e[n.id]);return{create:e=>(e.values[i]=n(e),1),update(e,t){if(a&&t.docChanged||l&&(t.docChanged||t.selection)||Ooe(e,c)){let t=n(e);if(s?!Poe(t,e.values[i],r):!r(t,e.values[i]))return e.values[i]=t,1}return 0},reconfigure:(e,t)=>{let a,l=t.config.address[o];if(null!=l){let o=Koe(t,l);if(this.dependencies.every((n=>n instanceof Noe?t.facet(n)===e.facet(n):!(n instanceof zoe)||t.field(n,!1)==e.field(n,!1)))||(s?Poe(a=n(e),o,r):r(a=n(e),o)))return e.values[i]=o,0}else a=n(e);return e.values[i]=a,1}}}}function Poe(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function Ooe(e,t){let n=!1;for(let r of t)1&qoe(e,r)&&(n=!0);return n}function Loe(e,t,n){let r=n.map((t=>e[t.id])),o=n.map((e=>e.type)),i=r.filter((e=>!(1&e))),s=e[t.id]>>1;function a(e){let n=[];for(let t=0;t<r.length;t++){let i=Koe(e,r[t]);if(2==o[t])for(let e of i)n.push(e);else n.push(i)}return t.combine(n)}return{create(e){for(let t of r)qoe(e,t);return e.values[s]=a(e),1},update(e,n){if(!Ooe(e,i))return 0;let r=a(e);return t.compare(r,e.values[s])?0:(e.values[s]=r,1)},reconfigure(e,o){let i=Ooe(e,r),l=o.config.facets[t.id],c=o.facet(t);if(l&&!i&&Doe(n,l))return e.values[s]=c,0;let u=a(e);return t.compare(u,c)?(e.values[s]=c,0):(e.values[s]=u,1)}}}const Foe=Noe.define({static:!0});class zoe{constructor(e,t,n,r,o){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=o,this.provides=void 0}static define(e){let t=new zoe(Roe++,e.create,e.update,e.compare||((e,t)=>e===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Foe).find((e=>e.field==this));return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],o=this.updateF(r,n);return this.compareF(r,o)?0:(e.values[t]=o,1)},reconfigure:(e,n)=>null!=n.config.address[this.id]?(e.values[t]=n.field(this),0):(e.values[t]=this.create(e),1)}}init(e){return[this,Foe.of({field:this,create:e})]}get extension(){return this}}function Uoe(e){return t=>new Hoe(t,e)}const Voe={highest:Uoe(0),high:Uoe(1),default:Uoe(2),low:Uoe(3),lowest:Uoe(4)};class Hoe{constructor(e,t){this.inner=e,this.prec=t}}class $oe{of(e){return new Woe(this,e)}reconfigure(e){return $oe.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Woe{constructor(e,t){this.compartment=e,this.inner=t}}class Goe{constructor(e,t,n,r,o,i){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=o,this.facets=i,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return null==t?e.default:this.staticValues[t>>1]}static resolve(e,t,n){let r=[],o=Object.create(null),i=new Map;for(let n of function(e,t,n){let r=[[],[],[],[],[]],o=new Map;return function e(i,s){let a=o.get(i);if(null!=a){if(a<=s)return;let e=r[a].indexOf(i);e>-1&&r[a].splice(e,1),i instanceof Woe&&n.delete(i.compartment)}if(o.set(i,s),Array.isArray(i))for(let t of i)e(t,s);else if(i instanceof Woe){if(n.has(i.compartment))throw new RangeError("Duplicate use of compartment in extensions");let r=t.get(i.compartment)||i.inner;n.set(i.compartment,r),e(r,s)}else if(i instanceof Hoe)e(i.inner,i.prec);else if(i instanceof zoe)r[s].push(i),i.provides&&e(i.provides,s);else if(i instanceof Moe)r[s].push(i),i.facet.extensions&&e(i.facet.extensions,2);else{let t=i.extension;if(!t)throw new Error(`Unrecognized extension value in extension set (${i}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);e(t,s)}}(e,2),r.reduce(((e,t)=>e.concat(t)))}(e,t,i))n instanceof zoe?r.push(n):(o[n.facet.id]||(o[n.facet.id]=[])).push(n);let s=Object.create(null),a=[],l=[];for(let e of r)s[e.id]=l.length<<1,l.push((t=>e.slot(t)));let c=null==n?void 0:n.config.facets;for(let e in o){let t=o[e],r=t[0].facet,i=c&&c[e]||[];if(t.every((e=>0==e.type)))if(s[r.id]=a.length<<1|1,Doe(i,t))a.push(n.facet(r));else{let e=r.combine(t.map((e=>e.value)));a.push(n&&r.compare(e,n.facet(r))?n.facet(r):e)}else{for(let e of t)0==e.type?(s[e.id]=a.length<<1|1,a.push(e.value)):(s[e.id]=l.length<<1,l.push((t=>e.dynamicSlot(t))));s[r.id]=l.length<<1,l.push((e=>Loe(e,r,t)))}}let u=l.map((e=>e(s)));return new Goe(e,i,u,s,a,o)}}function qoe(e,t){if(1&t)return 2;let n=t>>1,r=e.status[n];if(4==r)throw new Error("Cyclic dependency between fields and/or facets");if(2&r)return r;e.status[n]=4;let o=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|o}function Koe(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}const Yoe=Noe.define(),Joe=Noe.define({combine:e=>e.some((e=>e)),static:!0}),Xoe=Noe.define({combine:e=>e.length?e[0]:void 0,static:!0}),Zoe=Noe.define(),Qoe=Noe.define(),eie=Noe.define(),tie=Noe.define({combine:e=>!!e.length&&e[0]});class nie{constructor(e,t){this.type=e,this.value=t}static define(){return new rie}}class rie{of(e){return new nie(this,e)}}class oie{constructor(e){this.map=e}of(e){return new iie(this,e)}}class iie{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new iie(this.type,t)}is(e){return this.type==e}static define(e={}){return new oie(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}}iie.reconfigure=iie.define(),iie.appendConfig=iie.define();class sie{constructor(e,t,n,r,o,i){this.startState=e,this.changes=t,this.selection=n,this.effects=r,this.annotations=o,this.scrollIntoView=i,this._doc=null,this._state=null,n&&Boe(n,t.newLength),o.some((e=>e.type==sie.time))||(this.annotations=o.concat(sie.time.of(Date.now())))}static create(e,t,n,r,o,i){return new sie(e,t,n,r,o,i)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(sie.userEvent);return!(!t||!(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function aie(e,t){let n=[];for(let r=0,o=0;;){let i,s;if(r<e.length&&(o==t.length||t[o]>=e[r]))i=e[r++],s=e[r++];else{if(!(o<t.length))return n;i=t[o++],s=t[o++]}!n.length||n[n.length-1]<i?n.push(i,s):n[n.length-1]<s&&(n[n.length-1]=s)}}function lie(e,t,n){var r;let o,i,s;return n?(o=t.changes,i=woe.empty(t.changes.length),s=e.changes.compose(t.changes)):(o=t.changes.map(e.changes),i=e.changes.mapDesc(t.changes,!0),s=e.changes.compose(o)),{changes:s,selection:t.selection?t.selection.map(i):null===(r=e.selection)||void 0===r?void 0:r.map(o),effects:iie.mapEffects(e.effects,o).concat(iie.mapEffects(t.effects,i)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function cie(e,t,n){let r=t.selection,o=hie(t.annotations);return t.userEvent&&(o=o.concat(sie.userEvent.of(t.userEvent))),{changes:t.changes instanceof woe?t.changes:woe.of(t.changes||[],n,e.facet(Xoe)),selection:r&&(r instanceof Toe?r:Toe.single(r.anchor,r.head)),effects:hie(t.effects),annotations:o,scrollIntoView:!!t.scrollIntoView}}function uie(e,t,n){let r=cie(e,t.length?t[0]:{},e.doc.length);t.length&&!1===t[0].filter&&(n=!1);for(let o=1;o<t.length;o++){!1===t[o].filter&&(n=!1);let i=!!t[o].sequential;r=lie(r,cie(e,t[o],i?r.changes.newLength:e.doc.length),i)}let o=sie.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return function(e){let t=e.startState,n=t.facet(eie),r=e;for(let o=n.length-1;o>=0;o--){let i=n[o](e);i&&Object.keys(i).length&&(r=lie(r,cie(t,i,e.changes.newLength),!0))}return r==e?e:sie.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}(n?function(e){let t=e.startState,n=!0;for(let r of t.facet(Zoe)){let t=r(e);if(!1===t){n=!1;break}Array.isArray(t)&&(n=!0===n?t:aie(n,t))}if(!0!==n){let r,o;if(!1===n)o=e.changes.invertedDesc,r=woe.empty(t.doc.length);else{let t=e.changes.filter(n);r=t.changes,o=t.filtered.mapDesc(t.changes).invertedDesc}e=sie.create(t,r,e.selection&&e.selection.map(o),iie.mapEffects(e.effects,o),e.annotations,e.scrollIntoView)}let r=t.facet(Qoe);for(let n=r.length-1;n>=0;n--){let o=r[n](e);e=o instanceof sie?o:Array.isArray(o)&&1==o.length&&o[0]instanceof sie?o[0]:uie(t,hie(o),!1)}return e}(o):o)}sie.time=nie.define(),sie.userEvent=nie.define(),sie.addToHistory=nie.define(),sie.remote=nie.define();const die=[];function hie(e){return null==e?die:Array.isArray(e)?e:[e]}var pie=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(pie||(pie={}));const fie=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let mie;try{mie=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(e){}class gie{constructor(e,t,n,r,o,i){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=o,i&&(i._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)qoe(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(null!=n)return qoe(this,n),Koe(this,n);if(t)throw new RangeError("Field is not present in this state")}update(...e){return uie(this,e,!0)}applyTransaction(e){let t,n=this.config,{base:r,compartments:o}=n;for(let t of e.effects)t.is($oe.reconfigure)?(n&&(o=new Map,n.compartments.forEach(((e,t)=>o.set(t,e))),n=null),o.set(t.value.compartment,t.value.extension)):t.is(iie.reconfigure)?(n=null,r=t.value):t.is(iie.appendConfig)&&(n=null,r=hie(r).concat(t.value));n?t=e.startState.values.slice():(n=Goe.resolve(r,o,this),t=new gie(n,this.doc,this.selection,n.dynamicSlots.map((()=>null)),((e,t)=>t.reconfigure(e,this)),null).values);let i=e.startState.facet(Joe)?e.newSelection:e.newSelection.asSingle();new gie(n,e.newDoc,i,t,((t,n)=>n.update(t,e)),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange((t=>({changes:{from:t.from,to:t.to,insert:e},range:Toe.cursor(t.from+e.length)})))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),o=[n.range],i=hie(n.effects);for(let n=1;n<t.ranges.length;n++){let s=e(t.ranges[n]),a=this.changes(s.changes),l=a.map(r);for(let e=0;e<n;e++)o[e]=o[e].map(l);let c=r.mapDesc(a,!0);o.push(s.range.map(c)),r=r.compose(l),i=iie.mapEffects(i,l).concat(iie.mapEffects(hie(s.effects),c))}return{changes:r,selection:Toe.create(o,t.mainIndex),effects:i}}changes(e=[]){return e instanceof woe?e:woe.of(e,this.doc.length,this.facet(gie.lineSeparator))}toText(e){return Xre.of(e.split(this.facet(gie.lineSeparator)||voe))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return null==t?e.default:(qoe(this,t),Koe(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof zoe&&null!=this.config.address[r.id]&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(e,t={},n){if(!e||"string"!=typeof e.doc)throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(n)for(let t in n)if(Object.prototype.hasOwnProperty.call(e,t)){let o=n[t],i=e[t];r.push(o.init((e=>o.spec.fromJSON(i,e))))}return gie.create({doc:e.doc,selection:Toe.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=Goe.resolve(e.extensions||[],new Map),n=e.doc instanceof Xre?e.doc:Xre.of((e.doc||"").split(t.staticFacet(gie.lineSeparator)||voe)),r=e.selection?e.selection instanceof Toe?e.selection:Toe.single(e.selection.anchor,e.selection.head):Toe.single(0);return Boe(r,n.length),t.staticFacet(Joe)||(r=r.asSingle()),new gie(t,n,r,t.dynamicSlots.map((()=>null)),((e,t)=>t.create(e)),null)}get tabSize(){return this.facet(gie.tabSize)}get lineBreak(){return this.facet(gie.lineSeparator)||"\n"}get readOnly(){return this.facet(tie)}phrase(e,...t){for(let t of this.facet(gie.phrases))if(Object.prototype.hasOwnProperty.call(t,e)){e=t[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,((e,n)=>{if("$"==n)return"$";let r=+(n||1);return!r||r>t.length?e:t[r-1]}))),e}languageDataAt(e,t,n=-1){let r=[];for(let o of this.facet(Yoe))for(let i of o(this,t,n))Object.prototype.hasOwnProperty.call(i,e)&&r.push(i[e]);return r}charCategorizer(e){return t=this.languageDataAt("wordChars",e).join(""),e=>{if(!/\S/.test(e))return pie.Space;if(function(e){if(mie)return mie.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||fie.test(n)))return!0}return!1}(e))return pie.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return pie.Word;return pie.Other};var t}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),o=this.charCategorizer(e),i=e-n,s=e-n;for(;i>0;){let e=doe(t,i,!1);if(o(t.slice(e,i))!=pie.Word)break;i=e}for(;s<r;){let e=doe(t,s);if(o(t.slice(s,e))!=pie.Word)break;s=e}return i==s?null:Toe.range(i+n,s+n)}}function bie(e,t,n={}){let r={};for(let t of e)for(let e of Object.keys(t)){let o=t[e],i=r[e];if(void 0===i)r[e]=o;else if(i===o||void 0===o);else{if(!Object.hasOwnProperty.call(n,e))throw new Error("Config merge conflict for field "+e);r[e]=n[e](i,o)}}for(let e in t)void 0===r[e]&&(r[e]=t[e]);return r}gie.allowMultipleSelections=Joe,gie.tabSize=Noe.define({combine:e=>e.length?e[0]:4}),gie.lineSeparator=Xoe,gie.readOnly=tie,gie.phrases=Noe.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every((n=>e[n]==t[n]))}}),gie.languageData=Yoe,gie.changeFilter=Zoe,gie.transactionFilter=Qoe,gie.transactionExtender=eie,$oe.reconfigure=iie.define();class yie{eq(e){return this==e}range(e,t=e){return vie.create(e,t,this)}}yie.prototype.startSide=yie.prototype.endSide=0,yie.prototype.point=!1,yie.prototype.mapMode=_oe.TrackDel;class vie{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new vie(e,t,n)}}function _ie(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class xie{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let o=n?this.to:this.from;for(let i=r,s=o.length;;){if(i==s)return i;let r=i+s>>1,a=o[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==i)return a>=0?i:s;a>=0?s=r:i=r+1}}between(e,t,n,r){for(let o=this.findIndex(t,-1e9,!0),i=this.findIndex(n,1e9,!1,o);o<i;o++)if(!1===r(this.from[o]+e,this.to[o]+e,this.value[o]))return!1}map(e,t){let n=[],r=[],o=[],i=-1,s=-1;for(let a=0;a<this.value.length;a++){let l,c,u=this.value[a],d=this.from[a]+e,h=this.to[a]+e;if(d==h){let e=t.mapPos(d,u.startSide,u.mapMode);if(null==e)continue;if(l=c=e,u.startSide!=u.endSide&&(c=t.mapPos(d,u.endSide),c<l))continue}else if(l=t.mapPos(d,u.startSide),c=t.mapPos(h,u.endSide),l>c||l==c&&u.startSide>0&&u.endSide<=0)continue;(c-l||u.endSide-u.startSide)<0||(i<0&&(i=l),u.point&&(s=Math.max(s,c-l)),n.push(u),r.push(l-i),o.push(c-i))}return{mapped:n.length?new xie(r,o,n,s):null,pos:i}}}class wie{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(e,t,n,r){return new wie(e,t,n,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:r=0,filterTo:o=this.length}=e,i=e.filter;if(0==t.length&&!i)return this;if(n&&(t=t.slice().sort(_ie)),this.isEmpty)return t.length?wie.of(t):this;let s=new Sie(this,null,-1).goto(0),a=0,l=[],c=new kie;for(;s.value||a<t.length;)if(a<t.length&&(s.from-t[a].from||s.startSide-t[a].value.startSide)>=0){let e=t[a++];c.addInner(e.from,e.to,e.value)||l.push(e)}else 1==s.rangeIndex&&s.chunkIndex<this.chunk.length&&(a==t.length||this.chunkEnd(s.chunkIndex)<t[a].from)&&(!i||r>this.chunkEnd(s.chunkIndex)||o<this.chunkPos[s.chunkIndex])&&c.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!i||r>s.to||o<s.from||i(s.from,s.to,s.value))&&(c.addInner(s.from,s.to,s.value)||l.push(vie.create(s.from,s.to,s.value))),s.next());return c.finishInner(this.nextLayer.isEmpty&&!l.length?wie.empty:this.nextLayer.update({add:l,filter:i,filterFrom:r,filterTo:o}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],r=-1;for(let o=0;o<this.chunk.length;o++){let i=this.chunkPos[o],s=this.chunk[o],a=e.touchesRange(i,i+s.length);if(!1===a)r=Math.max(r,s.maxPoint),t.push(s),n.push(e.mapPos(i));else if(!0===a){let{mapped:o,pos:a}=s.map(i,e);o&&(r=Math.max(r,o.maxPoint),t.push(o),n.push(a))}}let o=this.nextLayer.map(e);return 0==t.length?o:new wie(n,t,o||wie.empty,r)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let o=this.chunkPos[r],i=this.chunk[r];if(t>=o&&e<=o+i.length&&!1===i.between(o,e-o,t-o,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return Aie.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Aie.from(e).goto(t)}static compare(e,t,n,r,o=-1){let i=e.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=o)),s=t.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=o)),a=Cie(i,s,n),l=new Iie(i,a,o),c=new Iie(s,a,o);n.iterGaps(((e,t,n)=>jie(l,e,c,t,n,r))),n.empty&&0==n.length&&jie(l,0,c,0,0,r)}static eq(e,t,n=0,r){null==r&&(r=999999999);let o=e.filter((e=>!e.isEmpty&&t.indexOf(e)<0)),i=t.filter((t=>!t.isEmpty&&e.indexOf(t)<0));if(o.length!=i.length)return!1;if(!o.length)return!0;let s=Cie(o,i),a=new Iie(o,s,0).goto(n),l=new Iie(i,s,0).goto(n);for(;;){if(a.to!=l.to||!Tie(a.active,l.active)||a.point&&(!l.point||!a.point.eq(l.point)))return!1;if(a.to>r)return!0;a.next(),l.next()}}static spans(e,t,n,r,o=-1){let i=new Iie(e,null,o).goto(t),s=t,a=i.openStart;for(;;){let e=Math.min(i.to,n);if(i.point){let n=i.activeForPoint(i.to),o=i.pointFrom<t?n.length+1:i.point.startSide<0?n.length:Math.min(n.length,a);r.point(s,e,i.point,n,o,i.pointRank),a=Math.min(i.openEnd(e),n.length)}else e>s&&(r.span(s,e,i.active,a),a=i.openEnd(e));if(i.to>n)return a+(i.point&&i.to>n?1:0);s=i.to,i.next()}}static of(e,t=!1){let n=new kie;for(let r of e instanceof vie?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(_ie(t,r)>0)return e.slice().sort(_ie);t=r}return e}(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(e){if(!e.length)return wie.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let r=e[n];r!=wie.empty;r=r.nextLayer)t=new wie(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}}wie.empty=new wie([],[],null,-1),wie.empty.nextLayer=wie.empty;class kie{finishChunk(e){this.chunks.push(new xie(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new kie)).add(e,t,n)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(r<0||(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),0))}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(wie.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=wie.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Cie(e,t,n){let r=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&r.set(t.chunk[e],t.chunkPos[e]);let o=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let i=r.get(e.chunk[t]);null==i||(n?n.mapPos(i):i)!=e.chunkPos[t]||(null==n?void 0:n.touchesRange(i,i+e.chunk[t].length))||o.add(e.chunk[t])}return o}class Sie{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Aie{constructor(e){this.heap=e}static from(e,t=null,n=-1){let r=[];for(let o=0;o<e.length;o++)for(let i=e[o];!i.isEmpty;i=i.nextLayer)i.maxPoint>=n&&r.push(new Sie(i,t,n,o));return 1==r.length?r[0]:new Aie(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)Eie(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)Eie(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Eie(this.heap,0)}}}function Eie(e,t){for(let n=e[t];;){let r=1+(t<<1);if(r>=e.length)break;let o=e[r];if(r+1<e.length&&o.compare(e[r+1])>=0&&(o=e[r+1],r++),n.compare(o)<0)break;e[r]=n,e[t]=o,t=r}}class Iie{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Aie.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Bie(this.active,e),Bie(this.activeTo,e),Bie(this.activeRank,e),this.minActive=Nie(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:o}=this.cursor;for(;t<this.activeRank.length&&(o-this.activeRank[t]||r-this.activeTo[t])>0;)t++;Rie(this.active,t,n),Rie(this.activeTo,t,r),Rie(this.activeRank,t,o),e&&Rie(e,t,this.cursor.from),this.minActive=Nie(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&Bie(n,r)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let e=this.cursor.value;if(e.point){if(!(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)){this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}this.cursor.next()}else this.addActive(n),this.cursor.next()}}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function jie(e,t,n,r,o,i){e.goto(t),n.goto(r);let s=r+o,a=r,l=r-t;for(;;){let t=e.to+l-n.to||e.endSide-n.endSide,r=t<0?e.to+l:n.to,o=Math.min(r,s);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&Tie(e.activeForPoint(e.to),n.activeForPoint(n.to))||i.comparePoint(a,o,e.point,n.point):o>a&&!Tie(e.active,n.active)&&i.compareRange(a,o,e.active,n.active),r>s)break;a=r,t<=0&&e.next(),t>=0&&n.next()}}function Tie(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!e[n].eq(t[n]))return!1;return!0}function Bie(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function Rie(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function Nie(e,t){let n=-1,r=1e9;for(let o=0;o<t.length;o++)(t[o]-r||e[o].endSide-e[n].endSide)<0&&(n=o,r=t[o]);return n}function Die(e,t,n=e.length){let r=0;for(let o=0;o<n;)9==e.charCodeAt(o)?(r+=t-r%t,o++):(r++,o=doe(e,o));return r}function Mie(e,t,n,r){for(let r=0,o=0;;){if(o>=t)return r;if(r==e.length)break;o+=9==e.charCodeAt(r)?n-o%n:1,r=doe(e,r)}return!0===r?-1:e.length}const Pie="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),Oie="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),Lie="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class Fie{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function o(e,t,i,s){let a=[],l=/^@(\w+)\b/.exec(e[0]),c=l&&"keyframes"==l[1];if(l&&null==t)return i.push(e[0]+";");for(let n in t){let s=t[n];if(/&/.test(n))o(n.split(/,\s*/).map((t=>e.map((e=>t.replace(/&/,e))))).reduce(((e,t)=>e.concat(t))),s,i);else if(s&&"object"==typeof s){if(!l)throw new RangeError("The value of a property ("+n+") should be a primitive value.");o(r(n),s,a,c)}else null!=s&&a.push(n.replace(/_.*/,"").replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()))+": "+s+";")}(a.length||c)&&i.push((!n||l||s?e:e.map(n)).join(", ")+" {"+a.join(" ")+"}")}for(let t in e)o(r(t),e[t],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=Lie[Pie]||1;return Lie[Pie]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let r=e[Oie],o=n&&n.nonce;r?o&&r.setNonce(o):r=new Uie(e,o),r.mount(Array.isArray(t)?t:[t],e)}}let zie=new Map;class Uie{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=zie.get(n);if(t)return e[Oie]=t;this.sheet=new r.CSSStyleSheet,zie.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Oie]=this}mount(e,t){let n=this.sheet,r=0,o=0;for(let t=0;t<e.length;t++){let i=e[t],s=this.modules.indexOf(i);if(s<o&&s>-1&&(this.modules.splice(s,1),o--,s=-1),-1==s){if(this.modules.splice(o++,0,i),n)for(let e=0;e<i.rules.length;e++)n.insertRule(i.rules[e],r++)}else{for(;o<s;)r+=this.modules[o++].rules.length;r+=i.rules.length,o++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e="";for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+"\n";this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}for(var Vie={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Hie={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},$ie="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Wie="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Gie=0;Gie<10;Gie++)Vie[48+Gie]=Vie[96+Gie]=String(Gie);for(Gie=1;Gie<=24;Gie++)Vie[Gie+111]="F"+Gie;for(Gie=65;Gie<=90;Gie++)Vie[Gie]=String.fromCharCode(Gie+32),Hie[Gie]=String.fromCharCode(Gie);for(var qie in Vie)Hie.hasOwnProperty(qie)||(Hie[qie]=Vie[qie]);function Kie(e){let t;return t=11==e.nodeType?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function Yie(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function Jie(e,t){if(!t.anchorNode)return!1;try{return Yie(e,t.anchorNode)}catch(e){return!1}}function Xie(e){return 3==e.nodeType?use(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function Zie(e,t,n,r){return!!n&&(tse(e,t,n,r,-1)||tse(e,t,n,r,1))}function Qie(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function ese(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function tse(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:nse(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||1!=n.nodeType)return!1;t=Qie(e)+(o<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if(1==(e=e.childNodes[t+(o<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=o<0?nse(e):0}}}function nse(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function rse(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function ose(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function ise(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}class sse{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?nse(t):0),n,Math.min(e.focusOffset,n?nse(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}}let ase,lse=null;function cse(e){if(e.setActive)return e.setActive();if(lse)return e.focus(lse);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==lse?{get preventScroll(){return lse={preventScroll:!0},!0}}:void 0),!lse){lse=!1;for(let e=0;e<t.length;){let n=t[e++],r=t[e++],o=t[e++];n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=o&&(n.scrollLeft=o)}}}function use(e,t,n=t){let r=ase||(ase=document.createRange());return r.setEnd(e,n),r.setStart(e,t),r}function dse(e,t,n,r){let o={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:o.altKey,ctrlKey:o.ctrlKey,shiftKey:o.shiftKey,metaKey:o.metaKey}=r);let i=new KeyboardEvent("keydown",o);i.synthetic=!0,e.dispatchEvent(i);let s=new KeyboardEvent("keyup",o);return s.synthetic=!0,e.dispatchEvent(s),i.defaultPrevented||s.defaultPrevented}function hse(e){for(;e.attributes.length;)e.removeAttributeNode(e.attributes[0])}function pse(e){return e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function fse(e,t){for(let n=e,r=t;;){if(3==n.nodeType&&r>0)return{node:n,offset:r};if(1==n.nodeType&&r>0){if("false"==n.contentEditable)return null;n=n.childNodes[r-1],r=nse(n)}else{if(!n.parentNode||ese(n))return null;r=Qie(n),n=n.parentNode}}}function mse(e,t){for(let n=e,r=t;;){if(3==n.nodeType&&r<n.nodeValue.length)return{node:n,offset:r};if(1==n.nodeType&&r<n.childNodes.length){if("false"==n.contentEditable)return null;n=n.childNodes[r],r=0}else{if(!n.parentNode||ese(n))return null;r=Qie(n)+1,n=n.parentNode}}}class gse{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new gse(e.parentNode,Qie(e),t)}static after(e,t){return new gse(e.parentNode,Qie(e)+1,t)}}const bse=[];class yse{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let n of this.children){if(n==e)return t;t+=n.length+n.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(2&this.flags){let n,r=this.dom,o=null;for(let i of this.children){if(7&i.flags){if(!i.dom&&(n=o?o.nextSibling:r.firstChild)){let e=yse.get(n);(!e||!e.parent&&e.canReuseDOM(i))&&i.reuseDOM(n)}i.sync(e,t),i.flags&=-8}if(n=o?o.nextSibling:r.firstChild,t&&!t.written&&t.node==r&&n!=i.dom&&(t.written=!0),i.dom.parentNode==r)for(;n&&n!=i.dom;)n=vse(n);else r.insertBefore(i.dom,n);o=i.dom}for(n=o?o.nextSibling:r.firstChild,n&&t&&t.node==r&&(t.written=!0);n;)n=vse(n)}else if(1&this.flags)for(let n of this.children)7&n.flags&&(n.sync(e,t),n.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let n;if(e==this.dom)n=this.dom.childNodes[t];else{let r=0==nse(e)?0:0==t?-1:1;for(;;){let t=e.parentNode;if(t==this.dom)break;0==r&&t.firstChild!=t.lastChild&&(r=e==t.firstChild?-1:1),e=t}n=r<0?e:e.nextSibling}if(n==this.dom.firstChild)return 0;for(;n&&!yse.get(n);)n=n.nextSibling;if(!n)return this.length;for(let e=0,t=0;;e++){let r=this.children[e];if(r.dom==n)return t;t+=r.length+r.breakAfter}}domBoundsAround(e,t,n=0){let r=-1,o=-1,i=-1,s=-1;for(let a=0,l=n,c=n;a<this.children.length;a++){let n=this.children[a],u=l+n.length;if(l<e&&u>t)return n.domBoundsAround(e,t,l);if(u>=e&&-1==r&&(r=a,o=l),l>t&&n.dom.parentNode==this.dom){i=a,s=c;break}c=u,l=u+n.breakAfter}return{from:o,to:s<0?n+this.length:s,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:i<this.children.length&&i>=0?this.children[i].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),1&t.flags)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,7&this.flags&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=bse){this.markDirty();for(let r=e;r<t;r++){let e=this.children[r];e.parent==this&&n.indexOf(e)<0&&e.destroy()}this.children.splice(e,t-e,...n);for(let e=0;e<n.length;e++)n[e].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new _se(this.children,e,this.children.length)}childPos(e,t=1){return this.childCursor().findPos(e,t)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==e?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,t,n,r,o,i){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!(8&(this.flags|e.flags))}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}function vse(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}yse.prototype.breakAfter=0;class _se{constructor(e,t,n){this.children=e,this.pos=t,this.i=n,this.off=0}findPos(e,t=1){for(;;){if(e>this.pos||e==this.pos&&(t>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function xse(e,t,n,r,o,i,s,a,l){let{children:c}=e,u=c.length?c[t]:null,d=i.length?i[i.length-1]:null,h=d?d.breakAfter:s;if(!(t==r&&u&&!s&&!h&&i.length<2&&u.merge(n,o,i.length?d:null,0==n,a,l))){if(r<c.length){let e=c[r];e&&(o<e.length||e.breakAfter&&(null==d?void 0:d.breakAfter))?(t==r&&(e=e.split(o),o=0),!h&&d&&e.merge(0,o,d,!0,0,l)?i[i.length-1]=e:((o||e.children.length&&!e.children[0].length)&&e.merge(0,o,null,!1,0,l),i.push(e))):(null==e?void 0:e.breakAfter)&&(d?d.breakAfter=1:s=1),r++}for(u&&(u.breakAfter=s,n>0&&(!s&&i.length&&u.merge(n,u.length,i[0],!1,a,0)?u.breakAfter=i.shift().breakAfter:(n<u.length||u.children.length&&0==u.children[u.children.length-1].length)&&u.merge(n,u.length,null,!1,a,0),t++));t<r&&i.length;)if(c[r-1].become(i[i.length-1]))r--,i.pop(),l=i.length?0:a;else{if(!c[t].become(i[0]))break;t++,i.shift(),a=i.length?0:l}!i.length&&t&&r<c.length&&!c[t-1].breakAfter&&c[r].merge(0,0,c[t-1],!1,a,l)&&t--,(t<r||i.length)&&e.replaceChildren(t,r,i)}}function wse(e,t,n,r,o,i){let s=e.childCursor(),{i:a,off:l}=s.findPos(n,1),{i:c,off:u}=s.findPos(t,-1),d=t-n;for(let e of r)d+=e.length;e.length+=d,xse(e,c,u,a,l,r,0,o,i)}let kse="undefined"!=typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},Cse="undefined"!=typeof document?document:{documentElement:{style:{}}};const Sse=/Edge\/(\d+)/.exec(kse.userAgent),Ase=/MSIE \d/.test(kse.userAgent),Ese=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(kse.userAgent),Ise=!!(Ase||Ese||Sse),jse=!Ise&&/gecko\/(\d+)/i.test(kse.userAgent),Tse=!Ise&&/Chrome\/(\d+)/.exec(kse.userAgent),Bse="webkitFontSmoothing"in Cse.documentElement.style,Rse=!Ise&&/Apple Computer/.test(kse.vendor),Nse=Rse&&(/Mobile\/\w+/.test(kse.userAgent)||kse.maxTouchPoints>2);var Dse={mac:Nse||/Mac/.test(kse.platform),windows:/Win/.test(kse.platform),linux:/Linux|X11/.test(kse.platform),ie:Ise,ie_version:Ase?Cse.documentMode||6:Ese?+Ese[1]:Sse?+Sse[1]:0,gecko:jse,gecko_version:jse?+(/Firefox\/(\d+)/.exec(kse.userAgent)||[0,0])[1]:0,chrome:!!Tse,chrome_version:Tse?+Tse[1]:0,ios:Nse,android:/Android\b/.test(kse.userAgent),webkit:Bse,safari:Rse,webkit_version:Bse?+(/\bAppleWebKit\/(\d+)/.exec(kse.userAgent)||[0,0])[1]:0,tabSize:null!=Cse.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class Mse extends yse{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){3==e.nodeType&&this.createDOM(e)}merge(e,t,n){return!(8&this.flags||n&&(!(n instanceof Mse)||this.length-(t-e)+n.length>256||8&n.flags)||(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),0))}split(e){let t=new Mse(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=8&this.flags,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new gse(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return function(e,t,n){let r=e.nodeValue.length;t>r&&(t=r);let o=t,i=t,s=0;0==t&&n<0||t==r&&n>=0?Dse.chrome||Dse.gecko||(t?(o--,s=1):i<r&&(i++,s=-1)):n<0?o--:i<r&&i++;let a=use(e,o,i).getClientRects();if(!a.length)return null;let l=a[(s?s<0:n>=0)?0:a.length-1];return Dse.safari&&!s&&0==l.width&&(l=Array.prototype.find.call(a,(e=>e.width))||l),s?rse(l,s<0):l||null}(this.dom,e,t)}}class Pse extends yse{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let e of t)e.setParent(this)}setAttrs(e){if(hse(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!(8&(this.flags|e.flags))}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,n,r,o,i){return!(n&&(!(n instanceof Pse&&n.mark.eq(this.mark))||e&&o<=0||t<this.length&&i<=0)||(wse(this,e,t,n?n.children.slice():[],o-1,i-1),this.markDirty(),0))}split(e){let t=[],n=0,r=-1,o=0;for(let i of this.children){let s=n+i.length;s>e&&t.push(n<e?i.split(e-n):i),r<0&&n>=e&&(r=o),n=s,o++}let i=this.length-e;return this.length=e,r>-1&&(this.children.length=r,this.markDirty()),new Pse(this.mark,t,i)}domAtPos(e){return Fse(this,e)}coordsAt(e,t){return Use(this,e,t)}}class Ose extends yse{static create(e,t,n){return new Ose(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=Ose.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){this.dom&&this.widget.updateDOM(this.dom,e)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,n,r,o,i){return!(n&&(!(n instanceof Ose&&this.widget.compare(n.widget))||e>0&&o<=0||t<this.length&&i<=0)||(this.length=e+(n?n.length:0)+(this.length-t),0))}become(e){return e instanceof Ose&&e.side==this.side&&this.widget.constructor==e.widget.constructor&&(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0)}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(0==this.length)return Xre.empty;let e=this;for(;e.parent;)e=e.parent;let{view:t}=e,n=t&&t.state.doc,r=this.posAtStart;return n?n.slice(r,r+this.length):Xre.empty}domAtPos(e){return(this.length?0==e:this.side>0)?gse.before(this.dom):gse.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let r=this.dom.getClientRects(),o=null;if(!r.length)return null;let i=this.side?this.side<0:e>0;for(let t=i?r.length-1:0;o=r[t],!(e>0?0==t:t==r.length-1||o.top<o.bottom);t+=i?-1:1);return rse(o,!i)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class Lse extends yse{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof Lse&&e.side==this.side}split(){return new Lse(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?gse.before(this.dom):gse.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Xre.empty}get isHidden(){return!0}}function Fse(e,t){let n=e.dom,{children:r}=e,o=0;for(let e=0;o<r.length;o++){let i=r[o],s=e+i.length;if(!(s==e&&i.getSide()<=0)){if(t>e&&t<s&&i.dom.parentNode==n)return i.domAtPos(t-e);if(t<=e)break;e=s}}for(let e=o;e>0;e--){let t=r[e-1];if(t.dom.parentNode==n)return t.domAtPos(t.length)}for(let e=o;e<r.length;e++){let t=r[e];if(t.dom.parentNode==n)return t.domAtPos(0)}return new gse(n,0)}function zse(e,t,n){let r,{children:o}=e;n>0&&t instanceof Pse&&o.length&&(r=o[o.length-1])instanceof Pse&&r.mark.eq(t.mark)?zse(r,t.children[0],n-1):(o.push(t),t.setParent(e)),e.length+=t.length}function Use(e,t,n){let r=null,o=-1,i=null,s=-1;!function e(t,a){for(let l=0,c=0;l<t.children.length&&c<=a;l++){let u=t.children[l],d=c+u.length;d>=a&&(u.children.length?e(u,a-c):(!i||i.isHidden&&n>0)&&(d>a||c==d&&u.getSide()>0)?(i=u,s=a-c):(c<a||c==d&&u.getSide()<0&&!u.isHidden)&&(r=u,o=a-c)),c=d}}(e,t);let a=(n<0?r:i)||r||i;return a?a.coordsAt(Math.max(0,a==r?o:s),n):function(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=Xie(t);return n[n.length-1]||null}(e)}function Vse(e,t){for(let n in e)"class"==n&&t.class?t.class+=" "+e.class:"style"==n&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}Mse.prototype.children=Ose.prototype.children=Lse.prototype.children=bse;const Hse=Object.create(null);function $se(e,t,n){if(e==t)return!0;e||(e=Hse),t||(t=Hse);let r=Object.keys(e),o=Object.keys(t);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=o.length-(n&&o.indexOf(n)>-1?1:0))return!1;for(let i of r)if(i!=n&&(-1==o.indexOf(i)||e[i]!==t[i]))return!1;return!0}function Wse(e,t,n){let r=!1;if(t)for(let o in t)n&&o in n||(r=!0,"style"==o?e.style.cssText="":e.removeAttribute(o));if(n)for(let o in n)t&&t[o]==n[o]||(r=!0,"style"==o?e.style.cssText=n[o]:e.setAttribute(o,n[o]));return r}function Gse(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}class qse extends yse{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,n,r,o,i){if(n){if(!(n instanceof qse))return!1;this.dom||n.transferDOM(this)}return r&&this.setDeco(n?n.attrs:null),wse(this,e,t,n?n.children.slice():[],o,i),!0}split(e){let t=new qse;if(t.breakAfter=this.breakAfter,0==this.length)return t;let{i:n,off:r}=this.childPos(e);r&&(t.append(this.children[n].split(r),0),this.children[n].merge(r,this.children[n].length,null,!1,0,0),n++);for(let e=n;e<this.children.length;e++)t.append(this.children[e],0);for(;n>0&&0==this.children[n-1].length;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){$se(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){zse(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=Vse(t,this.attrs||{})),n&&(this.attrs=Vse({class:n},this.attrs||{}))}domAtPos(e){return Fse(this,e)}reuseDOM(e){"DIV"==e.nodeName&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?4&this.flags&&(hse(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(Wse(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let r=this.dom.lastChild;for(;r&&yse.get(r)instanceof Pse;)r=r.lastChild;if(!(r&&this.length&&("BR"==r.nodeName||0!=(null===(n=yse.get(r))||void 0===n?void 0:n.isEditable)||Dse.ios&&this.children.some((e=>e instanceof Mse))))){let e=document.createElement("BR");e.cmIgnore=!0,this.dom.appendChild(e)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let e,t=0;for(let n of this.children){if(!(n instanceof Mse)||/[^ -~]/.test(n.text))return null;let r=Xie(n.dom);if(1!=r.length)return null;t+=r[0].width,e=r[0].height}return t?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length,textHeight:e}:null}coordsAt(e,t){let n=Use(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:e}=this.parent.view.viewState,t=n.bottom-n.top;if(Math.abs(t-e.lineHeight)<2&&e.textHeight<t){let r=(t-e.textHeight)/2;return{top:n.top+r,bottom:n.bottom-r,left:n.left,right:n.left}}}return n}become(e){return e instanceof qse&&0==this.children.length&&0==e.children.length&&$se(this.attrs,e.attrs)&&this.breakAfter==e.breakAfter}covers(){return!0}static find(e,t){for(let n=0,r=0;n<e.children.length;n++){let o=e.children[n],i=r+o.length;if(i>=t){if(o instanceof qse)return o;if(i>t)break}r=i+o.breakAfter}return null}}class Kse extends yse{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,r,o,i){return!(n&&(!(n instanceof Kse&&this.widget.compare(n.widget))||e>0&&o<=0||t<this.length&&i<=0)||(this.length=e+(n?n.length:0)+(this.length-t),0))}domAtPos(e){return 0==e?gse.before(this.dom):gse.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let n=new Kse(this.widget,t,this.deco);return n.breakAfter=this.breakAfter,n}get children(){return bse}sync(e){this.dom&&this.widget.updateDOM(this.dom,e)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):Xre.empty}domBoundsAround(){return null}become(e){return e instanceof Kse&&e.widget.constructor==this.widget.constructor&&(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0)}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,t){return this.widget.coordsAt(this.dom,e,t)}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:t,endSide:n}=this.deco;return t!=n&&(e<0?t<0:n>0)}}class Yse{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Jse=function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e}(Jse||(Jse={}));class Xse extends yie{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new Zse(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new eae(e,t,t,n,e.widget||null,!1)}static replace(e){let t,n,r=!!e.block;if(e.isBlockGap)t=-5e8,n=4e8;else{let{start:o,end:i}=tae(e,r);t=(o?r?-3e8:-1:5e8)-1,n=1+(i?r?2e8:1:-6e8)}return new eae(e,t,n,r,e.widget||null,!0)}static line(e){return new Qse(e)}static set(e,t=!1){return wie.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}Xse.none=wie.empty;class Zse extends Xse{constructor(e){let{start:t,end:n}=tae(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof Zse&&this.tagName==e.tagName&&(this.class||(null===(t=this.attrs)||void 0===t?void 0:t.class))==(e.class||(null===(n=e.attrs)||void 0===n?void 0:n.class))&&$se(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}Zse.prototype.point=!1;class Qse extends Xse{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Qse&&this.spec.class==e.spec.class&&$se(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}Qse.prototype.mapMode=_oe.TrackBefore,Qse.prototype.point=!0;class eae extends Xse{constructor(e,t,n,r,o,i){super(t,n,o,e),this.block=r,this.isReplace=i,this.mapMode=r?t<=0?_oe.TrackBefore:_oe.TrackAfter:_oe.TrackDel}get type(){return this.startSide!=this.endSide?Jse.WidgetRange:this.startSide<=0?Jse.WidgetBefore:Jse.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof eae&&function(e,t){return e==t||!!(e&&t&&e.compare(t))}(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}function tae(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return null==n&&(n=e.inclusive),null==r&&(r=e.inclusive),{start:null!=n?n:t,end:null!=r?r:t}}function nae(e,t,n,r=0){let o=n.length-1;o>=0&&n[o]+r>=e?n[o]=Math.max(n[o],t):n.push(e,t)}eae.prototype.point=!0;class rae{constructor(e,t,n,r){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=r,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Kse&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new qse),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(oae(new Lse(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,this.posCovered()||e&&this.content.length&&this.content[this.content.length-1]instanceof Kse||this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:r}=this.cursor.next(this.skip);if(this.skip=0,r)throw new Error("Ran out of text content when drawing inline views");if(n){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}this.text=t,this.textOff=0}let r=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(oae(new Mse(this.text.slice(this.textOff,this.textOff+r)),t),n),this.atCursorPos=!0,this.textOff+=r,e-=r,n=0}}span(e,t,n,r){this.buildText(t-e,n,r),this.pos=t,this.openStart<0&&(this.openStart=r)}point(e,t,n,r,o,i){if(this.disallowBlockEffectsFor[i]&&n instanceof eae){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let s=t-e;if(n instanceof eae)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Kse(n.widget||iae.block,s,n));else{let i=Ose.create(n.widget||iae.inline,s,s?0:n.startSide),a=this.atCursorPos&&!i.isEditable&&o<=r.length&&(e<t||n.startSide>0),l=!i.isEditable&&(e<t||o>r.length||n.startSide<=0),c=this.getLine();2!=this.pendingBuffer||a||i.isEditable||(this.pendingBuffer=0),this.flushBuffer(r),a&&(c.append(oae(new Lse(1),r),o),o=r.length+Math.max(0,o-r.length)),c.append(oae(i,r),o),this.atCursorPos=l,this.pendingBuffer=l?e<t||o>r.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=r.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);s&&(this.textOff+s<=this.text.length?this.textOff+=s:(this.skip+=s-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=o)}static build(e,t,n,r,o){let i=new rae(e,t,n,o);return i.openEnd=wie.spans(r,t,n,i),i.openStart<0&&(i.openStart=i.openEnd),i.finish(i.openEnd),i}}function oae(e,t){for(let n of t)e=new Pse(n,[e],e.length);return e}class iae extends Yse{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}iae.inline=new iae("span"),iae.block=new iae("div");var sae=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(sae||(sae={}));const aae=sae.LTR,lae=sae.RTL;function cae(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<+e[n]);return t}const uae=cae("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),dae=cae("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),hae=Object.create(null),pae=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);hae[t]=n,hae[n]=-t}function fae(e){return e<=247?uae[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?dae[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}const mae=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class gae{get dir(){return this.level%2?lae:aae}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let o=-1;for(let i=0;i<e.length;i++){let s=e[i];if(s.from<=t&&s.to>=t){if(s.level==n)return i;(o<0||(0!=r?r<0?s.from<t:s.to>t:e[o].level>s.level))&&(o=i)}}if(o<0)throw new RangeError("Index out of range");return o}}function bae(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],o=t[n];if(r.from!=o.from||r.to!=o.to||r.direction!=o.direction||!bae(r.inner,o.inner))return!1}return!0}const yae=[];function vae(e,t,n,r,o,i,s){let a=r%2?2:1;if(r%2==o%2)for(let l=t,c=0;l<n;){let t=!0,u=!1;if(c==i.length||l<i[c].from){let e=yae[l];e!=a&&(t=!1,u=16==e)}let d=t||1!=a?null:[],h=t?r:r+1,p=l;e:for(;;)if(c<i.length&&p==i[c].from){if(u)break e;let f=i[c];if(!t)for(let e=f.to,t=c+1;;){if(e==n)break e;if(!(t<i.length&&i[t].from==e)){if(yae[e]==a)break e;break}e=i[t++].to}c++,d?d.push(f):(f.from>l&&s.push(new gae(l,f.from,h)),_ae(e,f.direction==aae!=!(h%2)?r+1:r,o,f.inner,f.from,f.to,s),l=f.to),p=f.to}else{if(p==n||(t?yae[p]!=a:yae[p]==a))break;p++}d?vae(e,l,p,r+1,o,d,s):l<p&&s.push(new gae(l,p,h)),l=p}else for(let l=n,c=i.length;l>t;){let n=!0,u=!1;if(!c||l>i[c-1].to){let e=yae[l-1];e!=a&&(n=!1,u=16==e)}let d=n||1!=a?null:[],h=n?r:r+1,p=l;e:for(;;)if(c&&p==i[c-1].to){if(u)break e;let f=i[--c];if(!n)for(let e=f.from,n=c;;){if(e==t)break e;if(!n||i[n-1].to!=e){if(yae[e-1]==a)break e;break}e=i[--n].from}d?d.push(f):(f.to<l&&s.push(new gae(f.to,l,h)),_ae(e,f.direction==aae!=!(h%2)?r+1:r,o,f.inner,f.from,f.to,s),l=f.from),p=f.from}else{if(p==t||(n?yae[p-1]!=a:yae[p-1]==a))break;p--}d?vae(e,p,l,r+1,o,d,s):p<l&&s.push(new gae(p,l,h)),l=p}}function _ae(e,t,n,r,o,i,s){let a=t%2?2:1;!function(e,t,n,r,o){for(let i=0;i<=r.length;i++){let s=i?r[i-1].to:t,a=i<r.length?r[i].from:n,l=i?256:o;for(let t=s,n=l,r=l;t<a;t++){let o=fae(e.charCodeAt(t));512==o?o=n:8==o&&4==r&&(o=16),yae[t]=4==o?2:o,7&o&&(r=o),n=o}for(let e=s,t=l,r=l;e<a;e++){let o=yae[e];if(128==o)e<a-1&&t==yae[e+1]&&24&t?o=yae[e]=t:yae[e]=256;else if(64==o){let o=e+1;for(;o<a&&64==yae[o];)o++;let i=e&&8==t||o<n&&8==yae[o]?1==r?1:8:256;for(let t=e;t<o;t++)yae[t]=i;e=o-1}else 8==o&&1==r&&(yae[e]=1);t=o,7&o&&(r=o)}}}(e,o,i,r,a),function(e,t,n,r,o){let i=1==o?2:1;for(let s=0,a=0,l=0;s<=r.length;s++){let c=s?r[s-1].to:t,u=s<r.length?r[s].from:n;for(let t,n,r,s=c;s<u;s++)if(n=hae[t=e.charCodeAt(s)])if(n<0){for(let e=a-3;e>=0;e-=3)if(pae[e+1]==-n){let t=pae[e+2],n=2&t?o:4&t?1&t?i:o:0;n&&(yae[s]=yae[pae[e]]=n),a=e;break}}else{if(189==pae.length)break;pae[a++]=s,pae[a++]=t,pae[a++]=l}else if(2==(r=yae[s])||1==r){let e=r==o;l=e?0:1;for(let t=a-3;t>=0;t-=3){let n=pae[t+2];if(2&n)break;if(e)pae[t+2]|=2;else{if(4&n)break;pae[t+2]|=4}}}}}(e,o,i,r,a),function(e,t,n,r){for(let o=0,i=r;o<=n.length;o++){let s=o?n[o-1].to:e,a=o<n.length?n[o].from:t;for(let l=s;l<a;){let s=yae[l];if(256==s){let s=l+1;for(;;)if(s==a){if(o==n.length)break;s=n[o++].to,a=o<n.length?n[o].from:t}else{if(256!=yae[s])break;s++}let c=1==i,u=c==(1==(s<t?yae[s]:r))?c?1:2:r;for(let t=s,r=o,i=r?n[r-1].to:e;t>l;)t==i&&(t=n[--r].from,i=r?n[r-1].to:e),yae[--t]=u;l=s}else i=s,l++}}}(o,i,r,a),vae(e,o,i,t,n,r,s)}function xae(e){return[new gae(0,e,0)]}let wae="";function kae(e,t,n,r,o){var i;let s=r.head-e.from,a=gae.find(t,s,null!==(i=r.bidiLevel)&&void 0!==i?i:-1,r.assoc),l=t[a],c=l.side(o,n);if(s==c){let e=a+=o?1:-1;if(e<0||e>=t.length)return null;l=t[a=e],s=l.side(!o,n),c=l.side(o,n)}let u=doe(e.text,s,l.forward(o,n));(u<l.from||u>l.to)&&(u=c),wae=e.text.slice(Math.min(s,u),Math.max(s,u));let d=a==(o?t.length-1:0)?null:t[a+(o?1:-1)];return d&&u==c&&d.level+(o?0:1)<l.level?Toe.cursor(d.side(!o,n)+e.from,d.forward(o,n)?1:-1,d.level):Toe.cursor(u+e.from,l.forward(o,n)?-1:1,l.level)}function Cae(e,t,n){for(let r=t;r<n;r++){let t=fae(e.charCodeAt(r));if(1==t)return aae;if(2==t||4==t)return lae}return aae}const Sae=Noe.define(),Aae=Noe.define(),Eae=Noe.define(),Iae=Noe.define(),jae=Noe.define(),Tae=Noe.define(),Bae=Noe.define(),Rae=Noe.define({combine:e=>e.some((e=>e))}),Nae=Noe.define({combine:e=>e.some((e=>e))}),Dae=Noe.define();class Mae{constructor(e,t="nearest",n="nearest",r=5,o=5,i=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=o,this.isSnapshot=i}map(e){return e.empty?this:new Mae(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Mae(Toe.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Pae=iie.define({map:(e,t)=>e.map(t)}),Oae=iie.define();function Lae(e,t,n){let r=e.facet(Iae);r.length?r[0](t):window.onerror?window.onerror(String(t),n,void 0,void 0,t):n?console.error(n+":",t):console.error(t)}const Fae=Noe.define({combine:e=>!e.length||e[0]});let zae=0;const Uae=Noe.define();class Vae{constructor(e,t,n,r,o){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.extension=o(this)}static define(e,t){const{eventHandlers:n,eventObservers:r,provide:o,decorations:i}=t||{};return new Vae(zae++,e,n,r,(e=>{let t=[Uae.of(e)];return i&&t.push(Gae.of((t=>{let n=t.plugin(e);return n?i(n):Xse.none}))),o&&t.push(o(e)),t}))}static fromClass(e,t){return Vae.define((t=>new e(t)),t)}}class Hae{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(Lae(e.state,t,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(e){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){Lae(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(t){Lae(e.state,t,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const $ae=Noe.define(),Wae=Noe.define(),Gae=Noe.define(),qae=Noe.define(),Kae=Noe.define(),Yae=Noe.define();function Jae(e,t){let n=e.state.facet(Yae);if(!n.length)return n;let r=n.map((t=>t instanceof Function?t(e):t)),o=[];return wie.spans(r,t.from,t.to,{point(){},span(e,n,r,i){let s=e-t.from,a=n-t.from,l=o;for(let e=r.length-1;e>=0;e--,i--){let n,o=r[e].spec.bidiIsolate;if(null==o&&(o=Cae(t.text,s,a)),i>0&&l.length&&(n=l[l.length-1]).to==s&&n.direction==o)n.to=a,l=n.inner;else{let e={from:s,to:a,direction:o,inner:[]};l.push(e),l=e.inner}}}}),o}const Xae=Noe.define();function Zae(e){let t=0,n=0,r=0,o=0;for(let i of e.state.facet(Xae)){let s=i(e);s&&(null!=s.left&&(t=Math.max(t,s.left)),null!=s.right&&(n=Math.max(n,s.right)),null!=s.top&&(r=Math.max(r,s.top)),null!=s.bottom&&(o=Math.max(o,s.bottom)))}return{left:t,right:n,top:r,bottom:o}}const Qae=Noe.define();class ele{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(e){return new ele(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(e,t){if(0==t.length)return e;let n=[];for(let r=0,o=0,i=0,s=0;;r++){let a=r==e.length?null:e[r],l=i-s,c=a?a.fromB:1e9;for(;o<t.length&&t[o]<c;){let e=t[o],r=t[o+1],i=Math.max(s,e),a=Math.min(c,r);if(i<=a&&new ele(i+l,a+l,i,a).addToSet(n),r>c)break;o+=2}if(!a)return n;new ele(a.fromA,a.toA,a.fromB,a.toB).addToSet(n),i=a.toA,s=a.toB}}}class tle{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=woe.empty(this.startState.doc.length);for(let e of n)this.changes=this.changes.compose(e.changes);let r=[];this.changes.iterChangedRanges(((e,t,n,o)=>r.push(new ele(e,t,n,o)))),this.changedRanges=r}static create(e,t,n){return new tle(e,t,n)}get viewportChanged(){return(4&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(10&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some((e=>e.selection))}get empty(){return 0==this.flags&&0==this.transactions.length}}class nle extends yse{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=Xse.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new qse],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new ele(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every((({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo))?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null===(t=this.domChanged)||void 0===t?void 0:t.newSel)?r=this.domChanged.newSel.head:function(e,t){let n=!1;return t&&e.iterChangedRanges(((e,r)=>{e<t.to&&r>t.from&&(n=!0)})),n}(e.changes,this.hasComposition)||e.selectionSet||(r=e.state.selection.main.head));let o=r>-1?function(e,t,n){let r=ole(e,n);if(!r)return null;let{node:o,from:i,to:s}=r,a=o.nodeValue;if(/[\n\r]/.test(a))return null;if(e.state.doc.sliceString(r.from,r.to)!=a)return null;let l=t.invertedDesc,c=new ele(l.mapPos(i),l.mapPos(s),i,s),u=[];for(let t=o.parentNode;;t=t.parentNode){let n=yse.get(t);if(n instanceof Pse)u.push({node:t,deco:n.mark});else{if(n instanceof qse||"DIV"==t.nodeName&&t.parentNode==e.contentDOM)return{range:c,text:o,marks:u,line:t};if(t==e.contentDOM)return null;u.push({node:t,deco:new Zse({inclusive:!0,attributes:Gse(t),tagName:t.tagName.toLowerCase()})})}}}(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:t,to:r}=this.hasComposition;n=new ele(t,r,e.changes.mapPos(t,-1),e.changes.mapPos(r,1)).addToSet(n.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(Dse.ie||Dse.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=function(e,t,n){let r=new ile;return wie.compare(e,t,n,r),r.changes}(this.decorations,this.updateDeco(),e.changes);return n=ele.extendWithRanges(n,i),!!(7&this.flags||0!=n.length)&&(this.updateInner(n,e.startState.doc.length,o),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);let{observer:r}=this.view;r.ignore((()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let e=Dse.chrome||Dse.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,e),this.flags&=-8,e&&(e.written||r.selectionRange.focusNode!=e.node)&&(this.forceSelection=!0),this.dom.style.height=""})),this.markedForComposition.forEach((e=>e.flags&=-9));let o=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.children)e instanceof Kse&&e.widget instanceof rle&&o.push(e.dom);r.updateGaps(o)}updateChildren(e,t,n){let r=n?n.range.addToSet(e.slice()):e,o=this.childCursor(t);for(let e=r.length-1;;e--){let t=e>=0?r[e]:null;if(!t)break;let i,s,a,l,{fromA:c,toA:u,fromB:d,toB:h}=t;if(n&&n.range.fromB<h&&n.range.toB>d){let e=rae.build(this.view.state.doc,d,n.range.fromB,this.decorations,this.dynamicDecorationMap),t=rae.build(this.view.state.doc,n.range.toB,h,this.decorations,this.dynamicDecorationMap);s=e.breakAtStart,a=e.openStart,l=t.openEnd;let r=this.compositionView(n);t.breakAtStart?r.breakAfter=1:t.content.length&&r.merge(r.length,r.length,t.content[0],!1,t.openStart,0)&&(r.breakAfter=t.content[0].breakAfter,t.content.shift()),e.content.length&&r.merge(0,0,e.content[e.content.length-1],!0,0,e.openEnd)&&e.content.pop(),i=e.content.concat(r).concat(t.content)}else({content:i,breakAtStart:s,openStart:a,openEnd:l}=rae.build(this.view.state.doc,d,h,this.decorations,this.dynamicDecorationMap));let{i:p,off:f}=o.findPos(u,1),{i:m,off:g}=o.findPos(c,-1);xse(this,m,g,p,f,i,s,a,l)}n&&this.fixCompositionDOM(n)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(Oae)&&(this.editContextFormatting=e.value)}compositionView(e){let t=new Mse(e.text.nodeValue);t.flags|=8;for(let{deco:n}of e.marks)t=new Pse(n,[t],t.length);let n=new qse;return n.append(t,0),n}fixCompositionDOM(e){let t=(e,t)=>{t.flags|=8|(t.children.some((e=>7&e.flags))?1:0),this.markedForComposition.add(t);let n=yse.get(e);n&&n!=t&&(n.dom=null),t.setDOM(e)},n=this.childPos(e.range.fromB,1),r=this.children[n.i];t(e.line,r);for(let o=e.marks.length-1;o>=-1;o--)n=r.childPos(n.off,1),r=r.children[n.i],t(o>=0?e.marks[o].node:e.text,r)}updateSelection(e=!1,t=!1){!e&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();let n=this.view.root.activeElement,r=n==this.dom,o=!r&&Jie(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(r||t||o))return;let i=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(s.anchor)),l=s.empty?a:this.moveToLine(this.domAtPos(s.head));if(Dse.gecko&&s.empty&&!this.hasComposition&&1==(c=a).node.nodeType&&c.node.firstChild&&(0==c.offset||"false"==c.node.childNodes[c.offset-1].contentEditable)&&(c.offset==c.node.childNodes.length||"false"==c.node.childNodes[c.offset].contentEditable)){let e=document.createTextNode("");this.view.observer.ignore((()=>a.node.insertBefore(e,a.node.childNodes[a.offset]||null))),a=l=new gse(e,0),i=!0}var c;let u=this.view.observer.selectionRange;!i&&u.focusNode&&(Zie(a.node,a.offset,u.anchorNode,u.anchorOffset)&&Zie(l.node,l.offset,u.focusNode,u.focusOffset)||this.suppressWidgetCursorChange(u,s))||(this.view.observer.ignore((()=>{Dse.android&&Dse.chrome&&this.dom.contains(u.focusNode)&&function(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(1==n.nodeType&&"false"==n.contentEditable)return!0;return!1}(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let e=Kie(this.view.root);if(e)if(s.empty){if(Dse.gecko){let e=function(e,t){return 1!=e.nodeType?0:(t&&"false"==e.childNodes[t-1].contentEditable?1:0)|(t<e.childNodes.length&&"false"==e.childNodes[t].contentEditable?2:0)}(a.node,a.offset);if(e&&3!=e){let t=(1==e?fse:mse)(a.node,a.offset);t&&(a=new gse(t.node,t.offset))}}e.collapse(a.node,a.offset),null!=s.bidiLevel&&void 0!==e.caretBidiLevel&&(e.caretBidiLevel=s.bidiLevel)}else if(e.extend){e.collapse(a.node,a.offset);try{e.extend(l.node,l.offset)}catch(e){}}else{let t=document.createRange();s.anchor>s.head&&([a,l]=[l,a]),t.setEnd(l.node,l.offset),t.setStart(a.node,a.offset),e.removeAllRanges(),e.addRange(t)}o&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())})),this.view.observer.setSelectionRange(a,l)),this.impreciseAnchor=a.precise?null:new gse(u.anchorNode,u.anchorOffset),this.impreciseHead=l.precise?null:new gse(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Zie(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=Kie(e.root),{anchorNode:r,anchorOffset:o}=e.observer.selectionRange;if(!(n&&t.empty&&t.assoc&&n.modify))return;let i=qse.find(this,t.head);if(!i)return;let s=i.posAtStart;if(t.head==s||t.head==s+i.length)return;let a=this.coordsAt(t.head,-1),l=this.coordsAt(t.head,1);if(!a||!l||a.bottom>l.top)return;let c=this.domAtPos(t.head+t.assoc);n.collapse(c.node,c.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(r,o)}moveToLine(e){let t,n=this.dom;if(e.node!=n)return e;for(let r=e.offset;!t&&r<n.childNodes.length;r++){let e=yse.get(n.childNodes[r]);e instanceof qse&&(t=e.domAtPos(0))}for(let r=e.offset-1;!t&&r>=0;r--){let e=yse.get(n.childNodes[r]);e instanceof qse&&(t=e.domAtPos(e.length))}return t?new gse(t.node,t.offset,!0):e}nearest(e){for(let t=e;t;){let e=yse.get(t);if(e&&e.rootView==this)return e;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;t<this.children.length-1;){let e=this.children[t];if(n<e.length||e instanceof qse)break;t++,n=0}return this.children[t].domAtPos(n)}coordsAt(e,t){let n=null,r=0;for(let o=this.length,i=this.children.length-1;i>=0;i--){let s=this.children[i],a=o-s.breakAfter,l=a-s.length;if(a<e)break;if(l<=e&&(l<e||s.covers(-1))&&(a>e||s.covers(1))&&(!n||s instanceof qse&&!(n instanceof qse&&t>=0)))n=s,r=l;else if(n&&l==e&&a==e&&s instanceof Kse&&Math.abs(t)<2){if(s.deco.startSide<0)break;i&&(n=null)}o=l}return n?n.coordsAt(e-r,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),r=this.children[t];if(!(r instanceof qse))return null;for(;r.children.length;){let{i:e,off:t}=r.childPos(n,1);for(;;e++){if(e==r.children.length)return null;if((r=r.children[e]).length)break}n=t}if(!(r instanceof Mse))return null;let o=doe(r.text,n);if(o==n)return null;let i=use(r.dom,n,o).getClientRects();for(let e=0;e<i.length;e++){let t=i[e];if(e==i.length-1||t.top<t.bottom&&t.left<t.right)return t}return null}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,o=this.view.contentDOM.clientWidth,i=o>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,s=-1,a=this.view.textDirection==sae.LTR;for(let e=0,l=0;l<this.children.length;l++){let c=this.children[l],u=e+c.length;if(u>r)break;if(e>=n){let n=c.dom.getBoundingClientRect();if(t.push(n.height),i){let t=c.dom.lastChild,r=t?Xie(t):[];if(r.length){let t=r[r.length-1],i=a?t.right-n.left:n.right-t.left;i>s&&(s=i,this.minWidth=o,this.minWidthFrom=e,this.minWidthTo=u)}}}e=u+c.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return"rtl"==getComputedStyle(this.children[t].dom).direction?sae.RTL:sae.LTR}measureTextSize(){for(let e of this.children)if(e instanceof qse){let t=e.measureTextSize();if(t)return t}let e,t,n,r=document.createElement("div");return r.className="cm-line",r.style.width="99999px",r.style.position="absolute",r.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((()=>{this.dom.appendChild(r);let o=Xie(r.firstChild)[0];e=r.getBoundingClientRect().height,t=o?o.width/27:7,n=o?o.height:e,r.remove()})),{lineHeight:e,charWidth:t,textHeight:n}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new _se(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let o=r==t.viewports.length?null:t.viewports[r],i=o?o.from-1:this.length;if(i>n){let r=(t.lineBlockAt(i).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(Xse.replace({widget:new rle(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,i))}if(!o)break;n=o.to+1}return Xse.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Gae).map((t=>(this.dynamicDecorationMap[e++]="function"==typeof t)?t(this.view):t)),n=!1,r=this.view.state.facet(qae).map(((e,t)=>{let r="function"==typeof e;return r&&(n=!0),r?e(this.view):e}));for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(wie.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);return this.view.scrollDOM.scrollTop=t.top-e.yMargin,void(this.view.scrollDOM.scrollLeft=e.xMargin)}for(let t of this.view.state.facet(Dae))try{if(t(this.view,e.range,e))return!0}catch(e){Lae(this.view.state,e,"scroll handler")}let t,{range:n}=e,r=this.coordsAt(n.head,n.empty?n.assoc:n.head>n.anchor?-1:1);if(!r)return;!n.empty&&(t=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,t.left),top:Math.min(r.top,t.top),right:Math.max(r.right,t.right),bottom:Math.max(r.bottom,t.bottom)});let o=Zae(this.view),i={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:s,offsetHeight:a}=this.view.scrollDOM;!function(e,t,n,r,o,i,s,a){let l=e.ownerDocument,c=l.defaultView||window;for(let u=e,d=!1;u&&!d;)if(1==u.nodeType){let e,h=u==l.body,p=1,f=1;if(h)e=ose(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:p,scaleY:f}=ise(u,t)),e={left:t.left,right:t.left+u.clientWidth*p,top:t.top,bottom:t.top+u.clientHeight*f}}let m=0,g=0;if("nearest"==o)t.top<e.top?(g=-(e.top-t.top+s),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+g+s)):t.bottom>e.bottom&&(g=t.bottom-e.bottom+s,n<0&&t.top-g<e.top&&(g=-(e.top+g-t.top+s)));else{let r=t.bottom-t.top,i=e.bottom-e.top;g=("center"==o&&r<=i?t.top+r/2-i/2:"start"==o||"center"==o&&n<0?t.top-s:t.bottom-i+s)-e.top}if("nearest"==r?t.left<e.left?(m=-(e.left-t.left+i),n>0&&t.right>e.right+m&&(m=t.right-e.right+m+i)):t.right>e.right&&(m=t.right-e.right+i,n<0&&t.left<e.left+m&&(m=-(e.left+m-t.left+i))):m=("center"==r?t.left+(t.right-t.left)/2-(e.right-e.left)/2:"start"==r==a?t.left-i:t.right-(e.right-e.left)+i)-e.left,m||g)if(h)c.scrollBy(m,g);else{let e=0,n=0;if(g){let e=u.scrollTop;u.scrollTop+=g/f,n=(u.scrollTop-e)*f}if(m){let t=u.scrollLeft;u.scrollLeft+=m/p,e=(u.scrollLeft-t)*p}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&Math.abs(e-m)<1&&(r="nearest"),n&&Math.abs(n-g)<1&&(o="nearest")}if(h)break;u=u.assignedSlot||u.parentNode}else{if(11!=u.nodeType)break;u=u.host}}(this.view.scrollDOM,i,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,s),-s),Math.max(Math.min(e.yMargin,a),-a),this.view.textDirection==sae.LTR)}}class rle extends Yse{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function ole(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=fse(n.focusNode,n.focusOffset),o=mse(n.focusNode,n.focusOffset),i=r||o;if(o&&r&&o.node!=r.node){let t=yse.get(o.node);if(!t||t instanceof Mse&&t.text!=o.node.nodeValue)i=o;else if(e.docView.lastCompositionAfterCursor){let e=yse.get(r.node);!e||e instanceof Mse&&e.text!=r.node.nodeValue||(i=o)}}if(e.docView.lastCompositionAfterCursor=i!=r,!i)return null;let s=t-i.offset;return{from:s,to:s+i.node.nodeValue.length,node:i.node}}let ile=class{constructor(){this.changes=[]}compareRange(e,t){nae(e,t,this.changes)}comparePoint(e,t){nae(e,t,this.changes)}};function sle(e,t){return t.left>e?t.left-e:Math.max(0,e-t.right)}function ale(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function lle(e,t){return e.top<t.bottom-1&&e.bottom>t.top+1}function cle(e,t){return t<e.top?{top:t,left:e.left,right:e.right,bottom:e.bottom}:e}function ule(e,t){return t>e.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function dle(e,t,n){let r,o,i,s,a,l,c,u,d=!1;for(let h=e.firstChild;h;h=h.nextSibling){let e=Xie(h);for(let p=0;p<e.length;p++){let f=e[p];o&&lle(o,f)&&(f=cle(ule(f,o.bottom),o.top));let m=sle(t,f),g=ale(n,f);if(0==m&&0==g)return 3==h.nodeType?hle(h,t,n):dle(h,t,n);if(!r||s>g||s==g&&i>m){r=h,o=f,i=m,s=g;let a=g?n<f.top?-1:1:m?t<f.left?-1:1:0;d=!a||(a>0?p<e.length-1:p>0)}0==m?n>f.bottom&&(!c||c.bottom<f.bottom)?(a=h,c=f):n<f.top&&(!u||u.top>f.top)&&(l=h,u=f):c&&lle(c,f)?c=ule(c,f.bottom):u&&lle(u,f)&&(u=cle(u,f.top))}}if(c&&c.bottom>=n?(r=a,o=c):u&&u.top<=n&&(r=l,o=u),!r)return{node:e,offset:0};let h=Math.max(o.left,Math.min(o.right,t));return 3==r.nodeType?hle(r,h,n):d&&"false"!=r.contentEditable?dle(r,h,n):{node:e,offset:Array.prototype.indexOf.call(e.childNodes,r)+(t>=(o.left+o.right)/2?1:0)}}function hle(e,t,n){let r=e.nodeValue.length,o=-1,i=1e9,s=0;for(let a=0;a<r;a++){let r=use(e,a,a+1).getClientRects();for(let l=0;l<r.length;l++){let c=r[l];if(c.top==c.bottom)continue;s||(s=t-c.left);let u=(c.top>n?c.top-n:n-c.bottom)-1;if(c.left-1<=t&&c.right+1>=t&&u<i){let n=t>=(c.left+c.right)/2,r=n;if((Dse.chrome||Dse.gecko)&&use(e,a).getBoundingClientRect().left==c.right&&(r=!n),u<=0)return{node:e,offset:a+(r?1:0)};o=a+(r?1:0),i=u}}}return{node:e,offset:o>-1?o:s>0?e.nodeValue.length:0}}function ple(e,t,n,r=-1){var o,i;let s,a=e.contentDOM.getBoundingClientRect(),l=a.top+e.viewState.paddingTop,{docHeight:c}=e.viewState,{x:u,y:d}=t,h=d-l;if(h<0)return 0;if(h>c)return e.state.doc.length;for(let t=e.viewState.heightOracle.textHeight/2,o=!1;s=e.elementAtHeight(h),s.type!=Jse.Text;)for(;h=r>0?s.bottom+t:s.top-t,!(h>=0&&h<=c);){if(o)return n?null:0;o=!0,r=-r}d=l+h;let p=s.from;if(p<e.viewport.from)return 0==e.viewport.from?0:n?null:fle(e,a,s,u,d);if(p>e.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:n?null:fle(e,a,s,u,d);let f=e.dom.ownerDocument,m=e.root.elementFromPoint?e.root:f,g=m.elementFromPoint(u,d);g&&!e.contentDOM.contains(g)&&(g=null),g||(u=Math.max(a.left+1,Math.min(a.right-1,u)),g=m.elementFromPoint(u,d),g&&!e.contentDOM.contains(g)&&(g=null));let b,y=-1;if(g&&0!=(null===(o=e.docView.nearest(g))||void 0===o?void 0:o.isEditable))if(f.caretPositionFromPoint){let e=f.caretPositionFromPoint(u,d);e&&({offsetNode:b,offset:y}=e)}else if(f.caretRangeFromPoint){let t=f.caretRangeFromPoint(u,d);t&&(({startContainer:b,startOffset:y}=t),(!e.contentDOM.contains(b)||Dse.safari&&function(e,t,n){let r;if(3!=e.nodeType||t!=(r=e.nodeValue.length))return!1;for(let t=e.nextSibling;t;t=t.nextSibling)if(1!=t.nodeType||"BR"!=t.nodeName)return!1;return use(e,r-1,r).getBoundingClientRect().left>n}(b,y,u)||Dse.chrome&&function(e,t,n){if(0!=t)return!1;for(let t=e;;){let e=t.parentNode;if(!e||1!=e.nodeType||e.firstChild!=t)return!1;if(e.classList.contains("cm-line"))break;t=e}return n-(1==e.nodeType?e.getBoundingClientRect():use(e,0,Math.max(e.nodeValue.length,1)).getBoundingClientRect()).left>5}(b,y,u))&&(b=void 0))}if(!b||!e.docView.dom.contains(b)){let t=qse.find(e.docView,p);if(!t)return h>s.top+s.height/2?s.to:s.from;({node:b,offset:y}=dle(t.dom,u,d))}let v=e.docView.nearest(b);if(!v)return null;if(v.isWidget&&1==(null===(i=v.dom)||void 0===i?void 0:i.nodeType)){let e=v.dom.getBoundingClientRect();return t.y<e.top||t.y<=e.bottom&&t.x<=(e.left+e.right)/2?v.posAtStart:v.posAtEnd}return v.localPosFromDOM(b,y)+v.posAtStart}function fle(e,t,n,r,o){let i=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;i+=Math.floor((o-n.top-.5*(e.defaultLineHeight-t))/t)*e.viewState.heightOracle.lineLength}let s=e.state.sliceDoc(n.from,n.to);return n.from+Mie(s,i,e.state.tabSize)}function mle(e,t){let n=e.lineBlockAt(t);if(Array.isArray(n.type))for(let e of n.type)if(e.to>t||e.to==t&&(e.to==n.to||e.type==Jse.Text))return e;return n}function gle(e,t,n,r){let o=e.state.doc.lineAt(t.head),i=e.bidiSpans(o),s=e.textDirectionAt(o.from);for(let a=t,l=null;;){let t=kae(o,i,s,a,n),c=wae;if(!t){if(o.number==(n?e.state.doc.lines:1))return a;c="\n",o=e.state.doc.line(o.number+(n?1:-1)),i=e.bidiSpans(o),t=e.visualLineSide(o,!n)}if(l){if(!l(c))return a}else{if(!r)return t;l=r(c)}a=t}}function ble(e,t,n){for(;;){let r=0;for(let o of e)o.between(t-1,t+1,((e,o,i)=>{if(t>e&&t<o){let i=r||n||(t-e<o-t?-1:1);t=i<0?e:o,r=i}}));if(!r)return t}}function yle(e,t,n){let r=ble(e.state.facet(Kae).map((t=>t(e))),n.from,t.head>n.from?-1:1);return r==n.from?n:Toe.cursor(r,r<n.from?1:-1)}class vle{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Dse.safari&&e.contentDOM.addEventListener("input",(()=>null)),Dse.gecko&&function(e){Gle.has(e)||(Gle.add(e),e.addEventListener("copy",(()=>{})),e.addEventListener("cut",(()=>{})))}(e.contentDOM.ownerDocument)}handleEvent(e){(function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n,r=t.target;r!=e.contentDOM;r=r.parentNode)if(!r||11==r.nodeType||(n=yse.get(r))&&n.ignoreEvent(t))return!1;return!0})(this.view,e)&&!this.ignoreDuringComposition(e)&&("keydown"==e.type&&this.keydown(e)||this.runHandlers(e.type,e))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=xle(e),n=this.handlers,r=this.view.contentDOM;for(let e in t)if("scroll"!=e){let o=!t[e].handlers.length,i=n[e];i&&o!=!i.handlers.length&&(r.removeEventListener(e,this.handleEvent),i=null),i||r.addEventListener(e,this.handleEvent,{passive:o})}for(let e in n)"scroll"==e||t[e]||r.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),9==e.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&27!=e.keyCode&&Cle.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Dse.android&&Dse.chrome&&!e.synthetic&&(13==e.keyCode||8==e.keyCode))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return!Dse.ios||e.synthetic||e.altKey||e.metaKey||!((t=wle.find((t=>t.keyCode==e.keyCode)))&&!e.ctrlKey||kle.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(229!=e.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=t||e,setTimeout((()=>this.flushIOSKey()),250),!0)}flushIOSKey(e){let t=this.pendingIOSKey;return!!t&&!("Enter"==t.key&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString()))&&(this.pendingIOSKey=void 0,dse(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!!/^key/.test(e.type)&&(this.composing>0||!!(Dse.safari&&!Dse.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function _le(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){Lae(n.state,e)}}}function xle(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec;if(e&&e.domEventHandlers)for(let r in e.domEventHandlers){let o=e.domEventHandlers[r];o&&n(r).handlers.push(_le(t.value,o))}if(e&&e.domEventObservers)for(let r in e.domEventObservers){let o=e.domEventObservers[r];o&&n(r).observers.push(_le(t.value,o))}}for(let e in Ele)n(e).handlers.push(Ele[e]);for(let e in Ile)n(e).observers.push(Ile[e]);return t}const wle=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],kle="dthko",Cle=[16,17,18,20,91,92,224,225];function Sle(e){return.7*Math.max(0,e)+8}class Ale{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=function(e){let t=e.ownerDocument;for(let n=e.parentNode;n&&n!=t.body;)if(1==n.nodeType){if(n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)return n;n=n.assignedSlot||n.parentNode}else{if(11!=n.nodeType)break;n=n.host}return null}(e.contentDOM),this.atoms=e.state.facet(Kae).map((t=>t(e)));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(gie.allowMultipleSelections)&&function(e,t){let n=e.state.facet(Sae);return n.length?n[0](t):Dse.mac?t.metaKey:t.ctrlKey}(e,t),this.dragging=!(!function(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=Kie(e.root);if(!r||0==r.rangeCount)return!0;let o=r.getRangeAt(0).getClientRects();for(let e=0;e<o.length;e++){let n=o[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}(e,t)||1!=zle(t))&&null}start(e){!1===this.dragging&&this.select(e)}move(e){var t;if(0==e.buttons)return this.destroy();if(this.dragging||null==this.dragging&&function(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,o=(null===(t=this.scrollParent)||void 0===t?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},i=Zae(this.view);e.clientX-i.left<=o.left+6?n=-Sle(o.left-e.clientX):e.clientX+i.right>=o.right-6&&(n=Sle(e.clientX-o.right)),e.clientY-i.top<=o.top+6?r=-Sle(o.top-e.clientY):e.clientY+i.bottom>=o.bottom-6&&(r=Sle(e.clientY-o.bottom)),this.setScrollSpeed(n,r)}up(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval((()=>this.scroll()),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),!1===this.dragging&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;n<e.ranges.length;n++){let r=e.ranges[n],o=null;if(r.empty){let e=ble(this.atoms,r.from,0);e!=r.from&&(o=Toe.cursor(e,-1))}else{let e=ble(this.atoms,r.from,-1),t=ble(this.atoms,r.to,1);e==r.from&&t==r.to||(o=Toe.range(r.from==r.anchor?e:t,r.from==r.head?e:t))}o&&(t||(t=e.ranges.slice()),t[n]=o)}return t?Toe.create(t,e.mainIndex):e}select(e){let{view:t}=this,n=this.skipAtoms(this.style.get(e,this.extend,this.multiple));!this.mustSelect&&n.eq(t.state.selection,!1===this.dragging)||this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some((e=>e.isUserEvent("input.type")))?this.destroy():this.style.update(e)&&setTimeout((()=>this.select(this.lastEvent)),20)}}const Ele=Object.create(null),Ile=Object.create(null),jle=Dse.ie&&Dse.ie_version<15||Dse.ios&&Dse.webkit_version<604;function Tle(e,t){let n,{state:r}=e,o=1,i=r.toText(t),s=i.lines==r.selection.ranges.length,a=null!=Vle&&r.selection.ranges.every((e=>e.empty))&&Vle==i.toString();if(a){let e=-1;n=r.changeByRange((n=>{let a=r.doc.lineAt(n.from);if(a.from==e)return{range:n};e=a.from;let l=r.toText((s?i.line(o++).text:t)+r.lineBreak);return{changes:{from:a.from,insert:l},range:Toe.cursor(n.from+l.length)}}))}else n=s?r.changeByRange((e=>{let t=i.line(o++);return{changes:{from:e.from,to:e.to,insert:t.text},range:Toe.cursor(e.from+t.length)}})):r.replaceSelection(i);e.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}function Ble(e,t,n,r){if(1==r)return Toe.cursor(t,n);if(2==r)return function(e,t,n=1){let r=e.charCategorizer(t),o=e.doc.lineAt(t),i=t-o.from;if(0==o.length)return Toe.cursor(t);0==i?n=1:i==o.length&&(n=-1);let s=i,a=i;n<0?s=doe(o.text,i,!1):a=doe(o.text,i);let l=r(o.text.slice(s,a));for(;s>0;){let e=doe(o.text,s,!1);if(r(o.text.slice(e,s))!=l)break;s=e}for(;a<o.length;){let e=doe(o.text,a);if(r(o.text.slice(a,e))!=l)break;a=e}return Toe.range(s+o.from,a+o.from)}(e.state,t,n);{let n=qse.find(e.docView,t),r=e.state.doc.lineAt(n?n.posAtEnd:t),o=n?n.posAtStart:r.from,i=n?n.posAtEnd:r.to;return i<e.state.doc.length&&i==r.to&&i++,Toe.range(o,i)}}Ile.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},Ele.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&0!=e.inputState.tabFocusMode&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),Ile.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin("select.pointer")},Ile.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},Ele.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(Eae))if(n=r(e,t),n)break;if(n||0!=t.button||(n=function(e,t){let n=Mle(e,t),r=zle(t),o=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),o=o.map(e.changes))},get(t,i,s){let a,l=Mle(e,t),c=Ble(e,l.pos,l.bias,r);if(n.pos!=l.pos&&!i){let t=Ble(e,n.pos,n.bias,r),o=Math.min(t.from,c.from),i=Math.max(t.to,c.to);c=o<c.from?Toe.range(o,i):Toe.range(i,o)}return i?o.replaceRange(o.main.extend(c.from,c.to)):s&&1==r&&o.ranges.length>1&&(a=function(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:o}=e.ranges[n];if(r<=t&&o>=t)return Toe.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}(o,l.pos))?a:s?o.addRange(c):Toe.create([c])}}}(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new Ale(e,t,n,r)),r&&e.observer.ignore((()=>{cse(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()}));let o=e.inputState.mouseSelection;if(o)return o.start(t),!1===o.dragging}return!1};let Rle=(e,t)=>e>=t.top&&e<=t.bottom,Nle=(e,t,n)=>Rle(t,n)&&e>=n.left&&e<=n.right;function Dle(e,t,n,r){let o=qse.find(e.docView,t);if(!o)return 1;let i=t-o.posAtStart;if(0==i)return 1;if(i==o.length)return-1;let s=o.coordsAt(i,-1);if(s&&Nle(n,r,s))return-1;let a=o.coordsAt(i,1);return a&&Nle(n,r,a)?1:s&&Rle(r,s)?-1:1}function Mle(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:Dle(e,n,t.clientX,t.clientY)}}const Ple=Dse.ie&&Dse.ie_version<=11;let Ole=null,Lle=0,Fle=0;function zle(e){if(!Ple)return e.detail;let t=Ole,n=Fle;return Ole=e,Fle=Date.now(),Lle=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(Lle+1)%3:1}function Ule(e,t,n,r){if(!n)return;let o=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:i}=e.inputState,s=r&&i&&function(e,t){let n=e.state.facet(Aae);return n.length?n[0](t):Dse.mac?!t.altKey:!t.ctrlKey}(e,t)?{from:i.from,to:i.to}:null,a={from:o,insert:n},l=e.state.changes(s?[s,a]:a);e.focus(),e.dispatch({changes:l,selection:{anchor:l.mapPos(o,-1),head:l.mapPos(o,1)},userEvent:s?"move.drop":"input.drop"}),e.inputState.draggedContent=null}Ele.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.nearest(t.target);if(r&&r.isWidget){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=Toe.range(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",e.state.sliceDoc(n.from,n.to)),t.dataTransfer.effectAllowed="copyMove"),!1},Ele.dragend=e=>(e.inputState.draggedContent=null,!1),Ele.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),o=0,i=()=>{++o==n.length&&Ule(e,t,r.filter((e=>null!=e)).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=i,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),i()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData("Text");if(n)return Ule(e,t,n,!0),!0}return!1},Ele.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=jle?null:t.clipboardData;return n?(Tle(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(function(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout((()=>{e.focus(),n.remove(),Tle(e,n.value)}),50)}(e),!1)};let Vle=null;Ele.copy=Ele.cut=(e,t)=>{let{text:n,ranges:r,linewise:o}=function(e){let t=[],n=[],r=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let o=-1;for(let{from:r}of e.selection.ranges){let i=e.doc.lineAt(r);i.number>o&&(t.push(i.text),n.push({from:i.from,to:Math.min(e.doc.length,i.to+1)})),o=i.number}r=!0}return{text:t.join(e.lineBreak),ranges:n,linewise:r}}(e.state);if(!n&&!o)return!1;Vle=o?n:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let i=jle?null:t.clipboardData;return i?(i.clearData(),i.setData("text/plain",n),!0):(function(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout((()=>{r.remove(),e.focus()}),50)}(e,n),!1)};const Hle=nie.define();function $le(e,t){let n=[];for(let r of e.facet(Bae)){let o=r(e,t);o&&n.push(o)}return n?e.update({effects:n,annotations:Hle.of(!0)}):null}function Wle(e){setTimeout((()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=$le(e.state,t);n?e.dispatch(n):e.update([])}}),10)}Ile.focus=e=>{e.inputState.lastFocusTime=Date.now(),e.scrollDOM.scrollTop||!e.inputState.lastScrollTop&&!e.inputState.lastScrollLeft||(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),Wle(e)},Ile.blur=e=>{e.observer.clearSelectionRange(),Wle(e)},Ile.compositionstart=Ile.compositionupdate=e=>{e.observer.editContext||(null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},Ile.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,Dse.chrome&&Dse.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then((()=>e.observer.flush())):setTimeout((()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])}),50))},Ile.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},Ele.beforeinput=(e,t)=>{var n;let r;if(Dse.chrome&&Dse.android&&(r=wle.find((e=>e.inputType==t.inputType)))&&(e.observer.delayAndroidKey(r.key,r.keyCode),"Backspace"==r.key||"Delete"==r.key)){let t=(null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0;setTimeout((()=>{var n;((null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())}),100)}return Dse.ios&&"deleteContentForward"==t.inputType&&e.observer.flushSoon(),Dse.safari&&"insertText"==t.inputType&&e.inputState.composing>=0&&setTimeout((()=>Ile.compositionend(e,t)),20),!1};const Gle=new Set,qle=["pre-wrap","normal","pre-line","break-spaces"];class Kle{constructor(e){this.lineWrapping=e,this.doc=Xre.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return qle.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(10*r)]||(t=!0,this.heightSamples[Math.floor(10*r)]=!0)}return t}refresh(e,t,n,r,o,i){let s=qle.indexOf(e)>-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=s;if(this.lineWrapping=s,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=o,a){this.heightSamples={};for(let e=0;e<i.length;e++){let t=i[e];t<0?e++:this.heightSamples[Math.floor(10*t)]=!0}}return a}}class Yle{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class Jle{constructor(e,t,n,r,o){this.from=e,this.length=t,this.top=n,this.height=r,this._content=o}get type(){return"number"==typeof this._content?Jse.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof eae?this._content.widget:null}get widgetLineBreaks(){return"number"==typeof this._content?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Jle(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var Xle=function(e){return e[e.ByPos=0]="ByPos",e[e.ByHeight=1]="ByHeight",e[e.ByPosNoHeight=2]="ByPosNoHeight",e}(Xle||(Xle={}));const Zle=.001;class Qle{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(2&this.flags)>0}set outdated(e){this.flags=(e?2:0)|-3&this.flags}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>Zle&&(e.heightChanged=!0),this.height=t)}replace(e,t,n){return Qle.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let o=this,i=n.doc;for(let s=r.length-1;s>=0;s--){let{fromA:a,toA:l,fromB:c,toB:u}=r[s],d=o.lineAt(a,Xle.ByPosNoHeight,n.setDoc(t),0,0),h=d.to>=l?d:o.lineAt(l,Xle.ByPosNoHeight,n,0,0);for(u+=h.to-l,l=h.to;s>0&&d.from<=r[s-1].toA;)a=r[s-1].fromA,c=r[s-1].fromB,s--,a<d.from&&(d=o.lineAt(a,Xle.ByPosNoHeight,n,0,0));c+=d.from-a,a=d.from;let p=ice.build(n.setDoc(i),e,c,u);o=o.replace(a,l,p)}return o.updateHeight(n,0)}static empty(){return new tce(0,0)}static of(e){if(1==e.length)return e[0];let t=0,n=e.length,r=0,o=0;for(;;)if(t==n)if(r>2*o){let o=e[t-1];o.break?e.splice(--t,1,o.left,null,o.right):e.splice(--t,1,o.left,o.right),n+=1+o.break,r-=o.size}else{if(!(o>2*r))break;{let t=e[n];t.break?e.splice(n,1,t.left,null,t.right):e.splice(n,1,t.left,t.right),n+=2+t.break,o-=t.size}}else if(r<o){let n=e[t++];n&&(r+=n.size)}else{let t=e[--n];t&&(o+=t.size)}let i=0;return null==e[t-1]?(i=1,t--):null==e[t]&&(i=1,n++),new rce(Qle.of(e.slice(0,t)),i,Qle.of(e.slice(n)))}}Qle.prototype.size=1;class ece extends Qle{constructor(e,t,n){super(e,t),this.deco=n}blockAt(e,t,n,r){return new Jle(r,this.length,n,this.height,this.deco||0)}lineAt(e,t,n,r,o){return this.blockAt(0,n,r,o)}forEachLine(e,t,n,r,o,i){e<=o+this.length&&t>=o&&i(this.blockAt(0,n,r,o))}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setHeight(e,r.heights[r.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class tce extends ece{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,r){return new Jle(r,this.length,n,this.height,this.breaks)}replace(e,t,n){let r=n[0];return 1==n.length&&(r instanceof tce||r instanceof nce&&4&r.flags)&&Math.abs(this.length-r.length)<10?(r instanceof nce?r=new tce(r.length,this.height):r.height=this.height,this.outdated||(r.outdated=!1),r):Qle.of(n)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setHeight(e,r.heights[r.index++]):(n||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class nce extends Qle{constructor(e){super(e,0)}heightMetrics(e,t){let n,r=e.doc.lineAt(t).number,o=e.doc.lineAt(t+this.length).number,i=o-r+1,s=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);n=t/i,this.length>i+1&&(s=(this.height-t)/(this.length-i-1))}else n=this.height/i;return{firstLine:r,lastLine:o,perLine:n,perChar:s}}blockAt(e,t,n,r){let{firstLine:o,lastLine:i,perLine:s,perChar:a}=this.heightMetrics(t,r);if(t.lineWrapping){let o=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),i=t.doc.lineAt(o),l=s+i.length*a,c=Math.max(n,e-l/2);return new Jle(i.from,i.length,c,l,0)}{let r=Math.max(0,Math.min(i-o,Math.floor((e-n)/s))),{from:a,length:l}=t.doc.line(o+r);return new Jle(a,l,n+s*r,s,0)}}lineAt(e,t,n,r,o){if(t==Xle.ByHeight)return this.blockAt(e,n,r,o);if(t==Xle.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new Jle(t,r-t,0,0,0)}let{firstLine:i,perLine:s,perChar:a}=this.heightMetrics(n,o),l=n.doc.lineAt(e),c=s+l.length*a,u=l.number-i,d=r+s*u+a*(l.from-o-u);return new Jle(l.from,l.length,Math.max(r,Math.min(d,r+this.height-c)),c,0)}forEachLine(e,t,n,r,o,i){e=Math.max(e,o),t=Math.min(t,o+this.length);let{firstLine:s,perLine:a,perChar:l}=this.heightMetrics(n,o);for(let c=e,u=r;c<=t;){let t=n.doc.lineAt(c);if(c==e){let n=t.number-s;u+=a*n+l*(e-o-n)}let r=a+l*t.length;i(new Jle(t.from,t.length,u,r,0)),u+=r,c=t.to+1}}replace(e,t,n){let r=this.length-t;if(r>0){let e=n[n.length-1];e instanceof nce?n[n.length-1]=new nce(e.length+r):n.push(null,new nce(r-1))}if(e>0){let t=n[0];t instanceof nce?n[0]=new nce(e+t.length):n.unshift(new nce(e-1),null)}return Qle.of(n)}decomposeLeft(e,t){t.push(new nce(e-1),null)}decomposeRight(e,t){t.push(null,new nce(this.length-e-1))}updateHeight(e,t=0,n=!1,r){let o=t+this.length;if(r&&r.from<=t+this.length&&r.more){let n=[],i=Math.max(t,r.from),s=-1;for(r.from>t&&n.push(new nce(r.from-t-1).updateHeight(e,t));i<=o&&r.more;){let t=e.doc.lineAt(i).length;n.length&&n.push(null);let o=r.heights[r.index++];-1==s?s=o:Math.abs(o-s)>=Zle&&(s=-2);let a=new tce(t,o);a.outdated=!1,n.push(a),i+=t+1}i<=o&&n.push(null,new nce(o-i).updateHeight(e,i));let a=Qle.of(n);return(s<0||Math.abs(a.height-this.height)>=Zle||Math.abs(s-this.heightMetrics(e,t).perLine)>=Zle)&&(e.heightChanged=!0),a}return(n||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class rce extends Qle{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return 1&this.flags}blockAt(e,t,n,r){let o=n+this.left.height;return e<o?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,o,r+this.left.length+this.break)}lineAt(e,t,n,r,o){let i=r+this.left.height,s=o+this.left.length+this.break,a=t==Xle.ByHeight?e<i:e<s,l=a?this.left.lineAt(e,t,n,r,o):this.right.lineAt(e,t,n,i,s);if(this.break||(a?l.to<s:l.from>s))return l;let c=t==Xle.ByPosNoHeight?Xle.ByPosNoHeight:Xle.ByPos;return a?l.join(this.right.lineAt(s,c,n,i,s)):this.left.lineAt(s,c,n,r,o).join(l)}forEachLine(e,t,n,r,o,i){let s=r+this.left.height,a=o+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,t,n,r,o,i),t>=a&&this.right.forEachLine(e,t,n,s,a,i);else{let l=this.lineAt(a,Xle.ByPos,n,r,o);e<l.from&&this.left.forEachLine(e,l.from-1,n,r,o,i),l.to>=e&&l.from<=t&&i(l),t>l.to&&this.right.forEachLine(l.to+1,t,n,s,a,i)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let o=[];e>0&&this.decomposeLeft(e,o);let i=o.length;for(let e of n)o.push(e);if(e>0&&oce(o,i-1),t<this.length){let e=o.length;this.decomposeRight(t,o),oce(o,e)}return Qle.of(o)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?Qle.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:o,right:i}=this,s=t+o.length+this.break,a=null;return r&&r.from<=t+o.length&&r.more?a=o=o.updateHeight(e,t,n,r):o.updateHeight(e,t,n),r&&r.from<=s+i.length&&r.more?a=i=i.updateHeight(e,s,n,r):i.updateHeight(e,s,n),a?this.balanced(o,i):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function oce(e,t){let n,r;null==e[t]&&(n=e[t-1])instanceof nce&&(r=e[t+1])instanceof nce&&e.splice(t-1,3,new nce(n.length+1+r.length))}class ice{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof tce?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new tce(e-this.pos,-1)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,o=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let i=t-e;n.block?this.addBlock(new ece(i,r,n)):(i||o||r>=5)&&this.addLineDeco(r,o,i)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new tce(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new nce(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof tce)return e;let t=new tce(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof tce||this.isCovered?(this.writtenTo<this.pos||null==t)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new tce(0,-1));let n=e;for(let e of this.nodes)e instanceof tce&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(e,t,n,r){let o=new ice(n,e);return wie.spans(t,n,r,o,0),o.finish(n)}}class sce{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&nae(e,t,this.changes,5)}}function ace(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,o=r.defaultView||window,i=Math.max(0,n.left),s=Math.min(o.innerWidth,n.right),a=Math.max(0,n.top),l=Math.min(o.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=r.body;)if(1==t.nodeType){let n=t,r=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&"visible"!=r.overflow){let r=n.getBoundingClientRect();i=Math.max(i,r.left),s=Math.min(s,r.right),a=Math.max(a,r.top),l=t==e.parentNode?r.bottom:Math.min(l,r.bottom)}t="absolute"==r.position||"fixed"==r.position?n.offsetParent:n.parentNode}else{if(11!=t.nodeType)break;t=t.host}return{left:i-n.left,right:Math.max(i,s)-n.left,top:a-(n.top+t),bottom:Math.max(a,l)-(n.top+t)}}function lce(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class cce{constructor(e,t,n){this.from=e,this.to=t,this.size=n}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],o=t[n];if(r.from!=o.from||r.to!=o.to||r.size!=o.size)return!1}return!0}draw(e,t){return Xse.replace({widget:new uce(this.size*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class uce extends Yse{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class dce{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=mce,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=sae.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(Wae).some((e=>"function"!=typeof e&&"cm-lineWrapping"==e.class));this.heightOracle=new Kle(t),this.stateDeco=e.facet(Gae).filter((e=>"function"!=typeof e)),this.heightMap=Qle.empty().applyChanges(this.stateDeco,Xre.empty,this.heightOracle.setDoc(e.doc),[new ele(0,0,0,e.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Xse.set(this.lineGaps.map((e=>e.draw(this,!1)))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some((({from:e,to:t})=>r>=e&&r<=t))){let{from:t,to:n}=this.lineBlockAt(r);e.push(new hce(t,n))}}return this.viewports=e.sort(((e,t)=>e.from-t.from)),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?mce:new gce(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,(e=>{this.viewportLines.push(bce(e,this.scaler))}))}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(Gae).filter((e=>"function"!=typeof e));let r=e.changedRanges,o=ele.extendWithRanges(r,function(e,t,n){let r=new sce;return wie.compare(e,t,n,r,0),r.changes}(n,this.stateDeco,e?e.changes:woe.empty(this.state.doc.length))),i=this.heightMap.height,s=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),this.heightMap.height!=i&&(e.flags|=2),s?(this.scrollAnchorPos=e.changes.mapPos(s.from,-1),this.scrollAnchorHeight=s.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<a.from||t.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let l=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(l||!e.changes.empty||2&e.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Nae)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,o=n.whiteSpace;this.defaultTextDirection="rtl"==n.direction?sae.RTL:sae.LTR;let i=this.heightOracle.mustRefreshForWrapping(o),s=t.getBoundingClientRect(),a=i||this.mustMeasureContent||this.contentDOMHeight!=s.height;this.contentDOMHeight=s.height,this.mustMeasureContent=!1;let l=0,c=0;if(s.width&&s.height){let{scaleX:e,scaleY:n}=ise(t,s);(e>.005&&Math.abs(this.scaleX-e)>.005||n>.005&&Math.abs(this.scaleY-n)>.005)&&(this.scaleX=e,this.scaleY=n,l|=8,i=a=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;this.paddingTop==u&&this.paddingBottom==d||(this.paddingTop=u,this.paddingBottom=d,l|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,l|=8);let h=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=h&&(this.scrollAnchorHeight=-1,this.scrollTop=h),this.scrolledToBottom=pse(e.scrollDOM);let p=(this.printing?lce:ace)(t,this.paddingTop),f=p.top-this.pixelViewport.top,m=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let g=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(g!=this.inView&&(this.inView=g,g&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let b=s.width;if(this.contentDOMWidth==b&&this.editorHeight==e.scrollDOM.clientHeight||(this.contentDOMWidth=s.width,this.editorHeight=e.scrollDOM.clientHeight,l|=8),a){let t=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(t)&&(i=!0),i||r.lineWrapping&&Math.abs(b-this.contentDOMWidth)>r.charWidth){let{lineHeight:n,charWidth:s,textHeight:a}=e.docView.measureTextSize();i=n>0&&r.refresh(o,n,s,a,b/s,t),i&&(e.docView.minWidth=0,l|=8)}f>0&&m>0?c=Math.max(f,m):f<0&&m<0&&(c=Math.min(f,m)),r.heightChanged=!1;for(let n of this.viewports){let o=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(i?Qle.empty().applyChanges(this.stateDeco,Xre.empty,this.heightOracle,[new ele(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,i,new Yle(n.from,o))}r.heightChanged&&(l|=2)}let y=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return y&&(2&l&&(l|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),l|=this.updateForViewport()),(2&l||y)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(i?[]:this.lineGaps,e)),l|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),l}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,o=this.heightOracle,{visibleTop:i,visibleBottom:s}=this,a=new hce(r.lineAt(i-1e3*n,Xle.ByHeight,o,0,0).from,r.lineAt(s+1e3*(1-n),Xle.ByHeight,o,0,0).to);if(t){let{head:e}=t.range;if(e<a.from||e>a.to){let n,i=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),s=r.lineAt(e,Xle.ByPos,o,0,0);n="center"==t.y?(s.top+s.bottom)/2-i/2:"start"==t.y||"nearest"==t.y&&e<a.from?s.top:s.bottom-i,a=new hce(r.lineAt(n-500,Xle.ByHeight,o,0,0).from,r.lineAt(n+i+500,Xle.ByHeight,o,0,0).to)}}return a}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new hce(this.heightMap.lineAt(n,Xle.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,Xle.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,Xle.ByPos,this.heightOracle,0,0),{bottom:o}=this.heightMap.lineAt(t,Xle.ByPos,this.heightOracle,0,0),{visibleTop:i,visibleBottom:s}=this;return(0==e||r<=i-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||o>=s+Math.max(10,Math.min(n,250)))&&r>i-2e3&&o<s+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new cce(t.mapPos(r.from),t.mapPos(r.to),r.size));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,o=r>>1,i=r<<1;if(this.defaultTextDirection!=sae.LTR&&!n)return[];let s=[],a=(r,i,l,c)=>{if(i-r<o)return;let u=this.state.selection.main,d=[u.from];u.empty||d.push(u.to);for(let e of d)if(e>r&&e<i)return a(r,e-10,l,c),void a(e+10,i,l,c);let h=function(e,t){for(let n of e)if(t(n))return n}(e,(e=>e.from>=l.from&&e.to<=l.to&&Math.abs(e.from-r)<o&&Math.abs(e.to-i)<o&&!d.some((t=>e.from<t&&e.to>t))));if(!h){if(i<l.to&&t&&n&&t.visibleRanges.some((e=>e.from<=i&&e.to>=i))){let e=t.moveToLineBoundary(Toe.cursor(i),!1,!0).head;e>r&&(i=e)}h=new cce(r,i,this.gapSize(l,r,i,c))}s.push(h)},l=e=>{if(e.length<i||e.type!=Jse.Text)return;let t=function(e,t,n){let r=[],o=e,i=0;return wie.spans(n,e,t,{span(){},point(e,t){e>o&&(r.push({from:o,to:e}),i+=e-o),o=t}},20),o<t&&(r.push({from:o,to:t}),i+=t-o),{total:i,ranges:r}}(e.from,e.to,this.stateDeco);if(t.total<i)return;let o,s,l=this.scrollTarget?this.scrollTarget.range.head:null;if(n){let n,i,a=r/this.heightOracle.lineLength*this.heightOracle.lineHeight;if(null!=l){let r=fce(t,l),o=((this.visibleBottom-this.visibleTop)/2+a)/e.height;n=r-o,i=r+o}else n=(this.visibleTop-e.top-a)/e.height,i=(this.visibleBottom-e.top+a)/e.height;o=pce(t,n),s=pce(t,i)}else{let e,n,i=t.total*this.heightOracle.charWidth,a=r*this.heightOracle.charWidth;if(null!=l){let r=fce(t,l),o=((this.pixelViewport.right-this.pixelViewport.left)/2+a)/i;e=r-o,n=r+o}else e=(this.pixelViewport.left-a)/i,n=(this.pixelViewport.right+a)/i;o=pce(t,e),s=pce(t,n)}o>e.from&&a(e.from,o,e,t),s<e.to&&a(s,e.to,e,t)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(l):l(e);return s}gapSize(e,t,n,r){let o=fce(r,n)-fce(r,t);return this.heightOracle.lineWrapping?e.height*o:r.total*this.heightOracle.charWidth*o}updateLineGaps(e){cce.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Xse.set(e.map((e=>e.draw(this,this.heightOracle.lineWrapping)))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];wie.spans(e,this.viewport.from,this.viewport.to,{span(e,n){t.push({from:e,to:n})},point(){}},20);let n=t.length!=this.visibleRanges.length||this.visibleRanges.some(((e,n)=>e.from!=t[n].from||e.to!=t[n].to));return this.visibleRanges=t,n?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find((t=>t.from<=e&&t.to>=e))||bce(this.heightMap.lineAt(e,Xle.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find((t=>t.top<=e&&t.bottom>=e))||bce(this.heightMap.lineAt(this.scaler.fromDOM(e),Xle.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return bce(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class hce{constructor(e,t){this.from=e,this.to=t}}function pce({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:o}=t[e],i=o-n;if(r<=i)return n+r;r-=i}}function fce(e,t){let n=0;for(let{from:r,to:o}of e.ranges){if(t<=o){n+=t-r;break}n+=o-r}return n/e.total}const mce={toDOM:e=>e,fromDOM:e=>e,scale:1,eq(e){return e==this}};class gce{constructor(e,t,n){let r=0,o=0,i=0;this.viewports=n.map((({from:n,to:o})=>{let i=t.lineAt(n,Xle.ByPos,e,0,0).top,s=t.lineAt(o,Xle.ByPos,e,0,0).bottom;return r+=s-i,{from:n,to:o,top:i,bottom:s,domTop:0,domBottom:0}})),this.scale=(7e6-r)/(t.height-r);for(let e of this.viewports)e.domTop=i+(e.top-o)*this.scale,i=e.domBottom=e.domTop+(e.bottom-e.top),o=e.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let o=t<this.viewports.length?this.viewports[t]:null;if(!o||e<o.top)return r+(e-n)*this.scale;if(e<=o.bottom)return o.domTop+(e-o.top);n=o.bottom,r=o.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let o=t<this.viewports.length?this.viewports[t]:null;if(!o||e<o.domTop)return n+(e-r)/this.scale;if(e<=o.domBottom)return o.top+(e-o.domTop);n=o.bottom,r=o.domBottom}}eq(e){return e instanceof gce&&this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every(((t,n)=>t.from==e.viewports[n].from&&t.to==e.viewports[n].to))}}function bce(e,t){if(1==t.scale)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new Jle(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map((e=>bce(e,t))):e._content)}const yce=Noe.define({combine:e=>e.join(" ")}),vce=Noe.define({combine:e=>e.indexOf(!0)>-1}),_ce=Fie.newName(),xce=Fie.newName(),wce=Fie.newName(),kce={"&light":"."+xce,"&dark":"."+wce};function Cce(e,t,n){return new Fie(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,(t=>{if("&"==t)return e;if(!n||!n[t])throw new RangeError(`Unsupported selector: ${t}`);return n[t]})):e+" "+t})}const Sce=Cce("."+_ce,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},kce),Ace="￿";class Ece{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(gie.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Ace}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let e=this.text.length;this.readNode(r);let o=r.nextSibling;if(o==t)break;let i=yse.get(r),s=yse.get(o);(i&&s?i.breakAfter:(i?i.breakAfter:ese(r))||ese(o)&&("BR"!=r.nodeName||r.cmIgnore)&&this.text.length>e)&&this.lineBreak(),r=o}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let o,i=-1,s=1;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),s=this.lineSeparator.length):(o=r.exec(t))&&(i=o.index,s=o[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),s>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=s-1);n=i+s}}readNode(e){if(e.cmIgnore)return;let t=yse.get(e),n=t&&t.overrideDOMText;if(null!=n){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(3==e.nodeType?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(Ice(e,n.node,n.offset)?t:0))}}function Ice(e,t,n){for(;;){if(!t||n<nse(t))return!1;if(t==e)return!0;n=Qie(t)+1,t=t.parentNode}}class jce{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class Tce{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:o,impreciseAnchor:i}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let t=o||i?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}=e.observer.selectionRange;return n&&(t.push(new jce(n,r)),o==n&&i==r||t.push(new jce(o,i))),t}(e),n=new Ece(t,e.state);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=function(e,t){if(0==e.length)return null;let n=e[0].pos,r=2==e.length?e[1].pos:n;return n>-1&&r>-1?Toe.single(n+t,r+t):null}(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=o&&o.node==t.focusNode&&o.offset==t.focusOffset||!Yie(e.contentDOM,t.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=i&&i.node==t.anchorNode&&i.offset==t.anchorOffset||!Yie(e.contentDOM,t.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),s=e.viewport;if((Dse.ios||Dse.chrome)&&e.state.selection.main.empty&&n!=r&&(s.from>0||s.to<e.state.doc.length)){let t=Math.min(n,r),o=Math.max(n,r),i=s.from-t,a=s.to-o;0!=i&&1!=i&&0!=t||0!=a&&-1!=a&&o!=e.state.doc.length||(n=0,r=e.state.doc.length)}this.newSel=Toe.single(r,n)}}}function Bce(e,t){let n,{newSel:r}=t,o=e.state.selection.main,i=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:r,to:s}=t.bounds,a=o.from,l=null;(8===i||Dse.android&&t.text.length<s-r)&&(a=o.to,l="end");let c=function(e,t,n,r){let o=Math.min(e.length,t.length),i=0;for(;i<o&&e.charCodeAt(i)==t.charCodeAt(i);)i++;if(i==o&&e.length==t.length)return null;let s=e.length,a=t.length;for(;s>0&&a>0&&e.charCodeAt(s-1)==t.charCodeAt(a-1);)s--,a--;return"end"==r&&(n-=s+Math.max(0,i-Math.min(s,a))-i),s<i&&e.length<t.length?(i-=n<=i&&n>=s?i-n:0,a=i+(a-s),s=i):a<i&&(i-=n<=i&&n>=a?i-n:0,s=i+(s-a),a=i),{from:i,toA:s,toB:a}}(e.state.doc.sliceString(r,s,Ace),t.text,a-r,l);c&&(Dse.chrome&&13==i&&c.toB==c.from+2&&t.text.slice(c.from,c.toB)==Ace+Ace&&c.toB--,n={from:r+c.from,to:r+c.toA,insert:Xre.of(t.text.slice(c.from,c.toB).split(Ace))})}else r&&(!e.hasFocus&&e.state.facet(Fae)||r.main.eq(o))&&(r=null);if(!n&&!r)return!1;if(!n&&t.typeOver&&!o.empty&&r&&r.main.empty?n={from:o.from,to:o.to,insert:e.state.doc.slice(o.from,o.to)}:n&&n.from>=o.from&&n.to<=o.to&&(n.from!=o.from||n.to!=o.to)&&o.to-o.from-(n.to-n.from)<=4?n={from:o.from,to:o.to,insert:e.state.doc.slice(o.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,o.to))}:(Dse.mac||Dse.android)&&n&&n.from==n.to&&n.from==o.head-1&&/^\. ?$/.test(n.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(r&&2==n.insert.length&&(r=Toe.single(r.main.anchor-1,r.main.head-1)),n={from:o.from,to:o.to,insert:Xre.of([" "])}):Dse.chrome&&n&&n.from==n.to&&n.from==o.head&&"\n "==n.insert.toString()&&e.lineWrapping&&(r&&(r=Toe.single(r.main.anchor-1,r.main.head-1)),n={from:o.from,to:o.to,insert:Xre.of([" "])}),n)return Rce(e,n,r,i);if(r&&!r.main.eq(o)){let t=!1,n="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),n=e.inputState.lastSelectionOrigin),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}return!1}function Rce(e,t,n,r=-1){if(Dse.ios&&e.inputState.flushIOSKey(t))return!0;let o=e.state.selection.main;if(Dse.android&&(t.to==o.to&&(t.from==o.from||t.from==o.from-1&&" "==e.state.sliceDoc(t.from,o.from))&&1==t.insert.length&&2==t.insert.lines&&dse(e.contentDOM,"Enter",13)||(t.from==o.from-1&&t.to==o.to&&0==t.insert.length||8==r&&t.insert.length<t.to-t.from&&t.to>o.head)&&dse(e.contentDOM,"Backspace",8)||t.from==o.from&&t.to==o.to+1&&0==t.insert.length&&dse(e.contentDOM,"Delete",46)))return!0;let i,s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let a=()=>i||(i=function(e,t,n){let r,o=e.state,i=o.selection.main;if(t.from>=i.from&&t.to<=i.to&&t.to-t.from>=(i.to-i.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=i.from<t.from?o.sliceDoc(i.from,t.from):"",s=i.to>t.to?o.sliceDoc(t.to,i.to):"";r=o.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+s))}else{let s=o.changes(t),a=n&&n.main.to<=s.newLength?n.main:void 0;if(o.selection.ranges.length>1&&e.inputState.composing>=0&&t.to<=i.to&&t.to>=i.to-10){let l,c=e.state.sliceDoc(t.from,t.to),u=n&&ole(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);l={from:u.from,to:u.to-e}}else l=e.state.doc.lineAt(i.head);let d=i.to-t.to,h=i.to-i.from;r=o.changeByRange((n=>{if(n.from==i.from&&n.to==i.to)return{changes:s,range:a||n.map(s)};let r=n.to-d,u=r-c.length;if(n.to-n.from!=h||e.state.sliceDoc(u,r)!=c||n.to>=l.from&&n.from<=l.to)return{range:n};let p=o.changes({from:u,to:r,insert:t.insert}),f=n.to-i.to;return{changes:p,range:a?Toe.range(Math.max(0,a.anchor+f),Math.max(0,a.head+f)):n.map(p)}}))}else r={changes:s,selection:a&&o.selection.replaceRange(a)}}let s="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=".compose",e.inputState.compositionFirstChange&&(s+=".start",e.inputState.compositionFirstChange=!1)),o.update(r,{userEvent:s,scrollIntoView:!0})}(e,t,n));return e.state.facet(Tae).some((n=>n(e,t.from,t.to,s,a)))||e.dispatch(a()),!0}const Nce={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Dce=Dse.ie&&Dse.ie_version<=11;class Mce{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new sse,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver((t=>{for(let e of t)this.queue.push(e);(Dse.ie&&Dse.ie_version<=11||Dse.ios&&e.composing)&&t.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),!window.EditContext||!1===e.constructor.EDIT_CONTEXT||Dse.chrome&&Dse.chrome_version<126||(this.editContext=new Lce(e),e.state.facet(Fae)&&(e.contentDOM.editContext=this.editContext.editContext)),Dce&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver((()=>{var e;(null===(e=this.view.docView)||void 0===e?void 0:e.lastUpdate)<Date.now()-75&&this.onResize()})),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver((e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))}),{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver((e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))}),{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout((()=>{this.resizeTimeout=-1,this.view.requestMeasure()}),50))}onPrint(e){("change"!=e.type||e.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout((()=>{this.view.viewState.printing=!1,this.view.requestMeasure()}),500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some(((t,n)=>t!=e[n])))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(Fae)?n.root.activeElement!=this.dom:!Jie(n.dom,r))return;let o=r.anchorNode&&n.docView.nearest(r.anchorNode);o&&o.ignoreEvent(e)?t||(this.selectionChanged=!1):(Dse.ie&&Dse.ie_version<=11||Dse.android&&Dse.chrome)&&!n.state.selection.main.empty&&r.focusNode&&Zie(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Kie(e.root);if(!t)return!1;let n=Dse.safari&&11==e.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return Oce(e,n)}let n=null;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",r,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",r,!0),n?Oce(e,n):null}(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=Jie(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&function(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,nse(n));;)if(r){if(1!=n.nodeType)return!1;let e=n.childNodes[r-1];"false"==e.contentEditable?r--:(n=e,r=nse(n))}else{if(n==e)return!0;r=Qie(n),n=n.parentNode}}(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(1==n.nodeType)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(n),n=n.assignedSlot||n.parentNode;else{if(11!=n.nodeType)break;n=n.host}if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,Nce),Dce&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Dce&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var n;if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&dse(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(null===(n=this.delayedAndroidKey)||void 0===n?void 0:n.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame((()=>{this.delayedFlush=-1,this.flush()})))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let o of e){let e=this.readMutation(o);e&&(e.typeOver&&(r=!0),-1==t?({from:t,to:n}=e):(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&Jie(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new Tce(this.view,e,t,n);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=Bce(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty("attributes"==e.type),"attributes"==e.type&&(t.flags|=4),"childList"==e.type){let n=Pce(t,e.previousSibling||e.target.previousSibling,-1),r=Pce(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener("change",this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener("change",this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Fae)!=e.state.facet(Fae)&&(e.view.contentDOM.editContext=e.state.facet(Fae)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(n=this.resizeScroll)||void 0===n||n.disconnect();for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function Pce(e,t,n){for(;t;){let r=yse.get(t);if(r&&r.parent==e)return r;let o=t.parentNode;t=o!=e.dom?o:n>0?t.nextSibling:t.previousSibling}return null}function Oce(e,t){let n=t.startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,s=e.docView.domAtPos(e.state.selection.main.anchor);return Zie(s.node,s.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}class Lce{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});t.addEventListener("textupdate",(t=>{let{anchor:n}=e.state.selection.main,r={from:this.toEditorPos(t.updateRangeStart),to:this.toEditorPos(t.updateRangeEnd),insert:Xre.of(t.text.split("\n"))};r.from==this.from&&n<this.from?r.from=n:r.to==this.to&&n>this.to&&(r.to=n),(r.from!=r.to||r.insert.length)&&(this.pendingContextChange=r,Rce(e,r,Toe.single(this.toEditorPos(t.selectionStart),this.toEditorPos(t.selectionEnd))),this.pendingContextChange&&this.revertPending(e.state))})),t.addEventListener("characterboundsupdate",(n=>{let r=[],o=null;for(let t=this.toEditorPos(n.rangeStart),i=this.toEditorPos(n.rangeEnd);t<i;t++){let n=e.coordsForChar(t);o=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||o||new DOMRect,r.push(o)}t.updateCharacterBounds(n.rangeStart,r)})),t.addEventListener("textformatupdate",(t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if("None"!=t&&"None"!=r){let o=`text-decoration: underline ${"Dashed"==t?"dashed ":"Squiggle"==t?"wavy ":""}${"Thin"==r?1:2}px`;n.push(Xse.mark({attributes:{style:o}}).range(this.toEditorPos(e.rangeStart),this.toEditorPos(e.rangeEnd)))}}e.dispatch({effects:Oae.of(Xse.set(n))})})),t.addEventListener("compositionstart",(()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)})),t.addEventListener("compositionend",(()=>{e.inputState.composing=-1,e.inputState.compositionFirstChange=null})),this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=Kie(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges(((o,i,s,a,l)=>{if(n)return;let c=l.length-(i-o);if(r&&i>=r.to){if(r.from==o&&r.to==i&&r.insert.eq(l))return r=this.pendingContextChange=null,void(t+=c);r=null,this.revertPending(e.state)}if(o+=t,(i+=t)<=this.from)this.from+=c,this.to+=c;else if(o<this.to){if(o<this.from||i>this.to||this.to-this.from+l.length>3e4)return void(n=!0);this.editContext.updateText(this.toContextPos(o),this.toContextPos(i),l.toString()),this.to+=c}t+=c})),r&&!n&&this.revertPending(e.state),!n}update(e){this.applyEdits(e)&&this.rangeIsValid(e.state)?(e.docChanged||e.selectionSet)&&this.setSelection(e.state):(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(e.state)),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.to+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);this.editContext.selectionStart==n&&this.editContext.selectionEnd==r||this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>3e4)}toEditorPos(e){return e+this.from}toContextPos(e){return e-this.from}}class Fce{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(e=>e.forEach((e=>t(e,this))))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new dce(e.state||gie.create(e)),e.scrollTo&&e.scrollTo.is(Pae)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Uae).map((e=>new Hae(e)));for(let e of this.plugins)e.update(this);this.observer=new Mce(this),this.inputState=new vle(this),this.inputState.ensureHandlers(this.plugins),this.docView=new nle(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let t=1==e.length&&e[0]instanceof sie?e:1==e.length&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t,n=!1,r=!1,o=this.state;for(let t of e){if(t.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=t.state}if(this.destroyed)return void(this.viewState.state=o);let i=this.hasFocus,s=0,a=null;e.some((e=>e.annotation(Hle)))?(this.inputState.notifiedFocused=i,s=1):i!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=i,a=$le(o,i),a||(s=1));let l=this.observer.delayedAndroidKey,c=null;if(l?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(c=null)):this.observer.clear(),o.facet(gie.phrases)!=this.state.facet(gie.phrases))return this.setState(o);t=tle.create(this,o,e),t.flags|=s;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(u&&(u=u.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection;u=new Mae(e.empty?e:Toe.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(Pae)&&(u=e.value.clip(this.state))}this.viewState.update(t,u),this.bidiCache=Vce.update(this.bidiCache,t.changes),t.empty||(this.updatePlugins(t),this.inputState.update(t)),n=this.docView.update(t),this.state.facet(Qae)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some((e=>e.isUserEvent("select.pointer"))))}finally{this.updateState=0}if(t.startState.facet(yce)!=t.state.facet(yce)&&(this.viewState.mustMeasureContent=!0),(n||r||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!t.empty)for(let e of this.state.facet(jae))try{e(t)}catch(e){Lae(this.state,e,"update listener")}(a||c)&&Promise.resolve().then((()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!Bce(this,c)&&l.force&&dse(this.contentDOM,l.key,l.keyCode)}))}setState(e){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=e);this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new dce(e),this.plugins=e.facet(Uae).map((e=>new Hae(e))),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new nle(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Uae),n=e.state.facet(Uae);if(t!=n){let r=[];for(let o of n){let n=t.indexOf(o);if(n<0)r.push(new Hae(o));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){Lae(this.state,e,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,r=n.scrollTop*this.scaleY,{scrollAnchorPos:o,scrollAnchorHeight:i}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(i=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(i<0)if(pse(n))o=-1,i=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(r);o=e.from,i=e.top}this.updateState=1;let s=this.viewState.measure(this);if(!s&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let a=[];4&s||([this.measureRequests,a]=[a,this.measureRequests]);let l=a.map((e=>{try{return e.read(this)}catch(e){return Lae(this.state,e),Uce}})),c=tle.create(this,this.state,[]),u=!1;c.flags|=s,t?t.flags|=s:t=c,this.updateState=2,c.empty||(this.updatePlugins(c),this.inputState.update(c),this.updateAttrs(),u=this.docView.update(c),u&&this.docViewUpdate());for(let e=0;e<a.length;e++)if(l[e]!=Uce)try{let t=a[e];t.write&&t.write(l[e],this)}catch(e){Lae(this.state,e)}if(u&&this.docView.updateSelection(!0),!c.viewportChanged&&0==this.measureRequests.length){if(this.viewState.editorHeight){if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,i=-1;continue}{let e=(o<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(o).top)-i;if(e>1||e<-1){r+=e,n.scrollTop=r/this.scaleY,i=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(jae))e(t)}get themeClasses(){return _ce+" "+(this.state.facet(vce)?wce:xce)+" "+this.state.facet(yce)}updateAttrs(){let e=Hce(this,$ae,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(Fae)?"true":"false",class:"cm-content",style:`${Dse.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Hce(this,Wae,t);let n=this.observer.ignore((()=>{let n=Wse(this.contentDOM,this.contentAttrs,t),r=Wse(this.dom,this.editorAttrs,e);return n||r}));return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let e of n.effects)e.is(Fce.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(Qae);let e=this.state.facet(Fce.cspNonce);Fie.mount(this.root,this.styleModules.concat(Sce).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame((()=>this.measure()))),e){if(this.measureRequests.indexOf(e)>-1)return;if(null!=e.key)for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key)return void(this.measureRequests[t]=e);this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(void 0===t||t&&t.spec!=e)&&this.pluginMap.set(e,t=this.plugins.find((t=>t.spec==e))||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return yle(this,e,gle(this,e,t,n))}moveByGroup(e,t){return yle(this,e,gle(this,e,t,(t=>function(e,t,n){let r=e.state.charCategorizer(t),o=r(n);return e=>{let t=r(e);return o==pie.Space&&(o=t),o==t}}(this,e.head,t))))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),o=n[t?n.length-1:0];return Toe.cursor(o.side(t,r)+e.from,o.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return function(e,t,n,r){let o=mle(e,t.head),i=r&&o.type==Jse.Text&&(e.lineWrapping||o.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>o.from?t.head-1:t.head):null;if(i){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(o.from),s=e.posAtCoords({x:n==(r==sae.LTR)?t.right-1:t.left+1,y:(i.top+i.bottom)/2});if(null!=s)return Toe.cursor(s,n?-1:1)}return Toe.cursor(n?o.to:o.from,n?-1:1)}(this,e,t,n)}moveVertically(e,t,n){return yle(this,e,function(e,t,n,r){let o=t.head,i=n?1:-1;if(o==(n?e.state.doc.length:0))return Toe.cursor(o,t.assoc);let s,a=t.goalColumn,l=e.contentDOM.getBoundingClientRect(),c=e.coordsAtPos(o,t.assoc||-1),u=e.documentTop;if(c)null==a&&(a=c.left-l.left),s=i<0?c.top:c.bottom;else{let t=e.viewState.lineBlockAt(o);null==a&&(a=Math.min(l.right-l.left,e.defaultCharacterWidth*(o-t.from))),s=(i<0?t.top:t.bottom)+u}let d=l.left+a,h=null!=r?r:e.viewState.heightOracle.textHeight>>1;for(let t=0;;t+=10){let n=s+(h+t)*i,r=ple(e,{x:d,y:n},!1,i);if(n<l.top||n>l.bottom||(i<0?r<o:r>o)){let t=e.docView.coordsForChar(r),o=!t||n<t.top?-1:1;return Toe.cursor(r,o,void 0,a)}}}(this,e,t,n))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),ple(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),o=this.bidiSpans(r);return rse(n,o[gae.find(o,e-r.from,-1,t)].dir==sae.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Rae)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>zce)return xae(e.length);let t,n=this.textDirectionAt(e.from);for(let r of this.bidiCache)if(r.from==e.from&&r.dir==n&&(r.fresh||bae(r.isolates,t=Jae(this,e))))return r.order;t||(t=Jae(this,e));let r=function(e,t,n){if(!e)return[new gae(0,0,t==lae?1:0)];if(t==aae&&!n.length&&!mae.test(e))return xae(e.length);if(n.length)for(;e.length>yae.length;)yae[yae.length]=256;let r=[],o=t==aae?0:1;return _ae(e,o,o,n,0,e.length,r),r}(e.text,n,t);return this.bidiCache.push(new Vce(e.from,e.to,n,t,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Dse.safari&&(null===(e=this.inputState)||void 0===e?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore((()=>{cse(this.contentDOM),this.docView.updateSelection()}))}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((9==e.nodeType?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Pae.of(new Mae("number"==typeof e?Toe.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return Pae.of(new Mae(Toe.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){null==e?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof e?this.inputState.tabFocusMode=e?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Vae.define((()=>({})),{eventHandlers:e})}static domEventObservers(e){return Vae.define((()=>({})),{eventObservers:e})}static theme(e,t){let n=Fie.newName(),r=[yce.of(n),Qae.of(Cce(`.${n}`,e))];return t&&t.dark&&r.push(vce.of(!0)),r}static baseTheme(e){return Voe.lowest(Qae.of(Cce("."+_ce,e,kce)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),r=n&&yse.get(n)||yse.get(e);return(null===(t=null==r?void 0:r.rootView)||void 0===t?void 0:t.view)||null}}Fce.styleModule=Qae,Fce.inputHandler=Tae,Fce.scrollHandler=Dae,Fce.focusChangeEffect=Bae,Fce.perLineTextDirection=Rae,Fce.exceptionSink=Iae,Fce.updateListener=jae,Fce.editable=Fae,Fce.mouseSelectionStyle=Eae,Fce.dragMovesSelection=Aae,Fce.clickAddsSelectionRange=Sae,Fce.decorations=Gae,Fce.outerDecorations=qae,Fce.atomicRanges=Kae,Fce.bidiIsolatedRanges=Yae,Fce.scrollMargins=Xae,Fce.darkTheme=vce,Fce.cspNonce=Noe.define({combine:e=>e.length?e[0]:""}),Fce.contentAttributes=Wae,Fce.editorAttributes=$ae,Fce.lineWrapping=Fce.contentAttributes.of({class:"cm-lineWrapping"}),Fce.announce=iie.define();const zce=4096,Uce={};class Vce{constructor(e,t,n,r,o,i){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=o,this.order=i}static update(e,t){if(t.empty&&!e.some((e=>e.fresh)))return e;let n=[],r=e.length?e[e.length-1].dir:sae.LTR;for(let o=Math.max(0,e.length-10);o<e.length;o++){let i=e[o];i.dir!=r||t.touchesRange(i.from,i.to)||n.push(new Vce(t.mapPos(i.from,1),t.mapPos(i.to,-1),i.dir,i.isolates,!1,i.order))}return n}}function Hce(e,t,n){for(let r=e.state.facet(t),o=r.length-1;o>=0;o--){let t=r[o],i="function"==typeof t?t(e):t;i&&Vse(i,n)}return n}const $ce=Dse.mac?"mac":Dse.windows?"win":Dse.linux?"linux":"key";function Wce(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}const Gce=Noe.define({enables:Voe.default(Fce.domEventHandlers({keydown:(e,t)=>Zce(Kce(t.state),e,t,"editor")}))}),qce=new WeakMap;function Kce(e){let t=e.facet(Gce),n=qce.get(t);return n||qce.set(t,n=function(e,t=$ce){let n=Object.create(null),r=Object.create(null),o=(e,t)=>{let n=r[e];if(null==n)r[e]=t;else if(n!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},i=(e,r,i,s,a)=>{var l,c;let u=n[e]||(n[e]=Object.create(null)),d=r.split(/ (?!$)/).map((e=>function(e,t){const n=e.split(/-(?!$)/);let r,o,i,s,a=n[n.length-1];"Space"==a&&(a=" ");for(let e=0;e<n.length-1;++e){const a=n[e];if(/^(cmd|meta|m)$/i.test(a))s=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))o=!0;else if(/^s(hift)?$/i.test(a))i=!0;else{if(!/^mod$/i.test(a))throw new Error("Unrecognized modifier name: "+a);"mac"==t?s=!0:o=!0}}return r&&(a="Alt-"+a),o&&(a="Ctrl-"+a),s&&(a="Meta-"+a),i&&(a="Shift-"+a),a}(e,t)));for(let t=1;t<d.length;t++){let n=d.slice(0,t).join(" ");o(n,!0),u[n]||(u[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let r=Yce={view:t,prefix:n,scope:e};return setTimeout((()=>{Yce==r&&(Yce=null)}),Jce),!0}]})}let h=d.join(" ");o(h,!1);let p=u[h]||(u[h]={preventDefault:!1,stopPropagation:!1,run:(null===(c=null===(l=u._any)||void 0===l?void 0:l.run)||void 0===c?void 0:c.slice())||[]});i&&p.run.push(i),s&&(p.preventDefault=!0),a&&(p.stopPropagation=!0)};for(let r of e){let e=r.scope?r.scope.split(" "):["editor"];if(r.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||(e._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:o}=r;for(let t in e)e[t].run.push((e=>o(e,Xce)))}let o=r[t]||r.key;if(o)for(let t of e)i(t,o,r.run,r.preventDefault,r.stopPropagation),r.shift&&i(t,"Shift-"+o,r.shift,r.preventDefault,r.stopPropagation)}return n}(t.reduce(((e,t)=>e.concat(t)),[]))),n}let Yce=null;const Jce=4e3;let Xce=null;function Zce(e,t,n,r){Xce=t;let o=function(e){var t=!($ie&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Wie&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?Hie:Vie)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(t),i=yoe(goe(o,0))==o.length&&" "!=o,s="",a=!1,l=!1,c=!1;Yce&&Yce.view==n&&Yce.scope==r&&(s=Yce.prefix+" ",Cle.indexOf(t.keyCode)<0&&(l=!0,Yce=null));let u,d,h=new Set,p=e=>{if(e){for(let t of e.run)if(!h.has(t)&&(h.add(t),t(n)))return e.stopPropagation&&(c=!0),!0;e.preventDefault&&(e.stopPropagation&&(c=!0),l=!0)}return!1},f=e[r];return f&&(p(f[s+Wce(o,t,!i)])?a=!0:i&&(t.altKey||t.metaKey||t.ctrlKey)&&!(Dse.windows&&t.ctrlKey&&t.altKey)&&(u=Vie[t.keyCode])&&u!=o?(p(f[s+Wce(u,t,!0)])||t.shiftKey&&(d=Hie[t.keyCode])!=o&&d!=u&&p(f[s+Wce(d,t,!1)]))&&(a=!0):i&&t.shiftKey&&p(f[s+Wce(o,t,!0)])&&(a=!0),!a&&p(f._any)&&(a=!0)),l&&(a=!0),a&&c&&t.stopPropagation(),Xce=null,a}class Qce{constructor(e,t,n,r,o){this.className=e,this.left=t,this.top=n,this.width=r,this.height=o}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",null!=this.width&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(n.empty){let r=e.coordsAtPos(n.head,n.assoc||1);if(!r)return[];let o=eue(e);return[new Qce(t,r.left-o.left,r.top-o.top,null,r.bottom-r.top)]}return function(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),o=Math.min(n.to,e.viewport.to),i=e.textDirection==sae.LTR,s=e.contentDOM,a=s.getBoundingClientRect(),l=eue(e),c=s.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),d=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),h=a.right-(u?parseInt(u.paddingRight):0),p=mle(e,r),f=mle(e,o),m=p.type==Jse.Text?p:null,g=f.type==Jse.Text?f:null;if(m&&(e.lineWrapping||p.widgetLineBreaks)&&(m=tue(e,r,1,m)),g&&(e.lineWrapping||f.widgetLineBreaks)&&(g=tue(e,o,-1,g)),m&&g&&m.from==g.from&&m.to==g.to)return y(v(n.from,n.to,m));{let t=m?v(n.from,null,m):_(p,!1),r=g?v(null,n.to,g):_(f,!0),o=[];return(m||p).to<(g||f).from-(m&&g?1:0)||p.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<r.top?o.push(b(d,t.bottom,h,r.top)):t.bottom<r.top&&e.elementAtHeight((t.bottom+r.top)/2).type==Jse.Text&&(t.bottom=r.top=(t.bottom+r.top)/2),y(t).concat(o).concat(y(r))}function b(e,n,r,o){return new Qce(t,e-l.left,n-l.top-.01,r-e,o-n+.01)}function y({top:e,bottom:t,horizontal:n}){let r=[];for(let o=0;o<n.length;o+=2)r.push(b(n[o],e,n[o+1],t));return r}function v(t,n,r){let o=1e9,s=-1e9,a=[];function l(t,n,l,c,u){let p=e.coordsAtPos(t,t==r.to?-2:2),f=e.coordsAtPos(l,l==r.from?2:-2);p&&f&&(o=Math.min(p.top,f.top,o),s=Math.max(p.bottom,f.bottom,s),u==sae.LTR?a.push(i&&n?d:p.left,i&&c?h:f.right):a.push(!i&&c?d:f.left,!i&&n?h:p.right))}let c=null!=t?t:r.from,u=null!=n?n:r.to;for(let r of e.visibleRanges)if(r.to>c&&r.from<u)for(let o=Math.max(r.from,c),i=Math.min(r.to,u);;){let r=e.state.doc.lineAt(o);for(let s of e.bidiSpans(r)){let e=s.from+r.from,a=s.to+r.from;if(e>=i)break;a>o&&l(Math.max(e,o),null==t&&e<=c,Math.min(a,i),null==n&&a>=u,s.dir)}if(o=r.to+1,o>=i)break}return 0==a.length&&l(c,null==t,u,null==n,e.textDirection),{top:o,bottom:s,horizontal:a}}function _(e,t){let n=a.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}(e,t,n)}}function eue(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==sae.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function tue(e,t,n,r){let o=e.coordsAtPos(t,2*n);if(!o)return r;let i=e.dom.getBoundingClientRect(),s=(o.top+o.bottom)/2,a=e.posAtCoords({x:i.left+1,y:s}),l=e.posAtCoords({x:i.right-1,y:s});return null==a||null==l?r:{from:Math.max(r.from,Math.min(a,l)),to:Math.min(r.to,Math.max(a,l))}}class nue{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(rue)!=e.state.facet(rue)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){!1!==this.layer.updateOnDocViewUpdate&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(rue);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;e==this.scaleX&&t==this.scaleY||(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some(((e,t)=>!function(e,t){return e.constructor==t.constructor&&e.eq(t)}(e,this.drawn[t])))){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const rue=Noe.define();function oue(e){return[Vae.define((t=>new nue(t,e))),rue.of(e)]}const iue=!Dse.ios,sue=Noe.define({combine:e=>bie(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function aue(e){return e.startState.facet(sue)!=e.state.facet(sue)}const lue=oue({above:!0,markers(e){let{state:t}=e,n=t.facet(sue),r=[];for(let o of t.selection.ranges){let i=o==t.selection.main;if(o.empty?!i||iue:n.drawRangeCursor){let t=i?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",n=o.empty?o:Toe.cursor(o.head,o.head>o.anchor?-1:1);for(let o of Qce.forRange(e,t,n))r.push(o)}}return r},update(e,t){e.transactions.some((e=>e.selection))&&(t.style.animationName="cm-blink"==t.style.animationName?"cm-blink2":"cm-blink");let n=aue(e);return n&&cue(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){cue(t.state,e)},class:"cm-cursorLayer"});function cue(e,t){t.style.animationDuration=e.facet(sue).cursorBlinkRate+"ms"}const uue=oue({above:!1,markers:e=>e.state.selection.ranges.map((t=>t.empty?[]:Qce.forRange(e,"cm-selectionBackground",t))).reduce(((e,t)=>e.concat(t))),update:(e,t)=>e.docChanged||e.selectionSet||e.viewportChanged||aue(e),class:"cm-selectionLayer"}),due={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};iue&&(due[".cm-line"].caretColor=due[".cm-content"].caretColor="transparent !important");const hue=Voe.highest(Fce.theme(due)),pue=iie.define({map:(e,t)=>null==e?null:t.mapPos(e)}),fue=zoe.define({create:()=>null,update:(e,t)=>(null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce(((e,t)=>t.is(pue)?t.value:e),e))}),mue=Vae.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(fue);null==n?null!=this.cursor&&(null===(t=this.cursor)||void 0===t||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(fue)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(fue),n=null!=t&&e.coordsAtPos(t);if(!n)return null;let r=e.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-r.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(fue)!=e&&this.view.dispatch({effects:pue.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){e.target!=this.view.contentDOM&&this.view.contentDOM.contains(e.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function gue(e,t,n,r,o){t.lastIndex=0;for(let i,s=e.iterRange(n,r),a=n;!s.next().done;a+=s.value.length)if(!s.lineBreak)for(;i=t.exec(s.value);)o(a+i.index,i)}class bue{constructor(e){const{regexp:t,decoration:n,decorate:r,boundary:o,maxLength:i=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,r)this.addMatch=(e,t,n,o)=>r(o,n,n+e[0].length,e,t);else if("function"==typeof n)this.addMatch=(e,t,r,o)=>{let i=n(e,t,r);i&&o(r,r+e[0].length,i)};else{if(!n)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=(e,t,r,o)=>o(r,r+e[0].length,n)}this.boundary=o,this.maxLength=i}createDeco(e){let t=new kie,n=t.add.bind(t);for(let{from:t,to:r}of function(e,t){let n=e.visibleRanges;if(1==n.length&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:o,to:i}of n)o=Math.max(e.state.doc.lineAt(o).from,o-t),i=Math.min(e.state.doc.lineAt(i).to,i+t),r.length&&r[r.length-1].to>=o?r[r.length-1].to=i:r.push({from:o,to:i});return r}(e,this.maxLength))gue(e.state.doc,this.regexp,t,r,((t,r)=>this.addMatch(r,e,t,n)));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges(((t,o,i,s)=>{s>e.view.viewport.from&&i<e.view.viewport.to&&(n=Math.min(i,n),r=Math.max(s,r))})),e.viewportChanged||r-n>1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}updateRange(e,t,n,r){for(let o of e.visibleRanges){let i=Math.max(o.from,n),s=Math.min(o.to,r);if(s>i){let n=e.state.doc.lineAt(i),r=n.to<s?e.state.doc.lineAt(s):n,a=Math.max(o.from,n.from),l=Math.min(o.to,r.to);if(this.boundary){for(;i>n.from;i--)if(this.boundary.test(n.text[i-1-n.from])){a=i;break}for(;s<r.to;s++)if(this.boundary.test(r.text[s-r.from])){l=s;break}}let c,u=[],d=(e,t,n)=>u.push(n.range(e,t));if(n==r)for(this.regexp.lastIndex=a-n.from;(c=this.regexp.exec(n.text))&&c.index<l-n.from;)this.addMatch(c,e,c.index+n.from,d);else gue(e.state.doc,this.regexp,a,l,((t,n)=>this.addMatch(n,e,t,d)));t=t.update({filterFrom:a,filterTo:l,filter:(e,t)=>e<a||t>l,add:u})}}return t}}const yue=null!=/x/.unicode?"gu":"g",vue=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\ufeff-]",yue),_ue={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let xue=null;const wue=Noe.define({combine(e){let t=bie(e,{render:null,specialChars:vue,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==xue&&"undefined"!=typeof document&&document.body){let t=document.body.style;xue=null!=(null!==(e=t.tabSize)&&void 0!==e?e:t.MozTabSize)}return xue||!1}())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,yue)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,yue)),t}});let kue=null;class Cue extends Yse{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=function(e){return e>=32?"•":10==e?"␤":String.fromCharCode(9216+e)}(this.code),n=e.state.phrase("Control character")+" "+(_ue[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let o=document.createElement("span");return o.textContent=t,o.title=n,o.setAttribute("aria-label",n),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class Sue extends Yse{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent="\t",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}const Aue=Xse.line({class:"cm-activeLine"}),Eue=Vae.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let o=e.lineBlockAt(r.head);o.from>t&&(n.push(Aue.range(o.from)),t=o.from)}return Xse.set(n)}},{decorations:e=>e.decorations});class Iue extends Yse{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild("string"==typeof this.content?document.createTextNode(this.content):this.content),"string"==typeof this.content?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(e){let t=e.firstChild?Xie(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),r=rse(t[0],"rtl"!=n.direction),o=parseInt(n.lineHeight);return r.bottom-r.top>1.5*o?{left:r.left,right:r.right,top:r.top,bottom:r.top+o}:r}ignoreEvent(){return!1}}const jue=2e3;function Tue(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),o=n-r.from,i=o>jue?-1:o==r.length?function(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}(e,t.clientX):Die(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:i,off:o}}const Bue={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},Rue={style:"cursor: crosshair"},Nue="-10000px";class Due{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter((e=>e));let o=null;this.tooltipViews=this.tooltips.map((e=>o=n(e,o)))}update(e,t){var n;let r=e.state.facet(this.facet),o=r.filter((e=>e));if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let i=[],s=t?[]:null;for(let n=0;n<o.length;n++){let r=o[n],a=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(a=e)}if(a<0)i[n]=this.createTooltipView(r,n?i[n-1]:null),s&&(s[n]=!!r.above);else{let r=i[n]=this.tooltipViews[a];s&&(s[n]=t[a]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)i.indexOf(e)<0&&(this.removeTooltipView(e),null===(n=e.destroy)||void 0===n||n.call(e));return t&&(s.forEach(((e,n)=>t[n]=e)),t.length=s.length),this.input=r,this.tooltips=o,this.tooltipViews=i,!0}}function Mue(e){let{win:t}=e;return{top:0,left:0,bottom:t.innerHeight,right:t.innerWidth}}const Pue=Noe.define({combine:e=>{var t,n,r;return{position:Dse.ios?"absolute":(null===(t=e.find((e=>e.position)))||void 0===t?void 0:t.position)||"fixed",parent:(null===(n=e.find((e=>e.parent)))||void 0===n?void 0:n.parent)||null,tooltipSpace:(null===(r=e.find((e=>e.tooltipSpace)))||void 0===r?void 0:r.tooltipSpace)||Mue}}}),Oue=new WeakMap,Lue=Vae.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(Pue);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver((()=>this.measureSoon())):null,this.manager=new Due(e,zue,((e,t)=>this.createTooltip(e,t)),(e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()})),this.above=this.manager.tooltips.map((e=>!!e.above)),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver((e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()}),{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout((()=>{this.measureTimeout=-1,this.maybeMeasure()}),50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(Pue);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=Nue,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),null===(e=t.destroy)||void 0===e||e.call(t);this.parent&&this.container.remove(),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),null===(n=this.intersectionObserver)||void 0===n||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=this.view.dom.getBoundingClientRect(),t=1,n=1,r=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(Dse.gecko)r=e.offsetParent!=this.container.ownerDocument.body;else if(e.style.top==Nue&&"0px"==e.style.left){let t=e.getBoundingClientRect();r=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}}if(r||"absolute"==this.position)if(this.parent){let e=this.parent.getBoundingClientRect();e.width&&e.height&&(t=e.width/this.parent.offsetWidth,n=e.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:n}=this.view.viewState);return{editor:e,parent:this.parent?this.container.getBoundingClientRect():e,pos:this.manager.tooltips.map(((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)})),size:this.manager.tooltipViews.map((({dom:e})=>e.getBoundingClientRect())),space:this.view.state.facet(Pue).tooltipSpace(this.view),scaleX:t,scaleY:n,makeAbsolute:r}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let e of this.manager.tooltipViews)e.dom.style.position="absolute"}let{editor:n,space:r,scaleX:o,scaleY:i}=e,s=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],c=this.manager.tooltipViews[a],{dom:u}=c,d=e.pos[a],h=e.size[a];if(!d||d.bottom<=Math.max(n.top,r.top)||d.top>=Math.min(n.bottom,r.bottom)||d.right<Math.max(n.left,r.left)-.1||d.left>Math.min(n.right,r.right)+.1){u.style.top=Nue;continue}let p=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,f=p?7:0,m=h.right-h.left,g=null!==(t=Oue.get(c))&&void 0!==t?t:h.bottom-h.top,b=c.offset||Fue,y=this.view.textDirection==sae.LTR,v=h.width>r.right-r.left?y?r.left:r.right-h.width:y?Math.min(d.left-(p?14:0)+b.x,r.right-m):Math.max(r.left,d.left-m+(p?14:0)-b.x),_=this.above[a];!l.strictSide&&(_?d.top-(h.bottom-h.top)-b.y<r.top:d.bottom+(h.bottom-h.top)+b.y>r.bottom)&&_==r.bottom-d.bottom>d.top-r.top&&(_=this.above[a]=!_);let x=(_?d.top-r.top:r.bottom-d.bottom)-f;if(x<g&&!1!==c.resize){if(x<this.view.defaultLineHeight){u.style.top=Nue;continue}Oue.set(c,g),u.style.height=(g=x)/i+"px"}else u.style.height&&(u.style.height="");let w=_?d.top-g-f-b.y:d.bottom+f+b.y,k=v+m;if(!0!==c.overlap)for(let e of s)e.left<k&&e.right>v&&e.top<w+g&&e.bottom>w&&(w=_?e.top-g-2-f:e.bottom+f+2);if("absolute"==this.position?(u.style.top=(w-e.parent.top)/i+"px",u.style.left=(v-e.parent.left)/o+"px"):(u.style.top=w/i+"px",u.style.left=v/o+"px"),p){let e=d.left+(y?b.x:-b.x)-(v+14-7);p.style.left=e/o+"px"}!0!==c.overlap&&s.push({left:v,top:w,right:k,bottom:w+g}),u.classList.toggle("cm-tooltip-above",_),u.classList.toggle("cm-tooltip-below",!_),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=Nue}},{eventObservers:{scroll(){this.maybeMeasure()}}}),Fue={x:0,y:0},zue=Noe.define({enables:[Lue,Fce.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}})]}),Uue=Noe.define({combine:e=>e.reduce(((e,t)=>e.concat(t)),[])});class Vue{static create(e){return new Vue(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Due(e,Uue,((e,t)=>this.createHostedView(e,t)),(e=>e.dom.remove()))}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)null===(e=t.destroy)||void 0===e||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let r=n[e];if(void 0!==r)if(void 0===t)t=r;else if(t!==r)return}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const Hue=zue.compute([Uue],(e=>{let t=e.facet(Uue);return 0===t.length?null:{pos:Math.min(...t.map((e=>e.pos))),end:Math.max(...t.map((e=>{var t;return null!==(t=e.end)&&void 0!==t?t:e.pos}))),create:Vue.create,above:t[0].above,arrow:t.some((e=>e.arrow))}}));class $ue{constructor(e,t,n,r,o){this.view=e,this.source=t,this.field=n,this.setHover=r,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout((()=>this.startHover()),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.nearest(t.target);if(!n)return;let r,o=1;if(n instanceof Ose)r=n.posAtStart;else{if(r=e.posAtCoords(t),null==r)return;let n=e.coordsAtPos(r);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let i=e.bidiSpans(e.state.doc.lineAt(r)).find((e=>e.from<=r&&e.to>=r)),s=i&&i.dir==sae.RTL?-1:1;o=t.x<n.left?-s:s}let i=this.source(e,r,o);if(null==i?void 0:i.then){let t=this.pending={pos:r};i.then((n=>{this.pending==t&&(this.pending=null,!n||Array.isArray(n)&&!n.length||e.dispatch({effects:this.setHover.of(Array.isArray(n)?n:[n])}))}),(t=>Lae(e.state,t,"hover tooltip")))}else!i||Array.isArray(i)&&!i.length||e.dispatch({effects:this.setHover.of(Array.isArray(i)?i:[i])})}get tooltip(){let e=this.view.plugin(Lue),t=e?e.manager.tooltips.findIndex((e=>e.create==Vue.create)):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:o}=this;if(r.length&&o&&!function(e,t){let n=e.getBoundingClientRect();return t.clientX>=n.left-Wue&&t.clientX<=n.right+Wue&&t.clientY>=n.top-Wue&&t.clientY<=n.bottom+Wue}(o.dom,e)||this.pending){let{pos:o}=r[0]||this.pending,i=null!==(n=null===(t=r[0])||void 0===t?void 0:t.end)&&void 0!==n?n:o;(o==i?this.view.posAtCoords(this.lastMove)==o:function(e,t,n,r,o,i){let s=e.scrollDOM.getBoundingClientRect(),a=e.documentTop+e.documentPadding.top+e.contentHeight;if(s.left>r||s.right<r||s.top>o||Math.min(s.bottom,a)<o)return!1;let l=e.posAtCoords({x:r,y:o},!1);return l>=t&&l<=n}(this.view,o,i,e.clientX,e.clientY))||(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Wue=4;function Gue(e,t={}){let n=iie.define(),r=zoe.define({create:()=>[],update(e,r){if(e.length&&(t.hideOnChange&&(r.docChanged||r.selection)?e=[]:t.hideOn&&(e=e.filter((e=>!t.hideOn(r,e)))),r.docChanged)){let t=[];for(let n of e){let e=r.changes.mapPos(n.pos,-1,_oe.TrackDel);if(null!=e){let o=Object.assign(Object.create(null),n);o.pos=e,null!=o.end&&(o.end=r.changes.mapPos(o.end)),t.push(o)}}e=t}for(let t of r.effects)t.is(n)&&(e=t.value),t.is(Kue)&&(e=[]);return e},provide:e=>Uue.from(e)});return[r,Vae.define((o=>new $ue(o,e,r,n,t.hoverTime||300))),Hue]}function que(e,t){let n=e.plugin(Lue);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}const Kue=iie.define(),Yue=Noe.define({combine(e){let t,n;for(let r of e)t=t||r.topContainer,n=n||r.bottomContainer;return{topContainer:t,bottomContainer:n}}});function Jue(e,t){let n=e.plugin(Xue),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}const Xue=Vae.fromClass(class{constructor(e){this.input=e.state.facet(ede),this.specs=this.input.filter((e=>e)),this.panels=this.specs.map((t=>t(e)));let t=e.state.facet(Yue);this.top=new Zue(e,!0,t.topContainer),this.bottom=new Zue(e,!1,t.bottomContainer),this.top.sync(this.panels.filter((e=>e.top))),this.bottom.sync(this.panels.filter((e=>!e.top)));for(let e of this.panels)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}update(e){let t=e.state.facet(Yue);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new Zue(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new Zue(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(ede);if(n!=this.input){let t=n.filter((e=>e)),r=[],o=[],i=[],s=[];for(let n of t){let t,a=this.specs.indexOf(n);a<0?(t=n(e.view),s.push(t)):(t=this.panels[a],t.update&&t.update(e)),r.push(t),(t.top?o:i).push(t)}this.specs=t,this.panels=r,this.top.sync(o),this.bottom.sync(i);for(let e of s)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>Fce.scrollMargins.of((t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}}))});class Zue{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Que(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Que(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Que(e){let t=e.nextSibling;return e.remove(),t}const ede=Noe.define({enables:Xue});class tde extends yie{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}tde.prototype.elementClass="",tde.prototype.toDOM=void 0,tde.prototype.mapMode=_oe.TrackBefore,tde.prototype.startSide=tde.prototype.endSide=-1,tde.prototype.point=!0;const nde=Noe.define(),rde={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>wie.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},ode=Noe.define();function ide(e){return[ade(),ode.of(Object.assign(Object.assign({},rde),e))]}const sde=Noe.define({combine:e=>e.some((e=>e))});function ade(e){let t=[lde];return e&&!1===e.fixed&&t.push(sde.of(!0)),t}const lde=Vae.fromClass(class{constructor(e){this.view=e,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(ode).map((t=>new hde(e,t)));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!e.state.facet(sde),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<.8*(n.to-n.from))}e.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(sde)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&this.dom.remove();let n=wie.iter(this.view.state.facet(nde),this.view.viewport.from),r=[],o=this.gutters.map((e=>new dde(e,this.view.viewport,-this.view.documentPadding.top)));for(let e of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(e.type)){let t=!0;for(let i of e.type)if(i.type==Jse.Text&&t){ude(n,r,i.from);for(let e of o)e.line(this.view,i,r);t=!1}else if(i.widget)for(let e of o)e.widget(this.view,i)}else if(e.type==Jse.Text){ude(n,r,e.from);for(let t of o)t.line(this.view,e,r)}else if(e.widget)for(let t of o)t.widget(this.view,e);for(let e of o)e.finish();e&&this.view.scrollDOM.insertBefore(this.dom,t)}updateGutters(e){let t=e.startState.facet(ode),n=e.state.facet(ode),r=e.docChanged||e.heightChanged||e.viewportChanged||!wie.eq(e.startState.facet(nde),e.state.facet(nde),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(r=!0);else{r=!0;let o=[];for(let r of n){let n=t.indexOf(r);n<0?o.push(new hde(this.view,r)):(this.gutters[n].update(e),o.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),o.indexOf(e)<0&&e.destroy();for(let e of o)this.dom.appendChild(e.dom);this.gutters=o}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove()}},{provide:e=>Fce.scrollMargins.of((t=>{let n=t.plugin(e);return n&&0!=n.gutters.length&&n.fixed?t.textDirection==sae.LTR?{left:n.dom.offsetWidth*t.scaleX}:{right:n.dom.offsetWidth*t.scaleX}:null}))});function cde(e){return Array.isArray(e)?e:[e]}function ude(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class dde{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=wie.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,o=(t.top-this.height)/e.scaleY,i=t.height/e.scaleY;if(this.i==r.elements.length){let t=new pde(e,i,o,n);r.elements.push(t),r.dom.appendChild(t.dom)}else r.elements[this.i].update(e,i,o,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];ude(this.cursor,r,t.from),n.length&&(r=r.concat(n));let o=this.gutter.config.lineMarker(e,t,r);o&&r.unshift(o);let i=this.gutter;(0!=r.length||i.config.renderEmptyElements)&&this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t);n&&this.addElement(e,t,[n])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class hde{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in t.domEventHandlers)this.dom.addEventListener(n,(r=>{let o,i=r.target;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();o=(e.top+e.bottom)/2}else o=r.clientY;let s=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[n](e,s,r)&&r.preventDefault()}));this.markers=cde(t.markers(e)),t.initialSpacer&&(this.spacer=new pde(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=cde(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!wie.eq(this.markers,t,n.from,n.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class pde{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),function(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n="cm-gutterElement",r=this.dom.firstChild;for(let o=0,i=0;;){let s=i,a=o<t.length?t[o++]:null,l=!1;if(a){let e=a.elementClass;e&&(n+=" "+e);for(let e=i;e<this.markers.length;e++)if(this.markers[e].compare(a)){s=e,l=!0;break}}else s=this.markers.length;for(;i<s;){let e=this.markers[i++];if(e.toDOM){e.destroy(r);let t=r.nextSibling;r.remove(),r=t}}if(!a)break;a.toDOM&&(l?r=r.nextSibling:this.dom.insertBefore(a.toDOM(e),r)),l&&i++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}}const fde=Noe.define(),mde=Noe.define({combine:e=>bie(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let r=n[e],o=t[e];n[e]=r?(e,t,n)=>r(e,t,n)||o(e,t,n):o}return n}})});class gde extends tde{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function bde(e,t){return e.state.facet(mde).formatNumber(t,e.state)}const yde=ode.compute([mde],(e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(fde),lineMarker:(e,t,n)=>n.some((e=>e.toDOM))?null:new gde(bde(e,e.state.doc.lineAt(t.from).number)),widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(mde)!=e.state.facet(mde),initialSpacer:e=>new gde(bde(e,vde(e.state.doc.lines))),updateSpacer(e,t){let n=bde(t.view,vde(t.view.state.doc.lines));return n==e.number?e:new gde(n)},domEventHandlers:e.facet(mde).domEventHandlers})));function vde(e){let t=9;for(;t<e;)t=10*t+9;return t}const _de=new class extends tde{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},xde=nde.compute(["selection"],(e=>{let t=[],n=-1;for(let r of e.selection.ranges){let o=e.doc.lineAt(r.head).from;o>n&&(n=o,t.push(_de.range(o)))}return wie.of(t)})),wde=1024;let kde=0;class Cde{constructor(e,t){this.from=e,this.to=t}}class Sde{constructor(e={}){this.id=kde++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=Ide.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}Sde.closedBy=new Sde({deserialize:e=>e.split(" ")}),Sde.openedBy=new Sde({deserialize:e=>e.split(" ")}),Sde.group=new Sde({deserialize:e=>e.split(" ")}),Sde.isolate=new Sde({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}}),Sde.contextHash=new Sde({perNode:!0}),Sde.lookAhead=new Sde({perNode:!0}),Sde.mounted=new Sde({perNode:!0});class Ade{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[Sde.mounted.id]}}const Ede=Object.create(null);class Ide{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):Ede,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),r=new Ide(e.name||"",t,e.id,n);if(e.props)for(let n of e.props)if(Array.isArray(n)||(n=n(r)),n){if(n[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[n[0].id]=n[1]}return r}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(Sde.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(" "))t[r]=e[n];return e=>{for(let n=e.prop(Sde.group),r=-1;r<(n?n.length:0);r++){let o=t[r<0?e.name:n[r]];if(o)return o}}}}Ide.none=new Ide("",Object.create(null),0,8);const jde=new WeakMap,Tde=new WeakMap;var Bde;!function(e){e[e.ExcludeBuffers=1]="ExcludeBuffers",e[e.IncludeAnonymous=2]="IncludeAnonymous",e[e.IgnoreMounts=4]="IgnoreMounts",e[e.IgnoreOverlays=8]="IgnoreOverlays"}(Bde||(Bde={}));class Rde{constructor(e,t,n,r,o){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,o&&o.length){this.props=Object.create(null);for(let[e,t]of o)this.props["number"==typeof e?e:e.id]=t}}toString(){let e=Ade.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let e of this.children){let n=e.toString();n&&(t&&(t+=","),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new Wde(this.topNode,e)}cursorAt(e,t=0,n=0){let r=jde.get(this)||this.topNode,o=new Wde(r);return o.moveTo(e,t),jde.set(this,o._tree),o}get topNode(){return new Lde(this,0,0,null)}resolve(e,t=0){let n=Pde(jde.get(this)||this.topNode,e,t,!1);return jde.set(this,n),n}resolveInner(e,t=0){let n=Pde(Tde.get(this)||this.topNode,e,t,!0);return Tde.set(this,n),n}resolveStack(e,t=0){return function(e,t,n){let r=e.resolveInner(t,n),o=null;for(let e=r instanceof Lde?r:r.context.parent;e;e=e.parent)if(e.index<0){let i=e.parent;(o||(o=[r])).push(i.resolve(t,n)),e=i}else{let i=Ade.get(e.tree);if(i&&i.overlay&&i.overlay[0].from<=t&&i.overlay[i.overlay.length-1].to>=t){let s=new Lde(i.tree,i.overlay[0].from+e.from,-1,e);(o||(o=[r])).push(Pde(s,t,n,!1))}}return o?Hde(o):r}(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:o=this.length}=e,i=e.mode||0,s=(i&Bde.IncludeAnonymous)>0;for(let e=this.cursor(i|Bde.IncludeAnonymous);;){let i=!1;if(e.from<=o&&e.to>=r&&(!s&&e.type.isAnonymous||!1!==t(e))){if(e.firstChild())continue;i=!0}for(;i&&n&&(s||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;i=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Yde(Ide.none,this.children,this.positions,0,this.children.length,0,this.length,((e,t,n)=>new Rde(this.type,e,t,n,this.propValues)),e.makeTree||((e,t,n)=>new Rde(Ide.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:r,maxBufferLength:o=wde,reused:i=[],minRepeatType:s=r.types.length}=e,a=Array.isArray(n)?new Nde(n,n.length):n,l=r.types,c=0,u=0;function d(e,t,n,g,b,y){let{id:v,start:_,end:x,size:w}=a,k=u;for(;w<0;){if(a.next(),-1==w){let t=i[v];return n.push(t),void g.push(_-e)}if(-3==w)return void(c=v);if(-4==w)return void(u=v);throw new RangeError(`Unrecognized record size: ${w}`)}let C,S,A=l[v],E=_-e;if(x-_<=o&&(S=function(e,t){let n=a.fork(),r=0,i=0,l=0,c=n.end-o,u={size:0,start:0,skip:0};e:for(let o=n.pos-e;n.pos>o;){let e=n.size;if(n.id==t&&e>=0){u.size=r,u.start=i,u.skip=l,l+=4,r+=4,n.next();continue}let a=n.pos-e;if(e<0||a<o||n.start<c)break;let d=n.id>=s?4:0,h=n.start;for(n.next();n.pos>a;){if(n.size<0){if(-3!=n.size)break e;d+=4}else n.id>=s&&(d+=4);n.next()}i=h,r+=e,l+=d}return(t<0||r==e)&&(u.size=r,u.start=i,u.skip=l),u.size>4?u:void 0}(a.pos-t,b))){let t=new Uint16Array(S.size-S.skip),n=a.pos-S.size,o=t.length;for(;a.pos>n;)o=m(S.start,t,o);C=new Dde(t,x-S.start,r),E=S.start-e}else{let e=a.pos-w;a.next();let t=[],n=[],r=v>=s?v:-1,i=0,l=x;for(;a.pos>e;)r>=0&&a.id==r&&a.size>=0?(a.end<=l-o&&(p(t,n,_,i,a.end,l,r,k),i=t.length,l=a.end),a.next()):y>2500?h(_,e,t,n):d(_,e,t,n,r,y+1);if(r>=0&&i>0&&i<t.length&&p(t,n,_,i,_,l,r,k),t.reverse(),n.reverse(),r>-1&&i>0){let e=function(e){return(t,n,r)=>{let o,i,s=0,a=t.length-1;if(a>=0&&(o=t[a])instanceof Rde){if(!a&&o.type==e&&o.length==r)return o;(i=o.prop(Sde.lookAhead))&&(s=n[a]+o.length+i)}return f(e,t,n,r,s)}}(A);C=Yde(A,t,n,0,t.length,0,x-_,e,e)}else C=f(A,t,n,x-_,k-x)}n.push(C),g.push(E)}function h(e,t,n,i){let s=[],l=0,c=-1;for(;a.pos>t;){let{id:e,start:t,end:n,size:r}=a;if(r>4)a.next();else{if(c>-1&&t<c)break;c<0&&(c=n-o),s.push(e,t,n),l++,a.next()}}if(l){let t=new Uint16Array(4*l),o=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-o,t[n++]=s[e+2]-o,t[n++]=n;n.push(new Dde(t,s[2]-o,r)),i.push(o-e)}}function p(e,t,n,o,i,s,a,l){let c=[],u=[];for(;e.length>o;)c.push(e.pop()),u.push(t.pop()+n-i);e.push(f(r.types[a],c,u,s-i,l-s)),t.push(i-n)}function f(e,t,n,r,o=0,i){if(c){let e=[Sde.contextHash,c];i=i?[e].concat(i):[e]}if(o>25){let e=[Sde.lookAhead,o];i=i?[e].concat(i):[e]}return new Rde(e,t,n,r,i)}function m(e,t,n){let{id:r,start:o,end:i,size:l}=a;if(a.next(),l>=0&&r<s){let s=n;if(l>4){let r=a.pos-(l-4);for(;a.pos>r;)n=m(e,t,n)}t[--n]=s,t[--n]=i-e,t[--n]=o-e,t[--n]=r}else-3==l?c=r:-4==l&&(u=r);return n}let g=[],b=[];for(;a.pos>0;)d(e.start||0,e.bufferStart||0,g,b,-1,0);let y=null!==(t=e.length)&&void 0!==t?t:g.length?b[0]+g[0].length:0;return new Rde(l[e.topID],g.reverse(),b.reverse(),y)}(e)}}Rde.empty=new Rde(Ide.none,[],[],0);class Nde{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Nde(this.buffer,this.index)}}class Dde{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Ide.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],o=r.name;if(/\W/.test(o)&&!r.isError&&(o=JSON.stringify(o)),n==(e+=4))return o;let i=[];for(;e<n;)i.push(this.childString(e)),e=this.buffer[e+3];return o+"("+i.join(",")+")"}findChild(e,t,n,r,o){let{buffer:i}=this,s=-1;for(let a=e;a!=t&&!(Mde(o,r,i[a+1],i[a+2])&&(s=a,n>0));a=i[a+3]);return s}slice(e,t,n){let r=this.buffer,o=new Uint16Array(t-e),i=0;for(let s=e,a=0;s<t;){o[a++]=r[s++],o[a++]=r[s++]-n;let t=o[a++]=r[s++]-n;o[a++]=r[s++]-e,i=Math.max(i,t)}return new Dde(o,i,this.set)}}function Mde(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function Pde(e,t,n,r){for(var o;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof Lde&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:Bde.IgnoreOverlays;if(r)for(let r=e,s=r.parent;s;r=s,s=r.parent)r instanceof Lde&&r.index<0&&(null===(o=s.enter(t,n,i))||void 0===o?void 0:o.from)!=r.from&&(e=s);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}class Ode{cursor(e=0){return new Wde(this,e)}getChild(e,t=null,n=null){let r=Fde(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return Fde(this,e,t,n)}resolve(e,t=0){return Pde(this,e,t,!1)}resolveInner(e,t=0){return Pde(this,e,t,!0)}matchContext(e){return zde(this,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}}class Lde extends Ode{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,n,r,o=0){for(let i=this;;){for(let{children:s,positions:a}=i._tree,l=t>0?s.length:-1;e!=l;e+=t){let l=s[e],c=a[e]+i.from;if(Mde(r,n,c,c+l.length))if(l instanceof Dde){if(o&Bde.ExcludeBuffers)continue;let s=l.findChild(0,l.buffer.length,t,n-c,r);if(s>-1)return new Vde(new Ude(i,l,e,c),null,s)}else if(o&Bde.IncludeAnonymous||!l.type.isAnonymous||Gde(l)){let s;if(!(o&Bde.IgnoreMounts)&&(s=Ade.get(l))&&!s.overlay)return new Lde(s.tree,c,e,i);let a=new Lde(l,c,e,i);return o&Bde.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(t<0?l.children.length-1:0,t,n,r)}}if(o&Bde.IncludeAnonymous||!i.type.isAnonymous)return null;if(e=i.index>=0?i.index+t:t<0?-1:i._parent._tree.children.length,i=i._parent,!i)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let r;if(!(n&Bde.IgnoreOverlays)&&(r=Ade.get(this._tree))&&r.overlay){let n=e-this.from;for(let{from:e,to:o}of r.overlay)if((t>0?e<=n:e<n)&&(t<0?o>=n:o>n))return new Lde(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Fde(e,t,n,r){let o=e.cursor(),i=[];if(!o.firstChild())return i;if(null!=n)for(let e=!1;!e;)if(e=o.type.is(n),!o.nextSibling())return i;for(;;){if(null!=r&&o.type.is(r))return i;if(o.type.is(t)&&i.push(o.node),!o.nextSibling())return null==r?i:[]}}function zde(e,t,n=t.length-1){for(let r=e.parent;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}class Ude{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}}class Vde extends Ode{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:r}=this.context,o=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return o<0?null:new Vde(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&Bde.ExcludeBuffers)return null;let{buffer:r}=this.context,o=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return o<0?null:new Vde(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Vde(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Vde(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,o=n.buffer[this.index+3];if(o>r){let i=n.buffer[this.index+1];e.push(n.slice(r,o,i)),t.push(0)}return new Rde(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Hde(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let o=e[r];(o.from>n.from||o.to<n.to)&&(n=o,t=r)}let r=n instanceof Lde&&n.index<0?null:n.parent,o=e.slice();return r?o[t]=r:o.splice(t,1),new $de(o,n)}class $de{constructor(e,t){this.heads=e,this.node=t}get next(){return Hde(this.heads)}}class Wde{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Lde)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return!!e&&(e instanceof Lde?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,o=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return!(o<0)&&(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?!(n&Bde.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Bde.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Bde.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else({index:t,_parent:n}=this._tree);for(;n;({index:t,_parent:n}=n))if(t>-1)for(let r=t+e,o=e<0?-1:n._tree.children.length;r!=o;r+=e){let e=n._tree.children[r];if(this.mode&Bde.IncludeAnonymous||e instanceof Dde||!e.type.isAnonymous||Gde(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)e:for(let r=this.index,o=this.stack.length;o>=0;){for(let i=e;i;i=i._parent)if(i.index==r){if(r==this.index)return i;t=i,n=o+1;break e}r=this.stack[--o]}for(let e=n;e<this.stack.length;e++)t=new Vde(this.buffer,t,this.stack[e]);return this.bufferNode=new Vde(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||!1!==e(this)){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;r&&t&&t(this),r=this.type.isAnonymous,!this.nextSibling();){if(!n)return;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return zde(this.node,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,o=this.stack.length-1;r>=0;o--){if(o<0)return zde(this.node,e,r);let i=n[t.buffer[this.stack[o]]];if(!i.isAnonymous){if(e[r]&&e[r]!=i.name)return!1;r--}}return!0}}function Gde(e){return e.children.some((e=>e instanceof Dde||!e.type.isAnonymous||Gde(e)))}const qde=new WeakMap;function Kde(e,t){if(!e.isAnonymous||t instanceof Dde||t.type!=e)return 1;let n=qde.get(t);if(null==n){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof Rde)){n=1;break}n+=Kde(e,r)}qde.set(t,n)}return n}function Yde(e,t,n,r,o,i,s,a,l){let c=0;for(let n=r;n<o;n++)c+=Kde(e,t[n]);let u=Math.ceil(1.5*c/8),d=[],h=[];return function t(n,r,o,s,a){for(let c=o;c<s;){let o=c,p=r[c],f=Kde(e,n[c]);for(c++;c<s;c++){let t=Kde(e,n[c]);if(f+t>=u)break;f+=t}if(c==o+1){if(f>u){let e=n[o];t(e.children,e.positions,0,e.children.length,r[o]+a);continue}d.push(n[o])}else{let t=r[c-1]+n[c-1].length-p;d.push(Yde(e,n,r,o,c,p,t,null,l))}h.push(p+a-i)}}(t,n,r,o,0),(a||l)(d,h,s)}class Jde{constructor(e,t,n,r,o=!1,i=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=(o?1:0)|(i?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let r=[new Jde(0,e.length,e,0,!1,n)];for(let n of t)n.to>e.length&&r.push(n);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],o=1,i=e.length?e[0]:null;for(let s=0,a=0,l=0;;s++){let c=s<t.length?t[s]:null,u=c?c.fromA:1e9;if(u-a>=n)for(;i&&i.from<u;){let t=i;if(a>=t.from||u<=t.to||l){let e=Math.max(t.from,a)-l,n=Math.min(t.to,u)-l;t=e>=n?null:new Jde(e,n,t.tree,t.offset+l,s>0,!!c)}if(t&&r.push(t),i.to>u)break;i=o<e.length?e[o++]:null}if(!c)break;a=c.toA,l=c.toA-c.toB}return r}}class Xde{startParse(e,t,n){return"string"==typeof e&&(e=new Zde(e)),n=n?n.length?n.map((e=>new Cde(e.from,e.to))):[new Cde(0,0)]:[new Cde(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}}class Zde{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new Sde({perNode:!0});let Qde=0;class ehe{constructor(e,t,n){this.set=e,this.base=t,this.modified=n,this.id=Qde++}static define(e){if(null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");let t=new ehe([],null,[]);if(t.set.push(t),e)for(let n of e.set)t.set.push(n);return t}static defineModifier(){let e=new nhe;return t=>t.modified.indexOf(e)>-1?t:nhe.get(t.base||t,t.modified.concat(e).sort(((e,t)=>e.id-t.id)))}}let the=0;class nhe{constructor(){this.instances=[],this.id=the++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find((n=>n.base==e&&function(e,t){return e.length==t.length&&e.every(((e,n)=>e==t[n]))}(t,n.modified)));if(n)return n;let r=[],o=new ehe(r,e,t);for(let e of t)e.instances.push(o);let i=function(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,o=t.length;r<o;r++)t.push(t[r].concat(e[n]));return t.sort(((e,t)=>t.length-e.length))}(t);for(let t of e.set)if(!t.modified.length)for(let e of i)r.push(nhe.get(t,e));return o}}function rhe(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(" "))if(e){let n=[],o=2,i=e;for(let t=0;;){if("..."==i&&t>0&&t+3==e.length){o=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(i);if(!r)throw new RangeError("Invalid path: "+e);if(n.push("*"==r[0]?"":'"'==r[0][0]?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let s=e[t++];if(t==e.length&&"!"==s){o=0;break}if("/"!=s)throw new RangeError("Invalid path: "+e);i=e.slice(t)}let s=n.length-1,a=n[s];if(!a)throw new RangeError("Invalid path: "+e);let l=new ihe(r,o,s>0?n.slice(0,s):null);t[a]=l.sort(t[a])}}return ohe.add(t)}const ohe=new Sde;class ihe{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}function she(e,t){let n=Object.create(null);for(let t of e)if(Array.isArray(t.tag))for(let e of t.tag)n[e.id]=t.class;else n[t.tag.id]=t.class;let{scope:r,all:o=null}=t||{};return{style:e=>{let t=o;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+" "+r:r;break}}return t},scope:r}}function ahe(e,t,n,r=0,o=e.length){let i=new lhe(r,Array.isArray(t)?t:[t],n);i.highlightRange(e.cursor(),r,o,"",i.highlighters),i.flush(o)}ihe.empty=new ihe([],2,null);class lhe{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,o){let{type:i,from:s,to:a}=e;if(s>=n||a<=t)return;i.isTop&&(o=this.highlighters.filter((e=>!e.scope||e.scope(i))));let l=r,c=function(e){let t=e.type.prop(ohe);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||ihe.empty,u=function(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+" "+e:e)}return n}(o,c.tags);if(u&&(l&&(l+=" "),l+=u,1==c.mode&&(r+=(r?" ":"")+u)),this.startSpan(Math.max(t,s),l),c.opaque)return;let d=e.tree&&e.tree.prop(Sde.mounted);if(d&&d.overlay){let i=e.node.enter(d.overlay[0].from+s,1),c=this.highlighters.filter((e=>!e.scope||e.scope(d.tree.type))),u=e.firstChild();for(let h=0,p=s;;h++){let f=h<d.overlay.length?d.overlay[h]:null,m=f?f.from+s:a,g=Math.max(t,p),b=Math.min(n,m);if(g<b&&u)for(;e.from<b&&(this.highlightRange(e,g,b,r,o),this.startSpan(Math.min(b,e.to),l),!(e.to>=m)&&e.nextSibling()););if(!f||m>n)break;p=f.to+s,p>t&&(this.highlightRange(i.cursor(),Math.max(t,f.from+s),Math.min(n,p),"",c),this.startSpan(Math.min(n,p),l))}u&&e.parent()}else if(e.firstChild()){d&&(r="");do{if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,o),this.startSpan(Math.min(n,e.to),l)}}while(e.nextSibling());e.parent()}}}const che=ehe.define,uhe=che(),dhe=che(),hhe=che(dhe),phe=che(dhe),fhe=che(),mhe=che(fhe),ghe=che(fhe),bhe=che(),yhe=che(bhe),vhe=che(),_he=che(),xhe=che(),whe=che(xhe),khe=che(),Che={comment:uhe,lineComment:che(uhe),blockComment:che(uhe),docComment:che(uhe),name:dhe,variableName:che(dhe),typeName:hhe,tagName:che(hhe),propertyName:phe,attributeName:che(phe),className:che(dhe),labelName:che(dhe),namespace:che(dhe),macroName:che(dhe),literal:fhe,string:mhe,docString:che(mhe),character:che(mhe),attributeValue:che(mhe),number:ghe,integer:che(ghe),float:che(ghe),bool:che(fhe),regexp:che(fhe),escape:che(fhe),color:che(fhe),url:che(fhe),keyword:vhe,self:che(vhe),null:che(vhe),atom:che(vhe),unit:che(vhe),modifier:che(vhe),operatorKeyword:che(vhe),controlKeyword:che(vhe),definitionKeyword:che(vhe),moduleKeyword:che(vhe),operator:_he,derefOperator:che(_he),arithmeticOperator:che(_he),logicOperator:che(_he),bitwiseOperator:che(_he),compareOperator:che(_he),updateOperator:che(_he),definitionOperator:che(_he),typeOperator:che(_he),controlOperator:che(_he),punctuation:xhe,separator:che(xhe),bracket:whe,angleBracket:che(whe),squareBracket:che(whe),paren:che(whe),brace:che(whe),content:bhe,heading:yhe,heading1:che(yhe),heading2:che(yhe),heading3:che(yhe),heading4:che(yhe),heading5:che(yhe),heading6:che(yhe),contentSeparator:che(bhe),list:che(bhe),quote:che(bhe),emphasis:che(bhe),strong:che(bhe),link:che(bhe),monospace:che(bhe),strikethrough:che(bhe),inserted:che(),deleted:che(),changed:che(),invalid:che(),meta:khe,documentMeta:che(khe),annotation:che(khe),processingInstruction:che(khe),definition:ehe.defineModifier(),constant:ehe.defineModifier(),function:ehe.defineModifier(),standard:ehe.defineModifier(),local:ehe.defineModifier(),special:ehe.defineModifier()};var She;she([{tag:Che.link,class:"tok-link"},{tag:Che.heading,class:"tok-heading"},{tag:Che.emphasis,class:"tok-emphasis"},{tag:Che.strong,class:"tok-strong"},{tag:Che.keyword,class:"tok-keyword"},{tag:Che.atom,class:"tok-atom"},{tag:Che.bool,class:"tok-bool"},{tag:Che.url,class:"tok-url"},{tag:Che.labelName,class:"tok-labelName"},{tag:Che.inserted,class:"tok-inserted"},{tag:Che.deleted,class:"tok-deleted"},{tag:Che.literal,class:"tok-literal"},{tag:Che.string,class:"tok-string"},{tag:Che.number,class:"tok-number"},{tag:[Che.regexp,Che.escape,Che.special(Che.string)],class:"tok-string2"},{tag:Che.variableName,class:"tok-variableName"},{tag:Che.local(Che.variableName),class:"tok-variableName tok-local"},{tag:Che.definition(Che.variableName),class:"tok-variableName tok-definition"},{tag:Che.special(Che.variableName),class:"tok-variableName2"},{tag:Che.definition(Che.propertyName),class:"tok-propertyName tok-definition"},{tag:Che.typeName,class:"tok-typeName"},{tag:Che.namespace,class:"tok-namespace"},{tag:Che.className,class:"tok-className"},{tag:Che.macroName,class:"tok-macroName"},{tag:Che.propertyName,class:"tok-propertyName"},{tag:Che.operator,class:"tok-operator"},{tag:Che.comment,class:"tok-comment"},{tag:Che.meta,class:"tok-meta"},{tag:Che.invalid,class:"tok-invalid"},{tag:Che.punctuation,class:"tok-punctuation"}]);const Ahe=new Sde,Ehe=new Sde;class Ihe{constructor(e,t,n=[],r=""){this.data=e,this.name=r,gie.prototype.hasOwnProperty("tree")||Object.defineProperty(gie.prototype,"tree",{get(){return The(this)}}),this.parser=t,this.extension=[Fhe.of(this),gie.languageData.of(((e,t,n)=>{let r=jhe(e,t,n),o=r.type.prop(Ahe);if(!o)return[];let i=e.facet(o),s=r.type.prop(Ehe);if(s){let o=r.resolve(t-r.from,n);for(let t of s)if(t.test(o,e)){let n=e.facet(t.facet);return"replace"==t.type?n:n.concat(i)}}return i}))].concat(n)}isActiveAt(e,t,n=-1){return jhe(e,t,n).type.prop(Ahe)==this.data}findRegions(e){let t=e.facet(Fhe);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(Ahe)==this.data)return void n.push({from:t,to:t+e.length});let o=e.prop(Sde.mounted);if(o){if(o.tree.prop(Ahe)==this.data){if(o.overlay)for(let e of o.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}if(o.overlay){let e=n.length;if(r(o.tree,o.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let o=e.children[n];o instanceof Rde&&r(o,e.positions[n]+t)}};return r(The(e),0),n}get allowsNesting(){return!0}}function jhe(e,t,n){let r=e.facet(Fhe),o=The(e).topNode;if(!r||r.allowsNesting)for(let e=o;e;e=e.enter(t,n,Bde.ExcludeBuffers))e.type.isTop&&(o=e);return o}function The(e){let t=e.field(Ihe.state,!1);return t?t.tree:Rde.empty}Ihe.setState=iie.define();class Bhe{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let Rhe=null;class Nhe{constructor(e,t,n=[],r,o,i,s,a){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=o,this.viewport=i,this.skipped=s,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new Nhe(e,t,[],Rde.empty,0,n,[],null)}startParse(){return this.parser.startParse(new Bhe(this.state.doc),this.fragments)}work(e,t){return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=Rde.empty&&this.isDone(null!=t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var n;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let r=this.parse.advance();if(r){if(this.fragments=this.withoutTempSkipped(Jde.addTree(r,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(n=this.parse.stoppedAt)&&void 0!==n?n:this.state.doc.length,this.tree=r,this.parse=null,!(this.treeLen<(null!=t?t:this.state.doc.length)))return!0;this.parse=this.startParse()}if(e())return!1}}))}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext((()=>{for(;!(t=this.parse.advance()););})),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Jde.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Rhe;Rhe=this;try{return e()}finally{Rhe=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Dhe(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:r,treeLen:o,viewport:i,skipped:s}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges(((e,n,r,o)=>t.push({fromA:e,toA:n,fromB:r,toB:o}))),n=Jde.applyChanges(n,t),r=Rde.empty,o=0,i={from:e.mapPos(i.from,-1),to:e.mapPos(i.to,1)},this.skipped.length){s=[];for(let t of this.skipped){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);n<r&&s.push({from:n,to:r})}}}return new Nhe(this.parser,t,n,r,o,i,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=Dhe(this.fragments,n,r),this.skipped.splice(t--,1))}return!(this.skipped.length>=t||(this.reset(),0))}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Xde{createParse(t,n,r){let o=r[0].from,i=r[r.length-1].to,s={parsedPos:o,advance(){let t=Rhe;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=i,new Rde(Ide.none,[],[],i-o)},stoppedAt:null,stopAt(){}};return s}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return Rhe}}function Dhe(e,t,n){return Jde.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class Mhe{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new Mhe(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=Nhe.create(e.facet(Fhe).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new Mhe(n)}}Ihe.state=zoe.define({create:Mhe.init,update(e,t){for(let e of t.effects)if(e.is(Ihe.setState))return e.value;return t.startState.facet(Fhe)!=t.state.facet(Fhe)?Mhe.init(t.state):e.apply(t)}});let Phe=e=>{let t=setTimeout((()=>e()),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(Phe=e=>{let t=-1,n=setTimeout((()=>{t=requestIdleCallback(e,{timeout:400})}),100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const Ohe="undefined"!=typeof navigator&&(null===(She=navigator.scheduling)||void 0===She?void 0:She.isInputPending)?()=>navigator.scheduling.isInputPending():null,Lhe=Vae.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Ihe.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Ihe.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=Phe(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,o=n.field(Ihe.state);if(o.tree==o.context.tree&&o.context.isDone(r+1e5))return;let i=Date.now()+Math.min(this.chunkBudget,100,e&&!Ohe?Math.max(25,e.timeRemaining()-5):1e9),s=o.context.treeLen<r&&n.doc.length>r+1e3,a=o.context.work((()=>Ohe&&Ohe()||Date.now()>i),r+(s?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:Ihe.setState.of(new Mhe(o.context))})),this.chunkBudget>0&&(!a||s)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then((()=>this.scheduleWork())).catch((e=>Lae(this.view.state,e))).then((()=>this.workScheduled--)),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Fhe=Noe.define({combine:e=>e.length?e[0]:null,enables:e=>[Ihe.state,Lhe,Fce.contentAttributes.compute([e],(t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}}))]}),zhe=Noe.define(),Uhe=Noe.define({combine:e=>{if(!e.length)return"  ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some((e=>e!=t[0])))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function Vhe(e){let t=e.facet(Uhe);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function Hhe(e,t){let n="",r=e.tabSize,o=e.facet(Uhe)[0];if("\t"==o){for(;t>=r;)n+="\t",t-=r;o=" "}for(let e=0;e<t;e++)n+=o;return n}function $he(e,t){e instanceof gie&&(e=new Whe(e));for(let n of e.state.facet(zhe)){let r=n(e,t);if(void 0!==r)return r}let n=The(e.state);return n.length>=t?function(e,t,n){let r=t.resolveStack(n),o=r.node.enterUnfinishedNodesBefore(n);if(o!=r.node){let e=[];for(let t=o;t!=r.node;t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return qhe(r,e,n)}(e,n,t):null}class Whe{constructor(e,t={}){this.state=e,this.options=t,this.unit=Vhe(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:o}=this.options;return null!=r&&r>=n.from&&r<=n.to?o&&r==e?{text:"",from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),o=this.countColumn(n,e-r),i=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return i>-1&&(o+=i-this.countColumn(n,n.search(/\S|$/))),o}countColumn(e,t=e.length){return Die(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),o=this.options.overrideIndentation;if(o){let e=o(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Ghe=new Sde;function qhe(e,t,n){for(let r=e;r;r=r.next){let e=Khe(r.node);if(e)return e(Jhe.create(t,n,r))}return 0}function Khe(e){let t=e.type.prop(Ghe);if(t)return t;let n,r=e.firstChild;if(r&&(n=r.type.prop(Sde.closedBy))){let t=e.lastChild,r=t&&n.indexOf(t.name)>-1;return e=>function(e,t,n,r,o){let i=e.textAfter,s=i.match(/^\s*/)[0].length,a=r&&i.slice(s,s+r.length)==r||o==e.pos+s,l=t?function(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let o=e.options.simulateBreak,i=e.state.doc.lineAt(n.from),s=null==o||o<=i.from?i.to:Math.min(i.to,o);for(let e=n.to;;){let o=t.childAfter(e);if(!o||o==r)return null;if(!o.type.isSkipped)return o.from<s?n:null;e=o.to}}(e):null;return l?a?e.column(l.from):e.column(l.to):e.baseIndent+(a?0:e.unit*n)}(e,!0,1,void 0,r&&!function(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}(e)?t.from:void 0)}return null==e.parent?Yhe:null}function Yhe(){return 0}class Jhe extends Whe{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new Jhe(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(Xhe(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return qhe(this.context.next,this.base,this.pos)}}function Xhe(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}const Zhe=Noe.define(),Qhe=new Sde;function epe(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function tpe(e,t,n){for(let r of e.facet(Zhe)){let o=r(e,t,n);if(o)return o}return function(e,t,n){let r=The(e);if(r.length<n)return null;let o=null;for(let i=r.resolveStack(n,1);i;i=i.next){let s=i.node;if(s.to<=n||s.from>n)continue;if(o&&s.from<t)break;let a=s.type.prop(Qhe);if(a&&(s.to<r.length-50||r.length==e.doc.length||!epe(s))){let r=a(s,e);r&&r.from<=n&&r.from>=t&&r.to>n&&(o=r)}}return o}(e,t,n)}function npe(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}const rpe=iie.define({map:npe}),ope=iie.define({map:npe});function ipe(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some((e=>e.from<=n&&e.to>=n))||t.push(e.lineBlockAt(n));return t}const spe=zoe.define({create:()=>Xse.none,update(e,t){e=e.map(t.changes);for(let n of t.effects)if(n.is(rpe)&&!lpe(e,n.value.from,n.value.to)){let{preparePlaceholder:r}=t.state.facet(ppe),o=r?Xse.replace({widget:new bpe(r(t.state,n.value))}):gpe;e=e.update({add:[o.range(n.value.from,n.value.to)]})}else n.is(ope)&&(e=e.update({filter:(e,t)=>n.value.from!=e||n.value.to!=t,filterFrom:n.value.from,filterTo:n.value.to}));if(t.selection){let n=!1,{head:r}=t.selection.main;e.between(r,r,((e,t)=>{e<r&&t>r&&(n=!0)})),n&&(e=e.update({filterFrom:r,filterTo:r,filter:(e,t)=>t<=r||e>=r}))}return e},provide:e=>Fce.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,((e,t)=>{n.push(e,t)})),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n<e.length;){let r=e[n++],o=e[n++];if("number"!=typeof r||"number"!=typeof o)throw new RangeError("Invalid JSON for fold state");t.push(gpe.range(r,o))}return Xse.set(t,!0)}});function ape(e,t,n){var r;let o=null;return null===(r=e.field(spe,!1))||void 0===r||r.between(t,n,((e,t)=>{(!o||o.from>e)&&(o={from:e,to:t})})),o}function lpe(e,t,n){let r=!1;return e.between(t,t,((e,o)=>{e==t&&o==n&&(r=!0)})),r}function cpe(e,t){return e.field(spe,!1)?t:t.concat(iie.appendConfig.of(fpe()))}function upe(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,o=e.state.doc.lineAt(t.to).number;return Fce.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${e.state.phrase("to")} ${o}.`)}const dpe=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of ipe(e)){let n=tpe(e.state,t.from,t.to);if(n)return e.dispatch({effects:cpe(e.state,[rpe.of(n),upe(e,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(spe,!1))return!1;let t=[];for(let n of ipe(e)){let r=ape(e.state,n.from,n.to);r&&t.push(ope.of(r),upe(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let o=e.lineBlockAt(r),i=tpe(t,o.from,o.to);i&&n.push(rpe.of(i)),r=(i?e.lineBlockAt(i.to):o).to+1}return n.length&&e.dispatch({effects:cpe(e.state,n)}),!!n.length}},{key:"Ctrl-Alt-]",run:e=>{let t=e.state.field(spe,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,((e,t)=>{n.push(ope.of({from:e,to:t}))})),e.dispatch({effects:n}),!0}}],hpe={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},ppe=Noe.define({combine:e=>bie(e,hpe)});function fpe(e){let t=[spe,_pe];return e&&t.push(ppe.of(e)),t}function mpe(e,t){let{state:n}=e,r=n.facet(ppe),o=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),r=ape(e.state,n.from,n.to);r&&e.dispatch({effects:ope.of(r)}),t.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,o,t);let i=document.createElement("span");return i.textContent=r.placeholderText,i.setAttribute("aria-label",n.phrase("folded code")),i.title=n.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=o,i}const gpe=Xse.replace({widget:new class extends Yse{toDOM(e){return mpe(e,null)}}});class bpe extends Yse{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return mpe(e,this.value)}}const ype={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class vpe extends tde{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}const _pe=Fce.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class xpe{constructor(e,t){let n;function r(e){let t=Fie.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;const o="string"==typeof t.all?t.all:t.all?r(t.all):void 0,i=t.scope;this.scope=i instanceof Ihe?e=>e.prop(Ahe)==i.data:i?e=>e==i:void 0,this.style=she(e.map((e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))}))),{all:o}).style,this.module=n?new Fie(n):null,this.themeType=t.themeType}static define(e,t){return new xpe(e,t||{})}}const wpe=Noe.define(),kpe=Noe.define({combine:e=>e.length?[e[0]]:null});function Cpe(e){let t=e.facet(wpe);return t.length?t:e.facet(kpe)}function Spe(e,t){let n,r=[Epe];return e instanceof xpe&&(e.module&&r.push(Fce.styleModule.of(e.module)),n=e.themeType),(null==t?void 0:t.fallback)?r.push(kpe.of(e)):n?r.push(wpe.computeN([Fce.darkTheme],(t=>t.facet(Fce.darkTheme)==("dark"==n)?[e]:[]))):r.push(wpe.of(e)),r}class Ape{constructor(e){this.markCache=Object.create(null),this.tree=The(e.state),this.decorations=this.buildDeco(e,Cpe(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=The(e.state),n=Cpe(e.state),r=n!=Cpe(e.startState),{viewport:o}=e.view,i=e.changes.mapPos(this.decoratedTo,1);t.length<o.to&&!r&&t.type==this.tree.type&&i>=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=i):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=o.to)}buildDeco(e,t){if(!t||!this.tree.length)return Xse.none;let n=new kie;for(let{from:r,to:o}of e.visibleRanges)ahe(this.tree,t,((e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=Xse.mark({class:r})))}),r,o);return n.finish()}}const Epe=Voe.high(Vae.fromClass(Ape,{decorations:e=>e.decorations})),Ipe=xpe.define([{tag:Che.meta,color:"#404740"},{tag:Che.link,textDecoration:"underline"},{tag:Che.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Che.emphasis,fontStyle:"italic"},{tag:Che.strong,fontWeight:"bold"},{tag:Che.strikethrough,textDecoration:"line-through"},{tag:Che.keyword,color:"#708"},{tag:[Che.atom,Che.bool,Che.url,Che.contentSeparator,Che.labelName],color:"#219"},{tag:[Che.literal,Che.inserted],color:"#164"},{tag:[Che.string,Che.deleted],color:"#a11"},{tag:[Che.regexp,Che.escape,Che.special(Che.string)],color:"#e40"},{tag:Che.definition(Che.variableName),color:"#00f"},{tag:Che.local(Che.variableName),color:"#30a"},{tag:[Che.typeName,Che.namespace],color:"#085"},{tag:Che.className,color:"#167"},{tag:[Che.special(Che.variableName),Che.macroName],color:"#256"},{tag:Che.definition(Che.propertyName),color:"#00c"},{tag:Che.comment,color:"#940"},{tag:Che.invalid,color:"#f00"}]),jpe=Fce.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Tpe=1e4,Bpe="()[]{}",Rpe=Noe.define({combine:e=>bie(e,{afterCursor:!0,brackets:Bpe,maxScanDistance:Tpe,renderMatch:Mpe})}),Npe=Xse.mark({class:"cm-matchingBracket"}),Dpe=Xse.mark({class:"cm-nonmatchingBracket"});function Mpe(e){let t=[],n=e.matched?Npe:Dpe;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}const Ppe=zoe.define({create:()=>Xse.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],r=t.state.facet(Rpe);for(let e of t.state.selection.ranges){if(!e.empty)continue;let o=Upe(t.state,e.head,-1,r)||e.head>0&&Upe(t.state,e.head-1,1,r)||r.afterCursor&&(Upe(t.state,e.head,1,r)||e.head<t.state.doc.length&&Upe(t.state,e.head+1,-1,r));o&&(n=n.concat(r.renderMatch(o,t.state)))}return Xse.set(n,!0)},provide:e=>Fce.decorations.from(e)}),Ope=[Ppe,jpe],Lpe=new Sde;function Fpe(e,t,n){let r=e.prop(t<0?Sde.openedBy:Sde.closedBy);if(r)return r;if(1==e.name.length){let r=n.indexOf(e.name);if(r>-1&&r%2==(t<0?1:0))return[n[r+t]]}return null}function zpe(e){let t=e.type.prop(Lpe);return t?t(e.node):e}function Upe(e,t,n,r={}){let o=r.maxScanDistance||Tpe,i=r.brackets||Bpe,s=The(e),a=s.resolveInner(t,n);for(let e=a;e;e=e.parent){let r=Fpe(e.type,n,i);if(r&&e.from<e.to){let o=zpe(e);if(o&&(n>0?t>=o.from&&t<o.to:t>o.from&&t<=o.to))return Vpe(0,0,n,e,o,r,i)}}return function(e,t,n,r,o,i,s){let a=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=s.indexOf(a);if(l<0||l%2==0!=n>0)return null;let c={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let e=0;!u.next().done&&e<=i;){let i=u.value;n<0&&(e+=i.length);let a=t+e*n;for(let e=n>0?0:i.length-1,t=n>0?i.length:-1;e!=t;e+=n){let t=s.indexOf(i[e]);if(!(t<0||r.resolveInner(a+e,1).type!=o))if(t%2==0==n>0)d++;else{if(1==d)return{start:c,end:{from:a+e,to:a+e+1},matched:t>>1==l>>1};d--}}n>0&&(e+=i.length)}return u.done?{start:c,matched:!1}:null}(e,t,n,s,a.type,o,i)}function Vpe(e,t,n,r,o,i,s){let a=r.parent,l={from:o.from,to:o.to},c=0,u=null==a?void 0:a.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do{if(n<0?u.to<=r.from:u.from>=r.to){if(0==c&&i.indexOf(u.type.name)>-1&&u.from<u.to){let e=zpe(u);return{start:l,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}if(Fpe(u.type,n,s))c++;else if(Fpe(u.type,-n,s)){if(0==c){let e=zpe(u);return{start:l,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}c--}}}while(n<0?u.prevSibling():u.nextSibling());return{start:l,matched:!1}}const Hpe=Object.create(null),$pe=[Ide.none],Wpe=[],Gpe=Object.create(null),qpe=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])qpe[e]=Ype(Hpe,t);function Kpe(e,t){Wpe.indexOf(e)>-1||(Wpe.push(e),console.warn(t))}function Ype(e,t){let n=[];for(let r of t.split(" ")){let t=[];for(let n of r.split(".")){let r=e[n]||Che[n];r?"function"==typeof r?t.length?t=t.map(r):Kpe(n,`Modifier ${n} used at start of tag`):t.length?Kpe(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:Kpe(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,"_"),o=r+" "+n.map((e=>e.id)),i=Gpe[o];if(i)return i.id;let s=Gpe[o]=Ide.define({id:$pe.length,name:r,props:[rhe({[r]:n})]});return $pe.push(s),s.id}function Jpe(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let o=e(t,n);return!!o&&(r(n.update(o)),!0)}}sae.RTL,sae.LTR;const Xpe=Jpe(rfe,0),Zpe=Jpe(nfe,0),Qpe=Jpe(((e,t)=>nfe(e,t,function(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),o=n.to<=r.to?r:e.doc.lineAt(n.to),i=t.length-1;i>=0&&t[i].to>r.from?t[i].to=o.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:o.to})}return t}(t))),0);function efe(e,t){let n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}const tfe=50;function nfe(e,t,n=t.selection.ranges){let r=n.map((e=>efe(t,e.from).block));if(!r.every((e=>e)))return null;let o=n.map(((e,n)=>function(e,{open:t,close:n},r,o){let i,s,a=e.sliceDoc(r-tfe,r),l=e.sliceDoc(o,o+tfe),c=/\s*$/.exec(a)[0].length,u=/^\s*/.exec(l)[0].length,d=a.length-c;if(a.slice(d-t.length,d)==t&&l.slice(u,u+n.length)==n)return{open:{pos:r-c,margin:c&&1},close:{pos:o+u,margin:u&&1}};o-r<=2*tfe?i=s=e.sliceDoc(r,o):(i=e.sliceDoc(r,r+tfe),s=e.sliceDoc(o-tfe,o));let h=/^\s*/.exec(i)[0].length,p=/\s*$/.exec(s)[0].length,f=s.length-p-n.length;return i.slice(h,h+t.length)==t&&s.slice(f,f+n.length)==n?{open:{pos:r+h+t.length,margin:/\s/.test(i.charAt(h+t.length))?1:0},close:{pos:o-p-n.length,margin:/\s/.test(s.charAt(f-1))?1:0}}:null}(t,r[n],e.from,e.to)));if(2!=e&&!o.every((e=>e)))return{changes:t.changes(n.map(((e,t)=>o[t]?[]:[{from:e.from,insert:r[t].open+" "},{from:e.to,insert:" "+r[t].close}])))};if(1!=e&&o.some((e=>e))){let e=[];for(let t,n=0;n<o.length;n++)if(t=o[n]){let o=r[n],{open:i,close:s}=t;e.push({from:i.pos-o.open.length,to:i.pos+i.margin},{from:s.pos-s.margin,to:s.pos+o.close.length})}return{changes:e}}return null}function rfe(e,t,n=t.selection.ranges){let r=[],o=-1;for(let{from:e,to:i}of n){let n=r.length,s=1e9,a=efe(t,e).line;if(a){for(let n=e;n<=i;){let l=t.doc.lineAt(n);if(l.from>o&&(e==i||i>l.from)){o=l.from;let e=/^\s*/.exec(l.text)[0].length,t=e==l.length,n=l.text.slice(e,e+a.length)==a?e:-1;e<l.text.length&&e<s&&(s=e),r.push({line:l,comment:n,token:a,indent:e,empty:t,single:!1})}n=l.to+1}if(s<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=s);r.length==n+1&&(r[n].single=!0)}}if(2!=e&&r.some((e=>e.comment<0&&(!e.empty||e.single)))){let e=[];for(let{line:t,token:n,indent:o,empty:i,single:s}of r)!s&&i||e.push({from:t.from+o,insert:n+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&r.some((e=>e.comment>=0))){let e=[];for(let{line:t,comment:n,token:o}of r)if(n>=0){let r=t.from+n,i=r+o.length;" "==t.text[i-t.from]&&i++,e.push({from:r,to:i})}return{changes:e}}return null}const ofe=nie.define(),ife=nie.define(),sfe=Noe.define(),afe=Noe.define({combine:e=>bie(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}),lfe=zoe.define({create:()=>Cfe.empty,update(e,t){let n=t.state.facet(afe),r=t.annotation(ofe);if(r){let o=ffe.fromTransaction(t,r.selection),i=r.side,s=0==i?e.undone:e.done;return s=o?mfe(s,s.length,n.minDepth,o):vfe(s,t.startState.selection),new Cfe(0==i?r.rest:s,0==i?s:r.rest)}let o=t.annotation(ife);if("full"!=o&&"before"!=o||(e=e.isolate()),!1===t.annotation(sie.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let i=ffe.fromTransaction(t),s=t.annotation(sie.time),a=t.annotation(sie.userEvent);return i?e=e.addChanges(i,s,a,n,t):t.selection&&(e=e.addSelection(t.startState.selection,s,a,n.newGroupDelay)),"full"!=o&&"after"!=o||(e=e.isolate()),e},toJSON:e=>({done:e.done.map((e=>e.toJSON())),undone:e.undone.map((e=>e.toJSON()))}),fromJSON:e=>new Cfe(e.done.map(ffe.fromJSON),e.undone.map(ffe.fromJSON))});function cfe(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let o=n.field(lfe,!1);if(!o)return!1;let i=o.pop(e,n,t);return!!i&&(r(i),!0)}}const ufe=cfe(0,!1),dfe=cfe(1,!1),hfe=cfe(0,!0),pfe=cfe(1,!0);class ffe{constructor(e,t,n,r,o){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=o}setSelAfter(e){return new ffe(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map((e=>e.toJSON()))}}static fromJSON(e){return new ffe(e.changes&&woe.fromJSON(e.changes),[],e.mapped&&xoe.fromJSON(e.mapped),e.startSelection&&Toe.fromJSON(e.startSelection),e.selectionsAfter.map(Toe.fromJSON))}static fromTransaction(e,t){let n=bfe;for(let t of e.startState.facet(sfe)){let r=t(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new ffe(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,bfe)}static selection(e){return new ffe(void 0,bfe,void 0,void 0,e)}}function mfe(e,t,n,r){let o=t+1>n+20?t-n-1:0,i=e.slice(o,t);return i.push(r),i}function gfe(e,t){return e.length?t.length?e.concat(t):e:t}const bfe=[],yfe=200;function vfe(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-yfe));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),mfe(e,e.length-1,1e9,n.setSelAfter(r)))}return[ffe.selection([t])]}function _fe(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function xfe(e,t){if(!e.length)return e;let n=e.length,r=bfe;for(;n;){let o=wfe(e[n-1],t,r);if(o.changes&&!o.changes.empty||o.effects.length){let t=e.slice(0,n);return t[n-1]=o,t}t=o.mapped,n--,r=o.selectionsAfter}return r.length?[ffe.selection(r)]:bfe}function wfe(e,t,n){let r=gfe(e.selectionsAfter.length?e.selectionsAfter.map((e=>e.map(t))):bfe,n);if(!e.changes)return ffe.selection(r);let o=e.changes.map(t),i=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(i):i;return new ffe(o,iie.mapEffects(e.effects,t),s,e.startSelection.map(i),r)}const kfe=/^(input\.type|delete)($|\.)/;class Cfe{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new Cfe(this.done,this.undone):this}addChanges(e,t,n,r,o){let i=this.done,s=i[i.length-1];return i=s&&s.changes&&!s.changes.empty&&e.changes&&(!n||kfe.test(n))&&(!s.selectionsAfter.length&&t-this.prevTime<r.newGroupDelay&&r.joinToEvent(o,function(e,t){let n=[],r=!1;return e.iterChangedRanges(((e,t)=>n.push(e,t))),t.iterChangedRanges(((e,t,o,i)=>{for(let e=0;e<n.length;){let t=n[e++],s=n[e++];i>=t&&o<=s&&(r=!0)}})),r}(s.changes,e.changes))||"input.type.compose"==n)?mfe(i,i.length-1,r.minDepth,new ffe(e.changes.compose(s.changes),gfe(e.effects,s.effects),s.mapped,s.startSelection,bfe)):mfe(i,i.length,r.minDepth,e),new Cfe(i,bfe,t,n)}addSelection(e,t,n,r){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:bfe;return o.length>0&&t-this.prevTime<r&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&function(e,t){return e.ranges.length==t.ranges.length&&0===e.ranges.filter(((e,n)=>e.empty!=t.ranges[n].empty)).length}(o[o.length-1],e)?this:new Cfe(vfe(this.done,e),this.undone,t,n)}addMapping(e){return new Cfe(xfe(this.done,e),xfe(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=0==e?this.done:this.undone;if(0==r.length)return null;let o=r[r.length-1],i=o.selectionsAfter[0]||t.selection;if(n&&o.selectionsAfter.length)return t.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:ofe.of({side:e,rest:_fe(r),selection:i}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let n=1==r.length?bfe:r.slice(0,r.length-1);return o.mapped&&(n=xfe(n,o.mapped)),t.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:ofe.of({side:e,rest:n,selection:i}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}return null}}Cfe.empty=new Cfe(bfe,bfe);const Sfe=[{key:"Mod-z",run:ufe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:dfe,preventDefault:!0},{linux:"Ctrl-Shift-z",run:dfe,preventDefault:!0},{key:"Mod-u",run:hfe,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:pfe,preventDefault:!0}];function Afe(e,t){return Toe.create(e.ranges.map(t),e.mainIndex)}function Efe(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Ife({state:e,dispatch:t},n){let r=Afe(e.selection,n);return!r.eq(e.selection,!0)&&(t(Efe(e,r)),!0)}function jfe(e,t){return Toe.cursor(t?e.to:e.from)}function Tfe(e,t){return Ife(e,(n=>n.empty?e.moveByChar(n,t):jfe(n,t)))}function Bfe(e){return e.textDirectionAt(e.state.selection.main.head)==sae.LTR}const Rfe=e=>Tfe(e,!Bfe(e)),Nfe=e=>Tfe(e,Bfe(e));function Dfe(e,t){return Ife(e,(n=>n.empty?e.moveByGroup(n,t):jfe(n,t)))}function Mfe(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function Pfe(e,t,n){let r,o,i=The(e).resolveInner(t.head),s=n?Sde.closedBy:Sde.openedBy;for(let r=t.head;;){let t=n?i.childAfter(r):i.childBefore(r);if(!t)break;Mfe(e,t,s)?i=t:r=n?t.to:t.from}return o=i.type.prop(s)&&(r=n?Upe(e,i.from,1):Upe(e,i.to,-1))&&r.matched?n?r.end.to:r.end.from:n?i.to:i.from,Toe.cursor(o,n?-1:1)}function Ofe(e,t){return Ife(e,(n=>{if(!n.empty)return jfe(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)}))}"undefined"!=typeof Intl&&Intl.Segmenter;const Lfe=e=>Ofe(e,!1),Ffe=e=>Ofe(e,!0);function zfe(e){let t,n=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,r=0,o=0;if(n){for(let t of e.state.facet(Fce.scrollMargins)){let n=t(e);(null==n?void 0:n.top)&&(r=Math.max(null==n?void 0:n.top,r)),(null==n?void 0:n.bottom)&&(o=Math.max(null==n?void 0:n.bottom,o))}t=e.scrollDOM.clientHeight-r-o}else t=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:r,marginBottom:o,selfScroll:n,height:Math.max(e.defaultLineHeight,t-5)}}function Ufe(e,t){let n,r=zfe(e),{state:o}=e,i=Afe(o.selection,(n=>n.empty?e.moveVertically(n,t,r.height):jfe(n,t)));if(i.eq(o.selection))return!1;if(r.selfScroll){let t=e.coordsAtPos(o.selection.main.head),s=e.scrollDOM.getBoundingClientRect(),a=s.top+r.marginTop,l=s.bottom-r.marginBottom;t&&t.top>a&&t.bottom<l&&(n=Fce.scrollIntoView(i.main.head,{y:"start",yMargin:t.top-a}))}return e.dispatch(Efe(o,i),{effects:n}),!0}const Vfe=e=>Ufe(e,!1),Hfe=e=>Ufe(e,!0);function $fe(e,t,n){let r=e.lineBlockAt(t.head),o=e.moveToLineBoundary(t,n);if(o.head==t.head&&o.head!=(n?r.to:r.from)&&(o=e.moveToLineBoundary(t,n,!1)),!n&&o.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(o=Toe.cursor(r.from+n))}return o}function Wfe(e,t){let n=Afe(e.state.selection,(e=>{let n=t(e);return Toe.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)}));return!n.eq(e.state.selection)&&(e.dispatch(Efe(e.state,n)),!0)}function Gfe(e,t){return Wfe(e,(n=>e.moveByChar(n,t)))}const qfe=e=>Gfe(e,!Bfe(e)),Kfe=e=>Gfe(e,Bfe(e));function Yfe(e,t){return Wfe(e,(n=>e.moveByGroup(n,t)))}function Jfe(e,t){return Wfe(e,(n=>e.moveVertically(n,t)))}const Xfe=e=>Jfe(e,!1),Zfe=e=>Jfe(e,!0);function Qfe(e,t){return Wfe(e,(n=>e.moveVertically(n,t,zfe(e).height)))}const eme=e=>Qfe(e,!1),tme=e=>Qfe(e,!0),nme=({state:e,dispatch:t})=>(t(Efe(e,{anchor:0})),!0),rme=({state:e,dispatch:t})=>(t(Efe(e,{anchor:e.doc.length})),!0),ome=({state:e,dispatch:t})=>(t(Efe(e,{anchor:e.selection.main.anchor,head:0})),!0),ime=({state:e,dispatch:t})=>(t(Efe(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function sme(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,o=r.changeByRange((r=>{let{from:o,to:i}=r;if(o==i){let s=t(r);s<o?(n="delete.backward",s=ame(e,s,!1)):s>o&&(n="delete.forward",s=ame(e,s,!0)),o=Math.min(o,s),i=Math.max(i,s)}else o=ame(e,o,!1),i=ame(e,i,!0);return o==i?{range:r}:{changes:{from:o,to:i},range:Toe.cursor(o,o<r.head?-1:1)}}));return!o.changes.empty&&(e.dispatch(r.update(o,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?Fce.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function ame(e,t,n){if(e instanceof Fce)for(let r of e.state.facet(Fce.atomicRanges).map((t=>t(e))))r.between(t,t,((e,r)=>{e<t&&r>t&&(t=n?r:e)}));return t}const lme=(e,t,n)=>sme(e,(r=>{let o,i,s=r.from,{state:a}=e,l=a.doc.lineAt(s);if(n&&!t&&s>l.from&&s<l.from+200&&!/[^ \t]/.test(o=l.text.slice(0,s-l.from))){if("\t"==o[o.length-1])return s-1;let e=Die(o,a.tabSize)%Vhe(a)||Vhe(a);for(let t=0;t<e&&" "==o[o.length-1-t];t++)s--;i=s}else i=doe(l.text,s-l.from,t,t)+l.from,i==s&&l.number!=(t?a.doc.lines:1)?i+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(l.text.slice(i-l.from,s-l.from))&&(i=doe(l.text,i-l.from,!1,!1)+l.from);return i})),cme=e=>lme(e,!1,!0),ume=e=>lme(e,!0,!1),dme=(e,t)=>sme(e,(n=>{let r=n.head,{state:o}=e,i=o.doc.lineAt(r),s=o.charCategorizer(r);for(let e=null;;){if(r==(t?i.to:i.from)){r==n.head&&i.number!=(t?o.doc.lines:1)&&(r+=t?1:-1);break}let a=doe(i.text,r-i.from,t)+i.from,l=i.text.slice(Math.min(r,a)-i.from,Math.max(r,a)-i.from),c=s(l);if(null!=e&&c!=e)break;" "==l&&r==n.head||(e=c),r=a}return r})),hme=e=>dme(e,!1);function pme(e){let t=[],n=-1;for(let r of e.selection.ranges){let o=e.doc.lineAt(r.from),i=e.doc.lineAt(r.to);if(r.empty||r.to!=i.from||(i=e.doc.lineAt(r.to-1)),n>=o.number){let e=t[t.length-1];e.to=i.to,e.ranges.push(r)}else t.push({from:o.from,to:i.to,ranges:[r]});n=i.number+1}return t}function fme(e,t,n){if(e.readOnly)return!1;let r=[],o=[];for(let t of pme(e)){if(n?t.to==e.doc.length:0==t.from)continue;let i=e.doc.lineAt(n?t.to+1:t.from-1),s=i.length+1;if(n){r.push({from:t.to,to:i.to},{from:t.from,insert:i.text+e.lineBreak});for(let n of t.ranges)o.push(Toe.range(Math.min(e.doc.length,n.anchor+s),Math.min(e.doc.length,n.head+s)))}else{r.push({from:i.from,to:t.from},{from:t.to,insert:e.lineBreak+i.text});for(let e of t.ranges)o.push(Toe.range(e.anchor-s,e.head-s))}}return!!r.length&&(t(e.update({changes:r,scrollIntoView:!0,selection:Toe.create(o,e.selection.mainIndex),userEvent:"move.line"})),!0)}function mme(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of pme(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});return t(e.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const gme=yme(!1),bme=yme(!0);function yme(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange((n=>{let{from:r,to:o}=n,i=t.doc.lineAt(r),s=!e&&r==o&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n,r=The(e).resolveInner(t),o=r.childBefore(t),i=r.childAfter(t);return o&&i&&o.to<=t&&i.from>=t&&(n=o.type.prop(Sde.closedBy))&&n.indexOf(i.name)>-1&&e.doc.lineAt(o.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(o.to,i.from))?{from:o.to,to:i.from}:null}(t,r);e&&(r=o=(o<=i.to?i:t.doc.lineAt(o)).to);let a=new Whe(t,{simulateBreak:r,simulateDoubleBreak:!!s}),l=$he(a,r);for(null==l&&(l=Die(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize));o<i.to&&/\s/.test(i.text[o-i.from]);)o++;s?({from:r,to:o}=s):r>i.from&&r<i.from+100&&!/\S/.test(i.text.slice(0,r))&&(r=i.from);let c=["",Hhe(t,l)];return s&&c.push(Hhe(t,a.lineIndent(i.from,-1))),{changes:{from:r,to:o,insert:Xre.of(c)},range:Toe.cursor(r+1+c[1].length)}}));return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function vme(e,t){let n=-1;return e.changeByRange((r=>{let o=[];for(let i=r.from;i<=r.to;){let s=e.doc.lineAt(i);s.number>n&&(r.empty||r.to>s.from)&&(t(s,o,r),n=s.number),i=s.to+1}let i=e.changes(o);return{changes:o,range:Toe.range(i.mapPos(r.anchor,1),i.mapPos(r.head,1))}}))}const _me=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(vme(e,((t,n)=>{n.push({from:t.from,insert:e.facet(Uhe)})})),{userEvent:"input.indent"})),!0),xme=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(vme(e,((t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let o=Die(r,e.tabSize),i=0,s=Hhe(e,Math.max(0,o-Vhe(e)));for(;i<r.length&&i<s.length&&r.charCodeAt(i)==s.charCodeAt(i);)i++;n.push({from:t.from+i,to:t.from+r.length,insert:s.slice(i)})})),{userEvent:"delete.dedent"})),!0),wme=[{key:"ArrowLeft",run:Rfe,shift:qfe,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>Dfe(e,!Bfe(e)),shift:e=>Yfe(e,!Bfe(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>Ife(e,(t=>$fe(e,t,!Bfe(e)))),shift:e=>Wfe(e,(t=>$fe(e,t,!Bfe(e)))),preventDefault:!0},{key:"ArrowRight",run:Nfe,shift:Kfe,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>Dfe(e,Bfe(e)),shift:e=>Yfe(e,Bfe(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>Ife(e,(t=>$fe(e,t,Bfe(e)))),shift:e=>Wfe(e,(t=>$fe(e,t,Bfe(e)))),preventDefault:!0},{key:"ArrowUp",run:Lfe,shift:Xfe,preventDefault:!0},{mac:"Cmd-ArrowUp",run:nme,shift:ome},{mac:"Ctrl-ArrowUp",run:Vfe,shift:eme},{key:"ArrowDown",run:Ffe,shift:Zfe,preventDefault:!0},{mac:"Cmd-ArrowDown",run:rme,shift:ime},{mac:"Ctrl-ArrowDown",run:Hfe,shift:tme},{key:"PageUp",run:Vfe,shift:eme},{key:"PageDown",run:Hfe,shift:tme},{key:"Home",run:e=>Ife(e,(t=>$fe(e,t,!1))),shift:e=>Wfe(e,(t=>$fe(e,t,!1))),preventDefault:!0},{key:"Mod-Home",run:nme,shift:ome},{key:"End",run:e=>Ife(e,(t=>$fe(e,t,!0))),shift:e=>Wfe(e,(t=>$fe(e,t,!0))),preventDefault:!0},{key:"Mod-End",run:rme,shift:ime},{key:"Enter",run:gme},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:cme,shift:cme},{key:"Delete",run:ume},{key:"Mod-Backspace",mac:"Alt-Backspace",run:hme},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>dme(e,!0)},{mac:"Mod-Backspace",run:e=>sme(e,(t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}))},{mac:"Mod-Delete",run:e=>sme(e,(t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}))}].concat([{key:"Ctrl-b",run:Rfe,shift:qfe,preventDefault:!0},{key:"Ctrl-f",run:Nfe,shift:Kfe},{key:"Ctrl-p",run:Lfe,shift:Xfe},{key:"Ctrl-n",run:Ffe,shift:Zfe},{key:"Ctrl-a",run:e=>Ife(e,(t=>Toe.cursor(e.lineBlockAt(t.head).from,1))),shift:e=>Wfe(e,(t=>Toe.cursor(e.lineBlockAt(t.head).from)))},{key:"Ctrl-e",run:e=>Ife(e,(t=>Toe.cursor(e.lineBlockAt(t.head).to,-1))),shift:e=>Wfe(e,(t=>Toe.cursor(e.lineBlockAt(t.head).to)))},{key:"Ctrl-d",run:ume},{key:"Ctrl-h",run:cme},{key:"Ctrl-k",run:e=>sme(e,(t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}))},{key:"Ctrl-Alt-h",run:hme},{key:"Ctrl-o",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange((e=>({changes:{from:e.from,to:e.to,insert:Xre.of(["",""])},range:Toe.cursor(e.from)})));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange((t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),o=n==r.from?n-1:doe(r.text,n-r.from,!1)+r.from,i=n==r.to?n+1:doe(r.text,n-r.from,!0)+r.from;return{changes:{from:o,to:i,insert:e.doc.slice(n,i).append(e.doc.slice(o,n))},range:Toe.cursor(i)}}));return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:Hfe}].map((e=>({mac:e.key,run:e.run,shift:e.shift})))),kme=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>Ife(e,(t=>Pfe(e.state,t,!Bfe(e)))),shift:e=>Wfe(e,(t=>Pfe(e.state,t,!Bfe(e))))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>Ife(e,(t=>Pfe(e.state,t,Bfe(e)))),shift:e=>Wfe(e,(t=>Pfe(e.state,t,Bfe(e))))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>fme(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>mme(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>fme(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>mme(e,t,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=Toe.create([n.main]):n.main.empty||(r=Toe.create([Toe.cursor(n.main.head)])),!!r&&(t(Efe(e,r)),!0)}},{key:"Mod-Enter",run:bme},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=pme(e).map((({from:t,to:n})=>Toe.range(t,Math.min(n+1,e.doc.length))));return t(e.update({selection:Toe.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=Afe(e.selection,(t=>{var n;for(let r=The(e).resolveStack(t.from,1);r;r=r.next){let{node:e}=r;if((e.from<t.from&&e.to>=t.to||e.to>t.to&&e.from<=t.from)&&(null===(n=e.parent)||void 0===n?void 0:n.parent))return Toe.range(e.to,e.from)}return t}));return t(Efe(e,n)),!0},preventDefault:!0},{key:"Mod-[",run:xme},{key:"Mod-]",run:_me},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new Whe(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),o=vme(e,((t,o,i)=>{let s=$he(r,t.from);if(null==s)return;/\S/.test(t.text)||(s=0);let a=/^\s*/.exec(t.text)[0],l=Hhe(e,s);(a!=l||i.from<t.from+a.length)&&(n[t.from]=s,o.push({from:t.from,to:t.from+a.length,insert:l}))}));return o.changes.empty||t(e.update(o,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(pme(t).map((({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n})))),r=Afe(t.selection,(t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),o=e.coordsAtPos(t.head,t.assoc||1);o&&(n=r.bottom+e.documentTop-o.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)})).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>function(e,t,n){let r=!1,o=Afe(e.selection,(t=>{let o=Upe(e,t.head,-1)||Upe(e,t.head,1)||t.head>0&&Upe(e,t.head-1,1)||t.head<e.doc.length&&Upe(e,t.head+1,-1);if(!o||!o.end)return t;r=!0;let i=o.start.from==t.head?o.end.to:o.end.from;return n?Toe.range(t.anchor,i):Toe.cursor(i)}));return!!r&&(t(Efe(e,o)),!0)}(e,t,!1)},{key:"Mod-/",run:e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=efe(e.state,n.from);return r.line?Xpe(e):!!r.block&&Qpe(e)}},{key:"Alt-A",run:Zpe},{key:"Ctrl-m",mac:"Shift-Alt-m",run:e=>(e.setTabFocusMode(),!0)}].concat(wme),Cme={key:"Tab",run:_me,shift:xme};function Sme(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var o=n[r];"string"==typeof o?e.setAttribute(r,o):null!=o&&(e[r]=o)}t++}for(;t<arguments.length;t++)Ame(e,arguments[t]);return e}function Ame(e,t){if("string"==typeof t)e.appendChild(document.createTextNode(t));else if(null==t);else if(null!=t.nodeType)e.appendChild(t);else{if(!Array.isArray(t))throw new RangeError("Unsupported child node: "+t);for(var n=0;n<t.length;n++)Ame(e,t[n])}}const Eme="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class Ime{constructor(e,t,n=0,r=e.length,o,i){this.test=i,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=o?e=>o(Eme(e)):Eme,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return goe(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=boe(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=yoe(e);let r=this.normalize(t);for(let e=0,o=n;;e++){let i=r.charCodeAt(e),s=this.match(i,o,this.bufferPos+this.bufferStart);if(e==r.length-1){if(s)return this.value=s,this;break}o==n&&e<t.length&&t.charCodeAt(e)==i&&o++}}}match(e,t,n){let r=null;for(let t=0;t<this.matches.length;t+=2){let o=this.matches[t],i=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?r={from:this.matches[t+1],to:n}:(this.matches[t]++,i=!0)),i||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(1==this.query.length?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}}"undefined"!=typeof Symbol&&(Ime.prototype[Symbol.iterator]=function(){return this});const jme={from:-1,to:-1,match:/.*/.exec("")},Tme="gm"+(null==/x/.unicode?"":"u");class Bme{constructor(e,t,n,r=0,o=e.length){if(this.text=e,this.to=o,this.curLine="",this.done=!1,this.value=jme,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new Dme(e,t,n,r,o);this.re=new RegExp(t,Tme+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.iter=e.iter();let i=e.lineAt(r);this.curLineStart=i.from,this.matchPos=Mme(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=Mme(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),e=0}}}}const Rme=new WeakMap;class Nme{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let r=Rme.get(e);if(!r||r.from>=n||r.to<=t){let r=new Nme(t,e.sliceString(t,n));return Rme.set(e,r),r}if(r.from==t&&r.to==n)return r;let{text:o,from:i}=r;return i>t&&(o=e.sliceString(t,i)+o,i=t),r.to<n&&(o+=e.sliceString(r.to,n)),Rme.set(e,new Nme(i,o)),new Nme(t,o.slice(t-i,n-i))}}class Dme{constructor(e,t,n,r,o){this.text=e,this.to=o,this.done=!1,this.value=jme,this.matchPos=Mme(e,r),this.re=new RegExp(t,Tme+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.flat=Nme.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=Mme(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Nme.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function Mme(e,t){if(t>=e.length)return t;let n,r=e.lineAt(t);for(;t<r.to&&(n=r.text.charCodeAt(t-r.from))>=56320&&n<57344;)t++;return t}function Pme(e){let t=Sme("input",{class:"cm-textfield",name:"line",value:String(e.state.doc.lineAt(e.state.selection.main.head).number)});function n(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!n)return;let{state:r}=e,o=r.doc.lineAt(r.selection.main.head),[,i,s,a,l]=n,c=a?+a.slice(1):0,u=s?+s:o.number;if(s&&l){let e=u/100;i&&(e=e*("-"==i?-1:1)+o.number/r.doc.lines),u=Math.round(r.doc.lines*e)}else s&&i&&(u=u*("-"==i?-1:1)+o.number);let d=r.doc.line(Math.max(1,Math.min(r.doc.lines,u))),h=Toe.cursor(d.from+Math.max(0,Math.min(c,d.length)));e.dispatch({effects:[Ome.of(!1),Fce.scrollIntoView(h.from,{y:"center"})],selection:h}),e.focus()}return{dom:Sme("form",{class:"cm-gotoLine",onkeydown:t=>{27==t.keyCode?(t.preventDefault(),e.dispatch({effects:Ome.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),n())},onsubmit:e=>{e.preventDefault(),n()}},Sme("label",e.state.phrase("Go to line"),": ",t)," ",Sme("button",{class:"cm-button",type:"submit"},e.state.phrase("go")))}}"undefined"!=typeof Symbol&&(Bme.prototype[Symbol.iterator]=Dme.prototype[Symbol.iterator]=function(){return this});const Ome=iie.define(),Lme=zoe.define({create:()=>!0,update(e,t){for(let n of t.effects)n.is(Ome)&&(e=n.value);return e},provide:e=>ede.from(e,(e=>e?Pme:null))}),Fme=Fce.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),zme={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Ume=Noe.define({combine:e=>bie(e,zme,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),Vme=Xse.mark({class:"cm-selectionMatch"}),Hme=Xse.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function $me(e,t,n,r){return!(0!=n&&e(t.sliceDoc(n-1,n))==pie.Word||r!=t.doc.length&&e(t.sliceDoc(r,r+1))==pie.Word)}const Wme=Vae.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(Ume),{state:n}=e,r=n.selection;if(r.ranges.length>1)return Xse.none;let o,i=r.main,s=null;if(i.empty){if(!t.highlightWordAroundCursor)return Xse.none;let e=n.wordAt(i.head);if(!e)return Xse.none;s=n.charCategorizer(i.head),o=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return Xse.none;if(t.wholeWords){if(o=n.sliceDoc(i.from,i.to),s=n.charCategorizer(i.head),!$me(s,n,i.from,i.to)||!function(e,t,n,r){return e(t.sliceDoc(n,n+1))==pie.Word&&e(t.sliceDoc(r-1,r))==pie.Word}(s,n,i.from,i.to))return Xse.none}else if(o=n.sliceDoc(i.from,i.to),!o)return Xse.none}let a=[];for(let r of e.visibleRanges){let e=new Ime(n.doc,o,r.from,r.to);for(;!e.next().done;){let{from:r,to:o}=e.value;if((!s||$me(s,n,r,o))&&(i.empty&&r<=i.from&&o>=i.to?a.push(Hme.range(r,o)):(r>=i.to||o<=i.from)&&a.push(Vme.range(r,o)),a.length>t.maxMatches))return Xse.none}}return Xse.set(a)}},{decorations:e=>e.decorations}),Gme=Fce.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),qme=Noe.define({combine:e=>bie(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new wge(e),scrollToMatch:e=>Fce.scrollIntoView(e)})});class Kme{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,Tme),!0}catch(e){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,((e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"))}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new tge(this):new Xme(this)}getCursor(e,t=0,n){let r=e.doc?e:gie.create({doc:e});return null==n&&(n=r.doc.length),this.regexp?Zme(this,r,t,n):Jme(this,r,t,n)}}class Yme{constructor(e){this.spec=e}}function Jme(e,t,n,r){return new Ime(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?function(e,t){return(n,r,o,i)=>((i>n||i+o.length<r)&&(i=Math.max(0,n-2),o=e.sliceString(i,Math.min(e.length,r+2))),!(t(Qme(o,n-i))==pie.Word&&t(ege(o,n-i))==pie.Word||t(ege(o,r-i))==pie.Word&&t(Qme(o,r-i))==pie.Word))}(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}class Xme extends Yme{constructor(e){super(e)}nextMatch(e,t,n){let r=Jme(this.spec,e,n,e.doc.length).nextOverlapping();return r.done&&(r=Jme(this.spec,e,0,t).nextOverlapping()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),o=Jme(this.spec,e,n,r),i=null;for(;!o.nextOverlapping().done;)i=o.value;if(i)return i;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=Jme(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let o=Jme(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!o.next().done;)r(o.value.from,o.value.to)}}function Zme(e,t,n,r){return new Bme(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?(o=t.charCategorizer(t.selection.main.head),(e,t,n)=>!n[0].length||(o(Qme(n.input,n.index))!=pie.Word||o(ege(n.input,n.index))!=pie.Word)&&(o(ege(n.input,n.index+n[0].length))!=pie.Word||o(Qme(n.input,n.index+n[0].length))!=pie.Word)):void 0},n,r);var o}function Qme(e,t){return e.slice(doe(e,t,!1),t)}function ege(e,t){return e.slice(t,doe(e,t))}class tge extends Yme{nextMatch(e,t,n){let r=Zme(this.spec,e,n,e.doc.length).next();return r.done&&(r=Zme(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let o=Math.max(t,n-1e4*r),i=Zme(this.spec,e,o,n),s=null;for(;!i.next().done;)s=i.value;if(s&&(o==t||s.from>o+10))return s;if(o==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,((t,n)=>"$"==n?"$":"&"==n?e.match[0]:"0"!=n&&+n<e.match.length?e.match[n]:t))}matchAll(e,t){let n=Zme(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let o=Zme(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!o.next().done;)r(o.value.from,o.value.to)}}const nge=iie.define(),rge=iie.define(),oge=zoe.define({create:e=>new ige(gge(e).create(),null),update(e,t){for(let n of t.effects)n.is(nge)?e=new ige(n.value.create(),e.panel):n.is(rge)&&(e=new ige(e.query,n.value?mge:null));return e},provide:e=>ede.from(e,(e=>e.panel))});class ige{constructor(e,t){this.query=e,this.panel=t}}const sge=Xse.mark({class:"cm-searchMatch"}),age=Xse.mark({class:"cm-searchMatch cm-searchMatch-selected"}),lge=Vae.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(oge))}update(e){let t=e.state.field(oge);(t!=e.startState.field(oge)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return Xse.none;let{view:n}=this,r=new kie;for(let t=0,o=n.visibleRanges,i=o.length;t<i;t++){let{from:s,to:a}=o[t];for(;t<i-1&&a>o[t+1].from-500;)a=o[++t].to;e.highlight(n.state,s,a,((e,t)=>{let o=n.state.selection.ranges.some((n=>n.from==e&&n.to==t));r.add(e,t,o?age:sge)}))}return r.finish()}},{decorations:e=>e.decorations});function cge(e){return t=>{let n=t.state.field(oge,!1);return n&&n.query.spec.valid?e(t,n):vge(t)}}const uge=cge(((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let o=Toe.single(r.from,r.to),i=e.state.facet(qme);return e.dispatch({selection:o,effects:[Age(e,r),i.scrollToMatch(o.main,e)],userEvent:"select.search"}),yge(e),!0})),dge=cge(((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,o=t.prevMatch(n,r,r);if(!o)return!1;let i=Toe.single(o.from,o.to),s=e.state.facet(qme);return e.dispatch({selection:i,effects:[Age(e,o),s.scrollToMatch(i.main,e)],userEvent:"select.search"}),yge(e),!0})),hge=cge(((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!(!n||!n.length||(e.dispatch({selection:Toe.create(n.map((e=>Toe.range(e.from,e.to)))),userEvent:"select.search.matches"}),0))})),pge=cge(((e,{query:t})=>{let{state:n}=e,{from:r,to:o}=n.selection.main;if(n.readOnly)return!1;let i=t.nextMatch(n,r,r);if(!i)return!1;let s,a,l=[],c=[];if(i.from==r&&i.to==o&&(a=n.toText(t.getReplacement(i)),l.push({from:i.from,to:i.to,insert:a}),i=t.nextMatch(n,i.from,i.to),c.push(Fce.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))),i){let t=0==l.length||l[0].from>=i.to?0:i.to-i.from-a.length;s=Toe.single(i.from-t,i.to-t),c.push(Age(e,i)),c.push(n.facet(qme).scrollToMatch(s.main,e))}return e.dispatch({changes:l,selection:s,effects:c,userEvent:"input.replace"}),!0})),fge=cge(((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map((e=>{let{from:n,to:r}=e;return{from:n,to:r,insert:t.getReplacement(e)}}));if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:Fce.announce.of(r),userEvent:"input.replace.all"}),!0}));function mge(e){return e.state.facet(qme).createPanel(e)}function gge(e,t){var n,r,o,i,s;let a=e.selection.main,l=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!l)return t;let c=e.facet(qme);return new Kme({search:(null!==(n=null==t?void 0:t.literal)&&void 0!==n?n:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!==(r=null==t?void 0:t.caseSensitive)&&void 0!==r?r:c.caseSensitive,literal:null!==(o=null==t?void 0:t.literal)&&void 0!==o?o:c.literal,regexp:null!==(i=null==t?void 0:t.regexp)&&void 0!==i?i:c.regexp,wholeWord:null!==(s=null==t?void 0:t.wholeWord)&&void 0!==s?s:c.wholeWord})}function bge(e){let t=Jue(e,mge);return t&&t.dom.querySelector("[main-field]")}function yge(e){let t=bge(e);t&&t==e.root.activeElement&&t.select()}const vge=e=>{let t=e.state.field(oge,!1);if(t&&t.panel){let n=bge(e);if(n&&n!=e.root.activeElement){let r=gge(e.state,t.query.spec);r.valid&&e.dispatch({effects:nge.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[rge.of(!0),t?nge.of(gge(e.state,t.query.spec)):iie.appendConfig.of(Ige)]});return!0},_ge=e=>{let t=e.state.field(oge,!1);if(!t||!t.panel)return!1;let n=Jue(e,mge);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:rge.of(!1)}),!0},xge=[{key:"Mod-f",run:vge,scope:"editor search-panel"},{key:"F3",run:uge,shift:dge,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:uge,shift:dge,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:_ge,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:o}=n.main,i=[],s=0;for(let t=new Ime(e.doc,e.sliceDoc(r,o));!t.next().done;){if(i.length>1e3)return!1;t.value.from==r&&(s=i.length),i.push(Toe.range(t.value.from,t.value.to))}return t(e.update({selection:Toe.create(i,s),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{let t=Jue(e,Pme);if(!t){let n=[Ome.of(!0)];null==e.state.field(Lme,!1)&&n.push(iie.appendConfig.of([Lme,Fme])),e.dispatch({effects:n}),t=Jue(e,Pme)}return t&&t.dom.querySelector("input").select(),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some((e=>e.from===e.to)))return(({state:e,dispatch:t})=>{let{selection:n}=e,r=Toe.create(n.ranges.map((t=>e.wordAt(t.head)||Toe.cursor(t.head))),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)})({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some((t=>e.sliceDoc(t.from,t.to)!=r)))return!1;let o=function(e,t){let{main:n,ranges:r}=e.selection,o=e.wordAt(n.head),i=o&&o.from==n.from&&o.to==n.to;for(let n=!1,o=new Ime(e.doc,t,r[r.length-1].to);;){if(o.next(),!o.done){if(n&&r.some((e=>e.from==o.value.from)))continue;if(i){let t=e.wordAt(o.value.from);if(!t||t.from!=o.value.from||t.to!=o.value.to)continue}return o.value}if(n)return null;o=new Ime(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}}(e,r);return!!o&&(t(e.update({selection:e.selection.addRange(Toe.range(o.from,o.to),!1),effects:Fce.scrollIntoView(o.to)})),!0)},preventDefault:!0}];class wge{constructor(e){this.view=e;let t=this.query=e.state.field(oge).query.spec;function n(e,t,n){return Sme("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=Sme("input",{value:t.search,placeholder:kge(e,"Find"),"aria-label":kge(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Sme("input",{value:t.replace,placeholder:kge(e,"Replace"),"aria-label":kge(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Sme("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Sme("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Sme("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=Sme("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",(()=>uge(e)),[kge(e,"next")]),n("prev",(()=>dge(e)),[kge(e,"previous")]),n("select",(()=>hge(e)),[kge(e,"all")]),Sme("label",null,[this.caseField,kge(e,"match case")]),Sme("label",null,[this.reField,kge(e,"regexp")]),Sme("label",null,[this.wordField,kge(e,"by word")]),...e.state.readOnly?[]:[Sme("br"),this.replaceField,n("replace",(()=>pge(e)),[kge(e,"replace")]),n("replaceAll",(()=>fge(e)),[kge(e,"replace all")])],Sme("button",{name:"close",onclick:()=>_ge(e),"aria-label":kge(e,"close"),type:"button"},["×"])])}commit(){let e=new Kme({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:nge.of(e)}))}keydown(e){var t,n;n=e,Zce(Kce((t=this.view).state),n,t,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?dge:uge)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),pge(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(nge)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(qme).top}}function kge(e,t){return e.state.phrase(t)}const Cge=30,Sge=/[\s\.,:;?!]/;function Age(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),o=e.state.doc.lineAt(n).to,i=Math.max(r.from,t-Cge),s=Math.min(o,n+Cge),a=e.state.sliceDoc(i,s);if(i!=r.from)for(let e=0;e<Cge;e++)if(!Sge.test(a[e+1])&&Sge.test(a[e])){a=a.slice(e);break}if(s!=o)for(let e=a.length-1;e>a.length-Cge;e--)if(!Sge.test(a[e-1])&&Sge.test(a[e])){a=a.slice(0,e);break}return Fce.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${r.number}.`)}const Ege=Fce.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Ige=[oge,Voe.low(lge),Ege];class jge{constructor(e,t,n){this.state=e,this.pos=t,this.explicit=n,this.abortListeners=[]}tokenBefore(e){let t=The(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),o=r.search(Nge(e,!1));return o<0?null:{from:n+o,to:this.pos,text:r.slice(o)}}get aborted(){return null==this.abortListeners}addEventListener(e,t){"abort"==e&&this.abortListeners&&this.abortListeners.push(t)}}function Tge(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}class Bge{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}}function Rge(e){return e.selection.main.from}function Nge(e,t){var n;let{source:r}=e,o=t&&"^"!=r[0],i="$"!=r[r.length-1];return o||i?new RegExp(`${o?"^":""}(?:${r})${i?"$":""}`,null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}const Dge=nie.define(),Mge=new WeakMap;function Pge(e){if(!Array.isArray(e))return e;let t=Mge.get(e);return t||Mge.set(e,t=function(e){let t=e.map((e=>"string"==typeof e?{label:e}:e)),[n,r]=t.every((e=>/^\w+$/.test(e.label)))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=Tge(t)+Tge(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}(t);return e=>{let o=e.matchBefore(r);return o||e.explicit?{from:o?o.from:e.pos,options:t,validFor:n}:null}}(e)),t}const Oge=iie.define(),Lge=iie.define();class Fge{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=goe(e,t),r=yoe(n);this.chars.push(n);let o=e.slice(t,t+r),i=o.toUpperCase();this.folded.push(goe(i==o?o.toLowerCase():i,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(0==this.pattern.length)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:o,byWord:i}=this;if(1==t.length){let r=goe(e,0),o=yoe(r),i=o==e.length?0:-100;if(r==t[0]);else{if(r!=n[0])return null;i+=-200}return this.ret(i,[0,o])}let s=e.indexOf(this.pattern);if(0==s)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=t.length,l=0;if(s<0){for(let o=0,i=Math.min(e.length,200);o<i&&l<a;){let i=goe(e,o);i!=t[l]&&i!=n[l]||(r[l++]=o),o+=yoe(i)}if(l<a)return null}let c=0,u=0,d=!1,h=0,p=-1,f=-1,m=/[a-z]/.test(e),g=!0;for(let r=0,l=Math.min(e.length,200),b=0;r<l&&u<a;){let l=goe(e,r);s<0&&(c<a&&l==t[c]&&(o[c++]=r),h<a&&(l==t[h]||l==n[h]?(0==h&&(p=r),f=r+1,h++):h=0));let y,v=l<255?l>=48&&l<=57||l>=97&&l<=122?2:l>=65&&l<=90?1:0:(y=boe(l))!=y.toLowerCase()?1:y!=y.toUpperCase()?2:0;(!r||1==v&&m||0==b&&0!=v)&&(t[u]==l||n[u]==l&&(d=!0)?i[u++]=r:i.length&&(g=!1)),b=v,r+=yoe(l)}return u==a&&0==i[0]&&g?this.result((d?-200:0)-100,i,e):h==a&&0==p?this.ret(-200-e.length+(f==e.length?0:-100),[0,f]):s>-1?this.ret(-700-e.length,[s,s+this.pattern.length]):h==a?this.ret(-900-e.length,[p,f]):u==a?this.result((d?-200:0)-100-700+(g?0:-1100),i,e):2==t.length?null:this.result((r[0]?-700:0)-200-1100,r,e)}result(e,t,n){let r=[],o=0;for(let e of t){let t=e+(this.astral?yoe(goe(n,e)):1);o&&r[o-1]==e?r[o-1]=t:(r[o++]=e,r[o++]=t)}return this.ret(e-n.length,r)}}class zge{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return null==n?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}}const Uge=Noe.define({combine:e=>bie(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Hge,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>Vge(e(n),t(n)),optionClass:(e,t)=>n=>Vge(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})});function Vge(e,t){return e?t?e+" "+t:e:t}function Hge(e,t,n,r,o,i){let s,a,l=e.textDirection==sae.RTL,c=l,u=!1,d="top",h=t.left-o.left,p=o.right-t.right,f=r.right-r.left,m=r.bottom-r.top;if(c&&h<Math.min(f,p)?c=!1:!c&&p<Math.min(f,h)&&(c=!0),f<=(c?h:p))s=Math.max(o.top,Math.min(n.top,o.bottom-m))-t.top,a=Math.min(400,c?h:p);else{u=!0,a=Math.min(400,(l?t.right:o.right-t.left)-30);let e=o.bottom-t.bottom;e>=m||e>t.top?s=n.bottom-t.top:(d="bottom",s=t.bottom-n.top)}return{style:`${d}: ${s/((t.bottom-t.top)/i.offsetHeight)}px; max-width: ${a/((t.right-t.left)/i.offsetWidth)}px`,class:"cm-completionInfo-"+(u?l?"left-narrow":"right-narrow":c?"left":"right")}}function $ge(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}class Wge{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let r=e.state.field(t),{options:o,selected:i}=r.open,s=e.state.facet(Uge);this.optionContent=function(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map((e=>"cm-completionIcon-"+e))),t.setAttribute("aria-hidden","true"),t},position:20}),t.push({render(e,t,n,r){let o=document.createElement("span");o.className="cm-completionLabel";let i=e.displayLabel||e.label,s=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>s&&o.appendChild(document.createTextNode(i.slice(s,t)));let a=o.appendChild(document.createElement("span"));a.appendChild(document.createTextNode(i.slice(t,n))),a.className="cm-completionMatchedText",s=n}return s<i.length&&o.appendChild(document.createTextNode(i.slice(s))),o},position:50},{render(e){if(!e.detail)return null;let t=document.createElement("span");return t.className="cm-completionDetail",t.textContent=e.detail,t},position:80}),t.sort(((e,t)=>e.position-t.position)).map((e=>e.render))}(s),this.optionClass=s.optionClass,this.tooltipClass=s.tooltipClass,this.range=$ge(o.length,i,s.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",(n=>{let{options:r}=e.state.field(t).open;for(let t,o=n.target;o&&o!=this.dom;o=o.parentNode)if("LI"==o.nodeName&&(t=/-(\d+)$/.exec(o.id))&&+t[1]<r.length)return this.applyCompletion(e,r[+t[1]]),void n.preventDefault()})),this.dom.addEventListener("focusout",(t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(Uge).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:Lge.of(null)})})),this.showOptions(o,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",(()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)}))}update(e){var t;let n=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=r){let{options:o,selected:i,disabled:s}=n.open;r.open&&r.open.options==o||(this.range=$ge(o.length,i,e.state.facet(Uge).maxRenderedOptions),this.showOptions(o,n.id)),this.updateSel(),s!=(null===(t=r.open)||void 0===t?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!s)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(" "))e&&this.dom.classList.remove(e);for(let e of t.split(" "))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=$ge(t.options.length,t.selected,this.view.state.facet(Uge).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:n}=t.options[t.selected],{info:r}=n;if(!r)return;let o="string"==typeof r?document.createTextNode(r):r(n);if(!o)return;"then"in o?o.then((t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,n)})).catch((e=>Lae(this.view.state,e,"completion info"))):this.addInfoPane(o,n)}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",null!=e.nodeType)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)"LI"==n.nodeName&&n.id?r==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected"):r--;return t&&function(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/o:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/o)}(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),o=this.space;if(!o){let e=this.dom.ownerDocument.defaultView||window;o={left:0,top:0,right:e.innerWidth,bottom:e.innerHeight}}return r.top>Math.min(o.bottom,t.bottom)-10||r.bottom<Math.max(o.top,t.top)+10?null:this.view.state.facet(Uge).positionInfo(this.view,t,r,n,o,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,n){const r=document.createElement("ul");r.id=t,r.setAttribute("role","listbox"),r.setAttribute("aria-expanded","true"),r.setAttribute("aria-label",this.view.state.phrase("Completions"));let o=null;for(let i=n.from;i<n.to;i++){let{completion:s,match:a}=e[i],{section:l}=s;if(l){let e="string"==typeof l?l:l.name;e!=o&&(i>n.from||0==n.from)&&(o=e,"string"!=typeof l&&l.header?r.appendChild(l.header(l)):r.appendChild(document.createElement("completion-section")).textContent=e)}const c=r.appendChild(document.createElement("li"));c.id=t+"-"+i,c.setAttribute("role","option");let u=this.optionClass(s);u&&(c.className=u);for(let e of this.optionContent){let t=e(s,this.view.state,this.view,a);t&&c.appendChild(t)}}return n.from&&r.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&r.classList.add("cm-completionListIncompleteBottom"),r}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function Gge(e,t){return n=>new Wge(n,e,t)}function qge(e){return 100*(e.boost||0)+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}class Kge{constructor(e,t,n,r,o,i){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=o,this.disabled=i}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Kge(this.options,Zge(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,r,o){let i=function(e,t){let n=[],r=null,o=e=>{n.push(e);let{section:t}=e.completion;if(t){r||(r=[]);let e="string"==typeof t?t:t.name;r.some((t=>t.name==e))||r.push("string"==typeof t?{name:e}:t)}},i=t.facet(Uge);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(!1===r.result.filter)for(let t of r.result.options)o(new Bge(t,r.source,e?e(t):[],1e9-n.length));else{let n,s=t.sliceDoc(r.from,r.to),a=i.filterStrict?new zge(s):new Fge(s);for(let t of r.result.options)if(n=a.match(t.label)){let i=t.displayLabel?e?e(t,n.matched):[]:n.matched;o(new Bge(t,r.source,i,n.score+(t.boost||0)))}}}if(r){let e=Object.create(null),t=0,o=(e,t)=>{var n,r;return(null!==(n=e.rank)&&void 0!==n?n:1e9)-(null!==(r=t.rank)&&void 0!==r?r:1e9)||(e.name<t.name?-1:1)};for(let n of r.sort(o))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e["string"==typeof n?n:n.name])}}let s=[],a=null,l=i.compareCompletions;for(let e of n.sort(((e,t)=>t.score-e.score||l(e.completion,t.completion)))){let t=e.completion;!a||a.label!=t.label||a.detail!=t.detail||null!=a.type&&null!=t.type&&a.type!=t.type||a.apply!=t.apply||a.boost!=t.boost?s.push(e):qge(e.completion)>qge(a)&&(s[s.length-1]=e),a=e.completion}return s}(e,t);if(!i.length)return r&&e.some((e=>1==e.state))?new Kge(r.options,r.attrs,r.tooltip,r.timestamp,r.selected,!0):null;let s=t.facet(Uge).selectOnOpen?0:-1;if(r&&r.selected!=s&&-1!=r.selected){let e=r.options[r.selected].completion;for(let t=0;t<i.length;t++)if(i[t].completion==e){s=t;break}}return new Kge(i,Zge(n,s),{pos:e.reduce(((e,t)=>t.hasResult()?Math.min(e,t.from):e),1e8),create:abe,above:o.aboveCursor},r?r.timestamp:Date.now(),s,!1)}map(e){return new Kge(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class Yge{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new Yge(Qge,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(Uge),r=(n.override||t.languageDataAt("autocomplete",Rge(t)).map(Pge)).map((t=>{let r=this.active.find((e=>e.source==t))||new tbe(t,this.active.some((e=>0!=e.state))?1:0);return r.update(e,n)}));r.length==this.active.length&&r.every(((e,t)=>e==this.active[t]))&&(r=this.active);let o=this.open;o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some((t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to)))||!function(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult;)n++;for(;r<t.length&&!t[r].hasResult;)r++;let o=n==e.length,i=r==t.length;if(o||i)return o==i;if(e[n++].result!=t[r++].result)return!1}}(r,this.active)?o=Kge.build(r,t,this.id,o,n):o&&o.disabled&&!r.some((e=>1==e.state))&&(o=null),!o&&r.every((e=>1!=e.state))&&r.some((e=>e.hasResult()))&&(r=r.map((e=>e.hasResult()?new tbe(e.source,0):e)));for(let t of e.effects)t.is(obe)&&(o=o&&o.setSelected(t.value,this.id));return r==this.active&&o==this.open?this:new Yge(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?Jge:Xge}}const Jge={"aria-autocomplete":"list"},Xge={};function Zge(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}const Qge=[];function ebe(e,t){if(e.isUserEvent("input.complete")){let n=e.annotation(Dge);if(n&&t.activateOnCompletion(n))return"input"}return e.isUserEvent("input.type")?"input":e.isUserEvent("delete.backward")?"delete":null}class tbe{constructor(e,t,n=-1){this.source=e,this.state=t,this.explicitPos=n}hasResult(){return!1}update(e,t){let n=ebe(e,t),r=this;n?r=r.handleUserEvent(e,n,t):e.docChanged?r=r.handleChange(e):e.selection&&0!=r.state&&(r=new tbe(r.source,0));for(let t of e.effects)if(t.is(Oge))r=new tbe(r.source,1,t.value?Rge(e.state):-1);else if(t.is(Lge))r=new tbe(r.source,0);else if(t.is(rbe))for(let e of t.value)e.source==r.source&&(r=e);return r}handleUserEvent(e,t,n){return"delete"!=t&&n.activateOnTyping?new tbe(this.source,1):this.map(e.changes)}handleChange(e){return e.changes.touchesRange(Rge(e.startState))?new tbe(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new tbe(this.source,this.state,e.mapPos(this.explicitPos))}}class nbe extends tbe{constructor(e,t,n,r,o){super(e,2,t),this.result=n,this.from=r,this.to=o}hasResult(){return!0}handleUserEvent(e,t,n){var r;let o=this.result;o.map&&!e.changes.empty&&(o=o.map(o,e.changes));let i=e.changes.mapPos(this.from),s=e.changes.mapPos(this.to,1),a=Rge(e.state);if((this.explicitPos<0?a<=i:a<this.from)||a>s||!o||"delete"==t&&Rge(e.startState)==this.from)return new tbe(this.source,"input"==t&&n.activateOnTyping?1:0);let l=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return function(e,t,n,r){if(!e)return!1;let o=t.sliceDoc(n,r);return"function"==typeof e?e(o,n,r,t):Nge(e,!0).test(o)}(o.validFor,e.state,i,s)?new nbe(this.source,l,o,i,s):o.update&&(o=o.update(o,i,s,new jge(e.state,a,l>=0)))?new nbe(this.source,l,o,o.from,null!==(r=o.to)&&void 0!==r?r:Rge(e.state)):new tbe(this.source,1,l)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new tbe(this.source,0):this.map(e.changes)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new nbe(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new tbe(this.source,0)}}const rbe=iie.define({map:(e,t)=>e.map((e=>e.map(t)))}),obe=iie.define(),ibe=zoe.define({create:()=>Yge.start(),update:(e,t)=>e.update(t),provide:e=>[zue.from(e,(e=>e.tooltip)),Fce.contentAttributes.from(e,(e=>e.attrs))]});function sbe(e,t){const n=t.completion.apply||t.completion.label;let r=e.state.field(ibe).active.find((e=>e.source==t.source));return r instanceof nbe&&("string"==typeof n?e.dispatch(Object.assign(Object.assign({},function(e,t,n,r){let{main:o}=e.selection,i=n-o.from,s=r-o.from;return Object.assign(Object.assign({},e.changeByRange((a=>a!=o&&n!=r&&e.sliceDoc(a.from+i,a.from+s)!=e.sliceDoc(n,r)?{range:a}:{changes:{from:a.from+i,to:r==o.from?a.to:a.from+s,insert:t},range:Toe.cursor(a.from+i+t.length)}))),{scrollIntoView:!0,userEvent:"input.complete"})}(e.state,n,r.from,r.to)),{annotations:Dge.of(t.completion)})):n(e,t.completion,r.from,r.to),!0)}const abe=Gge(ibe,sbe);function lbe(e,t="option"){return n=>{let r=n.state.field(ibe,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(Uge).interactionDelay)return!1;let o,i=1;"page"==t&&(o=que(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:s}=r.open.options,a=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:s-1;return a<0?a="page"==t?0:s-1:a>=s&&(a="page"==t?s-1:0),n.dispatch({effects:obe.of(a)}),!0}}class cbe{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const ube=Vae.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(ibe).active)1==t.state&&this.startQuery(t)}update(e){let t=e.state.field(ibe),n=e.state.facet(Uge);if(!e.selectionSet&&!e.docChanged&&e.startState.field(ibe)==t)return;let r=e.transactions.some((e=>(e.selection||e.docChanged)&&!ebe(e,n)));for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.updates.length+e.transactions.length>50&&Date.now()-n.time>1e3){for(let e of n.context.abortListeners)try{e()}catch(e){Lae(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some((e=>e.effects.some((e=>e.is(Oge)))))&&(this.pendingStart=!0);let o=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some((e=>1==e.state&&!this.running.some((t=>t.active.source==e.source))))?setTimeout((()=>this.startUpdate()),o):-1,0!=this.composing)for(let t of e.transactions)"input"==ebe(t,n)?this.composing=2:2==this.composing&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(ibe);for(let e of t.active)1!=e.state||this.running.some((t=>t.active.source==e.source))||this.startQuery(e)}startQuery(e){let{state:t}=this.view,n=Rge(t),r=new jge(t,n,e.explicitPos==n),o=new cbe(e,r);this.running.push(o),Promise.resolve(e.source(r)).then((e=>{o.context.aborted||(o.done=e||null,this.scheduleAccept())}),(e=>{this.view.dispatch({effects:Lge.of(null)}),Lae(this.view.state,e)}))}scheduleAccept(){this.running.every((e=>void 0!==e.done))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((()=>this.accept()),this.view.state.facet(Uge).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(Uge);for(let r=0;r<this.running.length;r++){let o=this.running[r];if(void 0===o.done)continue;if(this.running.splice(r--,1),o.done){let r=new nbe(o.active.source,o.active.explicitPos,o.done,o.done.from,null!==(e=o.done.to)&&void 0!==e?e:Rge(o.updates.length?o.updates[0].startState:this.view.state));for(let e of o.updates)r=r.update(e,n);if(r.hasResult()){t.push(r);continue}}let i=this.view.state.field(ibe).active.find((e=>e.source==o.active.source));if(i&&1==i.state)if(null==o.done){let e=new tbe(o.active.source,0);for(let t of o.updates)e=e.update(t,n);1!=e.state&&t.push(e)}else this.startQuery(i)}t.length&&this.view.dispatch({effects:rbe.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(ibe,!1);if(t&&t.tooltip&&this.view.state.facet(Uge).closeOnBlur){let n=t.open&&que(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||setTimeout((()=>this.view.dispatch({effects:Lge.of(null)})),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout((()=>this.view.dispatch({effects:Oge.of(!1)})),20),this.composing=0}}}),dbe="object"==typeof navigator&&/Win/.test(navigator.platform),hbe=Voe.highest(Fce.domEventHandlers({keydown(e,t){let n=t.state.field(ibe,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&(!dbe||!e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],o=n.active.find((e=>e.source==r.source)),i=r.completion.commitCharacters||o.result.commitCharacters;return i&&i.indexOf(e.key)>-1&&sbe(t,r),!1}})),pbe=Fce.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),fbe={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},mbe=iie.define({map(e,t){let n=t.mapPos(e,-1,_oe.TrackAfter);return null==n?void 0:n}}),gbe=new class extends yie{};gbe.startSide=1,gbe.endSide=-1;const bbe=zoe.define({create:()=>wie.empty,update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(mbe)&&(e=e.update({add:[gbe.range(n.value,n.value+1)]}));return e}}),ybe="()[]{}<>";function vbe(e){for(let t=0;t<8;t+=2)if(ybe.charCodeAt(t)==e)return ybe.charAt(t+1);return boe(e<128?e:e+1)}function _be(e,t){return e.languageDataAt("closeBrackets",t)[0]||fbe}const xbe="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),wbe=Fce.inputHandler.of(((e,t,n,r)=>{if((xbe?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let o=e.state.selection.main;if(r.length>2||2==r.length&&1==yoe(goe(r,0))||t!=o.from||n!=o.to)return!1;let i=function(e,t){let n=_be(e,e.selection.main.head),r=n.brackets||fbe.brackets;for(let o of r){let i=vbe(goe(o,0));if(t==o)return i==o?Ibe(e,o,r.indexOf(o+o+o)>-1,n):Abe(e,o,i,n.before||fbe.before);if(t==i&&Cbe(e,e.selection.main.from))return Ebe(e,0,i)}return null}(e.state,r);return!!i&&(e.dispatch(i),!0)})),kbe=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=_be(e,e.selection.main.head).brackets||fbe.brackets,r=null,o=e.changeByRange((t=>{if(t.empty){let r=function(e,t){let n=e.sliceString(t-2,t);return yoe(goe(n,0))==n.length?n:n.slice(1)}(e.doc,t.head);for(let o of n)if(o==r&&Sbe(e.doc,t.head)==vbe(goe(o,0)))return{changes:{from:t.head-o.length,to:t.head+o.length},range:Toe.cursor(t.head-o.length)}}return{range:r=t}}));return r||t(e.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!r}}];function Cbe(e,t){let n=!1;return e.field(bbe).between(0,e.doc.length,(e=>{e==t&&(n=!0)})),n}function Sbe(e,t){let n=e.sliceString(t,t+2);return n.slice(0,yoe(goe(n,0)))}function Abe(e,t,n,r){let o=null,i=e.changeByRange((i=>{if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:n,from:i.to}],effects:mbe.of(i.to+t.length),range:Toe.range(i.anchor+t.length,i.head+t.length)};let s=Sbe(e.doc,i.head);return!s||/\s/.test(s)||r.indexOf(s)>-1?{changes:{insert:t+n,from:i.head},effects:mbe.of(i.head+t.length),range:Toe.cursor(i.head+t.length)}:{range:o=i}}));return o?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function Ebe(e,t,n){let r=null,o=e.changeByRange((t=>t.empty&&Sbe(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:Toe.cursor(t.head+n.length)}:r={range:t}));return r?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Ibe(e,t,n,r){let o=r.stringPrefixes||fbe.stringPrefixes,i=null,s=e.changeByRange((r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:mbe.of(r.to+t.length),range:Toe.range(r.anchor+t.length,r.head+t.length)};let s,a=r.head,l=Sbe(e.doc,a);if(l==t){if(jbe(e,a))return{changes:{insert:t+t,from:a},effects:mbe.of(a+t.length),range:Toe.cursor(a+t.length)};if(Cbe(e,a)){let r=n&&e.sliceDoc(a,a+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:a,to:a+r.length,insert:r},range:Toe.cursor(a+r.length)}}}else{if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&(s=Tbe(e,a-2*t.length,o))>-1&&jbe(e,s))return{changes:{insert:t+t+t+t,from:a},effects:mbe.of(a+t.length),range:Toe.cursor(a+t.length)};if(e.charCategorizer(a)(l)!=pie.Word&&Tbe(e,a,o)>-1&&!function(e,t,n,r){let o=The(e).resolveInner(t,-1),i=r.reduce(((e,t)=>Math.max(e,t.length)),0);for(let s=0;s<5;s++){let s=e.sliceDoc(o.from,Math.min(o.to,o.from+n.length+i)),a=s.indexOf(n);if(!a||a>-1&&r.indexOf(s.slice(0,a))>-1){let t=o.firstChild;for(;t&&t.from==o.from&&t.to-t.from>n.length+a;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let l=o.to==t&&o.parent;if(!l)break;o=l}return!1}(e,a,t,o))return{changes:{insert:t+t,from:a},effects:mbe.of(a+t.length),range:Toe.cursor(a+t.length)}}return{range:i=r}}));return i?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function jbe(e,t){let n=The(e).resolveInner(t+1);return n.parent&&n.from==t}function Tbe(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=pie.Word)return t;for(let o of n){let n=t-o.length;if(e.sliceDoc(n,t)==o&&r(e.sliceDoc(n-1,n))!=pie.Word)return n}return-1}const Bbe=[{key:"Ctrl-Space",run:e=>!!e.state.field(ibe,!1)&&(e.dispatch({effects:Oge.of(!0)}),!0)},{key:"Escape",run:e=>{let t=e.state.field(ibe,!1);return!(!t||!t.active.some((e=>0!=e.state))||(e.dispatch({effects:Lge.of(null)}),0))}},{key:"ArrowDown",run:lbe(!0)},{key:"ArrowUp",run:lbe(!1)},{key:"PageDown",run:lbe(!0,"page")},{key:"PageUp",run:lbe(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(ibe,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(Uge).interactionDelay)&&sbe(e,t.open.options[t.open.selected])}}],Rbe=Voe.highest(Gce.computeN([Uge],(e=>e.facet(Uge).defaultKeymap?[Bbe]:[])));class Nbe{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class Dbe{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let r=e,o=n.facet(Wbe).markerFilter;o&&(r=o(r,n));let i=Xse.set(r.map((e=>e.from==e.to||e.from==e.to-1&&n.doc.lineAt(e.from).to==e.from?Xse.widget({widget:new Kbe(e),diagnostic:e}).range(e.from):Xse.mark({attributes:{class:"cm-lintRange cm-lintRange-"+e.severity+(e.markClass?" "+e.markClass:"")},diagnostic:e}).range(e.from,e.to))),!0);return new Dbe(i,t,Mbe(i))}}function Mbe(e,t=null,n=0){let r=null;return e.between(n,1e9,((e,n,{spec:o})=>{if(!t||o.diagnostic==t)return r=new Nbe(e,n,o.diagnostic),!1})),r}const Pbe=iie.define(),Obe=iie.define(),Lbe=iie.define(),Fbe=zoe.define({create:()=>new Dbe(Xse.none,null,null),update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,o=e.panel;if(e.selected){let o=t.changes.mapPos(e.selected.from,1);r=Mbe(n,e.selected.diagnostic,o)||Mbe(n,null,o)}!n.size&&o&&t.state.facet(Wbe).autoPanel&&(o=null),e=new Dbe(n,o,r)}for(let n of t.effects)if(n.is(Pbe)){let r=t.state.facet(Wbe).autoPanel?n.value.length?Jbe.open:null:e.panel;e=Dbe.init(n.value,r,t.state)}else n.is(Obe)?e=new Dbe(e.diagnostics,n.value?Jbe.open:null,e.selected):n.is(Lbe)&&(e=new Dbe(e.diagnostics,e.panel,n.value));return e},provide:e=>[ede.from(e,(e=>e.panel)),Fce.decorations.from(e,(e=>e.diagnostics))]}),zbe=Xse.mark({class:"cm-lintRange cm-lintRange-active"});function Ube(e,t,n){let{diagnostics:r}=e.state.field(Fbe),o=[],i=2e8,s=0;r.between(t-(n<0?1:0),t+(n>0?1:0),((e,r,{spec:a})=>{t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0))&&(o.push(a.diagnostic),i=Math.min(e,i),s=Math.max(r,s))}));let a=e.state.facet(Wbe).tooltipFilter;return a&&(o=a(o,e.state)),o.length?{pos:i,end:s,above:e.state.doc.lineAt(i).to<s,create:()=>({dom:Vbe(e,o)})}:null}function Vbe(e,t){return Sme("ul",{class:"cm-tooltip-lint"},t.map((t=>qbe(e,t,!1))))}const Hbe=e=>{let t=e.state.field(Fbe,!1);return!(!t||!t.panel||(e.dispatch({effects:Obe.of(!1)}),0))},$be=[{key:"Mod-Shift-m",run:e=>{let t=e.state.field(Fbe,!1);var n,r;t&&t.panel||e.dispatch({effects:(n=e.state,r=[Obe.of(!0)],n.field(Fbe,!1)?r:r.concat(iie.appendConfig.of(Qbe)))});let o=Jue(e,Jbe.open);return o&&o.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(Fbe,!1);if(!t)return!1;let n=e.state.selection.main,r=t.diagnostics.iter(n.to+1);return!(!r.value&&(r=t.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)||(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),0))}}],Wbe=Noe.define({combine:e=>Object.assign({sources:e.map((e=>e.source)).filter((e=>null!=e))},bie(e.map((e=>e.config)),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t}))});function Gbe(e){let t=[];if(e)e:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some((e=>e.toLowerCase()==r.toLowerCase()))){t.push(r);continue e}}t.push("")}return t}function qbe(e,t,n){var r;let o=n?Gbe(t.actions):[];return Sme("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},Sme("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),null===(r=t.actions)||void 0===r?void 0:r.map(((n,r)=>{let i=!1,s=r=>{if(r.preventDefault(),i)return;i=!0;let o=Mbe(e.state.field(Fbe).diagnostics,t);o&&n.apply(e,o.from,o.to)},{name:a}=n,l=o[r]?a.indexOf(o[r]):-1,c=l<0?a:[a.slice(0,l),Sme("u",a.slice(l,l+1)),a.slice(l+1)];return Sme("button",{type:"button",class:"cm-diagnosticAction",onclick:s,onmousedown:s,"aria-label":` Action: ${a}${l<0?"":` (access key "${o[r]})"`}.`},c)})),t.source&&Sme("div",{class:"cm-diagnosticSource"},t.source))}class Kbe extends Yse{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return Sme("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class Ybe{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=qbe(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Jbe{constructor(e){this.view=e,this.items=[],this.list=Sme("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(27==t.keyCode)Hbe(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:n}=this.items[this.selectedIndex],r=Gbe(n.actions);for(let o=0;o<r.length;o++)if(r[o].toUpperCase().charCodeAt(0)==t.keyCode){let t=Mbe(this.view.state.field(Fbe).diagnostics,n);t&&n.actions[o].apply(e,t.from,t.to)}}}t.preventDefault()},onclick:e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)}}),this.dom=Sme("div",{class:"cm-panel-lint"},this.list,Sme("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>Hbe(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Fbe).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(Fbe),n=0,r=!1,o=null;for(e.between(0,this.view.state.doc.length,((e,i,{spec:s})=>{let a,l=-1;for(let e=n;e<this.items.length;e++)if(this.items[e].diagnostic==s.diagnostic){l=e;break}l<0?(a=new Ybe(this.view,s.diagnostic),this.items.splice(n,0,a),r=!0):(a=this.items[l],l>n&&(this.items.splice(n,l-n),r=!0)),t&&a.diagnostic==t.diagnostic?a.dom.hasAttribute("aria-selected")||(a.dom.setAttribute("aria-selected","true"),o=a):a.dom.hasAttribute("aria-selected")&&a.dom.removeAttribute("aria-selected"),n++}));n<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();0==this.items.length&&(this.items.push(new Ybe(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),o?(this.list.setAttribute("aria-activedescendant",o.id),this.view.requestMeasure({key:this,read:()=>({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=Mbe(this.view.state.field(Fbe).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:Lbe.of(t)})}static open(e){return new Jbe(e)}}function Xbe(e){return function(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const Zbe=Fce.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Xbe("#d11")},".cm-lintRange-warning":{backgroundImage:Xbe("orange")},".cm-lintRange-info":{backgroundImage:Xbe("#999")},".cm-lintRange-hint":{backgroundImage:Xbe("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}}),Qbe=[Fbe,Fce.decorations.compute([Fbe],(e=>{let{selected:t,panel:n}=e.field(Fbe);return t&&n&&t.from!=t.to?Xse.set([zbe.range(t.from,t.to)]):Xse.none})),Gue(Ube,{hideOn:function(e,t){let n=t.pos,r=t.end||n,o=e.state.facet(Wbe).hideOn(e,n,r);if(null!=o)return o;let i=e.startState.doc.lineAt(t.pos);return!(!e.effects.some((e=>e.is(Pbe)))&&!e.changes.touchesRange(i.from,Math.max(i.to,r)))}}),Zbe];var eye=function(e){void 0===e&&(e={});var{crosshairCursor:t=!1}=e,n=[];!1!==e.closeBracketsKeymap&&(n=n.concat(kbe)),!1!==e.defaultKeymap&&(n=n.concat(kme)),!1!==e.searchKeymap&&(n=n.concat(xge)),!1!==e.historyKeymap&&(n=n.concat(Sfe)),!1!==e.foldKeymap&&(n=n.concat(dpe)),!1!==e.completionKeymap&&(n=n.concat(Bbe)),!1!==e.lintKeymap&&(n=n.concat($be));var r=[];return!1!==e.lineNumbers&&r.push(function(e={}){return[mde.of(e),ade(),yde]}()),!1!==e.highlightActiveLineGutter&&r.push(xde),!1!==e.highlightSpecialChars&&r.push(function(e={}){return[wue.of(e),kue||(kue=Vae.fromClass(class{constructor(e){this.view=e,this.decorations=Xse.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(wue)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new bue({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:o}=n.state,i=goe(t[0],0);if(9==i){let e=o.lineAt(r),t=n.state.tabSize,i=Die(e.text,t,r-e.from);return Xse.replace({widget:new Sue((t-i%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[i]||(this.decorationCache[i]=Xse.replace({widget:new Cue(e,i)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(wue);e.startState.facet(wue)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))]}()),!1!==e.history&&r.push(function(e={}){return[lfe,afe.of(e),Fce.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?ufe:"historyRedo"==e.inputType?dfe:null;return!!n&&(e.preventDefault(),n(t))}})]}()),!1!==e.foldGutter&&r.push(function(e={}){let t=Object.assign(Object.assign({},ype),e),n=new vpe(t,!0),r=new vpe(t,!1),o=Vae.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(Fhe)!=e.state.facet(Fhe)||e.startState.field(spe,!1)!=e.state.field(spe,!1)||The(e.startState)!=The(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new kie;for(let o of e.viewportLineBlocks){let i=ape(e.state,o.from,o.to)?r:tpe(e.state,o.from,o.to)?n:null;i&&t.add(o.from,o.from,i)}return t.finish()}}),{domEventHandlers:i}=t;return[o,ide({class:"cm-foldGutter",markers(e){var t;return(null===(t=e.plugin(o))||void 0===t?void 0:t.markers)||wie.empty},initialSpacer:()=>new vpe(t,!1),domEventHandlers:Object.assign(Object.assign({},i),{click:(e,t,n)=>{if(i.click&&i.click(e,t,n))return!0;let r=ape(e.state,t.from,t.to);if(r)return e.dispatch({effects:ope.of(r)}),!0;let o=tpe(e.state,t.from,t.to);return!!o&&(e.dispatch({effects:rpe.of(o)}),!0)}})}),fpe()]}()),!1!==e.drawSelection&&r.push(function(e={}){return[sue.of(e),lue,uue,hue,Nae.of(!0)]}()),!1!==e.dropCursor&&r.push([fue,mue]),!1!==e.allowMultipleSelections&&r.push(gie.allowMultipleSelections.of(!0)),!1!==e.indentOnInput&&r.push(gie.transactionFilter.of((e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:r}=e.newSelection.main,o=n.lineAt(r);if(r>o.from+200)return e;let i=n.sliceString(o.from,r);if(!t.some((e=>e.test(i))))return e;let{state:s}=e,a=-1,l=[];for(let{head:e}of s.selection.ranges){let t=s.doc.lineAt(e);if(t.from==a)continue;a=t.from;let n=$he(s,t.from);if(null==n)continue;let r=/^\s*/.exec(t.text)[0],o=Hhe(s,n);r!=o&&l.push({from:t.from,to:t.from+r.length,insert:o})}return l.length?[e,{changes:l,sequential:!0}]:e}))),!1!==e.syntaxHighlighting&&r.push(Spe(Ipe,{fallback:!0})),!1!==e.bracketMatching&&r.push(function(e={}){return[Rpe.of(e),Ope]}()),!1!==e.closeBrackets&&r.push([wbe,bbe]),!1!==e.autocompletion&&r.push(function(e={}){return[hbe,ibe,Uge.of(e),ube,Rbe,pbe]}()),!1!==e.rectangularSelection&&r.push(function(e){let t=e=>e.altKey&&0==e.button;return Fce.mouseSelectionStyle.of(((e,n)=>t(n)?function(e,t){let n=Tue(e,t),r=e.state.selection;return n?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(n.line).from),o=e.state.doc.lineAt(t);n={line:o.number,col:n.col,off:Math.min(n.off,o.length)},r=r.map(e.changes)}},get(t,o,i){let s=Tue(e,t);if(!s)return r;let a=function(e,t,n){let r=Math.min(t.line,n.line),o=Math.max(t.line,n.line),i=[];if(t.off>jue||n.off>jue||t.col<0||n.col<0){let s=Math.min(t.off,n.off),a=Math.max(t.off,n.off);for(let t=r;t<=o;t++){let n=e.doc.line(t);n.length<=a&&i.push(Toe.range(n.from+s,n.to+a))}}else{let s=Math.min(t.col,n.col),a=Math.max(t.col,n.col);for(let t=r;t<=o;t++){let n=e.doc.line(t),r=Mie(n.text,s,e.tabSize,!0);if(r<0)i.push(Toe.cursor(n.to));else{let t=Mie(n.text,a,e.tabSize);i.push(Toe.range(n.from+r,n.from+t))}}}return i}(e.state,n,s);return a.length?i?Toe.create(a.concat(r.ranges)):Toe.create(a):r}}:null}(e,n):null))}()),!1!==t&&r.push(function(e={}){let[t,n]=Bue[e.key||"Alt"],r=Vae.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){e.keyCode!=t&&n(e)||this.set(!1)},mousemove(e){this.set(n(e))}}});return[r,Fce.contentAttributes.of((e=>{var t;return(null===(t=e.plugin(r))||void 0===t?void 0:t.isDown)?Rue:null}))]}()),!1!==e.highlightActiveLine&&r.push(Eue),!1!==e.highlightSelectionMatches&&r.push(function(e){let t=[Gme,Wme];return t}()),e.tabSize&&"number"==typeof e.tabSize&&r.push(Uhe.of(" ".repeat(e.tabSize))),r.concat([Gce.of(n.flat())]).filter(Boolean)};const tye="#e06c75",nye="#abb2bf",rye="#7d8799",oye="#d19a66",iye="#2c313a",sye="#282c34",aye="#353a42",lye="#528bff",cye=[Fce.theme({"&":{color:nye,backgroundColor:sye},".cm-content":{caretColor:lye},".cm-cursor, .cm-dropCursor":{borderLeftColor:lye},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:nye},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:sye,color:rye,border:"none"},".cm-activeLineGutter":{backgroundColor:iye},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:aye},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:aye,borderBottomColor:aye},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:iye,color:nye}}},{dark:!0}),Spe(xpe.define([{tag:Che.keyword,color:"#c678dd"},{tag:[Che.name,Che.deleted,Che.character,Che.propertyName,Che.macroName],color:tye},{tag:[Che.function(Che.variableName),Che.labelName],color:"#61afef"},{tag:[Che.color,Che.constant(Che.name),Che.standard(Che.name)],color:oye},{tag:[Che.definition(Che.name),Che.separator],color:nye},{tag:[Che.typeName,Che.className,Che.number,Che.changed,Che.annotation,Che.modifier,Che.self,Che.namespace],color:"#e5c07b"},{tag:[Che.operator,Che.operatorKeyword,Che.url,Che.escape,Che.regexp,Che.link,Che.special(Che.string)],color:"#56b6c2"},{tag:[Che.meta,Che.comment],color:rye},{tag:Che.strong,fontWeight:"bold"},{tag:Che.emphasis,fontStyle:"italic"},{tag:Che.strikethrough,textDecoration:"line-through"},{tag:Che.link,color:rye,textDecoration:"underline"},{tag:Che.heading,fontWeight:"bold",color:tye},{tag:[Che.atom,Che.bool,Che.special(Che.variableName)],color:oye},{tag:[Che.processingInstruction,Che.string,Che.inserted],color:"#98c379"},{tag:Che.invalid,color:"#ffffff"}]))];var uye=Fce.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),dye=function(e){void 0===e&&(e={});var{indentWithTab:t=!0,editable:n=!0,readOnly:r=!1,theme:o="light",placeholder:i="",basicSetup:s=!0}=e,a=[];switch(t&&a.unshift(Gce.of([Cme])),s&&("boolean"==typeof s?a.unshift(eye()):a.unshift(eye(s))),i&&a.unshift(function(e){return Vae.fromClass(class{constructor(t){this.view=t,this.placeholder=e?Xse.set([Xse.widget({widget:new Iue(e),side:1}).range(0)]):Xse.none}get decorations(){return this.view.state.doc.length?Xse.none:this.placeholder}},{decorations:e=>e.decorations})}(i)),o){case"light":a.push(uye);break;case"dark":a.push(cye);break;case"none":break;default:a.push(o)}return!1===n&&a.push(Fce.editable.of(!1)),r&&a.push(gie.readOnly.of(!0)),[...a]},hye=nie.define(),pye=[],fye=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],mye=(0,S.forwardRef)(((e,t)=>{var{className:n,value:r="",selection:o,extensions:i=[],onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,autoFocus:u,theme:d="light",height:h,minHeight:p,maxHeight:f,width:m,minWidth:g,maxWidth:b,basicSetup:y,placeholder:v,indentWithTab:_,editable:x,readOnly:w,root:k,initialState:C}=e,A=(0,D4.A)(e,fye),E=(0,S.useRef)(null),{state:I,view:j,container:T}=function(e){var{value:t,selection:n,onChange:r,onStatistics:o,onCreateEditor:i,onUpdate:s,extensions:a=pye,autoFocus:l,theme:c="light",height:u=null,minHeight:d=null,maxHeight:h=null,width:p=null,minWidth:f=null,maxWidth:m=null,placeholder:g="",editable:b=!0,readOnly:y=!1,indentWithTab:v=!0,basicSetup:_=!0,root:x,initialState:w}=e,[k,C]=(0,S.useState)(),[A,E]=(0,S.useState)(),[I,j]=(0,S.useState)(),T=Fce.theme({"&":{height:u,minHeight:d,maxHeight:h,width:p,minWidth:f,maxWidth:m},"& .cm-scroller":{height:"100% !important"}}),B=Fce.updateListener.of((e=>{if(e.docChanged&&"function"==typeof r&&!e.transactions.some((e=>e.annotation(hye)))){var t=e.state.doc.toString();r(t,e)}o&&o((e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map((t=>e.state.sliceDoc(t.from,t.to))),selectedText:e.state.selection.ranges.some((e=>!e.empty))}))(e))})),R=[B,T,...dye({theme:c,editable:b,readOnly:y,placeholder:g,indentWithTab:v,basicSetup:_})];return s&&"function"==typeof s&&R.push(Fce.updateListener.of(s)),R=R.concat(a),(0,S.useEffect)((()=>{if(k&&!I){var e={doc:t,selection:n,extensions:R},r=w?gie.fromJSON(w.json,e,w.fields):gie.create(e);if(j(r),!A){var o=new Fce({state:r,parent:k,root:x});E(o),i&&i(o,r)}}return()=>{A&&(j(void 0),E(void 0))}}),[k,I]),(0,S.useEffect)((()=>C(e.container)),[e.container]),(0,S.useEffect)((()=>()=>{A&&(A.destroy(),E(void 0))}),[A]),(0,S.useEffect)((()=>{l&&A&&A.focus()}),[l,A]),(0,S.useEffect)((()=>{A&&A.dispatch({effects:iie.reconfigure.of(R)})}),[c,a,u,d,h,p,f,m,g,b,y,v,_,r,s]),(0,S.useEffect)((()=>{if(void 0!==t){var e=A?A.state.doc.toString():"";A&&t!==e&&A.dispatch({changes:{from:0,to:e.length,insert:t||""},annotations:[hye.of(!0)]})}}),[t,A]),{state:I,setState:j,view:A,setView:E,container:k,setContainer:C}}({container:E.current,root:k,value:r,autoFocus:u,theme:d,height:h,minHeight:p,maxHeight:f,width:m,minWidth:g,maxWidth:b,basicSetup:y,placeholder:v,indentWithTab:_,editable:x,readOnly:w,selection:o,onChange:s,onStatistics:a,onCreateEditor:l,onUpdate:c,extensions:i,initialState:C});if((0,S.useImperativeHandle)(t,(()=>({editor:E.current,state:I,view:j})),[E,T,I,j]),"string"!=typeof r)throw new Error("value must be typeof string but got "+typeof r);var B="string"==typeof d?"cm-theme-"+d:"cm-theme";return(0,Td.jsx)("div",(0,S4.A)({ref:E,className:B+(n?" "+n:"")},A))}));mye.displayName="CodeMirror";const gye=mye;function bye({value:e,onChange:t,options:n={lineNumbers:!0,tabMode:"indent",matchBrackets:!0}}){const r=(0,S.useCallback)((e=>{t(e)}),[t]);return(0,Td.jsx)(gye,{value:e,onChange:r,basicSetup:{lineNumbers:n.lineNumbers,indentWithTabs:"indent"===n.tabMode,bracketMatching:n.matchBrackets}})}function yye({onToggle:e,isOpened:t}){const n=(0,Ul.A)((e=>e(A2).getFormStyles()),[]),{changeFormStyles:r}=(0,Vl.A)(A2);return(0,Td.jsx)(F5.A,{children:(0,Td.jsx)(aF.Ay,{title:_2.U.I18n.t("customCss"),opened:t,onToggle:e,children:(0,Td.jsx)(bye,{value:n,onChange:r})})})}bye.propTypes={value:k2().string.isRequired,onChange:k2().func.isRequired,options:k2().shape({lineNumbers:k2().bool,tabMode:k2().string,matchBrackets:k2().bool})},yye.propTypes={onToggle:k2().func.isRequired,isOpened:k2().bool.isRequired};var vye=n(50459);function _ye({onToggle:e,isOpened:t}){const n=(0,Ul.A)((e=>e(A2).getFormSettings()),[]),{changeFormSettings:r}=(0,Vl.A)(A2),o=_2.U.tags.map((e=>e.name));return(0,Td.jsx)(F5.A,{children:(0,Td.jsx)(aF.Ay,{title:"Tags",opened:t,onToggle:e,children:(0,Td.jsx)(vye.g,{label:_2.U.I18n.t("addNewTag"),onChange:e=>{(0,I2.isEqual)(n.tags,e.value)||r({...n,tags:e.value})},suggestedValues:o,selectedValues:n.tags})})})}function xye(){const{toggleSidebarPanel:e}=(0,Vl.A)(A2),t=(0,Ul.A)((e=>e(A2).getSidebarOpenedPanels()),[]);return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(v2.ErrorBoundary,{children:(0,Td.jsx)(Bre,{isOpened:t.includes("basic-settings"),onToggle:(0,I2.partial)(e,"basic-settings")})}),(0,Td.jsx)(Lre,{isOpened:t.includes("styles-settings"),onToggle:(0,I2.partial)(e,"styles-settings")}),(0,Td.jsx)(Jre,{isOpened:t.includes("form-placement"),onToggle:(0,I2.partial)(e,"form-placement")}),(0,Td.jsx)(_ye,{isOpened:t.includes("tags"),onToggle:(0,I2.partial)(e,"tags")}),(0,Td.jsx)(yye,{isOpened:t.includes("custom-css"),onToggle:(0,I2.partial)(e,"custom-css")})]})}function wye(){return(0,Td.jsx)(F5.A,{children:(0,Td.jsx)(p0,{})})}function kye({children:e,closeSidebar:t}){return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsxs)("div",{className:"components-panel__header interface-complementary-area-header__small",children:[(0,Td.jsx)("span",{className:"interface-complementary-area-header__small-title",children:_2.U.I18n.t("formSettings")}),(0,Td.jsx)(Zv.Ay,{onClick:t,icon:"no-alt"})]}),(0,Td.jsxs)("div",{className:"components-panel__header interface-complementary-area-header editor-sidebar__panel-tabs",children:[e,(0,Td.jsx)(Zv.Ay,{onClick:t,icon:"no-alt"})]})]})}const{lock:Cye,unlock:Sye}=(0,Nl.yf)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/edit-post"),{Tabs:Aye}=Sye(d_.j);function Eye({onClose:e}){const{activeTab:t,selectedBlockId:n}=(0,Ul.A)((e=>({activeTab:e(A2).getDefaultSidebarActiveTab(),selectedBlockId:e("core/block-editor").getSelectedBlockClientId()})),[]),{switchDefaultSidebarTab:r}=(0,Vl.A)(A2);return(0,S.useEffect)((()=>{r(n?"block":"form")}),[n,r]),(0,Td.jsxs)(Aye,{selectedTabId:t,onSelect:r,children:[(0,Td.jsx)(kye,{closeSidebar:e,children:(0,Td.jsxs)(Aye.TabList,{children:[(0,Td.jsx)(Aye.Tab,{tabId:"form",children:_2.U.I18n.t("form")}),(0,Td.jsx)(Aye.Tab,{tabId:"block",children:(0,H.__)("Block")})]})}),(0,Td.jsx)(Aye.TabPanel,{tabId:"form",children:(0,Td.jsx)(xye,{})}),(0,Td.jsx)(Aye.TabPanel,{tabId:"block",children:(0,Td.jsx)(wye,{})})]})}var Iye=n(32228);function jye({label:e,minPercents:t=0,maxPercents:n=100,minPixels:r=10,maxPixels:o=1e3,value:i,defaultPercentValue:s=50,defaultPixelValue:a=200,onChange:l}){const[c,u]=(0,S.useState)(i??{unit:"pixel",value:void 0});return(0,S.useEffect)((()=>{u(i)}),[i]),(0,Td.jsxs)("div",{className:"mailpoet-size-settings-control",children:[(0,Td.jsx)($_.Ay.VisualLabel,{children:e}),(0,Td.jsx)(Cre.A,{className:"mailpoet-form-inline-radios__control",selected:c.unit||"pixel",options:[{label:"px",value:"pixel"},{label:"%",value:"percent"}],onChange:e=>{const t={value:"pixel"===e?a:s,unit:e};u(t),l(t)}}),(0,Td.jsx)(FC,{value:c.value??("pixel"===c.unit?a:s),min:"pixel"===c.unit?r:t,max:"pixel"===c.unit?o:n,onChange:e=>{const t={unit:"pixel"===c.unit?"pixel":"percent",value:e};u(t),l(t)}})]})}jye.displayName="FormEditorSizeSettings";const Tye=(0,v2.withBoundary)(jye);function Bye({settingsPlacementKey:e}){const t=(0,Ul.A)((e=>e(A2).getFormSettings()),[]),n=(0,Ul.A)((e=>(0,Iye.sortBy)("name",e(A2).getAllWPTags().concat(e(A2).getAllWooCommerceTags()))),[]),r=(0,Ul.A)((e=>(0,Iye.sortBy)("name",e(A2).getAllWPCategories().concat(e(A2).getAllWooCommerceCategories()))),[]),o=(0,Ul.A)((e=>e(A2).getAllWPPages()),[]),i=(0,Ul.A)((e=>(0,Iye.sortBy)("name",e(A2).getAllWPPosts().concat(e(A2).getAllWooCommerceProducts()))),[]),s=(0,Ul.A)((e=>e(A2).getIsPreviewShown()),[]),{changeFormSettings:a}=(0,Vl.A)(A2);let l="no-preview";s&&(l="preview");const c="belowPosts"!==e;return(0,Td.jsxs)(Td.Fragment,{children:[c&&(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("placeFormOnHomepage"),checked:t.formPlacement[e].homepage,onChange:n=>{(0,Iye.compose)([a,(0,Iye.assocPath)(`formPlacement.${e}.homepage`,n)])(t)}}),(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("placeFormOnAllPages"),checked:t.formPlacement[e].pages.all,onChange:n=>{(0,Iye.compose)([a,(0,Iye.assocPath)(`formPlacement.${e}.pages.all`,n),(0,Iye.cond)([[()=>n,(0,Iye.compose)([(0,Iye.assocPath)(`formPlacement.${e}.pages.selected`,[]),(0,Iye.assocPath)(`formPlacement.${e}.categories`,[]),(0,Iye.assocPath)(`formPlacement.${e}.tags`,[])])],[()=>!n,Iye.identity]])])(t)}}),(0,Td.jsx)("div",{"data-automation-id":"form-placement-select-page",children:(0,Td.jsx)("div",{className:"form-editor-placement-selection",children:(0,Td.jsx)(jre,{dropDownParent:s?".mailpoet-modal-content":void 0,item:{id:`${l}${t.formPlacement[e].pages.selected.join()}`},onValueChange:n=>{const r=t.formPlacement[e].pages.selected;(0,Iye.isEqual)(r,n.target.value)||(0,Iye.compose)([a,(0,Iye.assocPath)(`formPlacement.${e}.pages.selected`,n.target.value),(0,Iye.cond)([[()=>!!n.target.value.length,(0,Iye.assocPath)(`formPlacement.${e}.pages.all`,!1)],[()=>!n.target.value.length,Iye.identity]])])(t)},field:{id:`${l}pages`,name:"pages",values:o,multiple:!0,placeholder:_2.U.I18n.t("selectPage"),getLabel:e=>e.name,selected:()=>t.formPlacement[e].pages.selected}})})}),(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("placeFormOnAllPosts"),checked:t.formPlacement[e].posts.all,onChange:n=>{(0,Iye.compose)([a,(0,Iye.assocPath)(`formPlacement.${e}.posts.all`,n),(0,Iye.cond)([[()=>n,(0,Iye.compose)([(0,Iye.assocPath)(`formPlacement.${e}.posts.selected`,[]),(0,Iye.assocPath)(`formPlacement.${e}.categories`,[]),(0,Iye.assocPath)(`formPlacement.${e}.tags`,[])])],[()=>!n,Iye.identity]])])(t)}}),(0,Td.jsx)("div",{className:"form-editor-placement-selection",children:(0,Td.jsx)(jre,{dropDownParent:s?".mailpoet-modal-content":void 0,item:{id:`${l}${t.formPlacement[e].posts.selected.join()}`},onValueChange:n=>{const r=t.formPlacement[e].posts.selected;(0,Iye.isEqual)(r,n.target.value)||(0,Iye.compose)([a,(0,Iye.assocPath)(`formPlacement.${e}.posts.selected`,n.target.value),(0,Iye.cond)([[()=>!!n.target.value.length,(0,Iye.assocPath)(`formPlacement.${e}.posts.all`,!1)],[()=>!n.target.value.length,Iye.identity]])])(t)},field:{id:`${l}posts`,name:"posts",values:i,multiple:!0,placeholder:_2.U.I18n.t("selectPage"),getLabel:e=>e.name,selected:()=>t.formPlacement[e].posts.selected}})}),(0,Td.jsxs)("div",{children:[(0,Td.jsx)("p",{className:"form-editor-sidebar-heading",children:_2.U.I18n.t("displayOnCategories")}),(0,Td.jsx)("div",{className:"form-editor-placement-selection",children:(0,Td.jsx)(jre,{dropDownParent:s?".mailpoet-modal-content":void 0,item:{id:`${l}${t.formPlacement[e].categories.join()}`},onValueChange:n=>{const r=t.formPlacement[e].categories;(0,Iye.isEqual)(r,n.target.value)||(0,Iye.compose)([a,(0,Iye.assocPath)(`formPlacement.${e}.categories`,n.target.value),(0,Iye.cond)([[()=>!!n.target.value.length,(0,Iye.compose)([(0,Iye.assocPath)(`formPlacement.${e}.pages.all`,!1),(0,Iye.assocPath)(`formPlacement.${e}.posts.all`,!1)])],[()=>!n.target.value.length,Iye.identity]])])(t)},field:{id:`${l}categories`,name:"categories",values:r,multiple:!0,placeholder:_2.U.I18n.t("selectPage"),getLabel:e=>e.name,selected:()=>t.formPlacement[e].categories}})})]}),(0,Td.jsxs)("div",{children:[(0,Td.jsx)("p",{className:"form-editor-sidebar-heading",children:_2.U.I18n.t("displayOnTags")}),(0,Td.jsx)("div",{className:"form-editor-placement-selection",children:(0,Td.jsx)(jre,{dropDownParent:s?".mailpoet-modal-content":void 0,item:{id:`${l}${t.formPlacement[e].tags.join()}`},onValueChange:n=>{const r=t.formPlacement[e].tags;(0,Iye.isEqual)(r,n.target.value)||(0,Iye.compose)([a,(0,Iye.assocPath)(`formPlacement.${e}.tags`,n.target.value),(0,Iye.cond)([[()=>!!n.target.value.length,(0,Iye.compose)([(0,Iye.assocPath)(`formPlacement.${e}.pages.all`,!1),(0,Iye.assocPath)(`formPlacement.${e}.posts.all`,!1)])],[()=>!n.target.value.length,Iye.identity]])])(t)},field:{id:`${l}tags`,name:"tags",values:n,multiple:!0,placeholder:_2.U.I18n.t("selectPage"),getLabel:e=>e.name,selected:()=>t.formPlacement[e].tags}})})]}),c&&(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("displayOnAllTagArchives"),checked:t.formPlacement[e].tagArchives.all,onChange:n=>{(0,Iye.compose)([a,(0,Iye.assocPath)(`formPlacement.${e}.tagArchives.all`,n),(0,Iye.cond)([[()=>n,(0,Iye.compose)([(0,Iye.assocPath)(`formPlacement.${e}.tagArchives.selected`,[])])],[()=>!n,Iye.identity]])])(t)}}),(0,Td.jsx)("div",{"data-automation-id":"form-placement-select-archive-tags",children:(0,Td.jsx)("div",{className:"form-editor-placement-selection",children:(0,Td.jsx)(jre,{dropDownParent:s?".mailpoet-modal-content":void 0,item:{id:`${l}${t.formPlacement[e].tagArchives.selected.join()}`},onValueChange:n=>{const r=t.formPlacement[e].tagArchives.selected;(0,Iye.isEqual)(r,n.target.value)||(0,Iye.compose)([a,(0,Iye.assocPath)(`formPlacement.${e}.tagArchives.selected`,n.target.value),(0,Iye.cond)([[()=>!!n.target.value.length,(0,Iye.assocPath)(`formPlacement.${e}.tagArchives.all`,!1)],[()=>!n.target.value.length,Iye.identity]])])(t)},field:{id:`${l}tagArchives`,name:"tagArchives",values:n,multiple:!0,placeholder:_2.U.I18n.t("selectSpecificArchiveTags"),getLabel:e=>e.name,selected:()=>t.formPlacement[e].tagArchives.selected}})})}),(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("displayOnAllCategoryArchives"),checked:t.formPlacement[e].categoryArchives.all,onChange:n=>{(0,Iye.compose)([a,(0,Iye.assocPath)(`formPlacement.${e}.categoryArchives.all`,n),(0,Iye.cond)([[()=>n,(0,Iye.compose)([(0,Iye.assocPath)(`formPlacement.${e}.categoryArchives.selected`,[])])],[()=>!n,Iye.identity]])])(t)}}),(0,Td.jsx)("div",{"data-automation-id":"form-placement-select-archive-categories",children:(0,Td.jsx)("div",{className:"form-editor-placement-selection",children:(0,Td.jsx)(jre,{dropDownParent:s?".mailpoet-modal-content":void 0,item:{id:`${l}${t.formPlacement[e].categoryArchives.selected.join()}`},onValueChange:n=>{const r=t.formPlacement[e].categoryArchives.selected;(0,Iye.isEqual)(r,n.target.value)||(0,Iye.compose)([a,(0,Iye.assocPath)(`formPlacement.${e}.categoryArchives.selected`,n.target.value),(0,Iye.cond)([[()=>!!n.target.value.length,(0,Iye.assocPath)(`formPlacement.${e}.categoryArchives.all`,!1)],[()=>!n.target.value.length,Iye.identity]])])(t)},field:{id:`${l}categoryArchives`,name:"categoryArchives",values:r,multiple:!0,placeholder:_2.U.I18n.t("selectSpecificArchiveCategories"),getLabel:e=>e.name,selected:()=>t.formPlacement[e].categoryArchives.selected}})})})]})]})}Bye.displayName="FormEditorPlacementSettings";const Rye=(0,v2.withBoundary)(Bye);function Nye(){const e=(0,Ul.A)((e=>e(A2).getFormSettings()),[]),{changeFormSettings:t}=(0,Vl.A)(A2),n=e.formPlacement.belowPosts.enabled;return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)("p",{children:_2.U.I18n.t("placeFormBellowPagesDescription")}),(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("enable"),checked:n,onChange:(0,Iye.compose)([t,(0,Iye.assocPath)("formPlacement.belowPosts.enabled",Iye.__,e)])}),n&&(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(Tye,{label:_2.U.I18n.t("formSettingsWidth"),value:e.formPlacement.belowPosts.styles.width,minPixels:200,maxPixels:1200,minPercents:10,maxPercents:100,defaultPixelValue:560,defaultPercentValue:100,onChange:n=>{t((0,Iye.assocPath)("formPlacement.belowPosts.styles.width",n,e))}}),(0,Td.jsx)(Rye,{settingsPlacementKey:"belowPosts"})]})]})}function Dye({settingsPlacementKey:e}){const t=(0,Ul.A)((e=>e(A2).getFormSettings()),[]),{changeFormSettings:n}=(0,Vl.A)(A2);return(0,Td.jsx)(_T.A,{label:_2.U.I18n.t("animationHeader"),value:t.formPlacement[e].animation,options:[{label:_2.U.I18n.t("animationNone"),value:"none"},{label:"Fade In",value:"fadein"},{label:"Slide Right",value:"slideright"},{label:"Slide Left",value:"slideleft"},{label:"Slide Up",value:"slideup"},{label:"Slide Down",value:"slidedown"},{label:"Zoom Out",value:"zoomout"},{label:"Zoom In",value:"zoomin"},{label:"Flip",value:"flip"}],onChange:(0,Iye.compose)([n,(0,Iye.assocPath)(`formPlacement.${e}.animation`,Iye.__,t)])})}Dye.displayName="FormEditorAnimationSettings";const Mye=(0,v2.withBoundary)(Dye);function Pye({settingsPlacementKey:e}){const t=(0,Ul.A)((e=>e(A2).getFormSettings()),[]),{changeFormSettings:n}=(0,Vl.A)(A2);return(0,Td.jsx)(_T.A,{label:_2.U.I18n.t("formPlacementCookieExpiration"),value:t.formPlacement[e].cookieExpiration,options:[{value:"0",label:_2.U.I18n.t("formPlacementCookieExpirationAlways")},{value:"1",label:_2.U.I18n.t("formPlacementCookieExpirationDay")},...[3,7,14,30,60,90].map((e=>({value:`${e}`,label:_2.U.I18n.t("formPlacementCookieExpirationDays").replace("%1s",e.toString())})))],onChange:(0,Iye.compose)([n,(0,Iye.assocPath)(`formPlacement.${e}.cookieExpiration`,Iye.__,t)])})}Pye.displayName="FormEditorCookieSettings";const Oye=(0,v2.withBoundary)(Pye),Lye=[0,2,5,10,15,30,45,60,120,180,240];function Fye(){const e=(0,Ul.A)((e=>e(A2).getFormSettings()),[]),{changeFormSettings:t}=(0,Vl.A)(A2),n=e.formPlacement.popup.enabled;return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)("p",{children:_2.U.I18n.t("placePopupFormOnPagesDescription")}),(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("enable"),checked:n,onChange:(0,Iye.compose)([t,(0,Iye.assocPath)("formPlacement.popup.enabled",Iye.__,e)])}),n&&(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)("hr",{}),(0,Td.jsx)(Tye,{label:_2.U.I18n.t("formSettingsWidth"),value:e.formPlacement.popup.styles.width,minPixels:200,maxPixels:1200,minPercents:10,maxPercents:100,defaultPixelValue:560,defaultPercentValue:100,onChange:n=>{t((0,Iye.assocPath)("formPlacement.popup.styles.width",n,e))}}),(0,Td.jsx)(Rye,{settingsPlacementKey:"popup"}),(0,Td.jsx)(Mye,{settingsPlacementKey:"popup"}),(0,Td.jsx)(_T.A,{label:_2.U.I18n.t("formPlacementDelay"),value:`${e.formPlacement.popup.delay}`,onChange:(0,Iye.compose)([t,(0,Iye.assocPath)("formPlacement.popup.delay",Iye.__,e)]),options:Lye.map((e=>({value:`${e}`,label:_2.U.I18n.t("formPlacementDelaySeconds").replace("%1s",`${e}`)})))}),(0,Td.jsx)(Oye,{settingsPlacementKey:"popup"}),(0,Td.jsxs)("div",{children:[(0,Td.jsx)("p",{children:(0,Td.jsx)("b",{children:_2.U.I18n.t("exitIntentTitle")})}),(0,Td.jsx)("p",{children:_2.U.I18n.t("exitIntentDescription")}),(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("exitIntentSwitch"),checked:e.formPlacement.popup.exitIntentEnabled,onChange:(0,Iye.compose)([t,(0,Iye.assocPath)("formPlacement.popup.exitIntentEnabled",Iye.__,e)])})]})]})]})}var zye=n(2726),Uye=n.n(zye);function Vye(){const[e,t]=(0,S.useState)(null),n=(0,Ul.A)((e=>e(A2).getFormExports()),[]),r=(0,Ul.A)((e=>e(A2).getFormSettings()),[]),o=(0,Ul.A)((e=>e(A2).isFormSaved()),[]),{changeFormSettings:i}=(0,Vl.A)(A2),s=(0,Ul.A)(A2).getThemeSupport(),a=Uye()(_2.U.I18n.t("addFormShortcodeHint"),/\[shortcode]/g,(e=>(0,Td.jsx)("code",{children:n.shortcode},e))),l=(0,I2.curry)(((e,r)=>(r.preventDefault(),_2.U.trackEvent("Forms > Embed",{"Embed type":e}),t("php"===e?n.php:n.iframe)))),c=Uye()(_2.U.I18n.t("addFormPhpIframeHint"),/\[link](.*?)\[\/link]/g,(e=>"PHP"===e?(0,Td.jsx)("a",{href:"#",onClick:l("php"),children:e},"exportPHP"):(0,Td.jsx)("a",{href:"#",onClick:l("iframe"),children:e},"exportIframe")));return o?(0,Td.jsxs)(Td.Fragment,{children:[(({hasWidgets:e,hasFSE:t})=>{if(!e&&!t)return null;let n;!0===e?n={href:"widgets.php",i18nKey:"addFormWidgetHint"}:!0===t&&(n={href:"site-editor.php",i18nKey:"addFormFSEHint"});const r=Uye()(_2.U.I18n.t(n.i18nKey),/\[link](.*?)\[\/link]/g,(e=>(0,Td.jsx)("a",{href:n.href,target:"_blank",rel:"noreferrer",children:e},"addFormWidgetHintLink")));return(0,Td.jsx)("p",{children:r})})(s),(0,Td.jsx)("p",{children:a}),(0,Td.jsx)("p",{children:c}),e?(0,Td.jsx)(A1.A,{readOnly:!0,onClick:e=>e.target.select(),rows:8,value:e,onChange:()=>{}},"copyTextArea"):null,(0,Td.jsx)("hr",{}),(0,Td.jsx)(Tye,{label:_2.U.I18n.t("formSettingsWidth"),value:r.formPlacement.others.styles.width,minPixels:200,maxPixels:1200,minPercents:10,maxPercents:100,defaultPixelValue:200,defaultPercentValue:100,onChange:e=>{i((0,Iye.assocPath)("formPlacement.others.styles.width",e,r))}})]}):(0,Td.jsx)("p",{children:_2.U.I18n.t("saveFormFirst")})}Vye.displayName="FormEditorOtherSettings";const Hye=[0,2,5,10,15,30,45,60,120,180,240];function $ye(){const e=(0,Ul.A)((e=>e(A2).getFormSettings()),[]),{changeFormSettings:t}=(0,Vl.A)(A2),n=e.formPlacement.fixedBar.enabled;return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)("p",{children:_2.U.I18n.t("placeFixedBarFormOnPagesDescription")}),(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("enable"),checked:n,onChange:(0,Iye.compose)([t,(0,Iye.assocPath)("formPlacement.fixedBar.enabled",Iye.__,e)])}),n&&(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)("hr",{}),(0,Td.jsx)(Cre.A,{label:_2.U.I18n.t("formPlacementPlacementPosition"),selected:e.formPlacement.fixedBar.position,options:[{label:_2.U.I18n.t("formPlacementPlacementPositionTop"),value:"top"},{label:_2.U.I18n.t("formPlacementPlacementPositionBottom"),value:"bottom"}],onChange:(0,Iye.compose)([t,(0,Iye.assocPath)("formPlacement.fixedBar.position",Iye.__,e)])}),(0,Td.jsx)(Tye,{label:_2.U.I18n.t("formSettingsWidth"),value:e.formPlacement.fixedBar.styles.width,minPixels:200,maxPixels:1200,minPercents:10,maxPercents:100,defaultPixelValue:560,defaultPercentValue:100,onChange:n=>{t((0,Iye.assocPath)("formPlacement.fixedBar.styles.width",n,e))}}),(0,Td.jsx)(Rye,{settingsPlacementKey:"fixedBar"}),(0,Td.jsx)(Mye,{settingsPlacementKey:"fixedBar"}),(0,Td.jsx)(_T.A,{label:_2.U.I18n.t("formPlacementDelay"),value:`${e.formPlacement.fixedBar.delay}`,onChange:(0,Iye.compose)([t,(0,Iye.assocPath)("formPlacement.fixedBar.delay",Iye.__,e)]),options:Hye.map((e=>({value:`${e}`,label:_2.U.I18n.t("formPlacementDelaySeconds").replace("%1s",`${e}`)})))}),(0,Td.jsx)(Oye,{settingsPlacementKey:"fixedBar"})]})]})}$ye.displayName="FormEditorFixedBarSettings";const Wye=[0,2,5,10,15,30,45,60,120,180,240];function Gye(){const e=(0,Ul.A)((e=>e(A2).getFormSettings()),[]),{changeFormSettings:t}=(0,Vl.A)(A2),n=e.formPlacement.slideIn.enabled;return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)("p",{children:_2.U.I18n.t("placeSlideInFormOnPagesDescription")}),(0,Td.jsx)(Hx.A,{label:_2.U.I18n.t("enable"),checked:n,onChange:(0,Iye.compose)([t,(0,Iye.assocPath)("formPlacement.slideIn.enabled",Iye.__,e)])}),n&&(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)("hr",{}),(0,Td.jsx)(Cre.A,{label:_2.U.I18n.t("formPlacementPlacementPosition"),selected:e.formPlacement.slideIn.position,options:[{label:_2.U.I18n.t("formPlacementPlacementPositionLeft"),value:"left"},{label:_2.U.I18n.t("formPlacementPlacementPositionRight"),value:"right"}],onChange:(0,Iye.compose)([t,(0,Iye.assocPath)("formPlacement.slideIn.position",Iye.__,e)])}),(0,Td.jsx)(Tye,{label:_2.U.I18n.t("formSettingsWidth"),value:e.formPlacement.slideIn.styles.width,minPixels:200,maxPixels:1200,minPercents:10,maxPercents:100,defaultPixelValue:560,defaultPercentValue:100,onChange:n=>{t((0,Iye.assocPath)("formPlacement.slideIn.styles.width",n,e))}}),(0,Td.jsx)(Rye,{settingsPlacementKey:"slideIn"}),(0,Td.jsx)(Mye,{settingsPlacementKey:"slideIn"}),(0,Td.jsx)(_T.A,{label:_2.U.I18n.t("formPlacementDelay"),value:`${e.formPlacement.slideIn.delay}`,onChange:(0,Iye.compose)([t,(0,Iye.assocPath)("formPlacement.slideIn.delay",Iye.__,e)]),options:Wye.map((e=>({value:`${e}`,label:_2.U.I18n.t("formPlacementDelaySeconds").replace("%1s",`${e}`)})))}),(0,Td.jsx)(Oye,{settingsPlacementKey:"slideIn"})]})]})}function qye({activePanel:e}){return(0,Td.jsxs)("div",{className:"mailpoet-styles-settings",children:["others"===e&&(0,Td.jsx)(v2.ErrorBoundary,{children:(0,Td.jsx)(Vye,{})}),"below_posts"===e&&(0,Td.jsx)(v2.ErrorBoundary,{children:(0,Td.jsx)(Nye,{})}),"fixed_bar"===e&&(0,Td.jsx)(v2.ErrorBoundary,{children:(0,Td.jsx)($ye,{})}),"popup"===e&&(0,Td.jsx)(v2.ErrorBoundary,{children:(0,Td.jsx)(Fye,{})}),"slide_in"===e&&(0,Td.jsx)(v2.ErrorBoundary,{children:(0,Td.jsx)(Gye,{})})]})}function Kye({onClose:e}){const t=(0,Ul.A)((e=>e(A2).getPreviewSettings()),[]);return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(kye,{closeSidebar:e,children:(0,Td.jsxs)("h3",{className:"mailpoet-sidebar-header-heading",children:["others"===t.formType&&_2.U.I18n.t("placeFormOthers"),"below_posts"===t.formType&&_2.U.I18n.t("placeFormBellowPages"),"fixed_bar"===t.formType&&_2.U.I18n.t("placeFixedBarFormOnPages"),"popup"===t.formType&&_2.U.I18n.t("placePopupFormOnPages"),"slide_in"===t.formType&&_2.U.I18n.t("placeSlideInFormOnPages")]})}),(0,Td.jsx)(F5.A,{children:(0,Td.jsx)(aF.Ay,{children:(0,Td.jsx)(qye,{activePanel:t.formType})})})]})}function Yye(){const{toggleSidebar:e,changeActiveSidebar:t}=(0,Vl.A)(A2),{activeSidebar:n,selectedBlockId:r}=(0,Ul.A)((e=>({activeSidebar:e(A2).getActiveSidebar(),selectedBlockId:e("core/block-editor").getSelectedBlockClientId()})),[]);return(0,S.useEffect)((()=>{r&&t("default")}),[r,t]),(0,Td.jsxs)("div",{className:"edit-post-sidebar interface-complementary-area mailpoet_form_editor_sidebar",children:["default"===n&&(0,Td.jsx)(Eye,{onClose:()=>{e(!1)}}),"placement_settings"===n&&(0,Td.jsx)(Kye,{onClose:()=>{t("default")}})]})}function Jye({setIsInserterOpened:e}){const t=(0,Ul.A)((e=>e(A2).getInserterPanelInsertPoint()),[]),n=(0,S.useRef)(null);return(0,Td.jsxs)("div",{className:"editor-inserter-sidebar",children:[(0,Td.jsx)("div",{className:"editor-inserter-sidebar__header",children:(0,Td.jsx)(Zv.Ay,{icon:WQ.A,onClick:()=>e(!1)})}),(0,Td.jsx)("div",{className:"editor-inserter-sidebar__content",children:(0,Td.jsx)(x1,{showMostUsedBlocks:!0,showInserterHelpPanel:!1,rootClientId:t.rootClientId??void 0,__experimentalInsertionIndex:t.insertionIndex??void 0,ref:n})})]})}function Xye(){return(0,Td.jsx)("div",{className:"editor-list-view-sidebar",children:(0,Td.jsx)("div",{className:"editor-list-view-sidebar__list-view-container",children:(0,Td.jsx)("div",{className:"editor-list-view-sidebar__list-view-panel-content",children:(0,Td.jsx)("div",{className:"edit-post-editor__list-view-container",children:(0,Td.jsx)(JX,{})})})})})}Yye.displayName="FormEditorSidebar";var Zye=n(49050);function Qye(){const e=(0,Ul.A)((e=>e(A2).getDismissibleNotices()),[]),t=(0,Ul.A)((e=>e(A2).getNonDismissibleNotices()),[]),{removeNotice:n}=(0,Vl.A)(A2),r=(0,I2.memoize)((e=>{setTimeout((()=>n(e)),5e3)}));return e.forEach((e=>r(e.id))),(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(Zye.A,{notices:t,className:"components-editor-notices__pinned"}),(0,Td.jsx)(Zye.A,{notices:e,className:"components-editor-notices__dismissible automation-dismissible-notices",onRemove:n})]})}Qye.displayName="FormEditorNotices";var eve=n(55880);const tve=()=>{const e=document.getElementById("mailpoet-form-editor-form-styles"),t=(0,Ul.A)((e=>e(A2).getFormStyles()),[]);try{eve.parse(t)}catch(t){return kW.createPortal(null,e)}const n=wq([{css:t}],".editor-styles-wrapper");return kW.createPortal(n[0],e)};function nve(){return(0,Td.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"16px",height:"24px",viewBox:"0 0 16 24",version:"1.1",children:(0,Td.jsx)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:(0,Td.jsx)("g",{className:"mailpoet_preview_icon_fill",transform:"translate(-760.000000, -64.000000)",fillRule:"nonzero",children:(0,Td.jsx)("g",{transform:"translate(712.000000, 64.000000)",children:(0,Td.jsx)("g",{transform:"translate(48.000000, 0.000000)",children:(0,Td.jsx)("path",{d:"M16,3 C16,1.34314575 14.6568542,0 13,0 L3,0 C1.34314575,0 0,1.34314575 0,3 L0,21 C0,22.6568542 1.34314575,24 3,24 L13,24 C14.6568542,24 16,22.6568542 16,21 L16,3 Z M14,5.5 L14,17.5 C14,18.0522847 13.5522847,18.5 13,18.5 L3,18.5 C2.44771525,18.5 2,18.0522847 2,17.5 L2,5.5 C2,4.94771525 2.44771525,4.5 3,4.5 L13,4.5 C13.5522847,4.5 14,4.94771525 14,5.5 Z M7,21 C7,20.4477153 7.44771525,20 8,20 C8.55228475,20 9,20.4477153 9,21 C9,21.5522847 8.55228475,22 8,22 C7.44771525,22 7,21.5522847 7,21 Z",id:"Shape"})})})})})})}function rve(){return(0,Td.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"24px",height:"24px",viewBox:"0 0 24 24",version:"1.1",children:(0,Td.jsx)("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:(0,Td.jsx)("g",{className:"mailpoet_preview_icon_fill",transform:"translate(-712.000000, -64.000000)",fillRule:"nonzero",children:(0,Td.jsx)("g",{transform:"translate(712.000000, 64.000000)",children:(0,Td.jsx)("g",{children:(0,Td.jsx)("path",{d:"M13.965,20.5 C14.1138804,20.5 14.2550143,20.5663566 14.35,20.681 L14.35,20.681 L16.449,23.213 C16.5561084,23.3657981 16.5692196,23.5655248 16.4830056,23.7310137 C16.3967915,23.8965027 16.2255996,24.0002137 16.039,24 L16.039,24 L7.96,24 C7.7734004,24.0002137 7.60220849,23.8965027 7.51599443,23.7310137 C7.42978036,23.5655248 7.44289164,23.3657981 7.55,23.213 L7.55,23.213 L9.65,20.681 C9.74498572,20.5663566 9.88611956,20.5 10.035,20.5 L10.035,20.5 Z M22.5,-4.08562073e-14 C23.3284271,-4.08562073e-14 24,0.671572875 24,1.5 L24,1.5 L24,17.5 C24,18.3284271 23.3284271,19 22.5,19 L22.5,19 L1.5,19 C0.671572875,19 0,18.3284271 0,17.5 L0,17.5 L0,1.5 C0,0.671572875 0.671572875,-4.08562073e-14 1.5,-4.08562073e-14 L1.5,-4.08562073e-14 Z M21.5,2 L2.5,2 C2.22385763,2 2,2.22385763 2,2.5 L2,2.5 L2,14.5 C2,14.7761424 2.22385763,15 2.5,15 L2.5,15 L21.5,15 C21.7761424,15 22,14.7761424 22,14.5 L22,14.5 L22,2.5 C22,2.22385763 21.7761424,2 21.5,2 L21.5,2 Z"})})})})})})}function ove({children:e,onDisplayTypeChange:t=(e=>e),selectedDisplayType:n="desktop"}){const[r,o]=(0,S.useState)(n),i=e=>{o(e),t(e)};return(0,Td.jsxs)("div",{className:"mailpoet_browser_preview",children:[(0,Td.jsxs)("div",{className:"mailpoet_browser_preview_toggle",children:[(0,Td.jsx)("a",{className:B()("mailpoet_browser_preview_icon",{mailpoet_active:"desktop"===r}),onClick:e=>{e.preventDefault(),i("desktop")},title:(0,H._x)("Desktop","Desktop browser preview mode","mailpoet"),href:"#","data-automation-id":"preview_type_desktop",children:(0,Td.jsx)(rve,{})}),(0,Td.jsx)("a",{className:B()("mailpoet_browser_preview_icon",{mailpoet_active:"mobile"===r}),onClick:e=>{e.preventDefault(),i("mobile")},title:(0,H._x)("Mobile","Mobile browser preview mode","mailpoet"),href:"#","data-automation-id":"preview_type_mobile",children:(0,Td.jsx)(nve,{})})]}),(0,Td.jsx)("div",{className:B()("mailpoet_browser_preview_container",{mailpoet_browser_preview_container_mobile:"desktop"!==r},{mailpoet_browser_preview_container_desktop:"desktop"===r}),children:(0,Td.jsx)("div",{className:"mailpoet_browser_preview_border",children:e})}),"desktop"!==r&&(0,Td.jsx)("p",{className:"mailpoet_form_preview_disclaimer",children:(0,H.__)("Psssst. Forms on mobile appear smaller automatically because it’s better for SEO.","mailpoet")})]})}function ive(){const e=(0,S.useRef)(null),[t,n]=(0,S.useState)(!1),{hidePreview:r,changePreviewSettings:o}=(0,Vl.A)(A2),i=(0,Ul.A)((e=>e(A2).getIsPreviewShown()),[]),s=(0,Ul.A)((e=>e(A2).getIsPreviewReady()),[]),a=(0,Ul.A)((e=>e(A2).getPreviewSettings()),[]),l=(0,Ul.A)((e=>e(A2).getFormSettings()),[]),c=(0,Ul.A)((e=>e(A2).getFormData().id),[]),u=(0,Ul.A)((e=>e(A2).getEditorUrl()),[]),d=(0,Ul.A)((e=>e(A2).getPreviewPageUrl()),[]);(0,S.useEffect)((()=>{n(!1);const e=document.getElementById("beacon-container");i&&e&&(e.style.display="none")}),[i]),(0,S.useEffect)((()=>{if(!e.current||!t)return;const n={formType:a.formType,formSettings:l};e.current.contentWindow.postMessage(n,d)}),[l,e,a,t,d]);const h=(0,S.useCallback)((()=>{const e=document.getElementById("beacon-container");e&&(e.style.display="block"),r()}),[r]),p=(0,S.useCallback)((e=>{n(!1),o({...a,formType:e})}),[o,a]),f=(0,S.useCallback)((e=>{o({...a,displayType:e})}),[o,a]);if(!i)return null;const m={id:c,form_type:a.formType,editor_url:u};let g=`${d}&data=${btoa(JSON.stringify(m))}`;return["below_posts"].includes(a.formType)&&(g+=`#mailpoet_form_preview_${c}`),(0,Td.jsxs)(xre.a,{onRequestClose:h,fullScreen:!0,contentClassName:"mailpoet_form_preview_modal",children:[!s&&(0,Td.jsx)("div",{className:"mailpoet_spinner_wrapper",children:(0,Td.jsx)(qE.Ay,{})}),s&&(0,Td.jsxs)("div",{className:"mailpoet_preview_content_wrapper",children:[(0,Td.jsxs)("div",{className:"mailpoet_preview_sidebar",children:[(0,Td.jsx)(_T.A,{label:_2.U.I18n.t("formPlacementLabel"),value:a.formType,onChange:p,className:"mailpoet_preview_form_type_selection","data-automation-id":"form_type_selection",options:[{value:"others",label:_2.U.I18n.t("placeFormOthers")},{value:"below_posts",label:_2.U.I18n.t("placeFormBellowPages")},{value:"fixed_bar",label:_2.U.I18n.t("placeFixedBarFormOnPages")},{value:"popup",label:_2.U.I18n.t("placePopupFormOnPages")},{value:"slide_in",label:_2.U.I18n.t("placeSlideInFormOnPages")}]}),(0,Td.jsx)(qye,{activePanel:a.formType})]}),(0,Td.jsx)(v2.ErrorBoundary,{children:(0,Td.jsxs)(ove,{onDisplayTypeChange:f,selectedDisplayType:a.displayType,children:[!t&&(0,Td.jsx)("div",{className:"mailpoet_spinner_wrapper",children:(0,Td.jsx)(qE.Ay,{})}),(0,Td.jsx)("iframe",{ref:e,className:"mailpoet_form_preview_iframe",src:g,title:_2.U.I18n.t("formPreview"),onLoad:()=>n(!0),"data-automation-id":"form_preview_iframe",scrolling:"others"===a.formType?"no":"yes"}),"others"===a.formType&&"desktop"===a.displayType&&(0,Td.jsx)("div",{className:"mailpoet_form_preview_disclaimer",children:_2.U.I18n.t("formPreviewOthersDisclaimer")})]})})]})]})}function sve({children:e}){const{fontColor:t,backgroundColor:n,gradient:r,fontSize:o,borderRadius:i,borderSize:s,borderColor:a,alignment:l,formPadding:c,backgroundImageUrl:u,backgroundImageDisplay:d,fontFamily:h}=(0,Ul.A)((e=>e(A2).getFormSettings()),[]),p=(0,Ul.A)((e=>e(A2).getPreviewSettings()),[]),f=(0,Ul.A)((e=>e(A2).getFormWidth(p.formType)),[p.formType]);let m,g,b;i&&(m=Number(i)),c&&(g=Number(c)),l&&(b=l);const y=[],v={color:t,fontSize:`${o}${Number.isNaN(Number(`${o}`||NaN))?"":"px"}`,fontFamily:h,lineHeight:1.2,borderRadius:m,textAlign:b,padding:g,width:"pixel"===f.unit?f.value:`${f.value}%`,margin:"0 auto",maxWidth:"100%"};if(s&&a&&(v.borderWidth=s,v.borderColor=a,v.borderStyle="solid"),["others","below_posts"].includes(p.formType)&&"percent"===f.unit&&(v.maxWidth=600),void 0!==u&&u){let e="center",t="no-repeat",n="cover";"fit"===d&&(n="auto",e="center top"),"tile"===d&&(t="repeat",n="auto"),y.push(`url(${u}) ${e}/${n} ${t}`)}if(r&&y.push(r),n&&y.push(n),y.length&&(v.background=y.join(", ")),"fixed_bar"===p.formType){const t={width:v.width,margin:"0 auto"};return v.width="max-content",v.minWidth="100%",v.maxWidth="auto",(0,Td.jsx)("div",{className:"mailpoet-form-background",style:v,children:(0,Td.jsx)("div",{style:t,children:e})})}return(0,Td.jsx)("div",{className:"mailpoet-form-background",style:v,children:e})}function ave(){const e=(0,Ul.A)((e=>e(A2).isFullscreenEnabled()),[]);return(0,S.useEffect)((()=>{e?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode")}),[e]),null}function lve(){const{sidebarOpened:e,isInserterOpened:t,isListViewOpened:n,formBlocks:r,canUserUpload:o,selectedBlock:i}=(0,Ul.A)((e=>({sidebarOpened:e(A2).getSidebarOpened(),isInserterOpened:e(A2).isInserterOpened(),isListViewOpened:e(A2).isListViewOpened(),formBlocks:e(A2).getFormBlocks(),canUserUpload:e("core").canUser("create","media"),selectedBlock:e("core/block-editor").getSelectedBlock()})),[]),s=B()("edit-post-layout interface-interface-skeleton",i?i.name.replace("/","-"):null,{"is-sidebar-opened":e}),{blocksChangedInBlockEditor:a,toggleInserter:l}=(0,Vl.A)(A2),c=(0,S.useMemo)((()=>({mediaUpload:o?nc:null,supportsLayout:!1,maxWidth:580,enableCustomSpacing:!0,enableCustomLineHeight:!0,disableCustomFontSizes:!1,__experimentalFetchLinkSuggestions:x2,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__experimentalSetIsInserterOpened:l,__experimentalFeatures:{spacing:{units:["px","em","rem","vh","vw","%"]},useRootPaddingAwareAlignments:!0,color:{custom:!0,text:!0,background:!0,customGradient:!0,defaultPalette:!0,palette:{default:nf.colors},gradients:{default:nf.gradients}},typography:{defaultFontSizes:!0,fontSizes:{default:E2}}}})),[o,l]);return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(vee,{}),(0,Td.jsx)(OU.Ee,{children:(0,Td.jsx)(Hl.Kq,{children:(0,Td.jsx)("div",{className:s,children:(0,Td.jsxs)("div",{className:"interface-interface-skeleton__editor",children:[(0,Td.jsx)("div",{className:"interface-interface-skeleton__header",children:(0,Td.jsx)(v2.ErrorBoundary,{children:(0,Td.jsx)(_re,{isInserterOpened:t,setIsInserterOpened:l})})}),(0,Td.jsx)("div",{className:"interface-interface-skeleton__body",children:(0,Td.jsxs)(UU,{value:r,onChange:a,settings:c,useSubRegistry:!1,children:[t&&(0,Td.jsx)("div",{className:"interface-interface-skeleton__secondary-sidebar",children:(0,Td.jsx)(Jye,{setIsInserterOpened:l})}),n&&(0,Td.jsx)("div",{className:"interface-interface-skeleton__secondary-sidebar",children:(0,Td.jsx)(Xye,{})}),(0,Td.jsxs)("div",{className:"interface-interface-skeleton__content",children:[(0,Td.jsx)(v2.ErrorBoundary,{children:(0,Td.jsx)(Qye,{})}),(0,Td.jsx)(y2.O,{storeName:"mailpoet-form-editor"}),(0,Td.jsx)(wG,{className:"edit-post-visual-editor editor-styles-wrapper",children:(0,Td.jsxs)(y1,{children:[(0,Td.jsx)(FU,{}),(0,Td.jsx)(FU.Register,{}),(0,Td.jsx)("div",{className:"mailpoet_form",children:(0,Td.jsx)(lq,{children:(0,Td.jsx)(AG,{children:(0,Td.jsx)(v2.ErrorBoundary,{children:(0,Td.jsx)(sve,{children:(0,Td.jsx)(BG,{renderAppender:!i&&SJ.ButtonBlockAppender})})})})})})]})})]}),e&&(0,Td.jsx)("div",{className:"interface-interface-skeleton__sidebar",children:(0,Td.jsx)(v2.ErrorBoundary,{children:(0,Td.jsx)(Yye,{})})})]})}),(0,Td.jsx)(v2.ErrorBoundary,{children:(0,Td.jsx)(tve,{})}),(0,Td.jsx)(v2.ErrorBoundary,{children:(0,Td.jsx)(ave,{})})]})})})}),(0,Td.jsx)(v2.ErrorBoundary,{children:(0,Td.jsx)(ive,{})}),(0,Td.jsx)(kre,{})]})}tve.displayName="FormStyles",ove.propTypes={children:k2().node.isRequired,onDisplayTypeChange:k2().func,selectedDisplayType:k2().string},ove.displayName="FormEditorPreview",ive.displayName="FormPreviewWrapper",sve.propTypes={children:k2().node.isRequired},sve.displayName="FormStylingBackground",ave.displayName="Fullscreen";var cve=n(64509);const uve="core/bold",dve=(0,H.__)("Bold"),hve={name:uve,title:dve,tagName:"strong",className:null,edit({isActive:e,value:t,onChange:n,onFocus:r}){function o(){n((0,$.toggleFormat)(t,{type:uve,title:dve}))}return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(nQ,{type:"primary",character:"b",onUse:o}),(0,Td.jsx)(rQ,{name:"bold",icon:cve.A,title:dve,onClick:function(){n((0,$.toggleFormat)(t,{type:uve})),r()},isActive:e,shortcutType:"primary",shortcutCharacter:"b"}),(0,Td.jsx)(oQ,{inputType:"formatBold",onInput:o})]})}};var pve=n(63039);const fve="core/code",mve=(0,H.__)("Inline code"),gve={name:fve,title:mve,tagName:"code",className:null,__unstableInputRule(e){const{start:t,text:n}=e;if("`"!==n[t-1])return e;if(t-2<0)return e;const r=n.lastIndexOf("`",t-2);if(-1===r)return e;const o=r,i=t-2;return o===i?e:(e=(0,$.remove)(e,o,o+1),e=(0,$.remove)(e,i,i+1),e=(0,$.applyFormat)(e,{type:fve},o,i))},edit({value:e,onChange:t,onFocus:n,isActive:r}){function o(){t((0,$.toggleFormat)(e,{type:fve,title:mve})),n()}return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(nQ,{type:"access",character:"x",onUse:o}),(0,Td.jsx)(rQ,{icon:pve.A,title:mve,onClick:o,isActive:r,role:"menuitemcheckbox"})]})}},bve=["image"],yve="core/image",vve=(0,H.__)("Inline image"),_ve={name:yve,title:vve,keywords:[(0,H.__)("photo"),(0,H.__)("media")],object:!0,tagName:"img",className:null,attributes:{className:"class",style:"style",url:"src",alt:"alt"},edit:function({value:e,onChange:t,onFocus:n,isObjectActive:r,activeObjectAttributes:o,contentRef:i}){return(0,Td.jsxs)(GE,{children:[(0,Td.jsx)(WE,{allowedTypes:bve,onSelect:({id:r,url:o,alt:i,width:s})=>{t((0,$.insertObject)(e,{type:yve,attributes:{className:`wp-image-${r}`,style:`width: ${Math.min(s,150)}px;`,url:o,alt:i}})),n()},render:({open:e})=>(0,Td.jsx)(rQ,{icon:(0,Td.jsx)(pw.t4,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Td.jsx)(pw.wA,{d:"M4 18.5h16V17H4v1.5zM16 13v1.5h4V13h-4zM5.1 15h7.8c.6 0 1.1-.5 1.1-1.1V6.1c0-.6-.5-1.1-1.1-1.1H5.1C4.5 5 4 5.5 4 6.1v7.8c0 .6.5 1.1 1.1 1.1zm.4-8.5h7V10l-1-1c-.3-.3-.8-.3-1 0l-1.6 1.5-1.2-.7c-.3-.2-.6-.2-.9 0l-1.3 1V6.5zm0 6.1l1.8-1.3 1.3.8c.3.2.7.2.9-.1l1.5-1.4 1.5 1.4v1.5h-7v-.9z"})}),title:vve,onClick:e,isActive:r})}),r&&(0,Td.jsx)(xve,{value:e,onChange:t,activeObjectAttributes:o,contentRef:i})]})}};function xve({value:e,onChange:t,activeObjectAttributes:n,contentRef:r}){const{style:o}=n,[i,s]=(0,S.useState)(o?.replace(/\D/g,"")),a=(0,$.useAnchor)({editableContentElement:r.current,settings:_ve});return(0,Td.jsx)(KC.Ay,{placement:"bottom",focusOnMount:!1,anchor:a,className:"block-editor-format-toolbar__image-popover",children:(0,Td.jsx)("form",{className:"block-editor-format-toolbar__image-container-content",onSubmit:r=>{const o=e.replacements.slice();o[e.start]={type:yve,attributes:{...n,style:i?`width: ${i}px;`:""}},t({...e,replacements:o}),r.preventDefault()},children:(0,Td.jsxs)(tA.A,{alignment:"bottom",spacing:"0",children:[(0,Td.jsx)(Kw.A,{className:"block-editor-format-toolbar__image-container-value",label:(0,H.__)("Width"),value:i,min:1,onChange:e=>s(e)}),(0,Td.jsx)(Zv.Ay,{className:"block-editor-format-toolbar__image-container-button",icon:ZE.A,label:(0,H.__)("Apply"),type:"submit"})]})})})}var wve=n(39274);const kve="core/italic",Cve=(0,H.__)("Italic"),Sve={name:kve,title:Cve,tagName:"em",className:null,edit({isActive:e,value:t,onChange:n,onFocus:r}){function o(){n((0,$.toggleFormat)(t,{type:kve,title:Cve}))}return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(nQ,{type:"primary",character:"i",onUse:o}),(0,Td.jsx)(rQ,{name:"italic",icon:wve.A,title:Cve,onClick:function(){n((0,$.toggleFormat)(t,{type:kve})),r()},isActive:e,shortcutType:"primary",shortcutCharacter:"i"}),(0,Td.jsx)(oQ,{inputType:"formatItalic",onInput:o})]})}};var Ave=n(54332),Eve=n(88569),Ive=n(58922),jve=n(84152),Tve=n(44376),Bve=n(6781),Rve=n(8094);function Nve(e){if(!e)return!1;const t=e.trim();if(!t)return!1;if(/^\S+:/.test(t)){const e=(0,OI.J)(t);if(!(0,FI.v)(e))return!1;if(e.startsWith("http")&&!/^https?:\/\/[^\/\s]/i.test(t))return!1;const n=(0,Eve.M)(t);if(!(0,Ive.W)(n))return!1;const r=(0,wI.Y)(t);if(r&&!(0,jve.o)(r))return!1;const o=(0,Tve.e)(t);if(o&&!(0,Bve._)(o))return!1;const i=(0,Rve.h)(t);if(i&&!(0,zI.R)(i))return!1}return!(t.startsWith("#")&&!(0,zI.R)(t))}function Dve(e,t,n=e.start,r=e.end){const o={start:null,end:null},{formats:i}=e;let s,a;if(!i?.length)return o;const l=i.slice(),c=l[n]?.find((({type:e})=>e===t.type)),u=l[r]?.find((({type:e})=>e===t.type)),d=l[r-1]?.find((({type:e})=>e===t.type));if(c)s=c,a=n;else if(u)s=u,a=r;else{if(!d)return o;s=d,a=r-1}const h=l[a].indexOf(s),p=[l,a,s,h];return{start:n=(n=Ove(...p))<0?0:n,end:r=Lve(...p)}}function Mve(e,t,n,r,o){let i=t;const s={forwards:1,backwards:-1}[o]||1,a=-1*s;for(;e[i]&&e[i][r]===n;)i+=s;return i+=a,i}const Pve=(e,...t)=>(...n)=>e(...n,...t),Ove=Pve(Mve,"backwards"),Lve=Pve(Mve,"forwards"),Fve=[...fj.DEFAULT_LINK_SETTINGS,{id:"nofollow",title:(0,H.__)("Mark as nofollow")}],zve=function({isActive:e,activeAttributes:t,value:n,onChange:r,onFocusOutside:o,stopAddingLink:i,contentRef:s,focusOnMount:a}){const l=function(e,t){let n=e.start,r=e.end;if(t){const t=Dve(e,{type:"core/link"});n=t.start,r=t.end+1}return(0,$.slice)(e,n,r)}(n,e).text,{selectionChange:c}=(0,Vl.A)(hv),{createPageEntity:u,userCanCreatePages:d,selectionStart:h}=(0,Ul.A)((e=>{const{getSettings:t,getSelectionStart:n}=e(hv),r=t();return{createPageEntity:r.__experimentalCreatePageEntity,userCanCreatePages:r.__experimentalUserCanCreatePages,selectionStart:n()}}),[]),p=(0,S.useMemo)((()=>({url:t.url,type:t.type,id:t.id,opensInNewTab:"_blank"===t.target,nofollow:t.rel?.includes("nofollow"),title:l})),[t.id,t.rel,t.target,t.type,t.url,l]),f=(0,$.useAnchor)({editableContentElement:s.current,settings:{...Hve,isActive:e}});return(0,Td.jsx)(KC.Ay,{anchor:f,animate:!1,onClose:i,onFocusOutside:o,placement:"bottom",offset:8,shift:!0,focusOnMount:a,constrainTabbing:!0,children:(0,Td.jsx)(fj,{value:p,onChange:function(t){const o=p?.url,s=!o;t={...p,...t};const a=(0,LI.N)(t.url),u=function({url:e,type:t,id:n,opensInNewWindow:r,nofollow:o}){const i={type:"core/link",attributes:{url:e}};return t&&(i.attributes.type=t),n&&(i.attributes.id=n),r&&(i.attributes.target="_blank",i.attributes.rel=i.attributes.rel?i.attributes.rel+" noreferrer noopener":"noreferrer noopener"),o&&(i.attributes.rel=i.attributes.rel?i.attributes.rel+" nofollow":"nofollow"),i}({url:a,type:t.type,id:void 0!==t.id&&null!==t.id?String(t.id):void 0,opensInNewWindow:t.opensInNewTab,nofollow:t.nofollow}),d=t.title||a;let f;if((0,$.isCollapsed)(n)&&!e){const e=(0,$.insert)(n,d);return f=(0,$.applyFormat)(e,u,n.start,n.start+d.length),r(f),i(),void c({clientId:h.clientId,identifier:h.attributeKey,start:n.start+d.length+1})}if(d===l)f=(0,$.applyFormat)(n,u);else{f=(0,$.create)({text:d}),f=(0,$.applyFormat)(f,u,0,d.length);const e=Dve(n,{type:"core/link"}),[t,r]=(0,$.split)(n,e.start,e.start),o=(0,$.replace)(r,l,f);f=(0,$.concat)(t,o)}r(f),s||i(),Nve(a)?e?(0,Jb.speak)((0,H.__)("Link edited."),"assertive"):(0,Jb.speak)((0,H.__)("Link inserted."),"assertive"):(0,Jb.speak)((0,H.__)("Warning: the link has been inserted but may have errors. Please test it."),"assertive")},onRemove:function(){const e=(0,$.removeFormat)(n,"core/link");r(e),i(),(0,Jb.speak)((0,H.__)("Link removed."),"assertive")},hasRichPreviews:!0,createSuggestion:u&&async function(e){const t=await u({title:e,status:"draft"});return{id:t.id,type:t.type,title:t.title.rendered,url:t.link,kind:"post-type"}},withCreateSuggestion:d,createSuggestionButtonText:function(e){return(0,uI.A)((0,H.sprintf)((0,H.__)("Create page: <mark>%s</mark>"),e),{mark:(0,Td.jsx)("mark",{})})},hasTextControl:!0,settings:Fve,showInitialSuggestions:!0,suggestionsQuery:{initialSuggestionsSearchOptions:{type:"post",subtype:"page",perPage:20}}})})},Uve="core/link",Vve=(0,H.__)("Link"),Hve={name:Uve,title:Vve,tagName:"a",className:null,attributes:{url:"href",type:"data-type",id:"data-id",_id:"id",target:"target",rel:"rel"},__unstablePasteRule(e,{html:t,plainText:n}){const r=(t||n).replace(/<[^>]+>/g,"").trim();if(!(0,sI.m)(r)||!/^https?:/.test(r))return e;window.console.log("Created link:\n\n",r);const o={type:Uve,attributes:{url:(0,Qa.decodeEntities)(r)}};return(0,$.isCollapsed)(e)?(0,$.insert)(e,(0,$.applyFormat)((0,$.create)({text:n}),o,0,n.length)):(0,$.applyFormat)(e,o)},edit:function({isActive:e,activeAttributes:t,value:n,onChange:r,onFocus:o,contentRef:i}){const[s,a]=(0,S.useState)(!1),[l,c]=(0,S.useState)(null);function u(t){const o=(0,$.getTextContent)((0,$.slice)(n));!e&&o&&(0,sI.m)(o)&&Nve(o)?r((0,$.applyFormat)(n,{type:Uve,attributes:{url:o}})):!e&&o&&(0,Ave.x)(o)?r((0,$.applyFormat)(n,{type:Uve,attributes:{url:`mailto:${o}`}})):(t&&c({el:t,action:null}),a(!0))}(0,S.useEffect)((()=>{e||a(!1)}),[e]),(0,S.useLayoutEffect)((()=>{const t=i.current;if(t)return t.addEventListener("click",n),()=>{t.removeEventListener("click",n)};function n(t){const n=t.target.closest("[contenteditable] a");n&&e&&(a(!0),c({el:n,action:"click"}))}}),[i,e]);const d=!("A"===l?.el?.tagName&&"click"===l?.action);return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(nQ,{type:"primary",character:"k",onUse:u}),(0,Td.jsx)(nQ,{type:"primaryShift",character:"k",onUse:function(){r((0,$.removeFormat)(n,Uve)),(0,Jb.speak)((0,H.__)("Link removed."),"assertive")}}),(0,Td.jsx)(rQ,{name:"link",icon:rT.A,title:e?(0,H.__)("Link"):Vve,onClick:e=>{u(e.currentTarget)},isActive:e||s,shortcutType:"primary",shortcutCharacter:"k","aria-haspopup":"true","aria-expanded":s}),s&&(0,Td.jsx)(zve,{stopAddingLink:function(){a(!1),"BUTTON"===l?.el?.tagName?l.el.focus():o(),c(null)},onFocusOutside:function(){a(!1),c(null)},isActive:e,activeAttributes:t,value:n,onChange:r,contentRef:i,focusOnMount:!!d&&"firstElement"})]})}},$ve="core/strikethrough",Wve=(0,H.__)("Strikethrough"),Gve={name:$ve,title:Wve,tagName:"s",className:null,edit({isActive:e,value:t,onChange:n,onFocus:r}){function o(){n((0,$.toggleFormat)(t,{type:$ve,title:Wve})),r()}return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(nQ,{type:"access",character:"d",onUse:o}),(0,Td.jsx)(rQ,{icon:wM.A,title:Wve,onClick:o,isActive:e,role:"menuitemcheckbox"})]})}},qve="core/underline",Kve=(0,H.__)("Underline"),Yve={name:qve,title:Kve,tagName:"span",className:null,attributes:{style:"style"},edit({value:e,onChange:t}){const n=()=>{t((0,$.toggleFormat)(e,{type:qve,attributes:{style:"text-decoration: underline;"},title:Kve}))};return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(nQ,{type:"primary",character:"u",onUse:n}),(0,Td.jsx)(oQ,{inputType:"formatUnderline",onInput:n})]})}};var Jve=n(46839),Xve=n(98875);const{lock:Zve,unlock:Qve}=(0,Nl.yf)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/format-library"),{Tabs:e_e}=Qve(d_.j),t_e=[{name:"color",title:(0,H.__)("Text")},{name:"backgroundColor",title:(0,H.__)("Background")}];function n_e(e=""){return e.split(";").reduce(((e,t)=>{if(t){const[n,r]=t.split(":");"color"===n&&(e.color=r),"background-color"===n&&r!==a_e&&(e.backgroundColor=r)}return e}),{})}function r_e(e="",t){return e.split(" ").reduce(((e,n)=>{if(n.startsWith("has-")&&n.endsWith("-color")){const r=n.replace(/^has-/,"").replace(/-color$/,""),o=Qj(t,r);e.color=o.color}return e}),{})}function o_e(e,t,n){const r=(0,$.getActiveFormat)(e,t);return r?{...n_e(r.attributes.style),...r_e(r.attributes.class,n)}:{}}function i_e({name:e,property:t,value:n,onChange:r}){const o=(0,Ul.A)((e=>{var t;const{getSettings:n}=e(hv);return null!==(t=n().colors)&&void 0!==t?t:[]}),[]),i=(0,S.useCallback)((i=>{r(function(e,t,n,r){const{color:o,backgroundColor:i}={...o_e(e,t,n),...r};if(!o&&!i)return(0,$.removeFormat)(e,t);const s=[],a=[],l={};if(i?s.push(["background-color",i].join(":")):s.push(["background-color",a_e].join(":")),o){const e=eT(n,o);e?a.push(tT("color",e.slug)):s.push(["color",o].join(":"))}return s.length&&(l.style=s.join(";")),a.length&&(l.class=a.join(" ")),(0,$.applyFormat)(e,{type:t,attributes:l})}(n,e,o,{[t]:i}))}),[o,r,t]),s=(0,S.useMemo)((()=>o_e(n,e,o)),[e,n,o]);return(0,Td.jsx)(Hz,{value:s[t],onChange:i})}function s_e({name:e,value:t,onChange:n,onClose:r,contentRef:o,isActive:i}){const s=(0,$.useAnchor)({editableContentElement:o.current,settings:{...h_e,isActive:i}});return(0,Td.jsx)(KC.Ay,{onClose:r,className:"format-library__inline-color-popover",anchor:s,children:(0,Td.jsxs)(e_e,{children:[(0,Td.jsx)(e_e.TabList,{children:t_e.map((e=>(0,Td.jsx)(e_e.Tab,{tabId:e.name,children:e.title},e.name)))}),t_e.map((r=>(0,Td.jsx)(e_e.TabPanel,{tabId:r.name,focusable:!1,children:(0,Td.jsx)(i_e,{name:e,property:r.name,value:t,onChange:n})},r.name)))]})})}const a_e="rgba(0, 0, 0, 0)",l_e="core/text-color",c_e=(0,H.__)("Highlight"),u_e=[];function d_e(e,t){const{ownerDocument:n}=e,{defaultView:r}=n,o=r.getComputedStyle(e).getPropertyValue(t);return"background-color"===t&&o===a_e&&e.parentElement?d_e(e.parentElement,t):o}const h_e={name:l_e,title:c_e,tagName:"mark",className:"has-inline-color",attributes:{style:"style",class:"class"},edit:function({value:e,onChange:t,isActive:n,activeAttributes:r,contentRef:o}){const[i,s=u_e]=fv("color.custom","color.palette"),[a,l]=(0,S.useState)(!1),c=(0,S.useCallback)((()=>l(!0)),[l]),u=(0,S.useCallback)((()=>l(!1)),[l]),d=(0,S.useMemo)((()=>function(e,{color:t,backgroundColor:n}){if(t||n)return{color:t||d_e(e,"color"),backgroundColor:n===a_e?d_e(e,"background-color"):n}}(o.current,o_e(e,l_e,s))),[e,s]),h=s.length||!i;return h||n?(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(rQ,{className:"format-library-text-color-button",isActive:n,icon:(0,Td.jsx)(lk.A,{icon:Object.keys(r).length?Jve.A:Xve.A,style:d}),title:c_e,onClick:h?c:()=>t((0,$.removeFormat)(e,l_e)),role:"menuitemcheckbox"}),a&&(0,Td.jsx)(s_e,{name:l_e,onClose:u,activeAttributes:r,value:e,onChange:t,contentRef:o,isActive:n})]}):null}};var p_e=n(97457);const f_e="core/subscript",m_e=(0,H.__)("Subscript"),g_e={name:f_e,title:m_e,tagName:"sub",className:null,edit:({isActive:e,value:t,onChange:n,onFocus:r})=>(0,Td.jsx)(rQ,{icon:p_e.A,title:m_e,onClick:function(){n((0,$.toggleFormat)(t,{type:f_e,title:m_e})),r()},isActive:e,role:"menuitemcheckbox"})};var b_e=n(76672);const y_e="core/superscript",v_e=(0,H.__)("Superscript"),__e={name:y_e,title:v_e,tagName:"sup",className:null,edit:({isActive:e,value:t,onChange:n,onFocus:r})=>(0,Td.jsx)(rQ,{icon:b_e.A,title:v_e,onClick:function(){n((0,$.toggleFormat)(t,{type:y_e,title:v_e})),r()},isActive:e,role:"menuitemcheckbox"})};var x_e=n(71230);const w_e="core/keyboard",k_e=(0,H.__)("Keyboard input"),C_e={name:w_e,title:k_e,tagName:"kbd",className:null,edit:({isActive:e,value:t,onChange:n,onFocus:r})=>(0,Td.jsx)(rQ,{icon:x_e.A,title:k_e,onClick:function(){n((0,$.toggleFormat)(t,{type:w_e,title:k_e})),r()},isActive:e,role:"menuitemcheckbox"})};var S_e=n(46545);const A_e="core/unknown",E_e=(0,H.__)("Clear Unknown Formatting"),I_e={name:A_e,title:E_e,tagName:"*",className:null,edit:({isActive:e,value:t,onChange:n,onFocus:r})=>e||function(e){return!(0,$.isCollapsed)(e)&&(0,$.slice)(e).formats.some((e=>e.some((e=>e.type===A_e))))}(t)?(0,Td.jsx)(rQ,{name:"unknown",icon:S_e.A,title:E_e,onClick:function(){n((0,$.removeFormat)(t,A_e)),r()},isActive:!0}):null};var j_e=n(45956);const T_e="core/language",B_e=(0,H.__)("Language"),R_e={name:T_e,tagName:"bdo",className:null,edit:function({isActive:e,value:t,onChange:n,contentRef:r}){const[o,i]=(0,S.useState)(!1),s=()=>{i((e=>!e))};return(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(rQ,{icon:j_e.A,label:B_e,title:B_e,onClick:()=>{e?n((0,$.removeFormat)(t,T_e)):s()},isActive:e,role:"menuitemcheckbox"}),o&&(0,Td.jsx)(N_e,{value:t,onChange:n,onClose:s,contentRef:r})]})},title:B_e};function N_e({value:e,contentRef:t,onChange:n,onClose:r}){const o=(0,$.useAnchor)({editableContentElement:t.current,settings:R_e}),[i,s]=(0,S.useState)(""),[a,l]=(0,S.useState)("ltr");return(0,Td.jsx)(KC.Ay,{className:"block-editor-format-toolbar__language-popover",anchor:o,onClose:r,children:(0,Td.jsxs)("form",{className:"block-editor-format-toolbar__language-container-content",onSubmit:t=>{t.preventDefault(),n((0,$.applyFormat)(e,{type:T_e,attributes:{lang:i,dir:a}})),r()},children:[(0,Td.jsx)(KE.A,{label:B_e,value:i,onChange:e=>s(e),help:(0,H.__)('A valid language attribute, like "en" or "fr".')}),(0,Td.jsx)(_T.A,{label:(0,H.__)("Text direction"),value:a,options:[{label:(0,H.__)("Left to right"),value:"ltr"},{label:(0,H.__)("Right to left"),value:"rtl"}],onChange:e=>l(e)}),(0,Td.jsx)(tA.A,{alignment:"right",children:(0,Td.jsx)(Zv.Ay,{variant:"primary",type:"submit",text:(0,H.__)("Apply")})})]})})}const D_e={name:"core/non-breaking-space",title:(0,H.__)("Non breaking space"),tagName:"nbsp",className:null,edit:({value:e,onChange:t})=>(0,Td.jsx)(nQ,{type:"primaryShift",character:" ",onUse:function(){t((0,$.insert)(e," "))}})};[hve,gve,_ve,Sve,Hve,Gve,Yve,h_e,g_e,__e,C_e,I_e,R_e,D_e].forEach((({name:e,...t})=>(0,$.registerFormatType)(e,t)));const M_e=(0,N.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}}),P_e=(0,Ws.A)((e=>Object.values(e.formatTypes)),(e=>[e.formatTypes]));function O_e(e,t){return e.formatTypes[t]}function L_e(e,t){const n=P_e(e);return n.find((({className:e,tagName:n})=>null===e&&t===n))||n.find((({className:e,tagName:t})=>null===e&&"*"===t))}function F_e(e,t){return P_e(e).find((({className:e})=>null!==e&&` ${t} `.indexOf(` ${e} `)>=0))}function z_e(e){return{type:"ADD_FORMAT_TYPES",formatTypes:Array.isArray(e)?e:[e]}}function U_e(e){return{type:"REMOVE_FORMAT_TYPES",names:Array.isArray(e)?e:[e]}}const V_e=(0,R.A)("core/rich-text",{reducer:M_e,selectors:x,actions:w});function H_e(e,t,n){return(e=e.slice())[t]=n,e}(0,N.register)(V_e);const $_e="mailpoet-form/font-selection",W_e=["core/paragraph","core/heading"],G_e={name:$_e,title:"Font Selection",tagName:"span",className:"mailpoet-has-font",interactive:!1,attributes:{style:"style",font:"data-font"},edit:function({value:e,onChange:t,activeAttributes:n}){const r=(0,Ul.A)((e=>e("core/block-editor").getSelectedBlock()),[]);return W_e.includes(r.name)?(0,Td.jsx)(v_,{children:(0,Td.jsx)("div",{className:"mailpoet_toolbar_item",children:(0,Td.jsx)(yee,{value:n.font,onChange:n=>{t(function(e,t,n=e.start,r=e.end){const{formats:o,activeFormats:i}=e,s=o.slice();if(n===r){const e=s[n]?.find((({type:e})=>e===t.type));if(e){const o=s[n].indexOf(e);for(;s[n]&&s[n][o]===e;)s[n]=H_e(s[n],o,t),n--;for(r++;s[r]&&s[r][o]===e;)s[r]=H_e(s[r],o,t),r++}}else{let e=1/0;for(let o=n;o<r;o++)if(s[o]){s[o]=s[o].filter((({type:e})=>e!==t.type));const n=s[o].length;n<e&&(e=n)}else s[o]=[],e=0;for(let o=n;o<r;o++)s[o].splice(e,0,t)}return function(e){const t=e.formats.slice();return t.forEach(((e,n)=>{const r=t[n-1];if(r){const o=e.slice();o.forEach(((e,t)=>{const n=r[t];(function(e,t){if(e===t)return!0;if(!e||!t)return!1;if(e.type!==t.type)return!1;const n=e.attributes,r=t.attributes;if(n===r)return!0;if(!n||!r)return!1;const o=Object.keys(n),i=Object.keys(r);if(o.length!==i.length)return!1;const s=o.length;for(let e=0;e<s;e++){const t=o[e];if(n[t]!==r[t])return!1}return!0})(e,n)&&(o[t]=n)})),t[n]=o}})),{...e,formats:t}}({...e,formats:s,activeFormats:[...i?.filter((({type:e})=>e!==t.type))||[],t]})}(e,{type:"mailpoet-form/font-selection",attributes:{style:`font-family: ${n}`,font:n}}))},name:_2.U.I18n.t("formSettingsStylesFontFamily"),hideLabelFromVision:!0})})}):null}};var q_e=n(48661),K_e=n(97550),Y_e=n(79711),J_e=n(87526),X_e=n(29975),Z_e=n(19669);const Q_e="mailpoet-form-editor-templates";var exe=n(83586);function txe(){const e=[{name:"popup",label:(0,H._x)("Pop-up","This is a text on a widget that leads to settings for form placement - form type is pop-up, it will be displayed on page in a small modal window","mailpoet")},{name:"slide_in",label:(0,H._x)("Slide–in","This is a text on a widget that leads to settings for form placement - form type is slide in","mailpoet")},{name:"fixed_bar",label:(0,H._x)("Fixed bar","This is a text on a widget that leads to settings for form placement - form type is fixed bar","mailpoet")},{name:"below_posts",label:(0,H._x)("Below pages","This is a text on a widget that leads to settings for form placement","mailpoet")},{name:"others",label:(0,H._x)("Others (widget)","Placement of the form using theme widget","mailpoet")}],t=(0,Ul.A)((e=>e(Q_e).getSelectedCategory()),[]),n=(0,Ul.A)((e=>e(Q_e).getTemplates()),[]),r=(0,Ul.A)((e=>e(Q_e).getLoading()),[]),o=(0,Ul.A)((e=>e(Q_e).getSelectTemplateFailed()),[]),{selectTemplate:i,selectCategory:s}=(0,Vl.A)(Q_e);return(0,Td.jsxs)(Td.Fragment,{children:[e.map((e=>n[e.name].map(((e,t)=>t<4&&(0,Td.jsx)("link",{rel:"preload",href:e.thumbnail,as:"image"},`thumbnail_prefetch_${e.id}`))))),(0,Td.jsx)(X_e.x,{}),o&&(0,Td.jsx)(Z_e.$,{type:"error",scroll:!0,renderInPlace:!0,children:(0,Td.jsx)("p",{children:(0,H.__)("Sorry, there was an error, please try again later.","mailpoet")})}),(0,Td.jsxs)("div",{"data-automation-id":"template_selection_list",children:[(0,Td.jsx)(K_e.V,{color:"#fff"}),(0,Td.jsxs)("div",{className:"mailpoet-form-templates",children:[(0,Td.jsx)(exe.z,{heading:(0,H.__)("Start with a template","mailpoet"),headingPrefix:(0,Td.jsx)(exe.o,{href:"?page=mailpoet-forms",label:(0,H.__)("Back to forms list","mailpoet")}),children:(0,Td.jsx)(Zv.Ay,{"data-automation-id":"create_blank_form",variant:"secondary",onClick:()=>{i("initial_form","Blank template")},children:(0,H.__)("Or, start with a blank form","mailpoet")})}),(0,Td.jsx)(q_e.L,{categories:e,active:t,onSelect:s}),n[t].map((e=>(0,Td.jsx)(J_e.c,{onSelect:()=>{i(e.id,e.name)},label:e.name,automationId:`select_template_${e.id}`,className:"mailpoet-form-template",children:(0,Td.jsx)("div",{className:"mailpoet-template-thumbnail",children:(0,Td.jsx)("img",{src:e.thumbnail,alt:e.name,width:"480",height:"317",loading:"lazy"})})},e.id))),(0,Td.jsxs)("div",{className:"mailpoet-form-template-selection-footer",children:[(0,Td.jsx)("p",{children:(0,H.__)("Can’t find a template that suits your needs?","mailpoet")}),(0,Td.jsx)(Zv.Ay,{variant:"link",onClick:()=>{i("initial_form","Blank template")},children:(0,H.__)("Start with a blank form","mailpoet")})]})]})]}),r&&(0,Td.jsx)(Y_e.R,{})]})}const nxe={getTemplates:e=>e.templates,getFormEditorUrl:e=>e.formEditorUrl,getSelectTemplateFailed:e=>e.selectTemplateFailed,getLoading:e=>e.loading,getSelectedCategory:e=>e.activeCategory},rxe=e=>(t=e,n)=>{switch(n.type){case"SELECT_TEMPLATE_ERROR":return(e=>({...e,selectTemplateFailed:!0,loading:!1}))(t);case"SELECT_TEMPLATE_START":return(e=>({...e,selectTemplateFailed:!1,loading:!0}))(t);case"SELECT_CATEGORY":return((e,t)=>({...e,activeCategory:t.category}))(t,n);default:return t}};function*oxe(e,t){yield{type:"SELECT_TEMPLATE_START"},yield{type:"TRACK_EVENT",name:"Forms > Template selected",data:{"Template id":e,"Template name":t},timeout:200};const n=(0,pc.L)(Q_e).getFormEditorUrl();return window.location.href=`${n}${e}`,{}}function ixe(e){return{type:"SELECT_CATEGORY",category:e}}var sxe=n(59276);let axe=function(e){return e.Popup="popup",e.SlideIn="slide_in",e.FixedBar="fixed_bar",e.BelowPosts="below_posts",e.Others="others",e}({});function lxe(){return(0,Td.jsx)(I.F.Provider,{value:(0,I.f)(window),children:(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(j.q,{}),(0,Td.jsx)(txe,{})]})})}const cxe=document.querySelector("#mailpoet_form_edit_templates");function uxe(){return(0,Td.jsx)(I.F.Provider,{value:(0,I.f)(window),children:(0,Td.jsxs)(Td.Fragment,{children:[(0,Td.jsx)(j.q,{}),(0,Td.jsx)(lve,{})]})})}cxe&&((0,v2.registerTranslations)(),(()=>{const e={templates:window.mailpoet_templates,formEditorUrl:window.mailpoet_form_edit_url,selectTemplateFailed:!1,loading:!1,activeCategory:axe.Popup},t={selectors:nxe,actions:k,controls:C,reducer:rxe(e),resolvers:{}},n=(0,R.A)(Q_e,t);(0,N.register)(n)})(),(0,A.H)(cxe).render((0,Td.jsx)(S.StrictMode,{children:(0,Td.jsx)(lxe,{})}))),window.addEventListener("DOMContentLoaded",(()=>{const e=document.querySelector("#mailpoet_form_edit");if(e){const t=(0,A.H)(e);E.default.use(E.default.createRootURLMiddleware(window.wpApiSettings.root)),E.default.use(E.default.createNonceMiddleware(window.wpApiSettings.nonce)),(0,Tu.addFilter)("editor.MediaUpload","mailpoet/form-editor/replace-media-upload",(()=>Jl)),(()=>{const e=window.mailpoet_custom_fields.map((e=>({...e,params:e.params||{}}))),t=ree(E2,nf.colors,nf.gradients,e),n={...window.mailpoet_form_data},r=t(n.body);delete n.body;const o={dateTypes:window.mailpoet_date_types,dateFormats:window.mailpoet_date_formats,months:window.mailpoet_month_names};n.settings.segments=n.settings.segments?n.settings.segments:[];let i,s=null;if(null!==n.id)try{s=JSON.parse(window.localStorage.getItem(`mailpoet_form_preview_settings${n.id}`)),"below_post"===s.formType&&(s.formType="below_posts")}catch(e){}try{i=JSON.parse(window.localStorage.getItem("mailpoet_form_view_options"))}catch(e){i=!1}const a={editorHistory:[],editorHistoryOffset:0,formBlocks:r,formData:gre(n),dateSettingData:o,sidebarOpened:!0,formExports:window.mailpoet_form_exports,formErrors:x5(n,r),segments:window.mailpoet_form_segments,customFields:e,isFormSaving:!1,isCustomFieldSaving:!1,isCustomFieldCreating:!1,isPreviewShown:!1,isPreviewReady:!1,isCustomFieldDeleting:!1,inserterPanel:null,isListViewOpened:!1,notices:[],hasUnsavedChanges:!1,sidebar:{activeSidebar:"default",activeTab:"form",openedPanels:["basic-settings"]},previewSettings:s,fullscreenStatus:i,editorUrl:window.location.href,formEditorUrl:window.mailpoet_form_edit_url,previewPageUrl:window.mailpoet_form_preview_page,closeIconsUrl:window.mailpoet_close_icons_url,customFonts:window.mailpoet_custom_fonts,allWpPosts:window.mailpoet_all_wp_posts,allWpPages:window.mailpoet_all_wp_pages,allWpCategories:window.mailpoet_all_wp_categories,allWpTags:window.mailpoet_all_wp_tags,allWooCommerceProducts:window.mailpoet_woocommerce_products,allWooCommerceCategories:window.mailpoet_woocommerce_categories,allWooCommerceTags:window.mailpoet_woocommerce_tags,tutorialSeen:"1"===window.mailpoet_tutorial_seen,tutorialUrl:window.mailpoet_tutorial_url,user:{isAdministrator:window.mailpoet_is_administrator},theme:{hasWidgets:window.mailpoet_theme_support_widgets,hasFSE:window.mailpoet_theme_support_fse}},l={reducer:E5(a),actions:_,selectors:j5,controls:lre,resolvers:{}},c=(0,R.A)(A2,l);(0,N.register)(c)})(),(()=>{const e=(0,pc.L)(A2).getAllAvailableCustomFields();Vee.supports.inserter=(0,pc.L)(A2).isUserAdministrator();const t=[{slug:"obligatory",title:""}];t.push({slug:"design",title:_2.U.I18n.t("layoutBlocksCategory")}),t.push({slug:"fields",title:_2.U.I18n.t("fieldsBlocksCategory")}),t.push({slug:"custom-fields",title:_2.U.I18n.t("customFieldsBlocksCategory")}),function(e){(0,fc.J)(ed).setCategories(e)}(t),_c("mailpoet-form/divider",hee),_c("mailpoet-form/email-input",mee),_c("mailpoet-form/submit-button",wee),_c("mailpoet-form/first-name-input",See),_c("mailpoet-form/last-name-input",Iee),_c("mailpoet-form/segment-select",Pee),_c("mailpoet-form/html",Vee),_c("mailpoet-form/add-custom-field",qee),_c(dte,pte),_c(xte,kte),_c(dne,pne),_c(Wte,qte),_c(nre,ore),Array.isArray(e)&&e.forEach(ire)})(),function(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,pc.L)(V_e).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,pc.L)(V_e).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,pc.L)(V_e).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,fc.J)(V_e).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.")}($_e,G_e),window.mailpoet_translations.forEach((e=>{const t=JSON.parse(e);t&&t.locale_data?.messages&&(0,H.setLocaleData)(t.locale_data.messages)})),(0,v2.registerTranslations)(),t.render((0,Td.jsx)(S.StrictMode,{children:(0,Td.jsx)(uxe,{})}))}}))},76739:e=>{e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},55880:(e,t,n)=>{t.parse=n(64512),t.stringify=n(77922)},64512:e=>{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function n(e){return e?e.replace(/^\s+|\s+$/g,""):""}function r(e,t){var n=e&&"string"==typeof e.type,o=n?e:t;for(var i in e){var s=e[i];Array.isArray(s)?s.forEach((function(e){r(e,o)})):s&&"object"==typeof s&&r(s,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}e.exports=function(e,o){o=o||{};var i=1,s=1;function a(e){var t=e.match(/\n/g);t&&(i+=t.length);var n=e.lastIndexOf("\n");s=~n?e.length-n:s+e.length}function l(){var e={line:i,column:s};return function(t){return t.position=new c(e),g(),t}}function c(e){this.start=e,this.end={line:i,column:s},this.source=o.source}c.prototype.content=e;var u=[];function d(t){var n=new Error(o.source+":"+i+":"+s+": "+t);if(n.reason=t,n.filename=o.source,n.line=i,n.column=s,n.source=e,!o.silent)throw n;u.push(n)}function h(){return m(/^{\s*/)}function p(){return m(/^}/)}function f(){var t,n,r,o=[];for(g(),b(o);e.length&&"}"!=e.charAt(0)&&(t=I()||(n=void 0,r=void 0,n=l(),(r=v())?(b(),n({type:"rule",selectors:r,declarations:x()})):d("selector missing")));)!1!==t&&(o.push(t),b(o));return o}function m(t){var n=t.exec(e);if(n){var r=n[0];return a(r),e=e.slice(r.length),n}}function g(){m(/^\s*/)}function b(e){var t;for(e=e||[];t=y();)!1!==t&&e.push(t);return e}function y(){var t=l();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return d("End of comment missing");var r=e.slice(2,n-2);return s+=2,a(r),e=e.slice(n),s+=2,t({type:"comment",comment:r})}}function v(){var e=m(/^([^{]+)/);if(e)return n(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function _(){var e=l(),r=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(r){if(r=n(r[0]),!m(/^:\s*/))return d("property missing ':'");var o=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),i=e({type:"declaration",property:r.replace(t,""),value:o?n(o[0]).replace(t,""):""});return m(/^[;\s]*/),i}}function x(){var e,t=[];if(!h())return d("missing '{'");for(b(t);e=_();)!1!==e&&(t.push(e),b(t));return p()?t:d("missing '}'")}function w(){for(var e,t=[],n=l();e=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),m(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:x()})}var k,C=E("import"),S=E("charset"),A=E("namespace");function E(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var n=l(),r=m(t);if(r){var o={type:e};return o[e]=r[1].trim(),n(o)}}}function I(){if("@"==e[0])return function(){var e=l();if(t=m(/^@([-\w]+)?keyframes\s*/)){var t,n=t[1];if(!(t=m(/^([-\w]+)\s*/)))return d("@keyframes missing name");var r,o=t[1];if(!h())return d("@keyframes missing '{'");for(var i=b();r=w();)i.push(r),i=i.concat(b());return p()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):d("@keyframes missing '}'")}}()||function(){var e=l(),t=m(/^@media *([^{]+)/);if(t){var r=n(t[1]);if(!h())return d("@media missing '{'");var o=b().concat(f());return p()?e({type:"media",media:r,rules:o}):d("@media missing '}'")}}()||function(){var e=l(),t=m(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:n(t[1]),media:n(t[2])})}()||function(){var e=l(),t=m(/^@supports *([^{]+)/);if(t){var r=n(t[1]);if(!h())return d("@supports missing '{'");var o=b().concat(f());return p()?e({type:"supports",supports:r,rules:o}):d("@supports missing '}'")}}()||C()||S()||A()||function(){var e=l(),t=m(/^@([-\w]+)?document *([^{]+)/);if(t){var r=n(t[1]),o=n(t[2]);if(!h())return d("@document missing '{'");var i=b().concat(f());return p()?e({type:"document",document:o,vendor:r,rules:i}):d("@document missing '}'")}}()||function(){var e=l();if(m(/^@page */)){var t=v()||[];if(!h())return d("@page missing '{'");for(var n,r=b();n=_();)r.push(n),r=r.concat(b());return p()?e({type:"page",selectors:t,declarations:r}):d("@page missing '}'")}}()||function(){var e=l();if(m(/^@host\s*/)){if(!h())return d("@host missing '{'");var t=b().concat(f());return p()?e({type:"host",rules:t}):d("@host missing '}'")}}()||function(){var e=l();if(m(/^@font-face\s*/)){if(!h())return d("@font-face missing '{'");for(var t,n=b();t=_();)n.push(t),n=n.concat(b());return p()?e({type:"font-face",declarations:n}):d("@font-face missing '}'")}}()}return r((k=f(),{type:"stylesheet",stylesheet:{source:o.source,rules:k,parsingErrors:u}}))}},85521:e=>{function t(e){this.options=e||{}}e.exports=t,t.prototype.emit=function(e){return e},t.prototype.visit=function(e){return this[e.type](e)},t.prototype.mapVisit=function(e,t){var n="";t=t||"";for(var r=0,o=e.length;r<o;r++)n+=this.visit(e[r]),t&&r<o-1&&(n+=this.emit(t));return n}},99948:(e,t,n)=>{var r=n(85521),o=n(18628);function i(e){r.call(this,e)}e.exports=i,o(i,r),i.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},i.prototype.comment=function(e){return this.emit("",e.position)},i.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},i.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},i.prototype.document=function(e){var t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},i.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},i.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},i.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},i.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},i.prototype.keyframe=function(e){var t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},i.prototype.page=function(e){var t=e.selectors.length?e.selectors.join(", "):"";return this.emit("@page "+t,e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},i.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},i.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},i.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},i.prototype.rule=function(e){var t=e.declarations;return t.length?this.emit(e.selectors.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}"):""},i.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")}},72166:(e,t,n)=>{var r=n(85521),o=n(18628);function i(e){e=e||{},r.call(this,e),this.indentation=e.indent}e.exports=i,o(i,r),i.prototype.compile=function(e){return this.stylesheet(e)},i.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},i.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},i.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},i.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},i.prototype.document=function(e){var t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit("  {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},i.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},i.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},i.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},i.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.keyframes,"\n")+this.emit(this.indent(-1)+"}")},i.prototype.keyframe=function(e){var t=e.declarations;return this.emit(this.indent())+this.emit(e.values.join(", "),e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(t,"\n")+this.emit(this.indent(-1)+"\n"+this.indent()+"}\n")},i.prototype.page=function(e){var t=e.selectors.length?e.selectors.join(", ")+" ":"";return this.emit("@page "+t,e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},i.prototype["font-face"]=function(e){return this.emit("@font-face ",e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},i.prototype.host=function(e){return this.emit("@host",e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},i.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},i.prototype.rule=function(e){var t=this.indent(),n=e.declarations;return n.length?this.emit(e.selectors.map((function(e){return t+e})).join(",\n"),e.position)+this.emit(" {\n")+this.emit(this.indent(1))+this.mapVisit(n,"\n")+this.emit(this.indent(-1))+this.emit("\n"+this.indent()+"}"):""},i.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},i.prototype.indent=function(e){return this.level=this.level||1,null!=e?(this.level+=e,""):Array(this.level).join(this.indentation||"  ")}},77922:(e,t,n)=>{var r=n(99948),o=n(72166);e.exports=function(e,t){var i=(t=t||{}).compress?new r(t):new o(t);if(t.sourcemap){n(31260)(i);var s=i.compile(e);return i.applySourceMaps(),{code:s,map:"generator"===t.sourcemap?i.map:i.map.toJSON()}}return i.compile(e)}},31260:(e,t,n)=>{var r=n(56116).SourceMapGenerator,o=n(56116).SourceMapConsumer,i=n(68743),s=n(54581),a=n(14993);e.exports=function(e){for(var n in e._comment=e.comment,e.map=new r,e.position={line:1,column:1},e.files={},t)e[n]=t[n]};const l=function(e){return"\\"===a.sep?e.replace(/\\/g,"/").replace(/^[a-z]:\/?/i,"/"):e};t.updatePosition=function(e){var t=e.match(/\n/g);t&&(this.position.line+=t.length);var n=e.lastIndexOf("\n");this.position.column=~n?e.length-n:this.position.column+e.length},t.emit=function(e,t){if(t){var n=l(t.source||"source.css");this.map.addMapping({source:n,generated:{line:this.position.line,column:Math.max(this.position.column-1,0)},original:{line:t.start.line,column:t.start.column-1}}),this.addFile(n,t)}return this.updatePosition(e),e},t.addFile=function(e,t){"string"==typeof t.content&&(Object.prototype.hasOwnProperty.call(this.files,e)||(this.files[e]=t.content))},t.applySourceMaps=function(){Object.keys(this.files).forEach((function(e){var t=this.files[e];if(this.map.setSourceContent(e,t),!1!==this.options.inputSourcemaps){var n=i.resolveSync(t,e,s.readFileSync);if(n){var r=new o(n.map),c=n.sourcesRelativeTo;this.map.applySourceMap(r,e,l(a.dirname(c)))}}}),this)},t.comment=function(e){return/^# sourceMappingURL=/.test(e.comment)?this.emit("",e.position):this._comment(e)}},21390:(e,t)=>{"use strict";function n(){}function r(e,t,n,r,o){for(var i=0,s=t.length,a=0,l=0;i<s;i++){var c=t[i];if(c.removed){if(c.value=e.join(r.slice(l,l+c.count)),l+=c.count,i&&t[i-1].added){var u=t[i-1];t[i-1]=t[i],t[i]=u}}else{if(!c.added&&o){var d=n.slice(a,a+c.count);d=d.map((function(e,t){var n=r[l+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(a,a+c.count));a+=c.count,c.added||(l+=c.count)}}var h=t[s-1];return s>1&&"string"==typeof h.value&&(h.added||h.removed)&&e.equals("",h.value)&&(t[s-2].value+=h.value,t.pop()),t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.callback;"function"==typeof n&&(o=n,n={}),this.options=n;var i=this;function s(e){return o?(setTimeout((function(){o(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,l=e.length,c=1,u=a+l,d=[{newPos:-1,components:[]}],h=this.extractCommon(d[0],t,e,0);if(d[0].newPos+1>=a&&h+1>=l)return s([{value:this.join(t),count:t.length}]);function p(){for(var n=-1*c;n<=c;n+=2){var o=void 0,u=d[n-1],h=d[n+1],p=(h?h.newPos:0)-n;u&&(d[n-1]=void 0);var f=u&&u.newPos+1<a,m=h&&0<=p&&p<l;if(f||m){if(!f||m&&u.newPos<h.newPos?(o={newPos:(g=h).newPos,components:g.components.slice(0)},i.pushComponent(o.components,void 0,!0)):((o=u).newPos++,i.pushComponent(o.components,!0,void 0)),p=i.extractCommon(o,t,e,n),o.newPos+1>=a&&p+1>=l)return s(r(i,o.components,t,e,i.useLongestToken));d[n]=o}else d[n]=void 0}var g;c++}if(o)!function e(){setTimeout((function(){if(c>u)return o();p()||e()}),0)}();else for(;c<=u;){var f=p();if(f)return f}},pushComponent:function(e,t,n){var r=e[e.length-1];r&&r.added===t&&r.removed===n?e[e.length-1]={count:r.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,r){for(var o=t.length,i=n.length,s=e.newPos,a=s-r,l=0;s+1<o&&a+1<i&&this.equals(t[s+1],n[a+1]);)s++,a++,l++;return l&&e.components.push({count:l}),e.newPos=s,a},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},56900:(e,t,n)=>{"use strict";var r;t.JJ=function(e,t,n){return o.diff(e,t,n)};var o=new(((r=n(21390))&&r.__esModule?r:{default:r}).default)},7040:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!=o--;){var s=i[o];if(!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n}},49781:(e,t,n)=>{var r=n(76739);e.exports=function(e){var t=r(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var o=e.style.lineHeight;e.style.lineHeight=t+"em",t=r(e,"line-height"),n=parseFloat(t,10),o?e.style.lineHeight=o:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var i=e.nodeName,s=document.createElement(i);s.innerHTML="&nbsp;","TEXTAREA"===i.toUpperCase()&&s.setAttribute("rows","1");var a=r(e,"font-size");s.style.fontSize=a,s.style.padding="0px",s.style.border="0px";var l=document.body;l.appendChild(s),n=s.offsetHeight,l.removeChild(s)}return n}},75187:(e,t,n)=>{e.exports=n(21238)},90299:e=>{"use strict";var t=!("undefined"==typeof window||!window.document||!window.document.createElement),n={canUseDOM:t,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:t&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:t&&!!window.screen,isInWorker:!t};e.exports=n},36048:e=>{var t,n,r,o,i,s,a,l,c,u,d,h,p,f,m,g=!1;function b(){if(!g){g=!0;var e=navigator.userAgent,b=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),y=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(h=/\b(iPhone|iP[ao]d)/.exec(e),p=/\b(iP[ao]d)/.exec(e),u=/Android/i.exec(e),f=/FBAN\/\w+;/i.exec(e),m=/Mobile/i.exec(e),d=!!/Win64/.exec(e),b){(t=b[1]?parseFloat(b[1]):b[5]?parseFloat(b[5]):NaN)&&document&&document.documentMode&&(t=document.documentMode);var v=/(?:Trident\/(\d+.\d+))/.exec(e);s=v?parseFloat(v[1])+4:t,n=b[2]?parseFloat(b[2]):NaN,r=b[3]?parseFloat(b[3]):NaN,(o=b[4]?parseFloat(b[4]):NaN)?(b=/(?:Chrome\/(\d+\.\d+))/.exec(e),i=b&&b[1]?parseFloat(b[1]):NaN):i=NaN}else t=n=r=i=o=NaN;if(y){if(y[1]){var _=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);a=!_||parseFloat(_[1].replace("_","."))}else a=!1;l=!!y[2],c=!!y[3]}else a=l=c=!1}}var y={ie:function(){return b()||t},ieCompatibilityMode:function(){return b()||s>t},ie64:function(){return y.ie()&&d},firefox:function(){return b()||n},opera:function(){return b()||r},webkit:function(){return b()||o},safari:function(){return y.webkit()},chrome:function(){return b()||i},windows:function(){return b()||l},osx:function(){return b()||a},linux:function(){return b()||c},iphone:function(){return b()||h},mobile:function(){return b()||h||p||u||m},nativeApp:function(){return b()||f},android:function(){return b()||u},ipad:function(){return b()||p}};e.exports=y},31186:(e,t,n)=>{"use strict";var r,o=n(90299);o.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=function(e,t){if(!o.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,i=n in document;if(!i){var s=document.createElement("div");s.setAttribute(n,"return;"),i="function"==typeof s[n]}return!i&&r&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}},21238:(e,t,n)=>{"use strict";var r=n(36048),o=n(31186);function i(e){var t=0,n=0,r=0,o=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),r=10*t,o=10*n,"deltaY"in e&&(o=e.deltaY),"deltaX"in e&&(r=e.deltaX),(r||o)&&e.deltaMode&&(1==e.deltaMode?(r*=40,o*=40):(r*=800,o*=800)),r&&!t&&(t=r<1?-1:1),o&&!n&&(n=o<1?-1:1),{spinX:t,spinY:n,pixelX:r,pixelY:o}}i.getEventType=function(){return r.firefox()?"DOMMouseScroll":o("wheel")?"wheel":"mousewheel"},e.exports=i},46051:e=>{var t=String,n=function(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t,blackBright:t,redBright:t,greenBright:t,yellowBright:t,blueBright:t,magentaBright:t,cyanBright:t,whiteBright:t,bgBlackBright:t,bgRedBright:t,bgGreenBright:t,bgYellowBright:t,bgBlueBright:t,bgMagentaBright:t,bgCyanBright:t,bgWhiteBright:t}};e.exports=n(),e.exports.createColors=n},92513:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},68868:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};n(92513);const o=r(n(45279)),i=r(n(50360));e.exports=(0,i.default)(o.default)},83461:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prefixWrapCSSSelector=t.prefixWrapCSSRule=void 0;const r=n(64075);t.prefixWrapCSSRule=(e,n,o,i,s)=>{const a=e.selector.split(",").filter((e=>!(0,r.cssRuleMatchesPrefixSelector)({selector:e},i)));0!==a.length&&(e.selector=a.map((r=>(0,t.prefixWrapCSSSelector)(r,e,n,o,i,s))).filter(r.isValidCSSSelector).join(", "))},t.prefixWrapCSSSelector=(e,t,n,o,i,s)=>{const a=(0,r.cleanSelector)(e);return""===a?null:null!==n&&a.startsWith(n,0)||(0,r.isKeyframes)(t)||o.some((e=>a.match(e)))?a:(0,r.isNotRootTag)(a)?i+" "+a:s?i+" ."+a:a.replace(/^(body|html|:root)/,i)}},64075:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cssRuleMatchesPrefixSelector=t.isNotRootTag=t.isKeyframes=t.cleanSelector=t.isValidCSSSelector=void 0;const n=/(^\s*|\s*$)/g,r=/^(body|html|:root).*$/;t.isValidCSSSelector=e=>null!==e,t.cleanSelector=e=>e.replace(n,""),t.isKeyframes=e=>{const{parent:t}=e,n=t;return void 0!==t&&"atrule"===n.type&&void 0!==n.name&&null!==n.name.match(/keyframes$/)},t.isNotRootTag=e=>!e.match(r),t.cssRuleMatchesPrefixSelector=(e,t)=>{const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${n}$`).test(e.selector)}},98467:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldIncludeFilePath=void 0,t.shouldIncludeFilePath=(e,t,n)=>t.length>0?null!=e&&t.some((t=>e.match(t))):!(n.length>0&&null!=e&&n.some((t=>e.match(t))))},31565:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.asPostCSSv7PluginGenerator=void 0;const s=i(n(82111));t.asPostCSSv7PluginGenerator=e=>e.plugin(s.PLUGIN_NAME,((e,t)=>new s.default(e,t).prefix()))},56904:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.asPostCSSv8PluginGenerator=t.isPostCSSv8=void 0;const s=i(n(82111));t.isPostCSSv8=e=>void 0!==e.Root,t.asPostCSSv8PluginGenerator=()=>(e,t)=>{const n=new s.default(e,t);return{postcssPlugin:s.PLUGIN_NAME,Once(e){n.prefixRoot(e)}}}},50360:(e,t,n)=>{"use strict";const r=n(56904),o=n(31565);e.exports=e=>(0,r.isPostCSSv8)(e)?(0,r.asPostCSSv8PluginGenerator)():(0,o.asPostCSSv7PluginGenerator)(e)},82111:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PLUGIN_NAME=void 0;const r=n(83461),o=n(98467);t.PLUGIN_NAME="postcss-prefixwrap",t.default=class{blacklist;ignoredSelectors;isPrefixSelector;prefixRootTags;prefixSelector;whitelist;nested;constructor(e,t={}){this.blacklist=t.blacklist??[],this.ignoredSelectors=t.ignoredSelectors??[],this.isPrefixSelector=new RegExp(`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`),this.prefixRootTags=t.prefixRootTags??!1,this.prefixSelector=e,this.whitelist=t.whitelist??[],this.nested=t.nested??null}prefixRoot(e){(0,o.shouldIncludeFilePath)(e.source?.input?.file,this.whitelist,this.blacklist)&&e.walkRules((e=>{(0,r.prefixWrapCSSRule)(e,this.nested,this.ignoredSelectors,this.prefixSelector,this.prefixRootTags)}))}prefix(){return e=>{this.prefixRoot(e)}}}},48790:(e,t,n)=>{const r=n(73427);e.exports=e=>{const t=Object.assign({skipHostRelativeUrls:!0},e);return{postcssPlugin:"rebaseUrl",Declaration(n){const o=r(n.value);let i=!1;o.walk((n=>{if("function"!==n.type||"url"!==n.value)return;const r=n.nodes[0].value,o=new URL(r,e.rootUrl);return o.pathname===r&&t.skipHostRelativeUrls||(n.nodes[0].value=o.toString(),i=!0),!1})),i&&(n.value=r.stringify(o))}}},e.exports.postcss=!0},73427:(e,t,n)=>{var r=n(80140),o=n(9434),i=n(90498);function s(e){return this instanceof s?(this.nodes=r(e),this):new s(e)}s.prototype.toString=function(){return Array.isArray(this.nodes)?i(this.nodes):""},s.prototype.walk=function(e,t){return o(this.nodes,e,t),this},s.unit=n(92497),s.walk=o,s.stringify=i,e.exports=s},80140:e=>{var t="(".charCodeAt(0),n=")".charCodeAt(0),r="'".charCodeAt(0),o='"'.charCodeAt(0),i="\\".charCodeAt(0),s="/".charCodeAt(0),a=",".charCodeAt(0),l=":".charCodeAt(0),c="*".charCodeAt(0),u="u".charCodeAt(0),d="U".charCodeAt(0),h="+".charCodeAt(0),p=/^[a-f0-9?-]+$/i;e.exports=function(e){for(var f,m,g,b,y,v,_,x,w,k=[],C=e,S=0,A=C.charCodeAt(S),E=C.length,I=[{nodes:k}],j=0,T="",B="",R="";S<E;)if(A<=32){f=S;do{f+=1,A=C.charCodeAt(f)}while(A<=32);b=C.slice(S,f),g=k[k.length-1],A===n&&j?R=b:g&&"div"===g.type?(g.after=b,g.sourceEndIndex+=b.length):A===a||A===l||A===s&&C.charCodeAt(f+1)!==c&&(!w||w&&"function"===w.type&&"calc"!==w.value)?B=b:k.push({type:"space",sourceIndex:S,sourceEndIndex:f,value:b}),S=f}else if(A===r||A===o){f=S,b={type:"string",sourceIndex:S,quote:m=A===r?"'":'"'};do{if(y=!1,~(f=C.indexOf(m,f+1)))for(v=f;C.charCodeAt(v-1)===i;)v-=1,y=!y;else f=(C+=m).length-1,b.unclosed=!0}while(y);b.value=C.slice(S+1,f),b.sourceEndIndex=b.unclosed?f:f+1,k.push(b),S=f+1,A=C.charCodeAt(S)}else if(A===s&&C.charCodeAt(S+1)===c)b={type:"comment",sourceIndex:S,sourceEndIndex:(f=C.indexOf("*/",S))+2},-1===f&&(b.unclosed=!0,f=C.length,b.sourceEndIndex=f),b.value=C.slice(S+2,f),k.push(b),S=f+2,A=C.charCodeAt(S);else if(A!==s&&A!==c||!w||"function"!==w.type||"calc"!==w.value)if(A===s||A===a||A===l)b=C[S],k.push({type:"div",sourceIndex:S-B.length,sourceEndIndex:S+b.length,value:b,before:B,after:""}),B="",S+=1,A=C.charCodeAt(S);else if(t===A){f=S;do{f+=1,A=C.charCodeAt(f)}while(A<=32);if(x=S,b={type:"function",sourceIndex:S-T.length,value:T,before:C.slice(x+1,f)},S=f,"url"===T&&A!==r&&A!==o){f-=1;do{if(y=!1,~(f=C.indexOf(")",f+1)))for(v=f;C.charCodeAt(v-1)===i;)v-=1,y=!y;else f=(C+=")").length-1,b.unclosed=!0}while(y);_=f;do{_-=1,A=C.charCodeAt(_)}while(A<=32);x<_?(b.nodes=S!==_+1?[{type:"word",sourceIndex:S,sourceEndIndex:_+1,value:C.slice(S,_+1)}]:[],b.unclosed&&_+1!==f?(b.after="",b.nodes.push({type:"space",sourceIndex:_+1,sourceEndIndex:f,value:C.slice(_+1,f)})):(b.after=C.slice(_+1,f),b.sourceEndIndex=f)):(b.after="",b.nodes=[]),S=f+1,b.sourceEndIndex=b.unclosed?f:S,A=C.charCodeAt(S),k.push(b)}else j+=1,b.after="",b.sourceEndIndex=S+1,k.push(b),I.push(b),k=b.nodes=[],w=b;T=""}else if(n===A&&j)S+=1,A=C.charCodeAt(S),w.after=R,w.sourceEndIndex+=R.length,R="",j-=1,I[I.length-1].sourceEndIndex=S,I.pop(),k=(w=I[j]).nodes;else{f=S;do{A===i&&(f+=1),f+=1,A=C.charCodeAt(f)}while(f<E&&!(A<=32||A===r||A===o||A===a||A===l||A===s||A===t||A===c&&w&&"function"===w.type&&"calc"===w.value||A===s&&"function"===w.type&&"calc"===w.value||A===n&&j));b=C.slice(S,f),t===A?T=b:u!==b.charCodeAt(0)&&d!==b.charCodeAt(0)||h!==b.charCodeAt(1)||!p.test(b.slice(2))?k.push({type:"word",sourceIndex:S,sourceEndIndex:f,value:b}):k.push({type:"unicode-range",sourceIndex:S,sourceEndIndex:f,value:b}),S=f}else b=C[S],k.push({type:"word",sourceIndex:S-B.length,sourceEndIndex:S+b.length,value:b}),S+=1,A=C.charCodeAt(S);for(S=I.length-1;S;S-=1)I[S].unclosed=!0,I[S].sourceEndIndex=C.length;return I[0].nodes}},90498:e=>{function t(e,t){var r,o,i=e.type,s=e.value;return t&&void 0!==(o=t(e))?o:"word"===i||"space"===i?s:"string"===i?(r=e.quote||"")+s+(e.unclosed?"":r):"comment"===i?"/*"+s+(e.unclosed?"":"*/"):"div"===i?(e.before||"")+s+(e.after||""):Array.isArray(e.nodes)?(r=n(e.nodes,t),"function"!==i?r:s+"("+(e.before||"")+r+(e.after||"")+(e.unclosed?"":")")):s}function n(e,n){var r,o;if(Array.isArray(e)){for(r="",o=e.length-1;~o;o-=1)r=t(e[o],n)+r;return r}return t(e,n)}e.exports=n},92497:e=>{var t="-".charCodeAt(0),n="+".charCodeAt(0),r=".".charCodeAt(0),o="e".charCodeAt(0),i="E".charCodeAt(0);e.exports=function(e){var s,a,l,c=0,u=e.length;if(0===u||!function(e){var o,i=e.charCodeAt(0);if(i===n||i===t){if((o=e.charCodeAt(1))>=48&&o<=57)return!0;var s=e.charCodeAt(2);return o===r&&s>=48&&s<=57}return i===r?(o=e.charCodeAt(1))>=48&&o<=57:i>=48&&i<=57}(e))return!1;for((s=e.charCodeAt(c))!==n&&s!==t||c++;c<u&&!((s=e.charCodeAt(c))<48||s>57);)c+=1;if(s=e.charCodeAt(c),a=e.charCodeAt(c+1),s===r&&a>=48&&a<=57)for(c+=2;c<u&&!((s=e.charCodeAt(c))<48||s>57);)c+=1;if(s=e.charCodeAt(c),a=e.charCodeAt(c+1),l=e.charCodeAt(c+2),(s===o||s===i)&&(a>=48&&a<=57||(a===n||a===t)&&l>=48&&l<=57))for(c+=a===n||a===t?3:2;c<u&&!((s=e.charCodeAt(c))<48||s>57);)c+=1;return{number:e.slice(0,c),unit:e.slice(c)}}},9434:e=>{e.exports=function e(t,n,r){var o,i,s,a;for(o=0,i=t.length;o<i;o+=1)s=t[o],r||(a=n(s,o,t)),!1!==a&&"function"===s.type&&Array.isArray(s.nodes)&&e(s.nodes,n,r),r&&n(s,o,t)}},59884:(e,t,n)=>{"use strict";let r=n(13729);class o extends r{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}e.exports=o,o.default=o,r.registerAtRule(o)},88827:(e,t,n)=>{"use strict";let r=n(75472);class o extends r{constructor(e){super(e),this.type="comment"}}e.exports=o,o.default=o},13729:(e,t,n)=>{"use strict";let r,o,i,s,a=n(88827),l=n(90214),c=n(75472),{isClean:u,my:d}=n(97943);function h(e){return e.map((e=>(e.nodes&&(e.nodes=h(e.nodes)),delete e.source,e)))}function p(e){if(e[u]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)p(t)}class f extends c{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,n,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[r]+=1;return delete this.indexes[r],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map((e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e))):"every"===t||"some"===t?n=>e[t](((e,...t)=>n(e.toProxy(),...t))):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map((e=>e.toProxy())):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n,r=this.index(e),o=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let e of o)this.proxyOf.nodes.splice(r+1,0,e);for(let e in this.indexes)n=this.indexes[e],r<n&&(this.indexes[e]=n+o.length);return this.markDirty(),this}insertBefore(e,t){let n,r=this.index(e),o=0===r&&"prepend",i=this.normalize(t,this.proxyOf.nodes[r],o).reverse();r=this.index(e);for(let e of i)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)n=this.indexes[e],r<=n&&(this.indexes[e]=n+i.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=h(o(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e)){e=e.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if("root"===e.type&&"document"!==this.type){e=e.nodes.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new l(e)]}else if(e.selector||e.selectors)e=[new s(e)];else if(e.name)e=[new r(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new a(e)]}return e.map((e=>(e[d]||f.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[u]&&p(e),e.raws||(e.raws={}),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e)))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls((r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))})),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each(((t,n)=>{let r;try{r=e(t,n)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(e)),r}))}walkAtRules(e,t){return t?e instanceof RegExp?this.walk(((n,r)=>{if("atrule"===n.type&&e.test(n.name))return t(n,r)})):this.walk(((n,r)=>{if("atrule"===n.type&&n.name===e)return t(n,r)})):(t=e,this.walk(((e,n)=>{if("atrule"===e.type)return t(e,n)})))}walkComments(e){return this.walk(((t,n)=>{if("comment"===t.type)return e(t,n)}))}walkDecls(e,t){return t?e instanceof RegExp?this.walk(((n,r)=>{if("decl"===n.type&&e.test(n.prop))return t(n,r)})):this.walk(((n,r)=>{if("decl"===n.type&&n.prop===e)return t(n,r)})):(t=e,this.walk(((e,n)=>{if("decl"===e.type)return t(e,n)})))}walkRules(e,t){return t?e instanceof RegExp?this.walk(((n,r)=>{if("rule"===n.type&&e.test(n.selector))return t(n,r)})):this.walk(((n,r)=>{if("rule"===n.type&&n.selector===e)return t(n,r)})):(t=e,this.walk(((e,n)=>{if("rule"===e.type)return t(e,n)})))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}f.registerParse=e=>{o=e},f.registerRule=e=>{s=e},f.registerAtRule=e=>{r=e},f.registerRoot=e=>{i=e},e.exports=f,f.default=f,f.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,r.prototype):"rule"===e.type?Object.setPrototypeOf(e,s.prototype):"decl"===e.type?Object.setPrototypeOf(e,l.prototype):"comment"===e.type?Object.setPrototypeOf(e,a.prototype):"root"===e.type&&Object.setPrototypeOf(e,i.prototype),e[d]=!0,e.nodes&&e.nodes.forEach((e=>{f.rebuild(e)}))}},47457:(e,t,n)=>{"use strict";let r=n(46051),o=n(11126);class i extends Error{constructor(e,t,n,r,o,s){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),r&&(this.source=r),s&&(this.plugin=s),void 0!==t&&void 0!==n&&("number"==typeof t?(this.line=t,this.column=n):(this.line=t.line,this.column=t.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,i)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=r.isColorSupported);let n=e=>e,i=e=>e,s=e=>e;if(e){let{bold:e,gray:t,red:a}=r.createColors(!0);i=t=>e(a(t)),n=e=>t(e),o&&(s=e=>o(e))}let a=t.split(/\r?\n/),l=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),u=String(c).length;return a.slice(l,c).map(((e,t)=>{let r=l+1+t,o=" "+(" "+r).slice(-u)+" | ";if(r===this.line){if(e.length>160){let t=20,r=Math.max(0,this.column-t),a=Math.max(this.column+t,this.endColumn+t),l=e.slice(r,a),c=n(o.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,t-1)).replace(/[^\t]/g," ");return i(">")+n(o)+s(l)+"\n "+c+i("^")}let t=n(o.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+n(o)+s(e)+"\n "+t+i("^")}return" "+n(o)+s(e)})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}}e.exports=i,i.default=i},90214:(e,t,n)=>{"use strict";let r=n(75472);class o extends r{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}e.exports=o,o.default=o},44433:(e,t,n)=>{"use strict";let r,o,i=n(13729);class s extends i{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new r(new o,this,e).stringify()}}s.registerLazyResult=e=>{r=e},s.registerProcessor=e=>{o=e},e.exports=s,s.default=s},13598:(e,t,n)=>{"use strict";let r=n(59884),o=n(88827),i=n(90214),s=n(30002),a=n(68214),l=n(30124),c=n(42718);function u(e,t){if(Array.isArray(e))return e.map((e=>u(e)));let{inputs:n,...d}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:s.prototype};n.map&&(n.map={...n.map,__proto__:a.prototype}),t.push(n)}}if(d.nodes&&(d.nodes=e.nodes.map((e=>u(e,t)))),d.source){let{inputId:e,...n}=d.source;d.source=n,null!=e&&(d.source.input=t[e])}if("root"===d.type)return new l(d);if("decl"===d.type)return new i(d);if("rule"===d.type)return new c(d);if("comment"===d.type)return new o(d);if("atrule"===d.type)return new r(d);throw new Error("Unknown node type: "+e.type)}e.exports=u,u.default=u},30002:(e,t,n)=>{"use strict";let{nanoid:r}=n(32067),{isAbsolute:o,resolve:i}=n(86529),{SourceMapConsumer:s,SourceMapGenerator:a}=n(30150),{fileURLToPath:l,pathToFileURL:c}=n(87189),u=n(47457),d=n(68214),h=n(11126),p=Symbol("fromOffsetCache"),f=Boolean(s&&a),m=Boolean(i&&o);class g{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!m||/^\w+:\/\//.test(t.from)||o(t.from)?this.file=t.from:this.file=i(t.from)),m&&f){let e=new d(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+r(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,r={}){let o,i,s;if(t&&"object"==typeof t){let e=t,r=n;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);i=e.line,o=e.col}else i=r.line,o=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let a=this.origin(t,n,i,o);return s=a?new u(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,r.plugin):new u(e,void 0===i?t:{column:n,line:t},void 0===i?n:{column:o,line:i},this.css,this.file,r.plugin),s.input={column:n,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(c&&(s.input.url=c(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,n;if(this[p])n=this[p];else{let e=this.css.split("\n");n=new Array(e.length);let t=0;for(let r=0,o=e.length;r<o;r++)n[r]=t,t+=e[r].length+1;this[p]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t,o=n.length-2;for(;r<o;)if(t=r+(o-r>>1),e<n[t])o=t-1;else{if(!(e>=n[t+1])){r=t;break}r=t+1}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:i(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,r){if(!this.map)return!1;let i,s,a=this.map.consumer(),u=a.originalPositionFor({column:t,line:e});if(!u.source)return!1;"number"==typeof n&&(i=a.originalPositionFor({column:r,line:n})),s=o(u.source)?c(u.source):new URL(u.source,this.map.consumer().sourceRoot||c(this.map.mapFile));let d={column:u.column,endColumn:i&&i.column,endLine:i&&i.line,line:u.line,url:s.toString()};if("file:"===s.protocol){if(!l)throw new Error("file: protocol is not available in this PostCSS build");d.file=l(s)}let h=a.sourceContentFor(u.source);return h&&(d.source=h),d}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}e.exports=g,g.default=g,h&&h.registerInput&&h.registerInput(g)},59910:(e,t,n)=>{"use strict";let r=n(13729),o=n(44433),i=n(27044),s=n(29449),a=n(86421),l=n(30124),c=n(83175),{isClean:u,my:d}=n(97943);n(98636);const h={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},p={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},f={Once:!0,postcssPlugin:!0,prepare:!0},m=0;function g(e){return"object"==typeof e&&"function"==typeof e.then}function b(e){let t=!1,n=h[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,m,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,m,n+"Exit"]:[n,n+"Exit"]}function y(e){let t;return t="document"===e.type?["Document",m,"DocumentExit"]:"root"===e.type?["Root",m,"RootExit"]:b(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function v(e){return e[u]=!1,e.nodes&&e.nodes.forEach((e=>v(e))),e}let _={};class x{constructor(e,t,n){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof x||t instanceof a)o=v(t.root),t.map&&(void 0===n.map&&(n.map={}),n.map.inline||(n.map.inline=!1),n.map.prev=t.map);else{let e=s;n.syntax&&(e=n.syntax.parse),n.parser&&(e=n.parser),e.parse&&(e=e.parse);try{o=e(t,n)}catch(e){this.processed=!0,this.error=e}o&&!o[d]&&r.rebuild(o)}else o=v(t);this.result=new a(e,o,n),this.helpers={..._,postcss:_,result:this.result},this.plugins=this.processor.plugins.map((e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e))}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin?n.postcssVersion:(e.plugin=n.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if("object"==typeof t)for(let n in t){if(!p[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!f[n])if("object"==typeof t[n])for(let r in t[n])e(t,"*"===r?n:n+"-"+r.toLowerCase(),t[n][r]);else"function"==typeof t[n]&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(g(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[u];){e[u]=!0;let t=[y(e)];for(;t.length>0;){let e=this.visitTick(t);if(g(e))try{await e}catch(e){let n=t[t.length-1].node;throw this.handleError(e,n)}}}if(this.listeners.OnceExit)for(let[t,n]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map((e=>n(e,this.helpers)));await Promise.all(t)}else await n(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map((t=>e.Once(t,this.helpers)));return g(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=c;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new i(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(g(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[u];)e[u]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,r]of e){let e;this.result.lastPlugin=n;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(g(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:r}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,o]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return o(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){let r,o=t.iterator;for(;r=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!r[u])return r[u]=!0,void e.push(y(r));t.iterator=0,delete n.indexes[o]}let o=t.events;for(;t.eventIndex<o.length;){let e=o[t.eventIndex];if(t.eventIndex+=1,e===m)return void(n.nodes&&n.nodes.length&&(n[u]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[u]=!0;let t=b(e);for(let n of t)if(n===m)e.nodes&&e.each((e=>{e[u]||this.walkSync(e)}));else{let t=this.listeners[n];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}x.registerPostcss=e=>{_=e},e.exports=x,x.default=x,l.registerLazyResult(x),o.registerLazyResult(x)},99960:e=>{"use strict";let t={comma:e=>t.split(e,[","],!0),space:e=>t.split(e,[" ","\n","\t"]),split(e,t,n){let r=[],o="",i=!1,s=0,a=!1,l="",c=!1;for(let n of e)c?c=!1:"\\"===n?c=!0:a?n===l&&(a=!1):'"'===n||"'"===n?(a=!0,l=n):"("===n?s+=1:")"===n?s>0&&(s-=1):0===s&&t.includes(n)&&(i=!0),i?(""!==o&&r.push(o.trim()),o="",i=!1):o+=n;return(n||""!==o)&&r.push(o.trim()),r}};e.exports=t,t.default=t},27044:(e,t,n)=>{"use strict";let{dirname:r,relative:o,resolve:i,sep:s}=n(86529),{SourceMapConsumer:a,SourceMapGenerator:l}=n(30150),{pathToFileURL:c}=n(87189),u=n(30002),d=Boolean(a&&l),h=Boolean(r&&i&&o&&s);e.exports=class{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,n=this.toUrl(this.path(e.file)),o=e.root||r(e.file);!1===this.mapOpts.sourcesContent?(t=new a(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,n,this.toUrl(this.path(o)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),h&&d&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,(t=>{e+=t})),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=l.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new l({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new l({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,r=1,o="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((s,a,l)=>{if(this.css+=s,a&&"end"!==l&&(i.generated.line=n,i.generated.column=r-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=o,i.original.line=1,i.original.column=0,this.map.addMapping(i))),t=s.match(/\n/g),t?(n+=t.length,e=s.lastIndexOf("\n"),r=s.length-e):r+=s.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=n,i.generated.column=r-2,this.map.addMapping(i)):(i.source=o,i.original.line=1,i.original.column=0,i.generated.line=n,i.generated.column=r-1,this.map.addMapping(i)))}}))}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some((e=>e.annotation)))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some((e=>e.inline)))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some((e=>e.withContent()))}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let n=this.opts.to?r(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=r(i(n,this.mapOpts.annotation)));let s=o(n,e);return this.memoizedPaths.set(e,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}}));else{let e=new u(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk((t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(r,t.source.input.css)}}}));else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(c){let t=c(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===s&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}}},2483:(e,t,n)=>{"use strict";let r=n(27044),o=n(29449);const i=n(86421);let s=n(83175);n(98636);class a{constructor(e,t,n){let o;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let a=s;this.result=new i(this._processor,o,this._opts),this.result.css=t;let l=this;Object.defineProperty(this.result,"root",{get:()=>l.root});let c=new r(a,o,this._opts,t);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=o;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}}e.exports=a,a.default=a},75472:(e,t,n)=>{"use strict";let r=n(47457),o=n(87828),i=n(83175),{isClean:s,my:a}=n(97943);function l(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let o=e[r],i=typeof o;"parent"===r&&"object"===i?t&&(n[r]=t):"source"===r?n[r]=o:Array.isArray(o)?n[r]=o.map((e=>l(e,n))):("object"===i&&null!==o&&(o=l(o)),n[r]=o)}return n}function c(e,t){if(t&&void 0!==t.offset)return t.offset;let n=1,r=1,o=0;for(let i=0;i<e.length;i++){if(r===t.line&&n===t.column){o=i;break}"\n"===e[i]?(n=1,r+=1):n+=1}return o}class u{constructor(e={}){this.raws={},this[s]=!1,this[a]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=l(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new r(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markClean(){this[s]=!0}markDirty(){if(this[s]){this[s]=!1;let e=this;for(;e=e.parent;)e[s]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e){let t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){let n=this.source.input.css.slice(c(this.source.input.css,this.source.start),c(this.source.input.css,this.source.end)).indexOf(e.word);-1!==n&&(t=this.positionInside(n))}return t}positionInside(e){let t=this.source.start.column,n=this.source.start.line,r=c(this.source.input.css,this.source.start),o=r+e;for(let e=r;e<o;e++)"\n"===this.source.input.css[e]?(t=1,n+=1):t+=1;return{column:t,line:n}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let r=this.source.input.css.slice(c(this.source.input.css,this.source.start),c(this.source.input.css,this.source.end)).indexOf(e.word);-1!==r&&(t=this.positionInside(r),n=this.positionInside(r+e.word.length))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return(new o).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},r=null==t;t=t||new Map;let o=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let r=this[e];if(Array.isArray(r))n[e]=r.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e));else if("object"==typeof r&&r.toJSON)n[e]=r.toJSON(null,t);else if("source"===e){let i=t.get(r.input);null==i&&(i=o,t.set(r.input,o),o++),n[e]={end:r.end,inputId:i,start:r.start}}else n[e]=r}return r&&(n.inputs=[...t.keys()].map((e=>e.toJSON()))),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=i){e.stringify&&(e=e.stringify);let t="";return e(this,(e=>{t+=e})),t}warn(e,t,n){let r={node:this};for(let e in n)r[e]=n[e];return e.warn(t,r)}get proxyOf(){return this}}e.exports=u,u.default=u},29449:(e,t,n)=>{"use strict";let r=n(13729),o=n(30002),i=n(51795);function s(e,t){let n=new o(e,t),r=new i(n);try{r.parse()}catch(e){throw e}return r.root}e.exports=s,s.default=s,r.registerParse(s)},51795:(e,t,n)=>{"use strict";let r=n(59884),o=n(88827),i=n(90214),s=n(30124),a=n(42718),l=n(60757);const c={empty:!0,space:!0};e.exports=class{constructor(e){this.input=e,this.root=new s,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,n,o,i=new r;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let s=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(l.length>0){for(o=l.length-1,n=l[o];n&&"space"===n[0];)n=l[--o];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}l.push(e)}else l.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(i.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(i,"params",l),s&&(e=l[l.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),a&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,r=0;for(let o=t-1;o>=0&&(n=e[o],"space"===n[0]||(r+=1,2!==r));o--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,r,o=0;for(let[i,s]of e.entries()){if(n=s,r=n[0],"("===r&&(o+=1),")"===r&&(o-=1),0===o&&":"===r){if(t){if("word"===t[0]&&"progid"===t[1])continue;return i}this.doubleColon(n)}t=n}return!1}comment(e){let t=new o;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=l(this.input)}decl(e,t){let n=new i;this.init(n,e[0][2]);let r,o=e[e.length-1];for(";"===o[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(o[3]||o[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let s,a=[];for(;e.length&&(s=e[0][0],"space"===s||"comment"===s);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(r=e[t],"!important"===r[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===r[1].toLowerCase()){let r=e.slice(0),o="";for(let e=t;e>0;e--){let t=r[e][0];if(o.trim().startsWith("!")&&"space"!==t)break;o=r.pop()[1]+o}o.trim().startsWith("!")&&(n.important=!0,n.raws.important=o,e=r)}if("space"!==r[0]&&"comment"!==r[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(n.raws.between+=a.map((e=>e[1])).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new a;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,o=null,i=[],s=e[1].startsWith("--"),a=[],l=e;for(;l;){if(n=l[0],a.push(l),"("===n||"["===n)o||(o=l),i.push("("===n?")":"]");else if(s&&r&&"{"===n)o||(o=l),i.push("}");else if(0===i.length){if(";"===n){if(r)return void this.decl(a,s);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(r=!0)}else n===i[i.length-1]&&(i.pop(),0===i.length&&(o=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(o),t&&r){if(!s)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,r){let o,i,s,a,l=n.length,u="",d=!0;for(let e=0;e<l;e+=1)o=n[e],i=o[0],"space"!==i||e!==l-1||r?"comment"===i?(a=n[e-1]?n[e-1][0]:"empty",s=n[e+1]?n[e+1][0]:"empty",c[a]||c[s]||","===u.slice(-1)?d=!1:u+=o[1]):u+=o[1]:d=!1;if(!d){let r=n.reduce(((e,t)=>e+t[1]),"");e.raws[t]={raw:r,value:u}}e[t]=u}rule(e){e.pop();let t=new a;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n="";for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}},45279:(e,t,n)=>{"use strict";let r=n(59884),o=n(88827),i=n(13729),s=n(47457),a=n(90214),l=n(44433),c=n(13598),u=n(30002),d=n(59910),h=n(99960),p=n(75472),f=n(29449),m=n(59566),g=n(86421),b=n(30124),y=n(42718),v=n(83175),_=n(37062);function x(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new m(e)}x.plugin=function(e,t){let n,r=!1;function o(...n){console&&console.warn&&!r&&(r=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let o=t(...n);return o.postcssPlugin=e,o.postcssVersion=(new m).version,o}return Object.defineProperty(o,"postcss",{get:()=>(n||(n=o()),n)}),o.process=function(e,t,n){return x([o(n)]).process(e,t)},o},x.stringify=v,x.parse=f,x.fromJSON=c,x.list=h,x.comment=e=>new o(e),x.atRule=e=>new r(e),x.decl=e=>new a(e),x.rule=e=>new y(e),x.root=e=>new b(e),x.document=e=>new l(e),x.CssSyntaxError=s,x.Declaration=a,x.Container=i,x.Processor=m,x.Document=l,x.Comment=o,x.Warning=_,x.AtRule=r,x.Result=g,x.Input=u,x.Rule=y,x.Root=b,x.Node=p,d.registerPostcss(x),e.exports=x,x.default=x},68214:(e,t,n)=>{"use strict";let{existsSync:r,readFileSync:o}=n(14917),{dirname:i,join:s}=n(86529),{SourceMapConsumer:a,SourceMapGenerator:l}=n(30150);class c{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=i(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new a(this.text)),this.consumerCache}decodeInline(e){let t=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(t)return decodeURIComponent(e.substr(t[0].length));let n=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(n)return r=e.substr(n[0].length),Buffer?Buffer.from(r,"base64").toString():window.atob(r);var r;let o=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+o)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/g);if(!t)return;let n=e.lastIndexOf(t.pop()),r=e.indexOf("*/",n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e){if(this.root=i(e),r(e))return this.mapFile=e,o(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof a)return l.fromSourceMap(t).toString();if(t instanceof l)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=s(i(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}e.exports=c,c.default=c},59566:(e,t,n)=>{"use strict";let r=n(44433),o=n(59910),i=n(2483),s=n(30124);class a{constructor(e=[]){this.version="8.4.49",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" is not a PostCSS plugin");return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new o(this,e,t):new i(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}e.exports=a,a.default=a,s.registerProcessor(a),r.registerProcessor(a)},86421:(e,t,n)=>{"use strict";let r=n(37062);class o{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let n=new r(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}}e.exports=o,o.default=o},30124:(e,t,n)=>{"use strict";let r,o,i=n(13729);class s extends i{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let r=super.normalize(e);if(t)if("prepend"===n)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before;return r}removeChild(e,t){let n=this.index(e);return!t&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new r(new o,this,e).stringify()}}s.registerLazyResult=e=>{r=e},s.registerProcessor=e=>{o=e},e.exports=s,s.default=s,i.registerRoot(s)},42718:(e,t,n)=>{"use strict";let r=n(13729),o=n(99960);class i extends r{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return o.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}}e.exports=i,i.default=i,r.registerRule(i)},87828:e=>{"use strict";const t={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:"    ",semicolon:!1};class n{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{let o=(e.raws.between||"")+(t?";":"");this.builder(n+r+o,e)}}beforeAfter(e,t){let n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let r=e.parent,o=0;for(;r&&"root"!==r.type;)o+=1,r=r.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<o;e++)n+=t}return n}block(e,t){let n,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let o=e.nodes[r],i=this.raw(o,"before");i&&this.builder(i),this.stringify(o,t!==r||n)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}decl(e,t){let n=this.raw(e,"between","colon"),r=e.prop+n+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}document(e){this.body(e)}raw(e,n,r){let o;if(r||(r=n),n&&(o=e.raws[n],void 0!==o))return o;let i=e.parent;if("before"===r){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return t[r];let s=e.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[r])return s.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let t="raw"+((a=r)[0].toUpperCase()+a.slice(1));this[t]?o=this[t](s,e):s.walk((e=>{if(o=e.raws[n],void 0!==o)return!1}))}var a;return void 0===o&&(o=t[r]),s.rawCache[r]=o,o}rawBeforeClose(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let n;return e.walkComments((e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1})),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls((e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1})),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(e){let t;return e.walk((e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1})),t}rawBeforeRule(e){let t;return e.walk((n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1})),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls((e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1})),t}rawEmptyBody(e){let t;return e.walk((e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1})),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk((n=>{let r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==n.raws.before){let e=n.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}})),t}rawSemicolon(e){let t;return e.walk((e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1})),t}rawValue(e,t){let n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}}e.exports=n,n.default=n},83175:(e,t,n)=>{"use strict";let r=n(87828);function o(e,t){new r(t).stringify(e)}e.exports=o,o.default=o},97943:e=>{"use strict";e.exports.isClean=Symbol("isClean"),e.exports.my=Symbol("my")},60757:e=>{"use strict";const t="'".charCodeAt(0),n='"'.charCodeAt(0),r="\\".charCodeAt(0),o="/".charCodeAt(0),i="\n".charCodeAt(0),s=" ".charCodeAt(0),a="\f".charCodeAt(0),l="\t".charCodeAt(0),c="\r".charCodeAt(0),u="[".charCodeAt(0),d="]".charCodeAt(0),h="(".charCodeAt(0),p=")".charCodeAt(0),f="{".charCodeAt(0),m="}".charCodeAt(0),g=";".charCodeAt(0),b="*".charCodeAt(0),y=":".charCodeAt(0),v="@".charCodeAt(0),_=/[\t\n\f\r "#'()/;[\\\]{}]/g,x=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,w=/.[\r\n"'(/\\]/,k=/[\da-f]/i;e.exports=function(e,C={}){let S,A,E,I,j,T,B,R,N,D,M=e.css.valueOf(),P=C.ignoreErrors,O=M.length,L=0,F=[],z=[];function U(t){throw e.error("Unclosed "+t,L)}return{back:function(e){z.push(e)},endOfFile:function(){return 0===z.length&&L>=O},nextToken:function(e){if(z.length)return z.pop();if(L>=O)return;let C=!!e&&e.ignoreUnclosed;switch(S=M.charCodeAt(L),S){case i:case s:case l:case c:case a:I=L;do{I+=1,S=M.charCodeAt(I)}while(S===s||S===i||S===l||S===c||S===a);T=["space",M.slice(L,I)],L=I-1;break;case u:case d:case f:case m:case y:case g:case p:{let e=String.fromCharCode(S);T=[e,e,L];break}case h:if(D=F.length?F.pop()[1]:"",N=M.charCodeAt(L+1),"url"===D&&N!==t&&N!==n&&N!==s&&N!==i&&N!==l&&N!==a&&N!==c){I=L;do{if(B=!1,I=M.indexOf(")",I+1),-1===I){if(P||C){I=L;break}U("bracket")}for(R=I;M.charCodeAt(R-1)===r;)R-=1,B=!B}while(B);T=["brackets",M.slice(L,I+1),L,I],L=I}else I=M.indexOf(")",L+1),A=M.slice(L,I+1),-1===I||w.test(A)?T=["(","(",L]:(T=["brackets",A,L,I],L=I);break;case t:case n:j=S===t?"'":'"',I=L;do{if(B=!1,I=M.indexOf(j,I+1),-1===I){if(P||C){I=L+1;break}U("string")}for(R=I;M.charCodeAt(R-1)===r;)R-=1,B=!B}while(B);T=["string",M.slice(L,I+1),L,I],L=I;break;case v:_.lastIndex=L+1,_.test(M),I=0===_.lastIndex?M.length-1:_.lastIndex-2,T=["at-word",M.slice(L,I+1),L,I],L=I;break;case r:for(I=L,E=!0;M.charCodeAt(I+1)===r;)I+=1,E=!E;if(S=M.charCodeAt(I+1),E&&S!==o&&S!==s&&S!==i&&S!==l&&S!==c&&S!==a&&(I+=1,k.test(M.charAt(I)))){for(;k.test(M.charAt(I+1));)I+=1;M.charCodeAt(I+1)===s&&(I+=1)}T=["word",M.slice(L,I+1),L,I],L=I;break;default:S===o&&M.charCodeAt(L+1)===b?(I=M.indexOf("*/",L+2)+1,0===I&&(P||C?I=M.length:U("comment")),T=["comment",M.slice(L,I+1),L,I],L=I):(x.lastIndex=L+1,x.test(M),I=0===x.lastIndex?M.length-1:x.lastIndex-2,T=["word",M.slice(L,I+1),L,I],F.push(T),L=I)}return L++,T},position:function(){return L}}}},98636:e=>{"use strict";let t={};e.exports=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}},37062:e=>{"use strict";class t{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}e.exports=t,t.default=t},89738:function(e,t,n){var r;e=n.nmd(e),function(o){t&&t.nodeType,e&&e.nodeType;var i="object"==typeof n.g&&n.g;i.global!==i&&i.window!==i&&i.self;var s,a=2147483647,l=36,c=26,u=38,d=700,h=/^xn--/,p=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=l-1,b=Math.floor,y=String.fromCharCode;function v(e){throw new RangeError(m[e])}function _(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function x(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+_((e=e.replace(f,".")).split("."),t).join(".")}function w(e){for(var t,n,r=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function k(e){return _(e,(function(e){var t="";return e>65535&&(t+=y((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+y(e)})).join("")}function C(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function S(e,t,n){var r=0;for(e=n?b(e/d):e>>1,e+=b(e/t);e>g*c>>1;r+=l)e=b(e/g);return b(r+(g+1)*e/(e+u))}function A(e){var t,n,r,o,i,s,u,d,h,p,f,m=[],g=e.length,y=0,_=128,x=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&v("not-basic"),m.push(e.charCodeAt(r));for(o=n>0?n+1:0;o<g;){for(i=y,s=1,u=l;o>=g&&v("invalid-input"),((d=(f=e.charCodeAt(o++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:l)>=l||d>b((a-y)/s))&&v("overflow"),y+=d*s,!(d<(h=u<=x?1:u>=x+c?c:u-x));u+=l)s>b(a/(p=l-h))&&v("overflow"),s*=p;x=S(y-i,t=m.length+1,0==i),b(y/t)>a-_&&v("overflow"),_+=b(y/t),y%=t,m.splice(y++,0,_)}return k(m)}function E(e){var t,n,r,o,i,s,u,d,h,p,f,m,g,_,x,k=[];for(m=(e=w(e)).length,t=128,n=0,i=72,s=0;s<m;++s)(f=e[s])<128&&k.push(y(f));for(r=o=k.length,o&&k.push("-");r<m;){for(u=a,s=0;s<m;++s)(f=e[s])>=t&&f<u&&(u=f);for(u-t>b((a-n)/(g=r+1))&&v("overflow"),n+=(u-t)*g,t=u,s=0;s<m;++s)if((f=e[s])<t&&++n>a&&v("overflow"),f==t){for(d=n,h=l;!(d<(p=h<=i?1:h>=i+c?c:h-i));h+=l)x=d-p,_=l-p,k.push(y(C(p+x%_,0))),d=b(x/_);k.push(y(C(d,0))),i=S(n,g,r==o),n=0,++r}++n,++t}return k.join("")}s={version:"1.4.1",ucs2:{decode:w,encode:k},decode:A,encode:E,toASCII:function(e){return x(e,(function(e){return p.test(e)?"xn--"+E(e):e}))},toUnicode:function(e){return x(e,(function(e){return h.test(e)?A(e.slice(4).toLowerCase()):e}))}},void 0===(r=function(){return s}.call(t,n,t,e))||(e.exports=r)}()},20937:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},s=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]])}return n};t.__esModule=!0;var a=n(7378),l=n(23108),c=n(48198),u=n(49781),d="autosize:resized",h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return o(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,r=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||r?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),r=(t.onChange,t.style),o=(t.innerRef,t.children),l=s(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return a.createElement("textarea",i({},l,{onChange:this.onChange,style:u?i({},r,{maxHeight:u}):r,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),o)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:l.number,maxRows:l.number,onResize:l.func,innerRef:l.any,async:l.bool},t}(a.Component);t.TextareaAutosize=a.forwardRef((function(e,t){return a.createElement(h,i({},e,{innerRef:t}))}))},28716:(e,t,n)=>{"use strict";var r=n(20937);t.A=r.TextareaAutosize},16588:(e,t)=>{"use strict";Symbol.for("react.element"),Symbol.for("react.portal");var n,r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=(Symbol.for("react.server_context"),Symbol.for("react.forward_ref")),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen");n=Symbol.for("react.module.reference"),t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===i||e===o||e===c||e===u||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===d||e.$$typeof===s||e.$$typeof===a||e.$$typeof===l||e.$$typeof===n||void 0!==e.getModuleId)}},74448:(e,t,n)=>{"use strict";e.exports=n(16588)},49482:function(e,t,n){var r;(function(){function o(e){"use strict";var t={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,describe:"Remove only spaces, ' and \" from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids",type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,description:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,description:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,description:"Parses simple line breaks as <br> (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,description:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,description:"Enables github @mentions",type:"boolean"},ghMentionsLink:{defaultValue:"https://github.com/{u}",description:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,description:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,description:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,description:"Support for HTML Tag escaping. ex: <div>foo</div>",type:"boolean"},emoji:{defaultValue:!1,description:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,description:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`",type:"boolean"},completeHTMLDocument:{defaultValue:!1,description:"Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags",type:"boolean"},metadata:{defaultValue:!1,description:"Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).",type:"boolean"},splitAdjacentBlockquotes:{defaultValue:!1,description:"Split adjacent blockquote blocks",type:"boolean"}};if(!1===e)return JSON.parse(JSON.stringify(t));var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r].defaultValue);return n}var i={},s={},a={},l=o(!0),c="vanilla",u={github:{omitExtraWLInCodeBlocks:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,disableForced4SpacesIndentedSublists:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghCompatibleHeaderId:!0,ghMentions:!0,backslashEscapesHTMLTags:!0,emoji:!0,splitAdjacentBlockquotes:!0},original:{noHeaderId:!0,ghCodeBlocks:!1},ghost:{omitExtraWLInCodeBlocks:!0,parseImgDimensions:!0,simplifiedAutoLink:!0,excludeTrailingPunctuationFromURLs:!0,literalMidWordUnderscores:!0,strikethrough:!0,tables:!0,tablesHeaderId:!0,ghCodeBlocks:!0,tasklists:!0,smoothLivePreview:!0,simpleLineBreaks:!0,requireSpaceBeforeHeadingText:!0,ghMentions:!1,encodeEmails:!0},vanilla:o(!0),allOn:function(){"use strict";var e=o(!0),t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=!0);return t}()};function d(e,t){"use strict";var n=t?"Error in "+t+" extension->":"Error in unnamed extension",r={valid:!0,error:""};i.helper.isArray(e)||(e=[e]);for(var o=0;o<e.length;++o){var s=n+" sub-extension "+o+": ",a=e[o];if("object"!=typeof a)return r.valid=!1,r.error=s+"must be an object, but "+typeof a+" given",r;if(!i.helper.isString(a.type))return r.valid=!1,r.error=s+'property "type" must be a string, but '+typeof a.type+" given",r;var l=a.type=a.type.toLowerCase();if("language"===l&&(l=a.type="lang"),"html"===l&&(l=a.type="output"),"lang"!==l&&"output"!==l&&"listener"!==l)return r.valid=!1,r.error=s+"type "+l+' is not recognized. Valid values: "lang/language", "output/html" or "listener"',r;if("listener"===l){if(i.helper.isUndefined(a.listeners))return r.valid=!1,r.error=s+'. Extensions of type "listener" must have a property called "listeners"',r}else if(i.helper.isUndefined(a.filter)&&i.helper.isUndefined(a.regex))return r.valid=!1,r.error=s+l+' extensions must define either a "regex" property or a "filter" method',r;if(a.listeners){if("object"!=typeof a.listeners)return r.valid=!1,r.error=s+'"listeners" property must be an object but '+typeof a.listeners+" given",r;for(var c in a.listeners)if(a.listeners.hasOwnProperty(c)&&"function"!=typeof a.listeners[c])return r.valid=!1,r.error=s+'"listeners" property must be an hash of [event name]: [callback]. listeners.'+c+" must be a function but "+typeof a.listeners[c]+" given",r}if(a.filter){if("function"!=typeof a.filter)return r.valid=!1,r.error=s+'"filter" must be a function, but '+typeof a.filter+" given",r}else if(a.regex){if(i.helper.isString(a.regex)&&(a.regex=new RegExp(a.regex,"g")),!(a.regex instanceof RegExp))return r.valid=!1,r.error=s+'"regex" property must either be a string or a RegExp object, but '+typeof a.regex+" given",r;if(i.helper.isUndefined(a.replace))return r.valid=!1,r.error=s+'"regex" extensions must implement a replace string or function',r}}return r}function h(e,t){"use strict";return"¨E"+t.charCodeAt(0)+"E"}i.helper={},i.extensions={},i.setOption=function(e,t){"use strict";return l[e]=t,this},i.getOption=function(e){"use strict";return l[e]},i.getOptions=function(){"use strict";return l},i.resetOptions=function(){"use strict";l=o(!0)},i.setFlavor=function(e){"use strict";if(!u.hasOwnProperty(e))throw Error(e+" flavor was not found");i.resetOptions();var t=u[e];for(var n in c=e,t)t.hasOwnProperty(n)&&(l[n]=t[n])},i.getFlavor=function(){"use strict";return c},i.getFlavorOptions=function(e){"use strict";if(u.hasOwnProperty(e))return u[e]},i.getDefaultOptions=function(e){"use strict";return o(e)},i.subParser=function(e,t){"use strict";if(i.helper.isString(e)){if(void 0===t){if(s.hasOwnProperty(e))return s[e];throw Error("SubParser named "+e+" not registered!")}s[e]=t}},i.extension=function(e,t){"use strict";if(!i.helper.isString(e))throw Error("Extension 'name' must be a string");if(e=i.helper.stdExtName(e),i.helper.isUndefined(t)){if(!a.hasOwnProperty(e))throw Error("Extension named "+e+" is not registered!");return a[e]}"function"==typeof t&&(t=t()),i.helper.isArray(t)||(t=[t]);var n=d(t,e);if(!n.valid)throw Error(n.error);a[e]=t},i.getAllExtensions=function(){"use strict";return a},i.removeExtension=function(e){"use strict";delete a[e]},i.resetExtensions=function(){"use strict";a={}},i.validateExtension=function(e){"use strict";var t=d(e,null);return!!t.valid||(console.warn(t.error),!1)},i.hasOwnProperty("helper")||(i.helper={}),i.helper.isString=function(e){"use strict";return"string"==typeof e||e instanceof String},i.helper.isFunction=function(e){"use strict";return e&&"[object Function]"==={}.toString.call(e)},i.helper.isArray=function(e){"use strict";return Array.isArray(e)},i.helper.isUndefined=function(e){"use strict";return void 0===e},i.helper.forEach=function(e,t){"use strict";if(i.helper.isUndefined(e))throw new Error("obj param is required");if(i.helper.isUndefined(t))throw new Error("callback param is required");if(!i.helper.isFunction(t))throw new Error("callback param must be a function/closure");if("function"==typeof e.forEach)e.forEach(t);else if(i.helper.isArray(e))for(var n=0;n<e.length;n++)t(e[n],n,e);else{if("object"!=typeof e)throw new Error("obj does not seem to be an array or an iterable object");for(var r in e)e.hasOwnProperty(r)&&t(e[r],r,e)}},i.helper.stdExtName=function(e){"use strict";return e.replace(/[_?*+\/\\.^-]/g,"").replace(/\s/g,"").toLowerCase()},i.helper.escapeCharactersCallback=h,i.helper.escapeCharacters=function(e,t,n){"use strict";var r="(["+t.replace(/([\[\]\\])/g,"\\$1")+"])";n&&(r="\\\\"+r);var o=new RegExp(r,"g");return e.replace(o,h)},i.helper.unescapeHTMLEntities=function(e){"use strict";return e.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")};var p=function(e,t,n,r){"use strict";var o,i,s,a,l,c=r||"",u=c.indexOf("g")>-1,d=new RegExp(t+"|"+n,"g"+c.replace(/g/g,"")),h=new RegExp(t,c.replace(/g/g,"")),p=[];do{for(o=0;s=d.exec(e);)if(h.test(s[0]))o++||(a=(i=d.lastIndex)-s[0].length);else if(o&&! --o){l=s.index+s[0].length;var f={left:{start:a,end:i},match:{start:i,end:s.index},right:{start:s.index,end:l},wholeMatch:{start:a,end:l}};if(p.push(f),!u)return p}}while(o&&(d.lastIndex=i));return p};i.helper.matchRecursiveRegExp=function(e,t,n,r){"use strict";for(var o=p(e,t,n,r),i=[],s=0;s<o.length;++s)i.push([e.slice(o[s].wholeMatch.start,o[s].wholeMatch.end),e.slice(o[s].match.start,o[s].match.end),e.slice(o[s].left.start,o[s].left.end),e.slice(o[s].right.start,o[s].right.end)]);return i},i.helper.replaceRecursiveRegExp=function(e,t,n,r,o){"use strict";if(!i.helper.isFunction(t)){var s=t;t=function(){return s}}var a=p(e,n,r,o),l=e,c=a.length;if(c>0){var u=[];0!==a[0].wholeMatch.start&&u.push(e.slice(0,a[0].wholeMatch.start));for(var d=0;d<c;++d)u.push(t(e.slice(a[d].wholeMatch.start,a[d].wholeMatch.end),e.slice(a[d].match.start,a[d].match.end),e.slice(a[d].left.start,a[d].left.end),e.slice(a[d].right.start,a[d].right.end))),d<c-1&&u.push(e.slice(a[d].wholeMatch.end,a[d+1].wholeMatch.start));a[c-1].wholeMatch.end<e.length&&u.push(e.slice(a[c-1].wholeMatch.end)),l=u.join("")}return l},i.helper.regexIndexOf=function(e,t,n){"use strict";if(!i.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";if(t instanceof RegExp==0)throw"InvalidArgumentError: second parameter of showdown.helper.regexIndexOf function must be an instance of RegExp";var r=e.substring(n||0).search(t);return r>=0?r+(n||0):r},i.helper.splitAtIndex=function(e,t){"use strict";if(!i.helper.isString(e))throw"InvalidArgumentError: first parameter of showdown.helper.regexIndexOf function must be a string";return[e.substring(0,t),e.substring(t)]},i.helper.encodeEmailAddress=function(e){"use strict";var t=[function(e){return"&#"+e.charCodeAt(0)+";"},function(e){return"&#x"+e.charCodeAt(0).toString(16)+";"},function(e){return e}];return e.replace(/./g,(function(e){if("@"===e)e=t[Math.floor(2*Math.random())](e);else{var n=Math.random();e=n>.9?t[2](e):n>.45?t[1](e):t[0](e)}return e}))},i.helper.padEnd=function(e,t,n){"use strict";return t|=0,n=String(n||" "),e.length>t?String(e):((t-=e.length)>n.length&&(n+=n.repeat(t/n.length)),String(e)+n.slice(0,t))},"undefined"==typeof console&&(console={warn:function(e){"use strict";alert(e)},log:function(e){"use strict";alert(e)},error:function(e){"use strict";throw e}}),i.helper.regexes={asteriskDashAndColon:/([*_:~])/g},i.helper.emojis={"+1":"👍","-1":"👎",100:"💯",1234:"🔢","1st_place_medal":"🥇","2nd_place_medal":"🥈","3rd_place_medal":"🥉","8ball":"🎱",a:"🅰️",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"✈️",alarm_clock:"⏰",alembic:"⚗️",alien:"👽",ambulance:"🚑",amphora:"🏺",anchor:"⚓️",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"♒️",aries:"♈️",arrow_backward:"◀️",arrow_double_down:"⏬",arrow_double_up:"⏫",arrow_down:"⬇️",arrow_down_small:"🔽",arrow_forward:"▶️",arrow_heading_down:"⤵️",arrow_heading_up:"⤴️",arrow_left:"⬅️",arrow_lower_left:"↙️",arrow_lower_right:"↘️",arrow_right:"➡️",arrow_right_hook:"↪️",arrow_up:"⬆️",arrow_up_down:"↕️",arrow_up_small:"🔼",arrow_upper_left:"↖️",arrow_upper_right:"↗️",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",artificial_satellite:"🛰",astonished:"😲",athletic_shoe:"👟",atm:"🏧",atom_symbol:"⚛️",avocado:"🥑",b:"🅱️",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",bacon:"🥓",badminton:"🏸",baggage_claim:"🛄",baguette_bread:"🥖",balance_scale:"⚖️",balloon:"🎈",ballot_box:"🗳",ballot_box_with_check:"☑️",bamboo:"🎍",banana:"🍌",bangbang:"‼️",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"⚾️",basketball:"🏀",basketball_man:"⛹️",basketball_woman:"⛹️&zwj;♀️",bat:"🦇",bath:"🛀",bathtub:"🛁",battery:"🔋",beach_umbrella:"🏖",bear:"🐻",bed:"🛏",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bellhop_bell:"🛎",bento:"🍱",biking_man:"🚴",bike:"🚲",biking_woman:"🚴&zwj;♀️",bikini:"👙",biohazard:"☣️",bird:"🐦",birthday:"🎂",black_circle:"⚫️",black_flag:"🏴",black_heart:"🖤",black_joker:"🃏",black_large_square:"⬛️",black_medium_small_square:"◾️",black_medium_square:"◼️",black_nib:"✒️",black_small_square:"▪️",black_square_button:"🔲",blonde_man:"👱",blonde_woman:"👱&zwj;♀️",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"⛵️",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bowing_man:"🙇",bow_and_arrow:"🏹",bowing_woman:"🙇&zwj;♀️",bowling:"🎳",boxing_glove:"🥊",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",building_construction:"🏗",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",burrito:"🌯",bus:"🚌",business_suit_levitating:"🕴",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",butterfly:"🦋",cactus:"🌵",cake:"🍰",calendar:"📆",call_me_hand:"🤙",calling:"📲",camel:"🐫",camera:"📷",camera_flash:"📸",camping:"🏕",cancer:"♋️",candle:"🕯",candy:"🍬",canoe:"🛶",capital_abcd:"🔠",capricorn:"♑️",car:"🚗",card_file_box:"🗃",card_index:"📇",card_index_dividers:"🗂",carousel_horse:"🎠",carrot:"🥕",cat:"🐱",cat2:"🐈",cd:"💿",chains:"⛓",champagne:"🍾",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cheese:"🧀",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chipmunk:"🐿",chocolate_bar:"🍫",christmas_tree:"🎄",church:"⛪️",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cityscape:"🏙",cl:"🆑",clamp:"🗜",clap:"👏",clapper:"🎬",classical_building:"🏛",clinking_glasses:"🥂",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"☁️",cloud_with_lightning:"🌩",cloud_with_lightning_and_rain:"⛈",cloud_with_rain:"🌧",cloud_with_snow:"🌨",clown_face:"🤡",clubs:"♣️",cocktail:"🍸",coffee:"☕️",coffin:"⚰️",cold_sweat:"😰",comet:"☄️",computer:"💻",computer_mouse:"🖱",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"㊗️",construction:"🚧",construction_worker_man:"👷",construction_worker_woman:"👷&zwj;♀️",control_knobs:"🎛",convenience_store:"🏪",cookie:"🍪",cool:"🆒",policeman:"👮",copyright:"©️",corn:"🌽",couch_and_lamp:"🛋",couple:"👫",couple_with_heart_woman_man:"💑",couple_with_heart_man_man:"👨&zwj;❤️&zwj;👨",couple_with_heart_woman_woman:"👩&zwj;❤️&zwj;👩",couplekiss_man_man:"👨&zwj;❤️&zwj;💋&zwj;👨",couplekiss_man_woman:"💏",couplekiss_woman_woman:"👩&zwj;❤️&zwj;💋&zwj;👩",cow:"🐮",cow2:"🐄",cowboy_hat_face:"🤠",crab:"🦀",crayon:"🖍",credit_card:"💳",crescent_moon:"🌙",cricket:"🏏",crocodile:"🐊",croissant:"🥐",crossed_fingers:"🤞",crossed_flags:"🎌",crossed_swords:"⚔️",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cucumber:"🥒",cupid:"💘",curly_loop:"➰",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",dagger:"🗡",dancer:"💃",dancing_women:"👯",dancing_men:"👯&zwj;♂️",dango:"🍡",dark_sunglasses:"🕶",dart:"🎯",dash:"💨",date:"📅",deciduous_tree:"🌳",deer:"🦌",department_store:"🏬",derelict_house:"🏚",desert:"🏜",desert_island:"🏝",desktop_computer:"🖥",male_detective:"🕵️",diamond_shape_with_a_dot_inside:"💠",diamonds:"♦️",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dove:"🕊",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",drooling_face:"🤤",droplet:"💧",drum:"🥁",duck:"🦆",dvd:"📀","e-mail":"📧",eagle:"🦅",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight_pointed_black_star:"✴️",eight_spoked_asterisk:"✳️",electric_plug:"🔌",elephant:"🐘",email:"✉️",end:"🔚",envelope_with_arrow:"📩",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"❗️",expressionless:"😑",eye:"👁",eye_speech_bubble:"👁&zwj;🗨",eyeglasses:"👓",eyes:"👀",face_with_head_bandage:"🤕",face_with_thermometer:"🤒",fist_oncoming:"👊",factory:"🏭",fallen_leaf:"🍂",family_man_woman_boy:"👪",family_man_boy:"👨&zwj;👦",family_man_boy_boy:"👨&zwj;👦&zwj;👦",family_man_girl:"👨&zwj;👧",family_man_girl_boy:"👨&zwj;👧&zwj;👦",family_man_girl_girl:"👨&zwj;👧&zwj;👧",family_man_man_boy:"👨&zwj;👨&zwj;👦",family_man_man_boy_boy:"👨&zwj;👨&zwj;👦&zwj;👦",family_man_man_girl:"👨&zwj;👨&zwj;👧",family_man_man_girl_boy:"👨&zwj;👨&zwj;👧&zwj;👦",family_man_man_girl_girl:"👨&zwj;👨&zwj;👧&zwj;👧",family_man_woman_boy_boy:"👨&zwj;👩&zwj;👦&zwj;👦",family_man_woman_girl:"👨&zwj;👩&zwj;👧",family_man_woman_girl_boy:"👨&zwj;👩&zwj;👧&zwj;👦",family_man_woman_girl_girl:"👨&zwj;👩&zwj;👧&zwj;👧",family_woman_boy:"👩&zwj;👦",family_woman_boy_boy:"👩&zwj;👦&zwj;👦",family_woman_girl:"👩&zwj;👧",family_woman_girl_boy:"👩&zwj;👧&zwj;👦",family_woman_girl_girl:"👩&zwj;👧&zwj;👧",family_woman_woman_boy:"👩&zwj;👩&zwj;👦",family_woman_woman_boy_boy:"👩&zwj;👩&zwj;👦&zwj;👦",family_woman_woman_girl:"👩&zwj;👩&zwj;👧",family_woman_woman_girl_boy:"👩&zwj;👩&zwj;👧&zwj;👦",family_woman_woman_girl_girl:"👩&zwj;👩&zwj;👧&zwj;👧",fast_forward:"⏩",fax:"📠",fearful:"😨",feet:"🐾",female_detective:"🕵️&zwj;♀️",ferris_wheel:"🎡",ferry:"⛴",field_hockey:"🏑",file_cabinet:"🗄",file_folder:"📁",film_projector:"📽",film_strip:"🎞",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist_raised:"✊",fist_left:"🤛",fist_right:"🤜",flags:"🎏",flashlight:"🔦",fleur_de_lis:"⚜️",flight_arrival:"🛬",flight_departure:"🛫",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",fog:"🌫",foggy:"🌁",football:"🏈",footprints:"👣",fork_and_knife:"🍴",fountain:"⛲️",fountain_pen:"🖋",four_leaf_clover:"🍀",fox_face:"🦊",framed_picture:"🖼",free:"🆓",fried_egg:"🍳",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",frowning_face:"☹️",frowning_man:"🙍&zwj;♂️",frowning_woman:"🙍",middle_finger:"🖕",fuelpump:"⛽️",full_moon:"🌕",full_moon_with_face:"🌝",funeral_urn:"⚱️",game_die:"🎲",gear:"⚙️",gem:"💎",gemini:"♊️",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goal_net:"🥅",goat:"🐐",golf:"⛳️",golfing_man:"🏌️",golfing_woman:"🏌️&zwj;♀️",gorilla:"🦍",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",green_salad:"🥗",grey_exclamation:"❕",grey_question:"❔",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guardswoman:"💂&zwj;♀️",guitar:"🎸",gun:"🔫",haircut_woman:"💇",haircut_man:"💇&zwj;♂️",hamburger:"🍔",hammer:"🔨",hammer_and_pick:"⚒",hammer_and_wrench:"🛠",hamster:"🐹",hand:"✋",handbag:"👜",handshake:"🤝",hankey:"💩",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"✔️",heavy_division_sign:"➗",heavy_dollar_sign:"💲",heavy_heart_exclamation:"❣️",heavy_minus_sign:"➖",heavy_multiplication_x:"✖️",heavy_plus_sign:"➕",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",hole:"🕳",honey_pot:"🍯",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hot_pepper:"🌶",hotdog:"🌭",hotel:"🏨",hotsprings:"♨️",hourglass:"⌛️",hourglass_flowing_sand:"⏳",house:"🏠",house_with_garden:"🏡",houses:"🏘",hugs:"🤗",hushed:"😯",ice_cream:"🍨",ice_hockey:"🏒",ice_skate:"⛸",icecream:"🍦",id:"🆔",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",tipping_hand_woman:"💁",information_source:"ℹ️",innocent:"😇",interrobang:"⁉️",iphone:"📱",izakaya_lantern:"🏮",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",joystick:"🕹",kaaba:"🕋",key:"🔑",keyboard:"⌨️",keycap_ten:"🔟",kick_scooter:"🛴",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",kiwi_fruit:"🥝",koala:"🐨",koko:"🈁",label:"🏷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",latin_cross:"✝️",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"↔️",leftwards_arrow_with_hook:"↩️",lemon:"🍋",leo:"♌️",leopard:"🐆",level_slider:"🎚",libra:"♎️",light_rail:"🚈",link:"🔗",lion:"🦁",lips:"👄",lipstick:"💄",lizard:"🦎",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"➿",loud_sound:"🔊",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",lying_face:"🤥",m:"Ⓜ️",mag:"🔍",mag_right:"🔎",mahjong:"🀄️",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_artist:"👨&zwj;🎨",man_astronaut:"👨&zwj;🚀",man_cartwheeling:"🤸&zwj;♂️",man_cook:"👨&zwj;🍳",man_dancing:"🕺",man_facepalming:"🤦&zwj;♂️",man_factory_worker:"👨&zwj;🏭",man_farmer:"👨&zwj;🌾",man_firefighter:"👨&zwj;🚒",man_health_worker:"👨&zwj;⚕️",man_in_tuxedo:"🤵",man_judge:"👨&zwj;⚖️",man_juggling:"🤹&zwj;♂️",man_mechanic:"👨&zwj;🔧",man_office_worker:"👨&zwj;💼",man_pilot:"👨&zwj;✈️",man_playing_handball:"🤾&zwj;♂️",man_playing_water_polo:"🤽&zwj;♂️",man_scientist:"👨&zwj;🔬",man_shrugging:"🤷&zwj;♂️",man_singer:"👨&zwj;🎤",man_student:"👨&zwj;🎓",man_teacher:"👨&zwj;🏫",man_technologist:"👨&zwj;💻",man_with_gua_pi_mao:"👲",man_with_turban:"👳",tangerine:"🍊",mans_shoe:"👞",mantelpiece_clock:"🕰",maple_leaf:"🍁",martial_arts_uniform:"🥋",mask:"😷",massage_woman:"💆",massage_man:"💆&zwj;♂️",meat_on_bone:"🍖",medal_military:"🎖",medal_sports:"🏅",mega:"📣",melon:"🍈",memo:"📝",men_wrestling:"🤼&zwj;♂️",menorah:"🕎",mens:"🚹",metal:"🤘",metro:"🚇",microphone:"🎤",microscope:"🔬",milk_glass:"🥛",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_mouth_face:"🤑",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",moon:"🌔",mortar_board:"🎓",mosque:"🕌",motor_boat:"🛥",motor_scooter:"🛵",motorcycle:"🏍",motorway:"🛣",mount_fuji:"🗻",mountain:"⛰",mountain_biking_man:"🚵",mountain_biking_woman:"🚵&zwj;♀️",mountain_cableway:"🚠",mountain_railway:"🚞",mountain_snow:"🏔",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",mrs_claus:"🤶",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",national_park:"🏞",nauseated_face:"🤢",necktie:"👔",negative_squared_cross_mark:"❎",nerd_face:"🤓",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",newspaper_roll:"🗞",next_track_button:"⏭",ng:"🆖",no_good_man:"🙅&zwj;♂️",no_good_woman:"🙅",night_with_stars:"🌃",no_bell:"🔕",no_bicycles:"🚳",no_entry:"⛔️",no_entry_sign:"🚫",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"⭕️",o2:"🅾️",ocean:"🌊",octopus:"🐙",oden:"🍢",office:"🏢",oil_drum:"🛢",ok:"🆗",ok_hand:"👌",ok_man:"🙆&zwj;♂️",ok_woman:"🙆",old_key:"🗝",older_man:"👴",older_woman:"👵",om:"🕉",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",open_umbrella:"☂️",ophiuchus:"⛎",orange_book:"📙",orthodox_cross:"☦️",outbox_tray:"📤",owl:"🦉",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",paintbrush:"🖌",palm_tree:"🌴",pancakes:"🥞",panda_face:"🐼",paperclip:"📎",paperclips:"🖇",parasol_on_ground:"⛱",parking:"🅿️",part_alternation_mark:"〽️",partly_sunny:"⛅️",passenger_ship:"🛳",passport_control:"🛂",pause_button:"⏸",peace_symbol:"☮️",peach:"🍑",peanuts:"🥜",pear:"🍐",pen:"🖊",pencil2:"✏️",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_fencing:"🤺",pouting_woman:"🙎",phone:"☎️",pick:"⛏",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",ping_pong:"🏓",pisces:"♓️",pizza:"🍕",place_of_worship:"🛐",plate_with_cutlery:"🍽",play_or_pause_button:"⏯",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"☝️",point_up_2:"👆",police_car:"🚓",policewoman:"👮&zwj;♀️",poodle:"🐩",popcorn:"🍿",post_office:"🏣",postal_horn:"📯",postbox:"📮",potable_water:"🚰",potato:"🥔",pouch:"👝",poultry_leg:"🍗",pound:"💷",rage:"😡",pouting_cat:"😾",pouting_man:"🙎&zwj;♂️",pray:"🙏",prayer_beads:"📿",pregnant_woman:"🤰",previous_track_button:"⏮",prince:"🤴",princess:"👸",printer:"🖨",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"❓",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",racing_car:"🏎",radio:"📻",radio_button:"🔘",radioactive:"☢️",railway_car:"🚃",railway_track:"🛤",rainbow:"🌈",rainbow_flag:"🏳️&zwj;🌈",raised_back_of_hand:"🤚",raised_hand_with_fingers_splayed:"🖐",raised_hands:"🙌",raising_hand_woman:"🙋",raising_hand_man:"🙋&zwj;♂️",ram:"🐏",ramen:"🍜",rat:"🐀",record_button:"⏺",recycle:"♻️",red_circle:"🔴",registered:"®️",relaxed:"☺️",relieved:"😌",reminder_ribbon:"🎗",repeat:"🔁",repeat_one:"🔂",rescue_worker_helmet:"⛑",restroom:"🚻",revolving_hearts:"💞",rewind:"⏪",rhinoceros:"🦏",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",right_anger_bubble:"🗯",ring:"💍",robot:"🤖",rocket:"🚀",rofl:"🤣",roll_eyes:"🙄",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rosette:"🏵",rotating_light:"🚨",round_pushpin:"📍",rowing_man:"🚣",rowing_woman:"🚣&zwj;♀️",rugby_football:"🏉",running_man:"🏃",running_shirt_with_sash:"🎽",running_woman:"🏃&zwj;♀️",sa:"🈂️",sagittarius:"♐️",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"📡",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"✂️",scorpion:"🦂",scorpius:"♏️",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"㊙️",see_no_evil:"🙈",seedling:"🌱",selfie:"🤳",shallow_pan_of_food:"🥘",shamrock:"☘️",shark:"🦈",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",shield:"🛡",shinto_shrine:"⛩",ship:"🚢",shirt:"👕",shopping:"🛍",shopping_cart:"🛒",shower:"🚿",shrimp:"🦐",signal_strength:"📶",six_pointed_star:"🔯",ski:"🎿",skier:"⛷",skull:"💀",skull_and_crossbones:"☠️",sleeping:"😴",sleeping_bed:"🛌",sleepy:"😪",slightly_frowning_face:"🙁",slightly_smiling_face:"🙂",slot_machine:"🎰",small_airplane:"🛩",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",sneezing_face:"🤧",snowboarder:"🏂",snowflake:"❄️",snowman:"⛄️",snowman_with_snow:"☃️",sob:"😭",soccer:"⚽️",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"♠️",spaghetti:"🍝",sparkle:"❇️",sparkler:"🎇",sparkles:"✨",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speaking_head:"🗣",speech_balloon:"💬",speedboat:"🚤",spider:"🕷",spider_web:"🕸",spiral_calendar:"🗓",spiral_notepad:"🗒",spoon:"🥄",squid:"🦑",stadium:"🏟",star:"⭐️",star2:"🌟",star_and_crescent:"☪️",star_of_david:"✡️",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",stop_button:"⏹",stop_sign:"🛑",stopwatch:"⏱",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",studio_microphone:"🎙",stuffed_flatbread:"🥙",sun_behind_large_cloud:"🌥",sun_behind_rain_cloud:"🌦",sun_behind_small_cloud:"🌤",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"☀️",sunrise:"🌅",sunrise_over_mountains:"🌄",surfing_man:"🏄",surfing_woman:"🏄&zwj;♀️",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimming_man:"🏊",swimming_woman:"🏊&zwj;♀️",symbols:"🔣",synagogue:"🕍",syringe:"💉",taco:"🌮",tada:"🎉",tanabata_tree:"🎋",taurus:"♉️",taxi:"🚕",tea:"🍵",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"⛺️",thermometer:"🌡",thinking:"🤔",thought_balloon:"💭",ticket:"🎫",tickets:"🎟",tiger:"🐯",tiger2:"🐅",timer_clock:"⏲",tipping_hand_man:"💁&zwj;♂️",tired_face:"😫",tm:"™️",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tornado:"🌪",trackball:"🖲",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tulip:"🌷",tumbler_glass:"🥃",turkey:"🦃",turtle:"🐢",tv:"📺",twisted_rightwards_arrows:"🔀",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯️",u6708:"🈷️",u6709:"🈶",u6e80:"🈵",u7121:"🈚️",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"☔️",unamused:"😒",underage:"🔞",unicorn:"🦄",unlock:"🔓",up:"🆙",upside_down_face:"🙃",v:"✌️",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"♍️",volcano:"🌋",volleyball:"🏐",vs:"🆚",vulcan_salute:"🖖",walking_man:"🚶",walking_woman:"🚶&zwj;♀️",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"⚠️",wastebasket:"🗑",watch:"⌚️",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"〰️",waxing_crescent_moon:"🌒",wc:"🚾",weary:"😩",wedding:"💒",weight_lifting_man:"🏋️",weight_lifting_woman:"🏋️&zwj;♀️",whale:"🐳",whale2:"🐋",wheel_of_dharma:"☸️",wheelchair:"♿️",white_check_mark:"✅",white_circle:"⚪️",white_flag:"🏳️",white_flower:"💮",white_large_square:"⬜️",white_medium_small_square:"◽️",white_medium_square:"◻️",white_small_square:"▫️",white_square_button:"🔳",wilted_flower:"🥀",wind_chime:"🎐",wind_face:"🌬",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",woman_artist:"👩&zwj;🎨",woman_astronaut:"👩&zwj;🚀",woman_cartwheeling:"🤸&zwj;♀️",woman_cook:"👩&zwj;🍳",woman_facepalming:"🤦&zwj;♀️",woman_factory_worker:"👩&zwj;🏭",woman_farmer:"👩&zwj;🌾",woman_firefighter:"👩&zwj;🚒",woman_health_worker:"👩&zwj;⚕️",woman_judge:"👩&zwj;⚖️",woman_juggling:"🤹&zwj;♀️",woman_mechanic:"👩&zwj;🔧",woman_office_worker:"👩&zwj;💼",woman_pilot:"👩&zwj;✈️",woman_playing_handball:"🤾&zwj;♀️",woman_playing_water_polo:"🤽&zwj;♀️",woman_scientist:"👩&zwj;🔬",woman_shrugging:"🤷&zwj;♀️",woman_singer:"👩&zwj;🎤",woman_student:"👩&zwj;🎓",woman_teacher:"👩&zwj;🏫",woman_technologist:"👩&zwj;💻",woman_with_turban:"👳&zwj;♀️",womans_clothes:"👚",womans_hat:"👒",women_wrestling:"🤼&zwj;♀️",womens:"🚺",world_map:"🗺",worried:"😟",wrench:"🔧",writing_hand:"✍️",x:"❌",yellow_heart:"💛",yen:"💴",yin_yang:"☯️",yum:"😋",zap:"⚡️",zipper_mouth_face:"🤐",zzz:"💤",octocat:'<img alt=":octocat:" height="20" width="20" align="absmiddle" src="https://assets-cdn.github.com/images/icons/emoji/octocat.png">',showdown:"<span style=\"font-family: 'Anonymous Pro', monospace; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: #3e8b8a;text-underline-position: under;\">S</span>"},i.Converter=function(e){"use strict";var t={},n=[],r=[],o={},s=c,h={parsed:{},raw:"",format:""};function p(e,t){if(t=t||null,i.helper.isString(e)){if(t=e=i.helper.stdExtName(e),i.extensions[e])return console.warn("DEPRECATION WARNING: "+e+" is an old extension that uses a deprecated loading method.Please inform the developer that the extension should be updated!"),void function(e,t){"function"==typeof e&&(e=e(new i.Converter)),i.helper.isArray(e)||(e=[e]);var o=d(e,t);if(!o.valid)throw Error(o.error);for(var s=0;s<e.length;++s)switch(e[s].type){case"lang":n.push(e[s]);break;case"output":r.push(e[s]);break;default:throw Error("Extension loader error: Type unrecognized!!!")}}(i.extensions[e],e);if(i.helper.isUndefined(a[e]))throw Error('Extension "'+e+'" could not be loaded. It was either not found or is not a valid extension.');e=a[e]}"function"==typeof e&&(e=e()),i.helper.isArray(e)||(e=[e]);var o=d(e,t);if(!o.valid)throw Error(o.error);for(var s=0;s<e.length;++s){switch(e[s].type){case"lang":n.push(e[s]);break;case"output":r.push(e[s])}if(e[s].hasOwnProperty("listeners"))for(var l in e[s].listeners)e[s].listeners.hasOwnProperty(l)&&f(l,e[s].listeners[l])}}function f(e,t){if(!i.helper.isString(e))throw Error("Invalid argument in converter.listen() method: name must be a string, but "+typeof e+" given");if("function"!=typeof t)throw Error("Invalid argument in converter.listen() method: callback must be a function, but "+typeof t+" given");o.hasOwnProperty(e)||(o[e]=[]),o[e].push(t)}!function(){for(var n in e=e||{},l)l.hasOwnProperty(n)&&(t[n]=l[n]);if("object"!=typeof e)throw Error("Converter expects the passed parameter to be an object, but "+typeof e+" was passed instead.");for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.extensions&&i.helper.forEach(t.extensions,p)}(),this._dispatch=function(e,t,n,r){if(o.hasOwnProperty(e))for(var i=0;i<o[e].length;++i){var s=o[e][i](e,t,this,n,r);s&&void 0!==s&&(t=s)}return t},this.listen=function(e,t){return f(e,t),this},this.makeHtml=function(e){if(!e)return e;var o={gHtmlBlocks:[],gHtmlMdBlocks:[],gHtmlSpans:[],gUrls:{},gTitles:{},gDimensions:{},gListLevel:0,hashLinkCounts:{},langExtensions:n,outputModifiers:r,converter:this,ghCodeBlocks:[],metadata:{parsed:{},raw:"",format:""}};return e=(e=(e=(e=(e=e.replace(/¨/g,"¨T")).replace(/\$/g,"¨D")).replace(/\r\n/g,"\n")).replace(/\r/g,"\n")).replace(/\u00A0/g,"&nbsp;"),t.smartIndentationFix&&(e=function(e){var t=e.match(/^\s*/)[0].length,n=new RegExp("^\\s{0,"+t+"}","gm");return e.replace(n,"")}(e)),e="\n\n"+e+"\n\n",e=(e=i.subParser("detab")(e,t,o)).replace(/^[ \t]+$/gm,""),i.helper.forEach(n,(function(n){e=i.subParser("runExtension")(n,e,t,o)})),e=i.subParser("metadata")(e,t,o),e=i.subParser("hashPreCodeTags")(e,t,o),e=i.subParser("githubCodeBlocks")(e,t,o),e=i.subParser("hashHTMLBlocks")(e,t,o),e=i.subParser("hashCodeTags")(e,t,o),e=i.subParser("stripLinkDefinitions")(e,t,o),e=i.subParser("blockGamut")(e,t,o),e=i.subParser("unhashHTMLSpans")(e,t,o),e=(e=(e=i.subParser("unescapeSpecialChars")(e,t,o)).replace(/¨D/g,"$$")).replace(/¨T/g,"¨"),e=i.subParser("completeHTMLDocument")(e,t,o),i.helper.forEach(r,(function(n){e=i.subParser("runExtension")(n,e,t,o)})),h=o.metadata,e},this.makeMarkdown=this.makeMd=function(e,t){if(e=(e=(e=e.replace(/\r\n/g,"\n")).replace(/\r/g,"\n")).replace(/>[ \t]+</,">¨NBSP;<"),!t){if(!window||!window.document)throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");t=window.document}var n=t.createElement("div");n.innerHTML=e;var r={preList:function(e){for(var t=e.querySelectorAll("pre"),n=[],r=0;r<t.length;++r)if(1===t[r].childElementCount&&"code"===t[r].firstChild.tagName.toLowerCase()){var o=t[r].firstChild.innerHTML.trim(),s=t[r].firstChild.getAttribute("data-language")||"";if(""===s)for(var a=t[r].firstChild.className.split(" "),l=0;l<a.length;++l){var c=a[l].match(/^language-(.+)$/);if(null!==c){s=c[1];break}}o=i.helper.unescapeHTMLEntities(o),n.push(o),t[r].outerHTML='<precode language="'+s+'" precodenum="'+r.toString()+'"></precode>'}else n.push(t[r].innerHTML),t[r].innerHTML="",t[r].setAttribute("prenum",r.toString());return n}(n)};!function e(t){for(var n=0;n<t.childNodes.length;++n){var r=t.childNodes[n];3===r.nodeType?/\S/.test(r.nodeValue)?(r.nodeValue=r.nodeValue.split("\n").join(" "),r.nodeValue=r.nodeValue.replace(/(\s)+/g,"$1")):(t.removeChild(r),--n):1===r.nodeType&&e(r)}}(n);for(var o=n.childNodes,s="",a=0;a<o.length;a++)s+=i.subParser("makeMarkdown.node")(o[a],r);return s},this.setOption=function(e,n){t[e]=n},this.getOption=function(e){return t[e]},this.getOptions=function(){return t},this.addExtension=function(e,t){p(e,t=t||null)},this.useExtension=function(e){p(e)},this.setFlavor=function(e){if(!u.hasOwnProperty(e))throw Error(e+" flavor was not found");var n=u[e];for(var r in s=e,n)n.hasOwnProperty(r)&&(t[r]=n[r])},this.getFlavor=function(){return s},this.removeExtension=function(e){i.helper.isArray(e)||(e=[e]);for(var t=0;t<e.length;++t){for(var o=e[t],s=0;s<n.length;++s)n[s]===o&&n[s].splice(s,1);for(;0<r.length;++s)r[0]===o&&r[0].splice(s,1)}},this.getAllExtensions=function(){return{language:n,output:r}},this.getMetadata=function(e){return e?h.raw:h.parsed},this.getMetadataFormat=function(){return h.format},this._setMetadataPair=function(e,t){h.parsed[e]=t},this._setMetadataFormat=function(e){h.format=e},this._setMetadataRaw=function(e){h.raw=e}},i.subParser("anchors",(function(e,t,n){"use strict";var r=function(e,r,o,s,a,l,c){if(i.helper.isUndefined(c)&&(c=""),o=o.toLowerCase(),e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)s="";else if(!s){if(o||(o=r.toLowerCase().replace(/ ?\n/g," ")),s="#"+o,i.helper.isUndefined(n.gUrls[o]))return e;s=n.gUrls[o],i.helper.isUndefined(n.gTitles[o])||(c=n.gTitles[o])}var u='<a href="'+(s=s.replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback))+'"';return""!==c&&null!==c&&(u+=' title="'+(c=(c=c.replace(/"/g,"&quot;")).replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback))+'"'),t.openLinksInNewWindow&&!/^#/.test(s)&&(u+=' rel="noopener noreferrer" target="¨E95Eblank"'),u+">"+r+"</a>"};return e=(e=(e=(e=(e=n.converter._dispatch("anchors.before",e,t,n)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,r)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,r)).replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,r)).replace(/\[([^\[\]]+)]()()()()()/g,r),t.ghMentions&&(e=e.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gim,(function(e,n,r,o,s){if("\\"===r)return n+o;if(!i.helper.isString(t.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var a=t.ghMentionsLink.replace(/\{u}/g,s),l="";return t.openLinksInNewWindow&&(l=' rel="noopener noreferrer" target="¨E95Eblank"'),n+'<a href="'+a+'"'+l+">"+o+"</a>"}))),n.converter._dispatch("anchors.after",e,t,n)}));var f=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,m=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,g=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,b=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gim,y=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,v=function(e){"use strict";return function(t,n,r,o,s,a,l){var c=r=r.replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback),u="",d="",h=n||"",p=l||"";return/^www\./i.test(r)&&(r=r.replace(/^www\./i,"http://www.")),e.excludeTrailingPunctuationFromURLs&&a&&(u=a),e.openLinksInNewWindow&&(d=' rel="noopener noreferrer" target="¨E95Eblank"'),h+'<a href="'+r+'"'+d+">"+c+"</a>"+u+p}},_=function(e,t){"use strict";return function(n,r,o){var s="mailto:";return r=r||"",o=i.subParser("unescapeSpecialChars")(o,e,t),e.encodeEmails?(s=i.helper.encodeEmailAddress(s+o),o=i.helper.encodeEmailAddress(o)):s+=o,r+'<a href="'+s+'">'+o+"</a>"}};i.subParser("autoLinks",(function(e,t,n){"use strict";return e=(e=(e=n.converter._dispatch("autoLinks.before",e,t,n)).replace(g,v(t))).replace(y,_(t,n)),n.converter._dispatch("autoLinks.after",e,t,n)})),i.subParser("simplifiedAutoLinks",(function(e,t,n){"use strict";return t.simplifiedAutoLink?(e=n.converter._dispatch("simplifiedAutoLinks.before",e,t,n),e=(e=t.excludeTrailingPunctuationFromURLs?e.replace(m,v(t)):e.replace(f,v(t))).replace(b,_(t,n)),e=n.converter._dispatch("simplifiedAutoLinks.after",e,t,n)):e})),i.subParser("blockGamut",(function(e,t,n){"use strict";return e=n.converter._dispatch("blockGamut.before",e,t,n),e=i.subParser("blockQuotes")(e,t,n),e=i.subParser("headers")(e,t,n),e=i.subParser("horizontalRule")(e,t,n),e=i.subParser("lists")(e,t,n),e=i.subParser("codeBlocks")(e,t,n),e=i.subParser("tables")(e,t,n),e=i.subParser("hashHTMLBlocks")(e,t,n),e=i.subParser("paragraphs")(e,t,n),n.converter._dispatch("blockGamut.after",e,t,n)})),i.subParser("blockQuotes",(function(e,t,n){"use strict";e=n.converter._dispatch("blockQuotes.before",e,t,n),e+="\n\n";var r=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return t.splitAdjacentBlockquotes&&(r=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),e=e.replace(r,(function(e){return e=(e=(e=e.replace(/^[ \t]*>[ \t]?/gm,"")).replace(/¨0/g,"")).replace(/^[ \t]+$/gm,""),e=i.subParser("githubCodeBlocks")(e,t,n),e=(e=(e=i.subParser("blockGamut")(e,t,n)).replace(/(^|\n)/g,"$1  ")).replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,(function(e,t){var n=t;return(n=n.replace(/^  /gm,"¨0")).replace(/¨0/g,"")})),i.subParser("hashBlock")("<blockquote>\n"+e+"\n</blockquote>",t,n)})),n.converter._dispatch("blockQuotes.after",e,t,n)})),i.subParser("codeBlocks",(function(e,t,n){"use strict";return e=n.converter._dispatch("codeBlocks.before",e,t,n),e=(e=(e+="¨0").replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g,(function(e,r,o){var s=r,a=o,l="\n";return s=i.subParser("outdent")(s,t,n),s=i.subParser("encodeCode")(s,t,n),s=(s=(s=i.subParser("detab")(s,t,n)).replace(/^\n+/g,"")).replace(/\n+$/g,""),t.omitExtraWLInCodeBlocks&&(l=""),s="<pre><code>"+s+l+"</code></pre>",i.subParser("hashBlock")(s,t,n)+a}))).replace(/¨0/,""),n.converter._dispatch("codeBlocks.after",e,t,n)})),i.subParser("codeSpans",(function(e,t,n){"use strict";return void 0===(e=n.converter._dispatch("codeSpans.before",e,t,n))&&(e=""),e=e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,(function(e,r,o,s){var a=s;return a=(a=a.replace(/^([ \t]*)/g,"")).replace(/[ \t]*$/g,""),a=r+"<code>"+(a=i.subParser("encodeCode")(a,t,n))+"</code>",i.subParser("hashHTMLSpans")(a,t,n)})),n.converter._dispatch("codeSpans.after",e,t,n)})),i.subParser("completeHTMLDocument",(function(e,t,n){"use strict";if(!t.completeHTMLDocument)return e;e=n.converter._dispatch("completeHTMLDocument.before",e,t,n);var r="html",o="<!DOCTYPE HTML>\n",i="",s='<meta charset="utf-8">\n',a="",l="";for(var c in void 0!==n.metadata.parsed.doctype&&(o="<!DOCTYPE "+n.metadata.parsed.doctype+">\n","html"!==(r=n.metadata.parsed.doctype.toString().toLowerCase())&&"html5"!==r||(s='<meta charset="utf-8">')),n.metadata.parsed)if(n.metadata.parsed.hasOwnProperty(c))switch(c.toLowerCase()){case"doctype":break;case"title":i="<title>"+n.metadata.parsed.title+"</title>\n";break;case"charset":s="html"===r||"html5"===r?'<meta charset="'+n.metadata.parsed.charset+'">\n':'<meta name="charset" content="'+n.metadata.parsed.charset+'">\n';break;case"language":case"lang":a=' lang="'+n.metadata.parsed[c]+'"',l+='<meta name="'+c+'" content="'+n.metadata.parsed[c]+'">\n';break;default:l+='<meta name="'+c+'" content="'+n.metadata.parsed[c]+'">\n'}return e=o+"<html"+a+">\n<head>\n"+i+s+l+"</head>\n<body>\n"+e.trim()+"\n</body>\n</html>",n.converter._dispatch("completeHTMLDocument.after",e,t,n)})),i.subParser("detab",(function(e,t,n){"use strict";return e=(e=(e=(e=(e=(e=n.converter._dispatch("detab.before",e,t,n)).replace(/\t(?=\t)/g,"    ")).replace(/\t/g,"¨A¨B")).replace(/¨B(.+?)¨A/g,(function(e,t){for(var n=t,r=4-n.length%4,o=0;o<r;o++)n+=" ";return n}))).replace(/¨A/g,"    ")).replace(/¨B/g,""),n.converter._dispatch("detab.after",e,t,n)})),i.subParser("ellipsis",(function(e,t,n){"use strict";return e=(e=n.converter._dispatch("ellipsis.before",e,t,n)).replace(/\.\.\./g,"…"),n.converter._dispatch("ellipsis.after",e,t,n)})),i.subParser("emoji",(function(e,t,n){"use strict";return t.emoji?(e=(e=n.converter._dispatch("emoji.before",e,t,n)).replace(/:([\S]+?):/g,(function(e,t){return i.helper.emojis.hasOwnProperty(t)?i.helper.emojis[t]:e})),n.converter._dispatch("emoji.after",e,t,n)):e})),i.subParser("encodeAmpsAndAngles",(function(e,t,n){"use strict";return e=(e=(e=(e=(e=n.converter._dispatch("encodeAmpsAndAngles.before",e,t,n)).replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&amp;")).replace(/<(?![a-z\/?$!])/gi,"&lt;")).replace(/</g,"&lt;")).replace(/>/g,"&gt;"),n.converter._dispatch("encodeAmpsAndAngles.after",e,t,n)})),i.subParser("encodeBackslashEscapes",(function(e,t,n){"use strict";return e=(e=(e=n.converter._dispatch("encodeBackslashEscapes.before",e,t,n)).replace(/\\(\\)/g,i.helper.escapeCharactersCallback)).replace(/\\([`*_{}\[\]()>#+.!~=|-])/g,i.helper.escapeCharactersCallback),n.converter._dispatch("encodeBackslashEscapes.after",e,t,n)})),i.subParser("encodeCode",(function(e,t,n){"use strict";return e=(e=n.converter._dispatch("encodeCode.before",e,t,n)).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/([*_{}\[\]\\=~-])/g,i.helper.escapeCharactersCallback),n.converter._dispatch("encodeCode.after",e,t,n)})),i.subParser("escapeSpecialCharsWithinTagAttributes",(function(e,t,n){"use strict";return e=(e=(e=n.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",e,t,n)).replace(/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,(function(e){return e.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,i.helper.escapeCharactersCallback)}))).replace(/<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi,(function(e){return e.replace(/([\\`*_~=|])/g,i.helper.escapeCharactersCallback)})),n.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",e,t,n)})),i.subParser("githubCodeBlocks",(function(e,t,n){"use strict";return t.ghCodeBlocks?(e=n.converter._dispatch("githubCodeBlocks.before",e,t,n),e=(e=(e+="¨0").replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,(function(e,r,o,s){var a=t.omitExtraWLInCodeBlocks?"":"\n";return s=i.subParser("encodeCode")(s,t,n),s="<pre><code"+(o?' class="'+o+" language-"+o+'"':"")+">"+(s=(s=(s=i.subParser("detab")(s,t,n)).replace(/^\n+/g,"")).replace(/\n+$/g,""))+a+"</code></pre>",s=i.subParser("hashBlock")(s,t,n),"\n\n¨G"+(n.ghCodeBlocks.push({text:e,codeblock:s})-1)+"G\n\n"}))).replace(/¨0/,""),n.converter._dispatch("githubCodeBlocks.after",e,t,n)):e})),i.subParser("hashBlock",(function(e,t,n){"use strict";return e=(e=n.converter._dispatch("hashBlock.before",e,t,n)).replace(/(^\n+|\n+$)/g,""),e="\n\n¨K"+(n.gHtmlBlocks.push(e)-1)+"K\n\n",n.converter._dispatch("hashBlock.after",e,t,n)})),i.subParser("hashCodeTags",(function(e,t,n){"use strict";return e=n.converter._dispatch("hashCodeTags.before",e,t,n),e=i.helper.replaceRecursiveRegExp(e,(function(e,r,o,s){var a=o+i.subParser("encodeCode")(r,t,n)+s;return"¨C"+(n.gHtmlSpans.push(a)-1)+"C"}),"<code\\b[^>]*>","</code>","gim"),n.converter._dispatch("hashCodeTags.after",e,t,n)})),i.subParser("hashElement",(function(e,t,n){"use strict";return function(e,t){var r=t;return r=(r=(r=r.replace(/\n\n/g,"\n")).replace(/^\n/,"")).replace(/\n+$/g,""),"\n\n¨K"+(n.gHtmlBlocks.push(r)-1)+"K\n\n"}})),i.subParser("hashHTMLBlocks",(function(e,t,n){"use strict";e=n.converter._dispatch("hashHTMLBlocks.before",e,t,n);var r=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],o=function(e,t,r,o){var i=e;return-1!==r.search(/\bmarkdown\b/)&&(i=r+n.converter.makeHtml(t)+o),"\n\n¨K"+(n.gHtmlBlocks.push(i)-1)+"K\n\n"};t.backslashEscapesHTMLTags&&(e=e.replace(/\\<(\/?[^>]+?)>/g,(function(e,t){return"&lt;"+t+"&gt;"})));for(var s=0;s<r.length;++s)for(var a,l=new RegExp("^ {0,3}(<"+r[s]+"\\b[^>]*>)","im"),c="<"+r[s]+"\\b[^>]*>",u="</"+r[s]+">";-1!==(a=i.helper.regexIndexOf(e,l));){var d=i.helper.splitAtIndex(e,a),h=i.helper.replaceRecursiveRegExp(d[1],o,c,u,"im");if(h===d[1])break;e=d[0].concat(h)}return e=e.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,i.subParser("hashElement")(e,t,n)),e=(e=i.helper.replaceRecursiveRegExp(e,(function(e){return"\n\n¨K"+(n.gHtmlBlocks.push(e)-1)+"K\n\n"}),"^ {0,3}\x3c!--","--\x3e","gm")).replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,i.subParser("hashElement")(e,t,n)),n.converter._dispatch("hashHTMLBlocks.after",e,t,n)})),i.subParser("hashHTMLSpans",(function(e,t,n){"use strict";function r(e){return"¨C"+(n.gHtmlSpans.push(e)-1)+"C"}return e=(e=(e=(e=(e=n.converter._dispatch("hashHTMLSpans.before",e,t,n)).replace(/<[^>]+?\/>/gi,(function(e){return r(e)}))).replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,(function(e){return r(e)}))).replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,(function(e){return r(e)}))).replace(/<[^>]+?>/gi,(function(e){return r(e)})),n.converter._dispatch("hashHTMLSpans.after",e,t,n)})),i.subParser("unhashHTMLSpans",(function(e,t,n){"use strict";e=n.converter._dispatch("unhashHTMLSpans.before",e,t,n);for(var r=0;r<n.gHtmlSpans.length;++r){for(var o=n.gHtmlSpans[r],i=0;/¨C(\d+)C/.test(o);){var s=RegExp.$1;if(o=o.replace("¨C"+s+"C",n.gHtmlSpans[s]),10===i){console.error("maximum nesting of 10 spans reached!!!");break}++i}e=e.replace("¨C"+r+"C",o)}return n.converter._dispatch("unhashHTMLSpans.after",e,t,n)})),i.subParser("hashPreCodeTags",(function(e,t,n){"use strict";return e=n.converter._dispatch("hashPreCodeTags.before",e,t,n),e=i.helper.replaceRecursiveRegExp(e,(function(e,r,o,s){var a=o+i.subParser("encodeCode")(r,t,n)+s;return"\n\n¨G"+(n.ghCodeBlocks.push({text:e,codeblock:a})-1)+"G\n\n"}),"^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>","^ {0,3}</code>\\s*</pre>","gim"),n.converter._dispatch("hashPreCodeTags.after",e,t,n)})),i.subParser("headers",(function(e,t,n){"use strict";e=n.converter._dispatch("headers.before",e,t,n);var r=isNaN(parseInt(t.headerLevelStart))?1:parseInt(t.headerLevelStart),o=t.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,s=t.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;e=(e=e.replace(o,(function(e,o){var s=i.subParser("spanGamut")(o,t,n),a=t.noHeaderId?"":' id="'+l(o)+'"',c="<h"+r+a+">"+s+"</h"+r+">";return i.subParser("hashBlock")(c,t,n)}))).replace(s,(function(e,o){var s=i.subParser("spanGamut")(o,t,n),a=t.noHeaderId?"":' id="'+l(o)+'"',c=r+1,u="<h"+c+a+">"+s+"</h"+c+">";return i.subParser("hashBlock")(u,t,n)}));var a=t.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;function l(e){var r,o;if(t.customizedHeaderId){var s=e.match(/\{([^{]+?)}\s*$/);s&&s[1]&&(e=s[1])}return r=e,o=i.helper.isString(t.prefixHeaderId)?t.prefixHeaderId:!0===t.prefixHeaderId?"section-":"",t.rawPrefixHeaderId||(r=o+r),r=t.ghCompatibleHeaderId?r.replace(/ /g,"-").replace(/&amp;/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():t.rawHeaderId?r.replace(/ /g,"-").replace(/&amp;/g,"&").replace(/¨T/g,"¨").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():r.replace(/[^\w]/g,"").toLowerCase(),t.rawPrefixHeaderId&&(r=o+r),n.hashLinkCounts[r]?r=r+"-"+n.hashLinkCounts[r]++:n.hashLinkCounts[r]=1,r}return e=e.replace(a,(function(e,o,s){var a=s;t.customizedHeaderId&&(a=s.replace(/\s?\{([^{]+?)}\s*$/,""));var c=i.subParser("spanGamut")(a,t,n),u=t.noHeaderId?"":' id="'+l(s)+'"',d=r-1+o.length,h="<h"+d+u+">"+c+"</h"+d+">";return i.subParser("hashBlock")(h,t,n)})),n.converter._dispatch("headers.after",e,t,n)})),i.subParser("horizontalRule",(function(e,t,n){"use strict";e=n.converter._dispatch("horizontalRule.before",e,t,n);var r=i.subParser("hashBlock")("<hr />",t,n);return e=(e=(e=e.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,r)).replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,r)).replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,r),n.converter._dispatch("horizontalRule.after",e,t,n)})),i.subParser("images",(function(e,t,n){"use strict";function r(e,t,r,o,s,a,l,c){var u=n.gUrls,d=n.gTitles,h=n.gDimensions;if(r=r.toLowerCase(),c||(c=""),e.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)o="";else if(""===o||null===o){if(""!==r&&null!==r||(r=t.toLowerCase().replace(/ ?\n/g," ")),o="#"+r,i.helper.isUndefined(u[r]))return e;o=u[r],i.helper.isUndefined(d[r])||(c=d[r]),i.helper.isUndefined(h[r])||(s=h[r].width,a=h[r].height)}t=t.replace(/"/g,"&quot;").replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback);var p='<img src="'+(o=o.replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback))+'" alt="'+t+'"';return c&&i.helper.isString(c)&&(p+=' title="'+(c=c.replace(/"/g,"&quot;").replace(i.helper.regexes.asteriskDashAndColon,i.helper.escapeCharactersCallback))+'"'),s&&a&&(p+=' width="'+(s="*"===s?"auto":s)+'"',p+=' height="'+(a="*"===a?"auto":a)+'"'),p+" />"}return e=(e=(e=(e=(e=(e=n.converter._dispatch("images.before",e,t,n)).replace(/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,r)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,(function(e,t,n,o,i,s,a,l){return r(e,t,n,o=o.replace(/\s/g,""),i,s,0,l)}))).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,r)).replace(/!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,r)).replace(/!\[([^\[\]]+)]()()()()()/g,r),n.converter._dispatch("images.after",e,t,n)})),i.subParser("italicsAndBold",(function(e,t,n){"use strict";function r(e,t,n){return t+e+n}return e=n.converter._dispatch("italicsAndBold.before",e,t,n),e=t.literalMidWordUnderscores?(e=(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,(function(e,t){return r(t,"<strong><em>","</em></strong>")}))).replace(/\b__(\S[\s\S]*?)__\b/g,(function(e,t){return r(t,"<strong>","</strong>")}))).replace(/\b_(\S[\s\S]*?)_\b/g,(function(e,t){return r(t,"<em>","</em>")})):(e=(e=e.replace(/___(\S[\s\S]*?)___/g,(function(e,t){return/\S$/.test(t)?r(t,"<strong><em>","</em></strong>"):e}))).replace(/__(\S[\s\S]*?)__/g,(function(e,t){return/\S$/.test(t)?r(t,"<strong>","</strong>"):e}))).replace(/_([^\s_][\s\S]*?)_/g,(function(e,t){return/\S$/.test(t)?r(t,"<em>","</em>"):e})),e=t.literalMidWordAsterisks?(e=(e=e.replace(/([^*]|^)\B\*\*\*(\S[\s\S]*?)\*\*\*\B(?!\*)/g,(function(e,t,n){return r(n,t+"<strong><em>","</em></strong>")}))).replace(/([^*]|^)\B\*\*(\S[\s\S]*?)\*\*\B(?!\*)/g,(function(e,t,n){return r(n,t+"<strong>","</strong>")}))).replace(/([^*]|^)\B\*(\S[\s\S]*?)\*\B(?!\*)/g,(function(e,t,n){return r(n,t+"<em>","</em>")})):(e=(e=e.replace(/\*\*\*(\S[\s\S]*?)\*\*\*/g,(function(e,t){return/\S$/.test(t)?r(t,"<strong><em>","</em></strong>"):e}))).replace(/\*\*(\S[\s\S]*?)\*\*/g,(function(e,t){return/\S$/.test(t)?r(t,"<strong>","</strong>"):e}))).replace(/\*([^\s*][\s\S]*?)\*/g,(function(e,t){return/\S$/.test(t)?r(t,"<em>","</em>"):e})),n.converter._dispatch("italicsAndBold.after",e,t,n)})),i.subParser("lists",(function(e,t,n){"use strict";function r(e,r){n.gListLevel++,e=e.replace(/\n{2,}$/,"\n");var o=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,s=/\n[ \t]*\n(?!¨0)/.test(e+="¨0");return t.disableForced4SpacesIndentedSublists&&(o=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),e=(e=e.replace(o,(function(e,r,o,a,l,c,u){u=u&&""!==u.trim();var d=i.subParser("outdent")(l,t,n),h="";return c&&t.tasklists&&(h=' class="task-list-item" style="list-style-type: none;"',d=d.replace(/^[ \t]*\[(x|X| )?]/m,(function(){var e='<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';return u&&(e+=" checked"),e+">"}))),d=d.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g,(function(e){return"¨A"+e})),r||d.search(/\n{2,}/)>-1?(d=i.subParser("githubCodeBlocks")(d,t,n),d=i.subParser("blockGamut")(d,t,n)):(d=(d=i.subParser("lists")(d,t,n)).replace(/\n$/,""),d=(d=i.subParser("hashHTMLBlocks")(d,t,n)).replace(/\n\n+/g,"\n\n"),d=s?i.subParser("paragraphs")(d,t,n):i.subParser("spanGamut")(d,t,n)),"<li"+h+">"+(d=d.replace("¨A",""))+"</li>\n"}))).replace(/¨0/g,""),n.gListLevel--,r&&(e=e.replace(/\s+$/,"")),e}function o(e,t){if("ol"===t){var n=e.match(/^ *(\d+)\./);if(n&&"1"!==n[1])return' start="'+n[1]+'"'}return""}function s(e,n,i){var s=t.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,a=t.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,l="ul"===n?s:a,c="";if(-1!==e.search(l))!function t(u){var d=u.search(l),h=o(e,n);-1!==d?(c+="\n\n<"+n+h+">\n"+r(u.slice(0,d),!!i)+"</"+n+">\n",l="ul"==(n="ul"===n?"ol":"ul")?s:a,t(u.slice(d))):c+="\n\n<"+n+h+">\n"+r(u,!!i)+"</"+n+">\n"}(e);else{var u=o(e,n);c="\n\n<"+n+u+">\n"+r(e,!!i)+"</"+n+">\n"}return c}return e=n.converter._dispatch("lists.before",e,t,n),e+="¨0",e=(e=n.gListLevel?e.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,(function(e,t,n){return s(t,n.search(/[*+-]/g)>-1?"ul":"ol",!0)})):e.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,(function(e,t,n,r){return s(n,r.search(/[*+-]/g)>-1?"ul":"ol",!1)}))).replace(/¨0/,""),n.converter._dispatch("lists.after",e,t,n)})),i.subParser("metadata",(function(e,t,n){"use strict";if(!t.metadata)return e;function r(e){n.metadata.raw=e,(e=(e=e.replace(/&/g,"&amp;").replace(/"/g,"&quot;")).replace(/\n {4}/g," ")).replace(/^([\S ]+): +([\s\S]+?)$/gm,(function(e,t,r){return n.metadata.parsed[t]=r,""}))}return e=(e=(e=(e=n.converter._dispatch("metadata.before",e,t,n)).replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,(function(e,t,n){return r(n),"¨M"}))).replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,(function(e,t,o){return t&&(n.metadata.format=t),r(o),"¨M"}))).replace(/¨M/g,""),n.converter._dispatch("metadata.after",e,t,n)})),i.subParser("outdent",(function(e,t,n){"use strict";return e=(e=(e=n.converter._dispatch("outdent.before",e,t,n)).replace(/^(\t|[ ]{1,4})/gm,"¨0")).replace(/¨0/g,""),n.converter._dispatch("outdent.after",e,t,n)})),i.subParser("paragraphs",(function(e,t,n){"use strict";for(var r=(e=(e=(e=n.converter._dispatch("paragraphs.before",e,t,n)).replace(/^\n+/g,"")).replace(/\n+$/g,"")).split(/\n{2,}/g),o=[],s=r.length,a=0;a<s;a++){var l=r[a];l.search(/¨(K|G)(\d+)\1/g)>=0?o.push(l):l.search(/\S/)>=0&&(l=(l=i.subParser("spanGamut")(l,t,n)).replace(/^([ \t]*)/g,"<p>"),l+="</p>",o.push(l))}for(s=o.length,a=0;a<s;a++){for(var c="",u=o[a],d=!1;/¨(K|G)(\d+)\1/.test(u);){var h=RegExp.$1,p=RegExp.$2;c=(c="K"===h?n.gHtmlBlocks[p]:d?i.subParser("encodeCode")(n.ghCodeBlocks[p].text,t,n):n.ghCodeBlocks[p].codeblock).replace(/\$/g,"$$$$"),u=u.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/,c),/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(u)&&(d=!0)}o[a]=u}return e=(e=(e=o.join("\n")).replace(/^\n+/g,"")).replace(/\n+$/g,""),n.converter._dispatch("paragraphs.after",e,t,n)})),i.subParser("runExtension",(function(e,t,n,r){"use strict";if(e.filter)t=e.filter(t,r.converter,n);else if(e.regex){var o=e.regex;o instanceof RegExp||(o=new RegExp(o,"g")),t=t.replace(o,e.replace)}return t})),i.subParser("spanGamut",(function(e,t,n){"use strict";return e=n.converter._dispatch("spanGamut.before",e,t,n),e=i.subParser("codeSpans")(e,t,n),e=i.subParser("escapeSpecialCharsWithinTagAttributes")(e,t,n),e=i.subParser("encodeBackslashEscapes")(e,t,n),e=i.subParser("images")(e,t,n),e=i.subParser("anchors")(e,t,n),e=i.subParser("autoLinks")(e,t,n),e=i.subParser("simplifiedAutoLinks")(e,t,n),e=i.subParser("emoji")(e,t,n),e=i.subParser("underline")(e,t,n),e=i.subParser("italicsAndBold")(e,t,n),e=i.subParser("strikethrough")(e,t,n),e=i.subParser("ellipsis")(e,t,n),e=i.subParser("hashHTMLSpans")(e,t,n),e=i.subParser("encodeAmpsAndAngles")(e,t,n),t.simpleLineBreaks?/\n\n¨K/.test(e)||(e=e.replace(/\n+/g,"<br />\n")):e=e.replace(/  +\n/g,"<br />\n"),n.converter._dispatch("spanGamut.after",e,t,n)})),i.subParser("strikethrough",(function(e,t,n){"use strict";return t.strikethrough&&(e=(e=n.converter._dispatch("strikethrough.before",e,t,n)).replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,(function(e,r){return function(e){return t.simplifiedAutoLink&&(e=i.subParser("simplifiedAutoLinks")(e,t,n)),"<del>"+e+"</del>"}(r)})),e=n.converter._dispatch("strikethrough.after",e,t,n)),e})),i.subParser("stripLinkDefinitions",(function(e,t,n){"use strict";var r=function(e,r,o,s,a,l,c){return r=r.toLowerCase(),o.match(/^data:.+?\/.+?;base64,/)?n.gUrls[r]=o.replace(/\s/g,""):n.gUrls[r]=i.subParser("encodeAmpsAndAngles")(o,t,n),l?l+c:(c&&(n.gTitles[r]=c.replace(/"|'/g,"&quot;")),t.parseImgDimensions&&s&&a&&(n.gDimensions[r]={width:s,height:a}),"")};return(e=(e=(e+="¨0").replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm,r)).replace(/^ {0,3}\[(.+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,r)).replace(/¨0/,"")})),i.subParser("tables",(function(e,t,n){"use strict";if(!t.tables)return e;function r(e,r){return"<td"+r+">"+i.subParser("spanGamut")(e,t,n)+"</td>\n"}function o(e){var o,s=e.split("\n");for(o=0;o<s.length;++o)/^ {0,3}\|/.test(s[o])&&(s[o]=s[o].replace(/^ {0,3}\|/,"")),/\|[ \t]*$/.test(s[o])&&(s[o]=s[o].replace(/\|[ \t]*$/,"")),s[o]=i.subParser("codeSpans")(s[o],t,n);var a,l,c,u,d=s[0].split("|").map((function(e){return e.trim()})),h=s[1].split("|").map((function(e){return e.trim()})),p=[],f=[],m=[],g=[];for(s.shift(),s.shift(),o=0;o<s.length;++o)""!==s[o].trim()&&p.push(s[o].split("|").map((function(e){return e.trim()})));if(d.length<h.length)return e;for(o=0;o<h.length;++o)m.push((a=h[o],/^:[ \t]*--*$/.test(a)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(a)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(a)?' style="text-align:center;"':""));for(o=0;o<d.length;++o)i.helper.isUndefined(m[o])&&(m[o]=""),f.push((l=d[o],c=m[o],u=void 0,u="",l=l.trim(),(t.tablesHeaderId||t.tableHeaderId)&&(u=' id="'+l.replace(/ /g,"_").toLowerCase()+'"'),"<th"+u+c+">"+(l=i.subParser("spanGamut")(l,t,n))+"</th>\n"));for(o=0;o<p.length;++o){for(var b=[],y=0;y<f.length;++y)i.helper.isUndefined(p[o][y]),b.push(r(p[o][y],m[y]));g.push(b)}return function(e,t){for(var n="<table>\n<thead>\n<tr>\n",r=e.length,o=0;o<r;++o)n+=e[o];for(n+="</tr>\n</thead>\n<tbody>\n",o=0;o<t.length;++o){n+="<tr>\n";for(var i=0;i<r;++i)n+=t[o][i];n+="</tr>\n"}return n+"</tbody>\n</table>\n"}(f,g)}return e=(e=(e=(e=n.converter._dispatch("tables.before",e,t,n)).replace(/\\(\|)/g,i.helper.escapeCharactersCallback)).replace(/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,o)).replace(/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm,o),n.converter._dispatch("tables.after",e,t,n)})),i.subParser("underline",(function(e,t,n){"use strict";return t.underline?(e=n.converter._dispatch("underline.before",e,t,n),e=(e=t.literalMidWordUnderscores?(e=e.replace(/\b___(\S[\s\S]*?)___\b/g,(function(e,t){return"<u>"+t+"</u>"}))).replace(/\b__(\S[\s\S]*?)__\b/g,(function(e,t){return"<u>"+t+"</u>"})):(e=e.replace(/___(\S[\s\S]*?)___/g,(function(e,t){return/\S$/.test(t)?"<u>"+t+"</u>":e}))).replace(/__(\S[\s\S]*?)__/g,(function(e,t){return/\S$/.test(t)?"<u>"+t+"</u>":e}))).replace(/(_)/g,i.helper.escapeCharactersCallback),e=n.converter._dispatch("underline.after",e,t,n)):e})),i.subParser("unescapeSpecialChars",(function(e,t,n){"use strict";return e=(e=n.converter._dispatch("unescapeSpecialChars.before",e,t,n)).replace(/¨E(\d+)E/g,(function(e,t){var n=parseInt(t);return String.fromCharCode(n)})),n.converter._dispatch("unescapeSpecialChars.after",e,t,n)})),i.subParser("makeMarkdown.blockquote",(function(e,t){"use strict";var n="";if(e.hasChildNodes())for(var r=e.childNodes,o=r.length,s=0;s<o;++s){var a=i.subParser("makeMarkdown.node")(r[s],t);""!==a&&(n+=a)}return"> "+(n=n.trim()).split("\n").join("\n> ")})),i.subParser("makeMarkdown.codeBlock",(function(e,t){"use strict";var n=e.getAttribute("language"),r=e.getAttribute("precodenum");return"```"+n+"\n"+t.preList[r]+"\n```"})),i.subParser("makeMarkdown.codeSpan",(function(e){"use strict";return"`"+e.innerHTML+"`"})),i.subParser("makeMarkdown.emphasis",(function(e,t){"use strict";var n="";if(e.hasChildNodes()){n+="*";for(var r=e.childNodes,o=r.length,s=0;s<o;++s)n+=i.subParser("makeMarkdown.node")(r[s],t);n+="*"}return n})),i.subParser("makeMarkdown.header",(function(e,t,n){"use strict";var r=new Array(n+1).join("#"),o="";if(e.hasChildNodes()){o=r+" ";for(var s=e.childNodes,a=s.length,l=0;l<a;++l)o+=i.subParser("makeMarkdown.node")(s[l],t)}return o})),i.subParser("makeMarkdown.hr",(function(){"use strict";return"---"})),i.subParser("makeMarkdown.image",(function(e){"use strict";var t="";return e.hasAttribute("src")&&(t+="!["+e.getAttribute("alt")+"](",t+="<"+e.getAttribute("src")+">",e.hasAttribute("width")&&e.hasAttribute("height")&&(t+=" ="+e.getAttribute("width")+"x"+e.getAttribute("height")),e.hasAttribute("title")&&(t+=' "'+e.getAttribute("title")+'"'),t+=")"),t})),i.subParser("makeMarkdown.links",(function(e,t){"use strict";var n="";if(e.hasChildNodes()&&e.hasAttribute("href")){var r=e.childNodes,o=r.length;n="[";for(var s=0;s<o;++s)n+=i.subParser("makeMarkdown.node")(r[s],t);n+="](",n+="<"+e.getAttribute("href")+">",e.hasAttribute("title")&&(n+=' "'+e.getAttribute("title")+'"'),n+=")"}return n})),i.subParser("makeMarkdown.list",(function(e,t,n){"use strict";var r="";if(!e.hasChildNodes())return"";for(var o=e.childNodes,s=o.length,a=e.getAttribute("start")||1,l=0;l<s;++l)void 0!==o[l].tagName&&"li"===o[l].tagName.toLowerCase()&&(r+=("ol"===n?a.toString()+". ":"- ")+i.subParser("makeMarkdown.listItem")(o[l],t),++a);return(r+="\n\x3c!-- --\x3e\n").trim()})),i.subParser("makeMarkdown.listItem",(function(e,t){"use strict";for(var n="",r=e.childNodes,o=r.length,s=0;s<o;++s)n+=i.subParser("makeMarkdown.node")(r[s],t);return/\n$/.test(n)?n=n.split("\n").join("\n    ").replace(/^ {4}$/gm,"").replace(/\n\n+/g,"\n\n"):n+="\n",n})),i.subParser("makeMarkdown.node",(function(e,t,n){"use strict";n=n||!1;var r="";if(3===e.nodeType)return i.subParser("makeMarkdown.txt")(e,t);if(8===e.nodeType)return"\x3c!--"+e.data+"--\x3e\n\n";if(1!==e.nodeType)return"";switch(e.tagName.toLowerCase()){case"h1":n||(r=i.subParser("makeMarkdown.header")(e,t,1)+"\n\n");break;case"h2":n||(r=i.subParser("makeMarkdown.header")(e,t,2)+"\n\n");break;case"h3":n||(r=i.subParser("makeMarkdown.header")(e,t,3)+"\n\n");break;case"h4":n||(r=i.subParser("makeMarkdown.header")(e,t,4)+"\n\n");break;case"h5":n||(r=i.subParser("makeMarkdown.header")(e,t,5)+"\n\n");break;case"h6":n||(r=i.subParser("makeMarkdown.header")(e,t,6)+"\n\n");break;case"p":n||(r=i.subParser("makeMarkdown.paragraph")(e,t)+"\n\n");break;case"blockquote":n||(r=i.subParser("makeMarkdown.blockquote")(e,t)+"\n\n");break;case"hr":n||(r=i.subParser("makeMarkdown.hr")(e,t)+"\n\n");break;case"ol":n||(r=i.subParser("makeMarkdown.list")(e,t,"ol")+"\n\n");break;case"ul":n||(r=i.subParser("makeMarkdown.list")(e,t,"ul")+"\n\n");break;case"precode":n||(r=i.subParser("makeMarkdown.codeBlock")(e,t)+"\n\n");break;case"pre":n||(r=i.subParser("makeMarkdown.pre")(e,t)+"\n\n");break;case"table":n||(r=i.subParser("makeMarkdown.table")(e,t)+"\n\n");break;case"code":r=i.subParser("makeMarkdown.codeSpan")(e,t);break;case"em":case"i":r=i.subParser("makeMarkdown.emphasis")(e,t);break;case"strong":case"b":r=i.subParser("makeMarkdown.strong")(e,t);break;case"del":r=i.subParser("makeMarkdown.strikethrough")(e,t);break;case"a":r=i.subParser("makeMarkdown.links")(e,t);break;case"img":r=i.subParser("makeMarkdown.image")(e,t);break;default:r=e.outerHTML+"\n\n"}return r})),i.subParser("makeMarkdown.paragraph",(function(e,t){"use strict";var n="";if(e.hasChildNodes())for(var r=e.childNodes,o=r.length,s=0;s<o;++s)n+=i.subParser("makeMarkdown.node")(r[s],t);return n.trim()})),i.subParser("makeMarkdown.pre",(function(e,t){"use strict";var n=e.getAttribute("prenum");return"<pre>"+t.preList[n]+"</pre>"})),i.subParser("makeMarkdown.strikethrough",(function(e,t){"use strict";var n="";if(e.hasChildNodes()){n+="~~";for(var r=e.childNodes,o=r.length,s=0;s<o;++s)n+=i.subParser("makeMarkdown.node")(r[s],t);n+="~~"}return n})),i.subParser("makeMarkdown.strong",(function(e,t){"use strict";var n="";if(e.hasChildNodes()){n+="**";for(var r=e.childNodes,o=r.length,s=0;s<o;++s)n+=i.subParser("makeMarkdown.node")(r[s],t);n+="**"}return n})),i.subParser("makeMarkdown.table",(function(e,t){"use strict";var n,r,o="",s=[[],[]],a=e.querySelectorAll("thead>tr>th"),l=e.querySelectorAll("tbody>tr");for(n=0;n<a.length;++n){var c=i.subParser("makeMarkdown.tableCell")(a[n],t),u="---";if(a[n].hasAttribute("style"))switch(a[n].getAttribute("style").toLowerCase().replace(/\s/g,"")){case"text-align:left;":u=":---";break;case"text-align:right;":u="---:";break;case"text-align:center;":u=":---:"}s[0][n]=c.trim(),s[1][n]=u}for(n=0;n<l.length;++n){var d=s.push([])-1,h=l[n].getElementsByTagName("td");for(r=0;r<a.length;++r){var p=" ";void 0!==h[r]&&(p=i.subParser("makeMarkdown.tableCell")(h[r],t)),s[d].push(p)}}var f=3;for(n=0;n<s.length;++n)for(r=0;r<s[n].length;++r){var m=s[n][r].length;m>f&&(f=m)}for(n=0;n<s.length;++n){for(r=0;r<s[n].length;++r)1===n?":"===s[n][r].slice(-1)?s[n][r]=i.helper.padEnd(s[n][r].slice(-1),f-1,"-")+":":s[n][r]=i.helper.padEnd(s[n][r],f,"-"):s[n][r]=i.helper.padEnd(s[n][r],f);o+="| "+s[n].join(" | ")+" |\n"}return o.trim()})),i.subParser("makeMarkdown.tableCell",(function(e,t){"use strict";var n="";if(!e.hasChildNodes())return"";for(var r=e.childNodes,o=r.length,s=0;s<o;++s)n+=i.subParser("makeMarkdown.node")(r[s],t,!0);return n.trim()})),i.subParser("makeMarkdown.txt",(function(e){"use strict";var t=e.nodeValue;return t=(t=t.replace(/ +/g," ")).replace(/¨NBSP;/g," "),(t=(t=(t=(t=(t=(t=(t=(t=i.helper.unescapeHTMLEntities(t)).replace(/([*_~|`])/g,"\\$1")).replace(/^(\s*)>/g,"\\$1>")).replace(/^#/gm,"\\#")).replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3")).replace(/^( {0,3}\d+)\./gm,"$1\\.")).replace(/^( {0,3})([+-])/gm,"$1\\$2")).replace(/]([\s]*)\(/g,"\\]$1\\(")).replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:")})),void 0===(r=function(){"use strict";return i}.call(t,n,t,e))||(e.exports=r)}).call(this)},39239:(e,t,n)=>{var r,o,i;e.exports=(r=Math.floor,o=Math.abs,i=Math.pow,function e(t,n,r){function o(s,a){if(!n[s]){if(!t[s]){if(i)return i(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[s]={exports:{}};t[s][0].call(c.exports,(function(e){return o(t[s][1][e]||e)}),c,c.exports,e,t,n,r)}return n[s].exports}for(var i=void 0,s=0;s<r.length;s++)o(r[s]);return o}({1:[function(e,t,n){"use strict";function r(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function o(e){return s[63&e>>18]+s[63&e>>12]+s[63&e>>6]+s[63&e]}function i(e,t,n){for(var r,i=[],s=t;s<n;s+=3)r=(16711680&e[s]<<16)+(65280&e[s+1]<<8)+(255&e[s+2]),i.push(o(r));return i.join("")}n.byteLength=function(e){var t=r(e),n=t[0],o=t[1];return 3*(n+o)/4-o},n.toByteArray=function(e){var t,n,o=r(e),i=o[0],s=o[1],c=new l(function(e,t,n){return 3*(t+n)/4-n}(0,i,s)),u=0,d=0<s?i-4:i;for(n=0;n<d;n+=4)t=a[e.charCodeAt(n)]<<18|a[e.charCodeAt(n+1)]<<12|a[e.charCodeAt(n+2)]<<6|a[e.charCodeAt(n+3)],c[u++]=255&t>>16,c[u++]=255&t>>8,c[u++]=255&t;return 2===s&&(t=a[e.charCodeAt(n)]<<2|a[e.charCodeAt(n+1)]>>4,c[u++]=255&t),1===s&&(t=a[e.charCodeAt(n)]<<10|a[e.charCodeAt(n+1)]<<4|a[e.charCodeAt(n+2)]>>2,c[u++]=255&t>>8,c[u++]=255&t),c},n.fromByteArray=function(e){for(var t,n=e.length,r=n%3,o=[],a=16383,l=0,c=n-r;l<c;l+=a)o.push(i(e,l,l+a>c?c:l+a));return 1===r?(t=e[n-1],o.push(s[t>>2]+s[63&t<<4]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],o.push(s[t>>10]+s[63&t>>4]+s[63&t<<2]+"=")),o.join("")};for(var s=[],a=[],l="undefined"==typeof Uint8Array?Array:Uint8Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0;u<64;++u)s[u]=c[u],a[c.charCodeAt(u)]=u;a[45]=62,a[95]=63},{}],2:[function(){},{}],3:[function(e,t,n){(function(){(function(){"use strict";var t=String.fromCharCode,r=Math.min;function o(e){if(2147483647<e)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=s.prototype,t}function s(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}return a(e,t,n)}function a(e,t,n){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!s.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|h(e,t),r=o(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return u(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(F(e,ArrayBuffer)||e&&F(e.buffer,ArrayBuffer))return function(e,t,n){if(0>t||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return(r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n)).__proto__=s.prototype,r}(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return s.from(r,t,n);var i=function(e){if(s.isBuffer(e)){var t=0|d(e.length),n=o(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0===e.length?"Buffer"===e.type&&Array.isArray(e.data)?u(e.data):void 0:"number"!=typeof e.length||z(e.length)?o(0):u(e)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(0>e)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return l(e),o(0>e?0:0|d(e))}function u(e){for(var t=0>e.length?0:0|d(e.length),n=o(t),r=0;r<t;r+=1)n[r]=255&e[r];return n}function d(e){if(e>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|e}function h(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||F(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=2<arguments.length&&!0===arguments[2];if(!r&&0===n)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return O(e).length;default:if(o)return r?-1:P(e).length;t=(""+t).toLowerCase(),o=!0}}function p(e,t,n){var r=!1;if((void 0===t||0>t)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),0>=n)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,n);case"utf8":case"utf-8":return C(this,t,n);case"ascii":return A(this,t,n);case"latin1":case"binary":return E(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function f(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):2147483647<n?n=2147483647:-2147483648>n&&(n=-2147483648),z(n=+n)&&(n=o?0:e.length-1),0>n&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(0>n){if(!o)return-1;n=0}if("string"==typeof t&&(t=s.from(t,r)),s.isBuffer(t))return 0===t.length?-1:g(e,t,n,r,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):g(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function g(e,t,n,r,o){function i(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}var s,a=1,l=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=(r+"").toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(2>e.length||2>t.length)return-1;a=2,l/=2,c/=2,n/=2}if(o){var u=-1;for(s=n;s<l;s++)if(i(e,s)!==i(t,-1===u?0:s-u))-1!==u&&(s-=s-u),u=-1;else if(-1===u&&(u=s),s-u+1===c)return u*a}else for(n+c>l&&(n=l-c),s=n;0<=s;s--){for(var d=!0,h=0;h<c;h++)if(i(e,s+h)!==i(t,h)){d=!1;break}if(d)return s}return-1}function b(e,t,n,r){n=+n||0;var o=e.length-n;r?(r=+r)>o&&(r=o):r=o;var i=t.length;r>i/2&&(r=i/2);for(var s,a=0;a<r;++a){if(z(s=parseInt(t.substr(2*a,2),16)))return a;e[n+a]=s}return a}function y(e,t,n,r){return L(P(t,e.length-n),e,n,r)}function v(e,t,n,r){return L(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function _(e,t,n,r){return v(e,t,n,r)}function x(e,t,n,r){return L(O(t),e,n,r)}function w(e,t,n,r){return L(function(e,t){for(var n,r,o,i=[],s=0;s<e.length&&!(0>(t-=2));++s)r=(n=e.charCodeAt(s))>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function k(e,t,n){return 0===t&&n===e.length?U.fromByteArray(e):U.fromByteArray(e.slice(t,n))}function C(e,t,n){n=r(e.length,n);for(var o=[],i=t;i<n;){var s,a,l,c,u=e[i],d=null,h=239<u?4:223<u?3:191<u?2:1;i+h<=n&&(1===h?128>u&&(d=u):2===h?128==(192&(s=e[i+1]))&&127<(c=(31&u)<<6|63&s)&&(d=c):3===h?(s=e[i+1],a=e[i+2],128==(192&s)&&128==(192&a)&&2047<(c=(15&u)<<12|(63&s)<<6|63&a)&&(55296>c||57343<c)&&(d=c)):4===h&&(s=e[i+1],a=e[i+2],l=e[i+3],128==(192&s)&&128==(192&a)&&128==(192&l)&&65535<(c=(15&u)<<18|(63&s)<<12|(63&a)<<6|63&l)&&1114112>c&&(d=c))),null===d?(d=65533,h=1):65535<d&&(d-=65536,o.push(55296|1023&d>>>10),d=56320|1023&d),o.push(d),i+=h}return S(o)}function S(e){var n=e.length;if(n<=4096)return t.apply(String,e);for(var r="",o=0;o<n;)r+=t.apply(String,e.slice(o,o+=4096));return r}function A(e,n,o){var i="";o=r(e.length,o);for(var s=n;s<o;++s)i+=t(127&e[s]);return i}function E(e,n,o){var i="";o=r(e.length,o);for(var s=n;s<o;++s)i+=t(e[s]);return i}function I(e,t,n){var r=e.length;(!t||0>t)&&(t=0),(!n||0>n||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=M(e[i]);return o}function j(e,n,r){for(var o=e.slice(n,r),i="",s=0;s<o.length;s+=2)i+=t(o[s]+256*o[s+1]);return i}function T(e,t,n){if(0!=e%1||0>e)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function B(e,t,n,r,o,i){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function R(e,t,n,r){if(n+r>e.length)throw new RangeError("Index out of range");if(0>n)throw new RangeError("Index out of range")}function N(e,t,n,r,o){return t=+t,n>>>=0,o||R(e,0,n,4),V.write(e,t,n,r,23,4),n+4}function D(e,t,n,r,o){return t=+t,n>>>=0,o||R(e,0,n,8),V.write(e,t,n,r,52,8),n+8}function M(e){return 16>e?"0"+e.toString(16):e.toString(16)}function P(e,t){t=t||1/0;for(var n,r=e.length,o=null,i=[],s=0;s<r;++s){if(55295<(n=e.charCodeAt(s))&&57344>n){if(!o){if(56319<n){-1<(t-=3)&&i.push(239,191,189);continue}if(s+1===r){-1<(t-=3)&&i.push(239,191,189);continue}o=n;continue}if(56320>n){-1<(t-=3)&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&-1<(t-=3)&&i.push(239,191,189);if(o=null,128>n){if(0>(t-=1))break;i.push(n)}else if(2048>n){if(0>(t-=2))break;i.push(192|n>>6,128|63&n)}else if(65536>n){if(0>(t-=3))break;i.push(224|n>>12,128|63&n>>6,128|63&n)}else{if(!(1114112>n))throw new Error("Invalid code point");if(0>(t-=4))break;i.push(240|n>>18,128|63&n>>12,128|63&n>>6,128|63&n)}}return i}function O(e){return U.toByteArray(function(e){if(2>(e=(e=e.split("=")[0]).trim().replace(H,"")).length)return"";for(;0!=e.length%4;)e+="=";return e}(e))}function L(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function F(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function z(e){return e!=e}var U=e("base64-js"),V=e("ieee754");n.Buffer=s,n.SlowBuffer=function(e){return+e!=e&&(e=0),s.alloc(+e)},n.INSPECT_MAX_BYTES=50,n.kMaxLength=2147483647,s.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){return s.isBuffer(this)?this.buffer:void 0}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){return s.isBuffer(this)?this.byteOffset:void 0}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),s.poolSize=8192,s.from=function(e,t,n){return a(e,t,n)},s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,s.alloc=function(e,t,n){return function(e,t,n){return l(e),0>=e||void 0===t?o(e):"string"==typeof n?o(e).fill(t,n):o(e).fill(t)}(e,t,n)},s.allocUnsafe=function(e){return c(e)},s.allocUnsafeSlow=function(e){return c(e)},s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if(F(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),F(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,o=t.length,i=0,a=r(n,o);i<a;++i)if(e[i]!==t[i]){n=e[i],o=t[i];break}return n<o?-1:o<n?1:0},s.isEncoding=function(e){switch((e+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=s.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var i=e[n];if(F(i,Uint8Array)&&(i=s.from(i)),!s.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,o),o+=i.length}return r},s.byteLength=h,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var e=this.length;if(0!=e%2)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)f(this,t,t+1);return this},s.prototype.swap32=function(){var e=this.length;if(0!=e%4)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)f(this,t,t+3),f(this,t+1,t+2);return this},s.prototype.swap64=function(){var e=this.length;if(0!=e%8)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)f(this,t,t+7),f(this,t+1,t+6),f(this,t+2,t+5),f(this,t+3,t+4);return this},s.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?C(this,0,e):p.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){var e="",t=n.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},s.prototype.compare=function(e,t,n,o,i){if(F(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===o&&(o=0),void 0===i&&(i=this.length),0>t||n>e.length||0>o||i>this.length)throw new RangeError("out of range index");if(o>=i&&t>=n)return 0;if(o>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(o>>>=0),l=(n>>>=0)-(t>>>=0),c=r(a,l),u=this.slice(o,i),d=e.slice(t,n),h=0;h<c;++h)if(u[h]!==d[h]){a=u[h],l=d[h];break}return a<l?-1:l<a?1:0},s.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},s.prototype.indexOf=function(e,t,n){return m(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return m(this,e,t,n,!1)},s.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),0<e.length&&(0>n||0>t)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return y(this,e,t,n);case"ascii":return v(this,e,t,n);case"latin1":case"binary":return _(this,e,t,n);case"base64":return x(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.prototype.slice=function(e,t){var n=this.length;0>(e=~~e)?0>(e+=n)&&(e=0):e>n&&(e=n),0>(t=void 0===t?n:~~t)?0>(t+=n)&&(t=0):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return r.__proto__=s.prototype,r},s.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},s.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);for(var r=this[e+--t],o=1;0<t&&(o*=256);)r+=this[e+--t]*o;return r},s.prototype.readUInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);for(var r=this[e],o=1,s=0;++s<t&&(o*=256);)r+=this[e+s]*o;return r>=(o*=128)&&(r-=i(2,8*t)),r},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);for(var r=t,o=1,s=this[e+--r];0<r&&(o*=256);)s+=this[e+--r]*o;return s>=(o*=128)&&(s-=i(2,8*t)),s},s.prototype.readInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),V.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),V.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),V.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),V.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||B(this,e,t,n,i(2,8*n)-1,0);var o=1,s=0;for(this[t]=255&e;++s<n&&(o*=256);)this[t+s]=255&e/o;return t+n},s.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||B(this,e,t,n,i(2,8*n)-1,0);var o=n-1,s=1;for(this[t+o]=255&e;0<=--o&&(s*=256);)this[t+o]=255&e/s;return t+n},s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var o=i(2,8*n-1);B(this,e,t,n,o-1,-o)}var s=0,a=1,l=0;for(this[t]=255&e;++s<n&&(a*=256);)0>e&&0===l&&0!==this[t+s-1]&&(l=1),this[t+s]=255&(e/a|0)-l;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var o=i(2,8*n-1);B(this,e,t,n,o-1,-o)}var s=n-1,a=1,l=0;for(this[t+s]=255&e;0<=--s&&(a*=256);)0>e&&0===l&&0!==this[t+s+1]&&(l=1),this[t+s]=255&(e/a|0)-l;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,1,127,-128),0>e&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeFloatLE=function(e,t,n){return N(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return N(this,e,t,!1,n)},s.prototype.writeDoubleLE=function(e,t,n){return D(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return D(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),0<r&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(0>t)throw new RangeError("targetStart out of bounds");if(0>n||n>=this.length)throw new RangeError("Index out of range");if(0>r)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o=r-n;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,n,r);else if(this===e&&n<t&&t<r)for(var i=o-1;0<=i;--i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,r),t);return o},s.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!s.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){var o=e.charCodeAt(0);("utf8"===r&&128>o||"latin1"===r)&&(e=o)}}else"number"==typeof e&&(e&=255);if(0>t||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var a=s.isBuffer(e)?e:s.from(e,r),l=a.length;if(0===l)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=a[i%l]}return this};var H=/[^+/0-9A-Za-z-_]/g}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":1,buffer:3,ieee754:9}],4:[function(e,t,n){(function(r){(function(){n.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,o=0;e[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"===e||(r++,"%c"===e&&(o=r))})),e.splice(o,0,n)},n.save=function(e){try{e?n.storage.setItem("debug",e):n.storage.removeItem("debug")}catch(e){}},n.load=function(){let e;try{e=n.storage.getItem("debug")}catch(e){}return!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG),e},n.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||!("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&31<=parseInt(RegExp.$1,10)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},n.storage=function(){try{return localStorage}catch(e){}}(),n.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],n.log=console.debug||console.log||(()=>{}),t.exports=e("./common")(n);const{formatters:o}=t.exports;o.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this)}).call(this,e("_process"))},{"./common":5,_process:12}],5:[function(e,t){t.exports=function(t){function n(e){function t(...e){if(!t.enabled)return;const r=t,i=+new Date,s=i-(o||i);r.diff=s,r.prev=o,r.curr=i,o=i,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,o)=>{if("%%"===t)return"%";a++;const i=n.formatters[o];if("function"==typeof i){const n=e[a];t=i.call(r,n),e.splice(a,1),a--}return t})),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}let o,i=null;return t.namespace=e,t.useColors=n.useColors(),t.color=n.selectColor(e),t.extend=r,t.destroy=n.destroy,Object.defineProperty(t,"enabled",{enumerable:!0,configurable:!1,get:()=>null===i?n.enabled(e):i,set:e=>{i=e}}),"function"==typeof n.init&&n.init(t),t}function r(e,t){const r=n(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){return e instanceof Error?e.stack||e.message:e},n.disable=function(){const e=[...n.names.map(i),...n.skips.map(i).map((e=>"-"+e))].join(",");return n.enable(""),e},n.enable=function(e){let t;n.save(e),n.names=[],n.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(t=0;t<o;t++)r[t]&&("-"===(e=r[t].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$")))},n.enabled=function(e){if("*"===e[e.length-1])return!0;let t,r;for(t=0,r=n.skips.length;t<r;t++)if(n.skips[t].test(e))return!1;for(t=0,r=n.names.length;t<r;t++)if(n.names[t].test(e))return!0;return!1},n.humanize=e("ms"),n.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((e=>{n[e]=t[e]})),n.names=[],n.skips=[],n.formatters={},n.selectColor=function(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[o(t)%n.colors.length]},n.enable(n.load()),n}},{ms:11}],6:[function(e,t){"use strict";function n(e,t){for(const n in t)Object.defineProperty(e,n,{value:t[n],enumerable:!0,configurable:!0});return e}t.exports=function(e,t,r){if(!e||"string"==typeof e)throw new TypeError("Please pass an Error to err-code");r||(r={}),"object"==typeof t&&(r=t,t=""),t&&(r.code=t);try{return n(e,r)}catch(t){r.message=e.message,r.stack=e.stack;const o=function(){};return o.prototype=Object.create(Object.getPrototypeOf(e)),n(new o,r)}}},{}],7:[function(e,t){"use strict";function n(){n.init.call(this)}function r(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function o(e){return void 0===e._maxListeners?n.defaultMaxListeners:e._maxListeners}function i(e,t,n,i){var s,a,l;if(r(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),l=a[t]),void 0===l)l=a[t]=n,++e._eventsCount;else if("function"==typeof l?l=a[t]=i?[n,l]:[l,n]:i?l.unshift(n):l.push(n),0<(s=o(e))&&l.length>s&&!l.warned){l.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=l.length,function(e){console&&console.warn&&console.warn(e)}(c)}return e}function s(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function a(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=s.bind(r);return o.listener=n,r.wrapFn=o,o}function l(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):u(o,o.length)}function c(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function u(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function d(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){r.once&&e.removeEventListener(t,o),n(i)}))}}var h,p="object"==typeof Reflect?Reflect:null,f=p&&"function"==typeof p.apply?p.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};h=p&&"function"==typeof p.ownKeys?p.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var m=Number.isNaN||function(e){return e!=e};t.exports=n,t.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}d(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&d(e,"error",t,n)}(e,o,{once:!0})}))},n.EventEmitter=n,n.prototype._events=void 0,n.prototype._eventsCount=0,n.prototype._maxListeners=void 0;var g=10;Object.defineProperty(n,"defaultMaxListeners",{enumerable:!0,get:function(){return g},set:function(e){if("number"!=typeof e||0>e||m(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");g=e}}),n.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},n.prototype.setMaxListeners=function(e){if("number"!=typeof e||0>e||m(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},n.prototype.getMaxListeners=function(){return o(this)},n.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var i;if(0<t.length&&(i=t[0]),i instanceof Error)throw i;var s=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw s.context=i,s}var a=o[e];if(void 0===a)return!1;if("function"==typeof a)f(a,this,t);else{var l=a.length,c=u(a,l);for(n=0;n<l;++n)f(c[n],this,t)}return!0},n.prototype.addListener=function(e,t){return i(this,e,t,!1)},n.prototype.on=n.prototype.addListener,n.prototype.prependListener=function(e,t){return i(this,e,t,!0)},n.prototype.once=function(e,t){return r(t),this.on(e,a(this,e,t)),this},n.prototype.prependOnceListener=function(e,t){return r(t),this.prependListener(e,a(this,e,t)),this},n.prototype.removeListener=function(e,t){var n,o,i,s,a;if(r(t),void 0===(o=this._events))return this;if(void 0===(n=o[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete o[e],o.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,s=n.length-1;0<=s;s--)if(n[s]===t||n[s].listener===t){a=n[s].listener,i=s;break}if(0>i)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(o[e]=n[0]),void 0!==o.removeListener&&this.emit("removeListener",e,a||t)}return this},n.prototype.off=n.prototype.removeListener,n.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;0<=r;r--)this.removeListener(e,t[r]);return this},n.prototype.listeners=function(e){return l(this,e,!0)},n.prototype.rawListeners=function(e){return l(this,e,!1)},n.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):c.call(e,t)},n.prototype.listenerCount=c,n.prototype.eventNames=function(){return 0<this._eventsCount?h(this._events):[]}},{}],8:[function(e,t){t.exports=function(){if("undefined"==typeof globalThis)return null;var e={RTCPeerConnection:globalThis.RTCPeerConnection||globalThis.mozRTCPeerConnection||globalThis.webkitRTCPeerConnection,RTCSessionDescription:globalThis.RTCSessionDescription||globalThis.mozRTCSessionDescription||globalThis.webkitRTCSessionDescription,RTCIceCandidate:globalThis.RTCIceCandidate||globalThis.mozRTCIceCandidate||globalThis.webkitRTCIceCandidate};return e.RTCPeerConnection?e:null}},{}],9:[function(e,t,n){n.read=function(e,t,n,r,o){var s,a,l=8*o-r-1,c=(1<<l)-1,u=c>>1,d=-7,h=n?o-1:0,p=n?-1:1,f=e[t+h];for(h+=p,s=f&(1<<-d)-1,f>>=-d,d+=l;0<d;s=256*s+e[t+h],h+=p,d-=8);for(a=s&(1<<-d)-1,s>>=-d,d+=r;0<d;a=256*a+e[t+h],h+=p,d-=8);if(0===s)s=1-u;else{if(s===c)return a?NaN:1/0*(f?-1:1);a+=i(2,r),s-=u}return(f?-1:1)*a*i(2,s-r)},n.write=function(e,t,n,s,a,l){var c,u,d,h=Math.LN2,p=Math.log,f=8*l-a-1,m=(1<<f)-1,g=m>>1,b=23===a?i(2,-24)-i(2,-77):0,y=s?0:l-1,v=s?1:-1,_=0>t||0===t&&0>1/t?1:0;for(t=o(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,c=m):(c=r(p(t)/h),1>t*(d=i(2,-c))&&(c--,d*=2),2<=(t+=1<=c+g?b/d:b*i(2,1-g))*d&&(c++,d/=2),c+g>=m?(u=0,c=m):1<=c+g?(u=(t*d-1)*i(2,a),c+=g):(u=t*i(2,g-1)*i(2,a),c=0));8<=a;e[n+y]=255&u,y+=v,u/=256,a-=8);for(c=c<<a|u,f+=a;0<f;e[n+y]=255&c,y+=v,c/=256,f-=8);e[n+y-v]|=128*_}},{}],10:[function(e,t){t.exports="function"==typeof Object.create?function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},{}],11:[function(e,t){var n=Math.round;function r(e){var t=o(e);return 864e5<=t?n(e/864e5)+"d":36e5<=t?n(e/36e5)+"h":6e4<=t?n(e/6e4)+"m":1e3<=t?n(e/1e3)+"s":e+"ms"}function i(e){var t=o(e);return 864e5<=t?s(e,t,864e5,"day"):36e5<=t?s(e,t,36e5,"hour"):6e4<=t?s(e,t,6e4,"minute"):1e3<=t?s(e,t,1e3,"second"):e+" ms"}function s(e,t,r,o){return n(e/r)+" "+o+(t>=1.5*r?"s":"")}t.exports=function(e,t){t=t||{};var n=typeof e;if("string"==n&&0<e.length)return function(e){if(!(100<(e+="").length)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();return"years"===r||"year"===r||"yrs"===r||"yr"===r||"y"===r?315576e5*n:"weeks"===r||"week"===r||"w"===r?6048e5*n:"days"===r||"day"===r||"d"===r?864e5*n:"hours"===r||"hour"===r||"hrs"===r||"hr"===r||"h"===r?36e5*n:"minutes"===r||"minute"===r||"mins"===r||"min"===r||"m"===r?6e4*n:"seconds"===r||"second"===r||"secs"===r||"sec"===r||"s"===r?1e3*n:"milliseconds"===r||"millisecond"===r||"msecs"===r||"msec"===r||"ms"===r?n:void 0}}}(e);if("number"===n&&isFinite(e))return t.long?i(e):r(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],12:[function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function i(){f&&h&&(f=!1,h.length?p=h.concat(p):m=-1,p.length&&s())}function s(){if(!f){var e=o(i);f=!0;for(var t=p.length;t;){for(h=p,p=[];++m<t;)h&&h[m].run();m=-1,t=p.length}h=null,f=!1,function(e){if(u===clearTimeout)return clearTimeout(e);if((u===r||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(e);try{return u(e)}catch(t){try{return u.call(null,e)}catch(t){return u.call(this,e)}}}(e)}}function a(e,t){this.fun=e,this.array=t}function l(){}var c,u,d=t.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(e){c=n}try{u="function"==typeof clearTimeout?clearTimeout:r}catch(e){u=r}}();var h,p=[],f=!1,m=-1;d.nextTick=function(e){var t=Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];p.push(new a(e,t)),1!==p.length||f||o(s)},a.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=l,d.addListener=l,d.once=l,d.off=l,d.removeListener=l,d.removeAllListeners=l,d.emit=l,d.prependListener=l,d.prependOnceListener=l,d.listeners=function(){return[]},d.binding=function(){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},{}],13:[function(e,t){(function(e){(function(){let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"==typeof window?e:window):e=>(n||(n=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))}).call(this)}).call(this,void 0===n.g?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:n.g)},{}],14:[function(e,t){(function(n,r){(function(){"use strict";var o=e("safe-buffer").Buffer,i=r.crypto||r.msCrypto;t.exports=i&&i.getRandomValues?function(e,t){if(e>4294967295)throw new RangeError("requested too many random bytes");var r=o.allocUnsafe(e);if(0<e)if(65536<e)for(var s=0;s<e;s+=65536)i.getRandomValues(r.slice(s,s+65536));else i.getRandomValues(r);return"function"==typeof t?n.nextTick((function(){t(null,r)})):r}:function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this)}).call(this,e("_process"),void 0===n.g?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:n.g)},{_process:12,"safe-buffer":30}],15:[function(e,t){"use strict";function n(e,t,n){function r(e,n,r){return"string"==typeof t?t:t(e,n,r)}n||(n=Error);var i=function(e){function t(t,n,o){return e.call(this,r(t,n,o))||this}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e),t}(n);i.prototype.name=n.name,i.prototype.code=e,o[e]=i}function r(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map((function(e){return e+""})),2<n?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(e+"")}var o={};n("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(e,t,n){var o,i;if("string"==typeof t&&function(e,t,n){return e.substr(!n||0>n?0:+n,t.length)===t}(t,"not ")?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))i="The ".concat(e," ").concat(o," ").concat(r(t,"type"));else{var s=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(s," ").concat(o," ").concat(r(t,"type"))}return i+". Received type ".concat(typeof n)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=o},{}],16:[function(e,t){(function(n){(function(){"use strict";function r(e){return this instanceof r?(a.call(this,e),l.call(this,e),this.allowHalfOpen=!0,void(e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",o))))):new r(e)}function o(){this._writableState.ended||n.nextTick(i,this)}function i(e){e.end()}var s=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=r;var a=e("./_stream_readable"),l=e("./_stream_writable");e("inherits")(r,a);for(var c,u=s(l.prototype),d=0;d<u.length;d++)c=u[d],r.prototype[c]||(r.prototype[c]=l.prototype[c]);Object.defineProperty(r.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(r.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(r.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(r.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0===this._readableState||void 0===this._writableState||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this)}).call(this,e("_process"))},{"./_stream_readable":18,"./_stream_writable":20,_process:12,inherits:10}],17:[function(e,t){"use strict";function n(e){return this instanceof n?void r.call(this,e):new n(e)}t.exports=n;var r=e("./_stream_transform");e("inherits")(n,r),n.prototype._transform=function(e,t,n){n(null,e)}},{"./_stream_transform":19,inherits:10}],18:[function(e,t){(function(n,r){(function(){"use strict";function o(t,n,r){w=w||e("./_stream_duplex"),t=t||{},"boolean"!=typeof r&&(r=n instanceof w),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=D(this,t,"readableHighWaterMark",r),this.buffer=new R,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(!j&&(j=e("string_decoder/").StringDecoder),this.decoder=new j(t.encoding),this.encoding=t.encoding)}function i(t){if(w=w||e("./_stream_duplex"),!(this instanceof i))return new i(t);var n=this instanceof w;this._readableState=new o(t,this,n),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),S.call(this)}function s(e,t,n,r,o){k("readableAddChunk",t);var i,s=e._readableState;if(null===t)s.reading=!1,function(e,t){if(k("onEofChunk"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?u(e):(t.needReadable=!1,!t.emittedReadable&&(t.emittedReadable=!0,d(e)))}}(e,s);else if(o||(i=l(s,t)),i)z(e,i);else if(s.objectMode||t&&0<t.length)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===A.prototype||(t=function(e){return A.from(e)}(t)),r)s.endEmitted?z(e,new F):a(e,s,t,!0);else if(s.ended)z(e,new O);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!n?(t=s.decoder.write(t),s.objectMode||0!==t.length?a(e,s,t,!1):h(e,s)):a(e,s,t,!1)}else r||(s.reading=!1,h(e,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function a(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&u(e)),h(e,t)}function l(e,t){var n;return function(e){return A.isBuffer(e)||e instanceof E}(t)||"string"==typeof t||void 0===t||e.objectMode||(n=new P("chunk",["string","Buffer","Uint8Array"],t)),n}function c(e,t){return 0>=e||0===t.length&&t.ended?0:t.objectMode?1:e==e?(e>t.highWaterMark&&(t.highWaterMark=function(e){return 1073741824<=e?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0)):t.flowing&&t.length?t.buffer.head.data.length:t.length}function u(e){var t=e._readableState;k("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(k("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(d,e))}function d(e){var t=e._readableState;k("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,b(e)}function h(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(p,e,t))}function p(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var n=t.length;if(k("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function f(e){var t=e._readableState;t.readableListening=0<e.listenerCount("readable"),t.resumeScheduled&&!t.paused?t.flowing=!0:0<e.listenerCount("data")&&e.resume()}function m(e){k("readable nexttick read 0"),e.read(0)}function g(e,t){k("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),b(e),t.flowing&&!t.reading&&e.read(0)}function b(e){var t=e._readableState;for(k("flow",t.flowing);t.flowing&&null!==e.read(););}function y(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function v(e){var t=e._readableState;k("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(_,t,e))}function _(e,t){if(k("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function x(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}var w;t.exports=i,i.ReadableState=o,e("events").EventEmitter;var k,C=function(e,t){return e.listeners(t).length},S=e("./internal/streams/stream"),A=e("buffer").Buffer,E=r.Uint8Array||function(){},I=e("util");k=I&&I.debuglog?I.debuglog("stream"):function(){};var j,T,B,R=e("./internal/streams/buffer_list"),N=e("./internal/streams/destroy"),D=e("./internal/streams/state").getHighWaterMark,M=e("../errors").codes,P=M.ERR_INVALID_ARG_TYPE,O=M.ERR_STREAM_PUSH_AFTER_EOF,L=M.ERR_METHOD_NOT_IMPLEMENTED,F=M.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;e("inherits")(i,S);var z=N.errorOrDestroy,U=["error","close","destroy","pause","resume"];Object.defineProperty(i.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),i.prototype.destroy=N.destroy,i.prototype._undestroy=N.undestroy,i.prototype._destroy=function(e,t){t(e)},i.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=A.from(e,t),t=""),n=!0),s(this,e,t,!1,n)},i.prototype.unshift=function(e){return s(this,e,null,!0,!1)},i.prototype.isPaused=function(){return!1===this._readableState.flowing},i.prototype.setEncoding=function(t){j||(j=e("string_decoder/").StringDecoder);var n=new j(t);this._readableState.decoder=n,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,o="";null!==r;)o+=n.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==o&&this._readableState.buffer.push(o),this._readableState.length=o.length,this},i.prototype.read=function(e){k("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0===t.highWaterMark?0<t.length:t.length>=t.highWaterMark)||t.ended))return k("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?v(this):u(this),null;if(0===(e=c(e,t))&&t.ended)return 0===t.length&&v(this),null;var r,o=t.needReadable;return k("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&k("length less than watermark",o=!0),t.ended||t.reading?k("reading or ended",o=!1):o&&(k("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,!t.reading&&(e=c(n,t))),null===(r=0<e?y(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(!t.ended&&(t.needReadable=!0),n!==e&&t.ended&&v(this)),null!==r&&this.emit("data",r),r},i.prototype._read=function(){z(this,new L("_read()"))},i.prototype.pipe=function(e,t){function r(e,t){k("onunpipe"),e===d&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,i())}function o(){k("onend"),e.end()}function i(){k("cleanup"),e.removeListener("close",l),e.removeListener("finish",c),e.removeListener("drain",f),e.removeListener("error",a),e.removeListener("unpipe",r),d.removeListener("end",o),d.removeListener("end",u),d.removeListener("data",s),m=!0,h.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&f()}function s(t){k("ondata");var n=e.write(t);k("dest.write",n),!1===n&&((1===h.pipesCount&&h.pipes===e||1<h.pipesCount&&-1!==x(h.pipes,e))&&!m&&(k("false write response, pause",h.awaitDrain),h.awaitDrain++),d.pause())}function a(t){k("onerror",t),u(),e.removeListener("error",a),0===C(e,"error")&&z(e,t)}function l(){e.removeListener("finish",c),u()}function c(){k("onfinish"),e.removeListener("close",l),u()}function u(){k("unpipe"),d.unpipe(e)}var d=this,h=this._readableState;switch(h.pipesCount){case 0:h.pipes=e;break;case 1:h.pipes=[h.pipes,e];break;default:h.pipes.push(e)}h.pipesCount+=1,k("pipe count=%d opts=%j",h.pipesCount,t);var p=t&&!1===t.end||e===n.stdout||e===n.stderr?u:o;h.endEmitted?n.nextTick(p):d.once("end",p),e.on("unpipe",r);var f=function(e){return function(){var t=e._readableState;k("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&C(e,"data")&&(t.flowing=!0,b(e))}}(d);e.on("drain",f);var m=!1;return d.on("data",s),function(e,t,n){"function"==typeof e.prependListener?e.prependListener(t,n):e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",a),e.once("close",l),e.once("finish",c),e.emit("pipe",d),h.flowing||(k("pipe resume"),d.resume()),e},i.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)r[i].emit("unpipe",this,{hasUnpiped:!1});return this}var s=x(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},i.prototype.on=function(e,t){var r=S.prototype.on.call(this,e,t),o=this._readableState;return"data"===e?(o.readableListening=0<this.listenerCount("readable"),!1!==o.flowing&&this.resume()):"readable"==e&&!o.endEmitted&&!o.readableListening&&(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,k("on readable",o.length,o.reading),o.length?u(this):!o.reading&&n.nextTick(m,this)),r},i.prototype.addListener=i.prototype.on,i.prototype.removeListener=function(e,t){var r=S.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(f,this),r},i.prototype.removeAllListeners=function(e){var t=S.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&n.nextTick(f,this),t},i.prototype.resume=function(){var e=this._readableState;return e.flowing||(k("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(g,e,t))}(this,e)),e.paused=!1,this},i.prototype.pause=function(){return k("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(k("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},i.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var o in e.on("end",(function(){if(k("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(o){k("wrapped data"),n.decoder&&(o=n.decoder.write(o)),n.objectMode&&null==o||!(n.objectMode||o&&o.length)||t.push(o)||(r=!0,e.pause())})),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var i=0;i<U.length;i++)e.on(U[i],this.emit.bind(this,U[i]));return this._read=function(t){k("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(i.prototype[Symbol.asyncIterator]=function(){return void 0===T&&(T=e("./internal/streams/async_iterator")),T(this)}),Object.defineProperty(i.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(i.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(i.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),i._fromList=y,Object.defineProperty(i.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(i.from=function(t,n){return void 0===B&&(B=e("./internal/streams/from")),B(i,t,n)})}).call(this)}).call(this,e("_process"),void 0===n.g?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:n.g)},{"../errors":15,"./_stream_duplex":16,"./internal/streams/async_iterator":21,"./internal/streams/buffer_list":22,"./internal/streams/destroy":23,"./internal/streams/from":25,"./internal/streams/state":27,"./internal/streams/stream":28,_process:12,buffer:3,events:7,inherits:10,"string_decoder/":31,util:2}],19:[function(e,t){"use strict";function n(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new l);n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function r(e){return this instanceof r?(d.call(this,e),this._transformState={afterTransform:n.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),void this.on("prefinish",o)):new r(e)}function o(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?i(this,null,null):this._flush((function(t,n){i(e,t,n)}))}function i(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new u;if(e._transformState.transforming)throw new c;return e.push(null)}t.exports=r;var s=e("../errors").codes,a=s.ERR_METHOD_NOT_IMPLEMENTED,l=s.ERR_MULTIPLE_CALLBACK,c=s.ERR_TRANSFORM_ALREADY_TRANSFORMING,u=s.ERR_TRANSFORM_WITH_LENGTH_0,d=e("./_stream_duplex");e("inherits")(r,d),r.prototype.push=function(e,t){return this._transformState.needTransform=!1,d.prototype.push.call(this,e,t)},r.prototype._transform=function(e,t,n){n(new a("_transform()"))},r.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var o=this._readableState;(r.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},r.prototype._read=function(){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},r.prototype._destroy=function(e,t){d.prototype._destroy.call(this,e,(function(e){t(e)}))}},{"../errors":15,"./_stream_duplex":16,inherits:10}],20:[function(e,t){(function(n,r){(function(){"use strict";function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;for(e.entry=null;r;){var o=r.callback;t.pendingcb--,o(n),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}function i(){}function s(t,n,r){_=_||e("./_stream_duplex"),t=t||{},"boolean"!=typeof r&&(r=n instanceof _),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=E(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=!1===t.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){h(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function a(t){var n=this instanceof(_=_||e("./_stream_duplex"));return n||x.call(a,this)?(this._writableState=new s(t,this,n),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),void k.call(this)):new a(t)}function l(e,t){var r=new M;O(e,r),n.nextTick(t,r)}function c(e,t,r,o){var i;return null===r?i=new D:"string"!=typeof r&&!t.objectMode&&(i=new j("chunk",["string","Buffer"],r)),!i||(O(e,i),n.nextTick(o,i),!1)}function u(e,t,n,r,o,i){if(!n){var s=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=C.from(t,n)),t}(t,r,o);r!==s&&(n=!0,o="buffer",r=s)}var a=t.objectMode?1:r.length;t.length+=a;var l=t.length<t.highWaterMark;if(l||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:o,isBuf:n,callback:i,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else d(e,t,!1,a,r,o,i);return l}function d(e,t,n,r,o,i,s){t.writelen=r,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new N("write")):n?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function h(e,t){var r=e._writableState,o=r.sync,i=r.writecb;if("function"!=typeof i)throw new B;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,o,i){--t.pendingcb,r?(n.nextTick(i,o),n.nextTick(y,e,t),e._writableState.errorEmitted=!0,O(e,o)):(i(o),e._writableState.errorEmitted=!0,O(e,o),y(e,t))}(e,r,o,t,i);else{var s=m(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||f(e,r),o?n.nextTick(p,e,r,s,i):p(e,r,s,i)}}function p(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),y(e,t)}function f(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=Array(r),s=t.corkedRequestsFree;s.entry=n;for(var a=0,l=!0;n;)i[a]=n,n.isBuf||(l=!1),n=n.next,a+=1;i.allBuffers=l,d(e,t,!0,t.length,i,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,u=n.encoding,h=n.callback;if(d(e,t,!1,t.objectMode?1:c.length,c,u,h),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function m(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function g(e,t){e._final((function(n){t.pendingcb--,n&&O(e,n),t.prefinished=!0,e.emit("prefinish"),y(e,t)}))}function b(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,n.nextTick(g,e,t)))}function y(e,t){var n=m(t);if(n&&(b(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}function v(e,t,r){t.ending=!0,y(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}var _;t.exports=a,a.WritableState=s;var x,w={deprecate:e("util-deprecate")},k=e("./internal/streams/stream"),C=e("buffer").Buffer,S=r.Uint8Array||function(){},A=e("./internal/streams/destroy"),E=e("./internal/streams/state").getHighWaterMark,I=e("../errors").codes,j=I.ERR_INVALID_ARG_TYPE,T=I.ERR_METHOD_NOT_IMPLEMENTED,B=I.ERR_MULTIPLE_CALLBACK,R=I.ERR_STREAM_CANNOT_PIPE,N=I.ERR_STREAM_DESTROYED,D=I.ERR_STREAM_NULL_VALUES,M=I.ERR_STREAM_WRITE_AFTER_END,P=I.ERR_UNKNOWN_ENCODING,O=A.errorOrDestroy;e("inherits")(a,k),s.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(s.prototype,"buffer",{get:w.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(x=Function.prototype[Symbol.hasInstance],Object.defineProperty(a,Symbol.hasInstance,{value:function(e){return!!x.call(this,e)||!(this!==a)&&e&&e._writableState instanceof s}})):x=function(e){return e instanceof this},a.prototype.pipe=function(){O(this,new R)},a.prototype.write=function(e,t,n){var r=this._writableState,o=!1,s=!r.objectMode&&function(e){return C.isBuffer(e)||e instanceof S}(e);return s&&!C.isBuffer(e)&&(e=function(e){return C.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":!t&&(t=r.defaultEncoding),"function"!=typeof n&&(n=i),r.ending?l(this,n):(s||c(this,r,e,n))&&(r.pendingcb++,o=u(this,r,s,e,t,n)),o},a.prototype.cork=function(){this._writableState.corked++},a.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&f(this,e))},a.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(-1<["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())))throw new P(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),a.prototype._write=function(e,t,n){n(new T("_write()"))},a.prototype._writev=null,a.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||v(this,r,n),this},Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),a.prototype.destroy=A.destroy,a.prototype._undestroy=A.undestroy,a.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),void 0===n.g?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:n.g)},{"../errors":15,"./_stream_duplex":16,"./internal/streams/destroy":23,"./internal/streams/state":27,"./internal/streams/stream":28,_process:12,buffer:3,inherits:10,"util-deprecate":32}],21:[function(e,t){(function(n){(function(){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){return{value:e,done:t}}function i(e){var t=e[c];if(null!==t){var n=e[m].read();null!==n&&(e[p]=null,e[c]=null,e[u]=null,t(o(n,!1)))}}function s(e){n.nextTick(i,e)}var a,l=e("./end-of-stream"),c=Symbol("lastResolve"),u=Symbol("lastReject"),d=Symbol("error"),h=Symbol("ended"),p=Symbol("lastPromise"),f=Symbol("handlePromise"),m=Symbol("stream"),g=Object.getPrototypeOf((function(){})),b=Object.setPrototypeOf((a={get stream(){return this[m]},next:function(){var e=this,t=this[d];if(null!==t)return Promise.reject(t);if(this[h])return Promise.resolve(o(void 0,!0));if(this[m].destroyed)return new Promise((function(t,r){n.nextTick((function(){e[d]?r(e[d]):t(o(void 0,!0))}))}));var r,i=this[p];if(i)r=new Promise(function(e,t){return function(n,r){e.then((function(){return t[h]?void n(o(void 0,!0)):void t[f](n,r)}),r)}}(i,this));else{var s=this[m].read();if(null!==s)return Promise.resolve(o(s,!1));r=new Promise(this[f])}return this[p]=r,r}},r(a,Symbol.asyncIterator,(function(){return this})),r(a,"return",(function(){var e=this;return new Promise((function(t,n){e[m].destroy(null,(function(e){return e?void n(e):void t(o(void 0,!0))}))}))})),a),g);t.exports=function(e){var t,n=Object.create(b,(r(t={},m,{value:e,writable:!0}),r(t,c,{value:null,writable:!0}),r(t,u,{value:null,writable:!0}),r(t,d,{value:null,writable:!0}),r(t,h,{value:e._readableState.endEmitted,writable:!0}),r(t,f,{value:function(e,t){var r=n[m].read();r?(n[p]=null,n[c]=null,n[u]=null,e(o(r,!1))):(n[c]=e,n[u]=t)},writable:!0}),t));return n[p]=null,l(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[u];return null!==t&&(n[p]=null,n[c]=null,n[u]=null,t(e)),void(n[d]=e)}var r=n[c];null!==r&&(n[p]=null,n[c]=null,n[u]=null,r(o(void 0,!0))),n[h]=!0})),e.on("readable",s.bind(null,n)),n}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":24,_process:12}],22:[function(e,t){"use strict";function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){for(var n,r=0;r<t.length;r++)(n=t[r]).enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}function i(e,t,n){s.prototype.copy.call(e,t,n)}var s=e("buffer").Buffer,a=e("util").inspect,l=a&&a.custom||"inspect";t.exports=function(){function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.head=null,this.tail=null,this.length=0}return function(e,t,n){t&&o(e.prototype,t),n&&o(e,n)}(e,[{key:"push",value:function(e){var t={data:e,next:null};0<this.length?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return s.alloc(0);for(var t=s.allocUnsafe(e>>>0),n=this.head,r=0;n;)i(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:"consume",value:function(e,t){var n;return e<this.head.data.length?(n=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):n=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,n=1,r=t.data;for(e-=r.length;t=t.next;){var o=t.data,i=e>o.length?o.length:e;if(r+=i===o.length?o:o.slice(0,e),0==(e-=i)){i===o.length?(++n,this.head=t.next?t.next:this.tail=null):(this.head=t,t.data=o.slice(i));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),n=this.head,r=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var o=n.data,i=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,i),0==(e-=i)){i===o.length?(++r,this.head=n.next?n.next:this.tail=null):(this.head=n,n.data=o.slice(i));break}++r}return this.length-=r,t}},{key:l,value:function(e,t){return a(this,function(e){for(var t,o=1;o<arguments.length;o++)t=null==arguments[o]?{}:arguments[o],o%2?n(Object(t),!0).forEach((function(n){r(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):n(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}));return e}({},t,{depth:0,customInspect:!1}))}}]),e}()},{buffer:3,util:2}],23:[function(e,t){(function(e){(function(){"use strict";function n(e,t){o(e,t),r(e)}function r(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function o(e,t){e.emit("error",t)}t.exports={destroy:function(t,i){var s=this,a=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return a||l?(i?i(t):t&&(this._writableState?!this._writableState.errorEmitted&&(this._writableState.errorEmitted=!0,e.nextTick(o,this,t)):e.nextTick(o,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!i&&t?s._writableState?s._writableState.errorEmitted?e.nextTick(r,s):(s._writableState.errorEmitted=!0,e.nextTick(n,s,t)):e.nextTick(n,s,t):i?(e.nextTick(r,s),i(t)):e.nextTick(r,s)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this)}).call(this,e("_process"))},{_process:12}],24:[function(e,t){"use strict";function n(){}var r=e("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;t.exports=function e(t,o,i){if("function"==typeof o)return e(t,null,o);o||(o={}),i=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];e.apply(this,r)}}}(i||n);var s=o.readable||!1!==o.readable&&t.readable,a=o.writable||!1!==o.writable&&t.writable,l=function(){t.writable||u()},c=t._writableState&&t._writableState.finished,u=function(){a=!1,c=!0,s||i.call(t)},d=t._readableState&&t._readableState.endEmitted,h=function(){s=!1,d=!0,a||i.call(t)},p=function(e){i.call(t,e)},f=function(){var e;return s&&!d?(t._readableState&&t._readableState.ended||(e=new r),i.call(t,e)):a&&!c?(t._writableState&&t._writableState.ended||(e=new r),i.call(t,e)):void 0},m=function(){t.req.on("finish",u)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",u),t.on("abort",f),t.req?m():t.on("request",m)):a&&!t._writableState&&(t.on("end",l),t.on("close",l)),t.on("end",h),t.on("finish",u),!1!==o.error&&t.on("error",p),t.on("close",f),function(){t.removeListener("complete",u),t.removeListener("abort",f),t.removeListener("request",m),t.req&&t.req.removeListener("finish",u),t.removeListener("end",l),t.removeListener("close",l),t.removeListener("finish",u),t.removeListener("end",h),t.removeListener("error",p),t.removeListener("close",f)}}},{"../../../errors":15}],25:[function(e,t){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],26:[function(e,t){"use strict";function n(e){if(e)throw e}function r(t,n,r,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var i=!1;t.on("close",(function(){i=!0})),void 0===a&&(a=e("./end-of-stream")),a(t,{readable:n,writable:r},(function(e){return e?o(e):(i=!0,void o())}));var s=!1;return function(e){if(!i)return s?void 0:(s=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new u("pipe")))}}function o(e){e()}function i(e,t){return e.pipe(t)}function s(e){return e.length&&"function"==typeof e[e.length-1]?e.pop():n}var a,l=e("../../../errors").codes,c=l.ERR_MISSING_ARGS,u=l.ERR_STREAM_DESTROYED;t.exports=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var a=s(t);if(Array.isArray(t[0])&&(t=t[0]),2>t.length)throw new c("streams");var l,u=t.map((function(e,n){var i=n<t.length-1;return r(e,i,0<n,(function(e){l||(l=e),e&&u.forEach(o),i||(u.forEach(o),a(l))}))}));return t.reduce(i)}},{"../../../errors":15,"./end-of-stream":24}],27:[function(e,t){"use strict";var n=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,o,i){var s=function(e,t,n){return null==e.highWaterMark?t?e[n]:null:e.highWaterMark}(t,i,o);if(null!=s){if(!isFinite(s)||r(s)!==s||0>s)throw new n(i?o:"highWaterMark",s);return r(s)}return e.objectMode?16:16384}}},{"../../../errors":15}],28:[function(e,t){t.exports=e("events").EventEmitter},{events:7}],29:[function(e,t,n){(n=t.exports=e("./lib/_stream_readable.js")).Stream=n,n.Readable=n,n.Writable=e("./lib/_stream_writable.js"),n.Duplex=e("./lib/_stream_duplex.js"),n.Transform=e("./lib/_stream_transform.js"),n.PassThrough=e("./lib/_stream_passthrough.js"),n.finished=e("./lib/internal/streams/end-of-stream.js"),n.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":16,"./lib/_stream_passthrough.js":17,"./lib/_stream_readable.js":18,"./lib/_stream_transform.js":19,"./lib/_stream_writable.js":20,"./lib/internal/streams/end-of-stream.js":24,"./lib/internal/streams/pipeline.js":26}],30:[function(e,t,n){function r(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return s(e,t,n)}var i=e("buffer"),s=i.Buffer;s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?t.exports=i:(r(i,n),n.Buffer=o),o.prototype=Object.create(s.prototype),r(s,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return s(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=s(e);return void 0===t?r.fill(0):"string"==typeof n?r.fill(t,n):r.fill(t),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return s(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},{buffer:3}],31:[function(e,t,n){"use strict";function r(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(h.isEncoding===p||!p(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=s,this.end=a,t=4;break;case"utf8":this.fillLast=i,t=4;break;case"base64":this.text=l,this.end=c,t=3;break;default:return this.write=u,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=h.allocUnsafe(t)}function o(e){return 127>=e?0:6==e>>5?2:14==e>>4?3:30==e>>3?4:2==e>>6?-1:-2}function i(e){var t=this.lastTotal-this.lastNeed,n=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(1<e.lastNeed&&1<t.length){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(2<e.lastNeed&&2<t.length&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0===n?this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length)):n}function s(e,t){if(0==(e.length-t)%2){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(55296<=r&&56319>=r)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function a(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function l(e,t){var n=(e.length-t)%3;return 0==n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1==n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function u(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}var h=e("safe-buffer").Buffer,p=h.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};n.StringDecoder=r,r.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},r.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},r.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=o(t[r]);return 0<=i?(0<i&&(e.lastNeed=i-1),i):--r<n||-2===i?0:0<=(i=o(t[r]))?(0<i&&(e.lastNeed=i-2),i):--r<n||-2===i?0:0<=(i=o(t[r]))?(0<i&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},r.prototype.fillLast=function(e){return this.lastNeed<=e.length?(e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),void(this.lastNeed-=e.length))}},{"safe-buffer":30}],32:[function(e,t){(function(e){(function(){function n(t){try{if(!e.localStorage)return!1}catch(e){return!1}var n=e.localStorage[t];return null!=n&&"true"===(n+"").toLowerCase()}t.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,void 0===n.g?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:n.g)},{}],"/":[function(e,t){function n(e){return e.replace(/a=ice-options:trickle\s\n/g,"")}const r=e("debug")("simple-peer"),o=e("get-browser-rtc"),i=e("randombytes"),s=e("readable-stream"),a=e("queue-microtask"),l=e("err-code"),{Buffer:c}=e("buffer"),u=65536;class d extends s.Duplex{constructor(e){if(super(e=Object.assign({allowHalfOpen:!1},e)),this._id=i(4).toString("hex").slice(0,7),this._debug("new peer %o",e),this.channelName=e.initiator?e.channelName||i(20).toString("hex"):null,this.initiator=e.initiator||!1,this.channelConfig=e.channelConfig||d.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},d.config,e.config),this.offerOptions=e.offerOptions||{},this.answerOptions=e.answerOptions||{},this.sdpTransform=e.sdpTransform||(e=>e),this.streams=e.streams||(e.stream?[e.stream]:[]),this.trickle=void 0===e.trickle||e.trickle,this.allowHalfTrickle=void 0!==e.allowHalfTrickle&&e.allowHalfTrickle,this.iceCompleteTimeout=e.iceCompleteTimeout||5e3,this.destroyed=!1,this.destroying=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=e.wrtc&&"object"==typeof e.wrtc?e.wrtc:o(),!this._wrtc)throw"undefined"==typeof window?l(new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"),"ERR_WEBRTC_SUPPORT"):l(new Error("No WebRTC support: Not a supported browser"),"ERR_WEBRTC_SUPPORT");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(e){return void this.destroy(l(e,"ERR_PC_CONSTRUCTOR"))}this._isReactNativeWebrtc="number"==typeof this._pc._peerConnectionId,this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=e=>{this._onIceCandidate(e)},"object"==typeof this._pc.peerIdentity&&this._pc.peerIdentity.catch((e=>{this.destroy(l(e,"ERR_PC_PEER_IDENTITY"))})),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=e=>{this._setupData(e)},this.streams&&this.streams.forEach((e=>{this.addStream(e)})),this._pc.ontrack=e=>{this._onTrack(e)},this._debug("initial negotiation"),this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once("finish",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&"open"===this._channel.readyState}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(e){if(!this.destroying){if(this.destroyed)throw l(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e={}}this._debug("signal()"),e.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),e.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(e.transceiverRequest.kind,e.transceiverRequest.init)),e.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(e.candidate):this._pendingCandidates.push(e.candidate)),e.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(e)).then((()=>{this.destroyed||(this._pendingCandidates.forEach((e=>{this._addIceCandidate(e)})),this._pendingCandidates=[],"offer"===this._pc.remoteDescription.type&&this._createAnswer())})).catch((e=>{this.destroy(l(e,"ERR_SET_REMOTE_DESCRIPTION"))})),e.sdp||e.candidate||e.renegotiate||e.transceiverRequest||this.destroy(l(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}}_addIceCandidate(e){const t=new this._wrtc.RTCIceCandidate(e);this._pc.addIceCandidate(t).catch((e=>{!t.address||t.address.endsWith(".local")?function(e){console.warn(e)}("Ignoring unsupported ICE candidate."):this.destroy(l(e,"ERR_ADD_ICE_CANDIDATE"))}))}send(e){if(!this.destroying){if(this.destroyed)throw l(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(e)}}addTransceiver(e,t){if(!this.destroying){if(this.destroyed)throw l(new Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(e,t),this._needsNegotiation()}catch(e){this.destroy(l(e,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{type:"transceiverRequest",transceiverRequest:{kind:e,init:t}})}}addStream(e){if(!this.destroying){if(this.destroyed)throw l(new Error("cannot addStream after peer is destroyed"),"ERR_DESTROYED");this._debug("addStream()"),e.getTracks().forEach((t=>{this.addTrack(t,e)}))}}addTrack(e,t){if(this.destroying)return;if(this.destroyed)throw l(new Error("cannot addTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("addTrack()");const n=this._senderMap.get(e)||new Map;let r=n.get(t);if(r)throw r.removed?l(new Error("Track has been removed. You should enable/disable tracks that you want to re-add."),"ERR_SENDER_REMOVED"):l(new Error("Track has already been added to that stream."),"ERR_SENDER_ALREADY_ADDED");r=this._pc.addTrack(e,t),n.set(t,r),this._senderMap.set(e,n),this._needsNegotiation()}replaceTrack(e,t,n){if(this.destroying)return;if(this.destroyed)throw l(new Error("cannot replaceTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("replaceTrack()");const r=this._senderMap.get(e),o=r?r.get(n):null;if(!o)throw l(new Error("Cannot replace track that was never added."),"ERR_TRACK_NOT_ADDED");t&&this._senderMap.set(t,r),null==o.replaceTrack?this.destroy(l(new Error("replaceTrack is not supported in this browser"),"ERR_UNSUPPORTED_REPLACETRACK")):o.replaceTrack(t)}removeTrack(e,t){if(this.destroying)return;if(this.destroyed)throw l(new Error("cannot removeTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSender()");const n=this._senderMap.get(e),r=n?n.get(t):null;if(!r)throw l(new Error("Cannot remove track that was never added."),"ERR_TRACK_NOT_ADDED");try{r.removed=!0,this._pc.removeTrack(r)}catch(e){"NS_ERROR_UNEXPECTED"===e.name?this._sendersAwaitingStable.push(r):this.destroy(l(e,"ERR_REMOVE_TRACK"))}this._needsNegotiation()}removeStream(e){if(!this.destroying){if(this.destroyed)throw l(new Error("cannot removeStream after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSenders()"),e.getTracks().forEach((t=>{this.removeTrack(t,e)}))}}_needsNegotiation(){this._debug("_needsNegotiation"),this._batchedNegotiation||(this._batchedNegotiation=!0,a((()=>{this._batchedNegotiation=!1,this.initiator||!this._firstNegotiation?(this._debug("starting batched negotiation"),this.negotiate()):this._debug("non-initiator initial negotiation request discarded"),this._firstNegotiation=!1})))}negotiate(){if(!this.destroying){if(this.destroyed)throw l(new Error("cannot negotiate after peer is destroyed"),"ERR_DESTROYED");this.initiator?this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("start negotiation"),setTimeout((()=>{this._createOffer()}),0)):this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("requesting negotiation from initiator"),this.emit("signal",{type:"renegotiate",renegotiate:!0})),this._isNegotiating=!0}}destroy(e){this._destroy(e,(()=>{}))}_destroy(e,t){this.destroyed||this.destroying||(this.destroying=!0,this._debug("destroying (error: %s)",e&&(e.message||e)),a((()=>{if(this.destroyed=!0,this.destroying=!1,this._debug("destroy (error: %s)",e&&(e.message||e)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this._connected=!1,this._pcReady=!1,this._channelReady=!1,this._remoteTracks=null,this._remoteStreams=null,this._senderMap=null,clearInterval(this._closingInterval),this._closingInterval=null,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._onFinishBound&&this.removeListener("finish",this._onFinishBound),this._onFinishBound=null,this._channel){try{this._channel.close()}catch(e){}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch(e){}this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.ondatachannel=null}this._pc=null,this._channel=null,e&&this.emit("error",e),this.emit("close"),t()})))}_setupData(e){if(!e.channel)return this.destroy(l(new Error("Data channel event is missing `channel` property"),"ERR_DATA_CHANNEL"));this._channel=e.channel,this._channel.binaryType="arraybuffer","number"==typeof this._channel.bufferedAmountLowThreshold&&(this._channel.bufferedAmountLowThreshold=u),this.channelName=this._channel.label,this._channel.onmessage=e=>{this._onChannelMessage(e)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=e=>{const t=e.error instanceof Error?e.error:new Error(`Datachannel error: ${e.message} ${e.filename}:${e.lineno}:${e.colno}`);this.destroy(l(t,"ERR_DATA_CHANNEL"))};let t=!1;this._closingInterval=setInterval((()=>{this._channel&&"closing"===this._channel.readyState?(t&&this._onChannelClose(),t=!0):t=!1}),5e3)}_read(){}_write(e,t,n){if(this.destroyed)return n(l(new Error("cannot write after peer is destroyed"),"ERR_DATA_CHANNEL"));if(this._connected){try{this.send(e)}catch(e){return this.destroy(l(e,"ERR_DATA_CHANNEL"))}this._channel.bufferedAmount>u?(this._debug("start backpressure: bufferedAmount %d",this._channel.bufferedAmount),this._cb=n):n(null)}else this._debug("write before connect"),this._chunk=e,this._cb=n}_onFinish(){if(!this.destroyed){const e=()=>{setTimeout((()=>this.destroy()),1e3)};this._connected?e():this.once("connect",e)}}_startIceCompleteTimeout(){this.destroyed||this._iceCompleteTimer||(this._debug("started iceComplete timeout"),this._iceCompleteTimer=setTimeout((()=>{this._iceComplete||(this._iceComplete=!0,this._debug("iceComplete timeout completed"),this.emit("iceTimeout"),this.emit("_iceComplete"))}),this.iceCompleteTimeout))}_createOffer(){this.destroyed||this._pc.createOffer(this.offerOptions).then((e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=n(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(!this.destroyed){const t=this._pc.localDescription||e;this._debug("signal"),this.emit("signal",{type:t.type,sdp:t.sdp})}};this._pc.setLocalDescription(e).then((()=>{this._debug("createOffer success"),this.destroyed||(this.trickle||this._iceComplete?t():this.once("_iceComplete",t))})).catch((e=>{this.destroy(l(e,"ERR_SET_LOCAL_DESCRIPTION"))}))})).catch((e=>{this.destroy(l(e,"ERR_CREATE_OFFER"))}))}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach((e=>{e.mid||!e.sender.track||e.requested||(e.requested=!0,this.addTransceiver(e.sender.track.kind))}))}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then((e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=n(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(!this.destroyed){const t=this._pc.localDescription||e;this._debug("signal"),this.emit("signal",{type:t.type,sdp:t.sdp}),this.initiator||this._requestMissingTransceivers()}};this._pc.setLocalDescription(e).then((()=>{this.destroyed||(this.trickle||this._iceComplete?t():this.once("_iceComplete",t))})).catch((e=>{this.destroy(l(e,"ERR_SET_LOCAL_DESCRIPTION"))}))})).catch((e=>{this.destroy(l(e,"ERR_CREATE_ANSWER"))}))}_onConnectionStateChange(){this.destroyed||"failed"===this._pc.connectionState&&this.destroy(l(new Error("Connection failed."),"ERR_CONNECTION_FAILURE"))}_onIceStateChange(){if(this.destroyed)return;const e=this._pc.iceConnectionState,t=this._pc.iceGatheringState;this._debug("iceStateChange (connection: %s) (gathering: %s)",e,t),this.emit("iceStateChange",e,t),("connected"===e||"completed"===e)&&(this._pcReady=!0,this._maybeReady()),"failed"===e&&this.destroy(l(new Error("Ice connection failed."),"ERR_ICE_CONNECTION_FAILURE")),"closed"===e&&this.destroy(l(new Error("Ice connection closed."),"ERR_ICE_CONNECTION_CLOSED"))}getStats(e){const t=e=>("[object Array]"===Object.prototype.toString.call(e.values)&&e.values.forEach((t=>{Object.assign(e,t)})),e);0===this._pc.getStats.length||this._isReactNativeWebrtc?this._pc.getStats().then((n=>{const r=[];n.forEach((e=>{r.push(t(e))})),e(null,r)}),(t=>e(t))):0<this._pc.getStats.length?this._pc.getStats((n=>{if(this.destroyed)return;const r=[];n.result().forEach((e=>{const n={};e.names().forEach((t=>{n[t]=e.stat(t)})),n.id=e.id,n.type=e.type,n.timestamp=e.timestamp,r.push(t(n))})),e(null,r)}),(t=>e(t))):e(null,[])}_maybeReady(){if(this._debug("maybeReady pc %s channel %s",this._pcReady,this._channelReady),this._connected||this._connecting||!this._pcReady||!this._channelReady)return;this._connecting=!0;const e=()=>{this.destroyed||this.getStats(((t,n)=>{if(this.destroyed)return;t&&(n=[]);const r={},o={},i={};let s=!1;n.forEach((e=>{("remotecandidate"===e.type||"remote-candidate"===e.type)&&(r[e.id]=e),("localcandidate"===e.type||"local-candidate"===e.type)&&(o[e.id]=e),("candidatepair"===e.type||"candidate-pair"===e.type)&&(i[e.id]=e)}));const a=e=>{s=!0;let t=o[e.localCandidateId];t&&(t.ip||t.address)?(this.localAddress=t.ip||t.address,this.localPort=+t.port):t&&t.ipAddress?(this.localAddress=t.ipAddress,this.localPort=+t.portNumber):"string"==typeof e.googLocalAddress&&(t=e.googLocalAddress.split(":"),this.localAddress=t[0],this.localPort=+t[1]),this.localAddress&&(this.localFamily=this.localAddress.includes(":")?"IPv6":"IPv4");let n=r[e.remoteCandidateId];n&&(n.ip||n.address)?(this.remoteAddress=n.ip||n.address,this.remotePort=+n.port):n&&n.ipAddress?(this.remoteAddress=n.ipAddress,this.remotePort=+n.portNumber):"string"==typeof e.googRemoteAddress&&(n=e.googRemoteAddress.split(":"),this.remoteAddress=n[0],this.remotePort=+n[1]),this.remoteAddress&&(this.remoteFamily=this.remoteAddress.includes(":")?"IPv6":"IPv4"),this._debug("connect local: %s:%s remote: %s:%s",this.localAddress,this.localPort,this.remoteAddress,this.remotePort)};if(n.forEach((e=>{"transport"===e.type&&e.selectedCandidatePairId&&a(i[e.selectedCandidatePairId]),("googCandidatePair"===e.type&&"true"===e.googActiveConnection||("candidatepair"===e.type||"candidate-pair"===e.type)&&e.selected)&&a(e)})),s||Object.keys(i).length&&!Object.keys(o).length){if(this._connecting=!1,this._connected=!0,this._chunk){try{this.send(this._chunk)}catch(e){return this.destroy(l(e,"ERR_DATA_CHANNEL"))}this._chunk=null,this._debug('sent chunk from "write before connect"');const e=this._cb;this._cb=null,e(null)}"number"!=typeof this._channel.bufferedAmountLowThreshold&&(this._interval=setInterval((()=>this._onInterval()),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")}else setTimeout(e,100)}))};e()}_onInterval(){this._cb&&this._channel&&!(this._channel.bufferedAmount>u)&&this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||("stable"===this._pc.signalingState&&(this._isNegotiating=!1,this._debug("flushing sender queue",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach((e=>{this._pc.removeTrack(e),this._queuedNegotiation=!0})),this._sendersAwaitingStable=[],this._queuedNegotiation?(this._debug("flushing negotiation queue"),this._queuedNegotiation=!1,this._needsNegotiation()):(this._debug("negotiated"),this.emit("negotiated"))),this._debug("signalingStateChange %s",this._pc.signalingState),this.emit("signalingStateChange",this._pc.signalingState))}_onIceCandidate(e){this.destroyed||(e.candidate&&this.trickle?this.emit("signal",{type:"candidate",candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}}):!e.candidate&&!this._iceComplete&&(this._iceComplete=!0,this.emit("_iceComplete")),e.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(e){if(this.destroyed)return;let t=e.data;t instanceof ArrayBuffer&&(t=c.from(t)),this.push(t)}_onChannelBufferedAmountLow(){if(!this.destroyed&&this._cb){this._debug("ending backpressure: bufferedAmount %d",this._channel.bufferedAmount);const e=this._cb;this._cb=null,e(null)}}_onChannelOpen(){this._connected||this.destroyed||(this._debug("on channel open"),this._channelReady=!0,this._maybeReady())}_onChannelClose(){this.destroyed||(this._debug("on channel close"),this.destroy())}_onTrack(e){this.destroyed||e.streams.forEach((t=>{this._debug("on track"),this.emit("track",e.track,t),this._remoteTracks.push({track:e.track,stream:t}),this._remoteStreams.some((e=>e.id===t.id))||(this._remoteStreams.push(t),a((()=>{this._debug("on stream"),this.emit("stream",t)})))}))}_debug(){const e=[].slice.call(arguments);e[0]="["+this._id+"] "+e[0],r.apply(null,e)}}d.WEBRTC_SUPPORT=!!o(),d.config={iceServers:[{urls:["stun:stun.l.google.com:19302","stun:global.stun.twilio.com:3478"]}],sdpSemantics:"unified-plan"},d.channelConfig={},t.exports=d},{buffer:3,debug:4,"err-code":6,"get-browser-rtc":8,"queue-microtask":13,randombytes:14,"readable-stream":29}]},{},[])("/"))},68743:(e,t,n)=>{var r=n(43575),o=n(67243),i=n(83868),s=n(40193);function a(){return Array.prototype.reduce.call(arguments,(function(e,t){return o.resolve(e,t)}))}function l(e){return"\\"===i.sep?e.replace(/\\/g,"/").replace(/^[a-z]:\/?/i,"/"):e}function c(e){return s(e.replace(/\+/g,"%2B"))}function u(e,t,n){setImmediate((function(){e(t,n)}))}function d(e,t){try{return JSON.parse(e.replace(/^\)\]\}'/,""))}catch(e){throw e.sourceMapData=t,e}}function h(e,t,n){var r=c(t);try{return String(e(r))}catch(e){throw e.sourceMapData=n,e}}var p=/[#@] sourceMappingURL=([^\s'"]*)/,f=RegExp("(?:/\\*(?:\\s*\r?\n(?://)?)?(?:"+p.source+")\\s*\\*/|//(?:"+p.source+"))\\s*");function m(e,t,n,r){var o;try{o=_(e,t)}catch(e){return u(r,e)}if(!o||o.map)return u(r,null,o);n(c(o.url),(function(e,t){if(e)return e.sourceMapData=o,r(e);o.map=String(t);try{o.map=d(o.map,o)}catch(e){return r(e)}r(null,o)}))}function g(e,t,n){var r=_(e,t);return!r||r.map||(r.map=h(n,r.url,r),r.map=d(r.map,r)),r}var b=/^data:([^,;]*)(;[^,;]*)*(?:,(.*))?$/,y=/^(?:application|text)\/json$/,v="utf-8";function _(e,t){t=l(t);var n=function(e){var t=e.match(f);return t?t[1]||t[2]||"":null}(e);if(!n)return null;var o=n.match(b);if(o){var i=o[1]||"text/plain",s=o[2]||"",c=o[3]||"",u={sourceMappingURL:n,url:null,sourcesRelativeTo:t,map:c};if(!y.test(i)){var h=new Error("Unuseful data uri mime type: "+i);throw h.sourceMapData=u,h}try{u.map=d(";base64"===s?function(e){if("undefined"==typeof TextDecoder||"undefined"==typeof Uint8Array)return r(e);var t=function(e){for(var t=r(e),n=t.length,o=new Uint8Array(n),i=0;i<n;i++)o[i]=t.charCodeAt(i);return o}(e);return new TextDecoder(v,{fatal:!0}).decode(t)}(c):decodeURIComponent(c),u)}catch(h){throw h.sourceMapData=u,h}return u}var p=a(t,n);return{sourceMappingURL:n,url:p,sourcesRelativeTo:p,map:null}}function x(e,t,n,r,o){"function"==typeof r&&(o=r,r={});var i=e.sources?e.sources.length:0,s={sourcesResolved:[],sourcesContent:[]};if(0!==i){var a=function(){0==--i&&o(null,s)};C(e,t,r,(function(e,t,r){if(s.sourcesResolved[r]=e,"string"==typeof t)s.sourcesContent[r]=t,u(a,null);else{var o=c(e);n(o,(function(e,t){s.sourcesContent[r]=e||String(t),a()}))}}))}else u(o,null,s)}function w(e,t,n,r){var o={sourcesResolved:[],sourcesContent:[]};return e.sources&&0!==e.sources.length?(C(e,t,r,(function(e,t,r){if(o.sourcesResolved[r]=e,null!==n)if("string"==typeof t)o.sourcesContent[r]=t;else{var i=c(e);try{o.sourcesContent[r]=String(n(i))}catch(e){o.sourcesContent[r]=e}}})),o):o}var k=/\/?$/;function C(e,t,n,r){var o;n=n||{},t=l(t);for(var i=0,s=e.sources.length;i<s;i++)o=null,"string"==typeof n.sourceRoot?o=n.sourceRoot:"string"==typeof e.sourceRoot&&!1!==n.sourceRoot&&(o=e.sourceRoot),r(null===o||""===o?a(t,e.sources[i]):a(t,o.replace(k,"/"),e.sources[i]),(e.sourcesContent||[])[i],i)}e.exports={resolveSourceMap:m,resolveSourceMapSync:g,resolveSources:x,resolveSourcesSync:w,resolve:function(e,t,n,r,o){if("function"==typeof r&&(o=r,r={}),null===e){var i={sourceMappingURL:null,url:t,sourcesRelativeTo:t,map:null},s=c(t);n(s,(function(e,t){if(e)return e.sourceMapData=i,o(e);i.map=String(t);try{i.map=d(i.map,i)}catch(e){return o(e)}a(i)}))}else m(e,t,n,(function(e,t){return e?o(e):t?void a(t):o(null,null)}));function a(e){x(e.map,e.sourcesRelativeTo,n,r,(function(t,n){if(t)return o(t);e.sourcesResolved=n.sourcesResolved,e.sourcesContent=n.sourcesContent,o(null,e)}))}},resolveSync:function(e,t,n,r){var o;if(null===e)(o={sourceMappingURL:null,url:t,sourcesRelativeTo:t,map:null}).map=h(n,t,o),o.map=d(o.map,o);else if(!(o=g(e,t,n)))return null;var i=w(o.map,o.sourcesRelativeTo,n,r);return o.sourcesResolved=i.sourcesResolved,o.sourcesContent=i.sourcesContent,o},parseMapToJSON:d}},56320:(e,t,n)=>{var r=n(71438),o=Object.prototype.hasOwnProperty,i="undefined"!=typeof Map;function s(){this._array=[],this._set=i?new Map:Object.create(null)}s.fromArray=function(e,t){for(var n=new s,r=0,o=e.length;r<o;r++)n.add(e[r],t);return n},s.prototype.size=function(){return i?this._set.size:Object.getOwnPropertyNames(this._set).length},s.prototype.add=function(e,t){var n=i?e:r.toSetString(e),s=i?this.has(e):o.call(this._set,n),a=this._array.length;s&&!t||this._array.push(e),s||(i?this._set.set(e,a):this._set[n]=a)},s.prototype.has=function(e){if(i)return this._set.has(e);var t=r.toSetString(e);return o.call(this._set,t)},s.prototype.indexOf=function(e){if(i){var t=this._set.get(e);if(t>=0)return t}else{var n=r.toSetString(e);if(o.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},s.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},s.prototype.toArray=function(){return this._array.slice()},t.C=s},13929:(e,t,n)=>{var r=n(77865);t.encode=function(e){var t,n="",o=function(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{t=31&o,(o>>>=5)>0&&(t|=32),n+=r.encode(t)}while(o>0);return n},t.decode=function(e,t,n){var o,i,s,a,l=e.length,c=0,u=0;do{if(t>=l)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(i=r.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));o=!!(32&i),c+=(i&=31)<<u,u+=5}while(o);n.value=(a=(s=c)>>1,1&~s?a:-a),n.rest=t}},77865:(e,t)=>{var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(e){if(0<=e&&e<n.length)return n[e];throw new TypeError("Must be between 0 and 63: "+e)},t.decode=function(e){return 65<=e&&e<=90?e-65:97<=e&&e<=122?e-97+26:48<=e&&e<=57?e-48+52:43==e?62:47==e?63:-1}},24988:(e,t)=>{function n(e,r,o,i,s,a){var l=Math.floor((r-e)/2)+e,c=s(o,i[l],!0);return 0===c?l:c>0?r-l>1?n(l,r,o,i,s,a):a==t.LEAST_UPPER_BOUND?r<i.length?r:-1:l:l-e>1?n(e,l,o,i,s,a):a==t.LEAST_UPPER_BOUND?l:e<0?-1:e}t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(e,r,o,i){if(0===r.length)return-1;var s=n(-1,r.length,e,r,o,i||t.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&0===o(r[s],r[s-1],!0);)--s;return s}},59131:(e,t,n)=>{var r=n(71438);function o(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}o.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},o.prototype.add=function(e){var t,n,o,i,s,a;n=e,o=(t=this._last).generatedLine,i=n.generatedLine,s=t.generatedColumn,a=n.generatedColumn,i>o||i==o&&a>=s||r.compareByGeneratedPositionsInflated(t,n)<=0?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},o.prototype.toArray=function(){return this._sorted||(this._array.sort(r.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.P=o},84252:(e,t)=>{function n(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function r(e,t,o,i){if(o<i){var s=o-1;n(e,(u=o,d=i,Math.round(u+Math.random()*(d-u))),i);for(var a=e[i],l=o;l<i;l++)t(e[l],a)<=0&&n(e,s+=1,l);n(e,s+1,l);var c=s+1;r(e,t,o,c-1),r(e,t,c+1,i)}var u,d}t.g=function(e,t){r(e,t,0,e.length-1)}},2589:(e,t,n)=>{var r=n(71438),o=n(24988),i=n(56320).C,s=n(13929),a=n(84252).g;function l(e,t){var n=e;return"string"==typeof e&&(n=r.parseSourceMapInput(e)),null!=n.sections?new d(n,t):new c(n,t)}function c(e,t){var n=e;"string"==typeof e&&(n=r.parseSourceMapInput(e));var o=r.getArg(n,"version"),s=r.getArg(n,"sources"),a=r.getArg(n,"names",[]),l=r.getArg(n,"sourceRoot",null),c=r.getArg(n,"sourcesContent",null),u=r.getArg(n,"mappings"),d=r.getArg(n,"file",null);if(o!=this._version)throw new Error("Unsupported version: "+o);l&&(l=r.normalize(l)),s=s.map(String).map(r.normalize).map((function(e){return l&&r.isAbsolute(l)&&r.isAbsolute(e)?r.relative(l,e):e})),this._names=i.fromArray(a.map(String),!0),this._sources=i.fromArray(s,!0),this._absoluteSources=this._sources.toArray().map((function(e){return r.computeSourceURL(l,e,t)})),this.sourceRoot=l,this.sourcesContent=c,this._mappings=u,this._sourceMapURL=t,this.file=d}function u(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function d(e,t){var n=e;"string"==typeof e&&(n=r.parseSourceMapInput(e));var o=r.getArg(n,"version"),s=r.getArg(n,"sections");if(o!=this._version)throw new Error("Unsupported version: "+o);this._sources=new i,this._names=new i;var a={line:-1,column:0};this._sections=s.map((function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var n=r.getArg(e,"offset"),o=r.getArg(n,"line"),i=r.getArg(n,"column");if(o<a.line||o===a.line&&i<a.column)throw new Error("Section offsets must be ordered and non-overlapping.");return a=n,{generatedOffset:{generatedLine:o+1,generatedColumn:i+1},consumer:new l(r.getArg(e,"map"),t)}}))}l.fromSourceMap=function(e,t){return c.fromSourceMap(e,t)},l.prototype._version=3,l.prototype.__generatedMappings=null,Object.defineProperty(l.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),l.prototype.__originalMappings=null,Object.defineProperty(l.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),l.prototype._charIsMappingSeparator=function(e,t){var n=e.charAt(t);return";"===n||","===n},l.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")},l.GENERATED_ORDER=1,l.ORIGINAL_ORDER=2,l.GREATEST_LOWER_BOUND=1,l.LEAST_UPPER_BOUND=2,l.prototype.eachMapping=function(e,t,n){var o,i=t||null;switch(n||l.GENERATED_ORDER){case l.GENERATED_ORDER:o=this._generatedMappings;break;case l.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var s=this.sourceRoot;o.map((function(e){var t=null===e.source?null:this._sources.at(e.source);return{source:t=r.computeSourceURL(s,t,this._sourceMapURL),generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:null===e.name?null:this._names.at(e.name)}}),this).forEach(e,i)},l.prototype.allGeneratedPositionsFor=function(e){var t=r.getArg(e,"line"),n={source:r.getArg(e,"source"),originalLine:t,originalColumn:r.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var i=[],s=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",r.compareByOriginalPositions,o.LEAST_UPPER_BOUND);if(s>=0){var a=this._originalMappings[s];if(void 0===e.column)for(var l=a.originalLine;a&&a.originalLine===l;)i.push({line:r.getArg(a,"generatedLine",null),column:r.getArg(a,"generatedColumn",null),lastColumn:r.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++s];else for(var c=a.originalColumn;a&&a.originalLine===t&&a.originalColumn==c;)i.push({line:r.getArg(a,"generatedLine",null),column:r.getArg(a,"generatedColumn",null),lastColumn:r.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++s]}return i},t.SourceMapConsumer=l,c.prototype=Object.create(l.prototype),c.prototype.consumer=l,c.prototype._findSourceIndex=function(e){var t,n=e;if(null!=this.sourceRoot&&(n=r.relative(this.sourceRoot,n)),this._sources.has(n))return this._sources.indexOf(n);for(t=0;t<this._absoluteSources.length;++t)if(this._absoluteSources[t]==e)return t;return-1},c.fromSourceMap=function(e,t){var n=Object.create(c.prototype),o=n._names=i.fromArray(e._names.toArray(),!0),s=n._sources=i.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=t,n._absoluteSources=n._sources.toArray().map((function(e){return r.computeSourceURL(n.sourceRoot,e,t)}));for(var l=e._mappings.toArray().slice(),d=n.__generatedMappings=[],h=n.__originalMappings=[],p=0,f=l.length;p<f;p++){var m=l[p],g=new u;g.generatedLine=m.generatedLine,g.generatedColumn=m.generatedColumn,m.source&&(g.source=s.indexOf(m.source),g.originalLine=m.originalLine,g.originalColumn=m.originalColumn,m.name&&(g.name=o.indexOf(m.name)),h.push(g)),d.push(g)}return a(n.__originalMappings,r.compareByOriginalPositions),n},c.prototype._version=3,Object.defineProperty(c.prototype,"sources",{get:function(){return this._absoluteSources.slice()}}),c.prototype._parseMappings=function(e,t){for(var n,o,i,l,c,d=1,h=0,p=0,f=0,m=0,g=0,b=e.length,y=0,v={},_={},x=[],w=[];y<b;)if(";"===e.charAt(y))d++,y++,h=0;else if(","===e.charAt(y))y++;else{for((n=new u).generatedLine=d,l=y;l<b&&!this._charIsMappingSeparator(e,l);l++);if(i=v[o=e.slice(y,l)])y+=o.length;else{for(i=[];y<l;)s.decode(e,y,_),c=_.value,y=_.rest,i.push(c);if(2===i.length)throw new Error("Found a source, but no line and column");if(3===i.length)throw new Error("Found a source and line, but no column");v[o]=i}n.generatedColumn=h+i[0],h=n.generatedColumn,i.length>1&&(n.source=m+i[1],m+=i[1],n.originalLine=p+i[2],p=n.originalLine,n.originalLine+=1,n.originalColumn=f+i[3],f=n.originalColumn,i.length>4&&(n.name=g+i[4],g+=i[4])),w.push(n),"number"==typeof n.originalLine&&x.push(n)}a(w,r.compareByGeneratedPositionsDeflated),this.__generatedMappings=w,a(x,r.compareByOriginalPositions),this.__originalMappings=x},c.prototype._findMapping=function(e,t,n,r,i,s){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return o.search(e,t,i,s)},c.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(t.generatedLine===n.generatedLine){t.lastGeneratedColumn=n.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}},c.prototype.originalPositionFor=function(e){var t={generatedLine:r.getArg(e,"line"),generatedColumn:r.getArg(e,"column")},n=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",r.compareByGeneratedPositionsDeflated,r.getArg(e,"bias",l.GREATEST_LOWER_BOUND));if(n>=0){var o=this._generatedMappings[n];if(o.generatedLine===t.generatedLine){var i=r.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),i=r.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var s=r.getArg(o,"name",null);return null!==s&&(s=this._names.at(s)),{source:i,line:r.getArg(o,"originalLine",null),column:r.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}},c.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(e){return null==e}))},c.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var o,i=e;if(null!=this.sourceRoot&&(i=r.relative(this.sourceRoot,i)),null!=this.sourceRoot&&(o=r.urlParse(this.sourceRoot))){var s=i.replace(/^file:\/\//,"");if("file"==o.scheme&&this._sources.has(s))return this.sourcesContent[this._sources.indexOf(s)];if((!o.path||"/"==o.path)&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(t)return null;throw new Error('"'+i+'" is not in the SourceMap.')},c.prototype.generatedPositionFor=function(e){var t=r.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};var n={source:t,originalLine:r.getArg(e,"line"),originalColumn:r.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",r.compareByOriginalPositions,r.getArg(e,"bias",l.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===n.source)return{line:r.getArg(i,"generatedLine",null),column:r.getArg(i,"generatedColumn",null),lastColumn:r.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},d.prototype=Object.create(l.prototype),d.prototype.constructor=l,d.prototype._version=3,Object.defineProperty(d.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var n=0;n<this._sections[t].consumer.sources.length;n++)e.push(this._sections[t].consumer.sources[n]);return e}}),d.prototype.originalPositionFor=function(e){var t={generatedLine:r.getArg(e,"line"),generatedColumn:r.getArg(e,"column")},n=o.search(t,this._sections,(function(e,t){return e.generatedLine-t.generatedOffset.generatedLine||e.generatedColumn-t.generatedOffset.generatedColumn})),i=this._sections[n];return i?i.consumer.originalPositionFor({line:t.generatedLine-(i.generatedOffset.generatedLine-1),column:t.generatedColumn-(i.generatedOffset.generatedLine===t.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},d.prototype.hasContentsOfAllSources=function(){return this._sections.every((function(e){return e.consumer.hasContentsOfAllSources()}))},d.prototype.sourceContentFor=function(e,t){for(var n=0;n<this._sections.length;n++){var r=this._sections[n].consumer.sourceContentFor(e,!0);if(r)return r}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},d.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var n=this._sections[t];if(-1!==n.consumer._findSourceIndex(r.getArg(e,"source"))){var o=n.consumer.generatedPositionFor(e);if(o)return{line:o.line+(n.generatedOffset.generatedLine-1),column:o.column+(n.generatedOffset.generatedLine===o.line?n.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},d.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var o=this._sections[n],i=o.consumer._generatedMappings,s=0;s<i.length;s++){var l=i[s],c=o.consumer._sources.at(l.source);c=r.computeSourceURL(o.consumer.sourceRoot,c,this._sourceMapURL),this._sources.add(c),c=this._sources.indexOf(c);var u=null;l.name&&(u=o.consumer._names.at(l.name),this._names.add(u),u=this._names.indexOf(u));var d={source:c,generatedLine:l.generatedLine+(o.generatedOffset.generatedLine-1),generatedColumn:l.generatedColumn+(o.generatedOffset.generatedLine===l.generatedLine?o.generatedOffset.generatedColumn-1:0),originalLine:l.originalLine,originalColumn:l.originalColumn,name:u};this.__generatedMappings.push(d),"number"==typeof d.originalLine&&this.__originalMappings.push(d)}a(this.__generatedMappings,r.compareByGeneratedPositionsDeflated),a(this.__originalMappings,r.compareByOriginalPositions)}},15356:(e,t,n)=>{var r=n(13929),o=n(71438),i=n(56320).C,s=n(59131).P;function a(e){e||(e={}),this._file=o.getArg(e,"file",null),this._sourceRoot=o.getArg(e,"sourceRoot",null),this._skipValidation=o.getArg(e,"skipValidation",!1),this._sources=new i,this._names=new i,this._mappings=new s,this._sourcesContents=null}a.prototype._version=3,a.fromSourceMap=function(e){var t=e.sourceRoot,n=new a({file:e.file,sourceRoot:t});return e.eachMapping((function(e){var r={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(r.source=e.source,null!=t&&(r.source=o.relative(t,r.source)),r.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(r.name=e.name)),n.addMapping(r)})),e.sources.forEach((function(r){var i=r;null!==t&&(i=o.relative(t,r)),n._sources.has(i)||n._sources.add(i);var s=e.sourceContentFor(r);null!=s&&n.setSourceContent(r,s)})),n},a.prototype.addMapping=function(e){var t=o.getArg(e,"generated"),n=o.getArg(e,"original",null),r=o.getArg(e,"source",null),i=o.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,r,i),null!=r&&(r=String(r),this._sources.has(r)||this._sources.add(r)),null!=i&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=n&&n.line,originalColumn:null!=n&&n.column,source:r,name:i})},a.prototype.setSourceContent=function(e,t){var n=e;null!=this._sourceRoot&&(n=o.relative(this._sourceRoot,n)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[o.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[o.toSetString(n)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},a.prototype.applySourceMap=function(e,t,n){var r=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');r=e.file}var s=this._sourceRoot;null!=s&&(r=o.relative(s,r));var a=new i,l=new i;this._mappings.unsortedForEach((function(t){if(t.source===r&&null!=t.originalLine){var i=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=i.source&&(t.source=i.source,null!=n&&(t.source=o.join(n,t.source)),null!=s&&(t.source=o.relative(s,t.source)),t.originalLine=i.line,t.originalColumn=i.column,null!=i.name&&(t.name=i.name))}var c=t.source;null==c||a.has(c)||a.add(c);var u=t.name;null==u||l.has(u)||l.add(u)}),this),this._sources=a,this._names=l,e.sources.forEach((function(t){var r=e.sourceContentFor(t);null!=r&&(null!=n&&(t=o.join(n,t)),null!=s&&(t=o.relative(s,t)),this.setSourceContent(t,r))}),this)},a.prototype._validateMapping=function(e,t,n,r){if(t&&"number"!=typeof t.line&&"number"!=typeof t.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||n||r)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}))},a.prototype._serializeMappings=function(){for(var e,t,n,i,s=0,a=1,l=0,c=0,u=0,d=0,h="",p=this._mappings.toArray(),f=0,m=p.length;f<m;f++){if(e="",(t=p[f]).generatedLine!==a)for(s=0;t.generatedLine!==a;)e+=";",a++;else if(f>0){if(!o.compareByGeneratedPositionsInflated(t,p[f-1]))continue;e+=","}e+=r.encode(t.generatedColumn-s),s=t.generatedColumn,null!=t.source&&(i=this._sources.indexOf(t.source),e+=r.encode(i-d),d=i,e+=r.encode(t.originalLine-1-c),c=t.originalLine-1,e+=r.encode(t.originalColumn-l),l=t.originalColumn,null!=t.name&&(n=this._names.indexOf(t.name),e+=r.encode(n-u),u=n)),h+=e}return h},a.prototype._generateSourcesContent=function(e,t){return e.map((function(e){if(!this._sourcesContents)return null;null!=t&&(e=o.relative(t,e));var n=o.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null}),this)},a.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},a.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=a},81624:(e,t,n)=>{var r=n(15356).SourceMapGenerator,o=n(71438),i=/(\r?\n)/,s="$$$isSourceNode$$$";function a(e,t,n,r,o){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==n?null:n,this.name=null==o?null:o,this[s]=!0,null!=r&&this.add(r)}a.fromStringWithSourceMap=function(e,t,n){var r=new a,s=e.split(i),l=0,c=function(){return e()+(e()||"");function e(){return l<s.length?s[l++]:void 0}},u=1,d=0,h=null;return t.eachMapping((function(e){if(null!==h){if(!(u<e.generatedLine)){var t=(n=s[l]||"").substr(0,e.generatedColumn-d);return s[l]=n.substr(e.generatedColumn-d),d=e.generatedColumn,p(h,t),void(h=e)}p(h,c()),u++,d=0}for(;u<e.generatedLine;)r.add(c()),u++;if(d<e.generatedColumn){var n=s[l]||"";r.add(n.substr(0,e.generatedColumn)),s[l]=n.substr(e.generatedColumn),d=e.generatedColumn}h=e}),this),l<s.length&&(h&&p(h,c()),r.add(s.splice(l).join(""))),t.sources.forEach((function(e){var i=t.sourceContentFor(e);null!=i&&(null!=n&&(e=o.join(n,e)),r.setSourceContent(e,i))})),r;function p(e,t){if(null===e||void 0===e.source)r.add(t);else{var i=n?o.join(n,e.source):e.source;r.add(new a(e.originalLine,e.originalColumn,i,t,e.name))}}},a.prototype.add=function(e){if(Array.isArray(e))e.forEach((function(e){this.add(e)}),this);else{if(!e[s]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},a.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[s]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},a.prototype.walk=function(e){for(var t,n=0,r=this.children.length;n<r;n++)(t=this.children[n])[s]?t.walk(e):""!==t&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})},a.prototype.join=function(e){var t,n,r=this.children.length;if(r>0){for(t=[],n=0;n<r-1;n++)t.push(this.children[n]),t.push(e);t.push(this.children[n]),this.children=t}return this},a.prototype.replaceRight=function(e,t){var n=this.children[this.children.length-1];return n[s]?n.replaceRight(e,t):"string"==typeof n?this.children[this.children.length-1]=n.replace(e,t):this.children.push("".replace(e,t)),this},a.prototype.setSourceContent=function(e,t){this.sourceContents[o.toSetString(e)]=t},a.prototype.walkSourceContents=function(e){for(var t=0,n=this.children.length;t<n;t++)this.children[t][s]&&this.children[t].walkSourceContents(e);var r=Object.keys(this.sourceContents);for(t=0,n=r.length;t<n;t++)e(o.fromSetString(r[t]),this.sourceContents[r[t]])},a.prototype.toString=function(){var e="";return this.walk((function(t){e+=t})),e},a.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},n=new r(e),o=!1,i=null,s=null,a=null,l=null;return this.walk((function(e,r){t.code+=e,null!==r.source&&null!==r.line&&null!==r.column?(i===r.source&&s===r.line&&a===r.column&&l===r.name||n.addMapping({source:r.source,original:{line:r.line,column:r.column},generated:{line:t.line,column:t.column},name:r.name}),i=r.source,s=r.line,a=r.column,l=r.name,o=!0):o&&(n.addMapping({generated:{line:t.line,column:t.column}}),i=null,o=!1);for(var c=0,u=e.length;c<u;c++)10===e.charCodeAt(c)?(t.line++,t.column=0,c+1===u?(i=null,o=!1):o&&n.addMapping({source:r.source,original:{line:r.line,column:r.column},generated:{line:t.line,column:t.column},name:r.name})):t.column++})),this.walkSourceContents((function(e,t){n.setSourceContent(e,t)})),{code:t.code,map:n}}},71438:(e,t)=>{t.getArg=function(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')};var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function o(e){var t=e.match(n);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function i(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function s(e){var n=e,r=o(e);if(r){if(!r.path)return e;n=r.path}for(var s,a=t.isAbsolute(n),l=n.split(/\/+/),c=0,u=l.length-1;u>=0;u--)"."===(s=l[u])?l.splice(u,1):".."===s?c++:c>0&&(""===s?(l.splice(u+1,c),c=0):(l.splice(u,2),c--));return""===(n=l.join("/"))&&(n=a?"/":"."),r?(r.path=n,i(r)):n}function a(e,t){""===e&&(e="."),""===t&&(t=".");var n=o(t),a=o(e);if(a&&(e=a.path||"/"),n&&!n.scheme)return a&&(n.scheme=a.scheme),i(n);if(n||t.match(r))return t;if(a&&!a.host&&!a.path)return a.host=t,i(a);var l="/"===t.charAt(0)?t:s(e.replace(/\/+$/,"")+"/"+t);return a?(a.path=l,i(a)):l}t.urlParse=o,t.urlGenerate=i,t.normalize=s,t.join=a,t.isAbsolute=function(e){return"/"===e.charAt(0)||n.test(e)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)};var l=!("__proto__"in Object.create(null));function c(e){return e}function u(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function d(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}t.toSetString=l?c:function(e){return u(e)?"$"+e:e},t.fromSetString=l?c:function(e){return u(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,n){var r=d(e.source,t.source);return 0!==r||0!=(r=e.originalLine-t.originalLine)||0!=(r=e.originalColumn-t.originalColumn)||n||0!=(r=e.generatedColumn-t.generatedColumn)||0!=(r=e.generatedLine-t.generatedLine)?r:d(e.name,t.name)},t.compareByGeneratedPositionsDeflated=function(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r||0!=(r=e.generatedColumn-t.generatedColumn)||n||0!==(r=d(e.source,t.source))||0!=(r=e.originalLine-t.originalLine)||0!=(r=e.originalColumn-t.originalColumn)?r:d(e.name,t.name)},t.compareByGeneratedPositionsInflated=function(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n||0!=(n=e.generatedColumn-t.generatedColumn)||0!==(n=d(e.source,t.source))||0!=(n=e.originalLine-t.originalLine)||0!=(n=e.originalColumn-t.originalColumn)?n:d(e.name,t.name)},t.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},t.computeSourceURL=function(e,t,n){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),n){var r=o(n);if(!r)throw new Error("sourceMapURL could not be parsed");if(r.path){var l=r.path.lastIndexOf("/");l>=0&&(r.path=r.path.substring(0,l+1))}t=a(i(r),t)}return s(t)}},56116:(e,t,n)=>{t.SourceMapGenerator=n(15356).SourceMapGenerator,t.SourceMapConsumer=n(2589).SourceMapConsumer,n(81624)},67243:(e,t,n)=>{"use strict";var r=n(89738);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var i=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(l),u=["%","/","?",";","#"].concat(c),d=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=n(63957);function y(e,t,n){if(e&&"object"==typeof e&&e instanceof o)return e;var r=new o;return r.parse(e,t,n),r}o.prototype.parse=function(e,t,n){if("string"!=typeof e)throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),s=-1!==o&&o<e.indexOf("#")?"?":"#",l=e.split(s);l[0]=l[0].replace(/\\/g,"/");var y=e=l.join(s);if(y=y.trim(),!n&&1===e.split("#").length){var v=a.exec(y);if(v)return this.path=y,this.href=y,this.pathname=v[1],v[2]?(this.search=v[2],this.query=t?b.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var _=i.exec(y);if(_){var x=(_=_[0]).toLowerCase();this.protocol=x,y=y.substr(_.length)}if(n||_||y.match(/^\/\/[^@/]+@[^@/]+/)){var w="//"===y.substr(0,2);!w||_&&m[_]||(y=y.substr(2),this.slashes=!0)}if(!m[_]&&(w||_&&!g[_])){for(var k,C,S=-1,A=0;A<d.length;A++)-1!==(E=y.indexOf(d[A]))&&(-1===S||E<S)&&(S=E);for(-1!==(C=-1===S?y.lastIndexOf("@"):y.lastIndexOf("@",S))&&(k=y.slice(0,C),y=y.slice(C+1),this.auth=decodeURIComponent(k)),S=-1,A=0;A<u.length;A++){var E;-1!==(E=y.indexOf(u[A]))&&(-1===S||E<S)&&(S=E)}-1===S&&(S=y.length),this.host=y.slice(0,S),y=y.slice(S),this.parseHost(),this.hostname=this.hostname||"";var I="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!I)for(var j=this.hostname.split(/\./),T=(A=0,j.length);A<T;A++){var B=j[A];if(B&&!B.match(h)){for(var R="",N=0,D=B.length;N<D;N++)B.charCodeAt(N)>127?R+="x":R+=B[N];if(!R.match(h)){var M=j.slice(0,A),P=j.slice(A+1),O=B.match(p);O&&(M.push(O[1]),P.unshift(O[2])),P.length&&(y="/"+P.join(".")+y),this.hostname=M.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),I||(this.hostname=r.toASCII(this.hostname));var L=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+L,this.href+=this.host,I&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==y[0]&&(y="/"+y))}if(!f[x])for(A=0,T=c.length;A<T;A++){var z=c[A];if(-1!==y.indexOf(z)){var U=encodeURIComponent(z);U===z&&(U=escape(z)),y=y.split(z).join(U)}}var V=y.indexOf("#");-1!==V&&(this.hash=y.substr(V),y=y.slice(0,V));var H=y.indexOf("?");if(-1!==H?(this.search=y.substr(H),this.query=y.substr(H+1),t&&(this.query=b.parse(this.query)),y=y.slice(0,H)):t&&(this.search="",this.query={}),y&&(this.pathname=y),g[x]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){L=this.pathname||"";var $=this.search||"";this.path=L+$}return this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",o=!1,i="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(i=b.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var s=this.search||i&&"?"+i||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||g[t])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),r&&"#"!==r.charAt(0)&&(r="#"+r),s&&"?"!==s.charAt(0)&&(s="?"+s),t+o+(n=n.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+r},o.prototype.resolve=function(e){return this.resolveObject(y(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if("string"==typeof e){var t=new o;t.parse(e,!1,!0),e=t}for(var n=new o,r=Object.keys(this),i=0;i<r.length;i++){var s=r[i];n[s]=this[s]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var a=Object.keys(e),l=0;l<a.length;l++){var c=a[l];"protocol"!==c&&(n[c]=e[c])}return g[n.protocol]&&n.hostname&&!n.pathname&&(n.pathname="/",n.path=n.pathname),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!g[e.protocol]){for(var u=Object.keys(e),d=0;d<u.length;d++){var h=u[d];n[h]=e[h]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||m[e.protocol])n.pathname=e.pathname;else{for(var p=(e.pathname||"").split("/");p.length&&!(e.host=p.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),n.pathname=p.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var f=n.pathname||"",b=n.search||"";n.path=f+b}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var y=n.pathname&&"/"===n.pathname.charAt(0),v=e.host||e.pathname&&"/"===e.pathname.charAt(0),_=v||y||n.host&&e.pathname,x=_,w=n.pathname&&n.pathname.split("/")||[],k=(p=e.pathname&&e.pathname.split("/")||[],n.protocol&&!g[n.protocol]);if(k&&(n.hostname="",n.port=null,n.host&&(""===w[0]?w[0]=n.host:w.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===p[0]?p[0]=e.host:p.unshift(e.host)),e.host=null),_=_&&(""===p[0]||""===w[0])),v)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,w=p;else if(p.length)w||(w=[]),w.pop(),w=w.concat(p),n.search=e.search,n.query=e.query;else if(null!=e.search)return k&&(n.host=w.shift(),n.hostname=n.host,(I=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=I.shift(),n.hostname=I.shift(),n.host=n.hostname)),n.search=e.search,n.query=e.query,null===n.pathname&&null===n.search||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!w.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var C=w.slice(-1)[0],S=(n.host||e.host||w.length>1)&&("."===C||".."===C)||""===C,A=0,E=w.length;E>=0;E--)"."===(C=w[E])?w.splice(E,1):".."===C?(w.splice(E,1),A++):A&&(w.splice(E,1),A--);if(!_&&!x)for(;A--;A)w.unshift("..");!_||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),S&&"/"!==w.join("/").substr(-1)&&w.push("");var I,j=""===w[0]||w[0]&&"/"===w[0].charAt(0);return k&&(n.hostname=j?"":w.length?w.shift():"",n.host=n.hostname,(I=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=I.shift(),n.hostname=I.shift(),n.host=n.hostname)),(_=_||n.host&&w.length)&&!j&&w.unshift(""),w.length>0?n.pathname=w.join("/"):(n.pathname=null,n.path=null),null===n.pathname&&null===n.search||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},t.parse=y,t.resolve=function(e,t){return y(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?y(e,!1,!0).resolveObject(t):t},t.format=function(e){return"string"==typeof e&&(e=y(e)),e instanceof o?e.format():o.prototype.format.call(e)},t.Url=o},41669:e=>{"use strict";e.exports=jQuery},54581:()=>{},14993:()=>{},11126:()=>{},14917:()=>{},86529:()=>{},30150:()=>{},87189:()=>{},83868:()=>{},32067:e=>{e.exports={nanoid:(e=21)=>{let t="",n=0|e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r="",o=0|n;for(;o--;)r+=e[Math.random()*e.length|0];return r}}},40193:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});const r="%[a-f0-9]{2}",o=new RegExp("("+r+")|([^%]+?)","gi"),i=new RegExp("("+r+")+","gi");function s(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(1===e.length)return e;t=t||1;const n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],s(n),s(r))}function a(e){try{return decodeURIComponent(e)}catch{let t=e.match(o)||[];for(let n=1;n<t.length;n++)t=(e=s(t,n).join("")).match(o)||[];return e}}function l(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return function(e){const t={"%FE%FF":"��","%FF%FE":"��"};let n=i.exec(e);for(;n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{const e=a(n[0]);e!==n[0]&&(t[n[0]]=e)}n=i.exec(e)}t["%C2"]="�";const r=Object.keys(t);for(const n of r)e=e.replace(new RegExp(n,"g"),t[n]);return e}(e)}}}},e=>{e.O(0,[223],(()=>e(e.s=66115))),e.O()}]);

Filemanager

Name Type Size Permission Actions
email-editor Folder 0755
email-editor-blocks Folder 0755
email_editor_integration Folder 0755
marketing-optin-block Folder 0755
skins Folder 0755
admin.js File 413.08 KB 0644
admin.js.LICENSE.txt File 81 B 0644
admin_vendor.js File 293.37 KB 0644
automation.js File 18.89 KB 0644
automation_analytics.js File 1006.28 KB 0644
automation_analytics.js.LICENSE.txt File 160 B 0644
automation_editor.js File 11.7 KB 0644
automation_templates.js File 2.53 KB 0644
commons.js File 3.8 MB 0644
commons.js.LICENSE.txt File 7.07 KB 0644
form_editor.js File 1.96 MB 0644
form_editor.js.LICENSE.txt File 1.57 KB 0644
form_preview.js File 133.97 KB 0644
index.php File 6 B 0644
mailpoet.js File 1.79 KB 0644
mailpoet.js.LICENSE.txt File 492 B 0644
manifest.json File 2.02 KB 0644
newsletter_editor.js File 1.41 MB 0644
newsletter_editor.js.LICENSE.txt File 388 B 0644
post_editor_block.js File 13.11 KB 0644
post_editor_block.js.LICENSE.txt File 487 B 0644
public.js File 106.74 KB 0644
public.js.LICENSE.txt File 734 B 0644
runtime.js File 2.14 KB 0644
settings.js File 56.42 KB 0644
vendor.js File 4.83 KB 0644