"use client";import{a as k}from"./chunk-VEUVLMJO.mjs";import{a as P,b as x}from"./chunk-3TBBNSCU.mjs";import"./chunk-QHIWJPL6.mjs";import{a as b,b as u}from"./chunk-QLEOPXHB.mjs";import{a as N}from"./chunk-EIQPM3DQ.mjs";import"./chunk-EI3IJHIE.mjs";import{a as h}from"./chunk-JNIJ5N3Y.mjs";import{a as F,c as a}from"./chunk-S7CSCIW4.mjs";import"./chunk-JZXLCA2E.mjs";import{useCallback as L,useMemo as Q,useState as W}from"react";import{UniformText as Y}from"@uniformdev/canvas-next-rsc/component";import{UniformSlot as I}from"@uniformdev/canvas-next-rsc/component";import{jsx as r,jsxs as X}from"react/jsx-runtime";var w=({isOpen:t,backgroundColor:e,context:o,slots:n,border:l,component:i,hasRightContent:m})=>r("div",{className:a("absolute z-10 w-max left-1/2 -translate-x-1/2 pt-4",{hidden:!t,block:t,"w-full md:w-[460px]":!m,"w-full md:w-[460px] xl:w-[768px]":m}),children:r("div",{className:a("p-8",{[`bg-${e}`]:!!e,[F(l,"{value}")]:l}),children:X(b,{columnsCount:"2",gapX:"4",children:[r(u,{children:r("div",{className:"flex flex-col gap-y-4",children:r(I,{context:o,data:i,slot:n.navigationFlyoutLeftContent})})}),r(u,{children:r(I,{context:o,data:i,slot:n.navigationFlyoutRightContent})})]})})});import{useEffect as q,useState as J}from"react";import{UniformSlot as B}from"@uniformdev/canvas-next-rsc/component";import{jsx as d,jsxs as H}from"react/jsx-runtime";var K=()=>{let[t,e]=J(0);return q(()=>{let o=document.getElementById("mobile-header");o&&e(o.offsetHeight)},[]),t},M=({isOpen:t,backgroundColor:e,context:o,slots:n,onClose:l,component:i})=>{let m=K();return H("div",{style:{top:m},className:a("fixed left-0 right-0 bottom-0 z-10 w-full pt-4",{[`bg-${e}`]:!!e,hidden:!t,block:t}),children:[d("button",{onClick:l,className:"w-max rotate-180 px-4",children:d(P,{})}),H("div",{className:"flex flex-col items-center justify-center gap-y-8 p-4",children:[d(B,{context:o,data:i,slot:n.navigationFlyoutLeftContent}),d(B,{context:o,data:i,slot:n.navigationFlyoutRightContent})]})]})};var D=({isOpen:t})=>a("transition transform hidden md:block",{"rotate-180":t,"rotate-0":!t}),G=({color:t})=>a("flex items-center gap-x-2",{[`text-${t}`]:!!t});import{jsx as s,jsxs as R}from"react/jsx-runtime";var Pt=({icon:t,backgroundColor:e,border:o,size:n,tag:l,color:i,weight:m,font:O,transform:S,decoration:E,letterSpacing:U,alignment:$,component:p,context:v,slots:f})=>{let[c,g]=W(!1),z=L(()=>g(!0),[]),C=L(()=>g(!1),[]),A=Q(()=>!!p.slots?.navigationFlyoutRightContent?.length,[p.slots]),[T]=h(t),{url:y,title:V=""}=T||{};return R("div",{className:"relative",onMouseLeave:C,children:[R("button",{onMouseEnter:z,className:G({color:i}),children:[s(k,{icon:y&&s(N,{src:y,alt:V,fill:!0}),size:n,tag:l,color:i,weight:m,font:O,transform:S,decoration:E,letterSpacing:U,alignment:$,children:s(Y,{placeholder:"Text goes here",parameterId:"text",component:p,context:v})}),s("div",{className:D({isOpen:c}),children:s(x,{})})]}),s("div",{className:"hidden md:block",children:s(w,{hasRightContent:A,isOpen:c,backgroundColor:e,context:v,slots:f,border:o,component:p})}),s("div",{className:"block md:hidden",children:s(M,{onClose:C,isOpen:c,backgroundColor:e,context:v,slots:f,border:o,component:p})})]})};export{Pt as NavigationFlyout};
