1import{j as e,C as b,a as k,S as N,B as m,c as _,A,e as F,q as oe,f as c,r as x,D as B,i as U,k as z,l as G,b as E,bh as K,G as n,I as h,m as fe,bi as M,J as V,v as O,L as J,w as ye,M as ve,g as $,x as Ne,aW as be,s as ke,T as we}from"./index-nbQLPUsP.js";import{u as Ce}from"./useCredentials-C37lulKv.js";import{u as me}from"./useDecentralizedIdentity-CDxHk1Ez.js";import{C as Q}from"./calendar-Czsyg7bg.js";import{C as xe}from"./circle-check-big-0c6EoX5f.js";import{H as De}from"./hash-DYmu3HeL.js";import{T as Te,a as Ie,b as X,c as Z}from"./tabs-DIsTv2CL.js";import{S as ee,a as se,b as ae,c as re,d as C}from"./select-DYH67wJc.js";import{u as Se}from"./useEmployment-Cs3_0KZJ.js";import{C as _e}from"./checkbox-Dipudos1.js";import{A as ie,a as le}from"./alert-BFgNIA8U.js";import{C as te}from"./copy-DTEi8geY.js";import{A as Fe}from"./arrow-right-Cs-YFUno.js";import{B as Pe}from"./BlockchainCredentialViewer-BS7WJMuW.js";import{C as ne}from"./clock-kZzggmxd.js";import{K as L}from"./key-DdUvDMKh.js";import{D as qe}from"./download-Bq94dB4z.js";import{E as Ae}from"./external-link-CebresAU.js";import{S as ce}from"./share-2-COiVAN0Q.js";import"./index-BdQq_4o_.js";import"./chevron-down-CxL4f_hC.js";import"./chevron-up-aCQBlT-N.js";const de=({credential:d,onViewDetails:g,compact:u=!1})=>{var p;const w=new Date(d.issuance_timestamp).toLocaleDateString(),D=new Date(d.expiration_timestamp).toLocaleDateString(),y=Math.round(d.proficiency_level*100),v=s=>s>=.9?"bg-green-500":s>=.7?"bg-blue-500":s>=.5?"bg-yellow-500":"bg-orange-500";return u?e.jsx(b,{className:"hover:shadow-lg transition-shadow border-primary/20",children:e.jsx(k,{className:"pt-6",children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:e.jsx(N,{className:"w-5 h-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold",children:d.skill_name}),e.jsx("p",{className:"text-sm text-muted-foreground",children:d.proficiency_description})]})]}),e.jsxs(m,{className:v(d.proficiency_level),children:[y,"%"]})]})})}):e.jsxs(b,{className:"hover:shadow-xl transition-all duration-300 border-2 border-primary/20 bg-gradient-to-br from-background to-primary/5",children:[e.jsx(_,{children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"p-3 rounded-xl bg-gradient-to-br from-primary to-primary-glow shadow-lg",children:e.jsx(A,{className:"w-6 h-6 text-white"})}),e.jsxs("div",{children:[e.jsx(F,{className:"text-xl",children:d.skill_name}),e.jsx(oe,{className:"mt-1",children:d.proficiency_description})]})]}),e.jsxs(m,{className:`${v(d.proficiency_level)} text-white`,variant:"default",children:[y,"% Proficiency"]})]})}),e.jsxs(k,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 p-4 rounded-lg bg-muted/50",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(Q,{className:"w-4 h-4 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Issued"}),e.jsx("p",{className:"font-medium",children:w})]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(Q,{className:"w-4 h-4 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Expires"}),e.jsx("p",{className:"font-medium",children:D})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(xe,{className:"w-4 h-4 text-green-500"}),e.jsx("span",{className:"text-muted-foreground",children:"Cryptographically Signed"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(De,{className:"w-4 h-4 text-blue-500"}),e.jsxs("span",{className:"text-xs text-muted-foreground font-mono truncate",children:["Block: ",(p=d.block_hash)==null?void 0:p.substring(0,16),"..."]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(N,{className:"w-4 h-4 text-purple-500"}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["ID: ",d.
1credential_id.substring(0,20),"..."]})]})]}),e.jsxs("div",{className:"pt-2 border-t",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Assessment Method"}),e.jsx("p",{className:"text-sm font-medium capitalize",children:d.assessment_method.replace(/_/g," ")})]}),g&&e.jsx(c,{onClick:g,className:"w-full",variant:"outline",children:"View Full Details"})]})]})};function Ee({open:d,onOpenChange:g,userId:u,skillId:w,skillName:D,credentialId:y}){const{submitEmploymentOutcome:v,loading:p}=Se(),[s,o]=x.useState({employerId:"",employerName:"",positionTitle:"",outcomeType:"interview",performanceRating:"",hireDate:"",employmentDurationDays:"",skillApplicationFrequency:"weekly",feedbackText:""}),i=async r=>{r.preventDefault();try{await v({userId:u,skillId:w,credentialId:y,employerId:s.employerId,employerName:s.employerName,positionTitle:s.positionTitle,outcomeType:s.outcomeType,performanceRating:s.performanceRating?parseInt(s.performanceRating):void 0,hireDate:s.hireDate||void 0,employmentDurationDays:s.employmentDurationDays?parseInt(s.employmentDurationDays):void 0,skillApplicationFrequency:s.skillApplicationFrequency,feedbackText:s.feedbackText||void 0}),g(!1),o({employerId:"",employerName:"",positionTitle:"",outcomeType:"interview",performanceRating:"",hireDate:"",employmentDurationDays:"",skillApplicationFrequency:"weekly",feedbackText:""})}catch(l){console.error("Failed to submit outcome:",l)}};return e.jsx(B,{open:d,onOpenChange:g,children:e.jsxs(U,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(z,{children:[e.jsxs(G,{className:"flex items-center gap-2",children:[e.jsx(E,{className:"w-5 h-5"}),"Report Employment Outcome - ",D]}),e.jsx(K,{children:"Share your employment experience to help calibrate skill decay models"})]}),e.jsxs("form",{onSubmit:i,className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"employerName",children:"Employer Name *"}),e.jsx(h,{id:"employerName",required:!0,value:s.employerName,onChange:r=>o({...s,employerName:r.target.value}),placeholder:"Company name"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"employerId",children:"Employer ID"}),e.jsx(h,{id:"employerId",value:s.employerId,onChange:r=>o({...s,employerId:r.target.value}),placeholder:"Optional identifier"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"positionTitle",children:"Position Title *"}),e.jsx(h,{id:"positionTitle",required:!0,value:s.positionTitle,onChange:r=>o({...s,positionTitle:r.target.value}),placeholder:"Your role"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"outcomeType",children:"Outcome Type *"}),e.jsxs(ee,{value:s.outcomeType,onValueChange:r=>o({...s,outcomeType:r}),children:[e.jsx(se,{children:e.jsx(ae,{})}),e.jsxs(re,{children:[e.jsx(C,{value:"interview",children:"Interview"}),e.jsx(C,{value:"hired",children:"Hired"}),e.jsx(C,{value:"rejected",children:"Rejected"}),e.jsx(C,{value:"performance_review",children:"Performance Review"})]})]})]}),(s.outcomeType==="hired"||s.outcomeType==="performance_review")&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"hireDate",children:"Hire Date"}),e.jsx(h,{id:"hireDate",type:"date",value:s.hireDate,onChange:r=>o({...s,hireDate:r.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"employmentDurationDays",children:"Duration (days)"}),e.jsx(h,{id:"employmentDurationDays",type:"number",value:s.employmentDurationDays,onChange:r=>o({...s,employmentDurationDays:r.target.value}),placeholder:"Days employed"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"performanceRating",children:"Performance Rating (1-5)"}),e.jsx(h,{id:"performanceRating",type:"number",min:"1",max:"5",value:s.performanceRating,onChange:r=>o({...s,performanceRating:r.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"skillApplicationFrequency",children:"How often did you use this skill?"}),e.jsxs(ee,{value:s.skillApplicationFrequency,onValueChange:r=>o({...s,skillApplicationFrequency:r}),children:[e.jsx(se,{children:e.jsx(ae,{})}),e.jsxs(re,{children:[e.jsx(C,{value:"daily",children:"Daily"}),e.jsx(C,{value:"weekly",children:"Weekly"}),e.jsx(C,{value:"monthly",children:"Monthly"}),e.jsx(C,{value:"rarely",children:"Rarely"})]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"feedbackText",children:"Additional Feedback"}),e.jsx(fe,{id:"feedbackText",value:s.feedbackText,onChange:r=>o({...s,feedbackText:r.target.value}),placeholder:"Share details about your experience...",rows:4})]}),e.jsxs(M,{children:[e.jsx(c,{type:"button",variant:"outline",onClick:()=>g(!1),children:"Cancel"}),e.jsx(c,{type:"submit",disabled:p,children:p?"Submitting...":"Submit Outcome"})]})]})]})})}const H=[{value:"skill_name",label:"Skill Name",default:!0},{value:"proficiency_level",label:"Initial Proficiency Level",default:!0},{value:"current_proficiency",label:"Current Proficiency (with decay)",default:!0},{value:"issuance_date",label:"Issuance Date",default:!1},{value:"credential_status",label:"Credential Status",default:!0},{value:"decay_status",label:"Decay Status",default:!1}];function Re({open:d,onOpenChange:g,credentialId:u,skillName:w}){const{createPrivacyToken:D,loading:y}
1=me(),[v,p]=x.useState(null),[s,o]=x.useState(null),[i,r]=x.useState({requesterId:"",requesterName:"",verificationPurpose:"",minimumThreshold:"0.70",expiresInHours:"24",disclosedFields:H.filter(a=>a.default).map(a=>a.value)}),l=async a=>{a.preventDefault();try{const j=await D({credentialId:u,requesterId:i.requesterId,requesterName:i.requesterName,disclosedFields:i.disclosedFields,minimumThreshold:parseFloat(i.minimumThreshold),verificationPurpose:i.verificationPurpose,expiresInHours:parseInt(i.expiresInHours)});p(j.token),o(j.verification_url)}catch(j){console.error("Failed to create privacy token:",j)}},I=a=>{navigator.clipboard.writeText(a),V.success("Copied to clipboard")},T=()=>{p(null),o(null),r({requesterId:"",requesterName:"",verificationPurpose:"",minimumThreshold:"0.70",expiresInHours:"24",disclosedFields:H.filter(a=>a.default).map(a=>a.value)}),g(!1)},f=a=>{r(j=>({...j,disclosedFields:j.disclosedFields.includes(a)?j.disclosedFields.filter(P=>P!==a):[...j.disclosedFields,a]}))};return e.jsx(B,{open:d,onOpenChange:T,children:e.jsxs(U,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(z,{children:[e.jsxs(G,{className:"flex items-center gap-2",children:[e.jsx(N,{className:"w-5 h-5 text-primary"}),"Privacy-Preserving Credential Sharing - ",w]}),e.jsx(K,{children:"Create a secure token for selective credential disclosure (Patent #2)"})]}),v?e.jsxs("div",{className:"space-y-4",children:[e.jsxs(ie,{className:"border-green-500 bg-green-50 dark:bg-green-950",children:[e.jsx(xe,{className:"h-4 w-4 text-green-600"}),e.jsxs(le,{className:"text-green-800 dark:text-green-200",children:["Privacy token created successfully! Share this with ",i.requesterName,"."]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(n,{className:"text-xs text-muted-foreground",children:"Privacy Token"}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(h,{value:v,readOnly:!0,className:"font-mono text-sm"}),e.jsx(c,{size:"sm",variant:"outline",onClick:()=>I(v),children:e.jsx(te,{className:"w-4 h-4"})})]})]}),s&&e.jsxs("div",{children:[e.jsx(n,{className:"text-xs text-muted-foreground",children:"Verification URL"}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(h,{value:s,readOnly:!0,className:"text-sm"}),e.jsx(c,{size:"sm",variant:"outline",onClick:()=>I(s),children:e.jsx(te,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 pt-2",children:[e.jsxs("div",{children:[e.jsx(n,{className:"text-xs text-muted-foreground",children:"Expires In"}),e.jsxs("p",{className:"text-sm font-medium",children:[i.expiresInHours," hours"]})]}),e.jsxs("div",{children:[e.jsx(n,{className:"text-xs text-muted-foreground",children:"Disclosed Fields"}),e.jsxs("div",{className:"flex flex-wrap gap-1 mt-1",children:[i.disclosedFields.slice(0,3).map(a=>e.jsx(m,{variant:"outline",className:"text-xs",children:a},a)),i.disclosedFields.length>3&&e.jsxs(m,{variant:"outline",className:"text-xs",children:["+",i.disclosedFields.length-3," more"]})]})]})]})]}),e.jsx(M,{children:e.jsx(c,{onClick:T,children:"Done"})})]}):e.jsxs("form",{onSubmit:l,className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"requesterName",children:"Requester Name *"}),e.jsx(h,{id:"requesterName",required:!0,value:i.requesterName,onChange:a=>r({...i,requesterName:a.target.value}),placeholder:"Company or person name"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"requesterId",children:"Requester ID"}),e.jsx(h,{id:"requesterId",value:i.requesterId,onChange:a=>r({...i,requesterId:a.target.value}),placeholder:"Optional identifier"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"verificationPurpose",children:"Verification Purpose"}),e.jsx(h,{id:"verificationPurpose",value:i.verificationPurpose,onChange:a=>r({...i,verificationPurpose:a.target.value}),placeholder:"e.g., Job application, Contract verification"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"minimumThreshold",children:"Minimum Proficiency"}),e.jsx(h,{id:"minimumThreshold",type:"number",step:"0.01",min:"0",max:"1",value:i.minimumThreshold,onChange:a=>r({...i,minimumThreshold:a.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"expiresInHours",children:"Expires In (hours)"}),e.jsx(h,{id:"expiresInHours",type:"number",min:"1",max:"168",value:i.expiresInHours,onChange:a=>r({...i,expiresInHours:a.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{children:"Disclosed Fields (Select what to share)"}),e.jsx("div",{className:"space-y-2 border rounded-lg p-3",children:H.map(a=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(_e,{id:a.value,checked:i.disclosedFields.includes(a.value),onCheckedChange:()=>f(a.value)}),e.jsx("label",{htmlFor:a.value,className:"text-sm cursor-pointer",children:a.label})]},a.value))})]}),e.jsxs(ie,{className:"border-primary/30 bg-primary/5",children:[e.jsx(N,{className:"h-4 w-4"}),e.jsx(le,{children:"Only selected fields will be shared. The token can only be used once and expires automatically."})]}),e.jsxs(M,{children:[e.jsx(c,{type:"button",variant:"outline",onClick:T,children:"Cancel"}),e.jsx(c,{type:"submit",disabled:y,children:y?"Creating...":"Create Privacy Token"})]})]})]})})}const Oe=()=>e.jsx(b,{className:"border-primary/20 bg-gradient-to-r from-primary/5 to-primary/10",children:e.jsx(k,{className:"p-6",children:e.jsx("div",{className:"flex items-start justify-between gap-6",children:e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(N,{className:"w-5 h-5 text-primary"}),e.jsx("h3",{className:"text-lg font-semibold",children:"Patent-Pending: Enhanced Blockchain Skills Passport"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Multi-source credential aggregation with educational degree verification, employment history authentication, and temporal skill decay tracking"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(O,{className:"w-4 h-4 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium",children:"Educational Degrees"}),e.jsx("div",{className:"text-muted-foreground",children:"Cryptographic registrar verification"})]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(O,{className:"w-4 h-4 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium",children:"Employment History"}),e.jsx("div",{className:"text-muted-foreground",children:"Immutable blockchain records"})]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(O,{className:"w-4 h-4 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium",children:"Skills Proficiency"}),e.jsx("div",{className:"text-muted-foreground",children:"Education-aware decay modeling"})]})]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(c,{asChild:!0,size:"sm",children:e.jsxs(J,{to:"/patent2-demo",children:["Try Interactive Demo",e.jsx(Fe,{className:"w-4 h-4 ml-2"})]})}),e.jsx(c,{asChild:!0,variant:"outline",size:"sm",children:e.jsx(J,{to:"/patent2-docs",children:"Read Full Specification"})})]})]})})})});
1function ts(){const[d,g]=x.useState(null),[u,w]=x.useState(null),[D,y]=x.useState(!0),[v,p]=x.useState(!1),[s,o]=x.useState(!1),[i,r]=x.useState(!1),[l,I]=x.useState(null),T=ye(),{credentials:f,loading:a,fetchCredentials:j}=Ce(u||void 0),{did:P,generateDID:he,fetchDID:W,loading:Y}=me();x.useEffect(()=>{ue()},[]);const ue=async()=>{try{if(ve()&&$){const t=Ne($,async S=>{if(S){const ge=be(S.uid);g({id:S.uid,email:S.email}),w(ge),y(!1)}else R()});return()=>t()}else R()}catch(t){console.error("Auth check error:",t),R()}},R=async()=>{try{const{data:{user:t}}=await ke.auth.getUser();if(!t){V.error("Please sign in to view your credentials"),T("/auth");return}g(t),w(t.id),y(!1)}catch(t){console.error("Supabase auth error:",t),V.error("Authentication error. Please sign in again."),T("/auth")}};if(x.useEffect(()=>{u&&(j(u),W(u))},[u,j,W]),D||a)return e.jsx("div",{className:"container mx-auto py-8 px-4",children:e.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:e.jsxs("div",{className:"animate-pulse text-center",children:[e.jsx(N,{className:"w-12 h-12 mx-auto mb-4 text-primary"}),e.jsx("p",{className:"text-muted-foreground",children:"Loading your credentials..."})]})})});const q=f.filter(t=>t.credential_status==="ACTIVE"),pe=q.length,je=q.length>0?Math.round(q.reduce((t,S)=>t+S.proficiency_level,0)/q.length*100):0;return e.jsxs("div",{className:"container mx-auto py-8 px-4 max-w-7xl",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("h1",{className:"text-4xl font-bold mb-2 flex items-center gap-3",children:[e.jsx(N,{className:"w-10 h-10 text-primary"}),"Blockchain Credentials"]}),e.jsx("p",{className:"text-muted-foreground text-lg mb-4",children:"Immutable, cryptographically signed skill certifications with temporal decay tracking"}),e.jsxs("div",{className:"flex flex-wrap gap-3 p-4 rounded-xl bg-gradient-to-r from-primary/5 to-accent/5 border border-primary/20",children:[e.jsxs(m,{variant:"outline",className:"bg-background gap-2 py-1.5",children:[e.jsx(N,{className:"w-3 h-3 text-green-500"}),"Polygon Mainnet"]}),e.jsxs(m,{variant:"outline",className:"bg-background gap-2 py-1.5",children:[e.jsx(ne,{className:"w-3 h-3 text-blue-500"}),"Temporal Decay Tracking"]}),e.jsxs(m,{variant:"outline",className:"bg-background gap-2 py-1.5",children:[e.jsx(A,{className:"w-3 h-3 text-purple-500"}),"W3C Verifiable Credentials"]}),e.jsxs(m,{variant:"outline",className:"bg-background gap-2 py-1.5",children:[e.jsx(L,{className:"w-3 h-3 text-amber-500"}),"Privacy-Preserving Sharing"]}),e.jsxs(m,{variant:"outline",className:"bg-background gap-2 py-1.5",children:[e.jsx(E,{className:"w-3 h-3 text-cyan-500"}),"Employer API Verification"]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-8",children:[e.jsxs(b,{className:"bg-gradient-to-br from-blue-50 to-blue-100 dark:from-blue-950 dark:to-blue-900 border-blue-200 dark:border-blue-800",children:[e.jsx(_,{children:e.jsxs(F,{className:"text-lg flex items-center gap-2",children:[e.jsx(A,{className:"w-5 h-5"}),"Active Credentials"]})}),e.jsxs(k,{children:[e.jsx("div",{className:"text-4xl font-bold",children:pe}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"verified skills"})]})]}),e.jsxs(b,{className:"bg-gradient-to-br from-green-50 to-green-100 dark:from-green-950 dark:to-green-900 border-green-200 dark:border-green-800",children:[e.jsx(_,{children:e.jsxs(F,{className:"text-lg flex items-center gap-2",children:[e.jsx(we,{className:"w-5 h-5"}),"Avg Proficiency"]})}),e.jsxs(k,{children:[e.jsxs("div",{className:"text-4xl font-bold",children:[je,"%"]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"across all credentials"})]})]}),e.jsxs(b,{className:"bg-gradient-to-br from-purple-50 to-purple-100 dark:from-purple-950 dark:to-purple-900 border-purple-200 dark:border-purple-800",children:[e.jsx(_,{children:e.jsxs(F,{className:"text-lg flex items-center gap-2",children:[e.jsx(ne,{className:"w-5 h-5"}),"Temporal Tracking"]})}),e.jsxs(k,{children:[e.jsx("div",{className:"text-4xl font-bold",children:"Active"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"real-time decay monitoring"})]})]})]}),e.jsx("div",{className:"mb-8",children:e.jsx(Oe,{})}),e.jsxs(b,{className:"mb-8 border-2 border-primary/30 bg-gradient-to-r from-primary/5 to-primary-glow/5",children:[e.jsx(_,{children:e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[e.jsxs("div",{children:[e.jsxs(F,{className:"flex items-center gap-2",children:[e.jsx(N,{className:"w-6 h-6 text-primary"}),"Patent #2: Blockchain-Based Portable Skills Passport"]}),e.jsx(oe,{className:"text-base mt-2",children:"Your credentials are secured using blockchain-style immutable records with cryptographic signatures. Each credential tracks temporal proficiency decay and maintains a complete verification history."})]}),P?e.jsxs(m,{variant:"outline",className:"gap-2 py-2 px-3 border-green-500 text-green-700 dark:text-green-300",children:[e.jsx(L,{className:"w-4 h-4"}),"DID Active"]}):e.jsxs(c,{onClick:he,disabled:Y,variant:"outline",className:"gap-2",children:[e.jsx(L,{className:"w-4 h-4"}),Y?"Generating...":"Generate DID"]})]})}),e.jsx(k,{children:e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(m,{variant:"outline",className:"border-green-500 text-green-700 dark:text-green-300",children:"â Cryptographically Signed"}),e.jsx(m,{variant:"outline",className:"border-blue-500 text-blue-700 dark:text-blue-300",children:"â Immutable Records"}),e.jsx(m,{variant:"outline",className:"border-purple-500 text-purple-700 dark:text-purple-300",children:"â Temporal Decay Tracking"}),e.jsx(m,{variant:"outline",className:"border-orange-500 text-orange-700 dark:text-orange-300",children:"â Blockchain Hash Verification"}),e.jsx(m,{variant:"outline",className:"border-pink-500 text-pink-700 dark:text-pink-300",children:"â Privacy-Preserving Sharing"}),P&&e.jsx(m,{variant:"outline",className:"border-cyan-500 text-cyan-700 dark:text-cyan-300",children:"â Decentralized Identity"})]})})]}),f.length===0?e.jsx(b,{className:"border-dashed",children:e.jsxs(k,{className:"flex flex-col items-center justify-center py-12",children:[e.jsx(N,{className:"w-16 h-16 text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-xl font-semibold mb-2",children:"No Credentials Yet"}),e.jsx("p",{className:"text-muted-foreground mb-4 text-center max-w-md",children:"Complete courses and assessments to earn blockchain-verified skill credentials"}),e.jsx(c,{onClick:()=>T("/courses"),children:"Browse Courses"})]})}):e.jsxs(Te,{defaultValue:"grid",className:"space-y-6",children:[e.jsxs(Ie,{children:[e.jsx(X,{value:"grid",children:"Grid View"}),e.jsx(X,{value:"list",children:"List View"})]}),e.jsx(Z,{value:"grid",className:"space-y-6",children:e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:f.map(t=>e.jsx(de,{credential:t,onViewDetails:()=>{I(t),r(!0)}},t.credential_id))})}),e.jsx(Z,{value:"list",className:"space-y-4",children:f.map(t=>e.jsx(de,{credential:t,compact:!0},t.credential_id))})]}),f.length>0&&e.jsxs("div",{className:"mt-8 flex gap-4 justify-center flex-wrap",children:[e.jsxs(c,{variant:"outline",className:"gap-2",children:[e.jsx(qe,{className:"w-4 h-4"}),"Export All Credentials"]}),e.jsxs(c,{variant:"outline",className:"gap-2",children:[e.jsx(Ae,{className:"w-4 h-4"}),"Share Portfolio"]}),e.jsxs(c,{variant:"outline",className:"gap-2",onClick:()=>{f.length>0&&(I(f[0]),o(!0))},children:[e.jsx(ce,{className:"w-4 h-4"}),"Create Privacy Token"]}),e.jsxs(c,{variant:"outline",className:"gap-2",onClick:()=>{f.length>0&&(I(f[0]),p(!0))},children:[e.jsx(E,{className:"w-4 h-4"}),"Report Employment Outcome"]})]}),l&&e.jsxs(e.Fragment,{children:[e.jsx(B,{open:i,onOpenChange:r,children:e.jsxs(U,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsxs(z,{children:[e.jsxs(G,{className:"flex items-center gap-2",children:[e.jsx(A,{className:"h-5 w-5 text-primary"}),l.skill_name," Credential"]}),e.jsx(K,{children:"Complete credential details and blockchain verification"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs(b,{children:[e.jsx(_,{children:e.jsx(F,{className:"text-base",children:"Proficiency Details"})}),e.jsx(k,{className:"space-y-3",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Level"}),e.jsxs("p",{className:"font-semibold",children:[Math.round(l.proficiency_level*100),"%"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Description"}),e.jsx("p",{className:"font-semibold",children:l.proficiency_description})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Assessment"}),e.jsx("p",{className:"font-semibold capitalize",children:l.assessment_method.replace(/_/g," ")})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Status"}),e.jsx(m,{variant:l.credential_status==="ACTIVE"?"default":"secondary",children:l.credential_status})]})]})})]}),e.jsx(Pe,{credential:{credential_id:l.credential_id,blockchain_record_id:l.blockchain_record_id,block_hash:l.block_hash,issuance_timestamp:l.issuance_timestamp,credential_status:l.credential_status},credentialType:"SKILL"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(c,{onClick:()=>{r(!1),p(!0)},variant:"outline",className:"flex-1",children:[e.jsx(E,{className:"h-4 w-4 mr-2"}),"Report Employment"]}),e.jsxs(c,{onClick:()=>{r(!1),o(!0)},variant:"outline",className:"flex-1",children:[e.jsx(ce,{className:"h-4 w-4 mr-2"}),"Share Privately"]})]})]})]})}),e.jsx(Ee,{open:v,onOpenChange:p,userId:u||"",skillId:l.skill_id,skillName:l.skill_name,credentialId:l.credential_id}),e.jsx(Re,{open:s,onOpenChange:o,credentialId:l.credential_id,skillName:l.skill_name})]})]})}export{ts 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.