'use client';
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),oe=require("react"),s=require("@heroui/react"),ue=require("../../../hooks/use-config.cjs"),ae=require("./user-profile.cjs"),de=l=>l&&l.__esModule?l:{default:l},c=de(oe);function fe({trigger:l,isOpen:u,onOpenChange:p,modalSize:M="lg",placement:P="center",backdrop:g="opaque",isDismissable:C=!0,closeOnOutsideClick:w=!0,hideCloseButton:m=!1,modalClassName:O="",title:a="Profile Settings",subtitle:d="Manage your account settings and preferences",customHeaderContent:f,footerActions:i,showDefaultFooter:q=!1,saveButtonText:U="Save Changes",cancelButtonText:_="Cancel",onSave:r,onCancel:t,onClose:x,isSaveLoading:h=!1,isSaveDisabled:N=!1,scrollBehavior:k="inside",isKeyboardDismissDisabled:y=!1,portalContainer:R,autoFocus:S=!0,defaultActiveTab:B,defaultTab:F,tabs:E,hideTabs:G,showOrganizationSettings:J,showSecuritySettings:Q,showMFASettings:V,showPasskeySettings:W,className:X,variant:Y="flat",orientation:Z="horizontal",tabPlacement:$="top",footerContent:z,onProfileUpdate:D,onSuccess:j,onError:H,isLoading:K,isDisabled:b,size:I="md",customTabs:L}){const{components:ee}=ue.useConfig(),v=s.useDisclosure(),le=u!==void 0?u:v.isOpen,o=p||v.onOpenChange,A=ee.UserProfileModal;if(A)return e.jsx(A,{trigger:l,isOpen:u,onOpenChange:p,modalSize:M,placement:P,backdrop:g,isDismissable:C,closeOnOutsideClick:w,hideCloseButton:m,modalClassName:O,title:a,subtitle:d,customHeaderContent:f,footerActions:i,showDefaultFooter:q,saveButtonText:U,cancelButtonText:_,onSave:r,onCancel:t,onClose:x,isSaveLoading:h,isSaveDisabled:N,scrollBehavior:k,isKeyboardDismissDisabled:y,portalContainer:R,autoFocus:S,defaultActiveTab:B,defaultTab:F,tabs:E,hideTabs:G,showOrganizationSettings:J,showSecuritySettings:Q,showMFASettings:V,showPasskeySettings:W,className:X,variant:Y,orientation:Z,tabPlacement:$,footerContent:z,onProfileUpdate:D,onSuccess:j,onError:H,isLoading:K,isDisabled:b,size:I,customTabs:L});const n=c.default.useCallback(()=>{x?.(),o(!1)},[x,o]),se=c.default.useCallback(()=>{t?.(),n()},[t,n]),re=c.default.useCallback(()=>{r?.()},[r]),ne=c.default.useCallback(T=>{j?.(T),!r&&n()},[j,r,n]),ce=l&&c.default.cloneElement(l,{onPress:()=>o(!0)});return e.jsxs(e.Fragment,{children:[ce,e.jsx(s.Modal,{isOpen:le,onOpenChange:o,size:M,placement:P,backdrop:g,isDismissable:C,hideCloseButton:m,scrollBehavior:k,isKeyboardDismissDisabled:y,portalContainer:R,shouldBlockScroll:!0,className:O,classNames:{base:"max-h-[90vh]",body:"p-0"},children:e.jsx(s.ModalContent,{children:T=>e.jsxs(e.Fragment,{children:[(f||a)&&e.jsx(s.ModalHeader,{className:"flex flex-col gap-1",children:f||e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold",children:a}),d&&e.jsx("p",{className:"text-sm text-default-500 font-normal",children:d})]})}),e.jsx(s.ModalBody,{children:e.jsx(ae.UserProfile,{defaultTab:B||F,tabs:E,hideTabs:G,showOrganizationSettings:J,showSecuritySettings:Q,showMFASettings:V,showPasskeySettings:W,className:X,variant:Y,orientation:Z,tabPlacement:$,footerContent:z,onProfileUpdate:D,onSuccess:ne,onError:H,onClose:n,isLoading:K,isDisabled:b,size:I,customTabs:L})}),(i||q)&&e.jsx(s.ModalFooter,{children:i||e.jsxs("div",{className:"flex gap-2",children:[e.jsx(s.Button,{variant:"light",onPress:se,isDisabled:h,children:_}),r&&e.jsx(s.Button,{color:"primary",onPress:re,isLoading:h,isDisabled:N,children:U})]})})]})})})]})}function ie(){const l=s.useDisclosure();return{...l,openProfile:l.onOpen,closeProfile:l.onClose,toggleProfile:()=>l.onOpenChange(!l.isOpen)}}exports.UserProfileModal=fe;exports.useUserProfileModal=ie;
//# sourceMappingURL=user-profile-modal.cjs.map
