dev-process-kit 0.0.12 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/chunks/{shared-CLnfjHCQ.js → shared-BESRsbtm.js} +1 -1
  2. package/dist/chunks/{shared-DBJaP5gF.js → shared-BFTEmZvI.js} +147 -95
  3. package/dist/chunks/{shared-BwaDMwUS.js → shared-C2gu-y4m.js} +61 -33
  4. package/dist/chunks/{shared-DkkBQzIf.js → shared-CE1P_7xs.js} +199 -168
  5. package/dist/chunks/shared-CGPv8MQ7.js +1049 -0
  6. package/dist/chunks/shared-CTK76mc_.js +2457 -0
  7. package/dist/chunks/{shared-BvuW5NtY.js → shared-CmBhMY6X.js} +14 -3
  8. package/dist/chunks/shared-D4K7KsfJ.js +1 -0
  9. package/dist/chunks/shared-DD-fi15c.js +1104 -0
  10. package/dist/chunks/shared-DUEkF1z7.js +572 -0
  11. package/dist/chunks/{shared-CcrRNZCH.js → shared-Dc_FGuLM.js} +1 -1
  12. package/dist/chunks/shared-DdefS1nG.js +1 -0
  13. package/dist/chunks/{shared-C__W71Hw.js → shared-DjOBIYHF.js} +1 -1
  14. package/dist/chunks/{shared-DYe0OZr-.js → shared-NnvpqsPp.js} +19 -10
  15. package/dist/chunks/shared-rZQ5j0Kh.js +2683 -0
  16. package/dist/chunks/{shared-DUq2-pM9.js → shared-wtt8CCP_.js} +184 -134
  17. package/dist/components.js +1 -1
  18. package/dist/index.js +1 -1
  19. package/dist/templates/delegation-poker.js +1 -1
  20. package/dist/templates/event-storming.js +1 -1
  21. package/dist/templates/example-mapping.js +1 -1
  22. package/dist/templates/grill.js +1 -1
  23. package/dist/templates/plain.js +1 -1
  24. package/dist/templates/prototype.js +1 -1
  25. package/dist/templates/slides.js +1 -1
  26. package/dist/templates/task-board.js +1 -1
  27. package/dist/templates/usm.js +1 -1
  28. package/dist/templates/whiteboard.js +1 -1
  29. package/package.json +1 -1
  30. package/dist/chunks/shared-BC5MlWBY.js +0 -2209
  31. package/dist/chunks/shared-CoDXb-Yj.js +0 -556
  32. package/dist/chunks/shared-D7CMQLaX.js +0 -2323
  33. package/dist/chunks/shared-DhwK_dh_.js +0 -1093
  34. package/dist/chunks/shared-aDPp8Vry.js +0 -1
  35. package/dist/chunks/shared-xrCdgpNS.js +0 -1
  36. package/dist/chunks/shared-y3FwoRgh.js +0 -1017
