1import{r as c,j as e}from"./react-TITiJaTY.js";import{a as ce}from"./App-Dli7sJFM.js";import{I as te}from"./shared-lite-BOZiOCY1.js";import{A as oe}from"./AppHeader-Bv7bfOUu.js";import{S as ie}from"./SectionTabs-DD1NeLsB.js";import{P as de}from"./PageHow-C48AC2is.js";import{aF as he,aG as me,aH as ae,aI as I,aJ as se,aK as ne,aL as J}from"./memory-BnxUEnat.js";import{m as le}from"./motion-DheP8iPc.js";import"./index-D0VpW5-F.js";import"./podcastDeviceState-B0NlAIS7.js";import"./llm-CdWZ4qgd.js";const ue={current:{label:"Current",tone:"ok",icon:"check"},waiting:{label:"In the backlog",tone:"warn",icon:"refresh"},unavailable:{label:"Unavailable this month",tone:"danger",icon:"warn"},"no-date":{label:"Add your priority date",tone:"muted",icon:"globe"},"no-data":{label:"No data for this selection",tone:"muted",icon:"globe"}},M=s=>typeof s=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(s),L=s=>Date.UTC(+s.slice(0,4),+s.slice(5,7)-1,+s.slice(8,10)),z=s=>s==="C"?"Current":s==="U"?"Unavailable":M(s)?J(s):"â";function ge({series:s,pdISO:y}){const i=s.filter(a=>M(a.value)).map(a=>L(a.value));if(s.length<2||!i.length)return null;const C=y?L(y):null,d=C!=null?[...i,C]:i;let j=Math.min(...d),r=Math.max(...d);const V=864e5*365.25,U=Math.max(r-j,V);j=Math.min(...d)-U*.08,r=Math.max(...d)+U*.12;const G=r,A=a=>52+a*598/(s.length-1),w=a=>22+(1-(a-j)/(r-j))*208,x=s.map((a,l)=>{const N=M(a.value)?L(a.value):a.value==="C"?G:null;return{i:l,x:A(l),y:N==null?null:w(N),value:a.value}}),H=230,T=[];let f=[];for(const a of x)a.y==null?f.length&&(T.push(f),f=[]):f.push(a);f.length&&T.push(f);const P=a=>a.map((l,N)=>`${N?"L":"M"}${l.x.toFixed(1)},${l.y.toFixed(1)}`).join(" "),W=a=>a.length<2?"":`${P(a)} L${a[a.length-1].x.toFixed(1)},${H} L${a[0].x.toFixed(1)},${H} Z`,h=[...x].reverse().find(a=>a.y!=null&&a.value!=="C")||[...x].reverse().find(a=>a.y!=null),b=x.filter(a=>a.value==="U"),S=new Date(j).getUTCFullYear(),n=new Date(r).getUTCFullYear(),$=[];for(let a=S;a<=n;a++){const l=Date.UTC(a,0,1);l>=j&&l<=r&&$.push({yr:a,y:w(l)})}const m=C!=null?w(C):null,v=s.find(a=>a.value!=null)||s[0],B=s[s.length-1];return e.jsxs("svg",{className:"gc-chart",viewBox:"0 0 680 264",role:"img","aria-label":`Cutoff dates from ${v.label} to ${B.label}${y?`, with your priority date ${J(y)} marked`:""}.`,children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"gcArea",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{className:"gc-area-top",offset:"0%"}),e.jsx("stop",{className:"gc-area-bot",offset:"100%"})]})}),m!=null&&e.jsx("rect",{x:52,y:22,width:598,height:Math.max(0,m-22),className:"gc-chart-zone"}),$.map(a=>e.jsxs("g",{children:[e.jsx("line",{x1:52,x2:650,y1:a.y,y2:a.y,className:"gc-chart-grid"}),e.jsx("text",{x:44,y:a.y+3,className:"gc-chart-ytick",textAnchor:"end",children:a.yr})]},a.yr)),b.map(a=>e.jsx("line",{x1:a.x,x2:a.x,y1:230,y2:236,className:"gc-chart-u"},a.i)),T.map((a,l)=>e.jsx("path",{d:W(a),className:"gc-chart-area"},`a${l}`)),T.map((a,l)=>e.jsx("path",{d:P(a),className:"gc-chart-line",fill:"none"},`l${l}`)),m!=null&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:52,x2:650,y1:m,y2:m,className:"gc-chart-pd"}),e.jsx("text",{x:650,y:m-6,className:"gc-chart-pd-lbl",textAnchor:"end",children:"Your priority date"})]}),h&&e.jsxs(e.Fragment,{children:[e.jsx("circle",{cx:h.x,cy:h.y,r:"9",className:"gc-chart-halo"}),e.jsx("circle",{cx:h.x,cy:h.y,r:"4.5",className:"gc-chart-dot"})]}),e.jsx("text",{x:52,y:256,className:"gc-chart-xtick",textAnchor:"start",children:v.label}),e.jsx("text",{x:650,y:256,className:"gc-chart-xtick",textAnchor:"end",children:B.label})]})}function _({label:s,children:y}){return e.jsxs("label",{className:"gc-field",children:[e.jsx("span",{children:s}),y]})}function Te(){var N,Z,q,O,Q,X;const{profile:s,update:y}=ce(),[o,Y]=c.useState(null),[k,R]=c.useState("loading"),[g,K]=c.useState(s.gcCategory||""),[i,C]=c.useState(s.gcCountry||""),[d,j]=c.useState(s.gcChart||"final"),[r,V]=c.useState(s.gcPriorityDate||""),[U,G]=c.useState(0),[A,w]=c.useState("");c.useEffect(()=>{let t=!0;return he().then(p=>{t&&(Y(p),R("ready"))}).catch(p=>{t&&R(p.message==="not-loaded"?"not-loaded":"error")}),()=>{t=!1}},[U]);const x=(t,p,u)=>{t(u),w("");const D=y({[p]:u});D!=null&&D.ok||w("Your selection is visible for this session but could not be saved. Check browser storage and try again.")},H=t=>x(K,"gcCategory",t),T=t=>x(C,"gcCountry",t),f=t=>x(j,"gcChart",t),P=t=>x(V,"gcPriorityDate",t),W=()=>{R("loading"),Y(null),G(t=>t+1)},h=k==="ready"&&!!o,b=!!g&&!!i,S=me(r),n=c.useMemo(()=>h&&b?ae(o,{category:g,country:i,chart:d,priorityDate:r}):null,[h,b,o,g,i,d,r]),$=d==="final"?"filing":"final",m=c.useMemo(()=>h&&b?ae(o,{category:g,country:i,chart:$,priorityDate:r}):null,[h,b,o,g,i,$,r]),v=n?ue[n.status]:null,B=(N=I.find(t=>t.key===d))==null?void 0:N.label,a=(Z=se.find(t=>t.key===g))==null?void 0:Z.full,l=c.useMemo(()=>
1{if(!n)return[];const t=n.series.filter(u=>u.value!=null),p=[];for(let u=t.length-1;u>0&&p.length<6;u--){const D=t[u-1].value,F=t[u].value;let E="neutral",re=z(F);if(M(D)&&M(F)){const ee=Math.round((L(F)-L(D))/864e5);E=ee>0?"ok":ee<0?"danger":"neutral"}else F==="U"?E="danger":F==="C"&&(E="ok");p.push({month:t[u].label,value:F,text:re,tone:E})}return p},[n]);return e.jsxs("div",{className:"gc",children:[e.jsx(oe,{}),e.jsxs("main",{className:"gc-main",children:[e.jsx(ie,{}),e.jsxs(le.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.5},children:[e.jsx("span",{className:"eyebrow",children:"Green Card Backlog"}),e.jsxs("h1",{className:"gc-title",children:["Where your green card ",e.jsx("span",{className:"gradient-text",children:"stands"}),"."]}),e.jsx("p",{className:"gc-sub",children:"Track your priority date against the monthly State Department Visa Bulletin - the official cutoffs that decide when an employment-based green card moves forward. See where you stand today, how the line is moving, and a grounded (not hyped) sense of the wait."})]}),e.jsx(de,{steps:["Set your category, country of chargeability, and priority date (from your I-140 receipt).","We compare it to every monthly Visa Bulletin cutoff since 2024.","See if you're current, how far the line is from you, and which way it's trending."]}),e.jsxs("div",{className:"gc-controls","aria-busy":k==="loading",children:[e.jsxs("div",{className:"gc-fields",children:[e.jsx(_,{label:"Category",children:e.jsxs("select",{value:g,onChange:t=>H(t.target.value),children:[e.jsx("option",{value:"",children:"Selectâ¦"}),se.map(t=>e.jsx("option",{value:t.key,children:t.label},t.key))]})}),e.jsx(_,{label:"Country of chargeability",children:e.jsxs("select",{value:i,onChange:t=>T(t.target.value),children:[e.jsx("option",{value:"",children:"Selectâ¦"}),ne.map(t=>e.jsx("option",{value:t.key,children:t.label},t.key))]})}),e.jsx(_,{label:"Priority date",children:e.jsx("input",{value:r,onChange:t=>P(t.target.value),placeholder:"e.g. May 2022",inputMode:"text"})})]}),e.jsxs("div",{className:"gc-controls-foot",children:[e.jsx("div",{className:"gc-chart-toggle",role:"group","aria-label":"Which chart",children:I.map(t=>e.jsx("button",{type:"button","aria-pressed":d===t.key,className:`gc-seg ${d===t.key?"on":""}`,onClick:()=>f(t.key),title:t.hint,children:t.label},t.key))}),a&&e.jsx("p",{className:"gc-cat-full",children:a})]})]}),A&&e.jsx("div",{className:"gc-msg card",role:"alert",children:A}),k==="loading"&&e.jsx("div",{className:"gc-msg card",role:"status",children:"Loading the Visa Bulletin historyâ¦"}),k==="not-loaded"&&e.jsxs("div",{className:"gc-msg card",role:"alert",children:["The Visa Bulletin data isn't available right now. ",e.jsx("button",{type:"button",className:"gc-retry",onClick:W,children:"Try again"}),"."]}),k==="error"&&e.jsxs("div",{className:"gc-msg card",role:"alert",children:["Couldn't reach the Visa Bulletin data. ",e.jsx("button",{type:"button",className:"gc-retry",onClick:W,children:"Try again"}),"."]}),h&&!b&&e.jsxs("div",{className:"gc-empty card",children:[e.jsx(te,{name:"globe",size:26}),e.jsxs("p",{children:["Pick your ",e.jsx("strong",{children:"category"})," and ",e.jsx("strong",{children:"country of chargeability"})," above to see the current cutoff. Add your ",e.jsx("strong",{children:"priority date"})," and we'll show exactly where you stand."]})]}),n&&v&&e.jsxs(e.Fragment,{children:[e.jsxs(le.div,{className:`gc-standing card tone-${v.tone}`,initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.4},children:[e.jsxs("div",{className:"gc-standing-head",children:[e.jsxs("span",{className:`gc-pill tone-${v.tone}`,children:[e.jsx(te,{name:v.icon,size:14})," ",v.label]}),e.jsxs("span",{className:"gc-standing-cat",children:[g," · ",(q=ne.find(t=>t.key===i))==null?void 0:q.label," · ",B]})]}),e.jsx("p",{className:"gc-headline",children:n.headline}),e.jsxs("div",{className:"gc-stats",children:[e.jsxs("div",{className:"gc-stat",children:[e.jsx("span",{className:"gc-stat-k",children:"Your priority date"}),e.jsx("strong",{children:S?J(S):"â"})]}),e.jsxs("div",{className:"gc-stat",children:[e.jsx("span",{className:"gc-stat-k",children:"Current cutoff"}),e.jsx("strong",{children:z(n.cutoff)})]}),n.status==="waiting"&&e.jsxs("div",{className:"gc-stat",children:[e.jsx("span",{className:"gc-stat-k",children:"Gap to cutoff"}),e.jsx("strong",{children:n.gapText})]}),n.movement&&e.jsxs("div",{className:"gc-stat",children:[e.jsx("span",{className:"gc-stat-k",children:"This month"}),e.jsxs("strong",{className:`tone-${n.movement.tone}
1`,children:[n.movement.tone==="good"?"â² ":n.movement.tone==="bad"?"â¼ ":"â ",n.movement.text]})]})]}),n.status==="waiting"&&e.jsx("p",{className:"gc-estimate",children:n.estimate?e.jsxs(e.Fragment,{children:["Rough estimate: ",e.jsx("strong",{children:n.estimate.text}),n.paceText?` (recent pace: ${n.paceText})`:"",". Priority-date movement is volatile and can retrogress, so treat this as a ballpark, not a promise."]}):e.jsxs(e.Fragment,{children:["The line has ",e.jsx("strong",{children:"stalled or moved backward"})," recently, so there's no honest way to estimate the wait right now. Watch the trend below."]})}),n.status==="current"&&e.jsx("p",{className:"gc-estimate",children:"You may be eligible to move forward on this chart. Confirm which chart USCIS is honoring this month before you file - they alternate between Final Action Dates and Dates for Filing."}),m&&m.cutoff!=null&&e.jsxs("p",{className:"gc-alt",children:[(O=I.find(t=>t.key===$))==null?void 0:O.label," this month: ",e.jsx("strong",{children:z(m.cutoff)}),m.status==="current"?" - current for you":"","."]})]}),e.jsxs("div",{className:"gc-chart-card card",children:[e.jsxs("div",{className:"gc-chart-head",children:[e.jsxs("h2",{children:["How the ",B," line has moved"]}),e.jsxs("span",{className:"hint",children:[n.series.filter(t=>t.value!=null).length," monthly bulletins"]})]}),n.series.some(t=>M(t.value))?e.jsxs(e.Fragment,{children:[e.jsx(ge,{series:n.series,pdISO:S}),e.jsxs("div",{className:"gc-legend",children:[e.jsxs("span",{children:[e.jsx("i",{className:"gc-key-line"})," Cutoff date"]}),S&&e.jsxs("span",{children:[e.jsx("i",{className:"gc-key-pd"})," Your priority date"]}),e.jsxs("span",{children:[e.jsx("i",{className:"gc-key-u"})," Unavailable"]})]})]}):e.jsxs("p",{className:"gc-chart-empty",children:["This category has ",e.jsx("strong",{children:"no priority-date cutoff"})," to plot across the tracked window â it's ",n.cutoff==="U"?"Unavailable":"Current"," this month, with no dated backlog to chart."]})]}),l.length>0&&e.jsxs("div",{className:"gc-recent card",children:[e.jsx("h2",{children:"Recent bulletins"}),e.jsx("div",{className:"gc-recent-list",children:l.map(t=>e.jsxs("div",{className:`gc-recent-row tone-${t.tone}`,children:[e.jsx("span",{className:"gc-recent-mo",children:t.month}),e.jsx("span",{className:"gc-recent-val",children:t.text})]},t.month))})]})]}),e.jsxs("p",{className:"gc-caveat",children:["Source: ",e.jsx("a",{href:"https://travel.state.gov/content/travel/en/legal/visa-law0/visa-bulletin.html",target:"_blank",rel:"noopener noreferrer",children:"U.S. Department of State - The Visa Bulletin"}),o!=null&&o.latest?`, current through ${(X=(Q=o.months)==null?void 0:Q[o.months.length-1])==null?void 0:X.label} in Nyanza's loaded dataset`:"",". These are the ",e.jsx("strong",{children:"official"})," cutoffs, but movement is historical and can retrogress; this tool tracks and explains - it isn't legal advice. Your priority date is stored with your private Career Persona, compared in your browser, and never shown on your resume."]})]})]})}export{Te 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.