1import{k as e,d as s,o as t,u as a,a as r,h as n,p as l,j as i}from"./index-BTcPvoEA.js";import{a as d,ag as c,aU as o,aI as x,Y as m,a9 as u,T as p,p as h,R as g,l as b,s as j,c as y}from"./vendor-icons-Bkg-6Ex1.js";import{u as N}from"./useMutation-DR89m72b.js";import{d as f}from"./useChecklist---WNH67X.js";import{P as v}from"./portal-api-DtkhAdlX.js";import{a as k,r as w,b as S}from"./roadmap-api-D1516FCe.js";import"./charts-C6KVAqdT.js";import"./firebase-auth-C4eyY_b2.js";import"./firebase-core-IgwuAbwy.js";import"./firebase-firestore-Ccbuv3Eb.js";import"./firebase-storage-C3_x6E22.js";import"./firebase-functions-BKCZgKG_.js";import"./firebase-analytics-qm8UH2IR.js";import"./firebase-installations-CDeT25bw.js";import"./vendor-utils-DFWLJKD2.js";import"./checklist-api-BkosrHOD.js";const I={not_started:"æªçæ",in_progress:"対å¿ä¸",done:"å®äº",deferred:"è¦éã"},C={high:"é«",medium:"ä¸",low:"ä½"},$={draft:"䏿¸ã",shared:"確å®",archived:"ä¿ç®¡"};function Q(e){const s=/^(\d{4})Q([1-4])$/.exec(e);return s?4*Number(s[1])+(Number(s[2])-1):null}function P(e){return`${Math.floor(e/4)}Q${e%4+1}`}function q(e,s=!1){const t=/^(\d{4})Q([1-4])$/.exec(e);if(!t)return e;const a=3*(Number(t[2])-1)+1;return s?`${String(t[1]).slice(2)}å¹´${a}-${a+2}æ`:`${t[1]}å¹´${a}ã${a+2}æ`}const E=["consultant","consultant-manager","system-admin"],L={in_progress:"åçä¸",submitted:"æåºæ¸ã¿",under_review:"ã¬ãã¥ã¼ä¸",revision_requested:"å·®æ»ã",completed:"å®äº"},A={"æªé":"bg-red-100 text-red-700","証跡ä¸è¶³":"bg-yellow-100 text-yellow-800","æªåç":"bg-gray-100 text-gray-600","è¦å¯¾å¿":"bg-orange-100 text-orange-800"},_={not_started:"bg-gray-100 text-gray-600",in_progress:"bg-blue-100 text-blue-700",done:"bg-green-100 text-green-700",deferred:"bg-slate-100 text-slate-500"},M=[3,5,8,10,15,20,30],F=["open","in_progress","waiting_user","answered"],U=e=>{if(!e)return"â";const s=new Date(e);return Number.isNaN(s.getTime())?"â":s.toLocaleDateString("ja-JP",{year:"numeric",month:"long",day:"numeric"})},O=e=>{if(!e)return"â";const s=new Date(e);return Number.isNaN(s.getTime())?"â":s.toLocaleString("ja-JP",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})},T=["in_progress","revision_requested"],R=({value:e,source:s})=>e&&"unset"!==s?i.jsxs("span",{className:"inline-flex items-center gap-1 whitespace-nowrap",children:[i.jsx("span",{className:"font-medium text-gray-800 dark:text-slate-200",children:e}),"ai_estimate"===s&&i.jsx("span",{className:"px-1 py-0.5 text-[10px] rounded bg-blue-50 text-blue-700 border border-blue-200",title:"ã³ã³ãµã«ã¿ã³ãã®ç£ä¿®åã®ãAI ã«ããç®å®ã§ã",children:"AI æ¨è¨"}),"client"===s&&i.jsx("span",{className:"px-1 py-0.5 text-[10px] rounded bg-gray-50 text-gray-500 border border-gray-200",children:"èªç¤¾è¨å®"})]}):i.jsx("span",{className:"text-xs text-gray-400",children:"æªè¨å®"});function K(e,s=[]){const t=Q(e);if(null===t)return[];const a=new Set;for(let r=t-4;r<=t+12;r++)a.add(r);for(const r of s){const e=r?Q(r):null;null!==e&&a.add(e)}return[...a].sort((e,s)=>e-s).map(P)}const D=({item:e,startQuarter:s,canManage:t,canEditEstimate:a,canEditProgress:r,saving:n,ownerCandidates:l,consultations:c,onPatch:o,onConsult:x,onOpenConsultation:m})=>{var u,p,h,g,b;const[j,N]=d.useState(e.ownerLabel),[f,v]=d.useState(e.clientNote);d.useEffect(()=>N(e.ownerLabel),[e.ownerLabel]),d.useEffect(()=>v(e.clientNote),[e.clientNote]);const k=K(s,[null==(u=e.schedule)?void 0:u.startQuarter,null==(p=e.schedule)?void 0:p.endQuarter]),w=(null==(h=e.schedule)?void 0:h.startQuarter)??"",S=(null==(g=e.schedule)?void 0:g.endQuarter)??"",C=c.find(e=>F.includes(e.status)),$=(e,s)=>{const t=Q(e),a=Q(s);null!==t&&null!==a&&o({schedule:{startQuarter:e,endQuarter:a<t?e:s}})},P="w-full rounded-md border border-gray-300 dark:border-slate-600 bg-white dark:bg-slate-900 text-sm text-gray-900 dark:text-white px-2 py-1.5 disabled:bg-gray-50 disabled:text-gray-400";return i.jsxs("div",{className:"space-y-4 text-sm print:hidden",children:[i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[i.jsxs("label",{className:"block",children:[i.jsx("span",{className:"block text-xs text-gray-500 mb-1",children:"鲿"}),i.jsx("select",{className:P,value:e.progress,disabled:!r||n,onChange:e=>o({progress:e.target.value}),children:Object.keys(I).map(e=>i.jsx("option",{value:e,children:I[e]},e))})]}),i.jsxs("label",{className:"block",children:[i.jsx("span",{className:"block text-xs text-gray-500 mb-1",children:"æ
å½ï¼é¨ç½²ã»å½¹å²ï¼"}),i.jsx("input",{className:P,value:j,maxLength:100,disabled:!t||n,placeholder:"ä¾
1: æ
å ±ã·ã¹ãã 課",onChange:e=>N(e.target.value),onBlur:()=>{j.trim()!==e.ownerLabel&&o({ownerLabel:j.trim()})}})]}),t&&i.jsxs("label",{className:"block",children:[i.jsx("span",{className:"block text-xs text-gray-500 mb-1",children:"æ
å½è
ï¼é²æãæ´æ°ã§ãã人ï¼"}),i.jsxs("select",{className:P,value:e.ownerUserId??"",disabled:n,onChange:s=>{const t=s.target.value||null,a=l.find(e=>e.userId===t);o(a&&!e.ownerLabel?{ownerUserId:t,ownerLabel:a.name}:{ownerUserId:t})},children:[i.jsx("option",{value:"",children:"ï¼æªè¨å®ï¼"}),l.map(e=>i.jsx("option",{value:e.userId,children:e.name},e.userId)),e.ownerUserId&&!l.some(s=>s.userId===e.ownerUserId)&&i.jsx("option",{value:e.ownerUserId,children:"ï¼è¨å®æ¸ã¿ã®æ
å½è
ï¼"})]})]}),i.jsxs("div",{children:[i.jsxs("span",{className:"block text-xs text-gray-500 mb-1",children:["ææ ",e.schedule&&!e.schedule.pinned&&i.jsx("span",{className:"text-gray-400",children:"ï¼èªåå²ä»ï¼"})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsxs("select",{className:P,value:w,disabled:!t||n,"aria-label":"éå§ã®ååæ",onChange:e=>$(e.target.value,S||e.target.value),children:[!w&&i.jsx("option",{value:"",children:"â"}),k.map(e=>i.jsx("option",{value:e,children:q(e)},e))]}),i.jsx("span",{className:"text-gray-400",children:"ã"}),i.jsxs("select",{className:P,value:S,disabled:!t||n,"aria-label":"çµäºã®ååæ",onChange:e=>$(w||e.target.value,e.target.value),children:[!S&&i.jsx("option",{value:"",children:"â"}),k.map(e=>i.jsx("option",{value:e,children:q(e)},e))]})]}),t&&(null==(b=e.schedule)?void 0:b.pinned)&&i.jsx("button",{type:"button",className:"mt-1 text-xs text-gsx-700 hover:underline",disabled:n,onClick:()=>o({schedule:null}),children:"èªåå²ä»ã«æ»ã"})]})]}),t&&i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[!a&&i.jsx("p",{className:"sm:col-span-2 self-center text-xs text-gray-500",children:"å·¥æ°ã»ãªã¹ã¯ã®åºåã®ç·¨é㯠Basic Plus 以ä¸ã§ãå©ç¨ããã ãã¾ãã"}),a&&i.jsxs("label",{className:"block",children:[i.jsx("span",{className:"block text-xs text-gray-500 mb-1",children:"å·¥æ°ï¼èªç¤¾ã§è¦ç´ãå ´åï¼"}),i.jsxs("select",{className:P,value:"client"===e.estimate.effortSource?e.estimate.effort??"":"",disabled:n,onChange:e=>o({estimate:{effort:e.target.value||null}}),children:[i.jsx("option",{value:"",children:"æå®ããªã"}),i.jsx("option",{value:"S",children:"Sï¼æ°é±éï¼"}),i.jsx("option",{value:"M",children:"Mï¼1ã3 ãæï¼"}),i.jsx("option",{value:"L",children:"Lï¼3 ãæè¶
ï¼"})]})]}),a&&i.jsxs("label",{className:"block",children:[i.jsx("span",{className:"block text-xs text-gray-500 mb-1",children:"ãªã¹ã¯ï¼èªç¤¾ã§è¦ç´ãå ´åï¼"}),i.jsxs("select",{className:P,value:"client"===e.estimate.riskSource?e.estimate.risk??"":"",disabled:n,onChange:e=>o({estimate:{risk:e.target.value||null}}),children:[i.jsx("option",{value:"",children:"æå®ããªã"}),i.jsx("option",{value:"high",children:"é«"}),i.jsx("option",{value:"medium",children:"ä¸"}),i.jsx("option",{value:"low",children:"ä½"})]})]}),i.jsxs("label",{className:"block sm:col-span-2",children:[i.jsx("span",{className:"block text-xs text-gray-500 mb-1",children:"ã¡ã¢"}),i.jsx("textarea",{className:P,rows:2,maxLength:2e3,value:f,disabled:n,onChange:e=>v(e.target.value),onBlur:()=>{f!==e.clientNote&&o({clientNote:f})}})]})]}),!t&&e.clientNote&&i.jsxs("p",{className:"text-gray-600 dark:text-slate-300 whitespace-pre-wrap",children:["ã¡ã¢: ",e.clientNote]}),e.estimate.dependsOn.length>0&&i.jsxs("p",{className:"text-xs text-gray-500",children:["å
ã«çµããé
ç®: ",e.estimate.dependsOn.join("ã»")]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-1 border-t border-gray-100 dark:border-slate-700",children:[i.jsx("span",{className:"text-xs text-gray-500 mr-1",children:"é¢é£ããç¸è«"}),0===c.length&&i.jsx("span",{className:"text-xs text-gray-400",children:"ã¾ã ããã¾ãã"}),c.map(e=>i.jsxs("button",{type:"button",onClick:()=>m(e.id),className:"inline-flex items-center gap-1 text-xs text-gsx-700 hover:underline",children:[i.jsx(y,{className:"w-3 h-3"}),e.ticketNumber??"ç¸è«"," ",e.subject.slice(0,24),F.includes(e.status)?"ï¼å¯¾å¿ä¸ï¼":"ï¼è§£æ±ºæ¸ã¿ï¼"]},e.id)),t&&(C?i.jsxs("button",{type:"button",onClick:()=>
1m(C.id),className:"ml-auto inline-flex items-center gap-1 px-3 py-1.5 text-xs font-medium rounded-lg border border-gsx-300 text-gsx-700 hover:bg-gsx-50",children:[i.jsx(y,{className:"w-3.5 h-3.5"})," 対å¿ä¸ã®ç¸è«ãéã"]}):i.jsxs("button",{type:"button",onClick:x,className:"ml-auto inline-flex items-center gap-1 px-3 py-1.5 text-xs font-medium text-white bg-gsx-600 rounded-lg hover:bg-gsx-700",children:[i.jsx(y,{className:"w-3.5 h-3.5"})," ãã®é
ç®ã«ã¤ãã¦ç¸è«ãã"]})),t&&i.jsx("button",{type:"button",disabled:n,onClick:()=>o({excluded:!e.excluded}),className:"text-xs text-gray-500 hover:underline",children:e.excluded?"è¨ç»ã«æ»ã":"ä»åã¯è¨ç»ã«å
¥ããªã"})]})]})},V=()=>{const{responseId:y=""}=e(),F=s(),V=t(),{currentUser:B}=a(),{selectedCompany:J}=r(),[G]=n(),X=E.includes((null==B?void 0:B.role)??""),Y=X&&(G.get("clientId")||(null==J?void 0:J.clientId))||void 0,z=d.useMemo(()=>["checklist","roadmap",y,Y??"self"],[y,Y]),{data:H,isLoading:W,error:Z}=l({queryKey:z,queryFn:()=>w.get(y,Y),enabled:!!y,retry:!1}),[ee,se]=d.useState(null),[te,ae]=d.useState(null),[re,ne]=d.useState(!1),[le,ie]=d.useState(!1),[de,ce]=d.useState(""),[oe,xe]=d.useState(null),me=()=>V.invalidateQueries({queryKey:z}),ue=e=>s=>ae({kind:"error",text:S(s,e)}),pe=N({mutationFn:()=>w.generate(y),onSuccess:e=>{ae({kind:"info",text:e.created?`ãã¼ããããã使ãã¾ããï¼${e.itemCount} é
ç®ï¼`:`ææ°ã®åçã§æ´æ°ãã¾ããï¼è¿½å ${e.summary.added} ä»¶ã»è§£æ¶ã®å¯è½æ§ ${e.summary.resolved} ä»¶ï¼ãæ
å½ã»ææã»é²æã¯ãã®ã¾ã¾ã§ã`}),me()},onError:ue("ãã¼ããããã®ä½æã«å¤±æãã¾ãã")}),he=N({mutationFn:e=>w.updatePlanning(y,e),onSuccess:()=>{me()},onError:ue("è¨å®ã®ä¿åã«å¤±æãã¾ãã")}),ge=N({mutationFn:e=>w.updateItem(y,e.itemId,e.patch),onSuccess:()=>{ae(null),me()},onError:ue("ä¿åã«å¤±æãã¾ãã")}),be=N({mutationFn:e=>w.addItem(y,e),onSuccess:()=>{ie(!1),ce(""),me()},onError:ue("é
ç®ã®è¿½å ã«å¤±æãã¾ãã")}),je=N({mutationFn:()=>w.launchEstimate(y,Y),onSuccess:e=>{xe(e.jobId),ae({kind:"info",text:"AI ã«ããæ¨è¨ãéå§ãã¾ãããå®äºããã¨åºåã表示ããã¾ã"})},onError:ue("AI ã«ããæ¨è¨ãéå§ã§ãã¾ããã§ãã")}),{data:ye,isError:Ne}=l({queryKey:["checklist","roadmap","estimate-job",y,oe],queryFn:()=>w.getEstimateJob(y,oe??"",Y),enabled:!!oe,retry:2,refetchInterval:e=>{var s;const t=null==(s=e.state.data)?void 0:s.status;return"completed"!==t&&"failed"!==t&&5e3}});d.useEffect(()=>{oe&&Ne&&(xe(null),ae({kind:"error",text:"AI ã«ããæ¨è¨ã®é²ã¿å
·åã確èªã§ãã¾ããã§ããããã°ãããã¦ãããã®ç»é¢ãéãç´ãã¦ã確èªãã ãã"}))},[oe,Ne]),d.useEffect(()=>{ye&&("completed"===ye.status?(xe(null),ae({kind:"info",text:"AI ã«ããæ¨è¨ãå®äºãã¾ãã"}),V.invalidateQueries({queryKey:z})):"failed"===ye.status&&(xe(null),ae({kind:"error",text:"AI ã«ããæ¨è¨ã«å¤±æãã¾ãããæéãããã¦å度ã試ããã ããï¼ãã®å¤±æã¯ãæ¨è¨ã®åæ°ã«ã¯æ°ãã¾ããï¼"})))},[ye,V,z]);const fe=H&&H.exists?H:null,ve=!0===(null==H?void 0:H.permissions.canManage),{data:ke}=l({queryKey:["checklist","roadmap","owners",y],queryFn:()=>w.getOwnerCandidates(y),enabled:!!fe&&ve,staleTime:3e5,retry:!1}),{data:we}=f(le?(null==H?void 0:H.response.templateId)??"":""),Se=d.useMemo(()=>{if(!fe||!we)return[];const e=new Set(fe.items.map(e=>e.questionId)),s=de.trim().toLowerCase(),t=[];for(const a of we.categories??[])for(const r of a.questions??[]){if(e.has(r.id))continue;const n=r.code??"",l=`${n?`${n} `:""}${r.questionText}`;s&&!l.toLowerCase().includes(s)||t.push({id:r.id,label:l,category:a.name})}return t.slice(0,100)},[fe,we,de]),Ie=d.useMemo(()=>{const e=new Map;for(const s of(null==fe?void 0:fe.consultations)??[]){const t=e.get(s.itemId)??[];t.push(s),e.set(s.itemId,t)}return e},[fe]),Ce=d.useMemo(()=>{if(!fe)return{quarters:[],truncated:!1};const e=Q(fe.roadmap.planning.startQuarter)??0;let s=e,t=e+3;for(const l of fe.items){if(!l.schedule)continue;const e=Q(l.schedule.startQuarter),a=Q(l.schedule.endQuarter);null!==e&&e<s&&(s=e),null!==a&&a>t&&(t=a)}const a=t-s+1>8,r=a?s+8-1:t,n=[];for(let l=s;l<=r;l++)n.push(P(l));return{quarters:n,truncated:a}},[fe]);if(W)return i.jsx("div",{className:"flex items-center justify-center min-h-[40vh] text-gray-500",children:"èªã¿è¾¼ã¿ä¸..."});if(Z||!H){const{status:e,code:s}
1=k(Z),t="client_selection_required"===s?"顧客ã鏿ãã¦ããéãã¦ãã ããã":404===e?"ãã®æ©è½ã¯ã¾ã ãå©ç¨ããã ãã¾ããã":403===e?"ãã®ãã¼ããããã表示ããæ¨©éãããã¾ããã":"ãã¼ãããããèªã¿è¾¼ãã¾ããã§ããã";return i.jsxs("div",{className:"p-8 text-center text-gray-500",children:[t,i.jsx("button",{onClick:()=>F("/app/checklist"),className:"ml-2 text-gsx-600 underline",children:"ãã§ãã¯ãªã¹ãä¸è¦§ã¸"})]})}const $e=H.response.templateName??"ãã§ãã¯ãªã¹ã",Qe=v[H.plan],Pe=ge.isPending,qe=i.jsxs("div",{className:"flex items-start justify-between flex-wrap gap-3",children:[i.jsxs("div",{children:[i.jsxs("button",{onClick:()=>F(`/app/checklist/responses/${y}/dashboard`),className:"inline-flex items-center gap-1 text-sm text-gray-500 hover:text-gray-700 mb-1 print:hidden",children:[i.jsx(c,{className:"w-4 h-4"})," è©ä¾¡ããã·ã¥ãã¼ãã¸æ»ã"]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(o,{className:"w-7 h-7 text-gsx-600 print:hidden"}),i.jsxs("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white print:text-black",children:[$e," ãã¼ãããã"]})]}),i.jsx("p",{className:"text-sm text-gray-500 mt-1",children:H.response.companyName})]}),i.jsxs("div",{className:"flex items-center gap-2 print:hidden",children:[i.jsxs("span",{className:"px-3 py-1 text-xs font-semibold rounded-full bg-gray-100 text-gray-600",children:[Qe," ãã©ã³"]}),fe&&i.jsxs("button",{onClick:()=>window.print(),className:"inline-flex items-center gap-1.5 rounded-lg border border-gray-300 dark:border-slate-600 px-3 py-1.5 text-xs font-medium text-gray-700 dark:text-slate-200 hover:bg-gray-50 dark:hover:bg-slate-700",children:[i.jsx(x,{className:"w-3.5 h-3.5"})," å°å·"]}),fe&&ve&&i.jsxs("button",{onClick:()=>pe.mutate(),disabled:pe.isPending,className:"inline-flex items-center gap-1.5 rounded-lg border border-gsx-300 px-3 py-1.5 text-xs font-medium text-gsx-700 hover:bg-gsx-50 disabled:opacity-50",title:"ææ°ã®åçããã®ã£ãããåãç´ãã¾ããæ
å½ã»ææã»é²æã¯ãã®ã¾ã¾æ®ãã¾ã",children:[i.jsx(m,{className:"w-3.5 h-3.5"})," ",pe.isPending?"æ´æ°ä¸â¦":"ææ°ã®åçã§æ´æ°"]})]})]}),Ee=te&&i.jsx("div",{className:"rounded-lg border p-3 text-sm print:hidden "+("error"===te.kind?"border-red-200 bg-red-50 text-red-800":"border-green-200 bg-green-50 text-green-800"),role:"error"===te.kind?"alert":"status",children:te.text});if(!fe){const e=H.exists?null:H.candidates;return i.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 space-y-6",children:[qe,Ee,i.jsxs("div",{className:"bg-white dark:bg-slate-800 rounded-xl shadow-sm p-8 text-center",children:[i.jsx(o,{className:"w-10 h-10 text-gsx-500 mx-auto mb-3"}),i.jsx("p",{className:"text-gray-800 dark:text-slate-200 font-medium",children:"æªå¯¾å¿ã®é
ç®ããã対å¿ã®é çªã¨ææã®è¨ç»ã使ãã¾ã"}),i.jsxs("p",{className:"text-sm text-gray-500 mt-2",children:["対象: ",(null==e?void 0:e.total)??0," ä»¶ï¼æªé ",(null==e?void 0:e.byStatus["æªé"])??0,"ã»è¨¼è·¡ä¸è¶³ ",(null==e?void 0:e.byStatus["証跡ä¸è¶³"])??0,"ã»æªåç"," ",(null==e?void 0:e.byStatus["æªåç"])??0,"ï¼"]}),ve?i.jsxs("button",{onClick:()=>pe.mutate(),disabled:pe.isPending,className:"mt-5 inline-flex items-center gap-2 rounded-lg bg-gsx-600 hover:bg-gsx-700 px-5 py-2.5 text-sm font-medium text-white disabled:opacity-50",children:[i.jsx(o,{className:"w-4 h-4"}),pe.isPending?"使ä¸â¦":"ãã¼ããããã使"]}):i.jsx("p",{className:"text-sm text-gray-500 mt-4",children:X?"顧客ã®ç®¡çè
ã使ããã¨ãããã«è¡¨ç¤ºããã¾ãï¼ã¹ã¿ããã¯é¡§å®¢ã®è¨ç»ã使ã»å¤æ´ãã¾ããï¼ã":"管çè
ã使ããã¨ãããã«è¡¨ç¤ºããã¾ãã"})]})]})}const{roadmap:Le}=fe,Ae=Le.planning.startQuarter,_e=fe.estimateCoverage,Me="basic"===fe.plan,Fe=T.includes(Le.baseResponseStatus??""),Ue=L[Le.baseResponseStatus??""]??"â",Oe=e=>{const s=e.schedule?Q(e.schedule.startQuarter):null,t=e.schedule?Q(e.sc
1hedule.endQuarter):null;return Ce.quarters.map((a,r)=>{var n,l;const d=Q(a),c=r===Ce.quarters.length-1,o=null!==s&&null!==t&&null!==d&&d>=s&&d<=t,x=Ce.truncated&&c&&null!==t&&null!==d&&t>d;return i.jsx("td",{className:"px-0.5 py-2 align-middle",children:o?i.jsx("div",{className:`h-3 rounded-sm ${"done"===e.progress?"bg-green-400":(null==(n=e.schedule)?void 0:n.pinned)?"bg-gsx-600":"bg-gsx-400"} print:border print:border-gray-600`,title:`${q(a)}${(null==(l=e.schedule)?void 0:l.pinned)?"":"ï¼èªåå²ä»ï¼"}`}):x?i.jsx("div",{className:"text-center text-xs text-gray-400",children:"â"}):i.jsx("div",{className:"h-3"})},a)})},Te=e=>s=>ge.mutate({itemId:e,patch:s}),Re=e=>ve||H.permissions.canUpdateOwnProgress&&!!B&&e.ownerUserId===(B.uid||B.id),Ke=e=>i.jsx(D,{item:e,startQuarter:Ae,canManage:ve,canEditEstimate:!0===H.permissions.canEditEstimate,canEditProgress:Re(e),saving:Pe,ownerCandidates:ke??[],consultations:Ie.get(e.id)??[],onPatch:Te(e.id),onConsult:()=>(e=>{const s=(null==H?void 0:H.response.templateName)??"ãã§ãã¯ãªã¹ã",t=new URLSearchParams({source:"checklist",mode:"ai",subject:`ã${s}ãè¨ç»ã®ç¸è«: ${e.questionText.slice(0,60)}`,message:`ãã§ãã¯ãªã¹ãã${s}ãã®ãã¼ããããã®é
ç®ã«ã¤ãã¦ãé²ãæ¹ãç¸è«ãããã§ãã\n\n- ã«ãã´ãª: ${e.categoryName}\n- é
ç®: ${e.code?`${e.code} `:""}${e.questionText}\n- ç¶æ
: ${e.gapStatus}\n`,relatedResponseId:y,roadmapId:y,roadmapItemId:e.id});F(`/app/support/tickets/new?${t.toString()}`)})(e),onOpenConsultation:e=>F(`/app/support/tickets/${e}`)}),De=e=>i.jsxs(i.Fragment,{children:[e.code&&i.jsx("span",{className:"font-mono text-xs text-gray-500 mr-1.5",children:e.code}),i.jsx("span",{className:"text-gray-900 dark:text-white",children:e.questionText}),e.gapResolved&&"done"!==e.progress&&i.jsx("span",{className:"ml-2 px-1.5 py-0.5 text-[10px] rounded bg-green-50 text-green-700 border border-green-200 whitespace-nowrap",title:"ææ°ã®åçã§ã¯æªå¯¾å¿ã
1§ã¯ãªããªã£ã¦ãã¾ãã確èªã®ããã鲿ããå®äºãã«ãã¦ãã ãã",children:"è§£æ¶æ¸ã¿ã®å¯è½æ§"}),e.priority.factors.length>0&&i.jsxs("span",{className:"block text-[11px] text-gray-400 mt-0.5",children:["æ ¹æ : ",e.priority.factors.join("ã»")]})]});return i.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 space-y-6 print:p-0 print:space-y-3 print:max-w-none",children:[qe,Ee,i.jsxs("div",{className:"bg-white dark:bg-slate-800 rounded-xl shadow-sm p-5 print:shadow-none print:p-0 print:rounded-none",children:[i.jsxs("dl",{className:"grid grid-cols-2 lg:grid-cols-4 gap-x-6 gap-y-2 text-sm",children:[i.jsxs("div",{children:[i.jsx("dt",{className:"text-xs text-gray-500",children:"åºæºã«ããåç"}),i.jsxs("dd",{className:"text-gray-900 dark:text-white print:text-black",children:[Fe?`ç·¨éä¸ã®åçï¼${Ue}ï¼`:Le.baseVersion?`第 ${Le.baseVersion} çï¼${Ue}ï¼`:`åçï¼${Ue}ï¼`,i.jsxs("span",{className:"block text-xs text-gray-500",children:[O(Le.generatedAt)," æç¹ã®å
容"]})]})]}),i.jsxs("div",{children:[i.jsx("dt",{className:"text-xs text-gray-500",children:"è©ä¾¡æ¥ï¼æåºæ¥ï¼"}),i.jsx("dd",{className:"text-gray-900 dark:text-white print:text-black",children:Fe?i.jsxs(i.Fragment,{children:["æªæåºï¼ç·¨éä¸ã®åçãã使ï¼",Le.baseVersion?i.jsxs("span",{className:"block text-xs text-gray-500",children:["ç´è¿ã«è¨é²ããçã¯ç¬¬ ",Le.baseVersion," ç"]}):null]}):U(Le.baseSubmittedAt)})]}),i.jsxs("div",{children:[i.jsx("dt",{className:"text-xs text-gray-500",children:"è¨ç»ã®ç¶æ
"}),i.jsx("dd",{className:"text-gray-900 dark:text-white print:text-black",children:$[Le.status]})]}),i.jsxs("div",{children:[i.jsx("dt",{className:"text-xs text-gray-500",children:"æçµæ´æ°"}),i.jsx("dd",{className:"text-gray-900 dark:text-white print:text-black",children:U(Le.updatedAt)})]})]}),ve&&i.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-100 dark:border-slate-700 flex flex-wrap items-end gap-4 print:hidden",children:[i.jsxs("label",{className:"text-sm",children:[i.jsx("span",{className:"block text-xs text-gray-500 mb-1",children:"èµ·ç¹"}),i.jsx("select",{className:"rounded-md border border-gray-300 dark:border-slate-600 bg-white dark:bg-slate-900 text-sm px-2 py-1.5",value:Ae,disabled:he.isPending,onChange:e=>he.mutate({startQuarter:e.target.value}),children:K(Ae).map(e=>i.jsx("option",{value:e,children:q(e)},e))})]}),i.jsxs("label",{className:"text-sm",children:[i.jsx("span",{className:"block text-xs text-gray-500 mb-1",title:"å·¥æ° S=1ã»M=3ã»L=8 ã¨ãã¦ã3 ãæã«é²ããããé",children:"3 ãæã«é²ããé"}),i.jsx("select",{className:"rounded-md border border-gray-300 dark:border-slate-600 bg-white dark:bg-slate-900 text-sm px-2 py-1.5",value:Le.planning.capacityPerQuarter,disabled:he.isPending,onChange:e=>he.mutate({capacityPerQuarter:Number(e.target.value)}),children:[...new Set([...M,Le.planning.capacityPerQuarter])].sort((e,s)=>e-s).map(e=>i.jsx("option",{value:e,children:e},e))})]}),i.jsx("button",{type:"button",disabled:he.isPending,onClick:()=>he.mutate({status:"shared"===Le.status?"draft":"shared"}),title:"shared"===Le.status?"è¨ç»ã®ç¶æ
ãã䏿¸ããã«æ»ãã¾ã":"è¨ç»ã®ç¶æ
ãã確å®ãã«ãã¾ãï¼æ
å½ã³ã³ãµã«ã¿ã³ãã¸ã®éç¥ã¯éããã¾ãããç¸è«ãããé
ç®ã¯ããã®é
ç®ã«ã¤ãã¦ç¸è«ãããããå©ç¨ãã ããï¼",className:"rounded-lg border border-gsx-300 px-3 py-1.5 text-xs font-medium text-gsx-700 hover:bg-gsx-50 disabled:opacity-50",children:"shared"===Le.status?"䏿¸ãã«æ»ã":"è¨ç»ã確å®ãã"}),i.jsxs("button",{type:"button",onClick:()=>ie(e=>!e),className:"inline-flex items-center gap-1 rounded-lg border border-gray-300 dark:border-slate-600 px-3 py-1.5 text-xs font-medium text-gray-700 dark:text-slate-200 hover:bg-gray-50 dark:hover:bg-slate-700",children:[i.jsx(u,{className:"w-3.5 h-3.5"})," é
ç®ã追å "]})]}),le&&ve&&i.jsxs("div",{className:"mt-4 rounded-lg border border-gray-200 dark:border-slate-700 p-4 print:hidden",children:[i.jsx("p",{className:"text-sm text-gray-700 dark:text-slate-200 mb-2",children:"èªç±è¨è¿°ã®è¨åãªã©ãèªåã§ã¯åè£ã«å
¥ããªãé
ç®ãè¨ç»ã«å
¥ãã¾ãï¼ç¶æ
ã¯ãè¦å¯¾å¿ãã«ãªãã¾ãï¼ã"}),i.jsx("input",{className:"w-full rounded-md border border-gray-300 dark:border-slate-600 bg-white dark:bg-slate-900 text-sm px-2 py-1.5 mb-2",placeholder:"è¨åãæ¤ç´¢",value:de,onChange:e=>ce(e.target.value)}),i.jsxs("ul",{className:"max-h-64 overflow-y-auto divide-y divide-gray-100 dark:divide-slate-700",children:[0===Se.length&&i.jsx("li",{className:"py-2 text-sm text-gray-400",children:we?"追å ã§ããè¨åãããã¾ãã":"èªã¿è¾¼ã¿ä¸â¦"}),Se.map(e=>i.jsxs("li",{className:"py-2 flex items-start justify-between gap-3",children:[i.jsxs("span",{className:"text-sm text-gray-800 dark:text-slate-200",children:[e.label,i.jsx("span",{className:"block text-xs text-gray-400",children:e.category})]}),i.jsx("button",{type:"button",disabled:be.isPending,onClick:()=>be.mutate(e.id),className:"shrink-0 rounded-md bg-gsx-600 hover:bg-gsx-700 px-2.5 py-1 text-xs font-medium text-white disabled:opacity-50",children:"追å "})]},e.id))]})]})]}),fe.dependencyCycle&&i.jsxs("div",{className:"rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-800 flex items-start gap-2",role:"alert",children:[i.jsx(p,{className:"w-4 h-4 mt-0.5 shrink-0"}),i.jsxs("span",{children:["é
ç®ã®åå¾é¢ä¿ã循ç°ãã¦ãããããé çªãæ£ããæ±ºãããã¾ããï¼",fe.dependencyCycle.join(" â "),"ï¼ã 表示ã®é çªã¯åå¾é¢ä¿ãç¡è¦ããåèå¤ã§ããæ
å½ã³ã³ãµã«ã¿ã³ãã«ãé£çµ¡ãã ããã"]})]}),i.jsxs("div",{className:"text-xs text-gray-500 space-y-1 print:text-[10px]",children:[_e.ai_estimate>0&&i.jsxs("p",{children:["â»ãAI æ¨è¨ãã¯ãã³ã³ãµã«ã¿ã³ãã®ç£ä¿®åã®ç®å®ã§ãï¼",_e.ai_estimate," ä»¶ï¼ãå·¥æ°ã¯ Sï¼æ°é±éã»Mï¼1ã3 ãæã»Lï¼3 ãæè¶
ã"]}),_e.unset>0&&i.jsxs("p",{children:["â»ãæªè¨å®ãã®é
ç®ï¼",_e.unset," ä»¶ï¼ã¯ããªã¹ã¯ä¸ã»å·¥æ° M ã¨ãã¦é çªãè¨ç®ãã¦ãã¾ãã",Me?"ç£ä¿®æ¸ã¿ã®åºåãç¨æããæ¬¡ç¬¬ã表示ããã¾ãã":"",!0===H.permissions.canEditEstimate?"é
ç®ãéãã¨èªç¤¾ã§è¨å®ã§ãã¾ãã":""]}),i.jsx("p",{children:"⻠製åã®é¸å®ãè²»ç¨ã«ã¤ãã¦ã¯ãåé
ç®ã®ããã®é
ç®ã«ã¤ãã¦ç¸è«ããããããç¸è«ãã ããã"}),i.jsx("p",{className:"print:hidden",children:"â» é
ç®ããã®ç¸è«ã¯ã使æã¯ææ¬¡ã®ç¸è«æ ãæ¶è²»ãã¾ããï¼1 ã¤ã®é
ç®ã«ã¤ãã対å¿ä¸ã®ç¸è«ã¯ 1 ä»¶ã¾ã§ï¼ã ãã ãããã®ç¸è«ã®ä¸ã§ã³ã³ãµã«ã¿ã³ãã«ç¢ºèªãä¾é ¼ããã¨ãã解決æ¸ã¿ã«ããç¸è«ãåéããã¨ãã ç¸è«æ ãæ¶è²»ããªãç¸è«ã®æãããã®ä¸éãè¶
ããåã¯ãé常ã®ç¸è«ã¨åããææ¬¡ã®ç¸è«æ ã使ãã¾ãã"})]}),fe.aiEstimate.available&&_e.unset>0&&(ve||X)&&i.jsxs("div",{className:"rounded-lg border border-blue-200 bg-blue-50 p-3 text-sm text-blue-900 flex flex-wrap items-center justify-between gap-2 print:hidden",children:[i.jsx("span",{children:"èªç¤¾ã§åãè¾¼ãã ãã§ãã¯ãªã¹ãã®ãããå·¥æ°ã»ãªã¹ã¯ã®
1åºåãæªè¨å®ã§ããAI ã§ç®å®ã使ã§ãã¾ãï¼AI ã®å©ç¨éã«è¨ä¸ããã¾ãï¼ã"}),i.jsxs("button",{type:"button",disabled:je.isPending||!!oe,onClick:()=>je.mutate(),className:"inline-flex items-center gap-1 rounded-lg bg-blue-600 hover:bg-blue-700 px-3 py-1.5 text-xs font-medium text-white disabled:opacity-50",children:[i.jsx(h,{className:"w-3.5 h-3.5"}),oe?"æ¨è¨ä¸â¦"+((null==ye?void 0:ye.progress)?`ï¼${ye.progress.completed}/${ye.progress.total}ï¼`:""):"AI ã§æ¨è¨ãä½ã"]})]}),X&&fe.consultationStats&&i.jsxs("div",{className:"rounded-lg border border-gray-200 dark:border-slate-700 bg-white dark:bg-slate-800 p-3 text-xs text-gray-600 dark:text-slate-300 print:hidden",children:["ã¹ã¿ããåã: ãã®é¡§å®¢ã®ãã¼ããããç±æ¥ã®ç¸è«ï¼",fe.consultationStats.month,"ã»ä½ææã¯ææ¬¡ã®ç¸è«æ ãæ¶è²»ãã¾ããï¼â AI"," ",fe.consultationStats.ai," ä»¶ / ã³ã³ãµã«ã¿ã³ã ",fe.consultationStats.consultant," ä»¶"]}),i.jsx("div",{className:"bg-white dark:bg-slate-800 rounded-xl shadow-sm p-4 hidden md:block print:block print:shadow-none print:p-0",children:0===fe.items.length?i.jsx("p",{className:"text-sm text-green-600 py-6 text-center",children:"è¨ç»ã«å
¥ã£ã¦ããé
ç®ã¯ããã¾ããã"}):i.jsxs("table",{className:"w-full text-sm border-collapse",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"text-left text-xs text-gray-500 border-b border-gray-200 dark:border-slate-700",children:[i.jsx("th",{className:"py-2 pr-2 font-medium w-10",children:"åªå
"}),i.jsx("th",{className:"py-2 pr-2 font-medium",children:"é
ç®"}),i.jsx("th",{className:"py-2 pr-2 font-medium whitespace-nowrap",children:"ç¶æ
"}),i.jsx("th",{className:"py-2 pr-2 font-medium whitespace-nowrap",children:"å·¥æ°"}),i.jsx("th",{className:"py-2 pr-2 font-medium whitespace-nowrap",children:"ãªã¹ã¯"}),i.jsx("th",{className:"py-2 pr-2 font-medium whitespace-nowrap",children:"æ
å½"}),i.jsx("th",{className:"py-2 pr-2 font-medium whitespace-nowrap",children:"鲿"}),Ce.quarters.map(e=>i.jsx("th",{className:"py-2 px-0.5 font-medium text-center text-[10px] whitespace-nowrap w-14",children:q(e,!0)},e))]})}),i.jsx("tbody",{children:fe.items.map(e=>{const s=ee===e.id;return i.jsxs(g.Fragment,{children:[i.jsxs("tr",{className:"border-b border-gray-100 dark:border-slate-700/50 cursor-pointer hover:bg-gray-50 dark:hover:bg-slate-700/30 print:break-inside-avoid",onClick:()=>se(s?null:e.id),children:[i.jsx("td",{className:"py-2 pr-2 text-gray-700 dark:text-slate-200 align-top",children:i.jsxs("span",{className:"inline-flex items-center gap-0.5",children:[i.jsx("span",{className:"print:hidden text-gray-400",children:s?i.jsx(b,{className:"w-3.5 h-3.5"}):i.jsx(j,{className:"w-3.5 h-3.5"})}),e.priority.rank??"â"]})}),i.jsx("td",{className:"py-2 pr-2 align-top",children:De(e)}),i.jsx("td",{className:"py-2 pr-2 align-top",children:i.jsx("span",{className:`px-2 py-0.5 text-xs font-medium rounded-full whitespace-nowrap ${A[e.gapStatus]??"bg-gray-100 text-gray-600"}`,children:e.gapStatus})}),i.jsx("td",{className:"py-2 pr-2 align-top",children:i.jsx(R,{value:e.estimate.effort,source:e.estimate.effortSource})}),i.jsx("td",{className:"py-2 pr-2 align-top",children:i.jsx(R,{value:e.estimate.risk?C[e.estimate.risk]:null,source:e.estimate.riskSource})}),i.jsx("td",{className:"py-2 pr-2 align-top text-gray-700 dark:text-slate-200",children:e.ownerLabel||i.jsx("span",{className:"text-xs text-gray-400",children:"æªè¨å®"})}),i.jsx("td",{className:"py-2 pr-2 align-top",children:i.jsx("span",{className:`px-2 py-0.5 text-xs rounded-full whitespace-nowrap ${_[e.progress]}`,children:I[e.progress]})}),Oe(e)]}),s&&i.jsxs("tr",{className:"bg-gray-50 dark:bg-slate-900/40 print:hidden",children:[i.jsx("td",{}),i.jsx("td",{colSpan:6+Ce.quarters.length,className:"py-3 pr-3",children:Ke(e)})]})]},e.id)})})]})}),i.jsxs("div",{className:"md:hidden space-y-3 print:hidden",children:[0===fe.items.length&&i.jsx("p",{className:"text-sm text-green-600 py-6 text-center",children:"è¨ç»ã«å
¥ã£ã¦ããé
ç®ã¯ããã¾ããã"}),fe.items.map(e=>{const s=ee===e.id;return i.jsxs("div",{className:"bg-white dark:bg-slate-800 rounded-xl shadow-sm p-4",children:[i.jsxs("button",{type:"button",className:"w-full text-left",onClick:()=>se(s?null:e.id),"aria-expanded":s,children:[i.jsxs("div",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"shrink-0 w-7 h-7 rounded-full bg-gsx-50 text-gsx-700 text-sm font-bold flex items-center justify-center",children:e.priority.rank??"â"}),i.jsx("span",{className:"text-sm",children:De(e)})]}),i.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs",children:[i.jsx("span",{className:`px-2 py-0.5 font-medium rounded-full ${A[e.gapStatus]??"bg-gray-100 text-gray-600"}`,children:e.gapStatus}),i.jsx("span",{className:`px-2 py-0.5 rounded-full ${_[e.progress]}`,children:I[e.progress]}),i.jsx("span",{className:"text-gray-500",children:"å·¥æ°"}),i.jsx(R,{value:e.estimate.effort,source:e.estimate.effortSource}),i.jsx("span",{className:"text-gray-500",children:"ãªã¹ã¯"}
1),i.jsx(R,{value:e.estimate.risk?C[e.estimate.risk]:null,source:e.estimate.riskSource})]}),i.jsxs("p",{className:"mt-2 text-xs text-gray-600 dark:text-slate-300",children:[e.schedule?e.schedule.startQuarter===e.schedule.endQuarter?q(e.schedule.startQuarter):`${q(e.schedule.startQuarter)} ã ${q(e.schedule.endQuarter)}`:"æææªå®",e.ownerLabel?` ï¼ ${e.ownerLabel}`:""]})]}),s&&i.jsx("div",{className:"mt-3 pt-3 border-t border-gray-100 dark:border-slate-700",children:Ke(e)})]},e.id)})]}),fe.excludedItems.length>0&&i.jsxs("div",{className:"bg-white dark:bg-slate-800 rounded-xl shadow-sm p-4 print:hidden",children:[i.jsxs("button",{type:"button",onClick:()=>ne(e=>!e),className:"inline-flex items-center gap-1 text-sm text-gray-700 dark:text-slate-200","aria-expanded":re,children:[re?i.jsx(b,{className:"w-4 h-4"}):i.jsx(j,{className:"w-4 h-4"}),"è¨ç»ã«å
¥ãã¦ããªãé
ç®ï¼",fe.excludedItems.length,"ï¼"]}),re&&i.jsx("ul",{className:"mt-3 divide-y divide-gray-100 dark:divide-slate-700",children:fe.excludedItems.map(e=>i.jsxs("li",{className:"py-2 flex items-start justify-between gap-3 text-sm",children:[i.jsx("span",{children:De(e)}),ve&&i.jsx("button",{type:"button",disabled:Pe,onClick:()=>Te(e.id)({excluded:!1}),className:"shrink-0 text-xs text-gsx-700 hover:underline",children:"è¨ç»ã«æ»ã"})]},e.id))})]}),i.jsxs("p",{className:"hidden print:block text-[10px] text-gray-500",children:["GSX One ãã¼ãããã â å°å·æ¥ ",U((new Date).toISOString()),"ãåªå
åº¦ã¯æªå¯¾å¿ã
1®ç¨®é¡ã»ãªã¹ã¯ã»å·¥æ°ã»åå¾é¢ä¿ããèªåã§è¨ç®ãã¦ãã¾ãã"]})]})};export{V as ChecklistRoadmapPage,V 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.