dev-process-kit 0.0.9 → 0.0.11
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/README.md +1 -1
- package/dist/THIRD_PARTY_LICENSES.md +47 -0
- package/dist/chunks/{shared-BHGClRU3.js → shared-B4ewpBuM.js} +6 -5
- package/dist/chunks/{shared-nW8tfMgg.js → shared-B9OVJ7XA.js} +2 -2
- package/dist/chunks/{shared-D4czF1TI.js → shared-BHRhwgui.js} +4 -4
- package/dist/chunks/{shared-BIdQ89rB.js → shared-BSFZSMH5.js} +1 -1
- package/dist/chunks/shared-B_MMP97h.js +2402 -0
- package/dist/chunks/{shared-p8037r6P.js → shared-BgCDocVX.js} +71 -48
- package/dist/chunks/{shared-8lYUcRvS.js → shared-CHaHI5X3.js} +3 -3
- package/dist/chunks/{shared-Dkx_2Lbf.js → shared-CrE-y5oF.js} +3 -3
- package/dist/chunks/{shared-U2T3astJ.js → shared-CxFItadP.js} +7 -7
- package/dist/chunks/{shared-BOFIcKZe.js → shared-DGI_sFo5.js} +1 -1
- package/dist/chunks/shared-DIJgMVpY.js +2239 -0
- package/dist/chunks/{shared-Dn5j0MCU.js → shared-DZfXwU7f.js} +1 -1
- package/dist/chunks/{shared-SGSKyTNs.js → shared-OGH3pSVq.js} +2 -2
- package/dist/chunks/{shared-D6Yx-euS.js → shared-TW6kWbUL.js} +2 -2
- 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-7qenhU4J.js +0 -2173
- package/dist/chunks/shared-Cia5FdOF.js +0 -1112
package/README.md
CHANGED
|
@@ -84,7 +84,7 @@ dev-process-kit ships **templates**, which make up a whole page, and **component
|
|
|
84
84
|
|
|
85
85
|
| Template | Element | What it is |
|
|
86
86
|
| ------------------ | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
87
|
-
| UX Prototype | `dpk-template-prototype` |
|
|
87
|
+
| UX Prototype | `dpk-template-prototype` | The product's apps and screens, and the user stories that walk through them: a step lays out the screens it shows and the materials the user has at hand, so the same screen is drawn once and the UI can also be browsed on its own as an app |
|
|
88
88
|
| User Story Mapping | `dpk-template-usm` | The backbone (activity › step) as columns, milestones as rows |
|
|
89
89
|
| Event Storming | `dpk-template-event-storming` | Sticky notes on swimlanes in timeline order, with causality links between them |
|
|
90
90
|
| Example Mapping | `dpk-template-example-mapping` | One story per column, rules beneath it, examples beneath each rule, questions pinned to any of them |
|
|
@@ -188,6 +188,53 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
188
188
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
189
189
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
190
190
|
|
|
191
|
+
## marked - 18.1.0 (MIT)
|
|
192
|
+
|
|
193
|
+
# License information
|
|
194
|
+
|
|
195
|
+
## Contribution License Agreement
|
|
196
|
+
|
|
197
|
+
If you contribute code to this project, you are implicitly allowing your code
|
|
198
|
+
to be distributed under the MIT license. You are also implicitly verifying that
|
|
199
|
+
all code is your original work. `</legalese>`
|
|
200
|
+
|
|
201
|
+
## Marked
|
|
202
|
+
|
|
203
|
+
Copyright (c) 2018+, MarkedJS (https://github.com/markedjs/)
|
|
204
|
+
Copyright (c) 2011-2018, Christopher Jeffrey (https://github.com/chjj/)
|
|
205
|
+
|
|
206
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
207
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
208
|
+
in the Software without restriction, including without limitation the rights
|
|
209
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
210
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
211
|
+
furnished to do so, subject to the following conditions:
|
|
212
|
+
|
|
213
|
+
The above copyright notice and this permission notice shall be included in
|
|
214
|
+
all copies or substantial portions of the Software.
|
|
215
|
+
|
|
216
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
217
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
218
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
219
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
220
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
221
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
222
|
+
THE SOFTWARE.
|
|
223
|
+
|
|
224
|
+
## Markdown
|
|
225
|
+
|
|
226
|
+
Copyright © 2004, John Gruber
|
|
227
|
+
http://daringfireball.net/
|
|
228
|
+
All rights reserved.
|
|
229
|
+
|
|
230
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
231
|
+
|
|
232
|
+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
233
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
234
|
+
* Neither the name “Markdown” nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
235
|
+
|
|
236
|
+
This software is provided by the copyright holders and contributors “as is” and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.
|
|
237
|
+
|
|
191
238
|
## valibot - 1.5.0 (MIT)
|
|
192
239
|
|
|
193
240
|
MIT License
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a0 as Wt,a3 as lt,a4 as K}from"./shared-7qenhU4J.js";const I=Math.min,S=Math.max,Q=Math.round,Z=Math.floor,$=t=>({x:t,y:t}),Nt={left:"right",right:"left",bottom:"top",top:"bottom"};function Vt(t,e,n){return S(t,I(e,n))}function U(t,e){return typeof t=="function"?t(e):t}function _(t){return t.split("-")[0]}function Y(t){return t.split("-")[1]}function xt(t){return t==="x"?"y":"x"}function bt(t){return t==="y"?"height":"width"}function P(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function vt(t){return xt(P(t))}function _t(t,e,n){n===void 0&&(n=!1);const o=Y(t),i=vt(t),s=bt(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=tt(r)),[r,tt(r)]}function Ht(t){const e=tt(t);return[at(t),e,at(e)]}function at(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Rt=["left","right"],Ct=["right","left"],Bt=["top","bottom"],zt=["bottom","top"];function It(t,e,n){switch(t){case"top":case"bottom":return n?e?Ct:Rt:e?Rt:Ct;case"left":case"right":return e?Bt:zt;default:return[]}}function Xt(t,e,n,o){const i=Y(t);let s=It(_(t),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),e&&(s=s.concat(s.map(at)))),s}function tt(t){const e=_(t);return Nt[e]+t.slice(e.length)}function jt(t){var e,n,o,i;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(o=t.bottom)!=null?o:0,left:(i=t.left)!=null?i:0}}function qt(t){return typeof t!="number"?jt(t):{top:t,right:t,bottom:t,left:t}}function et(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function At(t,e,n){let{reference:o,floating:i}=t;const s=P(e),r=vt(e),c=bt(r),l=_(e),a=s==="y",f=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,m=o[c]/2-i[c]/2;let d;switch(l){case"top":d={x:f,y:o.y-i.height};break;case"bottom":d={x:f,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:u};break;case"left":d={x:o.x-i.width,y:u};break;default:d={x:o.x,y:o.y}}const h=Y(e);return h&&(d[r]+=m*(h==="end"?1:-1)*(n&&a?-1:1)),d}async function Kt(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:s,rects:r,elements:c,strategy:l}=t,{boundary:a="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:m=!1,padding:d=0}=U(e,t),h=qt(d),w=c[m?u==="floating"?"reference":"floating":u],p=et(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:a,rootBoundary:f,strategy:l})),y=u==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),b=await(s.isElement==null?void 0:s.isElement(x))&&await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1},C=et(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:y,offsetParent:x,strategy:l}):y);return{top:(p.top-C.top+h.top)/b.y,bottom:(C.bottom-p.bottom+h.bottom)/b.y,left:(p.left-C.left+h.left)/b.x,right:(C.right-p.right+h.right)/b.x}}const Ut=50,Yt=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,c=r.detectOverflow?r:{...r,detectOverflow:Kt},l=await(r.isRTL==null?void 0:r.isRTL(e));let a=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=At(a,o,l),m=o,d=0;const h={};for(let g=0;g<s.length;g++){const w=s[g];if(!w)continue;const{name:p,fn:y}=w,{x,y:b,data:C,reset:v}=await y({x:f,y:u,initialPlacement:o,placement:m,strategy:i,middlewareData:h,rects:a,platform:c,elements:{reference:t,floating:e}});f=x??f,u=b??u,h[p]={...h[p],...C},v&&d<Ut&&(d++,typeof v=="object"&&(v.placement&&(m=v.placement),v.rects&&(a=v.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):v.rects),{x:f,y:u}=At(a,m,l)),g=-1)}return{x:f,y:u,placement:m,strategy:i,middlewareData:h}},Gt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:s,rects:r,initialPlacement:c,platform:l,elements:a}=e,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...w}=U(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const p=_(i),y=P(c),x=_(c)===c,b=await(l.isRTL==null?void 0:l.isRTL(a.floating)),C=m||(x||!g?[tt(c)]:Ht(c)),v=h!=="none";!m&&v&&C.push(...Xt(c,g,h,b));const D=[c,...C],T=await l.detectOverflow(e,w),W=[];let O=((o=s.flip)==null?void 0:o.overflows)||[];if(f&&W.push(T[p]),u){const N=_t(i,r,b);W.push(T[N[0]],T[N[1]])}if(O=[...O,{placement:i,overflows:W}],!W.every(N=>N<=0)){var gt,wt;const N=(((gt=s.flip)==null?void 0:gt.index)||0)+1,ct=D[N];if(ct&&(!(u==="alignment"?y!==P(ct):!1)||O.every(A=>P(A.placement)===y?A.overflows[0]>0:!0)))return{data:{index:N,overflows:O},reset:{placement:ct}};let q=(wt=O.filter(V=>V.overflows[0]<=0).sort((V,A)=>V.overflows[1]-A.overflows[1])[0])==null?void 0:wt.placement;if(!q)switch(d){case"bestFit":{var yt;const V=(yt=O.filter(A=>{if(v){const M=P(A.placement);return M===y||M==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(M=>M>0).reduce((M,Ft)=>M+Ft,0)]).sort((A,M)=>A[1]-M[1])[0])==null?void 0:yt[0];V&&(q=V);break}case"initialPlacement":q=c;break}if(i!==q)return{reset:{placement:q}}}return{}}}},Jt=new Set(["left","top"]);async function Qt(t,e){const{placement:n,platform:o,elements:i}=t,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=_(n),c=Y(n),l=P(n)==="y",a=Jt.has(r)?-1:1,f=s&&l?-1:1,u=U(e,t);let{mainAxis:m,crossAxis:d,alignmentAxis:h}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return c&&typeof h=="number"&&(d=c==="end"?h*-1:h),l?{x:d*f,y:m*a}:{x:m*a,y:d*f}}const Zt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:s,placement:r,middlewareData:c}=e,l=await Qt(e,t);return r===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:r}}}}},te=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:s}=e,{mainAxis:r=!0,crossAxis:c=!1,limiter:l={fn:y=>{let{x,y:b}=y;return{x,y:b}}},...a}=U(t,e),f={x:n,y:o},u=await s.detectOverflow(e,a),m=P(i),d=xt(m);let h=f[d],g=f[m];const w=(y,x)=>Vt(x+u[y==="y"?"top":"left"],x,x-u[y==="y"?"bottom":"right"]);r&&(h=w(d,h)),c&&(g=w(m,g));const p=l.fn({...e,[d]:h,[m]:g});return{...p,data:{x:p.x-n,y:p.y-o,enabled:{[d]:r,[m]:c}}}}}},ee=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:o,platform:i,elements:s}=e,{apply:r=()=>{},...c}=U(t,e),l=await i.detectOverflow(e,c),a=_(n),f=Y(n),u=P(n)==="y",{width:m,height:d}=o.floating;let h,g;a==="top"||a==="bottom"?(h=a,g=f===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(g=a,h=f==="end"?"top":"bottom");const w=d-l.top-l.bottom,p=m-l.left-l.right,y=I(d-l[h],w),x=I(m-l[g],p),b=e.middlewareData.shift,C=!b;let v=y,D=x;b!=null&&b.enabled.x&&(D=p),b!=null&&b.enabled.y&&(v=w),C&&!f&&(u?D=m-2*S(l.left,l.right):v=d-2*S(l.top,l.bottom)),await r({...e,availableWidth:D,availableHeight:v});const T=await i.getDimensions(s.floating);return m!==T.width||d!==T.height?{reset:{rects:!0}}:{}}}};function nt(){return typeof window<"u"}function X(t){return Ot(t)?(t.nodeName||"").toLowerCase():"#document"}function R(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function k(t){var e;return(e=(Ot(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ot(t){return nt()?t instanceof Node||t instanceof R(t).Node:!1}function L(t){return nt()?t instanceof Element||t instanceof R(t).Element:!1}function F(t){return nt()?t instanceof HTMLElement||t instanceof R(t).HTMLElement:!1}function Lt(t){return!nt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof R(t).ShadowRoot}function ot(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=E(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&i!=="inline"&&i!=="contents"}function ne(t){return/^(table|td|th)$/.test(X(t))}function it(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const oe=/transform|translate|scale|rotate|perspective|filter/,ie=/paint|layout|strict|content/,H=t=>!!t&&t!=="none";let ft;function ut(t){const e=L(t)?E(t):t;return H(e.transform)||H(e.translate)||H(e.scale)||H(e.rotate)||H(e.perspective)||!dt()&&(H(e.backdropFilter)||H(e.filter))||oe.test(e.willChange||"")||ie.test(e.contain||"")}function se(t){let e=B(t);for(;F(e)&&!G(e);){if(ut(e))return e;if(it(e))return null;e=B(e)}return null}function dt(){return ft==null&&(ft=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ft}function G(t){return/^(html|body|#document)$/.test(X(t))}function E(t){return R(t).getComputedStyle(t)}function st(t){return L(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function B(t){if(X(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Lt(t)&&t.host||k(t);return Lt(e)?e.host:e}function Et(t){const e=B(t);return G(e)?(t.ownerDocument||t).body:F(e)&&ot(e)?e:Et(e)}function J(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Et(t),s=i===((o=t.ownerDocument)==null?void 0:o.body),r=R(i);if(s){const c=mt(r);return e.concat(r,r.visualViewport||[],ot(i)?i:[],c&&n?J(c):[])}else return e.concat(i,J(i,[],n))}function mt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Tt(t){const e=E(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=F(t),s=i?t.offsetWidth:n,r=i?t.offsetHeight:o,c=Q(n)!==s||Q(o)!==r;return c&&(n=s,o=r),{width:n,height:o,$:c}}function ht(t){return L(t)?t:t.contextElement}function j(t){const e=ht(t);if(!F(e))return $(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:s}=Tt(e);let r=(s?Q(n.width):n.width)/o,c=(s?Q(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const re=$(0);function St(t){const e=R(t);return!dt()||!e.visualViewport?re:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ce(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===R(t)}function z(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=ht(t);let r=$(1);e&&(o?L(o)&&(r=j(o)):r=j(t));const c=ce(s,n,o)?St(s):$(0);let l=(i.left+c.x)/r.x,a=(i.top+c.y)/r.y,f=i.width/r.x,u=i.height/r.y;if(s&&o){const m=R(s),d=L(o)?R(o):o;let h=m,g=mt(h);for(;g&&d!==h;){const w=j(g),p=g.getBoundingClientRect(),y=E(g),x=p.left+(g.clientLeft+parseFloat(y.paddingLeft))*w.x,b=p.top+(g.clientTop+parseFloat(y.paddingTop))*w.y;l*=w.x,a*=w.y,f*=w.x,u*=w.y,l+=x,a+=b,h=R(g),g=mt(h)}}return et({width:f,height:u,x:l,y:a})}function rt(t,e){const n=st(t).scrollLeft;return e?e.left+n:z(k(t)).left+n}function $t(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-rt(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function le(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const s=i==="fixed",r=k(o),c=e?it(e.floating):!1;if(o===r||c&&s)return n;let l={scrollLeft:0,scrollTop:0},a=$(1);const f=$(0),u=F(o);if((u||!s)&&((X(o)!=="body"||ot(r))&&(l=st(o)),u)){const d=z(o);a=j(o),f.x=d.x+o.clientLeft,f.y=d.y+o.clientTop}const m=r&&!u&&!s?$t(r,l):$(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-l.scrollLeft*a.x+f.x+m.x,y:n.y*a.y-l.scrollTop*a.y+f.y+m.y}}function ae(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function fe(t){const e=st(t),n=t.ownerDocument.body,o=S(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=S(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-e.scrollLeft+rt(t);const r=-e.scrollTop;return E(n).direction==="rtl"&&(s+=S(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:r}}const ue=25;function de(t,e,n){n===void 0&&(n="viewport");const o=n==="layoutViewport",i=R(t),s=k(t),r=i.visualViewport;let c=s.clientWidth,l=s.clientHeight,a=0,f=0;if(r){const m=!dt()||e==="fixed";o?m||(a=-r.offsetLeft,f=-r.offsetTop):(c=r.width,l=r.height,m&&(a=r.offsetLeft,f=r.offsetTop))}if(rt(s)<=0){const m=s.ownerDocument,d=m.body,h=getComputedStyle(d),g=m.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,w=Math.abs(s.clientWidth-d.clientWidth-g),p=getComputedStyle(s).scrollbarGutter==="stable both-edges"?w/2:w;p<=ue&&(c-=p)}return{width:c,height:l,x:a,y:f}}function me(t,e){const n=z(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=j(t),r=t.clientWidth*s.x,c=t.clientHeight*s.y,l=i*s.x,a=o*s.y;return{width:r,height:c,x:l,y:a}}function Pt(t,e,n){let o;if(e==="viewport"||e==="layoutViewport")o=de(t,n,e);else if(e==="document")o=fe(k(t));else if(L(e))o=me(e,n);else{const i=St(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return et(o)}function he(t,e){const n=e.get(t);if(n)return n;let o=J(t,[],!1).filter(c=>L(c)&&X(c)!=="body"),i=null;const s=E(t).position==="fixed";let r=s?B(t):t;for(;L(r)&&!G(r);){const c=E(r),l=ut(r),a=i?i.position:s?"fixed":"";!l&&(a==="fixed"||a==="absolute"&&c.position==="static")?o=o.filter(u=>u!==r):i=c,r=B(r)}return e.set(t,o),o}function pe(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[...n==="clippingAncestors"?it(e)?[]:he(e,this._c):[].concat(n),o],c=Pt(e,r[0],i);let l=c.top,a=c.right,f=c.bottom,u=c.left;for(let m=1;m<r.length;m++){const d=Pt(e,r[m],i);l=S(d.top,l),a=I(d.right,a),f=I(d.bottom,f),u=S(d.left,u)}return{width:a-u,height:f-l,x:u,y:l}}function ge(t){const{width:e,height:n}=Tt(t);return{width:e,height:n}}function we(t,e,n){const o=F(e),i=k(e),s=n==="fixed",r=z(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const l=$(0);if((o||!s)&&((X(e)!=="body"||ot(i))&&(c=st(e)),o)){const m=z(e,!0,s,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}!o&&i&&(l.x=rt(i));const a=i&&!o&&!s?$t(i,c):$(0),f=r.left+c.scrollLeft-l.x-a.x,u=r.top+c.scrollTop-l.y-a.y;return{x:f,y:u,width:r.width,height:r.height}}function pt(t){return E(t).position==="static"}function kt(t,e){if(!F(t)||E(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return k(t)===n&&(n=n.ownerDocument.body),n}function Dt(t,e){const n=R(t);if(it(t))return n;if(!F(t)){let i=B(t);for(;i&&!G(i);){if(L(i)&&!pt(i))return i;i=B(i)}return n}let o=kt(t,e);for(;o&&ne(o)&&pt(o);)o=kt(o,e);return o&&G(o)&&pt(o)&&!ut(o)?n:o||se(t)||n}const ye=async function(t){const e=this.getOffsetParent||Dt,n=this.getDimensions,o=await n(t.floating);return{reference:we(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function xe(t){return E(t).direction==="rtl"}const be={convertOffsetParentRelativeRectToViewportRelativeRect:le,getDocumentElement:k,getClippingRect:pe,getOffsetParent:Dt,getElementRects:ye,getClientRects:ae,getDimensions:ge,getScale:j,isElement:L,isRTL:xe};function Mt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function ve(t,e,n){let o=null,i;const s=k(t);function r(){var f;clearTimeout(i),(f=o)==null||f.disconnect(),o=null}function c(f,u){f===void 0&&(f=!1),u===void 0&&(u=1),r();const m=t.getBoundingClientRect(),{left:d,top:h,width:g,height:w}=m;if(f||e(),!g||!w)return;const p=Z(h),y=Z(s.clientWidth-(d+g)),x=Z(s.clientHeight-(h+w)),b=Z(d),v={rootMargin:-p+"px "+-y+"px "+-x+"px "+-b+"px",threshold:S(0,I(1,u))||1};let D=!0;function T(W){const O=W[0].intersectionRatio;if(!Mt(m,t.getBoundingClientRect()))return c();if(O!==u){if(!D)return c();O?c(!1,O):i=setTimeout(()=>{c(!1,1e-7)},1e3)}D=!1}try{o=new IntersectionObserver(T,{...v,root:s.ownerDocument})}catch{o=new IntersectionObserver(T,v)}o.observe(t)}const l=R(t),a=()=>c(n);return l.addEventListener("resize",a),c(!0),()=>{l.removeEventListener("resize",a),r()}}function Re(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,a=ht(t),f=i||s?[...a?J(a):[],...e?J(e):[]]:[];f.forEach(p=>{i&&p.addEventListener("scroll",n),s&&p.addEventListener("resize",n)});const u=a&&c?ve(a,n,s):null;let m=-1,d=null;r&&(d=new ResizeObserver(p=>{let[y]=p;y&&y.target===a&&d&&e&&(d.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var x;(x=d)==null||x.observe(e)})),n()}),a&&!l&&d.observe(a),e&&d.observe(e));let h,g=l?z(t):null;l&&w();function w(){const p=z(t);g&&!Mt(g,p)&&n(),g=p,h=requestAnimationFrame(w)}return n(),()=>{var p;f.forEach(y=>{i&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),u?.(),(p=d)==null||p.disconnect(),d=null,l&&cancelAnimationFrame(h)}}const Ce=Zt,Ae=te,Oe=Gt,Le=ee,Ee=(t,e,n)=>{const o=new Map,i=n??{},s={...be,...i.platform,_c:o};return Yt(t,e,{...i,platform:s})},Te=(t,e)=>({top:e,bottom:e,right:t}),Se=(t,e,n,o={})=>{if(typeof t.showPopover!="function")return()=>{};try{t.showPopover()}catch{return()=>{}}let i=!0,s=0;const r=e instanceof Element?e:{getBoundingClientRect:()=>({x:e.right,y:e.top,left:e.right,right:e.right,top:e.top,bottom:e.bottom,width:0,height:e.bottom-e.top})};t.style.width=`${n.width}px`,t.style.maxHeight=`${n.height}px`;const l=Re(r,t,()=>{const a=++s;Ee(r,t,{strategy:"fixed",placement:o.placement??"bottom-end",middleware:[Ce(8),Oe({padding:8,fallbackAxisSideDirection:"end"}),Ae({padding:8}),Le({padding:8,apply:({availableWidth:f,availableHeight:u})=>{!i||a!==s||(t.style.width=`${Math.max(0,Math.min(n.width,f))}px`,t.style.maxHeight=`${Math.max(0,Math.min(n.height,u))}px`)}})]}).then(({x:f,y:u})=>{!i||a!==s||!t.isConnected||(t.style.left=`${f}px`,t.style.top=`${u}px`)}).catch(()=>{})},{animationFrame:o.trackTransform??!1,elementResize:typeof ResizeObserver<"u",layoutShift:typeof IntersectionObserver<"u"});return()=>{i=!1,l()}},$e=t=>{if(!(!t||typeof t.hidePopover!="function"))try{t.hidePopover()}catch{}};class Pe{#e;#t=new Map;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#e.requestUpdate()}hostUpdated(){for(const[e,n]of this.#t)e.isConnected||(n(),this.#t.delete(e))}hostDisconnected(){for(const e of this.#t.values())e();this.#t.clear()}open(e,n,o,i){this.#t.get(e)?.(),this.#t.set(e,Se(e,n,o,i))}}const ke=Wt({en:{comment:"Comment",commentOn:t=>`Comment on ${t}`,submit:"Send",cancel:"Cancel"},ja:{comment:"\u30B3\u30E1\u30F3\u30C8",commentOn:t=>`${t}\u3078\u306E\u30B3\u30E1\u30F3\u30C8`,submit:"\u9001\u4FE1",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB"}}),De=(t,e,n={})=>({body:t,notes:e,submission:t.trim()||null,label:n.label??null,error:n.error??null}),Me=(t,e,n)=>{const o=()=>{e.submission!==null&&n({kind:"comment",body:e.submission})};return K`<div
|
|
1
|
+
import{a0 as Wt,a3 as Q,a4 as K}from"./shared-B_MMP97h.js";const I=Math.min,S=Math.max,Z=Math.round,tt=Math.floor,$=t=>({x:t,y:t}),Nt={left:"right",right:"left",bottom:"top",top:"bottom"};function Vt(t,e,n){return S(t,I(e,n))}function U(t,e){return typeof t=="function"?t(e):t}function _(t){return t.split("-")[0]}function Y(t){return t.split("-")[1]}function xt(t){return t==="x"?"y":"x"}function bt(t){return t==="y"?"height":"width"}function k(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function vt(t){return xt(k(t))}function _t(t,e,n){n===void 0&&(n=!1);const o=Y(t),i=vt(t),s=bt(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=et(r)),[r,et(r)]}function Ht(t){const e=et(t);return[at(t),e,at(e)]}function at(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Rt=["left","right"],Ct=["right","left"],Bt=["top","bottom"],zt=["bottom","top"];function It(t,e,n){switch(t){case"top":case"bottom":return n?e?Ct:Rt:e?Rt:Ct;case"left":case"right":return e?Bt:zt;default:return[]}}function Xt(t,e,n,o){const i=Y(t);let s=It(_(t),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),e&&(s=s.concat(s.map(at)))),s}function et(t){const e=_(t);return Nt[e]+t.slice(e.length)}function jt(t){var e,n,o,i;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(o=t.bottom)!=null?o:0,left:(i=t.left)!=null?i:0}}function qt(t){return typeof t!="number"?jt(t):{top:t,right:t,bottom:t,left:t}}function nt(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function At(t,e,n){let{reference:o,floating:i}=t;const s=k(e),r=vt(e),c=bt(r),l=_(e),a=s==="y",f=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,m=o[c]/2-i[c]/2;let d;switch(l){case"top":d={x:f,y:o.y-i.height};break;case"bottom":d={x:f,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:u};break;case"left":d={x:o.x-i.width,y:u};break;default:d={x:o.x,y:o.y}}const h=Y(e);return h&&(d[r]+=m*(h==="end"?1:-1)*(n&&a?-1:1)),d}async function Kt(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:s,rects:r,elements:c,strategy:l}=t,{boundary:a="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:m=!1,padding:d=0}=U(e,t),h=qt(d),w=c[m?u==="floating"?"reference":"floating":u],p=nt(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:a,rootBoundary:f,strategy:l})),y=u==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),b=await(s.isElement==null?void 0:s.isElement(x))&&await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1},C=nt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:y,offsetParent:x,strategy:l}):y);return{top:(p.top-C.top+h.top)/b.y,bottom:(C.bottom-p.bottom+h.bottom)/b.y,left:(p.left-C.left+h.left)/b.x,right:(C.right-p.right+h.right)/b.x}}const Ut=50,Yt=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,c=r.detectOverflow?r:{...r,detectOverflow:Kt},l=await(r.isRTL==null?void 0:r.isRTL(e));let a=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=At(a,o,l),m=o,d=0;const h={};for(let g=0;g<s.length;g++){const w=s[g];if(!w)continue;const{name:p,fn:y}=w,{x,y:b,data:C,reset:v}=await y({x:f,y:u,initialPlacement:o,placement:m,strategy:i,middlewareData:h,rects:a,platform:c,elements:{reference:t,floating:e}});f=x??f,u=b??u,h[p]={...h[p],...C},v&&d<Ut&&(d++,typeof v=="object"&&(v.placement&&(m=v.placement),v.rects&&(a=v.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):v.rects),{x:f,y:u}=At(a,m,l)),g=-1)}return{x:f,y:u,placement:m,strategy:i,middlewareData:h}},Gt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:s,rects:r,initialPlacement:c,platform:l,elements:a}=e,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...w}=U(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const p=_(i),y=k(c),x=_(c)===c,b=await(l.isRTL==null?void 0:l.isRTL(a.floating)),C=m||(x||!g?[et(c)]:Ht(c)),v=h!=="none";!m&&v&&C.push(...Xt(c,g,h,b));const D=[c,...C],T=await l.detectOverflow(e,w),W=[];let O=((o=s.flip)==null?void 0:o.overflows)||[];if(f&&W.push(T[p]),u){const N=_t(i,r,b);W.push(T[N[0]],T[N[1]])}if(O=[...O,{placement:i,overflows:W}],!W.every(N=>N<=0)){var gt,wt;const N=(((gt=s.flip)==null?void 0:gt.index)||0)+1,lt=D[N];if(lt&&(!(u==="alignment"?y!==k(lt):!1)||O.every(A=>k(A.placement)===y?A.overflows[0]>0:!0)))return{data:{index:N,overflows:O},reset:{placement:lt}};let q=(wt=O.filter(V=>V.overflows[0]<=0).sort((V,A)=>V.overflows[1]-A.overflows[1])[0])==null?void 0:wt.placement;if(!q)switch(d){case"bestFit":{var yt;const V=(yt=O.filter(A=>{if(v){const M=k(A.placement);return M===y||M==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(M=>M>0).reduce((M,Ft)=>M+Ft,0)]).sort((A,M)=>A[1]-M[1])[0])==null?void 0:yt[0];V&&(q=V);break}case"initialPlacement":q=c;break}if(i!==q)return{reset:{placement:q}}}return{}}}},Jt=new Set(["left","top"]);async function Qt(t,e){const{placement:n,platform:o,elements:i}=t,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=_(n),c=Y(n),l=k(n)==="y",a=Jt.has(r)?-1:1,f=s&&l?-1:1,u=U(e,t);let{mainAxis:m,crossAxis:d,alignmentAxis:h}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return c&&typeof h=="number"&&(d=c==="end"?h*-1:h),l?{x:d*f,y:m*a}:{x:m*a,y:d*f}}const Zt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:s,placement:r,middlewareData:c}=e,l=await Qt(e,t);return r===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:r}}}}},te=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:s}=e,{mainAxis:r=!0,crossAxis:c=!1,limiter:l={fn:y=>{let{x,y:b}=y;return{x,y:b}}},...a}=U(t,e),f={x:n,y:o},u=await s.detectOverflow(e,a),m=k(i),d=xt(m);let h=f[d],g=f[m];const w=(y,x)=>Vt(x+u[y==="y"?"top":"left"],x,x-u[y==="y"?"bottom":"right"]);r&&(h=w(d,h)),c&&(g=w(m,g));const p=l.fn({...e,[d]:h,[m]:g});return{...p,data:{x:p.x-n,y:p.y-o,enabled:{[d]:r,[m]:c}}}}}},ee=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:o,platform:i,elements:s}=e,{apply:r=()=>{},...c}=U(t,e),l=await i.detectOverflow(e,c),a=_(n),f=Y(n),u=k(n)==="y",{width:m,height:d}=o.floating;let h,g;a==="top"||a==="bottom"?(h=a,g=f===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(g=a,h=f==="end"?"top":"bottom");const w=d-l.top-l.bottom,p=m-l.left-l.right,y=I(d-l[h],w),x=I(m-l[g],p),b=e.middlewareData.shift,C=!b;let v=y,D=x;b!=null&&b.enabled.x&&(D=p),b!=null&&b.enabled.y&&(v=w),C&&!f&&(u?D=m-2*S(l.left,l.right):v=d-2*S(l.top,l.bottom)),await r({...e,availableWidth:D,availableHeight:v});const T=await i.getDimensions(s.floating);return m!==T.width||d!==T.height?{reset:{rects:!0}}:{}}}};function ot(){return typeof window<"u"}function X(t){return Ot(t)?(t.nodeName||"").toLowerCase():"#document"}function R(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function P(t){var e;return(e=(Ot(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ot(t){return ot()?t instanceof Node||t instanceof R(t).Node:!1}function L(t){return ot()?t instanceof Element||t instanceof R(t).Element:!1}function F(t){return ot()?t instanceof HTMLElement||t instanceof R(t).HTMLElement:!1}function Lt(t){return!ot()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof R(t).ShadowRoot}function it(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=E(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&i!=="inline"&&i!=="contents"}function ne(t){return/^(table|td|th)$/.test(X(t))}function st(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const oe=/transform|translate|scale|rotate|perspective|filter/,ie=/paint|layout|strict|content/,H=t=>!!t&&t!=="none";let ft;function ut(t){const e=L(t)?E(t):t;return H(e.transform)||H(e.translate)||H(e.scale)||H(e.rotate)||H(e.perspective)||!dt()&&(H(e.backdropFilter)||H(e.filter))||oe.test(e.willChange||"")||ie.test(e.contain||"")}function se(t){let e=B(t);for(;F(e)&&!G(e);){if(ut(e))return e;if(st(e))return null;e=B(e)}return null}function dt(){return ft==null&&(ft=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ft}function G(t){return/^(html|body|#document)$/.test(X(t))}function E(t){return R(t).getComputedStyle(t)}function rt(t){return L(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function B(t){if(X(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Lt(t)&&t.host||P(t);return Lt(e)?e.host:e}function Et(t){const e=B(t);return G(e)?(t.ownerDocument||t).body:F(e)&&it(e)?e:Et(e)}function J(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Et(t),s=i===((o=t.ownerDocument)==null?void 0:o.body),r=R(i);if(s){const c=mt(r);return e.concat(r,r.visualViewport||[],it(i)?i:[],c&&n?J(c):[])}else return e.concat(i,J(i,[],n))}function mt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Tt(t){const e=E(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=F(t),s=i?t.offsetWidth:n,r=i?t.offsetHeight:o,c=Z(n)!==s||Z(o)!==r;return c&&(n=s,o=r),{width:n,height:o,$:c}}function ht(t){return L(t)?t:t.contextElement}function j(t){const e=ht(t);if(!F(e))return $(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:s}=Tt(e);let r=(s?Z(n.width):n.width)/o,c=(s?Z(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const re=$(0);function St(t){const e=R(t);return!dt()||!e.visualViewport?re:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ce(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===R(t)}function z(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=ht(t);let r=$(1);e&&(o?L(o)&&(r=j(o)):r=j(t));const c=ce(s,n,o)?St(s):$(0);let l=(i.left+c.x)/r.x,a=(i.top+c.y)/r.y,f=i.width/r.x,u=i.height/r.y;if(s&&o){const m=R(s),d=L(o)?R(o):o;let h=m,g=mt(h);for(;g&&d!==h;){const w=j(g),p=g.getBoundingClientRect(),y=E(g),x=p.left+(g.clientLeft+parseFloat(y.paddingLeft))*w.x,b=p.top+(g.clientTop+parseFloat(y.paddingTop))*w.y;l*=w.x,a*=w.y,f*=w.x,u*=w.y,l+=x,a+=b,h=R(g),g=mt(h)}}return nt({width:f,height:u,x:l,y:a})}function ct(t,e){const n=rt(t).scrollLeft;return e?e.left+n:z(P(t)).left+n}function $t(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-ct(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function le(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const s=i==="fixed",r=P(o),c=e?st(e.floating):!1;if(o===r||c&&s)return n;let l={scrollLeft:0,scrollTop:0},a=$(1);const f=$(0),u=F(o);if((u||!s)&&((X(o)!=="body"||it(r))&&(l=rt(o)),u)){const d=z(o);a=j(o),f.x=d.x+o.clientLeft,f.y=d.y+o.clientTop}const m=r&&!u&&!s?$t(r,l):$(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-l.scrollLeft*a.x+f.x+m.x,y:n.y*a.y-l.scrollTop*a.y+f.y+m.y}}function ae(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function fe(t){const e=rt(t),n=t.ownerDocument.body,o=S(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=S(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-e.scrollLeft+ct(t);const r=-e.scrollTop;return E(n).direction==="rtl"&&(s+=S(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:r}}const ue=25;function de(t,e,n){n===void 0&&(n="viewport");const o=n==="layoutViewport",i=R(t),s=P(t),r=i.visualViewport;let c=s.clientWidth,l=s.clientHeight,a=0,f=0;if(r){const m=!dt()||e==="fixed";o?m||(a=-r.offsetLeft,f=-r.offsetTop):(c=r.width,l=r.height,m&&(a=r.offsetLeft,f=r.offsetTop))}if(ct(s)<=0){const m=s.ownerDocument,d=m.body,h=getComputedStyle(d),g=m.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,w=Math.abs(s.clientWidth-d.clientWidth-g),p=getComputedStyle(s).scrollbarGutter==="stable both-edges"?w/2:w;p<=ue&&(c-=p)}return{width:c,height:l,x:a,y:f}}function me(t,e){const n=z(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=j(t),r=t.clientWidth*s.x,c=t.clientHeight*s.y,l=i*s.x,a=o*s.y;return{width:r,height:c,x:l,y:a}}function kt(t,e,n){let o;if(e==="viewport"||e==="layoutViewport")o=de(t,n,e);else if(e==="document")o=fe(P(t));else if(L(e))o=me(e,n);else{const i=St(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return nt(o)}function he(t,e){const n=e.get(t);if(n)return n;let o=J(t,[],!1).filter(c=>L(c)&&X(c)!=="body"),i=null;const s=E(t).position==="fixed";let r=s?B(t):t;for(;L(r)&&!G(r);){const c=E(r),l=ut(r),a=i?i.position:s?"fixed":"";!l&&(a==="fixed"||a==="absolute"&&c.position==="static")?o=o.filter(u=>u!==r):i=c,r=B(r)}return e.set(t,o),o}function pe(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[...n==="clippingAncestors"?st(e)?[]:he(e,this._c):[].concat(n),o],c=kt(e,r[0],i);let l=c.top,a=c.right,f=c.bottom,u=c.left;for(let m=1;m<r.length;m++){const d=kt(e,r[m],i);l=S(d.top,l),a=I(d.right,a),f=I(d.bottom,f),u=S(d.left,u)}return{width:a-u,height:f-l,x:u,y:l}}function ge(t){const{width:e,height:n}=Tt(t);return{width:e,height:n}}function we(t,e,n){const o=F(e),i=P(e),s=n==="fixed",r=z(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const l=$(0);if((o||!s)&&((X(e)!=="body"||it(i))&&(c=rt(e)),o)){const m=z(e,!0,s,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}!o&&i&&(l.x=ct(i));const a=i&&!o&&!s?$t(i,c):$(0),f=r.left+c.scrollLeft-l.x-a.x,u=r.top+c.scrollTop-l.y-a.y;return{x:f,y:u,width:r.width,height:r.height}}function pt(t){return E(t).position==="static"}function Pt(t,e){if(!F(t)||E(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return P(t)===n&&(n=n.ownerDocument.body),n}function Dt(t,e){const n=R(t);if(st(t))return n;if(!F(t)){let i=B(t);for(;i&&!G(i);){if(L(i)&&!pt(i))return i;i=B(i)}return n}let o=Pt(t,e);for(;o&&ne(o)&&pt(o);)o=Pt(o,e);return o&&G(o)&&pt(o)&&!ut(o)?n:o||se(t)||n}const ye=async function(t){const e=this.getOffsetParent||Dt,n=this.getDimensions,o=await n(t.floating);return{reference:we(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function xe(t){return E(t).direction==="rtl"}const be={convertOffsetParentRelativeRectToViewportRelativeRect:le,getDocumentElement:P,getClippingRect:pe,getOffsetParent:Dt,getElementRects:ye,getClientRects:ae,getDimensions:ge,getScale:j,isElement:L,isRTL:xe};function Mt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function ve(t,e,n){let o=null,i;const s=P(t);function r(){var f;clearTimeout(i),(f=o)==null||f.disconnect(),o=null}function c(f,u){f===void 0&&(f=!1),u===void 0&&(u=1),r();const m=t.getBoundingClientRect(),{left:d,top:h,width:g,height:w}=m;if(f||e(),!g||!w)return;const p=tt(h),y=tt(s.clientWidth-(d+g)),x=tt(s.clientHeight-(h+w)),b=tt(d),v={rootMargin:-p+"px "+-y+"px "+-x+"px "+-b+"px",threshold:S(0,I(1,u))||1};let D=!0;function T(W){const O=W[0].intersectionRatio;if(!Mt(m,t.getBoundingClientRect()))return c();if(O!==u){if(!D)return c();O?c(!1,O):i=setTimeout(()=>{c(!1,1e-7)},1e3)}D=!1}try{o=new IntersectionObserver(T,{...v,root:s.ownerDocument})}catch{o=new IntersectionObserver(T,v)}o.observe(t)}const l=R(t),a=()=>c(n);return l.addEventListener("resize",a),c(!0),()=>{l.removeEventListener("resize",a),r()}}function Re(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,a=ht(t),f=i||s?[...a?J(a):[],...e?J(e):[]]:[];f.forEach(p=>{i&&p.addEventListener("scroll",n),s&&p.addEventListener("resize",n)});const u=a&&c?ve(a,n,s):null;let m=-1,d=null;r&&(d=new ResizeObserver(p=>{let[y]=p;y&&y.target===a&&d&&e&&(d.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var x;(x=d)==null||x.observe(e)})),n()}),a&&!l&&d.observe(a),e&&d.observe(e));let h,g=l?z(t):null;l&&w();function w(){const p=z(t);g&&!Mt(g,p)&&n(),g=p,h=requestAnimationFrame(w)}return n(),()=>{var p;f.forEach(y=>{i&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),u?.(),(p=d)==null||p.disconnect(),d=null,l&&cancelAnimationFrame(h)}}const Ce=Zt,Ae=te,Oe=Gt,Le=ee,Ee=(t,e,n)=>{const o=new Map,i=n??{},s={...be,...i.platform,_c:o};return Yt(t,e,{...i,platform:s})},Te=(t,e)=>({top:e,bottom:e,right:t}),Se=(t,e,n,o={})=>{if(typeof t.showPopover!="function")return()=>{};try{t.showPopover()}catch{return()=>{}}let i=!0,s=0;const r=e instanceof Element?e:{getBoundingClientRect:()=>({x:e.right,y:e.top,left:e.right,right:e.right,top:e.top,bottom:e.bottom,width:0,height:e.bottom-e.top})};t.style.width=`${n.width}px`,t.style.maxHeight=`${n.height}px`;const l=Re(r,t,()=>{const a=++s;Ee(r,t,{strategy:"fixed",placement:o.placement??"bottom-end",middleware:[Ce(8),Oe({padding:8,fallbackAxisSideDirection:"end"}),Ae({padding:8}),Le({padding:8,apply:({availableWidth:f,availableHeight:u})=>{!i||a!==s||(t.style.width=`${Math.max(0,Math.min(n.width,f))}px`,t.style.maxHeight=`${Math.max(0,Math.min(n.height,u))}px`)}})]}).then(({x:f,y:u})=>{!i||a!==s||!t.isConnected||(t.style.left=`${f}px`,t.style.top=`${u}px`)}).catch(()=>{})},{animationFrame:o.trackTransform??!1,elementResize:typeof ResizeObserver<"u",layoutShift:typeof IntersectionObserver<"u"});return()=>{i=!1,l()}},$e=t=>{if(!(!t||typeof t.hidePopover!="function"))try{t.hidePopover()}catch{}};class ke{#e;#t=new Map;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#e.requestUpdate()}hostUpdated(){for(const[e,n]of this.#t)e.isConnected||(n(),this.#t.delete(e))}hostDisconnected(){for(const e of this.#t.values())e();this.#t.clear()}open(e,n,o,i){this.#t.get(e)?.(),this.#t.set(e,Se(e,n,o,i))}}const Pe=Wt({en:{comment:"Comment",commentOn:t=>`Comment on ${t}`,submit:"Send",cancel:"Cancel"},ja:{comment:"\u30B3\u30E1\u30F3\u30C8",commentOn:t=>`${t}\u3078\u306E\u30B3\u30E1\u30F3\u30C8`,submit:"\u9001\u4FE1",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB"}}),De=(t,e,n={})=>({body:t,notes:e,submission:t.trim()||null,label:n.label??null,error:n.error??null,key:n.key??null}),Me=(t,e,n)=>{const o=()=>{e.submission!==null&&n({kind:"comment",body:e.submission})};return K`<div
|
|
2
2
|
class="comment-pop"
|
|
3
3
|
popover="manual"
|
|
4
4
|
role="dialog"
|
|
@@ -6,14 +6,15 @@ import{a0 as Wt,a3 as lt,a4 as K}from"./shared-7qenhU4J.js";const I=Math.min,S=M
|
|
|
6
6
|
@click=${i=>i.stopPropagation()}
|
|
7
7
|
@keydown=${i=>{i.isComposing||i.key!=="Escape"||(i.preventDefault(),i.stopPropagation(),n({kind:"dismiss"}))}}
|
|
8
8
|
>
|
|
9
|
-
${e.label?K`<strong class="comment-target">${e.label}</strong>`:
|
|
10
|
-
${e.error?K`<p class="comment-error" role="alert">${e.error}</p>`:
|
|
9
|
+
${e.label?K`<strong class="comment-target">${e.label}</strong>`:Q}
|
|
10
|
+
${e.error?K`<p class="comment-error" role="alert">${e.error}</p>`:Q}
|
|
11
11
|
${e.notes.length?K`<ul class="comment-list">
|
|
12
12
|
${e.notes.map(i=>K`<li>${i}</li>`)}
|
|
13
|
-
</ul>`:
|
|
13
|
+
</ul>`:Q}
|
|
14
14
|
<textarea
|
|
15
15
|
class="dpk-textarea"
|
|
16
16
|
aria-label=${t.comment}
|
|
17
|
+
data-dpk-text-key=${e.key??Q}
|
|
17
18
|
.value=${e.body}
|
|
18
19
|
@input=${i=>{i.currentTarget instanceof HTMLTextAreaElement&&n({kind:"input",body:i.currentTarget.value})}}
|
|
19
20
|
@keydown=${i=>{i.isComposing||i.key==="Enter"&&(i.ctrlKey||i.metaKey)&&(i.preventDefault(),o())}}
|
|
@@ -26,4 +27,4 @@ import{a0 as Wt,a3 as lt,a4 as K}from"./shared-7qenhU4J.js";const I=Math.min,S=M
|
|
|
26
27
|
${t.cancel}
|
|
27
28
|
</button>
|
|
28
29
|
</div>
|
|
29
|
-
</div>`};export{
|
|
30
|
+
</div>`};export{ke as P,Te as a,$e as b,Pe as c,De as p,Me as r};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as m,aq as E,v as w,aw as k,ay as S,af as s,ah as x,ai as f,av as D,ab as Ue,ac as A,ad as M,ae as q,P as Pe,e as Qe,a0 as Ce,V as I,R as g,l as Xe,a2 as H,a7 as Ye,j as Be,a1 as Ve,a8 as ze,a3 as $,aB as Ke,a4 as h,A as Fe,K as je,h as Je,a5 as z,T as Z}from"./shared-7qenhU4J.js";import{s as K,r as N,D as We}from"./shared-xrCdgpNS.js";import{P as He,r as Ze,p as Ge,c as et}from"./shared-BHGClRU3.js";const u={SET_STORY_NAME:m("SET_STORY_NAME","story",E({name:x(s(),f(1))})),SET_STORY_DESCRIPTION:m("SET_STORY_DESCRIPTION","story",E({description:s()})),REORDER_STORY:m("REORDER_STORY","story",E({after:D(s())}),{mode:"sequence"}),ADD_STORY:m("ADD_STORY","page",E({id:k,name:x(s(),f(1)),description:S(s())}),{dedupeKey:w}),DELETE_STORY:m("DELETE_STORY","story",E({})),SET_RULE_NAME:m("SET_RULE_NAME","rule",E({name:x(s(),f(1))})),SET_RULE_DESCRIPTION:m("SET_RULE_DESCRIPTION","rule",E({description:s()})),MOVE_RULE:m("MOVE_RULE","rule",E({storyId:x(s(),f(1)),after:D(s())}),{mode:"sequence"}),REORDER_RULE:m("REORDER_RULE","rule",E({after:D(s())}),{mode:"sequence"}),ADD_RULE:m("ADD_RULE","story",E({id:k,name:x(s(),f(1)),description:S(s())}),{dedupeKey:w}),DELETE_RULE:m("DELETE_RULE","rule",E({})),SET_EXAMPLE_NAME:m("SET_EXAMPLE_NAME","example",E({name:x(s(),f(1))})),SET_EXAMPLE_DESCRIPTION:m("SET_EXAMPLE_DESCRIPTION","example",E({description:s()})),MOVE_EXAMPLE:m("MOVE_EXAMPLE","example",E({ruleId:x(s(),f(1)),after:D(s())}),{mode:"sequence"}),REORDER_EXAMPLE:m("REORDER_EXAMPLE","example",E({after:D(s())}),{mode:"sequence"}),ADD_EXAMPLE:m("ADD_EXAMPLE","rule",E({id:k,name:x(s(),f(1)),description:S(s())}),{dedupeKey:w}),DELETE_EXAMPLE:m("DELETE_EXAMPLE","example",E({})),SET_QUESTION_NAME:m("SET_QUESTION_NAME","question",E({name:x(s(),f(1))})),SET_QUESTION_DESCRIPTION:m("SET_QUESTION_DESCRIPTION","question",E({description:s()})),MOVE_QUESTION:m("MOVE_QUESTION","question",E({ruleId:x(s(),f(1)),after:D(s())}),{mode:"sequence"}),REORDER_QUESTION:m("REORDER_QUESTION","question",E({after:D(s())}),{mode:"sequence"}),ADD_QUESTION:m("ADD_QUESTION","rule",E({id:k,name:x(s(),f(1)),description:S(s())}),{dedupeKey:w}),DELETE_QUESTION:m("DELETE_QUESTION","question",E({}))},L={setStoryName:(e,t)=>({type:"SET_STORY_NAME",target:{type:"story",id:e},payload:{name:t}}),setStoryDescription:(e,t)=>({type:"SET_STORY_DESCRIPTION",target:{type:"story",id:e},payload:{description:t}}),reorderStory:(e,t)=>({type:"REORDER_STORY",target:{type:"story",id:e},payload:{after:t}}),addStory:(e,t)=>({type:"ADD_STORY",target:{type:"page",id:"example-mapping"},payload:{id:e,name:t}}),deleteStory:e=>({type:"DELETE_STORY",target:{type:"story",id:e},payload:{}}),setRuleName:(e,t)=>({type:"SET_RULE_NAME",target:{type:"rule",id:e},payload:{name:t}}),setRuleDescription:(e,t)=>({type:"SET_RULE_DESCRIPTION",target:{type:"rule",id:e},payload:{description:t}}),moveRule:(e,t,r)=>({type:"MOVE_RULE",target:{type:"rule",id:e},payload:{storyId:t,after:r}}),reorderRule:(e,t)=>({type:"REORDER_RULE",target:{type:"rule",id:e},payload:{after:t}}),addRule:(e,t,r)=>({type:"ADD_RULE",target:{type:"story",id:e},payload:{id:t,name:r}}),deleteRule:e=>({type:"DELETE_RULE",target:{type:"rule",id:e},payload:{}}),setExampleName:(e,t)=>({type:"SET_EXAMPLE_NAME",target:{type:"example",id:e},payload:{name:t}}),setExampleDescription:(e,t)=>({type:"SET_EXAMPLE_DESCRIPTION",target:{type:"example",id:e},payload:{description:t}}),moveExample:(e,t,r)=>({type:"MOVE_EXAMPLE",target:{type:"example",id:e},payload:{ruleId:t,after:r}}),reorderExample:(e,t)=>({type:"REORDER_EXAMPLE",target:{type:"example",id:e},payload:{after:t}}),addExample:(e,t,r)=>({type:"ADD_EXAMPLE",target:{type:"rule",id:e},payload:{id:t,name:r}}),deleteExample:e=>({type:"DELETE_EXAMPLE",target:{type:"example",id:e},payload:{}}),setQuestionName:(e,t)=>({type:"SET_QUESTION_NAME",target:{type:"question",id:e},payload:{name:t}}),setQuestionDescription:(e,t)=>({type:"SET_QUESTION_DESCRIPTION",target:{type:"question",id:e},payload:{description:t}}),moveQuestion:(e,t,r)=>({type:"MOVE_QUESTION",target:{type:"question",id:e},payload:{ruleId:t,after:r}}),reorderQuestion:(e,t)=>({type:"REORDER_QUESTION",target:{type:"question",id:e},payload:{after:t}}),addQuestion:(e,t,r)=>({type:"ADD_QUESTION",target:{type:"rule",id:e},payload:{id:t,name:r}}),deleteQuestion:e=>({type:"DELETE_QUESTION",target:{type:"question",id:e},payload:{}})},tt=A({id:k,name:x(s(),f(1)),description:S(s())}),rt=A({id:k,storyId:x(s(),f(1)),name:x(s(),f(1)),description:S(s())}),G=A({id:k,ruleId:x(s(),f(1)),name:x(s(),f(1)),description:S(s())}),ee=A({title:S(s()),stories:M(q(tt),[]),rules:M(q(rt),[]),examples:M(q(G),[]),questions:M(q(G),[])}),te=e=>{const t=Ue(ee,e),r=new Set,a=(i,d)=>{if(r.has(d))throw new Error(`duplicate id "${d}" in ${i}`);r.add(d)},n=new Set(t.stories.map(i=>i.id));for(const i of t.stories)a("stories",i.id);for(const i of t.rules)if(a("rules",i.id),!n.has(i.storyId))throw new Error(`rule "${i.id}" references unknown storyId "${i.storyId}"`);const o=new Map(t.rules.map(i=>[i.id,i]));for(const i of t.examples)if(a("examples",i.id),!o.has(i.ruleId))throw new Error(`example "${i.id}" references unknown ruleId "${i.ruleId}"`);for(const i of t.questions)if(a("questions",i.id),!o.has(i.ruleId))throw new Error(`question "${i.id}" references unknown ruleId "${i.ruleId}"`);return t},re=()=>({stories:[],rules:[],examples:[],questions:[]}),at=e=>({...e,rules:K(e.rules,["storyId"]),examples:K(e.examples,["ruleId"]),questions:K(e.questions,["ruleId"])}),T=(e,t)=>{if(t!==void 0)return e.stories.find(r=>r.id===t)},y=(e,t)=>{if(t!==void 0)return e.rules.find(r=>r.id===t)},b=(e,t)=>{if(t!==void 0)return e.examples.find(r=>r.id===t)},R=(e,t)=>{if(t!==void 0)return e.questions.find(r=>r.id===t)},U=(e,t)=>{if(t===void 0)return;const r=T(e,t);if(r)return{kind:"story",id:r.id,name:r.name,...r.description===void 0?{}:{description:r.description}};const a=y(e,t);if(a)return{kind:"rule",id:a.id,name:a.name,...a.description===void 0?{}:{description:a.description}};const n=b(e,t);if(n)return{kind:"example",id:n.id,name:n.name,...n.description===void 0?{}:{description:n.description}};const o=R(e,t);if(o)return{kind:"question",id:o.id,name:o.name,...o.description===void 0?{}:{description:o.description}}},ae=(e,t)=>e.rules.filter(r=>r.storyId===t),ne=(e,t)=>e.examples.filter(r=>r.ruleId===t),oe=(e,t)=>e.questions.filter(r=>r.ruleId===t),nt=(e,t)=>{if(T(e,t))return t;const r=y(e,t);if(r)return r.storyId;const a=b(e,t)?.ruleId??R(e,t)?.ruleId;return a===void 0?void 0:y(e,a)?.storyId},ie=e=>[...e.stories.map(t=>t.id),...e.rules.map(t=>t.id),...e.examples.map(t=>t.id),...e.questions.map(t=>t.id)],de=(e,t)=>y(e,t)?.storyId,ot=(e,t)=>{const r=b(e,t);return r?de(e,r.ruleId):void 0},se=(e,t)=>{const r=Pe(u,t);if(r===null)return null;const a=r.target.id;switch(r.type){case"SET_STORY_NAME":return le(e,a,n=>({...n,name:r.payload.name}));case"SET_STORY_DESCRIPTION":return le(e,a,n=>({...n,description:r.payload.description}));case"REORDER_STORY":{const n=Ee(e.stories,a,r.payload.after);return n===null?null:{...e,stories:n}}case"ADD_STORY":{const n=r.payload;return e.stories.some(o=>o.id===n.id)?e:P(e,n.id)?null:{...e,stories:[...e.stories,{id:n.id,name:n.name,...n.description===void 0?{}:{description:n.description}}]}}case"DELETE_STORY":{if(!e.stories.some(o=>o.id===a))return null;const n=new Set(e.rules.filter(o=>o.storyId===a).map(o=>o.id));return{...e,stories:e.stories.filter(o=>o.id!==a),rules:e.rules.filter(o=>o.storyId!==a),examples:e.examples.filter(o=>!n.has(o.ruleId)),questions:e.questions.filter(o=>!n.has(o.ruleId))}}case"SET_RULE_NAME":return pe(e,a,n=>({...n,name:r.payload.name}));case"SET_RULE_DESCRIPTION":return pe(e,a,n=>({...n,description:r.payload.description}));case"MOVE_RULE":{const n=r.payload,o=y(e,a);if(!o||!e.stories.some(d=>d.id===n.storyId))return null;const i=e.rules.filter(d=>d.storyId===n.storyId&&d.id!==a);return n.after!==null&&!i.some(d=>d.id===n.after)?null:{...e,rules:me(e.rules,{...o,storyId:n.storyId},n.after)}}case"REORDER_RULE":{const n=y(e,a);if(!n)return null;const o=e.rules.filter(i=>i.storyId===n.storyId);return r.payload.after!==null&&!o.some(i=>i.id===r.payload.after)?null:{...e,rules:me(e.rules,n,r.payload.after)}}case"ADD_RULE":{const n=r.payload,o=T(e,a);return o?e.rules.some(i=>i.id===n.id)?e:P(e,n.id)?null:{...e,rules:[...e.rules,{id:n.id,storyId:o.id,name:n.name,...n.description===void 0?{}:{description:n.description}}]}:null}case"DELETE_RULE":return y(e,a)?{...e,rules:e.rules.filter(n=>n.id!==a),examples:e.examples.filter(n=>n.ruleId!==a),questions:e.questions.filter(n=>n.ruleId!==a)}:null;case"SET_EXAMPLE_NAME":return ue(e,a,n=>({...n,name:r.payload.name}));case"SET_EXAMPLE_DESCRIPTION":return ue(e,a,n=>({...n,description:r.payload.description}));case"MOVE_EXAMPLE":{const n=r.payload,o=b(e,a);if(!o||!y(e,n.ruleId))return null;const i=e.examples.filter(d=>d.ruleId===n.ruleId&&d.id!==a);return n.after!==null&&!i.some(d=>d.id===n.after)?null:{...e,examples:Q(e.examples,{...o,ruleId:n.ruleId},n.after)}}case"REORDER_EXAMPLE":{const n=b(e,a);if(!n)return null;const o=e.examples.filter(i=>i.ruleId===n.ruleId);return r.payload.after!==null&&!o.some(i=>i.id===r.payload.after)?null:{...e,examples:Q(e.examples,n,r.payload.after)}}case"ADD_EXAMPLE":{const n=r.payload,o=y(e,a);return o?e.examples.some(i=>i.id===n.id)?e:P(e,n.id)?null:{...e,examples:[...e.examples,{id:n.id,ruleId:o.id,name:n.name,...n.description===void 0?{}:{description:n.description}}]}:null}case"DELETE_EXAMPLE":return b(e,a)?{...e,examples:e.examples.filter(n=>n.id!==a)}:null;case"SET_QUESTION_NAME":return ce(e,a,n=>({...n,name:r.payload.name}));case"SET_QUESTION_DESCRIPTION":return ce(e,a,n=>({...n,description:r.payload.description}));case"MOVE_QUESTION":{const n=r.payload,o=R(e,a);if(!o||!y(e,n.ruleId))return null;const i=e.questions.filter(d=>d.ruleId===n.ruleId&&d.id!==a);return n.after!==null&&!i.some(d=>d.id===n.after)?null:{...e,questions:Q(e.questions,{...o,ruleId:n.ruleId},n.after)}}case"REORDER_QUESTION":{const n=R(e,a);if(!n)return null;const o=e.questions.filter(i=>i.ruleId===n.ruleId);return r.payload.after!==null&&!o.some(i=>i.id===r.payload.after)?null:{...e,questions:Q(e.questions,n,r.payload.after)}}case"ADD_QUESTION":{const n=r.payload,o=y(e,a);return o?e.questions.some(i=>i.id===n.id)?e:P(e,n.id)?null:{...e,questions:[...e.questions,{id:n.id,ruleId:o.id,name:n.name,...n.description===void 0?{}:{description:n.description}}]}:null}case"DELETE_QUESTION":return R(e,a)?{...e,questions:e.questions.filter(n=>n.id!==a)}:null;default:return Qe(r)}},P=(e,t)=>e.stories.some(r=>r.id===t)||e.rules.some(r=>r.id===t)||e.examples.some(r=>r.id===t)||e.questions.some(r=>r.id===t),le=(e,t,r)=>e.stories.some(a=>a.id===t)?{...e,stories:e.stories.map(a=>a.id===t?r(a):a)}:null,pe=(e,t,r)=>e.rules.some(a=>a.id===t)?{...e,rules:e.rules.map(a=>a.id===t?r(a):a)}:null,ue=(e,t,r)=>e.examples.some(a=>a.id===t)?{...e,examples:e.examples.map(a=>a.id===t?r(a):a)}:null,ce=(e,t,r)=>e.questions.some(a=>a.id===t)?{...e,questions:e.questions.map(a=>a.id===t?r(a):a)}:null,me=(e,t,r)=>{const a=e.filter(l=>l.id!==t.id),n=a.filter(l=>l.storyId===t.storyId),o=r===null?[t,...n]:F(n,t,r),i=a.findIndex(l=>l.storyId===t.storyId),d=new Set(n.map(l=>l.id)),c=a.filter(l=>!d.has(l.id)),p=i<0?c.length:Math.min(i,c.length);return[...c.slice(0,p),...o,...c.slice(p)]},Q=(e,t,r)=>{const a=e.filter(l=>l.id!==t.id),n=a.filter(l=>l.ruleId===t.ruleId),o=r===null?[t,...n]:F(n,t,r),i=a.findIndex(l=>l.ruleId===t.ruleId),d=new Set(n.map(l=>l.id)),c=a.filter(l=>!d.has(l.id)),p=i<0?c.length:Math.min(i,c.length);return[...c.slice(0,p),...o,...c.slice(p)]},Ee=(e,t,r)=>{if(!e.some(o=>o.id===t)||r!==null&&!e.some(o=>o.id===r))return null;if(r===t)return[...e];const a=e.find(o=>o.id===t);if(a===void 0)return null;const n=e.filter(o=>o.id!==t);return F(n,a,r)},F=(e,t,r)=>{const a=[...e],n=r===null?-1:a.findIndex(o=>o.id===r);return a.splice(n+1,0,t),a},it={story:"Story",rule:"Rule",example:"Example",question:"Question"},dt={story:"\u30B9\u30C8\u30FC\u30EA\u30FC",rule:"\u30EB\u30FC\u30EB",example:"\u5177\u4F53\u4F8B",question:"\u8CEA\u554F"},st={empty:"No rules yet","open-questions":"Open questions","too-big":"Consider splitting",thin:"A rule has no example",ready:"Looks ready"},lt={empty:"\u30EB\u30FC\u30EB\u672A\u6574\u7406","open-questions":"\u672A\u89E3\u6C7A\u306E\u8CEA\u554F\u3042\u308A","too-big":"\u5206\u5272\u3092\u691C\u8A0E",thin:"\u5177\u4F53\u4F8B\u306E\u7121\u3044\u30EB\u30FC\u30EB\u3042\u308A",ready:"\u5408\u610F\u3067\u304D\u305D\u3046"},C=Ce({en:{kindLabel:e=>it[e],readinessLabel:e=>st[e],map:"Map",cardKinds:"Card kinds",noStoriesTitle:"No stories yet",noStoriesBody:"Place one story (yellow), then line up the rules (blue) that accept it beneath it. For each rule, stack examples (green) in the top area and open questions (red) in the bottom area.",firstStory:"+ First story",addStoryButton:"+ Story",noExamples:"No examples yet",noQuestions:"No open questions",commentButton:"Comment",deleteButton:"Delete",nameField:e=>`${e} name`,newStory:"New story",newRule:"New rule",newExample:"New example",newQuestion:"New question",storyRenamedTitle:"Renamed the story",storyDescriptionUpdatedTitle:"Updated the story\u2019s description",storyReorderedTitle:"Reordered the story",storyAddedTitle:"Added a story",storyDeletedTitle:"Deleted the story",ruleRenamedTitle:"Renamed the rule",ruleDescriptionUpdatedTitle:"Updated the rule\u2019s description",ruleMovedTitle:"Moved the rule",ruleReorderedTitle:"Reordered the rule",ruleAddedTitle:"Added a rule",ruleDeletedTitle:"Deleted the rule",exampleRenamedTitle:"Renamed the example",exampleDescriptionUpdatedTitle:"Updated the example\u2019s description",exampleMovedTitle:"Moved the example",exampleReorderedTitle:"Reordered the example",exampleAddedTitle:"Added an example",exampleDeletedTitle:"Deleted the example",questionRenamedTitle:"Renamed the question",questionDescriptionUpdatedTitle:"Updated the question\u2019s description",questionMovedTitle:"Moved the question",questionReorderedTitle:"Reordered the question",questionAddedTitle:"Added a question",questionDeletedTitle:"Deleted the question",arrowTo:e=>`\u2192 \u201C${e}\u201D`,arrowFrom:(e,t)=>`\u201C${e}\u201D \u2192 \u201C${t}\u201D`,added:e=>`+ \u201C${e}\u201D`,deleted:e=>`\u2212 \u201C${e}\u201D`,toTop:"\u2192 To the top",afterPlacement:e=>`\u2192 After \u201C${e}\u201D`,wholeMap:"Whole map"},ja:{kindLabel:e=>dt[e],readinessLabel:e=>lt[e],map:"\u30DE\u30C3\u30D7",cardKinds:"\u30AB\u30FC\u30C9\u306E\u7A2E\u985E",noStoriesTitle:"\u30B9\u30C8\u30FC\u30EA\u30FC\u304C\u307E\u3060\u3042\u308A\u307E\u305B\u3093",noStoriesBody:"\u30B9\u30C8\u30FC\u30EA\u30FC\uFF08\u9EC4\uFF09\u30921\u679A\u7F6E\u304D\u3001\u305D\u306E\u4E0B\u306B\u53D7\u3051\u5165\u308C\u6761\u4EF6\u3068\u306A\u308B\u30EB\u30FC\u30EB\uFF08\u9752\uFF09\u3092\u4E26\u3079\u307E\u3059\u3002\u30EB\u30FC\u30EB\u3054\u3068\u306B\u3001\u4E0A\u306E\u6B04\u3078\u5177\u4F53\u4F8B\uFF08\u7DD1\uFF09\u3092\u3001\u4E0B\u306E\u6B04\u3078\u7B54\u3048\u306E\u51FA\u306A\u3044\u8AD6\u70B9\u3092\u8CEA\u554F\uFF08\u8D64\uFF09\u3068\u3057\u3066\u7A4D\u307F\u307E\u3059\u3002",firstStory:"+ \u6700\u521D\u306E\u30B9\u30C8\u30FC\u30EA\u30FC",addStoryButton:"+ \u30B9\u30C8\u30FC\u30EA\u30FC",noExamples:"\u5177\u4F53\u4F8B\u304C\u307E\u3060\u3042\u308A\u307E\u305B\u3093",noQuestions:"\u672A\u89E3\u6C7A\u306E\u8CEA\u554F\u306F\u3042\u308A\u307E\u305B\u3093",commentButton:"\u30B3\u30E1\u30F3\u30C8",deleteButton:"\u524A\u9664",nameField:e=>`${e}\u540D`,newStory:"\u65B0\u3057\u3044\u30B9\u30C8\u30FC\u30EA\u30FC",newRule:"\u65B0\u3057\u3044\u30EB\u30FC\u30EB",newExample:"\u65B0\u3057\u3044\u5177\u4F53\u4F8B",newQuestion:"\u65B0\u3057\u3044\u8CEA\u554F",storyRenamedTitle:"\u30B9\u30C8\u30FC\u30EA\u30FC\u540D\u3092\u5909\u66F4",storyDescriptionUpdatedTitle:"\u30B9\u30C8\u30FC\u30EA\u30FC\u306E\u8AAC\u660E\u3092\u66F4\u65B0",storyReorderedTitle:"\u30B9\u30C8\u30FC\u30EA\u30FC\u306E\u9806\u5E8F\u3092\u5909\u66F4",storyAddedTitle:"\u30B9\u30C8\u30FC\u30EA\u30FC\u3092\u8FFD\u52A0",storyDeletedTitle:"\u30B9\u30C8\u30FC\u30EA\u30FC\u3092\u524A\u9664",ruleRenamedTitle:"\u30EB\u30FC\u30EB\u540D\u3092\u5909\u66F4",ruleDescriptionUpdatedTitle:"\u30EB\u30FC\u30EB\u306E\u8AAC\u660E\u3092\u66F4\u65B0",ruleMovedTitle:"\u30EB\u30FC\u30EB\u3092\u79FB\u52D5",ruleReorderedTitle:"\u30EB\u30FC\u30EB\u306E\u9806\u5E8F\u3092\u5909\u66F4",ruleAddedTitle:"\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0",ruleDeletedTitle:"\u30EB\u30FC\u30EB\u3092\u524A\u9664",exampleRenamedTitle:"\u5177\u4F53\u4F8B\u540D\u3092\u5909\u66F4",exampleDescriptionUpdatedTitle:"\u5177\u4F53\u4F8B\u306E\u8AAC\u660E\u3092\u66F4\u65B0",exampleMovedTitle:"\u5177\u4F53\u4F8B\u3092\u79FB\u52D5",exampleReorderedTitle:"\u5177\u4F53\u4F8B\u306E\u9806\u5E8F\u3092\u5909\u66F4",exampleAddedTitle:"\u5177\u4F53\u4F8B\u3092\u8FFD\u52A0",exampleDeletedTitle:"\u5177\u4F53\u4F8B\u3092\u524A\u9664",questionRenamedTitle:"\u8CEA\u554F\u540D\u3092\u5909\u66F4",questionDescriptionUpdatedTitle:"\u8CEA\u554F\u306E\u8AAC\u660E\u3092\u66F4\u65B0",questionMovedTitle:"\u8CEA\u554F\u3092\u79FB\u52D5",questionReorderedTitle:"\u8CEA\u554F\u306E\u9806\u5E8F\u3092\u5909\u66F4",questionAddedTitle:"\u8CEA\u554F\u3092\u8FFD\u52A0",questionDeletedTitle:"\u8CEA\u554F\u3092\u524A\u9664",arrowTo:e=>`\u2192 \u300C${e}\u300D`,arrowFrom:(e,t)=>`\u300C${e}\u300D\u2192\u300C${t}\u300D`,added:e=>`+ \u300C${e}\u300D`,deleted:e=>`\u2212 \u300C${e}\u300D`,toTop:"\u2192 \u5148\u982D\u3078",afterPlacement:e=>`\u2192 \u300C${e}\u300D\u306E\u76F4\u5F8C\u3078`,wholeMap:"\u30DE\u30C3\u30D7\u5168\u4F53"}}),X=(e,t,r)=>{const a=typeof r=="string"?r:"",n=typeof t=="string"?t:void 0;return n===void 0?e.arrowTo(a):e.arrowFrom(n,a)},pt={SET_STORY_NAME:(e,t,r)=>({title:e.storyRenamedTitle,tone:"update",body:X(e,T(r,t.target.id)?.name,g(u.SET_STORY_NAME,t).name??"")}),SET_STORY_DESCRIPTION:(e,t)=>({title:e.storyDescriptionUpdatedTitle,tone:"update",body:e.arrowTo(String(g(u.SET_STORY_DESCRIPTION,t).description??"").slice(0,90))}),REORDER_STORY:(e,t)=>({title:e.storyReorderedTitle,tone:"move",body:Y(e,g(u.REORDER_STORY,t).after)}),ADD_STORY:(e,t)=>({title:e.storyAddedTitle,tone:"create",body:e.added(String(g(u.ADD_STORY,t).name??""))}),DELETE_STORY:(e,t,r)=>({title:e.storyDeletedTitle,tone:"delete",body:e.deleted(T(r,t.target.id)?.name??t.target.id)}),SET_RULE_NAME:(e,t,r)=>({title:e.ruleRenamedTitle,tone:"update",body:X(e,y(r,t.target.id)?.name,g(u.SET_RULE_NAME,t).name??"")}),SET_RULE_DESCRIPTION:(e,t)=>({title:e.ruleDescriptionUpdatedTitle,tone:"update",body:e.arrowTo(String(g(u.SET_RULE_DESCRIPTION,t).description??"").slice(0,90))}),MOVE_RULE:(e,t,r)=>({title:e.ruleMovedTitle,tone:"move",body:e.arrowTo(T(r,String(g(u.MOVE_RULE,t).storyId))?.name??String(g(u.MOVE_RULE,t).storyId??""))}),REORDER_RULE:(e,t)=>({title:e.ruleReorderedTitle,tone:"move",body:Y(e,g(u.REORDER_RULE,t).after)}),ADD_RULE:(e,t)=>({title:e.ruleAddedTitle,tone:"create",body:e.added(String(g(u.ADD_RULE,t).name??""))}),DELETE_RULE:(e,t,r)=>({title:e.ruleDeletedTitle,tone:"delete",body:e.deleted(y(r,t.target.id)?.name??t.target.id)}),SET_EXAMPLE_NAME:(e,t,r)=>({title:e.exampleRenamedTitle,tone:"update",body:X(e,b(r,t.target.id)?.name,g(u.SET_EXAMPLE_NAME,t).name??"")}),SET_EXAMPLE_DESCRIPTION:(e,t)=>({title:e.exampleDescriptionUpdatedTitle,tone:"update",body:e.arrowTo(String(g(u.SET_EXAMPLE_DESCRIPTION,t).description??"").slice(0,90))}),MOVE_EXAMPLE:(e,t,r)=>({title:e.exampleMovedTitle,tone:"move",body:e.arrowTo(y(r,String(g(u.MOVE_EXAMPLE,t).ruleId))?.name??String(g(u.MOVE_EXAMPLE,t).ruleId??""))}),REORDER_EXAMPLE:(e,t)=>({title:e.exampleReorderedTitle,tone:"move",body:Y(e,g(u.REORDER_EXAMPLE,t).after)}),ADD_EXAMPLE:(e,t)=>({title:e.exampleAddedTitle,tone:"create",body:e.added(String(g(u.ADD_EXAMPLE,t).name??""))}),DELETE_EXAMPLE:(e,t,r)=>({title:e.exampleDeletedTitle,tone:"delete",body:e.deleted(b(r,t.target.id)?.name??t.target.id)}),SET_QUESTION_NAME:(e,t,r)=>({title:e.questionRenamedTitle,tone:"update",body:X(e,R(r,t.target.id)?.name,g(u.SET_QUESTION_NAME,t).name??"")}),SET_QUESTION_DESCRIPTION:(e,t)=>({title:e.questionDescriptionUpdatedTitle,tone:"update",body:e.arrowTo(String(g(u.SET_QUESTION_DESCRIPTION,t).description??"").slice(0,90))}),MOVE_QUESTION:(e,t,r)=>({title:e.questionMovedTitle,tone:"move",body:e.arrowTo(y(r,String(g(u.MOVE_QUESTION,t).ruleId))?.name??String(g(u.MOVE_QUESTION,t).ruleId??""))}),REORDER_QUESTION:(e,t)=>({title:e.questionReorderedTitle,tone:"move",body:Y(e,g(u.REORDER_QUESTION,t).after)}),ADD_QUESTION:(e,t)=>({title:e.questionAddedTitle,tone:"create",body:e.added(String(g(u.ADD_QUESTION,t).name??""))}),DELETE_QUESTION:(e,t,r)=>({title:e.questionDeletedTitle,tone:"delete",body:e.deleted(R(r,t.target.id)?.name??t.target.id)})},Y=(e,t)=>t==null?e.toTop:e.afterPlacement(t),ge=(e,t,r,a)=>{let n;try{const o=pt[t.type];n=o?o(e,t,a??r):{title:t.type,tone:"meta"}}catch{n={title:t.type,tone:"meta"}}return{title:n.title,targetLabel:xe(e,r,t.target),tone:n.tone,...n.body===void 0?{}:{summary:n.body}}},ye=e=>`${e.type} ${I(e.target)} ${JSON.stringify(e.payload)}`,xe=(e,t,r)=>{try{switch(r.type){case"story":{const a=T(t,r.id);return a?`${e.kindLabel("story")} \xB7 ${a.name}`:`${e.kindLabel("story")} \xB7 ${r.id} (missing)`}case"rule":{const a=y(t,r.id);return a?`${e.kindLabel("rule")} \xB7 ${a.name}`:`${e.kindLabel("rule")} \xB7 ${r.id} (missing)`}case"example":{const a=b(t,r.id);return a?`${e.kindLabel("example")} \xB7 ${a.name}`:`${e.kindLabel("example")} \xB7 ${r.id} (missing)`}case"question":{const a=R(t,r.id);return a?`${e.kindLabel("question")} \xB7 ${a.name}`:`${e.kindLabel("question")} \xB7 ${r.id} (missing)`}case"page":return`${e.map} \xB7 ${j(t)}`;default:return`${r.type} \xB7 ${r.id}`}}catch{return`${r.type} \xB7 ${r.id}`}},fe=(e,t,r)=>{const a=[{value:"page:example-mapping",label:e.wholeMap,group:e.map}];for(const n of t.stories)a.push({value:I({type:"story",id:n.id}),label:n.name,group:e.kindLabel("story")});for(const n of t.rules){const o=T(t,n.storyId);a.push({value:I({type:"rule",id:n.id}),label:o?`${o.name} \u203A ${n.name}`:n.name,group:e.kindLabel("rule")})}for(const n of t.examples){const o=y(t,n.ruleId);a.push({value:I({type:"example",id:n.id}),label:o?`${o.name} \u203A ${n.name}`:n.name,group:e.kindLabel("example")})}for(const n of t.questions){const o=y(t,n.ruleId);a.push({value:I({type:"question",id:n.id}),label:o?`${o.name} \u203A ${n.name}`:n.name,group:e.kindLabel("question")})}return a},he=(e,t,r)=>{const a=U(t,r.card);return a?{value:I({type:a.kind,id:a.id}),label:a.name,group:e.kindLabel(a.kind)}:null},ut=4,Te=(e,t,r)=>{const a=t.rules.filter(p=>p.storyId===r),n=new Set(a.map(p=>p.id)),o=t.examples.filter(p=>n.has(p.ruleId)),i=t.questions.filter(p=>n.has(p.ruleId)).length,d=a.some(p=>!o.some(l=>l.ruleId===p.id)),c=a.length===0?"empty":i>0?"open-questions":a.length>ut?"too-big":d?"thin":"ready";return{rules:a.length,examples:o.length,questions:i,readiness:c,label:e.readinessLabel(c)}},j=e=>e.title??"Example Mapping",be=(e,t)=>{const r=U(e,t.card),a={...t};return r?a.card=r.id:delete a.card,a},Re=(e,t)=>{switch(t.type){case"story":case"rule":case"example":case"question":return U(e,t.id)?.kind===t.type;case"page":return!0;default:return!1}},Se=e=>{const t=C(e);return{name:"example-mapping",label:"Example Mapping",parseBase:te,emptyBase:re,actions:u,apply:se,canonicalState:at,hasTarget:Re,describe:(r,a,n)=>ge(t,r,a,n),serialize:ye,resolveNavigation:be,commentTargets:(r,a)=>fe(t,r),currentTarget:(r,a)=>he(t,r,a),title:j}},B=(e,t,r)=>{const a=Xe(t,ie(e.state));return e.dispatch(r(a)).ok?(e.navigate({card:a}),a):null},ct=(e,t)=>B(e,"new-story",r=>L.addStory(r,t.newStory)),mt=(e,t,r)=>B(e,"new-rule",a=>L.addRule(r,a,t.newRule)),Et=(e,t,r)=>B(e,"new-example",a=>L.addExample(r,a,t.newExample)),gt=(e,t,r)=>B(e,"new-question",a=>L.addQuestion(r,a,t.newQuestion)),yt={width:300,height:260},ve=["story","rule","example","question"],_e={story:{bg:"linear-gradient(178deg, #fff3a6, #fde77a)",ink:"#4a3a06"},rule:{bg:"linear-gradient(178deg, #a3d1f5, #7cb8ea)",ink:"#0e2c4b"},example:{bg:"linear-gradient(178deg, #c9eb95, #a8dc63)",ink:"#22380a"},question:{bg:"linear-gradient(178deg, #fbc6d9, #f4a0c0)",ink:"#4b1029"}},O=e=>{const{bg:t,ink:r}=_e[e];return`--em-card-bg:${t};--em-card-ink:${r}`},xt=H`
|
|
1
|
+
import{p as m,aq as E,v as w,aw as k,ay as S,af as s,ah as x,ai as f,av as D,ab as Ue,ac as A,ad as M,ae as q,P as Pe,e as Qe,a0 as Ce,V as I,R as g,l as Xe,a2 as H,a7 as Ye,j as Be,a1 as Ve,a8 as ze,a3 as $,aB as Ke,a4 as h,A as Fe,K as je,h as Je,a5 as z,T as Z}from"./shared-B_MMP97h.js";import{s as K,r as N,D as We}from"./shared-xrCdgpNS.js";import{P as He,r as Ze,p as Ge,c as et}from"./shared-B4ewpBuM.js";const u={SET_STORY_NAME:m("SET_STORY_NAME","story",E({name:x(s(),f(1))})),SET_STORY_DESCRIPTION:m("SET_STORY_DESCRIPTION","story",E({description:s()})),REORDER_STORY:m("REORDER_STORY","story",E({after:D(s())}),{mode:"sequence"}),ADD_STORY:m("ADD_STORY","page",E({id:k,name:x(s(),f(1)),description:S(s())}),{dedupeKey:w}),DELETE_STORY:m("DELETE_STORY","story",E({})),SET_RULE_NAME:m("SET_RULE_NAME","rule",E({name:x(s(),f(1))})),SET_RULE_DESCRIPTION:m("SET_RULE_DESCRIPTION","rule",E({description:s()})),MOVE_RULE:m("MOVE_RULE","rule",E({storyId:x(s(),f(1)),after:D(s())}),{mode:"sequence"}),REORDER_RULE:m("REORDER_RULE","rule",E({after:D(s())}),{mode:"sequence"}),ADD_RULE:m("ADD_RULE","story",E({id:k,name:x(s(),f(1)),description:S(s())}),{dedupeKey:w}),DELETE_RULE:m("DELETE_RULE","rule",E({})),SET_EXAMPLE_NAME:m("SET_EXAMPLE_NAME","example",E({name:x(s(),f(1))})),SET_EXAMPLE_DESCRIPTION:m("SET_EXAMPLE_DESCRIPTION","example",E({description:s()})),MOVE_EXAMPLE:m("MOVE_EXAMPLE","example",E({ruleId:x(s(),f(1)),after:D(s())}),{mode:"sequence"}),REORDER_EXAMPLE:m("REORDER_EXAMPLE","example",E({after:D(s())}),{mode:"sequence"}),ADD_EXAMPLE:m("ADD_EXAMPLE","rule",E({id:k,name:x(s(),f(1)),description:S(s())}),{dedupeKey:w}),DELETE_EXAMPLE:m("DELETE_EXAMPLE","example",E({})),SET_QUESTION_NAME:m("SET_QUESTION_NAME","question",E({name:x(s(),f(1))})),SET_QUESTION_DESCRIPTION:m("SET_QUESTION_DESCRIPTION","question",E({description:s()})),MOVE_QUESTION:m("MOVE_QUESTION","question",E({ruleId:x(s(),f(1)),after:D(s())}),{mode:"sequence"}),REORDER_QUESTION:m("REORDER_QUESTION","question",E({after:D(s())}),{mode:"sequence"}),ADD_QUESTION:m("ADD_QUESTION","rule",E({id:k,name:x(s(),f(1)),description:S(s())}),{dedupeKey:w}),DELETE_QUESTION:m("DELETE_QUESTION","question",E({}))},L={setStoryName:(e,t)=>({type:"SET_STORY_NAME",target:{type:"story",id:e},payload:{name:t}}),setStoryDescription:(e,t)=>({type:"SET_STORY_DESCRIPTION",target:{type:"story",id:e},payload:{description:t}}),reorderStory:(e,t)=>({type:"REORDER_STORY",target:{type:"story",id:e},payload:{after:t}}),addStory:(e,t)=>({type:"ADD_STORY",target:{type:"page",id:"example-mapping"},payload:{id:e,name:t}}),deleteStory:e=>({type:"DELETE_STORY",target:{type:"story",id:e},payload:{}}),setRuleName:(e,t)=>({type:"SET_RULE_NAME",target:{type:"rule",id:e},payload:{name:t}}),setRuleDescription:(e,t)=>({type:"SET_RULE_DESCRIPTION",target:{type:"rule",id:e},payload:{description:t}}),moveRule:(e,t,r)=>({type:"MOVE_RULE",target:{type:"rule",id:e},payload:{storyId:t,after:r}}),reorderRule:(e,t)=>({type:"REORDER_RULE",target:{type:"rule",id:e},payload:{after:t}}),addRule:(e,t,r)=>({type:"ADD_RULE",target:{type:"story",id:e},payload:{id:t,name:r}}),deleteRule:e=>({type:"DELETE_RULE",target:{type:"rule",id:e},payload:{}}),setExampleName:(e,t)=>({type:"SET_EXAMPLE_NAME",target:{type:"example",id:e},payload:{name:t}}),setExampleDescription:(e,t)=>({type:"SET_EXAMPLE_DESCRIPTION",target:{type:"example",id:e},payload:{description:t}}),moveExample:(e,t,r)=>({type:"MOVE_EXAMPLE",target:{type:"example",id:e},payload:{ruleId:t,after:r}}),reorderExample:(e,t)=>({type:"REORDER_EXAMPLE",target:{type:"example",id:e},payload:{after:t}}),addExample:(e,t,r)=>({type:"ADD_EXAMPLE",target:{type:"rule",id:e},payload:{id:t,name:r}}),deleteExample:e=>({type:"DELETE_EXAMPLE",target:{type:"example",id:e},payload:{}}),setQuestionName:(e,t)=>({type:"SET_QUESTION_NAME",target:{type:"question",id:e},payload:{name:t}}),setQuestionDescription:(e,t)=>({type:"SET_QUESTION_DESCRIPTION",target:{type:"question",id:e},payload:{description:t}}),moveQuestion:(e,t,r)=>({type:"MOVE_QUESTION",target:{type:"question",id:e},payload:{ruleId:t,after:r}}),reorderQuestion:(e,t)=>({type:"REORDER_QUESTION",target:{type:"question",id:e},payload:{after:t}}),addQuestion:(e,t,r)=>({type:"ADD_QUESTION",target:{type:"rule",id:e},payload:{id:t,name:r}}),deleteQuestion:e=>({type:"DELETE_QUESTION",target:{type:"question",id:e},payload:{}})},tt=A({id:k,name:x(s(),f(1)),description:S(s())}),rt=A({id:k,storyId:x(s(),f(1)),name:x(s(),f(1)),description:S(s())}),G=A({id:k,ruleId:x(s(),f(1)),name:x(s(),f(1)),description:S(s())}),ee=A({title:S(s()),stories:M(q(tt),[]),rules:M(q(rt),[]),examples:M(q(G),[]),questions:M(q(G),[])}),te=e=>{const t=Ue(ee,e),r=new Set,a=(i,d)=>{if(r.has(d))throw new Error(`duplicate id "${d}" in ${i}`);r.add(d)},n=new Set(t.stories.map(i=>i.id));for(const i of t.stories)a("stories",i.id);for(const i of t.rules)if(a("rules",i.id),!n.has(i.storyId))throw new Error(`rule "${i.id}" references unknown storyId "${i.storyId}"`);const o=new Map(t.rules.map(i=>[i.id,i]));for(const i of t.examples)if(a("examples",i.id),!o.has(i.ruleId))throw new Error(`example "${i.id}" references unknown ruleId "${i.ruleId}"`);for(const i of t.questions)if(a("questions",i.id),!o.has(i.ruleId))throw new Error(`question "${i.id}" references unknown ruleId "${i.ruleId}"`);return t},re=()=>({stories:[],rules:[],examples:[],questions:[]}),at=e=>({...e,rules:K(e.rules,["storyId"]),examples:K(e.examples,["ruleId"]),questions:K(e.questions,["ruleId"])}),T=(e,t)=>{if(t!==void 0)return e.stories.find(r=>r.id===t)},y=(e,t)=>{if(t!==void 0)return e.rules.find(r=>r.id===t)},b=(e,t)=>{if(t!==void 0)return e.examples.find(r=>r.id===t)},R=(e,t)=>{if(t!==void 0)return e.questions.find(r=>r.id===t)},U=(e,t)=>{if(t===void 0)return;const r=T(e,t);if(r)return{kind:"story",id:r.id,name:r.name,...r.description===void 0?{}:{description:r.description}};const a=y(e,t);if(a)return{kind:"rule",id:a.id,name:a.name,...a.description===void 0?{}:{description:a.description}};const n=b(e,t);if(n)return{kind:"example",id:n.id,name:n.name,...n.description===void 0?{}:{description:n.description}};const o=R(e,t);if(o)return{kind:"question",id:o.id,name:o.name,...o.description===void 0?{}:{description:o.description}}},ae=(e,t)=>e.rules.filter(r=>r.storyId===t),ne=(e,t)=>e.examples.filter(r=>r.ruleId===t),oe=(e,t)=>e.questions.filter(r=>r.ruleId===t),nt=(e,t)=>{if(T(e,t))return t;const r=y(e,t);if(r)return r.storyId;const a=b(e,t)?.ruleId??R(e,t)?.ruleId;return a===void 0?void 0:y(e,a)?.storyId},ie=e=>[...e.stories.map(t=>t.id),...e.rules.map(t=>t.id),...e.examples.map(t=>t.id),...e.questions.map(t=>t.id)],de=(e,t)=>y(e,t)?.storyId,ot=(e,t)=>{const r=b(e,t);return r?de(e,r.ruleId):void 0},se=(e,t)=>{const r=Pe(u,t);if(r===null)return null;const a=r.target.id;switch(r.type){case"SET_STORY_NAME":return le(e,a,n=>({...n,name:r.payload.name}));case"SET_STORY_DESCRIPTION":return le(e,a,n=>({...n,description:r.payload.description}));case"REORDER_STORY":{const n=Ee(e.stories,a,r.payload.after);return n===null?null:{...e,stories:n}}case"ADD_STORY":{const n=r.payload;return e.stories.some(o=>o.id===n.id)?e:P(e,n.id)?null:{...e,stories:[...e.stories,{id:n.id,name:n.name,...n.description===void 0?{}:{description:n.description}}]}}case"DELETE_STORY":{if(!e.stories.some(o=>o.id===a))return null;const n=new Set(e.rules.filter(o=>o.storyId===a).map(o=>o.id));return{...e,stories:e.stories.filter(o=>o.id!==a),rules:e.rules.filter(o=>o.storyId!==a),examples:e.examples.filter(o=>!n.has(o.ruleId)),questions:e.questions.filter(o=>!n.has(o.ruleId))}}case"SET_RULE_NAME":return pe(e,a,n=>({...n,name:r.payload.name}));case"SET_RULE_DESCRIPTION":return pe(e,a,n=>({...n,description:r.payload.description}));case"MOVE_RULE":{const n=r.payload,o=y(e,a);if(!o||!e.stories.some(d=>d.id===n.storyId))return null;const i=e.rules.filter(d=>d.storyId===n.storyId&&d.id!==a);return n.after!==null&&!i.some(d=>d.id===n.after)?null:{...e,rules:me(e.rules,{...o,storyId:n.storyId},n.after)}}case"REORDER_RULE":{const n=y(e,a);if(!n)return null;const o=e.rules.filter(i=>i.storyId===n.storyId);return r.payload.after!==null&&!o.some(i=>i.id===r.payload.after)?null:{...e,rules:me(e.rules,n,r.payload.after)}}case"ADD_RULE":{const n=r.payload,o=T(e,a);return o?e.rules.some(i=>i.id===n.id)?e:P(e,n.id)?null:{...e,rules:[...e.rules,{id:n.id,storyId:o.id,name:n.name,...n.description===void 0?{}:{description:n.description}}]}:null}case"DELETE_RULE":return y(e,a)?{...e,rules:e.rules.filter(n=>n.id!==a),examples:e.examples.filter(n=>n.ruleId!==a),questions:e.questions.filter(n=>n.ruleId!==a)}:null;case"SET_EXAMPLE_NAME":return ue(e,a,n=>({...n,name:r.payload.name}));case"SET_EXAMPLE_DESCRIPTION":return ue(e,a,n=>({...n,description:r.payload.description}));case"MOVE_EXAMPLE":{const n=r.payload,o=b(e,a);if(!o||!y(e,n.ruleId))return null;const i=e.examples.filter(d=>d.ruleId===n.ruleId&&d.id!==a);return n.after!==null&&!i.some(d=>d.id===n.after)?null:{...e,examples:Q(e.examples,{...o,ruleId:n.ruleId},n.after)}}case"REORDER_EXAMPLE":{const n=b(e,a);if(!n)return null;const o=e.examples.filter(i=>i.ruleId===n.ruleId);return r.payload.after!==null&&!o.some(i=>i.id===r.payload.after)?null:{...e,examples:Q(e.examples,n,r.payload.after)}}case"ADD_EXAMPLE":{const n=r.payload,o=y(e,a);return o?e.examples.some(i=>i.id===n.id)?e:P(e,n.id)?null:{...e,examples:[...e.examples,{id:n.id,ruleId:o.id,name:n.name,...n.description===void 0?{}:{description:n.description}}]}:null}case"DELETE_EXAMPLE":return b(e,a)?{...e,examples:e.examples.filter(n=>n.id!==a)}:null;case"SET_QUESTION_NAME":return ce(e,a,n=>({...n,name:r.payload.name}));case"SET_QUESTION_DESCRIPTION":return ce(e,a,n=>({...n,description:r.payload.description}));case"MOVE_QUESTION":{const n=r.payload,o=R(e,a);if(!o||!y(e,n.ruleId))return null;const i=e.questions.filter(d=>d.ruleId===n.ruleId&&d.id!==a);return n.after!==null&&!i.some(d=>d.id===n.after)?null:{...e,questions:Q(e.questions,{...o,ruleId:n.ruleId},n.after)}}case"REORDER_QUESTION":{const n=R(e,a);if(!n)return null;const o=e.questions.filter(i=>i.ruleId===n.ruleId);return r.payload.after!==null&&!o.some(i=>i.id===r.payload.after)?null:{...e,questions:Q(e.questions,n,r.payload.after)}}case"ADD_QUESTION":{const n=r.payload,o=y(e,a);return o?e.questions.some(i=>i.id===n.id)?e:P(e,n.id)?null:{...e,questions:[...e.questions,{id:n.id,ruleId:o.id,name:n.name,...n.description===void 0?{}:{description:n.description}}]}:null}case"DELETE_QUESTION":return R(e,a)?{...e,questions:e.questions.filter(n=>n.id!==a)}:null;default:return Qe(r)}},P=(e,t)=>e.stories.some(r=>r.id===t)||e.rules.some(r=>r.id===t)||e.examples.some(r=>r.id===t)||e.questions.some(r=>r.id===t),le=(e,t,r)=>e.stories.some(a=>a.id===t)?{...e,stories:e.stories.map(a=>a.id===t?r(a):a)}:null,pe=(e,t,r)=>e.rules.some(a=>a.id===t)?{...e,rules:e.rules.map(a=>a.id===t?r(a):a)}:null,ue=(e,t,r)=>e.examples.some(a=>a.id===t)?{...e,examples:e.examples.map(a=>a.id===t?r(a):a)}:null,ce=(e,t,r)=>e.questions.some(a=>a.id===t)?{...e,questions:e.questions.map(a=>a.id===t?r(a):a)}:null,me=(e,t,r)=>{const a=e.filter(l=>l.id!==t.id),n=a.filter(l=>l.storyId===t.storyId),o=r===null?[t,...n]:F(n,t,r),i=a.findIndex(l=>l.storyId===t.storyId),d=new Set(n.map(l=>l.id)),c=a.filter(l=>!d.has(l.id)),p=i<0?c.length:Math.min(i,c.length);return[...c.slice(0,p),...o,...c.slice(p)]},Q=(e,t,r)=>{const a=e.filter(l=>l.id!==t.id),n=a.filter(l=>l.ruleId===t.ruleId),o=r===null?[t,...n]:F(n,t,r),i=a.findIndex(l=>l.ruleId===t.ruleId),d=new Set(n.map(l=>l.id)),c=a.filter(l=>!d.has(l.id)),p=i<0?c.length:Math.min(i,c.length);return[...c.slice(0,p),...o,...c.slice(p)]},Ee=(e,t,r)=>{if(!e.some(o=>o.id===t)||r!==null&&!e.some(o=>o.id===r))return null;if(r===t)return[...e];const a=e.find(o=>o.id===t);if(a===void 0)return null;const n=e.filter(o=>o.id!==t);return F(n,a,r)},F=(e,t,r)=>{const a=[...e],n=r===null?-1:a.findIndex(o=>o.id===r);return a.splice(n+1,0,t),a},it={story:"Story",rule:"Rule",example:"Example",question:"Question"},dt={story:"\u30B9\u30C8\u30FC\u30EA\u30FC",rule:"\u30EB\u30FC\u30EB",example:"\u5177\u4F53\u4F8B",question:"\u8CEA\u554F"},st={empty:"No rules yet","open-questions":"Open questions","too-big":"Consider splitting",thin:"A rule has no example",ready:"Looks ready"},lt={empty:"\u30EB\u30FC\u30EB\u672A\u6574\u7406","open-questions":"\u672A\u89E3\u6C7A\u306E\u8CEA\u554F\u3042\u308A","too-big":"\u5206\u5272\u3092\u691C\u8A0E",thin:"\u5177\u4F53\u4F8B\u306E\u7121\u3044\u30EB\u30FC\u30EB\u3042\u308A",ready:"\u5408\u610F\u3067\u304D\u305D\u3046"},C=Ce({en:{kindLabel:e=>it[e],readinessLabel:e=>st[e],map:"Map",cardKinds:"Card kinds",noStoriesTitle:"No stories yet",noStoriesBody:"Place one story (yellow), then line up the rules (blue) that accept it beneath it. For each rule, stack examples (green) in the top area and open questions (red) in the bottom area.",firstStory:"+ First story",addStoryButton:"+ Story",noExamples:"No examples yet",noQuestions:"No open questions",commentButton:"Comment",deleteButton:"Delete",nameField:e=>`${e} name`,newStory:"New story",newRule:"New rule",newExample:"New example",newQuestion:"New question",storyRenamedTitle:"Renamed the story",storyDescriptionUpdatedTitle:"Updated the story\u2019s description",storyReorderedTitle:"Reordered the story",storyAddedTitle:"Added a story",storyDeletedTitle:"Deleted the story",ruleRenamedTitle:"Renamed the rule",ruleDescriptionUpdatedTitle:"Updated the rule\u2019s description",ruleMovedTitle:"Moved the rule",ruleReorderedTitle:"Reordered the rule",ruleAddedTitle:"Added a rule",ruleDeletedTitle:"Deleted the rule",exampleRenamedTitle:"Renamed the example",exampleDescriptionUpdatedTitle:"Updated the example\u2019s description",exampleMovedTitle:"Moved the example",exampleReorderedTitle:"Reordered the example",exampleAddedTitle:"Added an example",exampleDeletedTitle:"Deleted the example",questionRenamedTitle:"Renamed the question",questionDescriptionUpdatedTitle:"Updated the question\u2019s description",questionMovedTitle:"Moved the question",questionReorderedTitle:"Reordered the question",questionAddedTitle:"Added a question",questionDeletedTitle:"Deleted the question",arrowTo:e=>`\u2192 \u201C${e}\u201D`,arrowFrom:(e,t)=>`\u201C${e}\u201D \u2192 \u201C${t}\u201D`,added:e=>`+ \u201C${e}\u201D`,deleted:e=>`\u2212 \u201C${e}\u201D`,toTop:"\u2192 To the top",afterPlacement:e=>`\u2192 After \u201C${e}\u201D`,wholeMap:"Whole map"},ja:{kindLabel:e=>dt[e],readinessLabel:e=>lt[e],map:"\u30DE\u30C3\u30D7",cardKinds:"\u30AB\u30FC\u30C9\u306E\u7A2E\u985E",noStoriesTitle:"\u30B9\u30C8\u30FC\u30EA\u30FC\u304C\u307E\u3060\u3042\u308A\u307E\u305B\u3093",noStoriesBody:"\u30B9\u30C8\u30FC\u30EA\u30FC\uFF08\u9EC4\uFF09\u30921\u679A\u7F6E\u304D\u3001\u305D\u306E\u4E0B\u306B\u53D7\u3051\u5165\u308C\u6761\u4EF6\u3068\u306A\u308B\u30EB\u30FC\u30EB\uFF08\u9752\uFF09\u3092\u4E26\u3079\u307E\u3059\u3002\u30EB\u30FC\u30EB\u3054\u3068\u306B\u3001\u4E0A\u306E\u6B04\u3078\u5177\u4F53\u4F8B\uFF08\u7DD1\uFF09\u3092\u3001\u4E0B\u306E\u6B04\u3078\u7B54\u3048\u306E\u51FA\u306A\u3044\u8AD6\u70B9\u3092\u8CEA\u554F\uFF08\u8D64\uFF09\u3068\u3057\u3066\u7A4D\u307F\u307E\u3059\u3002",firstStory:"+ \u6700\u521D\u306E\u30B9\u30C8\u30FC\u30EA\u30FC",addStoryButton:"+ \u30B9\u30C8\u30FC\u30EA\u30FC",noExamples:"\u5177\u4F53\u4F8B\u304C\u307E\u3060\u3042\u308A\u307E\u305B\u3093",noQuestions:"\u672A\u89E3\u6C7A\u306E\u8CEA\u554F\u306F\u3042\u308A\u307E\u305B\u3093",commentButton:"\u30B3\u30E1\u30F3\u30C8",deleteButton:"\u524A\u9664",nameField:e=>`${e}\u540D`,newStory:"\u65B0\u3057\u3044\u30B9\u30C8\u30FC\u30EA\u30FC",newRule:"\u65B0\u3057\u3044\u30EB\u30FC\u30EB",newExample:"\u65B0\u3057\u3044\u5177\u4F53\u4F8B",newQuestion:"\u65B0\u3057\u3044\u8CEA\u554F",storyRenamedTitle:"\u30B9\u30C8\u30FC\u30EA\u30FC\u540D\u3092\u5909\u66F4",storyDescriptionUpdatedTitle:"\u30B9\u30C8\u30FC\u30EA\u30FC\u306E\u8AAC\u660E\u3092\u66F4\u65B0",storyReorderedTitle:"\u30B9\u30C8\u30FC\u30EA\u30FC\u306E\u9806\u5E8F\u3092\u5909\u66F4",storyAddedTitle:"\u30B9\u30C8\u30FC\u30EA\u30FC\u3092\u8FFD\u52A0",storyDeletedTitle:"\u30B9\u30C8\u30FC\u30EA\u30FC\u3092\u524A\u9664",ruleRenamedTitle:"\u30EB\u30FC\u30EB\u540D\u3092\u5909\u66F4",ruleDescriptionUpdatedTitle:"\u30EB\u30FC\u30EB\u306E\u8AAC\u660E\u3092\u66F4\u65B0",ruleMovedTitle:"\u30EB\u30FC\u30EB\u3092\u79FB\u52D5",ruleReorderedTitle:"\u30EB\u30FC\u30EB\u306E\u9806\u5E8F\u3092\u5909\u66F4",ruleAddedTitle:"\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0",ruleDeletedTitle:"\u30EB\u30FC\u30EB\u3092\u524A\u9664",exampleRenamedTitle:"\u5177\u4F53\u4F8B\u540D\u3092\u5909\u66F4",exampleDescriptionUpdatedTitle:"\u5177\u4F53\u4F8B\u306E\u8AAC\u660E\u3092\u66F4\u65B0",exampleMovedTitle:"\u5177\u4F53\u4F8B\u3092\u79FB\u52D5",exampleReorderedTitle:"\u5177\u4F53\u4F8B\u306E\u9806\u5E8F\u3092\u5909\u66F4",exampleAddedTitle:"\u5177\u4F53\u4F8B\u3092\u8FFD\u52A0",exampleDeletedTitle:"\u5177\u4F53\u4F8B\u3092\u524A\u9664",questionRenamedTitle:"\u8CEA\u554F\u540D\u3092\u5909\u66F4",questionDescriptionUpdatedTitle:"\u8CEA\u554F\u306E\u8AAC\u660E\u3092\u66F4\u65B0",questionMovedTitle:"\u8CEA\u554F\u3092\u79FB\u52D5",questionReorderedTitle:"\u8CEA\u554F\u306E\u9806\u5E8F\u3092\u5909\u66F4",questionAddedTitle:"\u8CEA\u554F\u3092\u8FFD\u52A0",questionDeletedTitle:"\u8CEA\u554F\u3092\u524A\u9664",arrowTo:e=>`\u2192 \u300C${e}\u300D`,arrowFrom:(e,t)=>`\u300C${e}\u300D\u2192\u300C${t}\u300D`,added:e=>`+ \u300C${e}\u300D`,deleted:e=>`\u2212 \u300C${e}\u300D`,toTop:"\u2192 \u5148\u982D\u3078",afterPlacement:e=>`\u2192 \u300C${e}\u300D\u306E\u76F4\u5F8C\u3078`,wholeMap:"\u30DE\u30C3\u30D7\u5168\u4F53"}}),X=(e,t,r)=>{const a=typeof r=="string"?r:"",n=typeof t=="string"?t:void 0;return n===void 0?e.arrowTo(a):e.arrowFrom(n,a)},pt={SET_STORY_NAME:(e,t,r)=>({title:e.storyRenamedTitle,tone:"update",body:X(e,T(r,t.target.id)?.name,g(u.SET_STORY_NAME,t).name??"")}),SET_STORY_DESCRIPTION:(e,t)=>({title:e.storyDescriptionUpdatedTitle,tone:"update",body:e.arrowTo(String(g(u.SET_STORY_DESCRIPTION,t).description??"").slice(0,90))}),REORDER_STORY:(e,t)=>({title:e.storyReorderedTitle,tone:"move",body:Y(e,g(u.REORDER_STORY,t).after)}),ADD_STORY:(e,t)=>({title:e.storyAddedTitle,tone:"create",body:e.added(String(g(u.ADD_STORY,t).name??""))}),DELETE_STORY:(e,t,r)=>({title:e.storyDeletedTitle,tone:"delete",body:e.deleted(T(r,t.target.id)?.name??t.target.id)}),SET_RULE_NAME:(e,t,r)=>({title:e.ruleRenamedTitle,tone:"update",body:X(e,y(r,t.target.id)?.name,g(u.SET_RULE_NAME,t).name??"")}),SET_RULE_DESCRIPTION:(e,t)=>({title:e.ruleDescriptionUpdatedTitle,tone:"update",body:e.arrowTo(String(g(u.SET_RULE_DESCRIPTION,t).description??"").slice(0,90))}),MOVE_RULE:(e,t,r)=>({title:e.ruleMovedTitle,tone:"move",body:e.arrowTo(T(r,String(g(u.MOVE_RULE,t).storyId))?.name??String(g(u.MOVE_RULE,t).storyId??""))}),REORDER_RULE:(e,t)=>({title:e.ruleReorderedTitle,tone:"move",body:Y(e,g(u.REORDER_RULE,t).after)}),ADD_RULE:(e,t)=>({title:e.ruleAddedTitle,tone:"create",body:e.added(String(g(u.ADD_RULE,t).name??""))}),DELETE_RULE:(e,t,r)=>({title:e.ruleDeletedTitle,tone:"delete",body:e.deleted(y(r,t.target.id)?.name??t.target.id)}),SET_EXAMPLE_NAME:(e,t,r)=>({title:e.exampleRenamedTitle,tone:"update",body:X(e,b(r,t.target.id)?.name,g(u.SET_EXAMPLE_NAME,t).name??"")}),SET_EXAMPLE_DESCRIPTION:(e,t)=>({title:e.exampleDescriptionUpdatedTitle,tone:"update",body:e.arrowTo(String(g(u.SET_EXAMPLE_DESCRIPTION,t).description??"").slice(0,90))}),MOVE_EXAMPLE:(e,t,r)=>({title:e.exampleMovedTitle,tone:"move",body:e.arrowTo(y(r,String(g(u.MOVE_EXAMPLE,t).ruleId))?.name??String(g(u.MOVE_EXAMPLE,t).ruleId??""))}),REORDER_EXAMPLE:(e,t)=>({title:e.exampleReorderedTitle,tone:"move",body:Y(e,g(u.REORDER_EXAMPLE,t).after)}),ADD_EXAMPLE:(e,t)=>({title:e.exampleAddedTitle,tone:"create",body:e.added(String(g(u.ADD_EXAMPLE,t).name??""))}),DELETE_EXAMPLE:(e,t,r)=>({title:e.exampleDeletedTitle,tone:"delete",body:e.deleted(b(r,t.target.id)?.name??t.target.id)}),SET_QUESTION_NAME:(e,t,r)=>({title:e.questionRenamedTitle,tone:"update",body:X(e,R(r,t.target.id)?.name,g(u.SET_QUESTION_NAME,t).name??"")}),SET_QUESTION_DESCRIPTION:(e,t)=>({title:e.questionDescriptionUpdatedTitle,tone:"update",body:e.arrowTo(String(g(u.SET_QUESTION_DESCRIPTION,t).description??"").slice(0,90))}),MOVE_QUESTION:(e,t,r)=>({title:e.questionMovedTitle,tone:"move",body:e.arrowTo(y(r,String(g(u.MOVE_QUESTION,t).ruleId))?.name??String(g(u.MOVE_QUESTION,t).ruleId??""))}),REORDER_QUESTION:(e,t)=>({title:e.questionReorderedTitle,tone:"move",body:Y(e,g(u.REORDER_QUESTION,t).after)}),ADD_QUESTION:(e,t)=>({title:e.questionAddedTitle,tone:"create",body:e.added(String(g(u.ADD_QUESTION,t).name??""))}),DELETE_QUESTION:(e,t,r)=>({title:e.questionDeletedTitle,tone:"delete",body:e.deleted(R(r,t.target.id)?.name??t.target.id)})},Y=(e,t)=>t==null?e.toTop:e.afterPlacement(t),ge=(e,t,r,a)=>{let n;try{const o=pt[t.type];n=o?o(e,t,a??r):{title:t.type,tone:"meta"}}catch{n={title:t.type,tone:"meta"}}return{title:n.title,targetLabel:xe(e,r,t.target),tone:n.tone,...n.body===void 0?{}:{summary:n.body}}},ye=e=>`${e.type} ${I(e.target)} ${JSON.stringify(e.payload)}`,xe=(e,t,r)=>{try{switch(r.type){case"story":{const a=T(t,r.id);return a?`${e.kindLabel("story")} \xB7 ${a.name}`:`${e.kindLabel("story")} \xB7 ${r.id} (missing)`}case"rule":{const a=y(t,r.id);return a?`${e.kindLabel("rule")} \xB7 ${a.name}`:`${e.kindLabel("rule")} \xB7 ${r.id} (missing)`}case"example":{const a=b(t,r.id);return a?`${e.kindLabel("example")} \xB7 ${a.name}`:`${e.kindLabel("example")} \xB7 ${r.id} (missing)`}case"question":{const a=R(t,r.id);return a?`${e.kindLabel("question")} \xB7 ${a.name}`:`${e.kindLabel("question")} \xB7 ${r.id} (missing)`}case"page":return`${e.map} \xB7 ${j(t)}`;default:return`${r.type} \xB7 ${r.id}`}}catch{return`${r.type} \xB7 ${r.id}`}},fe=(e,t,r)=>{const a=[{value:"page:example-mapping",label:e.wholeMap,group:e.map}];for(const n of t.stories)a.push({value:I({type:"story",id:n.id}),label:n.name,group:e.kindLabel("story")});for(const n of t.rules){const o=T(t,n.storyId);a.push({value:I({type:"rule",id:n.id}),label:o?`${o.name} \u203A ${n.name}`:n.name,group:e.kindLabel("rule")})}for(const n of t.examples){const o=y(t,n.ruleId);a.push({value:I({type:"example",id:n.id}),label:o?`${o.name} \u203A ${n.name}`:n.name,group:e.kindLabel("example")})}for(const n of t.questions){const o=y(t,n.ruleId);a.push({value:I({type:"question",id:n.id}),label:o?`${o.name} \u203A ${n.name}`:n.name,group:e.kindLabel("question")})}return a},he=(e,t,r)=>{const a=U(t,r.card);return a?{value:I({type:a.kind,id:a.id}),label:a.name,group:e.kindLabel(a.kind)}:null},ut=4,Te=(e,t,r)=>{const a=t.rules.filter(p=>p.storyId===r),n=new Set(a.map(p=>p.id)),o=t.examples.filter(p=>n.has(p.ruleId)),i=t.questions.filter(p=>n.has(p.ruleId)).length,d=a.some(p=>!o.some(l=>l.ruleId===p.id)),c=a.length===0?"empty":i>0?"open-questions":a.length>ut?"too-big":d?"thin":"ready";return{rules:a.length,examples:o.length,questions:i,readiness:c,label:e.readinessLabel(c)}},j=e=>e.title??"Example Mapping",be=(e,t)=>{const r=U(e,t.card),a={...t};return r?a.card=r.id:delete a.card,a},Re=(e,t)=>{switch(t.type){case"story":case"rule":case"example":case"question":return U(e,t.id)?.kind===t.type;case"page":return!0;default:return!1}},Se=e=>{const t=C(e);return{name:"example-mapping",label:"Example Mapping",parseBase:te,emptyBase:re,actions:u,apply:se,canonicalState:at,hasTarget:Re,describe:(r,a,n)=>ge(t,r,a,n),serialize:ye,resolveNavigation:be,commentTargets:(r,a)=>fe(t,r),currentTarget:(r,a)=>he(t,r,a),title:j}},B=(e,t,r)=>{const a=Xe(t,ie(e.state));return e.dispatch(r(a)).ok?(e.navigate({card:a}),a):null},ct=(e,t)=>B(e,"new-story",r=>L.addStory(r,t.newStory)),mt=(e,t,r)=>B(e,"new-rule",a=>L.addRule(r,a,t.newRule)),Et=(e,t,r)=>B(e,"new-example",a=>L.addExample(r,a,t.newExample)),gt=(e,t,r)=>B(e,"new-question",a=>L.addQuestion(r,a,t.newQuestion)),yt={width:300,height:260},ve=["story","rule","example","question"],_e={story:{bg:"linear-gradient(178deg, #fff3a6, #fde77a)",ink:"#4a3a06"},rule:{bg:"linear-gradient(178deg, #a3d1f5, #7cb8ea)",ink:"#0e2c4b"},example:{bg:"linear-gradient(178deg, #c9eb95, #a8dc63)",ink:"#22380a"},question:{bg:"linear-gradient(178deg, #fbc6d9, #f4a0c0)",ink:"#4b1029"}},O=e=>{const{bg:t,ink:r}=_e[e];return`--em-card-bg:${t};--em-card-ink:${r}`},xt=H`
|
|
2
2
|
:host {
|
|
3
3
|
position: relative;
|
|
4
4
|
display: flex;
|
|
@@ -167,7 +167,7 @@ import{p as m,aq as E,v as w,aw as k,ay as S,af as s,ah as x,ai as f,av as D,ab
|
|
|
167
167
|
</button>
|
|
168
168
|
</div>
|
|
169
169
|
${this.mode==="commenting"?this.#o(t):$}
|
|
170
|
-
`}#o(t){return Ze(et(this.#e.locale),Ge(this.#r,this.notes.map(Je),{label:t.name}),r=>{r.kind==="input"?(this.#r=r.body,this.requestUpdate()):this.#t(r)})}#a(t){return r=>{r.stopPropagation(),this.#t(t)}}#t(t){this.onIntent?.(t)}}const ht=()=>{customElements.get("dpk-internal-example-mapping-card")||customElements.define("dpk-internal-example-mapping-card",ft)},Tt=(e,t,r)=>{const a=e.at(-1)??null;if(t===null||r==="end")return a;const n=e.indexOf(t);return n<0?a:r==="after"?t:n===0?null:e.at(n-1)??null},ke=(e,t,r,a)=>{if(!T(e,t))return null;const n=e.stories.map(o=>o.id);return{type:"REORDER_STORY",target:{type:"story",id:t},payload:{after:N(n,t,r,a)}}},De=(e,t,r,a,n)=>{if(!T(e,t)||!y(e,r))return null;const o=e.rules.filter(i=>i.storyId===t).map(i=>i.id);return{type:"MOVE_RULE",target:{type:"rule",id:r},payload:{storyId:t,after:N(o,r,a,n)}}},Ie=(e,t,r,a,n)=>{if(!y(e,t)||!b(e,r))return null;const o=e.examples.filter(i=>i.ruleId===t).map(i=>i.id);return{type:"MOVE_EXAMPLE",target:{type:"example",id:r},payload:{ruleId:t,after:N(o,r,a,n)}}},Oe=(e,t,r,a,n)=>{if(!y(e,t)||!R(e,r))return null;const o=e.questions.filter(i=>i.ruleId===t).map(i=>i.id);return{type:"MOVE_QUESTION",target:{type:"question",id:r},payload:{ruleId:t,after:N(o,r,a,n)}}},V={kind:"idle"},J=(e,t)=>e.kind!=="idle"&&e.cardId===t,$e=(e,t)=>J(e,t)&&(e.kind==="editing"||e.kind==="commenting")?e.kind:"view",Le=(e,t,r)=>{switch(r.kind){case"toggle-comment":return e.kind==="commenting"&&e.cardId===t?V:{kind:"commenting",cardId:t};case"rename":case"comment":case"dismiss":case"delete":return J(e,t)?V:e;case"select":return e}},bt=(e,t)=>{if(e==="story")return 0;let r=0;for(const a of t)r=r*31+a.charCodeAt(0)|0;return(Math.abs(r)%5-2)*.45},Rt=e=>h`<ul class="legend" aria-label=${e.cardKinds}>
|
|
170
|
+
`}#o(t){return Ze(et(this.#e.locale),Ge(this.#r,this.notes.map(Je),{label:t.name,key:`card:${t.id}`}),r=>{r.kind==="input"?(this.#r=r.body,this.requestUpdate()):this.#t(r)})}#a(t){return r=>{r.stopPropagation(),this.#t(t)}}#t(t){this.onIntent?.(t)}}const ht=()=>{customElements.get("dpk-internal-example-mapping-card")||customElements.define("dpk-internal-example-mapping-card",ft)},Tt=(e,t,r)=>{const a=e.at(-1)??null;if(t===null||r==="end")return a;const n=e.indexOf(t);return n<0?a:r==="after"?t:n===0?null:e.at(n-1)??null},ke=(e,t,r,a)=>{if(!T(e,t))return null;const n=e.stories.map(o=>o.id);return{type:"REORDER_STORY",target:{type:"story",id:t},payload:{after:N(n,t,r,a)}}},De=(e,t,r,a,n)=>{if(!T(e,t)||!y(e,r))return null;const o=e.rules.filter(i=>i.storyId===t).map(i=>i.id);return{type:"MOVE_RULE",target:{type:"rule",id:r},payload:{storyId:t,after:N(o,r,a,n)}}},Ie=(e,t,r,a,n)=>{if(!y(e,t)||!b(e,r))return null;const o=e.examples.filter(i=>i.ruleId===t).map(i=>i.id);return{type:"MOVE_EXAMPLE",target:{type:"example",id:r},payload:{ruleId:t,after:N(o,r,a,n)}}},Oe=(e,t,r,a,n)=>{if(!y(e,t)||!R(e,r))return null;const o=e.questions.filter(i=>i.ruleId===t).map(i=>i.id);return{type:"MOVE_QUESTION",target:{type:"question",id:r},payload:{ruleId:t,after:N(o,r,a,n)}}},V={kind:"idle"},J=(e,t)=>e.kind!=="idle"&&e.cardId===t,$e=(e,t)=>J(e,t)&&(e.kind==="editing"||e.kind==="commenting")?e.kind:"view",Le=(e,t,r)=>{switch(r.kind){case"toggle-comment":return e.kind==="commenting"&&e.cardId===t?V:{kind:"commenting",cardId:t};case"rename":case"comment":case"dismiss":case"delete":return J(e,t)?V:e;case"select":return e}},bt=(e,t)=>{if(e==="story")return 0;let r=0;for(const a of t)r=r*31+a.charCodeAt(0)|0;return(Math.abs(r)%5-2)*.45},Rt=e=>h`<ul class="legend" aria-label=${e.cardKinds}>
|
|
171
171
|
${ve.map(t=>h`<li><span class="legend-swatch" style=${O(t)}></span>${e.kindLabel(t)}</li>`)}
|
|
172
172
|
</ul>`,St=e=>{const{context:t,handlers:r,m:a}=e;return t.state.stories.length===0?h`
|
|
173
173
|
<div class="empty">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as h,aq as y,v as G,av as O,af as p,aw as R,ah as u,ai as g,ay as N,ab as Ke,aI as We,ac as Y,ad as z,ae as U,P as Je,e as Xe,a0 as Ze,V as _,R as b,a2 as te,a7 as Qe,j as et,a1 as ie,a8 as tt,a3 as w,a4 as d,aB as B,A as ae,I as it,K as at,h as st,l as P,a5 as S,J as nt,B as ot,aF as rt,T as se}from"./shared-7qenhU4J.js";import{s as dt,r as H,D as lt}from"./shared-xrCdgpNS.js";import{P as ne,r as pt,p as ct,c as mt,a as ut}from"./shared-BHGClRU3.js";const f={SET_ACTIVITY_NAME:h("SET_ACTIVITY_NAME","activity",y({name:u(p(),g(1))})),SET_STEP_NAME:h("SET_STEP_NAME","step",y({name:u(p(),g(1))})),REORDER_STEP:h("REORDER_STEP","step",y({after:O(p())}),{mode:"sequence"}),ADD_ACTIVITY:h("ADD_ACTIVITY","page",y({id:R,name:u(p(),g(1))}),{dedupeKey:G}),ADD_STEP:h("ADD_STEP","activity",y({id:R,name:u(p(),g(1))}),{dedupeKey:G}),DELETE_ACTIVITY:h("DELETE_ACTIVITY","activity",y({})),DELETE_STEP:h("DELETE_STEP","step",y({})),SET_STORY_NAME:h("SET_STORY_NAME","story",y({name:u(p(),g(1))})),SET_STORY_DESCRIPTION:h("SET_STORY_DESCRIPTION","story",y({description:p()})),SET_STORY_MILESTONE:h("SET_STORY_MILESTONE","story",y({milestoneId:O(p())})),MOVE_STORY:h("MOVE_STORY","story",y({activityId:u(p(),g(1)),stepId:u(p(),g(1)),milestoneId:O(p()),after:O(p())}),{mode:"sequence"}),REORDER_STORY:h("REORDER_STORY","story",y({after:O(p())}),{mode:"sequence"}),ADD_STORY:h("ADD_STORY","step",y({id:R,name:u(p(),g(1)),activityId:u(p(),g(1)),milestoneId:N(p())}),{dedupeKey:G}),DELETE_STORY:h("DELETE_STORY","story",y({})),SET_MILESTONE_NAME:h("SET_MILESTONE_NAME","milestone",y({name:u(p(),g(1))})),ADD_MILESTONE:h("ADD_MILESTONE","page",y({id:R,name:u(p(),g(1))}),{dedupeKey:G}),DELETE_MILESTONE:h("DELETE_MILESTONE","milestone",y({})),REORDER_MILESTONE:h("REORDER_MILESTONE","milestone",y({after:O(p())}),{mode:"sequence"})},gt={setActivityName:(e,t)=>({type:"SET_ACTIVITY_NAME",target:{type:"activity",id:e},payload:{name:t}}),setStepName:(e,t)=>({type:"SET_STEP_NAME",target:{type:"step",id:e},payload:{name:t}})},vt=Y({id:u(p(),g(1)),name:u(p(),g(1))}),ht=Y({id:R,name:u(p(),g(1)),steps:z(U(vt),[])}),yt=Y({id:u(p(),g(1)),name:u(p(),g(1)),timeframe:N(p()),description:N(p())}),ft=Y({id:R,name:u(p(),g(1)),description:N(p()),activityId:u(p(),g(1)),stepId:u(p(),g(1)),milestoneId:N(p())}),bt=Y({title:N(p()),activities:z(U(ht),[]),milestones:z(U(yt),[]),stories:z(U(ft),[])}),oe=e=>{const t=Ke(bt,e),i=new Map;for(const o of t.activities)for(const r of o.steps)i.set(r.id,o.id);const a=new Set(t.milestones.map(o=>o.id)),s=new Set,n=(o,r)=>{if(s.has(r))throw new Error(`duplicate id "${r}" in ${o}`);s.add(r)};for(const o of t.activities){n("activities",o.id);for(const r of o.steps)n("steps",r.id)}for(const o of t.milestones)n("milestones",o.id);for(const o of t.stories){n("stories",o.id);const r=i.get(o.stepId);if(r===void 0||r!==o.activityId)throw new Error(`story "${o.id}" references unknown activityId/stepId`);if(o.milestoneId!==void 0&&!a.has(o.milestoneId))throw new Error(`story "${o.id}" references unknown milestoneId "${o.milestoneId}"`)}return t},re=()=>({activities:[],milestones:[],stories:[]}),M=(e,t)=>{if(t!==void 0)return e.activities.find(i=>i.id===t)},K=(e,t)=>`${e}.${t}`,k=(e,t)=>{if(t===void 0)return;const i=We(t,2);if(i){const[a,s]=i;if(a===void 0||s===void 0)return;const n=e.activities.find(r=>r.id===a),o=n?.steps.find(r=>r.id===s);return n&&o?{activity:n,step:o}:void 0}if(!t.includes("."))for(const a of e.activities){const s=a.steps.find(n=>n.id===t);if(s)return{activity:a,step:s}}},T=(e,t)=>{if(t!==void 0)return e.milestones.find(i=>i.id===t)},x=(e,t)=>{if(t!==void 0)return e.stories.find(i=>i.id===t)},W=e=>e.activities.flatMap(t=>t.steps.map(i=>({activity:t,step:i}))),kt=e=>({...e,stories:dt(e.stories,[t=>`${t.activityId}/${t.stepId}/${t.milestoneId??""}`])}),q=(e,t,i)=>e.stories.filter(a=>a.stepId===t&&(a.milestoneId??void 0)===i),de=(e,t,i)=>e.stories.filter(a=>a.activityId===t&&(a.milestoneId??void 0)===i),L=e=>[...e.activities.map(t=>t.id),...e.activities.flatMap(t=>t.steps.map(i=>i.id)),...e.milestones.map(t=>t.id),...e.stories.map(t=>t.id)],le=(e,t)=>e.stories.filter(i=>i.stepId===t).length,pe=(e,t)=>{const i=Je(f,t);if(i===null)return null;const a=i.target.id;switch(i.type){case"SET_ACTIVITY_NAME":{const{name:s}=i.payload;return e.activities.some(n=>n.id===a)?{...e,activities:e.activities.map(n=>n.id===a?{...n,name:s}:n)}:null}case"SET_STEP_NAME":{const{name:s}=i.payload,n=k(e,a);return n?{...e,activities:e.activities.map(o=>o.id===n.activity.id?{...o,steps:o.steps.map(r=>r.id===n.step.id?{...r,name:s}:r)}:o)}:null}case"REORDER_STEP":{const{after:s}=i.payload,n=k(e,a);if(!n)return null;const o=s===null?null:k(e,s);if(s!==null&&(!o||o.activity.id!==n.activity.id))return null;const r=me(n.activity.steps,n.step.id,o?.step.id??null);return r===null?null:{...e,activities:e.activities.map(l=>l.id===n.activity.id?{...l,steps:r}:l)}}case"ADD_ACTIVITY":{const s=i.payload;return e.activities.some(n=>n.id===s.id)?e:{...e,activities:[...e.activities,{id:s.id,name:s.name,steps:[]}]}}case"ADD_STEP":{const s=i.payload,n=e.activities.find(o=>o.id===a);return n?n.steps.some(o=>o.id===s.id)?e:{...e,activities:e.activities.map(o=>o.id===a?{...o,steps:[...o.steps,{id:s.id,name:s.name}]}:o)}:null}case"DELETE_ACTIVITY":{const s=e.activities.find(o=>o.id===a);if(!s)return null;const n=new Set(s.steps.map(o=>o.id));return{...e,activities:e.activities.filter(o=>o.id!==a),stories:e.stories.filter(o=>o.activityId!==a&&!n.has(o.stepId))}}case"DELETE_STEP":{const s=k(e,a);return s?{...e,activities:e.activities.map(n=>n.id===s.activity.id?{...n,steps:n.steps.filter(o=>o.id!==s.step.id)}:n),stories:e.stories.filter(n=>n.activityId!==s.activity.id||n.stepId!==s.step.id)}:null}case"SET_STORY_NAME":{const{name:s}=i.payload;return J(e,a,n=>({...n,name:s}))}case"SET_STORY_DESCRIPTION":{const{description:s}=i.payload;return J(e,a,n=>({...n,description:s}))}case"SET_STORY_MILESTONE":{const{milestoneId:s}=i.payload;return s!==null&&!T(e,s)?null:J(e,a,n=>s===null?X(n):{...n,milestoneId:s})}case"MOVE_STORY":{const s=i.payload,n=x(e,a);if(!n)return null;const o=k(e,s.stepId);if(!o||o.activity.id!==s.activityId||s.milestoneId!==null&&!T(e,s.milestoneId))return null;const r=s.milestoneId??void 0,l=r===void 0?{...X(n),activityId:o.activity.id,stepId:o.step.id}:{...n,activityId:o.activity.id,stepId:o.step.id,milestoneId:r};return ce(e,l,s.after)}case"REORDER_STORY":{const{after:s}=i.payload,n=x(e,a);return n?ce(e,n,s,!0):null}case"ADD_STORY":{const s=i.payload,n=k(e,t.target.id);if(!n||n.activity.id!==s.activityId||s.milestoneId!==void 0&&!T(e,s.milestoneId))return null;if(e.stories.some(r=>r.id===s.id))return e;const o={id:s.id,name:s.name,activityId:s.activityId,stepId:n.step.id,...s.milestoneId===void 0?{}:{milestoneId:s.milestoneId}};return{...e,stories:[...e.stories,o]}}case"DELETE_STORY":return e.stories.some(s=>s.id===a)?{...e,stories:e.stories.filter(s=>s.id!==a)}:null;case"SET_MILESTONE_NAME":{const{name:s}=i.payload;return e.milestones.some(n=>n.id===a)?{...e,milestones:e.milestones.map(n=>n.id===a?{...n,name:s}:n)}:null}case"ADD_MILESTONE":{const s=i.payload;return e.milestones.some(n=>n.id===s.id)?e:{...e,milestones:[...e.milestones,{id:s.id,name:s.name}]}}case"DELETE_MILESTONE":return e.milestones.some(s=>s.id===a)?{...e,milestones:e.milestones.filter(s=>s.id!==a),stories:e.stories.map(s=>s.milestoneId===a?X(s):s)}:null;case"REORDER_MILESTONE":{const{after:s}=i.payload,n=me(e.milestones,a,s);return n===null?null:{...e,milestones:n}}default:return Xe(i)}},J=(e,t,i)=>e.stories.some(a=>a.id===t)?{...e,stories:e.stories.map(a=>a.id===t?i(a):a)}:null,X=e=>{const{milestoneId:t,...i}=e;return i},ce=(e,t,i,a=!1)=>{const s=t.milestoneId??void 0,n=e.stories.filter(m=>m.id!==t.id),o=n.filter(m=>m.stepId===t.stepId&&(m.milestoneId??void 0)===s);if(i!==null){const m=n.find($=>$.id===i);if(!m||m.stepId!==t.stepId||(m.milestoneId??void 0)!==s)return null;if(a){const $=x(e,t.id);if(!$||m.stepId!==$.stepId||(m.milestoneId??void 0)!==($.milestoneId??void 0))return null}}const r=i===null?[t,...o]:ue(o,t,i),l=n.findIndex(m=>m.stepId===t.stepId&&(m.milestoneId??void 0)===s),c=new Set(o.map(m=>m.id)),v=n.filter(m=>!c.has(m.id)),A=l<0?v.length:Math.min(l,v.length),I=[...v.slice(0,A),...r,...v.slice(A)];return{...e,stories:I}},me=(e,t,i)=>{if(!e.some(n=>n.id===t)||i!==null&&!e.some(n=>n.id===i))return null;if(i===t)return[...e];const a=e.find(n=>n.id===t);if(a===void 0)return null;const s=e.filter(n=>n.id!==t);return ue(s,a,i)},ue=(e,t,i)=>{const a=[...e],s=i===null?-1:a.findIndex(n=>n.id===i);return a.splice(s+1,0,t),a},j=Ze({en:{renameActivity:"Rename activity",renameStep:"Rename step",reorderStep:"Reorder step",addActivity:"Add activity",addStep:"Add step",deleteActivity:"Delete activity",deleteStep:"Delete step",renameStory:"Rename story",updateStoryDescription:"Update story description",changeMilestone:"Change milestone",moveStory:"Move story",reorderStory:"Reorder story",addStory:"Add story",deleteStory:"Delete story",renameMilestone:"Rename milestone",addMilestone:"Add milestone",deleteMilestone:"Delete milestone",reorderMilestone:"Reorder milestone",toValue:e=>`\u2192 \u201C${e}\u201D`,fromTo:(e,t)=>`\u201C${e}\u201D \u2192 \u201C${t}\u201D`,added:e=>`+ \u201C${e}\u201D`,removed:e=>`\u2212 \u201C${e}\u201D`,toFront:"\u2192 To the front",afterName:e=>`\u2192 Right after \u201C${e}\u201D`,toUnassigned:"\u2192 Unassigned",toName:e=>`\u2192 ${e}`,activityGroup:"Activity",stepGroup:"Step",storyGroup:"Story",milestoneGroup:"Milestone",mapGroup:"Map",targetLabel:(e,t)=>`${e} \xB7 ${t}`,targetMissing:(e,t)=>`${e} \xB7 ${t} (missing)`,wholeMap:"Whole map",unassigned:"Unassigned",emptyTitle:"No backbone yet",emptyBody:"Add activities and steps, and the story map appears here.",firstActivityButton:"+ First activity",groupingLabel:"Group by",groupViewTab:"Activity group",groupAxisHeader:"Activity group \u2192",activityAxis:"Activity \u2192",milestoneAxis:"Milestone \u2193",stepNameLabel:"Step name",activityNameLabel:"Activity name",milestoneNameLabel:"Milestone name",addStepAria:"Add a step to this activity",newActivityButton:"+ Activity",newMilestoneButton:"+ Milestone",addCellButton:"+ Add",addStoryCellAria:"Add a story to this cell",storyCount:e=>e===1?"1 story":`${e} stories`,pageTabsLabel:"Page",mapTab:"User Story Mapping",milestonesTab:"Milestones",milestonesLead:"What each release slice is for, and when it is due. The stories live on the map.",shareOfStories:e=>`${e}% of all stories`,coverageLabel:"Backbone coverage",coverage:(e,t)=>`${e} / ${t} steps`,storiesLabel:"Stories",timeframeUnset:"Timing not set",breakdownLabel:"By activity",breakdownItem:(e,t)=>`${e}: ${t} ${t===1?"story":"stories"}`,milestoneNoDescription:"No description yet.",noMilestonesTitle:"No milestones yet",noMilestonesBody:"Add a milestone to slice the map into releases.",commentCountAria:e=>e===1?"1 comment":`${e} comments`,moveDialogLabel:"Step to move to",moveDialogSelectLabel:"Destination",moveConfirm:"Move",moveCancel:"Cancel",storyNameLabel:"Story name",editTitleAria:"Edit title",commentAria:"Comment",deleteAria:"Delete",newActivityName:"New activity",newStepName:"New step",newMilestoneName:"New milestone",newStoryName:"New story"},ja:{renameActivity:"\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3\u540D\u3092\u5909\u66F4",renameStep:"\u30B9\u30C6\u30C3\u30D7\u540D\u3092\u5909\u66F4",reorderStep:"\u30B9\u30C6\u30C3\u30D7\u306E\u9806\u5E8F\u3092\u5909\u66F4",addActivity:"\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3\u3092\u8FFD\u52A0",addStep:"\u30B9\u30C6\u30C3\u30D7\u3092\u8FFD\u52A0",deleteActivity:"\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3\u3092\u524A\u9664",deleteStep:"\u30B9\u30C6\u30C3\u30D7\u3092\u524A\u9664",renameStory:"\u30B9\u30C8\u30FC\u30EA\u30FC\u540D\u3092\u5909\u66F4",updateStoryDescription:"\u30B9\u30C8\u30FC\u30EA\u30FC\u306E\u8AAC\u660E\u3092\u66F4\u65B0",changeMilestone:"\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3\u3092\u5909\u66F4",moveStory:"\u30B9\u30C8\u30FC\u30EA\u30FC\u3092\u79FB\u52D5",reorderStory:"\u30B9\u30C8\u30FC\u30EA\u30FC\u306E\u9806\u5E8F\u3092\u5909\u66F4",addStory:"\u30B9\u30C8\u30FC\u30EA\u30FC\u3092\u8FFD\u52A0",deleteStory:"\u30B9\u30C8\u30FC\u30EA\u30FC\u3092\u524A\u9664",renameMilestone:"\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3\u540D\u3092\u5909\u66F4",addMilestone:"\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3\u3092\u8FFD\u52A0",deleteMilestone:"\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3\u3092\u524A\u9664",reorderMilestone:"\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3\u306E\u9806\u5E8F\u3092\u5909\u66F4",toValue:e=>`\u2192 \u300C${e}\u300D`,fromTo:(e,t)=>`\u300C${e}\u300D\u2192\u300C${t}\u300D`,added:e=>`+ \u300C${e}\u300D`,removed:e=>`\u2212 \u300C${e}\u300D`,toFront:"\u2192 \u5148\u982D\u3078",afterName:e=>`\u2192 \u300C${e}\u300D\u306E\u76F4\u5F8C\u3078`,toUnassigned:"\u2192 \u672A\u5272\u5F53\u3078",toName:e=>`\u2192 ${e}`,activityGroup:"\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3",stepGroup:"\u30B9\u30C6\u30C3\u30D7",storyGroup:"\u30B9\u30C8\u30FC\u30EA\u30FC",milestoneGroup:"\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3",mapGroup:"\u30DE\u30C3\u30D7",targetLabel:(e,t)=>`${e} \xB7 ${t}`,targetMissing:(e,t)=>`${e} \xB7 ${t} (missing)`,wholeMap:"\u30DE\u30C3\u30D7\u5168\u4F53",unassigned:"\u672A\u5272\u5F53",emptyTitle:"\u30D0\u30C3\u30AF\u30DC\u30FC\u30F3\u304C\u307E\u3060\u3042\u308A\u307E\u305B\u3093",emptyBody:"\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3\u3068\u30B9\u30C6\u30C3\u30D7\u3092\u8FFD\u52A0\u3059\u308B\u3068\u3001\u3053\u3053\u306B\u30B9\u30C8\u30FC\u30EA\u30FC\u30DE\u30C3\u30D7\u304C\u73FE\u308C\u307E\u3059\u3002",firstActivityButton:"+ \u6700\u521D\u306E\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3",groupingLabel:"\u307E\u3068\u3081\u308B\u5358\u4F4D",groupViewTab:"\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3\u30B0\u30EB\u30FC\u30D7",groupAxisHeader:"\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3\u30B0\u30EB\u30FC\u30D7 \u2192",activityAxis:"\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3 \u2192",milestoneAxis:"\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3 \u2193",stepNameLabel:"\u30B9\u30C6\u30C3\u30D7\u540D",activityNameLabel:"\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3\u540D",milestoneNameLabel:"\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3\u540D",addStepAria:"\u3053\u306E\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3\u306B\u30B9\u30C6\u30C3\u30D7\u3092\u8FFD\u52A0",newActivityButton:"+ \u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3",newMilestoneButton:"+ \u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3",addCellButton:"+ \u8FFD\u52A0",addStoryCellAria:"\u3053\u306E\u30DE\u30B9\u306B\u30B9\u30C8\u30FC\u30EA\u30FC\u3092\u8FFD\u52A0",storyCount:e=>`${e} \u30B9\u30C8\u30FC\u30EA\u30FC`,pageTabsLabel:"\u30DA\u30FC\u30B8",mapTab:"User Story Mapping",milestonesTab:"\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3",milestonesLead:"\u30EA\u30EA\u30FC\u30B9\u306E\u533A\u5207\u308A\u3054\u3068\u306E\u76EE\u7684\u3068\u6642\u671F\u3002\u30B9\u30C8\u30FC\u30EA\u30FC\u306F\u30DE\u30C3\u30D7\u3067\u6271\u3044\u307E\u3059\u3002",shareOfStories:e=>`\u5168\u30B9\u30C8\u30FC\u30EA\u30FC\u306E ${e}%`,coverageLabel:"\u30D0\u30C3\u30AF\u30DC\u30FC\u30F3\u306E\u7DB2\u7F85",coverage:(e,t)=>`${e} / ${t} \u30B9\u30C6\u30C3\u30D7`,storiesLabel:"\u30B9\u30C8\u30FC\u30EA\u30FC",timeframeUnset:"\u6642\u671F\u672A\u5B9A",breakdownLabel:"\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3\u5225",breakdownItem:(e,t)=>`${e}: ${t} \u30B9\u30C8\u30FC\u30EA\u30FC`,milestoneNoDescription:"\u8AAC\u660E\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",noMilestonesTitle:"\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3\u304C\u307E\u3060\u3042\u308A\u307E\u305B\u3093",noMilestonesBody:"\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3\u3092\u8FFD\u52A0\u3059\u308B\u3068\u3001\u30DE\u30C3\u30D7\u3092\u30EA\u30EA\u30FC\u30B9\u3054\u3068\u306B\u533A\u5207\u308C\u307E\u3059\u3002",commentCountAria:e=>`\u30B3\u30E1\u30F3\u30C8 ${e} \u4EF6`,moveDialogLabel:"\u79FB\u52D5\u5148\u306E\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3",moveDialogSelectLabel:"\u79FB\u52D5\u5148",moveConfirm:"\u79FB\u52D5\u3059\u308B",moveCancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",storyNameLabel:"\u30B9\u30C8\u30FC\u30EA\u30FC\u540D",editTitleAria:"\u30BF\u30A4\u30C8\u30EB\u3092\u7DE8\u96C6",commentAria:"\u30B3\u30E1\u30F3\u30C8",deleteAria:"\u524A\u9664",newActivityName:"\u65B0\u3057\u3044\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3",newStepName:"\u65B0\u3057\u3044\u30B9\u30C6\u30C3\u30D7",newMilestoneName:"\u65B0\u3057\u3044\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3",newStoryName:"\u65B0\u3057\u3044\u30B9\u30C8\u30FC\u30EA\u30FC"}}),ge=e=>e.tab==="milestones"?"milestones":"map",F=(e,t,i)=>{const a=typeof i=="string"?i:"",s=typeof t=="string"?t:void 0;return s===void 0?e.toValue(a):e.fromTo(s,a)},Z=(e,t)=>typeof t=="string"?e.afterName(t):e.toFront,xt={SET_ACTIVITY_NAME:(e,t,i)=>({title:e.renameActivity,tone:"update",body:F(e,M(i,t.target.id)?.name,b(f.SET_ACTIVITY_NAME,t).name??"")}),SET_STEP_NAME:(e,t,i)=>({title:e.renameStep,tone:"update",body:F(e,k(i,t.target.id)?.step.name,b(f.SET_STEP_NAME,t).name??"")}),REORDER_STEP:(e,t)=>({title:e.reorderStep,tone:"move",body:Z(e,b(f.REORDER_STEP,t).after)}),ADD_ACTIVITY:(e,t)=>({title:e.addActivity,tone:"create",body:e.added(String(b(f.ADD_ACTIVITY,t).name??""))}),ADD_STEP:(e,t)=>({title:e.addStep,tone:"create",body:e.added(String(b(f.ADD_STEP,t).name??""))}),DELETE_ACTIVITY:(e,t,i)=>({title:e.deleteActivity,tone:"delete",body:e.removed(M(i,t.target.id)?.name??t.target.id)}),DELETE_STEP:(e,t,i)=>({title:e.deleteStep,tone:"delete",body:e.removed(k(i,t.target.id)?.step.name??t.target.id)}),SET_STORY_NAME:(e,t,i)=>({title:e.renameStory,tone:"update",body:F(e,x(i,t.target.id)?.name,b(f.SET_STORY_NAME,t).name??"")}),SET_STORY_DESCRIPTION:(e,t)=>({title:e.updateStoryDescription,tone:"update",body:e.toValue(String(b(f.SET_STORY_DESCRIPTION,t).description??"").slice(0,90))}),SET_STORY_MILESTONE:(e,t,i)=>{const a=b(f.SET_STORY_MILESTONE,t).milestoneId;return{title:e.changeMilestone,tone:"move",body:a==null?e.toUnassigned:e.toName(T(i,String(a))?.name??String(a))}},MOVE_STORY:(e,t,i)=>({title:e.moveStory,tone:"move",body:e.toName(k(i,String(b(f.MOVE_STORY,t).stepId))?.step.name??String(b(f.MOVE_STORY,t).stepId??""))}),REORDER_STORY:(e,t)=>({title:e.reorderStory,tone:"move",body:Z(e,b(f.REORDER_STORY,t).after)}),ADD_STORY:(e,t)=>({title:e.addStory,tone:"create",body:e.added(String(b(f.ADD_STORY,t).name??""))}),DELETE_STORY:(e,t,i)=>({title:e.deleteStory,tone:"delete",body:e.removed(x(i,t.target.id)?.name??t.target.id)}),SET_MILESTONE_NAME:(e,t,i)=>({title:e.renameMilestone,tone:"update",body:F(e,T(i,t.target.id)?.name,b(f.SET_MILESTONE_NAME,t).name??"")}),ADD_MILESTONE:(e,t)=>({title:e.addMilestone,tone:"create",body:e.added(String(b(f.ADD_MILESTONE,t).name??""))}),DELETE_MILESTONE:(e,t,i)=>({title:e.deleteMilestone,tone:"delete",body:e.removed(T(i,t.target.id)?.name??t.target.id)}),REORDER_MILESTONE:(e,t)=>({title:e.reorderMilestone,tone:"move",body:Z(e,b(f.REORDER_MILESTONE,t).after)})},ve=(e,t,i,a)=>{let s;try{const n=xt[t.type];s=n?n(e,t,a??i):{title:t.type,tone:"meta"}}catch{s={title:t.type,tone:"meta"}}return{title:s.title,targetLabel:ye(e,i,t.target),tone:s.tone,...s.body===void 0?{}:{summary:s.body}}},he=e=>`${e.type} ${_(e.target)} ${JSON.stringify(e.payload)}`,ye=(e,t,i)=>{try{switch(i.type){case"activity":{const a=M(t,i.id);return a?e.targetLabel(e.activityGroup,a.name):e.targetMissing(e.activityGroup,i.id)}case"step":{const a=k(t,i.id)?.step;return a?e.targetLabel(e.stepGroup,a.name):e.targetMissing(e.stepGroup,i.id)}case"story":{const a=x(t,i.id);return a?e.targetLabel(e.storyGroup,a.name):e.targetMissing(e.storyGroup,i.id)}case"milestone":{const a=T(t,i.id);return a?e.targetLabel(e.milestoneGroup,a.name):e.targetMissing(e.milestoneGroup,i.id)}case"page":return e.targetLabel(e.mapGroup,Q(t));default:return`${i.type} \xB7 ${i.id}`}}catch{return`${i.type} \xB7 ${i.id}`}},fe=(e,t,i)=>{const a=[{value:"page:usm",label:e.wholeMap,group:e.mapGroup}];for(const s of t.activities){a.push({value:_({type:"activity",id:s.id}),label:s.name,group:e.activityGroup});for(const n of s.steps)a.push({value:_({type:"step",id:K(s.id,n.id)}),label:`${s.name} \u203A ${n.name}`,group:e.stepGroup})}for(const s of t.milestones)a.push({value:_({type:"milestone",id:s.id}),label:s.name,group:e.milestoneGroup});for(const s of t.stories)a.push({value:_({type:"story",id:s.id}),label:s.name,group:e.storyGroup});return a},be=(e,t,i)=>{const a=t.stories.find(s=>s.id===i.story);if(a)return{value:_({type:"story",id:a.id}),label:a.name,group:e.storyGroup};for(const s of t.activities){const n=s.steps.find(o=>o.id===i.step);if(n)return{value:_({type:"step",id:K(s.id,n.id)}),label:n.name,group:e.stepGroup}}return null},Q=e=>e.title??"User Story Mapping",ke=(e,t)=>{const i=k(e,t.step),a=i?.activity??M(e,t.activity)??e.activities[0],s=i?.step??a?.steps.find(r=>r.id===t.step)??a?.steps[0],n=x(e,t.story),o={...t};return a?o.activity=a.id:delete o.activity,s?o.step=s.id:delete o.step,n?o.story=n.id:delete o.story,o.view=t.view==="group"?"group":"activity",ge(t)==="milestones"?o.tab="milestones":delete o.tab,o},xe=(e,t)=>{switch(t.type){case"activity":return M(e,t.id)!==void 0;case"step":return k(e,t.id)!==void 0;case"story":return x(e,t.id)!==void 0;case"milestone":return T(e,t.id)!==void 0;case"page":return!0;default:return!1}},we=e=>{const t=j(e);return{name:"usm",label:"User Story Mapping",parseBase:oe,emptyBase:re,actions:f,apply:pe,canonicalState:kt,hasTarget:xe,canonicalTarget:(i,a)=>{if(a.type!=="step")return a;const s=k(i,a.id);return s?{...a,id:K(s.activity.id,s.step.id)}:a},describe:(i,a,s)=>ve(t,i,a,s),serialize:he,resolveNavigation:ke,commentTargets:(i,a)=>fe(t,i),currentTarget:(i,a)=>be(t,i,a),title:Q}},wt={width:300,height:260},$t=te`
|
|
1
|
+
import{p as h,aq as y,v as G,av as O,af as p,aw as R,ah as u,ai as g,ay as N,ab as Ke,aJ as Je,ac as Y,ad as z,ae as U,P as We,e as Xe,a0 as Ze,V as _,R as b,a2 as te,a7 as Qe,j as et,a1 as ie,a8 as tt,a3 as w,a4 as d,aB as B,A as ae,I as it,K as at,h as st,l as P,a5 as S,J as nt,B as ot,aF as rt,T as se}from"./shared-B_MMP97h.js";import{s as dt,r as H,D as lt}from"./shared-xrCdgpNS.js";import{P as ne,r as pt,p as ct,c as mt,a as ut}from"./shared-B4ewpBuM.js";const f={SET_ACTIVITY_NAME:h("SET_ACTIVITY_NAME","activity",y({name:u(p(),g(1))})),SET_STEP_NAME:h("SET_STEP_NAME","step",y({name:u(p(),g(1))})),REORDER_STEP:h("REORDER_STEP","step",y({after:O(p())}),{mode:"sequence"}),ADD_ACTIVITY:h("ADD_ACTIVITY","page",y({id:R,name:u(p(),g(1))}),{dedupeKey:G}),ADD_STEP:h("ADD_STEP","activity",y({id:R,name:u(p(),g(1))}),{dedupeKey:G}),DELETE_ACTIVITY:h("DELETE_ACTIVITY","activity",y({})),DELETE_STEP:h("DELETE_STEP","step",y({})),SET_STORY_NAME:h("SET_STORY_NAME","story",y({name:u(p(),g(1))})),SET_STORY_DESCRIPTION:h("SET_STORY_DESCRIPTION","story",y({description:p()})),SET_STORY_MILESTONE:h("SET_STORY_MILESTONE","story",y({milestoneId:O(p())})),MOVE_STORY:h("MOVE_STORY","story",y({activityId:u(p(),g(1)),stepId:u(p(),g(1)),milestoneId:O(p()),after:O(p())}),{mode:"sequence"}),REORDER_STORY:h("REORDER_STORY","story",y({after:O(p())}),{mode:"sequence"}),ADD_STORY:h("ADD_STORY","step",y({id:R,name:u(p(),g(1)),activityId:u(p(),g(1)),milestoneId:N(p())}),{dedupeKey:G}),DELETE_STORY:h("DELETE_STORY","story",y({})),SET_MILESTONE_NAME:h("SET_MILESTONE_NAME","milestone",y({name:u(p(),g(1))})),ADD_MILESTONE:h("ADD_MILESTONE","page",y({id:R,name:u(p(),g(1))}),{dedupeKey:G}),DELETE_MILESTONE:h("DELETE_MILESTONE","milestone",y({})),REORDER_MILESTONE:h("REORDER_MILESTONE","milestone",y({after:O(p())}),{mode:"sequence"})},gt={setActivityName:(e,t)=>({type:"SET_ACTIVITY_NAME",target:{type:"activity",id:e},payload:{name:t}}),setStepName:(e,t)=>({type:"SET_STEP_NAME",target:{type:"step",id:e},payload:{name:t}})},vt=Y({id:u(p(),g(1)),name:u(p(),g(1))}),ht=Y({id:R,name:u(p(),g(1)),steps:z(U(vt),[])}),yt=Y({id:u(p(),g(1)),name:u(p(),g(1)),timeframe:N(p()),description:N(p())}),ft=Y({id:R,name:u(p(),g(1)),description:N(p()),activityId:u(p(),g(1)),stepId:u(p(),g(1)),milestoneId:N(p())}),bt=Y({title:N(p()),activities:z(U(ht),[]),milestones:z(U(yt),[]),stories:z(U(ft),[])}),oe=e=>{const t=Ke(bt,e),i=new Map;for(const o of t.activities)for(const r of o.steps)i.set(r.id,o.id);const a=new Set(t.milestones.map(o=>o.id)),s=new Set,n=(o,r)=>{if(s.has(r))throw new Error(`duplicate id "${r}" in ${o}`);s.add(r)};for(const o of t.activities){n("activities",o.id);for(const r of o.steps)n("steps",r.id)}for(const o of t.milestones)n("milestones",o.id);for(const o of t.stories){n("stories",o.id);const r=i.get(o.stepId);if(r===void 0||r!==o.activityId)throw new Error(`story "${o.id}" references unknown activityId/stepId`);if(o.milestoneId!==void 0&&!a.has(o.milestoneId))throw new Error(`story "${o.id}" references unknown milestoneId "${o.milestoneId}"`)}return t},re=()=>({activities:[],milestones:[],stories:[]}),M=(e,t)=>{if(t!==void 0)return e.activities.find(i=>i.id===t)},K=(e,t)=>`${e}.${t}`,k=(e,t)=>{if(t===void 0)return;const i=Je(t,2);if(i){const[a,s]=i;if(a===void 0||s===void 0)return;const n=e.activities.find(r=>r.id===a),o=n?.steps.find(r=>r.id===s);return n&&o?{activity:n,step:o}:void 0}if(!t.includes("."))for(const a of e.activities){const s=a.steps.find(n=>n.id===t);if(s)return{activity:a,step:s}}},T=(e,t)=>{if(t!==void 0)return e.milestones.find(i=>i.id===t)},x=(e,t)=>{if(t!==void 0)return e.stories.find(i=>i.id===t)},J=e=>e.activities.flatMap(t=>t.steps.map(i=>({activity:t,step:i}))),kt=e=>({...e,stories:dt(e.stories,[t=>`${t.activityId}/${t.stepId}/${t.milestoneId??""}`])}),q=(e,t,i)=>e.stories.filter(a=>a.stepId===t&&(a.milestoneId??void 0)===i),de=(e,t,i)=>e.stories.filter(a=>a.activityId===t&&(a.milestoneId??void 0)===i),L=e=>[...e.activities.map(t=>t.id),...e.activities.flatMap(t=>t.steps.map(i=>i.id)),...e.milestones.map(t=>t.id),...e.stories.map(t=>t.id)],le=(e,t)=>e.stories.filter(i=>i.stepId===t).length,pe=(e,t)=>{const i=We(f,t);if(i===null)return null;const a=i.target.id;switch(i.type){case"SET_ACTIVITY_NAME":{const{name:s}=i.payload;return e.activities.some(n=>n.id===a)?{...e,activities:e.activities.map(n=>n.id===a?{...n,name:s}:n)}:null}case"SET_STEP_NAME":{const{name:s}=i.payload,n=k(e,a);return n?{...e,activities:e.activities.map(o=>o.id===n.activity.id?{...o,steps:o.steps.map(r=>r.id===n.step.id?{...r,name:s}:r)}:o)}:null}case"REORDER_STEP":{const{after:s}=i.payload,n=k(e,a);if(!n)return null;const o=s===null?null:k(e,s);if(s!==null&&(!o||o.activity.id!==n.activity.id))return null;const r=me(n.activity.steps,n.step.id,o?.step.id??null);return r===null?null:{...e,activities:e.activities.map(l=>l.id===n.activity.id?{...l,steps:r}:l)}}case"ADD_ACTIVITY":{const s=i.payload;return e.activities.some(n=>n.id===s.id)?e:{...e,activities:[...e.activities,{id:s.id,name:s.name,steps:[]}]}}case"ADD_STEP":{const s=i.payload,n=e.activities.find(o=>o.id===a);return n?n.steps.some(o=>o.id===s.id)?e:{...e,activities:e.activities.map(o=>o.id===a?{...o,steps:[...o.steps,{id:s.id,name:s.name}]}:o)}:null}case"DELETE_ACTIVITY":{const s=e.activities.find(o=>o.id===a);if(!s)return null;const n=new Set(s.steps.map(o=>o.id));return{...e,activities:e.activities.filter(o=>o.id!==a),stories:e.stories.filter(o=>o.activityId!==a&&!n.has(o.stepId))}}case"DELETE_STEP":{const s=k(e,a);return s?{...e,activities:e.activities.map(n=>n.id===s.activity.id?{...n,steps:n.steps.filter(o=>o.id!==s.step.id)}:n),stories:e.stories.filter(n=>n.activityId!==s.activity.id||n.stepId!==s.step.id)}:null}case"SET_STORY_NAME":{const{name:s}=i.payload;return W(e,a,n=>({...n,name:s}))}case"SET_STORY_DESCRIPTION":{const{description:s}=i.payload;return W(e,a,n=>({...n,description:s}))}case"SET_STORY_MILESTONE":{const{milestoneId:s}=i.payload;return s!==null&&!T(e,s)?null:W(e,a,n=>s===null?X(n):{...n,milestoneId:s})}case"MOVE_STORY":{const s=i.payload,n=x(e,a);if(!n)return null;const o=k(e,s.stepId);if(!o||o.activity.id!==s.activityId||s.milestoneId!==null&&!T(e,s.milestoneId))return null;const r=s.milestoneId??void 0,l=r===void 0?{...X(n),activityId:o.activity.id,stepId:o.step.id}:{...n,activityId:o.activity.id,stepId:o.step.id,milestoneId:r};return ce(e,l,s.after)}case"REORDER_STORY":{const{after:s}=i.payload,n=x(e,a);return n?ce(e,n,s,!0):null}case"ADD_STORY":{const s=i.payload,n=k(e,t.target.id);if(!n||n.activity.id!==s.activityId||s.milestoneId!==void 0&&!T(e,s.milestoneId))return null;if(e.stories.some(r=>r.id===s.id))return e;const o={id:s.id,name:s.name,activityId:s.activityId,stepId:n.step.id,...s.milestoneId===void 0?{}:{milestoneId:s.milestoneId}};return{...e,stories:[...e.stories,o]}}case"DELETE_STORY":return e.stories.some(s=>s.id===a)?{...e,stories:e.stories.filter(s=>s.id!==a)}:null;case"SET_MILESTONE_NAME":{const{name:s}=i.payload;return e.milestones.some(n=>n.id===a)?{...e,milestones:e.milestones.map(n=>n.id===a?{...n,name:s}:n)}:null}case"ADD_MILESTONE":{const s=i.payload;return e.milestones.some(n=>n.id===s.id)?e:{...e,milestones:[...e.milestones,{id:s.id,name:s.name}]}}case"DELETE_MILESTONE":return e.milestones.some(s=>s.id===a)?{...e,milestones:e.milestones.filter(s=>s.id!==a),stories:e.stories.map(s=>s.milestoneId===a?X(s):s)}:null;case"REORDER_MILESTONE":{const{after:s}=i.payload,n=me(e.milestones,a,s);return n===null?null:{...e,milestones:n}}default:return Xe(i)}},W=(e,t,i)=>e.stories.some(a=>a.id===t)?{...e,stories:e.stories.map(a=>a.id===t?i(a):a)}:null,X=e=>{const{milestoneId:t,...i}=e;return i},ce=(e,t,i,a=!1)=>{const s=t.milestoneId??void 0,n=e.stories.filter(m=>m.id!==t.id),o=n.filter(m=>m.stepId===t.stepId&&(m.milestoneId??void 0)===s);if(i!==null){const m=n.find($=>$.id===i);if(!m||m.stepId!==t.stepId||(m.milestoneId??void 0)!==s)return null;if(a){const $=x(e,t.id);if(!$||m.stepId!==$.stepId||(m.milestoneId??void 0)!==($.milestoneId??void 0))return null}}const r=i===null?[t,...o]:ue(o,t,i),l=n.findIndex(m=>m.stepId===t.stepId&&(m.milestoneId??void 0)===s),c=new Set(o.map(m=>m.id)),v=n.filter(m=>!c.has(m.id)),A=l<0?v.length:Math.min(l,v.length),I=[...v.slice(0,A),...r,...v.slice(A)];return{...e,stories:I}},me=(e,t,i)=>{if(!e.some(n=>n.id===t)||i!==null&&!e.some(n=>n.id===i))return null;if(i===t)return[...e];const a=e.find(n=>n.id===t);if(a===void 0)return null;const s=e.filter(n=>n.id!==t);return ue(s,a,i)},ue=(e,t,i)=>{const a=[...e],s=i===null?-1:a.findIndex(n=>n.id===i);return a.splice(s+1,0,t),a},j=Ze({en:{renameActivity:"Rename activity",renameStep:"Rename step",reorderStep:"Reorder step",addActivity:"Add activity",addStep:"Add step",deleteActivity:"Delete activity",deleteStep:"Delete step",renameStory:"Rename story",updateStoryDescription:"Update story description",changeMilestone:"Change milestone",moveStory:"Move story",reorderStory:"Reorder story",addStory:"Add story",deleteStory:"Delete story",renameMilestone:"Rename milestone",addMilestone:"Add milestone",deleteMilestone:"Delete milestone",reorderMilestone:"Reorder milestone",toValue:e=>`\u2192 \u201C${e}\u201D`,fromTo:(e,t)=>`\u201C${e}\u201D \u2192 \u201C${t}\u201D`,added:e=>`+ \u201C${e}\u201D`,removed:e=>`\u2212 \u201C${e}\u201D`,toFront:"\u2192 To the front",afterName:e=>`\u2192 Right after \u201C${e}\u201D`,toUnassigned:"\u2192 Unassigned",toName:e=>`\u2192 ${e}`,activityGroup:"Activity",stepGroup:"Step",storyGroup:"Story",milestoneGroup:"Milestone",mapGroup:"Map",targetLabel:(e,t)=>`${e} \xB7 ${t}`,targetMissing:(e,t)=>`${e} \xB7 ${t} (missing)`,wholeMap:"Whole map",unassigned:"Unassigned",emptyTitle:"No backbone yet",emptyBody:"Add activities and steps, and the story map appears here.",firstActivityButton:"+ First activity",groupingLabel:"Group by",groupViewTab:"Activity group",groupAxisHeader:"Activity group \u2192",activityAxis:"Activity \u2192",milestoneAxis:"Milestone \u2193",stepNameLabel:"Step name",activityNameLabel:"Activity name",milestoneNameLabel:"Milestone name",addStepAria:"Add a step to this activity",newActivityButton:"+ Activity",newMilestoneButton:"+ Milestone",addCellButton:"+ Add",addStoryCellAria:"Add a story to this cell",storyCount:e=>e===1?"1 story":`${e} stories`,pageTabsLabel:"Page",mapTab:"User Story Mapping",milestonesTab:"Milestones",milestonesLead:"What each release slice is for, and when it is due. The stories live on the map.",shareOfStories:e=>`${e}% of all stories`,coverageLabel:"Backbone coverage",coverage:(e,t)=>`${e} / ${t} steps`,storiesLabel:"Stories",timeframeUnset:"Timing not set",breakdownLabel:"By activity",breakdownItem:(e,t)=>`${e}: ${t} ${t===1?"story":"stories"}`,milestoneNoDescription:"No description yet.",noMilestonesTitle:"No milestones yet",noMilestonesBody:"Add a milestone to slice the map into releases.",commentCountAria:e=>e===1?"1 comment":`${e} comments`,moveDialogLabel:"Step to move to",moveDialogSelectLabel:"Destination",moveConfirm:"Move",moveCancel:"Cancel",storyNameLabel:"Story name",editTitleAria:"Edit title",commentAria:"Comment",deleteAria:"Delete",newActivityName:"New activity",newStepName:"New step",newMilestoneName:"New milestone",newStoryName:"New story"},ja:{renameActivity:"\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3\u540D\u3092\u5909\u66F4",renameStep:"\u30B9\u30C6\u30C3\u30D7\u540D\u3092\u5909\u66F4",reorderStep:"\u30B9\u30C6\u30C3\u30D7\u306E\u9806\u5E8F\u3092\u5909\u66F4",addActivity:"\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3\u3092\u8FFD\u52A0",addStep:"\u30B9\u30C6\u30C3\u30D7\u3092\u8FFD\u52A0",deleteActivity:"\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3\u3092\u524A\u9664",deleteStep:"\u30B9\u30C6\u30C3\u30D7\u3092\u524A\u9664",renameStory:"\u30B9\u30C8\u30FC\u30EA\u30FC\u540D\u3092\u5909\u66F4",updateStoryDescription:"\u30B9\u30C8\u30FC\u30EA\u30FC\u306E\u8AAC\u660E\u3092\u66F4\u65B0",changeMilestone:"\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3\u3092\u5909\u66F4",moveStory:"\u30B9\u30C8\u30FC\u30EA\u30FC\u3092\u79FB\u52D5",reorderStory:"\u30B9\u30C8\u30FC\u30EA\u30FC\u306E\u9806\u5E8F\u3092\u5909\u66F4",addStory:"\u30B9\u30C8\u30FC\u30EA\u30FC\u3092\u8FFD\u52A0",deleteStory:"\u30B9\u30C8\u30FC\u30EA\u30FC\u3092\u524A\u9664",renameMilestone:"\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3\u540D\u3092\u5909\u66F4",addMilestone:"\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3\u3092\u8FFD\u52A0",deleteMilestone:"\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3\u3092\u524A\u9664",reorderMilestone:"\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3\u306E\u9806\u5E8F\u3092\u5909\u66F4",toValue:e=>`\u2192 \u300C${e}\u300D`,fromTo:(e,t)=>`\u300C${e}\u300D\u2192\u300C${t}\u300D`,added:e=>`+ \u300C${e}\u300D`,removed:e=>`\u2212 \u300C${e}\u300D`,toFront:"\u2192 \u5148\u982D\u3078",afterName:e=>`\u2192 \u300C${e}\u300D\u306E\u76F4\u5F8C\u3078`,toUnassigned:"\u2192 \u672A\u5272\u5F53\u3078",toName:e=>`\u2192 ${e}`,activityGroup:"\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3",stepGroup:"\u30B9\u30C6\u30C3\u30D7",storyGroup:"\u30B9\u30C8\u30FC\u30EA\u30FC",milestoneGroup:"\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3",mapGroup:"\u30DE\u30C3\u30D7",targetLabel:(e,t)=>`${e} \xB7 ${t}`,targetMissing:(e,t)=>`${e} \xB7 ${t} (missing)`,wholeMap:"\u30DE\u30C3\u30D7\u5168\u4F53",unassigned:"\u672A\u5272\u5F53",emptyTitle:"\u30D0\u30C3\u30AF\u30DC\u30FC\u30F3\u304C\u307E\u3060\u3042\u308A\u307E\u305B\u3093",emptyBody:"\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3\u3068\u30B9\u30C6\u30C3\u30D7\u3092\u8FFD\u52A0\u3059\u308B\u3068\u3001\u3053\u3053\u306B\u30B9\u30C8\u30FC\u30EA\u30FC\u30DE\u30C3\u30D7\u304C\u73FE\u308C\u307E\u3059\u3002",firstActivityButton:"+ \u6700\u521D\u306E\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3",groupingLabel:"\u307E\u3068\u3081\u308B\u5358\u4F4D",groupViewTab:"\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3\u30B0\u30EB\u30FC\u30D7",groupAxisHeader:"\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3\u30B0\u30EB\u30FC\u30D7 \u2192",activityAxis:"\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3 \u2192",milestoneAxis:"\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3 \u2193",stepNameLabel:"\u30B9\u30C6\u30C3\u30D7\u540D",activityNameLabel:"\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3\u540D",milestoneNameLabel:"\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3\u540D",addStepAria:"\u3053\u306E\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3\u306B\u30B9\u30C6\u30C3\u30D7\u3092\u8FFD\u52A0",newActivityButton:"+ \u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3",newMilestoneButton:"+ \u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3",addCellButton:"+ \u8FFD\u52A0",addStoryCellAria:"\u3053\u306E\u30DE\u30B9\u306B\u30B9\u30C8\u30FC\u30EA\u30FC\u3092\u8FFD\u52A0",storyCount:e=>`${e} \u30B9\u30C8\u30FC\u30EA\u30FC`,pageTabsLabel:"\u30DA\u30FC\u30B8",mapTab:"User Story Mapping",milestonesTab:"\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3",milestonesLead:"\u30EA\u30EA\u30FC\u30B9\u306E\u533A\u5207\u308A\u3054\u3068\u306E\u76EE\u7684\u3068\u6642\u671F\u3002\u30B9\u30C8\u30FC\u30EA\u30FC\u306F\u30DE\u30C3\u30D7\u3067\u6271\u3044\u307E\u3059\u3002",shareOfStories:e=>`\u5168\u30B9\u30C8\u30FC\u30EA\u30FC\u306E ${e}%`,coverageLabel:"\u30D0\u30C3\u30AF\u30DC\u30FC\u30F3\u306E\u7DB2\u7F85",coverage:(e,t)=>`${e} / ${t} \u30B9\u30C6\u30C3\u30D7`,storiesLabel:"\u30B9\u30C8\u30FC\u30EA\u30FC",timeframeUnset:"\u6642\u671F\u672A\u5B9A",breakdownLabel:"\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3\u5225",breakdownItem:(e,t)=>`${e}: ${t} \u30B9\u30C8\u30FC\u30EA\u30FC`,milestoneNoDescription:"\u8AAC\u660E\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",noMilestonesTitle:"\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3\u304C\u307E\u3060\u3042\u308A\u307E\u305B\u3093",noMilestonesBody:"\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3\u3092\u8FFD\u52A0\u3059\u308B\u3068\u3001\u30DE\u30C3\u30D7\u3092\u30EA\u30EA\u30FC\u30B9\u3054\u3068\u306B\u533A\u5207\u308C\u307E\u3059\u3002",commentCountAria:e=>`\u30B3\u30E1\u30F3\u30C8 ${e} \u4EF6`,moveDialogLabel:"\u79FB\u52D5\u5148\u306E\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3",moveDialogSelectLabel:"\u79FB\u52D5\u5148",moveConfirm:"\u79FB\u52D5\u3059\u308B",moveCancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",storyNameLabel:"\u30B9\u30C8\u30FC\u30EA\u30FC\u540D",editTitleAria:"\u30BF\u30A4\u30C8\u30EB\u3092\u7DE8\u96C6",commentAria:"\u30B3\u30E1\u30F3\u30C8",deleteAria:"\u524A\u9664",newActivityName:"\u65B0\u3057\u3044\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3",newStepName:"\u65B0\u3057\u3044\u30B9\u30C6\u30C3\u30D7",newMilestoneName:"\u65B0\u3057\u3044\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3",newStoryName:"\u65B0\u3057\u3044\u30B9\u30C8\u30FC\u30EA\u30FC"}}),ge=e=>e.tab==="milestones"?"milestones":"map",F=(e,t,i)=>{const a=typeof i=="string"?i:"",s=typeof t=="string"?t:void 0;return s===void 0?e.toValue(a):e.fromTo(s,a)},Z=(e,t)=>typeof t=="string"?e.afterName(t):e.toFront,xt={SET_ACTIVITY_NAME:(e,t,i)=>({title:e.renameActivity,tone:"update",body:F(e,M(i,t.target.id)?.name,b(f.SET_ACTIVITY_NAME,t).name??"")}),SET_STEP_NAME:(e,t,i)=>({title:e.renameStep,tone:"update",body:F(e,k(i,t.target.id)?.step.name,b(f.SET_STEP_NAME,t).name??"")}),REORDER_STEP:(e,t)=>({title:e.reorderStep,tone:"move",body:Z(e,b(f.REORDER_STEP,t).after)}),ADD_ACTIVITY:(e,t)=>({title:e.addActivity,tone:"create",body:e.added(String(b(f.ADD_ACTIVITY,t).name??""))}),ADD_STEP:(e,t)=>({title:e.addStep,tone:"create",body:e.added(String(b(f.ADD_STEP,t).name??""))}),DELETE_ACTIVITY:(e,t,i)=>({title:e.deleteActivity,tone:"delete",body:e.removed(M(i,t.target.id)?.name??t.target.id)}),DELETE_STEP:(e,t,i)=>({title:e.deleteStep,tone:"delete",body:e.removed(k(i,t.target.id)?.step.name??t.target.id)}),SET_STORY_NAME:(e,t,i)=>({title:e.renameStory,tone:"update",body:F(e,x(i,t.target.id)?.name,b(f.SET_STORY_NAME,t).name??"")}),SET_STORY_DESCRIPTION:(e,t)=>({title:e.updateStoryDescription,tone:"update",body:e.toValue(String(b(f.SET_STORY_DESCRIPTION,t).description??"").slice(0,90))}),SET_STORY_MILESTONE:(e,t,i)=>{const a=b(f.SET_STORY_MILESTONE,t).milestoneId;return{title:e.changeMilestone,tone:"move",body:a==null?e.toUnassigned:e.toName(T(i,String(a))?.name??String(a))}},MOVE_STORY:(e,t,i)=>({title:e.moveStory,tone:"move",body:e.toName(k(i,String(b(f.MOVE_STORY,t).stepId))?.step.name??String(b(f.MOVE_STORY,t).stepId??""))}),REORDER_STORY:(e,t)=>({title:e.reorderStory,tone:"move",body:Z(e,b(f.REORDER_STORY,t).after)}),ADD_STORY:(e,t)=>({title:e.addStory,tone:"create",body:e.added(String(b(f.ADD_STORY,t).name??""))}),DELETE_STORY:(e,t,i)=>({title:e.deleteStory,tone:"delete",body:e.removed(x(i,t.target.id)?.name??t.target.id)}),SET_MILESTONE_NAME:(e,t,i)=>({title:e.renameMilestone,tone:"update",body:F(e,T(i,t.target.id)?.name,b(f.SET_MILESTONE_NAME,t).name??"")}),ADD_MILESTONE:(e,t)=>({title:e.addMilestone,tone:"create",body:e.added(String(b(f.ADD_MILESTONE,t).name??""))}),DELETE_MILESTONE:(e,t,i)=>({title:e.deleteMilestone,tone:"delete",body:e.removed(T(i,t.target.id)?.name??t.target.id)}),REORDER_MILESTONE:(e,t)=>({title:e.reorderMilestone,tone:"move",body:Z(e,b(f.REORDER_MILESTONE,t).after)})},ve=(e,t,i,a)=>{let s;try{const n=xt[t.type];s=n?n(e,t,a??i):{title:t.type,tone:"meta"}}catch{s={title:t.type,tone:"meta"}}return{title:s.title,targetLabel:ye(e,i,t.target),tone:s.tone,...s.body===void 0?{}:{summary:s.body}}},he=e=>`${e.type} ${_(e.target)} ${JSON.stringify(e.payload)}`,ye=(e,t,i)=>{try{switch(i.type){case"activity":{const a=M(t,i.id);return a?e.targetLabel(e.activityGroup,a.name):e.targetMissing(e.activityGroup,i.id)}case"step":{const a=k(t,i.id)?.step;return a?e.targetLabel(e.stepGroup,a.name):e.targetMissing(e.stepGroup,i.id)}case"story":{const a=x(t,i.id);return a?e.targetLabel(e.storyGroup,a.name):e.targetMissing(e.storyGroup,i.id)}case"milestone":{const a=T(t,i.id);return a?e.targetLabel(e.milestoneGroup,a.name):e.targetMissing(e.milestoneGroup,i.id)}case"page":return e.targetLabel(e.mapGroup,Q(t));default:return`${i.type} \xB7 ${i.id}`}}catch{return`${i.type} \xB7 ${i.id}`}},fe=(e,t,i)=>{const a=[{value:"page:usm",label:e.wholeMap,group:e.mapGroup}];for(const s of t.activities){a.push({value:_({type:"activity",id:s.id}),label:s.name,group:e.activityGroup});for(const n of s.steps)a.push({value:_({type:"step",id:K(s.id,n.id)}),label:`${s.name} \u203A ${n.name}`,group:e.stepGroup})}for(const s of t.milestones)a.push({value:_({type:"milestone",id:s.id}),label:s.name,group:e.milestoneGroup});for(const s of t.stories)a.push({value:_({type:"story",id:s.id}),label:s.name,group:e.storyGroup});return a},be=(e,t,i)=>{const a=t.stories.find(s=>s.id===i.story);if(a)return{value:_({type:"story",id:a.id}),label:a.name,group:e.storyGroup};for(const s of t.activities){const n=s.steps.find(o=>o.id===i.step);if(n)return{value:_({type:"step",id:K(s.id,n.id)}),label:n.name,group:e.stepGroup}}return null},Q=e=>e.title??"User Story Mapping",ke=(e,t)=>{const i=k(e,t.step),a=i?.activity??M(e,t.activity)??e.activities[0],s=i?.step??a?.steps.find(r=>r.id===t.step)??a?.steps[0],n=x(e,t.story),o={...t};return a?o.activity=a.id:delete o.activity,s?o.step=s.id:delete o.step,n?o.story=n.id:delete o.story,o.view=t.view==="group"?"group":"activity",ge(t)==="milestones"?o.tab="milestones":delete o.tab,o},xe=(e,t)=>{switch(t.type){case"activity":return M(e,t.id)!==void 0;case"step":return k(e,t.id)!==void 0;case"story":return x(e,t.id)!==void 0;case"milestone":return T(e,t.id)!==void 0;case"page":return!0;default:return!1}},we=e=>{const t=j(e);return{name:"usm",label:"User Story Mapping",parseBase:oe,emptyBase:re,actions:f,apply:pe,canonicalState:kt,hasTarget:xe,canonicalTarget:(i,a)=>{if(a.type!=="step")return a;const s=k(i,a.id);return s?{...a,id:K(s.activity.id,s.step.id)}:a},describe:(i,a,s)=>ve(t,i,a,s),serialize:he,resolveNavigation:ke,commentTargets:(i,a)=>fe(t,i),currentTarget:(i,a)=>be(t,i,a),title:Q}},wt={width:300,height:260},$t=te`
|
|
2
2
|
/*
|
|
3
3
|
* The card takes its activity's tone (--usm-tone, set by the map) over its
|
|
4
4
|
* whole surface, like a sticky note of that activity's color: a tinted face
|
|
@@ -211,7 +211,7 @@ import{p as h,aq as y,v as G,av as O,af as p,aw as R,ah as u,ai as g,ay as N,ab
|
|
|
211
211
|
</button>
|
|
212
212
|
</div>
|
|
213
213
|
${s?this.#n():w}
|
|
214
|
-
`}#n(){return pt(mt(this.#a.locale),ct(this.#t,this.notes.map(st)),t=>{t.kind==="input"?(this.#t=t.body,this.requestUpdate()):this.#e(t)})}#i(t){return i=>{i.stopPropagation(),this.#e(t)}}#e(t){this.onIntent?.(t)}}const St=()=>{customElements.get("dpk-internal-usm-story-card")||customElements.define("dpk-internal-usm-story-card",Et)},Tt=(e,t,i)=>{const a=e.at(-1)??null;if(t===null||i==="end")return a;const s=e.indexOf(t);return s<0?a:i==="after"?t:s===0?null:e.at(s-1)??null},$e=(e,t,i,a,s)=>{const n=q(e,t.stepId,t.milestoneId).map(o=>o.id);return{type:"MOVE_STORY",target:{type:"story",id:i},payload:{activityId:t.activityId,stepId:t.stepId,milestoneId:t.milestoneId??null,after:H(n,i,a,s)}}},Ee=(e,t,i,a,s,n)=>{const o=x(e,a);if(!o||o.activityId!==t)return null;const r=de(e,t,i).map(l=>l.id);return{type:"MOVE_STORY",target:{type:"story",id:a},payload:{activityId:t,stepId:o.stepId,milestoneId:i??null,after:H(r,a,s,n)}}},Se=(e,t,i,a,s)=>{const n=q(e,a,s).filter(o=>o.id!==t);return{type:"MOVE_STORY",target:{type:"story",id:t},payload:{activityId:i,stepId:a,milestoneId:s??null,after:n.at(-1)?.id??null}}},Te=(e,t,i,a)=>e.includes(t)?{type:"REORDER_MILESTONE",target:{type:"milestone",id:t},payload:{after:H(e,t,i,a)}}:null,It=e=>{const t=e.stories.length,i=
|
|
214
|
+
`}#n(){return pt(mt(this.#a.locale),ct(this.#t,this.notes.map(st),this.story?{key:`story:${this.story.id}`}:{}),t=>{t.kind==="input"?(this.#t=t.body,this.requestUpdate()):this.#e(t)})}#i(t){return i=>{i.stopPropagation(),this.#e(t)}}#e(t){this.onIntent?.(t)}}const St=()=>{customElements.get("dpk-internal-usm-story-card")||customElements.define("dpk-internal-usm-story-card",Et)},Tt=(e,t,i)=>{const a=e.at(-1)??null;if(t===null||i==="end")return a;const s=e.indexOf(t);return s<0?a:i==="after"?t:s===0?null:e.at(s-1)??null},$e=(e,t,i,a,s)=>{const n=q(e,t.stepId,t.milestoneId).map(o=>o.id);return{type:"MOVE_STORY",target:{type:"story",id:i},payload:{activityId:t.activityId,stepId:t.stepId,milestoneId:t.milestoneId??null,after:H(n,i,a,s)}}},Ee=(e,t,i,a,s,n)=>{const o=x(e,a);if(!o||o.activityId!==t)return null;const r=de(e,t,i).map(l=>l.id);return{type:"MOVE_STORY",target:{type:"story",id:a},payload:{activityId:t,stepId:o.stepId,milestoneId:i??null,after:H(r,a,s,n)}}},Se=(e,t,i,a,s)=>{const n=q(e,a,s).filter(o=>o.id!==t);return{type:"MOVE_STORY",target:{type:"story",id:t},payload:{activityId:i,stepId:a,milestoneId:s??null,after:n.at(-1)?.id??null}}},Te=(e,t,i,a)=>e.includes(t)?{type:"REORDER_MILESTONE",target:{type:"milestone",id:t},payload:{after:H(e,t,i,a)}}:null,It=e=>{const t=e.stories.length,i=J(e);return e.milestones.map((a,s)=>{const n=e.stories.filter(r=>r.milestoneId===a.id),o=new Set(n.map(r=>r.stepId));return{id:a.id,ordinal:s+1,name:a.name,timeframe:a.timeframe?.trim()??"",description:a.description?.trim()??"",storyCount:n.length,share:t===0?0:n.length/t,coverage:{covered:i.filter(({step:r})=>o.has(r.id)).length,total:i.length},breakdown:e.activities.flatMap(r=>{const l=n.filter(c=>c.activityId===r.id).length;return l===0?[]:[{activityId:r.id,name:r.name,count:l}]})}})},Ie=["blue","violet","green","amber","accent"],V=e=>new Map(e.activities.map((t,i)=>[t.id,Ie[i%Ie.length]??"blue"])),Ae=(e,t)=>{const i=P("new-activity",L(t.state));if(!t.dispatch({type:"ADD_ACTIVITY",target:{type:"page",id:"usm"},payload:{id:i,name:e.newActivityName}}).ok)return;const s=P("new-step",[...L(t.state),i]);t.dispatch({type:"ADD_STEP",target:{type:"activity",id:i},payload:{id:s,name:e.newStepName}}),t.navigate({activity:i,step:null,story:null})},At=(e,t,i)=>{const a=P("new-step",L(t.state));t.dispatch({type:"ADD_STEP",target:{type:"activity",id:i},payload:{id:a,name:e.newStepName}})},_e=(e,t)=>{const i=P("new-milestone",L(t.state));t.dispatch({type:"ADD_MILESTONE",target:{type:"page",id:"usm"},payload:{id:i,name:e.newMilestoneName}})},Me=(e,t,i,a,s)=>{const n=P("new-story",L(t.state));t.dispatch({type:"ADD_STORY",target:{type:"step",id:a},payload:{id:n,name:e.newStoryName,activityId:i,...s===void 0?{}:{milestoneId:s}}}).ok&&t.navigate({activity:i,step:a,story:n})},D={kind:"idle"},ee=(e,t)=>e.kind!=="idle"&&e.storyId===t,De=(e,t)=>ee(e,t)&&(e.kind==="editing"||e.kind==="commenting")?e.kind:"view",Oe=(e,t,i)=>{switch(i.kind){case"toggle-edit":return e.kind==="editing"&&e.storyId===t?D:{kind:"editing",storyId:t};case"toggle-comment":return e.kind==="commenting"&&e.storyId===t?D:{kind:"commenting",storyId:t};case"rename":case"comment":case"dismiss":case"delete":return ee(e,t)?D:e;case"select":return e}},C=e=>`--usm-tone: var(--dpk-${e??"blue"})`,Re=(e,t)=>{const i=a=>t.stories.filter(s=>s.milestoneId===a).length;return[...t.milestones.map(({id:a,name:s,timeframe:n})=>({id:a,name:s,timeframe:n?.trim()??"",storyCount:i(a)})),{id:void 0,name:e.unassigned,timeframe:"",storyCount:i(void 0)}]},_t=(e,t)=>d`
|
|
215
215
|
<div class="empty">
|
|
216
216
|
<h2>${e.emptyTitle}</h2>
|
|
217
217
|
<p>${e.emptyBody}</p>
|
|
@@ -219,7 +219,7 @@ import{p as h,aq as y,v as G,av as O,af as p,aw as R,ah as u,ai as g,ay as N,ab
|
|
|
219
219
|
${e.firstActivityButton}
|
|
220
220
|
</button>
|
|
221
221
|
</div>
|
|
222
|
-
`,Mt=e=>{const{m:t,context:i}=e,a=
|
|
222
|
+
`,Mt=e=>{const{m:t,context:i}=e,a=J(i.state);return a.length===0?_t(t,i):Ne(i)==="activity"?Ot(e,a):Rt(e)},Ne=e=>e.navigation.view==="group"?"group":"activity",Dt=(e,t)=>{const i=Ne(t);return d`<div class="segmented view-tabs" role="tablist" aria-label=${e.groupingLabel}>
|
|
223
223
|
${Le(t,"activity",i,e.activityGroup)}
|
|
224
224
|
${Le(t,"group",i,e.groupViewTab)}
|
|
225
225
|
</div>`},Le=(e,t,i,a)=>{const s=t===i;return d`<a
|
|
@@ -1249,4 +1249,4 @@ import{p as h,aq as y,v as G,av as O,af as p,aw as R,ah as u,ai as g,ay as N,ab
|
|
|
1249
1249
|
${Ut(i,t,a)}
|
|
1250
1250
|
${a==="milestones"?Pt(i,t,It(t.state)):this.#n(i,t)}
|
|
1251
1251
|
${zt(i,t,this.mode,{confirm:s=>this.#d(s),cancel:()=>this.mode=D})}
|
|
1252
|
-
`}#n(t,i){return Mt({m:t,context:i,mode:this.mode,drag:this.#t,handlers:{cardIntent:(a,s)=>this.#i(a,s),dropOnCell:(a,s)=>this.#e(a,s),dropOnGroupCell:(a,s,n)=>this.#o(a,s,n),dropOnMilestoneRow:(a,s)=>this.#r(a,s)}})}#i(t,i){const a=this.context();switch(i.kind){case"select":{const s=x(a.state,t);s&&a.navigate({step:s.stepId,story:s.id});break}case"rename":a.dispatch({type:"SET_STORY_NAME",target:{type:"story",id:t},payload:{name:i.name}});break;case"comment":a.dispatch({type:"comment",target:`story:${t}`,payload:{body:i.body}});break;case"delete":a.dispatch({type:"DELETE_STORY",target:{type:"story",id:t},payload:{}});break}this.mode=Oe(this.mode,t,i)}#e(t,i){const a=this.context();a.dispatch($e(a.state,t,i.item.id,i.hoveredId,i.place))}#o(t,i,a){const s=this.context(),n=x(s.state,a.item.id);if(!n)return;if(n.activityId!==t){this.mode={kind:"picking-step",storyId:n.id,activityId:t,milestoneId:i,point:{x:a.event.clientX,y:a.event.clientY}};return}const o=Ee(s.state,t,i,n.id,a.hoveredId,a.place);o&&s.dispatch(o)}#r(t,i){const a=this.context(),s=a.state.milestones.map(o=>o.id),n=Te(s,i.item.id,i.hoveredId,i.place);n&&a.dispatch(n)}#d(t){const i=this.mode;if(i.kind!=="picking-step")return;const a=this.context();a.dispatch(Se(a.state,i.storyId,i.activityId,t,i.milestoneId)),this.mode=D}}const Fe=()=>{St(),customElements.get("dpk-template-usm")||customElements.define("dpk-template-usm",je)},Ft=Object.freeze(Object.defineProperty({__proto__:null,DpkTemplateUsm:je,IDLE_MODE:D,allUsmIds:L,applyUsmAction:pe,cardModeOf:De,defineUsmElement:Fe,describeUsmAction:ve,dropAfter:Tt,emptyUsmBase:re,findActivity:M,findMilestone:T,findStep:k,findStory:x,flatSteps:
|
|
1252
|
+
`}#n(t,i){return Mt({m:t,context:i,mode:this.mode,drag:this.#t,handlers:{cardIntent:(a,s)=>this.#i(a,s),dropOnCell:(a,s)=>this.#e(a,s),dropOnGroupCell:(a,s,n)=>this.#o(a,s,n),dropOnMilestoneRow:(a,s)=>this.#r(a,s)}})}#i(t,i){const a=this.context();switch(i.kind){case"select":{const s=x(a.state,t);s&&a.navigate({step:s.stepId,story:s.id});break}case"rename":a.dispatch({type:"SET_STORY_NAME",target:{type:"story",id:t},payload:{name:i.name}});break;case"comment":a.dispatch({type:"comment",target:`story:${t}`,payload:{body:i.body}});break;case"delete":a.dispatch({type:"DELETE_STORY",target:{type:"story",id:t},payload:{}});break}this.mode=Oe(this.mode,t,i)}#e(t,i){const a=this.context();a.dispatch($e(a.state,t,i.item.id,i.hoveredId,i.place))}#o(t,i,a){const s=this.context(),n=x(s.state,a.item.id);if(!n)return;if(n.activityId!==t){this.mode={kind:"picking-step",storyId:n.id,activityId:t,milestoneId:i,point:{x:a.event.clientX,y:a.event.clientY}};return}const o=Ee(s.state,t,i,n.id,a.hoveredId,a.place);o&&s.dispatch(o)}#r(t,i){const a=this.context(),s=a.state.milestones.map(o=>o.id),n=Te(s,i.item.id,i.hoveredId,i.place);n&&a.dispatch(n)}#d(t){const i=this.mode;if(i.kind!=="picking-step")return;const a=this.context();a.dispatch(Se(a.state,i.storyId,i.activityId,t,i.milestoneId)),this.mode=D}}const Fe=()=>{St(),customElements.get("dpk-template-usm")||customElements.define("dpk-template-usm",je)},Ft=Object.freeze(Object.defineProperty({__proto__:null,DpkTemplateUsm:je,IDLE_MODE:D,allUsmIds:L,applyUsmAction:pe,cardModeOf:De,defineUsmElement:Fe,describeUsmAction:ve,dropAfter:Tt,emptyUsmBase:re,findActivity:M,findMilestone:T,findStep:k,findStory:x,flatSteps:J,modeConcerns:ee,parseUsmBase:oe,reduceCardIntent:Oe,resolveCellDrop:$e,resolveGroupDrop:Ee,resolveMilestoneDrop:Te,resolvePickedStepMove:Se,resolveUsmNavigation:ke,serializeUsmAction:he,storiesInCell:q,storyCountForStep:le,usmAction:gt,usmActions:f,usmCommentTargets:fe,usmCurrentTarget:be,usmDefinitionFor:we,usmHasTarget:xe,usmMessages:j,usmTargetLabel:ye,usmTitle:Q},Symbol.toStringTag,{value:"Module"}));export{Fe as d,Ft as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{aP as t,aQ as a,a3 as i,aR as n}from"./shared-B_MMP97h.js";const o=t(class extends a{constructor(){super(...arguments),this.key=i}render(s,e){return this.key=s,e}update(s,[e,r]){return e!==this.key&&(n(s),this.key=e),r}});export{o as i};
|