1import{c9 as ce,r as a,j as e}from"./index-DVKVOqko.js";const f="/api/v4/skycommand",de={revenue_management:"Revenue Management",network_planning:"Network Planning",operations_control:"Operations Control",maintenance_engineering:"Maintenance & Engineering",airport_operations:"Airport Operations",baggage_cargo:"Baggage & Cargo",cargo_freighter:"Cargo & Freighter",crew_management:"Crew Management",safety_compliance:"Safety & Compliance",fuel_sustainability:"Fuel & Sustainability",financial_planning:"Finance & Accounting",pilot_analytics:"Pilots / Flight Deck",cabin_operations:"Cabin Crew",training_operations:"Training & Proficiency",catering_services:"Catering & Provisioning",customer_experience:"Customer Experience",legal_compliance:"Legal & Regulatory",hr_workforce:"HR & Workforce",marketing_sales:"Marketing & Sales",feature_store:"IT, Data & Digital",executive:"Executive Leadership"},w={got_right:{label:"What We Got Right",color:"emerald",bg:"bg-emerald-500/10",border:"border-emerald-500/30",text:"text-emerald-400",icon:"â"},got_wrong:{label:"What We Got Wrong",color:"amber",bg:"bg-amber-500/10",border:"border-amber-500/30",text:"text-amber-400",icon:"â"},missing:{label:"What's Missing",color:"red",bg:"bg-red-500/10",border:"border-red-500/30",text:"text-red-400",icon:"+"},general:{label:"General",color:"sky",bg:"bg-sky-500/10",border:"border-sky-500/30",text:"text-sky-400",icon:"ð¬"}};function me(){const l=localStorage.getItem("sc-fp");if(l)return l;const n=crypto.randomUUID?.()||Math.random().toString(36).slice(2);return localStorage.setItem("sc-fp",n),n}function G(l){const n=Date.now()-new Date(l).getTime(),s=Math.floor(n/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;const o=Math.floor(s/60);if(o<24)return`${o}h ago`;const i=Math.floor(o/24);return i<30?`${i}d ago`:new Date(l).toLocaleDateString()}const he=()=>{const{dept:l,role:n}=ce(),[s,o]=a.useState(null),[i,k]=a.useState([]),[S,J]=a.useState(0),[c,j]=a.useState(1),[u,H]=a.useState(1),[U,_]=a.useState(!0),[C,q]=a.useState(null),[y,K]=a.useState("newest"),[d,Q]=a.useState("got_right"),[m,T]=a.useState(""),[$,V]=a.useState(""),[x,X]=a.useState(!1),[g,E]=a.useState(!1),[A,L]=a.useState(""),[N,Z]=a.useState(""),[M,ee]=a.useState(""),[I,te]=a.useState(""),[P,se]=a.useState(""),[D,W]=a.useState(!1),[O,R]=a.useState(!1),[ae,F]=a.useState(!1),[B,z]=a.useState(null),[h,re]=a.useState(()=>{try{const t=localStorage.getItem("sc-starred");return t?new Set(JSON.parse(t)):new Set}catch{return new Set}}),Y=a.useCallback(async()=>{try{const t=await fetch(`${f}/roles/${l}/${n}/summary`);if(!t.ok)throw new Error("Role not found");o(await t.json())}catch(t){q(t.message)}},[l,n]),v=a.useCallback(async()=>{try{const t=await fetch(`${f}/roles/${l}/${n}/comments?page=${c}&sort=${y}`);if(!t.ok)return;const r=await t.json();k(r.comments),J(r.total),H(r.pages)}catch{}},[l,n,c,y]);a.useEffect(()=>{_(!0),Promise.all([Y(),v()]).finally(()=>_(!1))},[Y,v]);const le=async t=>{if(t.preventDefault(),!(!m.trim()||m.length<5)){R(!0),z(null);try{const r=await fetch(`${f}/roles/${l}/${n}/comments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({category:d,comment:m.trim(),display_name:x&&$.trim()||null,contact_opt_in:g,contact_email:g?A:null,years_experience:N?parseInt(N):null,current_role_match:M||null,professional_title:x&&I.trim()||null,organization:x&&P.trim()||null,willing_to_test:D})});if(!r.ok){const p=await r.json().catch(()=>({detail:"Failed to submit"}));throw new Error(p.detail||"Failed to submit")}F(!0),T(""),E(!1),L(""),W(!1),setTimeout(()=>F(!1),3e3),v()}catch(r){z(r.message)}finally{R(!1)}}},ne=async t=>{if(!h.has(t))try{if((await fetch(`${f}/comments/${t}/star`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({fingerprint:me()})})).ok){const p=new Set(h);p.add(t),re(p),localStorage.setItem("sc-starred",JSON.stringify([...p])),k(ie=>ie.map(b=>b.comment_id===t?{...b,stars:b.stars+1}:b))}}catch{}};if(U)return e.jsx("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 border-2 border-sky-500 border-t-transparent roun
1ded-full animate-spin"}),e.jsx("span",{className:"text-slate-400",children:"Loading role details..."})]})});if(C||!s)return e.jsx("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-6xl mb-4",children:"404"}),e.jsx("h1",{className:"text-xl font-bold text-white mb-2",children:"Role Not Found"}),e.jsx("p",{className:"text-slate-400",children:C||"This role does not exist in SkyCommand."})]})});const oe=de[s.department]||s.department;return e.jsxs("div",{className:"min-h-screen bg-[#0a1628] text-white",children:[e.jsx("header",{className:"bg-gradient-to-r from-[#0f172a] to-[#0c1a2e] border-b border-sky-900/40",children:e.jsxs("div",{className:"max-w-4xl mx-auto px-6 py-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-10 h-10 bg-sky-500 rounded-lg flex items-center justify-center",children:e.jsx("svg",{className:"w-6 h-6 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"})})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-xs font-semibold text-sky-400 uppercase tracking-wider",children:"SkyCommand"}),e.jsx("span",{className:"text-xs text-slate-500 ml-2",children:"by DaedArch"})]})]}),e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("span",{className:"px-2.5 py-0.5 text-xs font-medium bg-sky-500/20 text-sky-300 rounded-full border border-sky-500/30",children:oe}),s.technical&&e.jsx("span",{className:"px-2.5 py-0.5 text-xs font-medium bg-purple-500/20 text-purple-300 rounded-full border border-purple-500/30",children:"Technical"})]}),e.jsx("h1",{className:"text-3xl font-bold text-white",children:s.role_name})]})}),e.jsxs("main",{className:"max-w-4xl mx-auto px-6 py-8 space-y-8",children:[s.pain_points.length>0&&e.jsxs("section",{children:[e.jsxs("h2",{className:"text-lg font-semibold text-slate-200 mb-4 flex items-center gap-2",children:[e.jsx("span",{className:"text-amber-400",children:"!"})," Pain Points We Address"]}),e.jsx("div",{className:"space-y-2",children:s.pain_points.map((t,r)=>e.jsxs("div",{className:"flex items-start gap-3 bg-slate-800/40 rounded-lg px-4 py-3 border border-slate-700/40",children:[e.jsx("span",{className:"text-amber-400 mt-0.5 font-mono text-sm",children:r+1}),e.jsx("span",{className:"text-slate-300 text-sm",children:t})]},r))})]}),(s.before||s.after)&&e.jsxs("section",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-red-900/10 border border-red-800/30 rounded-xl p-5",children:[e.jsx("h3",{className:"text-sm font-semibold text-red-400 uppercase tracking-wider mb-3",children:"Before SkyCommand"}),e.jsx("p",{className:"text-sm text-slate-300 leading-relaxed",children:s.before})]}),e.jsxs("div",{className:"bg-emerald-900/10 border border-emerald-800/30 rounded-xl p-5",children:[e.jsx("h3",{className:"text-sm font-semibold text-emerald-400 uppercase tracking-wider mb-3",children:"After SkyCommand"}),e.jsx("p",{className:"text-sm text-slate-300 leading-relaxed",children:s.after})]})]}),s.impact&&e.jsxs("section",{className:"grid grid-cols-3 gap-4",children:[s.impact.time_saved_pct!=null&&e.jsxs("div",{className:"bg-slate-800/40 rounded-xl p-5 border border-slate-700/40 text-center",children:[e.jsxs("div",{className:"text-3xl font-bold text-sky-400",children:[s.impact.time_saved_pct,"%"]}),e.jsx("div",{className:"text-xs text-slate-400 mt-1",children:"Time Saved"})]}),s.impact.decisions_automated!=null&&e.jsxs("div",{className:"bg-slate-800/40 rounded-xl p-5 border border-slate-700/40 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-emerald-400",children:s.impact.decisions_automated}),e.jsx("div",{className:"text-xs text-slate-400 mt-1",children:"Decisions Automated"})]}),s.impact.accuracy_improvement&&e.jsxs("div",{className:"bg-slate-800/40 rounded-xl p-5 border border-slate-700/40 text-center",children:[e.jsx("div",{className:"text-lg font-bold text-amber-400",children:s.impact.accuracy_improvement}),e.jsx("div",{className:"text-xs text-slate-400 mt-1",children:"Accuracy Improvement"})]})]}),e.jsxs("section",{className:"grid md:grid-cols-2 gap-6",children:[s.tools.length>0&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-slate-200 mb-3",children:"Mapped Tools"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.tools.map(t=>e.jsx("span",{className:"px-3 py-1.5 text-xs font-mono bg-sky-500/15 text-sky-300 rounded-lg border border-sky-500/25",children:t},t))})]}),s.algorithms.length>0&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-slate-200 mb-3",children:"Algorithms"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.algorithms.map(t=>e.jsx("span",{className:"px-3 py-1.5 text-xs bg-purple-500/15 text-purple-300 rounded-lg border border-purple-500/25",children:t},t))})]})]}),e.jsxs("section",{className:"border-t border-slate-700/50 pt-8",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-xl font-bold text-white mb-2",children:"Help Us Get This Right"}),e.jsx("p",{className:"text-sm text-slate-400",children:"You live this role. Tell us what we nailed, what we missed, and what we got wrong. Your feedback directly shapes the next version."})]}),e.jsx("div",{className:"flex gap-2 mb-4 flex-wrap",children:Object.entries(w).map(([t,r])=>e.jsxs("button",{onClick:()=>
1Q(t),className:`px-4 py-2 rounded-lg text-sm font-medium transition-all border ${d===t?`${r.bg} ${r.text} ${r.border}`:"bg-slate-800/40 text-slate-400 border-slate-700/40 hover:bg-slate-700/40"}`,children:[e.jsx("span",{className:"mr-1.5",children:r.icon}),r.label]},t))}),e.jsxs("form",{onSubmit:le,className:"space-y-4",children:[e.jsx("textarea",{value:m,onChange:t=>T(t.target.value),placeholder:d==="got_right"?"What did we get right about this role?":d==="got_wrong"?"What did we get wrong? How does this actually work?":d==="missing"?"What's missing that this role actually needs?":"Share your thoughts...",rows:4,className:"w-full bg-slate-800/60 border border-slate-700/50 rounded-xl px-4 py-3 text-sm text-white placeholder-slate-500 focus:outline-none focus:border-sky-500/50 resize-none",maxLength:5e3}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("select",{value:M,onChange:t=>ee(t.target.value),className:"bg-slate-800/60 border border-slate-700/50 rounded-lg px-3 py-2 text-sm text-white focus:outline-none focus:border-sky-500/50",children:[e.jsx("option",{value:"",children:"How close is this to your role?"}),e.jsx("option",{value:"exact",children:"This IS my role"}),e.jsx("option",{value:"adjacent",children:"Adjacent role"}),e.jsx("option",{value:"different",children:"Different role"})]}),e.jsx("input",{type:"number",value:N,onChange:t=>Z(t.target.value),placeholder:"Years exp",min:"0",max:"60",className:"w-28 bg-slate-800/60 border border-slate-700/50 rounded-lg px-3 py-2 text-sm text-white placeholder-slate-500 focus:outline-none focus:border-sky-500/50"})]}),e.jsxs("div",{className:"bg-slate-800/30 rounded-xl p-4 border border-slate-700/30",children:[e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:x,onChange:t=>X(t.target.checked),className:"w-4 h-4 rounded border-slate-600 bg-slate-700 text-sky-500 focus:ring-sky-500/30"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-white",children:"Let us know who you are"}),e.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:"We'd love to work with people who see what we see. Your info is never displayed publicly."})]})]}),x&&e.jsxs("div",{className:"mt-4 space-y-3 pl-7",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx("input",{type:"text",value:$,onChange:t=>V(t.target.value),placeholder:"Your name",className:"bg-slate-800/60 border border-slate-700/50 rounded-lg px-3 py-2 text-sm text-white placeholder-slate-500 focus:outline-none focus:border-sky-500/50"}),e.jsx("input",{type:"text",value:I,onChange:t=>te(t.target.value),placeholder:"Job title",className:"bg-slate-800/60 border border-slate-700/50 rounded-lg px-3 py-2 text-sm text-white placeholder-slate-500 focus:outline-none focus:border-sky-500/50"})]}),e.jsx("input",{type:"text",value:P,onChange:t=>se(t.target.value),placeholder:"Organization / Airline (optional)",className:"w-full bg-slate-800/60 border border-slate-700/50 rounded-lg px-3 py-2 text-sm text-white placeholder-slate-500 focus:outline-none focus:border-sky-500/50"}),e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:g,onChange:t=>E(t.target.checked),className:"w-4 h-4 rounded border-slate-600 bg-slate-700 text-sky-500 focus:ring-sky-500/30"}),e.jsx("span",{className:"text-sm text-slate-300",children:"I'm open to being contacted about this work"})]}),g&&e.jsx("input",{type:"email",value:A,onChange:t=>L(t.target.value),placeholder:"[email protected]",className:"w-full bg-slate-800/60 border border-slate-700/50 rounded-lg px-3 py-2 text-sm text-white placeholder-slate-500 focus:outline-none focus:border-sky-500/50"}),e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:D,onChange:t=>W(t.target.checked),className:"w-4 h-4 rounded border-slate-600 bg-slate-700 text-emerald-500 focus:ring-emerald-500/30"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-sm text-slate-300",children:"I'd be interested in testing SkyCommand"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Early access to tools for your specific role"})]})]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("button",{type:"submit",disabled:O||m.length<5,className:"px-6 py-2.5 bg-sky-500 hover:bg-sky-600 disabled:bg-slate-700 disabled:text-slate-500 text-white text-sm font-medium rounded-lg transition-colors",children:O?"Submitting...":"Submit Feedback"}),ae&&e.jsx("span",{className:"text-sm text-emerald-400",children:"Thank y
1ou for your feedback!"}),B&&e.jsx("span",{className:"text-sm text-red-400",children:B})]})]})]}),e.jsxs("section",{className:"border-t border-slate-700/50 pt-8",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-white",children:["Community Feedback",S>0&&e.jsxs("span",{className:"ml-2 text-sm font-normal text-slate-400",children:["(",S,")"]})]}),e.jsx("div",{className:"flex gap-2",children:["newest","stars","oldest"].map(t=>e.jsx("button",{onClick:()=>{K(t),j(1)},className:`px-3 py-1 text-xs rounded-lg transition-colors ${y===t?"bg-sky-500/20 text-sky-300":"text-slate-400 hover:text-white"}`,children:t==="stars"?"Top":t.charAt(0).toUpperCase()+t.slice(1)},t))})]}),i.length===0?e.jsxs("div",{className:"text-center py-12 text-slate-500",children:[e.jsx("p",{className:"text-lg mb-1",children:"No feedback yet"}),e.jsx("p",{className:"text-sm",children:"Be the first to share your perspective on this role."})]}):e.jsx("div",{className:"space-y-4",children:i.map(t=>{const r=w[t.category]||w.general;return e.jsxs("div",{className:"bg-slate-800/30 rounded-xl border border-slate-700/30 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:`px-2 py-0.5 text-xs font-medium rounded ${r.bg} ${r.text} ${r.border} border`,children:[r.icon," ",r.label]}),e.jsx("span",{className:"text-sm font-medium text-slate-300",children:t.display_name}),t.current_role_match==="exact"&&e.jsx("span",{className:"px-1.5 py-0.5 text-xs bg-emerald-500/20 text-emerald-300 rounded border border-emerald-500/20",children:"In this role"}),t.years_experience!=null&&e.jsxs("span",{className:"text-xs text-slate-500",children:[t.years_experience,"y exp"]})]}),e.jsx("span",{className:"text-xs text-slate-500 flex-shrink-0",children:G(t.created_at)})]}),e.jsx("p",{className:"text-sm text-slate-300 leading-relaxed mb-3",children:t.comment}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("button",{onClick:()=>ne(t.comment_id),disabled:h.has(t.comment_id),className:`flex items-center gap-1.5 text-xs transition-colors ${h.has(t.comment_id)?"text-amber-400":"text-slate-500 hover:text-amber-400"}`,children:[e.jsx("svg",{className:"w-4 h-4",fill:h.has(t.comment_id)?"currentColor":"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z"})}),t.stars>0&&e.jsx("span",{children:t.stars})]}),t.professional_title&&e.jsx("span",{className:"text-xs text-slate-500",children:t.professional_title})]}),t.reconciliation&&e.jsxs("div",{className:"mt-4 bg-sky-900/20 border border-sky-800/30 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"w-5 h-5 bg-sky-500 rounded-full flex items-center justify-center",children:e.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})})}),e.jsx("span",{className:"text-xs font-medium text-sky-300",children:"SkyCommand Team Response"}),t.reconciled_at&&e.jsx("span",{className:"text-xs text-slate-500",children:G(t.reconciled_at)})]}),e.jsx("p",{className:"text-sm text-slate-300 leading-relaxed",children:t.reconciliation})]})]},t.comment_id)})}),u>1&&e.jsxs("div",{className:"flex items-center justify-center gap-2 mt-6",children:[e.jsx("button",{onClick:()=>j(t=>Math.max(1,t-1)),disabled:c<=1,className:"px-3 py-1 text-sm text-slate-400 hover:text-white disabled:opacity-30",children:"Prev"}),e.jsxs("span",{className:"text-sm text-slate-400",children:["Page ",c," of ",u]}
1),e.jsx("button",{onClick:()=>j(t=>Math.min(u,t+1)),disabled:c>=u,className:"px-3 py-1 text-sm text-slate-400 hover:text-white disabled:opacity-30",children:"Next"})]})]}),e.jsxs("footer",{className:"border-t border-slate-700/30 pt-8 pb-12 text-center",children:[e.jsx("p",{className:"text-xs text-slate-500",children:"SkyCommand by DaedArch Corporation. 190 analytical tools across 19 departments."}),e.jsx("p",{className:"text-xs text-slate-600 mt-1",children:"Every decision backed by real mathematics."})]})]})]})};export{he 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.