PageSourceSearch

https://negosh.com/_next/static/chunks/pages/my-company/[userUuid]…/[[...responseId]]-8dab3145abc26c9a.js

js negosh.com collected 2026-10-10 00:11:08 UTC 111,651 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d5f852be-1d17-43bd-b5bf-ee7525a613ed",e._sentryDebugIdIdentifier="sentry-dbid-d5f852be-1d17-43bd-b5bf-ee7525a613ed")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5993],{31428:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/my-company/[userUuid]/licensee-vetting/[[...responseId]]",function(){return n(5260)}])},80646:function(e,t,n){"use strict";n.d(t,{Z:function(){return T}});var i=n(63366),r=n(87462),o=n(67294),s=n(90512),l=n(94780),a=n(2101),c=n(93067),d=n(57680),u=n(85893),x=(0,d.Z)((0,u.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),p=(0,d.Z)((0,u.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),g=(0,d.Z)((0,u.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox"),h=n(75228),m=n(36522),f=n(89262),v=n(13188),b=n(1588),y=n(34867);function S(e){return(0,y.ZP)("MuiCheckbox",e)}let w=(0,b.Z)("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),j=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],C=e=>{let{classes:t,indeterminate:n,color:i,size:o}=e,s={root:["root",n&&"indeterminate","color".concat((0,h.Z)(i)),"size".concat((0,h.Z)(o))]},a=(0,l.Z)(s,S,t);return(0,r.Z)({},t,a)},Z=(0,f.ZP)(c.Z,{shouldForwardProp:e=>(0,v.Z)(e)||"classes"===e,name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t["size".concat((0,h.Z)(n.size))],"default"!==n.color&&t["color".concat((0,h.Z)(n.color))]]}})(e=>{let{theme:t,ownerState:n}=e;return(0,r.Z)({color:(t.vars||t).palette.text.secondary},!n.disableRipple&&{"&:hover":{backgroundColor:t.vars?"rgba(".concat("default"===n.color?t.vars.palette.action.activeChannel:t.vars.palette[n.color].mainChannel," / ").concat(t.vars.palette.action.hoverOpacity,")"):(0,a.Fq)("default"===n.color?t.palette.action.active:t.palette[n.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"default"!==n.color&&{["&.".concat(w.checked,", &.").concat(w.indeterminate)]:{color:(t.vars||t).palette[n.color].main},["&.".concat(w.disabled)]:{color:(t.vars||t).palette.action.disabled}})}),k=(0,u.jsx)(p,{}),I=(0,u.jsx)(x,{}),q=(0,u.jsx)(g,{});var T=o.forwardRef(function(e,t){var n,l;let a=(0,m.i)({props:e,name:"MuiCheckbox"}),{checkedIcon:c=k,color:d="primary",icon:x=I,indeterminate:p=!1,indeterminateIcon:g=q,inputProps:h,size:f="medium",className:v}=a,b=(0,i.Z)(a,j),y=p?g:x,S=p?g:c,w=(0,r.Z)({},a,{color:d,indeterminate:p,size:f}),T=C(w);return(0,u.jsx)(Z,(0,r.Z)({type:"checkbox",inputProps:(0,r.Z)({"data-indeterminate":p},h),icon:o.cloneElement(y,{fontSize:null!=(n=y.props.fontSize)?n:f}),checkedIcon:o.cloneElement(S,{fontSize:null!=(l=S.props.fontSize)?l:f}),ownerState:w,ref:t,className:(0,s.Z)(T.root,v)},b,{classes:T}))})},5408:function(e,t,n){"use strict";n.d(t,{W:function(){return s},s:function(){return o}});var i=n(12946);let r="user/vetting-questionnaire/responses/retrieve",o=r,s=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(await i.v_(r,e)).data}},82589:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var i=n(85893),r=n(37452),o=n(14440),s=n(91093),l=n(94246),a=n(67294),c=n(49687),d={alert:{border:"1px solid",borderColor:"warningSubdued",alignItems:"flex-start",borderRadius:"6px"},text:{fontSize:"14px",fontWeight:400,lineHeight:"20px"},icon:{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center"},flexContainer:{display:"flex",alignItems:"flex-start",gap:2,flex:1},variants:{neutralPrimary:{backgroundColor:"neutralSoftSurface",border:"none",color:"neutralStrong",height:"fit-content"},activePrimary:{backgroundColor:"primarySoftSurface",border:"none",color:"primaryStrong",height:"fit-content"},activeSoft:{backgroundColor:"primarySoftSurface",border:"none",color:"neutralStrong",iconColor:"primaryStrong",height:"fit-content"},dangerPrimary:{backgroundColor:"dangerSoftSurface",border:"none",color:"neutralStrong",iconColor:"dangerStrong",height:"fit-content"},successPrimary:{backgroundColor:"successSoftSurface",border:"none",color:"successStrong",height:"fit-content"},neutralSecondary:{backgroundColor:"white",border:"none",color:"neutralStrong",height:"fit-content"},neutralSecondaryBorder:{backgroundColor:"white",border:"1px solid",borderColor:"neutralStrong",color:"neutralStrong",height:"fit-content"},activeSecondary:{backgroundColor:"white",border:"none",color:"primaryStrong",height:"fit-content"},activeSecondaryBorder:{backgroundColor:"white",border:"1px solid",borderColor:"primaryStrong",color:"primaryStrong",height:"fit-content"}
1,activeSecondaryBorder2:{backgroundColor:"white",border:"2px solid",borderColor:"primaryStrong",color:"primaryStrong",height:"fit-content"},dangerSecondary:{backgroundColor:"white",border:"none",color:"dangerStrong",height:"fit-content"},successSecondary:{backgroundColor:"white",border:"none",color:"successStrong",height:"fit-content"},terracotaPrimary:{backgroundColor:"warningSoftSurface",border:"none",color:"warningStrong",height:"fit-content"},infoPrimary:{backgroundColor:"infoSoftSurface",border:"none",color:"neutralStrong",height:"fit-content"},infoSecondaryBorder:{backgroundColor:"white",border:"1px solid",borderColor:"infoStrong",color:"neutralStrong",height:"fit-content"},academyPrimary:{backgroundColor:"primarySoftSurface",border:"none",color:"neutralStrong",iconColor:"neutralStrong",height:"fit-content"}},closeButton:{position:"absolute",top:"8px",right:"8px",color:"neutralSubdued",cursor:"pointer"},alertSurface:(e,t)=>({backgroundColor:e,position:"relative",pr:t?"48px":void 0}),iconTint:e=>({color:e}),textColor:e=>({color:e})},u=e=>{let{children:t,dataTestId:n,withDefaultIcon:u=!1,icon:x,iconColor:p,textColor:g,backgroundColor:h="transparent",sx:m={},onClose:f,customVariant:v}=e,b=v?d.variants[v]:null,y=p||(null==b?void 0:b.iconColor)||(null==b?void 0:b.color)||"warningSubdued",S=g||(null==b?void 0:b.color)||"neutralStrong",w=()=>{let e=[d.iconTint(y),d.icon];if(x){var t;let n=null===(t=x.props)||void 0===t?void 0:t.sx;return a.cloneElement(x,{sx:[...e,...n?Array.isArray(n)?n:[n]:[]]})}return u?(0,i.jsx)(c.Z,{sx:e}):null},j=v&&d.variants[v]?d.variants[v]:{};return(0,i.jsxs)(s.Z,{icon:!1,"data-testid":n,sx:[d.alertSurface(h,!!f),d.alert,j,...m?Array.isArray(m)?m:[m]:[]],children:[f&&(0,i.jsx)(o.Z,{"aria-label":"close",onClick:f,sx:d.closeButton,children:(0,i.jsx)(r.Z,{fontSize:"small"})}),(0,i.jsxs)(o.Z,{sx:d.flexContainer,children:[w()?w():null,(0,i.jsx)(l.Z,{component:"div",sx:[d.text,d.textColor(S)],children:t})]})]})}},52841:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var i=n(85893),r=n(80646),o={checkbox:e=>({...e&&{"& .MuiSvgIcon-root":{backgroundColor:"neutralSoftSurface",borderRadius:"4px",boxShadow:"inset 0 0 0 4px white"}}}),disabledCheckbox:{color:"action.disabled","&.Mui-checked":{color:"action.disabled"}}},s=e=>{let{color:t="primary",size:n="medium",readOnly:s=!1,disabled:l=!1,...a}=e;return(0,i.jsx)(r.Z,{color:t,size:n,disabled:s||l,...a,sx:[...a.sx?Array.isArray(a.sx)?a.sx:[a.sx]:[],o.checkbox(s),...s||l?[o.disabledCheckbox]:[]]})}},53722:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var i=n(85893),r=n(14440),o=n(94246);n(67294);var s=n(67421),l=n(74209),a=n(64051),c=n(6293),d={description:{mt:3}},u=e=>{let{isOpen:t=!0,onClose:n,title:u,subtitle:x,description:p,children:g,maxWidth:h,headerDivider:m=!0,closeOnOverlayClick:f,zIndex:v,onKeyDown:b,"data-testid":y,onConfirm:S,action:w,loading:j=!1,confirmLabel:C,confirmLoadingLabel:Z,confirmIcon:k,confirmIconPosition:I,confirmChild:q,confirmDisabled:T,confirmVariant:B,confirmTestId:R,confirmSx:L,onCancel:M,cancelLabel:D,cancelDisabled:z,cancelVariant:W,cancelTestId:A,cancelSx:E,hideCancel:P=!1,hideCancelInMobile:K=!1,inverseButtons:H=!1,descriptionTestId:V}=e,{t:O}=(0,s.$G)();return(0,i.jsx)(a.Z,{isOpen:t,closeModal:n,modalTitle:u,modalSubtitle:x,maxWidth:h,headerDivider:m,closeOnOverlayClick:f,zIndex:v,onKeyDown:b,"data-testid":y,footerContent:(0,i.jsx)(c.Z,{inverseButtons:H,hideSecondaryButtonInMobile:K,primaryButtonChild:null!=q?q:(0,i.jsx)(l.Z,{action:w,loading:j,label:C,loadingLabel:Z,icon:k,iconPosition:I}),onPrimaryButtonClick:S,primaryButtonDisabled:T,primaryButtonCustomVariant:B,primaryButtonDataTestId:R,primaryButtonSx:L,...P?{}:{secondaryButtonChild:null!=D?D:O("cancel"),onSecondaryButtonClick:null!=M?M:n,secondaryButtonDisabled:z,secondaryButtonCustomVariant:W,secondaryButtonDataTestId:A,secondaryButtonSx:E}}),children:(0,i.jsxs)(i.Fragment,{children:[void 0!==p&&(0,i.jsx)(r.Z,{sx:d.description,children:(0,i.jsx)(o.Z,{"data-testid":V,children:p})}),g]})})}},13241:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var i=n(85893),r=n(9008),o=n.n(r);n(67294);var s=n(12001);function l(e){let{title:t,description:n,robots:r,canonical:l,ogUrl:a,ogTitle:c,ogDescription:d,ogImage:u=s.z,ogImageAlt:x="Negosh logo on a purple background"}=e,p=null!=c?c:t,g=null!=d?d:n,h=u===s.z;return(0,i.jsxs)(o(),{children:[(0,i.jsx)("title",{children:t}),n&&(0,i.jsx)("meta",{name:"description",content:n}),r&&(0,i.jsx)("meta",{name:"robots",content:r}),l&&(0,i.jsx)("link",{rel:"canonical",href:l}),(0,i.jsx)("meta",{property:"og:type",content:"website"}),(0,i.jsx)("meta",{property:"og:title",content:p}),g&&(0,i.jsx)("meta",{property:"og:description",content:g}),a&&(0,i.jsx)("meta",{property:"og:url",content:a}),(0,i.jsx)("meta",{property:"og:image",content:u}),(0,i.jsx)("meta",{property:"og:image:secure_url",content:u}),(0,i.jsx)("meta",{property:"og:image:alt",content:x}),h&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("meta",{property:"og:image:type",content:"image/png"}
1),(0,i.jsx)("meta",{property:"og:image:width",content:"1200"}),(0,i.jsx)("meta",{property:"og:image:height",content:"630"})]}),(0,i.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,i.jsx)("meta",{name:"twitter:title",content:p}),g&&(0,i.jsx)("meta",{name:"twitter:description",content:g}),(0,i.jsx)("meta",{name:"twitter:image",content:u}),(0,i.jsx)("meta",{name:"twitter:image:alt",content:x})]})}},48648:function(e,t,n){"use strict";n.d(t,{Y:function(){return c}});var i=n(85893),r=n(69097);n(67294);var o=n(49360);function s(){let e=(0,o.Z)();return(0,i.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("rect",{width:"20",height:"20",rx:"10",fill:e.palette.white}),(0,i.jsx)("circle",{cx:"10",cy:"10",r:"9.25",stroke:e.palette.neutralSoftBorder,strokeWidth:"1.5"})]})}function l(){let e=(0,o.Z)();return(0,i.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("circle",{cx:"10",cy:"10",r:"9.25",stroke:e.palette.primaryStrong,strokeWidth:"1.5"}),(0,i.jsx)("circle",{cx:"10",cy:"10",r:"5",fill:e.palette.primaryStrong})]})}var a=e=>({...e&&{"& svg":{backgroundColor:"neutralSoftSurface",borderRadius:"100px","& rect":{fill:"transparent"}}}});let c=e=>{let{color:t="primary",size:n="medium",icon:o=(0,i.jsx)(s,{}),checkedIcon:c=(0,i.jsx)(l,{}),disabled:d=!1,readOnly:u=!1,...x}=e;return(0,i.jsx)(r.Z,{sx:a(u),color:t,size:n,disabled:d,icon:o,checkedIcon:c,readOnly:u,...x})}},12001:function(e,t,n){"use strict";n.d(t,{R:function(){return r},z:function(){return i}});let i="https://negosh.com/images/SEO/negosh/head/negosh.png",r={"@type":"Organization","@id":"https://negosh.com/#organization",name:"Negosh Inc.",url:"https://negosh.com",logo:i,address:{"@type":"PostalAddress",streetAddress:"127 W 26th St",addressLocality:"New York",addressRegion:"NY",postalCode:"10001",addressCountry:"US"}}},21933:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var i=n(85893),r=n(14440),o=n(22021),s=n(34934),l=n(76182),a=n(96963),c=n(96760),d={container:e=>({display:"flex",width:"100%",height:"40px",...e&&{maxWidth:{md:e}}}),srOnly:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0},input:{width:"100%",backgroundColor:"white",".MuiInputBase-root":{height:"40px"}},adornmentBox:{width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center"},circularProgress:{color:"disabled"},closeIcon:{color:"neutralSubdued",width:20,height:20,cursor:"pointer",marginRight:"-8px"},searchIcon:{color:"disabled"}},u=e=>{let{label:t,value:n,onChange:u,onSearchClick:x,style:p,maxWidth:g,loading:h=!1,disabled:m=!1}=e;return(0,i.jsxs)(r.Z,{sx:d.container(g),children:[(0,i.jsx)(r.Z,{component:"label",htmlFor:"search",sx:d.srOnly,children:t}),(0,i.jsx)(l.Z,{name:"search",type:"text",placeholder:t,value:n,onChange:e=>u(e.target.value),onKeyDown:e=>"Enter"===e.key&&(null==x?void 0:x()),sx:d.input,disabled:m,inputProps:{"data-testid":"search-input"},InputProps:{startAdornment:(0,i.jsx)(o.Z,{position:"start",children:(0,i.jsx)(r.Z,{sx:d.adornmentBox,children:h?(0,i.jsx)(s.Z,{size:16,sx:d.circularProgress}):(0,i.jsx)(c.Z,{sx:d.searchIcon})})}),endAdornment:n?(0,i.jsx)(o.Z,{position:"end",children:(0,i.jsx)(a.Z,{onClick:()=>u(""),sx:d.closeIcon})}):null},style:p})]})}},56916:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var i=n(85893),r=n(18735),o=(0,n(67294).forwardRef)(function(e,t){let{color:n="primary",size:o="medium",alwaysOn:s=!1,sx:l,...a}=e;return(0,i.jsx)(r.Z,{ref:t,color:n,size:o,sx:[s?{"& .MuiSwitch-switchBase":{"&.Mui-checked":{"& + .MuiSwitch-track":{backgroundColor:"primaryStrong"}}},"& .MuiSwitch-switchBase:not(.Mui-checked)":{"& + .MuiSwitch-track":{backgroundColor:"primaryStrong"}}}:{},...l?Array.isArray(l)?l:[l]:[]],...a})})},68224:function(e,t,n){"use strict";n.d(t,{O:function(){return p},P:function(){return x}});var i=n(85893),r=n(14440),o=n(56804),s=n(76957),l=n(37887),a=n(67294),c=n(64145),d=n(36487),u=n(6944);let x=e=>{let{value:t,onChange:n,children:s,extra:l}=e,x=(0,a.useRef)(null),[p,g]=(0,a.useState)(!1),[h,m]=(0,a.useState)(!1),f=(0,a.useCallback)(()=>{let e=x.current;return e?e.querySelector(".MuiTabs-scroller"):null},[]),v=(0,a.useCallback)(()=>{let e=f();if(!e)return;let{scrollLeft:t,scrollWidth:n,clientWidth:i}=e;g(t>1),m(n>i&&Math.ceil(t+i)<n)},[f]);(0,a.useEffect)(()=>{let e=f();if(!e)return;let t=setTimeout(v,50);e.addEventListener("scroll",v),window.addEventListener("resize",v);let n=new ResizeObserver(v);return n.observe(e),()=>{clearTimeout(t),e.removeEventListener("scroll",v),window.removeEventListener("resize",v),n.disconnect()}},[v,f]),(0,a.useEffect)(()=>{let e=setTimeout(v,100);return()=>clearTimeout(e)},[s,v]);let b=e=>{let t=f();t&&t.scrollBy({left:"left"===e?-150:150,behavior:"smooth"})};return(0,i.jsxs)(r.Z,{sx:u.Z.scrollableTabsContainer,children:[(0,i.jsxs)(r.Z,{sx:u.Z.scrollableTabsWrapper,children:[p&&(0,i.jsx)(r.Z,{onClick:()=>b("left"),sx:u.Z.scrollableTabsFadeBox("left"),children:(0,i.jsx)(c.Z,{})}),(0,i.jsx)(o.Z,{ref:x,value:t,onChange:n,variant:"scrollable",scrollButtons:!1,sx:u.Z.scrollableTabsScroller,children:s}),h&&(0,i.jsx)(r.Z,{onClick:()=>b("right"),sx:u.Z.scrollableTabsFadeBox("right"),children:(0,i.jsx)(d.Z,{})})]}),l&&(0,i.jsx)(r.Z,{sx:u.Z.scrollableTabsExtra,children:l})]})},p=e=>{let{icon:t,label:n,badgeCount:o,selectedTab:a,forceActiveBadge:c=!1,isMobile:d=!1,id:x,...p}=e,g=a||!d;return(0,i.jsx)(s.Z,{disableRipple:!0,id:x,label:(0,i.jsxs)(r.Z,{component:"span",sx:u.Z.textContainer,children:[(0,i.jsxs)(r.Z,{sx:u.Z.tabLabelContent,children:[t,g&&n]}),o?(0,i.jsx)(l.Z,{badgeContent:o,color:"primary",sx:u.Z.badge(c||a)}):null]}),sx:u.Z.tab,...p})}},63841:function(e,t,n){"use strict";var i=n(85893);let r=(0,n(57680).Z)((0,i.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M11 13H6C5.71667 13 5.47917 12.9042 5.2875 12.7125C5.09583 12.5208 5 12.2833 5 12C5 11.7167 5.09583 11.4792 5.2875 11.2875C5.47917 11.0958 5.71667 11 6 11H11V6C11 5.71667 11.0958 5.47917 11.2875 5.2875C11.4792 5.09583 11.7167 5 12 5C12.2833 5 12.5208 5.09583 12.7125 5.2875C12.9042 5.47917 13 5.71667 13 6V11H18C18.2833 11 18.5208 11.0958 18.7125 11.2875C18.9042 11.4792 19 11.7167 19 12C19 12.2833 18.9042 12.5208 18.7125 12.7125C18.5208 12.9042 18.2833 13 18 13H13V18C13 18.2833 12.9042 18.5208 12.7125 18.7125C12.5208 18.9042 12.2833 19 12 19C11.7167 19 11.4792 18.9042 11.2875 18.7125C11.0958 18.5208 11 18.2833 11 18V13Z",fill:"currentColor"})}),"AddIcon");t.Z=r},50927:function(e,t,n){"use strict";var i=n(85893);let r=(0,n(57680).Z)((0,i.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{d:"M10.25 6.75L4.75 12L10.25 17.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,i.jsx)("path",{d:"M19.25 12H5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),"ArrowLeftIcon");t.Z=r},64145:function(e,t,n){"use strict";var i=n(85893);let r=(0,n(57680).Z)((0,i.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M6.54163 10.8333L8.91663 13.2083C9.08329 13.375 9.16315 13.5694 9.15621 13.7916C9.14926 14.0139 9.0694 14.2083 8.91663 14.375C8.74996 14.5416 8.55204 14.6284 8.32288 14.6354C8.09371 14.6423 7.89579 14.5625 7.72913 14.3958L3.91663 10.5833C3.74996 10.4166 3.66663 10.2222 3.66663 9.99997C3.66663 9.77775 3.74996 9.5833 3.91663 9.41664L7.72913 5.604
114C7.89579 5.43747 8.09371 5.35761 8.32288 5.36455C8.55204 5.3715 8.74996 5.4583 8.91663 5.62497C9.0694 5.79164 9.14926 5.98608 9.15621 6.2083C9.16315 6.43052 9.08329 6.62497 8.91663 6.79164L6.54163 9.16664H15.8333C16.0694 9.16664 16.2673 9.2465 16.427 9.40622C16.5868 9.56594 16.6666 9.76386 16.6666 9.99997C16.6666 10.2361 16.5868 10.434 16.427 10.5937C16.2673 10.7534 16.0694 10.8333 15.8333 10.8333H6.54163Z",fill:"currentColor"})}),"ArrowLeftAltIcon");t.Z=r},36487:function(e,t,n){"use strict";var i=n(85893);let r=(0,n(57680).Z)((0,i.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M13.4584 10.8333H4.16671C3.9306 10.8333 3.73268 10.7534 3.57296 10.5937C3.41324 10.434 3.33337 10.2361 3.33337 9.99997C3.33337 9.76386 3.41324 9.56594 3.57296 9.40622C3.73268 9.2465 3.9306 9.16664 4.16671 9.16664H13.4584L11.0834 6.79164C10.9167 6.62497 10.8368 6.43052 10.8438 6.2083C10.8507 5.98608 10.9306 5.79164 11.0834 5.62497C11.25 5.4583 11.448 5.3715 11.6771 5.36455C11.9063 5.35761 12.1042 5.43747 12.2709 5.60414L16.0834 9.41664C16.1667 9.49997 16.2257 9.59025 16.2605 9.68747C16.2952 9.78469 16.3125 9.88886 16.3125 9.99997C16.3125 10.1111 16.2952 10.2152 16.2605 10.3125C16.2257 10.4097 16.1667 10.5 16.0834 10.5833L12.2709 14.3958C12.1042 14.5625 11.9063 14.6423 11.6771 14.6354C11.448 14.6284 11.25 14.5416 11.0834 14.375C10.9306 14.2083 10.8507 14.0139 10.8438 13.7916C10.8368 13.5694 10.9167 13.375 11.0834 13.2083L13.4584 10.8333Z",fill:"currentColor"})}),"ArrowRightAltIcon");t.Z=r},96694:function(e,t,n){"use strict";var i=n(85893);let r=(0,n(57680).Z)((0,i.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M11.25 6.75L8 10.25L4.75 6.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),"ChevronDown");t.Z=r},30212:function(e,t,n){"use strict";var i=n(85893);let r=(0,n(57680).Z)((0,i.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M4.75 9.25L8 5.75L11.25 9.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),"ChevronUp");t.Z=r},86041:function(e,t,n){"use strict";var i=n(85893);let r=(0,n(57680).Z)((0,i.jsx)("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M9.36133 18C8.81133 18 8.3405 17.8042 7.94883 17.4125C7.55716 17.0208 7.36133 16.55 7.36133 16V4C7.36133 3.45 7.55716 2.97917 7.94883 2.5875C8.3405 2.19583 8.81133 2 9.36133 2H18.3613C18.9113 2 19.3822 2.19583 19.7738 2.5875C20.1655 2.97917 20.3613 3.45 20.3613 4V16C20.3613 16.55 20.1655 17.0208 19.7738 17.4125C19.3822 17.8042 18.9113 18 18.3613 18H9.36133ZM9.36133 16H18.3613V4H9.36133V16ZM5.36133 22C4.81133 22 4.34049 21.8042 3.94883 21.4125C3.55716 21.0208 3.36133 20.55 3.36133 20V7C3.36133 6.71667 3.45716 6.47917 3.64883 6.2875C3.84049 6.09583 4.07799 6 4.36133 6C4.64466 6 4.88216 6.09583 5.07383 6.2875C5.26549 6.47917 5.36133 6.71667 5.36133 7V20H15.3613C15.6447 20 15.8822 20.0958 16.0738 20.2875C16.2655 20.4792 16.3613 20.7167 16.3613 21C16.3613 21.2833 16.2655 21.5208 16.0738 21.7125C15.8822 21.9042 15.6447 22 15.3613 22H5.36133Z",fill:"currentColor"})}),"CopyIcon");t.Z=r},85680:function(e,t,n){"use strict";var i=n(85893);let r=(0,n(57680).Z)((0,i.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M18.5 17.8V15.5C18.5 15.3667 18.45 15.25 18.35 15.15C18.25 15.05 18.1333 15 18 15C17.8667 15 17.75 15.05 17.65 15.15C17.55 15.25 17.5 15.3667 17.5 15.5V17.8C17.5 17.9333 17.525 18.0583 17.575 18.175C17.625 18.2917 17.7 18.4 17.8 18.5L19.325 20.025C19.425 20.125 19.5417 20.175 19.675 20.175C19.8083 20.175 19.925 20.125 20.025 20.025C20.125 19.925 20.175 19.8083 20.175 19.675C20.175 19.5417 20.125 19.425 20.025 19.325L18.5 17.8ZM5 21C4.45 21 3.97917 20.8042 3.5875 20.4125C3.19583 20.0208 3 19.55 3 19V5C3 4.45 3.19583 3.97917 3.5875 3.5875C3.97917 3.19583 4.45 3 5 3H19C19.55 3 20.0208 3.19583 20.4125 3.5875C20.8042 3.97917 21 4.45 21 5V10C21 10.2833 20.9042 10.5208 20.7125 10.7125C20.5208 10.9042 20.2833 11 20 11C19.7167 11 19.4792 10.9042 19.2875 10.7125C19.0958 10.5208 19 10.2833 19 10V5H5V19H10C10.2833 19 10.5208 19.0958 10.7125 19.2875C10.9042 19.4792 11 19.7167 11 20C11 20.2833 10.9042 20.5208 10.7125 20.7125C10.5208 20.9042 10.2833 21 10 21H5ZM5 19V5V11.075V11V19ZM7 16C7 16.2833 7.09583 16.5208 7.2875 16.7125C7.47917 16.9042 7.71667 17 8 17H10.075C10.3583 17 10.5958 16.9042 10.7875 16.7125C10.9792 16.5208 11.075 16.2833 11.075 16C11.075 15.7167 10.9792 15.4792 10.7875 15.2875C10.5958 15.0958 10.3583 15 10.075 15H8C7.71667 15 7.47917 15.0958 7.2875 15.2875C7.09583 15.4792 7 15.7167 7 16ZM7 12C7 12.2833 7.09583 12.5208 7.2875 12.7125C7.47917 12.9042 7.71667 13 8 13H13C13.2833 13 13.5208 12.9042 13.7125 12.7125C13.9042 12.5208 14 12.2833 14 12C14 11.7167 13.9042 11.4792 13.7125 11.2875C13.5208 11.0958 13.2833 11 13 11H8C7.71667 11 7.47917 11.0958 7.2875 11.2875C7.09583 11.4792 7 11.7167 7 12ZM7 8C7 8.28333 7.09583 8.52083 7.2875 8.7125C7.47917 8.90417 7.71667 9 8 9H16C16.2833 9 16.5208 8.90417 16.7125 8.7125C16.9042 8.52083 17 8.28333 17 8C17 7.71667 16.9042 7.47917 16.7125 7.2875C16.5208 7.09583 16.2833 7 16 7H8C7.71667 7 7.47917 7.09583 7.2875 7.2875C7.09583 7.47917 7 7.71667 7 8ZM18 23C16.6167 23 15.4375 22.5125 14.4625 21.5375C13.4875 20.5625 13 19.3833 13 18C13 16.6167 13.4875 15.4375 14.4625 14.4625C15.4375 13.4875 16.6167 13 18 13C19.3833 13 20.5625 13.4875 21.5375 14.4625C22.5125 15.4375 23 16.6167 23 18C23 19.3833 22.5125 20.5625 21.5375 21.5375C20.5625 22.5125 19.3833 23 18 23Z",fill:"currentColor"})}),"OverviewIcon");t.Z=r},34882:function(e,t,n){"use strict";var i=n(85893);let r=(0,n(57680).Z)((0,i.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.75 17C20.75 16.5858 20.4142 16.25 20 16.25C19.5858 16.25 19.25 16.5858 19.25 17V31C19.25 31.4142 19.5858 31.75 20 31.75C20.4142 31.75 20.75 31.4142 20.75 31V17ZM28.75 17C28.75 16.5858 28.4142 16.25 28 16.25C27.5858 16.25 27.25 16.5858 27.25 17V31C27.25 31.4142 27.5858 31.75 28 31.75C28.4142 31.75 28.75 31.4142 28.75 31V17Z",fill:"currentColor"}),(0,i.jsx)("circle",{cx:"24",cy:"24",r:"17.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),"PauseIcon");t.Z=r},58914:function(e,t,n){"use strict";var i=n(85893);let r=(0,n(57680).Z)((0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:"currentColor",children:(0,i.jsx)("path",{d:"m440-486-75 75q-12 12-28.5 11.5T308-412q-11-12-11.5-28t11.5-28l144-144q6-6 13-8.5t15-2.5q8 0 15 2.5t13 8.5l144 144q12 12 11.5 28T652-412q-12 12-28.5 12.5T595-411l-75-75v286q0 17-11.5 28.5T480-160q-17 0-28.5-11.5T440-200v-286ZM160-640v-80q0-33 23.5-56.5T240-800h480q33 0 56.5 23.5T800-720v80q0 17-11.5 28.5T760-600q-17 0-28.5-11.5T720-640v-80H240v80q0 17-11.5 28.5T200-600q-17 0-28.5-11.5T160-640Z"})}),"PublishIcon");t.Z=r},53956:function(e,t,n){"use strict";var i=n(85893);let r=(0,n(57680).Z)((0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:"currentColor",children:(0,i.jsx)("path",{d:"M200-800v241-1 400-640 200-200Zm0 720q-33 0-56.5-23.5T120-160v-640q0-33 23.5-56.5T200-880h287q16 0 30.5 6t25.5 17l194 194q11 11 17 25.5t6 30.5v28q0 17-11.5 28T720-540q-17 0-28.5-11.5T680-580v-20H520q-17 0-28.5-11.5T480-640v-160H200v640h220q17 0 28.5 11.5T460-120q0 17-11.5 28.5T420-80H200Zm531-149q29-29 29-71t-29-71q-29-29-71-29t-71 29q-29 29-29 71t29 71q29 29 71 29t71-29ZM864-57q-17 0-28-11l-80-80q-21 14-45.5 21t-50.5 7q-75 0-127.5-52.5T480-300q0-75 52.5-127.5T660-480q75 0 127.5 52.5T840-300q0 26-7 50.5T812-204l80 80q11 11 11 28t-11 28q-11 11-28 11Z"})}),"ReviewIcon");t.Z=r},17632:function(e,t,n){"use strict";var i=n(85893);let r=(0,n(57680).Z)((0,i.jsx)("svg",{width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M44 22C31.8497 22 22 31.8497 22 44C22 56.1503 31.8497 66 44 66C56.1503 66 66 56.1503 66 44C66 31.8497 56.1503 22 44 22ZM16 44C16 28.536 28.536 16 44 16C59.464 16 72 28.536 72 44C72 50.6513 69.6808 56.7609 65.807 61.5644L79.1213 74.8787C80.2929 76.0503 80.2929 77.9497 79.1213 79.1213C77.9497 80.2929 76.0503 80.2929 74.8787 79.1213L61.5644 65.807C56.7609 69.6808 50.6513 72 44 72C28.536 72 16 59.464 16 44Z",fill:"currentColor"})}),"Search2Icon");t.Z=r},49687:function(e,t,n){"use strict";var i=n(85893);let r=(0,n(57680).Z)((0,i.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.9341 5.16095C10.55 4.39426 9.4559 4.39406 9.07156 5.16061L4.68572 13.9081C4.33842 14.6008 4.84204 15.4167 5.6169 15.4167H14.3846C15.1593 15.4167 15.6629 14.6011 15.3159 13.9085L10.9341 5.16095ZM7.95415 4.60035C8.79968 2.91396 11.2068 2.9144 12.0517 4.60111L16.4335 13.3486C17.1969 14.8725 16.0889 16.6667 14.3846 16.6667H5.6169C3.91221 16.6667 2.80426 14.8717 3.5683 13.3479L7.95415 4.60035Z",fill:"currentColor"}),(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.99984 7.5C10.4601 7.5 10.8332 7.8731 10.8332 8.33333V10C10.8332 10.4602 10.4601 10.8333 9.99984 10.8333C9.5396 10.8333 9.1665 10.4602 9.1665 10V8.33333C9.1665 7.8731 9.5396 7.5 9.99984 7.5Z",fill:"currentColor"}),(0,i.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.1665 13.3333C9.1665 12.8731 9.5396 12.5 9.99984 12.5C10.4601 12.5 10.8332 12.8731 10.8332 13.3333C10.8332 13.7936 10.4601 14.1667 9.99984 14.1667C9.5396 14.1667 9.1665 13.7936 9.1665 13.3333Z",fill:"currentColor"})]}),"WarningTriangleIcon");t.Z=r},5260:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return nA},default:function(){return nE}});var i=n(85893),r=n(11163),o=n(37871),s=n(67294),l=n(40567),a=n(13241),c=n(84118),d=n(36590),u=n(91335),x=n(36936),p=n(14440),g=n(94246),h=n(59505),m=n(51050),f=n(85945),v=n(17e3),b=n(91444),y=n(12946);let S=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(await y.v_("user/vetting-questionnaire/publishDraft",e)).data},w="user/vetting-questionnaire/retrieve",j=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(await y.v_(w,e)).data};var C=n(5408);let Z=async e=>(await y.v_("user/vetting-questionnaire/upsertDraft",e)).data,k="utility/retrieveVettingQuestions",I=async()=>(await y.v_(k,{})).data;var q=n(82589),T=n(76483),B=n(83735),R=n(55130),L=n(10608),M=n(68224),D=n(44128),z=n(63841),W=n(44850),A=n(51368),E=n(86041),P=n(82067),K=n(57680);let H=(0,K.Z)((0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:"currentColor",children:(0,i.jsx)("path",{d:"M720-240q25 0 42.5-17.5T780-300q0-25-17.5-42.5T720-360q-25 0-42.5 17.5T660-300q0 25 17.5 42.5T720-240Zm0 120q30 0 56-14t43-39q-23-14-48-20.5t-51-6.5q-26 0-51 6.5T621-173q17 25 43 39t56 14ZM360-640h240v-80q0-50-35-85t-85-35q
1-50 0-85 35t-35 85v80ZM490-80H240q-33 0-56.5-23.5T160-160v-400q0-33 23.5-56.5T240-640h40v-80q0-83 58.5-141.5T480-920q83 0 141.5 58.5T680-720v80h40q33 0 56.5 23.5T800-560v52q-18-6-37.5-9t-42.5-3v-40H240v400h212q8 24 16 41.5T490-80Zm230 40q-83 0-141.5-58.5T520-240q0-83 58.5-141.5T720-440q83 0 141.5 58.5T920-240q0 83-58.5 141.5T720-40ZM240-560v400-400Z"})}),"LockPersonIcon");var V=n(34882),O=n(58914),_=n(56274),U=n(74209),N=n(64051),F=n(6293),Q=n(21933),G=n(17632),X={body:{display:"flex",flexDirection:"column",gap:1.5,mt:2},subtitle:{color:"neutralStrong"},emptyState:{color:"neutralSubdued"},noResults:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",py:5},noResultsIcon:{width:"64px",height:"64px",color:"disabled",mb:1},noResultsText:{color:"neutralSubdued"}};let $=0,Y=e=>($+=1,"custom_".concat(e,"_").concat(Date.now(),"_").concat($)),J=(e,t)=>{var n;return{sectionKey:e.sectionKey,sectionName:e.sectionName,sectionOrder:e.order,subSectionKey:t.subSectionKey,subSectionName:t.
1subSectionName,subSectionOrder:t.order,applicabilityType:t.applicabilityType,applicabilityValues:null!==(n=t.applicabilityValues)&&void 0!==n?n:[],selected:"general"===t.applicabilityType,questions:[]}},ee=(e,t)=>{let n=[],i=new Map;return e.forEach(e=>{e.subSections.forEach(t=>{let r=J(e,t);n.push(r),i.set(t.subSectionKey,r)})}),null==t||t.sections.forEach(e=>{e.subSections.forEach(t=>{let r=i.get(t.subSectionKey);if(r)"general"!==r.applicabilityType&&(r.selected=t.selected);else{var o;r={sectionKey:e.sectionKey,sectionName:e.sectionName,sectionOrder:e.order,subSectionKey:t.subSectionKey,subSectionName:t.subSectionName,subSectionOrder:t.order,applicabilityType:t.applicabilityType,applicabilityValues:null!==(o=t.applicabilityValues)&&void 0!==o?o:[],selected:"general"===t.applicabilityType||t.selected,questions:[]},n.push(r),i.set(t.subSectionKey,r)}r.questions=t.questions.map(e=>{var t,n,i,r;return{key:null!==(t=e.bankQuestionKey)&&void 0!==t?t:e.uuid,questionSource:e.questionSource,bankQuestionKey:e.bankQuestionKey,question:e.question,fileRequirement:null!==(n=e.fileRequirement)&&void 0!==n?n:"not_required",fileLabel:null!==(i=e.fileLabel)&&void 0!==i?i:null,scoring:null!==(r=e.scoring)&&void 0!==r?r:null,fields:e.fields,fieldDescriptions:e.fieldDescriptions}})})}),n.sort((e,t)=>e.sectionOrder===t.sectionOrder?e.subSectionOrder-t.subSectionOrder:e.sectionOrder-t.sectionOrder),{groups:n}},et=(e,t)=>e.groups.filter(e=>e.applicabilityType===t),en=(e,t)=>et(e,t).reduce((e,t)=>e+(t.selected?t.questions.length:0),0),ei=e=>e.groups.reduce((e,t)=>e+(t.selected?t.questions.length:0),0),er=e=>e.groups.filter(e=>e.selected&&e.questions.length>0).length,eo=e=>e.groups.length,es=e=>{let t=new Map,n=[];return e.groups.forEach(e=>{t.has(e.sectionKey)||(t.set(e.sectionKey,{sectionKey:e.sectionKey,sectionName:e.sectionName,selected:!1,subSections:[]}),n.push(e.sectionKey));let i=t.get(e.sectionKey);e.selected&&(i.selected=!0),i.subSections.push({subSectionKey:e.subSectionKey,subSectionName:e.subSectionName,selected:e.selected,applicabilityType:e.applicabilityType,applicabilityValues:e.applicabilityValues,questions:e.questions.map(e=>({questionSource:e.questionSource,...e.bankQuestionKey?{bankQuestionKey:e.bankQuestionKey}:{},question:e.question,fileRequirement:e.fileRequirement,fileLabel:"not_required"===e.fileRequirement?null:e.fileLabel,scoring:e.scoring,fields:e.fields,fieldDescriptions:e.fieldDescriptions}))})}),{sections:n.map(e=>t.get(e))}};var el=n(68520),ea=n(76182),ec=n(48648),ed=n(32218),eu=n(56610),ex=n(82013),ep=n(22198),eg=n(19748),eh={wrapper:{display:"flex",flexDirection:"column",gap:1.5,px:2,py:2,backgroundColor:"white",border:"1.5px dashed",borderColor:"border",borderRadius:"8px"},inputRow:{display:"flex",alignItems:"center",gap:1.5},plusIcon:e=>({fontSize:"20px",color:"primaryStrong",cursor:e?"pointer":"default"}),input:{height:"40px","& .MuiOutlinedInput-root":{backgroundColor:"white"}},addButton:{whiteSpace:"nowrap"},addActionRow:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:1.5,pt:1},filePanel:{display:"flex",flexDirection:"column",gap:1.5,pt:"4px",pb:1},typeOptions:{display:"flex",flexDirection:"column",gap:1},typeOption:e=>({display:"flex",alignItems:"flex-start",gap:1,px:1.5,py:1,border:"1px solid",borderColor:e?"primaryStrong":"border",borderRadius:"8px",cursor:"pointer"}),typeOptionText:{display:"flex",flexDirection:"column",gap:.5},typeOptionHint:{color:"neutralSubdued"},criteriaSection:{display:"flex",flexDirection:"column",gap:1},criteriaHelp:{color:"neutralSubdued"},criterionField:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:1,pt:1},criteriaHint:{color:"neutralSubdued",mr:"auto"},previewSection:{display:"flex",flexDirection:"column",gap:1},previewDivider:{borderColor:"border",mb:.5},previewCaption:{color:"neutralSubdued",textTransform:"uppercase",letterSpacing:"0.06em"},previewQuestion:{color:"primaryStrong"},previewCard:{display:"flex",alignItems:"center",gap:1.5,px:2,py:1.5,backgroundColor:"white",border:"1px solid",borderColor:"border",borderRadius:"8px",pointerEvents:"none"},previewCardBody:{display:"flex",flexDirection:"column",alignItems:"flex-start",ga
1p:1.5,flex:1,minWidth:0},previewSendIcon:{width:"24px",height:"24px",color:"neutralSubdued"},previewCardHeader:{display:"flex",alignItems:"center",gap:1},previewFileIcon:{fontSize:"20px",color:"neutralSubdued"},previewFileLabel:e=>({color:e?"neutralSubdued":"neutralStrong"}),previewAttachButton:{whiteSpace:"nowrap"},editActions:{display:"flex",justifyContent:"flex-end",gap:1.5,pt:1},editActionButton:{whiteSpace:"nowrap"}};let em=(0,K.Z)((0,i.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M5.5 3a1 1 0 0 1 1 1v.6c3-1.3 6 1.1 9 0a1 1 0 0 1 1.4.9v7.2a1 1 0 0 1-.6.9c-3 1.3-6-1.1-9 0V21a1 1 0 0 1-2 0V4a1 1 0 0 1 1-1Z",fill:"currentColor"})}),"FlagIcon"),ef={red:{color:"dangerStrong",backgroundColor:"dangerSoftSurface"},yellow:{color:"#A16207",backgroundColor:"#FEF9C3"},green:{color:"successStrong",backgroundColor:"successSoftSurface"}};var ev=e=>({display:"inline-flex",alignItems:"center",gap:.5,px:1,py:"2px",borderRadius:"999px",whiteSpace:"nowrap",...ef[e]}),eb={fontSize:"14px"},ey={color:"inherit"},eS=e=>{let{color:t,label:n,testId:r}=e;return(0,i.jsxs)(p.Z,{sx:ev(t),"data-testid":r,children:[(0,i.jsx)(em,{sx:eb}),(0,i.jsx)(g.Z,{variant:"bodyXS",weight:"bold",sx:ey,children:n})]})};let ew=["red","yellow","green"],ej={red:"",yellow:"",green:""},eC=(e,t,n,i)=>{let r=n.trim();return{question:e.trim(),fileRequirement:"file"===t?"required":"not_required",fileLabel:"file"===t&&r?r:null,scoring:"scored"===t?{criteria:{red:i.red.trim()||null,yellow:i.yellow.trim()||null,green:i.green.trim()||null}}:null}},eZ=e=>"not_required"!==e.fileRequirement&&!e.fileLabel,ek=e=>!!e.scoring&&ew.some(t=>{var n;return!(null===(n=e.scoring)||void 0===n?void 0:n.criteria[t])}),eI=e=>e.scoring?"scored":"not_required"!==e.fileRequirement?"file":"typed",eq=e=>{var t,n,i;return e.scoring?{red:null!==(t=e.scoring.criteria.red)&&void 0!==t?t:"",yellow:null!==(n=e.scoring.criteria.yellow)&&void 0!==n?n:"",green:null!==(i=e.scoring.criteria.green)&&void 0!==i?i:""}:ej};var eT=e=>{var t,n;let{onSubmit:r,onDraftChange:l,initialDraft:a,submitLabel:c,onCancel:d,fileLabelError:u,testId:x}=e,{t:m}=(0,o.$G)(),[f,v]=(0,s.useState)(null!==(t=null==a?void 0:a.question)&&void 0!==t?t:""),[b,y]=(0,s.useState)(a?eI(a):"typed"),[S,w]=(0,s.useState)(null!==(n=null==a?void 0:a.fileLabel)&&void 0!==n?n:""),[j,C]=(0,s.useState)(a?eq(a):ej),[Z,k]=(0,s.useState)(!1),I=(e,t,n,i)=>null==l?void 0:l(eC(e,t,n,i)),q=e=>{v(e),I(e,b,S,j)},T=e=>{y(e),"file"!==e&&k(!1),I(f,e,S,j)},B=e=>{w(e),e.trim()&&k(!1),I(f,b,e,j)},R=(e,t)=>{let n={...j,[e]:t};C(n),I(f,b,S,n)},L=()=>{v(""),y("typed"),w(""),C(ej),k(!1),I("","typed","",ej)},M=ew.filter(e=>!j[e].trim()),D="scored"===b&&M.length>0,W=()=>{let e=f.trim();if(e){if("file"===b&&!S.trim()){k(!0);return}D||(r(eC(e,b,S,j)),L())}},A=!!f.trim(),E=A&&!D,P=[{value:"typed",label:m("licensee-vetting.question-type-typed"),hint:m("licensee-vetting.question-type-typed-hint")},{value:"file",label:m("licensee-vetting.question-type-file"),hint:m("licensee-vetting.question-type-file-hint")},{value:"scored",label:m("licensee-vetting.question-type-scored"),hint:m("licensee-vetting.question-type-scored-hint")}],K=e=>(0,i.jsx)(el.Z,{variant:"outlined",onClick:W,disabled:!E,startIcon:a?(0,i.jsx)(ep.Z,{}):e,sx:eh.addButton,"data-testid":x?"".concat(x,"-add"):void 0,children:null!=c?c:m("add")}),H=K((0,i.jsx)(z.Z,{})),V=A&&!d?(0,i.jsx)(p.Z,{sx:eh.addActionRow,children:K((0,i.jsx)(ed.Z,{}))}):null,O=d?(0,i.jsxs)(p.Z,{sx:eh.editActions,children:[(0,i.jsx)(el.Z,{variant:"outlined",onClick:d,sx:eh.editActionButton,"data-testid":x?"".concat(x,"-cancel"):void 0,children:m("cancel")}),(0,i.jsx)(el.Z,{onClick:W,disabled:!E,startIcon:(0,i.jsx)(ep.Z,{}),sx:eh.editActionButton,"data-testid":x?"".concat(x,"-add"):void 0,children:null!=c?c:m("save")})]}):null;return(0,i.jsxs)(p.Z,{sx:eh.wrapper,children:[(0,i.jsxs)(p.Z,{sx:eh.inputRow,children:[(0,i.jsx)(z.Z,{onClick:W,sx:eh.plusIcon(E)}),(0,i.jsx)(ea.Z,{value:f,onChange:e=>q(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),W())},placeholder:m("licensee-vetting.add-custom-placeholder"),flexGrow:!0,sx:eh.input,inputProps:{"data-testid":x}}),A&&!d&&"typed"===b&&H]}),A&&(0,i.jsxs)(p.Z,{sx:eh.filePanel,children:[(0,i.jsx)(g.Z,{variant:"bodyS",weight:"semibold",children:m("licensee-vetting.question-type-label")}),(0,i.jsx)(p.Z,{role:"radiogroup","aria-label":m("licensee-vetting.question-type-label"),sx:eh.typeOptions,children:P.map(e=>(0,i.jsxs)(p.Z,{sx:eh.typeOption(b===e.value),onClick:()=>T(e.value),"data-testid":x?"".concat(x,"-type-").concat(e.value):void 0,children:[(0,i.jsx)(ec.Y,{checked:b===e.value,onChange:()=>T(e.value),inputProps:{"data-testid":x?"".concat(x,"-type-").concat(e.value,"-radio"):void 0}}),(0,i.jsxs)(p.Z,{sx:eh.typeOptionText,children:[(0,i.jsx)(g.Z,{variant:"bodyS",weight:"semibold",children:e.label}),(0,i.jsx)(g.Z,{variant:"bodyXS",sx:eh.typeOptionHint,children:e.hint})]})]},e.value))}),"file"===b&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ea.Z,{value:S,onChange:e=>B(e.target.value),label:m("licensee-vetting.file-label"),placeholder:m("licensee-vetting.file-label-placeholder"),required:!0,errorText:Z||u?m("licensee-vetting.file-label-required-error"):void 0,leftHelperText:m("licensee-vetting.file-label-helper"),fullWidth:!0,inputProps:{maxLength:500,"data-testid":x?"".concat(x,"-file-label"):void 0}}),(0,i.jsxs)(p.Z,{sx:eh.previewSection,"data-testid":x?"".concat(x,"-preview"):void 0,children:[(0,i.jsx)(h.Z,{sx:eh.previewDivider}),(0,i.jsx)(g.Z,{variant:"bodyXS",weight:"bold",sx:eh.previewCaption,children:m("licensee-vetting.how-licensee-sees-it")}),(0,i.jsx)(g.Z,{variant:"bodyS",sx:eh.previewQuestion,children:f.trim()}),(0,i.jsxs)(p.Z,{sx:eh.previewCard,children:[(0,i.jsxs)(p.Z,{sx:eh.previewCardBody,children:[(0,i.jsxs)(p.Z,{sx:eh.previewCardHeader,children:[(0,i.jsx)(ex.Z,{sx:eh.previewFileIcon}),(0,i.jsx)(g.Z,{variant:"bodyS",weight:"semibold",sx:eh.previewFileLabel(!S.trim()),"data-testid":x?"".concat(x,"-preview-label"):void 0,children:S.trim()||m("licensee-vetting.file-label")})]}),(0,i.jsx)(el.Z,{startIcon:(0,i.jsx)(eu.Z,{}),tabIndex:-1,sx:eh.previewAttachButton,children:m("licensee-vetting.attach-file")})]}),(0,i.jsx)(eg.Z,{sx:eh.previewSendIcon})]})]}),O,V]}),"scored"===b&&(0,i.jsxs)(p.Z,{sx:eh.criteriaSection,"data-testid":x?"".concat(x,"-criteria"):void 0,children:[(0,i.jsx)(g.Z,{variant:"bodyS",weight:"semibold",children:m("licensee-vetting.scoring-criteria-label")}),(0,i.jsx)(g.Z,{variant:"bodyXS",sx:eh.criteriaHelp,children:m("licensee-vetting.scoring-criteria-help")}),ew.map(e=>
1(0,i.jsxs)(p.Z,{sx:eh.criterionField,children:[(0,i.jsx)(eS,{color:e,label:m("licensee-vetting.flag-".concat(e))}),(0,i.jsx)(ea.Z,{value:j[e],onChange:t=>R(e,t.target.value),placeholder:m("licensee-vetting.criteria-".concat(e,"-hint")),multiline:!0,rows:2,fullWidth:!0,inputProps:{maxLength:2e3,"data-testid":x?"".concat(x,"-criteria-").concat(e):void 0}})]},e)),D&&d&&(0,i.jsx)(g.Z,{variant:"bodyXS",sx:eh.criteriaHint,"data-testid":x?"".concat(x,"-criteria-hint"):void 0,children:m("licensee-vetting.criteria-required-hint")}),O,A&&!d&&(0,i.jsxs)(p.Z,{sx:eh.addActionRow,children:[D&&(0,i.jsx)(g.Z,{variant:"bodyXS",sx:eh.criteriaHint,"data-testid":x?"".concat(x,"-criteria-hint"):void 0,children:m("licensee-vetting.criteria-required-hint")}),K((0,i.jsx)(ed.Z,{}))]})]}),"typed"===b&&O]}),!A&&O]})},eB=n(33367),eR=n(85589),eL=n(87071),eM={row:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return{display:"flex",alignItems:"center",gap:1.5,px:2,py:1.5,backgroundColor:e?"neutralSoftSurface":"white",border:"1px solid",borderColor:"border",borderRadius:"8px",width:"100%"}},text:{color:"neutralStrong",flex:1},fileChip:{display:"flex",alignItems:"center",gap:.5,px:1,py:"2px",border:"1px solid",borderColor:"border",borderRadius:"8px",whiteSpace:"nowrap",maxWidth:"200px"},fileChipIcon:{fontSize:"14px",color:"neutralSubdued"},fileChipText:{color:"neutralStrong",overflow:"hidden",textOverflow:"ellipsis"},scoredChip:{display:"flex",alignItems:"center",gap:.5,px:1,py:"2px",border:"1px solid",borderColor:"border",borderRadius:"8px",whiteSpace:"nowrap"},scoredChipIcon:{fontSize:"14px",color:"primaryStrong"},scoredChipText:{color:"neutralStrong"},editButton:{p:"4px",mr:-1,color:"neutralSubdued","&:hover":{backgroundColor:"neutralSoftBorder",color:"primaryStrong"}},customBadge:{color:"white",backgroundColor:"primaryStrong",borderRadius:"8px",px:1,py:"2px",whiteSpace:"nowrap",textTransform:"uppercase"},removeButton:{p:"4px",color:"neutralSubdued","&:hover":{backgroundColor:"neutralSoftBorder",color:"dangerStrong"}},tooltipTitle:{mb:.5}},eD=e=>{let{text:t,fileLabel:n,scored:r=!1,isCustom:s=!1,hasSavedVersion:l=!1,disabled:a=!1,onRemove:c,onEdit:d,testId:u}=e,{t:x}=(0,o.$G)(),h=(0,i.jsx)(eB.Z,{size:"small",onClick:c,sx:eM.removeButton,"aria-label":x("licensee-vetting.remove-question"),"data-testid":u?"".concat(u,"-remove"):void 0,children:(0,i.jsx)(eR.Z,{fontSize:"small"})});return(0,i.jsxs)(p.Z,{sx:eM.row(a),"data-testid":u,children:[(0,i.jsx)(g.Z,{variant:"bodyS",sx:eM.text,children:t}),n&&(0,i.jsxs)(p.Z,{sx:eM.fileChip,"data-testid":u?"".concat(u,"-file-label"):void 0,children:[(0,i.jsx)(eu.Z,{sx:eM.fileChipIcon}),(0,i.jsx)(g.Z,{variant:"bodyXS",sx:eM.fileChipText,children:n})]}),r&&(0,i.jsx)(m.Z,{placement:"top",arrow:!0,title:(0,i.jsx)(g.Z,{variant:"bodyS",children:x("licensee-vetting.scored-tooltip")}),children:(0,i.jsxs)(p.Z,{sx:eM.scoredChip,"data-testid":u?"".concat(u,"-scored"):void 0,children:[(0,i.jsx)(em,{sx:eM.scoredChipIcon}),(0,i.jsx)(g.Z,{variant:"bodyXS",sx:eM.scoredChipText,children:x("licensee-vetting.scored-badge")})]})}),s&&(0,i.jsx)(g.Z,{variant:"bodyXS",weight:"bold",component:"span",sx:eM.customBadge,children:x("licensee-vetting.custom-badge")}),d&&(0,i.jsx)(eB.Z,{size:"small",onClick:d,sx:eM.editButton,"aria-label":x("licensee-vetting.edit-question"),"data-testid":u?"".concat(u,"-edit"):void 0,children:(0,i.jsx)(eL.Z,{fontSize:"small"})}),(0,i.jsx)(m.Z,{placement:"top",arrow:!0,title:s?(0,i.jsxs)(p.Z,{children:[(0,i.jsx)(g.Z,{variant:"bodyS",weight:"bold",sx:eM.tooltipTitle,children:x(l?"licensee-vetting.delete-warning-title-2":"licensee-vetting.delete-warning-title")}),(0,i.jsx)(g.Z,{variant:"bodyS",children:x(l?"licensee-vetting.delete-warning-body-2":"licensee-vetting.delete-warning-body")})]}):(0,i.jsx)(g.Z,{variant:"bodyS",children:x("licensee-vetting.remove-standard-warning")}),children:h})]})},ez=n(52841),eW=n(96963),eA={row:e=>({display:"flex",alignItems:"center",gap:1.5,px:2,py:1.5,backgroundColor:e?"primarySoftSurface":"white",border:"1px solid",borderColor:e?"primaryStrong":"border",borderRadius:"8px",cursor:"pointer",width:"100%",textAlign:"left",transition:"all 0.15s","&:hover":{backgroundColor:e?"primarySoftSurface":"neutralSoftSurface"}}),checkbox:{p:0},text:{color:"neutralStrong",flex:1},customBadge:{color:"white",backgroundColor:"primaryStrong",borderRadius:"8px",px:1,py:"2px",whiteSpace:"nowrap"},removeButton:{p:"4px",color:"neutralSubdued","&:hover":{backgroundColor:"neutralSoftBorder",color:"neutralStrong"}}},eE=e=>{let{text:t,selected:n,onToggle:r,isCustom:s=!1,onRemove:l,testId:a}=e,{t:c}=(0,o.$G)();return(0,i.jsxs)(p.Z,{component:"button",type:"button",onClick:r,sx:eA.row(n),"data-testid":a,children:[(0,i.jsx)(ez.Z,{checked:n,sx:eA.checkbox,tabIndex:-1,disableRipple:!0}),(0,i.jsx)(g.Z,{variant:"bodyS",sx:eA.text,children:t}),s&&(0,i.jsx)(g.Z,{variant:"bodyXS",weight:"bold",component:"span",sx:eA.customBadge,children:c("licensee-vetting.custom-badge")}),s&&l&&(0,i.jsx)(eB.Z,{size:"small",onClick:e=>{e.stopPropagation(),l()},sx:eA.removeButton,"aria-label":c("licensee-vetting.remove-question"),children:(0,i.jsx)(eW.Z,{fontSize:"small"})})]})};let eP=e=>{var t,n;return{key:e.bankQuestionKey,questionSource:"bank",bankQuestionKey:e.bankQuestionKey,question:e.question,fileRequirement:"not_required",fileLabel:null,scoring:null,fields:null!==(t=e.fields)&&void 0!==t?t:[],fieldDescriptions:null!==(n=e.fieldDescriptions)&&void 0!==n?n:{}}};var eK=e=>{let{isOpen:t,group:n,bankQuestions:r,hasSavedVersion:l,onSave:a,onClose:c}=e,{t:d}
1=(0,o.$G)(),[u,x]=(0,s.useState)(new Set),[h,m]=(0,s.useState)([]),[f,v]=(0,s.useState)(""),[b,y]=(0,s.useState)(null),[S,w]=(0,s.useState)(!1),[j,C]=(0,s.useState)(null);(0,s.useEffect)(()=>{if(!t)return;let e=new Set(r.map(e=>e.bankQuestionKey)),i=t=>!!t.bankQuestionKey&&e.has(t.bankQuestionKey);x(new Set(n.questions.filter(i).map(e=>e.bankQuestionKey))),m(n.questions.filter(e=>!i(e))),v(""),y(null),w(!1),C(null)},[t,n,r]);let Z=e=>({key:Y(n.subSectionKey),questionSource:"custom",bankQuestionKey:null,question:e.question,fileRequirement:e.fileRequirement,fileLabel:e.fileLabel,scoring:e.scoring,fields:[],fieldDescriptions:{}}),k=f.trim().toLowerCase(),I=(0,s.useMemo)(()=>k?r.filter(e=>e.question.toLowerCase().includes(k)):r,[r,k]),q=(0,s.useMemo)(()=>k?h.filter(e=>e.question.toLowerCase().includes(k)):h,[h,k]),T=e=>x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),B=(e,t)=>{m(n=>n.map(n=>n.key===e?{...n,question:t.question,fileRequirement:t.fileRequirement,fileLabel:t.fileLabel,scoring:t.scoring}:n)),C(null)},R=e=>m(t=>t.filter(t=>t.key!==e));return(0,i.jsx)(N.Z,{isOpen:t,closeModal:c,maxWidth:"560px",modalTitle:d("licensee-vetting.add-questions-to",{section:n.subSectionName}),headerDivider:!0,"data-testid":"vetting-bank-picker-modal",footerContent:(0,i.jsx)(F.Z,{primaryButtonChild:(0,i.jsx)(U.Z,{action:"apply"}),secondaryButtonChild:d("cancel"),hideSecondaryButtonInMobile:!0,primaryButtonDataTestId:"vetting-bank-picker-save",secondaryButtonDataTestId:"vetting-bank-picker-cancel",onPrimaryButtonClick:()=>{if((null==b?void 0:b.question)&&eZ(b)){w(!0);return}!((null==b?void 0:b.question)&&ek(b))&&a([...r.filter(e=>u.has(e.bankQuestionKey)).map(eP),...h,...(null==b?void 0:b.question)?[Z(b)]:[]])},onSecondaryButtonClick:c}),children:(0,i.jsxs)(p.Z,{sx:X.body,children:[(0,i.jsx)(g.Z,{variant:"bodyS",sx:X.subtitle,children:d("licensee-vetting.add-questions-subtitle")}),(0,i.jsx)(Q.Z,{label:d("licensee-vetting.search-questions"),value:f,onChange:v}),0===r.length&&0===h.length&&(0,i.jsx)(g.Z,{variant:"bodyS",sx:X.emptyState,children:d("licensee-vetting.no-bank-questions")}),k&&0===I.length&&0===q.length&&(0,i.jsxs)(p.Z,{sx:X.noResults,children:[(0,i.jsx)(G.Z,{sx:X.noResultsIcon}),(0,i.jsx)(g.Z,{variant:"bodyS",sx:X.noResultsText,children:d("licensee-vetting.no-search-results")})]}),I.map(e=>(0,i.jsx)(eE,{text:e.question,selected:u.has(e.bankQuestionKey),onToggle:()=>T(e.bankQuestionKey),testId:"bank-question-".concat(e.bankQuestionKey)},e.bankQuestionKey)),q.map(e=>j===e.key?(0,i.jsx)(eT,{initialDraft:{question:e.question,fileRequirement:e.fileRequirement,fileLabel:e.fileLabel,scoring:e.scoring},submitLabel:d("save"),onSubmit:t=>B(e.key,t),onCancel:()=>C(null),testId:"edit-custom-question-".concat(e.key)},e.key):(0,i.jsx)(eD,{text:e.question,fileLabel:e.fileLabel,scored:!!e.scoring,isCustom:!0,hasSavedVersion:l,onEdit:()=>C(e.key),onRemove:()=>R(e.key),testId:"custom-question-".concat(e.key)},e.key)),(0,i.jsx)(eT,{onSubmit:e=>{m(t=>[...t,Z(e)]),y(null)},onDraftChange:e=>{y(e),eZ(e)||w(!1)},fileLabelError:S,testId:"bank-picker-add-custom"})]})})},eH=n(27484),eV=n.n(eH),eO=n(24966),e_=n(35332),eU=n(36981),eN=n(78868),eF={fixedContainer:{position:"fixed",bottom:0,left:0,right:0,bgcolor:"white",borderTop:"1px solid",borderColor:"border",py:2,display:"flex",justifyContent:"center",zIndex:3},maxWidthContainer:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",gap:2,flexDirection:{xs:"column",md:"row"}},status:{display:"flex",alignItems:"center",justifyContent:{xs:"center",md:"flex-start"},flexWrap:"wrap",gap:1.5},statusChip:e=>({textTransform:"uppercase",color:e?"successStrong":"neutralStrong",backgroundColor:e?"successSoftSurface":"neutralSoftSurface",borderRadius:"8px",px:1.25,py:"4px",whiteSpace:"nowrap"}),statusMeta:e=>({color:"neutralSubdued",...e&&{flexBasis:{xs:"100%",md:"auto"},textAlign:{xs:"center",md:"left"}}}),lastPublished:{display:"inline-flex",alignItems:"center",alignSelf:"center",gap:1,color:"neutralSubdued",whiteSpace:"nowrap",mb:{xs:.5,md:0}},lastPublishedDate:{fontWeight:700,color:"neutralStrong"}
1,unsavedChip:{display:"inline-flex",alignItems:"center",gap:.75,fontSize:"12px",fontWeight:600,color:"warningSubdued",whiteSpace:"nowrap"},unsavedDot:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"warningSubdued"},actions:{display:"flex",flexDirection:{xs:"column",md:"row"},alignItems:"center",gap:1.5,flexWrap:"wrap",justifyContent:{xs:"center",md:"flex-end"},width:{xs:"100%",md:"auto"},"& > span":{width:{xs:"100%",md:"auto"}}},buttonRow:{display:"flex",flexDirection:"row",gap:1.5,width:{xs:"100%",md:"auto"}},actionButton:{whiteSpace:"nowrap",flex:{xs:1,md:"0 0 auto"},minWidth:0},previewButtonWrapper:{display:"inline-flex",width:{xs:"100%",md:"auto"}},previewButton:{whiteSpace:"nowrap",width:{xs:"100%",md:"auto"},"&.Mui-disabled":{border:"none",".MuiButton-startIcon svg path":{fill:"none"}}}},eQ=e=>{let{state:t,totalQuestions:n,sectionsInUse:r,totalSections:l,isSaving:a,isPublishing:c,canPublish:d,hasUnsavedChanges:u,hasUnpublishedChanges:x,publishedAt:h,onSave:m,onPublish:f,onPreview:v,onHeightChange:b}=e,{t:y}=(0,o.$G)(),{setBottomOffset:S}=(0,eU.p)(),w=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=()=>{if(w.current){let{offsetHeight:e}=w.current;S(e),null==b||b(e)}};e();let t=new ResizeObserver(e);return w.current&&t.observe(w.current),()=>{t.disconnect(),S(0),null==b||b(0)}},[S,b]);let j=y("Published"===t?"licensee-vetting.status-live":"licensee-vetting.status-draft"),C=h?eV()(h).format("MMM D, YYYY \xb7 h:mm A"):null;return(0,i.jsx)(p.Z,{ref:w,sx:eF.fixedContainer,children:(0,i.jsxs)(eO.Z,{maxWidth:1320,sx:eF.maxWidthContainer,children:[(0,i.jsxs)(p.Z,{sx:eF.status,children:[t&&(0,i.jsx)(g.Z,{variant:"bodyXS",weight:"bold",component:"span",sx:eF.statusChip("Published"===t),"data-testid":"vetting-status-chip",children:j}),u&&(0,i.jsxs)(p.Z,{component:"span",sx:eF.unsavedChip,"data-testid":"vetting-unsaved-indicator",children:[(0,i.jsx)(p.Z,{component:"span",sx:eF.unsavedDot}),y("licensee-vetting.unsaved-changes")]}),(0,i.jsx)(g.Z,{variant:"bodyS",weight:"medium",sx:eF.statusMeta(u),children:y("licensee-vetting.status-meta",{questions:n,used:r,total:l})})]}),(0,i.jsxs)(p.Z,{sx:eF.actions,children:[C&&(0,i.jsxs)(g.Z,{variant:"bodyS",weight:"medium",sx:eF.lastPublished,"data-testid":"vetting-last-published",children:[y("licensee-vetting.last-published"),(0,i.jsx)(p.Z,{component:"span",sx:eF.lastPublishedDate,children:C})]}),(0,i.jsx)(e_.Z,{title:u?y("licensee-vetting.preview-requires-saved"):"",children:(0,i.jsx)(p.Z,{component:"span",sx:eF.previewButtonWrapper,children:(0,i.jsx)(el.Z,{customVariant:"whitePrimaryOutlined",startIcon:(0,i.jsx)(eN.Z,{}),onClick:v,disabled:u,sx:eF.previewButton,"data-testid":"vetting-preview-button",children:y("licensee-vetting.preview-cta")})})}),(0,i.jsxs)(p.Z,{sx:eF.buttonRow,children:[(0,i.jsx)(el.Z,{variant:"outlined",startIcon:(0,i.jsx)(ep.Z,{}),onClick:m,disabled:a||c||!u,sx:eF.actionButton,"data-testid":"vetting-save-button",children:y(a?"licensee-vetting.saving":"save")}),d&&(0,i.jsx)(el.Z,{variant:"contained",startIcon:(0,i.jsx)(O.Z,{}),onClick:f,disabled:c||!x&&!u,sx:eF.actionButton,"data-testid":"vetting-publish-button",children:y(c?"licensee-vetting.publishing":"licensee-vetting.publish")})]})]})]})})},eG=n(37887),eX=n(85277),e$=n(6944),eY=n(96694),eJ={mb:2.5},e0={width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1.5,backgroundColor:"white",border:"1px solid",borderColor:"border",borderRadius:"8px",cursor:"pointer",textAlign:"left",transition:"background-color 0.15s, border-color 0.15s","&:hover":{backgroundColor:"neutralSoftSurface"}},e1={display:"flex",alignItems:"center",gap:1.5},e2={color:"neutralStrong"},e5=e=>({color:"neutralSubdued",transform:e?"rotate(180deg)":"none",transition:"transform 0.2s"}),e3={display:"flex",flexDirection:"column",gap:1.25,pt:1.5},e6=e=>{let{title:t,selectedCount:n,totalCount:r,expanded:o,onToggle:s,children:l,badgeLabel:a,testId:c}=e;return(0,i.jsxs)(p.Z,{sx:eJ,children:[(0,i.jsxs)(p.Z,{component:"button",type:"button",onClick:s,sx:e0,"data-testid":c,children:[(0,i.jsx)(g.Z,{variant:"bodyM",weight:"bold",sx:e2,children:t}),(0,i.jsxs)(p.Z,{sx:e1,children:[(0,i.jsx)(eG.Z,{badgeContent:null!=a?a:"".concat(n,"/").concat(r),color:"primary",sx:e$.Z.badge(n>0)}),(0,i.jsx)(eY.Z,{sx:e5(o)})]})]}),(0,i.jsx)(eX.Z,{in:o,unmountOnExit:!0,children:(0,i.jsx)(p.Z,{sx:e3,children:l})})]})},e8=n(56916),e4={wrapper:{mb:2.5},card:e=>({display:"flex",alignItems:"center",gap:2,px:2,py:1.5,backgroundColor:e?"primarySoftSurface":"white",border:"1px solid",borderColor:e?"primaryStrong":"border",borderRadius:"8px",cursor:"pointer",transition:"all 0.15s","&:hover":{backgroundColor:e?"primarySoftSurface":"neutralSoftSurface"}}),textWrapper:{flex:1,minWidth:0},title:{color:"neutralStrong"},meta:{color:"neutralSubdued"},metaSelected:{color:"primaryStrong"}
1,chevron:e=>({color:"neutralSubdued",flexShrink:0,transform:e?"rotate(180deg)":"none",transition:"transform 0.2s"}),content:{display:"flex",flexDirection:"column",gap:1.25,pt:1.5}},e7=e=>{let{title:t,totalQuestions:n,selectedCount:r,active:s,onToggleActive:l,children:a,badgeLabel:c,expanded:d,onToggleExpand:u,testId:x}=e,{t:h}=(0,o.$G)(),m=void 0!==u,f=m?!!d:s;return(0,i.jsxs)(p.Z,{sx:e4.wrapper,children:[(0,i.jsxs)(p.Z,{sx:e4.card(s),onClick:m?u:l,"data-testid":x,children:[(0,i.jsx)(e8.Z,{checked:s,onClick:e=>e.stopPropagation(),onChange:l,"data-testid":x?"".concat(x,"-switch"):void 0}),(0,i.jsxs)(p.Z,{sx:e4.textWrapper,children:[(0,i.jsx)(g.Z,{variant:"bodyM",weight:"bold",sx:e4.title,children:t}),!c&&(0,i.jsxs)(g.Z,{variant:"bodyXS",sx:e4.meta,children:[h("licensee-vetting.questions-count",{number:n}),s&&r>0&&(0,i.jsxs)(g.Z,{variant:"bodyXS",weight:"bold",component:"span",sx:e4.metaSelected,children:[" \xb7 ",h("licensee-vetting.selected-count",{number:r})]})]})]}),c&&(0,i.jsx)(eG.Z,{badgeContent:c,color:"primary",sx:e$.Z.badge(s)}),m&&(0,i.jsx)(eY.Z,{sx:e4.chevron(f)})]}),(0,i.jsx)(eX.Z,{in:f,unmountOnExit:!0,children:(0,i.jsx)(p.Z,{sx:e4.content,children:a})})]})},e9=n(53722),te={body:{mt:3},text:{color:"neutralStrong"}},tt=e=>{let{isOpen:t,title:n,subtitle:r,body:o,confirmLabel:s,cancelLabel:l,onConfirm:a,onClose:c,isConfirming:d=!1,danger:u=!1,confirmIcon:x,testId:h}=e;return(0,i.jsx)(e9.Z,{isOpen:t,onClose:c,title:n,subtitle:r,maxWidth:"448px","data-testid":h,confirmChild:x?(0,i.jsxs)(i.Fragment,{children:[x,s]}):s,onConfirm:a,confirmDisabled:d,confirmVariant:u?"dangerPrimary":void 0,confirmTestId:h?"".concat(h,"-confirm"):void 0,cancelLabel:l,cancelVariant:u?"neutralPrimary":void 0,cancelTestId:h?"".concat(h,"-cancel"):void 0,hideCancelInMobile:!0,children:(0,i.jsx)(p.Z,{sx:te.body,children:"string"==typeof o?(0,i.jsx)(g.Z,{variant:"bodyS",sx:te.text,children:o}):o})})},tn={body:{mt:3},text:{color:"neutralStrong"}},ti=e=>{let{isOpen:t,title:n,subtitle:r,body:o,buttonLabel:s,onClose:l,buttonIcon:a,testId:c}=e;return(0,i.jsx)(e9.Z,{isOpen:t,onClose:l,title:n,subtitle:r,maxWidth:"448px","data-testid":c,confirmChild:a?(0,i.jsxs)(i.Fragment,{children:[a,s]}):s,onConfirm:l,confirmTestId:c?"".concat(c,"-confirm"):void 0,hideCancel:!0,children:(0,i.jsx)(p.Z,{sx:tn.body,children:"string"==typeof o?(0,i.jsx)(g.Z,{variant:"bodyS",sx:tn.text,children:o}):o})})},tr=n(92690),to=n(85680),ts={container:{display:"flex",alignItems:"center",gap:.5,p:.5,width:{xs:"100%",md:"auto"},flexShrink:0,backgroundColor:"neutralSoftSurface",borderRadius:"12px"},segment:e=>({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:{xs:1,md:"none"},gap:.75,px:2,py:1,border:"none",borderRadius:"8px",cursor:"pointer",fontSize:"14px",fontWeight:600,whiteSpace:"nowrap",transition:"background-color 0.15s, color 0.15s",backgroundColor:e?"white":"transparent",color:e?"primaryStrong":"neutralSubdued",boxShadow:e?"0 1px 2px rgba(16, 24, 40, 0.08)":"none","&:hover":{color:e?"primaryStrong":"neutralStrong"}}),segmentIcon:{fontSize:"18px"},countBadge:e=>({display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",px:.5,borderRadius:"10px",fontSize:"12px",fontWeight:700,backgroundColor:e?"primaryStrong":"neutralSoftBorder",color:e?"white":"neutralSubdued"})},tl=e=>{let{mode:t,onChange:n,responsesCount:r,responsesFirst:s=!1}=e,{t:l}=(0,o.$G)(),a=(0,i.jsxs)(p.Z,{component:"button",type:"button",role:"tab","aria-selected":"builder"===t,sx:ts.segment("builder"===t),onClick:()=>n("builder"),"data-testid":"vetting-mode-builder",children:[(0,i.jsx)(tr.Z,{sx:ts.segmentIcon}),l("licensee-vetting.mode-builder")]},"builder"),c=(0,i.jsxs)(p.Z,{component:"button",type:"button",role:"tab","aria-selected":"responses"===t,sx:ts.segment("responses"===t),onClick:()=>n("responses"),"data-testid":"vetting-mode-responses",children:[(0,i.jsx)(to.Z,{sx:ts.segmentIcon}),l("licensee-vetting.mode-responses"),void 0!==r&&r>0&&(0,i.jsx)(p.Z,{component:"span",sx:ts.countBadge("responses"===t),children:r})]},"responses");return(0,i.jsx)(p.Z,{sx:ts.container,role:"tablist",children:s?[c,a]:[a,c]})},ta=n(67310),tc=n(50927),td=n(83721),tu=n(16170),tx=n(57632),tp=n(26674),tg=n(13587),th=n(97423),tm=n(2883),tf={root:{display:"flex",flexDirection:"column",width:"100%",height:"60vh",minHeight:420},messages:{display:"flex",flexDirection:"column",gap:2,py:2,flexGrow:1,minHeight:0,overflowY:"auto"},attachmentRow:{display:"flex",width:"100%",maxWidth:"85%"},messageRow:e=>({display:"flex",justifyContent:e?"flex-end":"flex-start",width:"100%"}),messageContainer:e=>({display:"flex",flexDirection:"column",alignItems:e?"flex-end":"flex-start",maxWidth:"85%"}),messageBubble:(e,t)=>
1({padding:e?"12px 16px":0,backgroundColor:e?"neutralSoftSurface":"transparent",borderRadius:"6px",fontSize:"14px",lineHeight:"20px",color:t?"neutralSubdued":e?"neutralStrong":"primaryStrong",whiteSpace:e?"pre-wrap":"normal",wordBreak:"break-word","& p":{margin:"0 0 12px 0","&:last-child":{marginBottom:0}},"& h1, & h2, & h3, & h4, & h5, & h6":{margin:"16px 0 8px 0",fontWeight:600,"&:first-child":{marginTop:0}},"& h1":{fontSize:"1.25em"},"& h2":{fontSize:"1.15em"},"& h3":{fontSize:"1.05em"},"& ul, & ol":{margin:"0 0 12px 0",paddingLeft:"20px","&:last-child":{marginBottom:0}},"& li":{marginBottom:"4px","&:last-child":{marginBottom:0}}}),thinkingContainer:{display:"flex",alignItems:"center",gap:1,padding:"8px 0"},thinkingText:{color:"primaryStrong"},thinkingSpinner:{color:"primaryStrong"},inputContainer:{pt:2,flexShrink:0},fullWidthDivider:{borderColor:"border"},sendButton:{width:"40px",height:"40px",color:"neutralSubdued","&:hover":{backgroundColor:"neutralSoftSurface"},"&:disabled":{color:"disabled"}},sendButtonIcon:{width:"24px",height:"24px"}};let tv=[tu.Z];var tb=e=>{let{conversationUuid:t,initialMessage:n,onComplete:r,responseId:l,initialVettingQuestion:a=null}=e,{t:c}=(0,o.$G)(),[d,u]=(0,s.useState)([n]),[x,m]=(0,s.useState)(""),[f,v]=(0,s.useState)(!1),[b,y]=(0,s.useState)(!1),[S,w]=(0,s.useState)(a),[j,C]=(0,s.useState)(!1),Z=(0,s.useRef)(null),k=(0,s.useRef)(null),I=!!l&&!!S&&"not_required"!==S.fileRequirement&&!b,q=I&&(null==S?void 0:S.fileRequirement)==="required";(0,s.useEffect)(()=>{let e=Z.current;e&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},[d.length,f]),(0,s.useEffect)(()=>{var e;f||q||null===(e=k.current)||void 0===e||e.focus()},[f,q]);let B=async()=>{try{var e;let n=await (0,tp.b)(t);w(null!==(e=n.currentVettingQuestion)&&void 0!==e?e:null)}catch(e){}},R=async e=>{if(e&&!f&&!j){if(e!==tm.W){let t={uuid:(0,tx.Z)(),message:e,isUser:!0};u(e=>[...e,t])}m(""),v(!0);try{var n;let i=await (0,tg.H)(t,e),o={uuid:i.aiMessage.uuid,message:i.aiMessage.message,isUser:!1};u(e=>[...e,o]),w(null!==(n=i.currentVettingQuestion)&&void 0!==n?n:null),i.complete&&(y(!0),r())}catch(e){u(e=>[...e,{uuid:(0,tx.Z)(),message:c("negosh-ai-was-unable-to-respond-2"),isUser:!1,isError:!0}])}finally{v(!1)}}},L=()=>R(x.trim());return(0,i.jsxs)(p.Z,{sx:tf.root,children:[(0,i.jsx)(h.Z,{sx:tf.fullWidthDivider}),(0,i.jsxs)(p.Z,{ref:Z,sx:tf.messages,children:[d.map(e=>(0,i.jsx)(p.Z,{sx:tf.messageRow(e.isUser),children:(0,i.jsx)(p.Z,{sx:tf.messageContainer(e.isUser),children:(0,i.jsx)(p.Z,{sx:tf.messageBubble(e.isUser,e.isError),children:e.isUser?e.message:(0,i.jsx)(td.UG,{remarkPlugins:tv,children:e.message})})})},e.uuid)),I&&!q&&!f&&l&&S&&(0,i.jsx)(p.Z,{sx:tf.attachmentRow,children:(0,i.jsx)(th.Z,{responseId:l,question:S,disabled:f,onQuestionChange:w,onUploadingChange:C,onConflict:B})}),f&&(0,i.jsx)(p.Z,{sx:tf.messageRow(!1),children:(0,i.jsx)(p.Z,{sx:tf.messageContainer(!1),children:(0,i.jsxs)(p.Z,{sx:tf.thinkingContainer,children:[(0,i.jsx)(T.Z,{size:20,sx:tf.thinkingSpinner}),(0,i.jsx)(g.Z,{variant:"bodyS",sx:tf.thinkingText,children:c("thinking-with-ellipsis")})]})})})]}),(0,i.jsx)(h.Z,{sx:tf.fullWidthDivider}),(0,i.jsx)(p.Z,{sx:tf.inputContainer,children:q&&!b&&l&&S?(0,i.jsx)(th.Z,{responseId:l,question:S,disabled:f,onQuestionChange:w,onUploadingChange:C,onConflict:B,onContinue:()=>R(tm.W)}):(0,i.jsx)(ea.Z,{inputRef:k,fullWidth:!0,multiline:!0,maxRows:4,value:x,onChange:e=>m(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),L())},disabled:f||b||j,readOnly:f||b,"data-testid":"preview-chat-input",InputProps:{readOnly:f||b,endAdornment:(0,i.jsx)(eB.Z,{onClick:L,disabled:!x.trim()||f||b||j,sx:tf.sendButton,"data-testid":"preview-chat-send-button",children:(0,i.jsx)(eg.Z,{sx:tf.sendButtonIcon})})}})})]})},ty={root:{display:"flex",flexDirection:"column",width:"100%"},backButton:{display:"inline-flex",alignItems:"center",gap:.5,alignSelf:"flex-start",mb:2.5,fontWeight:600,textDecoration:"none","&:hover":{textDecoration:"none"}},backIcon:{fontSize:"20px"},heading:{display:"flex",flexDirection:"column",gap:.5,mb:2.5},title:{color:"neutralStrong"},subtitle:{color:"neutralSubdued",maxWidth:720},loadingWrapper:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:320},errorWrapper:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:1.5,minHeight:320,textAlign:"center"},errorText:{color:"neutralSubdued"}};let tS=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(await y.v_("ai/chat/conversations/".concat(e,"/licenseeVettingSummary"),t)).data};var tw=n(75254),tj=n(41796),tC={loadingContainer:e=>({position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:3,minHeight:360,py:{xs:6,md:9},px:{xs:2,md:4},"@keyframes vettingLoadingPulse":{"0%, 100%":{transform:"scale(1)",boxShadow:"0 0 0 0 ".concat((0,tj.Fq)(e.palette.primaryStrong,.45))},"50%":{transform:"scale(1.05)",boxShadow:"0 0 0 24px ".concat((0,tj.Fq)(e.palette.primaryStrong,0))}},"@keyframes vettingLoadingFloat":{"0%, 100%":{transform:"translateY(0)"},"50%":{transform:"translateY(-6px)"}},"@keyframes vettingLoadingShimmer":{"0%":{transform:"translateX(-100%)"},"100%":{transform:"translateX(100%)"}},"@keyframes vettingLoadingMessageIn":{"0%":{opacity:0,transform:"translateY(8px)"},"100%":{opacity:1,transform:"translateY(0)"}}}),loadingIconWrapper:e=>({width:88,height:88,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:"linear-gradient(135deg, ".concat(e.palette.primaryStrong," 0%, ").concat(e.palette.primarySubdued," 100%)"),animation:"vettingLoadingPulse 2.4s ease-out infinite, vettingLoadingFloat 3.6s ease-in-out infinite",position:"relative",zIndex:1}),loadingIcon:{fontSize:"44px",color:"white"},loadingTextBlock:{display:"flex",flexDirection:"column",alignItems:"center",gap:1,textAlign:"center",zIndex:1},loadingTitle:{color:"neutralStrong",letterSpacing:"-0.2px"},loadingMessage:{color:"primaryStrong",minHeight:"22px",animation:"vettingLoadingMessageIn 400ms ease-out"},loadingProgressBlock:{width:"100%",maxWidth:440,display:"flex",flexDirection:"column",gap:1,zIndex:1},loadingProgressBar:{position:"relative",height:8,width:"100%",borderRadius:999,backgroundColor:"primarySoftSurface",overflow:"hidden"},loadingProgressFill:e=>t=>({height:"100%",width:"".concat(e,"%"),borderRadius:999,background:"linear-gradient(90deg, ".concat(t.palette.primaryStrong," 0%, ").concat(t.palette.primarySubdued," 50%, ").
1concat(t.palette.primaryStrong," 100%)"),backgroundSize:"200% 100%",transition:"width 240ms ease-out",position:"relative",overflow:"hidden","&::after":{content:'""',position:"absolute",inset:0,background:"linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.45) 50%, transparent 100%)",animation:"vettingLoadingShimmer 1.6s linear infinite"}}),loadingProgressMeta:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"12px",fontWeight:600,color:"neutralSubdued",letterSpacing:"0.6px",textTransform:"uppercase"},loadingProgressLabel:{fontSize:"inherit",fontWeight:"inherit",color:"inherit",letterSpacing:"inherit"},loadingProgressPercent:{fontSize:"inherit",fontWeight:"inherit",letterSpacing:"inherit",color:"primaryStrong",fontVariantNumeric:"tabular-nums"},errorContainer:{display:"flex",flexDirection:"column",alignItems:"center",gap:2,minHeight:360,justifyContent:"center",textAlign:"center"},errorText:{color:"neutralSubdued"}},tZ=n(56134),tk=n(48228),tI=n(25675),tq=n.n(tI),tT=n(95488);let tB=async e=>(await y.v_("user/vetting-questionnaire/responses/export",e,{responseType:"blob"})).data;var tR=n(11983),tL=n(93441),tM=n(71232),tD=n(44717),tz=n(54497),tW={card:{display:"flex",alignItems:"center",gap:1.5,px:2,py:1.5,backgroundColor:"white",border:"1px solid",borderColor:"border",borderRadius:"8px",width:"100%"},fileIcon:{fontSize:"20px",color:"neutralSubdued"},details:{display:"flex",flexDirection:"column",gap:.25,flex:1,minWidth:0},label:{color:"neutralStrong"},filename:{color:"neutralSubdued",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},downloadButton:{p:"4px",color:"neutralSubdued","&:hover":{backgroundColor:"neutralSoftBorder",color:"primaryStrong"}}},tA=e=>{let{label:t,filename:n,size:r,onDownload:s,isDownloading:l=!1,testId:a}=e,{t:c}=(0,o.$G)();return(0,i.jsxs)(p.Z,{sx:tW.card,"data-testid":a,children:[(0,i.jsx)(ex.Z,{sx:tW.fileIcon}),(0,i.jsxs)(p.Z,{sx:tW.details,children:[(0,i.jsx)(g.Z,{variant:"bodyS",weight:"semibold",sx:tW.label,children:t}),n&&(0,i.jsxs)(g.Z,{variant:"bodyXS",sx:tW.filename,children:[n,void 0!==r&&" \xb7 ".concat((0,tz.E6)(r))]})]}),s&&(0,i.jsx)(eB.Z,{size:"small",onClick:s,disabled:l,sx:tW.downloadButton,"aria-label":c("download"),"data-testid":a?"".concat(a,"-download"):void 0,children:l?(0,i.jsx)(T.Z,{size:20,disabled:!0}):(0,i.jsx)(tD.Z,{fontSize:"small"})})]})},tE=n(4431),tP=n(53956),tK=n(15479),tH={fixedContainer:{position:"fixed",bottom:0,left:0,right:0,bgcolor:"white",borderTop:"1px solid",borderColor:"border",py:2,display:"flex",justifyContent:"center",zIndex:3},maxWidthContainer:{display:"flex",justifyContent:"flex-end",alignItems:"center",width:"100%",gap:2},actions:{display:"flex",flexDirection:{xs:"column",md:"row"},alignItems:"center",gap:1.5,width:{xs:"100%",md:"auto"}},actionButton:{whiteSpace:"nowrap",width:{xs:"100%",md:"auto"}},buttonIcon:{fontSize:"18px"}},tV=e=>{let{isDownloading:t,onReviewProfile:n,onDownload:r,onHeightChange:l,hideReviewProfile:a=!1}=e,{t:c}=(0,o.$G)(),{setBottomOffset:d}=(0,eU.p)(),u=(0,s.useRef)(null);return(0,s.useEffect)(()=>{let e=()=>{if(u.current){let{offsetHeight:e}=u.current;d(e),null==l||l(e)}};e();let t=new ResizeObserver(e);return u.current&&t.observe(u.current),()=>{t.disconnect(),d(0),null==l||l(0)}},[d,l]),(0,i.jsx)(p.Z,{ref:u,sx:tH.fixedContainer,children:(0,i.jsx)(eO.Z,{maxWidth:1320,sx:tH.maxWidthContainer,children:(0,i.jsxs)(p.Z,{sx:tH.actions,children:[!a&&(0,i.jsx)(el.Z,{variant:"outlined",endIcon:(0,i.jsx)(tZ.Z,{sx:tH.buttonIcon}),onClick:n,sx:tH.actionButton,"data-testid":"vetting-detail-review-profile",children:c("licensee-vetting.detail-open-licensee-profile")}),(0,i.jsx)(el.Z,{variant:"contained",startIcon:t?(0,i.jsx)(T.Z,{disabled:!0,size:16}):(0,i.jsx)(tD.Z,{sx:tH.buttonIcon}),onClick:r,disabled:t,sx:tH.actionButton,"data-testid":"vetting-detail-download",children:c("licensee-vetting.detail-download-response")})]})})})},tO=n(54763),t_=n(5307);let tU=async e=>(await y.v_("user/vetting-questionnaire/responses/status",e)).data;var tN=n(25895);let tF={awaiting_review:"infoStrong",approved:"successStrong",declined:"dangerStrong"};var tQ={trigger:{display:"inline-flex",alignItems:"center",gap:.75,border:"1px solid",borderColor:"border",borderRadius:"8px",backgroundColor:"white",px:1.25,py:.75,fontSize:"14px",fontWeight:600,color:"neutralStrong",cursor:"pointer",whiteSpace:"nowrap","&:disabled":{cursor:"default",opacity:.6}},staticTrigger:{display:"inline-flex",alignItems:"center",gap:.75,border:"1px solid",borderColor:"border",borderRadius:"8px",backgroundColor:"white",px:1.25,py:.75,fontSize:"14px",fontWeight:600,color:"neutralStrong",whiteSpace:"nowrap"},chevron:{fontSize:"16px",color:"neutralSubdued"},dot:e=>({width:"8px",height:"8px",borderRadius:"50%",flexShrink:0,backgroundColor:tF[e]}),menuPaper:{mt:"4px",minWidth:"172px",border:"1px solid",borderColor:"border",boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.1)"},menuHeader:{px:2,pt:1.5,pb:.5,fontSize:"14px",color:"neutralSubdued"},menuItem:e=>({display:"flex",alignItems:"center",gap:1,fontSize:"14px",color:"neutralStrong",py:1,px:2,backgroundColor:e?"primarySoftSurface":"transparent","&:hover":{backgroundColor:e?"primarySoftSurface":void 0}}),menuItemLabel:{flex:1}};let tG={awaiting_review:"licensee-vetting.status-awaiting-review",approved:"licensee-vetting.status-approved",declined:"licensee-vetting.status-declined"},tX=["awaiting_review","approved","declined"];var t$=e=>{let{responseId:t,status:n,static:r=!1}=e,{t:l}
1=(0,o.$G)(),a=(0,f.NL)(),[c,d]=(0,s.useState)(null),u=(0,tN.g)(!!c),{mutate:x,isLoading:g}=(0,tk.D)({mutationFn:e=>tU({responseId:t,status:e}),onSuccess:()=>{a.invalidateQueries({queryKey:[C.s]})},onError:()=>{(0,b.Am)((0,i.jsx)(D.Z,{type:"error",message:l("licensee-vetting.detail-status-update-error")}))}}),h=e=>{d(null),e!==n&&x(e)};return r?(0,i.jsxs)(p.Z,{sx:tQ.staticTrigger,"data-testid":"vetting-status-menu-trigger",children:[(0,i.jsx)(p.Z,{sx:tQ.dot(n)}),l(tG[n])]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(p.Z,{component:"button",type:"button",sx:tQ.trigger,disabled:g,onClick:e=>d(e.currentTarget),"data-testid":"vetting-status-menu-trigger",children:[(0,i.jsx)(p.Z,{sx:tQ.dot(n)}),l(tG[n]),(0,i.jsx)(eY.Z,{sx:tQ.chevron})]}),(0,i.jsxs)(tO.Z,{action:u,anchorEl:c,open:!!c,onClose:()=>d(null),marginThreshold:null,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:tQ.menuPaper}},children:[(0,i.jsx)(p.Z,{sx:tQ.menuHeader,children:l("licensee-vetting.detail-set-status")}),tX.map(e=>(0,i.jsxs)(t_.Z,{sx:tQ.menuItem(e===n),onClick:()=>h(e),"data-testid":"vetting-status-option-".concat(e),children:[(0,i.jsx)(p.Z,{sx:tQ.dot(e)}),(0,i.jsx)(p.Z,{sx:tQ.menuItemLabel,children:l(tG[e])})]},e))]})]})},tY={root:{display:"flex",flexDirection:"column",gap:2},topBar:{display:"flex",flexDirection:{xs:"column",md:"row"},alignItems:{xs:"stretch",md:"center"},justifyContent:"space-between",gap:1.5},backLink:{display:"inline-flex",alignItems:"center",gap:.5,alignSelf:{xs:"flex-start",md:"flex-end"},fontWeight:600,textDecoration:"none","&:hover":{textDecoration:"none"}},backIcon:{fontSize:"20px"},loader:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"282px"},headerSection:{pb:3,display:"flex",flexDirection:"column",gap:2.5},headerTop:{display:"flex",flexDirection:{xs:"column",md:"row"},alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",gap:3},identity:{display:"flex",alignItems:"center",gap:1.5,minWidth:0},name:{fontSize:"22px",fontWeight:600,color:"neutralStrong",lineHeight:1.2,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},headerActions:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:1,flexShrink:0},scopeRow:{display:"flex",flexWrap:"wrap",alignItems:"flex-start",gap:3},scopeGroup:{display:"flex",flexDirection:"column",gap:.75},scopeLabel:{fontSize:"14px",fontWeight:600,color:"neutralSubdued",letterSpacing:"0.04em"},scopeValue:{display:"flex",alignItems:"center",minHeight:"28px",fontSize:"14px",color:"neutralStrong"},chips:{display:"flex",flexWrap:"wrap",gap:.75},chip:{display:"inline-flex",alignItems:"center",fontSize:"13px",fontWeight:500,color:"neutralStrong",backgroundColor:"neutralSoftSurface",borderRadius:"8px",px:1,py:"4px",whiteSpace:"nowrap"},detailBody:{display:"flex",flexDirection:"column"},section:{py:3,"&:last-child":{pb:0}},sectionDivider:{borderColor:"border"},sectionTitle:{fontSize:"16px",fontWeight:600,color:"neutralStrong"},sectionSubtitle:{fontSize:"14px",color:"neutralSubdued",mb:2},summaryParagraph:{fontSize:"14px",color:"neutralStrong",lineHeight:1.6,mt:1.5},answerGroup:{mt:2,p:2.5,border:"1px solid",borderColor:"border",borderRadius:"12px","&:first-of-type":{mt:0}},groupTitle:{fontSize:"14px",fontWeight:600,color:"neutralSubdued",letterSpacing:"0.04em",mb:2},question:{mb:2.5,"&:last-of-type":{mb:0}},fileList:{display:"flex",flexDirection:"column",gap:1,mt:1.5,maxWidth:"420px"},questionText:{fontSize:"14px",fontWeight:600,color:"neutralStrong",mb:.75},answerList:{display:"flex",flexDirection:"column",gap:.5,pl:.5},answerRow:{display:"flex",gap:.75,fontSize:"14px",color:"neutralStrong",lineHeight:1.5},answerBullet:{color:"neutralSubdued",flexShrink:0},verifiedBadge:{flexShrink:0},scoredList:{display:"flex",flexDirection:"column",gap:2.5,mt:2},scoredRow:{display:"flex",alignItems:"flex-start",gap:1.5},scoredRowBody:{display:"flex",flexDirection:"column",gap:.75,minWidth:0},openProfileButton:{mt:2.5,whiteSpace:"nowrap"},openProfileIcon:{fontSize:"18px"}
1,matchedCriterion:{display:"flex",alignItems:"flex-start",gap:1.5,mt:1.5,p:2,backgroundColor:"white",border:"1px solid",borderColor:"border",borderRadius:"12px"},matchedCriterionBody:{display:"flex",flexDirection:"column",gap:.5,minWidth:0},matchedCriterionLabel:{fontSize:"12px",fontWeight:600,color:"neutralSubdued",letterSpacing:"0.04em",textTransform:"uppercase"},matchedCriterionText:{fontSize:"14px",color:"neutralStrong",lineHeight:1.5}};let tJ=["red","yellow","green"],t0=e=>{var t,n;return(null!==(n=null===(t=e.scoring)||void 0===t?void 0:t.results)&&void 0!==n?n:[]).filter(e=>null!==e.flag)},t1=e=>{let t={red:0,yellow:0,green:0};return t0(e).forEach(e=>{t[e.flag]+=1}),t},t2=e=>tJ.some(t=>e[t]>0),t5=e=>{let t=new Map,n=null==e?void 0:e.sections;if(!Array.isArray(n))return t;let i=e=>null==e?void 0:e.forEach(e=>{var n,i,r,o;let s=null==e?void 0:null===(n=e.scoring)||void 0===n?void 0:n.criteria;(null==e?void 0:e.uuid)&&s&&t.set(e.uuid,{red:null!==(i=s.red)&&void 0!==i?i:null,yellow:null!==(r=s.yellow)&&void 0!==r?r:null,green:null!==(o=s.green)&&void 0!==o?o:null})});return n.forEach(e=>{var t;i(null==e?void 0:e.questions),null==e||null===(t=e.subSections)||void 0===t||t.forEach(e=>i(null==e?void 0:e.questions))}),t};var t3={display:"flex",alignItems:"center",gap:.5},t6=e=>{let{counts:t,testId:n}=e;return(0,i.jsx)(p.Z,{sx:t3,"data-testid":n,children:tJ.filter(e=>t[e]>0).map(e=>(0,i.jsx)(eS,{color:e,label:t[e],testId:n?"".concat(n,"-").concat(e):void 0},e))})};let t8={general_questions:"general",category_specific_questions:"category",territory_specific_questions:"territory"},t4=e=>Array.from(new Set(e)),t7=e=>{let t=[],n=new Map;return e.forEach(e=>{var i;let r=null!==(i=t8[e.sectionKey])&&void 0!==i?i:"general",o="general"===r?"general":"".concat(r,":").concat(e.subSectionKey),s=n.get(o);s||(s={key:o,type:r,subSectionName:e.subSectionName,records:[]},n.set(o,s),t.push(s)),s.records.push(e)}),t};var t9=e=>{var t,n,r,l,a,c,u,x,m,f,y,S,w,j,Z;let{responseId:k,onBack:I,onActionBarHeightChange:q,backLabel:L,preview:M=!1}=e,{t:z}=(0,o.$G)(),[W,A]=s.useState(null),E=async(e,t)=>{A(t);try{await (0,tK.$K)(e)}catch(e){(0,b.Am)((0,i.jsx)(D.Z,{type:"error",message:z("licensee-vetting.detail-download-error")}))}finally{A(null)}},P=(e,t)=>{let n="".concat(t,"-").concat(e.attachmentUuid);return(0,i.jsx)(tA,{label:e.fileLabel,filename:e.filenameOriginal,size:e.size,onDownload:()=>E(e,n),isDownloading:W===n,testId:"vetting-response-file-".concat(e.attachmentUuid)},e.attachmentUuid)},K=e=>"category"===e.type?z("licensee-vetting.detail-category-group",{name:e.subSectionName}):"territory"===e.type?z("licensee-vetting.detail-territory-group",{name:e.subSectionName}):z("licensee-vetting.detail-general-group"),{data:H,isLoading:V}=(0,v.a)({queryKey:[C.s,"detail",k],queryFn:()=>(0,C.W)({responseId:k})}),O=null==H?void 0:null===(t=H.responses)||void 0===t?void 0:t[0],{showLicenseeVerificationCapabilities:_}=(0,tE.ND)(),{data:U}=(0,v.a)({queryKey:[tT.t,null==O?void 0:O.licenseeUserUuid],queryFn:()=>(0,tT.o)(null==O?void 0:O.licenseeUserUuid),enabled:_&&!!(null==O?void 0:O.licenseeUserUuid)}),N=_&&!!(null==U?void 0:U.verified_user)&&!!(null==U?void 0:null===(n=U.roles)||void 0===n?void 0:n.includes(d.vX.LICENSEE)),{mutate:F,isLoading:Q}=(0,tk.D)({mutationFn:()=>tB({responseId:k}),onSuccess:e=>{var t;let n=(null!==(t=null==O?void 0:O.licenseeName)&&void 0!==t?t:k).replace(/[^\x20-\x7E]/g,"-").replace(/[/\\?%*:|"<>]/g,"-");(0,tK.Sv)("","Vetting-Response-".concat(n,".pdf"),e)},onError:()=>{(0,b.Am)((0,i.jsx)(D.Z,{type:"error",message:z("licensee-vetting.detail-download-error")}))}}),G=(0,i.jsx)(p.Z,{sx:tY.topBar,children:(0,i.jsxs)(R.Z,{variant:"secondary",onClick:I,sx:tY.backLink,"data-testid":"vetting-detail-back",children:[(0,i.jsx)(tc.Z,{sx:tY.backIcon}),null!=L?L:z("licensee-vetting.detail-back")]})});if(V)return(0,i.jsxs)(p.Z,{sx:tY.root,children:[G,(0,i.jsx)(p.Z,{sx:tY.loader,children:(0,i.jsx)(T.Z,{})})]});if(!O)return(0,i.jsxs)(p.Z,{sx:tY.root,children:[G,(0,i.jsx)(B.Z,{borderless:!0,icon:(0,i.jsx)(tP.Z,{}),title:z("licensee-vetting.detail-not-found-title"),description:z("licensee-vetting.detail-not-found-description")})]});let X=null!==(x=O.licenseeName)&&void 0!==x?x:z("licensee-vetting.detail-unknown-licensee"),$=t4(null!==(m=null===(r=O.summary)||void 0===r?void 0:r.productCategories)&&void 0!==m?m:[]),Y=t4(null!==(f=null===(l=O.summary)||void 0===l?void 0:l.territories)&&void 0!==f?f:[]),J=t7(null!==(y=O.answerRecords)&&void 0!==y?y:[]),ee=t1(O),et=new Map;null===(c=O.scoring)||void 0===c||null===(a=c.results)||void 0===a||a.forEach(e
1=>{e.flag&&et.set(e.questionUuid,e.flag)});let en=t5(O.questionnaireSnapshot),ei=null!==(S=O.answerRecords)&&void 0!==S?S:[],er=tJ.flatMap(e=>ei.filter(t=>et.get(t.questionUuid)===e).map(t=>({record:t,flag:e}))),eo=null!==(w=O.files)&&void 0!==w?w:[],es=new Map;eo.forEach(e=>{var t;let n=null!==(t=es.get(e.questionUuid))&&void 0!==t?t:[];n.push(e),es.set(e.questionUuid,n)});let ea=[...eo].sort((e,t)=>e.fileLabel.localeCompare(t.fileLabel)||e.filenameOriginal.localeCompare(t.filenameOriginal)),ec=(null!==(j=null===(u=O.summary)||void 0===u?void 0:u.executiveSummary)&&void 0!==j?j:"").split(/\n\s*\n/).map(e=>e.trim()).filter(Boolean),ed=()=>window.open("/company/".concat(O.licenseeUserUuid),"_blank","noopener,noreferrer");return(0,i.jsxs)(p.Z,{sx:tY.root,children:[G,(0,i.jsxs)(p.Z,{sx:tY.detailBody,children:[(0,i.jsxs)(p.Z,{sx:tY.headerSection,children:[(0,i.jsxs)(p.Z,{sx:tY.headerTop,children:[(0,i.jsxs)(p.Z,{sx:tY.identity,children:[(0,i.jsx)(tR.Z,{src:null!==(Z=O.licenseeLogoUrl)&&void 0!==Z?Z:void 0,size:"44px"}),(0,i.jsx)(g.Z,{sx:tY.name,children:X}),t2(ee)&&(0,i.jsx)(t6,{counts:ee,testId:"vetting-detail-flags"}),N&&(0,i.jsx)(tM.Z,{title:z("verification-badge-tooltip"),children:(0,i.jsx)(tq(),{src:"/images/Brand/Verified.svg",alt:z("alt-text.verified-icon"),width:20,height:20,style:tY.verifiedBadge,"data-testid":"vetting-detail-verified-badge"})})]}),"in_progress"!==O.status&&(0,i.jsx)(p.Z,{sx:tY.headerActions,children:(0,i.jsx)(t$,{responseId:O.id,status:O.status,static:M})})]}),(0,i.jsxs)(p.Z,{sx:tY.scopeRow,children:[(0,i.jsxs)(p.Z,{sx:tY.scopeGroup,children:[(0,i.jsx)(g.Z,{sx:tY.scopeLabel,children:z("licensee-vetting.detail-submitted")}),(0,i.jsx)(tL.Z,{date:O.createdAt,sx:tY.scopeValue})]}),$.length>0&&(0,i.jsxs)(p.Z,{sx:tY.scopeGroup,children:[(0,i.jsx)(g.Z,{sx:tY.scopeLabel,children:z("licensee-vetting.detail-categories")}),(0,i.jsx)(p.Z,{sx:tY.chips,children:$.map(e=>(0,i.jsx)(p.Z,{sx:tY.chip,children:e},e))})]}),Y.length>0&&(0,i.jsxs)(p.Z,{sx:tY.scopeGroup,children:[(0,i.jsx)(g.Z,{sx:tY.scopeLabel,children:z("licensee-vetting.detail-territories")}),(0,i.jsx)(p.Z,{sx:tY.chips,children:Y.map(e=>(0,i.jsx)(p.Z,{sx:tY.chip,children:e},e))})]})]})]}),(ec.length>0||er.length>0||J.length>0)&&(0,i.jsx)(h.Z,{sx:tY.sectionDivider}),ec.length>0&&(0,i.jsxs)(p.Z,{sx:tY.section,children:[(0,i.jsx)(g.Z,{sx:tY.sectionTitle,children:z("licensee-vetting.detail-interview-summary")}),ec.map((e,t)=>(0,i.jsx)(g.Z,{sx:tY.summaryParagraph,children:e},"".concat(t,"-").concat(e)))]}),ec.length>0&&er.length>0&&(0,i.jsx)(h.Z,{sx:tY.sectionDivider}),er.length>0&&(0,i.jsxs)(p.Z,{sx:tY.section,"data-testid":"vetting-scoring-criteria",children:[(0,i.jsx)(g.Z,{sx:tY.sectionTitle,children:z("licensee-vetting.detail-scoring-criteria")}),(0,i.jsx)(p.Z,{sx:tY.scoredList,children:er.map(e=>{let{record:t,flag:n}=e;return(0,i.jsxs)(p.Z,{sx:tY.scoredRow,children:[(0,i.jsx)(eS,{color:n,label:z("licensee-vetting.flag-".concat(n)),testId:"vetting-scored-flag-".concat(t.questionUuid)}),(0,i.jsxs)(p.Z,{sx:tY.scoredRowBody,children:[(0,i.jsx)(g.Z,{sx:tY.questionText,children:t.question}),(0,i.jsx)(p.Z,{sx:tY.answerList,children:t.answers.map((e,n)=>(0,i.jsxs)(p.Z,{sx:tY.answerRow,children:[(0,i.jsx)(p.Z,{component:"span",sx:tY.answerBullet,children:"›"}),e]},"".concat(t.questionUuid,"-").concat(n)))})]})]},t.questionUuid)})}),!M&&(0,i.jsx)(el.Z,{variant:"outlined",endIcon:(0,i.jsx)(tZ.Z,{sx:tY.openProfileIcon}),onClick:ed,sx:tY.openProfileButton,"data-testid":"vetting-detail-open-profile",children:z("licensee-vetting.detail-open-licensee-profile")})]}),(ec.length>0||er.length>0)&&J.length>0&&(0,i.jsx)(h.Z,{sx:tY.sectionDivider}),J.length>0&&(0,i.jsxs)(p.Z,{sx:tY.section,children:[(0,i.jsx)(g.Z,{sx:tY.sectionTitle,children:z("licensee-vetting.detail-licensee-answers")}),(0,i.jsx)(g.Z,{sx:tY.sectionSubtitle,children:z("licensee-vetting.detail-in-their-own-words")}),J.map(e=>(0,i.jsxs)(p.Z,{sx:tY.answerGroup,children:[(0,i.jsx)(g.Z,{sx:tY.groupTitle,children:K(e)}),e.records.map(e=>{var t,n;let r=null!==(n=es.get(e.questionUuid))&&void 0!==n?n:[],o=et.get(e.questionUuid),s=o?null===(t=en.get(e.questionUuid))||void 0===t?void 0:t[o]:null;return(0,i.jsxs)(p.Z,{sx:tY.question,children:[(0,i.jsx)(g.Z,{sx:tY.questionText,children:e.question}),(0,i.jsx)(p.Z,{sx:tY.answerList,children:e.answers.map((t,n)=>(0,i.jsxs)(p.Z,{sx:tY.answerRow,children:[(0,i.jsx)(p.Z,{component:"span",sx:tY.answerBullet,children:"›"}),t]},"".concat(e.questionUuid,"-").concat(n)))}),r.length>0&&(0,i.jsx)(p.Z,{sx:tY.fileList,children:r.map(e=>P(e,"question"))}),o&&s&&(0,i.jsxs)(p.Z,{sx:tY.matchedCriterion,"data-testid":"vetting-matched-criterion-".concat(e.questionUuid),children:[(0,i.jsx)(eS,{color:o,label:z("licensee-vetting.flag-".concat(o))}),(0,i.jsxs)(p.Z,{sx:tY.matchedCriterionBody,children:[(0,i.jsx)(g.Z,{sx:tY.matchedCriterionLabel,children:z("licensee-vetting.detail-matched-criterion")}),(0,i.jsx)(g.Z,{sx:tY.matchedCriterionText,children:s})]})]})]},e.questionUuid)})]},e.key))]}),ea.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(h.Z,{sx:tY.sectionDivider}),(0,i.jsxs)(p.Z,{sx:tY.section,"data-testid":"vetting-attached-documents",children:[(0,i.jsx)(g.Z,{sx:tY.sectionTitle,children:z("licensee-vetting.detail-attached-documents")}),(0,i.jsx)(p.Z,{sx:tY.fileList,children:ea.map(e=>P(e,"attached"))})]})]})]}),(0,i.jsx)(tV,{isDownloading:Q,onReviewProfile:ed,onDownload:()=>F(),onHeightChange:q,hideReviewProfile:M})]})};let ne=["licensee-vetting.summary-loading-1","licensee-vetting.summary-loading-2","licensee-vetting.summary-loading-3","licensee-vetting.summary-loading-4","licensee-vetting.summary-loading-5","licensee-vetting.summary-loading-6","licensee-vetting.summary-loading-7","licensee-vetting.summary-loading-8","licensee-vetting.summary-loading-9","licensee-vetting.summary-loading-10","licensee-vetting.summary-loading-11","licensee-vetting.summary-loading-12","licensee-vetting.summary-loading-13","licensee-vetting.summary-loading-14"];var nt=e=>{let{conversationUuid:t,responseId:n,onBack:r}=e,{t:l}
1=(0,o.$G)(),[a,c]=(0,s.useState)("loading"),[d,u]=(0,s.useState)(0),[x,h]=(0,s.useState)(0),m=(0,s.useRef)(null),f=async()=>{c("loading"),u(0);try{await tS(t),u(100),c("ready")}catch(e){c("error")}};if((0,s.useEffect)(()=>{f()},[t]),(0,s.useEffect)(()=>{if("loading"!==a){m.current=null;return}null===m.current&&(m.current=Date.now());let e=()=>{var e;let t=null!==(e=m.current)&&void 0!==e?e:Date.now(),n=Math.min((1-(1-Math.min((Date.now()-t)/15e3,1))**2)*90,90);u(e=>n>e?n:e)};e();let t=setInterval(e,150);return()=>clearInterval(t)},[a]),(0,s.useEffect)(()=>{if("loading"!==a)return;h(Math.floor(Math.random()*ne.length));let e=setInterval(()=>{h(e=>{let t=e;for(;t===e;)t=Math.floor(Math.random()*ne.length);return t})},1800);return()=>clearInterval(e)},[a]),"ready"===a)return(0,i.jsx)(t9,{responseId:n,onBack:r,backLabel:l("licensee-vetting.summary-back"),preview:!0});if("error"===a)return(0,i.jsxs)(p.Z,{sx:tC.errorContainer,"data-testid":"vetting-summary-error",children:[(0,i.jsx)(g.Z,{variant:"bodyS",sx:tC.errorText,children:l("licensee-vetting.summary-error")}),(0,i.jsx)(el.Z,{variant:"outlined",onClick:f,children:l("retry")}),(0,i.jsx)(R.Z,{variant:"secondary",onClick:r,children:l("licensee-vetting.summary-back")})]});let v=Math.min(Math.max(d,0),100);return(0,i.jsxs)(p.Z,{sx:tC.loadingContainer,"data-testid":"vetting-summary-loading",children:[(0,i.jsx)(p.Z,{sx:tC.loadingIconWrapper,children:(0,i.jsx)(tw.Z,{sx:tC.loadingIcon})}),(0,i.jsxs)(p.Z,{sx:tC.loadingTextBlock,children:[(0,i.jsx)(g.Z,{variant:"headingL",md:"headingXL",sx:tC.loadingTitle,children:l("licensee-vetting.summary-generating")}),(0,i.jsxs)(g.Z,{variant:"bodyS",weight:"medium",sx:tC.loadingMessage,children:[l(ne[x]),"…"]},x)]}),(0,i.jsxs)(p.Z,{sx:tC.loadingProgressBlock,children:[(0,i.jsx)(p.Z,{sx:tC.loadingProgressBar,children:(0,i.jsx)(p.Z,{sx:tC.loadingProgressFill(v)})}),(0,i.jsxs)(p.Z,{sx:tC.loadingProgressMeta,children:[(0,i.jsx)(g.Z,{component:"span",sx:tC.loadingProgressLabel,children:"Negosh AI"}),(0,i.jsxs)(g.Z,{component:"span",sx:tC.loadingProgressPercent,children:[Math.round(v),"%"]})]})]})]})};let nn=e=>({uuid:e.uuid,message:e.message,isUser:!1});var ni=e=>{let{licensorUserUuid:t,onBack:n}=e,{t:r}
1=(0,o.$G)(),[l,a]=(0,s.useState)({kind:"launching"}),c=async()=>{a({kind:"launching"});try{var e;let n=await (0,ta.Q)({conversationName:"licensee-vetting",conversationType:"AILicenseeVetting",licenseeVettingMode:"testDrive",licensorUserUuid:t});if(!n.initialAiMessage)throw Error("Missing initial AI message");a({kind:"interview",conversationUuid:n.uuid,initialMessage:nn(n.initialAiMessage),responseId:n.vettingQuestionnaireResponseId,initialVettingQuestion:null!==(e=n.currentVettingQuestion)&&void 0!==e?e:null})}catch(e){a({kind:"error"})}};return((0,s.useEffect)(()=>{c()},[t]),"summary"===l.kind)?(0,i.jsx)(nt,{conversationUuid:l.conversationUuid,responseId:l.responseId,onBack:n}):(0,i.jsxs)(p.Z,{sx:ty.root,children:[(0,i.jsxs)(R.Z,{variant:"secondary",onClick:n,sx:ty.backButton,"data-testid":"vetting-preview-back-button",children:[(0,i.jsx)(tc.Z,{sx:ty.backIcon}),r("licensee-vetting.preview-back")]}),(0,i.jsxs)(p.Z,{sx:ty.heading,children:[(0,i.jsx)(g.Z,{variant:"headingM",sx:ty.title,children:r("licensee-vetting.preview-title")}),(0,i.jsx)(g.Z,{variant:"bodyS",sx:ty.subtitle,children:r("licensee-vetting.preview-subtitle")})]}),"launching"===l.kind&&(0,i.jsx)(p.Z,{sx:ty.loadingWrapper,children:(0,i.jsx)(T.Z,{})}),"error"===l.kind&&(0,i.jsxs)(p.Z,{sx:ty.errorWrapper,children:[(0,i.jsx)(g.Z,{variant:"bodyS",sx:ty.errorText,children:r("licensee-vetting.preview-error")}),(0,i.jsx)(el.Z,{variant:"outlined",onClick:c,"data-testid":"vetting-preview-retry-button",children:r("licensee-vetting.preview-retry")})]}),"interview"===l.kind&&(0,i.jsx)(tb,{conversationUuid:l.conversationUuid,initialMessage:l.initialMessage,onComplete:()=>{a(e=>"interview"===e.kind&&e.responseId?{kind:"summary",conversationUuid:e.conversationUuid,responseId:e.responseId}:e)},responseId:l.responseId,initialVettingQuestion:l.initialVettingQuestion})]})},nr=n(23279),no=n.n(nr),ns=n(1103),nl=n(51902),na=n(5454),nc=n(49360),nd=n(77245),nu=n(13703),nx=n(54934),np=n(65963),ng=n(14223),nh=n(95687),nm=n(67421),nf=n(50002),nv={width:"100%",overflowX:"auto"},nb={borderBottom:"1px solid",borderColor:"border",py:1.5,whiteSpace:"nowrap"},ny=e=>({"&.MuiTableSortLabel-icon":{opacity:.5,stroke:e.palette.neutralSubdued}}),nS={cursor:"pointer","&.MuiTableRow-root:hover":{backgroundColor:"neutralSoftSurface"},"&.MuiTableRow-root .MuiTableCell-root":{borderBottom:"1px solid",borderColor:"border"},"&.MuiTableRow-root:last-of-type .MuiTableCell-root":{borderBottom:"none"}},nw={py:1.5},nj={display:"flex",alignItems:"center",gap:1.5,minWidth:0},nC={color:"neutralStrong"},nZ={fontSize:"14px",color:"neutralSubdued",whiteSpace:"nowrap"};let nk={in_progress:{color:"neutralStrong",backgroundColor:"neutralSoftSurface"},awaiting_review:{color:"infoStrong",backgroundColor:"infoSoftSurface"},approved:{color:"successStrong",backgroundColor:"successSoftSurface"},declined:{color:"dangerStrong",backgroundColor:"dangerSoftSurface"}};var nI=e=>({display:"inline-flex",alignItems:"center",width:"fit-content",fontSize:"12px",fontWeight:600,borderRadius:"8px",px:1,py:"4px",whiteSpace:"nowrap",...nk[e]});let nq={in_progress:"licensee-vetting.status-in-progress",awaiting_review:"licensee-vetting.status-awaiting-review",approved:"licensee-vetting.status-approved",declined:"licensee-vetting.status-declined"};var nT=e=>{let{status:t,testId:n}=e,{t:r}=(0,o.$G)();return(0,i.jsx)(p.Z,{component:"span",sx:nI(t),"data-testid":n,children:r(nq[t])})},nB=e=>{let{responses:t,sortField:n,sortDirection:r,onSort:o,onSelectResponse:s}=e,l=(0,nc.Z)(),{t:a}=(0,nm.$G)(),c=[{id:"licenseeName",align:"left",label:a("licensee-vetting.column-licensee")},{id:"flags",align:"left",label:a("licensee-vetting.column-flags")},{id:"createdAt",align:"left",label:a("licensee-vetting.column-submitted")},{id:"status",align:"left",label:a("licensee-vetting.column-status")}];return(0,i.jsx)(p.Z,{sx:nv,children:(0,i.jsxs)(nx.Z,{children:[(0,i.jsx)(np.Z,{children:(0,i.jsx)(ng.Z,{children:c.map(e=>(0,i.jsx)(nd.Z,{align:e.align,sx:nb,sortDirection:n===e.id&&null!=r&&r,children:(0,i.jsx)(nu.Z,{active:n===e.id,direction:n===e.id&&null!=r?r:"asc",hideSortIcon:!1,IconComponent:e=>(0,i.jsx)(nf.Z,{...e,sx:ny(l)}),onClick:()=>o(e.id),children:(0,i.jsx)(g.Z,{variant:"bodyS",weight:"bold",component:"span",children:e.label})})},e.id))})}
1),(0,i.jsx)(nh.Z,{children:t.map(e=>{var t;let n=t1(e);return(0,i.jsxs)(ng.Z,{sx:nS,onClick:()=>s(e.id),"data-testid":"vetting-response-row-".concat(e.id),children:[(0,i.jsx)(nd.Z,{align:"left",sx:nw,children:(0,i.jsxs)(p.Z,{sx:nj,children:[(0,i.jsx)(tR.Z,{src:null!==(t=e.licenseeLogoUrl)&&void 0!==t?t:void 0,size:32}),(0,i.jsx)(g.Z,{variant:"bodyS",weight:"semibold",sx:nC,children:e.licenseeName})]})}),(0,i.jsx)(nd.Z,{align:"left",children:t2(n)&&(0,i.jsx)(t6,{counts:n,testId:"vetting-response-flags-".concat(e.id)})}),(0,i.jsx)(nd.Z,{align:"left",children:(0,i.jsx)(tL.Z,{date:e.createdAt,sx:nZ})}),(0,i.jsx)(nd.Z,{align:"left",children:(0,i.jsx)(nT,{status:e.status,testId:"vetting-response-status-".concat(e.id)})})]},e.id)})})]})})},nR={controls:{display:"flex",flexDirection:{xs:"column",md:"row"},alignItems:{xs:"stretch",md:"center"},gap:1.5,mb:2},searchContainer:{flex:1,minWidth:0},filterTabs:{width:{xs:"100%",md:"auto"},minHeight:"40px",flexShrink:0,"& .MuiTabs-flexContainer":{flexWrap:"wrap",gap:"8px"},"& .MuiTabs-scroller":{display:"flex",alignItems:"center"},"& .MuiTabs-indicator":{display:"none"}},loader:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"282px"},tableCard:{border:"1px solid",borderColor:"border",borderRadius:"12px",backgroundColor:"white",overflow:"hidden"},paginationContainer:{paddingTop:"12px",paddingBottom:{xs:"0px",md:"12px"}}};let nL=[{value:"all",key:"licensee-vetting.filter-all"},{value:"awaiting_review",key:"licensee-vetting.filter-awaiting-review"},{value:"approved",key:"licensee-vetting.filter-approved"},{value:"declined",key:"licensee-vetting.filter-declined"}];var nM=e=>{var t,n,l;let a,{totalResponsesCount:c,onViewingResponseChange:d,onActionBarHeightChange:u}=e,{t:x}=(0,o.$G)(),g=(0,r.useRouter)(),h=g.query.userUuid,m=g.query.responseId,f=Array.isArray(m)&&null!==(t=m[0])&&void 0!==t?t:null,b="/my-company/".concat(h,"/licensee-vetting"),[y,S]=(0,s.useState)("all"),[w,j]=(0,s.useState)(""),[Z,k]=(0,s.useState)(""),[I,q]=(0,s.useState)(void 0),[R,L]=(0,s.useState)(void 0),[M,D]=(0,s.useState)(1);(0,s.useEffect)(()=>{D(1)},[y,Z,I,R]),(0,s.useEffect)(()=>{null==d||d(!!f)},[f,d]),(0,s.useEffect)(()=>()=>null==d?void 0:d(!1),[d]);let z=(0,s.useMemo)(()=>no()(e=>k(e),na.qh),[]);(0,s.useEffect)(()=>()=>z.cancel(),[z]);let{data:W,isLoading:A,isFetching:E}=(0,v.a)({queryKey:[C.s,y,Z,I,R,M],queryFn:()=>(0,C.W)({search:Z||void 0,optionalStatusFilter:"all"===y?void 0:[y],optionalSortField:I,optionalSortDirection:R,take:10,skip:(M-1)*10}),keepPreviousData:!0,staleTime:0}),P=null!==(n=null==W?void 0:W.responses)&&void 0!==n?n:[],K=null!==(l=null==W?void 0:W.responseCount)&&void 0!==l?l:0,H=Math.max(1,Math.ceil(K/10));(0,s.useEffect)(()=>{!E&&M>H&&D(H)},[E,M,H]);let V=(!!Z||"all"!==y)&&(null!=c?c:0)>0,O=A||E&&0===P.length,_=!O&&0===P.length,U=V?(0,i.jsx)(B.Z,{borderless:!0,icon:(0,i.jsx)(G.Z,{}),title:x("licensee-vetting.no-results-title"),description:x("licensee-vetting.no-results-description")}):(0,i.jsx)(B.Z,{borderless:!0,icon:(0,i.jsx)(tP.Z,{}),title:x("licensee-vetting.no-responses-title"),description:x("licensee-vetting.no-responses-description")});return(a=O?(0,i.jsx)(p.Z,{sx:nR.loader,children:(0,i.jsx)(T.Z,{})}):_?U:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(p.Z,{sx:nR.tableCard,children:(0,i.jsx)(nB,{responses:P,sortField:I,sortDirection:R,onSort:e=>{if(I===e){L(e=>"asc"===e?"desc":"asc");return}q(e),L("asc")},onSelectResponse:e=>g.push("".concat(b,"/").concat(e),void 0,{shallow:!0})})}),K>10?(0,i.jsx)(p.Z,{sx:nR.paginationContainer,children:(0,i.jsx)(nl.Z,{totalPages:H,selectedPage:M,onPageClick:e=>D(e)})}):null]}),f)?(0,i.jsx)(t9,{responseId:f,onBack:()=>g.push(b,void 0,{shallow:!0}),onActionBarHeightChange:u}):(0,i.jsxs)(p.Z,{children:[(0,i.jsxs)(p.Z,{sx:nR.controls,children:[(0,i.jsx)(p.Z,{sx:nR.searchContainer,children:(0,i.jsx)(Q.Z,{label:x("licensee-vetting.search-responses"),value:w,onChange:e=>{j(e),z(e)}})}),(0,i.jsx)(ns.p,{value:y,onChange:(e,t)=>
1S(t),sx:nR.filterTabs,children:nL.map(e=>(0,i.jsx)(ns.V,{value:e.value,label:x(e.key),"data-testid":"vetting-filter-".concat(e.value)},e.value))})]}),a]})},nD={topBar:{display:"flex",flexDirection:{xs:"column-reverse",md:"row"},alignItems:{xs:"stretch",md:"flex-start"},justifyContent:"space-between",gap:2,width:"100%",mb:"24px"},topBarHeading:{display:"flex",flexDirection:"column",gap:1,minWidth:0},title:{color:"neutralStrong"},description:{color:"neutralSubdued",maxWidth:720},builderContent:{display:"flex",flexDirection:"column",flex:1,minHeight:0},tabsContainer:{width:"100%",mb:3},tabDivider:{border:".5px solid",borderColor:"border",mt:"-9.25px",mb:"2px"},tabContent:{width:"100%"},helpAlert:{mb:2.5},helpStrong:{fontWeight:600},alertIcon:{color:"infoStrong"},questionList:{display:"flex",flexDirection:"column",gap:1.5},addTrigger:{display:"flex",alignItems:"center",gap:1,width:"100%",px:2,py:1.5,backgroundColor:"primarySoftSurface",border:"none",borderRadius:"8px",cursor:"pointer",color:"primaryStrong",fontSize:"14px",fontWeight:600,textAlign:"left",transition:"background-color 0.15s","&:hover":{backgroundColor:"primarySoftBorder"}},loadingWrapper:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:320},copyLinkRow:{display:"flex",justifyContent:"center",mt:"auto"},copyLinkTooltipAnchor:{display:"inline-flex"},copyLink:{display:"inline-flex",alignItems:"center",gap:.5,whiteSpace:"nowrap"},copyLinkIcon:{fontSize:"20px"},pauseLinkRow:{display:"flex",justifyContent:"center",mt:1.5},pauseLink:{display:"inline-flex",alignItems:"center",gap:.5,color:"warningStrong",fontWeight:600,textDecoration:"none",whiteSpace:"nowrap","&:hover":{color:"warningStrong",textDecoration:"none"}},pauseIcon:{fontSize:"24px"},modalBody:{display:"flex",flexDirection:"column",gap:2.5},modalIntro:{color:"neutralStrong"},pointList:{display:"flex",flexDirection:"column",gap:1.5},pointRow:{display:"flex",alignItems:"flex-start",gap:1.25},pointIcon:{color:"primaryStrong",fontSize:"20px",flexShrink:0,mt:"1px"},pointText:{color:"neutralSubdued"},summaryCard:{display:"flex",flexDirection:"column",gap:1.25,backgroundColor:"neutralSoftSurface",borderRadius:"6px",p:2},summaryRow:{display:"flex",justifyContent:"space-between",alignItems:"center"},summaryLabel:{color:"neutralStrong"},summaryValue:{color:"neutralStrong"},buttonIcon:{mr:.5}};let nz=[0,1,2];var nW=e=>{var t,n,r,l,a,x;let{onActionBarHeightChange:y,initialResponseId:K}=e,{t:U}=(0,o.$G)(),N=(0,f.NL)(),{account_flags_keyboard_user:F,isLoadingStore:Q}=(0,u.Z)(),G=!!(null==F?void 0:F.includes(d.uX.ADMINISTRATOR))||!!(null==F?void 0:F.includes(d.uX.VETTING_QUESTIONNAIRE_CAN_PUBLISH)),X=!!(null==F?void 0:F.includes(d.uX.AUTHORIZED_USER))&&!F.includes(d.uX.ACCOUNT_ADMINISTRATOR),[$,Y]=(0,s.useState)(K?"responses":"builder"),[J,el]=(0,s.useState)(!1),[ea,ec]=(0,s.useState)(0),[ed,eu]=(0,s.useState)(null),[ex,ep]=(0,s.use
1State)(null),[eg,eh]=(0,s.useState)(null),[em,ef]=(0,s.useState)(new Set),[ev,eb]=(0,s.useState)(!1),[ey,eS]=(0,s.useState)(!1),[ew,ej]=(0,s.useState)(!1),[eC,eZ]=(0,s.useState)(!1),[ek,eI]=(0,s.useState)(!1),[eq,eT]=(0,s.useState)(!1),eB=!Q&&!X,{data:eR,isLoading:eL}=(0,v.a)({queryKey:[k],queryFn:I,enabled:eB}),{data:eM,isLoading:ez}=(0,v.a)({queryKey:[w],queryFn:()=>j(),enabled:eB}),{data:eW}=(0,v.a)({queryKey:[C.s,"count"],queryFn:()=>(0,C.W)(),staleTime:0}),eA=null==eW?void 0:eW.responses.length;(0,s.useEffect)(()=>{"responses"===$&&(null==y||y(0))},[$,y]),(0,s.useEffect)(()=>{"responses"===$&&N.invalidateQueries({queryKey:[C.s,"count"]})},[$,N]);let eE=(0,s.useRef)(!1);(0,s.useEffect)(()=>{Q||eE.current||(eE.current=!0,X&&Y("responses"))},[Q,X]);let eP=null==eR?void 0:eR.sections,eH=null!==(r=null!==(n=null==eM?void 0:eM.draft)&&void 0!==n?n:null==eM?void 0:eM.published)&&void 0!==r?r:null,eV=null!==(l=null==eH?void 0:eH.state)&&void 0!==l?l:null;(0,s.useEffect)(()=>{if(!eP)return;let e=ee(eP,eH);eu(e),ep(JSON.stringify(es(e))),ef(new Set(e.groups.filter(e=>e.selected||e.questions.length>0).map(e=>e.subSectionKey)))},[eP,eM]);let eO=(0,s.useMemo)(()=>{let e=new Map;return null==eP||eP.forEach(t=>{t.subSections.forEach(t=>{e.set(t.subSectionKey,t.questions)})}),e},[eP]),e_=(0,s.useMemo)(()=>{let e=new Set;return null==eP||eP.forEach(t=>{t.subSections.forEach(t=>{t.questions.forEach(t=>{e.add(t.bankQuestionKey)})})}),e},[eP]),eU=e=>!e.bankQuestionKey||!e_.has(e.bankQuestionKey),eN=(e,t)=>eu(n=>n?{groups:n.groups.map(n=>n.subSectionKey===e?t(n):n)}:n),eF=e=>ef(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),eG=e=>{eN(e.subSectionKey,e=>({...e,selected:!e.selected})),e.selected||ef(t=>new Set(t).add(e.subSectionKey))},eX=(e,t)=>eN(e,e=>({...e,questions:e.questions.filter(e=>e.key!==t)})),e$=async()=>{ed&&(await Z(es(ed)),await N.invalidateQueries({queryKey:[w]}))},eY=async()=>{if(ed&&!ev){eb(!0);try{await e$(),ej(!0)}catch(e){(0,b.Am)((0,i.jsx)(D.Z,{type:"error",message:U("licensee-vetting.save-error")}))}finally{eb(!1)}}},eJ=async()=>{if(!ey){eS(!0);try{e0&&await e$(),await S(),await N.invalidateQueries({queryKey:[w]}),eZ(!1),(0,b.Am)((0,i.jsx)(D.Z,{type:"success",message:U("licensee-vetting.publish-success")}))}catch(e){(0,b.Am)((0,i.jsx)(D.Z,{type:"error",message:U("licensee-vetting.publish-error")}))}finally{eS(!1)}}},e0=(0,s.useMemo)(()=>!!ed&&null!==ex&&JSON.stringify(es(ed))!==ex,[ed,ex]),e1=(0,s.useMemo)(()=>{if(!eP||!(null==eM?void 0:eM.draft))return!1;let e=e=>JSON.stringify(es(ee(eP,e)));return e(eM.draft)!==e(eM.published)},[eP,eM]),e2=(0,s.useMemo)(()=>ed?{general:en(ed,"general"),category:en(ed,"category"),territory:en(ed,"territory"),total:ei(ed),sections:er(ed),totalSections:eo(ed)}:{general:0,category:0,territory:0,total:0,sections:0,totalSections:0},[ed]),e5=e=>1===e?U("licensee-vetting.question-count",{number:e}):U("licensee-vetting.questions-count",{number:e}),e3=e=>(0,i.jsxs)(p.Z,{sx:nD.questionList,children:[e.questions.map(t=>(0,i.jsx)(eD,{text:t.question,fileLabel:t.fileLabel,scored:!!t.scoring,isCustom:eU(t),hasSavedVersion:!!eH,disabled:!e.selected,onRemove:()=>eX(e.subSectionKey,t.key),testId:"builder-question-".concat(t.key)},t.key)),(0,i.jsxs)(p.Z,{component:"button",type:"button",sx:nD.addTrigger,onClick:()=>eh(e),"data-testid":"add-questions-".concat(e.subSectionKey),children:[(0,i.jsx)(z.Z,{fontSize:"small"}),0===e.questions.length?U("licensee-vetting.add-questions-empty"):U("licensee-vetting.add-questions-trigger")]})]}),e8=(e,t)=>(0,i.jsxs)(p.Z,{sx:nD.modalBody,children:[t&&(0,i.jsx)(g.Z,{variant:"bodyS",sx:nD.modalIntro,children:t}),(0,i.jsx)(p.Z,{sx:nD.pointList,children:e.map(e=>(0,i.jsxs)(p.Z,{sx:nD.pointRow,children:[(0,i.jsx)(W.Z,{sx:nD.pointIcon}),(0,i.jsx)(g.Z,{variant:"bodyS",sx:nD.pointText,children:e})]},e))}),(0,i.jsxs)(p.Z,{sx:nD.summaryCard,children:[(0,i.jsxs)(p.Z,{sx:nD.summaryRow,children:[(0,i.jsx)(g.Z,{variant:"bodyM",weight:"semibold",sx:nD.summaryLabel,children:U("licensee-vetting.summary-sections")}),(0,i.jsxs)(g.Z,{variant:"bodyM",weight:"bold",sx:nD.summaryValue,children:[e2.sections," / ",e2.totalSections]})]}),(0,i.jsxs)(p.Z,{sx:nD.summaryRow,children:[(0,i.jsx)(g.Z,{variant:"bodyM",weight:"semibold",sx:nD.summaryLabel,children:U("licensee-vetting.summary-questions")}),(0,i.jsx)(g.Z,{variant:"bodyM",weight:"bold",sx:nD.summaryValue,children:e2.total})]})]})]}),e4=eL||ez||!ed;
1return eq?(0,i.jsx)(ni,{licensorUserUuid:(0,_.Z)(),onBack:()=>eT(!1)}):(0,i.jsxs)(i.Fragment,{children:[!J&&(0,i.jsxs)(p.Z,{sx:nD.topBar,children:[(0,i.jsx)(p.Z,{sx:nD.topBarHeading,children:"builder"===$?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(g.Z,{variant:"headingM",sx:nD.title,children:U("licensee-vetting.builder-title")}),(0,i.jsx)(g.Z,{variant:"bodyS",sx:nD.description,children:U("licensee-vetting.builder-description")})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(g.Z,{variant:"headingM",sx:nD.title,children:U("licensee-vetting.responses-title")}),(0,i.jsx)(g.Z,{variant:"bodyS",sx:nD.description,children:U("licensee-vetting.responses-description")})]})}),(0,i.jsx)(tl,{mode:$,onChange:Y,responsesCount:eA,responsesFirst:X})]}),"responses"===$&&(0,i.jsx)(nM,{totalResponsesCount:eA,onViewingResponseChange:el,onActionBarHeightChange:y}),"builder"===$&&X&&(0,i.jsx)(p.Z,{sx:nD.builderContent,children:(0,i.jsx)(B.Z,{borderless:!0,icon:(0,i.jsx)(H,{}),title:U("licensee-vetting.administrator-access-needed"),description:U("licensee-vetting.administrator-access-needed-desc")})}),"builder"===$&&!X&&(0,i.jsx)(p.Z,{sx:nD.builderContent,children:e4?(0,i.jsx)(p.Z,{sx:nD.loadingWrapper,children:(0,i.jsx)(T.Z,{})}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(p.Z,{sx:nD.tabsContainer,children:[(0,i.jsx)(M.P,{value:ea,onChange:(e,t)=>
1ec(t),children:nz.map(e=>(0,i.jsx)(M.O,{label:U("licensee-vetting.tab-".concat(e)),badgeCount:[e2.general,e2.category,e2.territory][e],forceActiveBadge:!0,selectedTab:ea===e,"data-testid":"vetting-tab-".concat(e)},e))}),(0,i.jsx)(h.Z,{sx:nD.tabDivider})]}),(0,i.jsxs)(p.Z,{sx:nD.tabContent,children:[0===ea&&et(ed,"general").map(e=>{var t,n;return(0,i.jsx)(e6,{title:e.subSectionName,selectedCount:e.questions.length,totalCount:null!==(n=null===(t=eO.get(e.subSectionKey))||void 0===t?void 0:t.length)&&void 0!==n?n:e.questions.length,badgeLabel:e5(e.questions.length),expanded:em.has(e.subSectionKey),onToggle:()=>eF(e.subSectionKey),testId:"section-".concat(e.subSectionKey),children:e3(e)},e.subSectionKey)}),1===ea&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(q.Z,{icon:(0,i.jsx)(P.Z,{sx:nD.alertIcon}),customVariant:"infoPrimary",sx:nD.helpAlert,children:(0,i.jsx)(L.Z,{tKey:"licensee-vetting.category-help",components:{strong:(0,i.jsx)(p.Z,{component:"strong",sx:nD.helpStrong})}})}),et(ed,"category").map(e=>(0,i.jsx)(e7,{title:e.subSectionName,totalQuestions:e.questions.length,badgeLabel:e5(e.questions.length),selectedCount:0,active:e.selected,onToggleActive:()=>eG(e),expanded:em.has(e.subSectionKey),onToggleExpand:()=>eF(e.subSectionKey),testId:"category-".concat(e.subSectionKey),children:e3(e)},e.subSectionKey))]}),2===ea&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(q.Z,{icon:(0,i.jsx)(P.Z,{sx:nD.alertIcon}),customVariant:"infoPrimary",sx:nD.helpAlert,children:(0,i.jsx)(L.Z,{tKey:"licensee-vetting.territory-help",components:{strong:(0,i.jsx)(p.Z,{component:"strong",sx:nD.helpStrong})}})}),et(ed,"territory").map(e=>(0,i.jsx)(e7,{title:e.subSectionName,totalQuestions:e.questions.length,badgeLabel:e5(e.questions.length),selectedCount:0,active:e.selected,onToggleActive:()=>eG(e),expanded:em.has(e.subSectionKey),onToggleExpand:()=>eF(e.subSectionKey),testId:"territory-".concat(e.subSectionKey),children:e3(e)},e.subSectionKey))]})]}),(0,i.jsx)(p.Z,{sx:nD.copyLinkRow,children:(0,i.jsx)(m.Z,{title:U("licensee-vetting.copy-link-to-questionnaire-tooltip"),placement:"top",arrow:!0,children:(0,i.jsx)(p.Z,{component:"span",sx:nD.copyLinkTooltipAnchor,children:(0,i.jsxs)(R.Z,{variant:"secondary",onClick:()=>{let e="".concat(window.location.origin).concat(c.Z.vetting,"/").concat((0,_.Z)());navigator.clipboard.writeText(e),(0,b.Am)((0,i.jsx)(D.Z,{type:"success",message:U("licensee-vetting.copy-link-to-questionnaire-success")}))},sx:nD.copyLink,"data-testid":"vetting-copy-link-button",children:[(0,i.jsx)(E.Z,{sx:nD.copyLinkIcon}),U("licensee-vetting.copy-link-to-questionnaire")]})})})}),(0,i.jsx)(p.Z,{sx:nD.pauseLinkRow,children:(0,i.jsxs)(R.Z,{variant:"secondary",onClick:()=>eI(!0),sx:nD.pauseLink,"data-testid":"vetting-pause-button",children:[(0,i.jsx)(V.Z,{sx:nD.pauseIcon}),U("licensee-vetting.pause-vetting")]})})]})}),"builder"===$&&!X&&!e4&&(0,i.jsx)(eQ,{state:eV,totalQuestions:e2.total,sectionsInUse:e2.sections,totalSections:e2.totalSections,isSaving:ev,isPublishing:ey,canPublish:G,hasUnsavedChanges:e0,hasUnpublishedChanges:e1,publishedAt:null!==(a=null==eM?void 0:null===(t=eM.published)||void 0===t?void 0:t.publishedAt)&&void 0!==a?a:null,onSave:eY,onPublish:()=>eZ(!0),onPreview:()=>eT(!0),onHeightChange:y}),eg&&(0,i.jsx)(eK,{isOpen:!0,group:eg,bankQuestions:null!==(x=eO.get(eg.subSectionKey))&&void 0!==x?x:[],hasSavedVersion:!!eH,onSave:e=>{eN(eg.subSectionKey,t=>({...t,questions:e})),eh(null)},onClose:()=>eh(null)}),(0,i.jsx)(tt,{isOpen:eC,title:U("licensee-vetting.publish-title"),body:e8([U("licensee-vetting.publish-point-1"),U("licensee-vetting.publish-point-2")],U("licensee-vetting.publish-subtitle")),confirmLabel:U("licensee-vetting.publish-cta"),cancelLabel:U("cancel"),isConfirming:ey,confirmIcon:(0,i.jsx)(O.Z,{sx:nD.buttonIcon}),onConfirm:eJ,onClose:()=>eZ(!1),testId:"vetting-publish-modal"}),(0,i.jsx)(ti,{isOpen:ew,title:U("licensee-vetting.save-confirm-title"),body:e8([U("licensee-vetting.save-confirm-point-1"),U("licensee-vetting.save-confirm-point-2")],U("licensee-vetting.save-confirm-subtitle")),buttonLabel:U("licensee-vetting.got-it"),buttonIcon:(0,i.jsx)(A.Z,{sx:nD.buttonIcon}),onClose:()=>ej(!1),testId:"vetting-save-confirm-modal"}),(0,i.jsx)(ti,{isOpen:ek,title:U("licensee-vetting.pause-title"),body:U("licensee-vetting.pause-body"),buttonLabel:U("licensee-vetting.okay"),buttonIcon:(0,i.jsx)(A.Z,{sx:nD.buttonIcon}),onClose:()=>eI(!1),testId:"vetting-pause-modal"})]})},nA=!0,nE=()=>{let{t:e}=(0,o.$G)(),t=(0,r.useRouter)(),{account_flags_keyboard_user:n,roles:p,isLoadingStore:g}
1=(0,u.Z)(),[h,m]=(0,s.useState)(96),f=t.query.responseId,v=Array.isArray(f)?f[0]:void 0,b=p.includes(d.vX.LICENSOR),y=null==n?void 0:n.includes(d.uX.VETTING_QUESTIONNAIRE_ENABLED),S=!g&&(!b||!y);return((0,s.useEffect)(()=>{S&&t.replace(c.Z.home)},[S,t]),g||S)?null:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.Z,{title:e("page-title.licensee-vetting"),robots:"noindex"}),(0,i.jsx)(l.Z,{bgColor:"transparent",noFooter:!0,children:(0,i.jsx)(x.Z,{bottomOffset:h,children:(0,i.jsx)(nW,{initialResponseId:v,onActionBarHeightChange:m})})})]})}}},function(e){e.O(0,[7e3,2902,7775,8159,6734,4657,5421,2397,358,567,6936,6613,2888,9774,179],function(){return e(e.s=31428)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.