import{r as x,j as e,X as Y,G as Q,S as W,x as Z}from"./app-B2I0u56g.js";import{A as ee}from"./AuthenticatedLayout-CSWrnjBo.js";import{C as m,a as P,b as _,c as ae}from"./card-CNenytP1.js";import{B as N}from"./button-CZXDm7AM.js";import{c as se}from"./index-C34U6yNz.js";import{P as B,c as j,a as te}from"./index-BvHzyGl8.js";import{T as C,a as T,b as g,c as d,d as A,e as c}from"./table-DGi4kEBY.js";import{B as re}from"./badge-B_c_GXv4.js";import{D as ne,a as le,b as ie,c as oe}from"./dialog-D7HzSjYP.js";import{I as D}from"./InputError-CfICDb6E.js";import{L as S}from"./label-CvzcAu5c.js";import{I as R}from"./input-DNlwqhyi.js";import{P as de}from"./PrimaryButton-BQy2-spZ.js";import{c as b}from"./createLucideIcon-Clgba4O9.js";import{S as ce}from"./search-5yAQXUd_.js";import{C as me}from"./circle-plus-9mtFSSU7.js";import{G as xe}from"./graduation-cap-C0kUGrtc.js";import{U as ue}from"./users-kcZTKWHy.js";import{z as pe}from"./transition-CBlrvR9d.js";import"./dropdown-menu-DQJfh2mO.js";import"./toaster-DxMLtUEJ.js";import"./index-DApg-CV7.js";import"./x-DA-DG5pb.js";import"./Combination-PF8wrC0r.js";import"./index-BEIznL3m.js";import"./chevron-right-BAIS0e1p.js";import"./book-open-D6nR5z81.js";import"./calendar-D3o-AbwU.js";import"./clipboard-list-CnC8vf5s.js";import"./award-29EQ9zf_.js";/**
* @license lucide-react v0.474.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const he=[["path",{d:"M12 21V7",key:"gj6g52"}],["path",{d:"m16 12 2 2 4-4",key:"mdajum"}],["path",{d:"M22 6V4a1 1 0 0 0-1-1h-5a4 4 0 0 0-4 4 4 4 0 0 0-4-4H3a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h6a3 3 0 0 1 3 3 3 3 0 0 1 3-3h6a1 1 0 0 0 1-1v-1.3",key:"8arnkb"}]],ge=b("BookOpenCheck",he);/**
* @license lucide-react v0.474.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const fe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],je=b("CircleAlert",fe);/**
* @license lucide-react v0.474.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ve=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],Ne=b("Rocket",ve);var y="Progress",k=100,[be,la]=se(y),[ye,ke]=be(y),M=x.forwardRef((a,t)=>{const{__scopeProgress:r,value:l=null,max:n,getValueLabel:u=we,...v}=a;(n||n===0)&&!$(n)&&console.error(Pe(`${n}`,"Progress"));const i=$(n)?n:k;l!==null&&!I(l,i)&&console.error(_e(`${l}`,"Progress"));const o=I(l,i)?l:null,h=f(o)?u(o,i):void 0;return e.jsx(ye,{scope:r,value:o,max:i,children:e.jsx(B.div,{"aria-valuemax":i,"aria-valuemin":0,"aria-valuenow":f(o)?o:void 0,"aria-valuetext":h,role:"progressbar","data-state":E(o,i),"data-value":o??void 0,"data-max":i,...v,ref:t})})});M.displayName=y;var F="ProgressIndicator",L=x.forwardRef((a,t)=>{const{__scopeProgress:r,...l}=a,n=ke(F,r);return e.jsx(B.div,{"data-state":E(n.value,n.max),"data-value":n.value??void 0,"data-max":n.max,...l,ref:t})});L.displayName=F;function we(a,t){return`${Math.round(a/t*100)}%`}function E(a,t){return a==null?"indeterminate":a===t?"complete":"loading"}function f(a){return typeof a=="number"}function $(a){return f(a)&&!isNaN(a)&&a>0}function I(a,t){return f(a)&&!isNaN(a)&&a<=t&&a>=0}function Pe(a,t){return`Invalid prop \`max\` of value \`${a}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${k}\`.`}function _e(a,t){return`Invalid prop \`value\` of value \`${a}\` supplied to \`${t}\`. The \`value\` prop must be:
- a positive number
- less than the value passed to \`max\` (or ${k} if no \`max\` prop is set)
- \`null\` or \`undefined\` if the progress is indeterminate.
Defaulting to \`null\`.`}var V=M,Ce=L;const z=x.forwardRef(({className:a,value:t,...r},l)=>e.jsx(V,{ref:l,className:j("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",a),...r,children:e.jsx(Ce,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));z.displayName=V.displayName;const Te=te("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),O=x.forwardRef(({className:a,variant:t,...r},l)=>e.jsx("div",{ref:l,role:"alert",className:j(Te({variant:t}),a),...r}));O.displayName="Alert";const U=x.forwardRef(({className:a,...t},r)=>e.jsx("h5",{ref:r,className:j("mb-1 font-medium leading-none tracking-tight",a),...t}));U.displayName="AlertTitle";const H=x.forwardRef(({className:a,...t},r)=>e.jsx("div",{ref:r,className:j("text-sm [&_p]:leading-relaxed",a),...t}));H.displayName="AlertDescription";function ia({pelatihan:a,aku:t,tugas:r}){const l=Y().props.auth.user,[n,u]=x.useState(null),{data:v,setData:i,post:o,errors:h,processing:G,recentlySuccessful:K}=Q({file:null,link:"",materi_tugas_id:0}),X=s=>{s.preventDefault(),o(route("kirim-tugas"),{onFinish(){u(null)}})},q=s=>{var w;const p=(w=s.target.files)==null?void 0:w[0];p&&(new FileReader().readAsDataURL(p),i(J=>({...J,[s.target.name]:p})))};return e.jsxs(ee,{user:l,header:e.jsx("h2",{className:"font-semibold text-xl text-gray-800 leading-tight",children:"Dashboard"}),children:[e.jsx(W,{title:"Dashboard"}),t!=null&&t.status=="pending"&&e.jsxs(O,{children:[e.jsx(je,{className:"h-4 w-4"}),e.jsx(U,{children:"Status Pendaftaran"}),e.jsx(H,{children:"Terima kasih sudah mendaftar pelatihan. Saat ini status pendfataraanmu sedang diproses oleh admin."})]}),a!=null&&e.jsxs("div",{className:"py-2",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 lg:gap-6 mb-8",children:[e.jsx(m,{className:"bg-[#5BA4CF] text-white",children:e.jsxs(P,{children:[e.jsx(_,{className:"text-sm font-normal",children:"Pelatihan yang diikuti"}),e.jsx("p",{className:"text-lg font-semibold",children:a.title})]})}),e.jsxs(m,{className:"bg-[#4CAF50] text-white",children:[e.jsx(P,{children:e.jsx(_,{className:"text-sm font-normal",children:"Progress Anda"})}),e.jsx(ae,{className:"space-y-4",children:t.status=="approve"&&e.jsxs(e.Fragment,{children:[e.jsx(z,{value:100*(r.filter(s=>s.tugas_pesertas.length>0&&s.tugas_pesertas[0].status!=="reject").length/r.length),className:"h-2 bg-white/20"}),e.jsx("div",{className:"flex justify-between text-sm",children:r.map((s,p)=>e.jsxs("span",{children:["Tugas ",p+1]},`progress-tugas-${s.id}`))})]})})]})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Jadwal Pelatihan"}),e.jsx(m,{className:"overflow-auto",children:e.jsxs(C,{children:[e.jsx(T,{className:"bg-gray-200",children:e.jsxs(g,{children:[e.jsx(d,{className:"font-semibold",children:"Kode Unit"}),e.jsx(d,{className:"font-semibold",children:"Kompetensi"}),e.jsx(d,{className:"font-semibold",children:"Tanggal"}),e.jsx(d,{className:"font-semibold",children:"Instruktur"})]})}),e.jsx(A,{children:a.pelatihan_jadwals.map(s=>e.jsxs(g,{children:[e.jsx(c,{className:"font-medium",children:s.code}),e.jsx(c,{children:s.name}),e.jsx(c,{children:s.course_date}),e.jsx(c,{children:s.instructor.nama})]},`jadwal-${s.id}`))})]})})]}),e.jsxs("div",{className:" rounded-lg",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Pengumpulan Tugas"}),e.jsx(m,{className:"overflow-auto",children:e.jsxs(C,{children:[e.jsx(T,{className:"bg-gray-200",children:e.jsxs(g,{children:[e.jsx(d,{className:"font-semibold",children:"Tugas"}),e.jsx(d,{className:"font-semibold",children:"Tanggal Akhir Pengumpulan"}),e.jsx(d,{className:"font-semibold ",children:"Status"}),e.jsx(d,{className:"font-semibold text-right",children:"Upload"})]})}),e.jsx(A,{children:r.map(s=>e.jsxs(g,{className:"even:bg-gray-50",children:[e.jsx(c,{children:s.name}),e.jsx(c,{children:s.due_date}),e.jsx(c,{children:s.tugas_pesertas.length>0?s.tugas_pesertas[0].status=="pending"?e.jsx("span",{className:"inline-flex items-center rounded bg-orange-50 px-2 py-0.5 text-xs font-medium text-orange-500 ring-1 ring-inset ring-orange-600/20",children:"Pending"}):s.tugas_pesertas[0].status=="reject"?e.jsx("span",{className:"inline-flex items-center rounded bg-red-50 px-2 py-0.5 text-xs font-medium text-red-700 ring-1 ring-inset ring-red-600/10",children:"Reject"}):e.jsx("span",{className:"inline-flex items-center rounded bg-green-50 px-2 py-0.5 text-xs font-medium text-green-700 ring-1 ring-inset ring-green-600/20",children:"Approve"}):"-"}),e.jsx(c,{className:"text-right",children:s.tugas_pesertas.length>0&&s.tugas_pesertas[0].status!=="reject"?e.jsx(re,{variant:"secondary",className:"bg-emerald-500 hover:bg-emerald-500 text-white",children:"Sudah Dikirim"}):e.jsx(N,{onClick:()=>{s.tugas_pesertas.length<=0||s.tugas_pesertas.length>0&&s.tugas_pesertas[0].status=="reject"?(u(s),i("materi_tugas_id",s.id)):alert("Anda sudah mengirim tugas")},variant:"secondary",children:"Upload"})})]},`tugas-${s.id}`))})]})})]})]}),a==null&&e.jsxs("div",{className:"text-center max-w-2xl mx-auto py-12",children:[e.jsx("div",{className:"bg-blue-50 w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-6",children:e.jsx(Ne,{className:"w-8 h-8 text-blue-600"})}),e.jsx("h2",{className:"text-2xl font-bold mb-3",children:"Mulai tingkatkan skill-mu sekarang juga"}),e.jsx("p",{className:"text-gray-600 mb-8",children:"Kamu belum terdaftar di pelatihan manamupun. Yuk cari dan daftar pelatiha untuk meningkatan skill-mu."}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[e.jsx(Z,{href:route("course.index"),children:e.jsxs(N,{className:"gap-2",children:[e.jsx(ce,{className:"w-4 h-4"}),"Cari Pelatihan"]})}),e.jsxs(N,{variant:"outline",className:"gap-2",children:[e.jsx(ge,{className:"w-4 h-4"}),"Lihat Rekomendasi"]})]}),e.jsxs("div",{className:"mt-12 grid grid-cols-1 sm:grid-cols-3 gap-6 text-left",children:[e.jsxs(m,{className:"p-6",children:[e.jsx(me,{className:"w-8 h-8 text-blue-600 mb-4"}),e.jsx("h3",{className:"font-semibold mb-2",children:"Berbagai macam pelatihan"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Browse through our extensive catalog of professional courses."})]}),e.jsxs(m,{className:"p-6",children:[e.jsx(xe,{className:"w-8 h-8 text-blue-600 mb-4"}),e.jsx("h3",{className:"font-semibold mb-2",children:"Dapatka sertifikat BNSP"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Earn industry-recognized certificates to boost your career."})]}),e.jsxs(m,{className:"p-6",children:[e.jsx(ue,{className:"w-8 h-8 text-blue-600 mb-4"}),e.jsx("h3",{className:"font-semibold mb-2",children:"Bergabung bersama komunitas"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Connect with fellow learners and industry experts."})]})]})]}),e.jsx(ne,{open:!!n,onOpenChange:()=>u(null),children:e.jsxs(le,{className:"sm:max-w-[425px] transition-all duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=open]:slide-in-from-left-1/2",children:[e.jsx(ie,{children:e.jsx(oe,{className:"text-xl font-semibold",children:n==null?void 0:n.name})}),e.jsx("div",{children:e.jsxs("form",{onSubmit:X,className:"space-y-2",encType:"multipart/form-data",method:"POST",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{htmlFor:"file",children:"File Tugas (Max 50 MB)"}),e.jsx(R,{id:"file",name:"file",type:"file",onChange:s=>q(s),accept:`image/*,
video/*,
application/pdf,
application/msword,
application/vnd.openxmlformats-officedocument.wordprocessingml.document,
application/vnd.ms-excel,
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,
application/vnd.ms-powerpoint,
application/vnd.openxmlformats-officedocument.presentationml.presentation,
application/zip`})]}),e.jsx(D,{message:h.file})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{htmlFor:"link",children:"Link Tugas"}),e.jsx(R,{id:"link",name:"link",placeholder:"masukan link...",value:v.link,onChange:s=>i("link",s.target.value)})]}),e.jsx(D,{message:h.link})]}),e.jsxs("div",{className:"flex items-center gap-4 mt-4",children:[e.jsx(de,{disabled:G,children:"Kirim"}),e.jsx(pe,{show:K,enter:"transition ease-in-out",enterFrom:"opacity-0",leave:"transition ease-in-out",leaveTo:"opacity-0",children:e.jsx("p",{className:"text-sm text-gray-600",children:"Kirim."})})]})]})})]})})]})}export{ia as default};
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]