@@ -1,9 +1,14 @@
1
- import{p as be,al as L,ad as g,ai as h,aj as b,ag as p,an as v,ae as u,ao as fe,af as $,ac as ke,R as z,a0 as ve,V as xe,a4 as s,a5 as F,a3 as d,ap as O,a2 as me,T as P,aI as we,aJ as ye}from"./shared-BC5MlWBY.js";import{c as N}from"./shared-ml5h7U5L.js";const $e=(t,e,r)=>r.top<e.top?t+r.top-e.top:r.bottom<=e.bottom?t:t+Math.min(r.bottom-e.bottom,r.top-e.top),Te=(t,e)=>{const i=t.getBoundingClientRect().top+t.clientTop;t.scrollTop=$e(t.scrollTop,{top:i,bottom:i+t.clientHeight},e.getBoundingClientRect())},Se=L("kind",[g({kind:v("option"),optionId:h(p(),b(1))}),g({kind:v("free"),text:p()}),g({kind:v("clear")})]),T={ANSWER_QUESTION:be("ANSWER_QUESTION","question",Se)},G=(t,e)=>({type:"ANSWER_QUESTION",target:{type:"question",id:t},payload:e}),Re=g({id:h(p(),b(1)),label:h(p(),b(1))}),B=g({id:h(p(),b(1)),ref:u(h(p(),b(1))),title:h(p(),b(1)),description:u(p()),note:u(p()),options:u($(Re),[]),freeText:u(fe(),!0)}),Ce=L("kind",[g({kind:v("option"),optionId:h(p(),b(1))}),g({kind:v("free"),text:p()})]),Ae=g({...B.entries,answer:u(Ce)}),qe=g({label:u(h(p(),b(1))),questions:$(Ae)}),_=g({title:u(p(),""),questions:$(B),history:u($(qe),[])}),M=t=>{const e=new Set;return t.map((r,i)=>{if(e.has(r.id))throw new Error(`duplicate question id: ${r.id}`);e.add(r.id);const n=new Set;for(const a of r.options){if(n.has(a.id))throw new Error(`duplicate option id: ${a.id} in question ${r.id}`);n.add(a.id)}return{...r,ref:r.ref??`Q${i+1}`,description:r.description??null,note:r.note??null}})},U=t=>({id:t.id,ref:t.ref,title:t.title,description:t.description,note:t.note,options:t.options,freeText:t.freeText}),Ee=t=>{const e=t.answer??null;if(e?.kind==="option"&&!t.options.some(r=>r.id===e.optionId))throw new Error(`unknown option id: ${e.optionId} in question ${t.id}`);return{...U(t),answer:e}},H=t=>{const e=ke(_,t);return{title:e.title,questions:M(e.questions).map(U),answers:{},pastRounds:e.history.map((r,i)=>({label:r.label??`v${i+1}`,questions:M(r.questions).map(Ee)}))}},W=()=>({title:"",questions:[],answers:{},pastRounds:[]}),f=(t,e)=>t.questions.find(r=>r.id===e),Qe=(t,e)=>f(t,e)?.ref??e,q=(t,e)=>{const r=f(t,e);return r?`${r.ref} \xB7 ${r.title}`:e},x=(t,e)=>e?e.kind==="option"?t.options.find(r=>r.id===e.optionId)?.label??"":e.text.trim():"",S=(t,e)=>x(t,e)!=="",j=t=>{let e="";for(let r=t+1;r>0;r=Math.floor((r-1)/26))e=String.fromCharCode(97+(r-1)%26)+e;return e},D=t=>({total:t.questions.length,answered:t.questions.filter(e=>S(e,t.answers[e.id])).length}),R=(t,e,r)=>{const i=t.answers[e];if(r===null){if(i===void 0)return t;const n={...t.answers};return delete n[e],{...t,answers:n}}return i?.kind===r.kind&&(i.kind==="option"&&r.kind==="option"&&i.optionId===r.optionId||i.kind==="free"&&r.kind==="free"&&i.text===r.text)?t:{...t,answers:{...t.answers,[e]:r}}},Y=(t,e)=>{if(e.type!=="ANSWER_QUESTION")return null;const r=f(t,e.target.id);if(!r)return null;const i=z(T.ANSWER_QUESTION,e);return i.kind==="clear"?R(t,r.id,null):i.kind==="option"?r.options.some(n=>n.id===i.optionId)?R(t,r.id,{kind:"option",optionId:i.optionId}):null:R(t,r.id,{kind:"free",text:i.text})},m=ve({en:{wholePage:"Whole page",questionGroup:"Question",answerCleared:"Clear answer",answered:"Answer",answeredFreely:"Answer in your own words",quoted:t=>`\u2192 \u201C${t}\u201D`,progress:(t,e)=>`${t} of ${e} answered`,openPanel:"Show questions / review",closePanel:"Hide questions / review",toggleLabel:(t,e)=>`${t} (${e})`,tabs:"Questions / review",questionsTab:"Questions",reviewTab:"Review",copied:"Copied",copyFailed:"Could not copy",copyAll:"Copy answers and review",sending:"Sending\u2026",sent:"Sent to Claude",sendFailed:"Could not send",sendAll:"Send answers and review to Claude",copyDone:"Copied",copy:"Copy",noQuestions:"No matching questions.",freeText:"Your own answer",freeTextOf:t=>`Your own answer to ${t}`,freeTextPlaceholder:"Type an answer\u2026 (\u2318/Ctrl+Enter for next)",clearAnswer:"Clear answer",roundSelect:"Question round",currentRound:"Current questions",roundOption:(t,e)=>`${t} (${e})`,pastRound:t=>`${t}: earlier questions, read-only`,unanswered:"Not answered"},ja:{wholePage:"\u30DA\u30FC\u30B8\u5168\u4F53",questionGroup:"\u8CEA\u554F",answerCleared:"\u56DE\u7B54\u3092\u30AF\u30EA\u30A2",answered:"\u56DE\u7B54",answeredFreely:"\u81EA\u7531\u8A18\u8FF0\u3067\u56DE\u7B54",quoted:t=>`\u2192 \u300C${t}\u300D`,progress:(t,e)=>`\u56DE\u7B54\u6E08\u307F ${t} / ${e}`,openPanel:"\u8CEA\u554F / Review \u3092\u3072\u3089\u304F",closePanel:"\u8CEA\u554F / Review \u3092\u305F\u305F\u3080",toggleLabel:(t,e)=>`${t}\uFF08${e}\uFF09`,tabs:"\u8CEA\u554F / Review",questionsTab:"\u8CEA\u554F",reviewTab:"Review",copied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F",copyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F",copyAll:"\u56DE\u7B54\u30FBReview \u3092\u307E\u3068\u3081\u3066\u30B3\u30D4\u30FC",sending:"\u9001\u4FE1\u4E2D\u2026",sent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F",sendFailed:"\u9001\u308C\u307E\u305B\u3093\u3067\u3057\u305F",sendAll:"\u56DE\u7B54\u30FBReview \u3092 Claude \u306B\u9001\u308B",copyDone:"\u30B3\u30D4\u30FC\u6E08\u307F",copy:"\u30B3\u30D4\u30FC",noQuestions:"\u8A72\u5F53\u3059\u308B\u8CEA\u554F\u306F\u3042\u308A\u307E\u305B\u3093\u3002",freeText:"\u81EA\u7531\u8A18\u8FF0",freeTextOf:t=>`${t} \u306E\u81EA\u7531\u8A18\u8FF0`,freeTextPlaceholder:"\u56DE\u7B54\u3092\u5165\u529B\u2026\uFF08\u2318/Ctrl+Enter \u3067\u6B21\u3078\uFF09",clearAnswer:"\u56DE\u7B54\u3092\u30AF\u30EA\u30A2",roundSelect:"\u8CEA\u554F\u306E\u30E9\u30A6\u30F3\u30C9",currentRound:"\u73FE\u5728\u306E\u8CEA\u554F",roundOption:(t,e)=>`${t}\uFF08${e} \u554F\uFF09`,pastRound:t=>`${t}: \u904E\u53BB\u306E\u8CEA\u554F\uFF08\u95B2\u89A7\u306E\u307F\uFF09`,unanswered:"\u672A\u56DE\u7B54"}}),V=t=>t.title===""?"Visually Grill":t.title,K=(t,e,r)=>{switch(r.type){case"question":return q(e,r.id);case"page":return t.wholePage;default:return r.id}},Ie=(t,e,r)=>{const i=z(T.ANSWER_QUESTION,r);if(i.kind==="clear")return{title:t.answerCleared,tone:"delete"};if(i.kind==="option"){const n=f(e,r.target.id)?.options.find(a=>a.id===i.optionId);return{title:t.answered,tone:"update",body:t.quoted(n?.label??i.optionId)}}return{title:t.answeredFreely,tone:"update",body:t.quoted(i.text.slice(0,120))}},J=(t,e,r,i)=>{let n;try{n=Ie(t,i??r,e)}catch{n={title:e.type,tone:"meta"}}return{title:n.title,targetLabel:K(t,r,e.target),tone:n.tone,...n.body===void 0?{}:{summary:n.body}}},X=t=>`${t.type} ${xe(t.target)} ${JSON.stringify(t.payload)}`,Z=(t,e)=>e.questions.map(r=>({value:`question:${r.id}`,label:q(e,r.id),group:t.questionGroup})),ee=(t,e)=>{const r=e.question;if(r!==void 0&&f(t,r))return e;const i=t.questions[0];return i===void 0?e:{...e,question:i.id}},te=(t,e)=>{const r=e.question;return r!==void 0&&f(t,r)?r:t.questions[0]?.id??null},Le=(t,e)=>{const r=t.questions,i=r.findIndex(a=>a.id===e);return(i===-1?r:[...r.slice(i+1),...r.slice(0,i)]).find(a=>!S(a,t.answers[a.id]))?.id??null},re=(t,e)=>t.options.map((r,i)=>({id:r.id,letter:j(i),label:r.label,checked:e?.kind==="option"&&e.optionId===r.id})),ze=(t,e,r)=>{const i=e.answers[t.id];return{id:t.id,ref:t.ref,title:t.title,description:t.description,note:t.note,open:t.id===r,answered:x(t,i)!=="",summary:x(t,i),choices:re(t,i),draft:i?.kind==="free"?i.text:"",freeSelected:i?.kind==="free",allowFreeText:t.freeText}},ie=(t,e)=>{const r=te(t,e);return{questions:t.questions.map(i=>ze(i,t,r))}},ne=(t,e)=>{const r=D(e);return{progress:t.progress(r.answered,r.total),answered:r.answered,total:r.total}},ae=(t,e)=>e!=="current"&&t.pastRounds[e]!==void 0?e:"current",Fe=(t,e,r)=>{if(e.pastRounds.length===0)return[];const i=ae(e,r),n=e.pastRounds.map((a,o)=>({value:String(o),label:t.roundOption(a.label,a.questions.length),selected:i===o}));return[{value:"current",label:t.roundOption(t.currentRound,e.questions.length),selected:i==="current"},...[...n].reverse()]},Oe=(t,e,r)=>{const i=e.pastRounds[r];return i===void 0?null:{label:i.label,questions:i.questions.map(n=>{const a=n.answer??void 0,o=x(n,a);return{id:n.id,ref:n.ref,title:n.title,description:n.description,note:n.note,answered:o!=="",summary:o===""?t.unanswered:o,choices:re(n,a),freeText:a?.kind==="free"?a.text:null}})}},oe=(t,e)=>{switch(e.type){case"question":return f(t,e.id)!==void 0;case"page":return!0;default:return!1}},se=t=>{const e=m(t);return{name:"grill",label:"Visually Grill",parseBase:H,emptyBase:W,actions:T,apply:Y,hasTarget:oe,describe:(r,i,n)=>J(e,r,i,n),serialize:X,resolveNavigation:ee,commentTargets:r=>Z(e,r),title:V}},w="data-grill-questions",Pe=t=>{const e=[t];for(const r of t.querySelectorAll("*"))r.shadowRoot&&e.push(r.shadowRoot);return e},le=(t,e,r)=>{const i=r.question??e.questions[0]?.id??null,n=new Map(e.questions.map(o=>[o.ref,o])),a=[];for(const o of Pe(t))for(const l of o.querySelectorAll(`[${w}]`)){const k=l.getAttribute(w)??"";for(const C of k.split(/\s+/)){if(C==="")continue;const c=n.get(C);c&&a.push({index:a.length,target:l,questionId:c.id,ref:c.ref,title:c.title,answered:S(c,e.answers[c.id]),open:c.id===i})}}return a},de=(t,e)=>{const r=t.getBoundingClientRect(),i=new Map;e.forEach((a,o)=>{const l=t.querySelector(`[data-label="${o}"]`);if(!l)return;const k=i.get(a.target)??[];k.push(l),i.set(a.target,k)});const n=new Map;for(const[a,o]of i){const l=a.getBoundingClientRect(),k=l.width>0||l.height>0,c=n.get(a)??Ne(a,t);n.set(a,c);const E=l.bottom>r.top&&l.top<r.bottom&&l.right>r.left&&l.left<r.right,Q=l.bottom>c.top&&l.top<c.bottom;o.forEach((y,ge)=>{if(y.dataset.visible=String(k&&E&&Q),!k||!E||!Q)return;const A=y.offsetWidth,I=y.offsetHeight,ue=l.right-r.left-A+8-(o.length-1-ge)*(A+5),he=l.top-r.top-I/2;y.style.transform=`translate(${N(ue,0,Math.max(0,t.clientWidth-A))}px, ${N(he,0,Math.max(0,t.clientHeight-I))}px)`})}},Ne=(t,e)=>{const r=t.getRootNode(),i=r instanceof ShadowRoot?r.host:null,n=i?.shadowRoot?.querySelector(".diagram-canvas")??null;return n instanceof Element?n.getBoundingClientRect():i instanceof Element?i.getBoundingClientRect():e.getBoundingClientRect()},Ge=(t,e,r)=>s`
1
+ import{p as ve,am as N,ae as f,aj as x,ak as m,ah as c,ao as T,af as k,ap as xe,ag as q,ad as me,R as O,a0 as we,V as F,a4 as s,a5 as P,a3 as p,aq as G,a2 as ye,T as B,aL as $e,aM as Te,aN as Se}from"./shared-rZQ5j0Kh.js";import{s as Re}from"./shared-D4K7KsfJ.js";import{c as H}from"./shared-ml5h7U5L.js";const Ae=N("kind",[f({kind:T("option"),optionId:x(c(),m(1))}),f({kind:T("free"),text:c()}),f({kind:T("clear")})]),C={ANSWER_QUESTION:ve("ANSWER_QUESTION","question",Ae)},M=(t,e)=>({type:"ANSWER_QUESTION",target:{type:"question",id:t},payload:e}),qe=f({id:x(c(),m(1)),label:x(c(),m(1))}),_=f({id:x(c(),m(1)),ref:k(x(c(),m(1))),title:x(c(),m(1)),description:k(c()),note:k(c()),options:k(q(qe),[]),freeText:k(xe(),!0)}),Ce=N("kind",[f({kind:T("option"),optionId:x(c(),m(1))}),f({kind:T("free"),text:c()})]),Ee=f({..._.entries,answer:k(Ce)}),Ie=f({label:k(x(c(),m(1))),questions:q(Ee)}),U=f({title:k(c(),""),questions:q(_),history:k(q(Ie),[])}),W=t=>{const e=new Set;return t.map((r,i)=>{if(e.has(r.id))throw new Error(`duplicate question id: ${r.id}`);e.add(r.id);const n=new Set;for(const a of r.options){if(n.has(a.id))throw new Error(`duplicate option id: ${a.id} in question ${r.id}`);n.add(a.id)}return{...r,ref:r.ref??`Q${i+1}`,description:r.description??null,note:r.note??null}})},j=t=>({id:t.id,ref:t.ref,title:t.title,description:t.description,note:t.note,options:t.options,freeText:t.freeText}),Qe=t=>{const e=t.answer??null;if(e?.kind==="option"&&!t.options.some(r=>r.id===e.optionId))throw new Error(`unknown option id: ${e.optionId} in question ${t.id}`);return{...j(t),answer:e}},D=t=>{const e=me(U,t);return{title:e.title,questions:W(e.questions).map(j),answers:{},pastRounds:e.history.map((r,i)=>({label:r.label??`v${i+1}`,questions:W(r.questions).map(Qe)}))}},Y=()=>({title:"",questions:[],answers:{},pastRounds:[]}),v=(t,e)=>t.questions.find(r=>r.id===e),ze=(t,e)=>v(t,e)?.ref??e,z=(t,e)=>{const r=v(t,e);return r?`${r.ref} \xB7 ${r.title}`:e},S=(t,e)=>e?e.kind==="option"?t.options.find(r=>r.id===e.optionId)?.label??"":e.text.trim():"",E=(t,e)=>S(t,e)!=="",V=t=>{let e="";for(let r=t+1;r>0;r=Math.floor((r-1)/26))e=String.fromCharCode(97+(r-1)%26)+e;return e},K=t=>({total:t.questions.length,answered:t.questions.filter(e=>E(e,t.answers[e.id])).length}),I=(t,e,r)=>{const i=t.answers[e];if(r===null){if(i===void 0)return t;const n={...t.answers};return delete n[e],{...t,answers:n}}return i?.kind===r.kind&&(i.kind==="option"&&r.kind==="option"&&i.optionId===r.optionId||i.kind==="free"&&r.kind==="free"&&i.text===r.text)?t:{...t,answers:{...t.answers,[e]:r}}},J=(t,e)=>{if(e.type!=="ANSWER_QUESTION")return null;const r=v(t,e.target.id);if(!r)return null;const i=O(C.ANSWER_QUESTION,e);return i.kind==="clear"?I(t,r.id,null):i.kind==="option"?r.options.some(n=>n.id===i.optionId)?I(t,r.id,{kind:"option",optionId:i.optionId}):null:I(t,r.id,{kind:"free",text:i.text})},R=we({en:{wholePage:"Whole page",questionGroup:"Question",answerCleared:"Clear answer",answered:"Answer",answeredFreely:"Answer in your own words",quoted:t=>`\u2192 \u201C${t}\u201D`,progress:(t,e)=>`${t} of ${e} answered`,openPanel:"Show questions / review",closePanel:"Hide questions / review",toggleLabel:(t,e)=>`${t} (${e})`,tabs:"Questions / review",questionsTab:"Questions",reviewTab:"Review",copied:"Copied",copyFailed:"Could not copy",copyAll:"Copy answers and review",sending:"Sending\u2026",sent:"Sent to Claude",sendFailed:"Could not send",sendAll:"Send answers and review to Claude",copyDone:"Copied",copy:"Copy",noQuestions:"No matching questions.",freeText:"Your own answer",freeTextOf:t=>`Your own answer to ${t}`,freeTextPlaceholder:"Type an answer\u2026 (\u2318/Ctrl+Enter for next)",clearAnswer:"Clear answer",roundSelect:"Question round",currentRound:"Current questions",roundOption:(t,e)=>`${t} (${e})`,pastRound:t=>`${t}: earlier questions, read-only`,unanswered:"Not answered"},ja:{wholePage:"\u30DA\u30FC\u30B8\u5168\u4F53",questionGroup:"\u8CEA\u554F",answerCleared:"\u56DE\u7B54\u3092\u30AF\u30EA\u30A2",answered:"\u56DE\u7B54",answeredFreely:"\u81EA\u7531\u8A18\u8FF0\u3067\u56DE\u7B54",quoted:t=>`\u2192 \u300C${t}\u300D`,progress:(t,e)=>`\u56DE\u7B54\u6E08\u307F ${t} / ${e}`,openPanel:"\u8CEA\u554F / Review \u3092\u3072\u3089\u304F",closePanel:"\u8CEA\u554F / Review \u3092\u305F\u305F\u3080",toggleLabel:(t,e)=>`${t}\uFF08${e}\uFF09`,tabs:"\u8CEA\u554F / Review",questionsTab:"\u8CEA\u554F",reviewTab:"Review",copied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F",copyFailed:"\u30B3\u30D4\u30FC\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F",copyAll:"\u56DE\u7B54\u30FBReview \u3092\u307E\u3068\u3081\u3066\u30B3\u30D4\u30FC",sending:"\u9001\u4FE1\u4E2D\u2026",sent:"Claude \u306B\u9001\u308A\u307E\u3057\u305F",sendFailed:"\u9001\u308C\u307E\u305B\u3093\u3067\u3057\u305F",sendAll:"\u56DE\u7B54\u30FBReview \u3092 Claude \u306B\u9001\u308B",copyDone:"\u30B3\u30D4\u30FC\u6E08\u307F",copy:"\u30B3\u30D4\u30FC",noQuestions:"\u8A72\u5F53\u3059\u308B\u8CEA\u554F\u306F\u3042\u308A\u307E\u305B\u3093\u3002",freeText:"\u81EA\u7531\u8A18\u8FF0",freeTextOf:t=>`${t} \u306E\u81EA\u7531\u8A18\u8FF0`,freeTextPlaceholder:"\u56DE\u7B54\u3092\u5165\u529B\u2026\uFF08\u2318/Ctrl+Enter \u3067\u6B21\u3078\uFF09",clearAnswer:"\u56DE\u7B54\u3092\u30AF\u30EA\u30A2",roundSelect:"\u8CEA\u554F\u306E\u30E9\u30A6\u30F3\u30C9",currentRound:"\u73FE\u5728\u306E\u8CEA\u554F",roundOption:(t,e)=>`${t}\uFF08${e} \u554F\uFF09`,pastRound:t=>`${t}: \u904E\u53BB\u306E\u8CEA\u554F\uFF08\u95B2\u89A7\u306E\u307F\uFF09`,unanswered:"\u672A\u56DE\u7B54"}}),X=t=>t.title===""?"Visually Grill":t.title,Z=(t,e,r)=>{switch(r.type){case"question":return z(e,r.id);case"page":return t.wholePage;default:return r.id}},Le=(t,e,r)=>{const i=O(C.ANSWER_QUESTION,r);if(i.kind==="clear")return{title:t.answerCleared,tone:"delete"};if(i.kind==="option"){const n=v(e,r.target.id)?.options.find(a=>a.id===i.optionId);return{title:t.answered,tone:"update",body:t.quoted(n?.label??i.optionId)}}return{title:t.answeredFreely,tone:"update",body:t.quoted(i.text.slice(0,120))}},ee=(t,e,r,i)=>{let n;try{n=Le(t,i??r,e)}catch{n={title:e.type,tone:"meta"}}return{title:n.title,targetLabel:Z(t,r,e.target),tone:n.tone,...n.body===void 0?{}:{summary:n.body}}},te=t=>`${t.type} ${F(t.target)} ${JSON.stringify(t.payload)}`,re=(t,e)=>e.questions.map(r=>({value:`question:${r.id}`,label:z(e,r.id),group:t.questionGroup})),ie=(t,e)=>{const r=e.question;if(r!==void 0&&v(t,r))return e;const i=t.questions[0];return i===void 0?e:{...e,question:i.id}},ne=(t,e)=>{const r=e.question;return r!==void 0&&v(t,r)?r:t.questions[0]?.id??null},Ne=(t,e)=>{const r=t.questions,i=r.findIndex(a=>a.id===e);return(i===-1?r:[...r.slice(i+1),...r.slice(0,i)]).find(a=>!E(a,t.answers[a.id]))?.id??null},ae=(t,e)=>t.options.map((r,i)=>({id:r.id,letter:V(i),label:r.label,checked:e?.kind==="option"&&e.optionId===r.id})),Oe=(t,e,r)=>{const i=e.answers[t.id];return{id:t.id,ref:t.ref,title:t.title,description:t.description,note:t.note,open:t.id===r,answered:S(t,i)!=="",summary:S(t,i),choices:ae(t,i),draft:i?.kind==="free"?i.text:"",freeSelected:i?.kind==="free",allowFreeText:t.freeText}},oe=(t,e)=>{const r=ne(t,e);return{questions:t.questions.map(i=>Oe(i,t,r))}},se=(t,e)=>{const r=K(e);return{progress:t.progress(r.answered,r.total),answered:r.answered,total:r.total}},le=(t,e)=>e!=="current"&&t.pastRounds[e]!==void 0?e:"current",Fe=(t,e,r)=>{if(e.pastRounds.length===0)return[];const i=le(e,r),n=e.pastRounds.map((a,o)=>({value:String(o),label:t.roundOption(a.label,a.questions.length),selected:i===o}));return[{value:"current",label:t.roundOption(t.currentRound,e.questions.length),selected:i==="current"},...[...n].reverse()]},Pe=(t,e,r)=>{const i=e.pastRounds[r];return i===void 0?null:{label:i.label,questions:i.questions.map(n=>{const a=n.answer??void 0,o=S(n,a);return{id:n.id,ref:n.ref,title:n.title,description:n.description,note:n.note,answered:o!=="",summary:o===""?t.unanswered:o,choices:ae(n,a),freeText:a?.kind==="free"?a.text:null}})}},de=(t,e)=>{switch(e.type){case"question":return v(t,e.id)!==void 0;case"page":return!0;default:return!1}},pe=t=>{const e=R(t);return{name:"grill",label:"Visually Grill",parseBase:D,emptyBase:Y,actions:C,apply:J,hasTarget:de,describe:(r,i,n)=>ee(e,r,i,n),serialize:te,resolveNavigation:ie,navigationFor:(r,i)=>i.type==="question"&&v(r,i.id)?{question:i.id}:null,commentTargets:r=>re(e,r),title:X}},Ge=5,L=4,ce=8,Be=(t,e)=>{const r=e.badgeHeight,i=t.target.right+ce,n=t.target.left-ce,a=[];let o=0,l=i;for(let u=t.widths.length-1;u>=0;u-=1){const g=t.widths[u]??0;l!==i&&l-g<n&&(o+=1,l=i),a[u]={x:l-g,y:t.target.top-r/2-o*(r+L)},l-=g+Ge}return a},ge=(t,e)=>{const r=t.map(()=>[]),i=Re(t.map((a,o)=>({group:a,index:o})).filter(({group:a})=>a.gutter),[({group:a})=>a.target.top]);let n=Number.NEGATIVE_INFINITY;for(const{group:a,index:o}of i){let l=Math.max(a.target.top,n);r[o]=a.widths.map(u=>{const g={x:e.width-u,y:l};return l+=e.badgeHeight+L,g}),n=l}return{points:r,bottom:n-L}},He=(t,e)=>Math.max(0,ge(t,e).bottom),Me=(t,e)=>{const r=ge(t,e),i=Math.max(e.height,r.bottom);return t.map((n,a)=>(n.gutter?r.points[a]??[]:Be(n,e)).map((o,l)=>({x:H(o.x,0,Math.max(0,e.width-(n.widths[l]??0))),y:H(o.y,0,Math.max(0,i-e.badgeHeight))})))},A="data-grill-questions",_e=t=>{const e=[t];for(const r of t.querySelectorAll("*"))r.shadowRoot&&e.push(r.shadowRoot);return e},ue=(t,e,r)=>{const i=r.question??e.questions[0]?.id??null,n=new Map(e.questions.map(o=>[o.ref,o])),a=[];for(const o of _e(t))for(const l of o.querySelectorAll(`[${A}]`)){const u=l.getAttribute(A)??"";for(const g of u.split(/\s+/)){if(g==="")continue;const h=n.get(g);h&&a.push({index:a.length,target:l,questionId:h.id,ref:h.ref,title:h.title,answered:E(h,e.answers[h.id]),open:h.id===i})}}return a},he=(t,e)=>{const r=t.getBoundingClientRect(),i=t.getRootNode(),n=i instanceof ShadowRoot?i.host:null,a=new Map;e.forEach((b,w)=>{const d=t.querySelector(`[data-label="${w}"]`);if(!d)return;const y=a.get(b.target)??[];y.push(d),a.set(b.target,y)});const o=[];for(const[b,w]of a){const d=b.getBoundingClientRect(),y=Ue(b,t),$=(d.width>0||d.height>0)&&d.bottom>r.top&&d.top<r.bottom&&d.right>r.left&&d.left<r.right&&d.bottom>y.top&&d.top<y.bottom;for(const Q of w)Q.dataset.visible=String($);$&&o.push({buttons:w,group:{target:{left:d.left-r.left,top:d.top-r.top,right:d.right-r.left,bottom:d.bottom-r.top},widths:w.map(Q=>Q.offsetWidth),gutter:n?.contains(b)===!0}})}const l=o[0]?.buttons[0]?.offsetHeight??0,u=o.map(({group:b})=>b),g={width:t.clientWidth,height:t.clientHeight,badgeHeight:l},h=He(u,g);t.parentElement&&(t.parentElement.style.minHeight=h>0?`${Math.ceil(h)}px`:"");const ke=Me(u,{...g,height:Math.max(g.height,h)});o.forEach(({buttons:b},w)=>{b.forEach((d,y)=>{const $=ke[w]?.[y];$&&(d.style.transform=`translate(${$.x}px, ${$.y}px)`)})})},Ue=(t,e)=>{const r=t.getRootNode(),i=r instanceof ShadowRoot?r.host:null,n=i?.shadowRoot?.querySelector(".diagram-canvas")??null;return n instanceof Element?n.getBoundingClientRect():i instanceof Element?i.getBoundingClientRect():e.getBoundingClientRect()},We=(t,e,r)=>s`
2
2
  <div class="grill-list">
3
- ${e.questions.length===0?s`<p class="grill-empty">${t.noQuestions}</p>`:F(e.questions,i=>i.id,i=>Be(t,i,r))}
3
+ ${e.questions.length===0?s`<p class="grill-empty">${t.noQuestions}</p>`:P(e.questions,i=>i.id,i=>je(t,i,r))}
4
4
  </div>
5
- `,Be=(t,e,r)=>s`
6
- <section class="grill-question" data-question=${e.id} data-answered=${String(e.answered)}>
5
+ `,je=(t,e,r)=>s`
6
+ <section
7
+ class="grill-question"
8
+ data-question=${e.id}
9
+ data-answered=${String(e.answered)}
10
+ data-dpk-target=${F({type:"question",id:e.id})}
11
+ >
7
12
  <button
8
13
  class="grill-heading"
9
14
  type="button"
@@ -14,15 +19,15 @@ import{p as be,al as L,ad as g,ai as h,aj as b,ag as p,an as v,ae as u,ao as fe,
14
19
  <span class="grill-ref">${e.ref}</span>
15
20
  <span class="grill-heading-text">
16
21
  <strong>${e.title}</strong>
17
- ${!e.open&&e.answered?s`<span class="grill-summary">${e.summary}</span>`:d}
22
+ ${!e.open&&e.answered?s`<span class="grill-summary">${e.summary}</span>`:p}
18
23
  </span>
19
- <span class="grill-chevron" aria-hidden="true">${O()}</span>
24
+ <span class="grill-chevron" aria-hidden="true">${G()}</span>
20
25
  </button>
21
26
  ${e.open?s`<div class="grill-body" id=${`grill-body-${e.id}`}>
22
- ${e.description?s`<p class="grill-description">${e.description}</p>`:d}
23
- ${e.note?s`<p class="grill-note">${e.note}</p>`:d}
27
+ ${e.description?s`<p class="grill-description">${e.description}</p>`:p}
28
+ ${e.note?s`<p class="grill-note">${e.note}</p>`:p}
24
29
  <div class="grill-choices" role="radiogroup" aria-label=${e.title}>
25
- ${e.choices.map(i=>_e(e.id,i,r))}
30
+ ${e.choices.map(i=>De(e.id,i,r))}
26
31
  ${e.allowFreeText?s`<label class="grill-choice grill-choice--free" data-free=${String(e.freeSelected)}>
27
32
  <input
28
33
  type="radio"
@@ -32,7 +37,7 @@ import{p as be,al as L,ad as g,ai as h,aj as b,ag as p,an as v,ae as u,ao as fe,
32
37
  @change=${()=>r.answer(e.id,{kind:"free",text:""})}
33
38
  />
34
39
  <span class="grill-choice-text">${t.freeText}</span>
35
- </label>`:d}
40
+ </label>`:p}
36
41
  </div>
37
42
  ${e.allowFreeText?s`<textarea
38
43
  class="dpk-textarea grill-free"
@@ -43,17 +48,17 @@ import{p as be,al as L,ad as g,ai as h,aj as b,ag as p,an as v,ae as u,ao as fe,
43
48
  ?hidden=${!e.freeSelected}
44
49
  @input=${i=>{const n=i.currentTarget;n instanceof HTMLTextAreaElement&&r.answer(e.id,{kind:"free",text:n.value})}}
45
50
  @keydown=${i=>{i.isComposing||!(i.metaKey||i.ctrlKey)||i.key!=="Enter"||(i.preventDefault(),r.next(e.id))}}
46
- ></textarea>`:d}
51
+ ></textarea>`:p}
47
52
  ${e.answered?s`<button
48
53
  type="button"
49
54
  class="grill-clear"
50
55
  @click=${()=>r.answer(e.id,{kind:"clear"})}
51
56
  >
52
57
  ${t.clearAnswer}
53
- </button>`:d}
54
- </div>`:d}
58
+ </button>`:p}
59
+ </div>`:p}
55
60
  </section>
56
- `,_e=(t,e,r)=>s`
61
+ `,De=(t,e,r)=>s`
57
62
  <label class="grill-choice" data-choice=${e.id}>
58
63
  <input
59
64
  type="radio"
@@ -67,12 +72,12 @@ import{p as be,al as L,ad as g,ai as h,aj as b,ag as p,an as v,ae as u,ao as fe,
67
72
  <span>${e.label}</span>
68
73
  </span>
69
74
  </label>
70
- `,Me=(t,e)=>s`
75
+ `,Ye=(t,e)=>s`
71
76
  <div class="grill-list">
72
77
  <p class="grill-round-note">${t.pastRound(e.label)}</p>
73
- ${e.questions.length===0?s`<p class="grill-empty">${t.noQuestions}</p>`:F(e.questions,r=>r.id,r=>Ue(r))}
78
+ ${e.questions.length===0?s`<p class="grill-empty">${t.noQuestions}</p>`:P(e.questions,r=>r.id,r=>Ve(r))}
74
79
  </div>
75
- `,Ue=t=>s`
80
+ `,Ve=t=>s`
76
81
  <details
77
82
  class="grill-question grill-question--past"
78
83
  data-question=${t.id}
@@ -84,21 +89,21 @@ import{p as be,al as L,ad as g,ai as h,aj as b,ag as p,an as v,ae as u,ao as fe,
84
89
  <strong>${t.title}</strong>
85
90
  <span class="grill-summary">${t.summary}</span>
86
91
  </span>
87
- <span class="grill-chevron" aria-hidden="true">${O()}</span>
92
+ <span class="grill-chevron" aria-hidden="true">${G()}</span>
88
93
  </summary>
89
94
  <div class="grill-body">
90
- ${t.description?s`<p class="grill-description">${t.description}</p>`:d}
91
- ${t.note?s`<p class="grill-note">${t.note}</p>`:d}
92
- ${t.choices.length===0?d:s`<ul class="grill-past-choices">
95
+ ${t.description?s`<p class="grill-description">${t.description}</p>`:p}
96
+ ${t.note?s`<p class="grill-note">${t.note}</p>`:p}
97
+ ${t.choices.length===0?p:s`<ul class="grill-past-choices">
93
98
  ${t.choices.map(e=>s`<li class="grill-past-choice" data-checked=${String(e.checked)}>
94
99
  <span class="grill-letter">(${e.letter})</span>
95
100
  <span>${e.label}</span>
96
101
  </li>`)}
97
102
  </ul>`}
98
- ${t.freeText===null?d:s`<p class="grill-past-choice grill-past-free" data-checked="true">${t.freeText}</p>`}
103
+ ${t.freeText===null?p:s`<p class="grill-past-choice grill-past-free" data-checked="true">${t.freeText}</p>`}
99
104
  </div>
100
105
  </details>
101
- `,He=me`
106
+ `,Ke=ye`
102
107
  /*
103
108
  * The rail and its hand-off only work inside a bounded shell. A page that gives
104
109
  * the host no height (no \`height: 100%\` up the chain) would grow the shell to
@@ -140,6 +145,23 @@ import{p as be,al as L,ad as g,ai as h,aj as b,ag as p,an as v,ae as u,ao as fe,
140
145
  display: none;
141
146
  }
142
147
 
148
+ /* A phone has no room for the main area beside the questions: they open
149
+ over it, and the corner control folds them away to show it. */
150
+ @media (max-width: 760px) {
151
+ .dpk-sidebar {
152
+ position: absolute;
153
+ inset: 0;
154
+ z-index: 25;
155
+ width: auto;
156
+ max-width: none;
157
+ border-left: 0;
158
+ }
159
+
160
+ .dpk-sidebar-resizer {
161
+ display: none;
162
+ }
163
+ }
164
+
143
165
  .grill-tab-panel dpk-component-comment-panel {
144
166
  flex: 1;
145
167
  }
@@ -789,6 +811,12 @@ import{p as be,al as L,ad as g,ai as h,aj as b,ag as p,an as v,ae as u,ao as fe,
789
811
  min-width: 0;
790
812
  }
791
813
 
814
+ /* Badges on the author's own markup stand in a column of their own on the
815
+ right, beside the line they mark, so they never cover its words. */
816
+ .grill-stage[data-gutter] {
817
+ padding-right: 48px;
818
+ }
819
+
792
820
  /* The author's own markup lands in slot="main": nudge its prose toward the
793
821
  kit's own type scale, so the diagrams it wraps don't feel bolted on. */
794
822
  .grill-stage ::slotted(h1),
@@ -865,7 +893,7 @@ import{p as be,al as L,ad as g,ai as h,aj as b,ag as p,an as v,ae as u,ao as fe,
865
893
  outline: none;
866
894
  box-shadow: var(--dpk-focus);
867
895
  }
868
- `;class pe extends P{static{this.styles=[P.styles,He]}get sidebarLayout(){return{side:"right",defaultWidth:336,collapsible:!1}}definitionFor(e){return se(e)}static{this.properties={tab:{state:!0},folded:{state:!0},round:{state:!0}}}#o=[];#s=!1;#a=null;#l=null;#r=null;#e="idle";#i=null;#n={kind:"idle"};constructor(){super(),this.tab="questions",this.folded=!1,this.round="current"}connectedCallback(){super.connectedCallback(),document.addEventListener("scroll",this.#t,!0),window.addEventListener("resize",this.#t),this.addEventListener("dpk-diagram-view",this.#t)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("scroll",this.#t,!0),window.removeEventListener("resize",this.#t),this.removeEventListener("dpk-diagram-view",this.#t),this.#r?.disconnect(),this.#r=null,this.#d()}renderRegions(e){return this.#o=le(this,e.state,e.navigation),{header:this.#b(e),main:this.#m(e,this.#o),sidebar:this.#f(e),sidebarHidden:this.folded}}updated(){super.updated(),this.#T(),this.#t(),this.#S();const e=this.#l;e!==null&&(this.#l=null,this.renderRoot.querySelector(`[data-free-text="${e}"]`)?.focus())}get integratedReview(){return!0}requestComment(e){this.tab="review",this.folded=!1,super.requestComment(e)}#p(e,r){this.tab="questions",this.folded=!1,this.round="current",this.#a=null,e.navigate({question:r})}#b(e){const r=m(this.locale),i=ne(r,e.state),n=r.toggleLabel(this.folded?r.openPanel:r.closePanel,i.progress);return s`
896
+ `;class be extends B{static{this.styles=[B.styles,Ke]}get sidebarLayout(){return{side:"right",defaultWidth:336,collapsible:!1}}definitionFor(e){return pe(e)}static{this.properties={tab:{state:!0},folded:{state:!0},round:{state:!0}}}#o=[];#s=!1;#a=null;#l=null;#r=null;#e="idle";#i=null;#n={kind:"idle"};constructor(){super(),this.tab="questions",this.folded=!1,this.round="current"}connectedCallback(){super.connectedCallback(),document.addEventListener("scroll",this.#t,!0),window.addEventListener("resize",this.#t),this.addEventListener("dpk-diagram-view",this.#t)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("scroll",this.#t,!0),window.removeEventListener("resize",this.#t),this.removeEventListener("dpk-diagram-view",this.#t),this.#r?.disconnect(),this.#r=null,this.#d()}renderRegions(e){return this.#o=ue(this,e.state,e.navigation),{header:this.#b(e),main:this.#m(e,this.#o),sidebar:this.#f(e),sidebarHidden:this.folded}}updated(){super.updated(),this.#T(),this.#t(),this.#S();const e=this.#l;e!==null&&(this.#l=null,this.renderRoot.querySelector(`[data-free-text="${e}"]`)?.focus())}get integratedReview(){return!0}requestComment(e){this.tab="review",this.folded=!1,super.requestComment(e)}showTarget(e){e.type==="question"&&(this.tab="questions",this.folded=!1,this.round="current")}#p(e,r){this.tab="questions",this.folded=!1,this.round="current",this.#a=null,e.navigate({question:r})}#b(e){const r=R(this.locale),i=se(r,e.state),n=r.toggleLabel(this.folded?r.openPanel:r.closePanel,i.progress);return s`
869
897
  <button
870
898
  type="button"
871
899
  class="grill-toggle"
@@ -877,7 +905,7 @@ import{p as be,al as L,ad as g,ai as h,aj as b,ag as p,an as v,ae as u,ao as fe,
877
905
  <span class="grill-toggle-glyph" aria-hidden="true">?</span>
878
906
  <span class="grill-toggle-badge" aria-hidden="true">${i.answered} / ${i.total}</span>
879
907
  </button>
880
- `}#f(e){const r=m(this.locale),i=ae(e.state,this.round),n=Fe(r,e.state,i),a=i==="current"?null:Oe(r,e.state,i);return s`
908
+ `}#f(e){const r=R(this.locale),i=le(e.state,this.round),n=Fe(r,e.state,i),a=i==="current"?null:Pe(r,e.state,i);return s`
881
909
  <div class="grill-panel">
882
910
  <div class="grill-tabs" role="tablist" aria-label=${r.tabs}>
883
911
  ${["questions","review"].map(o=>o==="questions"&&n.length>0?this.#v(r,n):s`
@@ -905,7 +933,7 @@ import{p as be,al as L,ad as g,ai as h,aj as b,ag as p,an as v,ae as u,ao as fe,
905
933
  aria-labelledby="grill-tab-questions"
906
934
  ?hidden=${this.tab!=="questions"}
907
935
  >
908
- ${a===null?Ge(r,ie(e.state,e.navigation),{open:o=>this.#p(e,o),answer:(o,l)=>this.#w(o,l),next:o=>this.#g(o)}):Me(r,a)}
936
+ ${a===null?We(r,oe(e.state,e.navigation),{open:o=>this.#p(e,o),answer:(o,l)=>this.#w(o,l),next:o=>this.#g(o)}):Ye(r,a)}
909
937
  </div>
910
938
  <div
911
939
  class="grill-tab-panel"
@@ -918,7 +946,7 @@ import{p as be,al as L,ad as g,ai as h,aj as b,ag as p,an as v,ae as u,ao as fe,
918
946
  </div>
919
947
  ${this.#k(e.actions.length===0)}
920
948
  </div>
921
- `}#k(e){const r=m(this.locale),i=this.#e==="copied"?r.copied:this.#e==="failed"?r.copyFailed:r.copyAll;if(!this.canSendToClaude)return s`
949
+ `}#k(e){const r=R(this.locale),i=this.#e==="copied"?r.copied:this.#e==="failed"?r.copyFailed:r.copyAll;if(!this.canSendToClaude)return s`
922
950
  <div class="grill-footer">
923
951
  <button
924
952
  class="dpk-btn dpk-btn--accent grill-copy"
@@ -931,7 +959,7 @@ import{p as be,al as L,ad as g,ai as h,aj as b,ag as p,an as v,ae as u,ao as fe,
931
959
  </button>
932
960
  <span class="grill-sr" role="status">${this.#e==="idle"?"":i}</span>
933
961
  </div>
934
- `;const n=this.#n,a=n.kind==="pending"?r.sending:n.kind==="sent"?r.sent:n.kind==="failed"?r.sendFailed:r.sendAll,o=n.kind==="failed"?we(n.reason,this.locale):null,l=o??(n.kind==="sent"?a:this.#e==="idle"?"":i);return s`
962
+ `;const n=this.#n,a=n.kind==="pending"?r.sending:n.kind==="sent"?r.sent:n.kind==="failed"?r.sendFailed:r.sendAll,o=n.kind==="failed"?$e(n.reason,this.locale):null,l=o??(n.kind==="sent"?a:this.#e==="idle"?"":i);return s`
935
963
  <div class="grill-footer">
936
964
  <div class="grill-footer-actions">
937
965
  <button
@@ -960,8 +988,8 @@ import{p as be,al as L,ad as g,ai as h,aj as b,ag as p,an as v,ae as u,ao as fe,
960
988
  `}#v(e,r){const i=this.tab==="questions",n=s`
961
989
  <select
962
990
  class="grill-round"
963
- id=${i?"grill-tab-questions":d}
964
- data-tab=${i?"questions":d}
991
+ id=${i?"grill-tab-questions":p}
992
+ data-tab=${i?"questions":p}
965
993
  aria-label=${e.roundSelect}
966
994
  aria-controls="grill-panel-questions"
967
995
  ?disabled=${!i}
@@ -972,7 +1000,7 @@ import{p as be,al as L,ad as g,ai as h,aj as b,ag as p,an as v,ae as u,ao as fe,
972
1000
  `;return s`
973
1001
  <div class="grill-round-tab" data-selected=${String(i)}>
974
1002
  ${n}
975
- ${i?d:s`<button
1003
+ ${i?p:s`<button
976
1004
  type="button"
977
1005
  role="tab"
978
1006
  class="grill-round-switch"
@@ -987,7 +1015,7 @@ import{p as be,al as L,ad as g,ai as h,aj as b,ag as p,an as v,ae as u,ao as fe,
987
1015
  ></button>`}
988
1016
  </div>
989
1017
  `}#x(e){const r=e.currentTarget;r instanceof HTMLSelectElement&&(this.tab="questions",this.round=r.value==="current"?"current":Number(r.value),this.#a=null)}#c(e){if(!["ArrowLeft","ArrowRight","Home","End"].includes(e.key))return;e.preventDefault(),this.tab=e.key==="Home"?"questions":e.key==="End"||this.tab==="questions"?"review":"questions";const r=this.tab;this.updateComplete.then(()=>this.renderRoot.querySelector(`[data-tab="${r}"]`)?.focus())}#m(e,r){return s`
990
- <div class="grill-stage">
1018
+ <div class="grill-stage" ?data-gutter=${r.some(i=>this.contains(i.target))}>
991
1019
  <slot name="main"></slot>
992
1020
  <div class="grill-labels">
993
1021
  ${r.map(i=>s`
@@ -1007,4 +1035,4 @@ import{p as be,al as L,ad as g,ai as h,aj as b,ag as p,an as v,ae as u,ao as fe,
1007
1035
  `)}
1008
1036
  </div>
1009
1037
  </div>
1010
- `}#w(e,r){if(this.dispatch(G(e,r)).ok){if(r.kind==="option"){this.#g(e);return}r.kind==="free"&&r.text===""&&(this.#l=e)}}#g(e){const r=Le(this.derivation.state,e);r!==null&&this.navigate({question:r})}async#u(){const e=this.api.exportBrief(),r=await ye(e);this.#d(),this.#e=r?"copied":"failed",this.#h()}async#y(){this.#d(),this.#n={kind:"pending"},this.requestUpdate();const e=await this.sendToClaude();this.#n=e.ok?{kind:"sent"}:{kind:"failed",reason:e.reason},e.ok?this.#h():this.requestUpdate()}#h(){this.requestUpdate(),this.#i=setTimeout(()=>{this.#i=null,this.#e="idle",this.#n={kind:"idle"},this.requestUpdate()},2400)}#d(){this.#i!==null&&clearTimeout(this.#i),this.#i=null,this.#e="idle",this.#n={kind:"idle"}}#$(){this.requestUpdate()}#T(){this.#r?.disconnect(),this.#r??=new MutationObserver(()=>{this.#$(),this.#t()}),this.#r.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[w]});for(const e of this.querySelectorAll("*"))e===this||!e.shadowRoot||this.#r.observe(e.shadowRoot,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[w]})}#t=()=>{this.#s||(this.#s=!0,requestAnimationFrame(()=>{this.#s=!1;const e=this.renderRoot.querySelector(".grill-labels");e&&de(e,this.#o)}))};#S(){const e=this.navigation.question??null;if(this.tab!=="questions"||this.round!=="current"||this.folded||e===null||e===this.#a)return;this.#a=e;const r=this.renderRoot.querySelector(`[data-question="${e}"]`),i=r?.closest(".grill-list");r&&i&&Te(i,r)}}const ce=()=>{customElements.get("dpk-template-grill")||customElements.define("dpk-template-grill",pe)},We=Object.freeze(Object.defineProperty({__proto__:null,DpkTemplateGrill:pe,GRILL_QUESTIONS_ATTRIBUTE:w,answerCounts:D,answerQuestion:G,answerText:x,applyGrillAction:Y,collectLabelBindings:le,defineGrillElement:ce,describeGrillAction:J,emptyGrillBase:W,findQuestion:f,grillActions:T,grillBaseSchema:_,grillCommentTargets:Z,grillDefinitionFor:se,grillHasTarget:oe,grillMessages:m,grillTargetLabel:K,grillTitle:V,isAnswered:S,openQuestionId:te,optionLetter:j,parseGrillBase:H,positionLabels:de,presentGrillHeader:ne,presentGrillPanel:ie,questionLabel:q,questionRef:Qe,resolveGrillNavigation:ee,serializeGrillAction:X,withAnswer:R},Symbol.toStringTag,{value:"Module"}));export{ce as d,We as i};
1038
+ `}#w(e,r){if(this.dispatch(M(e,r)).ok){if(r.kind==="option"){this.#g(e);return}r.kind==="free"&&r.text===""&&(this.#l=e)}}#g(e){const r=Ne(this.derivation.state,e);r!==null&&this.navigate({question:r})}async#u(){const e=this.api.exportBrief(),r=await Te(e);this.#d(),this.#e=r?"copied":"failed",this.#h()}async#y(){this.#d(),this.#n={kind:"pending"},this.requestUpdate();const e=await this.sendToClaude();this.#n=e.ok?{kind:"sent"}:{kind:"failed",reason:e.reason},e.ok?this.#h():this.requestUpdate()}#h(){this.requestUpdate(),this.#i=setTimeout(()=>{this.#i=null,this.#e="idle",this.#n={kind:"idle"},this.requestUpdate()},2400)}#d(){this.#i!==null&&clearTimeout(this.#i),this.#i=null,this.#e="idle",this.#n={kind:"idle"}}#$(){this.requestUpdate()}#T(){this.#r?.disconnect(),this.#r??=new MutationObserver(()=>{this.#$(),this.#t()}),this.#r.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[A]});for(const e of this.querySelectorAll("*"))e===this||!e.shadowRoot||this.#r.observe(e.shadowRoot,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[A]})}#t=()=>{this.#s||(this.#s=!0,requestAnimationFrame(()=>{this.#s=!1;const e=this.renderRoot.querySelector(".grill-labels");e&&he(e,this.#o)}))};#S(){const e=this.navigation.question??null;if(this.tab!=="questions"||this.round!=="current"||this.folded||e===null||e===this.#a)return;this.#a=e;const r=this.renderRoot.querySelector(`[data-question="${e}"]`),i=r?.closest(".grill-list");r&&i&&Se(i,r)}}const fe=()=>{customElements.get("dpk-template-grill")||customElements.define("dpk-template-grill",be)},Je=Object.freeze(Object.defineProperty({__proto__:null,DpkTemplateGrill:be,GRILL_QUESTIONS_ATTRIBUTE:A,answerCounts:K,answerQuestion:M,answerText:S,applyGrillAction:J,collectLabelBindings:ue,defineGrillElement:fe,describeGrillAction:ee,emptyGrillBase:Y,findQuestion:v,grillActions:C,grillBaseSchema:U,grillCommentTargets:re,grillDefinitionFor:pe,grillHasTarget:de,grillMessages:R,grillTargetLabel:Z,grillTitle:X,isAnswered:E,openQuestionId:ne,optionLetter:V,parseGrillBase:D,positionLabels:he,presentGrillHeader:se,presentGrillPanel:oe,questionLabel:z,questionRef:ze,resolveGrillNavigation:ie,serializeGrillAction:te,withAnswer:I},Symbol.toStringTag,{value:"Module"}));export{fe as d,Je as i};