"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),a=require("lucide-react"),i=require("@mui/material"),n=require("../InstantLearning.module.css.js"),t=require("./ILPopup.styles.js"),o=require("./templates/TemplatesMap/templatesMap.js");exports.default=function(l){var r=l.customSections,d=l.showCustomSections,c=void 0===d||d,u=l.onSave,g=l.formHeader,m=l.onClose,p=l.validateCustom,v=l.template,x=l.templateProps,f=l.isLoading,h=l.saveButtonConfig,_=void 0===h?{label:"Save Learning",loadingLabel:"Saving Learning..."}:h,b=l.isAiStreaming,j=void 0!==b&&b,y=l.showSaveWithoutValidation,S=l.saveWithoutValBtnConfig,C=void 0===S?{label:"Save w/o validation",loadingLabel:"Saving w/o validation..."}:S,L=l.onSaveWithoutValidation,q=l.saveButtonColor,w=v?o.TemplateMap[v]:null,N=!p||p();return s.jsxs(s.Fragment,{children:[s.jsx("style",{children:t.componentStyles}),s.jsxs("div",e.__assign({className:"il-popup-container ".concat(n.default.customFont)},{children:[s.jsxs("div",e.__assign({className:"form-header"},{children:[s.jsx(i.Typography,e.__assign({sx:{fontSize:"1.125rem",fontWeight:500,lineHeight:"1.82rem",fontFamily:'"Plus Jakarta Sans", sans-serif'}},{children:g})),s.jsx("div",e.__assign({onClick:m,style:{cursor:"pointer"}},{children:s.jsx(a.X,{})}))]})),s.jsx("div",e.__assign({style:{flexGrow:1,display:"flex",flexDirection:"column",width:"100%",padding:"20px 24px",overflowY:"auto",borderBottom:"1px solid #E7E7E9"}},{children:s.jsxs("div",e.__assign({className:"sections-space"},{children:[w&&s.jsx(w,e.__assign({},x)),c&&r]}))})),s.jsxs("div",e.__assign({className:"save-button-container"},{children:[y&&s.jsxs("button",e.__assign({className:"save-button-secondary",onClick:function(){L&&N&&L()},disabled:f||!N||j},{children:[s.jsx(a.TriangleAlert,{size:16,style:{marginRight:"4px"}}),f?C.loadingLabel:C.label]})),s.jsx("button",e.__assign({className:"save-button",onClick:function(){!p||p()?(u(),console.log("Form Data to Save:")):console.error("Please fill all required fields before saving the learning.")},disabled:f||!N||j,style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",maxWidth:"fit-content",backgroundColor:q,borderColor:q}},{children:f?_.loadingLabel:_.label}))]}))]}))]})};
//# sourceMappingURL=ILPopup.js.map
