"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("../../../../_virtual/jsx-runtime.js"),l=require("react"),C=require("../bottomSheetHeader/index.js"),d=require("../../styles.js"),_=require("../bottomSheetBody/index.js"),z=require("../bottomSheetFooter/index.js"),p=require("../bottomSheetImage/index.js"),D=require("../../../../utils/index.js");const G=({headerTitle:q,headerContentModifiers:h,headerControlsModifiers:x,hasPullTab:i,icon:B,dismissAction:R,primaryAction:S,stackedActionButtons:n,pinnedFooter:j=!1,pinnedHeader:b=!1,hasBodyPadding:k=!0,isOpened:$=!1,shouldCloseOnEsc:J=!0,shouldCloseOnOverlayClick:K=!0,children:v,bottomSheetRoot:L,height:E,width:u,imgValues:t,position:w="center",onClose:o,customHeader:c,customFooter:s,onPullTabClick:y,bodyRef:f,...e})=>{const[H,O]=l.useState(E),a=D.getId(e.id),W=()=>O(I=>I==="100%"?E:"100%");return r.jsxRuntimeExports.jsx(d.BottomSheetWrapper,{isOpened:$,height:H,width:u,hasPullTab:i,stackedActionButtons:n,position:w,"data-testid":`${e["data-testid"]}-bottom-sheet-wrapper`,id:a("wrapper"),children:r.jsxRuntimeExports.jsxs(d.MainContentWrapper,{id:a("wrapper"),children:[i&&r.jsxRuntimeExports.jsx(d.PullTab,{hasPullTab:i,onClick:y||W,"data-testid":`${e["data-testid"]}-bottom-sheet-pull-tab`,id:a("pull-tab")}),h==="empty"&&x==="default"||t!=null&&t.asHeader||c!==void 0?null:r.jsxRuntimeExports.jsx(C.BottomSheetHeader,{headerTitle:q,onClose:o,hasPullTab:i,headerContentModifiers:h,headerControlsModifiers:x,pinnedHeader:b,icon:B,"data-testid":e["data-testid"],"data-trackid":e["data-trackid"],"aria-label":e["aria-label"],id:a("header")}),c&&r.jsxRuntimeExports.jsx(d.CustomHeaderWrapper,{id:a("custom-header-wrapper"),children:c}),(t==null?void 0:t.imgSrc)&&(t==null?void 0:t.asHeader)&&r.jsxRuntimeExports.jsx(p.default,{imgValues:t,onClose:o,headerControlsModifiers:x}),r.jsxRuntimeExports.jsxs(d.InnerWrapper,{pinnedHeader:b,pinnedFooter:j,id:a("inner-wrapper"),children:[(t==null?void 0:t.imgSrc)&&!(t!=null&&t.asHeader)&&r.jsxRuntimeExports.jsx(p.default,{imgValues:t,onClose:o,headerControlsModifiers:x}),v&&r.jsxRuntimeExports.jsx(_.BottomSheetBody,{pinnedFooter:j,dismissAction:R,stackedActionButtons:n,hasBodyPadding:k,"data-testid":e["data-testid"],"data-trackid":e["data-trackid"],"aria-label":e["aria-label"],bodyRef:f,id:a("body"),children:v}),S&&!s&&r.jsxRuntimeExports.jsx(z.BottomSheetFooter,{primaryAction:S,dismissAction:R,stackedActionButtons:n,pinnedFooter:j,"data-testid":e["data-testid"],"data-trackid":e["data-trackid"],"aria-label":e["aria-label"],id:a("footer")}),s]})]})})};exports.BottomSheetContent=G;
