PageSourceSearch

https://www.castingbell.com/assets/MyProjects-CQdrOoX-.js

js castingbell.com collected 2026-10-08 20:53:27 UTC 146,997 bytes, 1 lines download raw bytes

1import{r as d,a1 as At,a2 as Mt,a3 as qt,ak as Nr,am as is,a4 as ht,j as e,a5 as zt,M as Fi,ab as $t,an as ks,ao as kr,c as ti,T as Sr,f as ns,b as Ot,y as ae,a9 as ar,a0 as C,Y as ie,Z as es,P as a,A as dr,q as Cs,B as ut,o as G,aa as ur,af as hr,ac as xr,$ as Ns,ah as ss,aH as Oe,d as Ve,n as zi,D as Li,l as Pi,m as Bi,I as fr,u as Lr,t as Pr,H as Br,aG as bs,Q as bt,F as nr,aD as Fr,x as Ir}from"./index-DOEDGpFv.js";import{C as Et}from"./CustomDropdown-KMCu6Cw8.js";import{D as vt}from"./DataGrid-BA8QAoin.js";import{A as Tr}from"./AttachmentTwoTone-CKfvhjic.js";import{R as rs}from"./RemoveCircleTwoTone-DiiDLHIb.js";import{C as yt}from"./ControlPointTwoTone-CX685AT0.js";import{i as Rr}from"./info_circle-CPn1_Ob8.js";import{C as jr}from"./ContentCopyTwoTone-DG5g0Th1.js";import{c as ot,i as Ct,b as vs,d as Nt,j as Ar,u as kt}from"./index.esm-DaRz_fRj.js";import{c as He}from"./createProject.service-C6iPiW9V.js";import{C as ts}from"./Cancel-rtwU0jAA.js";import{P as gr,E as Ne}from"./PeopleAltTwoTone-UGP_l4Uo.js";import{S as bi}from"./SaveTwoTone-BeeFrSUG.js";import{P as Ht}from"./PersonSearchTwoTone-BIcspv41.js";import{h as mr,a as pr}from"./CustomSlider-DCr1sfo4.js";import{C as Vs,L as Gi,A as ct}from"./ArrowRight-Bl6iG-fk.js";import{M as _r}from"./MoreVert-Cla5hJ5Q.js";import{o as ne}from"./openProject.service-BQzikV6s.js";import{G as St}from"./Grid-DdjSVELe.js";import{L as Ee}from"./ListItemText-Dml_I78M.js";import{T as Mr,a as qr,b as Lt}from"./TabPanel-BtlVonHl.js";import{a as Pt}from"./Tabs-DEjLDeB5.js";import{P as zr}from"./ProjectImgPlaceholder-DzGzBaip.js";import{R as $r}from"./RecruiterDashBroadHeader-JVQDnjTz.js";import{R as or}from"./Recruiter404-CeW50bqo.js";import{L as Or}from"./LoaderPage-V8pn7OCQ.js";import{A as Er,L as ys}from"./Autocomplete-BiTc0fK0.js";import{A as lt}from"./ArrowDropDown-BNWd2-nS.js";import{R as cr}from"./RadioGroup-BVZKrqaO.js";import{F as Hr}from"./FormControlLabel-Cv1jetH4.js";import{R as Vr}from"./Radio-BcikqwZL.js";import"./toPropertyKey-DCwh5dYN.js";import"./styled-Om9RrDqq.js";import"./InputAdornment-CYJ-dB-y.js";import"./Checkbox-DKFnH0fc.js";import"./TablePagination-rbCf-VGH.js";import"./KeyboardArrowRight-K5Vapl4X.js";import"./LastPage-CTKFULy8.js";import"./Skeleton-H3a6dgVC.js";import"./useThemeProps-BeptFCZJ.js";import"./listItemButtonClasses-COmYTSa9.js";import"./useThemeProps-AF4bYKqg.js";import"./recruiter_404-BprXiUuV.js";const wr=d.createContext({});function Wr(o){return At("MuiAccordion",o)}const at=Mt("MuiAccordion",["root","heading","rounded","expanded","disabled","gutters","region"]),Ur=o=>{const{classes:s,square:b,expanded:l,disabled:U,disableGutters:x}=o;return zt({root:["root",!b&&"rounded",l&&"expanded",U&&"disabled",!x&&"gutters"],heading:["heading"],region:["region"]},Wr,s)},Jr=Fi($t,{name:"MuiAccordion",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:b}=o;return[{[`& .${at.region}`]:s.region},s.root,!b.square&&s.rounded,!b.disableGutters&&s.gutters]}})(ks(({theme:o})=>{const s={duration:o.transitions.duration.shortest};return{position:"relative",transition:o.transitions.create(["margin"],s),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(o.vars||o).palette.divider,transition:o.transitions.create(["opacity","background-color"],s)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${at.expanded}`]:{"&::before":{opacity:0}
1,"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${at.disabled}`]:{backgroundColor:(o.vars||o).palette.action.disabledBackground}}}),ks(({theme:o})=>({variants:[{props:s=>!s.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(o.vars||o).shape.borderRadius,borderTopRightRadius:(o.vars||o).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(o.vars||o).shape.borderRadius,borderBottomRightRadius:(o.vars||o).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:s=>!s.disableGutters,style:{[`&.${at.expanded}`]:{margin:"16px 0"}}}]}))),Gr=Fi("h3",{name:"MuiAccordion",slot:"Heading"})({all:"unset"}),Kr=Fi("div",{name:"MuiAccordion",slot:"Region"})({}),Yr=d.forwardRef(function(s,b){const l=qt({props:s,name:"MuiAccordion"}),{children:U,className:x,defaultExpanded:j=!1,disabled:N=!1,disableGutters:F=!1,expanded:g,onChange:K,slots:z={},slotProps:oe={},TransitionComponent:Z,TransitionProps:H,...se}=l,[Q,le]=Nr({controlled:g,default:j,name:"Accordion",state:"expanded"}),$=d.useCallback(Le=>{le(!Q),K&&K(Le,!Q)},[Q,K,le]),[ge,...S]=d.Children.toArray(U),ce=d.useMemo(()=>({expanded:Q,disabled:N,disableGutters:F,toggle:$}),[Q,N,F,$]),ke={...l,disabled:N,disableGutters:F,expanded:Q},ue=Ur(ke),ve={transition:Z,...z},Fe={transition:H,...oe},_e={slots:ve,slotProps:Fe},[Y,me]=is("root",{elementType:Jr,externalForwardedProps:{..._e,...se},className:ht(ue.root,x),shouldForwardComponentProp:!0,ownerState:ke,ref:b}),[ei,Ie]=is("heading",{elementType:Gr,externalForwardedProps:_e,className:ue.heading,ownerState:ke}),[X,Se]=is("transition",{elementType:Vs,externalForwardedProps:_e,ownerState:ke}),[v,ye]=is("region",{elementType:Kr,externalForwardedProps:_e,ownerState:ke,className:ue.region,additionalProps:{"aria-labelledby":ge.props.id,id:ge.props["aria-controls"],role:"region"}});return e.jsxs(Y,{...me,children:[e.jsx(ei,{...Ie,children:e.jsx(wr.Provider,{value:ce,children:ge})}),e.jsx(X,{in:Q,timeout:"auto",...Se,children:e.jsx(v,{...ye,children:S})})]})});function Qr(o){return At("MuiAccordionDetails",o)}Mt("MuiAccordionDetails",["root"]);const Zr=o=>{const{classes:s}=o;return zt({root:["root"]},Qr,s)},Xr=Fi("div",{name:"MuiAccordionDetails",slot:"Root"})(ks(({theme:o})=>({padding:o.spacing(1,2,2)}))),Dr=d.forwardRef(function(s,b){const l=qt({props:s,name:"MuiAccordionDetails"}),{className:U,...x}=l,j=l,N=Zr(j);return e.jsx(Xr,{className:ht(N.root,U),ref:b,ownerState:j,...x})});function en(o){return At("MuiAccordionSummary",o)}const $i=Mt("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),sn=o=>{const{classes:s,expanded:b,disabled:l,disableGutters:U}=o;return zt({root:["root",b&&"expanded",l&&"disabled",!U&&"gutters"],focusVisible:["focusVisible"],content:["content",b&&"expanded",!U&&"contentGutters"],expandIconWrapper:["expandIconWrapper",b&&"expanded"]},en,s)},tn=Fi(kr,{name:"MuiAccordionSummary",slot:"Root"})(ks(({theme:o})=>{const s={duration:o.transitions.duration.shortest};return{display:"flex",width:"100%",minHeight:48,padding:o.spacing(0,2),transition:o.transitions.create(["min-height","background-color"],s),[`&.${$i.focusVisible}`]:{backgroundColor:(o.vars||o).palette.action.focus},[`&.${$i.disabled}`]:{opacity:(o.vars||o).palette.action.disabledOpacity},[`&:hover:not(.${$i.disabled})`]:{cursor:"pointer"},variants:[{props:b=>!b.disableGutters,style:{[`&.${$i.expanded}`]:{minHeight:64}}}]}})),rn=Fi("span",{name:"MuiAccordionSummary",slot:"Content"})(ks(({theme:o})=>({display:"flex",textAlign:"start",flexGrow:1,margin:"12px 0",variants:[{props:s=>!s.disableGutters,style:{transition:o.transitions.create(["margin"],{duration:o.transitions.duration.shortest}),[`&.${$i.expanded}`]:{margin:"20px 0"}}}]}))),nn=Fi("span",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper"})(ks(({theme:o})=>({display:"flex",color:(o.vars||o).palette.action.active,transform:"rotate(0deg)",transition:o.transitions.create("transform",{duration:o.transitions.duration.shortest}),[`&.${$i.expanded}`]:{transform:"rotate(180deg)"}}))),on=d.forwardRef(function(s,b){const l=qt({props:s,name:"MuiAccordionSummary"}),{children:U,className:x,expandIcon:j,focusVisibleClassName:N,onClick:F,slots:g,slotProps:K,...z}=l,{disabled:oe=!1,disableGutters:Z,expanded:H,toggle:se}=d.useContext(wr),Q=_e=>{se&&se(_e),F&&F(_e)},le={...l,expanded:H,disabled:oe,disableGutters:Z},$=sn(le),ge={slots:g,slotProps:K},[S,ce]=is("root",{ref:b,shouldForwardComponentProp:!0,className:ht($.root,x),elementType:tn,externalForwardedProps:{...ge,...z},ownerState:le,additionalProps:{focusRipple:!1,disableRipple:!0,disabled:oe,"aria-expanded":H,focusVisibleClassName:ht($.focusVisible,N)},getSlotProps:_e=>({..._e,onClick:Y=>{var me;(me=_e.onClick)==null||me.call(_e,Y),Q(Y)}})}),[ke,ue]=is("content",{className:$.content,elementType:rn,externalForwardedProps:ge,ownerState:le}),[ve,Fe]=is("expandIconWrapper",{className:$.expandIconWrapper,elementType:nn,externalForwardedProps:ge,ownerState:le});return e.jsxs(S,{...ce,children:[e.jsx(ke,{...ue,children:U}),j&&e.jsx(ve,{...Fe,children:j})]})}),cn=ti([e.jsx("path",{d:"M6 7v3H5v10h16V8h-4.05l-1.83-2H9v1zm7 2c2.76 0 5 2.24 5 5s-2.24 5-5 5-5-2.24-5-5 2.24-5 5-5",o
1pacity:".3"},"0"),e.jsx("path",{d:"M21 6h-3.17L16 4H9v2h6.12l1.83 2H21v12H5V10H3v10c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2M8 14c0 2.76 2.24 5 5 5s5-2.24 5-5-2.24-5-5-5-5 2.24-5 5m5-3c1.65 0 3 1.35 3 3s-1.35 3-3 3-3-1.35-3-3 1.35-3 3-3M5 9V6h3V4H5V1H3v3H0v2h3v3z"},"1")]),br=ti(e.jsx("path",{d:"M6.23 20.23 8 22l10-10L8 2 6.23 3.77 14.46 12z"})),ln=ti(e.jsx("path",{d:"M18 13c0-.55-.45-1-1-1h-4c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1l2 1.06v-4.12L18 14zM12 3 4 9v12h16v-2H6v-9l6-4.5 6 4.5v1h2V9z"})),an=ti([e.jsx("path",{d:"M5 5h14v2H5z",opacity:".3"},"0"),e.jsx("path",{d:"M19 3h-1V1h-2v2H8V1H6v2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H5V9h14zm0-12H5V5h14zM7 11h10v2H7zm0 4h7v2H7z"},"1")]),It=ti(e.jsx("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"})),Tt=ti(e.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})),dn=ti([e.jsx("path",{d:"M14 7H8v14h11v-9h-5z",opacity:".3"},"0"),e.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm-1 4H8c-1.1 0-1.99.9-1.99 2L6 21c0 1.1.89 2 1.99 2H19c1.1 0 2-.9 2-2V11zm4 16H8V7h6v5h5z"},"1")]),un=ti(e.jsx("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m0 12H4V8h16z"})),hn=ti([e.jsx("path",{d:"M8.07 16c.09-.23.13-.39.91-.69.97-.38 1.99-.56 3.02-.56s2.05.18 3.02.56c.77.3.81.46.91.69zM12 8c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1",opacity:".3"},"0"),e.jsx("path",{d:"M4 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m1.13 1.1c-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58C.48 14.9 0 15.62 0 16.43V18h4.5v-1.61c0-.83.23-1.61.63-2.29M20 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m4 3.43c0-.81-.48-1.53-1.22-1.85-.85-.37-1.79-.58-2.78-.58-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29V18H24zm-7.76-2.78c-1.17-.52-2.61-.9-4.24-.9s-3.07.39-4.24.9C6.68 14.13 6 15.21 6 16.39V18h12v-1.61c0-1.18-.68-2.26-1.76-2.74M8.07 16c.09-.23.13-.39.91-.69.97-.38 1.99-.56 3.02-.56s2.05.18 3.02.56c.77.3.81.46.91.69zM12 8c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m0-2c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"},"1")]),lr=ti([e.jsx("path",{d:"M12 4c-4.41 0-8 3.59-8 8s3.59 8 8 8 8-3.59 8-8-3.59-8-8-8m4 10.59L14.59 16 12 13.41 9.41 16 8 14.59 10.59 12 8 9.41 9.41 8 12 10.59 14.59 8 16 9.41 13.41 12z",opacity:".3"},"0"),e.jsx("path",{d:"M14.59 8 12 10.59 9.41 8 8 9.41 10.59 12 8 14.59 9.41 16 12 13.41 14.59 16 16 14.59 13.41 12 16 9.41zM12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"},"1")]),xn=ti(e.jsx("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7m0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5"})),fn=ti(e.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"})),jn=ti(e.jsx("path",{d:"M20 6h-4V4c0-1.11-.89-2-2-2h-4c-1.11 0-2 .89-2 2v2H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2M10 4h4v2h-4zm10 15H4V8h16z"})),gn=Fi(o=>e.jsx(Yr,{disableGutters:!0,elevation:0,square:!0,...o}))(({theme:o})=>({border:`1px solid ${o.palette.divider}`,"&:not(:last-child)":{borderBottom:0},"&::before":{display:"none"}})),mn=Fi(o=>e.jsx(on,{expandIcon:e.jsx(br,{sx:{fontSize:"0.9rem"}}),...o}))(({theme:o})=>({backgroundColor:"rgba(0, 0, 0, .03)",flexDirection:"row-reverse",[`& .${$i.expandIconWrapper}.${$i.expanded}`]:{transform:"rotate(90deg)"},[`& .${$i.content}`]:{marginLeft:o.spacing(1)}})),pn=Fi(Dr)(({theme:o})=>({padding:o.spacing(2),borderTop:"1px solid rgba(0, 0, 0, .125)"})),be=ns.memo(function({title:s,onClick:b,disabled:l,loading:U,icon:x,activeColor:j="#9B26B6",inactiveColor:N="#9f9f9f",size:F=20}){return e.jsx(C,{title:s,placement:"top",children:e.jsx("span",{children:e.jsx(ie,{onClick:b,disabled:l,style:{padding:2},children:U?e.jsx(es,{size:F,sx:{color:j}}):ns.cloneElement(x,{sx:{color:l?N:j,fontSize:F},fontSize:"inherit"})})})})});be.propTypes={title:a.string.isRequired,onClick:a.func,disabled:a.bool,loading:a.bool,icon:a.element.isRequired,activeColor:a.string,inactiveColor:a.string,
1size:a.number};function Vt({isProfileFreezed:o,onSave:s,onCancel:b,onEdit:l,onDelete:U,onPost:x}){const j=d.useCallback(N=>F=>{F.preventDefault(),F.stopPropagation(),!o&&typeof N=="function"&&N()},[o]);return{handleSaveClick:j(()=>s==null?void 0:s(!0)),handleCancelClick:j(()=>b==null?void 0:b(!0)),handleEditClick:j(()=>l==null?void 0:l()),handleDeleteClick:j(()=>U==null?void 0:U()),handlePostClick:j(()=>x==null?void 0:x(!0))}}const Rt=ns.memo(function({talent:s,auditionDataInfo:b,index:l,isEditing:U,onEdit:x,onSave:j,onCancel:N,onDelete:F,onChange:g,onPost:K,onCopyLink:z,onFindTalent:oe,errors:Z={},touched:H={},isLoading:se,isProfileFreezed:Q,isClosed:le,currentDate:$,copiedId:ge,GENDER:S,height_min:ce,height_max:ke,handle_InchAndCm:ue,calculateValue:ve}){var Le;const Fe=Ot(),{handleSaveClick:_e,handleCancelClick:Y,handleEditClick:me,handleDeleteClick:ei,handlePostClick:Ie}=Vt({isProfileFreezed:Q,onSave:()=>j==null?void 0:j(!0),onCancel:()=>N==null?void 0:N(!0),onEdit:x,onDelete:()=>F==null?void 0:F(s),onPost:()=>K==null?void 0:K(!0)}),X=d.useMemo(()=>{const V=Array.isArray(S)?S.find(Pe=>String(Pe==null?void 0:Pe.id)===String(s==null?void 0:s.gender)):void 0;return(V==null?void 0:V.value)??"N/A"},[S,s==null?void 0:s.gender]),Se=Number(s==null?void 0:s.min_height)>0,v=ns.useMemo(()=>{const V=b??(s==null?void 0:s.auditionData);if(!V)return{};if(typeof V=="string")try{return JSON.parse(V)}catch(Pe){return console.error("Invalid auditionData JSON:",Pe),{}}return V},[b,s==null?void 0:s.auditionData]),ye=V=>V!=null?String(V):"N/A";return e.jsxs("div",{className:"talent-card",children:[e.jsx("div",{className:"talent-top-info",children:e.jsx("div",{className:"info-row",children:e.jsxs("div",{className:"main_flow_section",children:[!U&&e.jsxs("div",{className:"MainCharactername MainCharactername--meta",children:[e.jsxs("div",{className:"InnerSections InnerSections--stacked",children:[e.jsx("strong",{children:"Gender:"})," ",e.jsx("br",{}),e.jsx("span",{children:X})]}),e.jsxs("div",{className:"InnerSections InnerSections--age InnerSections--stacked",children:[e.jsx("strong",{children:"Min age:"})," ",e.jsx("br",{}),e.jsx("span",{children:(s==null?void 0:s.minAge)||(s==null?void 0:s.min_age)||"N/A"})]}),e.jsxs("div",{className:"InnerSections InnerSections--age InnerSections--stacked",children:[e.jsx("strong",{children:"Max age:"})," ",e.jsx("br",{}),e.jsx("span",{children:(s==null?void 0:s.maxAge)||(s==null?void 0:s.max_age)||"N/A"})]}),e.jsxs("div",{className:"InnerSections InnerSections--stacked",children:[e.jsx("strong",{children:"Min height:"}),e.jsx("br",{}),e.jsx("span",{children:s!=null&&s.id&&Se?ve(s==null?void 0:s.height_size_type,Number(s==null?void 0:s.min_height)):"N/A"})]})]}),!U&&Object.keys(v).length!==0&&e.jsxs("div",{className:"MainCharactername MainCharactername--pay",children:[e.jsxs("div",{className:"InnerSections InnerSections--stacked",children:[e.jsx("strong",{children:"Min pay:"}),e.jsx("br",{}),e.jsx("span",{children:ye(v==null?void 0:v.min_pay)})]}),e.jsxs("div",{className:"InnerSections InnerSections--stacked",children:[e.jsx("strong",{children:"Max pay:"}),e.jsx("br",{}),e.jsx("span",{children:ye(v==null?void 0:v.max_pay)})]}),e.jsxs("div",{className:"InnerSections InnerSections--stacked",children:[e.jsx("strong",{children:"Shoot Days:"}),e.jsx("br",{}),e.jsx("span",{children:ye(v==null?void 0:v.expected_days_of_shoot)})]})]}),U&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"main_flow_section",children:[e.jsxs("div",{className:"flex-column",children:[e.jsx("strong",{children:"Character Name:"})," ",e.jsx("br",{}),e.jsx(ae,{variant:"standard",name:"character_name",className:`${s!=null&&s.character_name?"value":""}`,value:(s==null?void 0:s.character_name)||"",onChange:V=>g==null?void 0:g({...s,character_name:V.target.value}),error:!!(Z!=null&&Z.character_name&&(H!=null&&H.character_name||H===!0)),size:"small"})]}),e.jsxs("div",{className:"flex-column",children:[e.jsx("strong",{children:"Gender:"})," ",e.jsx("br",{}),e.jsxs("div",{className:"flex w-full",children:[e.jsx("div",{style:{width:"100%"},children:e.jsx(Et,{name:"gender",error:!!(Z!=null&&Z.gender&&(H!=null&&H.gender||H===!0)),data:S,autoComplete:!0,dropdownName:"value",handleChange:V=>g==null?void 0:g({...s,gender:V}),values:s==null?void 0:s.gender,onkeyDownForTable:V=>V.stopPropagation(),disablePortal:!1})}),e.jsx("div",{})]})]})]}),e.jsxs("div",{className:"main_flow_section",children:[e.jsxs("div",{className:"flex-column",children:[e.jsx("strong",{children:"Min age:"})," ",e.jsx("br",{}),e.jsx(ae,{variant:"standard",name:"min_age",className:`${s!=null&&s.min_age?"value":""}`,value:(s==null?void 0:s.min_age)||"",onChange:V=>g==null?void 0:g({...s,min_age:V.target.value}),error:!!(Z!=null&&Z.min_age&&(H!=null&&H.min_age||H===!0)),size:"small"})]}),e.jsxs("div",{className:"flex-column",children:[e.jsx("strong",{children:"Max age:"})," ",e.jsx("br",{}),e.jsx(ae,{variant:"standard",name:"max_age",className:`${s!=null&&s.max_age?"value":""}`,value:(s==null?void 0:s.max_age)||"",onChange:V=>g==null?void 0:g({...s,max_age:V.target.value}),error:!!(Z!=null&&Z.max_age&&(H!=null&&H.max_age||H===!0)),size:"small"})]})]}),Object.keys(v).length!==0&&e.jsxs("div",{className:"main_flow_section",children:[e.jsxs("div",{className:"flex-column",children:[e.jsx("strong",{children:"Min pay:"})," ",e.jsx("br",{}),e.jsx(ae,{variant:"standard",name:"min_pay",type:"number",value:(v==null?void 0:v.min_pay)??"",onChange:V=>g==null?void 0:g({...s,auditionData:{...v,min_pay:V.target.value===""?null:Number(V.target.value)}}),size:"small"})]}),e.jsxs("div",{className:"flex-column",children:[e.jsx("strong",{children:"Max pay:"})," ",e.jsx("br",{}),e.jsx(ae,{variant:"standard",name:"max_pay",type:"number",value:(v==null?void 0:v.max_pay)??"",onChange:V=>g==null?void 0:g({...s,auditionData:{...v,max_pay:V.target.value===""?null:Number(V.target.value)}}),size:"small"})]}),e.jsxs("div",{className:"flex-column",children:[e.jsx("strong",{children:"Shoot Days:"})," ",e.jsx("br",{}),e.jsx(ae,{variant:"standard",name:"expected_days_of_shoot",type:"number",value:(v==null?void 0:v.expected_days_of_shoot)??"",onChange:V=>g==null?void 0:g({...s,auditionData:{...v,expected_days_of_shoot:V.target.value===""?null:Number(V.target.value)}}),size:"small"})]})]}),e.jsxs("div",{className:"height-section fullwidthchange",children:[e.jsx("strong",{children:"Min height (Optional):"}),e.jsxs("div",{className:"sliderCharacter flex form_left w-full ChangePAdding",children:[e.jsx(ar,{name:"min_height",valueLabelFormat:ve((s==null?void 0:s.height_size_type)||"in",Number(s==null?void 0:s.min_height)||0),valueLabelDisplay:"on",marks:((s==null?void 0:s.height_size_type)||"in")==="in"?mr:pr,min:ce,max:ke,onChange:(V,Pe)=>g==null?void 0:g({...s,min_height:Pe}),value:Number(s==null?void 0:s.min_height)||0,style:{width:"100%",marginLeft:"0px",marginRight:"20px"}}),e.jsxs("div",{className:"right_button flex",children:[e.jsx("button",{type:"button",className:((s==null?void 0:s.height_size_type)||"in")==="in"?"physical_button_active":"physical_button_inactive",onClick:()=>ue==null?void 0:ue("height","in",l,s),children:"ft/in"}),e.jsx("button",{type:"button",className:((s==null?void 0:s.height_size_type)||"in")==="cm"?"physical_button_active":"physical_button_inactive",onClick:()=>ue==null?void 0:ue("height","cm",l,s),children:"cm"})]})]})]})]})]})})}),(s==null?void 0:s.id)&&e.jsxs("div",{className:"talent-section",children:[e.jsx("div",{className:"section-label",children:"Job Posting:"}),e.jsx("div",{className:"section-action post-action",children:le?e.jsx("span",{children:"---"}):e.jsxs("p",{className:Q?"freeze_text_color flex gap-2 justify-center items-center":"flex gap-2 justify-center items-center",children:[e.jsx("span",{className:"character_link font-semibold cursor-pointer",onClick:!Q&&
1(s==null?void 0:s.isDeleted)===!1?()=>{Fe("/app/audition",{state:v!=null&&v.id?{poster_id:v==null?void 0:v.id}:s})}:void 0,children:(s==null?void 0:s.isDeleted)===!0?e.jsx("span",{className:"flex flex-col character_color",children:"Character is Deleted"}):v!=null&&v.isBanned?e.jsx(C,{title:"Click to view the Closed Job Posting",placement:"top",children:e.jsx("div",{className:"flex flex-col",children:"Closed"})}):Number(v==null?void 0:v.job_expiry)<Number($)?e.jsx(C,{title:"Click to view the Expired Job Posting",placement:"top",children:e.jsx("div",{className:"flex flex-col",children:"Expired"})}):(v==null?void 0:v.is_open_audition_posted)===!0?e.jsx(C,{title:"Click to edit the Job Posting",placement:"top",children:e.jsx("span",{className:"flex flex-col",children:"Live"})}):v!=null&&v.isSubmitted?e.jsx(C,{title:"Edit the Under Review Job Posting",placement:"top",children:e.jsx("span",{className:"flex flex-col",children:"Under review"})}):v!=null&&v.id?e.jsx(C,{title:"Your audition is in draft. Click to edit/submit",placement:"top",children:e.jsx("span",{className:"flex flex-col",children:"In Draft"})}):e.jsx(C,{title:"Post to receive applications from talents",placement:"top",children:e.jsx("span",{className:"flex flex-col",children:"Post"})})}),(v==null?void 0:v.is_open_audition_posted)===!0&&(v==null?void 0:v.jobUniqueId)&&e.jsxs(e.Fragment,{children:[e.jsx(C,{title:(ge==null?void 0:ge.length)>2?"Copied":"Copy link",placement:"top",children:e.jsx(ie,{"aria-label":"copy",style:{padding:2,fontSize:"1.5em"},onClick:()=>z==null?void 0:z(v==null?void 0:v.jobUniqueId),children:e.jsx(jr,{fontSize:"inherit",sx:{color:"#9B26B6"}})})}),(s==null?void 0:s.isDeleted)===!1?e.jsx(C,{title:"View Applicants",placement:"top",children:e.jsxs(ie,{"aria-label":"applicants",style:{padding:2,fontSize:"1.5em"},onClick:()=>{window.open(`/app/my-job-postings#project_id${s==null?void 0:s.project_id}#character_id#${s==null?void 0:s.id}`,"_blank")},children:[e.jsx("strong",{style:{color:"#9B26B6",cursor:"pointer",fontSize:16,fontWeight:600},children:Array.isArray(s==null?void 0:s.JobApplicantCount)?s.JobApplicantCount.length:0}),e.jsx(gr,{fontSize:"inherit",sx:{color:"#9B26B6"}})]})}):null]})]})})]}),(s==null?void 0:s.id)&&e.jsxs("div",{className:"talent-section",children:[e.jsx("div",{className:"section-label",children:"Find talent:"}),e.jsx("div",{className:"icon-group Chagesizeofimage1",children:(s==null?void 0:s.id)&&!le&&e.jsx(C,{title:(s==null?void 0:s.isDeleted)===!0?"Character is deleted":"Find Talents",placement:"top",children:e.jsx("span",{children:e.jsx(ie,{onClick:()=>{(s==null?void 0:s.isDeleted)!==!0&&(oe==null||oe(s))},children:e.jsx(Ht,{sx:{color:(s==null?void 0:s.isDeleted)===!1?"#9B26B6":"#9f9f9f"}})})})})})]}),(s==null?void 0:s.id)&&e.jsxs("div",{className:"talent-section",children:[e.jsx("div",{className:"section-label",children:"Shortlisted:"}),e.jsx("div",{className:"icon-group Chagesizeofimage2",children:(s==null?void 0:s.id)&&!le&&e.jsx(C,{title:"View Shortlist",placement:"top",children:e.jsx(ie,{onClick:()=>{var V;(V=window.history)!=null&&V.scrollRestoration&&(window.history.scrollRestoration="manual"),window.scrollTo(0,0),Fe("/app/short-list",{state:s.id})},children:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx("span",{style:{color:"#9B26B6",fontSize:16,fontWeight:600},children:Array.isArray(s==null?void 0:s.recruiterShortlist)?s.recruiterShortlist.length:0})})})})})]}),e.jsxs("div",{className:"talent-section",children:[e.jsx("div",{className:"section-label",children:"Actions:"}),e.jsxs("div",{className:"icon-group Chagesizeofimage3",children:[(s==null?void 0:s.isDeleted)===!0?((Le=s==null?void 0:s.recruiterProject)==null?void 0:Le.project_status)===1?e.jsx(be,{title:"Character is deleted",icon:e.jsx(Ne,{}),disabled:!0}):null:(s==null?void 0:s.id)&&!le&&e.jsxs(e.Fragment,{children:[(v==null?void 0:v.isBanned)===!1&&(v==null?void 0:v.isSubmitted)===!0&&!(v!=null&&v.is_open_audition_posted)?e.jsx(be,{title:"Cannot edit when Under Review",icon:e.jsx(Ne,{}),disabled:!0}):!U&&e.jsx(be,{title:"Edit character",icon:e.jsx(Ne,{}),onClick:me,disabled:Q}),U&&e.jsxs("div",{className:"flex",style:{gap:"4px"},children:[e.jsx(be,{title:"Save",icon:e.jsx(bi,{}),onClick:_e,disabled:Q||se,loading:se}),e.jsx(be,{title:"Cancel",icon:e.jsx(ts,{}),onClick:Y,disabled:Q})]})]}),!(s!=null&&s.id)&&e.jsx(be,{title:"Save Location",icon:e.jsx(bi,{}),onClick:Ie,disabled:Q||se,loading:se}),!(s!=null&&s.id)&&e.jsx(be,{title:(s==null?void 0:s.isDeleted)===!0?"Location is deleted":"Delete location",icon:e.jsx(rs,{}),onClick:ei,disabled:Q||(s==null?void 0:s.isDeleted)===!0,size:20})]})]})]})});Rt.propTypes={talent:a.object.isRequired,auditionDataInfo:a.object,index:a.number,isEditing:a.bool,onEdit:a.func,onSave:a.func,onCancel:a.func,onDelete:a.func,onChange:a.func,onPost:a.func,onCopyLink:a.func,onFindTalent:a.func,errors:a.object,touched:a.oneOfType([a.object,a.bool]),isLoading:a.bool,isProfileFreezed:a.bool,isClosed:a.bool,currentDate:a.oneOfType([a.number,a.string]),copiedId:a.string,GENDER:a.arrayOf(a.shape({id:a.oneOfType([a.number,a.string]),value:a.string})),height_min:a.number,height_max:a.number,handle_InchAndCm:a.func,calculateValue:a.func};const vr=ns.memo(function({talent:s,index:b,isEditing:l,onEdit:U,onSave:x,onCancel:j,onDelete:N,onChange:F,onPost:g,errors:K={},touched:z={},isLoading:oe,isProfileFreezed:Z,isClosed:H}){var S;const{handleSaveClick:se,handleCancelClick:Q,handleEditClick:le,handleDeleteClick:$,handlePostClick:ge}=Vt({isProfileFreezed:Z,onSave:()=>x==null?void 0:x(!0),onCancel:()=>j==null?void 0:j(!0),onEdit:U,onDelete:()=>N==null?void 0:N(s),onPost:()=>g==null?void 0:g(!0)});return e.jsxs("div",{className:"talent-card",children:[e.jsx("div",{className:"talent-top-info",children:e.jsxs("div",{className:"info-row",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Location:"})," ",e.jsx("br",{}),!(s!=null&&s.id)||l?e.jsx(ae,{variant:"standard",name:"location",className:`${s!=null&&s.location?"value":""}`,value:(s==null?void 0:s.location)||"",onChange:ce=>F==null?void 0:F({...s,location:ce.target.value}),error:!!(K!=null&&K.location&&(z!=null&&z.location||z===!0)),size:"small",fullWidth:!0}):e.jsx("span",{children:(s==null?void 0:s.lockedLocation)||(s==null?void 0:s.location)||"N/A"})]}
1),e.jsxs("div",{children:[e.jsx("strong",{children:"Locked Location:"})," ",e.jsx("br",{}),!(s!=null&&s.id)||l?e.jsx(ae,{variant:"standard",name:"locked_location",className:`${s!=null&&s.locked_location?"value":""}`,value:(s==null?void 0:s.locked_location)||"",onChange:ce=>F==null?void 0:F({...s,locked_location:ce.target.value}),error:!!(K!=null&&K.locked_location&&(z!=null&&z.locked_location||z===!0)),size:"small",fullWidth:!0}):e.jsx("span",{children:(s==null?void 0:s.lockedLocation)||(s==null?void 0:s.locked_location)||"N/A"})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Backup Location:"})," ",e.jsx("br",{}),!(s!=null&&s.id)||l?e.jsx(ae,{variant:"standard",name:"backup_location",className:`${s!=null&&s.backup_location?"value":""}`,value:(s==null?void 0:s.backup_location)||"",onChange:ce=>F==null?void 0:F({...s,backup_location:ce.target.value}),error:!!(K!=null&&K.backup_location&&(z!=null&&z.backup_location||z===!0)),size:"small",fullWidth:!0}):e.jsx("span",{children:(s==null?void 0:s.backupLocation)||(s==null?void 0:s.backup_location)||"N/A"})]})]})}),e.jsxs("div",{className:"talent-section",children:[e.jsx("div",{className:"section-label",children:"Actions:"}),e.jsxs("div",{className:"icon-group",children:[(s==null?void 0:s.isDeleted)===!0?((S=s==null?void 0:s.recruiterProject)==null?void 0:S.project_status)===1?e.jsx(be,{title:"Location is deleted",icon:e.jsx(Ne,{}),disabled:!0}):null:(s==null?void 0:s.id)&&!H&&e.jsxs(e.Fragment,{children:[!l&&e.jsx(be,{title:"Edit location",icon:e.jsx(Ne,{}),onClick:le,disabled:Z}),l&&e.jsxs("div",{className:"flex",style:{gap:"4px"},children:[e.jsx(be,{title:"Save",icon:e.jsx(bi,{}),onClick:se,disabled:Z||oe,loading:oe}),e.jsx(be,{title:"Cancel",icon:e.jsx(ts,{}),onClick:Q,disabled:Z})]})]}),!(s!=null&&s.id)&&e.jsx(be,{title:"Save Location",icon:e.jsx(bi,{}),onClick:ge,disabled:Z||oe,loading:oe}),!(s!=null&&s.id)&&e.jsx(be,{title:(s==null?void 0:s.isDeleted)===!0?"Location is deleted":"Delete location",icon:e.jsx(rs,{}),onClick:$,disabled:Z||(s==null?void 0:s.isDeleted)===!0})]})]})]})});vr.propTypes={talent:a.object.isRequired,index:a.number,isEditing:a.bool,onEdit:a.func,onSave:a.func,onCancel:a.func,onDelete:a.func,onChange:a.func,onPost:a.func,errors:a.object,touched:a.oneOfType([a.object,a.bool]),isLoading:a.bool,isProfileFreezed:a.bool,isClosed:a.bool};const yr=ns.memo(function({talent:s,index:b,isEditing:l,onEdit:U,onSave:x,onCancel:j,onDelete:N,onChange:F,onPost:g,errors:K={},touched:z={},isLoading:oe,isProfileFreezed:Z,isClosed:H}){var S;const{handleSaveClick:se,handleCancelClick:Q,handleEditClick:le,handleDeleteClick:$,handlePostClick:ge}=Vt({isProfileFreezed:Z,onSave:()=>x==null?void 0:x(!0),onCancel:()=>j==null?void 0:j(!0),onEdit:U,onDelete:()=>N==null?void 0:N(s),onPost:()=>g==null?void 0:g(!0)});return e.jsxs("div",{className:"talent-card",children:[e.jsx("div",{className:"talent-top-info",children:e.jsxs("div",{className:"info-row",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"Special Requirement:"})," ",e.jsx("br",{}),!(s!=null&&s.id)||l?e.jsx(ae,{variant:"standard",name:"special_requirement",className:`${s!=null&&s.special_requirement?"value":""}`,value:(s==null?void 0:s.special_requirement)||"",onChange:ce=>F==null?void 0:F({...s,special_requirement:ce.target.value}),error:!!(K!=null&&K.special_requirement&&(z!=null&&z.special_requirement||z===!0)),size:"small",fullWidth:!0}):e.jsx("span",{children:(s==null?void 0:s.locked)||(s==null?void 0:s.special_requirement)||"N/A"})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Locked:"})," ",e.jsx("br",{}),!(s!=null&&s.id)||l?e.jsx(ae,{variant:"standard",name:"locked_special_requirement",className:`${s!=null&&s.locked_special_requirement?"value":""}`,value:(s==null?void 0:s.locked_special_requirement)||"",onChange:ce=>F==null?void 0:F({...s,locked_special_requirement:ce.target.value}),error:!!(K!=null&&K.locked_special_requirement&&(z!=null&&z.locked_special_requirement||z===!0)),size:"small",fullWidth:!0}):e.jsx("span",{children:(s==null?void 0:s.locked)||(s==null?void 0:s.locked_special_requirement)||"N/A"})]}),e.jsxs("div",{children:[e.jsx("strong",{children:"Backup:"})," ",e.jsx("br",{}),!(s!=null&&s.id)||l?e.jsx(ae,{variant:"standard",name:"backup_special_requirement",className:`${s!=null&&s.backup_special_requirement?"value":""}`,value:(s==null?void 0:s.backup_special_requirement)||"",onChange:ce=>F==null?void 0:F({...s,backup_special_requirement:ce.target.value}),error:!!(K!=null&&K.backup_special_requirement&&(z!=null&&z.backup_special_requirement||z===!0)),size:"small",fullWidth:!0}):e.jsx("span",{children:(s==null?void 0:s.backup)||(s==null?void 0:s.backup_special_requirement)||"N/A"})]})]})}),e.jsxs("div",{className:"talent-section",children:[e.jsx("div",{className:"section-label",children:"Actions:"}),e.jsxs("div",{className:"icon-group Chagesizeofimage",children:[(s==null?void 0:s.isDeleted)===!0?((S=s==null?void 0:s.recruiterProject)==null?void 0:S.project_status)===1?e.jsx(be,{title:"Requirement is deleted",icon:e.jsx(Ne,{}),disabled:!0}):null:(s==null?void 0:s.id)&&!H&&e.jsxs(e.Fragment,{children:[!l&&e.jsx(be,{title:"Edit requirement",icon:e.jsx(Ne,{}),onClick:le,disabled:Z}),l&&e.jsxs("div",{className:"flex",style:{gap:"4px"},children:[e.jsx(be,{title:"Save",icon:e.jsx(bi,{}),onClick:se,disabled:Z||oe,loading:oe}),e.jsx(be,{title:"Cancel",icon:e.jsx(ts,{}),onClick:Q,disabled:Z})]})]}),!(s!=null&&s.id)&&e.jsx(be,{title:"Save Requirement",icon:e.jsx(bi,{}),onClick:ge,disabled:Z||oe,loading:oe}),!(s!=null&&s.id)&&e.jsx(be,{title:(s==null?void 0:s.isDeleted)===!0?"Requirement is deleted":"Delete requirement",icon:e.jsx(rs,{}),onClick:$,disabled:Z||(s==null?void 0:s.isDeleted)===!0})]})]})]})});yr.propTypes={talent:a.object.isRequired,index:a.number,isEditing:a.bool,onEdit:a.func,onSave:a.func,onCancel:a.func,onDelete:a.func,onChange:a.func,onPost:a.func,errors:a.object,touched:a.oneOfType([a.object,a.bool]),isLoading:a.bool,isProfileFreezed:a.bool,isClosed:a.bool};function _n(o,s){return(o==null?void 0:o.id)??`panel${s+1}`}function wn(o,s){switch(s){case"1":return(o==null?void 0:o.character_name)||"";case"2":return(o==null?void 0:o.location)||(o==null?void 0:o.location_name)||"";case"3":return(o==null?void 0:o.special_requirement)||(o==null?void 0:o.requirement_name)||"";default:return(o==null?void 0:o.name)||`Item ${(o==null?void 0:o.id)||""}`}}function Bt(o,{formik:s,formiks:b,formikss:l}){switch(o){case"1":return s;case"2":return b;case"3":return l;default:return s}}function bn(o,{isLoading:s,isLoadings:b,isLoadingss:l}){switch(o){case"1":return s;case"2":return b;case"3":return l;default:return s}}function vn(o,{currectIndexOfNewCharacter:s,currectIndexOfNewCharacters:b,currectIndexOfNewCharacterss:l}){switch(o){case"1":return s;case"2":return b;case"3":return l;default:return s}}function dt(o,s){switch(o){case"1":return(s==null?void 0:s.characters)??null;case"2":return(s==null?void 0:s.locations)??null;case"3":return(s==null?void 0:s.requirements)??null;default:return null}}function yn(o,s,b){o==="1"&&s(l=>({...l,characters:b})),o==="2"&&s(l=>({...l,locations:b})),o==="3"&&s(l=>({...l,requirements:b}))}function Cn(o,s){if(!Array.isArray(o))return[];const b=o.filter(g=>g&&g.id!==void 0&&g.id!==null),l=o.filter(g=>!g||g.id===void 0||g.id===null);if(b.length===0)return o;const U=g=>{switch(s){case"1":return((g==null?void 0:g.character_name)||"").toLowerCase();case"2":return((g==null?void 0:g.location)||(g==null?void 0:g.location_name)||"").toLowerCase();case"3":return((g==null?void 0:g.special_requirement)||(g==null?void 0:g.requirement_name)||"").toLowerCase();default:return((g==null?void 0:g.name)||"").toLowerCase()}},x=[...b].toSorted((g,K)=>U(g).localeCompare(U(K))),j=[];let N=0,F=0;return o.forEach(g=>{g&&g.id!==void 0&&g.id!==null?j.push(x[N++]):j.push(l[F++])}),j}function Cr({tabValue:o,data:s,editingStates:b,setEditingStates:l,onUpdate:U,onDelete:x,onPost:j,onCopyLink:N,onFindTalent:F,formik:g,formiks:K,formikss:z,errors:oe,touched:Z,isLoading:H,isLoadings:se,isLoadingss:Q,isProfileFreezed:le,isClosed:$,currentDate:ge,copiedId:S,GENDER:ce,height_min:ke,height_max:ue,handle_InchAndCm:ve,calculateValue:Fe,currectIndexOfNewCharacter:_e,currectIndexOfNewCharacters:Y,currectIndexOfNewCharacterss:me}){const[ei,Ie]=d.useState({1:null,2:null,3:null}),X=d.useCallback(()=>{Ie(k=>({...k,[o]:null}))},[o]);d.useEffect(()=>{(dt(o,b)==="newCharacter"||Array.isArray(s)&&s.some(te=>!(te!=null&&te.id)&&te!==null))&&X()},[b,s,o,X]);const Se=d.useMemo(()=>Cn(s,o),[s,o]),v=ei[o],ye=d.useCallback(k=>{(k==="newCharacter"||typeof k=="number"&&(s!=null&&s[k])&&!s[k].id)&&X(),yn(o,l,k)},[o,l,s,X]),Le=d.useCallback(k=>(te,D)=>{const fe=dt(o,b);fe!==null&&fe!=="newCharacter"&&!D||fe==="newCharacter"&&D||(te.stopPropagation(),Ie(qe=>({...qe,[o]:D?k:null})))},[o,b]),V=d.useMemo(()=>({formik:g,formiks:K,formikss:z}),[g,K,z]),Pe=d.useMemo(()=>({isLoading:H,isLoadings:se,isLoadingss:Q}),[H,se,Q]),We=d.useMemo(()=>({currectIndexOfNewCharacter:_e,currectIndexOfNewCharacters:Y,currectIndexOfNewCharacterss:me}),[_e,Y,me]),Ki=d.useCallback((k,te,D=!1)=>{U==null||U(o,k==null?void 0:k.id,k,te)},[U,o,X]),ri=d.useCallback((k=!1)=>{var D;ye(null);const te=Bt(o,V);(D=te==null?void 0:te.resetForm)==null||D.call(te),k&&X()},[ye,o,V,X]),vi=d.useCallback((k,te)=>x==null?void 0:x(o,k,te),[x,o]),Ii=d.useCallback((k,te,D=!1)=>{j==null||j(o,k,te),D&&X()},[j,o,X]),os=d.useCallback((k,te,D)=>{var ee,Be;const fe=Bt(o,V),qe=Array.isArray((ee=fe==null?void 0:fe.values)==null?void 0:ee.characterList)?[...fe.values.characterList]:[],yi=s==null?void 0:s.findIndex(we=>(we==null?void 0:we.id)===(k==null?void 0:k.id)||(k==null?void 0:k.index)&&(we==null?void 0:we.index)===(k==null?void 0:k.index));yi!==void 0&&yi!==-1&&(qe[yi]=D,(Be=fe==null?void 0:fe.setFieldValue)==null||Be.call(fe,"characterList",qe))},[s,o,V]),di=d.useCallback((k,te)=>{var Ci,ze,Ni,Ce;const D=s==null?void 0:s.findIndex(re=>(re==null?void 0:re.id)===(k==null?void 0:k.id)||(k==null?void 0:k.index)&&(re==null?void 0:re.index)===(k==null?void 0:k.index)),fe=dt(o,b),qe=!(k!=null&&k.id)||fe===D||fe==="newCharacter",yi=bn(o,Pe),ee=vn(o,We),Be=ee===D&&yi,we=Bt(o,V),Ti=((ze=(Ci=we==null?void 0:we.errors)==null?void 0:Ci.characterList)==null?void 0:ze.length)&&we.errors.characterList[D]||{},Te=ee===D?!0:((Ce=(Ni=we==null?void 0:we.touched)==null?void 0:Ni.characterList)==null?void 0:Ce.length)&&we.touched.characterList[D]||{},Ue={talent:k,auditionDataInfo:k==null?void 0:k.auditionData,index:D,isEditing:!(k!=null&&k.id)||qe,onEdit:()=>ye(D),onSave:re=>Ki(k,D,re),onCancel:re=>ri(re),onDelete:re=>vi(re,D),onChange:re=>os(k,D,re),onPost:re=>Ii(k,D,re),errors:Ti,touched:Te,isLoading:!!Be,isProfileFreezed:le,isClosed:$,currentDate:ge,copiedId:S};return o==="1"?e.jsx(Rt,{...Ue,auditionDataInfo:Ue.auditionDataInfo,onCopyLink:N,onFindTalent:F,GENDER:ce,height_min:ke,height_max:ue,handle_InchAndCm:ve,calculateValue:Fe}):o==="2"?e.jsx(vr,{...Ue}):o==="3"?e.jsx(yr,{...Ue}):e.jsx(Rt,{...Ue})},[s,o,b,Pe,We,V,ye,Ki,ri,vi,Ii,os,le,$,ge,S,N,F,ce,ke,ue,ve,Fe]);return e.jsx("div",{children:Se.map((k,te)=>{const D=_n(k,te),fe=wn(k,o),qe=dt(o,b);return k!=null&&k.id?e.jsxs(gn,{expanded:v===D,onChange:Le(D),disabled:qe==="newCharacter",children:[e.jsx(mn,{expandIcon:e.jsx(br,{sx:{fontSize:"17px",color:"#9B26B6"}}),"aria-controls":`${D}d-content`,id:`${D}d-header`,sx:{flexDirection:"row"},children:e.jsx(Sr,{component:"span",children:fe})}),e.jsx(pn,{children:di(k,te)}
1)]},`${o}-${D}`):e.jsx("div",{children:di(k,te)},`${o}-inline-${te}`)})})}Cr.propTypes={tabValue:a.oneOf(["1","2","3"]).isRequired,data:a.arrayOf(a.any).isRequired,editingStates:a.shape({characters:a.oneOfType([a.number,a.string,a.oneOf([null])]),locations:a.oneOfType([a.number,a.string,a.oneOf([null])]),requirements:a.oneOfType([a.number,a.string,a.oneOf([null])])}).isRequired,setEditingStates:a.func.isRequired,onUpdate:a.func.isRequired,onDelete:a.func.isRequired,onPost:a.func.isRequired,onCopyLink:a.func,onFindTalent:a.func,formik:a.object.isRequired,formiks:a.object.isRequired,formikss:a.object.isRequired,errors:a.object,touched:a.oneOfType([a.object,a.bool]),isLoading:a.bool,isLoadings:a.bool,isLoadingss:a.bool,isProfileFreezed:a.bool,isClosed:a.bool,currentDate:a.oneOfType([a.number,a.string]),copiedId:a.string,GENDER:a.array,height_min:a.number,height_max:a.number,handle_InchAndCm:a.func,calculateValue:a.func,currectIndexOfNewCharacter:a.number,currectIndexOfNewCharacters:a.number,currectIndexOfNewCharacterss:a.number};const Nn=5,kn={"& .empty-placeholder-row":{"&:hover":{backgroundColor:"transparent !important"},cursor:"default"},"& .empty-placeholder-row .MuiDataGrid-cell":{borderBottom:"none !important",borderTop:"none !important"},"& .empty-placeholder-row .MuiDataGrid-cell:focus":{outline:"none"}},Sn=({setGoForms:o,projectDetails:s,isNewCharacter:b=!0,isClosed:l,isNewChar:U=!1})=>{var zs,st,$s,Os,r,f,y,E,W,B,J,Ge,Ke,li,_s,Xi,Di,ws,Re,ii,Ui,gi,Ye,Es,tt,rt,Hs,ai,Wt,Ut,Jt,Gt,Kt,Yt,Qt,Zt,Xt;const[x,j]=d.useState(null),[N,F]=d.useState(null),[g,K]=d.useState(!1),[z,oe]=d.useState({isOpen:!1,data:null}),[Z,H]=d.useState(!1),[se,Q]=d.useState(!1),[le,$]=d.useState(0),[ge,S]=d.useState(97),[ce,ke]=d.useState(null),[ue,ve]=d.useState(null),[Fe,_e]=d.useState(!0),[Y,me]=ns.useState("1"),[ei,Ie]=d.useState(null),[X,Se]=d.useState(null),[v,ye]=d.useState(!1),[Le,V]=d.useState({isOpen:!1,data:null}),[Pe,We]=d.useState(!1),[Ki,ri]=d.useState(!1),[vi,Ii]=d.useState(null),[os,di]=d.useState(""),[k,te]=d.useState(""),[D,fe]=d.useState(""),[qe,yi]=d.useState(null),[ee,Be]=d.useState(null),[we,Ti]=d.useState(!1),[Te,Ue]=d.useState({isOpen:!1,data:null}),[Ci,ze]=d.useState(!1),[Ni,Ce]=d.useState(!1),[re,cs]=d.useState(null),Ri=Ot(),{isProfileFreezed:O,user:ls}=d.useContext(dr),[ni,Ws]=d.useState(null),[ft,Ai]=d.useState({characters:null,locations:null,requirements:null}),[Us,jt]=d.useState(!1),[ki,Js]=d.useState(!1),[gt,oi]=d.useState(!1),[Mi,as]=d.useState(null),[ui,qi]=d.useState({min_pay:"",max_pay:"",expected_days_of_shoot:""}),[hi,Ss]=d.useState(!1),[ds,Yi]=d.useState(!1),Ls=()=>Yi(!0),Je=d.useRef(null),us=d.useRef(null),Qi=d.useRef(null),Gs=d.useRef(null),xe=(i,t=75)=>{const n=()=>
1{if(!(i!=null&&i.current))return;const c=i.current.querySelector(".MuiDataGrid-virtualScroller");c&&(c.scrollTop=c.scrollHeight-c.clientHeight-t)};requestAnimationFrame(()=>{n(),setTimeout(n,100)})},Ks=i=>{Je.current&&Je.current.contains(i.target)||Yi(!1)},hs=[{id:0,value:"Female"},{id:1,value:"Male"},{id:2,value:"Neutral"}],Oi=(i,t,n,c)=>{switch(i){case"1":xi(t,n);break;case"2":et(t,n);break;case"3":it(t,n);break}},xs=(i,t,n)=>{switch(i){case"1":t!=null&&t.id?oe({isOpen:!0,data:{character:t,index:n}}):(fs(null,n),Ai(c=>({...c,characters:null})),F(null));break;case"2":t!=null&&t.id?V({isOpen:!0,data:{character:t,index:n}}):(Ts(null,n),Ai(c=>({...c,locations:null})),Se(null));break;case"3":t!=null&&t.id?Ue({isOpen:!0,data:{character:t,index:n}}):(ps(null,n),Ai(c=>({...c,requirements:null})),Be(null));break}},Ys=(i,t,n)=>{switch(i){case"1":ve(n),js(t);break;case"2":Ii(n),Rs(t);break;case"3":cs(n),Ms(t);break}},Ei=i=>{fi(i)},Ps=i=>{Ri(`/find-talents?character_id=${i==null?void 0:i.id}&gender=${i==null?void 0:i.gender}&min_age=${i==null?void 0:i.min_age}&max_age=${i==null?void 0:i.max_age}&min_height=${i==null?void 0:i.min_height}&height_size_type=${i==null?void 0:i.height_size_type}`)},Bs=ot().shape(Y=="1"?{characterList:Ct().of(ot().shape({character_name:vs().required("Please enter the character name"),min_age:Nt().required("Please enter minimum age"),max_age:Nt().min(Ar("min_age"),"Max Age must be greater than Min Age").required("Max Age must be greater than Min Age"),min_height:Nt(),gender:vs().required("Please select gender")}))}:Y=="2"?{characterList:Ct().of(ot().shape({location:vs().required("Please enter the location"),locked_location:vs().required("please Enter locked location")}))}:{characterList:Ct().of(ot().shape({special_requirement:vs().required("Please enter the special Requirement"),locked_special_requirement:vs().required("please Enter locked requirement")}))}),m=kt({initialValues:{characterList:x??[]},enableReinitialize:!0,validationSchema:Bs,onSubmit:({characterList:i},{setStatus:t,setSubmitting:n},c)=>{var u;if(s!=null&&s.id&&(N==null||N=="newCharacter")){H(!0);let h=(u=i.filter(p=>!p.id))==null?void 0:u.map(p=>(delete p.index,{...p,project_id:s==null?void 0:s.id,recruiter_id:s==null?void 0:s.recruiter_id,character_name:p.character_name.toLocaleUpperCase()}));h!=null&&h.length?He.createCharacter(h).then(p=>{Q(!0),s!=null&&s.id&&$e(s==null?void 0:s.id,s==null?void 0:s.recruiter_id),H(!1)}):H(!1)}}}),A=kt({initialValues:{characterList:ei??[]},enableReinitialize:!0,validationSchema:Bs,onSubmit:({characterList:i},{setStatus:t,setSubmitting:n},c)=>{var h;if(s!=null&&s.id&&(X==null||X=="newCharacter")){We(!0);let p=(h=i.filter(_=>!_.id))==null?void 0:h.map(_=>(delete _.index,{..._}));if(p!=null&&p.length){console.log("hello",p,s==null?void 0:s.id,s==null?void 0:s.recruiter_id);var u=p.map(function(_){return{backup_location:_.backup_location,location:_.location,locked_location:_.locked_location,project_id:s.id,recruiter_id:s.recruiter_id}});ne.addLocation(u).then(_=>{ri(!0),ms(),We(!1)})}else We(!1)}}}),I=kt({initialValues:{characterList:qe??[]},enableReinitialize:!0,validationSchema:Bs,onSubmit:({characterList:i},{setStatus:t,setSubmitting:n},c)=>{var h;if(s!=null&&s.id&&(ee==null||ee=="newCharacter")){ze(!0);let p=(h=i.filter(_=>!_.id))==null?void 0:h.map(_=>(delete _.index,{..._}));if(p!=null&&p.length){var u=p.map(function(_){return{backup_special_requirement:_.backup_special_requirement,locked_special_requirement:_.locked_special_requirement,special_requirement:_.special_requirement,project_id:s.id,recruiter_id:s.recruiter_id}});ne.addSpecialRequirements(u).then(_=>{Ce(!0),Zi(),ze(!1)})}else ze(!1)}}}),ci=()=>{var n,c,u;ve(null);let i={character_name:"",min_age:"",max_age:"",min_height:0,height_size_type:"in",gender:"",index:(n=m.values.characterList)!=null&&n.length?((u=(c=m.values.characterList)==null?void 0:c.find(h=>h.id))==null?void 0:u.id)+10:2*Math.floor(Math.random()*10)};$(0),S(97);const t=m.values.characterList?[...m.values.characterList]:[];F("newCharacter"),m.setFieldValue("characterList",[...t,i])};d.useEffect(()=>{U==!0&&setTimeout(()=>{ci()},1e3)},[U]),d.useEffect(()=>{N==="newCharacter"&&xe(us)},[N,(zs=m.values.characterList)==null?void 0:zs.length]),d.useEffect(()=>{X==="newCharacter"&&xe(Qi)},[X,(st=A.values.characterList)==null?void 0:st.length]),d.useEffect(()=>{ee==="newCharacter"&&xe(Gs)},[ee,($s=I.values.characterList)==null?void 0:$s.length]);const $e=async(i,t,n)=>{let c=n>=0?m.values.characterList.filter((u,h)=>h!=n).filter(u=>!u.id):null;return await He.getCharacterListById(i,s==null?void 0:s.recruiter_id).then(u=>{if(u!=null&&u.characters){const h=[...u.characters].sort((p,_)=>(p.id??0)-(_.id??0));c!=null&&c.length?(j([...h,...c]),F("newCharacter"),m.resetForm()):(j(h),F(null),m.resetForm())}return u}).finally(()=>_e(!1))},Qs=(i,t)=>{me(t)},xi=(i,t)=>{if(m.isValid){H(!0);let n={...t,character_name:t.character_name.toLocaleUpperCase()};He.updateCharacterbyId(i,n).then(c=>{$e(s==null?void 0:s.id,s==null?void 0:s.recruiter_id).then(u=>{H(!1)}),F(null),Ai(u=>({...u,characters:null}))})}else m.handleSubmit()},fs=(i,t)=>{var n;if(i){K(!0),He.deleteCharacterbyId(i).then(c=>{$e(s==null?void 0:s.id,s==null?void 0:s.recruiter_id)}).finally(()=>{oe({isOpen:!1,data:null}),K(!1)});return}if(t>=0){let c=((n=m.values.characterList)==null?void 0:n.filter((u,h)=>h!=t))??[];m.setFieldValue("characterList",c)}},Hi=async i=>{var t,n;if(!ki)try{const c=[{character_name:`COPY OF ${i.character_name}`,min_age:i.min_age,max_age:i.max_age,min_height:i.min_height,height_size_type:i.height_size_type,gender:i.gender,project_id:s==null?void 0:s.id,recruiter_id:s==null?void 0:s.recruiter_id}],u=await He.createCharacter(c);if((t=i==null?void 0:i.auditionData)!=null&&t.id&&u){const h=Array.isArray(u)?(n=u[0])==null?void 0:n.id:u==null?void 0:u.id;if(h&&He.duplicateAudition){const p={min_pay:i.auditionData.min_pay??0,max_pay:i.auditionData.max_pay??0,expected_days_of_shoot:i.auditionData.expected_days_of_shoot??0,gender:i.auditionData.gender??i.gender,min_age:i.auditionData.min_age??i.min_age,max_age:i.auditionData.max_age??i.max_age,min_height:i.auditionData.min_height??i.min_height,height_size_type:i.auditionData.height_size_type??i.height_size_type,special_requirements:i.auditionData.special_requirements??"",location:i.auditionData.location??null,job_expiry:i.auditionData.job_expiry??null,
1job_poster:i.auditionData.job_poster??"",project_id:i.auditionData.project_id??null,recruiter:i.auditionData.recruiter??(s==null?void 0:s.recruiter_id),recruiterProject_id:s==null?void 0:s.id,recruiterCharacter_id:h,isSubmitted:!1,is_open_audition_posted:!1,isBanned:!1};await He.duplicateAudition(i.auditionData.id,h,p)}}await $e(s==null?void 0:s.id,s==null?void 0:s.recruiter_id),oi(!0),xe(us)}catch(c){console.error("Duplicate character error:",c)}finally{Js(!1)}},Zs=async i=>{if(i){Ss(!0);try{const t={min_pay:ui.min_pay?Number(ui.min_pay):0,max_pay:ui.max_pay?Number(ui.max_pay):0,expected_days_of_shoot:ui.expected_days_of_shoot?Number(ui.expected_days_of_shoot):0};await He.updateAuditionById(i,t),await $e(s==null?void 0:s.id,s==null?void 0:s.recruiter_id),as(null),qi({min_pay:"",max_pay:"",expected_days_of_shoot:""})}catch(t){console.error("Save pay fields error:",t)}finally{Ss(!1)}}};d.useEffect(()=>{s!=null&&s.id&&(s!=null&&s.recruiter_id)&&($e(s==null?void 0:s.id,s==null?void 0:s.recruiter_id),He.getAllCharacterData(s==null?void 0:s.recruiter_id,s==null?void 0:s.id).then(i=>{Ws(i[0])}))},[s]);const Xs=(i,t=Math.round(i/2.54))=>({feet:Math.floor(t/12),inches:t%12}),mt=i=>{let t=Xs(i),n="";return t.feet==1?n=t.inches+1:n=(t.feet-1)*12+(t.inches+1),n},Ds=i=>{let t=Si("in",i);t=t.split(" ").join(".");let n=t.match(/\d/g);n=(n==null?void 0:n.length)<3?n.join("."):(n==null?void 0:n.length)===3?`${n[0]}.${n[1]}${n[1]}`:null;let c=n.split(".");return t=c.length===2?c[0]*30.48+c[1]*2.54:c[0]*30.48,t.toFixed(1)};function Si(i,t){if(i=="in"){let n="",c="";return t<=12?(n=t-1,n>0?n="1ft "+n+"in":n="1ft"):(n=t/12,Number.isInteger(n)?(n=n,c=11):(n=parseInt(t/12),c=t-12*n,c=c-1,n=n+1),c>0?n=n+"ft "+c+"in":n=n+"ft"),n}else return t+" cm"}const Vi=(i,t,n,c)=>{let u=[...m.values.characterList];i==="height"&&(t==="in"&&c.height_size_type!=="in"?(u[n]={...c,height_size_type:"in",min_height:mt(c.min_height)},m.setFieldValue("characterList",u),$(0),S(97)):t==="cm"&&c.height_size_type!=="cm"&&(u[n]={...c,height_size_type:"cm",min_height:Ds(c.min_height)},m.setFieldValue("characterList",u),$(0),S(274)))},fi=i=>{navigator.clipboard.writeText(`${Cs.client_url}/jobs/${i}`).then(function(){ke(i),setTimeout(()=>ke(null),9e3)})},js=i=>{if(i){H(!0),delete i.index;let t=[{...i,project_id:s==null?void 0:s.id,recruiter_id:s==null?void 0:s.recruiter_id,character_name:i.character_name.toLocaleUpperCase()}];t!=null&&t.length&&He.createCharacter(t).then(n=>{Q(!0),s!=null&&s.id?$e(s==null?void 0:s.id,s==null?void 0:s.recruiter_id,(i==null?void 0:i.index_sno)-1):F(null),H(!1)}).finally(()=>{H(!1)})}};var Wi=new Date().toISOString().slice(0,10);const gs=(i,t)=>{window.open(`/share-shortlists/${i}-${t}`,"_blank")},je=i=>{const t=(i??[]).map((c,u)=>({...c,index_sno:u+1})),n=Array(Nn).fill(null).map((c,u)=>({id:`__empty__${u}`,isEmpty:!0,index_sno:t.length+u+1}));return[...t,...n]},pt=[{field:"index_sno",headerName:"Row",width:40,align:"center",headerAlign:"center",renderCell:i=>{var t;return(t=i.row)!=null&&t.isEmpty?e.jsx("span",{}):e.jsx("span",{children:i.row.index_sno})}},{field:"character_name",headerName:"Character name",width:150,align:"left",headerAlign:"left",renderCell:i=>{var h,p,_,M,q,L,R,P,w;if((h=i.row)!=null&&h.isEmpty)return e.jsx("span",{});let t=[...m.values.characterList],n=(p=i.row)!=null&&p.id?m.values.characterList.findIndex(T=>{var he;return T.id===((he=i.row)==null?void 0:he.id)}):i.row.index_sno-1;const c=((_=m.errors.characterList)==null?void 0:_.length)&&m.errors.characterList[n]||{},u=ue==i.row.index_sno-1?!0:((M=m.touched.characterList)==null?void 0:M.length)&&m.touched.characterList[n]||{};return e.jsx("strong",{children:(q=i.row)!=null&&q.id&&N==n||!((L=i.row)!=null&&L.id)?e.jsx(ae,{id:"standard-search",variant:"standard",placeholder:"",slotProps:{input:{autoComplete:"new-password"}},name:"character_name",className:`${(R=i.row)!=null&&R.character_name?"value":""}`,defaultValue:(P=i.row)==null?void 0:P.character_name,onChangeCapture:T=>{t[n]={...i.row,character_name:T.target.value},m.setFieldValue("characterList",t)},error:(c==null?void 0:c.character_name)&&((u==null?void 0:u.character_name)||u===!0),onKeyDown:T=>T.stopPropagation()}):e.jsx("p",{className:"characterTableTextBold",children:(w=i.row)==null?void 0:w.character_name})})}},{field:"gender",headerName:"Gender",width:115,align:"center",headerAlign:"center",renderCell:i=>{var h,p,_,M,q,L,R,P;if((h=i.row)!=null&&h.isEmpty)return e.jsx("span",{});let t=[...m.values.characterList],n=(p=i.row)!=null&&p.id?m.values.characterList.findIndex(w=>{var T;return w.id===((T=i.row)==null?void 0:T.id)}):i.row.index_sno-1;const c=((_=m.errors.characterList)==null?void 0:_.length)&&m.errors.characterList[n]||{},u=ue==i.row.index_sno-1?!0:((M=m.touched.characterList)==null?void 0:M.length)&&m.touched.characterList[n]||{};return e.jsx("strong",{className:`w-full ${typeof((q=i.row)==null?void 0:q.gender)=="number"?"value":""}`,children:(L=i.row)!=null&&L.id?e.jsx("p",{className:"characterTableText",children:((P=hs.find(w=>{var T;return w.id==((T=i.row)==null?void 0:T.gender)}))==null?void 0:P.value)??""}):e.jsx("div",{className:"flex w-full",children:e.jsxs("div",{className:"InsideFlexGender",children:[e.jsx("div",{style:{width:"90%"},children:e.jsx(Et,{name:"gender",error:(c==null?void 0:c.gender)&&((u==null?void 0:u.gender)||u===!0),data:hs,autoComplete:!0,dropdownName:"value",handleChange:w=>{t[n]={...i.row,gender:w},m.setFieldValue("characterList",t)},values:(R=i.row)==null?void 0:R.gender,onkeyDownForTable:w=>w.stopPropagation(),disablePortal:!1})}),e.jsx("div",{children:e.jsx(C,{title:"Cannot be changed later",arrow:!0,placement:"top-start",children:e.jsx("img",{src:Rr,alt:""})})})]})})})}},{field:"min_age",headerName:"Min age",width:70,align:"center",headerAlign:"center",renderCell:i=>{var h,p,_,M,q,L,R,P,w;if((h=i.row)!=null&&h.isEmpty)return e.jsx("span",{});let t=[...m.values.characterList],n=(p=i.row)!=null&&p.id?m.values.characterList.findIndex(T=>{var he;return T.id===((he=i.row)==null?void 0:he.id)}):i.row.index_sno-1;const c=((_=m.errors.characterList)==null?void 0:_.length)&&m.errors.characterList[n]||{},u=ue==i.row.index_sno-1?!0:((M=m.touched.characterList)==null?void 0:M.length)&&m.touched.characterList[n]||{};return e.jsx(e.Fragment,{children:(q=i.row)!=null&&q.id&&N==n||!((L=i.row)!=null&&L.id)?e.jsx(ae,{id:"standard-basic",variant:"standard",placeholder:"",slotProps:{input:{autoComplete:"new-password"}},name:"min_age",className:`${(R=i.row)!=null&&R.min_age?"value":""}`,defaultValue:(P=i.row)==null?void 0:P.min_age,onChangeCapture:T=>{t[n]={...i.row,min_age:T.target.value},m.setFieldValue("characterList",t)},error:(c==null?void 0:c.min_age)&&((u==null?void 0:u.min_age)||u===!0),onKeyDown:T=>T.stopPropagation()}):e.jsx("p",{className:"characterTableText",children:(w=i.row)==null?void 0:w.min_age})})}},{field:"max_age",headerName:"Max age",width:85,align:"center",headerAlign:"center",renderCell:i=>{var h,p,_,M,q,L,R,P,w;if((h=i.row)!=null&&h.isEmpty)return e.jsx("span",{});let t=[...m.values.characterList],n=(p=i.row)!=null&&p.id?m.values.characterList.findIndex(T=>{var he;return T.id===((he=i.row)==null?void 0:he.id)}):i.row.index_sno-1;const c=((_=m.errors.characterList)==null?void 0:_.length)&&m.errors.characterList[n]||{},u=ue==i.row.index_sno-1?!0:((M=m.touched.characterList)==null?void 0:M.length)&&m.touched.characterList[n]||{};return e.jsx(e.Fragment,{children:(q=i.row)!=null&&q.id&&N==n||!((L=i.row)!=null&&L.id)?e.jsx(ae,{id:"standard-search",name:"max_age",placeholder:"",variant:"standard",className:`${(R=i.row)!=null&&R.max_age?"value":""}`,defaultValue:(P=i.row)==null?void 0:P.max_age,onChangeCapture:T=>{t[n]={...i.row,max_age:T.target.value},m.setFieldValue("characterList",t)},error:(c==null?void 0:c.max_age)&&((u==null?void 0:u.max_age)||u===!0),onKeyDown:T=>T.stopPropagation()}):e.jsx("p",{className:"characterTableText",children:(w=i.row)==null?void 0:w.max_age})})}},{field:"min_height",headerName:"Min height (Optional)",align:"center",headerAlign:"center",width:N!==null&&N>=0||N=="newCharacter"||(r=(Os=m.values.characterList)==null?void 0:Os.filter(i=>!i.id))!=null&&r.length?260:160,renderCell:i=>{var c,u,h,p,_,M,q,L;if((c=i.row)!=null&&c.isEmpty)return e.jsx("span",{});let t=[...m.values.characterList],n=(u=i.row)!=null&&u.id?m.values.characterList.findIndex(R=>{var P;return R.id===((P=i.row)==null?void 0:P.id)}):i.row.index_sno-1;return e.jsx(e.Fragment,{children:(h=i.row)!=null&&h.id&&N==n||!((p=i.row)!=null&&p.id)?e.jsxs("div",{className:"sliderCharacter flex form_left w-full",children:[e.jsx(ar,{name:"min_height",valueLabelFormat:Si(i.row.height_size_type,i.row.min_height),valueLabelDisplay:"on",marks:i.row.height_size_type==="in"?mr:pr,min:le,max:ge,onChange:(R,P)=>{t[n]={...i.row,min_height:P},m.setFieldValue("characterList",t)},value:(_=i.row)==null?void 0:_.min_height,style:{width:"60%",marginLeft:"10px",marginRight:"20px"}}),e.jsxs("div",{className:"right_button flex",children:[e.jsx("button",{type:"button",className:i.row.height_size_type==="in"?"physical_button_active":"physical_button_inactive",onClick:()=>{Vi("height","in",n,i.row)},children:"ft/in"}),e.jsx("button",{type:"button",className:i.row.height_size_type==="cm"?"physical_button_active":"physical_button_inactive",onClick:()=>{Vi("height","cm",n,i.row)},children:"cm"})]})]}):e.jsx("p",{className:"characterTableText",children:((M=i.row)==null?void 0:M.min_height)>0?Si((q=i.row)==null?void 0:q.height_size_type,(L=i.row)==null?void 0:L.min_height):"NA"})})}},{field:"audition",headerName:"Job Posting",width:135,align:"center",headerAlign:"center",renderCell:i=>{var t,n,c,u,h,p,_,M,q,L,R,P,w,T,he,Qe,Ze,Xe,mi,pi,_i;return(t=i.row)!=null&&t.isEmpty?e.jsx("span",{}):e.jsx(e.Fragment,{children:e.jsx("strong",{children:(n=i==null?void 0:i.row)!=null&&n.id&&!l?e.jsxs("p",{className:O?"freeze_text_color flex gap-2 justify-center items-center":"flex gap-2 justify-center items-center",children:[e.jsx("span",{className:"character_link font-semibold cursor-pointer ",onClick:!O&&((c=i==null?void 0:i.row)==null?void 0:c.isDeleted)===!1?()=>{var Ae,Me,de,pe;Ri("/app/audition",{state:(Me=(Ae=i==null?void 0:i.row)==null?void 0:Ae.auditionData)!=null&&Me.id?{poster_id:(pe=(de=i==null?void 0:i.row)==null?void 0:de.auditionData)==null?void 0:pe.id}:i==null?void 0:i.row})}:"",children:((u=i==null?void 0:i.row)==null?void 0:u.isDeleted)===!0?e.jsx("span",{className:"flex flex-col character_color",children:"Character is Deleted"}):(p=(h=i==null?void 0:i.row)==null?void 0:h.auditionData)!=null&&p.isBanned?e.jsx(C,{title:"Click to view the Closed Job Posting",placement:"top",children:e.jsx("div",{className:"flex flex-col",children:"Closed"})}):((M=(_=i==null?void 0:i.row)==null?void 0:_.auditionData)==null?void 0:M.job_expiry)<Wi?e.jsx(C,{title:"Click to view the Expired Job Posting",placement:"top",children:e.jsx("div",{className:"flex flex-col",children:"Expired"})}):((L=(q=i==null?void 0:i.row)==null?void 0:q.auditionData)==null?void 0:L.is_open_audition_posted)===!0?e.jsx(C,{title:"Click to edit the Job Posting",placement:"top",children:e.jsx("span",{className:"flex flex-col",children:"Live"})}):(P=(R=i==null?void 0:i.row)==null?void 0:R.auditionData)!=null&&P.isSubmitted?e.jsx(C,{title:"Edit the Under Review Job Posting",placement:"top",children:e.jsx("span",{className:"flex flex-col",children:"Under review"})}):(T=(w=i==null?void 0:i.row)==null?void 0:w.auditionData)!=null&&T.id?e.jsx(C,{title:"Your audition is in draft. Click to edit/submit",placement:"top",children:e.jsx("span",{className:"flex flex-col",children:"In Draft"})}
1):e.jsx(C,{title:"Post to receive applications from talents",placement:"top",children:e.jsx("span",{className:"flex flex-col",children:"Post"})})}),"    ",((Qe=(he=i==null?void 0:i.row)==null?void 0:he.auditionData)==null?void 0:Qe.is_open_audition_posted)===!0&&((Xe=(Ze=i==null?void 0:i.row)==null?void 0:Ze.auditionData)==null?void 0:Xe.jobUniqueId)&&e.jsxs(e.Fragment,{children:[e.jsx(C,{title:(ce==null?void 0:ce.length)>2?"Copied":"Copy link",placement:"top",children:e.jsx(ie,{"aria-label":"favorite",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",onClick:()=>{var Ae,Me;fi((Me=(Ae=i==null?void 0:i.row)==null?void 0:Ae.auditionData)==null?void 0:Me.jobUniqueId)},children:e.jsx(jr,{fontSize:"inherit",sx:{color:"#9B26B6"}})})}),"    ",((mi=i==null?void 0:i.row)==null?void 0:mi.isDeleted)===!1?e.jsx(C,{title:"View Applicants",placement:"top",children:e.jsxs(ie,{"aria-label":"favorite",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",onClick:()=>{var Ae,Me;window.open(`/app/my-job-postings#project_id${(Ae=i.row)==null?void 0:Ae.project_id}#character_id#${(Me=i.row)==null?void 0:Me.id}`,"_blank")},children:[e.jsx("strong",{style:{color:"#9B26B6",cursor:"pointer",fontSize:16,fontWeight:600},children:((pi=i==null?void 0:i.row)==null?void 0:pi.JobApplicantCount.length)>0?(_i=i==null?void 0:i.row)==null?void 0:_i.JobApplicantCount.length:0}),e.jsx(gr,{fontSize:"inherit",sx:{color:"#9B26B6"}})]})}):null]})]}):e.jsx("p",{className:"characterTableText",children:"---"})})})}},{field:"find",headerName:"Shortlisted",width:100,align:"center",headerAlign:"center",renderCell:i=>{var t,n,c,u,h;return(t=i.row)!=null&&t.isEmpty?e.jsx("span",{}):e.jsx(e.Fragment,{children:e.jsx("strong",{className:"w-full flex justify-center",children:(n=i==null?void 0:i.row)!=null&&n.id&&!l&&((c=i==null?void 0:i.row)==null?void 0:c.isDeleted)===!1?e.jsx(C,{title:"View Shortlist",placement:"top",children:e.jsx(ie,{"aria-label":"favorite",style:{padding:2,fontSize:"1.6em"},color:"#FFFFFF",onClick:()=>{Ri("/app/short-list",{state:i.row.id}),window.scrollTo(0,0)},children:e.jsx("p",{style:{color:"#9B26B6",fontSize:16,fontWeight:600},children:((h=(u=i==null?void 0:i.row)==null?void 0:u.recruiterShortlist)==null?void 0:h.length)??0})})}):e.jsx("p",{className:"characterTableText",children:"---"})})})}},{field:"action",headerName:"Actions",width:160,align:"center",headerAlign:"center",renderCell:i=>{var u,h,p,_,M,q,L,R,P,w,T,he,Qe,Ze,Xe,mi,pi,_i,Ae,Me,de,pe,De,nt,Dt,er,ir;if((u=i.row)!=null&&u.isEmpty)return e.jsx("span",{});let t=(h=i.row)!=null&&h.id?m.values.characterList.findIndex(si=>{var wi;return si.id===((wi=i.row)==null?void 0:wi.id)}):i.row.index_sno-1;const n=((p=m.errors.characterList)==null?void 0:p.length)&&m.errors.characterList[t]||{},c=((_=m.touched.characterList)==null?void 0:_.length)&&m.touched.characterList[t]||{};return(M=i.row)==null||M.id,e.jsx(e.Fragment,{children:e.jsxs("strong",{className:"w-full flex justify-center",children:[((q=i==null?void 0:i.row)==null?void 0:q.id)&&!l&&e.jsx(C,{title:((L=i==null?void 0:i.row)==null?void 0:L.isDeleted)===!0?"Character is deleted":"Find Talents",placement:"top",children:e.jsx(ie,{"aria-label":"favorite",style:{padding:2,fontSize:"1.6em"},color:"#FFFFFF",onClick:()=>{var si,wi,Ji,wt,sr,tr,rr;((si=i==null?void 0:i.row)==null?void 0:si.isDeleted)!==!0&&window.open(`${Cs.client_url}/find-talents?character_id=${(wi=i==null?void 0:i.row)==null?void 0:wi.id}&gender=${(Ji=i==null?void 0:i.row)==null?void 0:Ji.gender}&min_age=${(wt=i==null?void 0:i.row)==null?void 0:wt.min_age}&max_age=${(sr=i==null?void 0:i.row)==null?void 0:sr.max_age}&min_height=${(tr=i==null?void 0:i.row)==null?void 0:tr.min_height}&height_size_type=${(rr=i==null?void 0:i.row)==null?void 0:rr.height_size_type}`,"_blank")},children:e.jsx(Ht,{fontSize:"inherit",sx:{color:((R=i==null?void 0:i.row)==null?void 0:R.isDeleted)===!1?"#9B26B6":"#9f9f9f"}})})}),((P=i==null?void 0:i.row)==null?void 0:P.isDeleted)===!0?((T=(w=i==null?void 0:i.row)==null?void 0:w.recruiterProject)==null?void 0:T.project_status)===1?e.jsx(C,{title:"Character is deleted",placement:"top",children:e.jsx(ie,{"aria-label":"favorite",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",children:e.jsx(Ne,{fontSize:"inherit",sx:{color:!O&&!((he=i==null?void 0:i.row)!=null&&he.isDeleted)?"#9B26B6":"#9f9f9f"}})})}):null:((Qe=i.row)==null?void 0:Qe.id)&&!l&&e.jsxs(e.Fragment,{children:[((Xe=(Ze=i==null?void 0:i.row)==null?void 0:Ze.auditionData)==null?void 0:Xe.isBanned)===!1&&((pi=(mi=i==null?void 0:i.row)==null?void 0:mi.auditionData)==null?void 0:pi.isSubmitted)===!0&&!((Ae=(_i=i==null?void 0:i.row)==null?void 0:_i.auditionData)!=null&&Ae.is_open_audition_posted)?e.jsx(C,{title:"Cannot edit when Under Review ",placement:"top",children:e.jsx(ie,{"aria-label":"favorite",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",children:e.jsx(Ne,{fontSize:"inherit",sx:{color:!O&&!((Me=i==null?void 0:i.row)!=null&&Me.isDeleted)?"#9B26B6":"#9f9f9f"}})})}):(N==null||N!=t)&&(N==="newCharacter"?e.jsx(C,{title:"Only one character can be edited at a time",placement:"top",children:e.jsx(ie,{"aria-label":"favorite",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",children:e.jsx(Ne,{fontSize:"inherit",sx:{color:!O&&!((de=i==null?void 0:i.row)!=null&&de.isDeleted)?"#9B26B6":"#9f9f9f"}})})}):e.jsx(C,{title:"Edit character",placement:"top",children:e.jsx(ie,{"aria-label":"favorite",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",onClick:O?"":()=>
1F(t),children:e.jsx(Ne,{fontSize:"inherit",sx:{color:!O&&!((pe=i==null?void 0:i.row)!=null&&pe.isDeleted)?"#9B26B6":"#9f9f9f"}})})})),N==t&&e.jsxs("div",{className:"flex",children:[e.jsx(C,{title:"Save",placement:"top",children:e.jsx(ie,{"aria-label":"favorite",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",onClick:()=>{var si;return O?"":xi((si=i.row)==null?void 0:si.id,i.row)},children:Z?e.jsx("div",{style:{minWidth:25},children:e.jsx("span",{className:"",children:e.jsx(es,{size:"70%",sx:{color:"#9B26B6"}})})}):e.jsx(bi,{fontSize:"inherit",sx:{color:O?"#9f9f9f":"#9B26B6"}})})}),e.jsx(C,{title:"Cancel",placement:"top",children:e.jsx(ie,{"aria-label":"favorite",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",onClick:O?"":()=>{F(null),m.resetForm()},children:e.jsx(ts,{sx:{color:O?"#9f9f9f":"#9B26B6"},className:"cursor-pointer"})})})]})]}),!((De=i.row)!=null&&De.id)&&e.jsx("div",{className:"",children:e.jsx(Ft,{isLoading:ue===i.row.index_sno-1&&Z,onClick:O?"":()=>{var si,wi,Ji;ve(i.row.index_sno-1),(((si=Object.keys(n))==null?void 0:si.length)===0&&((wi=Object.keys(c))==null?void 0:wi.length)===0||((Ji=Object.keys(n))==null?void 0:Ji.length)===0)&&js(i.row)}})}),(N==null||N!=t)&&!l&&e.jsx(C,{title:((nt=i==null?void 0:i.row)==null?void 0:nt.isDeleted)===!0?"Character is deleted":"Delete character",placement:"top",children:e.jsx(ie,{"aria-label":"favorite",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",onClick:O?"":()=>{var si,wi,Ji;if(((si=i==null?void 0:i.row)==null?void 0:si.isDeleted)!==!0){if((wi=i.row)!=null&&wi.id){oe(wt=>({isOpen:!0,data:{character:i.row,index:indexedDB}}));return}fs(null,((Ji=i.row)==null?void 0:Ji.index_sno)-1),F(null)}},children:e.jsx(rs,{sx:{color:!O&&!((Dt=i==null?void 0:i.row)!=null&&Dt.isDeleted)?"#9B26B6":"#9f9f9f",fontSize:20}})})}),((er=i==null?void 0:i.row)==null?void 0:er.id)&&!l&&((ir=i==null?void 0:i.row)==null?void 0:ir.isDeleted)===!1&&!O&&e.jsx(C,{title:"Duplicate character",placement:"top",children:e.jsx(ie,{"aria-label":"duplicate",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",disabled:ki,onClick:()=>Hi(i.row),children:ki?e.jsx(es,{size:16,sx:{color:"#9B26B6"}}):e.jsx(dn,{fontSize:"inherit",sx:{color:"#9B26B6"}})})})]})})}},{field:"lock",headerName:"Locked talent",width:150,align:"center",headerAlign:"center",renderCell:i=>{var t,n,c,u,h,p,_,M,q;return(t=i.row)!=null&&t.isEmpty?e.jsx("span",{}):(n=i==null?void 0:i.row)!=null&&n.offeredTalent&&((u=(c=i==null?void 0:i.row)==null?void 0:c.offeredTalent)==null?void 0:u.length)!==0?e.jsx("div",{className:"flex gap-2 flex-wrap py-2  w-full ",children:(p=(h=i==null?void 0:i.row)==null?void 0:h.offeredTalent)==null?void 0:p.map(L=>{var R,P,w,T;return e.jsxs("div",{className:"flex justify-center items-center gap-2 w-full",children:[e.jsx("div",{className:"w-1/4",style:{height:50,width:50},children:e.jsx("img",{src:(P=(R=L==null?void 0:L.userData)==null?void 0:R.gallaryData)==null?void 0:P.file_url,alt:`${(w=L==null?void 0:L.userData)==null?void 0:w.first_name}-image`,style:{width:"100%",height:"100%",objectFit:"contain"},className:"cursor-pointer",onClick:()=>{var he;window.open(`/talent/${(he=L==null?void 0:L.userData)==null?void 0:he.userUniqueId}`,"_blank")}})}),e.jsx("p",{className:"w-3/4 whitespace-nowrap overflow-hidden overflow-ellipsis lockedText",children:(T=L==null?void 0:L.userData)==null?void 0:T.first_name})]})})}):e.jsx("div",{className:"flex justify-center items-center gap-4",children:(_=i.row)!=null&&_.character_name?e.jsx(C,{title:"Locked talent will show up here",placement:"top",children:e.jsx("div",{className:"LockedTalentCard",children:(q=(M=i.row)==null?void 0:M.character_name)==null?void 0:q.slice(0,1)})}):e.jsx("p",{className:"characterTableText text-center",children:"---"})})}},{field:"min_pay",headerName:"Min Pay",width:110,align:"center",headerAlign:"center",renderCell:i=>{var c,u,h,p,_,M,q,L,R;if((c=i.row)!=null&&c.isEmpty)return e.jsx("span",{});const t=!!((h=(u=i.row)==null?void 0:u.auditionData)!=null&&h.id),n=Mi===((p=i.row)==null?void 0:p.id);return t?n?e.jsxs(e.Fragment,{children:[e.jsx(ae,{variant:"standard",placeholder:"Min Pay",size:"small",type:"number",value:ui.min_pay,onChange:P=>qi(w=>({...w,min_pay:P.target.value})),onKeyDown:P=>P.stopPropagation(),style:{width:80}}),e.jsxs("div",{className:"flex",children:[e.jsx(C,{title:"Save Pay",placement:"top",children:e.jsx(ie,{style:{padding:2,fontSize:"1.5em"},onClick:()=>{var P,w;return Zs((w=(P=i.row)==null?void 0:P.auditionData)==null?void 0:w.id)},disabled:hi,children:hi?e.jsx(es,{size:16,sx:{color:"#9B26B6"}}):e.jsx(bi,{fontSize:"inherit",sx:{color:"#9B26B6"}})})}),e.jsx(C,{title:"Cancel",placement:"top",children:e.jsx(ie,{style:{padding:2,fontSize:"1.5em"},onClick:()=>{as(null),qi({min_pay:"",max_pay:"",expected_days_of_shoot:""})},children:e.jsx(ts,{sx:{color:"#9B26B6"},className:"cursor-pointer"})})})]})]}):e.jsxs("div",{className:"flex items-center gap-1",children:[((_=i.row)==null?void 0:_.auditionData)&&e.jsx(C,{title:"Edit Pay and 
1Shoot Days",placement:"top",children:e.jsx(ie,{size:"small",style:{padding:2,fontSize:"1em"},onClick:()=>{var P,w,T,he,Qe,Ze,Xe;as((P=i.row)==null?void 0:P.id),qi({min_pay:((T=(w=i.row)==null?void 0:w.auditionData)==null?void 0:T.min_pay)??"",max_pay:((Qe=(he=i.row)==null?void 0:he.auditionData)==null?void 0:Qe.max_pay)??"",expected_days_of_shoot:((Xe=(Ze=i.row)==null?void 0:Ze.auditionData)==null?void 0:Xe.expected_days_of_shoot)??""})},children:e.jsx("img",{src:"https://img.icons8.com/?size=100&id=89447&format=png&color=000000",style:{width:20,height:20,objectFit:"contain",display:"block",flexShrink:0,filter:"brightness(0) saturate(100%) invert(24%) sepia(71%) saturate(3097%) hue-rotate(280deg) brightness(84%) contrast(93%)"},alt:"Edit"})})}),e.jsx("p",{className:"characterTableText mb-0",children:((q=(M=i.row)==null?void 0:M.auditionData)==null?void 0:q.min_pay)!=null&&((R=(L=i.row)==null?void 0:L.auditionData)==null?void 0:R.min_pay)!==0?`₹${i.row.auditionData.min_pay}`:"---"})]}):e.jsx("span",{})}},{field:"max_pay",headerName:"Max Pay",width:110,align:"center",headerAlign:"center",renderCell:i=>{var c,u,h,p,_,M,q,L;if((c=i.row)!=null&&c.isEmpty)return e.jsx("span",{});const t=!!((h=(u=i.row)==null?void 0:u.auditionData)!=null&&h.id),n=Mi===((p=i.row)==null?void 0:p.id);return t?n?e.jsx(ae,{variant:"standard",placeholder:"Max Pay",size:"small",type:"number",value:ui.max_pay,onChange:R=>qi(P=>({...P,max_pay:R.target.value})),onKeyDown:R=>R.stopPropagation(),style:{width:80}}):e.jsx("p",{className:"characterTableText",children:((M=(_=i.row)==null?void 0:_.auditionData)==null?void 0:M.max_pay)!=null&&((L=(q=i.row)==null?void 0:q.auditionData)==null?void 0:L.max_pay)!==0?`₹${i.row.auditionData.max_pay}`:"---"}):e.jsx("span",{})}},{field:"shoot_days",headerName:"Shoot Days",width:110,align:"center",headerAlign:"center",renderCell:i=>{var c,u,h,p,_,M,q,L;if((c=i.row)!=null&&c.isEmpty)return e.jsx("span",{});const t=!!((h=(u=i.row)==null?void 0:u.auditionData)!=null&&h.id),n=Mi===((p=i.row)==null?void 0:p.id);return t?n?e.jsx(ae,{variant:"standard",placeholder:"Days",size:"small",type:"number",value:ui.expected_days_of_shoot,onChange:R=>qi(P=>({...P,expected_days_of_shoot:R.target.value})),onKeyDown:R=>R.stopPropagation(),style:{width:70}}):e.jsx("p",{className:"characterTableText",children:((M=(_=i.row)==null?void 0:_.auditionData)==null?void 0:M.expected_days_of_shoot)!=null&&((L=(q=i.row)==null?void 0:q.auditionData)==null?void 0:L.expected_days_of_shoot)!==0?i.row.auditionData.expected_days_of_shoot:"---"}):e.jsx("span",{})}}],ji=()=>{window.open(`/app/schedule-assist#recruiter_id${s.recruiter_id}#project_id${s.id}`)},Fs=i=>{var t,n;return((n=(t=i==null?void 0:i.model)==null?void 0:t.offeredTalent)==null?void 0:n.length)>0?"auto":70},Is=async()=>{var n,c,u;Ii(null);let i={location:"",locked_location:"",backup_location:"",index:(n=A.values.characterList)!=null&&n.length?((u=(c=A.values.characterList)==null?void 0:c.find(h=>h.id))==null?void 0:u.id)+10:2*Math.floor(Math.random()*10)};const t=A.values.characterList?[...A.values.characterList]:[];Se("newCharacter"),A.setFieldValue("characterList",[...t,i])},ms=async()=>(di(""),te(""),fe(""),await ne.getProjectLocation(s==null?void 0:s.recruiter_id,s==null?void 0:s.id).then(i=>(i&&(A.setFieldValue("characterList",i),Ie(i),A.setFieldValue("characterList",i),Se(null)),i))),et=(i,t)=>{A.isValid?(We(!0),ne.updateLocation(i,t).then(n=>{ms().then(c=>{We(!1)}),Se(null),Ai(c=>({...c,locations:null}))})):A.handleSubmit()},Ts=(i,t)=>{var n;if(i){ye(!0),ne.deleteLocation(i).then(c=>{ms()}).finally(()=>{V({isOpen:!1,data:null}),ye(!1)});return}if(t>=0){let c=((n=A.values.characterList)==null?void 0:n.filter((u,h)=>h!=t))??[];A.setFieldValue("characterList",c)}};d.useEffect(()=>{s!=null&&s.id&&(s!=null&&s.recruiter_id)&&ms(s==null?void 0:s.id,s==null?void 0:s.recruiter_id)},[s]);const Rs=async i=>{delete i.index,delete i.index_sno,i.project_id=s.id,i.recruiter_id=s.recruiter_id,We(!0);var t=[];t.push(i),await ne.addLocation(t).then(async n=>{ri(!0),s!=null&&s.id?await ne.getProjectLocation(s==null?void 0:s.recruiter_id,s.id).then(c=>{Ie(c),Se(null),di(""),fe(""),te("")}):Se(null),We(!1)}).finally(()=>{We(!1)})};var Wi=new Date().toISOString().slice(0,10);const _t=[{field:"index_sno",headerName:"Row",width:40},{field:"location",headerName:"Location",width:250,renderCell:i=>{var h,p,_,M,q,L,R,P;let t=[...A.values.characterList],n=(h=i.row)!=null&&h.id?A.values.characterList.findIndex(w=>{var T;return w.id===((T=i.row)==null?void 0:T.id)}):i.row.index_sno-1;const c=((p=A.errors.characterList)==null?void 0:p.length)&&A.errors.characterList[n]||{},u=vi==i.row.index_sno-1?!0:((_=A.touched.characterList)==null?void 0:_.length)&&A.touched.characterList[n]||{};return e.jsx("strong",{children:(M=i.row)!=null&&M.id&&X==n||!((q=i.row)!=null&&q.id)?e.jsx(ae,{id:"standard-search",variant:"standard",placeholder:"",slotProps:{input:{autoComplete:"new-password"}},name:"location",className:`${(L=i.row)!=null&&L.location?"value":""}`,defaultValue:(R=i.row)==null?void 0:R.location,onChangeCapture:w=>{di(w.target.value),t[n]={...i.row,location:w.target.value},A.setFieldValue("characterList",t)},error:(c==null?void 0:c.location)&&((u==null?void 0:u.location)||u===!0),onKeyDown:w=>w.stopPropagation()}):e.jsx("p",{className:"characterTableTextBold",children:(P=i.row)==null?void 0:P.location})})}}
1,{field:"locked_location",headerName:"Locked Location",width:250,renderCell:i=>{var h,p,_,M,q,L,R,P;let t=[...A.values.characterList],n=(h=i.row)!=null&&h.id?A.values.characterList.findIndex(w=>{var T;return w.id===((T=i.row)==null?void 0:T.id)}):i.row.index_sno-1;const c=((p=A.errors.characterList)==null?void 0:p.length)&&A.errors.characterList[n]||{},u=vi==i.row.index_sno-1?!0:((_=A.touched.characterList)==null?void 0:_.length)&&A.touched.characterList[n]||{};return e.jsx("strong",{children:(M=i.row)!=null&&M.id&&X==n||!((q=i.row)!=null&&q.id)?e.jsx(ae,{id:"standard-search",variant:"standard",placeholder:"",slotProps:{input:{autoComplete:"new-password"}},name:"locked_location",className:`${(L=i.row)!=null&&L.locked_location?"value":""}`,defaultValue:(R=i.row)==null?void 0:R.locked_location,onChangeCapture:w=>{te(w.target.value),t[n]={...i.row,locked_location:w.target.value},A.setFieldValue("characterList",t)},error:(c==null?void 0:c.locked_location)&&((u==null?void 0:u.locked_location)||u===!0),onKeyDown:w=>w.stopPropagation()}):e.jsx("p",{className:"characterTableTextBold",children:(P=i.row)==null?void 0:P.locked_location})})}},{field:"backup_location",headerName:"Backup Location",width:250,renderCell:i=>{var h,p,_,M,q,L,R,P;let t=[...A.values.characterList],n=(h=i.row)!=null&&h.id?A.values.characterList.findIndex(w=>{var T;return w.id===((T=i.row)==null?void 0:T.id)}):i.row.index_sno-1;const c=((p=A.errors.characterList)==null?void 0:p.length)&&A.errors.characterList[n]||{},u=vi==i.row.index_sno-1?!0:((_=A.touched.characterList)==null?void 0:_.length)&&A.touched.characterList[n]||{};return e.jsx("strong",{children:(M=i.row)!=null&&M.id&&X==n||!((q=i.row)!=null&&q.id)?e.jsx(ae,{id:"standard-search",variant:"standard",placeholder:"",slotProps:{input:{autoComplete:"new-password"}},name:"backup_location",className:`${(L=i.row)!=null&&L.backup_location?"value":""}`,defaultValue:(R=i.row)==null?void 0:R.backup_location,onChangeCapture:w=>{fe(w.target.value),t[n]={...i.row,backup_location:w.target.value},A.setFieldValue("characterList",t)},error:(c==null?void 0:c.backup_location)&&((u==null?void 0:u.backup_location)||u===!0),onKeyDown:w=>w.stopPropagation()}):e.jsx("p",{className:"characterTableTextBold",children:(P=i.row)==null?void 0:P.backup_location})})}},{field:"action",headerName:"Actions",width:80,renderCell:i=>{var u,h,p,_,M,q,L,R,P,w,T,he,Qe,Ze,Xe,mi,pi,_i,Ae,Me;let t=(u=i.row)!=null&&u.id?A.values.characterList.findIndex(de=>{var pe;return de.id===((pe=i.row)==null?void 0:pe.id)}):i.row.index_sno-1;const n=((h=A.errors.characterList)==null?void 0:h.length)&&A.errors.characterList[t]||{},c=((p=A.touched.characterList)==null?void 0:p.length)&&A.touched.characterList[t]||{};return e.jsx(e.Fragment,{children:e.jsxs("strong",{className:"w-full flex justify-center",children:[((_=i==null?void 0:i.row)==null?void 0:_.isDeleted)===!0?((q=(M=i==null?void 0:i.row)==null?void 0:M.recruiterProject)==null?void 0:q.project_status)===1?e.jsx(C,{title:"Character is deleted",placement:"top",children:e.jsx(ie,{"aria-label":"favorite",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",children:e.jsx(Ne,{fontSize:"inherit",sx:{color:!O&&!((L=i==null?void 0:i.row)!=null&&L.isDeleted)?"#9B26B6":"#9f9f9f"}})})}):null:((R=i.row)==null?void 0:R.id)&&!l&&e.jsxs(e.Fragment,{children:[((w=(P=i==null?void 0:i.row)==null?void 0:P.auditionData)==null?void 0:w.isBanned)===!1&&((he=(T=i==null?void 0:i.row)==null?void 0:T.auditionData)==null?void 0:he.isSubmitted)===!0&&!((Ze=(Qe=i==null?void 0:i.row)==null?void 0:Qe.auditionData)!=null&&Ze.is_open_audition_posted)?e.jsx(C,{title:"Cannot edit when Under Review ",placement:"top",children:e.jsx(ie,{"aria-label":"favorite",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",children:e.jsx(Ne,{fontSize:"inherit",sx:{color:!O&&!((Xe=i==null?void 0:i.row)!=null&&Xe.isDeleted)?"#9B26B6":"#9f9f9f"}})})}):(X==null||X!=t)&&(X==="newCharacter"?e.jsx(C,{title:"Only one character can be edited at a time",placement:"top",children:e.jsx(ie,{"aria-label":"favorite",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",children:e.jsx(Ne,{fontSize:"inherit",sx:{color:!O&&!((mi=i==null?void 0:i.row)!=null&&mi.isDeleted)?"#9B26B6":"#9f9f9f"}})})}):e.jsx(C,{title:"Edit character",placement:"top",children:e.jsx(ie,{"aria-label":"favorite",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",onClick:O?"":()=>Se(t),children:e.jsx(Ne,{fontSize:"inherit",sx:{color:!O&&!((pi=i==null?void 0:i.row)!=null&&pi.isDeleted)?"#9B26B6":"#9f9f9f"}})})})),X==t&&e.jsxs("div",{className:"flex",children:[e.jsx(C,{title:"Save",placement:"top",children:e.jsx(ie,{"aria-label":"favorite",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",onClick:()=>{var de;return O?"":et((de=i.row)==null?void 0:de.id,i.row)},children:Pe?e.jsx("div",{style:{minWidth:25},children:e.jsx("span",{className:"",children:e.jsx(es,{size:"70%",sx:{color:"#9B26B6"}})})}):e.jsx(bi,{fontSize:"inherit",sx:{color:O?"#9f9f9f":"#9B26B6"}})})}),e.jsx(C,{title:"Cancel",placement:"top",children:e.jsx(ie,{"aria-label":"favorite",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",onClick:O?"":()=>{Se(null),A.resetForm()},children:e.jsx(ts,{sx:{color:O?"#9f9f9f":"#9B26B6"},className:"cursor-pointer"})})})]})]}),!((_i=i.row)!=null&&_i.id)&&e.jsx("div",{className:"",children:e.jsx(Ft,{isLoadings:vi===i.row.index_sno-1&&Pe,onClick:O?"":()=>{var de,pe,De;Ii(i.row.index_sno-1),(((de=Object.keys(n))==null?void 0:de.length)===0&&((pe=Object.keys(c))==null?void 0:pe.length)===0||((De=Object.keys(n))==null?void 0:De.length)===0)&&Rs(i.row)}})}),(X==null||X!=t)&&!l&&e.jsx(C,{title:((Ae=i==null?void 0:i.row)==null?void 0:Ae.isDeleted)===!0?"Character is deleted":"Delete character",placement:"top",children:e.jsx(ie,{"aria-label":"favorite",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",onClick:O?"":()=>{var de,pe,De;if(((de=i==null?void 0:i.row)==null?void 0:de.isDeleted)!==!0){if((pe=i.row)!=null&&pe.id){V(nt=>({isOpen:!0,data:{character:i.row,index:indexedDB}}));return}Ts(null,((De=i.row)==null?void 0:De.index_sno)-1),Se(null)}},children:e.jsx(rs,{sx:{color:!O&&!((Me=i==null?void 0:i.row)!=null&&Me.isDeleted)?"#9B26B6":"#9f9f9f",fontSize:20}})})})]})})}}],As=async()=>{var n,c,u;cs(null);let i={special_requirement:"",locked_special_requirement:"",backup_special_requirement:"",index:(n=I.values.characterList)!=null&&n.length?((u=(c=I.values.characterList)==null?void 0:c.find(h=>h.id))==null?void 0:u.id)+10:2*Math.floor(Math.random()*10)};const t=I.values.characterList?[...I.values.characterList]:[];Be("newCharacter"),I.setFieldValue("characterList",[...t,i])},Zi=async()=>await ne.getRequirementProject(s==null?void 0:s.recruiter_id,s==null?void 0:s.id).then(i=>(i&&(I.setFieldValue("characterList",i),yi(i),Be(null)),i)),it=(i,t)=>{I.isValid?(ze(!0),ne.updateSpecialRequirements(i,t).then(n=>{Zi().then(c=>{ze(!1)}),Be(null),Ai(c=>({...c,requirements:null}))})):I.handleSubmit()},ps=(i,t)=>{var n;if(i){Ti(!0),ne.deleteSpecialRequirements(i).then(c=>{Zi()}).finally(()=>{Ue({isOpen:!1,data:null}),Ti(!1)});return}if(t>=0){let c=((n=I.values.characterList)==null?void 0:n.filter((u,h)=>h!=t))??[];I.setFieldValue("characterList",c)}};d.useEffect(()=>{s!=null&&s.id&&(s!=null&&s.recruiter_id)&&Zi(s==null?void 0:s.id,s==null?void 0:s.recruiter_id)},[s]);const Ms=async i=>{delete i.index,delete i.index_sno,i.project_id=s.id,i.recruiter_id=s.recruiter_id;var t=[];t.push(i),ze(!0),await ne.addSpecialRequirements(t).then(async n=>{Ce(!0),s!=null&&s.id?await ne.getRequirementProject(s==null?void 0:s.recruiter_id,s==null?void 0:s.id).then(c=>{yi(c),Be(null)}):Be(null),ze(!1)}).finally(()=>{ze(!1)})};var Wi=new Date().toISOString().slice(0,10);const qs=[{field:"index_sno",headerName:"Row",width:40},{field:"special_requirement",headerName:"Special Requirement",width:250,renderCell:i=>{var h,p,_,M,q,L,R,P;let t=[...I.values.characterList],n=(h=i.row)!=null&&h.id?I.values.characterList.findIndex(w=>{var T;return w.id===((T=i.row)==null?void 0:T.id)}):i.row.index_sno-1;const c=((p=I.errors.characterList)==null?void 0:p.length)&&I.errors.characterList[n]||{},u=re==i.row.index_sno-1?!0:((_=I.touched.characterList)==null?void 0:_.length)&&I.touched.characterList[n]||{};return e.jsx("strong",{children:(M=i.row)!=null&&M.id&&ee==n||!((q=i.row)!=null&&q.id)?e.jsx(ae,{id:"standard-search",variant:"standard",placeholder:"",slotProps:{input:{autoComplete:"new-password"}},name:"special_requirement",className:`${(L=i.row)!=null&&L.special_requirement?"value":""}`,defaultValue:(R=i.row)==null?void 0:R.special_requirement,onChangeCapture:w=>{t[n]={...i.row,special_requirement:w.target.value},I.setFieldValue("characterList",t)},error:(c==null?void 0:c.special_requirement)&&((u==null?void 0:u.special_requirement)||u===!0),onKeyDown:w=>w.stopPropagation()}):e.jsx("p",{className:"characterTableTextBold",children:(P=i.row)==null?void 0:P.special_requirement})})}},{field:"locked_special_requirement",headerName:"Locked",width:250,renderCell:i=>{var h,p,_,M,q,L,R,P;let t=[...I.values.characterList],n=(h=i.row)!=null&&h.id?I.values.characterList.findIndex(w=>{var T;return w.id===((T=i.row)==null?void 0:T.id)}):i.row.index_sno-1;const c=((p=I.errors.characterList)==null?void 0:p.length)&&I.errors.characterList[n]||{},u=re==i.row.index_sno-1?!0:((_=I.touched.characterList)==null?void 0:_.length)&&I.touched.characterList[n]||{};return e.jsx("strong",{children:(M=i.row)!=null&&M.id&&ee==n||!((q=i.row)!=null&&q.id)?e.jsx(ae,{id:"standard-search",variant:"standard",placeholder:"",slotProps:{input:{autoComplete:"new-password"}},name:"locked_special_requirement",className:`${(L=i.row)!=null&&L.locked_special_requirement?"value":""}`,defaultValue:(R=i.row)==null?void 0:R.locked_special_requirement,onChangeCapture:w=>{t[n]={...i.row,locked_special_requirement:w.target.value},I.setFieldValue("characterList",t)},error:(c==null?void 0:c.locked_special_requirement)&&((u==null?void 0:u.locked_special_requirement)||u===!0),onKeyDown:w=>w.stopPropagation()}):e.jsx("p",{className:"characterTableTextBold",children:(P=i.row)==null?void 0:P.locked_special_requirement})})}},{field:"backup_special_requirement",headerName:"Backup",width:250,renderCell:i=>{var h,p,_,M,q,L,R,P;let t=[...I.values.characterList],n=(h=i.row)!=null&&h.id?I.values.characterList.findIndex(w=>{var T;return w.id===((T=i.row)==null?void 0:T.id)}):i.row.index_sno-1;const c=((p=I.errors.characterList)==null?void 0:p.length)&&I.errors.characterList[n]||{},u=re==i.row.index_sno-1?!0:((_=I.touched.characterList)==null?void 0:_.length)&&I.touched.characterList[n]||{};return e.jsx("strong",{children:(M=i.row)!=null&&M.id&&ee==n||!((q=i.row)!=null&&q.id)?e.jsx(ae,{id:"standard-search",variant:"standard",placeholder:"",slotProps:{input:{autoComplete:"new-password"}},name:"backup_special_requirement",className:`${(L=i.row)!=null&&L.backup_special_requirement?"value":""}`,defaultValue:(R=i.row)==null?void 0:R.backup_special_requirement,onChangeCapture:w=>{t[n]={...i.row,backup_special_requirement:w.target.value},I.setFieldValue("characterList",t)},error:(c==null?void 0:c.backup_special_requirement)&&((u==null?void 0:u.backup_special_requirement)||u===!0),onKeyDown:w=>w.stopPropagation()}):e.jsx("p",{className:"characterTableTextBold",children:(P=i.row)==null?void 0:P.backup_special_requirement})})}},{field:"action",headerName:"Actions",width:80,renderCell:i=>{var u,h,p,_,M,q,L,R,P,w,T,he,Qe,Ze,Xe,mi,pi,_i,Ae,Me;let t=(u=i.row)!=null&&u.id?I.values.characterList.findIndex(de=>{var pe;return de.id===((pe=i.row)==null?void 0:pe.id)}):i.row.index_sno-1;const n=((h=I.errors.characterList)==null?void 0:h.length)&&I.errors.characterList[t]||{},c=((p=I.touched.characterList)==null?void 0:p.length)&&I.touched.characterList[t]||{};return e.jsx(e.Fragment,{children:e.jsxs("strong",{className:"w-full flex justify-center",children:[((_=i==null?void 0:i.row)==null?void 0:_.isDeleted)===!0?((q=(M=i==null?void 0:i.row)==null?void 0:M.recruiterProject)==null?void 0:q.project_status)===1?e.jsx(C,{title:"Character is deleted",placement:"top",children:e.jsx(ie,{"aria-label":"favorite",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",children:e.jsx(Ne,{fontSize:"inherit",sx:{color:!O&&!((L=i==null?void 0:i.row)!=null&&L.isDeleted)?"#9B26B6":"#9f9f9f"}})})}):null:((R=i.row)==null?void 0:R.id)&&!l&&e.jsxs(e.Fragment,{children:[((w=(P=i==null?void 0:i.row)==null?void 0:P.auditionData)==null?void 0:w.isBanned)===!1&&((he=(T=i==null?void 0:i.row)==null?void 0:T.auditionData)==null?void 0:he.isSubmitted)===!0&&!((Ze=(Qe=i==null?void 0:i.row)==null?void 0:Qe.auditionData)!=null&&Ze.is_open_audition_posted)?e.jsx(C,{title:"Cannot edit when Under Review ",placement:"top",children:e.jsx(ie,{"aria-label":"favorite",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",children:e.jsx(Ne,{fontSize:"inherit",sx:{color:!O&&!((Xe=i==null?void 0:i.row)!=null&&Xe.isDeleted)?"#9B26B6":"#9f9f9f"}})})}):(ee==null||ee!=t)&&(ee==="newCharacter"?e.jsx(C,{title:"Only one character can be edited at a time",placement:"top",children:e.jsx(ie,{"aria-label":"favorite",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",children:e.jsx(Ne,{fontSize:"inherit",sx:{color:!O&&!((mi=i==null?void 0:i.row)!=null&&mi.isDeleted)?"#9B26B6":"#9f9f9f"}})})}):e.jsx(C,{title:"Edit character",placement:"top",children:e.jsx(ie,{"aria-label":"favorite",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",onClick:O?"":()=>Be(t),children:e.jsx(Ne,{fontSize:"inherit",sx:{color:!O&&!((pi=i==null?void 0:i.row)!=null&&pi.isDeleted)?"#9B26B6":"#9f9f9f"}})})})),ee==t&&e.jsxs("div",{className:"flex",children:[e.jsx(C,{title:"Save",placement:"top",children:e.jsx(ie,{"aria-label":"favorite",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",onClick:()=>{var de;return O?"":it((de=i.row)==null?void 0:de.id,i.row)}
1,children:Ci?e.jsx("div",{style:{minWidth:25},children:e.jsx("span",{className:"",children:e.jsx(es,{size:"70%",sx:{color:"#9B26B6"}})})}):e.jsx(bi,{fontSize:"inherit",sx:{color:O?"#9f9f9f":"#9B26B6"}})})}),e.jsx(C,{title:"Cancel",placement:"top",children:e.jsx(ie,{"aria-label":"favorite",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",onClick:O?"":()=>{Be(null),I.resetForm()},children:e.jsx(ts,{sx:{color:O?"#9f9f9f":"#9B26B6"},className:"cursor-pointer"})})})]})]}),!((_i=i.row)!=null&&_i.id)&&e.jsx("div",{className:"",children:e.jsx(Ft,{isLoadingss:re===i.row.index_sno-1&&Ci,onClick:O?"":()=>{var de,pe,De;cs(i.row.index_sno-1),(((de=Object.keys(n))==null?void 0:de.length)===0&&((pe=Object.keys(c))==null?void 0:pe.length)===0||((De=Object.keys(n))==null?void 0:De.length)===0)&&Ms(i.row)}})}),(ee==null||ee!=t)&&!l&&e.jsx(C,{title:((Ae=i==null?void 0:i.row)==null?void 0:Ae.isDeleted)===!0?"Character is deleted":"Delete character",placement:"top",children:e.jsx(ie,{"aria-label":"favorite",style:{padding:2,fontSize:"1.5em"},color:"#FFFFFF",onClick:O?"":()=>{var de,pe,De;if(((de=i==null?void 0:i.row)==null?void 0:de.isDeleted)!==!0){if((pe=i.row)!=null&&pe.id){Ue(nt=>({isOpen:!0,data:{character:i.row,index:indexedDB}}));return}ps(null,((De=i.row)==null?void 0:De.index_sno)-1),Be(null)}},children:e.jsx(rs,{sx:{color:!O&&!((Me=i==null?void 0:i.row)!=null&&Me.isDeleted)?"#9B26B6":"#9f9f9f",fontSize:20}})})})]})})}}];return Fe===!1?e.jsxs("div",{className:"mt-73 ReduceMobilePadding",children:[e.jsx(ut,{sx:{flexGrow:1},children:e.jsxs(St,{container:!0,spacing:2,className:"bg-white character_librafry DisplayNone",children:[e.jsxs(St,{item:!0,xs:12,lg:6,className:"char_partLoc",children:[Y=="1"&&e.jsxs("div",{className:"MobileNone",children:[b&&e.jsx("p",{className:"character_title",children:e.jsx("span",{children:s==null?void 0:s.project_title})}),b&&e.jsx("p",{className:"character_sub_title",children:"Character Library"}),!b&&e.jsxs(e.Fragment,{children:[" ",e.jsxs("div",{className:"character_librafry  character_librafry_outer overflow-hidden overflow-ellipsis whitespace-nowrap",children:[e.jsx(C,{title:s==null?void 0:s.project_title,placement:"top",children:e.jsxs("label",{children:["Character Library for project"," ",e.jsxs("span",{children:[" ",s==null?void 0:s.project_title]})]})}),e.jsx("p",{children:" Add/view Characters in the project "})]})]})]}),Y=="2"&&e.jsxs("div",{className:"character_librafry character_librafry_outer overflow-hidden overflow-ellipsis whitespace-nowrap",children:[e.jsx(C,{title:s==null?void 0:s.project_title,placement:"top",children:e.jsxs("label",{children:[" ","Location Library for project",e.jsxs("span",{children:[" ",s==null?void 0:s.project_title]})]})}),e.jsx("p",{children:" Add/view Locations in the project "})]}),Y=="3"&&e.jsxs("div",{className:"character_librafry  character_librafry_outer overflow-hidden overflow-ellipsis whitespace-nowrap DisplayNone",children:[e.jsx(C,{title:s==null?void 0:s.project_title,placement:"top",children:e.jsxs("label",{children:[" ","Requirement Library for project"," ",e.jsx("span",{children:s==null?void 0:s.project_title})]})}),e.jsx("p",{children:" Add/view Requirements in the project "})]})]}),e.jsx(St,{item:!0,xs:12,lg:6,sx:{justifyContent:"flex-end"},className:"grid_row ",children:e.jsxs("div",{className:"btn_rightbx btn_rightbx_outer ",children:[Y=="1"&&!b&&e.jsxs(e.Fragment,{children:[!l&&e.jsx("div",{children:((f=m.values.characterList)==null?void 0:f.length)>0?e.jsx(C,{title:"Find talent for characters by clicking here",placement:"top",children:e.jsx("div",{className:"flex flex-col",children:e.jsx(G,{className:"",text:"Start recruiting",disableBtn:O,onClick:O?"":()=>{window.open(`${Cs.client_url}/find-talents?character_id=${ni==null?void 0:ni.id}`,"_blank"),window.scrollTo(0,0),Q(!1)}})})}):e.jsx(C,{title:"Add characters to Start recruiting",placement:"top",children:e.jsx("div",{className:"flex flex-col",children:e.jsx(G,{className:"recu_button",text:"Start recruiting",disableBtn:!0})})})}),!l&&e.jsx(C,{title:"Update availability calendars and Schedule like magic!",placement:"top",children:e.jsx("div",{className:"flex flex-col",children:e.jsx(G,{className:"library_button",text:"Schedule Assist",white:!0,id:"custom_button",onClick:ji})})}),!l&&e.jsx("div",{className:"flex gap-4 outer_formatik",children:N=="newCharacter"?e.jsx(C,{title:"Only one character can be edited at a time",placement:"top",style:{width:"fit-content"},children:e.jsx("div",{className:"tool_flex",children:e.jsx(G,{text:"Add a character",disableBtn:!0,className:"require_button_box"})})}):O?e.jsxs("div",{children:[" ",e.jsx(G,{text:"Add a character",disableBtn:!0})," "]}):e.jsx(G,{text:"Add a character ",onClick:ci,white:!0,style:{height:"fit-content"},disabled:N!==null&&N>=0,className:"add-vx"})})]}),Y=="2"&&e.jsxs(e.Fragment,{children:[!l&&e.jsx("div",{children:((y=m.values.characterList)==null?void 0:y.length)>
10?e.jsx(C,{title:"Find talent for characters by clicking here",placement:"top",children:e.jsx("div",{className:"flex flex-col",children:e.jsx(G,{className:"",text:"Start recruiting",disableBtn:O,onClick:O?"":()=>{window.open(`${Cs.client_url}/find-talents?character_id=${ni==null?void 0:ni.id}`,"_blank"),window.scrollTo(0,0),Q(!1)}})})}):e.jsx(C,{title:"Add characters to Start recruiting",placement:"top",children:e.jsx("div",{className:"flex flex-col",children:e.jsx(G,{className:"recu_button",text:"Start recruiting",disableBtn:!0})})})}),!l&&e.jsx(C,{title:"Update availability calendars and Schedule like magic!",placement:"top",children:e.jsx("div",{className:"flex flex-col",children:e.jsx(G,{className:"library_button",text:"Schedule Assist",white:!0,id:"custom_button",onClick:ji})})}),!l&&e.jsx("div",{className:"flex gap-4 outer_formatik",children:X=="newCharacter"?e.jsx(C,{className:"outer_formatik_tooltip",title:"Only one character can be edited at a time",placement:"top",style:{width:"fit-content"},children:e.jsx("div",{className:"tool_flex",children:e.jsx(G,{text:"Add a Location",className:"require_button_box_location",disableBtn:!0})})}):O?e.jsxs("div",{children:[" ",e.jsx(G,{text:"Add a Location",disableBtn:!0})," "]}):e.jsx(G,{text:"Add a location",onClick:Is,white:!0,style:{height:"fit-content"},disabled:X!==null&&X>=0})})]}),Y=="3"&&e.jsxs(e.Fragment,{children:[!l&&e.jsx("div",{children:((E=m.values.characterList)==null?void 0:E.length)>0?e.jsx(C,{title:"Find talent for characters by clicking here",placement:"top",children:e.jsx("div",{className:"flex flex-col",children:e.jsx(G,{className:"",text:"Start recruiting",disableBtn:O,onClick:O?"":()=>{window.open(`${Cs.client_url}/find-talents?character_id=${ni==null?void 0:ni.id}`,"_blank"),window.scrollTo(0,0),Q(!1)}})})}):e.jsx(C,{title:"Add characters to Start recruiting",placement:"top",children:e.jsx("div",{className:"flex flex-col",children:e.jsx(G,{className:"recu_button",text:"Start recruiting",disableBtn:!0})})})}),!l&&e.jsx(C,{title:"Update availability calendars and Schedule like magic!",placement:"top",children:e.jsx("div",{className:"flex flex-col",children:e.jsx(G,{className:"library_button",text:"Schedule Assist",white:!0,id:"custom_button",onClick:ji})})}),!l&&e.jsx("div",{className:"flex gap-4 outer_formatik",children:ee=="newCharacter"?e.jsx(C,{title:"Only one Requirement can be edited at a time",placement:"top",style:{width:"fit-content"},className:"outer_formatik_tooltip",children:e.jsx("div",{className:"tool_flex",children:e.jsx(G,{className:"require_button_box",text:"Add a requirement",disableBtn:!0})})}):O?e.jsxs("div",{className:"tool_flex",children:[" ",e.jsx(G,{text:"Add a requirement",disableBtn:!0})," "]}):e.jsx(G,{text:"Add a requirement",onClick:As,white:!0,style:{height:"fit-content"},disabled:ee!==null&&ee>=0,className:"outer_formatik_tooltip"})})]})]})})]})}),e.jsx(e.Fragment,{children:e.jsxs("div",{className:"NewMobileSectionInner",children:[e.jsx("div",{className:"TableNewChanges",children:e.jsxs("div",{className:"MobileREsponisveAcc",children:[e.jsx("div",{className:"project-title",children:Y=="1"?"Characters":Y=="2"?"Locations":" Special Requirements"}),e.jsxs("div",{className:"project-actions",children:[e.jsx("div",{className:"project_addDoc",children:Y=="1"&&N=="newCharacter"||Y=="2"&&X=="newCharacter"||Y=="3"&&ee=="newCharacter"?e.jsx(C,{title:"Only one character can be edited at a time",placement:"top",style:{width:"fit-content"},children:e.jsx("div",{className:"tool_flex",children:e.jsx(G,{text:Y=="1"?"Add Char.":Y=="2"?"Add Loc.":"Add Req.",disableBtn:!0,className:"require_button_box"})})}):O?e.jsx("div",{children:e.jsx(G,{text:Y=="1"?"Add Char.":Y=="2"?"Add Loc.":"Add Req.",disableBtn:!0})}):e.jsx(G,{text:Y=="1"?"Add Char.":Y=="2"?"Add Loc.":"Add Req.",onClick:Y=="1"?ci:Y=="2"?Is:As,white:!0,style:{height:"fit-content"},disabled:Y=="1"&&N!==null&&N>=0||Y=="2"&&X!==null&&X>=0||Y=="3"&&ee!==null&&ee>=0,className:"add-vx"})}),e.jsx(_r,{sx:{color:"#9B26B6",cursor:"pointer"},ref:Je,id:"composition-button","aria-controls":ds?"composition-menu":void 0,"aria-expanded":ds?"true":void 0,"aria-haspopup":"true",onClick:Ls}),e.jsx("span",{onClick:()=>{jt(i=>!i)},children:Us?e.jsx(Tt,{sx:{color:"#9B26B6",fontSize:25}}):e.jsx(It,{sx:{color:"#9B26B6",fontSize:25}})}),e.jsx("div",{children:e.jsx(ur,{open:ds,anchorEl:Je.current,role:void 0,placement:"bottom-start",transition:!0,style:{zIndex:10},children:({TransitionProps:i,placement:t})=>e.jsx(hr,{...i,style:{transformOrigin:t==="bottom-start"?"left top":"left bottom"},children:e.jsx($t,{className:"Reducewidth",elevation:4,sx:{width:220,borderRadius:2,overflow:"hidden",boxShadow:"0 4px 20px rgba(0,0,0,0.1)"},children:e.jsx(xr,{onClickAway:Ks,className:"PopupChange",children:e.jsxs("div",{children:[e.jsxs("div",{className:"modal-header flex items-center justify-between px-4 py-3 border-b border-gray-200 Commpnpopup",children:[e.jsx("span",{className:"text-sm font-semibold text-gray-800",children:"Options"}),e.jsx(Ns,{fontSize:"small",sx:{cursor:"pointer",color:"#444"},onClick:Ks})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs(ss,{onClick:()=>{me("1"),Yi(!1)}
1,sx:{gap:1.5,px:3,py:1.5},children:[e.jsx(Oe,{children:e.jsx(hn,{sx:{color:"#9B26B6"}})}),e.jsx(Ee,{primary:"Character Library",primaryTypographyProps:{fontSize:14}})]}),e.jsxs(ss,{onClick:()=>{me("2"),Yi(!1)},sx:{gap:1.5,px:3,py:1.5},children:[e.jsx(Oe,{children:e.jsx(xn,{sx:{color:"#9B26B6"}})}),e.jsx(Ee,{primary:"Location Library",primaryTypographyProps:{fontSize:14}})]}),e.jsxs(ss,{onClick:()=>{me("3"),Yi(!1)},sx:{gap:1.5,px:3,py:1.5},children:[e.jsx(Oe,{children:e.jsx(ln,{sx:{color:"#9B26B6"}})}),e.jsx(Ee,{primary:"Special Requirements",primaryTypographyProps:{fontSize:14}})]})]})]})})})})})})]})]})}),Us==!1&&e.jsx(ut,{sx:{width:"100%",typography:"body1"},className:"my_projecttab chartab indicator_char",children:e.jsxs(Mr,{value:Y,children:[e.jsx("div",{className:"MobiledisplayNone",children:e.jsx(ut,{sx:{borderBottom:1,borderColor:"divider"},children:e.jsxs(qr,{onChange:Qs,"aria-label":"lab API tabs example",className:"tab_details ",children:[e.jsx(Pt,{label:"Characters",value:"1",sx:{textTransform:"none"},className:"character_tab"}),e.jsx(Pt,{label:"Locations",value:"2",sx:{textTransform:"none"}}),e.jsx(Pt,{label:"Special Requirements",value:"3",sx:{textTransform:"none"}})]})})}),e.jsx("div",{className:"MobileTableDesign",children:e.jsx(Cr,{tabValue:Y,data:Y==="1"?m.values.characterList:Y==="2"?A.values.characterList:I.values.characterList,editingStates:ft,setEditingStates:Ai,onUpdate:Oi,onDelete:xs,onPost:Ys,onCopyLink:Ei,onFindTalent:Ps,formik:m,formiks:A,formikss:I,isLoading:Z,isLoadings:Pe,isLoadingss:Ci,isProfileFreezed:O,isClosed:l,currentDate:Wi,copiedId:ce,GENDER:hs,height_min:le,height_max:ge,handle_InchAndCm:Vi,calculateValue:Si,currectIndexOfNewCharacter:ue,currectIndexOfNewCharacters:vi,currectIndexOfNewCharacterss:re})}),e.jsx(Lt,{value:"1",className:"padding_leftright1 ",children:e.jsx(Ve.Row,{style:{marginLeft:0,marginRight:0},children:e.jsx(Ve.Col,{lg:12,xs:12,sm:12,className:"padding_leftright",children:e.jsxs("div",{className:"",children:[e.jsxs("div",{className:"create_card p-10 paddingreduce form_character MobiledisplayNone",children:[e.jsx("div",{className:"w-full flex justify-between with100p"}),e.jsx("div",{style:{height:((W=m.values.characterList)==null?void 0:W.length)>5?`${((B=m.values.characterList)==null?void 0:B.length)*80}px`:((J=m.values.characterList)==null?void 0:J.length)>2?`${((Ge=m.values.characterList)==null?void 0:Ge.length)*80+100}px`:"40vh",width:"100%",maxHeight:"470px"},ref:us,className:"mt-6s characterTable_dropdown ",id:"Character_table",children:e.jsx(vt,{hideFooter:!0,hideFooterPagination:!0,paginationMode:"server",sortModel:[],disableColumnFilter:!0,rows:je(m.values.characterList),columns:pt,rowHeight:70,getRowHeight:Fs,autoWidth:!0,getRowId:i=>i!=null&&i.isEmpty||i.id?i.id:i.index_sno?i.index_sno:i.index?i.index:0,getRowClassName:i=>{var t;return(t=i.row)!=null&&t.isEmpty?"empty-placeholder-row":""},sx:kn,disableColumnMenu:!0,localeText:{noRowsLabel:'Click on "Add a Character" above to start populating the Character Library.'}})})]}),!l&&e.jsx("div",{className:"Overtablebuttons",children:e.jsxs("div",{className:"flex justify-between mt-8 saveNext paddingChange",children:[b?e.jsx(zi,{text:"Back",onClick:()=>{o&&o(0),window.scrollTo(0,0)},disabled:N!==null&&N>=0}):e.jsx("p",{}),e.jsxs("div",{className:"flex gap-4 MobileWdithChange",children:[e.jsx(C,{title:(Ke=m.values.characterList.filter(i=>{var t;return((t=i==null?void 0:i.recruiterShortlist)==null?void 0:t.length)>0}))!=null&&Ke.length?"View and Share shortlist of all characters":"",placement:"top",children:e.jsx("div",{className:"tool_flex",children:e.jsx(G,{text:"Share Shortlists",onClick:()=>gs(ls==null?void 0:ls.userUniqueId,s.id),className:(li=m.values.characterList.filter(i=>{var t;return((t=i==null?void 0:i.recruiterShortlist)==null?void 0:t.length)>0}))!=null&&li.length?"":"opacity-50",disabled:!((_s=m.values.characterList.filter(i=>{var t;return((t=i==null?void 0:i.recruiterShortlist)==null?void 0:t.length)>0}))!=null&&_s.length)})})}),e.jsx(G,{text:"Save",onClick:m.handleSubmit,className:!((Xi=m.values.characterList.filter(i=>!i.id))!=null&&Xi.length)||!m.isValid?"opacity-50":"",disabled:!((Di=m.values.characterList.filter(i=>!i.id))!=null&&Di.length)||N!==null&&N>=0,isLoading:Z})]})]})}),e.jsxs(Li,{open:z==null?void 0:z.isOpen,fullWidth:!0,maxWidth:"sm",id:"characterDelete",onClose:()=>oe(i=>({...i,isOpen:!1})),children:[e.jsxs(Pi,{align:"center",children:[e.jsx("h2",{className:"title mt-4",children:"Are your sure?"}),e.jsxs("p",{className:"instruction mt-3",children:["Are you sure you want to remove"," ",e.jsxs("b",{children:[(Re=(ws=z==null?void 0:z.data)==null?void 0:ws.character)==null?void 0:Re.character_name," ","character"," "]}),"from the Character Library"]})]}),e.jsxs(Bi,{className:"gap-2",style:{padding:"15px 2.3rem 25px"},children:[e.jsx(zi,{text:"Cancel",onClick:()=>{oe(i=>({...i,isOpen:!1}))},disabled:g}),e.jsx(G,{text:"Yes, Remove",deleteBtn:!0,onClick:()=>{var i,t;fs((t=(i=z==null?void 0:z.data)==null?void 0:i.character)==null?void 0:t.id)},isLoading:g})]})]}),e.jsxs(Li,{className:"NewPopupClassClose",open:se,fullWidth:!0,maxWidth:"xs",id:"characterDelete",onClose:()=>Q(!1),children:[e.jsxs(Pi,{align:"center",children:[e.jsxs("h2",{className:"title mt-4",children:["Character added successfully"," "]}),e.jsx("p",{className:"instruction mt-3",children:"Now Post it as a Job so matching talents can Apply."})]}),e.jsx(Bi,{className:"gap-3",style:{padding:"15px 2.3rem 25px",justifyContent:"center"},children:e.jsx(G,{text:"Post Job",onClick:()=>{var i,t,n,c;Ri("/app/audition",{state:x.length>0&&((t=(i=x[x.length-1])==null?void 0:i.auditionData)!=null&&t.id)?{poster_id:(c=(n=x[x.length-1])==null?void 0:n.auditionData)==null?void 0:c.id}:x.length>0&&x[x.length-1]}),window.scrollTo(0,0),Q(!1)}})}),e.jsx("span",{className:"phot_close__icon",onClick:()=>Q(!1),children:e.jsx(Ns,{})})]}),e.jsxs(Li,{className:"NewPopupClassClose",open:gt,fullWidth:!0,maxWidth:"xs",onClose:()=>oi(!1),children:[e.jsxs(Pi,{align:"center",children:[e.jsx("h2",{className:"duplicate_character",children:"Duplicate Character Created"}),e.jsx("p",{className:"duplicate_character_content",children:"You can edit the character at the bottom of the Character Library."})]}),e.jsx(Bi,{className:"gap-3",style:{padding:"15px 2.3rem 25px",justifyContent:"center"},children:e.jsx(G,{text:"Ok",onClick:()=>oi(!1)})}),e.jsx("span",{className:"phot_close__icon",onClick:()=>oi(!1),children:e.jsx(Ns,{})})]})]})})})}),e.jsx(Lt,{value:"2",className:"padding_leftright1",children:e.jsx(Ve.Row,{style:{marginLeft:0,marginRight:0},children:e.jsx(Ve.Col,{lg:12,xs:12,sm:12,className:"padding_leftright",children:e.jsxs("div",{className:"mt-73",children:[e.jsxs("div",{className:"create_card p-10 paddingreduce form_character MobiledisplayNone",children:[e.jsx("div",{className:"w-full flex justify-between with100p",children:e.jsx("div",{})}),e.jsx("div",{style:{height:((ii=A.values.characterList)==null?void 0:ii.length)>5?`${((Ui=A.values.characterList)==null?void 0:Ui.length)*80}px`:((gi=A.values.characterList)==null?void 0:gi.length)>2?`${((Ye=A.values.characterList)==null?void 0:Ye.length)*80+100}px`:"40vh",width:"100%",maxHeight:"406px",overflow:"auto"},ref:Qi,className:"mt-61 characterTable_dropdown ",id:"Character_table",children:e.jsx(vt,{hideFooter:!0,hideFooterPagination:!0,paginationMode:"server",sortModel:[],disableColumnFilter:!0,rows:(Es=A.values.characterList)==null?void 0:Es.map((i,t)=>({...i,index_sno:t+1})),columns:_t,rowHeight:70,getRowHeight:Fs,autoWidth:!0,getRowId:i=>i.id?i.id:i.index_sno?i.index_sno:i.index?i.index:0,disableColumnMenu:!0,localeText:{noRowsLabel:'Click on "Add a Location" above to start populating the Location Library.'}})})]}),!l&&e.jsxs("div",{className:"flex justify-between mt-8 saveNext",children:[b?e.jsx(zi,{text:"Back",onClick:()=>{o&&o(0),window.scrollTo(0,0)},disabled:X!==null&&X>=0}):e.jsx("p",{}),e.jsx("div",{className:"flex gap-4",children:e.jsx(G,{text:"Save",onClick:A.handleSubmit,className:!((tt=A.values.characterList.filter(i=>!i.id))!=null&&tt.length)||!A.isValid?"opacity-50":"",disabled:!((rt=A.values.characterList.filter(i=>!i.id))!=null&&rt.length)||X!==null&&X>=0,isLoadings:Pe})})]}),e.jsxs(Li,{open:Le==null?void 0:Le.isOpen,fullWidth:!0,maxWidth:"sm",id:"characterDelete",onClose:()=>V(i=>({...i,isOpen:!1})),children:[e.jsxs(Pi,{align:"center",children:[e.jsx("h2",{className:"title mt-4",children:"Are your sure?"}),e.jsxs("p",{className:"instruction mt-3",children:["Are you sure you want to remove"," ",e.jsxs("b",{children:[(ai=(Hs=Le==null?void 0:Le.data)==null?void 0:Hs.character)==null?void 0:ai.character_name," ","Location"," "]})]})]}),e.jsxs(Bi,{className:"gap-2",style:{padding:"15px 2.3rem 25px"},children:[e.jsx(zi,{text:"Cancel",onClick:()=>{V(i=>({...i,isOpen:!1}))},disabled:v}),e.jsx(G,{text:"Yes, Remove",deleteBtn:!0,onClick:()=>{var i,t;Ts((t=(i=Le==null?void 0:Le.data)==null?void 0:i.character)==null?void 0:t.id)},isLoadings:v})]})]}),e.jsxs(Li,{className:"NewPopupClassClose",open:Ki,fullWidth:!0,maxWidth:"xs",id:"characterDelete",onClose:()=>ri(!1),children:[e.jsxs(Pi,{align:"center",children:[e.jsx("h2",{className:"title mt-4",children:"Confirmation"}),e.jsx("p",{className:"instruction mt-3",children:"Details have been saved."})]}),e.jsxs(Bi,{className:"gap-3",style:{padding:"15px 2.3rem 25px",justifyContent:"center"},children:[e.jsx(G,{gray:!0,text:"Add more",onClick:i=>{Is(),ri(!1)},style:{width:"140px"}}),e.jsx(G,{text:"Cancel",onClick:()=>ri(!1)})]}),e.jsx("span",{className:"phot_close__icon",onClick:()=>ri(!1),children:e.jsx(Ns,{})})]})]})})})}),e.jsx(Lt,{value:"3",className:"padding_leftright1",children:e.jsx(Ve.Row,{style:{marginLeft:0,marginRight:0},children:e.jsx(Ve.Col,{lg:12,xs:12,sm:12,className:"padding_leftright",children:e.jsxs("div",{className:"mt-73",children:[e.jsxs("div",{className:"create_card p-10 paddingreduce form_character MobiledisplayNone",children:[e.jsx("div",{className:"w-full flex justify-between with100p",children:e.jsx("div",{})}),e.jsx("div",{style:{height:((Wt=I.values.characterList)==null?void 0:Wt.length)>5?`${((Ut=I.values.characterList)==null?void 0:Ut.length)*80}px`:((Jt=I.values.characterList)==null?void 0:Jt.length)>2?`${((Gt=I.values.characterList)==null?void 0:Gt.length)*80+100}px`:"40vh",width:"100%",maxHeight:"406px",overflow:"auto"},ref:Gs,className:"mt-62 characterTable_dropdown",id:"Character_table",children:e.jsx(vt,{hideFooter:!0,hideFooterPagination:!0,paginationMode:"server",sortModel:[],disableColumnFilter:!0,rows:(Kt=I.values.characterList)==null?void 0:Kt.map((i,t)=>({...i,index_sno:t+1})),columns:qs,rowHeight:70,getRowHeight:Fs,autoWidth:!0,getRowId:i=>i.id?i.id:i.index_sno?i.index_sno:i.index?i.index:0,disableColumnMenu:!0,localeText:{noRowsLabel:'Click on "Add a requirement" above to start populating the Requirement Library.'}})})]}),!l&&e.jsxs("div",{className:"flex justify-between mt-8 saveNext",children:[b?e.jsx(zi,{text:"Back",onClick:()=>{o&&o(0),window.scrollTo(0,0)},disabled:ee!==null&&ee>=0}):e.jsx("p",{}),e.jsx("div",{className:"flex gap-4",children:e.jsx(G,{text:"Save",onClick:I.handleSubmit,className:!((Yt=I.values.characterList.filter(i=>!i.id))!=null&&Yt.length)||!I.isValid?"opacity-50":"",disabled:!((Qt=I.values.characterList.filter(i=>!i.id))!=null&&Qt.length)||ee!==null&&ee>=0,isLoadingss:Ci})})]}),e.jsxs(Li,{open:Te==null?void 0:Te.isOpen,fullWidth:!0,maxWidth:"sm",id:"characterDelete",onClose:()=>Ue(i=>({...i,isOpen:!1})),children:[e.jsxs(Pi,{align:"center",children:[e.jsx("h2",{className:"title mt-4",children:"Are your sure?"}),e.jsxs("p",{className:"instruction mt-3",children:["Are you sure you want to remove"," ",e.jsxs("b",{children:[(Xt=(Zt=Te==null?void 0:Te.data)==null?void 0:Zt.character)==null?void 0:Xt.character_name," ","Location"," "]})]})]}),e.jsxs(Bi,{className:"gap-2",style:{padding:"15px 2.3rem 25px"},children:[e.jsx(zi,{text:"Cancel",onClick:()=>{Ue(i=>({...i,isOpen:!1}))},disabled:we}),e.jsx(G,{text:"Yes, Remove",deleteBtn:!0,onClick:()=>{var i,t;ps((t=(i=Te==null?void 0:Te.data)==null?void 0:i.character)==null?void 0:t.id)},isLoadingss:we})]})]}),e.jsxs(Li,{className:"NewPopupClassClose",open:Ni,fullWidth:!0,maxWidth:"xs",id:"characterDelete",onClose:()=>Ce(!1),children:[e.jsxs(Pi,{align:"center",children:[e.jsx("h2",{className:"title mt-4",children:"Confirmation"}),e.jsx("p",{className:"instruction mt-3",children:"Details have been saved."})]}),e.jsxs(Bi,{className:"gap-3",style:{padding:"15px 2.3rem 25px",justifyContent:"center"},children:[e.jsx(G,{gray:!0,text:"Add more",onClick:i=>{As(),Ce(!1)},style:{width:"140px"}}),e.jsx(G,{text:"Cancel",onClick:()=>Ce(!1)})]}),e.jsx("span",{className:"phot_close__icon",onClick:()=>Ce(!1),children:e.jsx(Ns,{})})]})]})})})})]})})]})})]}):e.jsx(fr,{})},Ft=({isLoading:o,onClick:s})=>e.jsxs("div",{className:"relative",children:[e.jsx(ie,{onClick:s,disabled:o,children:!o&&e.jsx(bi,{fontSize:"inherit",sx:{color:"#9B26B6"}})}),o&&e.jsx(es,{size:18,sx:{color:"#9B26B6"}})]}),xt=({options:o,handleChange:s,data:b})=>{const l=(x,{inputValue:j})=>{if(!j)return x;const N=j.toLowerCase();return x.filter(F=>{const g=F.project_title.toLowerCase().includes(N),K=F.recruiter.some(z=>z.character_name.toLowerCase().includes(N));return g||K})},U=d.useMemo(()=>{const x=new Set;return o.filter(j=>x.has(j.id)?!1:(x.add(j.id),!0))},[o]);return e.jsx(Er,{className:"combo-box-demoauto",disablePortal:!0,id:"combo-box-demo",sx:{width:300},options:U,filterOptions:l,getOptionLabel:x=>b===1?x.project_title:"",renderOption:(x,j)=>d.createElement(ut,{component:"li",...x,key:j.id},j.project_title),onChange:(x,j)=>s(j),renderInput:x=>e.jsx(ae,{id:"standard-search",...x,InputProps:{...x.InputProps,endAdornment:e.jsxs(e.Fragment,{children:[e.jsx("span",{id:"searchProjectDropdown",children:x.InputProps.endAdornment}),e.jsx(fn,{sx:{color:"#9B26B6",fontSize:"20px"},className:"cursor-pointer"})]}),disableUnderline:!0},style:{border:"1px solid #E5E5E5",backgroundColor:"#fff",borderRadius:"5px",padding:"0%"},className:"SearchProjectDropdown",placeholder:"Search projects or characters",type:"text",onCh
1ange:j=>{b=1}})})};xt.propTypes={options:a.arrayOf(a.shape({id:a.oneOfType([a.string,a.number]).isRequired,project_title:a.string.isRequired,recruiter:a.arrayOf(a.shape({character_name:a.string.isRequired})).isRequired})).isRequired,handleChange:a.func.isRequired,data:a.oneOfType([a.string,a.number])};xt.defaultProps={data:null};const po=()=>{var $s,Os;const o=Ot(),{hash:s,state:b}=Lr(),{user:l,dependencyData:U,isProfileFreezed:x}=d.useContext(dr),[j,N]=d.useState(!1),[F,g]=d.useState(""),[K,z]=d.useState(""),[oe,Z]=d.useState(null),[H,se]=d.useState([]),[Q,le]=d.useState(!1),[$,ge]=d.useState([]),[S,ce]=d.useState([]);let[ke,ue]=d.useState(0);const[ve,Fe]=d.useState(!1),_e=d.useRef(null),[Y,me]=d.useState(null),[ei,Ie]=d.useState(null),X={display:"none"},Se=d.useRef(null),[v,ye]=d.useState(null),[Le,V]=d.useState(!1),[Pe,We]=d.useState(0),[Ki,ri]=d.useState(0),[vi,Ii]=d.useState(!1),os=()=>{V(!0)},di=d.useRef(null),k=()=>V(!1),[te,D]=d.useState(""),[fe,qe]=d.useState(!1),[yi,ee]=d.useState(!0),[Be,we]=d.useState(!1),[Ti,Te]=d.useState(!1),[Ue,Ci]=d.useState(5),[ze,Ni]=d.useState([]),[Ce,re]=d.useState(null),[cs,Ri]=d.useState(!0),O=d.useRef(null),[ls,ni]=d.useState(255),[Ws,ft]=d.useState(!0),{openSnackbar:Ai}=d.useContext(Pr),Us=()=>{Ci(H.length)},jt=()=>{Ci(5)},ki=async r=>await ne.openCloseProjectList(r).then(f=>(ge(f),f)),[Js,gt]=d.useState(!1),oi=()=>{gt(r=>!r)},[Mi,as]=d.useState(!1),ui=()=>as(!0),qi=r=>{di.current&&di.current.contains(r.target)||as(!1)},hi=async r=>{we(!0);let f={id:r};return await ne.openProject(f).then(y=>{var E;return ce(y.projects),y!=null&&y.projects&&Z((E=y==null?void 0:y.projects[0])==null?void 0:E.type_project),we(!1),y})},Ss=()=>{qe(!0)},ds=()=>{qe(!1),D("")},[Yi,Ls]=d.useState(!1),[Je,us]=d.useState([]),[Qi,Gs]=d.useState([]),[xe,Ks]=d.useState({}),[hs,Oi]=d.useState([]),[xs,Ys]=d.useState([]),[Ei,Ps]=d.useState(0),[Bs,m]=d.useState([]),[A,I]=d.useState(!0),[ci,$e]=d.useState(0),[Qs,xi]=d.useState(0),[fs,Hi]=d.useState(0),[Zs,Xs]=d.useState(0),[mt,Ds]=d.useState(0);let Si=new Date().toISOString().slice(0,10);const Vi=()=>{le(!Q)},fi=r=>{js(r),ue(1),hi(r).finally(()=>{ee(!1)}),ne.getDouments(r).then(y=>{se(y)}).then(y=>{He.getCharacterListById(r,l==null?void 0:l.user_id).then(async E=>{let W=E.characters.filter(J=>(J==null?void 0:J.isDeleted)!==!0);Ni(W);let B=E.characters.filter(J=>J.auditionData!==null&&J.auditionData.is_open_audition_posted===!0&&J.auditionData.isBanned!==!0&&J.auditionData.job_expiry>=Si);m(B)})}).finally(()=>{ee(!1)}),ce([]),re(null),I(!0),$e(0),g(""),z(null),xi(0),Hi(0),Ie(null),N(!1),me(null),Xs(0)},js=r=>{localStorage.setItem("projectId",r)},gs=r=>{js(r),Xs(1),ue(1),hi(r).finally(()=>{ee(!1)}),ne.getDouments(r).then(y=>{se(y)}).then(y=>{He.getCharacterListById(r,l==null?void 0:l.user_id).then(async E=>{let W=E.characters.filter(J=>(J==null?void 0:J.isDeleted)!==!0);Ni(W);let B=E.characters.filter(J=>J.auditionData!==null&&J.auditionData.is_open_audition_posted===!0&&J.auditionData.isBanned!==!0&&J.auditionData.job_expiry>=Si);m(B)})}).finally(()=>{ee(!1)}),ce([]),re(null),I(!0),$e(0),g(""),z(null),xi(0),Hi(0),Ie(null),N(!1),me(null)},je=r=>{Te(!1),Ks(f=>{var y,E;if(r.includes("Open Projects"))return Object.keys(f).map(W=>{(W.includes("activeProject-")||W.includes("inactiveProject-"))&&delete f[W]}),{...f,[r]:!xe[r],"Closed Projects":!1};if(r.includes("Closed Projects"))return Object.keys(f).map(W=>{(W.includes("activeProject-")||W.includes("inactiveProject-"))&&delete f[W]}),{...f,[r]:!xe[r],"Open Projects":!1};if(r.includes("activeProject-"))return delete f[(y=Object.keys(f))==null?void 0:y.find(W=>W.includes("activeProject-"))],{...f,[r]:!xe[r]};if(r.includes("inactiveProject-"))return delete f[(E=Object.keys(f))==null?void 0:E.find(W=>W.includes("inactiveProject-"))],{...f,[r]:!xe[r]}}),re(null),I(!0),$e(0),g(""),z(null),xi(0),Hi(0),Ie(null),me(null)};d.useEffect(()=>{(async()=>{var f,y,E,W,B;if(m([]),I(!0),$e(0),xi(0),N(!1),Ie(null),me(null),l!=null&&l.user_id)try{const J=await ki(l==null?void 0:l.user_id);Vi(),ue(1);const Ke=Number(localStorage.getItem("projectId"));if(Ke||s||b!=null&&b.project_id){let Re=s!=null&&s.includes("#")?(f=s.match(/\d+/g))==null?void 0:f[0]:null;if(console.log("---------hashId--------->",Re),Ke||Re||b!=null&&b.project_id){const ii=(b==null?void 0:b.project_id)||Re||Ke;console.log("------targetProjectId----targetProjectId-----1234---->",ii),localStorage.setItem("projectId",ii);const Ui=await hi(ii),[gi]=Ui==null?void 0:Ui.projects;b!=null&&b.project_id&&b.isNewProject?(Ii(!0),o(window.location.pathname,{replace:!0,state:null})):Ii(!1),(gi==null?void 0:gi.project_status)===1?je(`activeProject-${ii}`):(gi==null?void 0:gi.project_status)===2&&(le(!1),je(`inactiveProject-${ii}`),ji());const Ye=await ne.getDouments(ii);se(Ye);const Es=await He.getCharacterListById(ii,l==null?void 0:l.user_id);let tt=Es.characters.filter(ai=>(ai==null?void 0:ai.isDeleted)!==!0);Ni(tt);let rt=Es.characters.filter(ai=>ai.auditionData!==null&&ai.auditionData!=null&&ai.auditionData.is_open_audition_posted===!0&&ai.auditionData.isBanned!==!0&&ai.auditionData.job_expiry>=Si);m(rt);const Hs=await ne.closeProjectReason();us(Hs),ye(Hs[0].id);return}await He.getCharacterListById(Re,l==null?void 0:l.user_id).then(async ii=>{let Ui=ii.characters.filter(Ye=>(Ye==null?void 0:Ye.isDeleted)!==!0);Ni(Ui);let gi=ii.characters.filter(Ye=>Ye.auditionData!==null&&Ye.auditionData!=null&&Ye.auditionData.is_open_audition_posted===!0&&Ye.auditionData.isBanned!==!0&&Ye.auditionData.job_expiry>=Si);m(gi)});return}je(`activeProject-${(y=J.activeproject[0])==null?void 0:y.id}`),await hi((E=J.activeproject[0])==null?void 0:E.id);const li=await ne.getDouments((W=J.activeproject[0])==null?void 0:W.id);se(li);const _s=await ne.closeProjectReason();us(_s),ye(_s[0].id);const Xi=await He.getCharacterListById((B=J.activeproject[0])==null?void 0:B.id,l==null?void 0:l.user_id);let Di=Xi.characters.filter(Re=>(Re==null?void 0:Re.isDeleted)!==!0);Ni(Di);let ws=Xi.characters.filter(Re=>Re.auditionData!==null&&Re.auditionData!==void 0&&Re.auditionData.is_open_audition_posted===!0&&Re.auditionData.isBanned!==!0&&Re.auditionData.job_expiry>=Si);m(ws)}catch(J){console.error("Error in useEffect:",J)}finally{ee(!1)}})()},[l==null?void 0:l.user_id,s]),d.useEffect(()=>{var r;U!=null&&U.project&&Gs((r=U==null?void 0:U.project)==null?void 0:r.map(f=>{var y,E;return!((y=f==null?void 0:f.projectname)!=null&&y.includes("Series"))&&((E=f==null?void 0:f.projectname)==null?void 0:E.slice(-1))==="s"?{...f,projectname:f==null?void 0:f.projectname.slice(0,-1)}:f}))},[U]);const pt=()=>{Ls(!1),ne.getDouments(S[0].id).then(r=>{se(r)}),I(!0)},ji=()=>{Fe(!ve)},Fs=()=>{var r;(r=_e.current)==null||r.click()},Is=r=>{Se.current.click()},ms=r=>{const f=r.target.files;if(f.length>0){const y=f[0];Ie(f),me(URL.createObjectURL(y))}};function et(r){g(r.target.value),$e(0)}function Ts(r){z(r.target.value)}const Rs=r=>{r.key==="Enter"&&it()};function _t(r,f){if(r==null){let y=f,E=H.filter(function(W,B){return B!=y});se(E),Oi(E),xi(1)}else{let y=[...xs,r];xs.includes(r)&&(y=y.filter(W=>W!==r)),Ys(y);let E=H.filter(function(W){return W.id!=r});se(E),Oi(E),xi(1)}}function As(){var r,f;Ki==0?(ri(1),ki(l==null?void 0:l.user_id),hi(S[0].id),qe(!1),Ls(!0),ye(Je!=null&&Je.length?(r=Je[0])==null?void 0:r.id:null),D(""),ji(),je(`inactiveProject-$${S[0].id}`)):(ri(1),ki(l==null?void 0:l.user_id),hi(S[0].id),ne.getDouments(S[0].id).then(E=>{se(E)}),qe(!1),Ls(!0),ye(Je!=null&&Je.length?(f=Je[0])==null?void 0:f.id:null),D(""),ji())}function Zi(){if(Pe==0){We(1);let f={project_status:2,closedBy:l==null?void 0:l.user_id};ne.closeProject(S[0].id,f).then(y=>{y!=null&&y!=null&&(ji(),je(`inactiveProject-$${S[0].id}`),ki(l==null?void 0:l.user_id),hi(S[0].id),ne.getDouments(S[0].id).then(E=>{se(E)}))}),k(),Ss()}else{We(1);let r={project_status:2,closedBy:l==null?void 0:l.user_id};ne.closeProject(S[0].id,r).then(f=>{f!=null&&f!=null&&(ji(),je(`inactiveProject-$${S[0].id}`),ki(l==null?void 0:l.user_id),hi(S[0].id),ne.getDouments(S[0].id).then(y=>{se(y)}))}),k(),Ss()}}const it=()=>{te.length!==0&&(Zi(),D(""))},ps=async(r,f)=>
1{try{const y={files:[{fileName:f,fileType:r.type}]},E=await Ir.getPreSignedUrl(y),{signedUrl:W}=E.files[0],B=await fetch(W,{method:"PUT",body:r,headers:{"Content-Type":r.type}});if(!B.ok)throw new Error(`Upload failed with status: ${B.status}`);return W.split("?")[0]}catch(y){throw console.error("Error uploading file:",y),y}},Ms=async r=>{const f=r.target.files;if(!f||f.length===0)return;N(!0),re(null);const y=S[0].id,E=S[0].project_title,W=[];try{for(const B of f){const J=`Recruiter/projects/${E+"_"+y}/${B.name}`,Ge=await ps(B,J),Ke={project_id:y,url:Ge,file_name:B.name};W.push(Ke)}setTimeout(()=>{if(H.length>0){let B=W.filter(Ge=>!H.find(Ke=>Ke.file_name===Ge.file_name?(re("Error: File already exists in the project."),!0):!1));B.length>0&&I(!1);const J=[...H,...B];Oi(J),se(J)}else I(!1),Oi(W),se(W)},300)}catch(B){console.error("Error uploading files:",B),re(`Error uploading files: ${B.message}`)}},Wi=async()=>{var r,f,y,E;Ps(1);try{let W=null;if(ei&&ei.length>0){const Ge=ei[0],Ke=Ge.name.replace(/\.[^/.]+$/,""),li=await Fr(Ge),Xi=await(await fetch(li)).blob(),Di=new File([Xi],`${Ke}.webp`,{type:"image/webp"}),ws=`Recruiter/projects/imageupload/${S[0].project_title+"_"+S[0].id}/${Di.name}`;W=await ps(Di,ws)}const B={project_title:F?F.replace(/^\s+|\s+$/gm,""):S[0].project_title,project_description:K||S[0].project_description,type_project:oe||S[0].type_project};W&&(B.image_upload=W,me(W));const J=await ne.updateProject(S[0].id,B);if(J.data.status===400)N(!0),Ie(null),me(null),$e(J.data.message),Ps(0);else{await ki(l==null?void 0:l.user_id);const Ge=await ne.openProject({id:S[0].id});if(ce(Ge.projects),xs.length>0){for(const li of xs)await ne.deleteDocument(li);Ys([])}if(hs.length>0){for(const li of hs)(li.id==null||li.id===void 0)&&await ne.addDocument(li);Oi([])}const Ke=await ne.getDouments(S[0].id);se(Ke),re(null),I(!0),g(""),z(null),xi(0),Hi(0)}}catch(W){console.error("Error updating project:",W),re(`Error updating project: ${W.message}`);const B=((f=(r=W==null?void 0:W.response)==null?void 0:r.data)==null?void 0:f.message)||"Something went wrong";(E=(y=W==null?void 0:W.response)==null?void 0:y.data)==null||E.httpCode,Ai(B,"error")}finally{Ps(0)}};d.useEffect(()=>{var r,f;!Ti&&!Be&&(((r=O.current)==null?void 0:r.clientHeight)>300?ni(((f=O.current)==null?void 0:f.clientHeight)-46):ni(255))},[O,S,Ti,ke,H,Vi]);const qs=d.useRef(),zs=r=>{const E=46*(r-4.5+1);qs.current.scrollTo(E,0)},st=()=>{o(`/app/schedule-assist#recruiter_id${S[0].recruiter_id}#project_id${S[0].id}`)};return yi?e.jsx(Or,{}):e.jsxs("div",{className:"w-full bg-white rounded-xl ",children:[e.jsxs(Br,{htmlAttributes:!0,children:[e.jsx("title",{children:"My Projects | Casting Bell"}),e.jsx("meta",{name:"description",content:l!=null&&l.first_name?`${l==null?void 0:l.first_name}'s Projects | Casting Bell`:""})]}),e.jsx("section",{className:"top_profile_section ",style:{background:"#E5E5E5"},children:e.jsx("div",{className:"container mx-auto px-6 PaddingLeftChange",children:e.jsxs(Ve.Row,{children:[e.jsx(Ve.Col,{lg:6,xs:12,sm:6,className:"header_left mobilemenuhidden",children:e.jsx("div",{className:"top_title",children:e.jsx("h2",{children:"My Projects"})})}),e.jsx(Ve.Col,{lg:6,xs:12,sm:6,className:"text-right sm:text-left",children:e.jsx($r,{})})]})})}),e.jsx("section",{className:" pt-7 ReduceThepaddingInMobile",style:{background:"#f4f4f4",minHeight:"700px"},children:e.jsxs("div",{className:"container mx-auto waewwewqeqewqe",children:[e.jsxs("div",{className:"FullMobileMenuCommon",children:[e.jsxs("div",{className:"FullMobileMenu",children:[e.jsx("div",{className:"LeftMobileText",children:e.jsx("h3",{children:"Project"})}),e.jsx("div",{className:"RightMobileText",children:e.jsx("div",{className:"createNewprojectText_outer",children:e.jsxs("p",{className:"flex ml-1 gap-3 createNewprojectText cursor-pointer cre_project",style:{color:x?"#9f9f9f":"#9B26B6",whiteSpace:"nowrap",display:"inline-flex",alignItems:"center"},onClick:x?"":()=>{var r,f;(r=l==null?void 0:l.recruiter)!=null&&r.is_profile_creation_completed?(f=$.activeproject)!=null&&f.length?o("/app/create-new-project",{state:{isCreated:!0}}):o("/app/create-new-project"):o(`/app/recruiter-form/${l==null?void 0:l.userUniqueId}`)},children:["Create new",e.jsx(yt,{})," "]})})})]}),e.jsx("div",{className:"WildDaysMobile",children:e.jsxs("div",{children:[e.jsxs("div",{className:"select-box",onClick:oi,style:{display:"flex",alignItems:"center",cursor:"pointer",gap:"8px"},children:[e.jsx(un,{sx:{color:"#9B26B6"}}),e.jsx("p",{className:"select-label",style:{margin:0},children:(S==null?void 0:S.length)>0&&(($s=S[0])==null?void 0:$s.project_title)}),Js?e.jsx(It,{sx:{color:"#9B26B6",fontSize:25}}):e.jsx(Tt,{sx:{color:"#9B26B6",fontSize:25}})]}),e.jsxs("div",{className:`OpenTheSearchBox ${Js?"open":""}`,style:{background:"#fff",textAlign:"center"},children:[e.jsx("div",{className:"flex justify-center",children:e.jsx(xt,{options:[...$==null?void 0:$.activeproject,...$==null?void 0:$.inactiveproject],handleChange:r=>{if(oi(),r!=null)r.project_status==1?(Fe(!1),le(!0),je(`activeProject-${r.id}`),gs(r.id)):(le(!1),Fe(!0),je(`inactiveProject-${r.id}`),gs(r.id));else return null},data:Zs})}),e.jsx("div",{className:"mt-3"}),e.jsxs(bs,{ref:qs,sx:{width:"100%",maxWidth:360,bgcolor:"background.whitesmoke",overflow:"auto",maxHeight:ls},component:"nav","aria-labelledby":"nested-list-subheader",className:"customscrollProject  customscrollProjectOuter",subheader:e.jsx(ys,{component:"div",id:"nested-list-subheader"}),children:[e.jsx(ys,{sx:{padding:0},children:e.jsxs(Gi,{onClick:()=>{var r,f,y,E;Ri(!0),Vi(),je("Open Projects"),((r=$.activeproject)==null?void 0:r.length)!==0&&((f=$.activeproject[0])!=null&&f.id)?(fi((y=$.activeproject[0])==null?void 0:y.id),je(`activeProject-${(E=$.activeproject[0])==null?void 0:E.id}
1`)):Te(!0)},sx:{bgcolor:xe["Open Projects"]&&!Object.keys(xe).find(r=>r.includes("activeProject"))?"#E5E5E5":"#f4f4f4"},children:[e.jsx(Oe,{children:Q?e.jsx(lt,{sx:{color:"#9B26B6"}}):e.jsx(ct,{sx:{color:"#9B26B6"}})}),e.jsx(Ee,{primary:"Open Projects",className:"list_heading"})]})}),e.jsx(Vs,{in:Q,timeout:"auto",unmountOnExit:!0,children:$.activeproject.map(r=>e.jsx(bs,{component:"div",disablePadding:!0,children:e.jsxs(Gi,{onClick:()=>{fi(r.id),je(`activeProject-${r.id}`),oi()},sx:{bgcolor:xe[`activeProject-${r.id}`]?"#E5E5E5":"#f4f4f4"},children:[e.jsx(Oe,{}),e.jsx(Ee,{className:"list_subHeading ",primary:e.jsx("p",{className:xe[`activeProject-${r.id}`]?"active_menu":"",children:r.project_title})})]})}))}),e.jsx(ys,{sx:{padding:0},children:e.jsxs(Gi,{onClick:()=>{var r,f,y,E;Ri(!1),zs(1),ji(),je("Closed Projects"),((r=$.inactiveproject)==null?void 0:r.length)!==0&&((f=$.inactiveproject[0])!=null&&f.id)?(fi((y=$.inactiveproject[0])==null?void 0:y.id),je(`inactiveProject-${(E=$.inactiveproject[0])==null?void 0:E.id}`)):Te(!0)},sx:{bgcolor:xe["Closed Projects"]&&!Object.keys(xe).find(r=>r.includes("inactiveProject"))?"#E5E5E5":"#f4f4f4"},children:[e.jsx(Oe,{children:ve?e.jsx(lt,{sx:{color:"#9B26B6"}}):e.jsx(ct,{sx:{color:"#9B26B6"}})}),e.jsx(Ee,{primary:"Closed Projects",className:"list_heading"})]})}),e.jsx(Vs,{in:ve,timeout:"auto",unmountOnExit:!0,children:$.inactiveproject.map(r=>e.jsx(bs,{component:"div",disablePadding:!0,children:e.jsxs(Gi,{onClick:()=>{fi(r.id),je(`inactiveProject-${r.id}`),oi()},sx:{bgcolor:xe[[`inactiveProject-${r.id}`]]?"#E5E5E5":"#f4f4f4"},children:[e.jsx(Oe,{}),e.jsx(Ee,{className:"list_subHeading",primary:e.jsx("p",{className:xe[`inactiveProject-${r.id}`]?"active_menu":"",children:r.project_title})})]},r.id)}))})]})]})]})})]}),e.jsxs("div",{className:"px-6 ReduceMobilePadding",children:[e.jsxs("div",{className:"w-full",children:[e.jsxs(Ve.Row,{style:{marginLeft:0,marginRight:0},children:[e.jsx(Ve.Col,{lg:3,md:12,sm:12,xs:12,style:{padding:0},className:"ProjectListingNew DisplayNone",children:e.jsxs("div",{className:"SidebarProject",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx(xt,{options:[...$==null?void 0:$.activeproject,...$==null?void 0:$.inactiveproject],handleChange:r=>{if(oi(),r!=null)r.project_status==1?(Fe(!1),le(!0),je(`activeProject-${r.id}`),gs(r.id)):(le(!1),Fe(!0),je(`inactiveProject-${r.id}`),gs(r.id));else return null},data:Zs})}),e.jsx("div",{className:"mt-3"}),e.jsxs(bs,{ref:qs,sx:{width:"100%",maxWidth:360,bgcolor:"background.whitesmoke",overflow:"auto",maxHeight:ls},component:"nav","aria-labelledby":"nested-list-subheader",className:"customscrollProject  customscrollProjectOuter",subheader:e.jsx(ys,{component:"div",id:"nested-list-subheader"}),children:[e.jsx(ys,{sx:{padding:0},children:e.jsxs(Gi,{onClick:()=>{var r,f,y,E;Ri(!0),Vi(),je("Open Projects"),((r=$.activeproject)==null?void 0:r.length)!==0&&((f=$.activeproject[0])!=null&&f.id)?(fi((y=$.activeproject[0])==null?void 0:y.id),je(`activeProject-${(E=$.activeproject[0])==null?void 0:E.id}`)):Te(!0)},sx:{bgcolor:xe["Open Projects"]&&!Object.keys(xe).find(r=>r.includes("activeProject"))?"#E5E5E5":"#f4f4f4"},children:[e.jsx(Oe,{children:Q?e.jsx(lt,{sx:{color:"#9B26B6"}}):e.jsx(ct,{sx:{color:"#9B26B6"}})}),e.jsx(Ee,{primary:"Open Projects",className:"list_heading"})]})}),e.jsx(Vs,{in:Q,timeout:"auto",unmountOnExit:!0,children:$.activeproject.map(r=>e.jsx(bs,{component:"div",disablePadding:!0,children:e.jsxs(Gi,{onClick:()=>{fi(r.id),je(`activeProject-${r.id}`),oi()},sx:{bgcolor:xe[`activeProject-${r.id}`]?"#E5E5E5":"#f4f4f4"},children:[e.jsx(Oe,{}),e.jsx(Ee,{className:"list_subHeading ",primary:e.jsx("p",{className:xe[`activeProject-${r.id}`]?"active_menu":"",children:r.project_title})})]})}))}),e.jsx(ys,{sx:{padding:0},children:e.jsxs(Gi,{onClick:()=>{var r,f,y,E;Ri(!1),zs(1),ji(),je("Closed Projects"),((r=$.inactiveproject)==null?void 0:r.length)!==0&&((f=$.inactiveproject[0])!=null&&f.id)?(fi((y=$.inactiveproject[0])==null?void 0:y.id),je(`inactiveProject-${(E=$.inactiveproject[0])==null?void 0:E.id}
1`)):Te(!0)},sx:{bgcolor:xe["Closed Projects"]&&!Object.keys(xe).find(r=>r.includes("inactiveProject"))?"#E5E5E5":"#f4f4f4"},children:[e.jsx(Oe,{children:ve?e.jsx(lt,{sx:{color:"#9B26B6"}}):e.jsx(ct,{sx:{color:"#9B26B6"}})}),e.jsx(Ee,{primary:"Closed Projects",className:"list_heading"})]})}),e.jsx(Vs,{in:ve,timeout:"auto",unmountOnExit:!0,children:$.inactiveproject.map(r=>e.jsx(bs,{component:"div",disablePadding:!0,children:e.jsxs(Gi,{onClick:()=>{fi(r.id),je(`inactiveProject-${r.id}`),oi()},sx:{bgcolor:xe[[`inactiveProject-${r.id}`]]?"#E5E5E5":"#f4f4f4"},children:[e.jsx(Oe,{}),e.jsx(Ee,{className:"list_subHeading",primary:e.jsx("p",{className:xe[`inactiveProject-${r.id}`]?"active_menu":"",children:r.project_title})})]},r.id)}))})]}),e.jsx("div",{className:"createNewprojectText_outer",children:e.jsxs("p",{className:"flex ml-1 gap-3 createNewprojectText text_creat_form mtc-3 mcb-6 cursor-pointer cre_project",style:{color:x?"#9f9f9f":"#9B26B6"},onClick:x?"":()=>{var r,f;(r=l==null?void 0:l.recruiter)!=null&&r.is_profile_creation_completed?(f=$.activeproject)!=null&&f.length?o("/app/create-new-project",{state:{isCreated:!0}}):o("/app/create-new-project"):o(`/app/recruiter-form/${l==null?void 0:l.userUniqueId}`)},children:[e.jsx(yt,{sx:{color:x?"#9f9f9f":"#9B26B6"}})," ",e.jsx("label",{children:"Create new project"})]})})]})}),e.jsx(Ve.Col,{lg:9,md:12,sm:12,xs:12,className:"padding_leftright",children:e.jsx("div",{ref:O,children:ke===1&&(S!=null&&S.length)&&!Ti?e.jsxs("div",{className:"p-5 bg-white rounded-xl reducethepadding",children:[e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"MobileREsponisveAccNone",children:e.jsxs("div",{className:"MobileREsponisveAcc",style:{margin:"0 0 0px 0"},children:[e.jsx("div",{className:"project-title",children:"Project Details"}),e.jsxs("div",{className:"project-actions",children:[e.jsx(_r,{sx:{color:"#9B26B6",cursor:"pointer"},ref:di,id:"composition-button","aria-controls":Mi?"composition-menu":void 0,"aria-expanded":Mi?"true":void 0,"aria-haspopup":"true",onClick:ui}),e.jsx("span",{onClick:()=>{ft(r=>!r)},children:Ws?e.jsx(Tt,{sx:{color:"#9B26B6",fontSize:25}}):e.jsx(It,{sx:{color:"#9B26B6",fontSize:25}})})]})]})}),Mi&&e.jsx(ur,{className:"Reducewidth",open:Mi,anchorEl:di.current,placement:"bottom-start",transition:!0,style:{zIndex:10},children:({TransitionProps:r,placement:f})=>e.jsx(hr,{...r,style:{transformOrigin:f==="bottom-start"?"left top":"left bottom"},children:e.jsx($t,{elevation:4,sx:{width:200,borderRadius:2,overflow:"hidden",boxShadow:"0 4px 20px rgba(0,0,0,0.1)"},children:e.jsx(xr,{onClickAway:qi,children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200",children:[e.jsx("span",{className:"text-sm font-semibold text-gray-800",children:"Options"}),e.jsx(Ns,{fontSize:"small",sx:{cursor:"pointer",color:"#444"},onClick:qi})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs(ss,{disabled:x,onClick:()=>{x||(window.open(`${Cs.client_url}/find-talents?character_id=${ze.length>0&&ze[0].id}`,"_blank"),window.scrollTo(0,0))},sx:{gap:1.5,px:3,py:1.5},children:[e.jsx(Oe,{children:e.jsx(Ht,{sx:{color:x?"#9f9f9f":"#9B26B6"}})}),e.jsx(Ee,{primary:"Start Recruiting"})]}),e.jsxs(ss,{disabled:x,onClick:()=>{var y;x||window.open(`/app/my-job-postings#project_id${(y=S[0])==null?void 0:y.id}`,"_blank")},sx:{gap:1.5,px:3,py:1.5},children:[e.jsx(Oe,{children:e.jsx(jn,{sx:{color:x?"#9f9f9f":"#9B26B6"}})}),e.jsx(Ee,{primary:"Job Postings"})]}),e.jsxs(ss,{onClick:st,sx:{gap:1.5,px:3,py:1.5},children:[e.jsx(Oe,{children:e.jsx(an,{sx:{color:"#9B26B6"}})}),e.jsx(Ee,{primary:"Schedule Assist"})]}),e.jsxs(ss,{disabled:x,onClick:()=>{x||os()},sx:{gap:1.5,px:3,py:1.5},children:[e.jsx(Oe,{children:e.jsx(lr,{className:"MoveTheIconRight",sx:{color:x?"#9f9f9f":"#9B26B6"}})}),e.jsx(Ee,{primary:"Close Project"})]})]})]})})})})})]}),e.jsx("div",{className:Ws?"DisplayNone":"",children:S==null?void 0:S.map((r,f)=>{var y,E,W;return e.jsx(e.Fragment,{children:e.jsxs(Ve.Row,{children:[e.jsx(Ve.Col,{lg:3,md:12,xs:12,sm:12,className:"MovetheImagarea",children:e.jsx("div",{className:"flex items-center justify-center w-full WebAssetImages",children:e.jsxs("div",{className:"w-full h-full   rounded-lg  bx_user",onClick:()=>{j&&Is()},children:[Y==null&&r.image_upload&&e.jsx("img",{src:r.image_upload,className:"rounded-lg"}),Y!=null&&e.jsx("img",{src:Y,className:"rounded-lg"}),Y==null&&!r.image_upload&&e.jsx(zr,{letter:(y=r.project_title)==null?void 0:y.slice(0,1)}),e.jsx("input",{type:"file",accept:"image/png, image/gif, image/jpeg, image/webp",onChange:ms,ref:Se,style:{display:"none"}}),j&&e.jsx(cn,{sx:{color:"#9B26B6"},style:{position:"absolute",top:0,right:0,margin:10}})]})})}),e.jsxs(Ve.Col,{lg:9,md:12,xs:12,className:"flex flex-col gap-5 mt-5 sm:mt-0 paddingtopremove Reducethepadding",children:[e.jsxs("div",{className:"md:flex md:items-center",children:[e.jsx("div",{className:"md:w-1/3 lg:w-1/4 ChangePAddingTop",children:e.jsx("p",{className:"project_title pr-2",children:"Project Title:"})}),e.jsx("div",{className:"md:w-2/3 MobileChanges inputchnage",children:j?e.jsx(ae,{variant:"standard",name:"project_title_input",defaultValue:r.project_title,onChange:et,disabled:!j,className:r.project_title?"value":"",error:ci!=0,helperText:ci!=0&&ci,multiline:!0,slotProps:{input:{sx:{fontWeight:400}},htmlInput:{maxLength:101}}},f):((E=r==null?void 0:r.project_title)==null?void 0:E.length)>25?e.jsx(C,{title:(r==null?void 0:r.project_title)??"",placement:"top",children:e.jsx("div",{children:e.jsx("p",{className:"project_title_input mt-1 overflow-hidden overflow-ellipsis whitespace-nowrap",style:{width:"calc(100% - 84px)"},children:r.project_title})})}):e.jsx("p",{className:"project_title_input mt-1 overflow-hidden overflow-ellipsis whitespace-nowrap",style:{width:"calc(100% - 84px)"},children:r.project_title})})]}),e.jsxs("div",{className:"md:flex",children:[e.jsx("div",{className:"md:w-1/3 lg:w-1/4",children:e.jsx("p",{className:"project_title pr-2",children:"Project type:"})}),e.jsx("div",{className:`md:w-2/3 ${oe?"value":""}`,children:e.jsx("div",{className:"border_bottom min-w-min w-full",children:j?e.jsx(Et,{name:"project_projectType",data:Qi,autoComplete:!0,dropdownName:"projectname",slotProps:{htmlInput:{autoComplete:"off"}},values:oe,handleChange:B=>{Z(B),Hi(1)},onType:()=>{},disabled:!j}):e.jsx("p",{className:"project_projectType mt-1",children:(W=Qi==null?void 0:Qi.find(B=>{var J;return B.id==((J=r.projectData)==null?void 0:J.id)}
1))==null?void 0:W.projectname})})})]}),e.jsxs("div",{className:"md:flex",children:[e.jsx("div",{className:"md:w-1/3 lg:w-1/4",children:e.jsx("p",{className:"project_title pr-2",children:"Brief / Logline:"})}),e.jsx("div",{className:"md:w-2/3 border_bottom",children:j?e.jsxs(e.Fragment,{children:[e.jsx(ae,{style:{width:"100%"},variant:"standard",name:"project_Logline_input",fullWidth:!0,defaultValue:r.project_description,slotProps:{htmlInput:{maxLength:800}},multiline:!0,onChange:Ts,disabled:!j,className:r.project_description?"value":"",onInput:B=>{Ds(B.target.value.length)}},f),e.jsxs("p",{className:"text-right text-xs mt-2",children:[mt," / 800"]})]}):e.jsx("p",{className:"project_Logline_input mt-1",children:r.project_description})})]}),e.jsxs("div",{className:"md:flex",children:[e.jsx("div",{className:"md:w-1/3 lg:w-1/4 Reducepaddging",children:e.jsx("p",{className:"project_title pr-2 mb-2",children:"Related documents:"})}),e.jsx("div",{className:"md:w-2/3",children:e.jsxs("div",{className:"flex flex-col gap-3 justify-start",children:[H.length>0&&e.jsx("div",{className:"flex1 marigin justify-between flex-wrap gap-6",children:e.jsxs("div",{className:"col-span-2 flex flex-col gap-3",children:[H.length>0?H.slice(0,Ue).map((B,J)=>e.jsxs("span",{className:"flex gap-3",children:[e.jsx(Tr,{sx:{color:"#9B26B6"}})," ",e.jsx("p",{className:"project_relatedDoc",children:e.jsxs("a",{href:B.url,target:"_blank",children:[" ",B.file_name]})},J),j&&e.jsx(C,{title:"Click to Remove",placement:"top",children:e.jsx(rs,{sx:{color:"#44454D",cursor:"pointer"},onClick:()=>_t(B.id,J)})})]})):null,Ce!=null?e.jsx("p",{style:{color:"#FF0000",fontSize:"0.75rem"},children:Ce}):" ",Ue==5?e.jsx("p",{className:"seeMore",onClick:Us,children:H.length>5&&`See ${H.length-5} More`}):e.jsx("p",{className:"seeMore",onClick:jt,children:H.length>5&&"Show Less"})]})}),r.project_status==1&&e.jsxs("div",{className:"flex justify-start gap-2 mt-1 document_margin",children:[e.jsx("input",{ref:_e,style:X,type:"file",onChange:x?"":B=>{Ms(B)},onClick:x?"":B=>{B.target.value=null},multiple:!0}),e.jsx(yt,{sx:{color:x?"#9f9f9f":"#9B26B6"}}),e.jsx("a",{href:"#",className:"project_addDoc",onClick:x?"":Fs,style:{color:x?"#9f9f9f":"#9B26B6"},children:"Add documents"})]})]})})]}),r.project_status==1&&e.jsx(C,{title:"Once you close a Project, all the Job Postings associated with the project will also get closed.",children:e.jsxs("div",{className:"close_project flex  gap-2 spaceremove MobileNone",children:[e.jsx(lr,{sx:{color:x?"#9f9f9f":"#9B26B6"}}),e.jsx("p",{style:{color:x?"#9f9f9f":"#9B26B6"},className:"project_addDoc",onClick:x?"":os,children:"Close Project"})]})}),Pe==1&&e.jsxs(Li,{open:fe,onClose:ds,fullWidth:!0,maxWidth:"md",children:[e.jsx(Pi,{id:"first_alert__title",className:"first_alert__title",children:"Project Closed"}),e.jsx(bt,{children:e.jsxs("div",{children:[e.jsxs("p",{id:"firrt-dialog-description",style:{textAlign:"center"},className:"mb-6",children:["Project ",r.project_title," is closed. Any Job Postings under this project ",e.jsx("br",{}),"are also closed."]}),e.jsx("p",{id:"firrt-dialog-description",className:"ml-8",children:"Please indicate the reason to close this project:"}),e.jsx("div",{className:" pl-8",children:e.jsxs(nr,{className:"radio_cus",children:[e.jsx(cr,{"aria-labelledby":"demo-radio-buttons-group-label",name:"radio-buttons-group",children:Je.map((B,J)=>e.jsx(Hr,{value:B.id,checked:v==B.id,onChange:Ge=>{ye(Ge.target.value)},control:e.jsx(Vr,{}),label:B==null?void 0:B.reason}))}),e.jsxs("div",{className:"border_bottom",children:[e.jsx("h5",{className:"label_text",style:{marginTop:13},children:"Provide details (Optional)"}),e.jsx(ae,{id:"standard-basic",variant:"standard",name:"closedProjectreason",style:{width:"100%"},slotProps:{htmlInput:{autoComplete:"new-password"}},className:"reason_text",placeholder:"Please add an optional note",onCh
1ange:B=>{D(B.target.value)},value:te,onKeyPress:Rs,required:!0,multiline:!0})]})]})})]})}),e.jsx(Bi,{children:e.jsxs("div",{className:"pb-9 px-12 flex justify-between w-full",children:[e.jsx(zi,{text:"Cancel",onClick:ds,style:{marginRight:20}}),e.jsx(G,{text:"Submit",onClick:As})]})})]}),Ki==1&&e.jsxs(Li,{open:Yi,onClose:k,fullWidth:!0,maxWidth:"sm",children:[e.jsx(Pi,{id:"first_alert__title",className:"first_alert__title",children:"Project Closed"}),e.jsx(bt,{children:e.jsxs("div",{children:[e.jsxs("p",{id:"firrt-dialog-description",style:{textAlign:"center"},children:["Thank you for submitting your feedback"," "]}),e.jsx("div",{className:" pl-8",children:e.jsx(nr,{className:"radio_cus",children:e.jsx(cr,{"aria-labelledby":"demo-radio-buttons-group-label",name:"radio-buttons-group"})})})]})}),e.jsx(Bi,{children:e.jsxs("div",{className:"pb-9 px-12 flex justify-between w-full",children:[e.jsx(G,{text:"Create New Project",onClick:()=>{o("/app/create-new-project",{state:{isCreated:!0}})},style:{marginRight:20}}),e.jsx(G,{text:"Close",onClick:pt})]})})]}),r.project_status==1&&e.jsxs("div",{className:"flex gap-1 flex-wrap justify-end flex-col md:flex-row mt-5 RemoveThepadding",children:[!j&&Ei==0&&(ze.length>0?Bs.length>0?e.jsx(C,{title:"Click to view all your Live Job Postings",placement:"top",children:e.jsx("div",{className:"flex flex-col DisplayNone",children:e.jsx(G,{className:"",text:"Job postings",disableBtn:x,onClick:x?"":()=>{window.open(`/app/my-job-postings#project_id${r.id}`,"_blank")}})})}):e.jsx(C,{title:"Add characters and post as Job Posting to view this",placement:"top",children:e.jsx("div",{className:"flex flex-col DisplayNone",children:e.jsx(G,{className:"job_posting",text:"Job postings",disableBtn:!0})})}):e.jsx(C,{title:"Add characters and post as Job Posting to view this",placement:"top",children:e.jsx("div",{className:"flex flex-col DisplayNone",children:e.jsx(G,{className:"job_posting",text:"Job Postings",disableBtn:!0})})})),j&&e.jsx(zi,{className:"",text:"Cancel",white:!0,onClick:()=>{N(!1);let B=H.filter(J=>J.id);se(B),Oi(B),re(null),I(!0),$e(0),g(""),z(null),xi(0),Hi(0),Ie(null),me(null)}}),j&&ci!=0&&e.jsx("div",{className:"flex flex-col",children:e.jsx(G,{className:j&&ci!=0&&"opacity-50",text:j?"Save Changes":"Edit project",isLoading:!j&&Ei==1})}),j&&ci==0&&Ce==null&&A==!0&&F==""&&fs==0&&ei==null&&Qs==0&&K==null&&e.jsx("div",{className:"flex flex-col",children:e.jsx(G,{className:"opacity-50",text:j?"Save Changes":"Edit project",isLoading:!j&&Ei==1})}),!j&&e.jsx("div",{className:"flex flex-col",children:e.jsx(G,{disableBtn:x,className:(j&&Ce==null&&A==!0||Ce!=null&&A==!1)&&"opacity-50",text:j?"Save Changes":"Edit project",white:!0,onClick:x?"":()=>{var B;N(J=>!J),Ds((B=r==null?void 0:r.project_description)==null?void 0:B.length),j&&Ce==null&&A==!1&&Wi()},isLoading:!j&&Ei==1})}),j&&Ce!=null&&ci==0&&e.jsx("div",{className:"flex flex-col",children:e.jsx(G,{text:j?"Save Changes":"Edit project",disableBtn:x,onClick:x?"":()=>{N(B=>!B),j&&Wi()},isLoading:!j&&Ei==1})}),j&&ci==0&&Ce==null&&(F!=""||fs==1||K!=null||Ce==null&&A==!1||Qs==1||ei!=null)&&e.jsx("div",{className:"flex flex-col",children:e.jsx(G,{text:j?"Save Changes":"Edit project",disableBtn:x,onClick:x?"":()=>{N(B=>!B),j&&Wi()},isLoading:!j&&Ei==1})})]})]})]})})})})]}):Be?e.jsx(fr,{marginTop:"mt-0"}):cs?cs?e.jsx(or,{TextContent:e.jsxs("span",{children:["View details of your Open Projects here. Create a new project by clicking"," ",e.jsx("span",{style:{color:"#9B26B6",cursor:"pointer"},onClick:()=>o("/app/create-new-project",{state:{isCreated:!0}}),children:"here"})]})}):"Something went wrong":e.jsx(or,{disableImage:!0,TextContent:"No Closed Projects found. Once you close a project, it will be shown here."})})})]}),!Ti&&!Be&&S&&S[0]&&e.jsx(e.Fragment,{children:e.jsx(Sn,{projectDetails:S[0],isNewCharacter:!1,isClosed:((Os=S[0])==null?void 0:Os.project_status)==2,tabvalue:"1",isNewChar:vi})})]}),e.jsx("div",{className:"bottom_space"})]})]})}),e.jsxs(Li,{className:"NewPopupClassClose NewPopupClassClose_outer",open:Le,onClose:k,fullWidth:!0,maxWidth:"sm",children:[e.jsxs(Pi,{id:"first_alert__title  first_alert__title_outer",className:"first_alert__title",style:{paddingBottom:"0"},children:['Close Project "',(S==null?void 0:S.length)&&S[0].project_title,'"']}),e.jsx(bt,{children:e.jsx("div",{children:e.jsxs("p",{id:"firrt-dialog-description",style:{textAlign:"center",fontSize:"18px",color:"#44454D",lineHeight:"27px"},children:["All your Job Postings of this project will also get closed and",e.jsx("br",{}),"talents will no longer be able to Apply to this project any more.",e.jsx("br",{}),e.jsx("b",{children:"This action is irreversible."})," Close project?"]})})}),e.jsx(Bi,{children:e.jsxs("div",{className:"pb-6 px-6 flex justify-end gap-3 w-full",children:[e.jsx(zi,{text:"Cancel",onClick:k}),e.jsx(G,{text:"Yes, close project",onClick:Zi})]})})]})]})};export{po as default};

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.