1import{_ as he}from"./DSago7zB.js";import{_ as _e}from"./_TeY7avl.js";import{_ as we}from"./DAvRA8n7.js";import{_ as $e}from"./98WfNmqH.js";import{_ as Ae}from"./R63fu-Ty.js";import{a as Ce,_ as Se}from"./C3JqyHk7.js";import{_ as De}from"./DA2vljnD.js";import{_ as Ie}from"./C85GMcCZ.js";import{ak as nt,s as fe,i as z,h as C,a2 as lt,c as u,o as a,t as d,E as it,e as qe,O as ne,j as J,w as o,b as s,a as e,d as i,F as D,r as L,k as I,Q as Me,A as je,v as pe,y as ae,N as rt,f as n,K as Fe,n as U,L as dt}from"./D2aBaYCh.js";import{_ as Ve}from"./69vNnjgr.js";import{_ as Ee,a as Le,b as Ne,c as Pe,d as Te}from"./CV80t7uv.js";import{_ as ze}from"./hLujHJJh.js";import{S as me,_ as ut}from"./D2VLLpV9.js";import{_ as ct,a as pt,b as mt,c as _t,d as ft}from"./Bb_cvoc-.js";import{_ as vt}from"./1vL5Og7n.js";import{_ as gt}from"./DnimgOL5.js";import{u as Ke}from"./X3twHqHW.js";import{u as H}from"./Dt3MCdMV.js";import{u as Oe}from"./CAyuNa95.js";import{C as yt}from"./CQuTLo_P.js";import{S as Re}from"./jRoo9D20.js";import{T as Be}from"./cIqa32aJ.js";import{c as xt}from"./ChviPwxD.js";import{F as bt}from"./i5my3rD6.js";import{M as kt}from"./s7RBrMMq.js";import{u as ht}from"./BE1u7KBh.js";import"./BSVju-9X.js";import"./B_LYIUCK.js";import"./D2ltdv55.js";import"./BPAl-OSZ.js";import"./Cb6z0Gxi.js";import"./_lQnYn91.js";import"./B-DFnFy7.js";import"./DKZOPE58.js";import"./CHIgUVhi.js";import"./ChOKVcqp.js";import"./CjlqfVHq.js";import"./r1c86NA2.js";import"./N9UflkqM.js";import"./8gyaHsCQ.js";import"./FUKBWQwh.js";import"./BJ7eJWA3.js";import"./BFRx4GjS.js";import"./Bl41dlVg.js";import"./kRIii9yh.js";import"./D3VWVCOu.js";import"./vi2mB--f.js";import"./DJl8XXE2.js";import"./DH9hYNFk.js";import"./O1XqtwN6.js";import"./CyKarPmH.js";import"./B7iN_SNJ.js";import"./CHs1IB-k.js";import"./DvgU3qHA.js";import"./C-E83dC9.js";import"./DhenvKde.js";const wt=xt("calendar-fold",[["path",{d:"M3 20a2 2 0 0 0 2 2h10a2.4 2.4 0 0 0 1.706-.706l3.588-3.588A2.4 2.4 0 0 0 21 16V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2z",key:"r586nh"}],["path",{d:"M15 22v-5a1 1 0 0 1 1-1h5",key:"xl3app"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h18",key:"8toen8"}]]),$t=["datetime","title"],Ue={__name:"NuxtTime",props:{locale:{type:String,required:!1},datetime:{type:[String,Number,Date],required:!0},localeMatcher:{type:String,required:!1},weekday:{type:String,required:!1},era:{type:String,required:!1},year:{type:String,required:!1},month:{type:String,required:!1},day:{type:String,required:!1},hour:{type:String,required:!1},minute:{type:String,required:!1},second:{type:String,required:!1},timeZoneName:{type:String,required:!1},formatMatcher:{type:String,required:!1},hour12:{type:Boolean,required:!1,default:void 0},timeZone:{type:String,required:!1},calendar:{type:String,required:!1},dayPeriod:{type:String,required:!1},numberingSystem:{type:String,required:!1},dateStyle:{type:String,required:!1},timeStyle:{type:String,required:!1},hourCycle:{type:String,required:!1},relative:{type:Boolean,required:!1},numeric:{type:String,required:!1},relativeStyle:{type:String,required:!1},title:{type:[Boolean,String],required:!1}},setup(W){const x=W,b=nt()?.vnode.el,S=b?.getAttribute("datetime"),j=b?.getAttribute("data-locale"),$=fe(),q=z(()=>{const r=x.datetime;return S&&$.isHydrating?new Date(S):x.datetime?new Date(r):new Date}),p=C($.isHydrating&&window._nuxtTimeNow?new Date(window._nuxtTimeNow):new Date);if(x.relative){const h=setInterval(()=>{p.value=new Date},1e3);lt(()=>clearInterval(h))}const F=z(()=>{const{locale:r,relative:h,relativeStyle:A,...V}=x;return h?new Intl.RelativeTimeFormat(j??r,{...V,style:A}):new Intl.DateTimeFormat(j??r,V)}),Z=z(()=>{if(!x.relative)return F.value.format(q.value);const r=(q.value.getTime()-p.value.getTime())/1e3,h=[{unit:"second",seconds:1,threshold:60},{unit:"minute",seconds:60,threshold:60},{unit:"hour",seconds:3600,threshold:24},{unit:"day",seconds:86400,threshold:30},{unit:"month",seconds:2592e3,threshold:12},{unit:"year",seconds:31536e3,threshold:1/0}],{unit:A,seconds:V}=h.find(({seconds:O,threshold:P})=>Math.abs(r/O)<P)||h[h.length-1],N=r/V;return F.value.format(Math.round(N),A)}),K=z(()=>q.value.toISOString()),R=z(()=>x.title===!0?K.value:typeof x.title=="string"?x.title:void 0),m={};return(r,h)=>(a(),u("time",it(m,{datetime:K.value,title:R.value}),d(Z.value),17,$t))}},At={class:"space-y-4"},Ct={key:0,class:"text-xs text-gray-500 mt-1"},St=qe({__name:"CreateOrEditApplicationDialog",props:{open:{type:Boolean,default:!1},mode:{default:"create"},selectedApp:{default:null},storeApplicationMutation:{},updateApplicationMutation:{},allData:{}},emits:["update:open"],setup(W,{emit:x}){const b=W,S=x,j=z({get:()=>
1b.open,set:m=>S("update:open",m)}),$=z(()=>b.mode==="edit"),q=C(null),p=C({loker_id:"",freelancer_id:"",resume:"",cover_letter:""}),F=z(()=>{const m=new Map;return(b.allData||[]).forEach(r=>{r.loker&&m.set(r.loker.id,r.loker)}),Array.from(m.values())}),Z=z(()=>{const m=new Map;return(b.allData||[]).forEach(r=>{r.freelancer&&m.set(r.freelancer.id,r.freelancer)}),Array.from(m.values())});ne(()=>b.selectedApp,m=>{$.value&&m?(p.value.loker_id=String(m.loker.id),p.value.freelancer_id=String(m.freelancer.id),p.value.resume=m.resume||"",p.value.cover_letter=m.cover_letter||""):(p.value.loker_id="",p.value.freelancer_id="",p.value.resume="",p.value.cover_letter=""),q.value=null},{immediate:!0});function K(m){const r=m.target;q.value=r.files?.[0]??null}function R(){const m=new FormData;m.append("loker_id",p.value.loker_id),m.append("freelancer_id",p.value.freelancer_id),q.value&&m.append("resume",q.value),p.value.cover_letter&&m.append("cover_letter",p.value.cover_letter),$.value?b.updateApplicationMutation?.mutate({id:b.selectedApp.id,payload:m}):b.storeApplicationMutation?.mutate({payload:m})}return ne(()=>$.value?b.updateApplicationMutation?.isSuccess?.value:b.storeApplicationMutation?.isSuccess?.value,m=>{m&&(S("update:open",!1),p.value.loker_id="",p.value.freelancer_id="",p.value.resume="",p.value.cover_letter="",q.value=null)}),(m,r)=>{const h=Ne,A=Pe,V=Le,N=mt,O=pt,P=ft,Q=_t,Y=ct,l=vt,E=gt,_=_e,se=ze,B=Ee,X=Te;return a(),J(X,{open:j.value,"onUpdate:open":r[3]||(r[3]=g=>j.value=g)},{default:o(()=>[s(B,{class:"max-w-lg"},{default:o(()=>[s(V,null,{default:o(()=>[s(h,null,{default:o(()=>[i(d($.value?"Edit":"Create")+" Application",1)]),_:1}),s(A,null,{default:o(()=>[i(d($.value?"Update this application.":"Fill out the form to create."),1)]),_:1})]),_:1}),e("div",At,[e("div",null,[r[4]||(r[4]=e("label",{class:"text-sm font-medium"},"Loker",-1)),s(Y,{modelValue:p.value.loker_id,"onUpdate:modelValue":r[0]||(r[0]=g=>p.value.loker_id=g)},{default:o(()=>[s(O,{class:"w-full",disabled:""},{default:o(()=>[s(N,{placeholder:"Select Loker"})]),_:1}),s(Q,null,{default:o(()=>[(a(!0),u(D,null,L(F.value,g=>(a(),J(P,{key:g.id,value:String(g.id)},{default:o(()=>[i(d(g.title),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue"])]),e("div",null,[r[5]||(r[5]=e("label",{class:"text-sm font-medium"},"Freelancer",-1)),s(Y,{modelValue:p.value.freelancer_id,"onUpdate:modelValue":r[1]||(r[1]=g=>p.value.freelancer_id=g)},{default:o(()=>[s(O,{class:"w-full",disabled:""},{default:o(()=>[s(N,{placeholder:"Select Freelancer"})]),_:1}),s(Q,null,{default:o(()=>[(a(!0),u(D,null,L(Z.value,g=>(a(),J(P,{key:g.id,value:String(g.id)},{default:o(()=>[i(d(g.user.name),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue"])]),e("div",null,[r[6]||(r[6]=e("label",{class:"text-sm font-medium"},"Resume",-1)),s(l,{type:"file",accept:".pdf,.doc,.docx,.jpg,.jpeg,.png",onChange:K}),$.value&&p.value.resume?(a(),u("p",Ct," Current file: "+d(p.value.resume),1)):I("",!0)]),e("div",null,[r[7]||(r[7]=e("label",{class:"text-sm font-medium"},"Cover Letter",-1)),s(E,{modelValue:p.value.cover_letter,"onUpdate:modelValue":r[2]||(r[2]=g=>p.value.cover_letter=g),rows:"3",placeholder:"Optional cover letter..."},null,8,["modelValue"])])]),s(se,{class:"mt-4"},{default:o(()=>[s(_,{type:"button",onClick:R},{default:o(()=>[i(d($.value?"Update Application":"Save Application"),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])}}}),He=Object.assign(St,{__name:"CustomDashboardApplicationsCreateOrEditApplicationDialog"}),Dt={class:"relative flex justify-between"},It={class:"flex items-center justify-end"},qt={class:"rounded-md border p-4"},Mt={class:"w-full space-y-4"},jt={class:"flex gap-2 items-center justify-between"},Ft={class:"flex gap-2"},Vt={key:0},Et={key:1},Lt={key:0},Nt={key:1},Pt={class:"rounded-md"},Tt={class:"flex space-x-4 pb-4 overflow-x-auto min-h-[60vh]3"},zt={class:"font-semibold text-sm mb-2"},Kt={class:"w-full flex items-center border-border-jobster/70 px-3 py-2 cursor-pointer"},Ot={class:"overflow-hidden"},Rt={class:"flex items-center space-x-2"},Bt={class:"grid flex-1 text-left text-xs leading-tight"},Ut={class:"flex items-center truncate font-medium text-sm"},Ht={class:"flex-2 space-y-1"},Jt={class:"wrap-break-words text-xs text-muted-foreground inline-flex"},Qt={class:"flex text-xs items-center"},Yt={class:"font-semibold text-red-500"},Zt={class:"px-2 py-2 text-xs space-y-2"},Gt={class:"rounded border bg-content-jobster"},Wt={class:"border-t py-2 text-sm space-y-2"},Xt={class:"flex justify-between items-center text-xs cursor-pointer"},es={class:"mt-2 p-2 border border-border-jobster rounded bg-card-single text-xs space-y-1"},ts={key:0},ss={key:1},os={key:2,class:"flex items-center gap-0.5"},as={class:"flex items-center justify-between gap-2 pt-1"},ns={class:"items-end space-x-2"},ls={class:"flex items-end-safe justify-between"},is={class:"text-sm"},rs={class:"grid grid-cols-1 md:grid-cols-3 gap-4 text-sm"},ds={class:"md:col-span-1 space-y-2"},us={class:"flex items-center space-x-2"},cs={class:"grid flex-1 text-left text-xs leading-tight"},ps={class:"flex items-center truncate font-medium text-sm"},ms={class:"text-xs text-gray-600 space-y-1"},_s={key:1,class:"text-gray-500 italic"},fs={class:"md:col-span-2 space-y-2"},vs={key:0,class:"text-sm text-gray-500 p-3 border rounded"},gs={class:"px-3 py-2 cursor-pointer flex items-center justify-between bg-accent-foreground
1/10"},ys={class:"text-xs text-gray-500"},xs={class:"p-3 text-xs space-y-1"},bs={class:"flex items-center gap-0.5"},ks={class:"flex gap-2 mt-2"},hs={__name:"CustomDashboardApplicationsIndexApplication",setup(W){const{getInitials:x}=Oe(),b=Me(),S=z(()=>b.query.loker_id||null),{$api:j}=fe(),{data:$,isLoading:q,isError:p,search:F,filters:Z,allData:K,isFetching:R,nextPage:m,refetch:r}=Ke({endpoint:"/api/applications",queryKey:["applications"],defaultPerPage:20,defaultFilters:{loker_id:S.value},append:!0});ne(S,()=>{Z.value.loker_id=S.value,r()});const h=je(),A=C(!1),V=pe({mutationFn:async f=>{const{data:t}=await j.get(`/api/applications/${f}`);return t.data},onSuccess:f=>{l.value=f,A.value=!0,h.invalidateQueries({queryKey:["applications"]}),r()}}),N=pe({mutationFn:async f=>{await j.post(`/api/applications/${f}/accept`)},onSuccess:()=>{ae.success("Status berhasil diperbarui."),h.invalidateQueries({queryKey:["applications"]}),l.value&&(l.value.status="accepted"),A.value=!1,r()}}),O=pe({mutationFn:async f=>{await j.post(`/api/applications/${f}/reject`)},onSuccess:()=>{ae.success("Status berhasil diperbarui."),h.invalidateQueries({queryKey:["applications"]}),l.value&&(l.value.status="rejected"),A.value=!1,r()}}),P=C(!1),Q=C(null),Y=C("create"),l=C(null),E=C(null),_=rt({interview_type:"",scheduled_at:"",location:"",link_meet:"",notes:""}),se=H("create",{entity:"Interview",queryKey:["applications"],url:(f,{id:t})=>`/api/applications/${t}/interviews`}),B=H("update",{entity:"Interview",queryKey:["applications"],url:(f,{applicationId:t,interviewId:G})=>`/api/applications/${t}/interviews/${G}`}),X=H("delete",{entity:"Interview",queryKey:["applications"],url:(f,{applicationId:t,interviewId:G})=>`/api/applications/${t}/interviews/${G}`});function g(f={}){Object.assign(_,{interview_type:"",scheduled_at:"",location:"",link_meet:"",notes:"",...f})}function le(f){Y.value="create",l.value=f,E.value=f.id,Q.value=null,g(),P.value=!0}function ie(f,t){Y.value="edit",l.value=f,E.value=f.id,Q.value=t;const G=(t.scheduled_at||"").replace(" ","T").slice(0,16);g({...t,scheduled_at:G}),P.value=!0}const ee=C(!1),oe=C("create"),re=H("create",{entity:"Application",queryKey:["applications"],url:()=>"/api/applications"}),de=H("update",{entity:"Application",queryKey:["applications"],url:(f,{id:t})=>`/api/applications/${t}`}),ue=H("delete",{entity:"Application",queryKey:["applications"],url:(f,{id:t})=>`/api/applications/${t}`});function ce(){oe.value="create",l.value=null,ee.value=!0}function T(f){oe.value="edit",l.value=f,ee.value=!0}function k(f){ae.error("Yakin mau hapus application ini?",{description:`Application Name: ${f.freelancer?.user?.name}`,action:{label:"Hapus",onClick:()=>{ue.mutate({id:f.id})}}})}const w=[{key:"pending",label:"Pending",color:"bg-amber-500",bgColors:"bg-amber-500/5"},{key:"viewed",label:"Viewed",color:"bg-sky-600",bgColors:"bg-sky-600/5"},{key:"interview_scheduled",label:"Interview",color:"bg-indigo-600",bgColors:"bg-indigo-600/5"},{key:"accepted",label:"Accepted",color:"bg-green-600",bgColors:"bg-green-600/5"},{key:"rejected",label:"Rejected",color:"bg-red-600",bgColors:"bg-red-600/5"}];return(f,t)=>{const G=he,M=_e,Je=we,Qe=$e,Ye=Ae,ve=De,ge=Ce,ye=Se,xe=Ie,be=Ue,te=Ve,Ze=Ne,Ge=Pe,We=Le,Xe=ze,et=Ee,tt=Te,st=ut,ot=He;return a(),u(D,null,[e("div",Dt,[e("div",null,[s(G,{title:"Applications",description:"Manage your applications and permission settings"})]),e("div",It,[s(M,{onClick:ce,size:"sm",class:"items-center"},{default:o(()=>[s(n(yt),{class:"w-4 h-4 mr-2"}),t[7]||(t[7]=i(" Add Application ",-1))]),_:1})])]),e("div",qt,[e("div",Mt,[e("div",jt,[e("div",Ft,[s(Je,{modelValue:n(F),"onUpdate:modelValue":t[0]||(t[0]=c=>Fe(F)?F.value=c:null),placeholder:"Filter search..."},null,8,["modelValue"])]),n($)?.links?.next?(a(),J(M,{key:0,size:"sm",onClick:n(m),disabled:n(R)},{default:o(()=>[n(R)?(a(),u("span",Et,"Loading...")):(a(),u("span",Vt,"Load More"))]),_:1},8,["onClick","disabled"])):I("",!0)]),n(q)?(a(),u("div",Lt,"Loading...")):n(p)?(a(),u("div",Nt,"Error! fetching applications")):I("",!0),e("div",Pt,[e("div",Tt,[(a(),u(D,null,L(w,c=>e("div",{key:c.key,class:U(["w-72 shrink-0 rounded-lg border p-2.5",c.bgColors??"bg-primary-foreground"])},[e("h2",zt,[s(Qe,{color:c.color,label:c.label},null,8,["color","label"])]),s(Ye,{class:"my-3"}),(a(!0),u(D,null,L(n(K).filter(y=>y.status===c.key),y=>(a(),u("div",{key:y.id,class:"border rounded-md border-border-jobster/70 shadow bg-card mb-2"},[e("details",null,[e("summary",Kt,[e("div",Ot,[e("div",Rt,[s(ye,{class:"h-6 w-6 overflow-hidden rounded-sm"},{default:o(()=>[y.freelancer.user.avatar?(a(),J(ve,{key:0,src:`${y.freelancer?.user?.avatar}`,alt:y.freelancer?.user?.name},null,8,["src","alt"])):I("",!0),s(ge,{class:"rounded-lg text-black dark:text-white"},{default:o(()=>[i(d(n(x)(y.freelancer?.user?.name)),1)]),_:2},1024)]),_:2},1024),e("div",Bt,[e("span",Ut,[i(d(y.freelancer?.user?.name??"")+" ",1),e("span",null,[s(xe,{variant:y.freelancer?.badge,class:"size-3 ml-1 fill-current"},null,8,["variant"])])])])]),e("div",Ht,[e("span",Jt," Apply to "+d(y.loker?.title)+" @"+d(y.loker?.company?.title),
11),e("div",Qt,[e("p",null,[t[8]||(t[8]=i(" Interviews last step ",-1)),e("span",Yt,d(y.interviews_count??"0"),1)])])])])]),e("div",Zt,[e("details",Gt,[t[13]||(t[13]=e("summary",{class:"cursor-pointer px-2 py-1 text-xs flex items-center justify-between"},[i(" Interview steps "),e("span",{class:"ml-2 text-[10px] px-2 py-0.5 rounded bg-gray-200 text-gray-700"},"show")],-1)),e("div",Wt,[(a(!0),u(D,null,L(y.interviews,(v,at)=>(a(),u("details",{class:"px-2",key:v.id},[e("summary",Xt,[e("span",null,"Step "+d(at+1)+": "+d(v.interview_type),1),e("span",{class:U(["text-[10px] px-2 py-0.5 rounded",{"bg-indigo-600/10 text-indigo-600":v.status==="scheduled","bg-green-600/10 text-green-600":v.status==="completed","bg-red-600/10 text-red-600":v.status==="canceled"}])},d(v.status),3)]),e("div",es,[e("p",null,[t[9]||(t[9]=e("strong",null,"Date:",-1)),s(be,{datetime:v.scheduled_at,locale:"id-ID",month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"},null,8,["datetime"])]),v.notes?(a(),u("p",ts,[t[10]||(t[10]=e("strong",null,"Notes:",-1)),i(" "+d(v.notes),1)])):I("",!0),v.feedback?(a(),u("p",ss,[t[11]||(t[11]=e("strong",null,"Feedback:",-1)),i(" "+d(v.feedback),1)])):I("",!0),v.rating?(a(),u("p",os,[t[12]||(t[12]=e("strong",null,"Rating:",-1)),(a(),u(D,null,L(5,ke=>s(n(me),{key:ke,class:U(["w-3 h-3",ke<=v.rating?"fill-yellow-400 text-yellow-400":"fill-gray-300 text-gray-300 dark:fill-gray-600 dark:text-gray-600"])},null,8,["class"])),64))])):I("",!0)])]))),128))])]),e("div",as,[s(M,{onClick:v=>n(V).mutate(y.id),class:"h-6 px-2 py-1 text-xs rounded-sm"},{default:o(()=>[...t[14]||(t[14]=[i(" View ",-1)])]),_:1},8,["onClick"]),s(te,{to:`/dashboard/applications/${y.id}`},{default:o(()=>[s(M,{class:"h-6 px-2 py-1 text-xs rounded-sm"},{default:o(()=>[...t[15]||(t[15]=[i(" View Details ",-1)])]),_:1})]),_:1},8,["to"]),e("div",ns,[s(M,{class:"h-6 w-6 text-xs hover:bg-green-600/15",variant:"secondary",onClick:v=>T(y)},{default:o(()=>[s(n(Re),{class:"w-3.5! h-3.5!"})]),_:1},8,["onClick"]),s(M,{size:"icon",class:"h-6 w-6 text-xs hover:bg-red-600/15",variant:"secondary",onClick:v=>k(y)},{default:o(()=>[s(n(Be),{class:"w-3.5! h-3.5!"})]),_:1},8,["onClick"])])])])])]))),128))],2)),64))])])])]),e("div",null,[s(tt,{open:A.value,"onUpdate:open":t[4]||(t[4]=c=>A.value=c)},{default:o(()=>[s(et,{class:"max-w-4xl! w-full"},{default:o(()=>[s(We,null,{default:o(()=>[e("div",ls,[e("div",null,[s(Ze,null,{default:o(()=>[...t[16]||(t[16]=[i("Application Details",-1)])]),_:1}),s(Ge,{class:"text-sm pt-1.5"},{default:o(()=>[t[17]||(t[17]=i(" Apply loker to ",-1)),s(te,{to:`/loker/${l.value.loker.slug}`,class:"font-medium hover:underline"},{default:o(()=>[i(d(l.value.loker.title),1)]),_:1},8,["to"]),t[18]||(t[18]=i(" Company ",-1)),s(te,{to:`/perusahaan/${l.value.loker.company.slug}`,class:"font-medium hover:underline"},{default:o(()=>[i(d(l.value.loker.company.title),1)]),_:1},8,["to"]),t[19]||(t[19]=i(". ",-1))]),_:1})]),e("div",null,[e("p",is,[t[20]||(t[20]=i(" Status : ",-1)),e("span",{class:U(["px-2 py-1.5 rounded",{"bg-indigo-600/10 text-indigo-600":l.value.status==="interview_scheduled","bg-green-600/10 text-green-600":l.value.status==="accepted","bg-red-600/10 text-red-600":l.value.status==="rejected","bg-sky-600/10 text-sky-600":l.value.status==="viewed","bg-amber-500/10 text-amber-500":l.value.status==="pending"}])},d(l.value.status),3)])])])]),_:1}),e("div",rs,[e("div",ds,[e("div",null,[t[21]||(t[21]=e("p",{class:"font-semibold py-1"},"Applied",-1)),s(M,{size:"sm",variant:"secondary",class:"text-green-600"},{default:o(()=>[s(n(wt),{class:"w-4 h-4 mr-2"}),i(" "+d(l.value.applied_at??""),1)]),_:1})]),t[24]||(t[24]=e("p",{class:"font-semibold"},"Talent",-1)),e("div",us,[s(ye,{class:"h-8 w-8 overflow-hidden rounded-sm"},{default:o(()=>[l.value.freelancer?.user?.avatar?(a(),J(ve,{key:0,src:`${l.value.freelancer?.user?.avatar}`,alt:l.value.freelancer?.user?.name},null,8,["src","alt"])):I("",!0),s(ge,{class:"rounded-lg text-black dark:text-white"},{default:o(()=>[i(d(n(x)(l.value.freelancer?.user?.name)),1)]),_:1})]),_:1}),e("div",cs,[e("span",ps,[i(d(l.value.freelancer?.user?.name??"")+" ",1),e("span",null,[s(xe,{variant:l.value.freelancer?.badge,class:"size-3 ml-1 fill-current"},null,8,["variant"])])]),s(te,{to:`/freelancers/${l.value.freelancer?.user?.username}`,class:"text-xs text-sky-600 hover:underline"},{default:o(()=>[i("@"+d(l.value.freelancer?.user?.username??""),1)]),_:1},8,["to"])])]),e("div",ms,[e("p",null," Email: "+d(l.value.freelancer?.user?.email??""),1),e("p",null," Phone: "+d(l.value.freelancer?.user?.phone??""),1)]),e("div",null,[t[23]||(t[23]=e("p",{class:"font-semibold py-1"},"Resume",-1)),s(M,{size:"sm",variant:"default"},{default:o(()=>[s(n(bt),{class:"w-4 h-4 mr-2"}),l.value.resume?(a(),J(te,{key:0,to:`${l.value.resume}`,target:"_blank"},{default:o(()=>[...t[22]||(t[22]=[i("View Resume",-1)])]),_:1},8,["to"])):(a(),u("span",_s,"No Resume"))]),_:1})])]),e("div",fs,[t[32]||(t[32]=e("h4",{class:"text-xs font-semibold text-gray-700"}," Interview History ",-1)),!l.value?.interviews||l.value.interviews.length===0?(a(),u("p",vs," Belum ada interview. Silakan buat interview baru. ")):(a(!0),u(D,{key:1},L(l.value.interviews,(c,y)=>(a(),u("details",{key:c.id,class:"rounded border"},[e("summary",gs,[e("span",null,[i(" Step "+d(y+1)+": "+d(c.interview_type)+" â ",1),e("span",{class:U(["text-xs px-2 py-1 rounded",{"bg-indigo-600/10 text-indigo-600":c.status==="scheduled","bg-green-600/10 text-green-600":c.status==="completed","bg-red-600/10 text-red-600":c.status==="canceled"}])},d(c.status),3)]),e("span",ys,[s(be,{datetime:c.scheduled_at,locale:"id-ID",month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"},null,8,["datetime"])])]),e("div",xs,[e("p",null,[t[25]||(t[25]=e("strong",null,"Location:",-1)),i(" "+d(c.location),1)]),e("p",null,[t[26]||(t[26]=e("strong",null,"Meet: ",-1)),s(te,{to:c.link_meet,class:"text-sky-500"},{default:o(()=>[i(d(c.link_meet),1)]),_:2},1032,["to"])]),e("p",null,[t[27]||(t[27]=e("strong",null,"Notes:",-1)),i(" "+d(c.notes),1)]),e("p",null,[t[28]||(t[28]=e("strong",null,"Feedback:",-1)),i(" "+d(c.feedback),1
1)]),e("div",bs,[t[29]||(t[29]=e("span",{class:"mr-1"},[e("strong",null,"Rating: ")],-1)),(a(),u(D,null,L(5,v=>s(n(me),{key:v,class:U(["w-3 h-3",v<=c.rating?"fill-yellow-400 text-yellow-400":"fill-gray-300 text-gray-300 dark:fill-gray-600 dark:text-gray-600"])},null,8,["class"])),64))]),e("div",ks,[s(M,{class:"bg-amber-500 hover:bg-amber-600 text-white px-2 py-0.5 h-5 text-[10px] rounded-sm",onClick:v=>{A.value=!1,ie(l.value,c)}},{default:o(()=>[...t[30]||(t[30]=[i(" Edit ",-1)])]),_:1},8,["onClick"]),s(M,{class:"bg-red-600 hover:bg-red-700 text-white px-2 py-0.5 h-5 text-[10px] rounded-sm",onClick:v=>{A.value=!1,n(X).mutate({applicationId:l.value.id,interviewId:c.id})}},{default:o(()=>[...t[31]||(t[31]=[i(" Delete ",-1)])]),_:1},8,["onClick"])])])]))),128))])]),s(Xe,null,{default:o(()=>[s(M,{size:"sm",class:"bg-green-600 hover:bg-green-700 text-white",onClick:t[1]||(t[1]=c=>n(N).mutate(l.value.id)),disabled:n(N).isPending.value||n(O).isPending.value},{default:o(()=>[...t[33]||(t[33]=[i(" Accept ",-1)])]),_:1},8,["disabled"]),s(M,{size:"sm",class:"bg-red-600 hover:bg-red-700 text-white",onClick:t[2]||(t[2]=c=>n(O).mutate(l.value.id)),disabled:n(N).isPending.value||n(O).isPending.value},{default:o(()=>[...t[34]||(t[34]=[i(" Reject ",-1)])]),_:1},8,["disabled"]),s(M,{size:"sm",class:"bg-blue-500 hover:bg-blue-600 text-white",onClick:t[3]||(t[3]=c=>{A.value=!1,le(l.value)})},{default:o(()=>[...t[35]||(t[35]=[i(" Create Interview ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"]),s(st,{open:P.value,"onUpdate:open":t[5]||(t[5]=c=>P.value=c),mode:Y.value,form:_,"selected-app":l.value,"editing-interview-id":Q.value?.id??null,"store-interview-mutation":n(se),"update-interview-mutation":n(B)},null,8,["open","mode","form","selected-app","editing-interview-id","store-interview-mutation","update-interview-mutation"]),s(ot,{open:ee.value,"onUpdate:open":t[6]||(t[6]=c=>ee.value=c),mode:oe.value,"selected-app":l.value,"all-data":n(K),"store-application-mutation":n(re),"update-application-mutation":n(de)},null,8,["open","mode","selected-app","all-data","store-application-mutation","update-application-mutation"])])],64)}}},ws={class:"relative flex justify-between"},$s={class:"flex items-center justify-end"},As={class:"rounded-md border p-4"},Cs={class:"w-full space-y-4"},Ss={class:"flex gap-2 items-center justify-between"},Ds={class:"flex gap-2"},Is={key:0},qs={key:1},Ms={key:0},js={key:1},Fs={key:2,class:"rounded-md"},Vs={class:"flex space-x-4 pb-4 overflow-x-auto min-h-[60vh]3"},Es={class:"font-semibold text-sm mb-2"},Ls={class:"w-full flex items-center border-border-jobster/70 px-3 py-2 cursor-pointer"},Ns={class:"overflow-hidden"},Ps={class:"flex items-center space-x-2"},Ts={class:"grid flex-1 text-left text-xs leading-tight"},zs={class:"flex items-center truncate font-medium text-sm"},Ks={class:"flex-2 space-y-1"},Os={class:"wrap-break-words text-xs text-muted-foreground inline-flex"},Rs={class:"flex text-xs items-center"},Bs={class:"font-semibold text-red-500"},Us={class:"px-2 py-2 text-xs space-y-2"},Hs={class:"rounded border bg-content-jobster"},Js={class:"border-t py-2 text-sm space-y-2"},Qs={class:"flex justify-between items-center text-xs cursor-pointer"},Ys={class:"mt-2 p-2 border border-border-jobster rounded bg-card-single text-xs space-y-1"},Zs={key:0},Gs={key:1},Ws={key:2,class:"flex items-center gap-0.5"},Xs={class:"flex items-center justify-between gap-2 pt-1"},eo={class:"items-end space-x-2"},to={__name:"CustomDashboardFreelancersFreelancerApplication",setup(W){const{getInitials:x}=Oe(),b=Me(),S=z(()=>b.query.loker_id||null),{$api:j}=fe(),{data:$,isLoading:q,isError:p,search:F,filters:Z,allData:K,isFetching:R,nextPage:m,refetch:r}=Ke({endpoint:"/api/applications",queryKey:["applications"],defaultPerPage:20,defaultFilters:{loker_id:S.value},append:!0});ne(S,()=>{Z.value.loker_id=S.value,r()}),je(),C(!1);const h=C(null),A=[{key:"pending",label:"Pending",color:"bg-amber-500",bgColors:"bg-amber-500/5"},{key:"viewed",label:"Viewed",color:"bg-sky-600",bgColors:"bg-sky-600/5"},{key:"interview_scheduled",label:"Interview",color:"bg-indigo-600",bgColors:"bg-indigo-600/5"},{key:"accepted",label:"Accepted",color:"bg-green-600",bgColors:"bg-green-600/5"},{key:"rejected",label:"Rejected",color:"bg-red-600",bgColors:"bg-red-600/5"}],V=C(!1),N=C("create"),O=H("create",{entity:"Application",queryKey:["applications"],url:()=>"/api/applications"}),P=H("update",{entity:"Application",queryKey:["applications"],url:(E,{id:_})=>`/api/applications/${_}`}),Q=H("delete",{entity:"Application",queryKey:["applications"],url:(E,{id:_})=>`/api/applications/${_}`});function Y(E){N.value="edit",h.value=E,V.value=!0}function l(E){ae.error("Yakin mau hapus application ini?",{description:`Application Name: ${E.freelancer?.user?.name}`,action:{label:"Hapus",onClick:()=>{Q.mutate({id:E.id})}}})}return(E,_)=>{const se=he,B=_e,X=Ve,g=we,le=$e,ie=Ae,ee=De,oe=Ce,re=Se,de=Ie,ue=Ue,ce=He;
1return a(),u(D,null,[e("div",ws,[e("div",null,[s(se,{title:"Applications",description:"Manage your applications and permission settings"})]),e("div",$s,[s(X,{to:"/dashboard"},{default:o(()=>[s(B,{size:"sm",class:"items-center"},{default:o(()=>[s(n(kt),{class:"w-4 h-4 mr-2"}),_[2]||(_[2]=i(" Kembali ",-1))]),_:1})]),_:1})])]),e("div",As,[e("div",Cs,[e("div",Ss,[e("div",Ds,[s(g,{modelValue:n(F),"onUpdate:modelValue":_[0]||(_[0]=T=>Fe(F)?F.value=T:null),placeholder:"Filter search..."},null,8,["modelValue"])]),n($)?.links?.next?(a(),J(B,{key:0,size:"sm",onClick:n(m),disabled:n(R)},{default:o(()=>[n(R)?(a(),u("span",qs,"Loading...")):(a(),u("span",Is,"Load More"))]),_:1},8,["onClick","disabled"])):I("",!0)]),n(q)?(a(),u("div",Ms,"Loading...")):n(p)?(a(),u("div",js,"Error! fetching applications")):(a(),u("div",Fs,[e("div",Vs,[(a(),u(D,null,L(A,T=>e("div",{key:T.key,class:U(["w-72 shrink-0 rounded-lg border p-2.5",T.bgColors??"bg-primary-foreground"])},[e("h2",Es,[s(le,{color:T.color,label:T.label},null,8,["color","label"])]),s(ie,{class:"my-3"}),(a(!0),u(D,null,L(n(K).filter(k=>k.status===T.key),k=>(a(),u("div",{key:k.id,class:"border rounded-md border-border-jobster/70 shadow bg-card mb-2"},[e("details",null,[e("summary",Ls,[e("div",Ns,[e("div",Ps,[s(re,{class:"h-6 w-6 overflow-hidden rounded-sm"},{default:o(()=>[k.loker?.company?.company_logo?(a(),J(ee,{key:0,src:`${k.loker?.company?.company_logo}`,alt:k.loker?.company?.title},null,8,["src","alt"])):I("",!0),s(oe,{class:"rounded-lg text-black dark:text-white"},{default:o(()=>[i(d(n(x)(k.loker?.company?.title??"")),1)]),_:2},1024)]),_:2},1024),e("div",Ts,[e("span",zs,[i(d(k.loker?.company?.title??"")+" ",1),e("span",null,[s(de,{variant:k.loker?.company?.badge,class:"size-3 ml-1 fill-current"},null,8,["variant"])])])])]),e("div",Ks,[e("span",Os," Apply to "+d(k.loker?.title)+" @"+d(k.loker?.company?.title),
11),e("div",Rs,[e("p",null,[_[3]||(_[3]=i(" Interviews last step ",-1)),e("span",Bs,d(k.interviews_count??"0"),1)])])])])]),e("div",Us,[e("details",Hs,[_[8]||(_[8]=e("summary",{class:"cursor-pointer px-2 py-1 text-xs flex items-center justify-between"},[i(" Interview steps "),e("span",{class:"ml-2 text-[10px] px-2 py-0.5 rounded bg-gray-200 text-gray-700"},"show")],-1)),e("div",Js,[(a(!0),u(D,null,L(k.interviews,(w,f)=>(a(),u("details",{class:"px-2",key:w.id},[e("summary",Qs,[e("span",null,"Step "+d(f+1)+": "+d(w.interview_type),1),e("span",{class:U(["text-[10px] px-2 py-0.5 rounded",{"bg-indigo-600/10 text-indigo-600":w.status==="scheduled","bg-green-600/10 text-green-600":w.status==="completed","bg-red-600/10 text-red-600":w.status==="canceled"}])},d(w.status),3)]),e("div",Ys,[e("p",null,[_[4]||(_[4]=e("strong",null,"Date:",-1)),s(ue,{datetime:w.scheduled_at,locale:"id-ID",month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"},null,8,["datetime"])]),w.notes?(a(),u("p",Zs,[_[5]||(_[5]=e("strong",null,"Notes:",-1)),i(" "+d(w.notes),1)])):I("",!0),w.feedback?(a(),u("p",Gs,[_[6]||(_[6]=e("strong",null,"Feedback:",-1)),i(" "+d(w.feedback),1)])):I("",!0),w.rating?(a(),u("p",Ws,[_[7]||(_[7]=e("strong",null,"Rating:",-1)),(a(),u(D,null,L(5,t=>s(n(me),{key:t,class:U(["w-3 h-3",t<=w.rating?"fill-yellow-400 text-yellow-400":"fill-gray-300 text-gray-300 dark:fill-gray-600 dark:text-gray-600"])},null,8,["class"])),64))])):I("",!0)])]))),128))])]),e("div",Xs,[s(X,{to:`/dashboard/applications/${k.id}`},{default:o(()=>[s(B,{class:"h-6 px-2 py-1 text-xs rounded-sm"},{default:o(()=>[..._[9]||(_[9]=[i(" View Details ",-1)])]),_:1})]),_:1},8,["to"]),e("div",eo,[s(B,{class:"h-6 w-6 text-xs hover:bg-green-600/15",variant:"secondary",onClick:w=>Y(k)},{default:o(()=>[s(n(Re),{class:"w-3.5! h-3.5!"})]),_:1},8,["onClick"]),s(B,{size:"icon",class:"h-6 w-6 text-xs hover:bg-red-600/15",variant:"secondary",onClick:w=>l(k)},{default:o(()=>[s(n(Be),{class:"w-3.5! h-3.5!"})]),_:1},8,["onClick"])])])])])]))),128))],2)),64))])]))])]),e("div",null,[s(ce,{open:V.value,"onUpdate:open":_[1]||(_[1]=T=>V.value=T),mode:N.value,"selected-app":h.value,"all-data":n(K),"store-application-mutation":n(O),"update-application-mutation":n(P)},null,8,["open","mode","selected-app","all-data","store-application-mutation","update-application-mutation"])])],64)}}},so={key:0},oo={key:1},ia=qe({__name:"index",setup(W){const{hasRole:x}=dt();return ht("Applications","Manage your applications and permission settings."),(b,S)=>{const j=hs,$=to;return n(x)(["superadmin","company"])?(a(),u("div",so,[s(j)])):n(x)("freelancer")?(a(),u("div",oo,[s($)])):I("",!0)}}});export{ia 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.