dev-process-kit 0.0.16 → 0.0.18
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.
- package/dist/chunks/{shared-B0kk4Png.js → shared-8NAMqG0U.js} +1 -1
- package/dist/chunks/{shared-DLpKWOi6.js → shared-B00JP4in.js} +1 -1
- package/dist/chunks/shared-B5lBiq5s.js +1 -0
- package/dist/chunks/{shared-56aw61Mt.js → shared-BtN-8ibq.js} +1 -1
- package/dist/chunks/{shared-CYcKSitA.js → shared-C6QYWD8M.js} +3 -3
- package/dist/chunks/{shared-CHPc3-vO.js → shared-CUPe-wfx.js} +1 -1
- package/dist/chunks/{shared-BMyu-cIr.js → shared-CWKqlSx3.js} +1 -1
- package/dist/chunks/shared-CpTDkEui.js +3751 -0
- package/dist/chunks/shared-CtHWU02m.js +1 -0
- package/dist/chunks/{shared-6yS1zZwk.js → shared-DEjjuQMh.js} +1 -1
- package/dist/chunks/{shared-DlMlDHZ3.js → shared-DRvgJdY6.js} +1 -1
- package/dist/chunks/{shared-DFT6VIi_.js → shared-DWY93NpU.js} +1 -1
- package/dist/chunks/{shared-C1OgX-P6.js → shared-DXaIVZ_z.js} +56 -56
- package/dist/chunks/{shared-BqyO8tFt.js → shared-DzxR5Yzc.js} +1 -1
- package/dist/chunks/{shared-wOFcYu2a.js → shared-Ezic-gbC.js} +1 -1
- package/dist/chunks/{shared-BYBLt-RG.js → shared-IQ2sflGo.js} +1 -1
- package/dist/components.js +1 -1
- package/dist/index.js +1 -1
- package/dist/templates/delegation-poker.js +1 -1
- package/dist/templates/event-storming.js +1 -1
- package/dist/templates/example-mapping.js +1 -1
- package/dist/templates/grill.js +1 -1
- package/dist/templates/plain.js +1 -1
- package/dist/templates/prototype.js +1 -1
- package/dist/templates/slides.js +1 -1
- package/dist/templates/task-board.js +1 -1
- package/dist/templates/usm.js +1 -1
- package/dist/templates/whiteboard.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/shared-DdefS1nG.js +0 -1
- package/dist/chunks/shared-DewUyNUX.js +0 -2245
- package/dist/chunks/shared-sTu0Wlge.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a0 as w,ad as v,ae as s,af as o,ag as _,ah as l,aA as j,aj as B,ak as E,V as $,T as k}from"./shared-
|
|
1
|
+
import{a0 as w,ad as v,ae as s,af as o,ag as _,ah as l,aA as j,aj as B,ak as E,V as $,T as k}from"./shared-DXaIVZ_z.js";const r=w({en:{wholePage:"Whole page",sectionGroup:"Section"},ja:{wholePage:"\u30DA\u30FC\u30B8\u5168\u4F53",sectionGroup:"\u30BB\u30AF\u30B7\u30E7\u30F3"}}),x=s({id:j,title:B(l(),E(1))}),c=s({title:o(l(),""),sections:o(_(x),[])}),p=t=>{const e=v(c,t),a=new Set;for(const n of e.sections){if(a.has(n.id))throw new Error(`duplicate section id: ${n.id}`);a.add(n.id)}return{title:e.title,sections:e.sections}},d=()=>({title:"",sections:[]}),i=(t,e)=>t.sections.find(a=>a.id===e),m=t=>t.title===""?"Plain":t.title,u=(t,e,a)=>{switch(a.type){case"section":return i(e,a.id)?.title??a.id;case"page":return t.wholePage;default:return a.id}},g=(t,e,a)=>({title:e.type,targetLabel:u(t,a,e.target),tone:"meta"}),f=t=>`${t.type} ${$(t.target)} ${JSON.stringify(t.payload)}`,h=(t,e)=>e.sections.map(a=>({value:`section:${a.id}`,label:a.title,group:t.sectionGroup})),y=(t,e)=>e,P=(t,e)=>{switch(e.type){case"section":return i(t,e.id)!==void 0;case"page":return!0;default:return!1}},b=t=>{const e=r(t);return{name:"plain",label:"Plain",parseBase:p,emptyBase:d,actions:{},apply:()=>null,hasTarget:P,describe:(a,n)=>g(e,a,n),serialize:f,resolveNavigation:y,commentTargets:a=>h(e,a),title:m}};class T extends k{definitionFor(e){return b(e)}renderRegions(e){return{}}}const S=()=>{customElements.get("dpk-template-plain")||customElements.define("dpk-template-plain",T)},O=Object.freeze(Object.defineProperty({__proto__:null,DpkTemplatePlain:T,definePlainElement:S,describePlainAction:g,emptyPlainBase:d,findSection:i,parsePlainBase:p,plainBaseSchema:c,plainCommentTargets:h,plainDefinitionFor:b,plainHasTarget:P,plainMessages:r,plainTargetLabel:u,plainTitle:m,resolvePlainNavigation:y,serializePlainAction:f},Symbol.toStringTag,{value:"Module"}));export{S as d,O as i};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{am as Ut,ae as P,aA as xe,af as f,ah as x,ao as te,ai as T,aj as z,ak as B,b7 as oe,al as ne,ax as Fe,ad as Zt,ag as Pe,aB as U,p as g,au as $,v as Be,az as Xt,P as He,e as Gt,a0 as Vt,V as I,l as We,aU as _,b8 as Yt,b9 as jt,a3 as b,a5 as Jt,a4 as h,a7 as ye,a6 as Qt,J as eo,A as to,K as oo,aE as no,ar as io,a2 as ro,T as Ke,a1 as so,a9 as ao,h as co}from"./shared-C1OgX-P6.js";import{r as lo,p as ho,c as po}from"./shared-56aw61Mt.js";import{c as ke}from"./shared-ml5h7U5L.js";const uo=[["rect",{x:"8",y:"8",width:"8",height:"8",rx:"2"}],["path",{d:"M4 10a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2"}],["path",{d:"M14 20a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2"}]],bo=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17"}]],fo=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2"}]],mo=[["rect",{x:"14",y:"14",width:"8",height:"8",rx:"2"}],["rect",{x:"2",y:"2",width:"8",height:"8",rx:"2"}],["path",{d:"M7 14v1a2 2 0 0 0 2 2h1"}],["path",{d:"M14 7h1a2 2 0 0 1 2 2v1"}]],wo=[["circle",{cx:"19",cy:"5",r:"2"}],["circle",{cx:"5",cy:"19",r:"2"}],["path",{d:"M5 17A12 12 0 0 1 17 5"}]];function qe(t){if(t.length===0)return NaN;const e=t.slice().sort((n,i)=>n-i),o=Math.floor(e.length/2);return e.length%2===0?(e[o-1]+e[o])/2:e[o]}const ie=["yellow","orange","pink","purple","blue","green","gray"],Ue=["rect","ellipse"],xo=["sticky","text","shape","frame"],re=["small","medium","large","xlarge"],se="medium",Ze=["arrow","line"],Z=["straight","elbow","curve"],X=24,C={sticky:{w:160,h:160},text:{w:240,h:48},shape:{w:180,h:110},frame:{w:640,h:420}},H={sticky:"yellow",shape:"blue",frame:"gray"},Xe=z(ne(),oe()),R=z(ne(),oe(),Fe(X)),ge=T(ie),ve=f(T(re),se),ae={id:xe,x:Xe,y:Xe},yo=P({...ae,kind:te("sticky"),w:f(R,C.sticky.w),h:f(R,C.sticky.h),text:f(x(),""),color:f(ge,H.sticky),fontSize:ve}),ko=P({...ae,kind:te("text"),w:f(R,C.text.w),h:f(R,C.text.h),text:f(x(),""),fontSize:ve}),go=P({...ae,kind:te("shape"),shape:f(T(Ue),"rect"),w:f(R,C.shape.w),h:f(R,C.shape.h),text:f(x(),""),color:f(ge,H.shape),fontSize:ve}),vo=P({...ae,kind:te("frame"),w:R,h:R,title:z(x(),B(1)),color:f(ge,H.frame)}),Ge=Ut("kind",[yo,ko,go,vo]),$o=P({id:xe,from:z(x(),B(1)),to:z(x(),B(1)),label:U(x()),style:f(T(Ze),"arrow"),route:f(T(Z),"straight")}),Ve=P({title:U(x()),items:f(Pe(Ge),[]),connectors:f(Pe($o),[])}),Ye=t=>{const e=Zt(Ve,t),o=new Set;for(const{id:i}of[...e.items,...e.connectors]){if(o.has(i))throw new Error(`duplicate id "${i}" (items and connectors share one id space)`);o.add(i)}const n=new Set(e.items.map(i=>i.id));for(const i of e.connectors){if(!n.has(i.from))throw new Error(`unknown item "${i.from}" in connector "${i.id}"`);if(!n.has(i.to))throw new Error(`unknown item "${i.to}" in connector "${i.id}"`);if(i.from===i.to)throw new Error(`connector "${i.id}" connects an item to itself`)}return e},je=()=>({items:[],connectors:[]}),p=(t,e)=>{if(e!==void 0)return t.items.find(o=>o.id===e)},y=(t,e)=>{if(e!==void 0)return t.connectors.find(o=>o.id===e)},Je=t=>[...t.items.map(e=>e.id),...t.connectors.map(e=>e.id)],L=t=>t.kind==="frame"?t.title:t.text,$e=t=>t.kind!=="text",G=t=>t.kind!=="frame",de=t=>t.w*t.h,Eo=(t,e,o)=>e>=t.x&&e<=t.x+t.w&&o>=t.y&&o<=t.y+t.h,D=(t,e)=>{const o=e.x+e.w/2,n=e.y+e.h/2;let i;for(const r of t.items)r.kind!=="frame"||r.id===e.id||e.kind==="frame"&&de(r)<=de(e)||Eo(r,o,n)&&(i===void 0||de(r)<de(i))&&(i=r);return i},Ee=(t,e)=>{const o=[],n=i=>{let r=D(t,i);for(;r!==void 0;){if(r.id===e.id)return!0;r=D(t,r)}return!1};for(const i of t.items)i.id!==e.id&&n(i)&&o.push(i);return o},Qe=z(ne(),oe()),et=z(ne(),oe(),Fe(X)),Te={type:"page",id:"whiteboard"},ce={ADD_ITEM:g("ADD_ITEM","page",Ge,{dedupeKey:Be}),SET_ITEM_TEXT:g("SET_ITEM_TEXT","item",$({text:x()})),MOVE_ITEM:g("MOVE_ITEM","item",$({x:Qe,y:Qe})),RESIZE_ITEM:g("RESIZE_ITEM","item",$({w:et,h:et})),SET_ITEM_COLOR:g("SET_ITEM_COLOR","item",$({color:T(ie)})),SET_ITEM_FONT_SIZE:g("SET_ITEM_FONT_SIZE","item",$({fontSize:T(re)})),REORDER_ITEM:g("REORDER_ITEM","item",$({after:Xt(z(x(),B(1)))})),DELETE_ITEM:g("DELETE_ITEM","item",$({})),CONNECT_ITEMS:g("CONNECT_ITEMS","page",$({id:xe,from:z(x(),B(1)),to:z(x(),B(1)),label:U(x()),style:U(T(Ze)),route:U(T(Z))}),{dedupeKey:Be}),SET_CONNECTOR_LABEL:g("SET_CONNECTOR_LABEL","connector",$({label:x()})),SET_CONNECTOR_ROUTE:g("SET_CONNECTOR_ROUTE","connector",$({route:T(Z)})),DELETE_CONNECTOR:g("DELETE_CONNECTOR","connector",$({}))},F=t=>({type:"item",id:t}),k={addItem:t=>({type:"ADD_ITEM",target:Te,payload:t}),setText:(t,e)=>({type:"SET_ITEM_TEXT",target:F(t),payload:{text:e}}),move:(t,e,o)=>({type:"MOVE_ITEM",target:F(t),payload:{x:e,y:o}}),resize:(t,e,o)=>({type:"RESIZE_ITEM",target:F(t),payload:{w:e,h:o}}),setColor:(t,e)=>({type:"SET_ITEM_COLOR",target:F(t),payload:{color:e}}),setFontSize:(t,e)=>({type:"SET_ITEM_FONT_SIZE",target:F(t),payload:{fontSize:e}}),reorder:(t,e)=>({type:"REORDER_ITEM",target:F(t),payload:{after:e}}),deleteItem:t=>({type:"DELETE_ITEM",target:F(t),payload:{}}),connect:(t,e,o,n)=>({type:"CONNECT_ITEMS",target:Te,payload:{id:t,from:e,to:o,...n===void 0?{}:{label:n}}}),setConnectorLabel:(t,e)=>({type:"SET_CONNECTOR_LABEL",target:{type:"connector",id:t},payload:{label:e}}),setConnectorRoute:(t,e)=>({type:"SET_CONNECTOR_ROUTE",target:{type:"connector",id:t},payload:{route:e}}),deleteConnector:t=>({type:"DELETE_CONNECTOR",target:{type:"connector",id:t},payload:{}})},tt=(t,e)=>{const o=He(ce,e);if(o===null)return null;const n=o.target.id;switch(o.type){case"ADD_ITEM":{const i=o.payload,r=t.items.find(s=>s.id===i.id);return r!==void 0?r.kind===i.kind?t:null:t.connectors.some(s=>s.id===i.id)?null:{...t,items:[...t.items,i]}}case"SET_ITEM_TEXT":return V(t,n,i=>i.kind==="frame"?o.payload.text.trim()===""?null:{...i,title:o.payload.text}:{...i,text:o.payload.text});case"MOVE_ITEM":return V(t,n,i=>({...i,x:o.payload.x,y:o.payload.y}));case"RESIZE_ITEM":return V(t,n,i=>({...i,w:o.payload.w,h:o.payload.h}));case"SET_ITEM_COLOR":return V(t,n,i=>i.kind==="text"?null:{...i,color:o.payload.color});case"SET_ITEM_FONT_SIZE":return V(t,n,i=>i.kind==="frame"?null:{...i,fontSize:o.payload.fontSize});case"REORDER_ITEM":return To(t,n,o.payload.after);case"DELETE_ITEM":return t.items.some(i=>i.id===n)?{...t,items:t.items.filter(i=>i.id!==n),connectors:t.connectors.filter(i=>i.from!==n&&i.to!==n)}:null;case"CONNECT_ITEMS":{const i=o.payload;if(t.connectors.some(s=>s.id===i.id))return t;if(t.items.some(s=>s.id===i.id)||i.from===i.to||!t.items.some(s=>s.id===i.from)||!t.items.some(s=>s.id===i.to))return null;const r={id:i.id,from:i.from,to:i.to,style:i.style??"arrow",route:i.route??"straight",...i.label===void 0||i.label===""?{}:{label:i.label}};return{...t,connectors:[...t.connectors,r]}}case"SET_CONNECTOR_LABEL":return ot(t,n,i=>{const{label:r,...s}=i;return o.payload.label===""?s:{...s,label:o.payload.label}});case"SET_CONNECTOR_ROUTE":return ot(t,n,i=>({...i,route:o.payload.route}));case"DELETE_CONNECTOR":return t.connectors.some(i=>i.id===n)?{...t,connectors:t.connectors.filter(i=>i.id!==n)}:null;default:return Gt(o)}},V=(t,e,o)=>{const n=t.items.find(r=>r.id===e);if(n===void 0)return null;const i=o(n);return i===null?null:{...t,items:t.items.map(r=>r.id===e?i:r)}},To=(t,e,o)=>{const n=t.items.find(s=>s.id===e);if(n===void 0||o===e)return null;const i=t.items.filter(s=>s.id!==e),r=o===null?0:i.findIndex(s=>s.id===o)+1;return r===0&&o!==null?null:{...t,items:[...i.slice(0,r),n,...i.slice(r)]}},ot=(t,e,o)=>{const n=t.connectors.find(r=>r.id===e);if(n===void 0)return null;const i=o(n);return{...t,connectors:t.connectors.map(r=>r.id===e?i:r)}},W=t=>{if(t.length===0)return null;const e=Math.min(...t.map(r=>r.x)),o=Math.min(...t.map(r=>r.y)),n=Math.max(...t.map(r=>r.x+r.w)),i=Math.max(...t.map(r=>r.y+r.h));return{x:e,y:o,w:n-e,h:i-o}},ze=t=>[...t.items.filter(e=>e.kind==="frame"),...t.items.filter(e=>e.kind!=="frame")],zo=t=>t.kind==="shape"&&t.shape==="ellipse",Y=(t,e)=>{const o=t.x+t.w/2,n=t.y+t.h/2,i=e.x-o,r=e.y-n;if(i===0&&r===0)return{x:o,y:n};const s=t.w/2,d=t.h/2,a=zo(t)?1/Math.sqrt((i/s)**2+(r/d)**2):Math.min(i===0?1/0:s/Math.abs(i),r===0?1/0:d/Math.abs(r));return{x:o+i*a,y:n+r*a}},K=t=>({x:t.x+t.w/2,y:t.y+t.h/2}),nt=(t,e)=>{const o=Y(t,K(e)),n=Y(e,K(t));return{start:o,end:n,mid:{x:(o.x+n.x)/2,y:(o.y+n.y)/2}}},S=t=>`${t.x} ${t.y}`,le=(t,e,o)=>{if(o==="straight"){const{start:M,end:Q,mid:ee}=nt(t,e);return{d:`M ${S(M)} L ${S(Q)}`,mid:ee}}const n=K(t),i=K(e),r=Math.abs(i.x-n.x)>=Math.abs(i.y-n.y),s=r?i.x>=n.x:i.y>=n.y,d=(M,Q)=>{const ee=K(M);return r?{x:Q?M.x+M.w:M.x,y:ee.y}:{x:ee.x,y:Q?M.y+M.h:M.y}},a=d(t,s),c=d(e,!s),l={x:(a.x+c.x)/2,y:(a.y+c.y)/2},m=r?{x:l.x,y:a.y}:{x:a.x,y:l.y},u=r?{x:l.x,y:c.y}:{x:c.x,y:l.y};return{d:o==="elbow"?`M ${S(a)} L ${S(m)} L ${S(u)} L ${S(c)}`:`M ${S(a)} C ${S(m)} ${S(u)} ${S(c)}`,mid:l}},Se=(t,e)=>e.x>=t.x&&e.x<=t.x+t.w&&e.y>=t.y&&e.y<=t.y+t.h,So=(t,e)=>e>.5?{w:t.w,h:Math.ceil(t.h+e)}:void 0,Mo=(t,e)=>t.items.filter(o=>o.kind==="frame"&&Se(o,e)).sort((o,n)=>o.w*o.h-n.w*n.h),Me=(t,e,o)=>{const n=ze(t);for(let r=n.length-1;r>=0;r-=1){const s=n[r];if(!(s===void 0||s.id===o||s.kind==="frame")&&Se(s,e))return s}let i;for(const r of n)r.kind!=="frame"||r.id===o||!Se(r,e)||(i===void 0||r.w*r.h<i.w*i.h)&&(i=r);return i},_o=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),w:Math.abs(t.x-e.x),h:Math.abs(t.y-e.y)}),Lo=(t,e)=>e.x>=t.x&&e.y>=t.y&&e.x+e.w<=t.x+t.w&&e.y+e.h<=t.y+t.h,Oo=(t,e)=>t.items.filter(o=>o.kind==="frame"?Lo(e,o):he(e,o,0)),he=(t,e,o)=>t.x<e.x+e.w+o&&e.x<t.x+t.w+o&&t.y<e.y+e.h+o&&e.y<t.y+t.h+o,Io=(t,e,o=!1,n=16,i=6)=>{const r=o?t.items:t.items.filter(c=>c.kind!=="frame"),s=c=>!r.some(l=>he(c,l,n));if(s(e))return{x:e.x,y:e.y};const d=e.w+n,a=e.h+n;for(let c=1;c<=i;c+=1){const l=[];for(let u=-c;u<=c;u+=1)for(let w=-c;w<=c;w+=1)Math.max(Math.abs(w),Math.abs(u))===c&&l.push({x:e.x+w*d,y:e.y+u*a});l.sort((u,w)=>Math.hypot(u.x-e.x,u.y-e.y)-Math.hypot(w.x-e.x,w.y-e.y));const m=l.find(u=>s({...e,...u}));if(m!==void 0)return m}return{x:e.x,y:e.y}},Co={sticky:"Sticky note",text:"Text",shape:"Shape",frame:"Frame"},O={sticky:"\u4ED8\u7B8B",text:"\u30C6\u30AD\u30B9\u30C8",shape:"\u56F3\u5F62",frame:"\u30D5\u30EC\u30FC\u30E0"},N={sticky:"sticky note",text:"text box",shape:"shape",frame:"frame"},Ro={rect:"Rectangle",ellipse:"Ellipse"},No={rect:"\u56DB\u89D2\u5F62",ellipse:"\u6955\u5186"},Ao={yellow:"Yellow",orange:"Orange",pink:"Pink",purple:"Purple",blue:"Blue",green:"Green",gray:"Gray"},Do={yellow:"\u9EC4",orange:"\u30AA\u30EC\u30F3\u30B8",pink:"\u30D4\u30F3\u30AF",purple:"\u7D2B",blue:"\u9752",green:"\u7DD1",gray:"\u30B0\u30EC\u30FC"},Fo={small:"Small",medium:"Medium",large:"Large",xlarge:"Extra large"},Po={small:"\u5C0F",medium:"\u4E2D",large:"\u5927",xlarge:"\u7279\u5927"},Bo={straight:"Straight",elbow:"Elbow",curve:"Curved"},Ho={straight:"\u76F4\u7DDA",elbow:"\u30AB\u30AE\u7DDA",curve:"\u66F2\u7DDA"},it={small:"S",medium:"M",large:"L",xlarge:"XL"},pe=Vt({en:{kindLabel:t=>Co[t],shapeLabel:t=>Ro[t],colorLabel:t=>Ao[t],fontSizeLabel:t=>Fo[t],fontSizeShort:t=>it[t],routeLabel:t=>Bo[t],connector:"Connector",board:"Board",wholeBoard:"Whole board",canvasLabel:"Whiteboard canvas",emptyHint:"Double-click anywhere to add a sticky note, or pick something from the toolbar.",toolsLabel:"Add to the board",addSticky:"Sticky note",addText:"Text",addRect:"Rectangle",addEllipse:"Ellipse",addFrame:"Frame",newFrameTitle:"New frame",textPlaceholder:"Type something",selectionLabel:"Selected item",selectionCount:t=>`${t} items selected`,editText:"Edit text",renameFrame:"Rename frame",comment:"Comment",delete:"Delete",colorLabelPrefix:"Color",fontSizeLabelPrefix:"Text size",arrangeLabel:"Stacking order",bringToFront:"Bring to front",bringForward:"Bring forward",sendBackward:"Send backward",sendToBack:"Send to back",routeLabelPrefix:"Line",labelField:"Connector label",labelPlaceholder:"Add a label",resizeHandle:"Resize",connectHandle:"Drag to connect",commentCount:t=>`${t} comment${t===1?"":"s"}`,zoomIn:"Zoom in",zoomOut:"Zoom out",zoomFit:"Fit the board",zoomReset:"Reset to 100%",framesHeading:"Frames",framesHint:"Pick a frame to bring it into view.",memberCount:t=>`${t} item${t===1?"":"s"}`,addedTitle:t=>`Added a ${N[t]}`,textEditedTitle:t=>t==="frame"?"Renamed the frame":`Edited the ${N[t]}`,movedTitle:t=>`Moved the ${N[t]}`,resizedTitle:t=>`Resized the ${N[t]}`,recoloredTitle:t=>`Changed the color of the ${N[t]}`,resizedTextTitle:t=>`Changed the text size of the ${N[t]}`,restackedTitle:t=>`Changed the stacking order of the ${N[t]}`,deletedTitle:t=>`Deleted the ${N[t]}`,connectedTitle:"Connected two items",relabeledTitle:"Relabeled the connector",reroutedTitle:"Changed the connector line",disconnectedTitle:"Removed the connector",arrowTo:t=>`\u2192 \u201C${t}\u201D`,arrowFrom:(t,e)=>`\u201C${t}\u201D \u2192 \u201C${e}\u201D`,plain:(t,e)=>`${t} \u2192 ${e}`,added:t=>`+ \u201C${t}\u201D`,deleted:t=>`\u2212 \u201C${t}\u201D`,inFrame:t=>`in frame \u201C${t}\u201D`,intoFrame:t=>`into frame \u201C${t}\u201D`,outOfFrame:t=>`out of frame \u201C${t}\u201D`,betweenFrames:(t,e)=>`frame \u201C${t}\u201D \u2192 frame \u201C${e}\u201D`,position:(t,e)=>`(${t}, ${e})`,size:(t,e)=>`${t}\xD7${e}`,connection:(t,e)=>`\u201C${t}\u201D \u2192 \u201C${e}\u201D`,labeled:t=>`labeled \u201C${t}\u201D`,inFrontOf:t=>`in front of \u201C${t}\u201D`,toBack:"to the very back",empty:"(empty)",noLabel:"(no label)"},ja:{kindLabel:t=>O[t],shapeLabel:t=>No[t],colorLabel:t=>Do[t],fontSizeLabel:t=>Po[t],fontSizeShort:t=>it[t],routeLabel:t=>Ho[t],connector:"\u30B3\u30CD\u30AF\u30BF",board:"\u30DC\u30FC\u30C9",wholeBoard:"\u30DC\u30FC\u30C9\u5168\u4F53",canvasLabel:"\u30DB\u30EF\u30A4\u30C8\u30DC\u30FC\u30C9",emptyHint:"\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3067\u4ED8\u7B8B\u3092\u7F6E\u304F\u304B\u3001\u30C4\u30FC\u30EB\u30D0\u30FC\u304B\u3089\u8FFD\u52A0\u3057\u307E\u3059\u3002",toolsLabel:"\u30DC\u30FC\u30C9\u306B\u8FFD\u52A0",addSticky:"\u4ED8\u7B8B",addText:"\u30C6\u30AD\u30B9\u30C8",addRect:"\u56DB\u89D2\u5F62",addEllipse:"\u6955\u5186",addFrame:"\u30D5\u30EC\u30FC\u30E0",newFrameTitle:"\u65B0\u3057\u3044\u30D5\u30EC\u30FC\u30E0",textPlaceholder:"\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",selectionLabel:"\u9078\u629E\u4E2D\u306E\u8981\u7D20",selectionCount:t=>`${t} \u4EF6\u3092\u9078\u629E\u4E2D`,editText:"\u30C6\u30AD\u30B9\u30C8\u3092\u7DE8\u96C6",renameFrame:"\u30D5\u30EC\u30FC\u30E0\u540D\u3092\u5909\u66F4",comment:"\u30B3\u30E1\u30F3\u30C8",delete:"\u524A\u9664",colorLabelPrefix:"\u8272",fontSizeLabelPrefix:"\u6587\u5B57\u30B5\u30A4\u30BA",arrangeLabel:"\u91CD\u306A\u308A\u9806",bringToFront:"\u6700\u524D\u9762\u3078",bringForward:"\u524D\u9762\u3078",sendBackward:"\u80CC\u9762\u3078",sendToBack:"\u6700\u80CC\u9762\u3078",routeLabelPrefix:"\u7DDA\u306E\u5F62",labelField:"\u30B3\u30CD\u30AF\u30BF\u306E\u30E9\u30D9\u30EB",labelPlaceholder:"\u30E9\u30D9\u30EB\u3092\u8FFD\u52A0",resizeHandle:"\u30B5\u30A4\u30BA\u3092\u5909\u66F4",connectHandle:"\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u3064\u306A\u3050",commentCount:t=>`\u30B3\u30E1\u30F3\u30C8 ${t} \u4EF6`,zoomIn:"\u62E1\u5927",zoomOut:"\u7E2E\u5C0F",zoomFit:"\u30DC\u30FC\u30C9\u5168\u4F53\u3092\u8868\u793A",zoomReset:"100% \u306B\u623B\u3059",framesHeading:"\u30D5\u30EC\u30FC\u30E0",framesHint:"\u30D5\u30EC\u30FC\u30E0\u3092\u9078\u3076\u3068\u305D\u3053\u3078\u79FB\u52D5\u3057\u307E\u3059\u3002",memberCount:t=>`${t} \u4EF6`,addedTitle:t=>`${O[t]}\u3092\u8FFD\u52A0`,textEditedTitle:t=>t==="frame"?"\u30D5\u30EC\u30FC\u30E0\u540D\u3092\u5909\u66F4":`${O[t]}\u306E\u30C6\u30AD\u30B9\u30C8\u3092\u5909\u66F4`,movedTitle:t=>`${O[t]}\u3092\u79FB\u52D5`,resizedTitle:t=>`${O[t]}\u306E\u30B5\u30A4\u30BA\u3092\u5909\u66F4`,recoloredTitle:t=>`${O[t]}\u306E\u8272\u3092\u5909\u66F4`,resizedTextTitle:t=>`${O[t]}\u306E\u6587\u5B57\u30B5\u30A4\u30BA\u3092\u5909\u66F4`,restackedTitle:t=>`${O[t]}\u306E\u91CD\u306A\u308A\u9806\u3092\u5909\u66F4`,deletedTitle:t=>`${O[t]}\u3092\u524A\u9664`,connectedTitle:"\u8981\u7D20\u3092\u3064\u306A\u3044\u3060",relabeledTitle:"\u30B3\u30CD\u30AF\u30BF\u306E\u30E9\u30D9\u30EB\u3092\u5909\u66F4",reroutedTitle:"\u30B3\u30CD\u30AF\u30BF\u306E\u7DDA\u306E\u5F62\u3092\u5909\u66F4",disconnectedTitle:"\u30B3\u30CD\u30AF\u30BF\u3092\u524A\u9664",arrowTo:t=>`\u2192 \u300C${t}\u300D`,arrowFrom:(t,e)=>`\u300C${t}\u300D\u2192\u300C${e}\u300D`,plain:(t,e)=>`${t} \u2192 ${e}`,added:t=>`+ \u300C${t}\u300D`,deleted:t=>`\u2212 \u300C${t}\u300D`,inFrame:t=>`\u30D5\u30EC\u30FC\u30E0\u300C${t}\u300D\u5185`,intoFrame:t=>`\u30D5\u30EC\u30FC\u30E0\u300C${t}\u300D\u3078`,outOfFrame:t=>`\u30D5\u30EC\u30FC\u30E0\u300C${t}\u300D\u306E\u5916\u3078`,betweenFrames:(t,e)=>`\u30D5\u30EC\u30FC\u30E0\u300C${t}\u300D\u2192\u300C${e}\u300D`,position:(t,e)=>`(${t}, ${e})`,size:(t,e)=>`${t}\xD7${e}`,connection:(t,e)=>`\u300C${t}\u300D\u2192\u300C${e}\u300D`,labeled:t=>`\u30E9\u30D9\u30EB\u300C${t}\u300D`,inFrontOf:t=>`\u300C${t}\u300D\u306E\u524D\u9762\u3078`,toBack:"\u6700\u80CC\u9762\u3078",empty:"\uFF08\u7A7A\uFF09",noLabel:"\uFF08\u30E9\u30D9\u30EB\u306A\u3057\uFF09"}}),ue=t=>t===void 0?[]:[...new Set(t.split(",").filter(e=>e!==""))],rt=t=>t.length===0?void 0:t.join(","),st=(t,e)=>t.includes(e)?t.filter(o=>o!==e):[...t,e],at=40,A=(t,e)=>{const o=e.replace(/\s+/g," ").trim();return o===""?t.empty:o.length>at?`${o.slice(0,at-1)}\u2026`:o},Wo=(t,e)=>`${e.kind==="shape"?t.shapeLabel(e.shape):t.kindLabel(e.kind)} \xB7 ${A(t,L(e))}`,E=(t,e,o,n)=>{const i=p(e,n)??p(o,n);return i===void 0?n:A(t,L(i))},Ko=(t,e,o,n=e)=>`${t.connector} \xB7 ${t.connection(E(t,e,n,o.from),E(t,e,n,o.to))}`,qo=(t,e,o,n,i)=>{const r=o===void 0?void 0:D(i,o),s=D(e,n),d=t.position(Math.round(n.x),Math.round(n.y));if(r?.id!==s?.id){if(r!==void 0&&s!==void 0)return`${t.betweenFrames(r.title,s.title)} ${d}`;if(s!==void 0)return`${t.intoFrame(s.title)} ${d}`;if(r!==void 0)return`${t.outOfFrame(r.title)} ${d}`}return o===void 0?`\u2192 ${d}`:t.plain(t.position(Math.round(o.x),Math.round(o.y)),d)},Uo=(t,e,o,n)=>{const i=e.target.id,r=p(n,i),s=p(o,i)??r,d=s?.kind??"sticky";switch(e.type){case"ADD_ITEM":{const a=p(o,e.payload.id)??e.payload,c=D(o,a),l=t.added(A(t,L(a)));return{title:t.addedTitle(a.kind),tone:"create",body:c===void 0?l:`${l} ${t.inFrame(c.title)}`}}case"SET_ITEM_TEXT":{const a=A(t,e.payload.text);return{title:t.textEditedTitle(d),tone:"update",body:r===void 0?t.arrowTo(a):t.arrowFrom(A(t,L(r)),a)}}case"MOVE_ITEM":{if(s===void 0)return{title:t.movedTitle(d),tone:"move"};const a={...s,x:e.payload.x,y:e.payload.y};return{title:t.movedTitle(d),tone:"move",body:qo(t,o,r,a,n)}}case"RESIZE_ITEM":{const a=t.size(Math.round(e.payload.w),Math.round(e.payload.h));return{title:t.resizedTitle(d),tone:"update",body:r===void 0?`\u2192 ${a}`:t.plain(t.size(Math.round(r.w),Math.round(r.h)),a)}}case"SET_ITEM_COLOR":{const a=t.colorLabel(e.payload.color);return{title:t.recoloredTitle(d),tone:"update",body:r!==void 0&&$e(r)?t.plain(t.colorLabel(r.color),a):`\u2192 ${a}`}}case"SET_ITEM_FONT_SIZE":{const a=t.fontSizeLabel(e.payload.fontSize);return{title:t.resizedTextTitle(d),tone:"update",body:r!==void 0&&G(r)?t.plain(t.fontSizeLabel(r.fontSize),a):`\u2192 ${a}`}}case"REORDER_ITEM":{const a=e.payload.after;return{title:t.restackedTitle(d),tone:"move",body:a===null?t.toBack:t.inFrontOf(E(t,o,n,a))}}case"DELETE_ITEM":return{title:t.deletedTitle(d),tone:"delete",body:t.deleted(s===void 0?i:A(t,L(s)))};case"CONNECT_ITEMS":{const a=e.payload,c=t.connection(E(t,o,n,a.from),E(t,o,n,a.to));return{title:t.connectedTitle,tone:"create",body:a.label===void 0||a.label===""?c:`${c} \xB7 ${t.labeled(a.label)}`}}case"SET_CONNECTOR_LABEL":{const a=y(n,i)?.label,c=e.payload.label===""?t.noLabel:e.payload.label;return{title:t.relabeledTitle,tone:"update",body:a===void 0?t.arrowTo(c):t.arrowFrom(a,c)}}case"SET_CONNECTOR_ROUTE":{const a=y(n,i)?.route,c=t.routeLabel(e.payload.route);return{title:t.reroutedTitle,tone:"update",body:a===void 0?`\u2192 ${c}`:t.plain(t.routeLabel(a),c)}}case"DELETE_CONNECTOR":{const a=y(n,i)??y(o,i);return{title:t.disconnectedTitle,tone:"delete",...a===void 0?{}:{body:t.connection(E(t,o,n,a.from),E(t,o,n,a.to))}}}}},dt=(t,e,o,n=o)=>{let i;try{const r=He(ce,e);i=r===null?{title:e.type,tone:"meta"}:Uo(t,r,o,n)}catch{i={title:e.type,tone:"meta"}}return{title:i.title,targetLabel:lt(t,o,e.target,n),tone:i.tone,...i.body===void 0?{}:{summary:i.body}}},ct=t=>`${t.type} ${I(t.target)} ${JSON.stringify(t.payload)}`,lt=(t,e,o,n=e)=>{switch(o.type){case"item":{const i=p(e,o.id)??p(n,o.id);return i===void 0?`${o.type} \xB7 ${o.id} (missing)`:Wo(t,i)}case"connector":{const i=y(e,o.id)??y(n,o.id);return i===void 0?`${t.connector} \xB7 ${o.id} (missing)`:Ko(t,e,i,n)}case"page":return`${t.board} \xB7 ${_e(e)}`;default:return`${o.type} \xB7 ${o.id}`}},ht=(t,e)=>{const o=[{value:"page:whiteboard",label:t.wholeBoard,group:t.board}],n=e.items.filter(r=>r.kind==="frame"),i=e.items.filter(r=>r.kind!=="frame");for(const r of[...n,...i]){const s=D(e,r),d=A(t,L(r));o.push({value:I({type:"item",id:r.id}),label:s===void 0?d:`${s.title} \u203A ${d}`,group:t.kindLabel(r.kind)})}for(const r of e.connectors)o.push({value:I({type:"connector",id:r.id}),label:t.connection(E(t,e,e,r.from),E(t,e,e,r.to)),group:t.connector});return o},pt=(t,e,o)=>{const n=ue(o.item),i=n.length===1?n[0]:void 0,r=p(e,i)??p(e,o.frame);if(r!==void 0)return{value:I({type:"item",id:r.id}),label:A(t,L(r)),group:t.kindLabel(r.kind)};const s=y(e,i);return s===void 0?null:{value:I({type:"connector",id:s.id}),label:t.connection(E(t,e,e,s.from),E(t,e,e,s.to)),group:t.connector}},_e=t=>t.title??"Whiteboard",ut=(t,e)=>{const o={...e};p(t,e.frame)?.kind!=="frame"&&delete o.frame;const n=ue(e.item),i=n.filter(d=>p(t,d)!==void 0),r=n.length===1?y(t,n[0]):void 0,s=rt(r===void 0?i:[r.id]);return s===void 0?delete o.item:o.item=s,o},bt=(t,e)=>{switch(e.type){case"item":return p(t,e.id)!==void 0;case"connector":return y(t,e.id)!==void 0;case"page":return!0;default:return!1}},ft=t=>{const e=pe(t);return{name:"whiteboard",label:"Whiteboard",parseBase:Ye,emptyBase:je,actions:ce,apply:tt,canonicalState:o=>({...o,items:ze(o)}),hasTarget:bt,describe:(o,n,i)=>dt(e,o,n,i),serialize:ct,resolveNavigation:ut,navigationHierarchy:["frame","item"],commentTargets:o=>ht(e,o),currentTarget:(o,n)=>pt(e,o,n),title:_e}},mt=["front","forward","backward","back"],wt=t=>t.items.filter(e=>e.kind!=="frame"),xt=(t,e,o,n)=>{const i=t.indexOf(e),r=(n?t.slice(i+1):t.slice(0,i).reverse()).filter(c=>!o.has(c.id)),s=r.find(c=>he(e,c,0))??r[0];if(s===void 0)return t;const d=t.filter(c=>c!==e),a=d.indexOf(s)+(n?1:0);return[...d.slice(0,a),e,...d.slice(a)]},yt=(t,e,o)=>{const n=t.filter(r=>e.has(r.id)),i=t.filter(r=>!e.has(r.id));switch(o){case"front":return[...i,...n];case"back":return[...n,...i];case"forward":return[...n].reverse().reduce((r,s)=>xt(r,s,e,!0),[...t]);case"backward":return n.reduce((r,s)=>xt(r,s,e,!1),[...t])}},Zo=(t,e,o)=>{let n=t.map(r=>r.id);const i=[];return e.forEach((r,s)=>{if(!o.has(r.id))return;const d=e[s-1]?.id??null,a=n.indexOf(r.id);(n[a-1]??null)!==d&&(n=n.filter(c=>c!==r.id),n.splice(d===null?0:n.indexOf(d)+1,0,r.id),i.push(k.reorder(r.id,d)))}),i},Xo=(t,e,o)=>{const n=wt(t),i=new Set(e.filter(r=>n.some(s=>s.id===r)));return i.size===0?[]:Zo(n,yt(n,i,o),i)},Go=(t,e)=>{const o=wt(t),n=new Set(e.filter(s=>o.some(d=>d.id===s))),i=o.flatMap(s=>n.has(s.id)?o.filter(d=>!n.has(d.id)&&he(s,d,0)).map(d=>[s,d]):[]),r=(s,[d,a])=>s.indexOf(d)>s.indexOf(a);return new Set(mt.filter(s=>{const d=yt(o,n,s);return i.some(a=>r(o,a)!==r(d,a))}))},kt=(t,e,o)=>{if(!t.contains(e)||e.nodeType!==Node.TEXT_NODE)return;let n=0;const i=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(let r=i.nextNode();r!==null;r=i.nextNode()){if(r===e)return n+o;n+=r.textContent?.length??0}},Vo=(t,e,o)=>{const n=t.getRootNode(),i=t.ownerDocument;if(typeof i.caretPositionFromPoint=="function"){const r=n instanceof ShadowRoot?[n]:[],s=i.caretPositionFromPoint(e,o,{shadowRoots:r});if(s!==null)return kt(t,s.offsetNode,s.offset)}if(typeof i.caretRangeFromPoint=="function"){const r=i.caretRangeFromPoint(e,o);if(r!==null)return kt(t,r.startContainer,r.startOffset)}},Yo=["sticky","text","rect","ellipse","frame"],jo=t=>t==="rect"||t==="ellipse"?C.shape:C[t],Jo=(t,e,o,n)=>{const{w:i,h:r}=jo(o),s={x:Math.round(n.x-i/2),y:Math.round(n.y-r/2)},d=Io(t,{...s,w:i,h:r},o==="frame"),l={id:We(`new-${o==="rect"||o==="ellipse"?"shape":o}`,Je(t)),x:d.x,y:d.y,w:i,h:r};switch(o){case"sticky":return{...l,kind:"sticky",text:"",color:H.sticky,fontSize:se};case"text":return{...l,kind:"text",text:"",fontSize:se};case"rect":case"ellipse":return{...l,kind:"shape",shape:o,text:"",color:H.shape,fontSize:se};case"frame":return{...l,kind:"frame",title:e.newFrameTitle,color:H.frame}}},Qo=(t,e,o)=>We(`${e}-to-${o}`,Je(t)),en=(t,e)=>{const o=(t.kind==="frame"?e.replace(/\r?\n/g," "):e).trim();if(!(t.kind==="frame"&&o===""))return o===L(t)?void 0:o},be=4,Le=(t,e,o,n,i=[e])=>{if(p(t,e)===void 0)return;const r=new Map;for(const s of i.includes(e)?i:[e,...i]){const d=p(t,s);if(d!==void 0)for(const a of d.kind==="frame"?[d,...Ee(t,d)]:[d])r.set(a.id,a)}return{kind:"move",pointerId:o,itemId:e,origins:[...r.values()].map(({id:s,x:d,y:a})=>({id:s,x:d,y:a})),start:n,current:n,moved:!1}},tn=(t,e,o,n)=>{const i=p(t,e);if(i!==void 0)return{kind:"resize",pointerId:o,itemId:e,origin:{w:i.w,h:i.h},start:n,current:n,moved:!1,keepRatio:!1}},on=(t,e)=>({kind:"pan",pointerId:t,start:e,last:e,moved:!1}),nn=(t,e)=>({gesture:{...t,last:e,moved:t.moved||Math.hypot(e.x-t.start.x,e.y-t.start.y)>be},dx:e.x-t.last.x,dy:e.y-t.last.y}),gt=(t,e,o)=>({kind:"marquee",pointerId:t,base:o,start:e,current:e,moved:!1}),rn=(t,e,o,n,i)=>{const r=Mo(t,n).find(d=>e.includes(d.id));return(r===void 0?void 0:Le(t,r.id,o,n,e))??gt(o,n,i)},vt=t=>t?.kind==="marquee"&&t.moved?_o(t.start,t.current):void 0,$t=(t,e)=>{const o=vt(e);if(e.kind!=="marquee"||o===void 0)return[];const n=Oo(t,o).map(i=>i.id);return[...new Set([...e.base,...n])]},sn=(t,e,o)=>({kind:"connect",pointerId:e,fromId:t,start:o,current:o,moved:!1}),Oe=(t,e,o,n,i,r=!1)=>{if(e.pointerId!==o)return e;switch(e.kind){case"pan":return e;case"marquee":case"move":{const s=e.moved||Math.hypot(n.x-e.start.x,n.y-e.start.y)*i>be;return{...e,current:n,moved:s}}case"resize":{const s=e.moved||Math.hypot(n.x-e.start.x,n.y-e.start.y)*i>be;return{...e,current:n,moved:s,keepRatio:r}}case"connect":{const s=e.moved||Math.hypot(n.x-e.start.x,n.y-e.start.y)*i>be,d=Me(t,n,e.fromId),{targetId:a,...c}=e;return d===void 0?{...c,current:n,moved:s}:{...c,current:n,moved:s,targetId:d.id}}}},q=t=>Math.round(t),Et=(t,e)=>{if(e===void 0||!e.moved)return t;if(e.kind==="move"){const o=e.current.x-e.start.x,n=e.current.y-e.start.y,i=new Map(e.origins.map(r=>[r.id,r]));return{...t,items:t.items.map(r=>{const s=i.get(r.id);return s===void 0?r:{...r,x:q(s.x+o),y:q(s.y+n)}})}}if(e.kind==="resize"){const o=Tt(e);return{...t,items:t.items.map(n=>n.id===e.itemId?{...n,...o}:n)}}return t},Tt=t=>{const{origin:e}=t,o=e.w+t.current.x-t.start.x,n=e.h+t.current.y-t.start.y;if(!t.keepRatio)return{w:Math.max(X,q(o)),h:Math.max(X,q(n))};const i=Math.max(o/e.w,n/e.h,X/Math.min(e.w,e.h));return{w:q(e.w*i),h:q(e.h*i)}},an=(t,e,o,n)=>{const[i]=e;if(i===void 0)return[];const r=Le(t,i,0,{x:0,y:0},e);if(r?.kind!=="move")return[];const s=zt(t,{...r,current:{x:o,y:n},moved:!0});return s.kind==="dispatch"?s.inputs:[]},zt=(t,e)=>{switch(e.kind){case"pan":return e.moved?{kind:"none"}:{kind:"click"};case"marquee":{if(e.moved)return{kind:"select",ids:$t(t,e)};const o=Me(t,e.start);return o===void 0?{kind:"click"}:{kind:"click",itemId:o.id}}case"move":{if(!e.moved)return{kind:"click",itemId:e.itemId};const o=Et(t,e),n=e.origins.flatMap(i=>{const r=p(o,i.id);return r===void 0||r.x===i.x&&r.y===i.y?[]:[k.move(i.id,r.x,r.y)]});return n.length===0?{kind:"none"}:{kind:"dispatch",inputs:n}}case"resize":{if(!e.moved)return{kind:"click",itemId:e.itemId};const o=Tt(e);return o.w===e.origin.w&&o.h===e.origin.h?{kind:"none"}:{kind:"dispatch",inputs:[k.resize(e.itemId,o.w,o.h)]}}case"connect":return e.moved?e.targetId===void 0?{kind:"none"}:{kind:"connect",from:e.fromId,to:e.targetId}:{kind:"click",itemId:e.fromId}}},j=.1,St=2.5,dn={x:0,y:0,zoom:1},cn=96,Ie=(t,e)=>({x:(e.x-t.x)/t.zoom,y:(e.y-t.y)/t.zoom}),Ce=(t,e)=>({x:e.x*t.zoom+t.x,y:e.y*t.zoom+t.y}),fe=(t,e,o)=>({...t,x:t.x+e,y:t.y+o}),Re=(t,e,o)=>{const n=ke(t.zoom*o,j,St),i=Ie(t,e);return{zoom:n,x:e.x-i.x*n,y:e.y-i.y*n}},Mt=(t,e,o=48,n=1)=>{const i=Math.max(1,e.width-o*2),r=Math.max(1,e.height-o*2),s=ke(Math.min(i/Math.max(1,t.w),r/Math.max(1,t.h)),j,n);return{zoom:s,x:e.width/2-(t.x+t.w/2)*s,y:e.height/2-(t.y+t.h/2)*s}},ln=(t,e,o=48)=>{const n=W(t);if(n===null)return null;const i=Math.max(1,e.width-o*2)/j,r=Math.max(1,e.height-o*2)/j;if(n.w<=i&&n.h<=r)return n;const s=qe(t.map(c=>c.x+c.w/2)),d=qe(t.map(c=>c.y+c.h/2)),a=t.filter(c=>c.x<s+i/2&&c.x+c.w>s-i/2&&c.y<d+r/2&&c.y+c.h>d-r/2);return W(a)??n},_t=(t,e,o)=>{if(e===null||o.width<=0||o.height<=0)return t;const n=(i,r,s,d)=>{const a=Math.min(cn,d/2),c=a-(r+s)*t.zoom,l=d-a-r*t.zoom;return ke(i,Math.min(c,l),Math.max(c,l))};return{zoom:t.zoom,x:n(t.x,e.x,e.w,o.width),y:n(t.y,e.y,e.h,o.height)}},Lt=(t,e,o,n=24)=>{const i=e.x*t.zoom+t.x,r=e.y*t.zoom+t.y,s=i+e.w*t.zoom,d=r+e.h*t.zoom;return i>=n&&r>=n&&s<=o.width-n&&d<=o.height-n?t:{zoom:t.zoom,x:o.width/2-(e.x+e.w/2)*t.zoom,y:o.height/2-(e.y+e.h/2)*t.zoom}},Ot=(t,e,o,n,i=0)=>{const r=t+e-(o-n),s=r>0?-r:0;return t+s<i+n?i+n-t:s},hn=(t,e)=>t.x===e.x&&t.y===e.y&&t.zoom===e.zoom,v={kind:"idle"},J=(t,e)=>t.kind==="editing"&&t.itemId===e,pn={front:_(uo),forward:_(jt),backward:_(Yt),back:_(mo)},It=[["circle",{cx:"19",cy:"5",r:"2"}],["circle",{cx:"5",cy:"19",r:"2"}]],un={straight:_([...It,["path",{d:"M6.5 17.5 17.5 6.5"}]]),elbow:_([...It,["path",{d:"M7 19h5V5h5"}]]),curve:_(wo)},bn=t=>pn[t](),fn=t=>un[t](),mn=_(bo),wn=_(fo),xn={yellow:{paper:"#fff0a3",ink:"#4a3a06",stroke:"#d9a900"},orange:{paper:"#ffd1a0",ink:"#4a2503",stroke:"#ec7f1d"},pink:{paper:"#ffc9dd",ink:"#4b1029",stroke:"#de4479"},purple:{paper:"#ddcbf8",ink:"#32195c",stroke:"#8a5bd6"},blue:{paper:"#c0ddf7",ink:"#0e2c4b",stroke:"#3a80d4"},green:{paper:"#cdeba5",ink:"#22380a",stroke:"#55a42c"},gray:{paper:"#e3e6eb",ink:"#2a2f38",stroke:"#868d99"}},Ne=t=>{const{paper:e,ink:o,stroke:n}=xn[t];return`--wb-paper:${e};--wb-ink:${o};--wb-stroke:${n}`},Ct={sticky:"addSticky",text:"addText",rect:"addRect",ellipse:"addEllipse",frame:"addFrame"},Rt={small:.8,medium:1,large:1.4,xlarge:2},yn=t=>{const e=24*t.zoom;return`background-size:${e}px ${e}px;background-position:${t.x}px ${t.y}px`},kn=t=>{const{m:e,state:o,viewport:n,gesture:i,handlers:r}=t,s=["wb-canvas"];i?.moved===!0&&s.push("wb-canvas--gesturing"),i?.kind==="pan"&&i.moved&&s.push("wb-canvas--panning"),i?.kind==="connect"&&s.push("wb-canvas--connecting"),(t.panReady||i?.kind==="pan")&&s.push("wb-canvas--pan-ready");const d=ze(o);return h`<div
|
|
1
|
+
import{am as Ut,ae as P,aA as xe,af as f,ah as x,ao as te,ai as T,aj as z,ak as B,b7 as oe,al as ne,ax as Fe,ad as Zt,ag as Pe,aB as U,p as g,au as $,v as Be,az as Xt,P as He,e as Gt,a0 as Vt,V as I,l as We,aU as _,bb as Yt,bc as jt,a3 as b,a5 as Jt,a4 as h,a7 as ye,a6 as Qt,J as eo,A as to,K as oo,aE as no,ar as io,a2 as ro,T as Ke,a1 as so,a9 as ao,h as co}from"./shared-DXaIVZ_z.js";import{r as lo,p as ho,c as po}from"./shared-BtN-8ibq.js";import{c as ke}from"./shared-ml5h7U5L.js";const uo=[["rect",{x:"8",y:"8",width:"8",height:"8",rx:"2"}],["path",{d:"M4 10a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2"}],["path",{d:"M14 20a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2"}]],bo=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17"}]],fo=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2"}]],mo=[["rect",{x:"14",y:"14",width:"8",height:"8",rx:"2"}],["rect",{x:"2",y:"2",width:"8",height:"8",rx:"2"}],["path",{d:"M7 14v1a2 2 0 0 0 2 2h1"}],["path",{d:"M14 7h1a2 2 0 0 1 2 2v1"}]],wo=[["circle",{cx:"19",cy:"5",r:"2"}],["circle",{cx:"5",cy:"19",r:"2"}],["path",{d:"M5 17A12 12 0 0 1 17 5"}]];function qe(t){if(t.length===0)return NaN;const e=t.slice().sort((n,i)=>n-i),o=Math.floor(e.length/2);return e.length%2===0?(e[o-1]+e[o])/2:e[o]}const ie=["yellow","orange","pink","purple","blue","green","gray"],Ue=["rect","ellipse"],xo=["sticky","text","shape","frame"],re=["small","medium","large","xlarge"],se="medium",Ze=["arrow","line"],Z=["straight","elbow","curve"],X=24,C={sticky:{w:160,h:160},text:{w:240,h:48},shape:{w:180,h:110},frame:{w:640,h:420}},H={sticky:"yellow",shape:"blue",frame:"gray"},Xe=z(ne(),oe()),R=z(ne(),oe(),Fe(X)),ge=T(ie),ve=f(T(re),se),ae={id:xe,x:Xe,y:Xe},yo=P({...ae,kind:te("sticky"),w:f(R,C.sticky.w),h:f(R,C.sticky.h),text:f(x(),""),color:f(ge,H.sticky),fontSize:ve}),ko=P({...ae,kind:te("text"),w:f(R,C.text.w),h:f(R,C.text.h),text:f(x(),""),fontSize:ve}),go=P({...ae,kind:te("shape"),shape:f(T(Ue),"rect"),w:f(R,C.shape.w),h:f(R,C.shape.h),text:f(x(),""),color:f(ge,H.shape),fontSize:ve}),vo=P({...ae,kind:te("frame"),w:R,h:R,title:z(x(),B(1)),color:f(ge,H.frame)}),Ge=Ut("kind",[yo,ko,go,vo]),$o=P({id:xe,from:z(x(),B(1)),to:z(x(),B(1)),label:U(x()),style:f(T(Ze),"arrow"),route:f(T(Z),"straight")}),Ve=P({title:U(x()),items:f(Pe(Ge),[]),connectors:f(Pe($o),[])}),Ye=t=>{const e=Zt(Ve,t),o=new Set;for(const{id:i}of[...e.items,...e.connectors]){if(o.has(i))throw new Error(`duplicate id "${i}" (items and connectors share one id space)`);o.add(i)}const n=new Set(e.items.map(i=>i.id));for(const i of e.connectors){if(!n.has(i.from))throw new Error(`unknown item "${i.from}" in connector "${i.id}"`);if(!n.has(i.to))throw new Error(`unknown item "${i.to}" in connector "${i.id}"`);if(i.from===i.to)throw new Error(`connector "${i.id}" connects an item to itself`)}return e},je=()=>({items:[],connectors:[]}),p=(t,e)=>{if(e!==void 0)return t.items.find(o=>o.id===e)},y=(t,e)=>{if(e!==void 0)return t.connectors.find(o=>o.id===e)},Je=t=>[...t.items.map(e=>e.id),...t.connectors.map(e=>e.id)],L=t=>t.kind==="frame"?t.title:t.text,$e=t=>t.kind!=="text",G=t=>t.kind!=="frame",de=t=>t.w*t.h,Eo=(t,e,o)=>e>=t.x&&e<=t.x+t.w&&o>=t.y&&o<=t.y+t.h,D=(t,e)=>{const o=e.x+e.w/2,n=e.y+e.h/2;let i;for(const r of t.items)r.kind!=="frame"||r.id===e.id||e.kind==="frame"&&de(r)<=de(e)||Eo(r,o,n)&&(i===void 0||de(r)<de(i))&&(i=r);return i},Ee=(t,e)=>{const o=[],n=i=>{let r=D(t,i);for(;r!==void 0;){if(r.id===e.id)return!0;r=D(t,r)}return!1};for(const i of t.items)i.id!==e.id&&n(i)&&o.push(i);return o},Qe=z(ne(),oe()),et=z(ne(),oe(),Fe(X)),Te={type:"page",id:"whiteboard"},ce={ADD_ITEM:g("ADD_ITEM","page",Ge,{dedupeKey:Be}),SET_ITEM_TEXT:g("SET_ITEM_TEXT","item",$({text:x()})),MOVE_ITEM:g("MOVE_ITEM","item",$({x:Qe,y:Qe})),RESIZE_ITEM:g("RESIZE_ITEM","item",$({w:et,h:et})),SET_ITEM_COLOR:g("SET_ITEM_COLOR","item",$({color:T(ie)})),SET_ITEM_FONT_SIZE:g("SET_ITEM_FONT_SIZE","item",$({fontSize:T(re)})),REORDER_ITEM:g("REORDER_ITEM","item",$({after:Xt(z(x(),B(1)))})),DELETE_ITEM:g("DELETE_ITEM","item",$({})),CONNECT_ITEMS:g("CONNECT_ITEMS","page",$({id:xe,from:z(x(),B(1)),to:z(x(),B(1)),label:U(x()),style:U(T(Ze)),route:U(T(Z))}),{dedupeKey:Be}),SET_CONNECTOR_LABEL:g("SET_CONNECTOR_LABEL","connector",$({label:x()})),SET_CONNECTOR_ROUTE:g("SET_CONNECTOR_ROUTE","connector",$({route:T(Z)})),DELETE_CONNECTOR:g("DELETE_CONNECTOR","connector",$({}))},F=t=>({type:"item",id:t}),k={addItem:t=>({type:"ADD_ITEM",target:Te,payload:t}),setText:(t,e)=>({type:"SET_ITEM_TEXT",target:F(t),payload:{text:e}}),move:(t,e,o)=>({type:"MOVE_ITEM",target:F(t),payload:{x:e,y:o}}),resize:(t,e,o)=>({type:"RESIZE_ITEM",target:F(t),payload:{w:e,h:o}}),setColor:(t,e)=>({type:"SET_ITEM_COLOR",target:F(t),payload:{color:e}}),setFontSize:(t,e)=>({type:"SET_ITEM_FONT_SIZE",target:F(t),payload:{fontSize:e}}),reorder:(t,e)=>({type:"REORDER_ITEM",target:F(t),payload:{after:e}}),deleteItem:t=>({type:"DELETE_ITEM",target:F(t),payload:{}}),connect:(t,e,o,n)=>({type:"CONNECT_ITEMS",target:Te,payload:{id:t,from:e,to:o,...n===void 0?{}:{label:n}}}),setConnectorLabel:(t,e)=>({type:"SET_CONNECTOR_LABEL",target:{type:"connector",id:t},payload:{label:e}}),setConnectorRoute:(t,e)=>({type:"SET_CONNECTOR_ROUTE",target:{type:"connector",id:t},payload:{route:e}}),deleteConnector:t=>({type:"DELETE_CONNECTOR",target:{type:"connector",id:t},payload:{}})},tt=(t,e)=>{const o=He(ce,e);if(o===null)return null;const n=o.target.id;switch(o.type){case"ADD_ITEM":{const i=o.payload,r=t.items.find(s=>s.id===i.id);return r!==void 0?r.kind===i.kind?t:null:t.connectors.some(s=>s.id===i.id)?null:{...t,items:[...t.items,i]}}case"SET_ITEM_TEXT":return V(t,n,i=>i.kind==="frame"?o.payload.text.trim()===""?null:{...i,title:o.payload.text}:{...i,text:o.payload.text});case"MOVE_ITEM":return V(t,n,i=>({...i,x:o.payload.x,y:o.payload.y}));case"RESIZE_ITEM":return V(t,n,i=>({...i,w:o.payload.w,h:o.payload.h}));case"SET_ITEM_COLOR":return V(t,n,i=>i.kind==="text"?null:{...i,color:o.payload.color});case"SET_ITEM_FONT_SIZE":return V(t,n,i=>i.kind==="frame"?null:{...i,fontSize:o.payload.fontSize});case"REORDER_ITEM":return To(t,n,o.payload.after);case"DELETE_ITEM":return t.items.some(i=>i.id===n)?{...t,items:t.items.filter(i=>i.id!==n),connectors:t.connectors.filter(i=>i.from!==n&&i.to!==n)}:null;case"CONNECT_ITEMS":{const i=o.payload;if(t.connectors.some(s=>s.id===i.id))return t;if(t.items.some(s=>s.id===i.id)||i.from===i.to||!t.items.some(s=>s.id===i.from)||!t.items.some(s=>s.id===i.to))return null;const r={id:i.id,from:i.from,to:i.to,style:i.style??"arrow",route:i.route??"straight",...i.label===void 0||i.label===""?{}:{label:i.label}};return{...t,connectors:[...t.connectors,r]}}case"SET_CONNECTOR_LABEL":return ot(t,n,i=>{const{label:r,...s}=i;return o.payload.label===""?s:{...s,label:o.payload.label}});case"SET_CONNECTOR_ROUTE":return ot(t,n,i=>({...i,route:o.payload.route}));case"DELETE_CONNECTOR":return t.connectors.some(i=>i.id===n)?{...t,connectors:t.connectors.filter(i=>i.id!==n)}:null;default:return Gt(o)}},V=(t,e,o)=>{const n=t.items.find(r=>r.id===e);if(n===void 0)return null;const i=o(n);return i===null?null:{...t,items:t.items.map(r=>r.id===e?i:r)}},To=(t,e,o)=>{const n=t.items.find(s=>s.id===e);if(n===void 0||o===e)return null;const i=t.items.filter(s=>s.id!==e),r=o===null?0:i.findIndex(s=>s.id===o)+1;return r===0&&o!==null?null:{...t,items:[...i.slice(0,r),n,...i.slice(r)]}},ot=(t,e,o)=>{const n=t.connectors.find(r=>r.id===e);if(n===void 0)return null;const i=o(n);return{...t,connectors:t.connectors.map(r=>r.id===e?i:r)}},W=t=>{if(t.length===0)return null;const e=Math.min(...t.map(r=>r.x)),o=Math.min(...t.map(r=>r.y)),n=Math.max(...t.map(r=>r.x+r.w)),i=Math.max(...t.map(r=>r.y+r.h));return{x:e,y:o,w:n-e,h:i-o}},ze=t=>[...t.items.filter(e=>e.kind==="frame"),...t.items.filter(e=>e.kind!=="frame")],zo=t=>t.kind==="shape"&&t.shape==="ellipse",Y=(t,e)=>{const o=t.x+t.w/2,n=t.y+t.h/2,i=e.x-o,r=e.y-n;if(i===0&&r===0)return{x:o,y:n};const s=t.w/2,d=t.h/2,a=zo(t)?1/Math.sqrt((i/s)**2+(r/d)**2):Math.min(i===0?1/0:s/Math.abs(i),r===0?1/0:d/Math.abs(r));return{x:o+i*a,y:n+r*a}},K=t=>({x:t.x+t.w/2,y:t.y+t.h/2}),nt=(t,e)=>{const o=Y(t,K(e)),n=Y(e,K(t));return{start:o,end:n,mid:{x:(o.x+n.x)/2,y:(o.y+n.y)/2}}},S=t=>`${t.x} ${t.y}`,le=(t,e,o)=>{if(o==="straight"){const{start:M,end:Q,mid:ee}=nt(t,e);return{d:`M ${S(M)} L ${S(Q)}`,mid:ee}}const n=K(t),i=K(e),r=Math.abs(i.x-n.x)>=Math.abs(i.y-n.y),s=r?i.x>=n.x:i.y>=n.y,d=(M,Q)=>{const ee=K(M);return r?{x:Q?M.x+M.w:M.x,y:ee.y}:{x:ee.x,y:Q?M.y+M.h:M.y}},a=d(t,s),c=d(e,!s),l={x:(a.x+c.x)/2,y:(a.y+c.y)/2},m=r?{x:l.x,y:a.y}:{x:a.x,y:l.y},u=r?{x:l.x,y:c.y}:{x:c.x,y:l.y};return{d:o==="elbow"?`M ${S(a)} L ${S(m)} L ${S(u)} L ${S(c)}`:`M ${S(a)} C ${S(m)} ${S(u)} ${S(c)}`,mid:l}},Se=(t,e)=>e.x>=t.x&&e.x<=t.x+t.w&&e.y>=t.y&&e.y<=t.y+t.h,So=(t,e)=>e>.5?{w:t.w,h:Math.ceil(t.h+e)}:void 0,Mo=(t,e)=>t.items.filter(o=>o.kind==="frame"&&Se(o,e)).sort((o,n)=>o.w*o.h-n.w*n.h),Me=(t,e,o)=>{const n=ze(t);for(let r=n.length-1;r>=0;r-=1){const s=n[r];if(!(s===void 0||s.id===o||s.kind==="frame")&&Se(s,e))return s}let i;for(const r of n)r.kind!=="frame"||r.id===o||!Se(r,e)||(i===void 0||r.w*r.h<i.w*i.h)&&(i=r);return i},_o=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),w:Math.abs(t.x-e.x),h:Math.abs(t.y-e.y)}),Lo=(t,e)=>e.x>=t.x&&e.y>=t.y&&e.x+e.w<=t.x+t.w&&e.y+e.h<=t.y+t.h,Oo=(t,e)=>t.items.filter(o=>o.kind==="frame"?Lo(e,o):he(e,o,0)),he=(t,e,o)=>t.x<e.x+e.w+o&&e.x<t.x+t.w+o&&t.y<e.y+e.h+o&&e.y<t.y+t.h+o,Io=(t,e,o=!1,n=16,i=6)=>{const r=o?t.items:t.items.filter(c=>c.kind!=="frame"),s=c=>!r.some(l=>he(c,l,n));if(s(e))return{x:e.x,y:e.y};const d=e.w+n,a=e.h+n;for(let c=1;c<=i;c+=1){const l=[];for(let u=-c;u<=c;u+=1)for(let w=-c;w<=c;w+=1)Math.max(Math.abs(w),Math.abs(u))===c&&l.push({x:e.x+w*d,y:e.y+u*a});l.sort((u,w)=>Math.hypot(u.x-e.x,u.y-e.y)-Math.hypot(w.x-e.x,w.y-e.y));const m=l.find(u=>s({...e,...u}));if(m!==void 0)return m}return{x:e.x,y:e.y}},Co={sticky:"Sticky note",text:"Text",shape:"Shape",frame:"Frame"},O={sticky:"\u4ED8\u7B8B",text:"\u30C6\u30AD\u30B9\u30C8",shape:"\u56F3\u5F62",frame:"\u30D5\u30EC\u30FC\u30E0"},N={sticky:"sticky note",text:"text box",shape:"shape",frame:"frame"},Ro={rect:"Rectangle",ellipse:"Ellipse"},No={rect:"\u56DB\u89D2\u5F62",ellipse:"\u6955\u5186"},Ao={yellow:"Yellow",orange:"Orange",pink:"Pink",purple:"Purple",blue:"Blue",green:"Green",gray:"Gray"},Do={yellow:"\u9EC4",orange:"\u30AA\u30EC\u30F3\u30B8",pink:"\u30D4\u30F3\u30AF",purple:"\u7D2B",blue:"\u9752",green:"\u7DD1",gray:"\u30B0\u30EC\u30FC"},Fo={small:"Small",medium:"Medium",large:"Large",xlarge:"Extra large"},Po={small:"\u5C0F",medium:"\u4E2D",large:"\u5927",xlarge:"\u7279\u5927"},Bo={straight:"Straight",elbow:"Elbow",curve:"Curved"},Ho={straight:"\u76F4\u7DDA",elbow:"\u30AB\u30AE\u7DDA",curve:"\u66F2\u7DDA"},it={small:"S",medium:"M",large:"L",xlarge:"XL"},pe=Vt({en:{kindLabel:t=>Co[t],shapeLabel:t=>Ro[t],colorLabel:t=>Ao[t],fontSizeLabel:t=>Fo[t],fontSizeShort:t=>it[t],routeLabel:t=>Bo[t],connector:"Connector",board:"Board",wholeBoard:"Whole board",canvasLabel:"Whiteboard canvas",emptyHint:"Double-click anywhere to add a sticky note, or pick something from the toolbar.",toolsLabel:"Add to the board",addSticky:"Sticky note",addText:"Text",addRect:"Rectangle",addEllipse:"Ellipse",addFrame:"Frame",newFrameTitle:"New frame",textPlaceholder:"Type something",selectionLabel:"Selected item",selectionCount:t=>`${t} items selected`,editText:"Edit text",renameFrame:"Rename frame",comment:"Comment",delete:"Delete",colorLabelPrefix:"Color",fontSizeLabelPrefix:"Text size",arrangeLabel:"Stacking order",bringToFront:"Bring to front",bringForward:"Bring forward",sendBackward:"Send backward",sendToBack:"Send to back",routeLabelPrefix:"Line",labelField:"Connector label",labelPlaceholder:"Add a label",resizeHandle:"Resize",connectHandle:"Drag to connect",commentCount:t=>`${t} comment${t===1?"":"s"}`,zoomIn:"Zoom in",zoomOut:"Zoom out",zoomFit:"Fit the board",zoomReset:"Reset to 100%",framesHeading:"Frames",framesHint:"Pick a frame to bring it into view.",memberCount:t=>`${t} item${t===1?"":"s"}`,addedTitle:t=>`Added a ${N[t]}`,textEditedTitle:t=>t==="frame"?"Renamed the frame":`Edited the ${N[t]}`,movedTitle:t=>`Moved the ${N[t]}`,resizedTitle:t=>`Resized the ${N[t]}`,recoloredTitle:t=>`Changed the color of the ${N[t]}`,resizedTextTitle:t=>`Changed the text size of the ${N[t]}`,restackedTitle:t=>`Changed the stacking order of the ${N[t]}`,deletedTitle:t=>`Deleted the ${N[t]}`,connectedTitle:"Connected two items",relabeledTitle:"Relabeled the connector",reroutedTitle:"Changed the connector line",disconnectedTitle:"Removed the connector",arrowTo:t=>`\u2192 \u201C${t}\u201D`,arrowFrom:(t,e)=>`\u201C${t}\u201D \u2192 \u201C${e}\u201D`,plain:(t,e)=>`${t} \u2192 ${e}`,added:t=>`+ \u201C${t}\u201D`,deleted:t=>`\u2212 \u201C${t}\u201D`,inFrame:t=>`in frame \u201C${t}\u201D`,intoFrame:t=>`into frame \u201C${t}\u201D`,outOfFrame:t=>`out of frame \u201C${t}\u201D`,betweenFrames:(t,e)=>`frame \u201C${t}\u201D \u2192 frame \u201C${e}\u201D`,position:(t,e)=>`(${t}, ${e})`,size:(t,e)=>`${t}\xD7${e}`,connection:(t,e)=>`\u201C${t}\u201D \u2192 \u201C${e}\u201D`,labeled:t=>`labeled \u201C${t}\u201D`,inFrontOf:t=>`in front of \u201C${t}\u201D`,toBack:"to the very back",empty:"(empty)",noLabel:"(no label)"},ja:{kindLabel:t=>O[t],shapeLabel:t=>No[t],colorLabel:t=>Do[t],fontSizeLabel:t=>Po[t],fontSizeShort:t=>it[t],routeLabel:t=>Ho[t],connector:"\u30B3\u30CD\u30AF\u30BF",board:"\u30DC\u30FC\u30C9",wholeBoard:"\u30DC\u30FC\u30C9\u5168\u4F53",canvasLabel:"\u30DB\u30EF\u30A4\u30C8\u30DC\u30FC\u30C9",emptyHint:"\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3067\u4ED8\u7B8B\u3092\u7F6E\u304F\u304B\u3001\u30C4\u30FC\u30EB\u30D0\u30FC\u304B\u3089\u8FFD\u52A0\u3057\u307E\u3059\u3002",toolsLabel:"\u30DC\u30FC\u30C9\u306B\u8FFD\u52A0",addSticky:"\u4ED8\u7B8B",addText:"\u30C6\u30AD\u30B9\u30C8",addRect:"\u56DB\u89D2\u5F62",addEllipse:"\u6955\u5186",addFrame:"\u30D5\u30EC\u30FC\u30E0",newFrameTitle:"\u65B0\u3057\u3044\u30D5\u30EC\u30FC\u30E0",textPlaceholder:"\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",selectionLabel:"\u9078\u629E\u4E2D\u306E\u8981\u7D20",selectionCount:t=>`${t} \u4EF6\u3092\u9078\u629E\u4E2D`,editText:"\u30C6\u30AD\u30B9\u30C8\u3092\u7DE8\u96C6",renameFrame:"\u30D5\u30EC\u30FC\u30E0\u540D\u3092\u5909\u66F4",comment:"\u30B3\u30E1\u30F3\u30C8",delete:"\u524A\u9664",colorLabelPrefix:"\u8272",fontSizeLabelPrefix:"\u6587\u5B57\u30B5\u30A4\u30BA",arrangeLabel:"\u91CD\u306A\u308A\u9806",bringToFront:"\u6700\u524D\u9762\u3078",bringForward:"\u524D\u9762\u3078",sendBackward:"\u80CC\u9762\u3078",sendToBack:"\u6700\u80CC\u9762\u3078",routeLabelPrefix:"\u7DDA\u306E\u5F62",labelField:"\u30B3\u30CD\u30AF\u30BF\u306E\u30E9\u30D9\u30EB",labelPlaceholder:"\u30E9\u30D9\u30EB\u3092\u8FFD\u52A0",resizeHandle:"\u30B5\u30A4\u30BA\u3092\u5909\u66F4",connectHandle:"\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u3064\u306A\u3050",commentCount:t=>`\u30B3\u30E1\u30F3\u30C8 ${t} \u4EF6`,zoomIn:"\u62E1\u5927",zoomOut:"\u7E2E\u5C0F",zoomFit:"\u30DC\u30FC\u30C9\u5168\u4F53\u3092\u8868\u793A",zoomReset:"100% \u306B\u623B\u3059",framesHeading:"\u30D5\u30EC\u30FC\u30E0",framesHint:"\u30D5\u30EC\u30FC\u30E0\u3092\u9078\u3076\u3068\u305D\u3053\u3078\u79FB\u52D5\u3057\u307E\u3059\u3002",memberCount:t=>`${t} \u4EF6`,addedTitle:t=>`${O[t]}\u3092\u8FFD\u52A0`,textEditedTitle:t=>t==="frame"?"\u30D5\u30EC\u30FC\u30E0\u540D\u3092\u5909\u66F4":`${O[t]}\u306E\u30C6\u30AD\u30B9\u30C8\u3092\u5909\u66F4`,movedTitle:t=>`${O[t]}\u3092\u79FB\u52D5`,resizedTitle:t=>`${O[t]}\u306E\u30B5\u30A4\u30BA\u3092\u5909\u66F4`,recoloredTitle:t=>`${O[t]}\u306E\u8272\u3092\u5909\u66F4`,resizedTextTitle:t=>`${O[t]}\u306E\u6587\u5B57\u30B5\u30A4\u30BA\u3092\u5909\u66F4`,restackedTitle:t=>`${O[t]}\u306E\u91CD\u306A\u308A\u9806\u3092\u5909\u66F4`,deletedTitle:t=>`${O[t]}\u3092\u524A\u9664`,connectedTitle:"\u8981\u7D20\u3092\u3064\u306A\u3044\u3060",relabeledTitle:"\u30B3\u30CD\u30AF\u30BF\u306E\u30E9\u30D9\u30EB\u3092\u5909\u66F4",reroutedTitle:"\u30B3\u30CD\u30AF\u30BF\u306E\u7DDA\u306E\u5F62\u3092\u5909\u66F4",disconnectedTitle:"\u30B3\u30CD\u30AF\u30BF\u3092\u524A\u9664",arrowTo:t=>`\u2192 \u300C${t}\u300D`,arrowFrom:(t,e)=>`\u300C${t}\u300D\u2192\u300C${e}\u300D`,plain:(t,e)=>`${t} \u2192 ${e}`,added:t=>`+ \u300C${t}\u300D`,deleted:t=>`\u2212 \u300C${t}\u300D`,inFrame:t=>`\u30D5\u30EC\u30FC\u30E0\u300C${t}\u300D\u5185`,intoFrame:t=>`\u30D5\u30EC\u30FC\u30E0\u300C${t}\u300D\u3078`,outOfFrame:t=>`\u30D5\u30EC\u30FC\u30E0\u300C${t}\u300D\u306E\u5916\u3078`,betweenFrames:(t,e)=>`\u30D5\u30EC\u30FC\u30E0\u300C${t}\u300D\u2192\u300C${e}\u300D`,position:(t,e)=>`(${t}, ${e})`,size:(t,e)=>`${t}\xD7${e}`,connection:(t,e)=>`\u300C${t}\u300D\u2192\u300C${e}\u300D`,labeled:t=>`\u30E9\u30D9\u30EB\u300C${t}\u300D`,inFrontOf:t=>`\u300C${t}\u300D\u306E\u524D\u9762\u3078`,toBack:"\u6700\u80CC\u9762\u3078",empty:"\uFF08\u7A7A\uFF09",noLabel:"\uFF08\u30E9\u30D9\u30EB\u306A\u3057\uFF09"}}),ue=t=>t===void 0?[]:[...new Set(t.split(",").filter(e=>e!==""))],rt=t=>t.length===0?void 0:t.join(","),st=(t,e)=>t.includes(e)?t.filter(o=>o!==e):[...t,e],at=40,A=(t,e)=>{const o=e.replace(/\s+/g," ").trim();return o===""?t.empty:o.length>at?`${o.slice(0,at-1)}\u2026`:o},Wo=(t,e)=>`${e.kind==="shape"?t.shapeLabel(e.shape):t.kindLabel(e.kind)} \xB7 ${A(t,L(e))}`,E=(t,e,o,n)=>{const i=p(e,n)??p(o,n);return i===void 0?n:A(t,L(i))},Ko=(t,e,o,n=e)=>`${t.connector} \xB7 ${t.connection(E(t,e,n,o.from),E(t,e,n,o.to))}`,qo=(t,e,o,n,i)=>{const r=o===void 0?void 0:D(i,o),s=D(e,n),d=t.position(Math.round(n.x),Math.round(n.y));if(r?.id!==s?.id){if(r!==void 0&&s!==void 0)return`${t.betweenFrames(r.title,s.title)} ${d}`;if(s!==void 0)return`${t.intoFrame(s.title)} ${d}`;if(r!==void 0)return`${t.outOfFrame(r.title)} ${d}`}return o===void 0?`\u2192 ${d}`:t.plain(t.position(Math.round(o.x),Math.round(o.y)),d)},Uo=(t,e,o,n)=>{const i=e.target.id,r=p(n,i),s=p(o,i)??r,d=s?.kind??"sticky";switch(e.type){case"ADD_ITEM":{const a=p(o,e.payload.id)??e.payload,c=D(o,a),l=t.added(A(t,L(a)));return{title:t.addedTitle(a.kind),tone:"create",body:c===void 0?l:`${l} ${t.inFrame(c.title)}`}}case"SET_ITEM_TEXT":{const a=A(t,e.payload.text);return{title:t.textEditedTitle(d),tone:"update",body:r===void 0?t.arrowTo(a):t.arrowFrom(A(t,L(r)),a)}}case"MOVE_ITEM":{if(s===void 0)return{title:t.movedTitle(d),tone:"move"};const a={...s,x:e.payload.x,y:e.payload.y};return{title:t.movedTitle(d),tone:"move",body:qo(t,o,r,a,n)}}case"RESIZE_ITEM":{const a=t.size(Math.round(e.payload.w),Math.round(e.payload.h));return{title:t.resizedTitle(d),tone:"update",body:r===void 0?`\u2192 ${a}`:t.plain(t.size(Math.round(r.w),Math.round(r.h)),a)}}case"SET_ITEM_COLOR":{const a=t.colorLabel(e.payload.color);return{title:t.recoloredTitle(d),tone:"update",body:r!==void 0&&$e(r)?t.plain(t.colorLabel(r.color),a):`\u2192 ${a}`}}case"SET_ITEM_FONT_SIZE":{const a=t.fontSizeLabel(e.payload.fontSize);return{title:t.resizedTextTitle(d),tone:"update",body:r!==void 0&&G(r)?t.plain(t.fontSizeLabel(r.fontSize),a):`\u2192 ${a}`}}case"REORDER_ITEM":{const a=e.payload.after;return{title:t.restackedTitle(d),tone:"move",body:a===null?t.toBack:t.inFrontOf(E(t,o,n,a))}}case"DELETE_ITEM":return{title:t.deletedTitle(d),tone:"delete",body:t.deleted(s===void 0?i:A(t,L(s)))};case"CONNECT_ITEMS":{const a=e.payload,c=t.connection(E(t,o,n,a.from),E(t,o,n,a.to));return{title:t.connectedTitle,tone:"create",body:a.label===void 0||a.label===""?c:`${c} \xB7 ${t.labeled(a.label)}`}}case"SET_CONNECTOR_LABEL":{const a=y(n,i)?.label,c=e.payload.label===""?t.noLabel:e.payload.label;return{title:t.relabeledTitle,tone:"update",body:a===void 0?t.arrowTo(c):t.arrowFrom(a,c)}}case"SET_CONNECTOR_ROUTE":{const a=y(n,i)?.route,c=t.routeLabel(e.payload.route);return{title:t.reroutedTitle,tone:"update",body:a===void 0?`\u2192 ${c}`:t.plain(t.routeLabel(a),c)}}case"DELETE_CONNECTOR":{const a=y(n,i)??y(o,i);return{title:t.disconnectedTitle,tone:"delete",...a===void 0?{}:{body:t.connection(E(t,o,n,a.from),E(t,o,n,a.to))}}}}},dt=(t,e,o,n=o)=>{let i;try{const r=He(ce,e);i=r===null?{title:e.type,tone:"meta"}:Uo(t,r,o,n)}catch{i={title:e.type,tone:"meta"}}return{title:i.title,targetLabel:lt(t,o,e.target,n),tone:i.tone,...i.body===void 0?{}:{summary:i.body}}},ct=t=>`${t.type} ${I(t.target)} ${JSON.stringify(t.payload)}`,lt=(t,e,o,n=e)=>{switch(o.type){case"item":{const i=p(e,o.id)??p(n,o.id);return i===void 0?`${o.type} \xB7 ${o.id} (missing)`:Wo(t,i)}case"connector":{const i=y(e,o.id)??y(n,o.id);return i===void 0?`${t.connector} \xB7 ${o.id} (missing)`:Ko(t,e,i,n)}case"page":return`${t.board} \xB7 ${_e(e)}`;default:return`${o.type} \xB7 ${o.id}`}},ht=(t,e)=>{const o=[{value:"page:whiteboard",label:t.wholeBoard,group:t.board}],n=e.items.filter(r=>r.kind==="frame"),i=e.items.filter(r=>r.kind!=="frame");for(const r of[...n,...i]){const s=D(e,r),d=A(t,L(r));o.push({value:I({type:"item",id:r.id}),label:s===void 0?d:`${s.title} \u203A ${d}`,group:t.kindLabel(r.kind)})}for(const r of e.connectors)o.push({value:I({type:"connector",id:r.id}),label:t.connection(E(t,e,e,r.from),E(t,e,e,r.to)),group:t.connector});return o},pt=(t,e,o)=>{const n=ue(o.item),i=n.length===1?n[0]:void 0,r=p(e,i)??p(e,o.frame);if(r!==void 0)return{value:I({type:"item",id:r.id}),label:A(t,L(r)),group:t.kindLabel(r.kind)};const s=y(e,i);return s===void 0?null:{value:I({type:"connector",id:s.id}),label:t.connection(E(t,e,e,s.from),E(t,e,e,s.to)),group:t.connector}},_e=t=>t.title??"Whiteboard",ut=(t,e)=>{const o={...e};p(t,e.frame)?.kind!=="frame"&&delete o.frame;const n=ue(e.item),i=n.filter(d=>p(t,d)!==void 0),r=n.length===1?y(t,n[0]):void 0,s=rt(r===void 0?i:[r.id]);return s===void 0?delete o.item:o.item=s,o},bt=(t,e)=>{switch(e.type){case"item":return p(t,e.id)!==void 0;case"connector":return y(t,e.id)!==void 0;case"page":return!0;default:return!1}},ft=t=>{const e=pe(t);return{name:"whiteboard",label:"Whiteboard",parseBase:Ye,emptyBase:je,actions:ce,apply:tt,canonicalState:o=>({...o,items:ze(o)}),hasTarget:bt,describe:(o,n,i)=>dt(e,o,n,i),serialize:ct,resolveNavigation:ut,navigationHierarchy:["frame","item"],commentTargets:o=>ht(e,o),currentTarget:(o,n)=>pt(e,o,n),title:_e}},mt=["front","forward","backward","back"],wt=t=>t.items.filter(e=>e.kind!=="frame"),xt=(t,e,o,n)=>{const i=t.indexOf(e),r=(n?t.slice(i+1):t.slice(0,i).reverse()).filter(c=>!o.has(c.id)),s=r.find(c=>he(e,c,0))??r[0];if(s===void 0)return t;const d=t.filter(c=>c!==e),a=d.indexOf(s)+(n?1:0);return[...d.slice(0,a),e,...d.slice(a)]},yt=(t,e,o)=>{const n=t.filter(r=>e.has(r.id)),i=t.filter(r=>!e.has(r.id));switch(o){case"front":return[...i,...n];case"back":return[...n,...i];case"forward":return[...n].reverse().reduce((r,s)=>xt(r,s,e,!0),[...t]);case"backward":return n.reduce((r,s)=>xt(r,s,e,!1),[...t])}},Zo=(t,e,o)=>{let n=t.map(r=>r.id);const i=[];return e.forEach((r,s)=>{if(!o.has(r.id))return;const d=e[s-1]?.id??null,a=n.indexOf(r.id);(n[a-1]??null)!==d&&(n=n.filter(c=>c!==r.id),n.splice(d===null?0:n.indexOf(d)+1,0,r.id),i.push(k.reorder(r.id,d)))}),i},Xo=(t,e,o)=>{const n=wt(t),i=new Set(e.filter(r=>n.some(s=>s.id===r)));return i.size===0?[]:Zo(n,yt(n,i,o),i)},Go=(t,e)=>{const o=wt(t),n=new Set(e.filter(s=>o.some(d=>d.id===s))),i=o.flatMap(s=>n.has(s.id)?o.filter(d=>!n.has(d.id)&&he(s,d,0)).map(d=>[s,d]):[]),r=(s,[d,a])=>s.indexOf(d)>s.indexOf(a);return new Set(mt.filter(s=>{const d=yt(o,n,s);return i.some(a=>r(o,a)!==r(d,a))}))},kt=(t,e,o)=>{if(!t.contains(e)||e.nodeType!==Node.TEXT_NODE)return;let n=0;const i=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(let r=i.nextNode();r!==null;r=i.nextNode()){if(r===e)return n+o;n+=r.textContent?.length??0}},Vo=(t,e,o)=>{const n=t.getRootNode(),i=t.ownerDocument;if(typeof i.caretPositionFromPoint=="function"){const r=n instanceof ShadowRoot?[n]:[],s=i.caretPositionFromPoint(e,o,{shadowRoots:r});if(s!==null)return kt(t,s.offsetNode,s.offset)}if(typeof i.caretRangeFromPoint=="function"){const r=i.caretRangeFromPoint(e,o);if(r!==null)return kt(t,r.startContainer,r.startOffset)}},Yo=["sticky","text","rect","ellipse","frame"],jo=t=>t==="rect"||t==="ellipse"?C.shape:C[t],Jo=(t,e,o,n)=>{const{w:i,h:r}=jo(o),s={x:Math.round(n.x-i/2),y:Math.round(n.y-r/2)},d=Io(t,{...s,w:i,h:r},o==="frame"),l={id:We(`new-${o==="rect"||o==="ellipse"?"shape":o}`,Je(t)),x:d.x,y:d.y,w:i,h:r};switch(o){case"sticky":return{...l,kind:"sticky",text:"",color:H.sticky,fontSize:se};case"text":return{...l,kind:"text",text:"",fontSize:se};case"rect":case"ellipse":return{...l,kind:"shape",shape:o,text:"",color:H.shape,fontSize:se};case"frame":return{...l,kind:"frame",title:e.newFrameTitle,color:H.frame}}},Qo=(t,e,o)=>We(`${e}-to-${o}`,Je(t)),en=(t,e)=>{const o=(t.kind==="frame"?e.replace(/\r?\n/g," "):e).trim();if(!(t.kind==="frame"&&o===""))return o===L(t)?void 0:o},be=4,Le=(t,e,o,n,i=[e])=>{if(p(t,e)===void 0)return;const r=new Map;for(const s of i.includes(e)?i:[e,...i]){const d=p(t,s);if(d!==void 0)for(const a of d.kind==="frame"?[d,...Ee(t,d)]:[d])r.set(a.id,a)}return{kind:"move",pointerId:o,itemId:e,origins:[...r.values()].map(({id:s,x:d,y:a})=>({id:s,x:d,y:a})),start:n,current:n,moved:!1}},tn=(t,e,o,n)=>{const i=p(t,e);if(i!==void 0)return{kind:"resize",pointerId:o,itemId:e,origin:{w:i.w,h:i.h},start:n,current:n,moved:!1,keepRatio:!1}},on=(t,e)=>({kind:"pan",pointerId:t,start:e,last:e,moved:!1}),nn=(t,e)=>({gesture:{...t,last:e,moved:t.moved||Math.hypot(e.x-t.start.x,e.y-t.start.y)>be},dx:e.x-t.last.x,dy:e.y-t.last.y}),gt=(t,e,o)=>({kind:"marquee",pointerId:t,base:o,start:e,current:e,moved:!1}),rn=(t,e,o,n,i)=>{const r=Mo(t,n).find(d=>e.includes(d.id));return(r===void 0?void 0:Le(t,r.id,o,n,e))??gt(o,n,i)},vt=t=>t?.kind==="marquee"&&t.moved?_o(t.start,t.current):void 0,$t=(t,e)=>{const o=vt(e);if(e.kind!=="marquee"||o===void 0)return[];const n=Oo(t,o).map(i=>i.id);return[...new Set([...e.base,...n])]},sn=(t,e,o)=>({kind:"connect",pointerId:e,fromId:t,start:o,current:o,moved:!1}),Oe=(t,e,o,n,i,r=!1)=>{if(e.pointerId!==o)return e;switch(e.kind){case"pan":return e;case"marquee":case"move":{const s=e.moved||Math.hypot(n.x-e.start.x,n.y-e.start.y)*i>be;return{...e,current:n,moved:s}}case"resize":{const s=e.moved||Math.hypot(n.x-e.start.x,n.y-e.start.y)*i>be;return{...e,current:n,moved:s,keepRatio:r}}case"connect":{const s=e.moved||Math.hypot(n.x-e.start.x,n.y-e.start.y)*i>be,d=Me(t,n,e.fromId),{targetId:a,...c}=e;return d===void 0?{...c,current:n,moved:s}:{...c,current:n,moved:s,targetId:d.id}}}},q=t=>Math.round(t),Et=(t,e)=>{if(e===void 0||!e.moved)return t;if(e.kind==="move"){const o=e.current.x-e.start.x,n=e.current.y-e.start.y,i=new Map(e.origins.map(r=>[r.id,r]));return{...t,items:t.items.map(r=>{const s=i.get(r.id);return s===void 0?r:{...r,x:q(s.x+o),y:q(s.y+n)}})}}if(e.kind==="resize"){const o=Tt(e);return{...t,items:t.items.map(n=>n.id===e.itemId?{...n,...o}:n)}}return t},Tt=t=>{const{origin:e}=t,o=e.w+t.current.x-t.start.x,n=e.h+t.current.y-t.start.y;if(!t.keepRatio)return{w:Math.max(X,q(o)),h:Math.max(X,q(n))};const i=Math.max(o/e.w,n/e.h,X/Math.min(e.w,e.h));return{w:q(e.w*i),h:q(e.h*i)}},an=(t,e,o,n)=>{const[i]=e;if(i===void 0)return[];const r=Le(t,i,0,{x:0,y:0},e);if(r?.kind!=="move")return[];const s=zt(t,{...r,current:{x:o,y:n},moved:!0});return s.kind==="dispatch"?s.inputs:[]},zt=(t,e)=>{switch(e.kind){case"pan":return e.moved?{kind:"none"}:{kind:"click"};case"marquee":{if(e.moved)return{kind:"select",ids:$t(t,e)};const o=Me(t,e.start);return o===void 0?{kind:"click"}:{kind:"click",itemId:o.id}}case"move":{if(!e.moved)return{kind:"click",itemId:e.itemId};const o=Et(t,e),n=e.origins.flatMap(i=>{const r=p(o,i.id);return r===void 0||r.x===i.x&&r.y===i.y?[]:[k.move(i.id,r.x,r.y)]});return n.length===0?{kind:"none"}:{kind:"dispatch",inputs:n}}case"resize":{if(!e.moved)return{kind:"click",itemId:e.itemId};const o=Tt(e);return o.w===e.origin.w&&o.h===e.origin.h?{kind:"none"}:{kind:"dispatch",inputs:[k.resize(e.itemId,o.w,o.h)]}}case"connect":return e.moved?e.targetId===void 0?{kind:"none"}:{kind:"connect",from:e.fromId,to:e.targetId}:{kind:"click",itemId:e.fromId}}},j=.1,St=2.5,dn={x:0,y:0,zoom:1},cn=96,Ie=(t,e)=>({x:(e.x-t.x)/t.zoom,y:(e.y-t.y)/t.zoom}),Ce=(t,e)=>({x:e.x*t.zoom+t.x,y:e.y*t.zoom+t.y}),fe=(t,e,o)=>({...t,x:t.x+e,y:t.y+o}),Re=(t,e,o)=>{const n=ke(t.zoom*o,j,St),i=Ie(t,e);return{zoom:n,x:e.x-i.x*n,y:e.y-i.y*n}},Mt=(t,e,o=48,n=1)=>{const i=Math.max(1,e.width-o*2),r=Math.max(1,e.height-o*2),s=ke(Math.min(i/Math.max(1,t.w),r/Math.max(1,t.h)),j,n);return{zoom:s,x:e.width/2-(t.x+t.w/2)*s,y:e.height/2-(t.y+t.h/2)*s}},ln=(t,e,o=48)=>{const n=W(t);if(n===null)return null;const i=Math.max(1,e.width-o*2)/j,r=Math.max(1,e.height-o*2)/j;if(n.w<=i&&n.h<=r)return n;const s=qe(t.map(c=>c.x+c.w/2)),d=qe(t.map(c=>c.y+c.h/2)),a=t.filter(c=>c.x<s+i/2&&c.x+c.w>s-i/2&&c.y<d+r/2&&c.y+c.h>d-r/2);return W(a)??n},_t=(t,e,o)=>{if(e===null||o.width<=0||o.height<=0)return t;const n=(i,r,s,d)=>{const a=Math.min(cn,d/2),c=a-(r+s)*t.zoom,l=d-a-r*t.zoom;return ke(i,Math.min(c,l),Math.max(c,l))};return{zoom:t.zoom,x:n(t.x,e.x,e.w,o.width),y:n(t.y,e.y,e.h,o.height)}},Lt=(t,e,o,n=24)=>{const i=e.x*t.zoom+t.x,r=e.y*t.zoom+t.y,s=i+e.w*t.zoom,d=r+e.h*t.zoom;return i>=n&&r>=n&&s<=o.width-n&&d<=o.height-n?t:{zoom:t.zoom,x:o.width/2-(e.x+e.w/2)*t.zoom,y:o.height/2-(e.y+e.h/2)*t.zoom}},Ot=(t,e,o,n,i=0)=>{const r=t+e-(o-n),s=r>0?-r:0;return t+s<i+n?i+n-t:s},hn=(t,e)=>t.x===e.x&&t.y===e.y&&t.zoom===e.zoom,v={kind:"idle"},J=(t,e)=>t.kind==="editing"&&t.itemId===e,pn={front:_(uo),forward:_(jt),backward:_(Yt),back:_(mo)},It=[["circle",{cx:"19",cy:"5",r:"2"}],["circle",{cx:"5",cy:"19",r:"2"}]],un={straight:_([...It,["path",{d:"M6.5 17.5 17.5 6.5"}]]),elbow:_([...It,["path",{d:"M7 19h5V5h5"}]]),curve:_(wo)},bn=t=>pn[t](),fn=t=>un[t](),mn=_(bo),wn=_(fo),xn={yellow:{paper:"#fff0a3",ink:"#4a3a06",stroke:"#d9a900"},orange:{paper:"#ffd1a0",ink:"#4a2503",stroke:"#ec7f1d"},pink:{paper:"#ffc9dd",ink:"#4b1029",stroke:"#de4479"},purple:{paper:"#ddcbf8",ink:"#32195c",stroke:"#8a5bd6"},blue:{paper:"#c0ddf7",ink:"#0e2c4b",stroke:"#3a80d4"},green:{paper:"#cdeba5",ink:"#22380a",stroke:"#55a42c"},gray:{paper:"#e3e6eb",ink:"#2a2f38",stroke:"#868d99"}},Ne=t=>{const{paper:e,ink:o,stroke:n}=xn[t];return`--wb-paper:${e};--wb-ink:${o};--wb-stroke:${n}`},Ct={sticky:"addSticky",text:"addText",rect:"addRect",ellipse:"addEllipse",frame:"addFrame"},Rt={small:.8,medium:1,large:1.4,xlarge:2},yn=t=>{const e=24*t.zoom;return`background-size:${e}px ${e}px;background-position:${t.x}px ${t.y}px`},kn=t=>{const{m:e,state:o,viewport:n,gesture:i,handlers:r}=t,s=["wb-canvas"];i?.moved===!0&&s.push("wb-canvas--gesturing"),i?.kind==="pan"&&i.moved&&s.push("wb-canvas--panning"),i?.kind==="connect"&&s.push("wb-canvas--connecting"),(t.panReady||i?.kind==="pan")&&s.push("wb-canvas--pan-ready");const d=ze(o);return h`<div
|
|
2
2
|
class=${s.join(" ")}
|
|
3
3
|
data-testid="wb-canvas"
|
|
4
4
|
tabindex="0"
|
|
@@ -1,4 +1,4 @@
|
|
|
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 A,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-C1OgX-P6.js";import{s as Re}from"./shared-D4K7KsfJ.js";import{c as H}from"./shared-ml5h7U5L.js";const qe=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",qe)},M=(t,e)=>({type:"ANSWER_QUESTION",target:{type:"question",id:t},payload:e}),Ae=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(A(Ae),[]),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:A(Ee)}),U=f({title:k(c(),""),questions:A(_),history:k(A(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))})))},q="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(`[${q}]`)){const u=l.getAttribute(q)??"";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`
|
|
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 A,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-DXaIVZ_z.js";import{s as Re}from"./shared-D4K7KsfJ.js";import{c as H}from"./shared-ml5h7U5L.js";const qe=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",qe)},M=(t,e)=>({type:"ANSWER_QUESTION",target:{type:"question",id:t},payload:e}),Ae=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(A(Ae),[]),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:A(Ee)}),U=f({title:k(c(),""),questions:A(_),history:k(A(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))})))},q="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(`[${q}]`)){const u=l.getAttribute(q)??"";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
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>
|
package/dist/components.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a}from"./chunks/shared-
|
|
1
|
+
import{r as a}from"./chunks/shared-DWY93NpU.js";import{D as e,a as s,b as n,c as t,d as o,e as r,f as i,g as p,h as m,i as c,j as d,k as D,l as f,m as l,n as g,o as C,p as S,q as A,s as E,t as M,u as k,v as u}from"./chunks/shared-DWY93NpU.js";import{s as y}from"./chunks/shared-DXaIVZ_z.js";import{C as h,a as T,D as I,b as v,c as K,E as N,F as O,M as b,T as R,W as P,d as q,e as F,f as G,g as j,h as w,i as _,j as B,k as H,l as V,m as W,n as x,o as z,p as L,q as U,r as Y,t as J,u as Q,v as X,w as Z,x as $,y as aa,z as ea,A as sa,B as na,G as ta,H as oa,I as ra,J as ia,K as pa,L as ma,N as ca,O as da,P as Da,Q as fa,R as la,S as ga,U as Ca,V as Sa,X as Aa,Y as Ea,Z as Ma}from"./chunks/shared-DXaIVZ_z.js";y({entry:"components.js",templates:[],register:()=>{a()}});export{h as COMMENT_ACTION,T as COMMENT_DESCRIPTOR,e as DpkComponentArchitectureMap,I as DpkComponentCommentPanel,s as DpkComponentDependencyGraph,n as DpkComponentErDiagram,t as DpkComponentFormalSpec,v as DpkComponentInlineEdit,o as DpkComponentKanban,r as DpkComponentMindMap,i as DpkComponentSequenceDiagram,p as DpkComponentStateDiagram,K as DraftController,N as EMPTY_NAVIGATION,O as FRAMEWORK_VERSION,b as MemoryDraftStorage,R as TemplateElement,P as WebStorageDraftStorage,q as appendAction,F as assertNever,G as buildAgentBrief,j as commentActionSchema,w as commentBody,_ as commentTargetKey,B as controls,H as createActionId,V as createEntityId,W as dedupeKeyOf,x as defaultStorage,z as defaultStorageKey,L as defineAction,m as defineArchitectureMap,U as defineCommentPanel,c as defineDependencyGraph,d as defineErDiagram,D as defineFormalSpec,Y as defineInlineEdit,f as defineKanban,l as defineMindMap,g as defineSequenceDiagram,C as defineStateDiagram,J as derive,Q as draftActionEnvelopeSchema,X as entityDedupeKey,Z as formatHash,$ as iconArrowDown,aa as iconArrowUp,ea as iconClose,sa as iconComment,na as iconGrip,ta as iconLink,oa as iconMove,ra as iconPencil,ia as iconPlus,pa as iconTrash,ma as liveActions,S as parseFormalSpecData,ca as parseHash,A as parseKanbanData,E as parseMindMapData,M as parseSequenceData,k as parseStateData,da as parseTargetRef,Da as parseTemplateAction,fa as patchNavigation,la as payloadFor,a as registerComponentElements,u as registerDiagramElements,ga as serializeDraft,Ca as slugify,Sa as targetRef,Aa as targetSchema,Ea as toTarget,Ma as tokens};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./chunks/shared-
|
|
1
|
+
import{r as e}from"./chunks/shared-DWY93NpU.js";import{D as r,a as s,b as i,c as m,d as n,e as p,f as l,g as f,v as d}from"./chunks/shared-DWY93NpU.js";import{s as g,_ as E,$ as D,F as t}from"./chunks/shared-DXaIVZ_z.js";import{C as c,D as k,b as C,c as y,M as S,T as M,W as b,e as u,f as A,h as T,l as h,n as v,o as P,p as R,t as N,v as O,w as x,N as I,O as B,P as F,Q as K,R as W,U as _,V as w}from"./chunks/shared-DXaIVZ_z.js";import{d as V}from"./chunks/shared-CUPe-wfx.js";import{i as G}from"./chunks/shared-CUPe-wfx.js";import{d as H}from"./chunks/shared-DEjjuQMh.js";import{i as U}from"./chunks/shared-DEjjuQMh.js";import{d as j}from"./chunks/shared-B00JP4in.js";import{i as q}from"./chunks/shared-B00JP4in.js";import{d as L}from"./chunks/shared-IQ2sflGo.js";import{i as Q}from"./chunks/shared-IQ2sflGo.js";import{d as $}from"./chunks/shared-DzxR5Yzc.js";import{i as z}from"./chunks/shared-DzxR5Yzc.js";import{d as J}from"./chunks/shared-C6QYWD8M.js";import{i as X}from"./chunks/shared-C6QYWD8M.js";import{d as Y}from"./chunks/shared-8NAMqG0U.js";import{i as Z}from"./chunks/shared-8NAMqG0U.js";import{d as ee}from"./chunks/shared-DRvgJdY6.js";import{i as ae}from"./chunks/shared-DRvgJdY6.js";import{d as te}from"./chunks/shared-CpTDkEui.js";import{i as oe}from"./chunks/shared-CpTDkEui.js";import{d as re}from"./chunks/shared-Ezic-gbC.js";import{i as se}from"./chunks/shared-Ezic-gbC.js";const a=()=>{J(),te(),H(),j(),L(),$(),Y(),ee(),V(),re()},o=["prototype","usm","event-storming","example-mapping","grill","plain","slides","task-board","delegation-poker","whiteboard"],ie=()=>{e(),a(),E(t,o,D)};g({entry:"index.js",templates:o,register:()=>{e(),a()}});export{c as COMMENT_ACTION,r as DpkComponentArchitectureMap,k as DpkComponentCommentPanel,s as DpkComponentDependencyGraph,i as DpkComponentErDiagram,m as DpkComponentFormalSpec,C as DpkComponentInlineEdit,n as DpkComponentKanban,p as DpkComponentMindMap,l as DpkComponentSequenceDiagram,f as DpkComponentStateDiagram,y as DraftController,t as FRAMEWORK_VERSION,S as MemoryDraftStorage,M as TemplateElement,b as WebStorageDraftStorage,u as assertNever,A as buildAgentBrief,T as commentBody,h as createEntityId,v as defaultStorage,P as defaultStorageKey,R as defineAction,G as delegationPoker,N as derive,O as entityDedupeKey,U as eventStorming,q as exampleMapping,x as formatHash,Q as grill,I as parseHash,B as parseTargetRef,F as parseTemplateAction,K as patchNavigation,W as payloadFor,z as plain,X as prototype,ie as registerAllElements,e as registerComponentElements,d as registerDiagramElements,a as registerTemplateElements,Z as slides,_ as slugify,w as targetRef,ae as taskBoard,oe as usm,se as whiteboard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as a,q as e,r as s}from"../chunks/shared-
|
|
1
|
+
import{s as a,q as e,r as s}from"../chunks/shared-DXaIVZ_z.js";import{C as t,a as o,D as n,b as r,c as i,E as m,F as c,M as l,T as p,W as d,d as f,e as g,f as A,g as E,h as y,i as T,j as C,k as D,l as S,m as I,n as k,o as M,p as N,t as O,u as P,v as h,w as u,x as R,y as v,z as K,A as w,B as _,G as b,H as B,I as F,J as G,K as H,L as V,N as W,O as j,P as x,Q as z,R as L,S as U,U as Y,V as q,X as J,Y as Q,Z as X}from"../chunks/shared-DXaIVZ_z.js";import{d as Z}from"../chunks/shared-CUPe-wfx.js";import{i as $}from"../chunks/shared-CUPe-wfx.js";a({entry:"templates/delegation-poker.js",templates:["delegation-poker"],register:()=>{e(),s(),Z()}});export{t as COMMENT_ACTION,o as COMMENT_DESCRIPTOR,n as DpkComponentCommentPanel,r as DpkComponentInlineEdit,i as DraftController,m as EMPTY_NAVIGATION,c as FRAMEWORK_VERSION,l as MemoryDraftStorage,p as TemplateElement,d as WebStorageDraftStorage,f as appendAction,g as assertNever,A as buildAgentBrief,E as commentActionSchema,y as commentBody,T as commentTargetKey,C as controls,D as createActionId,S as createEntityId,I as dedupeKeyOf,k as defaultStorage,M as defaultStorageKey,N as defineAction,$ as delegationPoker,O as derive,P as draftActionEnvelopeSchema,h as entityDedupeKey,u as formatHash,R as iconArrowDown,v as iconArrowUp,K as iconClose,w as iconComment,_ as iconGrip,b as iconLink,B as iconMove,F as iconPencil,G as iconPlus,H as iconTrash,V as liveActions,W as parseHash,j as parseTargetRef,x as parseTemplateAction,z as patchNavigation,L as payloadFor,U as serializeDraft,Y as slugify,q as targetRef,J as targetSchema,Q as toTarget,X as tokens};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as a,q as e,r as s}from"../chunks/shared-
|
|
1
|
+
import{s as a,q as e,r as s}from"../chunks/shared-DXaIVZ_z.js";import{C as t,a as o,D as n,b as r,c as i,E as m,F as c,M as p,T as l,W as f,d,e as g,f as A,g as E,h as y,i as S,j as T,k as C,l as v,m as D,n as I,o as M,p as N,t as O,u as h,v as u,w as R,x as P,y as K,z as k,A as w,B as _,G as b,H as B,I as F,J as G,K as H,L as V,N as W,O as j,P as x,Q as z,R as L,S as U,U as Y,V as q,X as J,Y as Q,Z as X}from"../chunks/shared-DXaIVZ_z.js";import{d as Z}from"../chunks/shared-DEjjuQMh.js";import{i as $}from"../chunks/shared-DEjjuQMh.js";a({entry:"templates/event-storming.js",templates:["event-storming"],register:()=>{e(),s(),Z()}});export{t as COMMENT_ACTION,o as COMMENT_DESCRIPTOR,n as DpkComponentCommentPanel,r as DpkComponentInlineEdit,i as DraftController,m as EMPTY_NAVIGATION,c as FRAMEWORK_VERSION,p as MemoryDraftStorage,l as TemplateElement,f as WebStorageDraftStorage,d as appendAction,g as assertNever,A as buildAgentBrief,E as commentActionSchema,y as commentBody,S as commentTargetKey,T as controls,C as createActionId,v as createEntityId,D as dedupeKeyOf,I as defaultStorage,M as defaultStorageKey,N as defineAction,O as derive,h as draftActionEnvelopeSchema,u as entityDedupeKey,$ as eventStorming,R as formatHash,P as iconArrowDown,K as iconArrowUp,k as iconClose,w as iconComment,_ as iconGrip,b as iconLink,B as iconMove,F as iconPencil,G as iconPlus,H as iconTrash,V as liveActions,W as parseHash,j as parseTargetRef,x as parseTemplateAction,z as patchNavigation,L as payloadFor,U as serializeDraft,Y as slugify,q as targetRef,J as targetSchema,Q as toTarget,X as tokens};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as a,q as e,r as s}from"../chunks/shared-
|
|
1
|
+
import{s as a,q as e,r as s}from"../chunks/shared-DXaIVZ_z.js";import{C as t,a as o,D as n,b as r,c as i,E as m,F as p,M as c,T as l,W as f,d,e as g,f as A,g as E,h as y,i as T,j as C,k as M,l as S,m as D,n as I,o as N,p as O,t as h,u,v as R,w as v,x as P,y as x,z as K,A as k,B as w,G as _,H as b,I as B,J as F,K as G,L as H,N as V,O as W,P as j,Q as z,R as L,S as U,U as Y,V as q,X as J,Y as Q,Z as X}from"../chunks/shared-DXaIVZ_z.js";import{d as Z}from"../chunks/shared-B00JP4in.js";import{i as $}from"../chunks/shared-B00JP4in.js";a({entry:"templates/example-mapping.js",templates:["example-mapping"],register:()=>{e(),s(),Z()}});export{t as COMMENT_ACTION,o as COMMENT_DESCRIPTOR,n as DpkComponentCommentPanel,r as DpkComponentInlineEdit,i as DraftController,m as EMPTY_NAVIGATION,p as FRAMEWORK_VERSION,c as MemoryDraftStorage,l as TemplateElement,f as WebStorageDraftStorage,d as appendAction,g as assertNever,A as buildAgentBrief,E as commentActionSchema,y as commentBody,T as commentTargetKey,C as controls,M as createActionId,S as createEntityId,D as dedupeKeyOf,I as defaultStorage,N as defaultStorageKey,O as defineAction,h as derive,u as draftActionEnvelopeSchema,R as entityDedupeKey,$ as exampleMapping,v as formatHash,P as iconArrowDown,x as iconArrowUp,K as iconClose,k as iconComment,w as iconGrip,_ as iconLink,b as iconMove,B as iconPencil,F as iconPlus,G as iconTrash,H as liveActions,V as parseHash,W as parseTargetRef,j as parseTemplateAction,z as patchNavigation,L as payloadFor,U as serializeDraft,Y as slugify,q as targetRef,J as targetSchema,Q as toTarget,X as tokens};
|
package/dist/templates/grill.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as a,q as e,r as s}from"../chunks/shared-
|
|
1
|
+
import{s as a,q as e,r as s}from"../chunks/shared-DXaIVZ_z.js";import{C as t,a as o,D as r,b as n,c as i,E as m,F as l,M as c,T as p,W as f,d,e as g,f as A,g as E,h as y,i as T,j as C,k as S,l as D,m as I,n as M,o as N,p as O,t as h,u,v as R,w as v,x as P,y as K,z as k,A as w,B as G,G as _,H as b,I as B,J as F,K as H,L as V,N as W,O as j,P as x,Q as z,R as L,S as U,U as Y,V as q,X as J,Y as Q,Z as X}from"../chunks/shared-DXaIVZ_z.js";import{d as Z}from"../chunks/shared-IQ2sflGo.js";import{i as $}from"../chunks/shared-IQ2sflGo.js";a({entry:"templates/grill.js",templates:["grill"],register:()=>{e(),s(),Z()}});export{t as COMMENT_ACTION,o as COMMENT_DESCRIPTOR,r as DpkComponentCommentPanel,n as DpkComponentInlineEdit,i as DraftController,m as EMPTY_NAVIGATION,l as FRAMEWORK_VERSION,c as MemoryDraftStorage,p as TemplateElement,f as WebStorageDraftStorage,d as appendAction,g as assertNever,A as buildAgentBrief,E as commentActionSchema,y as commentBody,T as commentTargetKey,C as controls,S as createActionId,D as createEntityId,I as dedupeKeyOf,M as defaultStorage,N as defaultStorageKey,O as defineAction,h as derive,u as draftActionEnvelopeSchema,R as entityDedupeKey,v as formatHash,$ as grill,P as iconArrowDown,K as iconArrowUp,k as iconClose,w as iconComment,G as iconGrip,_ as iconLink,b as iconMove,B as iconPencil,F as iconPlus,H as iconTrash,V as liveActions,W as parseHash,j as parseTargetRef,x as parseTemplateAction,z as patchNavigation,L as payloadFor,U as serializeDraft,Y as slugify,q as targetRef,J as targetSchema,Q as toTarget,X as tokens};
|
package/dist/templates/plain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as a,q as e,r as s}from"../chunks/shared-
|
|
1
|
+
import{s as a,q as e,r as s}from"../chunks/shared-DXaIVZ_z.js";import{C as t,a as o,D as n,b as r,c as i,E as m,F as c,M as l,T as p,W as f,d,e as g,f as A,g as E,h as y,i as T,j as C,k as S,l as D,m as I,n as M,o as N,p as O,t as h,u,v as P,w as R,x as v,y as K,z as k,A as w,B as _,G as b,H as B,I as F,J as G,K as H,L as V,N as W,O as j,P as x,Q as z,R as L,S as U,U as Y,V as q,X as J,Y as Q,Z as X}from"../chunks/shared-DXaIVZ_z.js";import{d as Z}from"../chunks/shared-DzxR5Yzc.js";import{i as $}from"../chunks/shared-DzxR5Yzc.js";a({entry:"templates/plain.js",templates:["plain"],register:()=>{e(),s(),Z()}});export{t as COMMENT_ACTION,o as COMMENT_DESCRIPTOR,n as DpkComponentCommentPanel,r as DpkComponentInlineEdit,i as DraftController,m as EMPTY_NAVIGATION,c as FRAMEWORK_VERSION,l as MemoryDraftStorage,p as TemplateElement,f as WebStorageDraftStorage,d as appendAction,g as assertNever,A as buildAgentBrief,E as commentActionSchema,y as commentBody,T as commentTargetKey,C as controls,S as createActionId,D as createEntityId,I as dedupeKeyOf,M as defaultStorage,N as defaultStorageKey,O as defineAction,h as derive,u as draftActionEnvelopeSchema,P as entityDedupeKey,R as formatHash,v as iconArrowDown,K as iconArrowUp,k as iconClose,w as iconComment,_ as iconGrip,b as iconLink,B as iconMove,F as iconPencil,G as iconPlus,H as iconTrash,V as liveActions,W as parseHash,j as parseTargetRef,x as parseTemplateAction,z as patchNavigation,L as payloadFor,$ as plain,U as serializeDraft,Y as slugify,q as targetRef,J as targetSchema,Q as toTarget,X as tokens};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as a,q as e,r as t}from"../chunks/shared-
|
|
1
|
+
import{s as a,q as e,r as t}from"../chunks/shared-DXaIVZ_z.js";import{C as s,a as o,D as r,b as n,c as i,E as m,F as p,M as c,T as l,W as f,d,e as y,f as g,g as A,h as E,i as T,j as C,k as S,l as D,m as I,n as M,o as N,p as O,t as h,u,v as P,w as R,x as v,y as K,z as k,A as w,B as _,G as b,H as B,I as F,J as G,K as H,L as V,N as W,O as j,P as x,Q as z,R as L,S as U,U as Y,V as q,X as J,Y as Q,Z as X}from"../chunks/shared-DXaIVZ_z.js";import{d as Z}from"../chunks/shared-C6QYWD8M.js";import{i as $}from"../chunks/shared-C6QYWD8M.js";a({entry:"templates/prototype.js",templates:["prototype"],register:()=>{e(),t(),Z()}});export{s as COMMENT_ACTION,o as COMMENT_DESCRIPTOR,r as DpkComponentCommentPanel,n as DpkComponentInlineEdit,i as DraftController,m as EMPTY_NAVIGATION,p as FRAMEWORK_VERSION,c as MemoryDraftStorage,l as TemplateElement,f as WebStorageDraftStorage,d as appendAction,y as assertNever,g as buildAgentBrief,A as commentActionSchema,E as commentBody,T as commentTargetKey,C as controls,S as createActionId,D as createEntityId,I as dedupeKeyOf,M as defaultStorage,N as defaultStorageKey,O as defineAction,h as derive,u as draftActionEnvelopeSchema,P as entityDedupeKey,R as formatHash,v as iconArrowDown,K as iconArrowUp,k as iconClose,w as iconComment,_ as iconGrip,b as iconLink,B as iconMove,F as iconPencil,G as iconPlus,H as iconTrash,V as liveActions,W as parseHash,j as parseTargetRef,x as parseTemplateAction,z as patchNavigation,L as payloadFor,$ as prototype,U as serializeDraft,Y as slugify,q as targetRef,J as targetSchema,Q as toTarget,X as tokens};
|
package/dist/templates/slides.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as a,q as e,r as s}from"../chunks/shared-
|
|
1
|
+
import{s as a,q as e,r as s}from"../chunks/shared-DXaIVZ_z.js";import{C as t,a as o,D as n,b as r,c as i,E as m,F as c,M as l,T as p,W as d,d as f,e as g,f as A,g as E,h as y,i as T,j as C,k as S,l as D,m as I,n as M,o as N,p as O,t as h,u,v as R,w as v,x as P,y as K,z as k,A as w,B as _,G as b,H as B,I as F,J as G,K as H,L as V,N as W,O as j,P as x,Q as z,R as L,S as U,U as Y,V as q,X as J,Y as Q,Z as X}from"../chunks/shared-DXaIVZ_z.js";import{d as Z}from"../chunks/shared-8NAMqG0U.js";import{i as $}from"../chunks/shared-8NAMqG0U.js";a({entry:"templates/slides.js",templates:["slides"],register:()=>{e(),s(),Z()}});export{t as COMMENT_ACTION,o as COMMENT_DESCRIPTOR,n as DpkComponentCommentPanel,r as DpkComponentInlineEdit,i as DraftController,m as EMPTY_NAVIGATION,c as FRAMEWORK_VERSION,l as MemoryDraftStorage,p as TemplateElement,d as WebStorageDraftStorage,f as appendAction,g as assertNever,A as buildAgentBrief,E as commentActionSchema,y as commentBody,T as commentTargetKey,C as controls,S as createActionId,D as createEntityId,I as dedupeKeyOf,M as defaultStorage,N as defaultStorageKey,O as defineAction,h as derive,u as draftActionEnvelopeSchema,R as entityDedupeKey,v as formatHash,P as iconArrowDown,K as iconArrowUp,k as iconClose,w as iconComment,_ as iconGrip,b as iconLink,B as iconMove,F as iconPencil,G as iconPlus,H as iconTrash,V as liveActions,W as parseHash,j as parseTargetRef,x as parseTemplateAction,z as patchNavigation,L as payloadFor,U as serializeDraft,$ as slides,Y as slugify,q as targetRef,J as targetSchema,Q as toTarget,X as tokens};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as a,q as e,r as s}from"../chunks/shared-
|
|
1
|
+
import{s as a,q as e,r as s}from"../chunks/shared-DXaIVZ_z.js";import{C as t,a as o,D as r,b as n,c as i,E as m,F as c,M as p,T as d,W as l,d as f,e as g,f as A,g as E,h as T,i as y,j as C,k as S,l as D,m as I,n as k,o as M,p as N,t as O,u as h,v as u,w as R,x as v,y as P,z as K,A as b,B,G as w,H as _,I as F,J as G,K as H,L as V,N as W,O as j,P as x,Q as z,R as L,S as U,U as Y,V as q,X as J,Y as Q,Z as X}from"../chunks/shared-DXaIVZ_z.js";import{d as Z}from"../chunks/shared-DRvgJdY6.js";import{i as $}from"../chunks/shared-DRvgJdY6.js";a({entry:"templates/task-board.js",templates:["task-board"],register:()=>{e(),s(),Z()}});export{t as COMMENT_ACTION,o as COMMENT_DESCRIPTOR,r as DpkComponentCommentPanel,n as DpkComponentInlineEdit,i as DraftController,m as EMPTY_NAVIGATION,c as FRAMEWORK_VERSION,p as MemoryDraftStorage,d as TemplateElement,l as WebStorageDraftStorage,f as appendAction,g as assertNever,A as buildAgentBrief,E as commentActionSchema,T as commentBody,y as commentTargetKey,C as controls,S as createActionId,D as createEntityId,I as dedupeKeyOf,k as defaultStorage,M as defaultStorageKey,N as defineAction,O as derive,h as draftActionEnvelopeSchema,u as entityDedupeKey,R as formatHash,v as iconArrowDown,P as iconArrowUp,K as iconClose,b as iconComment,B as iconGrip,w as iconLink,_ as iconMove,F as iconPencil,G as iconPlus,H as iconTrash,V as liveActions,W as parseHash,j as parseTargetRef,x as parseTemplateAction,z as patchNavigation,L as payloadFor,U as serializeDraft,Y as slugify,q as targetRef,J as targetSchema,$ as taskBoard,Q as toTarget,X as tokens};
|
package/dist/templates/usm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as a,q as e,r as s}from"../chunks/shared-
|
|
1
|
+
import{s as a,q as e,r as s}from"../chunks/shared-DXaIVZ_z.js";import{C as t,a as o,D as n,b as r,c as i,E as m,F as c,M as p,T as l,W as f,d,e as g,f as A,g as E,h as y,i as T,j as C,k as u,l as S,m as D,n as I,o as M,p as N,t as O,u as h,v as R,w as v,x as P,y as K,z as k,A as w,B as _,G as b,H as B,I as F,J as G,K as H,L as U,N as V,O as W,P as j,Q as x,R as z,S as L,U as Y,V as q,X as J,Y as Q,Z as X}from"../chunks/shared-DXaIVZ_z.js";import{d as Z}from"../chunks/shared-CpTDkEui.js";import{i as $}from"../chunks/shared-CpTDkEui.js";a({entry:"templates/usm.js",templates:["usm"],register:()=>{e(),s(),Z()}});export{t as COMMENT_ACTION,o as COMMENT_DESCRIPTOR,n as DpkComponentCommentPanel,r as DpkComponentInlineEdit,i as DraftController,m as EMPTY_NAVIGATION,c as FRAMEWORK_VERSION,p as MemoryDraftStorage,l as TemplateElement,f as WebStorageDraftStorage,d as appendAction,g as assertNever,A as buildAgentBrief,E as commentActionSchema,y as commentBody,T as commentTargetKey,C as controls,u as createActionId,S as createEntityId,D as dedupeKeyOf,I as defaultStorage,M as defaultStorageKey,N as defineAction,O as derive,h as draftActionEnvelopeSchema,R as entityDedupeKey,v as formatHash,P as iconArrowDown,K as iconArrowUp,k as iconClose,w as iconComment,_ as iconGrip,b as iconLink,B as iconMove,F as iconPencil,G as iconPlus,H as iconTrash,U as liveActions,V as parseHash,W as parseTargetRef,j as parseTemplateAction,x as patchNavigation,z as payloadFor,L as serializeDraft,Y as slugify,q as targetRef,J as targetSchema,Q as toTarget,X as tokens,$ as usm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as a,q as e,r as s}from"../chunks/shared-
|
|
1
|
+
import{s as a,q as e,r as s}from"../chunks/shared-DXaIVZ_z.js";import{C as t,a as o,D as r,b as n,c as i,E as m,F as c,M as p,T as d,W as l,d as f,e as g,f as A,g as E,h as y,i as T,j as h,k as C,l as S,m as D,n as I,o as M,p as N,t as O,u,v as R,w as b,x as v,y as w,z as P,A as K,B as k,G as W,H as _,I as B,J as F,K as G,L as H,N as V,O as j,P as x,Q as z,R as L,S as U,U as Y,V as q,X as J,Y as Q,Z as X}from"../chunks/shared-DXaIVZ_z.js";import{d as Z}from"../chunks/shared-Ezic-gbC.js";import{i as $}from"../chunks/shared-Ezic-gbC.js";a({entry:"templates/whiteboard.js",templates:["whiteboard"],register:()=>{e(),s(),Z()}});export{t as COMMENT_ACTION,o as COMMENT_DESCRIPTOR,r as DpkComponentCommentPanel,n as DpkComponentInlineEdit,i as DraftController,m as EMPTY_NAVIGATION,c as FRAMEWORK_VERSION,p as MemoryDraftStorage,d as TemplateElement,l as WebStorageDraftStorage,f as appendAction,g as assertNever,A as buildAgentBrief,E as commentActionSchema,y as commentBody,T as commentTargetKey,h as controls,C as createActionId,S as createEntityId,D as dedupeKeyOf,I as defaultStorage,M as defaultStorageKey,N as defineAction,O as derive,u as draftActionEnvelopeSchema,R as entityDedupeKey,b as formatHash,v as iconArrowDown,w as iconArrowUp,P as iconClose,K as iconComment,k as iconGrip,W as iconLink,_ as iconMove,B as iconPencil,F as iconPlus,G as iconTrash,H as liveActions,V as parseHash,j as parseTargetRef,x as parseTemplateAction,z as patchNavigation,L as payloadFor,U as serializeDraft,Y as slugify,q as targetRef,J as targetSchema,Q as toTarget,X as tokens,$ as whiteboard};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const c={kind:"idle"},d="text/plain",f=i=>`${i.type}:${i.id}`,h=(i,t)=>{const e=(i??"").trim();if(e.length===0)return null;const r=e.indexOf(":");if(r<0)return{type:t,id:e};const s=e.slice(0,r),n=e.slice(r+1);return s.length===0||n.length===0?null:{type:s,id:n}},g=(i,t)=>t<=i.top+i.height/2?"before":"after";class p{#n;#t=c;#r;constructor(t){this.#n=t,t.addController(this)}hostDisconnected(){this.reset()}get state(){return this.#t}get item(){return this.#t.kind==="dragging"?this.#t.item:null}isDragging(t,e){const r=this.item;return r!==null&&r.type===t&&r.id===e}isOver(t){return this.#t.kind!=="idle"&&this.#t.over===t}reset(){clearTimeout(this.#r),this.#r=void 0,this.#e(c)}source(t){return{dragstart:e=>{e.dataTransfer&&(e.dataTransfer.setData(d,f(t)),e.dataTransfer.effectAllowed="move"),clearTimeout(this.#r),this.#r=setTimeout(()=>{this.#r=void 0,this.#e({kind:"dragging",item:t,over:null})},0)},dragend:()=>this.reset()}}target(t){return{dragenter:r=>{this.#s(t.accepts)&&(r.preventDefault(),this.#i(t.key))},dragover:r=>{this.#s(t.accepts)&&(r.preventDefault(),r.dataTransfer&&(r.dataTransfer.dropEffect="move"),this.#i(t.key))},dragleave:()=>{this.isOver(t.key)&&this.#i(null)},drop:r=>{r.preventDefault();const s=h(r.dataTransfer?.getData(d),t.accepts)??this.item;if(this.#e(c),!s||s.type!==t.accepts)return;const n=t.hovered?.(r)??null;t.onDrop({item:{type:t.accepts,id:s.id},hoveredId:n?.id??null,place:n?g(n.element.getBoundingClientRect(),r.clientY):"end",event:r})}}}#s(t){const e=this.item;return e===null||e.type===t}#i(t){const e=this.#t;if(e.kind==="dragging"){e.over!==t&&this.#e({...e,over:t});return}if(t===null){e.kind==="receiving"&&this.#e(c);return}(e.kind==="idle"||e.over!==t)&&this.#e({kind:"receiving",over:t})}#e(t){this.#t!==t&&(this.#t=t,this.#n.requestUpdate())}}const m=(i,t,e,r)=>{const n=i.filter(l=>l!==t).at(-1)??null;if(e===null||r==="end")return n;const u=i.indexOf(t),a=i.indexOf(e);if(a<0)return n;const o=l=>l<=0?null:i.at(l-1)??null;return u>=0?u<a?e:o(a):r==="after"?e:o(a)};export{p as D,m as r};
|