"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),s=require("../../molecules/Sections/SectionWrapper.js"),n=require("../../_svg/CognitiveDecisioning.js"),o=require("lucide-react"),t=require("../../TooltipComponent.js");exports.ScopeSection=function(r){var l=r.id,a=r.title,c=void 0===a?"Scope":a,d=r.required,p=void 0!==d&&d,g=r.openSections,x=r.setOpenSections,h=r.scopeData,u=r.onScopeChange;r.stationOptions;var v=r.tierOptions,_=void 0===v?[]:v;r.stationLabel;var b=r.tierLabel,y=void 0===b?"Where should this rule apply?":b,j=r.highlights,f=void 0===j?{}:j,m=r.isOpen,S=r.onToggle,C=r.showCognitiveIcon,O=r.cognitiveIcon,w=r.tooltipDescription,I=r.errorMessage,k=r.stationErrorMessage,q=r.tierErrorMessage,z=e.__rest(r,["id","title","required","openSections","setOpenSections","scopeData","onScopeChange","stationOptions","tierOptions","stationLabel","tierLabel","highlights","isOpen","onToggle","showCognitiveIcon","cognitiveIcon","tooltipDescription","errorMessage","stationErrorMessage","tierErrorMessage"]);return i.jsx(s.SectionWrapper,e.__assign({id:l,title:c,required:p,openSections:g,setOpenSections:x},z,{children:i.jsxs("div",e.__assign({className:"scope-content"},{children:[_.length>0&&i.jsxs("div",e.__assign({className:"form-group"},{children:[i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px",marginBottom:"4px"}},{children:[i.jsx("span",e.__assign({style:{color:"#8F2C23",lineHeight:1}},{children:"*"})),i.jsx("label",e.__assign({className:(null==z?void 0:z.readOnly)?"readOnly":"form-label",style:{margin:0}},{children:y}))]})),i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap"}},{children:[i.jsx("div",e.__assign({className:"checkbox-group",style:{display:"flex",gap:"16px"}},{children:_.map(function(s){var n,o,t=f["scope_".concat(s)],r="tier-".concat(l,"-").concat(s.replace(/\s+/g,"-").toLowerCase());return i.jsxs("div",e.__assign({className:"checkbox-item",style:{display:"flex",alignItems:"center",gap:"6px",position:"relative"}},{children:[i.jsx("input",{type:"radio",name:"scope-tiers-".concat(l),id:r,checked:null===(n=h.tiers)||void 0===n?void 0:n.includes(s),onChange:function(){u("tiers",[s])},disabled:(null==z?void 0:z.readOnly)||!1,style:{position:"absolute",opacity:0,cursor:"pointer",width:"16px",height:"16px",zIndex:1}}),i.jsx("div",e.__assign({style:{width:"16px",height:"16px",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease",boxShadow:t?"0 0 14px 4px rgba(37, 99, 235, 0.35)":"none",borderRadius:"50%"}},{children:(null===(o=h.tiers)||void 0===o?void 0:o.includes(s))?i.jsx("div",{style:{width:"16px",height:"16px",borderRadius:"50%",border:"5px solid #2563EB",backgroundColor:"white",boxSizing:"border-box"}}):i.jsx("div",{style:{width:"16px",height:"16px",border:"1px solid #64748B",borderRadius:"50%",backgroundColor:"white",boxSizing:"border-box"}})})),i.jsx("label",e.__assign({style:{color:(null==z?void 0:z.readOnly)?"#9CA3AF":void 0,cursor:(null==z?void 0:z.readOnly)?"not-allowed":"pointer",margin:0,fontSize:"14px"},htmlFor:r},{children:s}))]}),r)})})),i.jsx("div",e.__assign({style:{width:"fit-content"}},{children:i.jsx(t.default,e.__assign({description:null!=w?w:""},{children:C&&i.jsxs("button",e.__assign({onClick:function(e){e.preventDefault(),null==S||S()},style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"2px",padding:"2px 6px ",flexShrink:0,border:"none",backgroundColor:"transparent",borderRadius:"4px",cursor:"pointer",outline:"none",maxWidth:"fit-content",transition:"background-color 0.2s ease",marginTop:"6px",marginLeft:"6px"}},{children:[O||i.jsx(n.default,{}),m?i.jsx(o.ChevronUpIcon,{size:16}):i.jsx(o.ChevronDownIcon,{size:16})]}))}))}))]})),q&&i.jsx("div",e.__assign({style:{color:"#ef4444",fontSize:"12px",marginTop:"4px"}},{children:q}))]})),I&&!k&&!q&&i.jsx("div",e.__assign({style:{color:"#ef4444",fontSize:"12px",marginTop:"4px"}},{children:I}))]}))}))};
//# sourceMappingURL=ScopeSection.js.map
