'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),l=require("@gem-sdk/core"),t=require("next/link");const p=({id:r,menu:s,arrow:i,textColor:g,menuTextColor:a,depth:o=0,maxDepth:n=2,menuBg:c,typo:u,typography:d,enableHoverEffect:h,enableDropdownHoverEffect:m})=>{let x=s?.[r];if(!x||o>n)return null;let f=o===n,v=l.composeTypographyStyle(u,d),y=!!x?.childrens?.length&&!f,b=l.getGlobalColorStateStyle("c",0===o?g:a),j=0===o&&h||0!==o&&m?b:l.filterHoverVariables(b);return e.jsxs("li",{className:l.cls("gp-group gp-relative gp-inline-flex gp-flex-1 gp-cursor-pointer gp-items-center gp-gap-2 gp-whitespace-nowrap gp-px-4 gp-py-2 gp-transition-colors gp-duration-300 !gp-max-w-fit hover:gp-z-50",{"gp-justify-center":0===o,"gp-min-w-[200px] gp-border-b last:gp-border-b-transparent":o>0}),style:{...v,...j},children:[x?.link?e.jsx(t,{href:x.link,title:x.title,className:"gp-w-full",children:x.title}):e.jsx("span",{children:x?.title}),y&&!!i&&e.jsx("span",{dangerouslySetInnerHTML:{__html:i},className:l.cls("gp-ml-auto gp-shrink-0 [&>svg]:gp-h-4 [&>svg]:gp-w-auto",{"-gp-rotate-90":1===o})}),y&&e.jsx("div",{className:l.cls("gp-invisible gp-absolute gp-min-w-max gp-opacity-0 gp-transition-all gp-duration-300 gp-ease-in-out [li:hover>div&]:gp-visible [li:hover>div&]:gp-opacity-100 gp-z-[100]",{"gp-left-0 gp-top-full":0===o,"gp-left-full gp-top-0 gp-translate-y-4 [li:hover>div&]:gp-translate-y-0":1===o}),children:e.jsx("ul",{className:l.cls("gp-flex gp-flex-col gp-shadow-card-2 gp-relative",{"gp-ml-4":1===o}),style:{...l.getGlobalColorResponsiveStyle("bgc",c)},children:x?.childrens?.map(l=>e.jsx(p,{id:l,menu:s,depth:o+1,maxDepth:n,arrow:i,menuTextColor:a,menuBg:c,typo:u,typography:d,enableHoverEffect:h,enableDropdownHoverEffect:m},l))})})]})};exports.default=p;
